田源
2023-08-02 9941378cc6e6eefa0f927cde165c47c5585c00ea
Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue
@@ -1,7 +1,6 @@
<template>
  <div>
    <div style="display: flex;flex-wrap: wrap;" v-if="this.crudArrayFlag" class="app">
      <el-button-group>
      <!--新增-->
      <el-button v-if="attrEditVisible == false && attrFlagChiledren==false && editOpenFlag &&  (!checkStatus || crudLCStatus=='Editing' )" size="small" type="primary" icon="el-icon-plus" plain @click="busineHandle">添加 {{ msg }}</el-button>
@@ -14,7 +13,7 @@
      </el-button-group>
      <el-button-group>
        <!--    保存-->
        <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" size="small" type="success" plain @click="addsHandler" icon="el-icon-check">保存</el-button>
        <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" size="small" type="success" plain @click.prevent="addsHandler" icon="el-icon-check">保存</el-button>
        <!--    预览排序-->
        <el-button size="small" @click="orderHandle" icon="el-icon-arrow-down">预览排序</el-button>
        <!--    删除-->
@@ -166,11 +165,11 @@
        </div>
      </el-dialog>
      <!--        属性分组-->
      <el-dialog :visible.sync="attrVisible" append-to-body style="width: 800px; left:30vw;top: 10vh ;"
      <el-dialog :visible.sync="attrVisible" append-to-body :before-close="attrClose" style="width: 800px; left:30vw;top: 10vh ;"
                 title="输入分组的名称">
        <el-form ref="form" label-width="70px">
          <el-form-item label="属性分组">
            <el-input v-model="attrModel"></el-input>
            <el-input v-model="attrModel" autofocus></el-input>
          </el-form-item>
          <div style="display: flex;justify-content: flex-end">
            <el-button size="small" type="primary" @click="attrHandle">提交</el-button>
@@ -218,7 +217,7 @@
      </el-dialog>
      <!--        全屏编辑-->
      <el-dialog :visible.sync="attrEditVisible" append-to-body fullscreen="true" :before-close="escEdit" >
        <attrCrud :ProData="this.ProData" :attrFlagChiledren="this.attrFlag" :editStyleFlag="editStyleFlag" :editOpenFlag="editOpenFlag" :crudArrayFlag="this.crudArrayFlag"></attrCrud>
        <attrCrud :ProData="this.ProData" :attrFlagChiledren="this.attrFlag" @editCloseChildren="editClose" :editStyleFlag="editStyleFlag" :editOpenFlag="editOpenFlag" :crudArrayFlag="this.crudArrayFlag"></attrCrud>
      </el-dialog>
      <!--      组合规则-->
      <formula-editor :systemVariableTableData="systemVariableTableData"
@@ -414,7 +413,6 @@
      }
    },
    'injectOption.classifyInvokeAttr': function(newVal) {
      console.log('newVal',newVal)
      if (newVal === "name") {
        this.injectOption.classifyInvokeAttrName='分类名称'
      } else if (newVal === "id") {
@@ -1485,9 +1483,6 @@
    })
  },
  methods: {
    formAttr(row, column) {
      console.log(row,column)
    },
    //新增搜索
    AddFindHandler(){
      if(this.SelectValue == 'id'){
@@ -1508,7 +1503,6 @@
    },
    //参照配置子组件
    echoReferConfig(val){
      console.log('val--',val)
      this.referObject=val
      this.$set(this.CurrentCell,'referConfig',JSON.stringify(val))
@@ -1529,12 +1523,10 @@
        this.$message.warning('请选择模板属性')
      } else  {
        this.attrVisible = true;
       console.log(this.attrSelectList)
      }
    },
    //属性分组提交
    attrHandle() {
      console.log(this.attrSelectList)
      this.attrSelectList.forEach(item=>{
        item.attributeGroup=this.attrModel
      })
@@ -1543,12 +1535,15 @@
      }else {
        this.$set(this.attrSelectList[0], 'attributeGroup', this.attrModel)
      }
      this.attrModel = "";
      this.attrVisible = false;
      this.attrClose()
    },
    //属性分组清空
    attrRemove() {
      this.attrModel = ""
    },
    attrClose(){
      this.attrModel = "";
      this.attrVisible=false
    },
    //表格数据
    CrudRend() {
@@ -1611,7 +1606,6 @@
    //业务类型选择
    businessSelect(selection, row) {
      this.busineSelectList = selection;
      console.log(selection)
    },
    // 从业务类型中选择数据弹窗
    busineHandle() {
@@ -1670,7 +1664,6 @@
    selectHandle(selection, row) {
      this.attrOid = row.oid;
      this.attrRow = row;
      console.log(row)
    },
    //表格选择
    selectionChange(list) {
@@ -1686,15 +1679,16 @@
      this.attrRow = row;
    },
    //保存
    addsHandler() {
    addsHandler(event) {
      batchAddSave(JSON.parse(JSON.stringify(this.ProData))).then(res => {
        this.$message.success('保存成功')
        this.editOpenFlag=false
        this.editOpenFlag=false;
        // 调用父组件修改按钮状态
        this.$emit('editCloseChildren')
      }).catch(()=>{
        this.$message.warning('保存失败,请查看控制台输出!')
      })
    },
    //表格行编辑
    handleCellClicks(row, column) {
       if(this.editOpenFlag){
@@ -1712,10 +1706,20 @@
               referConfig:'',
             }
           }
           console.log('--',this.referConfigOption)
           // this.$refs.referConfigFormDialog.onloadAttrData();
         }else if(column.property == 'classifyInvokeText'){
           this.injectVisible=true;
           if (this.CurrentCell.classifyInvokeAttr != '') {
             this.injectOption = {
               classifyInvokeAttr: this.CurrentCell.classifyInvokeAttr,
               classifyInvokeAttrName: this.CurrentCell.classifyInvokeAttrName,
               classifyInvokeEditFlag: this.CurrentCell.classifyInvokeEditFlag,
               classifyInvokeLevel: this.CurrentCell.classifyInvokeLevel == 'min' ? 'min' : 'max',
               classifyNumber: this.CurrentCell.classifyInvokeLevel == 'min' ? '' : this.CurrentCell.classifyInvokeLevel
             };
           } else {
             this.injectHandleReset();
           }
         }else if(column.property == 'componentRule'){
           if(this.CurrentCell){
             this.CurrentCell.componentRule=this.componentRuleText;
@@ -1733,7 +1737,6 @@
             'conditionMap[oid_notequal]': this.CurrentCell.oid,
             limit:-1
           }).then(res => {
             console.log(res)
             this.CascadeData = res.data.data;
           })
           this.CascadeVisible=true;
@@ -1742,6 +1745,9 @@
           this.rulesVisible=true;
         }else if(column.property == 'attributeGroup'){
           this.attrVisible = true;
           if(this.CurrentCell.attributeGroup !== ''){
                this.attrModel=this.CurrentCell.attributeGroup
           }
         }
       }
    },
@@ -1854,7 +1860,6 @@
    },
    //验证规则检查
    rulesExamine() {
      console.log(this.RulesForm.expressionText)
      const regex = new RegExp(this.rulesData.ruleRowBds);
      if(regex.test(this.RulesForm.TestContent)){
        this.$message.success('校验成功')
@@ -1879,23 +1884,6 @@
        "层级设置": this.injectOption.classifyInvokeLevel=='max'?this.injectOption.classifyNumber :'min',
        "是否可修改": this.injectOption.classifyInvokeEditFlag
      }
      //单元格编辑赋值一遍
      // noinspection JSCheckFunctionSignatures
      if(this.CurrentCell){
        //如果是指定层赋值为数字
        if(this.injectOption.classifyInvokeLevel!== 'min'){
          this.CurrentCell.classifyInvokeLevel=this.injectOption.classifyNumber
        }else {
          this.CurrentCell.classifyInvokeLevel='min'
        }
        //其余正常赋值
        this.CurrentCell.classifyInvokeAttr=this.injectOption.classifyInvokeAttr,
        this.CurrentCell.classifyInvokeAttrName=this.injectOption.classifyInvokeAttrName,
        this.CurrentCell.classifyInvokeEditFlag=this.injectOption.classifyInvokeEditFlag,
        // this.$set(this.CurrentCell, 'classifyInvokeText', data)
          this.CurrentCell.classifyInvokeText = data;
        this.injectHandleReset()
      }else {
        //勾选操作
        for (const key in this.injectOption) {
          this.attrSelectList[0][key] = this.injectOption[key];
@@ -1908,7 +1896,7 @@
          this.$set(this.attrSelectList[0],'classifyInvokeText',data)
        }
        this.injectHandleReset()
      }
      if(this.injectOption.classifyInvokeLevel !== 'min'){
        this.injectOption.classifyInvokeLevel=this.injectOption.classifyNumber;
      }else  {
@@ -1927,7 +1915,8 @@
    },
    // 分类注入取消
    injectRemove() {
      this.injectVisible = false
      this.injectVisible = false;
      this.injectHandleReset()
    },
    //属性模板表格单元格点击事件
    //表格操作栏删除
@@ -2014,6 +2003,10 @@
    editOpen(){
      this.editOpenFlag=true;
    },
    //定义一个关闭编辑的方法供子组件使用
    editClose(){
      this.editOpenFlag=false;
    },
    //批量设置switch
    batchSetFlag(value){
      this.attrSelectList.forEach(item=>{