From a34c10535d130c4be667301434a0e8072ee82716 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期一, 14 十月 2024 15:21:48 +0800
Subject: [PATCH] 整合代码,修改表单定义按钮排列方式

---
 Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/index.vue |  235 +++++++++++++++++++++++++++++++---------------------------
 1 files changed, 125 insertions(+), 110 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/index.vue
index 9a6bc20..0bf39a8 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/index.vue
@@ -36,8 +36,10 @@
             <el-button icon="el-icon-plus" size="small" type="primary" @click="addHandler">鍒涘缓</el-button>
             <!--<el-button icon="el-icon-edit" plain size="small" type="primary" @click="editHandler">淇敼</el-button>
             <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delHandler">鍒犻櫎</el-button>-->
-            <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">瀵煎嚭</el-button>
-            <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">瀵煎叆</el-button>
+            <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">瀵煎嚭
+            </el-button>
+            <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">瀵煎叆
+            </el-button>
             <el-button icon="el-icon-place" plain size="small" type="primary" @click="uiAuthorHandler">鎺堟潈</el-button>
           </template>
           <template slot="menu" slot-scope="scope">
@@ -45,7 +47,8 @@
             </el-button>
             <el-button icon="el-icon-delete" size="small" type="text" @click="rowDeleteHandler(scope.row)">鍒犻櫎
             </el-button>
-            <el-button icon="el-icon-document-copy" size="small" type="text" @click="rowCloneHandler(scope.row)">鍏嬮殕</el-button>
+            <el-button icon="el-icon-document-copy" size="small" type="text" @click="rowCloneHandler(scope.row)">鍏嬮殕
+            </el-button>
           </template>
           <template slot="plName" slot-scope="{row}">
             <el-link type="primary" @click="linkClickHandler(row)">{{ row.plName }}</el-link>
@@ -55,11 +58,11 @@
         <el-dialog
           v-dialogDrag
           v-loading="dialogLoading"
+          :close-on-click-modal="false"
           :title="dialogType === 'add' ? ' 鍒涘缓 涓婁笅鏂�' : '缂栬緫 涓婁笅鏂�'"
           :visible.sync="dialogVisible"
           append-to-body="true"
           class="avue-dialog"
-          :close-on-click-modal="false"
           width="500px"
           @close="dialogClose"
         >
@@ -78,7 +81,7 @@
               </el-checkbox-group>
             </el-form-item>
             <el-form-item label="鎻忚堪锛�" prop="plDesc">
-              <el-input type="textarea" :rows="5" v-model="form.plDesc"></el-input>
+              <el-input v-model="form.plDesc" :rows="5" type="textarea"></el-input>
             </el-form-item>
           </el-form>
           <span slot="footer" class="dialog-footer">
@@ -90,14 +93,14 @@
         <el-dialog
           key="cloneDialog"
           v-dialogDrag
-          title="鍏嬮殕"
           :visible.sync="cloneDialogVisible"
           append-to-body="true"
           class="avue-dialog"
+          title="鍏嬮殕"
           width="500px"
           @close="cloneDialogClose"
         >
-          <avue-form ref="cloneForm" :option="cloneOption" v-model="cloneForm"></avue-form>
+          <avue-form ref="cloneForm" v-model="cloneForm" :option="cloneOption"></avue-form>
           <span slot="footer" class="dialog-footer">
             <el-button @click="cloneDialogClose">鍙� 娑�</el-button>
             <el-button type="primary" @click="cloneSaveHandler">纭� 瀹�</el-button>
@@ -107,10 +110,10 @@
         <el-dialog
           key="cloneDialog"
           v-dialogDrag
-          title="瀵煎嚭"
           :visible.sync="expDialogVisible"
           append-to-body="true"
           class="avue-dialog"
+          title="瀵煎嚭"
           width="500px"
           @close="expDialogVisible=false"
         >
@@ -124,19 +127,20 @@
         </el-dialog>
       </basic-container>
       <!-- 瀵煎叆 -->
-      <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" :fileData="fileData" title="瀵煎叆"
+      <upload-file ref="upload" :fileData="fileData" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList"
+                   title="瀵煎叆"
                    @updata="getTableList" @upfaildata="upFail"></upload-file>
       <!--椤电绐楀彛-->
       <el-dialog v-dialogDrag
+                 :append-to-body="true"
+                 :close-on-click-modal="false"
+                 :destroy-on-close="true"
+                 :fullscreen="true"
                  :title="dialog.title"
                  :visible.sync="dialog.showDialog"
-                 :fullscreen="true"
-                 :append-to-body="true"
                  class="avue-dialog"
-                 :destroy-on-close="true"
-                 :close-on-click-modal="false"
                  @close="dialog.showDialog=false">
-          <pl-show :uiDefineData="dialog.uiDefineData"></pl-show>
+        <pl-show :uiDefineData="dialog.uiDefineData"></pl-show>
       </el-dialog>
       <!--ui鎺堟潈-->
       <ui-author ref="uiAuthor"></ui-author>
@@ -146,26 +150,36 @@
 </template>
 
 <script>
-import {getBizTree,gridUIContextData,saveUIContextData,updateUIContextData,delUIContextData, cloneUIContextData ,getExpContextTree,expUIContextData} from "@/api/UI/uiDefine";
+import {
+  getBizTree,
+  gridUIContextData,
+  saveUIContextData,
+  updateUIContextData,
+  delUIContextData,
+  cloneUIContextData,
+  getExpContextTree,
+  expUIContextData
+} from "@/api/UI/uiDefine";
 import basicOption from "@/util/basic-option";
 import func from "@/util/func";
 import plShow from "@/views/modelingMenu/ui/uiDefine/rightRegion/plShow";
 import uiAuthor from "@/views/authority/ui/uiAuthorization/UIDialog"
+
 export default {
   name: "index",
-  components:{plShow,uiAuthor},
+  components: {plShow, uiAuthor},
   data() {
     return {
       dialog: {
         showDialog: false,
         title: "涓婁笅鏂囪鎯�",
         loading: false,
-        uiDefineData:null
+        uiDefineData: null
       },
       tipList: [],
       upFileType: ['xls'],
       fileUrl: 'api/uiManagerController/impUIContextData',
-      fileData:{},
+      fileData: {},
       lastIndex: null,
       treeOption: {
         height: 'auto',
@@ -194,13 +208,13 @@
       selectList: [],
       option: {
         ...basicOption,
-        calcHeight: -40,
+        calcHeight: -50,
         addBtn: false,
         editBtn: false,
         delBtn: false,
         tip: false,
         searchMenuSpan: 6,
-        align:'left',
+        align: 'left',
         column: [{
           label: '鍚嶇О',
           prop: 'plName',
@@ -214,7 +228,7 @@
           label: '瀵艰埅鍖�',
           prop: 'plIsShowNavigator',
           width: 130,
-          align:'center',
+          align: 'center',
           formatter: function (row, value) {
             if (row.plIsShowNavigator == 0) {
               return '涓嶆樉绀�'
@@ -226,7 +240,7 @@
           label: '鎺у埗鍖�',
           prop: 'plIsShowForm',
           width: 130,
-          align:'center',
+          align: 'center',
           formatter: function (row, value) {
             if (row.plIsShowForm == 0) {
               return '涓嶆樉绀�'
@@ -238,7 +252,7 @@
           label: '鎿嶄綔鍖�',
           prop: 'plIsShowTab',
           width: 130,
-          align:'center',
+          align: 'center',
           formatter: function (row, value) {
             if (row.plIsShowTab == 0) {
               return '涓嶆樉绀�'
@@ -274,18 +288,18 @@
           trigger: 'blur'
         }]
       },
-      cloneDialogVisible:false,
+      cloneDialogVisible: false,
       cloneOption: {
-        submitBtn:false,
-        emptyBtn:false,
+        submitBtn: false,
+        emptyBtn: false,
         column: [{
           label: '鍏嬮殕鐩爣',
           prop: 'cloneTargetName',
-          span:24,
+          span: 24,
           type: 'tree',
           clearable: true,
           dicData: [],
-          defaultExpandAll:true,
+          defaultExpandAll: true,
           rules: [
             {
               required: true,
@@ -296,7 +310,7 @@
         }, {
           label: 'UI鍚嶇О',
           prop: 'cloneName',
-          span:24,
+          span: 24,
           type: 'input',
           rules: [
             {
@@ -308,7 +322,7 @@
         }, {
           label: 'UI涓婁笅鏂�',
           prop: 'cloneContextCode',
-          span:24,
+          span: 24,
           type: 'input',
           rules: [
             {
@@ -319,19 +333,19 @@
           ]
         }]
       },
-      cloneForm:{
+      cloneForm: {
         //鍏嬮殕鐨勬簮瀵硅薄鐨勪俊鎭�
-        sourcePLUILayout:null,
-        cloneTargetName:'n',
-        cloneName:'',
-        cloneContextCode:''
+        sourcePLUILayout: null,
+        cloneTargetName: 'n',
+        cloneName: '',
+        cloneContextCode: ''
       },
-      expDialogVisible:false,
-      expTreeData:[],
-      expOption:{
+      expDialogVisible: false,
+      expTreeData: [],
+      expOption: {
         height: 'auto',
-        filter:false,
-        multiple:true,
+        filter: false,
+        multiple: true,
         defaultExpandAll: true,
         menu: false,
         addBtn: false,
@@ -351,17 +365,17 @@
     getTreeList() {
       const loading = this.$loading({});
       getBizTree().then(res => {
-        this.treeData=[res.data.obj];
+        this.treeData = [res.data.obj];
         const dicData = res.data.obj.children.map(item => {
-          item.label=item.attributes.name;
-          item.value=item.attributes.name;
+          item.label = item.attributes.name;
+          item.value = item.attributes.name;
           return item;
         });
-        this.cloneOption.column[0].dicData=[{
-          label:'涓氬姟绫诲瀷鏍�',
-          value:'涓氬姟绫诲瀷鏍�',
+        this.cloneOption.column[0].dicData = [{
+          label: '涓氬姟绫诲瀷鏍�',
+          value: '涓氬姟绫诲瀷鏍�',
           disabled: true,
-          children:dicData
+          children: dicData
         }];
         loading.close();
       }).catch(error => {
@@ -376,8 +390,8 @@
         this.getTableList();
       }
     },
-    getTableList(){
-      const params = Object.assign(this.searchParams,{
+    getTableList() {
+      const params = Object.assign(this.searchParams, {
         'conditionMap[btmName]': this.nodeRow.attributes.name,
       })
       gridUIContextData(this.page.currentPage, this.page.pageSize, params).then(res => {
@@ -387,14 +401,14 @@
         this.tableLoading = false;
       })
     },
-    linkClickHandler(row){
-      this.dialog.title='銆�'+row.plName+' - '+row.plCode+'銆戣鎯�'
-      this.dialog.uiDefineData=row;
-      this.dialog.showDialog=true;
+    linkClickHandler(row) {
+      this.dialog.title = '銆�' + row.plName + ' - ' + row.plCode + '銆戣鎯�'
+      this.dialog.uiDefineData = row;
+      this.dialog.showDialog = true;
       return false;
       this.$router.push({
-        path: '/UIDefineShow/:'+row.plOId,
-        name: row.plName+'璇︽儏'
+        path: '/UIDefineShow/:' + row.plOId,
+        name: row.plName + '璇︽儏'
       });
     },
     sizeChange(val) {
@@ -439,25 +453,25 @@
     },
 
     //鍒涘缓
-    addHandler(){
-      if(this.nodeRow && this.nodeRow.oid){
-        this.form.plIsShow=[];
-        this.form.plRelatedType=this.nodeRow.attributes.name;
+    addHandler() {
+      if (this.nodeRow && this.nodeRow.oid) {
+        this.form.plIsShow = [];
+        this.form.plRelatedType = this.nodeRow.attributes.name;
         this.dialogType = 'add';
         this.dialogVisible = true;
-      }else {
+      } else {
         this.$message.error('璇烽�夋嫨涓氬姟绫诲瀷');
       }
 
     },
-    editHandler(){
-      if(this.selectList.length!=0){
+    editHandler() {
+      if (this.selectList.length != 0) {
         this.rowEditBtnClick(this.selectList[0]);
-      }else {
+      } else {
         this.$message.error('璇烽�夋嫨涓�鏉℃暟鎹繘琛岀紪杈�');
       }
     },
-    delHandler(){
+    delHandler() {
       if (this.selectList.length <= 0) {
         this.$message.error('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�');
         return;
@@ -491,31 +505,31 @@
       this.form = {
         plName: '',
         plCode: '',
-        plDesc:'',
+        plDesc: '',
         plIsShow: [],
       }
     },
     // 淇濆瓨UI涓婁笅鏂�
     saveHandler() {
-      this.$refs.form.validate((valid,done) => {
+      this.$refs.form.validate((valid, done) => {
         if (valid) {
           let params = {
             ...this.form
           }
-          if(this.form.plIsShow.includes('瀵艰埅鍖�')){
-            params.plIsShowNavigator=1
-          }else {
-            params.plIsShowNavigator=0
+          if (this.form.plIsShow.includes('瀵艰埅鍖�')) {
+            params.plIsShowNavigator = 1
+          } else {
+            params.plIsShowNavigator = 0
           }
-          if(this.form.plIsShow.includes('鎺у埗鍖�')){
-            params.plIsShowForm=1;
-          }else {
-            params.plIsShowForm=0;
+          if (this.form.plIsShow.includes('鎺у埗鍖�')) {
+            params.plIsShowForm = 1;
+          } else {
+            params.plIsShowForm = 0;
           }
-          if(this.form.plIsShow.includes('鎿嶄綔鍖�')){
-            params.plIsShowTab=1;
-          }else {
-            params.plIsShowTab=0;
+          if (this.form.plIsShow.includes('鎿嶄綔鍖�')) {
+            params.plIsShowTab = 1;
+          } else {
+            params.plIsShowTab = 0;
           }
           delete params.plIsShow;
           if (this.dialogType === 'add') {
@@ -550,24 +564,24 @@
         expDatas: this.selectList.map(item => item.plOId).join(',')
       }
       getExpContextTree(params).then(res => {
-        this.expTreeData=[res.data.obj];
+        this.expTreeData = [res.data.obj];
       })
-      this.expDialogVisible=true;
+      this.expDialogVisible = true;
     },
-    exportData(){
+    exportData() {
       const params = {}
-      const checkedDatas=this.$refs.expTree.getCheckedNodes();
+      const checkedDatas = this.$refs.expTree.getCheckedNodes();
       if (checkedDatas.length <= 0) {
         this.$message.error('璇烽�夋嫨鏁版嵁');
         return;
       }
-      this.selectList.forEach(item=>{
-        params[item.plOId]=checkedDatas.filter(checkitem => checkitem.parentId==item.plOId).map(checkitem => checkitem.oid).join(',')
+      this.selectList.forEach(item => {
+        params[item.plOId] = checkedDatas.filter(checkitem => checkitem.parentId == item.plOId).map(checkitem => checkitem.oid).join(',')
       })
       expUIContextData(params).then(res => {
         func.downloadFileByBlobHandler(res);
         this.$message.success('瀵煎嚭鎴愬姛');
-        this.expDialogVisible=false;
+        this.expDialogVisible = false;
       }).catch(err => {
         this.$message.error(err);
       });
@@ -575,37 +589,37 @@
 
     // 瀵煎叆
     upLoadClickHandler() {
-      this.fileData={
-        isCovered:false,
-        selectBtm:this.nodeRow.attributes.name
+      this.fileData = {
+        isCovered: false,
+        selectBtm: this.nodeRow.attributes.name
       }
       this.$refs.upload.visible = true;
     },
     //瀵煎叆澶辫触
-    upFail(response){
+    upFail(response) {
 
     },
     //ui鎺堟潈
-    uiAuthorHandler(){
-      if (this.selectList.length!=1) {
+    uiAuthorHandler() {
+      if (this.selectList.length != 1) {
         this.$message.error('璇烽�夋嫨涓�鏉℃暟鎹�');
         return;
       }
-      this.$refs.uiAuthor.openDialog(this.nodeRow.attributes.name,this.selectList[0].plCode);
+      this.$refs.uiAuthor.openDialog(this.nodeRow.attributes.name, this.selectList[0].plCode);
     },
     // 缂栬緫鎸夐挳
     rowEditBtnClick(row) {
-      this.form={
+      this.form = {
         ...row,
         plIsShow: [],
       };
-      if(row.plIsShowNavigator){
+      if (row.plIsShowNavigator) {
         this.form.plIsShow.push('瀵艰埅鍖�')
       }
-      if(row.plIsShowForm){
+      if (row.plIsShowForm) {
         this.form.plIsShow.push('鎺у埗鍖�')
       }
-      if(row.plIsShowTab){
+      if (row.plIsShowTab) {
         this.form.plIsShow.push('鎿嶄綔鍖�')
       }
       this.dialogType = 'edit';
@@ -632,17 +646,17 @@
       });
     },
     //鍏嬮殕
-    rowCloneHandler(row){
-      this.cloneForm={
-        sourcePLUILayout:row,
-        cloneTargetName:'',
-        cloneName:row.plName+'_copy(0)',
-        cloneContextCode:row.plCode+'_copy(0)',
+    rowCloneHandler(row) {
+      this.cloneForm = {
+        sourcePLUILayout: row,
+        cloneTargetName: '',
+        cloneName: row.plName + '_copy(0)',
+        cloneContextCode: row.plCode + '_copy(0)',
       }
-      this.cloneDialogVisible=true;
+      this.cloneDialogVisible = true;
     },
-    cloneSaveHandler(){
-      this.$refs.cloneForm.validate((valid,done) => {
+    cloneSaveHandler() {
+      this.$refs.cloneForm.validate((valid, done) => {
         if (valid) {
           cloneUIContextData(this.cloneForm).then(res => {
             if (res.data.code === 200) {
@@ -656,9 +670,9 @@
         }
       });
     },
-    cloneDialogClose(){
-      this.cloneDialogVisible=false;
-      this.cloneForm= {
+    cloneDialogClose() {
+      this.cloneDialogVisible = false;
+      this.cloneForm = {
         //鍏嬮殕鐨勬簮瀵硅薄鐨勪俊鎭�
         sourcePLUILayout: null,
         cloneTargetName: '',
@@ -675,8 +689,9 @@
   .el-scrollbar__wrap {
     overflow: auto !important;
   }
-  .headerCon{
-    .el-button{
+
+  .headerCon {
+    .el-button {
       width: 82px;
     }
   }

--
Gitblit v1.9.3