ludc
2023-07-31 86a216010c436ea1f8ff9cd2789c3555f51d1b3f
Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue
@@ -1,6 +1,7 @@
<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>
@@ -10,6 +11,16 @@
      <el-button v-if="(!checkStatus || crudLCStatus=='Editing' )&& editOpenFlag" icon="el-icon-info" size="small" @click="ruleAddHandler">验证规则</el-button>
      <!--        属性分组-->
      <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-menu" size="small" @click="attrVisibleHandle">属性分组</el-button>
      </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 size="small" @click="orderHandle" icon="el-icon-arrow-down">预览排序</el-button>
        <!--    删除-->
        <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" size="small" @click="CrudRemove" icon="el-icon-delete">删除</el-button>
        <!--    重置-->
        <el-button size="small" @click="reset" icon="el-icon-refresh-right">重置</el-button>
      </el-button-group>
      <el-button-group>
        <!--新增-->
@@ -22,17 +33,7 @@
      <!--    级联属性-->
      <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-coin" size="small" @click="CascadeHandle">级联属性</el-button>
      </el-button-group>
      <el-button-group>
      <!--    预览排序-->
        <el-button size="small" @click="orderHandle" icon="el-icon-arrow-down">预览排序</el-button>
        <!--新增-->
      <!--    保存-->
      <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" size="small" @click="addsHandler" icon="el-icon-check">保存</el-button>
      <!--    删除-->
      <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" size="small" @click="CrudRemove" icon="el-icon-delete">删除</el-button>
      <!--    重置-->
      <el-button size="small" @click="reset" icon="el-icon-refresh-right">重置</el-button>
      </el-button-group>
      <el-button-group>
      <!--    同步到其他模板-->
      <el-button size="small"@click="syncHandle" icon="el-icon-share">同步到其他模板</el-button>
@@ -45,7 +46,7 @@
      </el-button-group>
      <!-- 是否开启编辑     -->
    <el-button-group>
      <el-button size="small" plain  icon="el-icon-view"  v-if="(!checkStatus|| crudLCStatus=='Editing') && !editOpenFlag" @click="editOpen" >开启编辑</el-button>
      <el-button size="small" plain  icon="el-icon-view"  v-if="(!checkStatus|| crudLCStatus=='Editing') && !editOpenFlag && attrEditVisible == false && attrFlagChiledren==false" @click="editOpen" >开启编辑</el-button>
    </el-button-group>
    </div>
<!--    弹窗-->
@@ -207,7 +208,7 @@
      </el-dialog>
      <!--        全屏编辑-->
      <el-dialog :visible.sync="attrEditVisible" append-to-body fullscreen="true">
        <attrCrud :ProData="this.ProData" :attrFlagChiledren="this.attrFlag" :crudArrayFlag="this.crudArrayFlag"></attrCrud>
        <attrCrud :ProData="this.ProData" :attrFlagChiledren="this.attrFlag" :editOpenFlag="editOpenFlag" :crudArrayFlag="this.crudArrayFlag"></attrCrud>
      </el-dialog>
      <!--      组合规则-->
      <formula-editor :systemVariableTableData="systemVariableTableData"
@@ -251,7 +252,7 @@
    </div>
    <el-table :data="ProData"
              style="width: 100%"
              height="400"
              :height="!this.editStyleFlag ? 450 : 900"
              @cell-click="handleCellClicks"
              @select="selectHandle"
              @selection-change="selectionChange"
@@ -276,8 +277,8 @@
                       v-if="item.edit !='referName'"
      >
        <template slot-scope="{ row }">
          <el-input v-if="editingRows === row && editShows== item.prop && item.prop != 'codeDateFormat' && (item.edit == 'text'  ||item.edit == 'refer' )" v-model="row[item.prop]"
                    @blur="saveRows" ></el-input>
          <el-input ref="inputRef" v-if="editingRows === row && editShows== item.prop && item.prop != 'codeDateFormat' && (item.edit == 'text'  ||item.edit == 'refer' )" v-model="row[item.prop]"
                    @blur="saveRows" autofocus ></el-input>
          <el-input-number size="small" controls-position="right" v-if="editingRows === row && editShows== item.prop && item.edit == 'number'" v-model="row[item.prop]"
                           @blur="saveRows" :style="{width:(item.width-10)+'px'}"></el-input-number>
          <el-select v-model="row[item.prop]" filterable  allow-create  default-first-option slot="prepend" v-if="editingRows === row && editShows== item.prop && item.edit == 'select' " @blur="selectChangeHandler(item.editConfig,index)">
@@ -371,6 +372,24 @@
      deep:true,
      immediate:true
    },
    Formlist:{
      handler(newval,oldval){
        if(newval.length === 0){
          this.crudArrayFlag=false
          return
        }
      }
    },
    ProData:{
      handler(newval,oldval){
        if(newval){
          this.loading=true;
          setTimeout(() => {
            this.loading=false
          }, 1000);
        }
      }
    },
    'injectOption.classifyInvokeAttr': function(newVal) {
      console.log('newVal',newVal)
      if (newVal === "name") {
@@ -391,6 +410,8 @@
  },
  data() {
    return {
      //全屏编辑高度状态
      editStyleFlag:false,
      loading:false,
      referConfigText:"",
      referConfigVisble:false,
@@ -488,7 +509,7 @@
          desc: "当前用户的姓名"
        },
        {
          formula: "#CURRENTUSER.SECRETGRADE#",
          formula: "#CURRENTUSER.SECRETARIAT#",
          desc: "当前用户密级"
        },
        {
@@ -1448,11 +1469,14 @@
    //属性分组提交
    attrHandle() {
      console.log(this.attrSelectList)
      // this.$set(this.attrRow, 'attributeGroup', this.attrModel)
      // this.attrSelectList.attributeGroup=this.attrModel
      this.attrSelectList.forEach(item=>{
        item.attributeGroup=this.attrModel
      })
      if(this.CurrentCell){
        this.$set(this.CurrentCell, 'attributeGroup', this.attrModel)
      }else {
        this.$set(this.attrSelectList[0], 'attributeGroup', this.attrModel)
      }
      this.attrModel = "";
      this.attrVisible = false;
    },
@@ -1463,7 +1487,7 @@
    //表格数据
    CrudRend() {
      if (this.crudOid != '') {
        gridCodeClassifyTemplateAttr({'conditionMap[classifyTemplateOid]': this.crudOid}).then(res => {
        gridCodeClassifyTemplateAttr({'conditionMap[classifyTemplateOid]': this.crudOid,limit:-1}).then(res => {
          this.loading=true
          setTimeout(() => {
            this.ProData = res.data.data;
@@ -1517,7 +1541,6 @@
        }
      })
      this.addVisible = false;
    },
    //业务类型选择
    businessSelect(selection, row) {
@@ -1592,6 +1615,9 @@
    addsHandler() {
      batchAddSave(JSON.parse(JSON.stringify(this.ProData))).then(res => {
        this.$message.success('保存成功')
        this.editOpenFlag=false
      }).catch(()=>{
        this.$message.warning('保存失败,请查看控制台输出!')
      })
    },
@@ -1603,9 +1629,10 @@
         this.rowOid = row.oid;
         this.CurrentCell=row;
         if(column.property == 'referConfig' ){
           console.log( this.CurrentCell.referConfig)
           this.referConfigVisble= true;
           this.referConfigOption = {
             referConfig: this.referConfigText || '',
             referConfig: this.CurrentCell.referConfig || '',
           }
           if(this.CurrentCell.referConfig == ''){
             this.referConfigOption = {
@@ -1630,7 +1657,8 @@
         }else if(column.property == 'parentCode'){
           gridCodeClassifyTemplateAttr({
             'conditionMap[classifyTemplateOid]': this.Formlist[0].oid,
             'conditionMap[oid_notequal]': this.CurrentCell.oid
             'conditionMap[oid_notequal]': this.CurrentCell.oid,
             limit:-1
           }).then(res => {
             console.log(res)
             this.CascadeData = res.data.data;
@@ -1639,8 +1667,8 @@
         }else if(column.property == 'verifyRule'){
           this.RulesForm.expressionTextt=this.CurrentCell.verifyRule;
           this.rulesVisible=true;
           console.log(this.CurrentCell.verifyRule)
           console.log(this.RulesForm.expressionText)
         }else if(column.property == 'attributeGroup'){
           this.attrVisible = true;
         }
       }
    },
@@ -1782,8 +1810,10 @@
      // noinspection JSCheckFunctionSignatures
      if(this.CurrentCell){
        //如果是指定层赋值为数字
        if(this.CurrentCell.classifyInvokeLevel!== 'min'){
        if(this.injectOption.classifyInvokeLevel!== 'min'){
          this.CurrentCell.classifyInvokeLevel=this.injectOption.classifyNumber
        }else {
          this.CurrentCell.classifyInvokeLevel='min'
        }
        //其余正常赋值
        this.CurrentCell.classifyInvokeAttr=this.injectOption.classifyInvokeAttr,
@@ -1799,6 +1829,8 @@
          //如果是指定层赋值为数字
          if(this.injectOption.classifyInvokeLevel !== 'min'){
            this.attrSelectList[0].classifyInvokeLevel=this.injectOption.classifyNumber
          }else {
            this.attrSelectList[0].classifyInvokeLevel='min'
          }
          this.$set(this.attrSelectList[0],'classifyInvokeText',data)
        }
@@ -1871,6 +1903,8 @@
      if (this.crudArray.length < 1) {
        this.$message.warning('请选择一个模板')
      } else {
        this.editStyleFlag=true;
        // this.editOpenFlag=true;
        this.attrEditVisible = true;
        this.attrFlag = true;
      }
@@ -1880,6 +1914,7 @@
    escEdit() {
      this.attrFlagChiledren = false;
      this.attrEditVisible = false;
      this.editStyleFlag=false;
    },
    //组合规则确定
    updataFormlaContent(val) {
@@ -1903,11 +1938,9 @@
    sortChange(val) {
      console.log(val)
    },
    //开启编辑
    editOpen(){
      this.editOpenFlag=true;
      console.log('不等于',this.checkStatus)
      console.log('等于',this.editOpenFlag)
      console.log('等于',this.crudLCStatus)
    }
  }
}