田源
2023-07-27 4123ea005ce58731881c4b85d350b27e9f138760
Source/UBCS-WEB/src/components/Tree/classifyTrees.vue
@@ -33,14 +33,14 @@
            <el-form-item :label="this.TreeFlag ? '分类名称:' :'主题库名称:'" label-width="110px" style="display: inline-block" prop="name">
              <el-input v-model="TreeAddform.name" autocomplete="off" style="width: 170px"></el-input>
            </el-form-item>
            <el-form-item label="存储的业务类型:" label-width="150px" v-if="TreeFlagCode==false" prop="btmTypeName">
              <el-input v-model="TreeAddform.btmTypeName" autocomplete="off" style="width: 585px" @focus="btmFoucus"></el-input>
            </el-form-item>
            <el-form-item label="描述:" label-width="150px">
              <el-input v-model="TreeAddform.description" autocomplete="off" style="width: 585px"></el-input>
            </el-form-item>
            <el-form-item label="编码规则:" label-width="150px">
              <el-input v-model="TreeAddform.codeRuleOidName" autocomplete="off" style="width: 585px" @focus="CodeFoucus"></el-input>
            </el-form-item>
            <el-form-item label="业务类型:" label-width="150px" v-if="TreeFlagCode==false">
              <el-input v-model="TreeAddform.btmTypeName" autocomplete="off" style="width: 585px" @focus="btmFoucus"></el-input>
            </el-form-item>
            <el-form-item label="关键属性查询规则:" label-width="150px">
                <el-input v-model="TreeAddform.codeKeyAttrRepeatOidName" autocomplete="off" @focus="Keyfouce"
@@ -83,9 +83,12 @@
                          @row-save="CrudRowSave"
                          @row-del="CrudRowDel"
                          @row-update="CrudRowUpdata"
                          :before-close="beforeClose"
                          @select="selectHandle"
                          @row-click="rowHandle"
               >
                  <template slot="radio" slot-scope="{row}">
                       <el-radio v-model="selectRow" :label="row.$index" style="padding-left: 10px !important;">{{''}}</el-radio>
                  </template>
            <template slot="menuLeft">
              <el-button plain size="small" type="primary" @click="FindeHanler">查询</el-button>
              <el-button plain size="small" type="primary" @click="TemRefresh">刷新</el-button>
@@ -210,7 +213,6 @@
                >
              </template>
          </avue-crud>
          </basic-container>
          <templatePro :ProData="this.ProData" :crudOid="this.crudOid" :crudLCStatus="this.crudLCStatus" :crudArray="this.crudArray" :Formlist="this.Formlist" :codeClassifyOid="this.codeClassifyOid"></templatePro>
        </span>
@@ -344,6 +346,7 @@
  inject: ["crudTreeData"],
  data() {
    return {
      selectRow:'',
      //树节点显示隐藏
      TreeFlagCode:false,
      //编码规则
@@ -352,7 +355,7 @@
      masterSelectList:[],
      masterName:"",
      masterOid:"",
      //关键属性
      //关键属性btmTypeId
      KeydialogVisible:false,
      KeyName:"",
      KeyOid:"",
@@ -404,14 +407,6 @@
      ],
      SelectValue:"",
      SelectFInd:"",
      rules: {
        id: [
          { required: true, message: '请输入名称', trigger: 'blur' },
        ],
        name:[
          { required: true, message: '请输入编号', trigger: 'blur' },
        ]
      },
      addFlag:false,
      // 表格当前行id
      crudOid:"",
@@ -478,6 +473,17 @@
        codeRuleOidName: "",
        //存储的业务类型
        btmTypeName: ""
      },
      rules: {
        id: [
          { required: true, message: '请输入名称', trigger: 'blur' },
        ],
        name:[
          { required: true, message: '请输入编号', trigger: 'blur' },
        ],
        btmTypeName:[
          { required: true, message: '请选择业务类型', trigger: 'blur' },
        ]
      },
      //avue-tree数据,暂时没有作用,里面功能用element写了,只用avue的一个树组件不用内置表单了。
      TreeAvueform: {},
@@ -628,13 +634,13 @@
        },
        stopLose: {
          tip: "模板只有发布状态才能被使用,是否确定停用?",
          typeText: "停用/失效",
          typeText: "停用",
          funAPi: stopLose,
          load: 'stopLoseLoad'
        },
        startRelease: {
          tip: "是否确定启用/发布这个模板,模板只有发布状态才能被使用,是否继续?",
          typeText: "启用/发布",
          typeText: "启用",
          funAPi: startRelease,
          load: 'startReleaseLoad'
        }
@@ -663,11 +669,16 @@
        index: true,
        border: true,
        height:180,
        selection:true,
        addBtn:this.Formlist.length<=0  && this.nodeClickList != "",
        editBtn:false,
        delBtn:false,
        column: [
          {
            label: '',
            prop: 'radio',
            width: 60,
            hide: false,
          },
          {
            label: "模板编号",
            prop: "id",
@@ -788,8 +799,8 @@
          'conditionMap[id]':this.SelectFInd
        }
        this.KeydefaultRend(masterParameter);
        this.SelectValue=""
        this.SelectFInd=""
        this.SelectValue="";
        this.SelectFInd="";
      }else if(this.SelectValue == 'name'){
        const masterParameter={
          'conditionMap[name]':this.SelectFInd
@@ -909,7 +920,7 @@
    btmSelect(row){
      this.btmSelectList=row;
      this.btmName=row[0].name;
      this.btmOid=row[0].oid;
      this.btmOid=row[0].id;
    },
    //业务类型接口
    btmdefaultRend(masterParameter){
@@ -921,13 +932,31 @@
    MasterHandler(val){
      this.TreeList=val;
    },
    //行单选事件
    selectHandle(selection,row){
    rowHandle(row, column){
      this.selectRow=row.$index;
      this.crudOid=row.oid;
      this.crudLCStatus=row.lcStatus;
      this.crudArray=selection;
      this.crudArray.push(row);
      gridCodeClassifyTemplateAttr({'conditionMap[classifyTemplateOid]': row.oid}).then(res => {
        this.ProData = res.data.data;
        //分类注入数据格式
        this.ProData =  res.data.data.map((item) => {
          //如果分类注入classifyInvokeAttr为空说明是初始状态
          if(item.classifyInvokeAttr !== ''){
            if (!item.hasOwnProperty('classifyInvokeText')) { // 检查classifyInvokeText属性是否存在
              item = {
                ...item,
                classifyInvokeText: {
                  "注入类型": item.classifyInvokeAttr,
                  "注入类型名称": item.classifyInvokeAttrName,
                  "层级设置": item.classifyInvokeLevel,
                  "是否可修改": item.classifyInvokeEditFlag
                }
              };
            }
          }
          return item;
        });
      }).catch(res => {
        this.$message.error(res)
      })
@@ -1225,6 +1254,7 @@
        });
      } else {
        this.$set(row, "codeclassifyoid", this.nodeClickList.oid)
        console.log(this.nodeClickList)
        addSave(row).then(() => {
          this.$message({
            type: "success",