Browse Source

文件题名修改

duy 7 months ago
parent
commit
f5192e3e60
1 changed files with 43 additions and 22 deletions
  1. 43 22
      src/views/manager/projectinfo/tree.vue

+ 43 - 22
src/views/manager/projectinfo/tree.vue

@@ -1899,7 +1899,7 @@
 
   <template #footer>
       <div class="dialog-footer">
-        <el-button>取消</el-button>
+        <el-button @click="fileTitleVisible=false">取消</el-button>
         <el-button type="primary" @click="batchsaveFileSize">
           保存
         </el-button>
@@ -1931,6 +1931,7 @@
                         show-checkbox
                         @check="checkFileSize"
                         :default-checked-keys="deCheckTreeKeys"
+                        
 
                       >
                       </el-tree>
@@ -1941,7 +1942,7 @@
 
     <template #footer>
       <div class="dialog-footer">
-        <el-button>取消</el-button>
+        <el-button @click="chooseFileVisible=false">取消</el-button>
         <el-button type="primary" @click="saveFileSize">
           保存
         </el-button>
@@ -2339,7 +2340,10 @@ export default {
       fileTreeData:[],
       filedefaultProps:{
          children: 'children',
-          label: 'nodeName'
+          label: 'nodeName',
+          disabled:function (data) {
+          return data.status===11 ;
+        },
       },
       fileTitleRules:{
         type: [
@@ -4416,15 +4420,12 @@ export default {
     },
     //选择题名范围
     chooseFile(index,row){
-      console.log(row,'row');
-      
-      const {ruleName,nameId}=row
-      if(ruleName.length>0){
+      const {ruleName}=row
+      if(ruleName&&ruleName.length>0){
          this.chooseFileVisible = true;
         this.chooseFileIndex= index;
         this.deCheckTreeKeys=row.ruleSizeValId
         this.getTitleRangeData()
-       
       }else{
       this.$message.warning('请先选择文件题名规则');
       }
@@ -4456,6 +4457,14 @@ export default {
     },
     //保存文件题名
     saveRow(index,row){
+      if(row.ruleName.length<1){
+        this.$message.warning('请选择文件题名规则')
+        return
+      }
+      if(!row.type){
+        this.$message.warning('请选择文件题名范围')
+        return
+      }
       this.$set(row, "isEdit", false);
       this.$set(row, "isEdit1", false)
       const ruleName=row.ruleName.join('-')
@@ -4465,7 +4474,7 @@ export default {
       }else{
          ruleSizeVal=row.ruleSizeValId.join(',')
       }
-    
+     
       let nameRuleDtos={
         nameId:row.nameId,
         nameRule:ruleName,
@@ -4485,7 +4494,6 @@ export default {
       });
     },
     changeRoleName(data,row){
-      console.log(data,'data');
       const originalData=this.nodeTypelist
       const dictKeyToDictValueMap = originalData.reduce((acc, item) => {
         acc[item.dictKey] = item.dictValue;
@@ -4503,22 +4511,32 @@ export default {
       this.getFileTableData()
     },
     delRow(index,row){
-      // this.fileTableData.splice(index,1)
-      deletedNameRule(
-      {nameId:row.nameId}
-      ).then((res) => {
-       if(res.data.code==200){
-          this.$message.success(res.data.msg)
-          this.getFileTableData()
-        }else{
-          this.$message.error(res.data.msg)
-        }
-      });
+      if(!row.nameId){
+       this.fileTableData.splice(index,1)
+      }else{
+        deletedNameRule(
+          {nameId:row.nameId}
+          ).then((res) => {
+            if(res.data.code==200){
+                this.$message.success(res.data.msg)
+                this.getFileTableData()
+              }else{
+                this.$message.error(res.data.msg)
+              }
+          });
+      }
+    
     },
     batchsaveFileSize(){
       console.log(this.fileTableData,'this.fileTableData');
+      let isCansave=true
       let saveArr=[]
       this.fileTableData.forEach((ele)=>{
+        if(ele.ruleName.length<1||!ele.type){
+          this.$message.warning('请先完善相关信息')
+          isCansave=false
+          return
+        }
         let ruleSizeVal=''
         if(ele.type==1){
             ruleSizeVal=''
@@ -4527,13 +4545,16 @@ export default {
         }
          const ruleName=ele.ruleName.join('-')
         saveArr.push({
-          nameId:ele.nameId,
+          nameId:ele.nameId||'',
           nameRule:ruleName,
           nodeId:ruleSizeVal,
           projectId:this.projectid,
           type:ele.type
         })
       })
+      if(!isCansave){
+        return
+      }
       saveOrUpdateNameRule(
         saveArr
       ).then((res) => {