事件展示-数据来源如果便携式设备或治理设备没数据则不展示
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
v-model="tableStore.table.params.cascader"
|
v-model="tableStore.table.params.cascader"
|
||||||
placeholder="请选择数据来源"
|
placeholder="请选择数据来源"
|
||||||
@change="sourceChange"
|
@change="sourceChange"
|
||||||
:options="props.deviceTree"
|
:options="deviceTreeOptions"
|
||||||
:show-all-levels="false"
|
:show-all-levels="false"
|
||||||
:props="{ checkStrictly: true }"
|
:props="{ checkStrictly: true }"
|
||||||
clearable
|
clearable
|
||||||
@@ -103,21 +103,27 @@ tableStore.table.params.status = ''
|
|||||||
tableStore.table.params.target = []
|
tableStore.table.params.target = []
|
||||||
tableStore.table.params.userId = ''
|
tableStore.table.params.userId = ''
|
||||||
|
|
||||||
|
const deviceTreeOptions = ref<any>(props.deviceTree)
|
||||||
|
deviceTreeOptions.value.map((item: any, index: any) => {
|
||||||
|
if (item.children.length == 0) {
|
||||||
|
deviceTreeOptions.value.splice(index, 1)
|
||||||
|
}
|
||||||
|
})
|
||||||
const sourceChange = (e: any) => {
|
const sourceChange = (e: any) => {
|
||||||
tableStore.table.params.engineeringid = e[1] || ''
|
tableStore.table.params.engineeringid = e[1] || ''
|
||||||
tableStore.table.params.projectId = e[2] || ''
|
tableStore.table.params.projectId = e[2] || ''
|
||||||
const zlIndex = props.deviceTree.findIndex((item: any) => {
|
const zlIndex = deviceTreeOptions.value.findIndex((item: any) => {
|
||||||
return item.name == '治理设备'
|
return item.name == '治理设备'
|
||||||
})
|
})
|
||||||
const bxsIndex = props.deviceTree.findIndex((item: any) => {
|
const bxsIndex = deviceTreeOptions.value.findIndex((item: any) => {
|
||||||
return item.name == '便携式设备'
|
return item.name == '便携式设备'
|
||||||
})
|
})
|
||||||
//便携式设备特殊处理
|
//便携式设备特殊处理
|
||||||
if (props.deviceTree[bxsIndex].id == e[0] && e.length == 2) {
|
if (bxsIndex != -1 && deviceTreeOptions.value[bxsIndex].id == e[0] && e.length == 2) {
|
||||||
tableStore.table.params.deviceId = e[1]
|
tableStore.table.params.deviceId = e[1]
|
||||||
}
|
}
|
||||||
//治理设备
|
//治理设备
|
||||||
if (props.deviceTree[zlIndex].id == e[0]) {
|
if (zlIndex != -1 && deviceTreeOptions.value[zlIndex].id == e[0]) {
|
||||||
tableStore.table.params.deviceId = e[2] || ''
|
tableStore.table.params.deviceId = e[2] || ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
v-model="tableStore.table.params.cascader"
|
v-model="tableStore.table.params.cascader"
|
||||||
placeholder="请选择数据来源"
|
placeholder="请选择数据来源"
|
||||||
@change="sourceChange"
|
@change="sourceChange"
|
||||||
:options="props.deviceTree"
|
:options="deviceTreeOptions"
|
||||||
:show-all-levels="false"
|
:show-all-levels="false"
|
||||||
:props="{ checkStrictly: true }"
|
:props="{ checkStrictly: true }"
|
||||||
clearable
|
clearable
|
||||||
@@ -102,25 +102,30 @@ tableStore.table.params.userId = ''
|
|||||||
tableStore.table.params.cascader = ''
|
tableStore.table.params.cascader = ''
|
||||||
// tableStore.table.params.level=''
|
// tableStore.table.params.level=''
|
||||||
|
|
||||||
|
const deviceTreeOptions = ref<any>(props.deviceTree)
|
||||||
|
deviceTreeOptions.value.map((item: any, index: any) => {
|
||||||
|
if (item.children.length == 0) {
|
||||||
|
deviceTreeOptions.value.splice(index, 1)
|
||||||
|
}
|
||||||
|
})
|
||||||
const sourceChange = (e: any) => {
|
const sourceChange = (e: any) => {
|
||||||
tableStore.table.params.engineeringid = e[1] || ''
|
tableStore.table.params.engineeringid = e[1] || ''
|
||||||
tableStore.table.params.projectId = e[2] || ''
|
tableStore.table.params.projectId = e[2] || ''
|
||||||
const zlIndex = props.deviceTree.findIndex((item: any) => {
|
const zlIndex = deviceTreeOptions.value.findIndex((item: any) => {
|
||||||
return item.name == '治理设备'
|
return item.name == '治理设备'
|
||||||
})
|
})
|
||||||
const bxsIndex = props.deviceTree.findIndex((item: any) => {
|
const bxsIndex = deviceTreeOptions.value.findIndex((item: any) => {
|
||||||
return item.name == '便携式设备'
|
return item.name == '便携式设备'
|
||||||
})
|
})
|
||||||
//便携式设备特殊处理
|
//便携式设备特殊处理
|
||||||
if (props.deviceTree[bxsIndex].id == e[0] && e.length == 2) {
|
if (bxsIndex != -1 && deviceTreeOptions.value[bxsIndex].id == e[0] && e.length == 2) {
|
||||||
tableStore.table.params.deviceId = e[1]
|
tableStore.table.params.deviceId = e[1]
|
||||||
}
|
}
|
||||||
//治理设备
|
//治理设备
|
||||||
if (props.deviceTree[zlIndex].id == e[0]) {
|
if (zlIndex != -1 && deviceTreeOptions.value[zlIndex].id == e[0]) {
|
||||||
tableStore.table.params.deviceId = e[2] || ''
|
tableStore.table.params.deviceId = e[2] || ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
placeholder="请选择数据来源"
|
placeholder="请选择数据来源"
|
||||||
@change="sourceChange"
|
@change="sourceChange"
|
||||||
v-model="tableStore.table.params.cascader"
|
v-model="tableStore.table.params.cascader"
|
||||||
:options="props.deviceTree"
|
:options="deviceTreeOptions"
|
||||||
:show-all-levels="false"
|
:show-all-levels="false"
|
||||||
:props="{ checkStrictly: true }"
|
:props="{ checkStrictly: true }"
|
||||||
clearable
|
clearable
|
||||||
@@ -215,21 +215,27 @@ tableStore.table.params.userId = ''
|
|||||||
tableStore.table.params.cascader = ''
|
tableStore.table.params.cascader = ''
|
||||||
// tableStore.table.params.level=''
|
// tableStore.table.params.level=''
|
||||||
|
|
||||||
|
const deviceTreeOptions = ref<any>(props.deviceTree)
|
||||||
|
deviceTreeOptions.value.map((item: any, index: any) => {
|
||||||
|
if (item.children.length == 0) {
|
||||||
|
deviceTreeOptions.value.splice(index, 1)
|
||||||
|
}
|
||||||
|
})
|
||||||
const sourceChange = (e: any) => {
|
const sourceChange = (e: any) => {
|
||||||
tableStore.table.params.engineeringid = e[1] || ''
|
tableStore.table.params.engineeringid = e[1] || ''
|
||||||
tableStore.table.params.projectId = e[2] || ''
|
tableStore.table.params.projectId = e[2] || ''
|
||||||
const zlIndex = props.deviceTree.findIndex((item: any) => {
|
const zlIndex = deviceTreeOptions.value.findIndex((item: any) => {
|
||||||
return item.name == '治理设备'
|
return item.name == '治理设备'
|
||||||
})
|
})
|
||||||
const bxsIndex = props.deviceTree.findIndex((item: any) => {
|
const bxsIndex = deviceTreeOptions.value.findIndex((item: any) => {
|
||||||
return item.name == '便携式设备'
|
return item.name == '便携式设备'
|
||||||
})
|
})
|
||||||
//便携式设备特殊处理
|
//便携式设备特殊处理
|
||||||
if (props.deviceTree[bxsIndex].id == e[0] && e.length == 2) {
|
if (bxsIndex != -1 && deviceTreeOptions.value[bxsIndex].id == e[0] && e.length == 2) {
|
||||||
tableStore.table.params.deviceId = e[1]
|
tableStore.table.params.deviceId = e[1]
|
||||||
}
|
}
|
||||||
//治理设备
|
//治理设备
|
||||||
if (props.deviceTree[zlIndex].id == e[0]) {
|
if (zlIndex != -1 && deviceTreeOptions.value[zlIndex].id == e[0]) {
|
||||||
tableStore.table.params.deviceId = e[2] || ''
|
tableStore.table.params.deviceId = e[2] || ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user