|
@@ -82,29 +82,30 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { nextTick, onMounted, ref, watch } from 'vue'
|
|
|
-import { arrToId, formValidate, getArrValue, getObjValue, getRandom } from 'js-fast-way'
|
|
|
-import unitApi from '~api/project/debit/project/unit.js'
|
|
|
-import { useAppStore } from '~src/store'
|
|
|
+import { computed, nextTick, onMounted, ref, watch } from 'vue'
|
|
|
+import { arrToId, formValidate, getArrValue, getObjValue, getRandom, isNullES } from 'js-fast-way'
|
|
|
+import unitApi from '~api/project/debit/project/unit'
|
|
|
import { getStoreValue, setStoreValue } from '~src/utils/storage'
|
|
|
import { getDictionaryBiz } from '~api/other'
|
|
|
-
|
|
|
+import { useAppStore } from '~src/store'
|
|
|
|
|
|
import { HcDelMsg } from 'hc-vue3-ui'
|
|
|
const useAppState = useAppStore()
|
|
|
-const projectId = ref(useAppState.getProjectId || '')
|
|
|
+const projectId = computed(() => useAppState.getProjectId || '')
|
|
|
+
|
|
|
//监听
|
|
|
-watch(() => [
|
|
|
-useAppState.getProjectId,
|
|
|
-], ([pid]) => {
|
|
|
- if (pid) {
|
|
|
+watch(() => projectId.value, (pid) => {
|
|
|
+ if (isNullES(pid)) {
|
|
|
+ ishowTree.value = false
|
|
|
+ return
|
|
|
+ }
|
|
|
projectId.value = pid
|
|
|
ishowTree.value = false
|
|
|
setTimeout(() => {
|
|
|
ishowTree.value = true
|
|
|
}, 100)
|
|
|
- }
|
|
|
})
|
|
|
+
|
|
|
defineOptions({
|
|
|
name: 'ProjectDebitProjectUnit',
|
|
|
})
|
|
@@ -113,6 +114,7 @@ const uuid = getRandom(4)
|
|
|
|
|
|
//渲染完成
|
|
|
onMounted(() => {
|
|
|
+ ishowTree.value = !isNullES(projectId.value)
|
|
|
setSplitRef()
|
|
|
// getNodeType()
|
|
|
})
|
|
@@ -165,7 +167,7 @@ const treeLoadNode = async ({ item, level }, resolve) => {
|
|
|
resolve(getArrValue(data))
|
|
|
}
|
|
|
|
|
|
-const ishowTree = ref(true)
|
|
|
+const ishowTree = ref(false)
|
|
|
//重新设置树
|
|
|
const setLoading = ref(false)
|
|
|
const setTree = async ()=>{
|