eslint_fixes #3

Merged
vbuglov merged 3 commits from eslint_fixes into master 2024-04-02 15:10:34 +00:00
57 changed files with 255 additions and 316 deletions
Showing only changes of commit 70cb21c9af - Show all commits

View File

@ -196,11 +196,11 @@ const setTooltip = (map, coordinates, machine, tooltip_id, content_id, closer_id
tooltipText.classList.add(content_id)
if (feature) {
const container = tooltip.getElement();
const props = feature.getProperties()
const container = tooltip.getElement()
// const props = feature.getProperties()
const coordsFormated = feature.getGeometry()
const coordsFormat = feature.getGeometry().getFlatCoordinates()
// const coordsFormated = feature.getGeometry()
// const coordsFormat = feature.getGeometry().getFlatCoordinates()
// const hdms = toLonLat(coordinates)
@ -228,12 +228,9 @@ const setTooltip = (map, coordinates, machine, tooltip_id, content_id, closer_id
});
map.on('pointermove', function (e) {
const pixel = map.getEventPixel(e.originalEvent);
const hit = map.hasFeatureAtPixel(pixel);
// console.log('hit', hit)
// console.log('pixel', pixel)
// console.log('map', map)
// map.getTarget().style.cursor = hit ? 'pointer' : '';
const pixel = map.getEventPixel(e.originalEvent)
const hit = map.hasFeatureAtPixel(pixel)
map.getTarget().style.cursor = hit ? 'pointer' : ''
})
onClose.addEventListener('click', onClosed)

View File

@ -39,7 +39,7 @@ export default {
enableTime: this.enableTime,
dateFormat: this._dateFormat,
locale: Russian,
onChange: (a,_b,_c) => {
onChange: (a) => {
this.onchange(a[0])
}
});

View File

@ -5,11 +5,10 @@ import {
sorter,
renderGroupHeader,
groupByFunction,
makedFiltering,
tablefy
} from "./helper";
import localization from "./localization";
import { cond, equals, is, mergeAll, sort, T, mergeDeepRight } from "ramda";
import { is, sort, mergeDeepRight } from "ramda";
import { pipe } from "@helpers/functions";
import Pagination from "./VTabulatorPagination.vue";
@ -116,7 +115,7 @@ export default {
data: this.data,
groupStartOpen: false,
groupHeader: function (value, count, data, group) {
groupHeader: function (value, count) {
return value + "<span>(" + count + " записей)</span>";
},
};

View File

@ -1,10 +1,9 @@
<script>
import {mapGetters, mapMutations, mapActions, useStore} from "vuex"
import { validation } from './helper'
import { Alert } from "@store/hooks/Alert"
export default {
name: 'Pagination',
name: 'TabulatorPagination',
components: {
},
props: {
@ -24,8 +23,8 @@ export default {
},
watch: {
params: {
handler(value, oldValue) {
if(value) {
handler(newValue) {
if(newValue) {
const loader = document.querySelector(`#table_loder_${this.params.id}`)
loader.style.display = 'none'
}
@ -37,7 +36,7 @@ export default {
},
methods: {
selectOptions: (selectOption, paginationOptions) => {
const options = selectOption ? selectOption : optionsDefault
const options = selectOption ? selectOption : []
const currentOptions = options.filter((el) => {
if(el <= Math.ceil(paginationOptions.total / 10) * 10) {
return el

View File

@ -1,4 +1,4 @@
import { always, cond, equals, is, T, mergeLeft } from "ramda";
import { always, cond, equals, is, T, pipe, mergeLeft } from "ramda";
import Handlebars from "handlebars/dist/cjs/handlebars";
import moment from "moment";
import presetConfig from './presetConfig'
@ -20,7 +20,7 @@ const tablefy = (list = []) => {
return list.map((el) => mergeLeft(el, defaultData(el?.title || "")))
}
const math = (value, operator, operand, options) => {
const math = (value, operator, operand) => {
var left = parseFloat(value);
var right = parseFloat(operand);
@ -138,7 +138,8 @@ const link = (col) => ({
[
"from_list",
(list, param_string) => {
const [key, value] = param_string.split(",")
return list.find(el => el[key] === value)
}
],
[
@ -334,9 +335,9 @@ const makedFiltering = (id, filterParams, selectedFilter, clearFilters) => {
const validation = (value, pagination) => {
const pipe = (...fns) => (...x) => fns.reduce((error, validator) => error || validator(...x), undefined)
const required = value => {
return value ? undefined : "*"
}
// const required = value => {
// return value ? undefined : "*"
// }
const minPage = length => value => {
value = value.replace(/\s+/g, '')
return value >= length ? undefined : `Номер страницы должен быть больше или равен ${length}`

View File

@ -1,52 +1,5 @@
import { cond, T } from "ramda";
const text = `
0 Конфигурация не установлена (по умолчанию)
1 Стандартная конфигурация МРТ (МПТ/АВФ)
2 Стандартная конфигурация ЖДСМ
3 Стандартная конфигурация УК/ВПО
4 ЩОМ/РМ (Акселерометр)
5 СМ (Сибирский ПГУПС)
6 СМ (зарезервировано)
7 Эмуляция платы БКП
8 Конфигурация Блок-М
40 Эмуляторы
41 Эмуляторы (CAN1 + CAN2 (Блок-М) + ModBus
50 Стандартная конфигурация ModBus Master (опрос внешних устройств)
51 Стандартная конфигурация ModBus Master (опрос плат АС КРСПС)
52 Конфигурация трекера (электрички и т.п.)
53 Конфигурация трекер + счетчик импульсов + акселерометр
54 РадарП
55 СДРГО
100 ПМА-1М РПМ
101 ЩОМ-1400 РПМ
102 АМ-140 СКРТ РПМ
103 АС-01 РПМ
104 ТЭС ПСС-1К РПМ
105 ПСС-2П РПМ
200 РПБ-01 ВНИКТИ
201 МПК Спецлоко
202 УК 25/25 ВНИКТИ
203 СЗ-800 ВНИКТИ
300 ЩОМ-1200С ТЖДМ
301 ЩОМ-2000 ТЖДМc
302 ССГС-1 ТЖДМ
303 ВПО-С ТЖДМ
304 МПВ ТЖДМ
305 УПК ТЖДМ
306 ПРЛ-М ТЖДМ
307 РУ-700 ТЖДМ
308 МПВ Секция 2 ТЖДМ
1911 Конфигурация для отладки
4096 Настраиваемая конфигурация
`
//TODO SERGEY
const parse = () => {
text
return {}
}
const get_f1_preset = (el) => {
const r = {
0: "Конфигурация не установлена (по умолчанию)",

View File

@ -8,10 +8,8 @@ import {
propEq,
findIndex,
update,
is,
cond,
T,
isNil
} from "ramda";
let getPackSettings = (userId, page, packStructId, func) => {
@ -30,7 +28,7 @@ let getPackSettings = (userId, page, packStructId, func) => {
}
};
const prepDiscretes = (from, to, arr) =>
const prepDiscretes = (from, to) =>
range(from, to + 1).map((el) => ({
title: el,
dataIndex: `disc${el}`,
@ -79,17 +77,14 @@ const withCustomSettings = (_columns, requestSettings) => {
let columns = _columns
if (requestSettings?.colors?.isOn) {
}
if (requestSettings?.colors?.isOn) {
let colors = requestSettings.colors.list.filter((el) => el.isOn);
colors = groupBy((c) => c.param)(colors);
coloredParams = Object.keys(colors);
let colors = requestSettings.colors.list.filter((el) => el.isOn)
colors = groupBy((c) => c.param)(colors)
const coloredParams = Object.keys(colors)
columns = columns.map((el) => {
if (coloredParams.includes(el.dataIndex)) {
return {
...el,
onCell: (data, index) => {
onCell: (data) => {
let colrSettings = colors[el.dataIndex];
let value = data[el.dataIndex];
let color = find(({ from, untill }) =>
@ -147,23 +142,22 @@ const withCustomSettings = (_columns, requestSettings) => {
}
}
return columns;
return columns
};
const fetch_sorter_field = (sorter, req_params) => {
const date_param = req_params?.settings?.date_param
return cond([
[() => sorter?.field, () => sorter.field],
[is(Array), field_from_arr(sorter, date_param)],
[isNil, () => date_param],
])(sorter)
}
const field_from_arr = (sorter, date_param) => () => {
const field = sorter.find((el) => `${el?.field}`.includes("dt"))?.field
return field || date_param
}
// const fetch_sorter_field = (sorter, req_params) => {
// const date_param = req_params?.settings?.date_param
// return cond([
// [() => sorter?.field, () => sorter.field],
// [is(Array), field_from_arr(sorter, date_param)],
// [isNil, () => date_param],
// ])(sorter)
// }
// const field_from_arr = (sorter, date_param) => () => {
// const field = sorter.find((el) => `${el?.field}`.includes("dt"))?.field
// return field || date_param
// }
const get_f1_preset = (el) => {
const r = {

View File

@ -1,4 +1,3 @@
import { parse } from "handlebars/dist/cjs/handlebars/compiler/base";
import { cond, T, isEmpty } from "ramda";
const setPackColumns = (name) => {
@ -163,6 +162,7 @@ const prepareSetPackColumns = (name, data) => {
if (data.length === 0) {
return []
}
break
case 'raw':
return setPackColumns('Сырые')
case 'unrecognized':

View File

@ -1,5 +1,5 @@
<script>
import {mapGetters, mapMutations, mapActions, useStore} from "vuex"
import {mapGetters, mapActions} from "vuex"
export default {
name: 'PackViewButton',
@ -28,7 +28,7 @@ export default {
},
idx: {
type: Number,
default: ""
default: 0
}
},
computed: {

View File

@ -1,5 +1,5 @@
<script>
import {mapGetters, mapMutations, mapActions, useStore} from "vuex"
import {mapGetters, mapActions} from "vuex"
import PackViewButton from './Button.vue'
import Spinner from "@molecules/VSpinner/VSpinner.vue"
import Tabulator from "@molecules/VTabulator/VTabulator.vue"
@ -36,13 +36,6 @@ export default {
hasData: false
}
},
updated () {
this.$nextTick(function () {
if (!isEmpty(this.packData)) {
this.hasData = true
}
})
},
computed: {
...mapGetters('machines', ['packData', 'selectPackStructs', 'selectedPackStruct']),
buttonsData: () =>
@ -52,6 +45,13 @@ export default {
{mode: 'unrecognized', isActive: false, name: 'switch_unrecognized', inner: 'нераспознанные', labelClass: 'rounded-r-lg border'},
])
},
updated () {
this.$nextTick(function () {
if (!isEmpty(this.packData)) {
this.hasData = true
}
})
},
methods: {
...mapActions('machines', ['updateSelectStruct']),
updateSelectedValue: function (e) {
@ -100,6 +100,7 @@ export default {
<div class="col-span-12 sm:col-span-8 md:col-span-7 lg:col-span-7 2xl:col-span-5 flex justify-center">
<PackViewButton
v-for="(button, idx) in buttonsData"
:key="idx"
:idx="idx"
:mode="button.mode"
:name="button.name"

View File

@ -1,5 +1,4 @@
<script>
import {mapGetters} from 'vuex'
import { createIcons, icons } from "lucide";
export default {

View File

@ -2,7 +2,7 @@
import Login from './Login.vue'
export default {
name: 'Auth',
name: 'AuthPage',
components: {
Login
},

View File

@ -1,10 +1,9 @@
<script>
import TaskModal from './TaskModal.vue'
import TaskHistory from './TaskHistory.vue'
import ButtonModal from '@molecules/ButtonModal/ButtonModal.vue'
export default {
name: 'Task',
name: 'TaskComponent',
components: {
TaskModal,
TaskHistory

View File

@ -1,6 +1,5 @@
<script>
import ButtonModal from '@molecules/ButtonModal/ButtonModal.vue'
import {data} from './historyData'
export default {
name: 'TaskHistory',

View File

@ -1,10 +1,9 @@
<script>
import { defineAsyncComponent } from 'vue'
import Task from './Task.vue'
import TaskModal from './TaskModal.vue'
export default {
name: 'Cron',
name: 'CronPage',
components: {
Task,
TaskModal,

View File

@ -1,5 +1,5 @@
<script>
import {mapGetters, mapActions, mapMutations, useStore} from "vuex"
import {mapGetters, useStore} from "vuex"
import Button from "@atoms/VButton.vue"
import Tabulator from "@molecules/VTabulator/VTabulator.vue"

View File

@ -1,5 +1,5 @@
<script>
import {mapGetters, mapMutations, mapActions, useStore} from "vuex"
import {mapGetters, mapActions, useStore} from "vuex"
import Spinner from "@molecules/VSpinner/VSpinner.vue"
import {PushAfterTimeout} from '@store/hooks/PushAfterTimeout'
import Accordion from '@atoms/VAccordion.vue'
@ -121,7 +121,10 @@ export default {
</tr>
</thead>
<tbody>
<tr v-for="struct in group.pack_structs">
<tr
v-for="(struct, index) in group.pack_structs"
:key="index"
>
<td class="items-center justify-center py-2">
<div class="flex gap-2 w-full">
<div class="w-full text-left decoration-dashed cursor-pointer hover:text-slate-800 transition-all">

View File

@ -1,16 +1,14 @@
<script>
import {ref, toRaw, computed} from 'vue'
import {mapGetters, mapMutations, mapActions, useStore} from "vuex";
import {useRoute, useRouter} from 'vue-router'
import Button from "@atoms/VButton.vue";
import {computed} from 'vue'
import {mapGetters, mapMutations, mapActions} from "vuex";
import {useRoute} from 'vue-router'
import DoubleSwitch from "@/components/1_atoms/DoubleSwitch.vue";
import Chart from "@molecules/VChart/VChart.vue";
import ECharts from '@store/hooks/Echarts';
export default {
name: 'Charts',
name: 'ChartsComponent',
components: {
Button,
Chart,
DoubleSwitch
},
@ -34,10 +32,12 @@ export default {
isChartTypes: this.isChartTypesUrl,
}
},
computed: {
...mapGetters('layoutMachines', ['selectedSelects', 'selectsData', 'toggleFilter', 'chartsData', 'activeChartData', 'prevGroupByData', 'activeMenuChartData', 'openMenuChart', 'legendFiltersParams']),
},
watch: {
activeChartData: {
handler(newValue, oldValue) {
console.log('newValue - activeChartData', newValue)
handler(newValue) {
if (newValue.id && newValue.type && newValue.data) {
const chart = new ECharts(newValue.id)
const isSelectedLegend = this.legendFiltersParams.length > 0 && this.legendFiltersParams[0].id === newValue.id
@ -49,8 +49,7 @@ export default {
// deep: true
},
activeMenuChartData: {
handler(newValue, oldValue) {
// console.log('newValue - activeMenuChartData', newValue)
handler(newValue) {
if (newValue.groupByInfo && newValue.groupByInfo.chartId) {
const chart = new ECharts(newValue.groupByInfo.chartId)
chart.setMenuChart(newValue)
@ -61,9 +60,6 @@ export default {
},
},
},
computed: {
...mapGetters('layoutMachines', ['selectedSelects', 'selectsData', 'toggleFilter', 'chartsData', 'activeChartData', 'prevGroupByData', 'activeMenuChartData', 'openMenuChart', 'legendFiltersParams']),
},
mounted () {
},
@ -121,7 +117,10 @@ export default {
id="main"
class="relative flex flex-wrap justify-center w-full h-full mb-3"
>
<div v-for="(chart, idx) in chartsData.main">
<div
v-for="(chart, idx) in chartsData.main"
:key="idx"
>
<Chart
:id="chart.id"
:idx="idx"
@ -137,7 +136,10 @@ export default {
id="types"
class="relative flex flex-wrap justify-center w-full h-full mb-3"
>
<div v-for="(chart, idx) in chartsData.types">
<div
v-for="(chart, idx) in chartsData.types"
:key="idx"
>
<Chart
:id="chart.id"
:idx="idx"

View File

@ -1,5 +1,5 @@
<script>
import {mapGetters, mapMutations, mapActions, useStore} from "vuex"
import {mapGetters, mapActions} from "vuex"
import Modal from '@molecules/VModal/VModal.vue'
import Accordion from '@atoms/VAccordion.vue'
import PackView from '@organisms/PackView/index.vue'
@ -46,6 +46,9 @@ export default {
machineOverInfo: null
}
},
computed: {
...mapGetters('machines', ['machineInfo', 'reportPacks']),
},
updated () {
this.$nextTick(function () {
if (this.data && this.id && this.open) {
@ -57,9 +60,6 @@ export default {
}
})
},
computed: {
...mapGetters('machines', ['machineInfo', 'reportPacks']),
},
methods: {
...mapActions('machines', ['loadPack']),
}
@ -188,31 +188,32 @@ export default {
>
<h2>Нет данных по машине</h2>
</div>
<div
v-for="(pack, idx) in reportPacks"
v-if="reportPacks.length > 0"
:key="idx"
class="col-span-6 sm:col-span-4 lg:col-span-3 xl:col-span-2 flex items-start flex gap-1 justify-center rounded-md bg-slate-300"
>
<div class="flex-col flex-grow flex py-1">
<div class="flex text-slate-700 font-medium px-3 text-slate-700">
<div class="mr-1">
Номер
</div>
<div>{{ pack.pack_number }}</div>
</div>
<div class="text-slate-600 flex px-3 text-slate-600">
<div class="mr-1">
Количество
</div>
<div>{{ pack.count }}</div>
</div>
</div>
<div v-if="reportPacks.length > 0">
<div
class="h-full flex items-center justify-center text-white rounded-md px-3 text-center cursor-pointer transitiona-all bg-slate-400 hover:bg-slate-600"
@click="loadPack(pack.pack_number)"
v-for="(pack, idx) in reportPacks"
:key="idx"
class="col-span-6 sm:col-span-4 lg:col-span-3 xl:col-span-2 flex items-start flex gap-1 justify-center rounded-md bg-slate-300"
>
<i class="ri-eye-line" />
<div class="flex-col flex-grow flex py-1">
<div class="flex text-slate-700 font-medium px-3 text-slate-700">
<div class="mr-1">
Номер
</div>
<div>{{ pack.pack_number }}</div>
</div>
<div class="text-slate-600 flex px-3 text-slate-600">
<div class="mr-1">
Количество
</div>
<div>{{ pack.count }}</div>
</div>
</div>
<div
class="h-full flex items-center justify-center text-white rounded-md px-3 text-center cursor-pointer transitiona-all bg-slate-400 hover:bg-slate-600"
@click="loadPack(pack.pack_number)"
>
<i class="ri-eye-line" />
</div>
</div>
</div>
</div>

View File

@ -1,7 +1,7 @@
const getMachineInfo = (info, isMain) => {
const mainInfo = ["Текущая симкарта", "Последняя коммуникация", "Предприятие приписки", "Текущее устройство"]
if (isMain) {
return info.reduce((acc, el, idx) => {
return info.reduce((acc, el) => {
if (mainInfo.includes(Object.keys(el)[0])) {
const item = {title: Object.keys(el)[0], val: Object.values(el)[0]}
acc.push(item)
@ -12,7 +12,7 @@ const getMachineInfo = (info, isMain) => {
}, [])
}
if (!isMain) {
return info.reduce((acc, el, idx) => {
return info.reduce((acc, el) => {
if (!mainInfo.includes(Object.keys(el)[0])) {
const item = {title: Object.keys(el)[0], val: Object.values(el)[0]}
acc.push(item)

View File

@ -1,13 +1,10 @@
<script>
import {ref, toRaw, computed} from 'vue'
import {mapGetters, mapMutations, mapActions, useStore} from "vuex";
import Button from "@atoms/VButton.vue";
import {mapGetters, mapMutations, mapActions} from "vuex"
import VueMultiselect from 'vue-multiselect'
export default {
name: 'Filters',
name: 'FiltersComponent',
components: {
Button,
VueMultiselect
},
setup() {
@ -59,7 +56,8 @@ export default {
phx-hook="SelectFilters"
>
<div
v-for="selectData in selectsData"
v-for="(selectData, idx) in selectsData"
:key="idx"
class="col-span-12 sm:col-span-6 lg:col-span-3"
>
<VueMultiselect

View File

@ -1,13 +1,11 @@
<script>
import {mapGetters, mapMutations, mapActions, useStore} from "vuex"
import Button from "@atoms/VButton.vue"
import {mapGetters, mapMutations, mapActions} from "vuex"
import { EventStore } from "@store/hooks/EventStore"
import moment from 'moment'
export default {
name: 'Machine',
name: 'MachineComponent',
components: {
Button,
},
props: {
machine: {
@ -42,7 +40,7 @@ export default {
buttonClass: function(value) {
return `border border-slate-400 flex items-center justify-center cursor-pointer rounded transition-all text-xs text-center py-[5px] px-2 ${value}`
},
cardFunc: function(value) {
cardFunc: function() {
this.initLocalStorage = new EventStore()
if (this.machine.machine_id) {
const valueStorage = {machine_id: this.machine.machine_id, machine_type: this.machine.machine_type, link: `/html/askr_devices/analyze_device/${this.machine.device_number}`, created_at: moment().format('HH:mm:ss DD-MM-YY')}

View File

@ -1,7 +1,7 @@
<script>
import {computed} from 'vue'
import {mapGetters, mapMutations, mapActions, useStore} from "vuex"
import {useRoute, useRouter} from 'vue-router'
import {useRoute} from 'vue-router'
import Button from "@atoms/VButton.vue"
import VueMultiselect from 'vue-multiselect'
import Filters from "./Filters.vue"
@ -16,7 +16,7 @@ import {PushAfterTimeout} from '@store/hooks/PushAfterTimeout'
import {EventStore} from '@store/hooks/EventStore'
export default {
name: 'Machines',
name: 'MachinesComponent',
components: {
Button,
Filters,
@ -245,7 +245,8 @@ export default {
>
<!-- <li v-for="machine in machinesData" class="w-full sm:w-1/2 md:w-1/2 lg:w-1/2 xl:w-1/2 p-2 border-2 border-primary rounded-md"> -->
<li
v-for="machine in machinesData"
v-for="(machine, idx) in machinesData"
:key="idx"
class=""
>
<Machine

View File

@ -1,10 +1,9 @@
<script>
import {mapGetters, mapActions, mapMutations, useStore} from "vuex"
import {mapGetters, mapActions, mapMutations} from "vuex"
import Tabulator from "@molecules/VTabulator/VTabulator.vue"
import { EventStore } from "@store/hooks/EventStore"
export default {
name: 'Table',
name: 'TableComponent',
components: {Tabulator},
data () {

View File

@ -2,17 +2,11 @@
import {computed} from 'vue'
import {mapGetters, mapMutations, mapActions, useStore} from "vuex";
import {useRoute} from 'vue-router'
import Machines from "./Machines/Machines.vue";
import FinderPacks from "./FinderPacks/FinderPacks.vue";
import AddUsers from "./AddUsers/AddUsers.vue";
import Button from "@atoms/VButton.vue";
export default {
name: 'Main',
name: 'MainPage',
components: {
Machines,
FinderPacks,
AddUsers,
Button
},
setup() {
@ -71,6 +65,7 @@ export default {
<div class="flex gap-3 sm:gap-7 w-full lg:w-[50%]">
<router-link
v-for="(page, idx) in pages"
:key="idx"
:to="{name: page.link}"
class="flex w-full"
@click="setPage(page)"

View File

@ -1,7 +1,7 @@
<script>
import {ref, toRaw, computed} from 'vue'
import {computed} from 'vue'
import {mapGetters, mapMutations, mapActions, useStore} from "vuex";
import {useRoute, useRouter} from 'vue-router'
import {useRoute} from 'vue-router'
import Datepicker from "@molecules/VDatepicker/VDatepicker.vue"
import Spinner from "@molecules/VSpinner/VSpinner.vue"
import Tabulator from "@molecules/VTabulator/VTabulator.vue"
@ -10,7 +10,7 @@ import VueMultiselect from 'vue-multiselect'
import moment from 'moment'
export default {
name: 'Packs',
name: 'PacksPage',
components: {
Datepicker,
VueMultiselect,

View File

@ -1,7 +1,7 @@
<script>
export default {
name: 'Diap',
name: 'DiapPage',
components: {},
data() {
},

View File

@ -1,7 +1,7 @@
<script>
export default {
name: 'News',
name: 'NewsPage',
components: {},
data() {
},

View File

@ -1,7 +1,7 @@
<script>
export default {
name: 'Packs',
name: 'PacksAdminPage',
components: {},
data() {
},

View File

@ -1,19 +1,15 @@
<script>
import {mapGetters, useStore} from "vuex"
import Service from './ServicesServiceItem.vue'
import Spinner from "@molecules/VSpinner/VSpinner.vue"
import Tabulator from "@molecules/VTabulator/VTabulator.vue"
export default {
name: 'Services',
name: 'ServicesPage',
components: {
Service,
Spinner,
Tabulator,
},
props: {
},
setup (props, {slots}) {
setup () {
const store = useStore()
store.dispatch('services/uploadData')
},
@ -58,7 +54,10 @@ export default {
id="serviceList"
:class="`flex flex-wrap h-auto flex-row mt-4 overflow-x-auto w-full gap-4 transition-all pb-4 ${isOpenServices ? 'max-h-full' : 'max-h-[220px]'}`"
>
<div v-for="(service, idx) in sortingServices(services)">
<div
v-for="(service, idx) in sortingServices(services)"
:key="idx"
>
<Service
:idx="idx"
:name="service.service || service.name"

View File

@ -1,3 +1,4 @@
// eslint-disable-next-line no-undef
export default dom = (() => {
const getNodeList = (arg) => {
if (typeof arg === "string" && arg.trim().slice(0, 1) !== "<") {

View File

@ -1,7 +1,7 @@
<script>
export default {
name: 'Name',
name: 'NameComponent',
components: {},
data() {
},

View File

@ -1,7 +1,7 @@
import {createRouter, createWebHistory} from "vue-router";
import Main from "@pages/Main/index.vue"
import Auth from "@pages/Auth/index.vue"
import Communication from "@pages/Communication/index.vue"
// import Communication from "@pages/Communication/index.vue"
import LastPacksNum from "@pages/LastPacksNum/index.vue"
import Fuel from "@pages/Fuel/index.vue"
import Cron from "@pages/Cron/index.vue"
@ -12,14 +12,13 @@ import Packs from "@pages/Packs/index.vue"
import FileViewer from "@pages/FileViewer/index.vue"
import NotFound from "@pages/404/index.vue"
import Diap from "@admin_pages/Diap/index.vue"
import News from "@admin_pages/News/index.vue"
// import News from "@admin_pages/News/index.vue"
import Machines from "@pages/Main/Machines/Machines.vue"
import FinderPacks from "@pages/Main/FinderPacks/FinderPacks.vue"
import AddUsers from "@pages/Main/AddUsers/AddUsers.vue"
import Services from "@admin_pages/Services/Services.vue"
import ServiceManage from "@admin_pages/ServiceManage/index.vue"
import {get} from "@store/modules/apiHelpers"
import {cond, T} from 'ramda'
// import ServiceManage from "@admin_pages/ServiceManage/index.vue"
// import {get} from "@store/modules/apiHelpers"
const routes = [
@ -124,17 +123,17 @@ const router = createRouter({
routes
});
const logout = (from, next) => {
localStorage.removeItem("token")
sessionStorage.setItem("pathname", from.fullPath)
next()
}
// const logout = (from, next) => {
// localStorage.removeItem("token")
// sessionStorage.setItem("pathname", from.fullPath)
// next()
// }
const auth_check = async () => {
return await get("/api/auth/loginStatus", ({data}) => {
return data
})
}
// const auth_check = async () => {
// return await get("/api/auth/loginStatus", ({data}) => {
// return data
// })
// }
// router.beforeEach(async (to, from, next) => {
// const status = await auth_check()

View File

@ -18,7 +18,7 @@ export class CopyToClipboard {
copy (text, id) {
if (!navigator.clipboard) {
fallbackCopyTextToClipboard(text)
this.fallbackCopyTextToClipboard(text)
return
}
navigator.clipboard.writeText(text).then(function() {

View File

@ -131,27 +131,29 @@ const updatedGroupByData = (idx, prevGroupByFilters, groupByKey, groupByValue) =
const choiceTypeBarTypesCharts = (params) => {
switch(params.type) {
case 'ml':
case 'ml': {
const yAxisMlData = params.yAxisData.sort().map((el) => {
return `${el.key !== null ? el.key : 'Нет данных'} ${el.val}`
}).sort((a, b) => a - b).reverse()
const xAxisMlData = params.xAxisData.map((item) => item.map((el) => el))
const mlData = xAxisMlData.sort().map((el) => prepareBarTypesMlData(el, params))
return {axisData: yAxisMlData, updatedData: groupByBarTypesData(mlData, xAxisMlData, chartsFiltersNamesMl)}
case 'mount':
}
case 'mount': {
const xAxisMountData = params.yAxisData.sort((a, b) => a.key - b.key).map((el) => {
return `${el.key !== null ? el.key : 'Нет данных'} \n ${el.val}`})
const mountData = params.xAxisData.sort().map((el) => prepareBarTypesData(el, params.xAxisData, params))
return {axisData: xAxisMountData, updatedData: groupByBarTypesData(mountData, params.xAxisData, chartsFiltersNames)}
}
default :
default : {
const yAxisDefaultData = params.yAxisData.sort().map((el) => {
return `${el.key !== null ? el.key : 'Нет данных'} ${el.val}`
}).sort((a, b) => a - b).reverse()
const defaultData = params.xAxisData.sort().map((el) => prepareBarTypesData(el, params.xAxisData, params))
return {axisData: yAxisDefaultData, updatedData: groupByBarTypesData(defaultData, params.xAxisData, chartsFiltersNames)}
}
}
}
export {isEqualKeyValue, getTextWidth, updatedGroupByData, choiceTypeBarTypesCharts}

View File

@ -145,7 +145,7 @@ const linesPackConfig = (params, id, windowConfig) => {
}
const pieConfig = (params, id, windowConfig) => {
const data = params.machines.map((el, idx) => {
const data = params.machines.map((el) => {
el.color = colorList(el.name)
el.order = orderCharts(el.name)
return el
@ -230,7 +230,7 @@ const barConfig = (params, id, windowConfig) => {
// console.log('params', params)
const countMachinesWithoutMl = params?.machines?.[params?.machines?.length - 1]?.key === 'routes_without_ml' ? params?.machines?.[params?.machines?.length - 1]?.values : 0
const data = params?.machines?.map((el, idx) => {
const data = params?.machines?.map((el) => {
el.itemStyle = {color: colorListBar(params.type, el.name)}
return el
}).sort((a, b) => a?.value - b?.value).reverse()
@ -359,7 +359,7 @@ const barTypesConfig = (params, id, windowConfig, enableDataZoom) => {
})
// console.log('dataWithoutZero', dataWithoutZero)
const series = dataWithoutZero.map((charts, idx) => {
const series = dataWithoutZero.map((charts) => {
const [title] = choiceTypeBarTypesCharts(params).updatedData.dataCustomTitle.flat().filter((el) => el?.name == charts[0]?.name)
return {
name: `${title?.name} ${title?.count} id:${id}`,
@ -557,7 +557,7 @@ class ECharts {
const clientHeight = window.innerHeight
this.isMobile = clientWidth < 768
this.currentWidth = clientWidth - 100
// const currentheight = clientHeight + 70
this.currentheight = clientHeight + 70
this.widthChart = sizes.width ? sizes.width : 450
this.heightChart = sizes.height ? sizes.height : 350
this.mountHeightChart = 350
@ -891,7 +891,7 @@ class ECharts {
this.initCharts.on('legendselectchanged', (params) => {
if(params.name.indexOf('id:') > 0) {
// Берём все данные производные из имени, так как это активный элемент легенды
const id = params.name.slice((params.name.indexOf('id:') + 3))
// const id = params.name.slice((params.name.indexOf('id:') + 3))
const nameIdxEnd = (params.name.indexOf('id:') - 1)
const namePrepare = params.name.slice(0, nameIdxEnd)
const name = namePrepare.slice(0, namePrepare.lastIndexOf(' '))

View File

@ -66,7 +66,7 @@ const orderCharts = (name) => {
}
}
const title = (id, count, countWithoutMl = '') => {
const title = (id) => {
switch(id) {
case 'commun_pie': return `Связь с СПС`
case 'commun_pie_cdim': return `Связь с СПС, ЦДИМ`
@ -93,8 +93,11 @@ const title = (id, count, countWithoutMl = '') => {
}
const openMachine = (data) => {
const [currentEl] = data?.linkData?.filter((el) => el?.machine_type === data?.groupByData[data?.groupByKey])
window.open(`/html/askr_devices/analyze_device/${currentEl.device_number}`, '_blank')
const currentArr = data?.linkData?.filter((el) => el?.machine_type === data?.groupByData[data?.groupByKey])
if (currentArr?.length > 0) {
const currentEl = currentArr[0]
window.open(`/html/askr_devices/analyze_device/${currentEl.device_number}`, '_blank')
}
}
const groupByKeys = {

View File

@ -12,6 +12,7 @@ import { store as packs } from '@/store/modules/packs';
import { store as services } from '@/store/modules/services';
import { store as logger } from '@/store/modules/logger';
// eslint-disable-next-line no-undef
let debug = process.env.NODE_ENV !== 'production';
debug = false;

View File

@ -20,7 +20,7 @@ const columns = [
log: true,
render: `
<div class="flex items-center gap-2">
<a target="_blank" href="/html/admin/manage/{{ id }}?prev_page=/\?current_mode=users"><i class="cursor-pointer ri-pencil-line text-slate-700"></i></a>
<a target="_blank" href="/html/admin/manage/{{ id }}?prev_page=/?current_mode=users"><i class="cursor-pointer ri-pencil-line text-slate-700"></i></a>
</div>
`
}

View File

@ -1,6 +1,5 @@
import {toRaw} from 'vue'
import {columns, users} from './StaticData'
import {equals, isEmpty, uniq} from 'ramda'
import {isEmpty} from 'ramda'
const initState = {
adminData: [],
@ -24,7 +23,7 @@ const mutations = {
};
const actions = {
uploadData: async ({commit, getters, state}, historyData) => {
uploadData: async ({commit}, historyData) => {
try{
/*
@ -41,7 +40,7 @@ const actions = {
}
*/
console.log('historyData', historyData)
const adminList = !isEmpty(users) ? users : []
const report = {

View File

@ -1,7 +1,3 @@
import {get, post} from '../apiHelpers'
import {groupBy} from 'ramda'
import {toRaw} from "vue"
import {cond, T, equals} from 'ramda'
import axios from 'axios';
import {orisMenu} from './menuList'

View File

@ -1,5 +1,3 @@
import moment from 'moment'
const initState = {
}

View File

@ -1,6 +1,5 @@
import {toRaw} from 'vue'
import {packsGroups} from './StaticData'
import {equals, isEmpty, uniq} from 'ramda'
import {isEmpty} from 'ramda'
const initState = {
@ -36,7 +35,7 @@ const mutations = {
};
const actions = {
uploadData: async ({commit, getters, state}, historyData) => {
uploadData: async ({commit}) => {
try{
/*
@ -81,7 +80,7 @@ const actions = {
console.error(err)
}
},
updateSearch: async ({commit, getters, state}, updatedValue) => {
updateSearch: async ({commit, state}, updatedValue) => {
try {
const groups = state.packsGroupsDefault
const readyValue = updatedValue?.toLowerCase().split(' ')

View File

@ -35,7 +35,7 @@ const mutations = {
const actions = {
uploadData: ({commit, state}) => {
uploadData: ({state}) => {
setTimeout(() => {
state.pageState = 'loading'
}, 500);

View File

@ -1,5 +1,3 @@
import moment from 'moment'
const initState = {
imei: "",
pageState: "await", // await | loading | isLoaded | error
@ -38,7 +36,7 @@ const mutations = {
const actions = {
uploadData: ({commit, state}) => {
uploadData: ({state}) => {
setTimeout(() => {
state.pageState = 'loading'
}, 500);

View File

@ -1,5 +1,5 @@
import {isEmpty, uniq} from 'ramda'
import {pagination, searchModes} from './StaticData'
import {isEmpty} from 'ramda'
import {searchModes} from './StaticData'
const prepareSelects = (selects, selectors) => {
const updatedSelects = selects.reduce((acc, el) => {

View File

@ -2,7 +2,7 @@ import { chartsFilterParams, chartsGroupByParams, chartsGroupByParams2, chartsFi
import {cond, uniq, has, T} from 'ramda'
const setPeriodCharts = (filterKeys) => {
if (typeof filterKeys === 'array') return {period: 'dayly', title: '24 часа'}
if (filterKeys && filterKeys.length > 0) return {period: 'dayly', title: '24 часа'}
switch(filterKeys) {
case 'commun': return {period: 'yearly', title: "год"}
case 'rors': return {period: 'dayly', title: "на данный момент"}
@ -215,14 +215,14 @@ const chartsBarTypesGroupedBy = (data, groupByKey, filterKey, prevGroupByData, p
const chartsBarTypesWithoutFirstLayout = (data, groupByKey, filterKey, prevGroupByData, prevGroupByFilters, groupByValue) => {
const groupByData = Object.groupBy(data, (el) => el['org_type_name'])
const filteredGroupByData = Object.entries(groupByData).filter(([key, val]) => key === groupByValue)
const filteredGroupByData = Object.entries(groupByData).filter(([key, ]) => key === groupByValue)
if (filteredGroupByData.length === 0) return {yAxisData: [], xAxisData: [], countMachines: 0, period: setPeriodCharts(filterKey).title, filterKey: filterKey, groupByKey: groupByKey, prevGroupByData: prevGroupByData, prevGroupByFilters: prevGroupByFilters, groupByValue: groupByValue}
const [groupedByGroupByKeyY] = filteredGroupByData.map(([key, groupArr]) => Object.groupBy(groupArr, (el) => el[groupByKey]))
const [groupedByGroupByKeyY] = filteredGroupByData.map(([, groupArr]) => Object.groupBy(groupArr, (el) => el[groupByKey]))
const yAxisData = Object.entries(groupedByGroupByKeyY).map(([key, val]) => ({key: key, val: val.length}))
const [groupedByGroupByKeyX] = filteredGroupByData.map(([key, groupArr]) => Object.groupBy(groupArr, (el) => el[groupByKey]))
const [groupedByGroupByKeyX] = filteredGroupByData.map(([, groupArr]) => Object.groupBy(groupArr, (el) => el[groupByKey]))
const xAxisData = Object.entries(groupedByGroupByKeyX).map(([key, groupArr]) => {
const groupByFilterData = Object.groupBy(groupArr, (el) => el[filterKey])
const newArr = Object.entries(groupByFilterData).map(([key, val]) => ({name: key, value: val.length, linkData: groupByKey === 'machine_type' ? val.map((el) => ({machine_type: el.machine_type, device_number: el.device_number})) : ''}))
@ -371,9 +371,9 @@ const loadingChartsData = ({chartsSetup, data, dataMount, prevGroupByData, prevG
return {...chartsSetup, main: main, types: types}
}
const setBarTypesChart = (activeChartParams, prevGroupByData, prevGroupByFilters, defaultData, currentData) => {
const setBarTypesChart = (activeChartParams, prevGroupByData, prevGroupByFilters, defaultData) => {
switch (activeChartParams.type) {
case 'default':
case 'default': {
const dataDefault = chartsBarTypes(defaultData, activeChartParams.groupByKey, activeChartParams.filterKey, prevGroupByData, prevGroupByFilters)
// const updatedData = currentData.types.reduce((acc, chart) => {
// if (chart.id === activeChartParams.id) {
@ -386,16 +386,23 @@ const setBarTypesChart = (activeChartParams, prevGroupByData, prevGroupByFilters
// }, [])
// return {main: currentData.main, types: updatedData}
Review

лучше убрать

лучше убрать
return dataDefault
case 'without_first_layout':
}
case 'without_first_layout': {
const dataWithoutFirstLayout = chartsBarTypesWithoutFirstLayout(defaultData, activeChartParams.groupByKey, activeChartParams.filterKey, prevGroupByData, prevGroupByFilters, activeChartParams.groupByValue)
return dataWithoutFirstLayout
case 'types':
}
case 'types': {
const dataGroupBy = chartsBarTypesGroupedBy(defaultData, activeChartParams.groupByKey, activeChartParams.filterKey, prevGroupByData, prevGroupByFilters, activeChartParams.groupByValue)
return dataGroupBy
case 'ml':
}
case 'ml': {
const dataMl = chartsBarTypesGroupedByMl(defaultData, activeChartParams.groupByKey, chartsFilterKeysMl, prevGroupByData, prevGroupByFilters)
return dataMl
}
}
}
const setNextLayoutGroupByKey = (groupByKey, prevGroupByValue) => {

View File

@ -1,11 +1,11 @@
import {toRaw} from 'vue'
import {searchModes, leftTopButtons, rightTopButtons, selects, selectors, charts, dataMachines, dataMount, pagination, machineInfo, reportPacks, report, packStructure, multiReport, multiPackStructure} from './StaticData'
import {searchModes, leftTopButtons, rightTopButtons, selects, selectors, dataMachines, dataMount, pagination, machineInfo, reportPacks, multiReport, multiPackStructure} from './StaticData'
import { chartsSetup } from '@/store/hooks/Echarts/staticData.js';
import { prepareSelects, mergedMachines, setUpdatedDataMachines, colorSelection, loadingPagination, setPagination } from './helpers';
import { loadingChartsData, setBarTypesChart, setNextLayoutGroupByKey, setBeforeLayoutGroupByData, typesCharts } from './helpersCharts';
import { fetchColumn, prepareSetPackColumns } from '@organisms/PackColumns';
import { get } from '../apiHelpers';
import {equals, isEmpty, uniq} from 'ramda'
// import { get } from '../apiHelpers';
import {equals, isEmpty} from 'ramda'
const initState = {
leftTopButtons: leftTopButtons,
@ -235,10 +235,10 @@ const actions = {
console.error(err)
}
},
updateCharts: async ({commit, getters, state}, updatedData) => {
updateCharts: async ({commit, state}, updatedData) => {
try {
switch(updatedData.action) {
case 'nextLayoutChart':
case 'nextLayoutChart': {
// console.log('updatedDataNext', updatedData)
const prevGroupByFiltersNext = updatedData.prevGroupByFilters
const updatedFiltersNext = {...prevGroupByFiltersNext, ...updatedData.prevGroupByData}
@ -250,7 +250,8 @@ const actions = {
return commit('setActiveChartData', {...activeChartData, data: newData})
}
break
case 'beforeLayoutChart':
}
case 'beforeLayoutChart': {
// console.log('updatedDataBefore', updatedData)
const prevGroupByData = updatedData.groupByInfo.prevGroupByData
const prevGroupByFiltersBefore = updatedData.groupByInfo.prevGroupByFilters
@ -264,7 +265,8 @@ const actions = {
return commit('setActiveChartData', {...activeChartData, data: newData})
}
break
case 'openMenuChart':
}
case 'openMenuChart': {
// console.log('updatedDataOpen', updatedData)
const openMenuChart = toRaw(state.activeMenuChartData.openMenuChart)
updatedData.groupByInfo.data[0].type = updatedData.groupByInfo.type
@ -274,7 +276,8 @@ const actions = {
const toggleActiveMenuChartData = {openMenuChart: !openMenuChart, groupByInfo: {...activeChartDataMenu, data: isNotTypesChartsMenu ? updatedData.groupByInfo.data[0] : newDataMenu}}
commit('setActiveMenuChartData', toggleActiveMenuChartData)
break
case 'downloadChart':
}
case 'downloadChart': {
// console.log('updatedDataDownload', updatedData)
const activeChartDataDownload = {chartId: updatedData.groupByInfo.chartId, isDownloadChart: updatedData.groupByInfo.isDownloadChart, data: updatedData.groupByInfo.data, groupByKey: updatedData.groupByInfo.groupByKey, prevGroupByData: updatedData.groupByInfo.prevGroupByData, prevGroupByFilters: updatedData.groupByInfo.prevGroupByFilters, filterKey: updatedData.groupByInfo.filterKey, type: updatedData.groupByInfo.type, groupByValue: updatedData.groupByInfo.groupByValue}
const newDataDownload = setBarTypesChart(activeChartDataDownload, updatedData.groupByInfo.prevGroupByData, updatedData.groupByInfo.prevGroupByFilters, state.machinesDataDefault, toRaw(state.chartsData))
@ -282,8 +285,10 @@ const actions = {
const downloadActiveMenuChartData = {openMenuChart: false, groupByInfo: {...updatedData.groupByInfo, data: isNotTypesChartsDownload ? updatedData.groupByInfo.data[0] : newDataDownload}}
commit('setActiveMenuChartData', downloadActiveMenuChartData)
break
}
case 'legendFiltersParams':
commit('setLegendFiltersParams', updatedData.data)
break
default: return false
}
} catch (err) {
@ -302,7 +307,7 @@ const actions = {
console.error(err)
}
},
openMapModal: async ({commit, state}, machine) => {
openMapModal: async ({commit}, machine) => {
try {
// Добавить запрос на получение координат
/*
@ -317,7 +322,7 @@ const actions = {
console.error(err)
}
},
openDataModal: async ({commit, state}, machine) => {
openDataModal: async ({commit}) => {
try {
// Добавить запрос на получение пакетов и информации о машине
@ -355,7 +360,7 @@ const actions = {
console.error(err)
}
},
loadPack: async ({commit, state}, packNumber) => {
loadPack: async ({commit}, packNumber) => {
try {
/* Получение данных о пакете
@ -398,7 +403,7 @@ const actions = {
console.error(err)
}
},
updateModePack: async ({commit, getters, state}, updatedMode) => {
updateModePack: async ({commit, state}, updatedMode) => {
try {
const structPackDefault = toRaw(state.structPackDefault)
const currentReport = multiReport[updatedMode] ? multiReport[updatedMode] : []

View File

@ -1,5 +1,5 @@
import {isEmpty, uniq} from 'ramda'
import {pagination, searchModes} from './StaticData'
import {isEmpty} from 'ramda'
import {searchModes} from './StaticData'
const prepareSelects = (selects, selectors) => {
const updatedSelects = selects.reduce((acc, el) => {

View File

@ -2,7 +2,7 @@ import { chartsFilterParams, chartsGroupByParams, chartsGroupByParams2, chartsFi
import {cond, uniq, has, T} from 'ramda'
const setPeriodCharts = (filterKeys) => {
if (typeof filterKeys === 'array') return {period: 'dayly', title: '24 часа'}
if (filterKeys && filterKeys.length > 0) return {period: 'dayly', title: '24 часа'}
switch(filterKeys) {
case 'commun': return {period: 'yearly', title: "год"}
case 'rors': return {period: 'dayly', title: "на данный момент"}
@ -215,14 +215,14 @@ const chartsBarTypesGroupedBy = (data, groupByKey, filterKey, prevGroupByData, p
const chartsBarTypesWithoutFirstLayout = (data, groupByKey, filterKey, prevGroupByData, prevGroupByFilters, groupByValue) => {
const groupByData = Object.groupBy(data, (el) => el['org_type_name'])
const filteredGroupByData = Object.entries(groupByData).filter(([key, val]) => key === groupByValue)
const filteredGroupByData = Object.entries(groupByData).filter(([key, ]) => key === groupByValue)
if (filteredGroupByData.length === 0) return {yAxisData: [], xAxisData: [], countMachines: 0, period: setPeriodCharts(filterKey).title, filterKey: filterKey, groupByKey: groupByKey, prevGroupByData: prevGroupByData, prevGroupByFilters: prevGroupByFilters, groupByValue: groupByValue}
const [groupedByGroupByKeyY] = filteredGroupByData.map(([key, groupArr]) => Object.groupBy(groupArr, (el) => el[groupByKey]))
const [groupedByGroupByKeyY] = filteredGroupByData.map(([, groupArr]) => Object.groupBy(groupArr, (el) => el[groupByKey]))
const yAxisData = Object.entries(groupedByGroupByKeyY).map(([key, val]) => ({key: key, val: val.length}))
const [groupedByGroupByKeyX] = filteredGroupByData.map(([key, groupArr]) => Object.groupBy(groupArr, (el) => el[groupByKey]))
const [groupedByGroupByKeyX] = filteredGroupByData.map(([, groupArr]) => Object.groupBy(groupArr, (el) => el[groupByKey]))
const xAxisData = Object.entries(groupedByGroupByKeyX).map(([key, groupArr]) => {
const groupByFilterData = Object.groupBy(groupArr, (el) => el[filterKey])
const newArr = Object.entries(groupByFilterData).map(([key, val]) => ({name: key, value: val.length, linkData: groupByKey === 'machine_type' ? val.map((el) => ({machine_type: el.machine_type, device_number: el.device_number})) : ''}))
@ -371,9 +371,9 @@ const loadingChartsData = ({chartsSetup, data, dataMount, prevGroupByData, prevG
return {...chartsSetup, main: main, types: types}
}
const setBarTypesChart = (activeChartParams, prevGroupByData, prevGroupByFilters, defaultData, currentData) => {
const setBarTypesChart = (activeChartParams, prevGroupByData, prevGroupByFilters, defaultData) => {
switch (activeChartParams.type) {
case 'default':
case 'default': {
const dataDefault = chartsBarTypes(defaultData, activeChartParams.groupByKey, activeChartParams.filterKey, prevGroupByData, prevGroupByFilters)
// const updatedData = currentData.types.reduce((acc, chart) => {
// if (chart.id === activeChartParams.id) {
@ -386,16 +386,20 @@ const setBarTypesChart = (activeChartParams, prevGroupByData, prevGroupByFilters
// }, [])
// return {main: currentData.main, types: updatedData}
Review

лучше убрать

лучше убрать
return dataDefault
case 'without_first_layout':
}
case 'without_first_layout': {
const dataWithoutFirstLayout = chartsBarTypesWithoutFirstLayout(defaultData, activeChartParams.groupByKey, activeChartParams.filterKey, prevGroupByData, prevGroupByFilters, activeChartParams.groupByValue)
return dataWithoutFirstLayout
case 'types':
}
case 'types': {
const dataGroupBy = chartsBarTypesGroupedBy(defaultData, activeChartParams.groupByKey, activeChartParams.filterKey, prevGroupByData, prevGroupByFilters, activeChartParams.groupByValue)
return dataGroupBy
case 'ml':
}
case 'ml': {
const dataMl = chartsBarTypesGroupedByMl(defaultData, activeChartParams.groupByKey, chartsFilterKeysMl, prevGroupByData, prevGroupByFilters)
return dataMl
}
}
}
const setNextLayoutGroupByKey = (groupByKey, prevGroupByValue) => {

View File

@ -1,5 +1,3 @@
import {equals, isEmpty} from 'ramda'
const initState = {
modalMachines: [],
};

View File

@ -1,4 +1,3 @@
import {toRaw} from 'vue'
import {pages} from './StaticData'
const initState = {

View File

@ -2,7 +2,7 @@ import {toRaw} from 'vue'
import {pageSettings, packStruct, packsNames, data} from './StaticData'
import {fetchColumn} from '@organisms/PackColumns';
import {loadingPagination, setPagination} from './helpers';
import {equals, is, isEmpty, uniq} from 'ramda'
import {isEmpty, uniq} from 'ramda'
import moment from'moment'
const initState = {
@ -65,7 +65,7 @@ const mutations = {
};
const actions = {
uploadData: async ({commit, getters, state}, params) => {
uploadData: async ({commit, getters}, params) => {
try{
/*
@ -186,7 +186,7 @@ const actions = {
console.error(err)
}
},
updatePackSettings: async ({commit, getters, state}, updatedData) => {
updatePackSettings: async ({commit, getters}, updatedData) => {
try {
console.log('updatedData', updatedData)
const packsSettings = toRaw(getters.packsSettings)
@ -198,7 +198,7 @@ const actions = {
console.error(err)
}
},
updateSelects: async ({dispatch, commit, getters, state}, updatedSelect) => {
updateSelects: async ({commit, getters}, updatedSelect) => {
try {
const dataSource = toRaw(getters.tableData).dataSource

View File

@ -1,22 +1,22 @@
const servicesNames = ["check_scand_api_2EC27AEA12AAC9E5B013", "niflheim",
"scand_client_B0C8B117F3AB40D5869C",
"local_local_cdrp@172.25.78.64_E66972859C7734FBAB11",
"cronex_9354617E3A5A69493AC0",
"local_lm_api@172.25.78.153_36C091D060A018177B49",
"db_loader_7C6C7680BAC92D4BFD8C", "sql_inserter_B2751775DD1FC358682A",
"authentication_service_F2AE8881F984DFE1A4BD", "cdrp",
"asgard_82DB735B1F03E8A5BA0E", "alfheim_90556327D9DC81351EE2", "GStore",
"alfheim_1B3027982471601E45E8", "cronex", "comm_client_diap_1",
"cdrp_B2E275BA9E7E79D4D2D6", "authentication_service",
"comm_client_diap_1_8348C79D6407CDB752FD", "sql_sup_F66176648815DC42BD4D",
"periodic_tasks_228605BF57BD5DE8C94B",
"integration_pk_gip_F6797EF2E89795090B4D", "live_monitor_EA3F27068ABA3C4F5D7F",
"snotra_EC6E797D24F8E93C536F", "thor_70B46C452D3105A6AF09",
"kudt_diag_3D0E0652B99B208E8519", "snotra", "live_monitor", "sql_sup",
"comm_client_diap_2_B2FAA49D7F5EF167DF1D", "niflheim_829F2F30E9FD2539D3E7",
"comm_client_diap_repl_6BA0746DB5CFB506AC7A", "pack_rrnr_DDCE13940E392EB3456A",
"local_local_live_monitor@172.25.78.151_CD55455FB92AB74F178B", "alfheim",
"local_fuel_api@172.25.78.98_C215EA176A84C84A6CEC"]
// const servicesNames = ["check_scand_api_2EC27AEA12AAC9E5B013", "niflheim",
// "scand_client_B0C8B117F3AB40D5869C",
// "local_local_cdrp@172.25.78.64_E66972859C7734FBAB11",
// "cronex_9354617E3A5A69493AC0",
// "local_lm_api@172.25.78.153_36C091D060A018177B49",
// "db_loader_7C6C7680BAC92D4BFD8C", "sql_inserter_B2751775DD1FC358682A",
// "authentication_service_F2AE8881F984DFE1A4BD", "cdrp",
// "asgard_82DB735B1F03E8A5BA0E", "alfheim_90556327D9DC81351EE2", "GStore",
// "alfheim_1B3027982471601E45E8", "cronex", "comm_client_diap_1",
// "cdrp_B2E275BA9E7E79D4D2D6", "authentication_service",
// "comm_client_diap_1_8348C79D6407CDB752FD", "sql_sup_F66176648815DC42BD4D",
// "periodic_tasks_228605BF57BD5DE8C94B",
// "integration_pk_gip_F6797EF2E89795090B4D", "live_monitor_EA3F27068ABA3C4F5D7F",
// "snotra_EC6E797D24F8E93C536F", "thor_70B46C452D3105A6AF09",
// "kudt_diag_3D0E0652B99B208E8519", "snotra", "live_monitor", "sql_sup",
// "comm_client_diap_2_B2FAA49D7F5EF167DF1D", "niflheim_829F2F30E9FD2539D3E7",
// "comm_client_diap_repl_6BA0746DB5CFB506AC7A", "pack_rrnr_DDCE13940E392EB3456A",
// "local_local_live_monitor@172.25.78.151_CD55455FB92AB74F178B", "alfheim",
// "local_fuel_api@172.25.78.98_C215EA176A84C84A6CEC"]
// const servicesNotConnected = [

View File

@ -60,7 +60,7 @@ class Services {
if (serviceNameArr?.length > 0) {
if (serviceNameArr[serviceNameArr.length - 1].length > 15)
serviceCode = serviceNameArr[serviceNameArr.length - 1]
serviceIp = serviceNameArr.reduce((acc, el, idx) => {
serviceIp = serviceNameArr.reduce((acc, el) => {
const ipIdx = el.indexOf('@')
if (ipIdx !== -1) {
acc = el.slice(ipIdx)

View File

@ -52,7 +52,7 @@ const actions = {
}
},
uploadServiceData: async ({}, service) => {
uploadServiceData: async (service) => {
try{
const serviceNew = new Service(service)
serviceNew.getCashe(service)

View File

@ -1,4 +1,4 @@
import {expect, describe, vi, test, beforeEach} from 'vitest'
import {expect, describe, test, beforeEach} from 'vitest'
import ServiceOfMachines from "@services/ServiceOfMachines.js"
import {AdapterOfMachines, appModalListMachines} from "@mocks/machines.js"
import { createStore } from "vuex"
@ -23,12 +23,6 @@ describe('test ServiceOfMachines', () => {
expect(result).toEqual(appModalListMachines)
})
test('test putModalMachines', async () => {
await serviceOfMachines.putModalMachines(appModalListMachines)
const result = store.getters['machines/modalMachines']
expect(result).toEqual(appModalListMachines)
})
test('test makeFetchAndPutModalMachines', async () => {
const funcResult = await serviceOfMachines.makeFetchAndPutModalMachines()
const storeResult = store.getters['machines/modalMachines']