|
|
|
@ -30,11 +30,9 @@ |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<vue3-tree-org |
|
|
|
|
ref="treeOrgRef" |
|
|
|
|
:data="dataList" |
|
|
|
|
center |
|
|
|
|
collapsable |
|
|
|
|
:default-expand-keys="lastExpendKeys" |
|
|
|
|
:props="treeProps" |
|
|
|
|
@on-node-click="handleClickNode" |
|
|
|
|
> |
|
|
|
@ -76,7 +74,7 @@ |
|
|
|
|
</template> |
|
|
|
|
</vue3-tree-org> |
|
|
|
|
<DialogOkr ref="dialogOkr" @edit="handleEditOkr" /> |
|
|
|
|
<DialogOkrInfo ref="dialogOkrInfo" @close="openOkr" @success="resetTreeData" /> |
|
|
|
|
<DialogOkrInfo ref="dialogOkrInfo" @close="openOkr" /> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
@ -91,7 +89,6 @@ import { listToTree } from '@/utils/tree' |
|
|
|
|
|
|
|
|
|
const dataList = ref({}) |
|
|
|
|
const helpDataList = ref([]) |
|
|
|
|
const lastExpendKeys = ref([]) |
|
|
|
|
const treeProps = { |
|
|
|
|
children: 'children', |
|
|
|
|
label: 'nodeName', |
|
|
|
@ -109,7 +106,6 @@ const peroidList = ref([]) |
|
|
|
|
handleSearchPeroid() |
|
|
|
|
|
|
|
|
|
function handleSearchPeroid() { |
|
|
|
|
lastExpendKeys.value = [] |
|
|
|
|
getOkrRelationTree().then((resp) => { |
|
|
|
|
peroidList.value = resp |
|
|
|
|
if (resp && resp.length && !searchForm.value.nodeId) { |
|
|
|
@ -120,43 +116,6 @@ function handleSearchPeroid() { |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const treeOrgRef = ref(null) |
|
|
|
|
function resetTreeData() { |
|
|
|
|
if (treeOrgRef.value) { |
|
|
|
|
lastExpendKeys.value = treeOrgRef.value.getExpandKeys() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 重新获取tree数据 |
|
|
|
|
getOkrRelationTree().then((resp) => { |
|
|
|
|
peroidList.value = resp |
|
|
|
|
if (resp && resp.length) { |
|
|
|
|
if (!searchForm.value.nodeId) { |
|
|
|
|
searchForm.value.nodeId = resp[0].nodeId |
|
|
|
|
searchForm.value.nodeName = resp[0].nodeName |
|
|
|
|
} |
|
|
|
|
getOkrRelationTreeChildren({ |
|
|
|
|
nodeId: searchForm.value.nodeId |
|
|
|
|
}).then((resp) => { |
|
|
|
|
const tree = listToTree(resp, { |
|
|
|
|
id: 'nodeId', |
|
|
|
|
pid: 'parentId', |
|
|
|
|
children: 'children' |
|
|
|
|
}) |
|
|
|
|
// // 设置展开的keys |
|
|
|
|
// if (treeOrgRef.value) { |
|
|
|
|
// treeOrgRef.value.setExpandKeys(lastExpendKeys.value) |
|
|
|
|
// } |
|
|
|
|
helpDataList.value = resp |
|
|
|
|
if (tree && tree.length) { |
|
|
|
|
dataList.value = tree[0] |
|
|
|
|
} else { |
|
|
|
|
dataList.value = {} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function getOkrList() { |
|
|
|
|
getOkrRelationTreeChildren({ |
|
|
|
|
nodeId: searchForm.value.nodeId |
|
|
|
|