From ea44fca5c2b4e0101a43bea607ce1de1bdc6e173 Mon Sep 17 00:00:00 2001
From: lihang <lihang@vci-tech.com>
Date: 星期三, 12 七月 2023 17:27:24 +0800
Subject: [PATCH] 业务类型相关的修正,主要兼容达梦。

---
 Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue | 1050 +++++++++++++++++++++++++++++----------------------------
 1 files changed, 535 insertions(+), 515 deletions(-)

diff --git a/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue b/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue
index e8abccc..ca03ae9 100644
--- a/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue
+++ b/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue
@@ -1,555 +1,575 @@
 <template>
-    <el-dialog
+  <el-dialog
     title="涓氬姟绫诲瀷"
     :visible.sync="showSubmitDialog"
     append-to-body
     @close="closeSubmitDialog"
     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-item label="鑻辨枃鍚嶇О" label-width="100px" required="true" prop="id">
+        <el-input v-model="btmType.id" :prefix-icon="icons.key"></el-input>
+      </el-form-item>
+      <el-form-item label="涓枃鍚嶇О" label-width="100px">
+        <el-input v-model="btmType.name" :prefix-icon="icons.name"></el-input>
+      </el-form-item>
+      <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" 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>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="鐗堟湰瑙勫垯" label-width="100px">
+        <el-input v-model="btmType.revisionRuleName" :prefix-icon="icons.revisionRule" class="revisionRule"
+                  @focus="openRevision" clearable @clear="clearRevision">
+          <i slot="suffix" class="el-input__icon el-icon-search"></i>
+        </el-input>
+      </el-form-item>
+      <el-form-item label="鐢熷懡鍛ㄦ湡" label-width="100px">
+        <el-input v-model="btmType.lifeCycleId" :prefix-icon="icons.lifeCycle">
+          <i slot="suffix" class="el-input__icon el-icon-search"></i>
+        </el-input>
+      </el-form-item>
+      <div>
+        <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" class="viewInput">
+          <el-input v-model="btmType.view" :prefix-icon="icons.view" :disabled="!btmType.viewFlag"></el-input>
+        </el-form-item>
+      </div>
+      <el-form-item label="鎻忚堪" label-width="100px" class="description">
+        <el-input v-model="btmType.description"
+                  :prefix-icon="icons.desc"
+                  class="descClass"
+                  id="descId"
+        ></el-input>
+      </el-form-item>
+    </el-form>
+    <avue-crud :option="option"
+               :data="btmType.attributes"
+               :page.sync="page"
+               ref="attrTable">
+      <template slot-scope="scope" slot="menuLeft">
+        <el-button type="danger"
+                   icon="el-icon-plus"
+                   size="small"
+                   @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>
+      </template>
+    </avue-crud>
+    <div slot="footer" class="dialog-footer">
+      <el-button type="primary" @click="submitBtmType">纭畾</el-button>
+      <el-button @click="cancleSubmitBtmType">鍙栨秷</el-button>
+    </div>
+
+    <!-- 灞炴�ф睜鐨勯�夋嫨 -->
+    <el-dialog title="灞炴�ф睜"
+               :visible="attrRef.visible"
+               append-to-body
+               @close="closeAttrDialog"
+               width="80%"
     >
-        <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>
-            <el-form-item label="涓枃鍚嶇О" label-width="100px">
-                <el-input v-model="btmType.name" :prefix-icon="icons.name"></el-input>
-            </el-form-item>
-            <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-option v-for="item in domainOption"
-                    :label="item.label" :value="item.value" :key="item.value"></el-option>
-                </el-select>
-            </el-form-item>
-            <el-form-item label="鐗堟湰瑙勫垯" label-width="100px">
-                <el-input v-model="btmType.revisionRuleName" :prefix-icon="icons.revisionRule" class="revisionRule"
-                @focus="openRevision" clearable @clear="clearRevision">
-                    <i slot="suffix" class="el-input__icon el-icon-search"></i>
-                </el-input>
-            </el-form-item>
-            <el-form-item label="鐢熷懡鍛ㄦ湡" label-width="100px">
-                <el-input v-model="btmType.lifeCycleId" :prefix-icon="icons.lifeCycle">
-                    <i slot="suffix" class="el-input__icon el-icon-search"></i>
-                </el-input>
-            </el-form-item>
-            <div>
-            <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-input v-model="btmType.view" :prefix-icon="icons.view" :disabled="!btmType.viewFlag"></el-input>
-            </el-form-item>
-        </div>
-            <el-form-item label="鎻忚堪" label-width="100px" class="description">
-                <el-input v-model="btmType.description"
-                :prefix-icon="icons.desc"
-                class="descClass"
-                id="descId"
-                ></el-input>
-            </el-form-item>
-        </el-form>
-        <avue-crud :option="option"
-        :data="btmType.attributes"
-        :page.sync="page"
-        ref="attrTable">
-            <template slot-scope="scope" slot="menuLeft">
-                <el-button type="danger"
-                icon="el-icon-plus"
-                size="small"
-                @click="rowAdd()">灞炴�ч�夋嫨</el-button>
-            </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>
-          </template>
-        </avue-crud>
-        <div slot="footer" class="dialog-footer">
-            <el-button type="primary" @click="submitBtmType">纭畾</el-button>
-            <el-button @click="cancleSubmitBtmType">鍙栨秷</el-button>
-        </div>
-
-<!-- 灞炴�ф睜鐨勯�夋嫨 -->
-        <el-dialog title="灞炴�ф睜"
-            :visible="attrRef.visible"
-            append-to-body
-            @close="closeAttrDialog"
-            width="80%"
-        >
-            <avue-crud class="attrRef"
-            :option="attrRef.option"
-            :data="attrRef.data"
-            :page.sync="attrRef.page"
-            ref="attrRef"
-            @on-load="attrRefOnLoad"
-            @search-change="attrRefSearch"
-            @selection-change="selectionChange"
-            v-loading="attrRef.loading">
-                <template slot="typeValue" slot-scope="scope" >
-                    <el-tag>{{scope.row.typeValue}}</el-tag>
-                </template>
-            </avue-crud>
-            <div slot="footer" class="dialog-footer">
-                <el-button @click="confirmSelectAttr">纭畾</el-button>
-                <el-button @click="cancleSelectAttr">鍙栨秷</el-button>
-            </div>
-        </el-dialog>
-<!-- 鐗堟湰瑙勫垯鐨勫弬鐓� -->
-        <el-dialog title="璇烽�夋嫨鐗堟湰瑙勫垯"
-            :visible.sync="revisionRef.visible"
-            append-to-body
-            width="80%">
-
-            <avue-crud class="revisionRef"
-             :option="revisionRef.option"
-             :data="revisionRef.data"
-             :page.sync="revisionRef.page"
-             ref="revisionRef"
-             @row-click="revisionClick">
-                <template slot="radio"
-                slot-scope="{row}">
-                    <el-radio v-model="revisionRef.selectRow"
-                        :label="row.$index">&nbsp;
-                    </el-radio>
-                </template>
-            </avue-crud>
-            <div slot="footer" class="dialog-footer">
-                <el-button type="primary" @click="confirmRevision">纭畾</el-button>
-                <el-button @click="cancelRevision">鍙栨秷</el-button>
-            </div>
-        </el-dialog>
+      <avue-crud class="attrRef"
+                 :option="attrRef.option"
+                 :data="attrRef.data"
+                 :page.sync="attrRef.page"
+                 ref="attrRef"
+                 @on-load="attrRefOnLoad"
+                 @search-change="attrRefSearch"
+                 @selection-change="selectionChange"
+                 v-loading="attrRef.loading">
+        <template slot="typeValue" slot-scope="scope">
+          <el-tag>{{ scope.row.typeValue }}</el-tag>
+        </template>
+      </avue-crud>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="confirmSelectAttr">纭畾</el-button>
+        <el-button @click="cancleSelectAttr">鍙栨秷</el-button>
+      </div>
     </el-dialog>
+    <!-- 鐗堟湰瑙勫垯鐨勫弬鐓� -->
+    <el-dialog title="璇烽�夋嫨鐗堟湰瑙勫垯"
+               :visible.sync="revisionRef.visible"
+               append-to-body
+               width="80%">
+
+      <avue-crud class="revisionRef"
+                 :option="revisionRef.option"
+                 :data="revisionRef.data"
+                 :page.sync="revisionRef.page"
+                 ref="revisionRef"
+                 @row-click="revisionClick">
+        <template slot="radio"
+                  slot-scope="{row}">
+          <el-radio v-model="revisionRef.selectRow"
+                    :label="row.$index">&nbsp;
+          </el-radio>
+        </template>
+      </avue-crud>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="confirmRevision">纭畾</el-button>
+        <el-button @click="cancelRevision">鍙栨秷</el-button>
+      </div>
+    </el-dialog>
+  </el-dialog>
 </template>
 
 
 <script>
 
-import { add,update } from '@/api/omd/btmType';
-import { queryPage } from '@/api/omd/OmdAttribute';
-import { getPage } from '@/api/omd/revisionRule';
+import {add, update} from '@/api/omd/btmType';
+import {queryPage} from '@/api/omd/OmdAttribute';
+import {getPage} from '@/api/omd/revisionRule';
+
 export default {
-    name: 'BusinessAdd',
-    props: {
-        btmType:{
-            type: Object
-        },
-        domainOption:{
-            type: Array
-        },
-        icons: {
-            type: Array
-        }
+  name: 'BusinessAdd',
+  props: {
+    btmType: {
+      type: Object
     },
-  watch:{
-    btmType:{
-      handler(newval,oldval){
-        console.log('鐩戝惉',newval,oldval)
-      },
-      deep:true,
-      immediate:true
+    domainOption: {
+      type: Array
+    },
+    icons: {
+      type: Array
     }
   },
-    data() {
-        return {
-            form: {},
-            showSubmitDialog : false,
-            option: {
-                height: "330px",
-                selection: false,
-                headerAlign: 'center',
-                border: true,
-                index: true,
-                rowKey: 'id',
-                tabs: true,
-                menu: true,
-                editBtn: false,
-                delBtn: false,
-                menuWidth: 150,
-                addBtn:false,
-                highlightCurrentRow: true,
-                column: [
-                    {
-                        label: '鑻辨枃鍚嶇О',
-                        prop: 'id',
-                        align: 'center'
-                    }, {
-                        label: '涓枃鍚嶇О',
-                        prop: 'name',
-                        align: 'center',
-                        cell: true
-                    },
-                    {
-                        label: "绫诲瀷",
-                        prop: "attrDataType",
-                        align: 'center',
-                        slot: true
-                    },
-                    {
-                        label: "榛樿鍊�",
-                        prop: "defaultValue",
-                        align: 'center',
-                        cell: true
-                    },
-                    {
-                        label: "璇存槑",
-                        prop: "description",
-                        align: 'center',
-                        cell:true
-                    }
-                ]
-            },
-            attrRef:{
-                visible:false,
-                page: {
-                    currentPage:1,
-                    pageSize:10,
-                },
-                loading: false,
-                key: null,
-                option:{
-                    height: 360,
-                    addBtn: false,
-                    refreshBtn: false,
-                    columnBtn: false,
-                    selection: true,
-                    menu: false,
-                    border: true,
-                    reserveSelection: true,
-                    searchMenuSpan:8,
-                    highlightCurrentRow: true,
-                    rowKey: 'id',
-                    column: [
-                        {
-                        label: '鑻辨枃鍚嶇О',
-                        prop: 'id',
-                        align: 'left',
-                        search: true,
-                        width: 230
-                    }, {
-                        label: '涓枃鍚嶇О',
-                        prop: 'name',
-                        align: 'center',
-                    },
-                    {
-                        label: "绫诲瀷",
-                        prop: "typeValue",
-                        align: 'center',
-                        slot: true,
-                    },
-                    {
-                        label: "榛樿鍊�",
-                        prop: "defaultValue",
-                        align: 'center'
-                    },
-                    {
-                        label: '鍏佽涓虹┖',
-                        prop: 'nullable',
-                        type: 'switch',
-                        display: false,
-                        hide: true,
-                        labelWidth: 132,
-                        dicData: [{
-                        label: '鍚�',
-                        value: 1
-                        }, {
-                        label: '鏄�',
-                        value: 0
-                        }]
-                    },
-                    {
-                        label: "璇存槑",
-                        prop: "description",
-                        cell:true,
-                        align: 'center'
-                    }
-                    ]
-                },
-                data: [],
-                queryNotIn: ''
-            },
-            revisionRef: {
-                visible: false,
-                page: {
-                    currentPage:1,
-                    pageSize: 10
-                },
-                selectRow:'',
-                searchKey: null,
-                option:{
-                    height: 360,
-                    addBtn: false,
-                    refreshBtn: false,
-                    columnBtn: false,
-                    menu: false,
-                    border: true,
-                    reserveSelection: true,
-                    searchMenuSpan:8,
-                    searchShowBtn: false,
-                    highlightCurrentRow: true,
-                    column:[{
-                        label: '閫夋嫨',
-                        prop: 'radio',
-                        width: 60,
-                        hide: false
-                    },
-                        {
-                            label:'鑻辨枃鍚嶇О',
-                            prop: 'id',
-                            search:true
-                        },
-                        {
-                            label:"涓枃鍚嶇О",
-                            prop:"name",
-                            search:true,
-                        },
-                        {
-                            label:"璺宠穬瀛楃",
-                            prop: "skipCode"
-                        },
-                        {
-                            label: "鍒濆鍊�",
-                            prop:"startCode"
-                        },
-                        {
-                            label: "姝ラ暱",
-                            prop: "serialStep"
-                        },
-                        {
-                            label: "鍓嶇紑",
-                            prop:"prefixCode"
-                        },
-                        {
-                            label: "鍚庣紑",
-                            prop: "suffixCode"
-                        },
-                        {
-                            label: "鎻忚堪",
-                            prop:"description",
-                            type:"textarea"
-                        }
-                    ]
-                },
-            },
-            rules: {
-                id: [
-                    { required: true, message: '璇疯緭鍏ヤ笟鍔$被鍨嬬紪鍙�', trigger: 'blur' },
-                    { pattern: /^[A-Za-z]+$/, message: '涓氬姟绫诲瀷缂栧彿鍙兘涓鸿嫳鏂�', trigger: 'blur' },
-                    { min: 2, max: 20, message: '闀垮害鍦�2鍒�20涓瓧绗�', trigger: 'blur' }
-                ],
-                domain: [
-                    { required: true, message: '璇烽�夋嫨鎵�灞為鍩�', trigger: 'blur' }
-                ]
-            },
-        }
-    },
-    created() {
-
-    },
-    methods: {
-        // 鍏抽棴缁勪欢寮圭獥
-        closeSubmitDialog(){
-            this.showSubmitDialog = false;
-            this.btmType.attributes = [];
-            this.btmType = {};
-            this.attrRef.selectData = [];
-            this.attrRef.queryNotIn = null;
-            this.resetForm();
-        },
-        // 鍏抽棴灞炴�ф睜鏌ヨ寮圭獥
-        closeAttrDialog(){
-            this.attrRef.visible = false;
-        },
-        // 灞炴�ч�夋嫨娣诲姞
-        async rowAdd() {
-            await this.attrRefOnLoad();
-            this.attrRef.visible = true;
-        },
-        // 灞炴�ф睜鍔犺浇
-        attrRefOnLoad(){
-            if (this.attrRef.queryNotIn != ''){
-              this.attrRef.queryNotIn = '';
-               this.btmType.attributes.forEach(item => {
-                  this.attrRef.queryNotIn += (item.id + ",")
-               })
-            }
-            this.attrRef.loading = true;
-            queryPage(this.attrRef.key,this.attrRef.queryNotIn,this.attrRef.page.currentPage, this.attrRef.page.pageSize).then(res => {
-                const data = res.data.data;
-                this.attrRef.page.total = data.total;
-                this.attrRef.data = data.records;
-            });
-            setTimeout(() => {
-              this.attrRef.loading = false;
-            },600)
-            this.$nextTick(() => {
-                this.$refs.attrRef.refreshTable();
-            });
-        },
-        // 灞炴�ф睜妫�绱�
-        attrRefSearch(form,done){
-            this.attrRef.key = form.id;
-            this.attrRefOnLoad();
-            done();
-            this.attrRef.key = null;
-        },
-        // 浠庡睘鎬ф睜涓Щ闄�
-        removeFormAttrTable(row,index){
-          this.btmType.attributes.splice(index,1);
-          this.attrRef.queryNotIn = "";
-          this.btmType.attributes.forEach(item => {
-            this.attrRef.queryNotIn += (item.id + ",")
-          })
-        },
-        // 灞炴�ф睜鍕鹃�変簨浠�
-        selectionChange(list){
-            this.attrRef.selectData = list;
-        },
-        // 纭灞炴�ф睜鍕鹃��
-        confirmSelectAttr(){
-            if(!this.btmType.attributes) {
-              this.btmType.attributes = [];
-            }
-            this.attrRef.selectData.forEach(item => {
-                this.btmType.attributes.push({
-                    id: item.id,
-                    name: item.name,
-                    typeValue: item.typeValue,
-                    typeKey: item.typeValue,
-                    attrDataType : item.typeKey,
-                    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 + ",")
-            });
-            this.attrRef.data = [];
-            this.closeAttrDialog();
-        },
-        // 鍙栨秷灞炴�ф睜鍕鹃��
-        cancleSelectAttr(){
-            this.attrRef.selectData = [];
-            this.closeAttrDialog();
-        },
-        // 娣诲姞涓氬姟绫诲瀷
-        submitBtmType(){
-            console.log(this.btmType);
-            add(this.btmType,true).then(res => {
-                // 娣诲姞瀹屾垚锛屽洖璋冪埗缁勪欢鐨勫埛鏂�
-                this.$message.success('淇濆瓨鎴愬姛');
-                this.cancleSubmitBtmType();
-                this.$emit('refreshTable');
-            })
-        },
-        // 鍙栨秷娣诲姞涓氬姟绫诲瀷
-        cancleSubmitBtmType(){
-            this.btmType = {};
-            this.btmType.attributes = [];
-            this.showSubmitDialog = false;
-        },
-        // 鍒锋柊灞炴�у垪琛�
-        refreshAttrTable(){
-            this.$nextTick( () => {
-                this.$refs.attrTable.refreshTable();
-            })
-        },
-        //
-        viewChange(){
-
-        },
-        // 鍒楄〃缂栬緫
-        cellEditClick(cell){
-          console.log(cell);
-            cell.$cellEdit = true;
-        },
-        // 鍒楄〃缂栬緫淇濆瓨
-        cellEditSave(row){
-            this.btmType.attributes[row.$index].name = row.name
-            this.btmType.attributes[row.$index].defaultValue = row.defaultValue;
-            this.btmType.attributes[row.$index].description = row.description;
-            row.$cellEdit = false;
-        },
-        // 鎵撳紑鐗堟湰瑙勫垯鍙傜収
-        async openRevision(){
-            await getPage().then(res => {
-                this.revisionRef.data = res.data.data.records;
-            });
-            this.revisionRef.visible = true;
-        },
-       // 鍏抽棴鐗堟湰瑙勫垯鍙傜収寮圭獥
-       closeRevisionDialog(){
-            this.revisionRef.visible = false;
-       },
-       // 鐗堟湰瑙勫垯鍙傜収鍒楄〃妫�绱�
-       revisionRefSearch(){
-
-       },
-       // 鐗堟湰瑙勫垯閫変腑浜嬩欢
-       revisionChange(){},
-       // 纭閫変腑鐗堟湰瑙勫垯
-       confirmRevision(){
-            this.btmType.revisionFlag = true;
-            this.btmType.revisionRuleId = this.revisionRef.selectData.id;
-            this.btmType.revisionRuleName = this.revisionRef.selectData.name;
-            this.btmType.inputRevisionFlag = false;
-            this.cancelRevision();
-       },
-       // 鍙栨秷閫変腑鐗堟湰瑙勫垯
-       cancelRevision(){
-            this.revisionRef.selectRow  = '';
-            this.revisionRef.selectData = {};
-            this.closeRevisionDialog();
-       },
-       // 鐗堟湰瑙勫垯鍗曢��
-       revisionClick(row){
-            this.revisionRef.selectRow = row.$index;
-            this.revisionRef.selectData = {
-                id: row.id,
-                name: row.name,
-            };
-       },
-       clearRevision(){
-            this.$delete(this.btmType,'revisionFlag');
-            this.$delete(this.btmType,'revisionRuleId');
-            this.$delete(this.btmType,'revisionRuleName');
-            this.$delete(this.btmType,'inputRevisionFlag');
-       },
-       resetForm(){
-        this.btmType = {};
-        this.$refs.form.resetFields();
-       }
+  watch: {
+    btmType: {
+      handler(newval, oldval) {
+        console.log('鐩戝惉', newval, oldval)
+      },
+      deep: true,
+      immediate: true
     }
+  },
+  data() {
+    return {
+      form: {},
+      showSubmitDialog: false,
+      option: {
+        height: "330px",
+        selection: false,
+        headerAlign: 'center',
+        border: true,
+        index: true,
+        rowKey: 'id',
+        tabs: true,
+        menu: true,
+        editBtn: false,
+        delBtn: false,
+        columnBtn: false,
+        menuWidth: 150,
+        addBtn: false,
+        highlightCurrentRow: true,
+        column: [
+          {
+            label: '鑻辨枃鍚嶇О',
+            prop: 'id',
+            align: 'center'
+          }, {
+            label: '涓枃鍚嶇О',
+            prop: 'name',
+            align: 'center',
+            cell: true
+          },{
+            label: "绫诲瀷",
+            prop: "attrDataTypeText",
+            align: 'center',
+            slot: true
+          },
+          {
+            label: "榛樿鍊�",
+            prop: "defaultValue",
+            align: 'center',
+            cell: true
+          },
+          {
+            label: "璇存槑",
+            prop: "description",
+            align: 'center',
+            cell: true
+          }
+        ]
+      },
+      attrRef: {
+        visible: false,
+        page: {
+          currentPage: 1,
+          pageSize: 10,
+        },
+        loading: false,
+        key: null,
+        option: {
+          height: 360,
+          addBtn: false,
+          refreshBtn: false,
+          columnBtn: false,
+          selection: true,
+          menu: false,
+          border: true,
+          reserveSelection: true,
+          searchMenuSpan: 8,
+          highlightCurrentRow: true,
+          rowKey: 'id',
+          column: [
+            {
+              label: '鑻辨枃鍚嶇О',
+              prop: 'id',
+              align: 'left',
+              search: true,
+              width: 230
+            }, {
+              label: '涓枃鍚嶇О',
+              prop: 'name',
+              align: 'center',
+            },
+            {
+              label: "绫诲瀷",
+              prop: "typeValue",
+              align: 'center',
+              slot: true,
+            },
+            {
+              label: "榛樿鍊�",
+              prop: "defaultValue",
+              align: 'center'
+            },
+            {
+              label: '鍏佽涓虹┖',
+              prop: 'nullable',
+              type: 'switch',
+              display: false,
+              hide: true,
+              labelWidth: 132,
+              dicData: [{
+                label: '鍚�',
+                value: 1
+              }, {
+                label: '鏄�',
+                value: 0
+              }]
+            },
+            {
+              label: "璇存槑",
+              prop: "description",
+              cell: true,
+              align: 'center'
+            }
+          ]
+        },
+        data: [],
+        queryNotIn: ''
+      },
+      revisionRef: {
+        visible: false,
+        page: {
+          currentPage: 1,
+          pageSize: 10
+        },
+        selectRow: '',
+        searchKey: null,
+        option: {
+          height: 360,
+          addBtn: false,
+          refreshBtn: false,
+          columnBtn: false,
+          menu: false,
+          border: true,
+          reserveSelection: true,
+          searchMenuSpan: 8,
+          searchShowBtn: false,
+          highlightCurrentRow: true,
+          column: [{
+            label: '閫夋嫨',
+            prop: 'radio',
+            width: 60,
+            hide: false
+          },
+            {
+              label: '鑻辨枃鍚嶇О',
+              prop: 'id',
+              search: true
+            },
+            {
+              label: "涓枃鍚嶇О",
+              prop: "name",
+              search: true,
+            },
+            {
+              label: "璺宠穬瀛楃",
+              prop: "skipCode"
+            },
+            {
+              label: "鍒濆鍊�",
+              prop: "startCode"
+            },
+            {
+              label: "姝ラ暱",
+              prop: "serialStep"
+            },
+            {
+              label: "鍓嶇紑",
+              prop: "prefixCode"
+            },
+            {
+              label: "鍚庣紑",
+              prop: "suffixCode"
+            },
+            {
+              label: "鎻忚堪",
+              prop: "description",
+              type: "textarea"
+            }
+          ]
+        },
+      },
+      rules: {
+        id: [
+          {required: true, message: '璇疯緭鍏ヤ笟鍔$被鍨嬬紪鍙�', trigger: 'blur'},
+          {pattern: /^[A-Za-z]+$/, message: '涓氬姟绫诲瀷缂栧彿鍙兘涓鸿嫳鏂�', trigger: 'blur'},
+          {min: 2, max: 20, message: '闀垮害鍦�2鍒�20涓瓧绗�', trigger: 'blur'}
+        ],
+        domain: [
+          {required: true, message: '璇烽�夋嫨鎵�灞為鍩�', trigger: 'blur'}
+        ]
+      },
+    }
+  },
+  created() {
+
+  },
+  methods: {
+    // 鍏抽棴缁勪欢寮圭獥
+    closeSubmitDialog() {
+      this.showSubmitDialog = false;
+      this.btmType.attributes = [];
+      this.btmType = {};
+      this.attrRef.selectData = [];
+      this.attrRef.queryNotIn = null;
+      this.resetForm();
+    },
+    // 鍏抽棴灞炴�ф睜鏌ヨ寮圭獥
+    closeAttrDialog() {
+      this.attrRef.visible = false;
+    },
+    // 灞炴�ч�夋嫨娣诲姞
+    async rowAdd() {
+      await this.attrRefOnLoad();
+      this.attrRef.visible = true;
+    },
+    // 灞炴�ф睜鍔犺浇
+    attrRefOnLoad() {
+      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 + ",")
+        })
+      }
+      this.attrRef.loading = true;
+      queryPage(this.attrRef.key, this.attrRef.queryNotIn, this.attrRef.page.currentPage, this.attrRef.page.pageSize).then(res => {
+        const data = res.data.data;
+        this.attrRef.page.total = data.total;
+        this.attrRef.data = data.records;
+      });
+      setTimeout(() => {
+        this.attrRef.loading = false;
+      }, 600)
+      this.$nextTick(() => {
+        this.$refs.attrRef.refreshTable();
+      });
+    },
+    // 灞炴�ф睜妫�绱�
+    attrRefSearch(form, done) {
+      this.attrRef.key = form.id;
+      this.attrRefOnLoad();
+      done();
+      this.attrRef.key = null;
+    },
+    // 浠庡睘鎬ф睜涓Щ闄�
+    removeFormAttrTable(row, index) {
+      this.btmType.attributes.splice(index, 1);
+      this.attrRef.queryNotIn = "";
+      this.btmType.attributes.forEach(item => {
+        this.attrRef.queryNotIn += (item.id + ",")
+      })
+    },
+    // 灞炴�ф睜鍕鹃�変簨浠�
+    selectionChange(list) {
+      this.attrRef.selectData = list;
+    },
+    // 纭灞炴�ф睜鍕鹃��
+    confirmSelectAttr() {
+      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,
+          attrDataType: item.typeKey,
+          attrDataTypeText: item.typeValue,
+          defaultValue: item.defaultValue,
+          description: item.description,
+          attributeLength: item.maxLength,
+          referBtmTypeId: item.referTypeCode,
+          referBtmTypeName: item.referToName,
+          enumId: item.dictCode,
+        });
+        this.attrRef.queryNotIn += (item.id + ",")
+      });
+      this.attrRef.data = [];
+      this.closeAttrDialog();
+    },
+    // 鍙栨秷灞炴�ф睜鍕鹃��
+    cancleSelectAttr() {
+      this.attrRef.selectData = [];
+      this.closeAttrDialog();
+    },
+    // 娣诲姞涓氬姟绫诲瀷
+    submitBtmType() {
+      console.log(this.btmType);
+      add(this.btmType, true).then(res => {
+        // 娣诲姞瀹屾垚锛屽洖璋冪埗缁勪欢鐨勫埛鏂�
+        this.$message.success('淇濆瓨鎴愬姛');
+        this.cancleSubmitBtmType();
+        this.$emit('refreshTable');
+      })
+    },
+    // 鍙栨秷娣诲姞涓氬姟绫诲瀷
+    cancleSubmitBtmType() {
+      this.btmType = {};
+      this.btmType.attributes = [];
+      this.showSubmitDialog = false;
+    },
+    // 鍒锋柊灞炴�у垪琛�
+    refreshAttrTable() {
+      this.$nextTick(() => {
+        this.$refs.attrTable.refreshTable();
+      })
+    },
+    //
+    viewChange() {
+
+    },
+    // 鍒楄〃缂栬緫
+    cellEditClick(cell) {
+      console.log(cell);
+      cell.$cellEdit = true;
+    },
+    // 鍒楄〃缂栬緫淇濆瓨
+    cellEditSave(row) {
+      this.btmType.attributes[row.$index].name = row.name
+      this.btmType.attributes[row.$index].defaultValue = row.defaultValue;
+      this.btmType.attributes[row.$index].description = row.description;
+      row.$cellEdit = false;
+    },
+    // 鎵撳紑鐗堟湰瑙勫垯鍙傜収
+    async openRevision() {
+      await getPage().then(res => {
+        this.revisionRef.data = res.data.data.records;
+      });
+      this.revisionRef.visible = true;
+    },
+    // 鍏抽棴鐗堟湰瑙勫垯鍙傜収寮圭獥
+    closeRevisionDialog() {
+      this.revisionRef.visible = false;
+    },
+    // 鐗堟湰瑙勫垯鍙傜収鍒楄〃妫�绱�
+    revisionRefSearch() {
+
+    },
+    // 鐗堟湰瑙勫垯閫変腑浜嬩欢
+    revisionChange() {
+    },
+    // 纭閫変腑鐗堟湰瑙勫垯
+    confirmRevision() {
+      this.btmType.revisionFlag = true;
+      this.btmType.revisionRuleId = this.revisionRef.selectData.id;
+      this.btmType.revisionRuleName = this.revisionRef.selectData.name;
+      this.btmType.inputRevisionFlag = false;
+      this.cancelRevision();
+    },
+    // 鍙栨秷閫変腑鐗堟湰瑙勫垯
+    cancelRevision() {
+      this.revisionRef.selectRow = '';
+      this.revisionRef.selectData = {};
+      this.closeRevisionDialog();
+    },
+    // 鐗堟湰瑙勫垯鍗曢��
+    revisionClick(row) {
+      this.revisionRef.selectRow = row.$index;
+      this.revisionRef.selectData = {
+        id: row.id,
+        name: row.name,
+      };
+    },
+    clearRevision() {
+      this.$delete(this.btmType, 'revisionFlag');
+      this.$delete(this.btmType, 'revisionRuleId');
+      this.$delete(this.btmType, 'revisionRuleName');
+      this.$delete(this.btmType, 'inputRevisionFlag');
+    },
+    resetForm() {
+      this.btmType = {};
+      this.$refs.form.resetFields();
+    }
+  }
 }
 </script>
 
 <style>
 /* 灞炴�ф睜鍙傜収鍒楄〃 */
-.attrRef > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu{
-    display: none !important;
+.attrRef > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu {
+  display: none !important;
 }
 
-.revisionRef > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu{
-    display: none !important;
+.revisionRef > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu {
+  display: none !important;
 }
 
 .btmTypeForm > .el-form-item > .el-form-item__content > .el-input > .el-input__inner {
-    width: 200px;
+  width: 200px;
+}
+
+.domainSelect > .el-form-item__content > .el-select > .el-input > .el-input__inner {
+  width: 200px;
 }
 
 .viewFlag {
-    width: 305px;
+  width: 305px;
+}
+
+.viewInput > .el-form-item__content > .el-input > .el-input__inner {
+  width: 200px;
 }
 
 .descClass > .el-input__inner {
-    width: 57vw
+  width: 57vw
 }
 
 #descId {
-    width: 57vw;
+  width: 57vw;
 }
 </style>

--
Gitblit v1.9.3