From 404966637eda6881a0f17683c5aacc7c1c34aed8 Mon Sep 17 00:00:00 2001
From: 田源 <tianyuan@vci-tech.com>
Date: 星期四, 16 一月 2025 16:18:34 +0800
Subject: [PATCH] 增加操作类型

---
 Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue |  921 +++++++++++++++++++++++++--------------------------------
 1 files changed, 400 insertions(+), 521 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue
index 60bf00a..b78d04b 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue
@@ -18,35 +18,64 @@
           @current-change="currentChange"
         >
           <template slot="menuLeft" slot-scope="scope">
-            <el-button icon="el-icon-plus" plain size="small" type="primary" @click="rowSaveHandlerClick">鍒涘缓</el-button>
-            <el-button icon="el-icon-delete" plain size="small" type="danger" @click="allDelHandler">鍒犻櫎</el-button>
-            <el-button icon="el-icon-view" plain size="small" type="primary" @click="chekView">鏌ョ湅浣跨敤鑼冨洿</el-button>
-            <el-button icon="el-icon-download" plain size="small" type="primary" @click="downloadTemplateHandler">
+            <el-button v-if="permissionList.addBtn" class="button-custom-icon" plain size="small" type="primary"
+                       @click="rowSaveHandlerClick">
+              <icon-show :name="permissionList.addBtn.source"></icon-show>
+              鍒涘缓
+            </el-button>
+            <el-button v-if="permissionList.delBtn" class="button-custom-icon" plain size="small" type="danger"
+                       @click="allDelHandler">
+              <icon-show :name="permissionList.delBtn.source"></icon-show>
+              鍒犻櫎
+            </el-button>
+            <el-button v-if="permissionList.viewTheScopeBtn" class="button-custom-icon" plain size="small"
+                       type="primary"
+                       @click="chekView">
+              <icon-show :name="permissionList.viewTheScopeBtn.source"></icon-show>
+              鏌ョ湅浣跨敤鑼冨洿
+            </el-button>
+            <el-button v-if="permissionList.downloadImportTemplateBtn" class="button-custom-icon" plain size="small"
+                       type="primary" @click="downloadTemplateHandler">
+              <icon-show :name="permissionList.downloadImportTemplateBtn.source"></icon-show>
               涓嬭浇瀵煎叆妯℃澘
             </el-button>
-            <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadHandler">瀵煎叆</el-button>
-            <el-button icon="el-icon-download" plain size="small" type="primary" @click="downLoadHandler">瀵煎嚭</el-button>
+            <el-button v-if="permissionList.importBtn" class="button-custom-icon" plain size="small" type="primary"
+                       @click="upLoadHandler">
+              <icon-show :name="permissionList.importBtn.source"></icon-show>
+              瀵煎叆
+            </el-button>
+            <el-button v-if="permissionList.exportBtn" class="button-custom-icon" plain size="small" type="primary"
+                       @click="downLoadHandler">
+              <icon-show :name="permissionList.exportBtn.source"></icon-show>
+              瀵煎嚭
+            </el-button>
           </template>
 
           <template slot="menu" slot-scope="scope">
-            <el-button icon="el-icon-edit" size="small" type="text" @click="editBtnClick(scope.row)">缂栬緫
+            <el-button v-if="permissionList.editBtn" size="small" type="text"
+                       @click="editBtnClick(scope.row)">
+              <icon-show :name="permissionList.editBtn.source"></icon-show>
+              缂栬緫
             </el-button>
-            <el-button icon="el-icon-delete" size="small" type="text" @click="rowDeleteHandler(scope.row)">鍒犻櫎
+            <el-button v-if="permissionList.delBtn" size="small" type="text"
+                       @click="rowDeleteHandler(scope.row)">
+              <icon-show :name="permissionList.delBtn.source"></icon-show>
+              鍒犻櫎
             </el-button>
           </template>
         </avue-crud>
       </basic-container>
     </el-main>
-    <!-- 鍙充晶淇℃伅   -->
+    <!-- 鍙充晶淇℃伅 -->
     <el-aside width="30%">
       <basic-container>
         <div style="height: 85vh; overflow-y: auto">
-          <el-descriptions :column="1" border size="medium" title="灞炴�ч」">
+          <el-descriptions :column="1" :labelStyle="{width:'120px'}" border size="medium" title="灞炴�ч」">
             <el-descriptions-item>
               <template slot="label">
                 鍚嶇О
               </template>
-              <div style="width: 330px">
+              <div>
                 {{ lastItem.id }}
               </div>
             </el-descriptions-item>
@@ -54,7 +83,7 @@
               <template slot="label">
                 鏍囩
               </template>
-              <div style="width: 330px">
+              <div>
                 {{ lastItem.name }}
               </div>
             </el-descriptions-item>
@@ -62,7 +91,7 @@
               <template slot="label">
                 鎻忚堪
               </template>
-              <div style="width: 330px">
+              <div>
                 {{ lastItem.description }}
               </div>
             </el-descriptions-item>
@@ -75,14 +104,15 @@
           </el-descriptions>
 
           <!-- 鍊煎煙 -->
-          <el-descriptions v-if="!isSpecialDataType" :column="1" :title="lastItem.attributeDataType" border
-                           class="margin-top"
-                           size="medium">
+          <el-descriptions v-if="!isSpecialDataType" :column="1" :labelStyle="{width:'120px'}"
+                           :title="lastItem.attributeDataType || 'VTString'"
+                           border
+                           class="margin-top" size="medium">
             <el-descriptions-item>
               <template slot="label">
                 鍏佽涓虹┖
               </template>
-              <div style="width: 330px">
+              <div>
                 <el-tag :type="lastItem.nullableFlag ? 'success' : 'danger'">
                   {{ lastItem.nullableFlag ? '鏄�' : '鍚�' }}
                 </el-tag>
@@ -98,7 +128,7 @@
               <template slot="label">
                 闀垮害
               </template>
-              <div style="width: 330px">
+              <div>
                 {{ lastItem.attrLength }}
               </div>
             </el-descriptions-item>
@@ -106,7 +136,7 @@
               <template slot="label">
                 榛樿鍊�
               </template>
-              <div style="width: 330px">
+              <div>
                 {{ lastItem.defaultValue }}
               </div>
             </el-descriptions-item>
@@ -114,12 +144,12 @@
 
           <!--   VTString  -->
           <el-descriptions v-if="lastItem.attributeDataType === 'VTString' || !lastItem.attributeDataType"
-                           :column="1" border class="margin-top" size="medium" title="鍊煎煙">
+                           :column="1" :labelStyle="{width:'120px'}" border class="margin-top" size="medium" title="鍊煎煙">
             <el-descriptions-item>
               <template slot="label">
                 褰撳墠绫诲瀷
               </template>
-              <div style="width: 345px">
+              <div>
                 {{ lastItem.version ? '閾炬帴绫诲瀷' : '涓氬姟绫诲瀷' }}
               </div>
             </el-descriptions-item>
@@ -127,7 +157,7 @@
               <template slot="label">
                 褰撳墠绫诲瀷鍊�
               </template>
-              <div style="width: 345px">
+              <div>
                 {{ lastItem.version ? lastItem.linkTypeName : lastItem.btmTypeId }}
               </div>
             </el-descriptions-item>
@@ -135,7 +165,7 @@
               <template slot="label">
                 褰撳墠鐗堟湰娆�
               </template>
-              <div style="width: 345px">
+              <div>
                 {{ lastItem.version }}
               </div>
             </el-descriptions-item>
@@ -143,7 +173,7 @@
               <template slot="label">
                 浣跨敤鏋氫妇
               </template>
-              <div style="width: 345px">
+              <div>
                 <el-tag :type="lastItem.enumId ? 'success' : 'danger'">
                   {{ lastItem.enumId ? '鏄�' : '鍚�' }}
                 </el-tag>
@@ -153,7 +183,7 @@
               <template slot="label">
                 褰撳墠鏋氫妇绫诲瀷
               </template>
-              <div style="width: 345px">
+              <div>
                 {{ lastItem.enumId }}
               </div>
             </el-descriptions-item>
@@ -161,24 +191,22 @@
               <template slot="label">
                 鍙栧�艰寖鍥�
               </template>
-              <div style="width: 330px; height: 80px;overflow: auto">
-                <el-tag v-for="item in rangeList" plain style="margin: 5px">{{ item }}</el-tag>
+              <div>
+                <el-tag v-for="item in rangeList" plain style="margin: 3px 10px 3px 0">{{ item }}</el-tag>
               </div>
             </el-descriptions-item>
-
           </el-descriptions>
           <!-- VTInteger && VTInteger  -->
           <el-descriptions
             v-if="lastItem.attributeDataType === 'VTInteger' || lastItem.attributeDataType === 'VTInteger'"
-            :column="1" border class="margin-top" size="medium" title="鍊煎煙">
-
+            :column="1" :labelStyle="{width:'120px'}" border class="margin-top" size="medium" title="鍊煎煙">
             <el-descriptions-item>
               <template slot="label">
                 浣跨敤鏋氫妇
               </template>
-              <div style="width: 330px">
-                <el-tag :type="lastItem.enumFlag ? 'success' : 'danger'">
-                  {{ lastItem.enumFlag ? '鏄�' : '鍚�' }}
+              <div>
+                <el-tag :type="lastItem.enumId ? 'success' : 'danger'">
+                  {{ lastItem.enumId ? '鏄�' : '鍚�' }}
                 </el-tag>
               </div>
             </el-descriptions-item>
@@ -186,39 +214,38 @@
               <template slot="label">
                 鏋氫妇绫诲瀷
               </template>
-              <div style="width: 330px">
-                {{ lastItem.enumFlag }}
+              <div>
+                {{ lastItem.enumId }}
               </div>
             </el-descriptions-item>
             <el-descriptions-item>
               <template slot="label">
                 鍙栧�艰寖鍥�
               </template>
-              <div style="width: 345px; height: 80px;overflow: auto">
-                <el-tag v-for="item in rangeList" plain style="margin: 5px">{{ item }}</el-tag>
+              <div>
+                <el-tag v-for="item in rangeList" plain style="margin: 3px 10px 3px 0">{{ item }}</el-tag>
               </div>
             </el-descriptions-item>
 
           </el-descriptions>
           <!-- VTDouble -->
           <el-descriptions v-if="lastItem.attributeDataType === 'VTDouble'"
-                           :column="1" border class="margin-top" size="medium" title="鍊煎煙">
+                           :column="1" :labelStyle="{width:'120px'}" border class="margin-top" size="medium" title="鍊煎煙">
 
             <el-descriptions-item>
               <template slot="label">
                 鍙栧�艰寖鍥�
               </template>
-              <div style="width: 330px; height: 80px;overflow: auto">
-                <el-tag v-for="item in rangeList" plain style="margin: 5px">{{ item }}</el-tag>
+              <div>
+                <el-tag v-for="item in rangeList" plain style="margin: 3px 10px 3px 0">{{ item }}</el-tag>
               </div>
             </el-descriptions-item>
-
           </el-descriptions>
           <!--      VTDate VTTime VTDateTime VTNote VTFilePath VTClob鍧囦笉鏄剧ず VTBoolean涓嶆樉绀哄�煎煙 鍙樉绀虹被鍨�   -->
         </div>
       </basic-container>
     </el-aside>
-    <!-- 鏂板瀵硅瘽妗�    -->
+    <!-- 鏂板瀵硅瘽妗� -->
     <el-dialog
       v-dialogDrag
       v-loading="addLoading"
@@ -226,112 +253,149 @@
       :visible.sync="addVisible"
       append-to-body="true"
       class="avue-dialog"
-      width="65%"
+      width="1200px"
       @close="addEscHandler"
     >
-      <div style="height: 650px">
-        <el-form ref="form" :model="form" :rules="rules" label-width="120px" size="small">
-          <el-row>
-            <div class="addDialog">
-              <div>
-                <h3>灞炴�ч」</h3>
-                <el-col :span="12">
-                  <el-form-item label="鍚嶇О锛�" prop="id">
-                    <el-input v-model="form.id"></el-input>
+      <div style="height: 550px;">
+        <el-form ref="form" :model="form" :rules="rules" label-width="120px" size="small" style="max-height: 600px;">
+          <div class="addDialog">
+            <h3 style="border-bottom: 1px solid #eee;margin: -10px 0 20px;line-height: 40px">灞炴�ч」</h3>
+            <el-col :span="8">
+              <el-form-item label="鍚嶇О锛�" prop="id">
+                <el-input v-model="form.id" :disabled="dialogTitle !== 'add'"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="鏍囩锛�" prop="name">
+                <el-input v-model="form.name"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="灞炴�х被鍨嬶細" prop="attributeDataType">
+                <el-select v-model="form.attributeDataType" placeholder="璇烽�夋嫨灞炴�х被鍨�" @change="attributeDataTypeChange">
+                  <el-option v-for="item in typeSelectList" :label="item" :value="item"></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="鎻忚堪锛�" prop="description">
+                <el-input v-model="form.description" :rows="2" type="textarea"></el-input>
+              </el-form-item>
+            </el-col>
+            <!--  VTString   -->
+            <div v-if="form.attributeDataType === 'VTString'" style="clear: both">
+              <h3 style="border-bottom: 1px solid #eee;margin: -10px 0 20px;line-height: 40px">{{
+                  form.attributeDataType
+                }}</h3>
+              <el-col :span="8">
+                <el-form-item label="闀垮害锛�" prop="attrLength">
+                  <el-input-number v-model="form.attrLength" :min="0" controls-position="right"></el-input-number>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item v-if="form.enumSwitch" label="榛樿鍊硷細" prop="defaultValue">
+                  <el-select v-model="form.defaultValue">
+                    <el-option v-for="(item,index) in enumAddListChange" :key="index" :label="item.replace('=','')"
+                               :value="item.replace('=','')"></el-option>
+                  </el-select>
+                </el-form-item>
+                <el-form-item v-else label="榛樿鍊硷細" prop="defaultValue">
+                  <el-input v-model="form.defaultValue"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="鍏佽涓虹┖锛�" prop="nullableFlag">
+                  <el-switch v-model="form.nullableFlag"></el-switch>
+                </el-form-item>
+              </el-col>
+              <h3 style="border-bottom: 1px solid #eee;margin: -10px 0 20px;line-height: 40px;clear: both">鍊煎煙</h3>
+              <el-col :span="8">
+                <el-form-item label="褰撳墠鍊煎煙绫诲瀷锛�" prop="attributeSelectType">
+                  <el-select v-model="form.attributeSelectType" placeholder="璇烽�夋嫨灞炴�х被鍨�"
+                             @change="attributeSelectTypeChange">
+                    <el-option label="涓氬姟绫诲瀷" value="business"></el-option>
+                    <el-option label="閾炬帴绫诲瀷" value="link"></el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="閫夋嫨鍙傜収绫诲瀷锛�" prop="referValue">
+                  <avue-input-tree key="businessReferValue" v-if="form.attributeSelectType === 'business'" default-expand-all :clearable="true" v-model="form.referValue" placeholder="璇烽�夋嫨鍐呭" :dic="businessData" @change="referValueChange"></avue-input-tree>
+                  <avue-input-tree key="linkReferValue" v-else default-expand-all v-model="form.referValue" placeholder="璇烽�夋嫨鍐呭" :clearable="true" :dic="linkTypeData" @change="referValueChange"></avue-input-tree>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item v-show="form.attributeSelectType === 'link'" label="鐗堟湰娆★細" prop="version">
+                  <el-select v-model="form.version" placeholder="璇烽�夋嫨鐗堟湰娆�">
+                    <el-option :value="1" label="褰撳墠鐗堟湰娆�"></el-option>
+                    <el-option :value="3" label="鏈�鏂扮増鏈"></el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <div v-show="showEnumSwitch" style="clear: both">
+                <el-col :span="8">
+                  <el-form-item label="浣跨敤鏋氫妇锛�" prop="enumSwitch">
+                    <el-switch v-model="form.enumSwitch" @change="switchEnumChange"></el-switch>
                   </el-form-item>
                 </el-col>
-                <el-col :span="12">
-                  <el-form-item label="鏍囩锛�" prop="name">
-                    <el-input v-model="form.name"></el-input>
-                  </el-form-item>
-                </el-col>
-                <el-col :span="12">
-                  <el-form-item label="灞炴�х被鍨嬶細" prop="attributeDataType">
-                    <el-select v-model="form.attributeDataType" placeholder="璇烽�夋嫨灞炴�х被鍨�" @change="attributeDataTypeChange">
-                      <el-option v-for="item in typeSelectList" :label="item" :value="item"></el-option>
+                <el-col :span="8">
+                  <el-form-item :label="form.enumSwitch ? '鏋氫妇閫夋嫨锛�' : '娣诲姞鍊煎煙锛�'" prop="enumSwitch">
+                    <el-select v-if="form.enumSwitch" v-model="form.enumId" placeholder="璇烽�夋嫨鏋氫妇绫诲瀷"
+                               @change="enumSelectChange">
+                      <el-option v-for="(item,index) in attributeDataTypePickList" :key="index" :label="item.key"
+                                 :value="item.key"></el-option>
                     </el-select>
+                    <el-input v-if="!form.enumSwitch" v-model="form.enumAddValue"></el-input>
                   </el-form-item>
                 </el-col>
-                <el-col :span="12">
-                  <el-form-item label="鎻忚堪锛�" prop="description">
-                    <el-input v-model="form.description" :rows="2" type="textarea"></el-input>
+                <el-col :span="8">
+                  <el-form-item v-if="!form.enumSwitch" label-width="10px" labeldd="杩愮畻绗︼細">
+                    <div>
+                      <el-button size="mini" @click="enumAddHandler"> =</el-button>
+                    </div>
                   </el-form-item>
                 </el-col>
-
+                <el-col v-if="form.rangeValue && form.rangeValue.length>0" :span="24">
+                  <el-form-item :label="form.enumSwitch ? '褰撳墠鏋氫妇鍊硷細' : '褰撳墠鍊煎煙锛�'" prop="rangeValue">
+                    <el-tag v-for="item in form.rangeValue.split('\n')" :key="item" :closable="!form.enumSwitch" plain
+                            style="margin: 0 10px 5px 0" type="success" @close="handleRangeValueDel(item)">{{ item }}
+                    </el-tag>
+                    <el-input v-model="form.rangeValue" :readonly="form.enumSwitch" :rows="2"
+                              style="width: 0;height:0;overflow: hidden"
+                              type="textarea"></el-input>
+                  </el-form-item>
+                </el-col>
               </div>
-              <div v-if="!hideType" class="addDialogBottom">
-                <div class="left">
-                  <h3>{{ form.attributeDataType }}</h3>
-
-                  <el-form-item
-                    v-if="form.attributeDataType !== 'VTInteger' && form.attributeDataType !== 'VTLong'
-                  && form.attributeDataType !== 'VTDouble' && form.attributeDataType !== 'VTBoolean'"
-                    label="闀垮害锛�" prop="attrLength">
-                    <el-input v-model="form.attrLength"></el-input>
-                  </el-form-item>
-
-                  <el-form-item v-if="form.attributeDataType === 'VTDouble'" label="绮惧害锛�" prop="precisionLength">
-                    <el-input v-model="form.precisionLength"></el-input>
-                  </el-form-item>
-
-                  <el-form-item v-if="form.attributeDataType === 'VTDouble'" label="闀垮害锛�" prop="scaleLength">
-                    <el-input v-model="form.scaleLength"></el-input>
-                  </el-form-item>
-
-
-                  <el-form-item v-if="form.attributeDataType !== 'VTBoolean' && !form.enumSwitch" label="榛樿鍊硷細"
-                                prop="defaultValue">
-                    <el-input v-model="form.defaultValue"></el-input>
-                  </el-form-item>
-
-                  <el-form-item v-if="form.attributeDataType === 'VTBoolean'" label="榛樿鍊硷細" prop="defaultValue">
-                    <el-select v-model="form.defaultValue">
-                      <el-option label="false" value="false"></el-option>
-                      <el-option label="true" value="true"></el-option>
-                    </el-select>
-                  </el-form-item>
-                  <el-form-item v-if="form.attributeDataType !== 'VTBoolean' && form.enumSwitch" label="榛樿鍊硷細"
-                                prop="defaultValue">
-                    <el-select v-model="form.defaultValue">
-                      <el-option v-for="(item,index) in rangeOptionValue" :key="index" :label="item"
-                                 :value="item"></el-option>
-                    </el-select>
-                  </el-form-item>
-
-                  <el-form-item label="鍏佽涓虹┖锛�" prop="nullableFlag">
-                    <el-switch v-model="form.nullableFlag"></el-switch>
-                  </el-form-item>
-
-                </div>
-                <el-divider direction="vertical"></el-divider>
-                <!--  VTString   -->
-                <div v-if="form.attributeDataType === 'VTString'" class="right">
-                  <h3>鍊煎煙</h3>
-                  <el-form-item label="褰撳墠鍊煎煙绫诲瀷锛�" prop="attributeSelectType">
-                    <el-select v-model="form.attributeSelectType" placeholder="璇烽�夋嫨灞炴�х被鍨�"
-                               @change="attributeSelectTypeChange">
-                      <el-option label="涓氬姟绫诲瀷" value="business"></el-option>
-                      <el-option label="閾炬帴绫诲瀷" value="link"></el-option>
-                    </el-select>
-                  </el-form-item>
-
-                  <el-form-item v-if="form.attributeSelectType === 'link'" label="鐗堟湰娆★細" prop="version">
-                    <el-select v-model="form.version" placeholder="璇烽�夋嫨鐗堟湰娆�">
-                      <el-option :value="1" label="褰撳墠鐗堟湰娆�"></el-option>
-                      <el-option :value="3" label="鏈�鏂扮増鏈"></el-option>
-                    </el-select>
-                  </el-form-item>
-
-                  <el-form-item label="閫夋嫨鍙傜収绫诲瀷锛�" prop="referValue">
-                    <el-input v-model="form.referValue" @focus="referFormFocusHandler"></el-input>
-                  </el-form-item>
-
-                  <span v-if="!form.referValue">
+            </div>
+            <!--  VTInteger VTLong   -->
+            <div v-else-if="form.attributeDataType === 'VTInteger' || form.attributeDataType === 'VTLong' "
+                 style="clear: both">
+              <h3 style="border-bottom: 1px solid #eee;margin: -10px 0 20px;line-height: 40px">{{
+                  form.attributeDataType
+                }}</h3>
+              <el-col :span="8">
+                <el-form-item v-if="form.enumSwitch" label="榛樿鍊硷細" prop="defaultValue">
+                  <el-select v-model="form.defaultValue">
+                    <el-option v-for="(item,index) in enumAddListChange" :key="index" :label="item.replace('=','')"
+                               :value="item.replace('=','')"></el-option>
+                  </el-select>
+                </el-form-item>
+                <el-form-item v-else label="榛樿鍊硷細" prop="defaultValue">
+                  <el-input-number v-model="form.defaultValue" controls-position="right"></el-input-number>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="鍏佽涓虹┖锛�" prop="nullableFlag">
+                  <el-switch v-model="form.nullableFlag"></el-switch>
+                </el-form-item>
+              </el-col>
+              <h3 style="border-bottom: 1px solid #eee;margin: -10px 0 20px;line-height: 40px;clear: both">鍊煎煙</h3>
+              <el-col :span="8">
                 <el-form-item label="浣跨敤鏋氫妇锛�" prop="enumSwitch">
                   <el-switch v-model="form.enumSwitch" @change="switchEnumChange"></el-switch>
                 </el-form-item>
-
-
+              </el-col>
+              <el-col :span="8">
                 <el-form-item :label="form.enumSwitch ? '鏋氫妇閫夋嫨锛�' : '娣诲姞鍊煎煙锛�'" prop="enumSwitch">
                   <el-select v-if="form.enumSwitch" v-model="form.enumId" placeholder="璇烽�夋嫨鏋氫妇绫诲瀷"
                              @change="enumSelectChange">
@@ -341,144 +405,125 @@
                   <el-input v-if="!form.enumSwitch" v-model="form.enumAddValue">
                   </el-input>
                 </el-form-item>
-                <el-form-item v-if="!form.enumSwitch" label="杩愮畻绗︼細">
+              </el-col>
+              <el-col :span="8">
+                <el-form-item v-if="!form.enumSwitch" label-width="10px" labeldd="杩愮畻绗︼細">
                   <div>
-                    <el-button size="mini" @click="enumAddHandler"> = </el-button>
+                    <el-button size="mini" @click="operationHandler('>')"> ></el-button>
+                    <el-button size="mini" @click="operationHandler('<')"> <</el-button>
+                    <el-button size="mini" @click="operationHandler('>=')"> >=</el-button>
+                    <el-button size="mini" @click="operationHandler('<=')"> <=</el-button>
+                    <el-button size="mini" @click="operationHandler('=')"> =</el-button>
+                    <el-button size="mini" @click="operationHandler('!=')"> !=</el-button>
+                    <el-button size="mini" @click="operationHandler('()')"> ([])</el-button>
                   </div>
                 </el-form-item>
+              </el-col>
+              <el-col v-if="form.rangeValue && form.rangeValue.length>0" :span="24">
                 <el-form-item :label="form.enumSwitch ? '褰撳墠鏋氫妇鍊硷細' : '褰撳墠鍊煎煙锛�'" prop="rangeValue">
-                  <textarea v-model="form.rangeValue" :readonly="form.enumSwitch"
-                            style="width: 330px; height: 80px; border: 1px solid #DCDFE6; overflow: auto; text-align: left;resize: none;">
-                  </textarea>
+                  <el-tag v-for="item in form.rangeValue.split('\n')" :key="item" :closable="!form.enumSwitch" plain
+                          style="margin: 0 10px 5px 0" type="success" @close="handleRangeValueDel(item)">{{ item }}
+                  </el-tag>
+                  <el-input v-model="form.rangeValue" :readonly="form.enumSwitch" :rows="2"
+                            style="width: 0;height:0;overflow: hidden"
+                            type="textarea"></el-input>
                 </el-form-item>
-                </span>
-                </div>
-                <!--  VTInteger VTLong   -->
-                <div v-if="form.attributeDataType === 'VTInteger' || form.attributeDataType === 'VTLong' "
-                     class="right">
-                  <h3>鍊煎煙</h3>
-
-                  <el-form-item label="浣跨敤鏋氫妇锛�" prop="enumSwitch">
-                    <el-switch v-model="form.enumSwitch" @change="switchEnumChange"></el-switch>
-                  </el-form-item>
-
-
-                  <el-form-item :label="form.enumSwitch ? '鏋氫妇閫夋嫨锛�' : '娣诲姞鍊煎煙锛�'" prop="enumSwitch">
-                    <el-select v-if="form.enumSwitch" v-model="form.enumId" placeholder="璇烽�夋嫨鏋氫妇绫诲瀷"
-                               @change="enumSelectChange">
-                      <el-option v-for="(item,index) in attributeDataTypePickList" :key="index" :label="item.key"
-                                 :value="item.key"></el-option>
-                    </el-select>
-                    <el-input v-if="!form.enumSwitch" v-model="form.enumAddValue">
-                    </el-input>
-                  </el-form-item>
-                  <el-form-item v-if="!form.enumSwitch" label="杩愮畻绗︼細">
-                    <div>
-                      <el-button size="mini" @click="operationHandler('>')"> ></el-button>
-                      <el-button size="mini" @click="operationHandler('<')"> <</el-button>
-                      <el-button size="mini" @click="operationHandler('>=')"> >=</el-button>
-                      <el-button size="mini" @click="operationHandler('<=')"> <=</el-button>
-                      <el-button size="mini" @click="operationHandler('=')"> =</el-button>
-                      <el-button size="mini" @click="operationHandler('!=')"> !=</el-button>
-                      <el-button size="mini" @click="operationHandler('()')"> ([])</el-button>
-                    </div>
-                  </el-form-item>
-                  <el-form-item :label="form.enumSwitch ? '褰撳墠鏋氫妇鍊硷細' : '褰撳墠鍊煎煙锛�'" prop="rangeValue">
-                  <textarea v-model="form.rangeValue" :readonly="form.enumSwitch"
-                            style="width: 330px; height: 80px; border: 1px solid #DCDFE6; overflow: auto; text-align: left;resize: none;">
-                  </textarea>
-                  </el-form-item>
-                </div>
-                <!--   VTDouble    -->
-                <div v-if="form.attributeDataType === 'VTDouble'" class="right">
-                  <h3>鍊煎煙</h3>
-                  <el-form-item :label="form.enumSwitch ? '鏋氫妇閫夋嫨锛�' : '娣诲姞鍊煎煙锛�'" prop="enumAddValue">
-                    <el-input v-model="form.enumAddValue">
-                    </el-input>
-                  </el-form-item>
-                  <el-form-item label="杩愮畻绗︼細">
-                    <div>
-                      <el-button size="mini" @click="operationHandler('>')"> ></el-button>
-                      <el-button size="mini" @click="operationHandler('<')"> <</el-button>
-                      <el-button size="mini" @click="operationHandler('>=')"> >=</el-button>
-                      <el-button size="mini" @click="operationHandler('<=')"> <=</el-button>
-                      <el-button size="mini" @click="operationHandler('=')"> =</el-button>
-                      <el-button size="mini" @click="operationHandler('!=')"> !=</el-button>
-                      <el-button size="mini" @click="operationHandler('()')">([])</el-button>
-                    </div>
-                  </el-form-item>
-                  <el-form-item :label="form.enumSwitch ? '褰撳墠鏋氫妇鍊硷細' : '褰撳墠鍊煎煙锛�'" prop="rangeValue">
-                  <textarea v-model="form.rangeValue"
-                            style="width: 330px; height: 80px; border: 1px solid #DCDFE6; overflow: auto; text-align: left;resize: none;">
-                  </textarea>
-                  </el-form-item>
-                </div>
-              </div>
+              </el-col>
             </div>
-          </el-row>
+            <!--   VTDouble    -->
+            <div v-else-if="form.attributeDataType === 'VTDouble'" style="clear: both">
+              <h3 style="border-bottom: 1px solid #eee;margin: -10px 0 20px;line-height: 40px">{{
+                  form.attributeDataType
+                }}</h3>
+              <el-col :span="8">
+                <el-form-item label="绮惧害锛�" prop="precisionLength">
+                  <el-input-number v-model="form.precisionLength" :min="0" :precision="0" :step="1"
+                                   controls-position="right"></el-input-number>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="闀垮害锛�" prop="scaleLength">
+                  <el-input-number v-model="form.scaleLength" :min="0" :precision="0" :step="1"
+                                   controls-position="right"></el-input-number>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item v-if="form.enumSwitch" label="榛樿鍊硷細" prop="defaultValue">
+                  <el-select v-model="form.defaultValue">
+                    <el-option v-for="(item,index) in enumAddListChange" :key="index" :label="item.replace('=','')"
+                               :value="item.replace('=','')"></el-option>
+                  </el-select>
+                </el-form-item>
+                <el-form-item v-else label="榛樿鍊硷細" prop="defaultValue">
+                  <el-input-number v-model="form.defaultValue" :precision="form.precisionLength"
+                                   controls-position="right"></el-input-number>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="鍏佽涓虹┖锛�" prop="nullableFlag">
+                  <el-switch v-model="form.nullableFlag"></el-switch>
+                </el-form-item>
+              </el-col>
+              <h3 style="border-bottom: 1px solid #eee;margin: -10px 0 20px;line-height: 40px;clear: both">鍊煎煙</h3>
+              <el-col :span="8">
+                <el-form-item :label="form.enumSwitch ? '鏋氫妇閫夋嫨锛�' : '娣诲姞鍊煎煙锛�'" prop="enumAddValue">
+                  <el-input v-model="form.enumAddValue"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="16">
+                <el-form-item label="杩愮畻绗︼細">
+                  <div>
+                    <el-button size="mini" @click="operationHandler('>')"> ></el-button>
+                    <el-button size="mini" @click="operationHandler('<')"> <</el-button>
+                    <el-button size="mini" @click="operationHandler('>=')"> >=</el-button>
+                    <el-button size="mini" @click="operationHandler('<=')"> <=</el-button>
+                    <el-button size="mini" @click="operationHandler('=')"> =</el-button>
+                    <el-button size="mini" @click="operationHandler('!=')"> !=</el-button>
+                    <el-button size="mini" @click="operationHandler('()')">([])</el-button>
+                  </div>
+                </el-form-item>
+              </el-col>
+              <el-col v-if="form.rangeValue && form.rangeValue.length>0" :span="24">
+                <el-form-item :label="form.enumSwitch ? '褰撳墠鏋氫妇鍊硷細' : '褰撳墠鍊煎煙锛�'" prop="rangeValue">
+                  <el-tag v-for="item in form.rangeValue.split('\n')" :key="item" closable plain
+                          style="margin: 0 10px 5px 0"
+                          type="success" @close="handleRangeValueDel(item)">{{ item }}
+                  </el-tag>
+                  <el-input v-model="form.rangeValue" :rows="2" style="width: 0;height:0;overflow: hidden"
+                            type="textarea"></el-input>
+                </el-form-item>
+              </el-col>
+            </div>
+            <div v-else-if="form.attributeDataType === 'VTBoolean'" style="clear: both">
+              <h3 style="border-bottom: 1px solid #eee;margin: -10px 0 20px;line-height: 40px">{{
+                  form.attributeDataType
+                }}</h3>
+              <el-col :span="8">
+                <el-form-item label="榛樿鍊硷細" prop="defaultValue">
+                  <el-select v-model="form.defaultValue">
+                    <el-option label="false" value="false"></el-option>
+                    <el-option label="true" value="true"></el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="鍏佽涓虹┖锛�" prop="nullableFlag">
+                  <el-switch v-model="form.nullableFlag"></el-switch>
+                </el-form-item>
+              </el-col>
+            </div>
+          </div>
         </el-form>
-
-        <!-- 涓氬姟绫诲瀷瀵硅瘽妗�      -->
-        <el-dialog
-          v-dialogDrag
-          :visible.sync="businessVisible"
-          append-to-body="true"
-          class="avue-dialog"
-          title="涓氬姟绫诲瀷閫夋嫨"
-          width="70%"
-        >
-          <avue-crud
-            ref="businessCrud"
-            :data="businessData"
-            :option="businessOption"
-            :table-loading="businessLoading"
-            @search-change="businessHandleSearch"
-            @search-reset="businessHandleReset"
-            @row-click="businessRowClick"
-          >
-          </avue-crud>
-          <span slot="footer" class="dialog-footer">
-          <el-button @click="businessEmpty">娓� 绌�</el-button>
-         <el-button @click="businessVisible = false">鍙� 娑�</el-button>
-         <el-button type="primary" @click="businessSaveHandler">纭� 瀹�</el-button>
-        </span>
-        </el-dialog>
-
-        <!-- 閾炬帴绫诲瀷瀵硅瘽妗�      -->
-        <el-dialog
-          v-dialogDrag
-          :visible.sync="linkTypeVisible"
-          append-to-body="true"
-          class="avue-dialog"
-          title="閾炬帴绫诲瀷閫夋嫨"
-          width="70%"
-        >
-          <avue-crud
-            ref="linkTypeCrud"
-            :data="linkTypeData"
-            :option="linkTypeOption"
-            :table-loading="linkTypeLoading"
-            @search-change="linkHandleSearch"
-            @search-reset="linkHandleReset"
-            @row-click="linkRowClick"
-          >
-          </avue-crud>
-          <span slot="footer" class="dialog-footer">
-          <el-button @click="linkEmpty">娓� 绌�</el-button>
-         <el-button @click="linkTypeVisible = false">鍙� 娑�</el-button>
-         <el-button type="primary" @click="linkSaveHandler">纭� 瀹�</el-button>
-        </span>
-        </el-dialog>
       </div>
       <span slot="footer" class="dialog-footer">
-        <el-button @click="addEscHandler">鍙� 娑�</el-button>
-        <el-button type="primary" @click="addSaveHandler">纭� 瀹�</el-button>
+        <el-button size="small" type="primary" @click="addSaveHandler">纭� 瀹�</el-button>
+        <el-button size="small" @click="addEscHandler">鍙� 娑�</el-button>
       </span>
     </el-dialog>
     <!--瀵煎叆    -->
     <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="瀵煎叆"
                  @updata="getTableList"></upload-file>
-    <!-- 鏌ョ湅浣跨敤鑼冨洿    -->
+    <!-- 鏌ョ湅浣跨敤鑼冨洿 -->
     <el-dialog
       v-dialogDrag
       v-loading="checkViewLoading"
@@ -495,7 +540,6 @@
         @search-change="checkHandleSearch"
         @search-reset="checkHandleReset"
       >
-
       </avue-crud>
     </el-dialog>
   </el-container>
@@ -517,6 +561,7 @@
 import basicOption from '@/util/basic-option';
 import {column} from "./option"
 import func from "@/util/func";
+import {mapGetters} from "vuex";
 
 export default {
   name: "index",
@@ -529,73 +574,8 @@
         ]
       },
       dialogTitle: "",
-      businessRow: {},
-      linkRow: {},
-      linkDataSearch: [],
-      businessSearchParams: {},
-      linkTypeSearchParams: {},
-      businessLoading: false,
-      linkTypeLoading: false,
-      businessVisible: false,
-      linkTypeVisible: false,
       businessData: [],
       linkTypeData: [],
-      businessOption: {
-        ...basicOption,
-        addBtn: false,
-        menu: false,
-        searchMenuSpan: 8,
-        selection: false,
-        refreshBtn: false,
-        searchLabelWidth: 100,
-        highlightCurrentRow: true,
-        column: [
-          {
-            label: '涓氬姟绫诲瀷鍚�',
-            prop: 'name',
-            sortable: true,
-            search: true
-          },
-          {
-            label: '鏍囩',
-            prop: 'label',
-            sortable: true,
-          },
-          {
-            label: '鐖剁被',
-            prop: 'fName',
-            sortable: true,
-          },
-          {
-            label: '鐗堟湰瑙勫垯',
-            prop: 'revRuleName',
-            sortable: true,
-          },
-          {
-            label: '鐢熷懡鍛ㄦ湡',
-            prop: 'lifeCycle',
-            sortable: true,
-          },
-        ]
-      },
-      linkTypeOption: {
-        ...basicOption,
-        addBtn: false,
-        menu: false,
-        searchMenuSpan: 8,
-        selection: false,
-        refreshBtn: false,
-        searchLabelWidth: 100,
-        highlightCurrentRow: true,
-        column: [
-          {
-            label: '閾炬帴绫诲瀷鍚�',
-            prop: 'name',
-            sortable: true,
-            search: true
-          },
-        ]
-      },
       tableData: [],
       option: {
         ...basicOption,
@@ -627,6 +607,7 @@
         searchMenuSpan: 8,
         refreshBtn: false,
         selection: false,
+        header: false,
         column: [
           {
             label: '鍚嶇О',
@@ -647,6 +628,8 @@
       },
       addVisible: false,
       addLoading: false,
+      referValueDic:[],
+      showEnumSwitch:false,
       form: {
         id: "",
         name: "",
@@ -654,6 +637,8 @@
         description: "",
         nullableFlag: true,
         attrLength: 50,
+        precisionLength: 2,//绮惧害
+        scaleLength: 20,//闀垮害
         enumFlag: false,
         enumId: "",
         enumSwitch: false,
@@ -665,7 +650,7 @@
         referValue: "",
         btmTypeId: "",
         linkTypeName: "",
-        rangeValue: ""
+        rangeValue: [] //褰撳墠鍊煎煙\褰撳墠鏋氫妇鍊�
 
       },
       typeSelectList: ['VTString', 'VTInteger', 'VTLong', 'VTDouble', 'VTBoolean', 'VTDate', 'VTTime', 'VTDateTime', 'VTNote', 'VTFilePath', 'VTClob'],
@@ -682,6 +667,18 @@
     }
   },
   computed: {
+    ...mapGetters(["permission"]),
+    permissionList() {
+      return {
+        addBtn: this.vaildData(this.permission[this.$route.query.id].ADD, false),
+        delBtn: this.vaildData(this.permission[this.$route.query.id].DELETE, false),
+        editBtn: this.vaildData(this.permission[this.$route.query.id].EDIT, false),
+        exportBtn: this.vaildData(this.permission[this.$route.query.id].EXPORT, false),
+        importBtn: this.vaildData(this.permission[this.$route.query.id].IMPORT, false),
+        downloadImportTemplateBtn: this.vaildData(this.permission[this.$route.query.id].DOWNLOAD, false),
+        viewTheScopeBtn: this.vaildData(this.permission[this.$route.query.id].SEARCH, false),
+      };
+    },
     lastItem() {
       return this.selectList.length > 0 ? this.selectList[this.selectList.length - 1] : {};
     },
@@ -710,15 +707,6 @@
         this.form.attributeDataType === 'VTClob' ||
         this.form.attributeDataType === 'VTDateTime' ||
         this.form.attributeDataType === 'VTFilePath';
-    },
-    rangeOptionValue() {
-      let values = this.form.rangeValue.split('\n');
-
-      // 澶勭悊姣忎釜鍊硷紝鍘婚櫎绛夊彿鍓嶇殑閮ㄥ垎锛屽彧淇濈暀绛夊彿鍚庣殑閮ㄥ垎
-      return values.map(value => {
-        let parts = value.split('=');
-        return parts.length > 1 ? parts[1].trim() : value.trim();
-      });
     }
   },
   watch: {},
@@ -731,9 +719,24 @@
         this.tableData = data;
         this.page.total = res.data.total;
         this.tableLoading = false;
-      }).catch(err => {
-        this.$message.error(err)
       });
+      //鑾峰彇涓氬姟绫诲瀷鏁版嵁
+      getBizTypes().then(res => {
+        const data = res.data.data.map(item => ({
+          label: item.name,
+          value:item.name,
+          desc:item.label
+        }));
+        this.businessData = data;
+      })
+      //鑾峰彇閾炬帴绫诲瀷鏁版嵁
+      getAllLtName().then(res => {
+        const data = res.data.data.map(item => ({
+          label: item,
+          value:item
+        }));
+        this.linkTypeData = data;
+      })
     },
 
     // 琛ㄦ牸澶撮儴鍒锋柊
@@ -742,7 +745,7 @@
     },
 
     // 鎼滅储
-    handleSearch(params, done) {
+    handleSearch(params, done) {debugger;
       this.searchParams = {
         "conditionMap[id]": "*" + params.id + "*"
       };
@@ -771,7 +774,7 @@
           this.lastIndex = newIndex;
         },
         () => {
-          this.selectList = [];
+          this.selectList = [row];
         }
       );
     },
@@ -872,6 +875,7 @@
       })
     },
 
+
     // 鏌ョ湅浣跨敤鑼冨洿鏌ヨ
     checkHandleSearch(params, done) {
       const {source} = params;
@@ -880,14 +884,12 @@
         this.checkViewData = this.checkViewDataSearch;
         return done();
       }
-      ;
 
       this.checkViewData = this.checkViewData.filter(item => {
         return item.source && item.source.includes(source);
       });
 
       done();
-
     },
 
     // 鏌ョ湅浣跨敤鑼冨洿閲嶇疆
@@ -915,16 +917,15 @@
         this.form.attributeSelectType = 'business'
         this.form.referValue = row.btmTypeId;
       }
-      // console.log(row);
-
       this.getEnumMapByTypeHandler(this.form.attributeDataType);
       this.addVisible = true;
-
+      this.lastIndex = -1;//闃叉瑙﹀彂琛岀偣鍑讳簨浠跺悗娓呴櫎閫変腑椤�
     },
 
     // 灞炴�х被鍨嬩笅鎷夋change
     attributeDataTypeChange(val) {
       this.form.rangeValue = null;
+      this.form.nullableFlag = true;
       this.getEnumMapByTypeHandler(val);
       this.form.enumSwitch = false;
       if (val === 'VTBoolean') {
@@ -959,7 +960,8 @@
     enumSelectChange(val) {
       const list = this.attributeDataTypePickList.find(item => item.key === val).values;
       this.form.rangeValue = list.join('\n');
-      this.form.defaultValue = this.rangeOptionValue[0];
+      this.enumAddListChange = list;
+      this.form.defaultValue = list[0].replace('=', '');
     },
 
     // 浣跨敤鏋氫妇switch婊戝潡change浜嬩欢
@@ -968,15 +970,17 @@
         this.form.enumId = this.attributeDataTypePickList[0].key;
         const list = this.attributeDataTypePickList[0].values;
         this.form.rangeValue = list.join('\n');
-        this.form.defaultValue = this.rangeOptionValue[0];
+        this.enumAddListChange = list;
+        this.form.defaultValue = list[0].replace('=', '');
       } else {
         this.form.defaultValue = "";
         this.form.rangeValue = "";
+        this.enumAddListChange = [];
         this.enumId = "";
       }
     },
 
-    // 涓嶄娇鐢ㄦ灇涓� 鎵嬪姩娣诲姞鏋氫妇鍊�
+    // 涓嶄娇鐢ㄦ灇涓� 鎵嬪姩娣诲姞鏋氫妇鍊� VTString
     enumAddHandler() {
       // 妫�鏌ュ拰杞崲 this.form.range 涓烘暟缁勶紝鍚屾椂鎺掗櫎绌哄��
       let currentRangeArray = this.form.rangeValue ? this.form.rangeValue.split('\n').filter(item => item.trim() !== '') : [];
@@ -1007,8 +1011,6 @@
         let lastValue = this.form.enumAddValue[(this.form.enumAddValue.length - 1)];
         // 鍒囧壊 enumAddValue 鐨勯�楀彿
         let values = this.form.enumAddValue.split(regex).map(item => item.trim()).filter(item => item !== "");
-        ;
-
 
         // 妫�鏌ユ槸鍚︽湁鏈夋晥鐨勫��
         if (values.length < 2 || values.some(item => item === '')) {
@@ -1056,7 +1058,10 @@
         '=': '=',
         '!=': '!='
       };
-
+      if (isNaN(this.form.enumAddValue.trim())) {
+        this.$message.error('璇疯緭鍏ユ湁鏁堢殑鏁板瓧鍊硷紒');
+        return;
+      }
       // 鍒涘缓鏂扮殑鍊�
       let newValue = operatorMap[val] + this.form.enumAddValue.trim();
 
@@ -1072,143 +1077,23 @@
       this.form.rangeValue = currentRangeArray.join('\n');
       this.form.enumAddValue = "";
     },
-
+    //鍒犻櫎鍊煎煙
+    handleRangeValueDel(val) {
+      let currentRangeArray = this.form.rangeValue ? this.form.rangeValue.split('\n').filter(item => item.trim() !== val) : [];
+      this.enumAddListChange = currentRangeArray;
+      this.form.rangeValue = currentRangeArray.join('\n');
+    },
     // 鍊煎煙绫诲瀷鍒囨崲
     attributeSelectTypeChange() {
+      this.form.referValue = ''; // 鍒囨崲鍊煎煙绫诲瀷 娓呯┖褰撳墠鍙傜収
       this.$forceUpdate(); // 寮哄埗鏇存柊form缁勪欢
-      this.form.referValue = null; // 鍒囨崲鍊煎煙绫诲瀷 娓呯┖褰撳墠鍙傜収
     },
-
-    // 閫夋嫨鍙傜収
-    referFormFocusHandler() {
-      const handlers = {
-        business: () => {
-          this.businessVisible = true;
-          this.businessLoading = true;
-          this.businessGetTable();
-        },
-        link: () => {
-          this.linkTypeVisible = true;
-          this.linkTypeLoading = true;
-          this.linkGetTable();
-        }
-      };
-
-      const {attributeSelectType} = this.form;
-      const handler = handlers[attributeSelectType];
-
-      if (handler) {
-        handler();
-      }
-      ;
+    //鍙傜収绫诲瀷鏁版嵁鍙樺寲
+    referValueChange(data){
+      this.showEnumSwitch=!data.value;
     },
-
-    // 涓氬姟绫诲瀷琛ㄦ牸鏁版嵁璇锋眰
-    businessGetTable() {
-      getBizTypes(this.businessSearchParams).then(res => {
-        const data = res.data.data;
-        this.businessData = data;
-        this.businessLoading = false;
-      })
-    },
-
-    // 涓氬姟绫诲瀷鍙傜収鎼滅储
-    businessHandleSearch(val, done) {
-      this.businessSearchParams = {
-        btmName: val.name
-      }
-      this.businessGetTable();
-      done()
-    },
-
-    // 涓氬姟绫诲瀷鍙傜収娓呯┖鎼滅储
-    businessHandleReset() {
-      this.businessSearchParams = {};
-      this.businessGetTable();
-    },
-
-    // 閾炬帴绫诲瀷琛ㄦ牸鏁版嵁璇锋眰
-    linkGetTable() {
-      getAllLtName(this.linkTypeSearchParams).then(res => {
-        const data = res.data.data.map(item => ({name: item}));
-        ;
-        this.linkTypeData = data;
-        this.linkDataSearch = data;
-        this.linkTypeLoading = false;
-      })
-    },
-
-    // 閾炬帴绫诲瀷鍙傜収鎼滅储
-    linkHandleSearch(params, done) {
-      const {name} = params;
-
-      if (!params.name) {
-        this.linkTypeData = this.linkDataSearch;
-        return done();
-      }
-      ;
-
-      this.linkTypeData = this.linkDataSearch.filter(item => {
-        console.log(item)
-        return item.name && item.name.includes(name);
-      });
-
-      done();
-    },
-
-    // 閾炬帴绫诲瀷鍙傜収娓呯┖鎼滅储
-    linkHandleReset() {
-      this.linkTypeData = this.linkDataSearch;
-    },
-
-    // 涓氬姟绫诲瀷琛ㄦ牸琛岀偣鍑�
-    businessRowClick(row) {
-      this.businessRow = row;
-    },
-
-    // 涓氬姟绫诲瀷纭畾淇濆瓨
-    businessSaveHandler() {
-      if (func.isEmptyObject(this.businessRow)) {
-        this.$message.error('璇烽�夋嫨涓�鏉℃暟鎹紒')
-        return;
-      }
-
-      this.form.referValue = this.businessRow.name;
-      this.businessVisible = false;
-
-    },
-
-    // 涓氬姟绫诲瀷娓呯┖
-    businessEmpty() {
-      this.form.referValue = null;
-      this.businessVisible = false;
-    },
-
-    // 閾炬帴绫诲瀷纭畾淇濆瓨
-    linkRowClick(row) {
-      this.linkRow = row;
-    },
-
-    // 涓氬姟绫诲瀷纭畾淇濆瓨
-    linkSaveHandler() {
-      if (func.isEmptyObject(this.linkRow)) {
-        this.$message.error('璇烽�夋嫨涓�鏉℃暟鎹紒')
-        return;
-      }
-
-      this.form.referValue = this.linkRow.name;
-      this.linkTypeVisible = false;
-    },
-
-    // 閾炬帴绫诲瀷娓呯┖
-    linkEmpty() {
-      this.form.referValue = null;
-      this.linkTypeVisible = false;
-    },
-
-    // 鏂板瀵硅瘽妗� 鍙栨秷浜嬩欢
+    // 鍏抽棴鏂板瀵硅瘽妗�
     addEscHandler() {
-      this.$refs.form.resetFields(); // 瀵规暣涓〃鍗曡繘琛岄噸缃紝灏嗘墍鏈夊瓧娈靛�奸噸缃负鍒濆鍊煎苟绉婚櫎鏍¢獙缁撴灉
       this.addVisible = false;
       const form = {
         id: "",
@@ -1217,6 +1102,8 @@
         description: "",
         nullableFlag: true,
         attrLength: 50,
+        precisionLength: 2,//绮惧害
+        scaleLength: 20,//闀垮害
         enumFlag: false,
         enumId: "",
         enumSwitch: false,
@@ -1224,68 +1111,53 @@
         range: "",
         attributeSelectType: "business",
         version: 1,
-        defaultValue: "",
-        referValue: "",
+        defaultValue: "",//榛樿鍊�
+        referValue: null,
         btmTypeId: "",
         linkTypeName: "",
         rangeValue: ""
       };
       this.form = form;
+      this.$refs.form.clearValidate(); // 瀵规暣涓〃鍗曡繘琛岄噸缃紝灏嗘墍鏈夊瓧娈靛�奸噸缃负鍒濆鍊煎苟绉婚櫎鏍¢獙缁撴灉
     },
 
     // 鏂板淇濆瓨
     addSaveHandler() {
-      const form = {
-        id: "",
-        name: "",
-        attributeDataType: "VTString",
-        description: "",
-        nullableFlag: true,
-        attrLength: 50,
-        enumFlag: false,
-        enumId: "",
-        enumSwitch: false,
-        enumAddValue: "",
-        range: "",
-        attributeSelectType: "business",
-        version: 1,
-        defaultValue: "",
-        referValue: "",
-        btmTypeId: "",
-        linkTypeName: "",
-        rangeValue: ""
-      };
       this.$refs.form.validate((valid) => {
         if (valid) {
-          if (this.dialogTitle === 'add') {
-            this.form.range = this.form.rangeValue ? this.form.rangeValue.replace(/\n/g, ';') : '';
-            if (this.form.attributeSelectType === 'business') {
-              this.form.btmTypeId = this.form.referValue;
-            } else {
-              this.form.linkTypeName = this.form.referValue;
+          if(this.form.attributeDataType === 'VTString'){
+            if(!this.form.referValue){
+              //鍙傜収绫诲瀷娌℃湁鍊�
+
+            }else {
+              this.form.enumSwitch=false;
+              this.form.rangeValue=''
             }
+          }
+
+          this.form.range = this.form.rangeValue.length>0 ? this.form.rangeValue.replace(/\n/g, ';') : '';
+          if (this.form.attributeSelectType === 'business') {
+            this.form.btmTypeId = this.form.referValue;
+            this.form.linkTypeName = "";
+          } else {
+            this.form.linkTypeName = this.form.referValue;
+            this.form.btmTypeId = "";
+          }
+          if (this.dialogTitle === 'add') {
             addAttribute(this.form).then(res => {
               if (res.data.code === 200) {
                 this.$message.success(res.data.obj);
                 this.getTableList();
-                this.form = form;
-                this.addVisible = false;
+                this.addEscHandler();
               }
             })
           }
           if (this.dialogTitle === 'edit') {
-            this.form.range = this.form.rangeValue ? this.form.rangeValue.replace(/\n/g, ';') : '';
-            if (this.form.attributeSelectType === 'business') {
-              this.form.btmTypeId = this.form.referValue;
-            } else {
-              this.form.linkTypeName = this.form.referValue;
-            }
             updateAttribute(this.form).then(res => {
               if (res.data.code === 200) {
                 this.$message.success(res.data.obj);
                 this.getTableList();
-                this.form = form;
-                this.addVisible = false;
+                this.addEscHandler();
               }
             })
           }
@@ -1330,6 +1202,12 @@
 </script>
 
 <style lang="scss" scoped>
+::v-deep {
+  .el-input-number--small {
+    width: 100%;
+  }
+}
+
 .margin-top {
   margin-top: 25px;
 }
@@ -1347,14 +1225,15 @@
 }
 
 .addDialogBottom {
+  margin-top: 30px;
   width: 100%;
   display: flex;
   flex-direction: row;
 }
 
 .addDialogBottom > .el-divider--vertical {
-  width: 2px;
-  height: 78%;
+  width: 1px;
+  height: 70%;
   position: absolute;
   top: 50%;
   left: 50%;

--
Gitblit v1.9.3