Browse Source

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

yangyj 1 year ago
parent
commit
28ea5a981e

BIN
public/img/login/warn.png


+ 17 - 0
src/api/exctab/editelement.js

@@ -17,6 +17,14 @@ export const submit = (data) => {
         data
     })
 }
+//新增修改批量
+export const submit2 = (data) => {
+  return request({
+      url: '/api/blade-manager/linkdatainfo/saveTabColInfo2',
+      method: 'post',
+      data
+  })
+}
 
 //删除元素
 export const remove = (data) => {
@@ -59,4 +67,13 @@ export const tableType = () => {
       method: 'get',
     })
   }
+
+//提取未匹配的元素字段
+export const getUnMatchField = (params) => {
+    return request({
+      url: '/api/blade-manager/exceltab/getUnMatchField',
+      method: 'get',
+      params
+    })
+  }
   

+ 11 - 0
src/components/table-form/hc-form-select-search2.vue

@@ -0,0 +1,11 @@
+<template>
+  <div>
+    <el-input placeholder=" 搜索设计强度" />
+  </div>
+</template>
+
+<script>
+export default {
+  name: "HcFormSelectSearch2",
+};
+</script>

+ 2 - 0
src/main.js

@@ -24,6 +24,7 @@ import thirdRegister from './components/third-register/main';
 import flowDesign from './components/flow-design/main';
 import HcTableFormUpload from './components/table-form/hc-form-upload';
 import HcFormSelectSearch from './components/table-form/hc-form-select-search';
+import HcFormSelectSearch2 from './components/table-form/hc-form-select-search2';
 import HcFormCheckboxGroup from './components/table-form/hc-form-checkbox-group';
 import avueUeditor from 'avue-plugin-ueditor';
 import website from '@/config/website';
@@ -64,6 +65,7 @@ Vue.component('flowDesign', flowDesign);
 Vue.component('tenantPackage', tenantPackage);
 Vue.component('HcTableFormUpload', HcTableFormUpload);
 Vue.component('HcFormSelectSearch', HcFormSelectSearch);
+Vue.component('HcFormSelectSearch2', HcFormSelectSearch2);
 Vue.component('HcFormCheckboxGroup', HcFormCheckboxGroup);
 // 加载相关url地址
 Object.keys(urls).forEach(key => {

+ 2 - 2
src/views/certificate/lists/addList.vue

@@ -276,10 +276,10 @@ export default {
       rules: {
         certificateType: [{ required: true, message: '请选择', trigger: 'change' }],
         certificateUserName: [{ required: true, message: '请输入证书所有者', trigger: 'blur' }],
-        // certificateId: [{ required: true, message: '请输入所持证书者身份ID', trigger: 'blur' }],
+        certificateId: [{ required: true, message: '请输入所持证书者身份ID', trigger: 'blur' }],
         enterpriseUnifiedCode: [{ required: true, message: '请输入企业统一社会信用代码', trigger: 'blur' }],
         // certificateNumber: [{ required: true, message: '请输入证书编号', trigger: 'blur' }],
-        // certificatePassword: [{ required: true, message: '请输入证书密码', trigger: 'blur' }],
+        certificatePassword: [{ required: true, message: '请输入证书密码', trigger: 'blur' }],
         certificateUserId: [{ required: true, message: '请选择关联用户', trigger: 'change' }],
         // certificateFileUrl: [{ required: true, message: '请选择证书文件', trigger: 'change' }],
         // signatureFileUrl: [{ required: true, message: '请选择签名体图片', trigger: 'change', }],

+ 4 - 1
src/views/exctab/excelmodel/excelmodel.vue

@@ -205,7 +205,7 @@
     </el-dialog>
     <!-- 上传Excel表格 -->
     <el-dialog title="上传Excel表格" :visible.sync="exceldialogVisible" width="40%" append-to-body
-      :before-close="excelhandleClose">
+      :before-close="cancleexceldialog">
       <span>
         <el-upload accept=".xls, .xlsx" class="upload-demo" action="#" :auto-upload="false" :on-change="excelhandleChange"
           :show-file-list="false" multiple :on-exceed="excelhandleExceed" :file-list="excelfileList"
@@ -1023,6 +1023,7 @@ export default {
       this.curTreeData = data;
       this.exceldialogVisible = true
     },
+    
 
     excelhandleChange(file, fileList) {
       this.dataList = fileList
@@ -1060,6 +1061,7 @@ export default {
           loading.close();
         });
         this.$refs.excelmoudelupload.clearFiles();
+        this.cancleexceldialog()
        
     },
     //更改上传文件顺序
@@ -1086,6 +1088,7 @@ export default {
     cancleexceldialog(){
       this.exceldialogVisible=false
       this.dataList=[]
+      this.excelfileList=[]
     }
   },
   created() {

+ 1 - 1
src/views/formula/component/formulaTemplate.vue

@@ -68,7 +68,7 @@ export default {
     //选择当前元素
     setCurEle(index){
       let tmp = JSON.parse(JSON.stringify(this.curele));
-      //console.log(tmp)
+      console.log(tmp,'当前元素')
       this.$set(this.formulainfo.arguments,index,tmp);
     }
   }

+ 3 - 3
src/views/formula/edit1.vue

@@ -1515,7 +1515,7 @@ export default {
     async formulaStringToArray(){
       let detail = (await formulaDetail({elementId:this.eleid,scope:this.globaltype,nodeId:this.nodeid,projectId:this.curProjiect.id||this.pid})).data.data;
       console.log(detail);
-      if(detail.id){
+      if(detail&&detail.id){
         this.formulaid = detail.id;
         //let formula = formulaStringToArray('FC.sum(FC.repeat(E[测试测试_222]))+FC.ifelse(3<E[测试测试_333]&&E[测试测试_333]<10,E[测试测试_222]+E[测试测试_333],E[测试测试_333])',detail.map,this.formulaMap);
         let formula = formulaStringToArray(detail.formula,detail.map,this.formulaMap);
@@ -1532,7 +1532,7 @@ export default {
         }
       }
 
-      if(detail.scale > -1){
+      if(detail&&detail.scale > -1){
         this.isRetain = true;
         this.retainNum = detail.scale;
       }
@@ -1672,7 +1672,7 @@ export default {
                 this.eleTableListComp =res.data.data;
                 console.log( this.eleTableListComp,' this.eleTableListComp');
                 this.eleTableIdComp = this.eleTableListComp[0].id;
-              ;
+              
                }
 
              }

+ 12 - 8
src/views/formula/formulaArrayToString.js

@@ -154,14 +154,15 @@ function transformArguments(children,curEle,eleMap){
               //认为这个参数是之前公式计算的结果,不再写入元素
               isNestEle = true;
             }else{
+              let atbkey=arg.tableElementKey.replace('_key',':key')
               if(arg.type == 'Element'){
-                eleMap[arg.tableElementKey] = {
+                eleMap[atbkey] = {
                   id: arg.id,
                   name: arg.name,
-                  tableElementKey: arg.tableElementKey,
+                  tableElementKey: atbkey,
                   type: "Element",
                 };
-                fcText += `E[${arg.tableElementKey}]`;
+                fcText += `E[${atbkey}]`;
               }else if(arg.type == 'ParamData'){
                 eleMap[arg.k] = {
                   id: arg.id,
@@ -229,7 +230,7 @@ function transformArguments(children,curEle,eleMap){
       fcText += ')';
     
     }
-    //console.log(ele.name)
+    console.log(fcText,'ele.name')
 
   
   }
@@ -276,16 +277,19 @@ export const formulaArrayToString = (processFormula,resultFormula) => {
       text += item.name;
     }
   });
-
   if(resultFormula[0].children.length){
     //等号左侧部分
     let resText = transformArguments(resultFormula[0].children,resultFormula[0],eleMap);
-  
     //等号左侧元素不需要,左侧的公式嵌套右侧所有结果
-    text = resText.replace(`E[${resultFormula[0].tableElementKey}]`,text);
+    if(text){
+      text = resText.replace(`E[${resultFormula[0].tableElementKey}]`,text);
+    }else{
+      text=resText
+    }
+   
   }
 
-  console.log(text);
+  console.log(text,'最终');
   //console.log(eleMap)
   return {text,eleMap};
 }

+ 169 - 20
src/views/manager/projectinfo/editElement/editElement.vue

@@ -104,9 +104,13 @@
                 @click="saveReplace()"
               >保存</el-button>
             </div> -->
-            <div class="martop20 replace_box" v-if="false">
-              <div>
-
+            <div class="martop20 replace_box" v-if="true">
+              <div style="width: 100%;height: 100%;overflow-y: auto;">
+                  <el-row class="mb-4 ">
+                    <div  style="width: 60%;">
+                      <el-button type="warning" plain v-for="item in unMatchItems"  @click="unMatchClick(item)" style="margin-bottom: 10px ;" size="small">{{ item.eName }}</el-button>
+                    </div>
+                </el-row>
               </div>
             </div>
           </div>
@@ -258,9 +262,11 @@ import FormulaEdit from '@/views/formula/edit.vue'
 import FormulaEditone from '@/views/formula/edit1.vue'
 
 import { getExcelHtml } from '@/api/exctab/excelmodel'
-import { getElementInfoByTabId, submit, dictionarydataType, submitBatch } from '@/api/exctab/editelement'
+import { getElementInfoByTabId, submit,submit2, dictionarydataType, submitBatch,getUnMatchField } from '@/api/exctab/editelement'
 import Vue from 'vue'
 
+
+
 export default {
   components:{
     FormulaEdit,
@@ -359,6 +365,11 @@ export default {
       formulaCompVisible:false,//公式弹框节点公式
        formulaCompVisible1:false,//公式弹框全局公式
       eleid:'',//当前元素
+      unMatchItems:[
+
+      ],
+      checkList:[]//需要替换的数组
+     
     }
   },
   mounted () {
@@ -368,9 +379,27 @@ export default {
   },
   created () {
     this.getElementInfoByTabId()
+    this.getUnMatchFieldData()
     this.AddNewElementField = '替换元素'
   },
   methods: {
+    //获取未匹配的元素字段
+    getUnMatchFieldData(){
+      getUnMatchField({
+        pkeyId:this.pkeyId,
+        tabId:this.initTableId
+      }).then((res)=>{
+        console.log(res,'res');
+        this.unMatchItems=res.data.data
+      })
+    },
+    //选择未匹配的字段
+    unMatchClick(item){
+      console.log(item,'item');
+      this.value=item.id
+      this.names=item.eName
+    
+    },
     takuangchangge (value) {//切换事件
       if (value[value.length - 1] == '替换元素') {
         this.AddNewElementField = '替换元素'
@@ -477,6 +506,9 @@ export default {
       })
 
     },
+    LeftClick(tr, td, x1, x2, y1, y2){
+      console.log('点击左');
+    },
 
     getTd(ele){
 
@@ -512,6 +544,7 @@ export default {
           message: '已取消删除'
         });
       });
+      _that.AddNewElementField = '替换元素'
     },
     getInformation2 (a, b, c) {
       if (this.AddNewElementField) {
@@ -558,10 +591,23 @@ export default {
           checkboxGroupChange(){},
           keyupShiftUp() {},
           keyupShiftDown() {},
-          keyupShiftLeft() {},
-          keyupShiftRight() {},
-          inputLeftClick() {},
-        }
+          keyupShiftLeft() {
+        
+          },
+          keyupShiftRight() {
+          },
+          inputLeftClick() {
+         
+          },
+          KeyDown(e) {
+            if (e.ctrlKey|| e.metaKey) {
+              console.log("检测到按下了control键");
+            }
+          },
+        },
+        mounted() {
+          window.addEventListener("keydown", this.KeyDown, true);
+        },
       })
       var component = new MyComponent().$mount()
 
@@ -603,10 +649,16 @@ export default {
           checkboxGroupChange(){},
           keyupShiftUp() {},
           keyupShiftDown() {},
-          keyupShiftLeft() {},
+          keyupShiftLeft() {
+           
+          },
           keyupShiftRight() {},
-          inputLeftClick() {},
-        }
+          inputLeftClick() {
+           
+          },
+        },
+     
+
       })
       var component = new MyComponent().$mount()
       let na = document.getElementById('parent')
@@ -638,17 +690,41 @@ export default {
        this.$refs.cascader.clearCheckedNodes()//调用方法无效
     },
     saveReplace () {//保存按钮
-    
-      if (this.value&& this.table.td&& this.table.tr) {
+      console.log(this.checkList,'checkList');
+
+      // if (this.value&& this.table) {
+      //   this.tag = true
+      //   this.submit({
+      //     tabId: this.pkeyId,
+      //     tdIndex: this.table.td,
+      //     trIndex: this.table.tr,
+      //     colName: "",
+      //     htmlType: this.value
+      //   })
+      // } 
+      if (this.value&&this.table&&this.checkList.length===0) {
         this.tag = true
-        this.submit({
+        this.submit2([{
           tabId: this.pkeyId,
           tdIndex: this.table.td,
           trIndex: this.table.tr,
           colName: "",
           htmlType: this.value
-        })
-      } else {
+        }])
+      } else if(this.value&&this.checkList.length>0){
+       let arr=[]
+       this.checkList.forEach((ele)=>{
+          arr.push({
+            tabId: this.pkeyId,
+            tdIndex: ele.td,
+            trIndex: ele.tr,
+            colName: "",
+            htmlType: this.value
+          })
+       })
+       this.submit2(arr)
+      }
+      else {
         this.$message({
           type: "error",
           message: "请右键选择要替换的元素"
@@ -670,11 +746,31 @@ export default {
         console.log(res);
         if (res.code === 200) {
           this.tag = false
-          this.value = ''
+          // this.value = ''
+          this.options = []
+          localStorage.setItem('editElement', res.data)
+          this.getElementInfoByTabId()
+          this.copss()
+          this.getUnMatchFieldData()
+        }
+      }
+    },
+    async submit2 (da) {//批量保存替换元素
+      const { data: res } = await submit2(da)
+      console.log(res);
+      if (res.code == 200) {
+        const { data: res } = await getExcelHtml({ pkeyId: this.pkeyId })
+        console.log(res);
+        this.tag = false
+        if (res.code === 200) {
+       
+          // this.value = ''
+          this.checkList=[]
           this.options = []
           localStorage.setItem('editElement', res.data)
           this.getElementInfoByTabId()
           this.copss()
+          this.getUnMatchFieldData()
         }
       }
     },
@@ -805,10 +901,25 @@ export default {
       }
     },
 
+
+
+  noRepeat(tempArr) {
+      for (let i = 0; i < tempArr.length; i++) {
+          for (let j = i + 1; j < tempArr.length; j++) {
+              if (tempArr[i].tr == tempArr[j].tr&&tempArr[i].td == tempArr[j].td) {
+                  tempArr.splice(j, 1);
+                  j--;
+              }
+          }
+      }
+      return tempArr;
+  },
+
     //excel父节点点击检测
     parentClick(e){
+    const{metaKey,ctrlKey}=e
       let target = e.target;
-
+      console.log(target,'target');
       let bgs = document.querySelectorAll("#parent .oldlace-bg")
       //console.log(bgs)
       for (let i = 0; i < bgs.length; i++) {
@@ -819,8 +930,26 @@ export default {
         let tdEle = this.getParentTD(target);
         if(tdEle){
           target.classList.add("oldlace-bg");
+          if(metaKey||ctrlKey){
+            target.classList.add("select-td");
+            this.checkList.push({
+              tr:target.getAttribute('trindex'),
+              td:target.getAttribute('tdindex'),
+            })
+          }else{
+            target.classList.remove("select-td");
+            this.checkList.forEach((ele,index)=>{
+              if(ele.tr===target.getAttribute('trindex')){
+                this.checkList.splice(index,1)
+              }
+            })
+          }
+          
+         
 
         }
+      
+        this.noRepeat(this.checkList)
       }
     },
 
@@ -835,6 +964,8 @@ export default {
       return targetParent;
     },
 
+ 
+
   },
   watch: {
     'options' () {
@@ -920,6 +1051,19 @@ export default {
     background-color: oldlace;
   }
 }
+/deep/ .warnstyle .el-input__inner{
+  background-image: url('/img/login/warn.png') !important;       
+  background-repeat: no-repeat;        
+  background-size:cover;        
+  background-position: center
+}
+/deep/ .warnstyle .el-textarea__inner{
+  background-image: url('/img/login/warn.png') !important;       
+  background-repeat: no-repeat;        
+  // background-size:cover;        
+  background-position-x: 45%;
+  background-position-y: 46%;
+}
 
 .full-dialog{
   /deep/ .el-dialog__body{
@@ -932,14 +1076,19 @@ export default {
   }
 }
 .replace_box{
+  margin-top: 40px;
   border: 1px gray dashed;
   width: 95%;
-  height: 500px;
+  height: calc(100vh - 560px);
   position: relative;
+  padding-top: 20px;
+  padding-left: 20px;
+
+ 
  
 }
 .replace_box::after {
-				content: '未进行匹配的字段';
+				content: '未进行匹配的元素字段';
 				position: absolute;
 				right: 34%;
 				top: -15px;

+ 3 - 1
src/views/manager/projectinfo/independent.vue

@@ -127,6 +127,7 @@
         :nodeid="editElementQuery.nodeid"
          :initTableId="editElementQuery.initTableId"
         @hideDialog="editElementVisible = false"
+        @adjustExcel="adjustExcel"
         v-if="editElementVisible"
         :elementType="true"
         :globaltype='1'
@@ -712,7 +713,8 @@ export default {
       }
     },
       //#region 调整表单
-    adjustExcel(id,pkeyId) {
+    adjustExcel(pkeyId) {
+      console.log(pkeyId,'pkeyId');
       this.excelHtml=false;
       // //调整表单
       this.GLExcelFrom.id = pkeyId;

+ 23 - 14
src/views/manager/projectinfo/tree.vue

@@ -2148,6 +2148,7 @@ export default {
     },
 
     deleNode(data, node) {
+      let pid=data.primaryKeyId?data.primaryKeyId:data.pKeyId
       this.$confirm(
         "此操作将删除节点【" + data.title + "】, 是否继续?",
         "提示",
@@ -2158,7 +2159,7 @@ export default {
         }
       )
         .then(() => {
-          removePrivateTreeNode(data.primaryKeyId).then(() => {
+          removePrivateTreeNode(pid).then(() => {
             this.$refs.tree.remove(node);
             this.$message({
               type: "success",
@@ -2988,8 +2989,9 @@ export default {
       //节点参数按钮
       this.keymap();
       //console.log(data)
-      this.jiedianId = data.primaryKeyId;
-      this.parameters(data.primaryKeyId);
+      let pid=data.primaryKeyId?data.primaryKeyId:data.pKeyId
+      this.jiedianId = pid;
+      this.parameters(pid);
       this.nodeInfoVisible = true;
     },
     closenodeInfoVisible(){
@@ -3459,7 +3461,8 @@ export default {
           message: "节点数据同步中...",
           duration: 0,
         });
-        syncNodeTable(data.primaryKeyId)
+        let pid=data.primaryKeyId?data.primaryKeyId:data.pKeyId
+        syncNodeTable(pid)
           .then(() => {
             this.updateNodeTable();
             this.$message({
@@ -3489,7 +3492,8 @@ export default {
           message: "节点数据同步中...",
           duration: 0,
         });
-        syncNodeinfo(data.primaryKeyId)
+        let pid=data.primaryKeyId?data.primaryKeyId:data.pKeyId
+        syncNodeinfo(pid)
           .then(() => {
             this.updateNodeTable();
             this.$message({
@@ -3695,15 +3699,20 @@ export default {
               target={elementId:e.id,paramId:this.curParam.id};
              }
         })
-        specifiedParamElements(target).then(data=>{
-          this.linkCheckVisible = false;
-          getParamElements({nodeId:this.curTreeData.id,projectId:this.projectid,paramId:this.curParam.id,scopeType:10}).then((res) => {
-           if (res.data.data.length) {
-              this.linkEleTableList = res.data.data;
-              } else {
-               this.linkEleTableList = [];
-           }})
-        })
+        if(JSON.stringify(target) !== '{}'){
+          specifiedParamElements(target).then(data=>{
+            this.linkCheckVisible = false;
+            getParamElements({nodeId:this.curTreeData.id,projectId:this.projectid,paramId:this.curParam.id,scopeType:10}).then((res) => {
+            if (res.data.data.length) {
+                this.linkEleTableList = res.data.data;
+                } else {
+                this.linkEleTableList = [];
+            }})
+          })
+        }else{
+          this.$message.warning('请先选择关联元素')
+        }
+     
     },
     //树形控件菜单相关方法
     mouseout(){

+ 23 - 2
src/views/manager/projectinfo/treeTemplate/dynamicExcel.vue

@@ -2,7 +2,7 @@
   <div class="excelHtnl">
     <div class="header" style=" position: absolute;left:10px;top:0">
       <div class="flexStar">
-        <h2>编辑WBS库</h2>
+        <h2>编辑WBS库111</h2>
         <div
           class="GoBack marleft20"
           @click="GoBack()"
@@ -79,7 +79,8 @@ export default {
           prop: 'tab5',
         }
         ]
-      }
+      },
+      checkList:[]
     }
   },
   mounted () {
@@ -212,6 +213,7 @@ export default {
     //excel父节点点击检测
     parentClick(e){
       let target = e.target;
+      const{metaKey,ctrlKey}=e
       //console.log(target)
       let bgs = document.querySelectorAll("#parent .oldlace-bg")
       //console.log(bgs)
@@ -224,6 +226,20 @@ export default {
         if(tdEle){
           //橙色背景
           target.classList.add("oldlace-bg");
+          if(metaKey||ctrlKey){
+            target.classList.add("select-td");
+            this.checkList.push({
+              tr:target.getAttribute('trindex'),
+              td:target.getAttribute('tdindex'),
+            })
+          }else{
+            target.classList.remove("select-td");
+            this.checkList.forEach((ele,index)=>{
+              if(ele.tr===target.getAttribute('trindex')){
+                this.checkList.splice(index,1)
+              }
+            })
+          }
         }
       }
     },
@@ -368,6 +384,11 @@ export default {
   /deep/ .oldlace-bg{
     background-color: oldlace;
   }
+  /deep/ .select-td{
+    border-width: 4px;
+    border-color: #E6A23C;
+    border-style: solid;
+  }
 }
 </style>
 

+ 150 - 19
src/views/manager/projectinfo/treeTemplate/template/setInputTPT.vue

@@ -20,15 +20,15 @@
           </el-select>
         </el-col>
       </el-row>
-      <!-- <el-row :span="24" v-if="from.type==='date'||from.type==='daterange'">
+      <el-row :span="24" v-if="from.type==='date'||from.type==='daterange'">
         <el-col :span="3.8" style="line-height: 40px">
           日期:
         </el-col>
         <el-col :span="8">
-          <el-checkbox-group v-model="checkDateList" style="margin-top: 10px;margin-left: 10px;" size="large">
-            <el-checkbox label="yyyy" >年</el-checkbox>
-            <el-checkbox label="MM" >月</el-checkbox>
-            <el-checkbox label="dd" >日</el-checkbox>
+          <el-checkbox-group v-model="checkDateList" style="margin-top: 10px;margin-left: 10px;" size="large" @change="changeDate">
+            
+            <el-checkbox v-for="item in yearList" :label="item.value">{{ item.name }}</el-checkbox>
+       
           </el-checkbox-group>
         </el-col>
         <el-col :span="3.8" style="line-height: 40px">
@@ -37,14 +37,14 @@
         <el-col :span="8" style="margin-left: 10px;">
           <el-select
               style="width:100%;"
-              v-model="from.type"
+              v-model="from.divide_y"
               clearable
               placeholder="请选择"
             
             >
               <el-option
                 label="文本"
-                :value="文本"
+                value="文本"
               >
               </el-option>
               <el-option
@@ -66,10 +66,8 @@
           时间:
         </el-col>
         <el-col :span="8">
-          <el-checkbox-group v-model="checkDateList" style="margin-top: 10px;margin-left: 10px;" size="large">
-            <el-checkbox label="hh" >时</el-checkbox>
-            <el-checkbox label="mm" >分</el-checkbox>
-            <el-checkbox label="ss" >秒</el-checkbox>
+          <el-checkbox-group v-model="checkTimeist" style="margin-top: 10px;margin-left: 10px;" size="large" @change="changeTime">
+            <el-checkbox v-for="item in timeList" :label="item.value">{{ item.name }}</el-checkbox>
           </el-checkbox-group>
         </el-col>
         <el-col :span="3.8" style="line-height: 40px">
@@ -78,14 +76,14 @@
         <el-col :span="8" style="margin-left: 10px;">
           <el-select
               style="width:100%;"
-              v-model="from.type"
+              v-model="from.divide_h"
               clearable
               placeholder="请选择"
             
             >
               <el-option
                 label="文本"
-                :value="文本"
+                value="文本"
               >
               </el-option>
               <el-option
@@ -109,11 +107,16 @@
         <el-col :span="18" style="margin-left: 10px;">
           <el-select
               style="width:100%;"
-              v-model="from.type"
+              v-model="from.divide_c"
               clearable
               placeholder="请选择"
             
             >
+            <el-option
+                label="至"
+                value='至'
+              >
+              </el-option>
               <el-option
                 label="-"
                 value="-"
@@ -126,7 +129,7 @@
               </el-option>
             </el-select>
         </el-col>
-      </el-row> -->
+      </el-row>
 
     </div>
     <!-- 添加框 -->
@@ -188,7 +191,8 @@ export default {
           this.setInputTable = newV.selectDatas;
         }
       } else {
-        this.from.type = '';
+       
+        // this.from.type = '';
         this.setInputTable = [];
       }
     }
@@ -200,11 +204,25 @@ export default {
       from: {
         type: '',
         value: '',
+        divide_c:'至'
       },
       setInputTable: [],//数据体
       disabled: false,
+      yearList:[
+        {name:'年',value:'YYYY',sort:1},
+        {name:'月',value:'MM',sort:2},
+        {name:'日',value:'DD',sort:3},
+      ],
+      yearSort:[],
+      TimeSort:[],
+      timeList:[
+        {name:'时',value:'HH',sort:4},
+        {name:'分',value:'mm',sort:5},
+        {name:'秒',value:'ss',sort:6},
+      ],
       checkDateList: [],
-      testvalue1: new Date(2000, 0, 0, 0, 22),
+      checkTimeist:[],
+  
     }
   },
   methods: {
@@ -250,7 +268,62 @@ export default {
               textInfo: this.setInputTable
             })
           }
-        } else {
+        } else if(this.from.type == 'daterange'|this.from.type == 'date'){
+          let c = this.yearSort.concat(this.TimeSort);//c=[1,2,3,4,5,6]
+          console.log(c,'c');
+          let  isAdd=this.IncreasingFn(c)
+          console.log(isAdd,'isAdd');
+          if(isAdd){
+            let dateFormat=[]
+            this.yearList.forEach((ele)=>{
+              this.checkDateList.forEach((ele1)=>{
+                if(ele.value===ele1){
+                  dateFormat.push(
+                    ele
+                  )
+                }
+              })
+            })
+            this.timeList.forEach((ele)=>{
+              this.checkTimeist.forEach((ele1)=>{
+                if(ele.value===ele1){
+                  dateFormat.push(
+                    ele
+                  )
+                }
+              })
+            })
+            if(this.from.divide_y){
+              dateFormat.push({
+                divide_y:this.from.divide_y
+              })
+            }
+            if(this.from.divide_h){
+              dateFormat.push({
+                divide_h:this.from.divide_h
+              })
+            }
+            if(this.from.divide_c&&this.from.type==='daterange'){
+              dateFormat.push({
+                divide_c:this.from.divide_c
+              })
+            }
+            console.log(dateFormat,'dateFormat');
+            this.saveInput({
+              trIndex: this.htmlData.tr,
+              tdIndex: this.htmlData.td,
+              tableId: this.pkeyId,
+              textId: this.from.type,
+              type: '1',
+              textInfo: this.setInputTable,
+              dateFormat:dateFormat
+            })
+          }else{
+            this.$message.warning('请按年月日时分秒顺序选择,不要跨越选择')
+          }
+         
+        }
+        else {
           this.saveInput({
             trIndex: this.htmlData.tr,
             tdIndex: this.htmlData.td,
@@ -278,10 +351,17 @@ export default {
     async saveInput(da) {//保存设置文本接口
       const { data: res } = await saveInput(da)
       console.log(res);
+      this.checkDateList=[]
+      this.checkTimeist=[]
+      this.from.divide_y=''
+      this.from.divide_h=''
+      this.yearSort=[]
+      this.TimeSort=[]
       if (res.code == 200) {
         this.setInputTable = []
         this.disabled = false
         this.getExcelHtml()
+       
       }
     },
     // async getColByTabId () {//获取字段信息
@@ -296,7 +376,7 @@ export default {
       console.log(res);
       if (res.code === 200) {
         this.htmlData.name = ''
-        this.from.type = ''
+        // this.from.type = ''
         this.htmlData.tr = ''
         this.htmlData.td = ''
         this.setInputTable = []
@@ -304,6 +384,57 @@ export default {
         this.$emit('cop')
       }
     },
+    // 判断是否是是
+  
+    IncreasingFn(array) {
+      let IncreasingFn = false
+      let arrayCount = array.length - 1
+      // console.log(arrayCount,'现在是?');
+      for (var i = 0; i < arrayCount; i++) {
+        let currentArr = Number(array[i]) + 1
+        let nestArr = Number(array[i + 1])
+ 
+        if (i < 1 == arrayCount) {
+          console.log('执行')
+          currentArr = Number(array[i])
+          nestArr = Number(array[i])
+        }
+        if (currentArr != nestArr) {
+          IncreasingFn = false
+          break
+        } else {
+          IncreasingFn = true
+        }
+      }
+      return IncreasingFn
+    },
+
+
+    changeDate(val){
+      this.yearSort=[]
+      this.yearList.forEach((ele)=>{
+        val.forEach((ele1)=>{
+          if(ele.value===ele1){
+            this.yearSort.push(ele.sort)
+          }
+        })
+      })
+
+
+    
+    },
+    changeTime(val){
+      this.TimeSort=[]
+      this.timeList.forEach((ele)=>{
+        val.forEach((ele1)=>{
+          if(ele.value===ele1){
+            this.TimeSort.push(ele.sort)
+          }
+        })
+      })
+     
+      
+    }
   },
   created() {
     this.dictionary()  //获取文本类型接口

+ 522 - 0
src/views/system/app.vue

@@ -0,0 +1,522 @@
+<template>
+  <basic-container>
+    <avue-crud :option="option"
+               :table-loading="loading"
+               :data="data"
+               ref="crud"
+               v-model="form"
+               :page.sync="page"
+               :permission="permissionList"
+               :before-open="beforeOpen"
+               @row-del="rowDel"
+               @row-update="rowUpdate"
+               @row-save="rowSave"
+               @selection-change="selectionChange"
+               @current-change="currentChange"
+               @size-change="sizeChange"
+               @refresh-change="refreshChange"
+               @on-load="onLoad">
+      <template slot-scope="scope" slot="menu">
+        <el-button type="text" size="small" icon="el-icon-upload2" @click.stop="handleAdd(scope.row,scope.index)">升级</el-button>
+      </template>
+    </avue-crud>
+
+    <!-- 升级 -->
+    <el-dialog title="App升级" :visible.sync="dialogUpload" width="70%" append-to-body center>
+      <avue-crud :option="option1"
+                 :table-loading="loading"
+                 :data="data"
+                 ref="crud"
+                 v-model="form"
+                 :page.sync="page"
+                 :permission="permissionList"
+                 :before-open="beforeOpen"
+                 @row-del="rowDel"
+                 @row-update="rowUpdate"
+                 @row-save="rowSave"
+                 @selection-change="selectionChange"
+                 @current-change="currentChange"
+                 @size-change="sizeChange"
+                 @refresh-change="refreshChange"
+                 @on-load="onLoad">
+      </avue-crud>
+    </el-dialog>
+  </basic-container>
+</template>
+
+<script>
+import {
+  getList,
+  getDetail,
+  remove,
+  update,
+  add,
+  setting,
+  datasource,
+  packageInfo,
+  packageSetting
+} from "@/api/system/tenant";
+import {getDetail as packageDetail} from "@/api/system/tenantpackage";
+import {mapGetters} from "vuex";
+import {getMenuTree} from "@/api/system/menu";
+import {validatenull} from "@/util/validate";
+
+export default {
+  data() {
+    return {
+      form: {},
+      selectionList: [],
+      query: {},
+      loading: true,
+      box: false,
+      datasourceBox: false,
+      packageBox: false,
+      packageSettingBox: false,
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0
+      },
+      option: {
+        height: 'auto',
+        calcHeight: 30,
+        tip: false,
+        searchShow: false,
+        searchMenuSpan: 6,
+        border: true,
+        index: true,
+        selection: false,
+        viewBtn: false,
+        dialogWidth: 600,
+        dialogClickModal: false,
+        column: [
+          {
+            label: "应用平台",
+            prop: "tenantId",
+            span: 24,
+            rules: [{
+              required: true,
+              message: "请输入应用平台",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "应用名称",
+            prop: "tenantName",
+            span: 24,
+            rules: [{
+              required: true,
+              message: "请输入应用名称",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "当前版本",
+            prop: "linkman",
+            span: 24,
+            rules: [{
+              required: true,
+              message: "请输入当前版本号",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "应用说明",
+            prop: "address",
+            span: 24,
+            minRows: 2,
+            type: "textarea",
+            hide: true,
+          },
+        ]
+      },
+      data: [],
+      settingForm: {},
+      dialogUpload: false,
+      option1: {
+        height: '100%',
+        calcHeight: 30,
+        tip: false,
+        searchShow: false,
+        searchMenuSpan: 6,
+        border: true,
+        index: true,
+        selection: false,
+        viewBtn: false,
+        dialogWidth: 600,
+        dialogClickModal: false,
+        column: [
+          {
+            label: "当前版本",
+            prop: "tenantId",
+            span: 24,
+            rules: [{
+              required: true,
+              message: "请输入当前版本号",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "软件类型",
+            prop: "category",
+            type: "radio",
+            span: 24,
+            dicData: [
+              {
+                label: "安卓",
+                value: 1
+              },
+              {
+                label: "ios",
+                value: 2
+              }
+            ],
+            value: 1,
+            rules: [
+              {
+                required: true,
+                message: "请选择软件类型",
+                trigger: "blur"
+              }
+            ],
+          },
+          {
+            label: "资源类型",
+            prop: "category1",
+            type: "radio",
+            span: 24,
+            dicData: [
+              {
+                label: "完整安装包",
+                value: 1
+              },
+              {
+                label: "wgt热更新包",
+                value: 2
+              }
+            ],
+            value: 1,
+            rules: [
+              {
+                required: true,
+                message: "请选择资源类型",
+                trigger: "blur"
+              }
+            ],
+          },
+          {
+            label: "更新内容",
+            prop: "address",
+            span: 24,
+            minRows: 3,
+            type: "textarea",
+            hide: true,
+            rules: [{
+              required: true,
+              message: "请填写更新内容",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "文件地址",
+            prop: "linkman",
+            span: 24,
+            rules: [{
+              required: true,
+              message: "请上传文件",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "文件大小",
+            prop: "linkman",
+            span: 24,
+          },
+          {
+            label: "强制更新",
+            prop: "category1",
+            type: "radio",
+            span: 24,
+            dicData: [
+              {
+                label: "是",
+                value: 1
+              },
+              {
+                label: "否",
+                value: 2
+              }
+            ],
+            value: 1,
+            rules: [
+              {
+                required: true,
+                message: "请选择是否强制更新",
+                trigger: "blur"
+              }
+            ],
+          },
+        ]
+      },
+    };
+  },
+  watch: {
+    'packageForm.packageId'() {
+      if (!validatenull(this.packageForm.packageId)) {
+        packageDetail(this.packageForm.packageId).then(res => {
+          this.packageForm.menuId = res.data.data.menuId;
+          this.initData();
+        });
+      }
+    }
+  },
+  computed: {
+    ...mapGetters(["userInfo", "permission"]),
+    permissionList() {
+      return {
+        addBtn: this.vaildData(this.permission.tenant_add, false),
+        delBtn: this.vaildData(this.permission.tenant_delete, false),
+        editBtn: this.vaildData(this.permission.tenant_edit, false)
+      };
+    },
+    ids() {
+      let ids = [];
+      this.selectionList.forEach(ele => {
+        ids.push(ele.id);
+      });
+      return ids.join(",");
+    },
+    tenantId() {
+      return this.selectionList[0].tenantId;
+    }
+  },
+  methods: {
+    initData() {
+      getMenuTree().then(res => {
+        const column = this.findObject(this.packageOption.column, "menuId");
+        column.dicData = res.data.data;
+      });
+    },
+    rowSave(row, done, loading) {
+      add(row).then(() => {
+        this.onLoad(this.page);
+        this.$message({
+          type: "success",
+          message: "操作成功!"
+        });
+        done();
+      }, error => {
+        window.console.log(error);
+        loading();
+      });
+    },
+    rowUpdate(row, index, done, loading) {
+      update(row).then(() => {
+        this.onLoad(this.page);
+        this.$message({
+          type: "success",
+          message: "操作成功!"
+        });
+        done();
+      }, error => {
+        window.console.log(error);
+        loading();
+      });
+    },
+    rowDel(row) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          return remove(row.id);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+        });
+    },
+    beforeOpen(done, type) {
+      if (["view"].includes(type)) {
+        getDetail(this.form.id).then(res => {
+          const data = res.data.data;
+          if (!(data.accountNumber > 0)) {
+            data.accountNumber = "不限制";
+          }
+          if (!data.expireTime) {
+            data.expireTime = "不限制";
+          }
+          this.form = data;
+        });
+      }
+      done();
+    },
+    searchReset() {
+      this.query = {};
+      this.onLoad(this.page);
+    },
+    searchChange(params, done) {
+      this.query = params;
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+    selectionChange(list) {
+      this.selectionList = list;
+    },
+    selectionClear() {
+      this.selectionList = [];
+      this.$refs.crud.toggleSelection();
+    },
+    handleDelete() {
+      if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
+      }
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          return remove(this.ids);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          this.$refs.crud.toggleSelection();
+        });
+    },
+    handleSetting() {
+      if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
+      }
+      if (this.selectionList.length === 1) {
+        getDetail(this.selectionList[0].id).then(res => {
+          const data = res.data.data;
+          this.settingForm.accountNumber = data.accountNumber;
+          this.settingForm.expireTime = data.expireTime;
+        });
+      } else {
+        this.settingForm.accountNumber = -1;
+        this.settingForm.expireTime = '';
+      }
+      this.box = true;
+    },
+    handleDatasource() {
+      if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
+      }
+      if (this.selectionList.length !== 1) {
+        this.$message.warning("只能选择一条数据");
+        return;
+      }
+      getDetail(this.selectionList[0].id).then(res => {
+        const data = res.data.data;
+        this.datasourceForm.datasourceId = data.datasourceId;
+      });
+      this.datasourceBox = true;
+    },
+    handlePackage() {
+      if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
+      }
+      if (this.selectionList.length !== 1) {
+        this.$message.warning("只能选择一条数据");
+        return;
+      }
+      if (this.selectionList.length === 1) {
+        packageInfo(this.selectionList[0].id).then(res => {
+          const data = res.data.data;
+          this.packageForm.packageId = data.id;
+          this.packageForm.menuId = data.menuId;
+        });
+      } else {
+        this.packageForm.menuId = '';
+      }
+      this.packageBox = true;
+      //更新字典远程数据
+      setTimeout(() => {
+        const form = this.$refs.formPackage;
+        form.updateDic('packageId');
+      }, 10);
+    },
+    handlePackageSetting() {
+      this.packageSettingBox = true;
+    },
+    handleSubmit(form, done, loading) {
+      setting(this.ids, form).then(() => {
+        this.onLoad(this.page);
+        this.$message({
+          type: "success",
+          message: "配置成功!"
+        });
+        done();
+        this.box = false;
+      }, error => {
+        window.console.log(error);
+        loading();
+      });
+    },
+    handleDatasourceSubmit(form, done, loading) {
+      datasource(this.tenantId, form.datasourceId).then(() => {
+        this.$message({
+          type: "success",
+          message: "配置成功!"
+        });
+        done();
+        this.datasourceBox = false;
+      }, error => {
+        window.console.log(error);
+        loading();
+      });
+    },
+    handlePackageSubmit(form, done, loading) {
+      packageSetting(this.tenantId, form.packageId).then(() => {
+        this.onLoad(this.page);
+        this.$message({
+          type: "success",
+          message: "配置成功!"
+        });
+        done();
+        this.packageBox = false;
+      }, error => {
+        window.console.log(error);
+        loading();
+      });
+    },
+    currentChange(currentPage) {
+      this.page.currentPage = currentPage;
+    },
+    sizeChange(pageSize) {
+      this.page.pageSize = pageSize;
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.query);
+    },
+    onLoad(page, params = {}) {
+      this.loading = true;
+      getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
+        const data = res.data.data;
+        this.page.total = data.total;
+        this.data = data.records;
+        this.loading = false;
+        this.selectionClear();
+      });
+    },
+    handleAdd(row, index) {
+     this.dialogUpload = true;
+    },
+  }
+};
+</script>