From 8c107924ebc49105fa81f13f972f1710b42c1503 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期五, 01 十一月 2024 17:30:20 +0800
Subject: [PATCH] 首页样式修改

---
 Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue |  570 ++++++++++++++++++++++++++++++--------------------------
 1 files changed, 303 insertions(+), 267 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 befcded..2ab9bd1 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
@@ -21,7 +21,9 @@
             <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>
+            <el-button icon="el-icon-download" plain size="small" type="primary" @click="downloadTemplateHandler">
+              涓嬭浇瀵煎叆妯℃澘
+            </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>
           </template>
@@ -35,16 +37,16 @@
         </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" border size="medium" title="灞炴�ч」" :labelStyle="{width:'120px'}">
             <el-descriptions-item>
               <template slot="label">
                 鍚嶇О
               </template>
-              <div style="width: 330px">
+              <div>
                 {{ lastItem.id }}
               </div>
             </el-descriptions-item>
@@ -52,7 +54,7 @@
               <template slot="label">
                 鏍囩
               </template>
-              <div style="width: 330px">
+              <div>
               {{ lastItem.name }}
               </div>
             </el-descriptions-item>
@@ -60,7 +62,7 @@
               <template slot="label">
                 鎻忚堪
               </template>
-              <div style="width: 330px">
+              <div>
               {{ lastItem.description }}
               </div>
             </el-descriptions-item>
@@ -73,14 +75,14 @@
           </el-descriptions>
 
           <!-- 鍊煎煙 -->
-          <el-descriptions v-if="!isSpecialDataType" :column="1" :title="lastItem.attributeDataType" border
+          <el-descriptions v-if="!isSpecialDataType" :column="1" :title="lastItem.attributeDataType || 'VTString'" border
                            class="margin-top"
-                           size="medium">
+                           size="medium"  :labelStyle="{width:'120px'}">
             <el-descriptions-item>
               <template slot="label">
                 鍏佽涓虹┖
               </template>
-              <div style="width: 330px">
+              <div>
               <el-tag :type="lastItem.nullableFlag ? 'success' : 'danger'">
                 {{ lastItem.nullableFlag ? '鏄�' : '鍚�' }}
               </el-tag>
@@ -96,7 +98,7 @@
               <template slot="label">
                 闀垮害
               </template>
-              <div style="width: 330px">
+              <div>
               {{ lastItem.attrLength }}
               </div>
             </el-descriptions-item>
@@ -104,7 +106,7 @@
               <template slot="label">
                 榛樿鍊�
               </template>
-              <div style="width: 330px">
+              <div>
               {{ lastItem.defaultValue }}
               </div>
             </el-descriptions-item>
@@ -112,12 +114,12 @@
 
           <!--   VTString  -->
           <el-descriptions v-if="lastItem.attributeDataType === 'VTString' || !lastItem.attributeDataType"
-                           :column="1" border class="margin-top" size="medium" title="鍊煎煙">
+                           :column="1" border class="margin-top" size="medium" title="鍊煎煙"  :labelStyle="{width:'120px'}">
             <el-descriptions-item>
               <template slot="label">
                 褰撳墠绫诲瀷
               </template>
-              <div style="width: 345px">
+              <div>
               {{ lastItem.version ? '閾炬帴绫诲瀷' : '涓氬姟绫诲瀷' }}
               </div>
             </el-descriptions-item>
@@ -125,7 +127,7 @@
               <template slot="label">
                 褰撳墠绫诲瀷鍊�
               </template>
-              <div style="width: 345px">
+              <div>
               {{ lastItem.version ? lastItem.linkTypeName : lastItem.btmTypeId }}
               </div>
             </el-descriptions-item>
@@ -133,7 +135,7 @@
               <template slot="label">
                 褰撳墠鐗堟湰娆�
               </template>
-              <div style="width: 345px">
+              <div>
               {{ lastItem.version }}
               </div>
             </el-descriptions-item>
@@ -141,7 +143,7 @@
               <template slot="label">
                 浣跨敤鏋氫妇
               </template>
-              <div style="width: 345px">
+              <div>
               <el-tag :type="lastItem.enumId ? 'success' : 'danger'">
                 {{ lastItem.enumId ? '鏄�' : '鍚�' }}
               </el-tag>
@@ -151,7 +153,7 @@
               <template slot="label">
                 褰撳墠鏋氫妇绫诲瀷
               </template>
-              <div style="width: 345px">
+              <div>
               {{ lastItem.enumId }}
               </div>
             </el-descriptions-item>
@@ -159,22 +161,20 @@
               <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" border class="margin-top" size="medium" title="鍊煎煙"  :labelStyle="{width:'120px'}">
             <el-descriptions-item>
               <template slot="label">
                 浣跨敤鏋氫妇
               </template>
-              <div style="width: 330px">
+              <div>
               <el-tag :type="lastItem.enumFlag ? 'success' : 'danger'">
                 {{ lastItem.enumFlag ? '鏄�' : '鍚�' }}
               </el-tag>
@@ -184,7 +184,7 @@
               <template slot="label">
                 鏋氫妇绫诲瀷
               </template>
-              <div style="width: 330px">
+              <div>
               {{ lastItem.enumFlag }}
               </div>
             </el-descriptions-item>
@@ -192,31 +192,30 @@
               <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" border class="margin-top" size="medium" title="鍊煎煙"  :labelStyle="{width:'120px'}">
 
             <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"
@@ -224,86 +223,61 @@
       :visible.sync="addVisible"
       append-to-body="true"
       class="avue-dialog"
-      width="65%"
+      width="1200px"
       @close="addEscHandler"
     >
-      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
-        <el-row>
+      <div style="height: 550px;">
+        <el-form ref="form" :model="form" :rules="rules" label-width="120px" size="small" style="max-height: 600px;">
           <div class="addDialog">
-            <div>
-              <h3>灞炴�ч」</h3>
-              <el-col :span="12">
-                <el-form-item label="鍚嶇О锛�" prop="id">
-                  <el-input v-model="form.id"></el-input>
+            <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" controls-position="right" :min="0"></el-input-number>
                 </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 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-col>
-              <el-col :span="12">
-                <el-form-item label="鎻忚堪锛�" prop="description">
-                  <el-input v-model="form.description" :rows="2" 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-form-item v-else 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-col>
+              <el-col :span="8">
                 <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-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">
@@ -311,54 +285,76 @@
                     <el-option label="閾炬帴绫诲瀷" value="link"></el-option>
                   </el-select>
                 </el-form-item>
-
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="閫夋嫨鍙傜収绫诲瀷锛�" prop="referValue">
+                  <el-input v-model="form.referValue" @focus="referFormFocusHandler" :clearable="true"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
                 <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">
-                <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="enumAddHandler"> = </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>
-                </span>
+              </el-col>
+              <div v-if="!form.referValue" 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="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="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 :span="24" v-if="form.rangeValue && form.rangeValue.length>0">
+                  <el-form-item :label="form.enumSwitch ? '褰撳墠鏋氫妇鍊硷細' : '褰撳墠鍊煎煙锛�'" prop="rangeValue">
+                    <el-tag  :key="item" v-for="item in form.rangeValue.split('\n')" plain :closable="!form.enumSwitch" type="success" @close="handleRangeValueDel(item)" style="margin: 0 10px 5px 0">{{ item }}</el-tag>
+                    <el-input v-model="form.rangeValue" :readonly="form.enumSwitch" type="textarea" :rows="2" style="width: 0;height:0;overflow: hidden"></el-input>
+                  </el-form-item>
+                </el-col>
               </div>
-              <!--  VTInteger VTLong   -->
-              <div v-if="form.attributeDataType === 'VTInteger' || form.attributeDataType === 'VTLong' " class="right">
-                <h3>鍊煎煙</h3>
-
+            </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">
@@ -368,7 +364,9 @@
                   <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="operationHandler('>')"> ></el-button>
                     <el-button size="mini" @click="operationHandler('<')"> <</el-button>
@@ -376,22 +374,53 @@
                     <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 :span="24" v-if="form.rangeValue && form.rangeValue.length>0">
                 <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  :key="item" v-for="item in form.rangeValue.split('\n')" plain :closable="!form.enumSwitch" type="success" @close="handleRangeValueDel(item)" style="margin: 0 10px 5px 0">{{ item }}</el-tag>
+                  <el-input v-model="form.rangeValue" :readonly="form.enumSwitch" type="textarea" :rows="2" style="width: 0;height:0;overflow: hidden"></el-input>
                 </el-form-item>
-              </div>
-              <!--   VTDouble    -->
-              <div v-if="form.attributeDataType === 'VTDouble'" class="right">
-                <h3>鍊煎煙</h3>
+              </el-col>
+            </div>
+            <!--   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" controls-position="right" :precision="0" :step="1" :min="0"></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" controls-position="right"  :precision="0" :step="1" :min="0"></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" controls-position="right" :precision="form.precisionLength"></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-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>
@@ -400,80 +429,97 @@
                     <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 :span="24" v-if="form.rangeValue && form.rangeValue.length>0">
                 <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-tag  :key="item" v-for="item in form.rangeValue.split('\n')" plain closable type="success" @close="handleRangeValueDel(item)" style="margin: 0 10px 5px 0">{{ item }}</el-tag>
+                  <el-input v-model="form.rangeValue" type="textarea" :rows="2" style="width: 0;height:0;overflow: hidden"></el-input>
                 </el-form-item>
-              </div>
+              </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-row>
-      </el-form>
+        </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"
+        <!-- 涓氬姟绫诲瀷瀵硅瘽妗� -->
+        <el-dialog
+          v-dialogDrag
+          :visible.sync="businessVisible"
+          append-to-body="true"
+          class="avue-dialog"
+          title="涓氬姟绫诲瀷閫夋嫨"
+          width="70%"
         >
-        </avue-crud>
-        <span slot="footer" class="dialog-footer">
+          <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 type="primary" @click="businessSaveHandler">纭� 瀹�</el-button>
           <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>
 
-      <!-- 閾炬帴绫诲瀷瀵硅瘽妗�      -->
-      <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"
+        <!-- 閾炬帴绫诲瀷瀵硅瘽妗� -->
+        <el-dialog
+          v-dialogDrag
+          :visible.sync="linkTypeVisible"
+          append-to-body="true"
+          class="avue-dialog"
+          title="閾炬帴绫诲瀷閫夋嫨"
+          width="70%"
         >
-        </avue-crud>
-        <span slot="footer" class="dialog-footer">
+          <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>
+        </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 @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"
@@ -490,7 +536,6 @@
         @search-change="checkHandleSearch"
         @search-reset="checkHandleReset"
       >
-
       </avue-crud>
     </el-dialog>
   </el-container>
@@ -599,7 +644,7 @@
         addBtn: false,
         editBtn: false,
         delBtn: false,
-        menuWidth:160,
+        menuWidth: 160,
         column
       },
       tableLoading: false,
@@ -622,6 +667,7 @@
         searchMenuSpan: 8,
         refreshBtn: false,
         selection: false,
+        header:false,
         column: [
           {
             label: '鍚嶇О',
@@ -649,6 +695,8 @@
         description: "",
         nullableFlag: true,
         attrLength: 50,
+        precisionLength:2,//绮惧害
+        scaleLength:20,//闀垮害
         enumFlag: false,
         enumId: "",
         enumSwitch: false,
@@ -660,7 +708,7 @@
         referValue: "",
         btmTypeId: "",
         linkTypeName: "",
-        rangeValue: ""
+        rangeValue: [] //褰撳墠鍊煎煙\褰撳墠鏋氫妇鍊�
 
       },
       typeSelectList: ['VTString', 'VTInteger', 'VTLong', 'VTDouble', 'VTBoolean', 'VTDate', 'VTTime', 'VTDateTime', 'VTNote', 'VTFilePath', 'VTClob'],
@@ -705,17 +753,9 @@
         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: {},
   methods: {
     //琛ㄦ牸鏌ヨ璇锋眰
     getTableList() {
@@ -866,6 +906,7 @@
       })
     },
 
+
     // 鏌ョ湅浣跨敤鑼冨洿鏌ヨ
     checkHandleSearch(params, done) {
       const {source} = params;
@@ -874,14 +915,12 @@
         this.checkViewData = this.checkViewDataSearch;
         return done();
       }
-      ;
 
       this.checkViewData = this.checkViewData.filter(item => {
         return item.source && item.source.includes(source);
       });
 
       done();
-
     },
 
     // 鏌ョ湅浣跨敤鑼冨洿閲嶇疆
@@ -905,20 +944,24 @@
         this.form.attributeSelectType = 'link'
         this.form.referValue = row.linkTypeName;
       }
-
-      this.getEnumMapByTypeHandler(this.form.attributeDataType)
+      if (!row.btmTypeId && !row.linkTypeName) {
+        this.form.attributeSelectType = 'business'
+        this.form.referValue = row.btmTypeId;
+      }
+      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') {
         this.form.defaultValue = 'false';
-      } else {
+      } else{
         this.form.defaultValue = '';
       }
     },
@@ -948,7 +991,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浜嬩欢
@@ -957,15 +1001,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() !== '') : [];
@@ -991,8 +1037,11 @@
 
       // 澶勭悊 '()' 杩愮畻绗︾殑鎯呭喌
       if (val === '()') {
+        let regex = /[,\[\]()]+/g;
+        let firstValue = this.form.enumAddValue[0];
+        let lastValue = this.form.enumAddValue[(this.form.enumAddValue.length - 1)];
         // 鍒囧壊 enumAddValue 鐨勯�楀彿
-        let values = this.form.enumAddValue.split(',').map(item => item.trim());
+        let values = this.form.enumAddValue.split(regex).map(item => item.trim()).filter(item => item !== "");
 
         // 妫�鏌ユ槸鍚︽湁鏈夋晥鐨勫��
         if (values.length < 2 || values.some(item => item === '')) {
@@ -1015,7 +1064,7 @@
         }
 
         // 鏋勫缓 newValue 鐨勫舰寮� (鍊�1,鍊�2)
-        let newValue = `(${values.join(',')})`;
+        let newValue = `${firstValue}${values.join(',')}${lastValue}`;
 
         // 妫�鏌ユ柊鐨勫�兼槸鍚﹀凡瀛樺湪
         if (currentRangeArray.includes(newValue)) {
@@ -1040,7 +1089,10 @@
         '=': '=',
         '!=': '!='
       };
-
+      if (isNaN(this.form.enumAddValue.trim())) {
+        this.$message.error('璇疯緭鍏ユ湁鏁堢殑鏁板瓧鍊硷紒');
+        return;
+      }
       // 鍒涘缓鏂扮殑鍊�
       let newValue = operatorMap[val] + this.form.enumAddValue.trim();
 
@@ -1056,7 +1108,12 @@
       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.$forceUpdate(); // 寮哄埗鏇存柊form缁勪欢
@@ -1065,9 +1122,6 @@
 
     // 閫夋嫨鍙傜収
     referFormFocusHandler() {
-      this.form.enumSwitch = false;
-      this.form.rangeValue = "";
-      this.form.enumId = "";
       const handlers = {
         business: () => {
           this.businessVisible = true;
@@ -1192,9 +1246,8 @@
       this.linkTypeVisible = false;
     },
 
-    // 鏂板瀵硅瘽妗� 鍙栨秷浜嬩欢
+    // 鍏抽棴鏂板瀵硅瘽妗�
     addEscHandler() {
-      this.$refs.form.resetFields(); // 瀵规暣涓〃鍗曡繘琛岄噸缃紝灏嗘墍鏈夊瓧娈靛�奸噸缃负鍒濆鍊煎苟绉婚櫎鏍¢獙缁撴灉
       this.addVisible = false;
       const form = {
         id: "",
@@ -1203,6 +1256,8 @@
         description: "",
         nullableFlag: true,
         attrLength: 50,
+        precisionLength:2,//绮惧害
+        scaleLength:20,//闀垮害
         enumFlag: false,
         enumId: "",
         enumSwitch: false,
@@ -1210,68 +1265,43 @@
         range: "",
         attributeSelectType: "business",
         version: 1,
-        defaultValue: "",
+        defaultValue: "",//榛樿鍊�
         referValue: "",
         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) {
+          this.form.range = this.form.rangeValue ? 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') {
-            this.form.range = this.form.rangeValue.replace(/\n/g, ';');
-            if (this.form.attributeSelectType === 'business') {
-              this.form.btmTypeId = this.form.referValue;
-            } else {
-              this.form.linkTypeName = this.form.referValue;
-            }
             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.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();
               }
             })
           }
@@ -1316,6 +1346,11 @@
 </script>
 
 <style lang="scss" scoped>
+::v-deep {
+  .el-input-number--small {
+    width: 100%;
+  }
+}
 .margin-top {
   margin-top: 25px;
 }
@@ -1333,14 +1368,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