|
@@ -81,7 +81,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { nextTick, onMounted, ref } from 'vue'
|
|
|
+import { nextTick, onMounted, ref, watch } from 'vue'
|
|
|
import { arrToId, getArrValue, getObjValue, getRandom } from 'js-fast-way'
|
|
|
import unitApi from '~api/project/debit/project/unit.js'
|
|
|
import { useAppStore } from '~src/store'
|
|
@@ -89,7 +89,19 @@ import { getStoreValue, setStoreValue } from '~src/utils/storage'
|
|
|
import { getDictionary } from '~api/other'
|
|
|
import { delMessageV2 } from '~com/message/index.js'
|
|
|
const useAppState = useAppStore()
|
|
|
-const projectId = ref(useAppState.getProjectId)
|
|
|
+const projectId = ref(useAppState.getProjectId || '')
|
|
|
+//监听
|
|
|
+watch(() => [
|
|
|
+useAppState.getProjectId,
|
|
|
+], ([pid]) => {
|
|
|
+ if (pid) {
|
|
|
+ projectId.value = pid
|
|
|
+ ishowTree.value = false
|
|
|
+ setTimeout(() => {
|
|
|
+ ishowTree.value = true
|
|
|
+ }, 100)
|
|
|
+ }
|
|
|
+})
|
|
|
defineOptions({
|
|
|
name: 'ProjectDebitProjectUnit',
|
|
|
})
|