历史趋势图参数修改:指标多选改为单选
This commit is contained in:
@@ -26,7 +26,7 @@
|
|||||||
:name="item.id"
|
:name="item.id"
|
||||||
:key="index"
|
:key="index"
|
||||||
>
|
>
|
||||||
<el-descriptions value="small" class="mb10" :column="4" border>
|
<el-descriptions value="small" class="mb10" :column="6" border>
|
||||||
<el-descriptions-item label="测试项名称" width="160">
|
<el-descriptions-item label="测试项名称" width="160">
|
||||||
{{ item.itemName }}
|
{{ item.itemName }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
@@ -69,13 +69,11 @@
|
|||||||
<span style="width: 140px; overflow: hidden; display: block">
|
<span style="width: 140px; overflow: hidden; display: block">
|
||||||
{{ item.startTime }}
|
{{ item.startTime }}
|
||||||
</span>
|
</span>
|
||||||
<!-- {{ item.startTime }} -->
|
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="结束时间" width="160">
|
<el-descriptions-item label="结束时间" width="160">
|
||||||
<span style="width: 140px; overflow: hidden; display: block">
|
<span style="width: 140px; overflow: hidden; display: block">
|
||||||
{{ item.endTime }}
|
{{ item.endTime }}
|
||||||
</span>
|
</span>
|
||||||
<!-- {{ item.endTime }} -->
|
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="监测位置" width="160">
|
<el-descriptions-item label="监测位置" width="160">
|
||||||
{{ item.location }}
|
{{ item.location }}
|
||||||
@@ -98,9 +96,9 @@
|
|||||||
<div class="history_header">
|
<div class="history_header">
|
||||||
<el-form :model="searchForm" class="history_select" id="history_select">
|
<el-form :model="searchForm" class="history_select" id="history_select">
|
||||||
<el-form-item label="统计指标" label-width="80px">
|
<el-form-item label="统计指标" label-width="80px">
|
||||||
|
<!-- multiple
|
||||||
|
:multiple-limit="3" -->
|
||||||
<el-select
|
<el-select
|
||||||
multiple
|
|
||||||
:multiple-limit="3"
|
|
||||||
collapse-tags
|
collapse-tags
|
||||||
collapse-tags-tooltip
|
collapse-tags-tooltip
|
||||||
v-model="searchForm.index"
|
v-model="searchForm.index"
|
||||||
@@ -205,7 +203,7 @@ const typeOptions = [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
searchForm.value = {
|
searchForm.value = {
|
||||||
index: [],
|
index: '',
|
||||||
type: typeOptions[0].id,
|
type: typeOptions[0].id,
|
||||||
count: []
|
count: []
|
||||||
}
|
}
|
||||||
@@ -219,7 +217,8 @@ const legendDictList: any = ref([])
|
|||||||
queryByCode('portable-harmonic').then(res => {
|
queryByCode('portable-harmonic').then(res => {
|
||||||
queryCsDictTree(res.data.id).then(item => {
|
queryCsDictTree(res.data.id).then(item => {
|
||||||
indexOptions.value = item.data
|
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 => {
|
queryStatistical(res.data.id).then(vv => {
|
||||||
legendDictList.value = vv.data
|
legendDictList.value = vv.data
|
||||||
@@ -278,11 +277,14 @@ const init = async () => {
|
|||||||
// 选择指标的时候切换legend内容和data数据
|
// 选择指标的时候切换legend内容和data数据
|
||||||
let list: any = []
|
let list: any = []
|
||||||
legendDictList.value?.selectedList?.map((item: any) => {
|
legendDictList.value?.selectedList?.map((item: any) => {
|
||||||
searchForm.value.index.map((vv: any) => {
|
// searchForm.value.index.map((vv: any) => {
|
||||||
if (item.dataType == vv) {
|
// if (item.dataType == vv) {
|
||||||
list.push(item.eleEpdPqdVOS)
|
// list.push(item.eleEpdPqdVOS)
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
|
if (item.dataType == searchForm.value.index) {
|
||||||
|
list.push(item.eleEpdPqdVOS)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
//颜色数组
|
//颜色数组
|
||||||
@@ -302,7 +304,7 @@ const init = async () => {
|
|||||||
]
|
]
|
||||||
if (historyDevId.value) {
|
if (historyDevId.value) {
|
||||||
//选择的指标使用方法处理
|
//选择的指标使用方法处理
|
||||||
initSearchFormIndexAndCount(searchForm.value.index)
|
initSearchFormIndexAndCount([searchForm.value.index])
|
||||||
//查询历史趋势
|
//查询历史趋势
|
||||||
historyDataList.value = []
|
historyDataList.value = []
|
||||||
loading.value = true
|
loading.value = true
|
||||||
@@ -320,11 +322,13 @@ const init = async () => {
|
|||||||
} else {
|
} else {
|
||||||
middleTitle = ''
|
middleTitle = ''
|
||||||
}
|
}
|
||||||
|
let indexList=[]
|
||||||
|
indexList=[searchForm.value.index]
|
||||||
chartTitle.value = deviceData.value.itemName + '_' + middleTitle + '_'
|
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) => {
|
indexOptions.value.map((vv: any) => {
|
||||||
if (vv.id == item) {
|
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')
|
console.log(item.count, '878888888')
|
||||||
lists[index] = {
|
lists[index] = {
|
||||||
statisticalId: item.index,
|
statisticalId: item.index,
|
||||||
frequencys: item.count&& item.count.length != 0 ?[ item.count] : []
|
frequencys: item.count && item.count.length != 0 ? [item.count] : []
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
let obj = {
|
let obj = {
|
||||||
@@ -362,6 +366,7 @@ const init = async () => {
|
|||||||
unitList.push(item.unit)
|
unitList.push(item.unit)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
console.log(timeList, '+++++++++++')
|
||||||
xAxis = timeList.sort((a: any, b: any) => {
|
xAxis = timeList.sort((a: any, b: any) => {
|
||||||
return (
|
return (
|
||||||
a.replace('-', '').replace('-', '').replace(' ', '').replace(':', '').replace(':', '') -
|
a.replace('-', '').replace('-', '').replace(' ', '').replace(':', '').replace(':', '') -
|
||||||
@@ -761,7 +766,7 @@ const initSearchFormIndexAndCount = (list: any) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
watch(
|
watch(
|
||||||
() => searchForm.value.index,
|
() => [searchForm.value.index],
|
||||||
(val: any, oldval: any) => {
|
(val: any, oldval: any) => {
|
||||||
if (val) {
|
if (val) {
|
||||||
initSearchFormIndexAndCount(val)
|
initSearchFormIndexAndCount(val)
|
||||||
@@ -784,7 +789,8 @@ watch(
|
|||||||
immediate: true
|
immediate: true
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
onMounted(() => {})
|
onMounted(() => {
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
Reference in New Issue
Block a user