lihang
2023-07-12 ea44fca5c2b4e0101a43bea607ce1de1bdc6e173
Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue
@@ -7,7 +7,8 @@
    width="70%"
    style="height: 115vh;"
    >
        <el-form ref="form" :model="btmType" show-message="true" inline size="medium" label-suffix=":" class="btmTypeForm" :rules="rules" @resetFields="resetForm" status-icon="true">
    <el-form ref="form" :model="btmType" show-message="true" inline size="medium" label-suffix=":" class="btmTypeForm"
             :rules="rules" @resetFields="resetForm" status-icon="true">
            <el-form-item label="英文名称" label-width="100px" required="true" prop="id">
                <el-input v-model="btmType.id" :prefix-icon="icons.key"></el-input>
            </el-form-item>
@@ -17,10 +18,11 @@
            <el-form-item label="数据库表名" label-width="100px">
                <el-input v-model="btmType.tableName" :prefix-icon="icons.tableName"></el-input>
            </el-form-item>
            <el-form-item label="所属领域" label-width="100px" prop="domain">
                <el-select v-model="btmType.domain" :prefix-icon="icons.domain">
      <el-form-item label="所属领域" label-width="100px" prop="domain" class="domainSelect">
        <el-select v-model="btmType.bizDomain" :prefix-icon="icons.domain">
                    <el-option v-for="item in domainOption"
                    :label="item.label" :value="item.value" :key="item.value"></el-option>
                     :label="item.label" :value="item.value" :key="item.value">
          </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="版本规则" label-width="100px">
@@ -38,7 +40,7 @@
            <el-form-item label="开启视图" label-width="100px" class="viewFlag">
                <el-switch v-model="btmType.viewFlag" active-color="#13ce66" @change="viewChange"></el-switch>
            </el-form-item>
            <el-form-item label="视图语句" label-width="100px">
        <el-form-item label="视图语句" label-width="100px" class="viewInput">
                <el-input v-model="btmType.view" :prefix-icon="icons.view" :disabled="!btmType.viewFlag"></el-input>
            </el-form-item>
        </div>
@@ -58,12 +60,21 @@
                <el-button type="danger"
                icon="el-icon-plus"
                size="small"
                @click="rowAdd()">属性选择</el-button>
                   @click="rowAdd()">属性选择
        </el-button>
      </template>
      <template slot="attrDataTypeText" slot-scope="{row}">
        <el-tag>{{ row.attrDataTypeText }}</el-tag>
            </template>
          <template slot="menu" slot-scope="{row,index}">
            <el-button icon="el-icon-edit" size="small" type="text" v-if="!row.$cellEdit" @click="cellEditClick(row)">编辑</el-button>
            <el-button icon="el-icon-delete" size="small" type="text" v-if="!row.$cellEdit" @click="removeFormAttrTable(row,index)">移除</el-button>
            <el-button icon="el-icon-check" size="small" type="text" v-if="row.$cellEdit" @click="cellEditSave(row,index)">保存</el-button>
        <el-button icon="el-icon-edit" size="small" type="text" v-if="!row.$cellEdit" @click="cellEditClick(row)">编辑
        </el-button>
        <el-button icon="el-icon-delete" size="small" type="text" v-if="!row.$cellEdit"
                   @click="removeFormAttrTable(row,index)">移除
        </el-button>
        <el-button icon="el-icon-check" size="small" type="text" v-if="row.$cellEdit" @click="cellEditSave(row,index)">
          保存
        </el-button>
          </template>
        </avue-crud>
        <div slot="footer" class="dialog-footer">
@@ -129,6 +140,7 @@
import { add,update } from '@/api/omd/btmType';
import { queryPage } from '@/api/omd/OmdAttribute';
import { getPage } from '@/api/omd/revisionRule';
export default {
    name: 'BusinessAdd',
    props: {
@@ -166,6 +178,7 @@
                menu: true,
                editBtn: false,
                delBtn: false,
        columnBtn: false,
                menuWidth: 150,
                addBtn:false,
                highlightCurrentRow: true,
@@ -179,10 +192,9 @@
                        prop: 'name',
                        align: 'center',
                        cell: true
                    },
                    {
          },{
                        label: "类型",
                        prop: "attrDataType",
            prop: "attrDataTypeText",
                        align: 'center',
                        slot: true
                    },
@@ -368,7 +380,7 @@
        },
        // 属性池加载
        attrRefOnLoad(){
            if (this.attrRef.queryNotIn != ''){
      if (this.attrRef.queryNotIn != '' && this.btmType.attributes !== undefined && this.btmType.attributes.length > 0) {
              this.attrRef.queryNotIn = '';
               this.btmType.attributes.forEach(item => {
                  this.attrRef.queryNotIn += (item.id + ",")
@@ -411,20 +423,19 @@
            if(!this.btmType.attributes) {
              this.btmType.attributes = [];
            }
      console.log(this.attrRef.selectData);
            this.attrRef.selectData.forEach(item => {
                this.btmType.attributes.push({
                    id: item.id,
                    name: item.name,
                    typeValue: item.typeValue,
                    typeKey: item.typeValue,
                    attrDataType : item.typeKey,
          attrDataTypeText: item.typeValue,
                    defaultValue: item.defaultValue,
                    description: item.description,
                    attributeLength: item.maxLength,
                    referBtmTypeId: item.referTypeCode,
                    referBtmTypeName: item.referToName,
                    enumId: item.dictCode,
                    // enumName: item,
                });
                this.attrRef.queryNotIn += (item.id + ",")
            });
@@ -490,7 +501,8 @@
       },
       // 版本规则选中事件
       revisionChange(){},
    revisionChange() {
    },
       // 确认选中版本规则
       confirmRevision(){
            this.btmType.revisionFlag = true;
@@ -541,10 +553,18 @@
    width: 200px;
}
.domainSelect > .el-form-item__content > .el-select > .el-input > .el-input__inner {
  width: 200px;
}
.viewFlag {
    width: 305px;
}
.viewInput > .el-form-item__content > .el-input > .el-input__inner {
  width: 200px;
}
.descClass > .el-input__inner {
    width: 57vw
}