Explorar el Código

Merge branch 'master' of http://47.110.251.215:3000/web/saber into master

yangyj hace 2 años
padre
commit
209d36d386

+ 19 - 0
src/api/exctab/excelmodel.js

@@ -118,6 +118,14 @@ export const deleteExcel = (row) => {
         data: row
     })
 }
+//删除模板
+export const deleteExcelmodel = (row) => {
+    return request({
+        url: '/api/blade-manager/exceltab/delete-template',
+        method: 'post',
+        data: row
+    })
+}
 export const deleteExcelshu = (ids) => {
     return request({
         url: '/api/blade-manager/exceltab/remove',
@@ -253,6 +261,17 @@ export const downExcelFile = (fileId) => {
       responseType: 'arraybuffer'
     })
 }
+//下载模板
+export const downExcelFileModel = (fileId) => {
+    return request({
+      url: '/api/blade-manager/exceltab/down-template-file',
+      method: 'get',
+      params: {
+        fileId,
+      },
+      responseType: 'arraybuffer'
+    })
+}
 //清表模板树节点排序
 export const exctabSort = (ids) => {
     return request({

+ 27 - 0
src/api/manager/archivetree.js

@@ -100,3 +100,30 @@ export const submitArchiveTreeSort = (data) => {
     data
   })
 }
+
+//设置立卷规则保存接口
+export const saveArchiveAutoRule = (params) => {
+    return request({
+      url: '/api/blade-manager/archiveTree/saveArchiveAutoRule',
+      method: 'post',
+      params
+    })
+  }
+
+  //删除立卷规则接口
+export const removeArchiveAutoRule = (params) => {
+    return request({
+      url: '/api/blade-manager/archiveTree/removeArchiveAutoRule',
+      method: 'post',
+      params
+    })
+  }
+
+  //查看立卷规则接口
+export const getArchiveAutoRule = (params) => {
+    return request({
+      url: '/api/blade-manager/archiveTree/getArchiveAutoRule',
+      method: 'post',
+      params
+    })
+  }

+ 60 - 8
src/views/exctab/excelmodel/excelmodel.vue

@@ -233,8 +233,8 @@
             </template>
 
             <div style="margin-left:50px;" class="flex">
-              <div class="excelname mg-r-10" v-if="from.extension">
-                <div>{{from.extension}}</div>
+              <div class="excelname mg-r-10" v-if="from.templateExtension">
+                <div>{{from.templateExtension}}</div>
                 <i
                   class="el-icon-success marleft10"
                   style="color: rgb(0, 168, 112);"
@@ -252,8 +252,20 @@
                 <el-button
                   type="primary"
                   size="mini"
-                >{{from.extension?'重新上传导入模板':'上传导入模板'}}</el-button>
+                >{{from.templateExtension?'重新上传导入模板':'上传导入模板'}}</el-button>
               </el-upload>
+               <el-link
+                v-if="from.templateExtension"
+                class="marleft10 colorblue"
+                @click="delectExcelMSModel"
+              >删除</el-link>
+              <el-link
+               v-if="from.templateExtension"
+                underline
+                class="marleft10 colorblue"
+                style="text-decoration:underline;"
+                @click="downloadExcelModel()"
+              >下载模板</el-link>
             </div>
           </div>
 
@@ -477,8 +489,8 @@
 
 <script>
 import {mapGetters} from "vuex";
-import { detailExcel, excelType, tabLazytree, getWbsTypeList, wbstree, selectByNodeTable, Excelmodify, uploadExcel, deleteExcelshu, deleteExcel ,tabLazytreeAll,
-          uploadcoverfileExcel,downExcelFile,exctabSort} from '@/api/exctab/excelmodel';
+import { detailExcel, excelType, tabLazytree, getWbsTypeList, wbstree, selectByNodeTable, Excelmodify, uploadExcel, deleteExcelshu, deleteExcel ,deleteExcelmodel,tabLazytreeAll,
+          uploadcoverfileExcel,downExcelFile,downExcelFileModel,exctabSort} from '@/api/exctab/excelmodel';
 import ManualSorting from '@/components/WbsTree/ManualSorting'
 import VabOnlyOffice from '@/components/online-office/index'
 import { log } from '@antv/g2plot/lib/utils';
@@ -722,6 +734,7 @@ export default {
       if (res.code === 200) {
         this.from.id = res.data.id
         this.from.extension = res.data.extension  //文件名称
+        this.from.templateExtension=res.data.templateExtension
         this.from.name=res.data.name
         this.from.fileUrl = res.data.fileUrl      //文件路径
         let routeUrl = res.data.fileUrl
@@ -916,6 +929,38 @@ export default {
         URL.revokeObjectURL(objectUrl); // 释放内存
       })
     },
+
+    delectExcelMSModel () {//删除excel表点击事件、
+      let _that = this
+      this.$confirm('确认删除该文件?', '', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        deleteExcelmodel({ id: _that.from.id, fileUrl: '' }).then((res)=>{
+          if(res.data.code==200){
+            _that.from.templateExtension=''
+            this.$forceUpdate()
+          }
+        })
+      }).catch(() => {
+      })
+    
+    },
+    downloadExcelModel () {//下载excel表
+      //this.downFile(this.from.fileUrl,"123456.xlsx");
+      //window.open(this.from.fileUrl,'namexxx')
+      const link = document.createElement('a')
+      downExcelFileModel(this.from.id).then((res)=>{
+        // 创建Blob对象,设置文件类型
+        let blob = new Blob([res.data], {type: "application/vnd.ms-excel"})
+        let objectUrl = URL.createObjectURL(blob) // 创建URL
+        link.href = objectUrl
+        link.download = this.from.extension // 自定义文件名
+        link.click() // 下载文件
+        URL.revokeObjectURL(objectUrl); // 释放内存
+      })
+    },
     //#endregion
 
     //#region  外层左侧事件
@@ -1179,9 +1224,12 @@ export default {
     },
 
     uploadcoverfileExcel(file){
+      console.log('上传导入模板');
+       this.from.templateExtension=false
       let formData = new FormData()
       formData.append('file', file.raw)
       formData.append('nodeId', this.from.id)
+      this.from.templateExtension=file.raw.name
       // console.log(file.raw)
 
       const loading = this.$loading({
@@ -1192,18 +1240,22 @@ export default {
       });
 
       uploadcoverfileExcel(formData).then(() => {
-        this.from.import=file.raw;
-        this.from.extension=file.raw.name
         this.$message({
           message: '上传文件成功',
           type: 'success'
         })
+        // this.detailExcel(this.from.id)
         loading.close();
       }).catch(() => {
         loading.close();
       });
-
+     
       this.$refs.file3.clearFiles();
+      this.$forceUpdate()
+    
+   
+     
+     
     },
     //上传
     uploadMoudle(){

+ 156 - 20
src/views/manager/archivetree.vue

@@ -256,9 +256,9 @@
                     :props="Rightprops"
                     :data="rightData"
                     node-key="id"
-                    ref="tree"
+                    ref="settree"
                     class="filter-tree"
-                    show-checkbox
+                    show-checkbox :check-strictly="true"
                     @check-change="handleCheckChange"
                   >
                    <div class="custom-tree-node" slot-scope="{ node, data }"   @mouseover="mouseOver(data)"
@@ -625,9 +625,7 @@
       append-to-body
     >
      <el-checkbox-group v-model="checkList">
-      <el-checkbox label="复选框 A" style="margin-bottom:10px"></el-checkbox><br/>
-      <el-checkbox label="复选框 B" style="margin-bottom:10px"></el-checkbox><br/>
-      <el-checkbox label="复选框 C" style="margin-bottom:10px"></el-checkbox><br/>
+      <el-checkbox :label="node.id" v-for="node in nodesList" :key="node.id" style="margin-bottom:10px">{{node.pathName}}</el-checkbox><br/>
     </el-checkbox-group>
       <span
         slot="footer"
@@ -636,12 +634,13 @@
         <el-button @click="highVisible=false,highVisible=false">取 消</el-button>
         <el-button
           type="primary"
-          @click="editSort()"
+          @click="setRecordsHandle()"
         >确 定</el-button>
       </span>
     </el-dialog>
+
     <!-- 查看配置 -->
-    <el-dialog
+    <!-- <el-dialog
         title="设置最高并卷层级"
         :visible.sync="configVisible"
         width="50%"
@@ -668,13 +667,42 @@
             @click="editSort()"
           >确 定</el-button>
         </span>
+      </el-dialog> -->
+      <el-dialog
+        :visible.sync="configVisible"
+        width="50%"
+        append-to-body
+      >
+        <div v-if="configInfo && configInfo.type">
+          <div>
+            <span>配置类别:</span>
+            <span v-if="configInfo.type == 1">最高并卷层级</span>
+            <span v-if="configInfo.type == 2">分类并卷</span>
+            <span v-if="configInfo.type == 3">独立组卷</span>
+          </div>
+        </div>
+        <div style="text-align: center;font-size: 22px;" v-else>
+          该节点尚未配置
+        </div>
+
+        <span
+          slot="footer"
+          class="dialog-footer"
+        >
+          <el-button @click="configVisible=false">取 消</el-button>
+          <el-button
+            type="primary"
+            @click="editSort()"
+          >确 定</el-button>
+        </span>
       </el-dialog>
+
   </basic-container>
 </template>
 
 <script>
 import ManualSorting from '@/components/WbsTree/ManualSorting'
-import { archiveTreeInit, lazyTree, dictionary, remove, archiveTreeSave, archiveTreeUpdate, archiveTreeDetail, archiveTreetree, submitDisplayConfigTree, getSameGradeNode, submitArchiveTreeSort } from "@/api/manager/archivetree";
+import { archiveTreeInit, lazyTree, dictionary, remove, archiveTreeSave, archiveTreeUpdate, archiveTreeDetail, archiveTreetree, submitDisplayConfigTree, getSameGradeNode, submitArchiveTreeSort,saveArchiveAutoRule,getArchiveAutoRule } from "@/api/manager/archivetree";
 import {getWbsList} from "@/api/manager/wbsinfo";
 import { getToken } from '@/util/auth';
 import { roletree } from "@/api/system/role.js";
@@ -936,8 +964,32 @@ export default {
         },
         highVisible:false,
         configVisible:false,
+
+        archiveAutoType:'',//最高1  分类2  独立3
+        nodesList:[],
+
+        configInfo:null,
+    }
+  },
+
+  computed:{
+    setName(){
+      let name = '';
+      switch (this.archiveAutoType) {
+        case 1:
+          name = '设置最高并卷层级';
+          break;
+        case 2:
+          name = '设置分类并卷层级';
+          break;
+        case 3:
+          name = '设置单独并卷层级';
+          break;
+      }
+      return name;
     }
   },
+
   methods: {
     //切换tabs
      handleClick(tab, event) {
@@ -950,19 +1002,74 @@ export default {
      confighandleClick(tab, event) {
         console.log(tab, event);
      },
+
+
      setHigh(){
-        this.highVisible=true
-       console.log('设置最高');
+      if(this.showHighVisible()){
+        this.archiveAutoType =1;
+      }
+        
+       //console.log('设置最高');
      },
      setType(){
-          console.log('设置类型');
+      if(this.showHighVisible()){
+        this.archiveAutoType =2;
+      }
+        //console.log('设置类型');
      },
     setAlone(){
-      console.log('设置独立');
+      if(this.showHighVisible()){
+        this.archiveAutoType =3;
+      }
+      //console.log('设置独立');
      },
-     viewConfig(data){
-       console.log(data,'查看配置');
-       this.configVisible=true
+      
+    showHighVisible(){
+      if(!this.publictreevalue && !this.testtreevalue){
+        this.$message({
+          message: '请先在下拉框选择树,在勾选树节点,再进行设置',
+          type: 'warning'
+        });
+        return false;
+      }
+      let nodes = this.$refs.settree.getCheckedNodes();
+      if(nodes.length < 1){
+        this.$message({
+          message: '请先勾选节点,再进行设置',
+          type: 'warning'
+        });
+        return false;
+      }
+      nodes.forEach((element)=>{
+        element.pathName = this.getTreeNodePath(element,'settree')
+      })
+      //console.log(nodes)
+      this.checkList = [];
+      this.nodesList = nodes;
+      this.highVisible=true;
+      return true;
+    },
+
+    async viewConfig(data){
+       //console.log(data,'查看配置');
+       this.configInfo = null;
+       const { data: res } = await  getArchiveAutoRule({
+        nodeId:data.id,//归档树节点的id 或者 挂载wbs节点的ID(具体哪个ID待定)
+        iswbsNode:false,//是否是wbs节点 flase 不是 true 是 (先false,具体怎么区分后面再看
+       })
+
+       if (res.code == 200 && res.msg == "操作成功") {
+        //console.log(res.data)
+        if(res.data.type){
+          this.configInfo = res.data;
+        }else if(res.data.archiveAutoType){
+          this.configInfo = {
+            type:2,
+            data:res.data
+          }
+        }
+        this.configVisible=true
+      }
      },
      handleCheckChange(data, checked, indeterminate) {
         console.log(data, checked, indeterminate);
@@ -1418,11 +1525,11 @@ export default {
       this.checkXuan = []
     },
     async archiveTreetree (da) {//右侧树全加载接口
-      const { data: res } = await archiveTreetree(da)
-      console.log(res);
-      if (res.code == 200 && res.msg == "操作成功") {
-        this.rightData = res.data
-      }
+      // const { data: res } = await archiveTreetree(da)
+      // console.log(res);
+      // if (res.code == 200 && res.msg == "操作成功") {
+      //   this.rightData = res.data
+      // }
     },
     //#endregion
 
@@ -1495,7 +1602,36 @@ export default {
       if (res.code == 200 && res.msg == "操作成功") {
         this.rightData = res.data
       }
+    },
+
+    //获取树节点名字路径
+    getTreeNodePath(node,refName){
+      let nodeInfo = this.$refs[refName].getNode(node.id);
+      //console.log(nodeInfo)
+      let pathArr = [];
+      while (nodeInfo.parent) {
+        pathArr.push(nodeInfo.data.title)
+        nodeInfo = nodeInfo.parent
+      }
+      return pathArr.reverse().join('/');
+    },
+
+    async setRecordsHandle(){
+      const { data: res } = await saveArchiveAutoRule({
+        archiveAutoType:this.archiveAutoType,//最高1  分类2  独立3
+        selectNodeIds:this.checkList.join(','),//鼠标选择的节点ID(只要鼠标选择的节点,选择节点的下级子节点那种不要),逗号拼接
+        iswbsNode:false,//是否是wbs节点   flase 不是 true 是 (先false,具体怎么区分后面再看)
+      })
+
+      if (res.code == 200 && res.msg == "操作成功") {
+        this.$message({
+          type: 'success',
+          message: '设置成功'
+        })
+        this.highVisible = false;
+      }
     }
+
   },
   watch: {
     filterText (val) {

+ 3 - 2
src/views/manager/projectinfo/detail.vue

@@ -1162,8 +1162,6 @@ export default {
       if ((this.templateType == 1 && this.projectForm.referenceWbsTemplateType === 'private')
           || (this.templateType == 2 && this.projectForm.referenceWbsTemplateTypeTrial === 'private')
            && refId != null && refId.toString().length > 0) {
-             
-        console.log(1111111111111);
           console.log(refId,'refId');
         // 私有库右边树形数据是通过 pkeyId 查询的
         let ids = refId.toString().split(",");
@@ -1435,6 +1433,7 @@ export default {
 
     getRightTree() {
       this.rightloading = true;
+       this.iswbsselected=true
       console.log(this.nowref,'nowrefId');
 
       let refId =  this.templateType === 1 ? this.selectData.referenceWbsTemplateId : this.selectData.referenceWbsTemplateIdTrial;
@@ -1442,6 +1441,7 @@ export default {
       if(!refId){
         console.log('不存在refId');
          this.$refs.treetotree.setRightTree([]);
+          this.iswbsselected=false
       }else{
               let WbsId=''
               if (this.projectForm.referenceWbsTemplateType === 'private' && refId != null && refId.toString().length > 0) {
@@ -1508,6 +1508,7 @@ export default {
                   this.$refs.treetotree.setRightTree(res.data.data);
                 } else {
                   this.$refs.treetotree.setRightTree([]);
+                  this.iswbsselected=false
                 }
               }
                 

+ 32 - 5
src/views/manager/wbsinfo/edit.vue

@@ -1031,11 +1031,16 @@
       :close-on-click-modal="false"
     >
       <p class="font-c-warning">编辑元素信息(请谨慎操作)</p>
+        <div style="display:flex;margin-bottom:10px">
+                      <el-input placeholder="请输入你想编辑的元素名称" v-model="searchinput" :size="size"  clearable  @clear="clearsearchinput" >  </el-input>
+                      <el-button type="primary" icon="el-icon-search"  size="small"  @click="searchinputChange">搜索</el-button>
+        </div>
       <el-table
         :data="editEleList"
         border
         style="width: 100%"
         height="400px"
+        v-loading="editEleloading"
       >
         <el-table-column
           align="center"
@@ -1816,7 +1821,9 @@ export default {
       formulaCurRow:{},//当前元素
       testTreeLoad: false,
       testTreeData: [],
-      mixRatioTestIds: []
+      mixRatioTestIds: [],
+      searchinput:'',
+      editEleloading:false
     };
   },
   computed: {
@@ -2184,17 +2191,37 @@ export default {
     importHandle () {
 
     },
-
-    handleEdit (index, row) {
-      this.curEleTable = row;
-      selectFormElements(this.curEleTable.id,{type:1}).then((res) => {
+  //获取编辑元素表格数据
+  getSelectFormElements(){
+     this.editEleloading=true
+      selectFormElements(this.curEleTable.id,{type:1,search:this.searchinput}).then((res) => {
         res.data.data.forEach((element) => {
           this.eleReg.exec(element.eAllowDeviation);
           element.allow = RegExp.$1 ? RegExp.$1 : '';
           element.deviation = RegExp.$2 ? RegExp.$2 : '';
         })
+         this.editEleloading=false
         this.editEleList = res.data.data;
       })
+  },
+    //编辑元素搜索相关
+    clearsearchinput(){
+      this.getSelectFormElements()
+    },
+    searchinputChange(){
+     this.getSelectFormElements()
+    },
+    handleEdit (index, row) {
+      this.curEleTable = row;
+      // selectFormElements(this.curEleTable.id,{type:1}).then((res) => {
+      //   res.data.data.forEach((element) => {
+      //     this.eleReg.exec(element.eAllowDeviation);
+      //     element.allow = RegExp.$1 ? RegExp.$1 : '';
+      //     element.deviation = RegExp.$2 ? RegExp.$2 : '';
+      //   })
+      //   this.editEleList = res.data.data;
+      // })
+      this.getSelectFormElements()
       this.editEleVisible = true;
     },
     handleDelete (index, row) {