田源
2023-06-26 aa7b19831312d3e8d7eb19fd4e0a44505be24e93
Source/UBCS-WEB/src/components/Tree/classifyTreeform.vue
@@ -1,15 +1,72 @@
<template>
  <avue-form v-model="TreeNewForm" :option="option" @submit="submit">
  </avue-form>
  <div>
    <avue-form v-model="loneTreeNewForm" :option="option" @submit="submit" v-if="flag == 'renonly'">
    </avue-form>
    <avue-form v-model="loneTreeNewForm" :option="options" @submit="submit" v-else-if="flag == 'edit'">
    </avue-form>
    <div>
      <el-dialog  :visible.sync="dialogVisible"   title="为【编码规则】选取值" append-to-body>
        <div>
          <el-input placeholder="请选择内容" v-model="masterInput" class="input-with-select">
            <el-select v-model="MasterSearchSelects"  placeholder="请选择">
              <el-option label="英文名称" value="0"></el-option>
              <el-option label="中文名称" value="1"></el-option>
            </el-select>
            <el-button slot="append" icon="el-icon-search"></el-button>
          </el-input>
        </div>
        <avue-crud :data="masterData" :option="masterOption" @select="masterSelect"></avue-crud>
        <div style="padding-top: 10px;display: flex; justify-content: flex-end" >
          <el-button type="primary" size="small" @click="MasterHandlerClick">确定</el-button>
          <el-button  size="small" @click="dialogVisible=false">取消</el-button>
        </div>
      </el-dialog>
    </div>
  </div>
</template>
<script>
export default {
  name: "classifyTreeform.vue",
  props: ["TreeNewForm"],
  props: ['loneTreeNewForm','flag'],
  data() {
    return {
      masterInput:'',
      MasterSearchSelects:"",
      masterData:[
        {
          id:'001',
          name:'001',
          description:'001'
        },
        {
          id:'002',
          name:'002',
          description:'002'
        }
      ],
      masterOption:{
        addBtn:false,
        index:true,
        border:true,
        selection:true,
        height:380,
        column:[
          {
            label:'英文名称',
            prop:'id'
          },
          {
            label:'中文名称',
            prop:'name'
          },
          {
            label:'描述',
            prop:'description'
          }
        ]
      },
      dialogVisible:false,
      form: {
        name: "哈哈",
        sex: "男"
@@ -45,6 +102,7 @@
            label:"描述",
            prop:"description",
            labelWidth:128,
            readonly: true,
          },
          {
            label: '存储的业务类型',
@@ -61,6 +119,66 @@
            label:"编码规则",
            prop:"coderuleoidName",
            labelWidth:128,
            readonly: true,
          },
          {
            label:"关键属性查询规则",
            prop:"codekeyattrrepeatoidName",
            labelWidth:128,
            readonly: true,
          },
          {
            label:"相似查询规则",
            prop:"codeResembleRuleOidName",
            labelWidth:128,
            readonly: true,
          },
        ]
      },
      options: {
        submitBtn:false,
        emptyBtn:false,
        column: [
          {
            label: '主题库/分类编号',
            prop: 'btmtypeid',
            labelWidth:128,
            rules: [{
              required: true,
              message: "主题库/分类编号",
              trigger: "blur"
            }]
          },
          {
            label: '主题库/分类名称',
            prop: 'name',
            labelWidth:128,
            rules: [{
              required: true,
              message: "主题库/分类名称",
              trigger: "blur"
            }]
          },
          {
            label:"描述",
            prop:"description",
            labelWidth:128,
          },
          {
            label: '存储的业务类型',
            prop: 'btmtypename',
            labelWidth:128,
            rules: [{
              required: true,
              message: "存储的业务类型",
              trigger: "blur"
            }]
          },
          {
            label:"编码规则",
            prop:"coderuleoidName",
            labelWidth:128,
            focus:this.CodeFoucus
          },
          {
            label:"关键属性查询规则",
@@ -72,9 +190,11 @@
            prop:"codeResembleRuleOidName",
            labelWidth:128,
          },
        ]
      },
      FormList: {}
      FormList: {},
      masterSelectList:[]
    }
  },
  methods: {
@@ -85,6 +205,25 @@
    error(err) {
      this.$message.success('请查看控制台');
      console.log(err)
    },
    CodeFoucus(){
      this.dialogVisible=true;
      console.log(this.dialogVisible)
    },
    MasterHandlerClick(){
      if(this.masterSelectList.length>1){
        this.$message.warning('只能选择一条数据')
      }else if(this.masterSelectList.length<=0){
        this.$message.warning('请选择一条数据')
      }else {
        this.dialogVisible=false;
        console.log(this.masterInput)
        console.log(this.MasterSearchSelect)
      }
    },
    masterSelect(row){
      console.log(row)
      this.masterSelectList=row;
    }
  }
}