fixed eslint errors
This commit is contained in:
parent
053f6ef711
commit
70cb21c9af
@ -196,11 +196,11 @@ const setTooltip = (map, coordinates, machine, tooltip_id, content_id, closer_id
|
|||||||
tooltipText.classList.add(content_id)
|
tooltipText.classList.add(content_id)
|
||||||
|
|
||||||
if (feature) {
|
if (feature) {
|
||||||
const container = tooltip.getElement();
|
const container = tooltip.getElement()
|
||||||
const props = feature.getProperties()
|
// const props = feature.getProperties()
|
||||||
|
|
||||||
const coordsFormated = feature.getGeometry()
|
// const coordsFormated = feature.getGeometry()
|
||||||
const coordsFormat = feature.getGeometry().getFlatCoordinates()
|
// const coordsFormat = feature.getGeometry().getFlatCoordinates()
|
||||||
|
|
||||||
// const hdms = toLonLat(coordinates)
|
// const hdms = toLonLat(coordinates)
|
||||||
|
|
||||||
@ -228,12 +228,9 @@ const setTooltip = (map, coordinates, machine, tooltip_id, content_id, closer_id
|
|||||||
});
|
});
|
||||||
|
|
||||||
map.on('pointermove', function (e) {
|
map.on('pointermove', function (e) {
|
||||||
const pixel = map.getEventPixel(e.originalEvent);
|
const pixel = map.getEventPixel(e.originalEvent)
|
||||||
const hit = map.hasFeatureAtPixel(pixel);
|
const hit = map.hasFeatureAtPixel(pixel)
|
||||||
// console.log('hit', hit)
|
map.getTarget().style.cursor = hit ? 'pointer' : ''
|
||||||
// console.log('pixel', pixel)
|
|
||||||
// console.log('map', map)
|
|
||||||
// map.getTarget().style.cursor = hit ? 'pointer' : '';
|
|
||||||
})
|
})
|
||||||
|
|
||||||
onClose.addEventListener('click', onClosed)
|
onClose.addEventListener('click', onClosed)
|
||||||
|
|||||||
@ -39,7 +39,7 @@ export default {
|
|||||||
enableTime: this.enableTime,
|
enableTime: this.enableTime,
|
||||||
dateFormat: this._dateFormat,
|
dateFormat: this._dateFormat,
|
||||||
locale: Russian,
|
locale: Russian,
|
||||||
onChange: (a,_b,_c) => {
|
onChange: (a) => {
|
||||||
this.onchange(a[0])
|
this.onchange(a[0])
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -5,11 +5,10 @@ import {
|
|||||||
sorter,
|
sorter,
|
||||||
renderGroupHeader,
|
renderGroupHeader,
|
||||||
groupByFunction,
|
groupByFunction,
|
||||||
makedFiltering,
|
|
||||||
tablefy
|
tablefy
|
||||||
} from "./helper";
|
} from "./helper";
|
||||||
import localization from "./localization";
|
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 { pipe } from "@helpers/functions";
|
||||||
import Pagination from "./VTabulatorPagination.vue";
|
import Pagination from "./VTabulatorPagination.vue";
|
||||||
|
|
||||||
@ -116,7 +115,7 @@ export default {
|
|||||||
data: this.data,
|
data: this.data,
|
||||||
groupStartOpen: false,
|
groupStartOpen: false,
|
||||||
|
|
||||||
groupHeader: function (value, count, data, group) {
|
groupHeader: function (value, count) {
|
||||||
return value + "<span>(" + count + " записей)</span>";
|
return value + "<span>(" + count + " записей)</span>";
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,10 +1,9 @@
|
|||||||
<script>
|
<script>
|
||||||
import {mapGetters, mapMutations, mapActions, useStore} from "vuex"
|
|
||||||
import { validation } from './helper'
|
import { validation } from './helper'
|
||||||
import { Alert } from "@store/hooks/Alert"
|
import { Alert } from "@store/hooks/Alert"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Pagination',
|
name: 'TabulatorPagination',
|
||||||
components: {
|
components: {
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
@ -24,8 +23,8 @@ export default {
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
params: {
|
params: {
|
||||||
handler(value, oldValue) {
|
handler(newValue) {
|
||||||
if(value) {
|
if(newValue) {
|
||||||
const loader = document.querySelector(`#table_loder_${this.params.id}`)
|
const loader = document.querySelector(`#table_loder_${this.params.id}`)
|
||||||
loader.style.display = 'none'
|
loader.style.display = 'none'
|
||||||
}
|
}
|
||||||
@ -37,7 +36,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
selectOptions: (selectOption, paginationOptions) => {
|
selectOptions: (selectOption, paginationOptions) => {
|
||||||
const options = selectOption ? selectOption : optionsDefault
|
const options = selectOption ? selectOption : []
|
||||||
const currentOptions = options.filter((el) => {
|
const currentOptions = options.filter((el) => {
|
||||||
if(el <= Math.ceil(paginationOptions.total / 10) * 10) {
|
if(el <= Math.ceil(paginationOptions.total / 10) * 10) {
|
||||||
return el
|
return el
|
||||||
|
|||||||
@ -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 Handlebars from "handlebars/dist/cjs/handlebars";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import presetConfig from './presetConfig'
|
import presetConfig from './presetConfig'
|
||||||
@ -20,7 +20,7 @@ const tablefy = (list = []) => {
|
|||||||
return list.map((el) => mergeLeft(el, defaultData(el?.title || "")))
|
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 left = parseFloat(value);
|
||||||
var right = parseFloat(operand);
|
var right = parseFloat(operand);
|
||||||
|
|
||||||
@ -138,7 +138,8 @@ const link = (col) => ({
|
|||||||
[
|
[
|
||||||
"from_list",
|
"from_list",
|
||||||
(list, param_string) => {
|
(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 validation = (value, pagination) => {
|
||||||
const pipe = (...fns) => (...x) => fns.reduce((error, validator) => error || validator(...x), undefined)
|
const pipe = (...fns) => (...x) => fns.reduce((error, validator) => error || validator(...x), undefined)
|
||||||
const required = value => {
|
// const required = value => {
|
||||||
return value ? undefined : "*"
|
// return value ? undefined : "*"
|
||||||
}
|
// }
|
||||||
const minPage = length => value => {
|
const minPage = length => value => {
|
||||||
value = value.replace(/\s+/g, '')
|
value = value.replace(/\s+/g, '')
|
||||||
return value >= length ? undefined : `Номер страницы должен быть больше или равен ${length}`
|
return value >= length ? undefined : `Номер страницы должен быть больше или равен ${length}`
|
||||||
|
|||||||
@ -1,52 +1,5 @@
|
|||||||
import { cond, T } from "ramda";
|
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 get_f1_preset = (el) => {
|
||||||
const r = {
|
const r = {
|
||||||
0: "Конфигурация не установлена (по умолчанию)",
|
0: "Конфигурация не установлена (по умолчанию)",
|
||||||
|
|||||||
@ -8,10 +8,8 @@ import {
|
|||||||
propEq,
|
propEq,
|
||||||
findIndex,
|
findIndex,
|
||||||
update,
|
update,
|
||||||
is,
|
|
||||||
cond,
|
cond,
|
||||||
T,
|
T,
|
||||||
isNil
|
|
||||||
} from "ramda";
|
} from "ramda";
|
||||||
|
|
||||||
let getPackSettings = (userId, page, packStructId, func) => {
|
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) => ({
|
range(from, to + 1).map((el) => ({
|
||||||
title: el,
|
title: el,
|
||||||
dataIndex: `disc${el}`,
|
dataIndex: `disc${el}`,
|
||||||
@ -79,17 +77,14 @@ const withCustomSettings = (_columns, requestSettings) => {
|
|||||||
let columns = _columns
|
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)
|
||||||
if (requestSettings?.colors?.isOn) {
|
const coloredParams = Object.keys(colors)
|
||||||
let colors = requestSettings.colors.list.filter((el) => el.isOn);
|
|
||||||
colors = groupBy((c) => c.param)(colors);
|
|
||||||
coloredParams = Object.keys(colors);
|
|
||||||
columns = columns.map((el) => {
|
columns = columns.map((el) => {
|
||||||
if (coloredParams.includes(el.dataIndex)) {
|
if (coloredParams.includes(el.dataIndex)) {
|
||||||
return {
|
return {
|
||||||
...el,
|
...el,
|
||||||
onCell: (data, index) => {
|
onCell: (data) => {
|
||||||
let colrSettings = colors[el.dataIndex];
|
let colrSettings = colors[el.dataIndex];
|
||||||
let value = data[el.dataIndex];
|
let value = data[el.dataIndex];
|
||||||
let color = find(({ from, untill }) =>
|
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 fetch_sorter_field = (sorter, req_params) => {
|
||||||
const date_param = req_params?.settings?.date_param
|
// const date_param = req_params?.settings?.date_param
|
||||||
return cond([
|
// return cond([
|
||||||
[() => sorter?.field, () => sorter.field],
|
// [() => sorter?.field, () => sorter.field],
|
||||||
[is(Array), field_from_arr(sorter, date_param)],
|
// [is(Array), field_from_arr(sorter, date_param)],
|
||||||
[isNil, () => date_param],
|
// [isNil, () => date_param],
|
||||||
])(sorter)
|
// ])(sorter)
|
||||||
}
|
// }
|
||||||
|
|
||||||
const field_from_arr = (sorter, date_param) => () => {
|
|
||||||
const field = sorter.find((el) => `${el?.field}`.includes("dt"))?.field
|
|
||||||
return field || date_param
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// 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 get_f1_preset = (el) => {
|
||||||
const r = {
|
const r = {
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
import { parse } from "handlebars/dist/cjs/handlebars/compiler/base";
|
|
||||||
import { cond, T, isEmpty } from "ramda";
|
import { cond, T, isEmpty } from "ramda";
|
||||||
|
|
||||||
const setPackColumns = (name) => {
|
const setPackColumns = (name) => {
|
||||||
@ -163,6 +162,7 @@ const prepareSetPackColumns = (name, data) => {
|
|||||||
if (data.length === 0) {
|
if (data.length === 0) {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
break
|
||||||
case 'raw':
|
case 'raw':
|
||||||
return setPackColumns('Сырые')
|
return setPackColumns('Сырые')
|
||||||
case 'unrecognized':
|
case 'unrecognized':
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<script>
|
<script>
|
||||||
import {mapGetters, mapMutations, mapActions, useStore} from "vuex"
|
import {mapGetters, mapActions} from "vuex"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'PackViewButton',
|
name: 'PackViewButton',
|
||||||
@ -28,7 +28,7 @@ export default {
|
|||||||
},
|
},
|
||||||
idx: {
|
idx: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: ""
|
default: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<script>
|
<script>
|
||||||
import {mapGetters, mapMutations, mapActions, useStore} from "vuex"
|
import {mapGetters, mapActions} from "vuex"
|
||||||
import PackViewButton from './Button.vue'
|
import PackViewButton from './Button.vue'
|
||||||
import Spinner from "@molecules/VSpinner/VSpinner.vue"
|
import Spinner from "@molecules/VSpinner/VSpinner.vue"
|
||||||
import Tabulator from "@molecules/VTabulator/VTabulator.vue"
|
import Tabulator from "@molecules/VTabulator/VTabulator.vue"
|
||||||
@ -36,13 +36,6 @@ export default {
|
|||||||
hasData: false
|
hasData: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
updated () {
|
|
||||||
this.$nextTick(function () {
|
|
||||||
if (!isEmpty(this.packData)) {
|
|
||||||
this.hasData = true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters('machines', ['packData', 'selectPackStructs', 'selectedPackStruct']),
|
...mapGetters('machines', ['packData', 'selectPackStructs', 'selectedPackStruct']),
|
||||||
buttonsData: () =>
|
buttonsData: () =>
|
||||||
@ -52,6 +45,13 @@ export default {
|
|||||||
{mode: 'unrecognized', isActive: false, name: 'switch_unrecognized', inner: 'нераспознанные', labelClass: 'rounded-r-lg border'},
|
{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: {
|
methods: {
|
||||||
...mapActions('machines', ['updateSelectStruct']),
|
...mapActions('machines', ['updateSelectStruct']),
|
||||||
updateSelectedValue: function (e) {
|
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">
|
<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
|
<PackViewButton
|
||||||
v-for="(button, idx) in buttonsData"
|
v-for="(button, idx) in buttonsData"
|
||||||
|
:key="idx"
|
||||||
:idx="idx"
|
:idx="idx"
|
||||||
:mode="button.mode"
|
:mode="button.mode"
|
||||||
:name="button.name"
|
:name="button.name"
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
<script>
|
<script>
|
||||||
import {mapGetters} from 'vuex'
|
|
||||||
import { createIcons, icons } from "lucide";
|
import { createIcons, icons } from "lucide";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
import Login from './Login.vue'
|
import Login from './Login.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Auth',
|
name: 'AuthPage',
|
||||||
components: {
|
components: {
|
||||||
Login
|
Login
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,10 +1,9 @@
|
|||||||
<script>
|
<script>
|
||||||
import TaskModal from './TaskModal.vue'
|
import TaskModal from './TaskModal.vue'
|
||||||
import TaskHistory from './TaskHistory.vue'
|
import TaskHistory from './TaskHistory.vue'
|
||||||
import ButtonModal from '@molecules/ButtonModal/ButtonModal.vue'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Task',
|
name: 'TaskComponent',
|
||||||
components: {
|
components: {
|
||||||
TaskModal,
|
TaskModal,
|
||||||
TaskHistory
|
TaskHistory
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
<script>
|
<script>
|
||||||
import ButtonModal from '@molecules/ButtonModal/ButtonModal.vue'
|
import ButtonModal from '@molecules/ButtonModal/ButtonModal.vue'
|
||||||
import {data} from './historyData'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'TaskHistory',
|
name: 'TaskHistory',
|
||||||
|
|||||||
@ -1,10 +1,9 @@
|
|||||||
<script>
|
<script>
|
||||||
import { defineAsyncComponent } from 'vue'
|
|
||||||
import Task from './Task.vue'
|
import Task from './Task.vue'
|
||||||
import TaskModal from './TaskModal.vue'
|
import TaskModal from './TaskModal.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Cron',
|
name: 'CronPage',
|
||||||
components: {
|
components: {
|
||||||
Task,
|
Task,
|
||||||
TaskModal,
|
TaskModal,
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<script>
|
<script>
|
||||||
import {mapGetters, mapActions, mapMutations, useStore} from "vuex"
|
import {mapGetters, useStore} from "vuex"
|
||||||
import Button from "@atoms/VButton.vue"
|
import Button from "@atoms/VButton.vue"
|
||||||
import Tabulator from "@molecules/VTabulator/VTabulator.vue"
|
import Tabulator from "@molecules/VTabulator/VTabulator.vue"
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<script>
|
<script>
|
||||||
import {mapGetters, mapMutations, mapActions, useStore} from "vuex"
|
import {mapGetters, mapActions, useStore} from "vuex"
|
||||||
import Spinner from "@molecules/VSpinner/VSpinner.vue"
|
import Spinner from "@molecules/VSpinner/VSpinner.vue"
|
||||||
import {PushAfterTimeout} from '@store/hooks/PushAfterTimeout'
|
import {PushAfterTimeout} from '@store/hooks/PushAfterTimeout'
|
||||||
import Accordion from '@atoms/VAccordion.vue'
|
import Accordion from '@atoms/VAccordion.vue'
|
||||||
@ -121,7 +121,10 @@ export default {
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<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">
|
<td class="items-center justify-center py-2">
|
||||||
<div class="flex gap-2 w-full">
|
<div class="flex gap-2 w-full">
|
||||||
<div class="w-full text-left decoration-dashed cursor-pointer hover:text-slate-800 transition-all">
|
<div class="w-full text-left decoration-dashed cursor-pointer hover:text-slate-800 transition-all">
|
||||||
|
|||||||
@ -1,16 +1,14 @@
|
|||||||
<script>
|
<script>
|
||||||
import {ref, toRaw, computed} from 'vue'
|
import {computed} from 'vue'
|
||||||
import {mapGetters, mapMutations, mapActions, useStore} from "vuex";
|
import {mapGetters, mapMutations, mapActions} from "vuex";
|
||||||
import {useRoute, useRouter} from 'vue-router'
|
import {useRoute} from 'vue-router'
|
||||||
import Button from "@atoms/VButton.vue";
|
|
||||||
import DoubleSwitch from "@/components/1_atoms/DoubleSwitch.vue";
|
import DoubleSwitch from "@/components/1_atoms/DoubleSwitch.vue";
|
||||||
import Chart from "@molecules/VChart/VChart.vue";
|
import Chart from "@molecules/VChart/VChart.vue";
|
||||||
import ECharts from '@store/hooks/Echarts';
|
import ECharts from '@store/hooks/Echarts';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Charts',
|
name: 'ChartsComponent',
|
||||||
components: {
|
components: {
|
||||||
Button,
|
|
||||||
Chart,
|
Chart,
|
||||||
DoubleSwitch
|
DoubleSwitch
|
||||||
},
|
},
|
||||||
@ -34,10 +32,12 @@ export default {
|
|||||||
isChartTypes: this.isChartTypesUrl,
|
isChartTypes: this.isChartTypesUrl,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters('layoutMachines', ['selectedSelects', 'selectsData', 'toggleFilter', 'chartsData', 'activeChartData', 'prevGroupByData', 'activeMenuChartData', 'openMenuChart', 'legendFiltersParams']),
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
activeChartData: {
|
activeChartData: {
|
||||||
handler(newValue, oldValue) {
|
handler(newValue) {
|
||||||
console.log('newValue - activeChartData', newValue)
|
|
||||||
if (newValue.id && newValue.type && newValue.data) {
|
if (newValue.id && newValue.type && newValue.data) {
|
||||||
const chart = new ECharts(newValue.id)
|
const chart = new ECharts(newValue.id)
|
||||||
const isSelectedLegend = this.legendFiltersParams.length > 0 && this.legendFiltersParams[0].id === newValue.id
|
const isSelectedLegend = this.legendFiltersParams.length > 0 && this.legendFiltersParams[0].id === newValue.id
|
||||||
@ -49,8 +49,7 @@ export default {
|
|||||||
// deep: true
|
// deep: true
|
||||||
},
|
},
|
||||||
activeMenuChartData: {
|
activeMenuChartData: {
|
||||||
handler(newValue, oldValue) {
|
handler(newValue) {
|
||||||
// console.log('newValue - activeMenuChartData', newValue)
|
|
||||||
if (newValue.groupByInfo && newValue.groupByInfo.chartId) {
|
if (newValue.groupByInfo && newValue.groupByInfo.chartId) {
|
||||||
const chart = new ECharts(newValue.groupByInfo.chartId)
|
const chart = new ECharts(newValue.groupByInfo.chartId)
|
||||||
chart.setMenuChart(newValue)
|
chart.setMenuChart(newValue)
|
||||||
@ -61,9 +60,6 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
...mapGetters('layoutMachines', ['selectedSelects', 'selectsData', 'toggleFilter', 'chartsData', 'activeChartData', 'prevGroupByData', 'activeMenuChartData', 'openMenuChart', 'legendFiltersParams']),
|
|
||||||
},
|
|
||||||
mounted () {
|
mounted () {
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -121,7 +117,10 @@ export default {
|
|||||||
id="main"
|
id="main"
|
||||||
class="relative flex flex-wrap justify-center w-full h-full mb-3"
|
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
|
<Chart
|
||||||
:id="chart.id"
|
:id="chart.id"
|
||||||
:idx="idx"
|
:idx="idx"
|
||||||
@ -137,7 +136,10 @@ export default {
|
|||||||
id="types"
|
id="types"
|
||||||
class="relative flex flex-wrap justify-center w-full h-full mb-3"
|
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
|
<Chart
|
||||||
:id="chart.id"
|
:id="chart.id"
|
||||||
:idx="idx"
|
:idx="idx"
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<script>
|
<script>
|
||||||
import {mapGetters, mapMutations, mapActions, useStore} from "vuex"
|
import {mapGetters, mapActions} from "vuex"
|
||||||
import Modal from '@molecules/VModal/VModal.vue'
|
import Modal from '@molecules/VModal/VModal.vue'
|
||||||
import Accordion from '@atoms/VAccordion.vue'
|
import Accordion from '@atoms/VAccordion.vue'
|
||||||
import PackView from '@organisms/PackView/index.vue'
|
import PackView from '@organisms/PackView/index.vue'
|
||||||
@ -46,6 +46,9 @@ export default {
|
|||||||
machineOverInfo: null
|
machineOverInfo: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters('machines', ['machineInfo', 'reportPacks']),
|
||||||
|
},
|
||||||
updated () {
|
updated () {
|
||||||
this.$nextTick(function () {
|
this.$nextTick(function () {
|
||||||
if (this.data && this.id && this.open) {
|
if (this.data && this.id && this.open) {
|
||||||
@ -57,9 +60,6 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
...mapGetters('machines', ['machineInfo', 'reportPacks']),
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions('machines', ['loadPack']),
|
...mapActions('machines', ['loadPack']),
|
||||||
}
|
}
|
||||||
@ -188,9 +188,9 @@ export default {
|
|||||||
>
|
>
|
||||||
<h2>Нет данных по машине</h2>
|
<h2>Нет данных по машине</h2>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="reportPacks.length > 0">
|
||||||
<div
|
<div
|
||||||
v-for="(pack, idx) in reportPacks"
|
v-for="(pack, idx) in reportPacks"
|
||||||
v-if="reportPacks.length > 0"
|
|
||||||
:key="idx"
|
: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"
|
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"
|
||||||
>
|
>
|
||||||
@ -218,6 +218,7 @@ export default {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div class="w-full h-[1px] bg-slate-300" />
|
<div class="w-full h-[1px] bg-slate-300" />
|
||||||
<PackView
|
<PackView
|
||||||
id="machineReport"
|
id="machineReport"
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
const getMachineInfo = (info, isMain) => {
|
const getMachineInfo = (info, isMain) => {
|
||||||
const mainInfo = ["Текущая симкарта", "Последняя коммуникация", "Предприятие приписки", "Текущее устройство"]
|
const mainInfo = ["Текущая симкарта", "Последняя коммуникация", "Предприятие приписки", "Текущее устройство"]
|
||||||
if (isMain) {
|
if (isMain) {
|
||||||
return info.reduce((acc, el, idx) => {
|
return info.reduce((acc, el) => {
|
||||||
if (mainInfo.includes(Object.keys(el)[0])) {
|
if (mainInfo.includes(Object.keys(el)[0])) {
|
||||||
const item = {title: Object.keys(el)[0], val: Object.values(el)[0]}
|
const item = {title: Object.keys(el)[0], val: Object.values(el)[0]}
|
||||||
acc.push(item)
|
acc.push(item)
|
||||||
@ -12,7 +12,7 @@ const getMachineInfo = (info, isMain) => {
|
|||||||
}, [])
|
}, [])
|
||||||
}
|
}
|
||||||
if (!isMain) {
|
if (!isMain) {
|
||||||
return info.reduce((acc, el, idx) => {
|
return info.reduce((acc, el) => {
|
||||||
if (!mainInfo.includes(Object.keys(el)[0])) {
|
if (!mainInfo.includes(Object.keys(el)[0])) {
|
||||||
const item = {title: Object.keys(el)[0], val: Object.values(el)[0]}
|
const item = {title: Object.keys(el)[0], val: Object.values(el)[0]}
|
||||||
acc.push(item)
|
acc.push(item)
|
||||||
|
|||||||
@ -1,13 +1,10 @@
|
|||||||
<script>
|
<script>
|
||||||
import {ref, toRaw, computed} from 'vue'
|
import {mapGetters, mapMutations, mapActions} from "vuex"
|
||||||
import {mapGetters, mapMutations, mapActions, useStore} from "vuex";
|
|
||||||
import Button from "@atoms/VButton.vue";
|
|
||||||
import VueMultiselect from 'vue-multiselect'
|
import VueMultiselect from 'vue-multiselect'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Filters',
|
name: 'FiltersComponent',
|
||||||
components: {
|
components: {
|
||||||
Button,
|
|
||||||
VueMultiselect
|
VueMultiselect
|
||||||
},
|
},
|
||||||
setup() {
|
setup() {
|
||||||
@ -59,7 +56,8 @@ export default {
|
|||||||
phx-hook="SelectFilters"
|
phx-hook="SelectFilters"
|
||||||
>
|
>
|
||||||
<div
|
<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"
|
class="col-span-12 sm:col-span-6 lg:col-span-3"
|
||||||
>
|
>
|
||||||
<VueMultiselect
|
<VueMultiselect
|
||||||
|
|||||||
@ -1,13 +1,11 @@
|
|||||||
<script>
|
<script>
|
||||||
import {mapGetters, mapMutations, mapActions, useStore} from "vuex"
|
import {mapGetters, mapMutations, mapActions} from "vuex"
|
||||||
import Button from "@atoms/VButton.vue"
|
|
||||||
import { EventStore } from "@store/hooks/EventStore"
|
import { EventStore } from "@store/hooks/EventStore"
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Machine',
|
name: 'MachineComponent',
|
||||||
components: {
|
components: {
|
||||||
Button,
|
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
machine: {
|
machine: {
|
||||||
@ -42,7 +40,7 @@ export default {
|
|||||||
buttonClass: function(value) {
|
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}`
|
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()
|
this.initLocalStorage = new EventStore()
|
||||||
if (this.machine.machine_id) {
|
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')}
|
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')}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import {computed} from 'vue'
|
import {computed} from 'vue'
|
||||||
import {mapGetters, mapMutations, mapActions, useStore} from "vuex"
|
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 Button from "@atoms/VButton.vue"
|
||||||
import VueMultiselect from 'vue-multiselect'
|
import VueMultiselect from 'vue-multiselect'
|
||||||
import Filters from "./Filters.vue"
|
import Filters from "./Filters.vue"
|
||||||
@ -16,7 +16,7 @@ import {PushAfterTimeout} from '@store/hooks/PushAfterTimeout'
|
|||||||
import {EventStore} from '@store/hooks/EventStore'
|
import {EventStore} from '@store/hooks/EventStore'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Machines',
|
name: 'MachinesComponent',
|
||||||
components: {
|
components: {
|
||||||
Button,
|
Button,
|
||||||
Filters,
|
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" 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
|
<li
|
||||||
v-for="machine in machinesData"
|
v-for="(machine, idx) in machinesData"
|
||||||
|
:key="idx"
|
||||||
class=""
|
class=""
|
||||||
>
|
>
|
||||||
<Machine
|
<Machine
|
||||||
|
|||||||
@ -1,10 +1,9 @@
|
|||||||
<script>
|
<script>
|
||||||
import {mapGetters, mapActions, mapMutations, useStore} from "vuex"
|
import {mapGetters, mapActions, mapMutations} from "vuex"
|
||||||
import Tabulator from "@molecules/VTabulator/VTabulator.vue"
|
import Tabulator from "@molecules/VTabulator/VTabulator.vue"
|
||||||
import { EventStore } from "@store/hooks/EventStore"
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Table',
|
name: 'TableComponent',
|
||||||
components: {Tabulator},
|
components: {Tabulator},
|
||||||
data () {
|
data () {
|
||||||
|
|
||||||
|
|||||||
@ -2,17 +2,11 @@
|
|||||||
import {computed} from 'vue'
|
import {computed} from 'vue'
|
||||||
import {mapGetters, mapMutations, mapActions, useStore} from "vuex";
|
import {mapGetters, mapMutations, mapActions, useStore} from "vuex";
|
||||||
import {useRoute} from 'vue-router'
|
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";
|
import Button from "@atoms/VButton.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Main',
|
name: 'MainPage',
|
||||||
components: {
|
components: {
|
||||||
Machines,
|
|
||||||
FinderPacks,
|
|
||||||
AddUsers,
|
|
||||||
Button
|
Button
|
||||||
},
|
},
|
||||||
setup() {
|
setup() {
|
||||||
@ -71,6 +65,7 @@ export default {
|
|||||||
<div class="flex gap-3 sm:gap-7 w-full lg:w-[50%]">
|
<div class="flex gap-3 sm:gap-7 w-full lg:w-[50%]">
|
||||||
<router-link
|
<router-link
|
||||||
v-for="(page, idx) in pages"
|
v-for="(page, idx) in pages"
|
||||||
|
:key="idx"
|
||||||
:to="{name: page.link}"
|
:to="{name: page.link}"
|
||||||
class="flex w-full"
|
class="flex w-full"
|
||||||
@click="setPage(page)"
|
@click="setPage(page)"
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import {ref, toRaw, computed} from 'vue'
|
import {computed} from 'vue'
|
||||||
import {mapGetters, mapMutations, mapActions, useStore} from "vuex";
|
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 Datepicker from "@molecules/VDatepicker/VDatepicker.vue"
|
||||||
import Spinner from "@molecules/VSpinner/VSpinner.vue"
|
import Spinner from "@molecules/VSpinner/VSpinner.vue"
|
||||||
import Tabulator from "@molecules/VTabulator/VTabulator.vue"
|
import Tabulator from "@molecules/VTabulator/VTabulator.vue"
|
||||||
@ -10,7 +10,7 @@ import VueMultiselect from 'vue-multiselect'
|
|||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Packs',
|
name: 'PacksPage',
|
||||||
components: {
|
components: {
|
||||||
Datepicker,
|
Datepicker,
|
||||||
VueMultiselect,
|
VueMultiselect,
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<script>
|
<script>
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Diap',
|
name: 'DiapPage',
|
||||||
components: {},
|
components: {},
|
||||||
data() {
|
data() {
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<script>
|
<script>
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'News',
|
name: 'NewsPage',
|
||||||
components: {},
|
components: {},
|
||||||
data() {
|
data() {
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<script>
|
<script>
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Packs',
|
name: 'PacksAdminPage',
|
||||||
components: {},
|
components: {},
|
||||||
data() {
|
data() {
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,19 +1,15 @@
|
|||||||
<script>
|
<script>
|
||||||
import {mapGetters, useStore} from "vuex"
|
import {mapGetters, useStore} from "vuex"
|
||||||
import Service from './ServicesServiceItem.vue'
|
import Service from './ServicesServiceItem.vue'
|
||||||
import Spinner from "@molecules/VSpinner/VSpinner.vue"
|
|
||||||
import Tabulator from "@molecules/VTabulator/VTabulator.vue"
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Services',
|
name: 'ServicesPage',
|
||||||
components: {
|
components: {
|
||||||
Service,
|
Service,
|
||||||
Spinner,
|
|
||||||
Tabulator,
|
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
},
|
},
|
||||||
setup (props, {slots}) {
|
setup () {
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
store.dispatch('services/uploadData')
|
store.dispatch('services/uploadData')
|
||||||
},
|
},
|
||||||
@ -58,7 +54,10 @@ export default {
|
|||||||
id="serviceList"
|
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]'}`"
|
: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
|
<Service
|
||||||
:idx="idx"
|
:idx="idx"
|
||||||
:name="service.service || service.name"
|
:name="service.service || service.name"
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
// eslint-disable-next-line no-undef
|
||||||
export default dom = (() => {
|
export default dom = (() => {
|
||||||
const getNodeList = (arg) => {
|
const getNodeList = (arg) => {
|
||||||
if (typeof arg === "string" && arg.trim().slice(0, 1) !== "<") {
|
if (typeof arg === "string" && arg.trim().slice(0, 1) !== "<") {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<script>
|
<script>
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Name',
|
name: 'NameComponent',
|
||||||
components: {},
|
components: {},
|
||||||
data() {
|
data() {
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import {createRouter, createWebHistory} from "vue-router";
|
import {createRouter, createWebHistory} from "vue-router";
|
||||||
import Main from "@pages/Main/index.vue"
|
import Main from "@pages/Main/index.vue"
|
||||||
import Auth from "@pages/Auth/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 LastPacksNum from "@pages/LastPacksNum/index.vue"
|
||||||
import Fuel from "@pages/Fuel/index.vue"
|
import Fuel from "@pages/Fuel/index.vue"
|
||||||
import Cron from "@pages/Cron/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 FileViewer from "@pages/FileViewer/index.vue"
|
||||||
import NotFound from "@pages/404/index.vue"
|
import NotFound from "@pages/404/index.vue"
|
||||||
import Diap from "@admin_pages/Diap/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 Machines from "@pages/Main/Machines/Machines.vue"
|
||||||
import FinderPacks from "@pages/Main/FinderPacks/FinderPacks.vue"
|
import FinderPacks from "@pages/Main/FinderPacks/FinderPacks.vue"
|
||||||
import AddUsers from "@pages/Main/AddUsers/AddUsers.vue"
|
import AddUsers from "@pages/Main/AddUsers/AddUsers.vue"
|
||||||
import Services from "@admin_pages/Services/Services.vue"
|
import Services from "@admin_pages/Services/Services.vue"
|
||||||
import ServiceManage from "@admin_pages/ServiceManage/index.vue"
|
// import ServiceManage from "@admin_pages/ServiceManage/index.vue"
|
||||||
import {get} from "@store/modules/apiHelpers"
|
// import {get} from "@store/modules/apiHelpers"
|
||||||
import {cond, T} from 'ramda'
|
|
||||||
|
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
@ -124,17 +123,17 @@ const router = createRouter({
|
|||||||
routes
|
routes
|
||||||
});
|
});
|
||||||
|
|
||||||
const logout = (from, next) => {
|
// const logout = (from, next) => {
|
||||||
localStorage.removeItem("token")
|
// localStorage.removeItem("token")
|
||||||
sessionStorage.setItem("pathname", from.fullPath)
|
// sessionStorage.setItem("pathname", from.fullPath)
|
||||||
next()
|
// next()
|
||||||
}
|
// }
|
||||||
|
|
||||||
const auth_check = async () => {
|
// const auth_check = async () => {
|
||||||
return await get("/api/auth/loginStatus", ({data}) => {
|
// return await get("/api/auth/loginStatus", ({data}) => {
|
||||||
return data
|
// return data
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
|
|
||||||
// router.beforeEach(async (to, from, next) => {
|
// router.beforeEach(async (to, from, next) => {
|
||||||
// const status = await auth_check()
|
// const status = await auth_check()
|
||||||
|
|||||||
@ -18,7 +18,7 @@ export class CopyToClipboard {
|
|||||||
|
|
||||||
copy (text, id) {
|
copy (text, id) {
|
||||||
if (!navigator.clipboard) {
|
if (!navigator.clipboard) {
|
||||||
fallbackCopyTextToClipboard(text)
|
this.fallbackCopyTextToClipboard(text)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
navigator.clipboard.writeText(text).then(function() {
|
navigator.clipboard.writeText(text).then(function() {
|
||||||
|
|||||||
@ -131,21 +131,22 @@ const updatedGroupByData = (idx, prevGroupByFilters, groupByKey, groupByValue) =
|
|||||||
|
|
||||||
const choiceTypeBarTypesCharts = (params) => {
|
const choiceTypeBarTypesCharts = (params) => {
|
||||||
switch(params.type) {
|
switch(params.type) {
|
||||||
case 'ml':
|
case 'ml': {
|
||||||
const yAxisMlData = params.yAxisData.sort().map((el) => {
|
const yAxisMlData = params.yAxisData.sort().map((el) => {
|
||||||
return `${el.key !== null ? el.key : 'Нет данных'} ${el.val}`
|
return `${el.key !== null ? el.key : 'Нет данных'} ${el.val}`
|
||||||
}).sort((a, b) => a - b).reverse()
|
}).sort((a, b) => a - b).reverse()
|
||||||
const xAxisMlData = params.xAxisData.map((item) => item.map((el) => el))
|
const xAxisMlData = params.xAxisData.map((item) => item.map((el) => el))
|
||||||
const mlData = xAxisMlData.sort().map((el) => prepareBarTypesMlData(el, params))
|
const mlData = xAxisMlData.sort().map((el) => prepareBarTypesMlData(el, params))
|
||||||
return {axisData: yAxisMlData, updatedData: groupByBarTypesData(mlData, xAxisMlData, chartsFiltersNamesMl)}
|
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) => {
|
const xAxisMountData = params.yAxisData.sort((a, b) => a.key - b.key).map((el) => {
|
||||||
return `${el.key !== null ? el.key : 'Нет данных'} \n ${el.val}`})
|
return `${el.key !== null ? el.key : 'Нет данных'} \n ${el.val}`})
|
||||||
const mountData = params.xAxisData.sort().map((el) => prepareBarTypesData(el, params.xAxisData, params))
|
const mountData = params.xAxisData.sort().map((el) => prepareBarTypesData(el, params.xAxisData, params))
|
||||||
return {axisData: xAxisMountData, updatedData: groupByBarTypesData(mountData, params.xAxisData, chartsFiltersNames)}
|
return {axisData: xAxisMountData, updatedData: groupByBarTypesData(mountData, params.xAxisData, chartsFiltersNames)}
|
||||||
|
}
|
||||||
|
|
||||||
default :
|
default : {
|
||||||
const yAxisDefaultData = params.yAxisData.sort().map((el) => {
|
const yAxisDefaultData = params.yAxisData.sort().map((el) => {
|
||||||
return `${el.key !== null ? el.key : 'Нет данных'} ${el.val}`
|
return `${el.key !== null ? el.key : 'Нет данных'} ${el.val}`
|
||||||
}).sort((a, b) => a - b).reverse()
|
}).sort((a, b) => a - b).reverse()
|
||||||
@ -153,5 +154,6 @@ const choiceTypeBarTypesCharts = (params) => {
|
|||||||
return {axisData: yAxisDefaultData, updatedData: groupByBarTypesData(defaultData, params.xAxisData, chartsFiltersNames)}
|
return {axisData: yAxisDefaultData, updatedData: groupByBarTypesData(defaultData, params.xAxisData, chartsFiltersNames)}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export {isEqualKeyValue, getTextWidth, updatedGroupByData, choiceTypeBarTypesCharts}
|
export {isEqualKeyValue, getTextWidth, updatedGroupByData, choiceTypeBarTypesCharts}
|
||||||
@ -145,7 +145,7 @@ const linesPackConfig = (params, id, windowConfig) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const pieConfig = (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.color = colorList(el.name)
|
||||||
el.order = orderCharts(el.name)
|
el.order = orderCharts(el.name)
|
||||||
return el
|
return el
|
||||||
@ -230,7 +230,7 @@ const barConfig = (params, id, windowConfig) => {
|
|||||||
// console.log('params', params)
|
// 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 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)}
|
el.itemStyle = {color: colorListBar(params.type, el.name)}
|
||||||
return el
|
return el
|
||||||
}).sort((a, b) => a?.value - b?.value).reverse()
|
}).sort((a, b) => a?.value - b?.value).reverse()
|
||||||
@ -359,7 +359,7 @@ const barTypesConfig = (params, id, windowConfig, enableDataZoom) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// console.log('dataWithoutZero', dataWithoutZero)
|
// 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)
|
const [title] = choiceTypeBarTypesCharts(params).updatedData.dataCustomTitle.flat().filter((el) => el?.name == charts[0]?.name)
|
||||||
return {
|
return {
|
||||||
name: `${title?.name} ${title?.count} id:${id}`,
|
name: `${title?.name} ${title?.count} id:${id}`,
|
||||||
@ -557,7 +557,7 @@ class ECharts {
|
|||||||
const clientHeight = window.innerHeight
|
const clientHeight = window.innerHeight
|
||||||
this.isMobile = clientWidth < 768
|
this.isMobile = clientWidth < 768
|
||||||
this.currentWidth = clientWidth - 100
|
this.currentWidth = clientWidth - 100
|
||||||
// const currentheight = clientHeight + 70
|
this.currentheight = clientHeight + 70
|
||||||
this.widthChart = sizes.width ? sizes.width : 450
|
this.widthChart = sizes.width ? sizes.width : 450
|
||||||
this.heightChart = sizes.height ? sizes.height : 350
|
this.heightChart = sizes.height ? sizes.height : 350
|
||||||
this.mountHeightChart = 350
|
this.mountHeightChart = 350
|
||||||
@ -891,7 +891,7 @@ class ECharts {
|
|||||||
this.initCharts.on('legendselectchanged', (params) => {
|
this.initCharts.on('legendselectchanged', (params) => {
|
||||||
if(params.name.indexOf('id:') > 0) {
|
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 nameIdxEnd = (params.name.indexOf('id:') - 1)
|
||||||
const namePrepare = params.name.slice(0, nameIdxEnd)
|
const namePrepare = params.name.slice(0, nameIdxEnd)
|
||||||
const name = namePrepare.slice(0, namePrepare.lastIndexOf(' '))
|
const name = namePrepare.slice(0, namePrepare.lastIndexOf(' '))
|
||||||
|
|||||||
@ -66,7 +66,7 @@ const orderCharts = (name) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const title = (id, count, countWithoutMl = '') => {
|
const title = (id) => {
|
||||||
switch(id) {
|
switch(id) {
|
||||||
case 'commun_pie': return `Связь с СПС`
|
case 'commun_pie': return `Связь с СПС`
|
||||||
case 'commun_pie_cdim': return `Связь с СПС, ЦДИМ`
|
case 'commun_pie_cdim': return `Связь с СПС, ЦДИМ`
|
||||||
@ -93,9 +93,12 @@ const title = (id, count, countWithoutMl = '') => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const openMachine = (data) => {
|
const openMachine = (data) => {
|
||||||
const [currentEl] = data?.linkData?.filter((el) => el?.machine_type === data?.groupByData[data?.groupByKey])
|
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')
|
window.open(`/html/askr_devices/analyze_device/${currentEl.device_number}`, '_blank')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const groupByKeys = {
|
const groupByKeys = {
|
||||||
firstLayout: 'org_type_name',
|
firstLayout: 'org_type_name',
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import { store as packs } from '@/store/modules/packs';
|
|||||||
import { store as services } from '@/store/modules/services';
|
import { store as services } from '@/store/modules/services';
|
||||||
import { store as logger } from '@/store/modules/logger';
|
import { store as logger } from '@/store/modules/logger';
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
let debug = process.env.NODE_ENV !== 'production';
|
let debug = process.env.NODE_ENV !== 'production';
|
||||||
debug = false;
|
debug = false;
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,7 @@ const columns = [
|
|||||||
log: true,
|
log: true,
|
||||||
render: `
|
render: `
|
||||||
<div class="flex items-center gap-2">
|
<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>
|
</div>
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
import {toRaw} from 'vue'
|
|
||||||
import {columns, users} from './StaticData'
|
import {columns, users} from './StaticData'
|
||||||
import {equals, isEmpty, uniq} from 'ramda'
|
import {isEmpty} from 'ramda'
|
||||||
|
|
||||||
const initState = {
|
const initState = {
|
||||||
adminData: [],
|
adminData: [],
|
||||||
@ -24,7 +23,7 @@ const mutations = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const actions = {
|
const actions = {
|
||||||
uploadData: async ({commit, getters, state}, historyData) => {
|
uploadData: async ({commit}, historyData) => {
|
||||||
try{
|
try{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -41,7 +40,7 @@ const actions = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
console.log('historyData', historyData)
|
||||||
const adminList = !isEmpty(users) ? users : []
|
const adminList = !isEmpty(users) ? users : []
|
||||||
|
|
||||||
const report = {
|
const report = {
|
||||||
|
|||||||
@ -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 axios from 'axios';
|
||||||
import {orisMenu} from './menuList'
|
import {orisMenu} from './menuList'
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
import moment from 'moment'
|
|
||||||
|
|
||||||
const initState = {
|
const initState = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
import {toRaw} from 'vue'
|
|
||||||
import {packsGroups} from './StaticData'
|
import {packsGroups} from './StaticData'
|
||||||
import {equals, isEmpty, uniq} from 'ramda'
|
import {isEmpty} from 'ramda'
|
||||||
|
|
||||||
const initState = {
|
const initState = {
|
||||||
|
|
||||||
@ -36,7 +35,7 @@ const mutations = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const actions = {
|
const actions = {
|
||||||
uploadData: async ({commit, getters, state}, historyData) => {
|
uploadData: async ({commit}) => {
|
||||||
try{
|
try{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -81,7 +80,7 @@ const actions = {
|
|||||||
console.error(err)
|
console.error(err)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
updateSearch: async ({commit, getters, state}, updatedValue) => {
|
updateSearch: async ({commit, state}, updatedValue) => {
|
||||||
try {
|
try {
|
||||||
const groups = state.packsGroupsDefault
|
const groups = state.packsGroupsDefault
|
||||||
const readyValue = updatedValue?.toLowerCase().split(' ')
|
const readyValue = updatedValue?.toLowerCase().split(' ')
|
||||||
|
|||||||
@ -35,7 +35,7 @@ const mutations = {
|
|||||||
|
|
||||||
|
|
||||||
const actions = {
|
const actions = {
|
||||||
uploadData: ({commit, state}) => {
|
uploadData: ({state}) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
state.pageState = 'loading'
|
state.pageState = 'loading'
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
import moment from 'moment'
|
|
||||||
|
|
||||||
const initState = {
|
const initState = {
|
||||||
imei: "",
|
imei: "",
|
||||||
pageState: "await", // await | loading | isLoaded | error
|
pageState: "await", // await | loading | isLoaded | error
|
||||||
@ -38,7 +36,7 @@ const mutations = {
|
|||||||
|
|
||||||
|
|
||||||
const actions = {
|
const actions = {
|
||||||
uploadData: ({commit, state}) => {
|
uploadData: ({state}) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
state.pageState = 'loading'
|
state.pageState = 'loading'
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import {isEmpty, uniq} from 'ramda'
|
import {isEmpty} from 'ramda'
|
||||||
import {pagination, searchModes} from './StaticData'
|
import {searchModes} from './StaticData'
|
||||||
|
|
||||||
const prepareSelects = (selects, selectors) => {
|
const prepareSelects = (selects, selectors) => {
|
||||||
const updatedSelects = selects.reduce((acc, el) => {
|
const updatedSelects = selects.reduce((acc, el) => {
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { chartsFilterParams, chartsGroupByParams, chartsGroupByParams2, chartsFi
|
|||||||
import {cond, uniq, has, T} from 'ramda'
|
import {cond, uniq, has, T} from 'ramda'
|
||||||
|
|
||||||
const setPeriodCharts = (filterKeys) => {
|
const setPeriodCharts = (filterKeys) => {
|
||||||
if (typeof filterKeys === 'array') return {period: 'dayly', title: '24 часа'}
|
if (filterKeys && filterKeys.length > 0) return {period: 'dayly', title: '24 часа'}
|
||||||
switch(filterKeys) {
|
switch(filterKeys) {
|
||||||
case 'commun': return {period: 'yearly', title: "год"}
|
case 'commun': return {period: 'yearly', title: "год"}
|
||||||
case 'rors': return {period: 'dayly', 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 chartsBarTypesWithoutFirstLayout = (data, groupByKey, filterKey, prevGroupByData, prevGroupByFilters, groupByValue) => {
|
||||||
|
|
||||||
const groupByData = Object.groupBy(data, (el) => el['org_type_name'])
|
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}
|
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 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 xAxisData = Object.entries(groupedByGroupByKeyX).map(([key, groupArr]) => {
|
||||||
const groupByFilterData = Object.groupBy(groupArr, (el) => el[filterKey])
|
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})) : ''}))
|
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}
|
return {...chartsSetup, main: main, types: types}
|
||||||
}
|
}
|
||||||
|
|
||||||
const setBarTypesChart = (activeChartParams, prevGroupByData, prevGroupByFilters, defaultData, currentData) => {
|
const setBarTypesChart = (activeChartParams, prevGroupByData, prevGroupByFilters, defaultData) => {
|
||||||
switch (activeChartParams.type) {
|
switch (activeChartParams.type) {
|
||||||
case 'default':
|
case 'default': {
|
||||||
const dataDefault = chartsBarTypes(defaultData, activeChartParams.groupByKey, activeChartParams.filterKey, prevGroupByData, prevGroupByFilters)
|
const dataDefault = chartsBarTypes(defaultData, activeChartParams.groupByKey, activeChartParams.filterKey, prevGroupByData, prevGroupByFilters)
|
||||||
// const updatedData = currentData.types.reduce((acc, chart) => {
|
// const updatedData = currentData.types.reduce((acc, chart) => {
|
||||||
// if (chart.id === activeChartParams.id) {
|
// if (chart.id === activeChartParams.id) {
|
||||||
@ -386,17 +386,24 @@ const setBarTypesChart = (activeChartParams, prevGroupByData, prevGroupByFilters
|
|||||||
// }, [])
|
// }, [])
|
||||||
// return {main: currentData.main, types: updatedData}
|
// return {main: currentData.main, types: updatedData}
|
||||||
return dataDefault
|
return dataDefault
|
||||||
case 'without_first_layout':
|
}
|
||||||
|
|
||||||
|
case 'without_first_layout': {
|
||||||
const dataWithoutFirstLayout = chartsBarTypesWithoutFirstLayout(defaultData, activeChartParams.groupByKey, activeChartParams.filterKey, prevGroupByData, prevGroupByFilters, activeChartParams.groupByValue)
|
const dataWithoutFirstLayout = chartsBarTypesWithoutFirstLayout(defaultData, activeChartParams.groupByKey, activeChartParams.filterKey, prevGroupByData, prevGroupByFilters, activeChartParams.groupByValue)
|
||||||
return dataWithoutFirstLayout
|
return dataWithoutFirstLayout
|
||||||
case 'types':
|
}
|
||||||
|
|
||||||
|
case 'types': {
|
||||||
const dataGroupBy = chartsBarTypesGroupedBy(defaultData, activeChartParams.groupByKey, activeChartParams.filterKey, prevGroupByData, prevGroupByFilters, activeChartParams.groupByValue)
|
const dataGroupBy = chartsBarTypesGroupedBy(defaultData, activeChartParams.groupByKey, activeChartParams.filterKey, prevGroupByData, prevGroupByFilters, activeChartParams.groupByValue)
|
||||||
return dataGroupBy
|
return dataGroupBy
|
||||||
case 'ml':
|
}
|
||||||
|
|
||||||
|
case 'ml': {
|
||||||
const dataMl = chartsBarTypesGroupedByMl(defaultData, activeChartParams.groupByKey, chartsFilterKeysMl, prevGroupByData, prevGroupByFilters)
|
const dataMl = chartsBarTypesGroupedByMl(defaultData, activeChartParams.groupByKey, chartsFilterKeysMl, prevGroupByData, prevGroupByFilters)
|
||||||
return dataMl
|
return dataMl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const setNextLayoutGroupByKey = (groupByKey, prevGroupByValue) => {
|
const setNextLayoutGroupByKey = (groupByKey, prevGroupByValue) => {
|
||||||
if (prevGroupByValue === 'без типа') return null
|
if (prevGroupByValue === 'без типа') return null
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
import {toRaw} from 'vue'
|
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 { chartsSetup } from '@/store/hooks/Echarts/staticData.js';
|
||||||
import { prepareSelects, mergedMachines, setUpdatedDataMachines, colorSelection, loadingPagination, setPagination } from './helpers';
|
import { prepareSelects, mergedMachines, setUpdatedDataMachines, colorSelection, loadingPagination, setPagination } from './helpers';
|
||||||
import { loadingChartsData, setBarTypesChart, setNextLayoutGroupByKey, setBeforeLayoutGroupByData, typesCharts } from './helpersCharts';
|
import { loadingChartsData, setBarTypesChart, setNextLayoutGroupByKey, setBeforeLayoutGroupByData, typesCharts } from './helpersCharts';
|
||||||
import { fetchColumn, prepareSetPackColumns } from '@organisms/PackColumns';
|
import { fetchColumn, prepareSetPackColumns } from '@organisms/PackColumns';
|
||||||
import { get } from '../apiHelpers';
|
// import { get } from '../apiHelpers';
|
||||||
import {equals, isEmpty, uniq} from 'ramda'
|
import {equals, isEmpty} from 'ramda'
|
||||||
|
|
||||||
const initState = {
|
const initState = {
|
||||||
leftTopButtons: leftTopButtons,
|
leftTopButtons: leftTopButtons,
|
||||||
@ -235,10 +235,10 @@ const actions = {
|
|||||||
console.error(err)
|
console.error(err)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
updateCharts: async ({commit, getters, state}, updatedData) => {
|
updateCharts: async ({commit, state}, updatedData) => {
|
||||||
try {
|
try {
|
||||||
switch(updatedData.action) {
|
switch(updatedData.action) {
|
||||||
case 'nextLayoutChart':
|
case 'nextLayoutChart': {
|
||||||
// console.log('updatedDataNext', updatedData)
|
// console.log('updatedDataNext', updatedData)
|
||||||
const prevGroupByFiltersNext = updatedData.prevGroupByFilters
|
const prevGroupByFiltersNext = updatedData.prevGroupByFilters
|
||||||
const updatedFiltersNext = {...prevGroupByFiltersNext, ...updatedData.prevGroupByData}
|
const updatedFiltersNext = {...prevGroupByFiltersNext, ...updatedData.prevGroupByData}
|
||||||
@ -250,7 +250,8 @@ const actions = {
|
|||||||
return commit('setActiveChartData', {...activeChartData, data: newData})
|
return commit('setActiveChartData', {...activeChartData, data: newData})
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case 'beforeLayoutChart':
|
}
|
||||||
|
case 'beforeLayoutChart': {
|
||||||
// console.log('updatedDataBefore', updatedData)
|
// console.log('updatedDataBefore', updatedData)
|
||||||
const prevGroupByData = updatedData.groupByInfo.prevGroupByData
|
const prevGroupByData = updatedData.groupByInfo.prevGroupByData
|
||||||
const prevGroupByFiltersBefore = updatedData.groupByInfo.prevGroupByFilters
|
const prevGroupByFiltersBefore = updatedData.groupByInfo.prevGroupByFilters
|
||||||
@ -264,7 +265,8 @@ const actions = {
|
|||||||
return commit('setActiveChartData', {...activeChartData, data: newData})
|
return commit('setActiveChartData', {...activeChartData, data: newData})
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case 'openMenuChart':
|
}
|
||||||
|
case 'openMenuChart': {
|
||||||
// console.log('updatedDataOpen', updatedData)
|
// console.log('updatedDataOpen', updatedData)
|
||||||
const openMenuChart = toRaw(state.activeMenuChartData.openMenuChart)
|
const openMenuChart = toRaw(state.activeMenuChartData.openMenuChart)
|
||||||
updatedData.groupByInfo.data[0].type = updatedData.groupByInfo.type
|
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}}
|
const toggleActiveMenuChartData = {openMenuChart: !openMenuChart, groupByInfo: {...activeChartDataMenu, data: isNotTypesChartsMenu ? updatedData.groupByInfo.data[0] : newDataMenu}}
|
||||||
commit('setActiveMenuChartData', toggleActiveMenuChartData)
|
commit('setActiveMenuChartData', toggleActiveMenuChartData)
|
||||||
break
|
break
|
||||||
case 'downloadChart':
|
}
|
||||||
|
case 'downloadChart': {
|
||||||
// console.log('updatedDataDownload', updatedData)
|
// 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 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))
|
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}}
|
const downloadActiveMenuChartData = {openMenuChart: false, groupByInfo: {...updatedData.groupByInfo, data: isNotTypesChartsDownload ? updatedData.groupByInfo.data[0] : newDataDownload}}
|
||||||
commit('setActiveMenuChartData', downloadActiveMenuChartData)
|
commit('setActiveMenuChartData', downloadActiveMenuChartData)
|
||||||
break
|
break
|
||||||
|
}
|
||||||
case 'legendFiltersParams':
|
case 'legendFiltersParams':
|
||||||
commit('setLegendFiltersParams', updatedData.data)
|
commit('setLegendFiltersParams', updatedData.data)
|
||||||
|
break
|
||||||
default: return false
|
default: return false
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@ -302,7 +307,7 @@ const actions = {
|
|||||||
console.error(err)
|
console.error(err)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
openMapModal: async ({commit, state}, machine) => {
|
openMapModal: async ({commit}, machine) => {
|
||||||
try {
|
try {
|
||||||
// Добавить запрос на получение координат
|
// Добавить запрос на получение координат
|
||||||
/*
|
/*
|
||||||
@ -317,7 +322,7 @@ const actions = {
|
|||||||
console.error(err)
|
console.error(err)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
openDataModal: async ({commit, state}, machine) => {
|
openDataModal: async ({commit}) => {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
// Добавить запрос на получение пакетов и информации о машине
|
// Добавить запрос на получение пакетов и информации о машине
|
||||||
@ -355,7 +360,7 @@ const actions = {
|
|||||||
console.error(err)
|
console.error(err)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
loadPack: async ({commit, state}, packNumber) => {
|
loadPack: async ({commit}, packNumber) => {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
/* Получение данных о пакете
|
/* Получение данных о пакете
|
||||||
@ -398,7 +403,7 @@ const actions = {
|
|||||||
console.error(err)
|
console.error(err)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
updateModePack: async ({commit, getters, state}, updatedMode) => {
|
updateModePack: async ({commit, state}, updatedMode) => {
|
||||||
try {
|
try {
|
||||||
const structPackDefault = toRaw(state.structPackDefault)
|
const structPackDefault = toRaw(state.structPackDefault)
|
||||||
const currentReport = multiReport[updatedMode] ? multiReport[updatedMode] : []
|
const currentReport = multiReport[updatedMode] ? multiReport[updatedMode] : []
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import {isEmpty, uniq} from 'ramda'
|
import {isEmpty} from 'ramda'
|
||||||
import {pagination, searchModes} from './StaticData'
|
import {searchModes} from './StaticData'
|
||||||
|
|
||||||
const prepareSelects = (selects, selectors) => {
|
const prepareSelects = (selects, selectors) => {
|
||||||
const updatedSelects = selects.reduce((acc, el) => {
|
const updatedSelects = selects.reduce((acc, el) => {
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { chartsFilterParams, chartsGroupByParams, chartsGroupByParams2, chartsFi
|
|||||||
import {cond, uniq, has, T} from 'ramda'
|
import {cond, uniq, has, T} from 'ramda'
|
||||||
|
|
||||||
const setPeriodCharts = (filterKeys) => {
|
const setPeriodCharts = (filterKeys) => {
|
||||||
if (typeof filterKeys === 'array') return {period: 'dayly', title: '24 часа'}
|
if (filterKeys && filterKeys.length > 0) return {period: 'dayly', title: '24 часа'}
|
||||||
switch(filterKeys) {
|
switch(filterKeys) {
|
||||||
case 'commun': return {period: 'yearly', title: "год"}
|
case 'commun': return {period: 'yearly', title: "год"}
|
||||||
case 'rors': return {period: 'dayly', 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 chartsBarTypesWithoutFirstLayout = (data, groupByKey, filterKey, prevGroupByData, prevGroupByFilters, groupByValue) => {
|
||||||
|
|
||||||
const groupByData = Object.groupBy(data, (el) => el['org_type_name'])
|
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}
|
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 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 xAxisData = Object.entries(groupedByGroupByKeyX).map(([key, groupArr]) => {
|
||||||
const groupByFilterData = Object.groupBy(groupArr, (el) => el[filterKey])
|
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})) : ''}))
|
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}
|
return {...chartsSetup, main: main, types: types}
|
||||||
}
|
}
|
||||||
|
|
||||||
const setBarTypesChart = (activeChartParams, prevGroupByData, prevGroupByFilters, defaultData, currentData) => {
|
const setBarTypesChart = (activeChartParams, prevGroupByData, prevGroupByFilters, defaultData) => {
|
||||||
switch (activeChartParams.type) {
|
switch (activeChartParams.type) {
|
||||||
case 'default':
|
case 'default': {
|
||||||
const dataDefault = chartsBarTypes(defaultData, activeChartParams.groupByKey, activeChartParams.filterKey, prevGroupByData, prevGroupByFilters)
|
const dataDefault = chartsBarTypes(defaultData, activeChartParams.groupByKey, activeChartParams.filterKey, prevGroupByData, prevGroupByFilters)
|
||||||
// const updatedData = currentData.types.reduce((acc, chart) => {
|
// const updatedData = currentData.types.reduce((acc, chart) => {
|
||||||
// if (chart.id === activeChartParams.id) {
|
// if (chart.id === activeChartParams.id) {
|
||||||
@ -386,17 +386,21 @@ const setBarTypesChart = (activeChartParams, prevGroupByData, prevGroupByFilters
|
|||||||
// }, [])
|
// }, [])
|
||||||
// return {main: currentData.main, types: updatedData}
|
// return {main: currentData.main, types: updatedData}
|
||||||
return dataDefault
|
return dataDefault
|
||||||
case 'without_first_layout':
|
}
|
||||||
|
case 'without_first_layout': {
|
||||||
const dataWithoutFirstLayout = chartsBarTypesWithoutFirstLayout(defaultData, activeChartParams.groupByKey, activeChartParams.filterKey, prevGroupByData, prevGroupByFilters, activeChartParams.groupByValue)
|
const dataWithoutFirstLayout = chartsBarTypesWithoutFirstLayout(defaultData, activeChartParams.groupByKey, activeChartParams.filterKey, prevGroupByData, prevGroupByFilters, activeChartParams.groupByValue)
|
||||||
return dataWithoutFirstLayout
|
return dataWithoutFirstLayout
|
||||||
case 'types':
|
}
|
||||||
|
case 'types': {
|
||||||
const dataGroupBy = chartsBarTypesGroupedBy(defaultData, activeChartParams.groupByKey, activeChartParams.filterKey, prevGroupByData, prevGroupByFilters, activeChartParams.groupByValue)
|
const dataGroupBy = chartsBarTypesGroupedBy(defaultData, activeChartParams.groupByKey, activeChartParams.filterKey, prevGroupByData, prevGroupByFilters, activeChartParams.groupByValue)
|
||||||
return dataGroupBy
|
return dataGroupBy
|
||||||
case 'ml':
|
}
|
||||||
|
case 'ml': {
|
||||||
const dataMl = chartsBarTypesGroupedByMl(defaultData, activeChartParams.groupByKey, chartsFilterKeysMl, prevGroupByData, prevGroupByFilters)
|
const dataMl = chartsBarTypesGroupedByMl(defaultData, activeChartParams.groupByKey, chartsFilterKeysMl, prevGroupByData, prevGroupByFilters)
|
||||||
return dataMl
|
return dataMl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const setNextLayoutGroupByKey = (groupByKey, prevGroupByValue) => {
|
const setNextLayoutGroupByKey = (groupByKey, prevGroupByValue) => {
|
||||||
if (prevGroupByValue === 'без типа') return null
|
if (prevGroupByValue === 'без типа') return null
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
import {equals, isEmpty} from 'ramda'
|
|
||||||
|
|
||||||
const initState = {
|
const initState = {
|
||||||
modalMachines: [],
|
modalMachines: [],
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
import {toRaw} from 'vue'
|
|
||||||
import {pages} from './StaticData'
|
import {pages} from './StaticData'
|
||||||
|
|
||||||
const initState = {
|
const initState = {
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import {toRaw} from 'vue'
|
|||||||
import {pageSettings, packStruct, packsNames, data} from './StaticData'
|
import {pageSettings, packStruct, packsNames, data} from './StaticData'
|
||||||
import {fetchColumn} from '@organisms/PackColumns';
|
import {fetchColumn} from '@organisms/PackColumns';
|
||||||
import {loadingPagination, setPagination} from './helpers';
|
import {loadingPagination, setPagination} from './helpers';
|
||||||
import {equals, is, isEmpty, uniq} from 'ramda'
|
import {isEmpty, uniq} from 'ramda'
|
||||||
import moment from'moment'
|
import moment from'moment'
|
||||||
|
|
||||||
const initState = {
|
const initState = {
|
||||||
@ -65,7 +65,7 @@ const mutations = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const actions = {
|
const actions = {
|
||||||
uploadData: async ({commit, getters, state}, params) => {
|
uploadData: async ({commit, getters}, params) => {
|
||||||
try{
|
try{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -186,7 +186,7 @@ const actions = {
|
|||||||
console.error(err)
|
console.error(err)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
updatePackSettings: async ({commit, getters, state}, updatedData) => {
|
updatePackSettings: async ({commit, getters}, updatedData) => {
|
||||||
try {
|
try {
|
||||||
console.log('updatedData', updatedData)
|
console.log('updatedData', updatedData)
|
||||||
const packsSettings = toRaw(getters.packsSettings)
|
const packsSettings = toRaw(getters.packsSettings)
|
||||||
@ -198,7 +198,7 @@ const actions = {
|
|||||||
console.error(err)
|
console.error(err)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
updateSelects: async ({dispatch, commit, getters, state}, updatedSelect) => {
|
updateSelects: async ({commit, getters}, updatedSelect) => {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
const dataSource = toRaw(getters.tableData).dataSource
|
const dataSource = toRaw(getters.tableData).dataSource
|
||||||
|
|||||||
@ -1,22 +1,22 @@
|
|||||||
const servicesNames = ["check_scand_api_2EC27AEA12AAC9E5B013", "niflheim",
|
// const servicesNames = ["check_scand_api_2EC27AEA12AAC9E5B013", "niflheim",
|
||||||
"scand_client_B0C8B117F3AB40D5869C",
|
// "scand_client_B0C8B117F3AB40D5869C",
|
||||||
"local_local_cdrp@172.25.78.64_E66972859C7734FBAB11",
|
// "local_local_cdrp@172.25.78.64_E66972859C7734FBAB11",
|
||||||
"cronex_9354617E3A5A69493AC0",
|
// "cronex_9354617E3A5A69493AC0",
|
||||||
"local_lm_api@172.25.78.153_36C091D060A018177B49",
|
// "local_lm_api@172.25.78.153_36C091D060A018177B49",
|
||||||
"db_loader_7C6C7680BAC92D4BFD8C", "sql_inserter_B2751775DD1FC358682A",
|
// "db_loader_7C6C7680BAC92D4BFD8C", "sql_inserter_B2751775DD1FC358682A",
|
||||||
"authentication_service_F2AE8881F984DFE1A4BD", "cdrp",
|
// "authentication_service_F2AE8881F984DFE1A4BD", "cdrp",
|
||||||
"asgard_82DB735B1F03E8A5BA0E", "alfheim_90556327D9DC81351EE2", "GStore",
|
// "asgard_82DB735B1F03E8A5BA0E", "alfheim_90556327D9DC81351EE2", "GStore",
|
||||||
"alfheim_1B3027982471601E45E8", "cronex", "comm_client_diap_1",
|
// "alfheim_1B3027982471601E45E8", "cronex", "comm_client_diap_1",
|
||||||
"cdrp_B2E275BA9E7E79D4D2D6", "authentication_service",
|
// "cdrp_B2E275BA9E7E79D4D2D6", "authentication_service",
|
||||||
"comm_client_diap_1_8348C79D6407CDB752FD", "sql_sup_F66176648815DC42BD4D",
|
// "comm_client_diap_1_8348C79D6407CDB752FD", "sql_sup_F66176648815DC42BD4D",
|
||||||
"periodic_tasks_228605BF57BD5DE8C94B",
|
// "periodic_tasks_228605BF57BD5DE8C94B",
|
||||||
"integration_pk_gip_F6797EF2E89795090B4D", "live_monitor_EA3F27068ABA3C4F5D7F",
|
// "integration_pk_gip_F6797EF2E89795090B4D", "live_monitor_EA3F27068ABA3C4F5D7F",
|
||||||
"snotra_EC6E797D24F8E93C536F", "thor_70B46C452D3105A6AF09",
|
// "snotra_EC6E797D24F8E93C536F", "thor_70B46C452D3105A6AF09",
|
||||||
"kudt_diag_3D0E0652B99B208E8519", "snotra", "live_monitor", "sql_sup",
|
// "kudt_diag_3D0E0652B99B208E8519", "snotra", "live_monitor", "sql_sup",
|
||||||
"comm_client_diap_2_B2FAA49D7F5EF167DF1D", "niflheim_829F2F30E9FD2539D3E7",
|
// "comm_client_diap_2_B2FAA49D7F5EF167DF1D", "niflheim_829F2F30E9FD2539D3E7",
|
||||||
"comm_client_diap_repl_6BA0746DB5CFB506AC7A", "pack_rrnr_DDCE13940E392EB3456A",
|
// "comm_client_diap_repl_6BA0746DB5CFB506AC7A", "pack_rrnr_DDCE13940E392EB3456A",
|
||||||
"local_local_live_monitor@172.25.78.151_CD55455FB92AB74F178B", "alfheim",
|
// "local_local_live_monitor@172.25.78.151_CD55455FB92AB74F178B", "alfheim",
|
||||||
"local_fuel_api@172.25.78.98_C215EA176A84C84A6CEC"]
|
// "local_fuel_api@172.25.78.98_C215EA176A84C84A6CEC"]
|
||||||
|
|
||||||
|
|
||||||
// const servicesNotConnected = [
|
// const servicesNotConnected = [
|
||||||
|
|||||||
@ -60,7 +60,7 @@ class Services {
|
|||||||
if (serviceNameArr?.length > 0) {
|
if (serviceNameArr?.length > 0) {
|
||||||
if (serviceNameArr[serviceNameArr.length - 1].length > 15)
|
if (serviceNameArr[serviceNameArr.length - 1].length > 15)
|
||||||
serviceCode = serviceNameArr[serviceNameArr.length - 1]
|
serviceCode = serviceNameArr[serviceNameArr.length - 1]
|
||||||
serviceIp = serviceNameArr.reduce((acc, el, idx) => {
|
serviceIp = serviceNameArr.reduce((acc, el) => {
|
||||||
const ipIdx = el.indexOf('@')
|
const ipIdx = el.indexOf('@')
|
||||||
if (ipIdx !== -1) {
|
if (ipIdx !== -1) {
|
||||||
acc = el.slice(ipIdx)
|
acc = el.slice(ipIdx)
|
||||||
|
|||||||
@ -52,7 +52,7 @@ const actions = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
uploadServiceData: async ({}, service) => {
|
uploadServiceData: async (service) => {
|
||||||
try{
|
try{
|
||||||
const serviceNew = new Service(service)
|
const serviceNew = new Service(service)
|
||||||
serviceNew.getCashe(service)
|
serviceNew.getCashe(service)
|
||||||
|
|||||||
@ -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 ServiceOfMachines from "@services/ServiceOfMachines.js"
|
||||||
import {AdapterOfMachines, appModalListMachines} from "@mocks/machines.js"
|
import {AdapterOfMachines, appModalListMachines} from "@mocks/machines.js"
|
||||||
import { createStore } from "vuex"
|
import { createStore } from "vuex"
|
||||||
@ -23,12 +23,6 @@ describe('test ServiceOfMachines', () => {
|
|||||||
expect(result).toEqual(appModalListMachines)
|
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 () => {
|
test('test makeFetchAndPutModalMachines', async () => {
|
||||||
const funcResult = await serviceOfMachines.makeFetchAndPutModalMachines()
|
const funcResult = await serviceOfMachines.makeFetchAndPutModalMachines()
|
||||||
const storeResult = store.getters['machines/modalMachines']
|
const storeResult = store.getters['machines/modalMachines']
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user