duy преди 1 година
родител
ревизия
dfaa8b54bd
променени са 1 файла, в които са добавени 8 реда и са изтрити 5 реда
  1. 8 5
      src/views/other-file/image-form.vue

+ 8 - 5
src/views/other-file/image-form.vue

@@ -173,7 +173,7 @@ const userInfo = ref(useAppState.getUserInfo)
 const routerQuery = useRoutes?.query
 //存储目录格式 1按部位存储,2按日期存储
 const dataId = ref(routerQuery?.id || '')
-const wbsNodeIds = routerQuery?.wbsId || ''
+const wbsNodeIds = ref(routerQuery?.wbsId || '')
 const classifyId = routerQuery?.classifyId || ''
 const dataType = parseInt(routerQuery?.dataType + '') || 1
 const fileType = parseInt(routerQuery?.fileType + '') || 2
@@ -210,6 +210,7 @@ onActivated(() => {
         isshowTree.value = true
     }, 100)
     dataId.value = useRoutes?.query?.id || ''
+    wbsNodeIds.value = routerQuery?.wbsId || ''
     console.log( dataId.value, 'dataId.value')
     if (dataType === 1) {
         TreeAutoExpandKeys.value = getStoreValue('TreeExpandKeys')
@@ -218,8 +219,8 @@ onActivated(() => {
    
     queryById()
     formValue.value.shootingUser = userInfo.value['real_name']
-    if (wbsNodeIds) {
-        getFileTitleNamedata(wbsNodeIds)
+    if (wbsNodeIds.value) {
+        getFileTitleNamedata(wbsNodeIds.value)
     }
 
 })
@@ -262,7 +263,9 @@ const getFileTitleNamedata = async (wbsNodeIds) => {
 const wbsId = ref('')
 const treeItemInfo = ref({})
 const nodeWbsElTreeClick = ({ data, keys }) => {
-    if (dataId.value.length > 1 && data['primaryKeyId'] !== wbsNodeIds) {
+    console.log(data, 'data')
+    console.log(wbsNodeIds.value, 'wbsNodeIds')
+    if (dataId.value.length > 1 && data['primaryKeyId'] !== wbsNodeIds.value) {
         window.$message.warning('编辑文件时,不可切换节点')
         return
     }
@@ -338,7 +341,7 @@ const formDataFormat = (info) => {
         shootingTimeStr: toDayDate,
         ...info,
         type: fileType || '2',
-        wbsId: info?.wbsId || wbsNodeIds,
+        wbsId: info?.wbsId || wbsNodeIds.value,
         classifyId: info?.classifyId || classifyId,
         projectId: info?.projectId || projectId.value,
         contractId: info?.contractId || contractId.value,