diff --git a/src/components/tree/govern/pointTree.vue b/src/components/tree/govern/pointTree.vue
index 475d8d3..ee3848f 100644
--- a/src/components/tree/govern/pointTree.vue
+++ b/src/components/tree/govern/pointTree.vue
@@ -1,86 +1,121 @@
-
+
diff --git a/src/views/govern/device/planData/components/schemeTree.vue b/src/views/govern/device/planData/components/schemeTree.vue
index f71faca..cb61af6 100644
--- a/src/views/govern/device/planData/components/schemeTree.vue
+++ b/src/views/govern/device/planData/components/schemeTree.vue
@@ -136,6 +136,8 @@ const emit = defineEmits(['init', 'checkChange', 'nodeChange', 'editNode', 'getC
const config = useConfig()
const tree = ref()
const treRef = ref()
+const id = ref(null)
+const treeData = ref({})
//获取方案树形数据
const getTreeList = () => {
getSchemeTree().then(res => {
@@ -152,11 +154,13 @@ const getTreeList = () => {
tree.value = res.data
nextTick(() => {
if (arr.length) {
- treRef.value.setCurrentKey(arr[0].id)
+
+ treRef.value.setCurrentKey(id.value || arr[0].id)
+ let list= id.value ? arr.find((item: any) => item.id == id.value) : arr[0]
// 注册父组件事件
emit('init', {
level: 2,
- ...arr[0]
+ ...list
})
} else {
emit('init')
@@ -238,9 +242,13 @@ const del = (node: Node, data: any) => {
const cancelDel = () => { }
const clickNode = (e: anyObj) => {
e.children ? (planId.value = e.id) : (planId.value = e.pid)
+ id.value = e.id
+
emit('nodeChange', e)
}
const setCheckedNode = (e: anyObj) => {
+ console.log("🚀 ~ setCheckedNode ~ e:", e)
+ id.value=e
treRef.value.setCurrentKey(e)
}
watch(
diff --git a/src/views/govern/device/planData/index.vue b/src/views/govern/device/planData/index.vue
index 1ef55d0..f62cb9d 100644
--- a/src/views/govern/device/planData/index.vue
+++ b/src/views/govern/device/planData/index.vue
@@ -244,11 +244,15 @@ const historyDevId: any = ref('')
const chartTitle: any = ref('')
//点击测试项切换树节点
const handleClickTabs = async () => {
+ searchForm.value.index = [indexOptions.value[0].id]
historyDevId.value = activeName.value
schemeTreeRef.value.setCheckedNode(activeName.value)
- await init(true)
+ setTimeout(() => {
+ init(true)
+ }, 100);
}
const nodeClick = async (e: anyObj) => {
+ console.log("🚀 ~ nodeClick ~ e:", e)
loading.value = true
deviceData.value = []
historyDevId.value = e.children && e.children.length != 0 ? e.children[0].id : e.id
@@ -274,7 +278,7 @@ const nodeClick = async (e: anyObj) => {
schemeTreeRef.value.getPlanData(deviceData.value)
await setTimeout(() => {
init(true)
- }, 500);
+ }, 100);
loading.value = false
})
diff --git a/src/views/govern/reportCore/statistics/index.vue b/src/views/govern/reportCore/statistics/index.vue
index 291d017..9f8afcc 100644
--- a/src/views/govern/reportCore/statistics/index.vue
+++ b/src/views/govern/reportCore/statistics/index.vue
@@ -2,7 +2,8 @@
-
+
@@ -104,13 +105,20 @@ onMounted(() => {
size.value = Math.round((180 / dom.offsetHeight) * 100)
}
})
-getTemplateByDept({ id: dictData.state.area[0].id }).then((res: any) => {
- templatePolicy.value = res.data
- Template.value = res.data[0]
- reportForm.value = res.data[0]?.reportForm
-})
+// getTemplateByDept({ id: dictData.state.area[0].id }).then((res: any) => {
+// templatePolicy.value = res.data
+
+// })
+
+const stencil=(val: any) => {
+ console.log("🚀 ~ Policy ~ val:", val)
+ templatePolicy.value =val
+ Template.value =val[0]
+ reportForm.value =val[0]?.reportForm
+
+}
const changetype = (val: any) => {
reportForm.value = val.reportForm
@@ -122,7 +130,7 @@ const handleNodeClick = (data: any, node: any) => {
dotList.value = data
setTimeout(() => {
tableStore.index()
- },500)
+ }, 500)
}
}