소스 검색

feat(projectinfo/tree.vue): 添加内业资料类型列及格式化功能

在项目信息树形表格中添加“内业资料类型”列,并实现其格式化功能。同时,优化了文件大小保存逻辑,确保仅保存有效节点的信息。
duy 3 달 전
부모
커밋
e07ebc07ce
1개의 변경된 파일24개의 추가작업 그리고 6개의 파일을 삭제
  1. 24 6
      src/views/manager/projectinfo/tree.vue

+ 24 - 6
src/views/manager/projectinfo/tree.vue

@@ -284,6 +284,12 @@
                   prop="id"
                   label="id"
                 ></el-table-column>
+                <el-table-column
+                  align="center"
+                  prop="majorDataType"
+                  :formatter="formMajorType"
+                  label="内业资料类型"
+                ></el-table-column>
               </el-table>
             </div>
             <div class="flex jc-sb">
@@ -2393,6 +2399,7 @@ export default {
       this.getDataTypelist();
       this.getOwnerTypelist();
       this.getStandardTypeOptions();
+      this.getMajorDataTypeList();
 
       this.defaultExpandedKeys = getStore({ name: this.expandName });
       this.projectName = this.$route.query.projectName;
@@ -2512,7 +2519,7 @@ export default {
         this.dialogVisible = true;
         this.editType = type;
       }
-
+  
       getDetail(data.id, this.id, this.projectid).then((res) => {
         let parentName = "";
         if (node.parent.data) {
@@ -3303,6 +3310,16 @@ export default {
       }
       return cellValue;
     },
+    formMajorType(row, column, cellValue) {
+
+      
+      for (let i = 0; i < this.majorDataTypeList.length; i++) {
+        if (this.majorDataTypeList[i].dictKey == cellValue) {
+          return this.majorDataTypeList[i].dictValue;
+        }
+      }
+      return cellValue;
+    },
 
     // filterNode(value, data) {
     //   if (!value) return true;
@@ -4458,7 +4475,9 @@ export default {
         this.fileTreeLoading=false
         if(res.data.data){
           this.fileTreeData = res.data.data;
-          this.deCheckTreeKeys = this.fileTreeData.filter(node => node.status === 11).map(node => node.id);
+     
+          
+          // this.deCheckTreeKeys = this.fileTreeData.filter(node => node.status === 11).map(node => node.id);
       
         }else{
           this.fileTreeData =[]
@@ -4502,11 +4521,10 @@ export default {
     return result
 },
     saveFileSize(){
-      this.fileTableData[this.chooseFileIndex].ruleSizeValId =this.deCheckTreeKeys
-      console.log(this. deCheckTreeKeys,'this. deCheckTreeKeys');
-      
+      // const checkedNodes = this.getCheckedNodes(this.fileTreeData, this.deCheckTreeKeys).filter(node => node.status !== 11)
       const checkedNodes = this.getCheckedNodes(this.fileTreeData, this.deCheckTreeKeys)
-        this.fileTableData[this.chooseFileIndex].ruleSizeVal = checkedNodes.map(node => node.nodeName).join('、')
+      this.fileTableData[this.chooseFileIndex].ruleSizeValId = checkedNodes.map(node => node.id)
+      this.fileTableData[this.chooseFileIndex].ruleSizeVal = checkedNodes.map(node => node.nodeName).join('、')
       this.chooseFileVisible = false;
       this.isShowSize=false
       setTimeout(()=>{