ludc
2023-07-14 36d3d9da36c71e65081e38cf9cfbd5e0ff6bfeed
Source/UBCS-WEB/src/components/Tree/attrCrud.vue
@@ -1,7 +1,7 @@
<template>
  <div>
    <div style="display: flex;flex-wrap: wrap;" v-if="this.crudArrayFlag">
      <el-button-group>
      <!--新增-->
      <el-button v-if="attrEditVisible == false && attrFlagChiledren==false" size="small" type="primary" icon="el-icon-plus" @click="busineHandle">添加 {{ msg }}</el-button>
      <!--        全屏编辑-->
@@ -10,8 +10,8 @@
      <el-button icon="el-icon-info" size="small" @click="ruleAddHandler">验证规则</el-button>
      <!--        属性分组-->
      <el-button icon="el-icon-menu" size="small" @click="attrVisibleHandle">属性分组</el-button>
      </el-button-group>
      <el-button-group>
      <!--        分类注入-->
      <el-button icon="el-icon-magic-stick" size="small" @click="injectBtn">分类注入</el-button>
        <!--    组合规则-->
@@ -22,8 +22,8 @@
      <el-button size="small" @click="CascadeHandle">级联属性</el-button>
      <!--    预览排序-->
        <el-button size="small" @click="orderHandle" icon="el-icon-arrow-down">预览排序</el-button>
      </el-button-group>
      <el-button-group>
      <!--    保存-->
      <el-button size="small" @click="addsHandler" icon="el-icon-check">保存</el-button>
      <!--    删除-->
@@ -32,7 +32,7 @@
      <el-button size="small" @click="reset" icon="el-icon-refresh-right">重置</el-button>
      <!--    同步到其他模板-->
      <el-button size="small"@click="syncHandle" icon="el-icon-share">同步到其他模板</el-button>
      </el-button-group>
      <!--    编码申请预览-->
      <el-button size="small" @click="applicationHandle" style="">编码申请预览</el-button>
      <!--        验证规则-->
@@ -270,7 +270,7 @@
                    @blur="saveRows"></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' " @visible-change="DataChangeHandler($event,item.editConfig,index)">
          <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)">
            <el-option
              v-for="optionItem in item.data"
              :key="optionItem.dictValue"
@@ -374,6 +374,7 @@
      editingRows: null,
      editShows:"",
      attrFlag: false,
      referObject:{},
      //编码申请预览option
      applicationoption: {
        column: []
@@ -1360,7 +1361,11 @@
    )
  },
  created() {
    this.option.column.forEach((item,index) => {
      if (item.edit == 'select') {
        this.selectChangeHandler(item.editConfig,index)
      }
    })
  },
  methods: {
    formAttr(row, column) {
@@ -1387,15 +1392,16 @@
    //参照配置子组件
    echoReferConfig(val){
      console.log('val--',val)
      this.referObject=val
      this.$set(this.CurrentCell,'referConfig',JSON.stringify(val))
    },
    //时间下拉格式
    DataChangeHandler($event,editConfig,index){
    //可输可选下拉
    selectChangeHandler(editConfig,index){
      let that=this;
      if(!$event){
      /*if(that.option.column[index].data && that.option.column[index].data.length>=0){
        return;
      }
      }*/
      listByFlag(editConfig.extraParams).then(res=>{
        that.option.column[index].data=res.data.data;
      })
@@ -1403,7 +1409,7 @@
    //属性分组按钮
    attrVisibleHandle() {
     if (this.attrSelectList < 1) {
        this.$message.warning('请选择一条模板属性')
        this.$message.warning('请选择模板属性')
      } else  {
        this.attrVisible = true;
       console.log(this.attrSelectList)
@@ -1541,7 +1547,7 @@
      console.log(row)
    },
    //表格选择
    selectionChange(list,) {
    selectionChange(list) {
      this.attrSelectList = list;
      console.log(list)
    },
@@ -1650,11 +1656,9 @@
    },
    //验证规则按钮
    ruleAddHandler(){
      if(this.attrSelectList.length>1){
        this.$message.warning('只能选择一条数据')
      }else if(this.attrSelectList.length<1){
        this.$message.warning('请选择一提模板属性')
      }else if(this.attrSelectList.length === 1){
      if (this.attrSelectList < 1) {
        this.$message.warning('请选择模板属性')
      } else{
        this.rulesVisible=true
      }
@@ -1671,11 +1675,12 @@
    },
    // 验证规则确定
    rulesHandle() {
     if(this.CurrentCell.length>0){
     if(this.CurrentCell){
       this.$set(this.CurrentCell,'verifyRule',this.RulesForm.expressionText)
     }else {
       console.log(this.attrSelectList)
       this.$set(this.attrSelectList[0],'verifyRule',this.RulesForm.expressionText)
       this.attrSelectList.forEach((item)=>{
         this.$set(item,'verifyRule',this.RulesForm.expressionText)
       })
       this.rulesremove()
     }
      this.rulesVisible = false