修改页面重置不生效问题
This commit is contained in:
@@ -213,12 +213,12 @@ const treeData = ref()
|
||||
const loadData = () => {
|
||||
initDetpStataionTree({ orgId: dictData.state.area[0].id }).then(res => {
|
||||
treeList.value = res.data
|
||||
initDetpStataionTree({ orgId: '02d1b4e1680413eb72f3fa63d46c496c' }).then(res => {
|
||||
treeListCgy.value = res.data
|
||||
setTimeout(() => {
|
||||
changeArea()
|
||||
}, 10)
|
||||
})
|
||||
// initDetpStataionTree({ orgId: '02d1b4e1680413eb72f3fa63d46c496c' }).then(res => {
|
||||
// treeListCgy.value = res.data
|
||||
setTimeout(() => {
|
||||
changeArea()
|
||||
}, 10)
|
||||
// })
|
||||
})
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ const submitFn = async (flag: boolean) => {
|
||||
}
|
||||
addForm.saveOrCheckflag = '1'
|
||||
|
||||
await addSurveyPlan(addForm).then(res => {
|
||||
await addSurveyPlan(addForm).then(res => {
|
||||
cancelFn()
|
||||
ElMessage.success('保存成功!')
|
||||
emit('onsubmit')
|
||||
@@ -263,7 +263,7 @@ const submitFn = async (flag: boolean) => {
|
||||
emit('onsubmit')
|
||||
})
|
||||
} else {
|
||||
await updateSurveyPlan(addForm).then(res => {
|
||||
await updateSurveyPlan(addForm).then(res => {
|
||||
cancelFn()
|
||||
ElMessage.success('重新发起成功!')
|
||||
emit('onsubmit')
|
||||
@@ -283,14 +283,30 @@ const changeArea = () => {
|
||||
treeList.value.forEach((item: any) => {
|
||||
if (item.id == form.value.deptId) {
|
||||
list.push(item)
|
||||
if (item.id != treeListCgy.value[0].id && item.name != '冀北电力有限公司' && item.name != '超高压') {
|
||||
list.push(...treeListCgy.value)
|
||||
}
|
||||
|
||||
} else {
|
||||
list.push(item.children.filter((v: any) => v.id == form.value.deptId)[0])
|
||||
if (form.value.deptId != treeListCgy.value[0].id) {
|
||||
list.push(...treeListCgy.value)
|
||||
if (item.children.filter((v: any) => v.id == form.value.deptId).length == 0) {
|
||||
item.children.forEach((v: any) => {
|
||||
list.push(v.children.filter((K: any) => K.id == form.value.deptId)[0])
|
||||
})
|
||||
// list.push(item.children.filter((v: any) => {
|
||||
// return (v.children.filter((k: any) => {
|
||||
// if( k.id == form.value.deptId){
|
||||
// return k
|
||||
// }
|
||||
// }))
|
||||
// }))
|
||||
console.log("🚀 ~ list.push ~ list:", list)
|
||||
|
||||
|
||||
} else {
|
||||
list.push(item.children.filter((v: any) => v.id == form.value.deptId)[0])
|
||||
}
|
||||
|
||||
|
||||
// if (form.value.deptId != treeListCgy.value[0].id) {
|
||||
// list.push(...treeListCgy.value)
|
||||
// }
|
||||
}
|
||||
})
|
||||
treeData.value = list
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<template>
|
||||
<div class='default-main'>
|
||||
<TableHeader>
|
||||
<template v-slot:select>
|
||||
<template #select>
|
||||
<el-form-item label='关键词'>
|
||||
<el-input
|
||||
v-model='tableStore.table.params.searchValue'
|
||||
clearable
|
||||
placeholder='关键词模糊查询'
|
||||
placeholder='输入用户名、行业'
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label='区域'>
|
||||
@@ -161,11 +161,11 @@ const tableStore = new TableStore({
|
||||
if (tableStore.table.params.addr) {
|
||||
tableStore.table.params.addrStrOption = tableStore.table.params.addr.map(tempArray => tempArray.join('/'))
|
||||
}
|
||||
for (let key in tableStore.table.params) {
|
||||
if (tableStore.table.params[key] === '') {
|
||||
delete tableStore.table.params[key]
|
||||
}
|
||||
}
|
||||
// for (let key in tableStore.table.params) {
|
||||
// if (tableStore.table.params[key] === '') {
|
||||
// delete tableStore.table.params[key]
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user