From 83aa382fd3b88ec7a564f14d41a9c8e5d43beeb3 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期一, 09 十二月 2024 10:26:31 +0800
Subject: [PATCH] 修改表单定义样式&&修改ui上下文btmName&&添加登录密码即将过期进入首页并提醒

---
 Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/formDialog.vue |  605 +++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 563 insertions(+), 42 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/formDialog.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/formDialog.vue
index cd500be..f67bc3d 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/formDialog.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/formDialog.vue
@@ -30,12 +30,15 @@
               <div style="display: flex;justify-content: center">
                 <span style="display: flex;align-items: center; margin-right: 5px;">
                  <p class="tableTopLabel">鍚嶇О锛�</p>
-                 <el-input v-model="topForm.viName" placeholder="璇疯緭鍏ュ唴瀹�" size="mini"></el-input>
+                 <el-input v-model="topForm.viName" placeholder="璇疯緭鍏ュ悕绉�" size="mini"></el-input>
                 </span>
 
                 <span style="display: flex;align-items: center; margin-right: 5px;">
                  <p class="tableTopLabel">鏌ヨ妯℃澘鍚嶇О锛�</p>
-                 <el-input v-model="form.itemQtName" placeholder="璇疯緭鍏ユ煡璇㈡ā鏉垮悕绉�" size="mini"></el-input>
+                  <el-select v-model="topForm.itemQtName" placeholder="璇烽�夋嫨鏌ヨ妯℃澘" size="mini">
+                    <el-option v-for="(item,index) in searchQtNameList" :key="index" :label="item.qtName"
+                               :value="item.qtName"></el-option>
+                  </el-select>
                 </span>
 
                 <span style="display: flex;align-items: center; margin-right: 5px;">
@@ -58,7 +61,62 @@
                     <el-form-item :class="['hiddenLabel', { 'active-border': activeItem.text === item.text }]"
                                   :label="item.text + '锛�'"
                                   style="padding-left: 5px" @click.native="formItemClick(item,index)">
-                      <el-input v-model="item.value" :placeholder="item.text" size="mini"></el-input>
+                      <el-input
+                        v-if="item.itemType === 'text' ||
+                         item.itemType === 'custom' ||
+                         item.itemType === 'customform'||
+                         item.itemType === 'hidden' ||
+                         item.itemType === 'specialCharacter'"
+                        v-model="item.value" :placeholder="item.text"
+                        size="mini"></el-input>
+
+                      <div v-if="item.itemType === 'textbtn'" style="display: flex;align-items: center">
+                        <el-input v-model="item.value" :placeholder="item.text" size="mini"></el-input>
+                        <el-button icon="el-icon-edit" plain size="mini" style="height: 28px;"
+                                   type="primary"></el-button>
+                      </div>
+                      <el-input
+                        v-if="item.itemType === 'textarea' || item.itemType === 'richtext' || item.itemType === 'webeditor'"
+                        v-model="item.value"
+                        :placeholder="item.text">
+                      </el-input>
+                      <el-input-number v-if="item.itemType === 'number'" v-model="item.value" :max="99999" :min="1"
+                                       size="mini"></el-input-number>
+                      <el-input v-if="item.itemType === 'password'" v-model="input" placeholder="璇疯緭鍏ュ瘑鐮�"
+                                show-password></el-input>
+                      <el-radio v-if="item.itemType === 'radio'" v-model="item.value"></el-radio>
+                      <el-checkbox v-if="item.itemType === 'checkbox'" v-model="item.value"></el-checkbox>
+                      <el-select v-if="item.itemType === 'select' || item.itemType === 'multiselect'"
+                                 v-model="item.value" :disabled="false" placeholder="璇烽�夋嫨" size="mini">
+                      </el-select>
+                      <el-date-picker
+                        v-if="item.itemType === 'date' || item.itemType === 'datetime'"
+                        v-model="item.value"
+                        :placeholder="item.itemType === 'date' ? '璇烽�夋嫨鏃ユ湡' : '璇烽�夋嫨鏃ユ湡鏃堕棿'"
+                        class="formItemMargin"
+                        type="date">
+                      </el-date-picker>
+
+                      <el-time-select
+                        v-if="item.itemType === 'time'"
+                        v-model="item.value"
+                        :picker-options="{
+                         start: '08:30',
+                         step: '00:15',
+                         end: '18:30'
+                         }"
+                        class="formItemMargin"
+                        placeholder="閫夋嫨鏃堕棿">
+                      </el-time-select>
+                      <el-button v-if="item.itemType === 'file'"
+                                 v-model="item.value" plain size="mini" type="primary">
+                        涓婁紶鏂囦欢
+                      </el-button>
+                      <el-button v-if="item.itemType === 'multiFile'"
+                                 v-model="item.value" plain size="mini" type="primary">
+                        澶氭枃浠朵笂浼�
+                      </el-button>
+
                     </el-form-item>
                   </el-col>
                 </el-row>
@@ -72,24 +130,30 @@
               </el-button>
               <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addCustomClickHandler">娣诲姞鑷畾涔夌粍浠�
               </el-button>
-              <el-button icon="el-icon-zoom-in" plain size="small" type="primary">棰勮</el-button>
+              <el-button icon="el-icon-zoom-in" plain size="small" type="primary" @click="checkViewHandler">棰勮
+              </el-button>
             </div>
           </basic-container>
         </el-main>
 
         <el-aside width="25%">
           <basic-container>
-            <div style="height: 700px; overflow-y: auto;padding-right: 10px">
+            <div style="height: 660px; overflow-y: auto;padding-right: 10px">
               <h3>璁剧疆</h3>
+              <h4 style="color: red">灞炴�ц缃俊鎭悗闇�鍗曞嚮鍙充笅瑙掑簲鐢ㄦ寜閽繘琛屽簲鐢�</h4>
               <el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="85px">
                 <el-row style="border-bottom: 1px solid #878585;padding-bottom: 10px">
                   <el-col :span="24">
                     <el-form-item label="浣跨敤瀛楁">
-                      <div style="display: flex">
-                        <el-input v-model="form.text" placeholder="璇疯緭鍏ヤ娇鐢ㄥ瓧娈�" size="mini"></el-input>
-                        <el-checkbox v-model="form.itemIsEditable" style="margin-left: 5px; margin-right: 5px">鍙
+                      <div style="display: flex;align-items: center">
+                        <el-input v-model="form.text" :readonly="true" placeholder="璇疯緭鍏ヤ娇鐢ㄥ瓧娈�" size="mini"></el-input>
+                        <el-checkbox v-model="form.itemIsEditable" false-label="0"
+                                     style="margin-left: 5px; margin-right: 5px"
+                                     true-label="1">鍙
                         </el-checkbox>
-                        <el-checkbox v-model="form.itemIsRequired" style="margin-left: 5px;margin-right: 0px">蹇呭~
+                        <el-checkbox v-model="form.itemIsRequired" false-label="0"
+                                     style="margin-left: 5px;margin-right: 0px"
+                                     true-label="1">蹇呭~
                         </el-checkbox>
                       </div>
                     </el-form-item>
@@ -103,7 +167,7 @@
 
                   <el-col :span="12">
                     <el-form-item class="rightLabel" label="鏄剧ず绫诲瀷">
-                      <el-select v-model="form.itemType" placeholder="璇烽�夋嫨绫诲瀷" size="mini">
+                      <el-select v-model="form.itemType" placeholder="璇烽�夋嫨绫诲瀷" size="mini" @change="itemTypeChange">
                         <el-option v-for="(item,index) in showSelectList" :key="index" :label="item.label"
                                    :value="item.value"></el-option>
                       </el-select>
@@ -183,7 +247,9 @@
                     <el-form-item label="鏉冮檺鎺у埗">
                       <div style="display: flex;align-items: center">
                         <el-input v-model="form.itemRight" placeholder="璇疯緭鍏ュ唴瀹�" size="mini"></el-input>
-                        <el-button plain size="mini" style="margin-left: 3px" type="success">閫夋嫨</el-button>
+                        <el-button plain size="mini" style="margin-left: 3px" type="success" @click="authClickHandler">
+                          閫夋嫨
+                        </el-button>
                       </div>
                     </el-form-item>
                   </el-col>
@@ -264,7 +330,7 @@
                     <el-form-item>
                       <div style="height: 150px; width: 100%; border: 1px solid #bdbbbb;overflow-y: auto">
                         <el-table
-                          :data="form.itemValueList"
+                          :data="form.itemKeyValueList"
                           :highlight-current-row="true"
                           :show-header="false"
                           border
@@ -334,6 +400,10 @@
 
               </el-form>
             </div>
+            <div style="display: flex;justify-content: right">
+              <el-button plain size="mini" style="margin-top: 10px" type="success" @click="asideFormHandler">搴旂敤
+              </el-button>
+            </div>
           </basic-container>
         </el-aside>
       </div>
@@ -347,14 +417,18 @@
       append-to-body="true"
       class="avue-dialog"
       title="琛ㄥ崟"
-      width="40%"
+      width="50%"
       @close="closeCustomDialog">
       <el-form ref="form" :model="customForm" :rules="rules" label-position="left" label-width="85px">
         <el-row style="border-bottom: 1px solid #878585;padding-bottom: 10px">
           <el-col :span="24">
             <el-form-item label="浣跨敤瀛楁">
-              <div style="display: flex">
-                <el-input v-model="customForm.text" placeholder="璇疯緭鍏ヤ娇鐢ㄥ瓧娈�" size="mini"></el-input>
+              <div style="display: flex;align-items: center">
+                <div style="display: flex;align-items: center">
+                  <el-input v-model="customForm.text" placeholder="璇疯緭鍏ヤ娇鐢ㄥ瓧娈�" size="mini"></el-input>
+                  <el-button plain size="mini" style="margin-left: 3px" type="success" @click="customTextHandler">閫夋嫨
+                  </el-button>
+                </div>
                 <el-checkbox v-model="customForm.itemIsEditable" style="margin-left: 5px; margin-right: 5px">鍙
                 </el-checkbox>
                 <el-checkbox v-model="customForm.itemIsRequired" style="margin-left: 5px;margin-right: 0px">蹇呭~
@@ -371,7 +445,7 @@
 
           <el-col :span="12">
             <el-form-item class="rightLabel" label="鏄剧ず绫诲瀷">
-              <el-select v-model="customForm.itemType" placeholder="璇烽�夋嫨绫诲瀷" size="mini">
+              <el-select v-model="customForm.itemType" placeholder="璇烽�夋嫨绫诲瀷" size="mini" @change="customItemTypeChange">
                 <el-option v-for="(item,index) in showSelectList" :key="index" :label="item.label"
                            :value="item.value"></el-option>
               </el-select>
@@ -448,10 +522,12 @@
           </el-col>
 
           <el-col :span="24">
-            <el-form-item label="鏉冮檺鎺у埗">
+            <el-form-item label="灞炴�ф潈闄�">
               <div style="display: flex;align-items: center">
                 <el-input v-model="customForm.itemRight" placeholder="璇疯緭鍏ュ唴瀹�" size="mini"></el-input>
-                <el-button plain size="mini" style="margin-left: 3px" type="success">閫夋嫨</el-button>
+                <el-button plain size="mini" style="margin-left: 3px" type="success" @click="customAuthClickHandler">
+                  閫夋嫨
+                </el-button>
               </div>
             </el-form-item>
           </el-col>
@@ -513,7 +589,8 @@
 
         </el-row>
 
-        <el-row style="margin-top: 10px;border-bottom: 1px solid #878585;padding-bottom: 10px">
+        <el-row v-if="customForm.itemType ? customOptionTypeStatus : true"
+                style="margin-top: 10px;border-bottom: 1px solid #878585;padding-bottom: 10px">
           <h4>閫夐」鍒楄〃</h4>
           <el-col :span="12">
             <el-form-item label="鍚嶇О">
@@ -531,12 +608,13 @@
             <el-form-item>
               <div style="height: 150px; width: 100%; border: 1px solid #bdbbbb;overflow-y: auto">
                 <el-table
-                  :data="customForm.itemValueList"
+                  :data="customForm.itemKeyValueList"
                   :highlight-current-row="true"
                   :show-header="false"
                   border
                   stripe
-                  style="width: 100%">
+                  style="width: 100%"
+                  @row-click="customOptionTableClick">
                   <el-table-column
                     align="center"
                     label="鍚嶇О"
@@ -559,7 +637,9 @@
                 <el-button plain size="mini" style="margin-right: 5px" type="success"
                            @click="optionAddClickHandler('dialog')">娣诲姞
                 </el-button>
-                <el-button plain size="mini" style="margin-left: 5px" type="danger">鍒犻櫎</el-button>
+                <el-button plain size="mini" style="margin-left: 5px" type="danger"
+                           @click="optionDeleteClickHandler('dialog')">鍒犻櫎
+                </el-button>
               </div>
             </el-form-item>
           </el-col>
@@ -582,7 +662,7 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <el-row style="margin-top: 10px">
+        <el-row v-if="customForm.itemType ? customItemStyleTypeStatus : true" style="margin-top: 10px">
           <el-col :span="24" style="height: 90px">
             <el-form-item label="闄勫姞灞炴��">
               <el-input
@@ -599,15 +679,143 @@
       </el-form>
       <span slot="footer" class="dialog-footer">
          <el-button @click="customVisible = false">鍙� 娑�</el-button>
-         <el-button type="primary">纭� 瀹�</el-button>
+         <el-button type="primary" @click="customSaveHandler">纭� 瀹�</el-button>
+    </span>
+    </el-dialog>
+    <!-- 娣诲姞鑷畾涔夌粍浠堕�夋嫨灞炴�ф睜灞炴�у璇濇  -->
+    <el-dialog
+      v-dialogDrag
+      :visible.sync="customAttrVisible"
+      append-to-body="true"
+      class="avue-dialog"
+      title="閫夋嫨灞炴��"
+      width="50%">
+      <avue-crud
+        ref="userCrud"
+        :data="customAttrData"
+        :option="customAttrOption"
+        :page.sync="page"
+        :table-loading="customAttrLoading"
+        @row-click="customAttrRowClickHandler"
+      >
+      </avue-crud>
+      <span slot="footer" class="dialog-footer">
+         <el-button @click="customAttrVisible = false">鍙� 娑�</el-button>
+         <el-button type="primary" @click="customAttrSaveHandler">纭� 瀹�</el-button>
+    </span>
+    </el-dialog>
+    <!-- 棰勮  -->
+    <el-dialog
+      v-dialogDrag
+      :visible.sync="checkViewVisible"
+      append-to-body="true"
+      class="avue-dialog"
+      title="棰勮"
+      width="60%">
+      <div style="height: 600px">
+        <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+          <el-row>
+            <el-col v-for="(item,index) in formList" :key="index" :span="topForm.columnNumber">
+              <el-form-item :label="item.itemName + '锛�'" style="padding-left: 5px">
+                <el-input
+                  v-if="item.itemType === 'text' ||
+                         item.itemType === 'custom' ||
+                         item.itemType === 'customform'||
+                         item.itemType === 'hidden' ||
+                         item.itemType === 'specialCharacter'"
+                  v-model="item.value" :placeholder="item.text"
+                  size="mini"></el-input>
+
+                <div v-if="item.itemType === 'textbtn'" style="display: flex;align-items: center">
+                  <el-input v-model="item.value" :placeholder="item.text" size="mini"></el-input>
+                  <el-button icon="el-icon-edit" plain size="mini" style="height: 28px;"
+                             type="primary"></el-button>
+                </div>
+
+                <el-input
+                  v-if="item.itemType === 'textarea' || item.itemType === 'richtext' || item.itemType === 'webeditor'"
+                  v-model="item.value"
+                  :placeholder="item.text">
+                </el-input>
+
+                <el-input-number v-if="item.itemType === 'number'" v-model="item.value" :max="99999" :min="1"
+                                 size="mini"></el-input-number>
+                <el-input v-if="item.itemType === 'password'" v-model="input" placeholder="璇疯緭鍏ュ瘑鐮�"
+                          show-password></el-input>
+                <el-radio v-if="item.itemType === 'radio'" v-model="item.value"></el-radio>
+                <el-checkbox v-if="item.itemType === 'checkbox'" v-model="item.value"></el-checkbox>
+                <el-select v-if="item.itemType === 'select' || item.itemType === 'multiselect'"
+                           v-model="item.value" placeholder="璇烽�夋嫨" size="mini">
+                  <el-option v-for="(i,k) in item.itemKeyValueList" :key="l" :label="i.value"
+                             :value="i.key"></el-option>
+                </el-select>
+                <el-date-picker
+                  v-if="item.itemType === 'date' || item.itemType === 'datetime'"
+                  v-model="item.value"
+                  :placeholder="item.itemType === 'date' ? '璇烽�夋嫨鏃ユ湡' : '璇烽�夋嫨鏃ユ湡鏃堕棿'"
+                  type="date">
+                </el-date-picker>
+
+                <el-time-select
+                  v-if="item.itemType === 'time'"
+                  v-model="item.value"
+                  :picker-options="{
+                         start: '08:30',
+                         step: '00:15',
+                         end: '18:30'
+                         }"
+                  placeholder="閫夋嫨鏃堕棿">
+                </el-time-select>
+                <el-button v-if="item.itemType === 'file'"
+                           v-model="item.value" plain size="mini" type="primary">
+                  涓婁紶鏂囦欢
+                </el-button>
+                <el-button v-if="item.itemType === 'multiFile'"
+                           v-model="item.value" plain size="mini" type="primary">
+                  澶氭枃浠朵笂浼�
+                </el-button>
+
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+    </el-dialog>
+
+    <el-dialog
+      v-dialogDrag
+      :visible.sync="authVisible"
+      append-to-body="true"
+      class="avue-dialog"
+      title="鏉冮檺鎺у埗-浜哄憳鍒楄〃"
+      width="60%"
+      @close="authDialogClose">
+      <div style="height: 650px">
+        <div style="height: 600px;">
+          <avue-tree :key="refresh" ref="authTree" v-model="treeAuthForm" :data="treeAuthData" :option="treeAuthOption"
+                     @check-change="treeAuthCheckChange">
+              <span slot-scope="{ node, data }" class="el-tree-node__label">
+           <span style="font-size: 15px">
+              <i class="el-icon-s-promotion"></i>
+                {{ (node || {}).label }}
+            </span>
+          </span>
+          </avue-tree>
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+         <el-button @click="authDialogClose">鍙� 娑�</el-button>
+         <el-button type="primary" @click="authDialogSaveHandler">纭� 瀹�</el-button>
     </span>
     </el-dialog>
   </el-dialog>
 </template>
 
 <script>
-import {getTreeAttributes} from "@/api/UI/formDefine/api";
+import {getObjTypeQTs, getTreeAttributes, savePortalVI, refPersonOrgTree} from "@/api/UI/formDefine/api";
+import {gridAttribute} from "@/api/modeling/attributePool/api";
 import func from "@/util/func";
+import basicOption from "@/util/basic-option";
 
 export default {
   name: "formDialog",
@@ -620,10 +828,96 @@
     treeRadio: {
       type: String,
       default: ""
+    },
+    editRow: {
+      type: Object,
+      default: () => {
+      }
     }
   },
   data() {
     return {
+      authType: 'default',
+      refresh: Math.random(),
+      treeAuthOption: {
+        multiple: true,
+        height: 'auto',
+        menu: false,
+        addBtn: false,
+        defaultExpandAll: true,
+        lazy: true,
+        props: {
+          label: 'text',
+          value: 'oid',
+          children: 'childNodes',
+        },
+        treeLoad: (node, resolve) => {
+          const params = {
+            'conditionMap[dataType]': node.data.data,
+            'conditionMap[parentId]': node.data.data,
+            'conditionMap[orgType]': 'all'
+          }
+          refPersonOrgTree(node.level === 0 ? {} : params).then(res => {
+            resolve(res.data.treeData.map(item => {
+              return {
+                ...item,
+                id: item.id,
+                name: item.name,
+                leaf: item.leaf
+              }
+            }))
+          })
+        }
+      },
+      treeAuthData: [],
+      treeAuthForm: {},
+      authVisible: false,
+      searchQtNameList: [],
+      customAttrRow: {},
+      customAttrOption: {
+        ...basicOption,
+        calcHeight: -60,
+        addBtn: false,
+        editBtn: false,
+        delBtn: false,
+        menu: false,
+        refreshBtn: false,
+        highlightCurrentRow: true,
+        selection: false,
+        column: [
+          {
+            label: '灞炴�у悕',
+            prop: 'id',
+            sortable: true,
+          },
+          {
+            label: '鏍囩',
+            prop: 'name',
+            sortable: true,
+          },
+          {
+            label: '绫诲瀷',
+            prop: 'attributeDataTypeText',
+            sortable: true,
+            width: 100
+          },
+          {
+            label: '榛樿鍊�',
+            prop: 'defaultValue',
+            sortable: true,
+            width: 120
+          },
+          {
+            label: '鎻忚堪',
+            prop: 'description',
+            overHidden: true,
+          },
+        ]
+      },
+      customAttrData: [],
+      customAttrLoading: false,
+      customAttrVisible: false,
+      checkViewVisible: false,
       optionObj: {
         optionName: '',
         optionValue: ''
@@ -633,7 +927,8 @@
         optionValue: ''
       },
       customForm: {
-        itemValueList: [],
+        itemKeyValueList: [],
+        itemCols: '1'
       },
       customLoading: false,
       customVisible: false,
@@ -732,7 +1027,7 @@
       form: {},
       topForm: {
         columnNumber: 8,
-        showColumn: '',
+        showColumn: '3',
         viName: '',
         position: ''
       },
@@ -757,7 +1052,11 @@
           children: 'children',
         },
       },
-      treeData: []
+      treeData: [],
+      optionRow: {},
+      customOptionRow: {},
+      optionCurrentIndex: 0,
+      customOptionCurrentIndex: 0
     }
   },
   computed: {
@@ -765,11 +1064,18 @@
       const types = ['radio', 'checkbox', 'select'];
       return types.includes(this.form.itemType); // 灞曠ず
     },
-
     itemStyleTypeStatus() {
       const types = ['hidden', 'webeditor', 'radio', 'checkbox'];
       return !types.includes(this.form.itemType); // 涓嶅睍绀�
-    }
+    },
+    customOptionTypeStatus() {
+      const types = ['radio', 'checkbox', 'select'];
+      return types.includes(this.customForm.itemType); // 灞曠ず
+    },
+    customItemStyleTypeStatus() {
+      const types = ['hidden', 'webeditor', 'radio', 'checkbox'];
+      return !types.includes(this.customForm.itemType); // 涓嶅睍绀�
+    },
   },
   created() {
     // this.getTreeList();
@@ -778,7 +1084,9 @@
     // 鍏抽棴瀵硅瘽妗�
     closeDialog() {
       this.formList = [];
-
+      this.form = {};
+      this.activeItem = {};
+      this.topForm.viName = "";
     },
 
     getTreeList() {
@@ -795,6 +1103,7 @@
           this.treeLoading = false;
         }
       })
+      this.getSearchSelectList();
     },
 
     // 寮�濮嬫嫋鎷芥爲鑺傜偣浜嬩欢
@@ -810,6 +1119,11 @@
       const params = {
         text: data.text,
         oid: data.oid,
+        itemType: 'text',
+        itemName: data.data.name,
+        itemCols: "1",
+        itemIsEditable: "0",
+        itemIsRequired: "0",
       }
       const isDuplicate = this.formList.some(item => item.text === data.text);
 
@@ -825,6 +1139,8 @@
       this.activeItem = item;
       this.activeItemIndex = index;
       this.form = {...item};
+      this.topForm.position = index += 1;
+      // this.$forceUpdate();
     },
 
     // 璁剧疆鏄剧ず琛屾暟
@@ -892,7 +1208,7 @@
         this.$message.error('璇烽�夋嫨涓�鏉℃暟鎹繘琛屽垹闄�');
         return;
       }
-      this.formList = this.formList.filter(item => item.text != this.activeItem.text);
+      this.formList = this.formList.filter(item => item.text !== this.activeItem.text);
       this.activeItem = {};
       this.form = {};
     },
@@ -926,23 +1242,27 @@
 
     // 閫夐」琛ㄦ牸琛岀偣鍑�
     optionTableClick(row) {
-      console.log(row);
+      this.optionRow = row;
+    },
+
+    customOptionTableClick(row) {
+      this.customOptionRow = row;
     },
 
     // 閫夐」娣诲姞
     optionAddClickHandler(val) {
-      let optionObj, itemValueList;
+      let optionObj, itemKeyValueList;
 
       if (val === 'dialog') {
         optionObj = this.customOptionObj;
-        itemValueList = this.customForm.itemValueList;
+        itemKeyValueList = this.customForm.itemKeyValueList;
       } else {
         if (func.isEmptyObject(this.activeItem)) {
           this.$message.error('璇烽�夋嫨涓�鏉℃暟鎹繘琛屾坊鍔犻�夐」');
           return;
         }
         optionObj = this.optionObj;
-        itemValueList = this.form.itemValueList;
+        itemKeyValueList = this.form.itemKeyValueList;
       }
 
       if (!optionObj.optionName) {
@@ -957,15 +1277,20 @@
 
       const params = {
         key: optionObj.optionName,
-        value: optionObj.optionValue
+        value: optionObj.optionValue,
+        index: val === 'dialog' ? this.customOptionCurrentIndex++ : this.optionCurrentIndex++
       };
 
-      itemValueList.push(params);
+      itemKeyValueList.push(params);
     },
 
     // 閫夐」鍒犻櫎
-    optionDeleteClickHandler() {
-
+    optionDeleteClickHandler(val) {
+      if (val === 'dialog') {
+        this.customForm.itemKeyValueList.splice(this.customOptionRow.index,1);
+      } else {
+        this.form.itemKeyValueList.splice(this.optionRow.index,1);
+      }
     },
 
     // 娣诲姞鑷畾涔夌粍浠�
@@ -976,15 +1301,207 @@
     // 淇濆瓨鎸夐挳
     saveClickHandler() {
       if (!this.topForm.viName) {
-        this.$message.error('鍚嶇О涓嶈兘涓虹┖');
+        this.$message.error('琛ㄥ崟鍚嶇О涓嶈兘涓虹┖');
         return;
       }
       if (this.formList.length <= 0) {
-        this.$message.error('椤甸潰涓嶈兘涓虹┖');
+        this.$message.error('椤甸潰瀹氫箟涓嶈兘涓虹┖');
+        return;
+      }
+      this.formList = this.formList.map(item => {
+        return {
+          ...item,
+          itemField: item.text // 灏唅temField閲嶆柊璧嬪�间负text锛屽洜涓哄繕璁板綋鏃跺湪鐖剁粍浠剁紪杈戝洖濉柟娉曢噷涓轰粈涔堟妸itemField璧嬪�间负text浜�
+        };
+      });
+      const params = {
+        id: this.editRow.id,// 淇敼鏃跺�欏繀浼�
+        typeFlag: this.treeRadio, // 涓氬姟绫诲瀷0 or 閾炬帴绫诲瀷1
+        typeFlagText: this.treeRadio === '0' ? '涓氬姟绫诲瀷鐨勮〃鍗�' : '閾炬帴绫诲瀷鐨勮〃鍗�',// 涓氬姟绫诲瀷鏄剧ず鍊�
+        typeName: this.treeRadio === '0' ? this.TreeNodeRow.id : this.TreeNodeRow.name, // 涓氬姟绫诲瀷鍚� or 閾炬帴绫诲瀷鍚�
+        viName: this.topForm.viName, // 瑙嗗浘鍚嶇О
+        viType: 1, // 瑙嗗浘绫诲瀷
+        viTypeText: "琛ㄥ崟", // 瑙嗗浘涓枃鍚嶇О
+        prm: {
+          formQtName: this.topForm.itemQtName, // 鏌ヨ妯℃澘鍚嶇О
+          showCols: this.topForm.showColumn,
+          prmItemList: this.formList
+        },
+      }
+      savePortalVI(params).then(res => {
+        if (res.data.code === 200) {
+          this.$message.success(res.data.obj);
+          this.visible = false;
+          this.closeDialog();
+          this.$emit('updataTable');
+        }
+      })
+      // this.visible = false;
+      // this.$message.success('淇濆瓨鎴愬姛');
+    },
+
+    // 淇敼鏄剧ず绫诲瀷
+    itemTypeChange(val) {
+      if (val) {
+        this.clearFormBottom();
+      }
+      if (!this.form.text) {
+        this.$message.error('璇峰湪鍙充晶閫夋嫨鏁版嵁鍚庤繘琛屾搷浣滐紒');
+      }
+    },
+
+    // 鑷畾涔夌粍浠朵慨鏀规樉绀虹被鍨�
+    customItemTypeChange(val) {
+      if (val) {
+        this.customClearFormBottom();
+      }
+    },
+
+    // 鑷畾涔夌粍浠朵繚瀛�
+    customSaveHandler() {
+      if (!this.customForm.text) {
+        this.$message.error('璇烽�夋嫨浣跨敤瀛楁');
+        return;
+      }
+      if (!this.customForm.itemType) {
+        this.$message.error('璇烽�夋嫨鏄剧ず绫诲瀷');
+        return;
+      }
+      const status = this.formList.some(item => item.text === this.customForm.text);
+      if (status) {
+        this.$message.error('璇锋鏌ユ槸鍚︽坊鍔犵浉鍚岄」');
+        return;
+      }
+      this.formList.push(this.customForm);
+      this.customVisible = false;
+    },
+
+    // 鑷畾涔夊璇濇鍏抽棴
+    closeCustomDialog() {
+      this.customForm = {
+        itemKeyValueList: [],
+        itemType: 'text',
+        itemCols: '1'
+      };
+    },
+
+    // 娓呯┖涓嶅悓绫诲瀷琛ㄥ崟涓嬫柟缁戝畾鍊�
+    clearFormBottom() {
+      this.optionObj = {};
+      this.form.itemKeyValueList = [];
+      this.form.itemListTable = this.form.itemListTxt = this.form.itemListVal = this.form.itemStyle = "";
+    },
+
+    // 鑷畾涔夌粍浠舵竻绌轰笉鍚岀被鍨嬭〃鍗曚笅鏂圭粦瀹氬��
+    customClearFormBottom() {
+      this.customOptionObj = {};
+      this.customForm.itemKeyValueList = [];
+      this.customForm.itemListTable = this.customForm.itemListTxt = this.customForm.itemListVal = this.customForm.itemStyle = "";
+    },
+
+    // 鑷畾涔夎〃鍗曚娇鐢ㄥ瓧娈佃〃鏍艰鐐瑰嚮
+    customAttrRowClickHandler(row) {
+      this.customAttrRow = row;
+    },
+
+    // 鑷畾涔夎〃鍗曚娇鐢ㄥ瓧娈甸�夋嫨
+    customTextHandler() {
+      this.customAttrVisible = true;
+      this.customAttrLoading = true
+      gridAttribute().then(res => {
+        const data = res.data.data;
+        this.customAttrData = data;
+        this.customAttrLoading = false;
+      }).catch(err => {
+        this.$message.error(err)
+      });
+    },
+
+    // 鑷畾涔夎〃鍗曚娇鐢ㄥ瓧娈典繚瀛�
+    customAttrSaveHandler() {
+      if (func.isEmptyObject(this.customAttrRow)) {
+        this.$message.error('璇烽�夋嫨涓�鏉℃暟鎹繘琛屼繚瀛�');
+        return;
+      }
+      this.customForm.text = this.customAttrRow.id;
+      this.customAttrVisible = false;
+    },
+
+    // 鍙充晶琛ㄥ崟搴旂敤鎸夐挳
+    asideFormHandler() {
+      if (!this.form.text) {
+        this.$message.error('璇锋坊鍔犱竴鏉℃暟鎹繘琛屼繚瀛橈紒');
         return;
       }
 
+      this.formList = this.formList.map(item =>
+        item.text === this.form.text ? this.form : item
+      );
+
+      this.$message.success('搴旂敤鎴愬姛');
+    },
+
+    // 棰勮鎸夐挳
+    checkViewHandler() {
+      this.checkViewVisible = true;
+    },
+
+    // 鏌ヨ妯℃澘涓嬫媺鎺ュ彛鏌ヨ
+    getSearchSelectList() {
+      getObjTypeQTs({btName: this.treeRadio === '0' ? this.TreeNodeRow.id : this.TreeNodeRow.name}).then(res => {
+        this.searchQtNameList = res.data.data;
+      })
+    },
+
+    // 鏉冮檺閫夋嫨鎸夐挳
+    authClickHandler() {
+      this.authVisible = true;
+    },
+
+    // 鑷畾涔夎〃鍗曢�夋嫨鏉冮檺
+    customAuthClickHandler() {
+      this.authVisible = true;
+      this.authType = 'attr';
+    },
+
+    // 鏉冮檺鏍戝璇濇鍏抽棴
+    authDialogClose() {
+      this.authVisible = false;
+      this.refresh = Math.random(); // 鍒锋柊宸︿晶鏍�
+    },
+
+    // 鏉冮檺鎺у埗淇濆瓨
+    authDialogSaveHandler() {
+      const filterList = ['root', 'user', 'role', 'department']
+      const data = this.$refs.authTree.getCheckedNodes().filter(item => !filterList.includes(item.oid));
+      if (!data || data.length <= 0) {
+        this.$message.error('璇锋鏌ユ槸鍚﹀嬀閫夊瓙鑺傜偣');
+        return;
+      }
+
+      const resultMap = {};
+
+      data.forEach(item => {
+        const key = item.parentBtmName;
+        if (!resultMap[key]) {
+          resultMap[key] = []; // 鍒濆鍖栨暟缁�
+        }
+        resultMap[key].push(item.parentBtmName === 'user' ? item.data.userName : item.data.name);
+      });
+
+      // 缁勮瀛楃涓�
+      const resultString = Object.entries(resultMap).map(([key, oids]) => {
+        return `${key}=${oids.join(',')}`; // 鐢� , 杩炴帴鍚屼竴绫诲瀷鐨� oid
+      }).join('&&'); // 鏈�鍚庣敤 && 杩炴帴涓嶅悓绫诲瀷
+
+      if (this.authType === 'attr') {
+        this.customForm.itemRight = resultString;
+      } else {
+        this.form.itemRight = resultString;
+      }
+      this.authDialogClose();
     }
+
   }
 }
 </script>
@@ -1023,4 +1540,8 @@
   font-size: 14px
 }
 
+//.formItemMargin {
+//  margin: 10px 0 10px 0;
+//}
+
 </style>

--
Gitblit v1.9.3