diff --git a/src/views/govern/device/planData/index.vue b/src/views/govern/device/planData/index.vue index c2f1af9..d46e612 100644 --- a/src/views/govern/device/planData/index.vue +++ b/src/views/govern/device/planData/index.vue @@ -26,7 +26,7 @@ :name="item.id" :key="index" > - + {{ item.itemName }} @@ -69,13 +69,11 @@ {{ item.startTime }} - {{ item.endTime }} - {{ item.location }} @@ -98,9 +96,9 @@
+ { queryCsDictTree(res.data.id).then(item => { indexOptions.value = item.data - searchForm.value.index[0] = indexOptions.value[0].id + // searchForm.value.index[0] = indexOptions.value[0].id + searchForm.value.index = indexOptions.value[0].id }) queryStatistical(res.data.id).then(vv => { legendDictList.value = vv.data @@ -278,11 +277,14 @@ const init = async () => { // 选择指标的时候切换legend内容和data数据 let list: any = [] legendDictList.value?.selectedList?.map((item: any) => { - searchForm.value.index.map((vv: any) => { - if (item.dataType == vv) { - list.push(item.eleEpdPqdVOS) - } - }) + // searchForm.value.index.map((vv: any) => { + // if (item.dataType == vv) { + // list.push(item.eleEpdPqdVOS) + // } + // }) + if (item.dataType == searchForm.value.index) { + list.push(item.eleEpdPqdVOS) + } }) //颜色数组 @@ -302,7 +304,7 @@ const init = async () => { ] if (historyDevId.value) { //选择的指标使用方法处理 - initSearchFormIndexAndCount(searchForm.value.index) + initSearchFormIndexAndCount([searchForm.value.index]) //查询历史趋势 historyDataList.value = [] loading.value = true @@ -320,11 +322,13 @@ const init = async () => { } else { middleTitle = '' } + let indexList=[] + indexList=[searchForm.value.index] chartTitle.value = deviceData.value.itemName + '_' + middleTitle + '_' - searchForm.value.index.map((item: any, indexs: any) => { + indexList.map((item: any, indexs: any) => { indexOptions.value.map((vv: any) => { if (vv.id == item) { - chartTitle.value += indexs == searchForm.value.index.length - 1 ? vv.name : vv.name + '/' + chartTitle.value += indexs == indexList.length - 1 ? vv.name : vv.name + '/' } }) }) @@ -333,7 +337,7 @@ const init = async () => { console.log(item.count, '878888888') lists[index] = { statisticalId: item.index, - frequencys: item.count&& item.count.length != 0 ?[ item.count] : [] + frequencys: item.count && item.count.length != 0 ? [item.count] : [] } }) let obj = { @@ -362,6 +366,7 @@ const init = async () => { unitList.push(item.unit) } }) + console.log(timeList, '+++++++++++') xAxis = timeList.sort((a: any, b: any) => { return ( a.replace('-', '').replace('-', '').replace(' ', '').replace(':', '').replace(':', '') - @@ -761,7 +766,7 @@ const initSearchFormIndexAndCount = (list: any) => { } } watch( - () => searchForm.value.index, + () => [searchForm.value.index], (val: any, oldval: any) => { if (val) { initSearchFormIndexAndCount(val) @@ -784,7 +789,8 @@ watch( immediate: true } ) -onMounted(() => {}) +onMounted(() => { +})