修改事件展示查询问题

This commit is contained in:
GGJ
2024-10-10 09:56:34 +08:00
parent bef7796668
commit 3958928ebb
10 changed files with 203 additions and 192 deletions

View File

@@ -2,25 +2,15 @@
<TableHeader datePicker ref="refheader">
<template v-slot:select>
<el-form-item label="数据来源">
<el-cascader
v-model="tableStore.table.params.cascader"
placeholder="请选择数据来源"
@change="sourceChange"
:options="deviceTreeOptions"
:show-all-levels="false"
:props="{ checkStrictly: true }"
clearable
></el-cascader>
<el-cascader v-model="tableStore.table.params.cascader" placeholder="请选择数据来源" @change="sourceChange"
:options="deviceTreeOptions" :show-all-levels="false" :props="{ checkStrictly: true }"
clearable></el-cascader>
<!-- <el-input v-model="tableStore.table.params.searchValue" placeholder="请输入设备名称" /> -->
</el-form-item>
<el-form-item label="级别">
<el-select v-model="tableStore.table.params.level" placeholder="请选择级别" clearable>
<el-option
v-for="item in rankOptions"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
<el-option v-for="item in rankOptions" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</template>
@@ -70,7 +60,7 @@ const rankOptions = ref([
])
const tableStore = new TableStore({
url: '/cs-harmonic-boot/eventUser/queryEventpage',
url: '/cs-harmonic-boot/eventUser/queryEventpageWeb',
method: 'POST',
publicHeight: 65,
column: [
@@ -82,9 +72,7 @@ const tableStore = new TableStore({
{ title: '发生时刻', field: 'startTime', align: 'center' }
],
beforeSearchFun: () => {
if (!tableStore.table.params.deviceId) {
delete tableStore.table.params.deviceId
}
}
})
@@ -102,6 +90,7 @@ tableStore.table.params.eventIds = []
tableStore.table.params.status = ''
tableStore.table.params.target = []
tableStore.table.params.userId = ''
tableStore.table.params.deviceTypeId = ''
const deviceTreeOptions = ref<any>(props.deviceTree)
deviceTreeOptions.value.map((item: any, index: any) => {
@@ -110,21 +99,24 @@ deviceTreeOptions.value.map((item: any, index: any) => {
}
})
const sourceChange = (e: any) => {
tableStore.table.params.engineeringid = e[1] || ''
tableStore.table.params.projectId = e[2] || ''
const zlIndex = deviceTreeOptions.value.findIndex((item: any) => {
return item.name == '治理设备'
})
const bxsIndex = deviceTreeOptions.value.findIndex((item: any) => {
return item.name == '便携式设备'
})
//便携式设备特殊处理
if (bxsIndex != -1 && deviceTreeOptions.value[bxsIndex].id == e[0] && e.length == 2) {
tableStore.table.params.deviceId = e[1]
}
//治理设备
if (zlIndex != -1 && deviceTreeOptions.value[zlIndex].id == e[0]) {
tableStore.table.params.deviceId = e[2] || ''
tableStore.table.params.deviceTypeId = ''
tableStore.table.params.engineeringid = ''
tableStore.table.params.projectId = ''
tableStore.table.params.deviceId = ''
if (e) {
let name = deviceTreeOptions.value.filter((item: any) => {
return item.id == e[0]
})[0].name
if (name == '便携式设备') {
tableStore.table.params.deviceTypeId = e[0] || ''
tableStore.table.params.deviceId = e[1] || ''
} else {
tableStore.table.params.deviceTypeId = e[0] || ''
tableStore.table.params.engineeringid = e[1] || ''
tableStore.table.params.projectId = e[2] || ''
}
}
}
@@ -134,6 +126,6 @@ onMounted(() => {
setTimeout(() => {
// tableStore.table.height = mainHeight(200).height as any
}, 0)
const addMenu = () => {}
const addMenu = () => { }
</script>
<style></style>