From f25ba67cb65c61892e38f1aacb113c6bf7a70556 Mon Sep 17 00:00:00 2001 From: wangting <675591594@qq.com> Date: 星期五, 01 十一月 2024 17:30:37 +0800 Subject: [PATCH] 调整页面 --- Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/businessType/index.vue | 428 +++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 312 insertions(+), 116 deletions(-) diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/businessType/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/businessType/index.vue index 6d4bb28..4f60ac9 100644 --- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/businessType/index.vue +++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/businessType/index.vue @@ -2,39 +2,11 @@ <el-container v-loading="createViewLoading"> <el-aside> <basic-container> - <div ref="TreeBox" style="height: calc(100vh - 144px);!important;"> - <div class="headerCon"> - <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addClickHandler">鍒涘缓 - </el-button> - <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editClickHandler">淇敼 - </el-button> - <el-button icon="el-icon-delete" plain size="small" type="danger" @click="deleteClickHandler">鍒犻櫎 - </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 class="miniBtn" icon="el-icon-circle-plus-outline" plain size="small" - type="primary" @click="createViewClickHandler">鍒涘缓瑙嗗浘 - </el-button> - <el-button class="miniBtn" icon="el-icon-circle-plus-outline" plain size="small" - type="primary" @click="indexClickHandler">鍒涘缓绱㈠紩 - </el-button> - <el-button icon="el-icon-menu" plain size="small" style="width: 82px;text-align: center;padding-left: 1px" - type="primary" @click="checkClickHandler">涓�鑷存�ф鏌� - </el-button> - <el-button class="miniBtn" icon="el-icon-delete" plain size="small" - type="danger" @click="checkClickHandler">鍒犻櫎鏁版嵁 - </el-button> - <el-button class="smallBtn" plain size="small" - type="danger" @click="checkClickHandler">鍒犻櫎鍏ㄩ儴绫诲瀷 - </el-button> - <el-button class="smallBtn" plain size="small" type="primary" @click="checkViewClickHandler">鏌ョ湅浣跨敤鑼冨洿 - </el-button> - </div> + <div ref="TreeBox" style="height: calc(100vh - 154px);!important;"> + <!-- 宸︿晶鏍� --> - <div style="height: calc(100vh - 330px);"> - <avue-tree ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick"> + <div style="height: calc(100vh - 190px);"> + <avue-tree ref="tree" v-loading="treeLoading" :data="treeData" :option="treeOption" @node-click="nodeClick"> <span slot-scope="{ node, data }" class="el-tree-node__label"> <span style="font-size: 15px"> <i class="el-icon-s-promotion"></i> @@ -48,8 +20,21 @@ </el-aside> <el-main> <basic-container> - <div style="display: flex;justify-content: center; height: 230px"> - <div class="descBox" style="max-height: 100px"> + <div> + <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addClickHandler">鍒涘缓</el-button> + <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editClickHandler">淇敼</el-button> + <el-button icon="el-icon-delete" plain size="small" type="danger" @click="deleteClickHandler">鍒犻櫎</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-circle-plus-outline" plain size="small" type="primary" @click="createViewClickHandler">鍒涘缓瑙嗗浘</el-button> + <el-button icon="el-icon-circle-plus-outline" plain size="small" type="primary" @click="indexClickHandler">鍒涘缓绱㈠紩</el-button> + <el-button icon="el-icon-menu" plain size="small" type="primary" @click="checkClickHandler">涓�鑷存�ф鏌�</el-button> + <el-button icon="el-icon-delete" plain size="small" type="danger" @click="checkClickHandler">鍒犻櫎鏁版嵁</el-button> + <el-button icon="el-icon-delete" plain size="small" type="danger" @click="checkClickHandler">鍒犻櫎鍏ㄩ儴绫诲瀷</el-button> + <el-button icon="el-icon-view" plain size="small" type="primary" @click="checkViewClickHandler">鏌ョ湅浣跨敤鑼冨洿</el-button> + </div> + <div style="display: flex;justify-content:left;margin-top: 15px;"> + <div class="descBox" style="width: 40%"> <el-descriptions :column="1" border class="margin-top" size="medium" title="灞炴�т俊鎭�"> <el-descriptions-item :contentStyle="descriptionOption.contentStyle" :labelStyle="descriptionOption.labelStyle"> @@ -72,8 +57,7 @@ </template> <el-tooltip v-if="nodeRow.implClass" :content="nodeRow.implClass" class="item" effect="dark" placement="top-start"> - <el-tag style="max-width: 250px;overflow: hidden">{{ nodeRow.implClass }} - </el-tag> + <el-tag style="max-width: 100%;overflow: hidden;display: block">{{ nodeRow.implClass }}</el-tag> </el-tooltip> </el-descriptions-item> <el-descriptions-item :contentStyle="descriptionOption.contentStyle" @@ -85,7 +69,7 @@ </el-descriptions-item> </el-descriptions> </div> - <div class="descBox"> + <div class="descBox" style="width: 25%;"> <el-descriptions :column="1" border class="margin-top" size="medium" title="鐗堟湰瑙勫垯"> <el-descriptions-item :contentStyle="descriptionOption.contentStyle" :labelStyle="descriptionOption.labelStyle"> @@ -137,7 +121,7 @@ </el-descriptions> </div> - <div class="descBox"> + <div class="descBox" style="width: calc(35% - 40px);margin-right: 0"> <el-descriptions :column="1" border class="margin-top" size="medium" title="鐢熷懡鍛ㄦ湡"> <el-descriptions-item :contentStyle="descriptionOption.contentStyle" :labelStyle="descriptionOption.labelStyle"> @@ -149,8 +133,8 @@ </el-descriptions> </div> </div> - <div style="margin-top: 30px"> - <h3>灞炴�у垪琛�</h3> + <div style="margin-top: 25px;position: relative"> + <h3 style="margin: 0;position: absolute;top:0;z-index: 1000;">灞炴�у垪琛�</h3> <avue-crud :data="attrData" :option="attrOption"> @@ -168,9 +152,9 @@ class="avue-dialog" width="75%" @close="addDialogClose"> - <el-form ref="form" :model="form" :rules="rules" label-width="95px"> + <el-form ref="form" :model="form" :rules="rules" label-width="95px" size="small"> <div class="dialogForm"> - <div class="leftForm"> + <div class="leftForm" style="width: 40%"> <el-form-item label="绫诲瀷鍚嶇О锛�" prop="id"> <el-input v-model="form.id" :readOnly="title === 'edit'"></el-input> </el-form-item> @@ -193,7 +177,7 @@ <el-input v-model="form.description" :rows="2" type="textarea"></el-input> </el-form-item> </div> - <div class="centerForm"> + <div class="centerForm" style="width: 24%"> <el-form-item label="鐗堟湰瑙勫垯锛�" label-width="110px" prop="revLevel"> <el-select v-model="form.revLevel" @change="revLevelChange"> <el-option label="涓嶅彲淇" value="0"></el-option> @@ -231,7 +215,7 @@ </el-select> </el-form-item> </div> - <div class="rightForm"> + <div class="rightForm" style="width: 26%"> <el-form-item label="鐢熷懡鍛ㄦ湡锛�" label-width="138px" prop="lifeCycleId"> <div style="display: flex;gap: 5px;align-items: center"> <el-input v-model="form.lifeCycleId" :readOnly="true"></el-input> @@ -279,7 +263,7 @@ </div> </el-form> <div class="bottomForm"> - <h3>灞炴�ф睜鍒楄〃</h3> + <h3 style="margin-bottom: 10px;">灞炴�ф睜鍒楄〃</h3> <avue-crud :data="dialogAttrData" :option="dialogAttrOption" @@ -289,9 +273,9 @@ </template> </avue-crud> </div> - <span slot="footer" class="dialog-footer"> - <el-button @click="addDialogClose">鍙� 娑�</el-button> + <span slot="footer" class="dialog-footer avue-dialog__footer"> <el-button type="primary" @click="addDialogSavaHandler">纭� 瀹�</el-button> + <el-button @click="addDialogClose">鍙� 娑�</el-button> </span> </el-dialog> @@ -402,8 +386,8 @@ </span> </avue-tree> <span slot="footer" class="dialog-footer"> - <el-button @click="inheritClose">鍙� 娑�</el-button> <el-button type="primary" @click="inheritSaveClickHandler">纭� 瀹�</el-button> + <el-button @click="inheritClose">鍙� 娑�</el-button> </span> </el-dialog> @@ -446,12 +430,12 @@ :table-loading="conCheckLoading"> </avue-crud> <span slot="footer" class="dialog-footer"> - <el-button @click="conCheckVisible = false">鍙� 娑�</el-button> <el-button type="primary" @click="repairClickHandler">淇� 澶�</el-button> + <el-button @click="conCheckVisible = false">鍙� 娑�</el-button> </span> </el-dialog> - <!-- 涓�鑷存�ф鏌� --> + <!-- 鏌ョ湅绱㈠紩 --> <el-dialog v-dialogDrag :visible.sync="indexVisible" @@ -459,8 +443,61 @@ class="avue-dialog" title="绱㈠紩淇℃伅" width="60%" + @close="indexDialogClose" > - + <div v-loading="indexLoading" style="display: flex;height: 500px;width: 100%"> + <basic-container> + <div style="height: 390px"> + <el-button plain size="mini" style="margin-bottom: 5px" type="danger" + @click="deleteIndexLeftTreeClickHandler">鍒犻櫎绱㈠紩 + </el-button> + <avue-tree + :data="indexLeftData" + :option="indexLeftOption" + @node-click="indexLeftNodeClick"></avue-tree> + </div> + </basic-container> + <div style="padding: 20px;width: 75%"> + <div> + <el-form ref="form" :model="indexForm" label-width="90px" size="mini"> + <el-form-item label="绱㈠紩鍚嶇О锛�"> + <el-input v-model="indexForm.name" :readOnly="indexFormRead"></el-input> + </el-form-item> + <el-form-item label="鎻忚堪锛�"> + <el-input v-model="indexForm.desc"></el-input> + </el-form-item> + </el-form> + <div style="display: flex;justify-content: center"> + <el-button plain size="mini" type="success" @click="rightIndexAddClick">澧炲姞</el-button> + <el-button plain size="mini" type="danger">鍒犻櫎</el-button> + </div> + </div> + <avue-crud + :data="indexData" + :option="indexOption"></avue-crud> + </div> + </div> + <el-dialog + v-dialogDrag + :visible.sync="indexAttrVisible" + append-to-body="true" + class="avue-dialog" + title="灞炴�т俊鎭�" + width="60%" + > + <avue-crud + :data="indexAttrData" + :option="indexAttrOption" + @row-click="indexAttrRowClick"></avue-crud> + <span slot="footer" class="dialog-footer"> + <el-button type="primary" @click="indexAttrClickAddHandler">纭� 瀹�</el-button> + <el-button @click="indexAttrVisible = false">鍙� 娑�</el-button> + </span> + </el-dialog> + <span slot="footer" class="dialog-footer"> + <el-button type="primary" @click="indexClickAddHandler">淇� 瀛�</el-button> + <el-button @click="indexDialogClose">鍙� 娑�</el-button> + </span> </el-dialog> </el-container> @@ -478,7 +515,10 @@ getUsedBtmLinkList, checkBtmConsistency, executeRepair, - getIndexByCondition + getIndexByCondition, + delIndex, + getAllAttributesByBtmId, + addIndex } from "@/api/modeling/businessType/api" import {gridAttribute} from "@/api/modeling/attributePool/api"; import func from "@/util/func"; @@ -489,7 +529,79 @@ name: "index", data() { return { - indexVisible:false, + indexLoading: false, + indexFormRead: false, + indexAttrRow: {}, + indexAttrOption: { + ...basicOption, + height: 380, + highlightCurrentRow: true, + addBtn: false, + refreshBtn: false, + editBtn: false, + delBtn: false, + selection: false, + menu: false, + column: [ + { + label: '灞炴�т俊鎭�', + prop: 'id', + sortable: true, + }, + ] + }, + indexAttrData: [], + indexData: [], + indexAttrVisible: false, + indexLeftNodeRow: {}, + indexForm: { + name: '', + desc: '' + }, + indexLeftData: [], + indexLeftOption: { + height: 'auto', + menu: false, + addBtn: false, + props: { + label: 'name', + value: 'id', + children: 'children', + }, + }, + indexOption: { + ...basicOption, + height: 280, + addBtn: false, + refreshBtn: false, + editBtn: false, + delBtn: false, + selection: false, + menu: false, + column: [ + { + label: '涓氬姟绫诲瀷鍚嶇О', + prop: 'typeName', + sortable: true, + }, + { + label: '绱㈠紩鍚嶇О', + prop: 'indexName', + sortable: true, + }, + { + label: '灞炴�у悕绉�', + prop: 'attrNames', + sortable: true, + }, + { + label: '鎻忚堪', + prop: 'desc', + sortable: true, + }, + ] + }, + indexVisible: false, conDefaultCheckData: [], // 淇濈暀涓婁釜鎺ュ彛杩斿洖鐨勬暟鎹� conCheckLoading: false, conCheckOption: { @@ -527,6 +639,7 @@ searchMenuSpan: 8, refreshBtn: false, selection: false, + header:false, column: [ { label: '鍚嶇О', @@ -640,6 +753,7 @@ highlightCurrentRow: true, height: 450, searchMenuSpan: 8, + header: false, column: [ { label: '灞炴�у悕', @@ -651,6 +765,7 @@ label: '灞炴�х被鍨�', prop: 'attributeDataType', sortable: true, + width:150, }, { label: '鍒濆鍊�', @@ -687,6 +802,7 @@ selection: false, height: 210, addBtn: false, + menuWidth:100, // index:false, column: [ { @@ -704,11 +820,13 @@ label: '灞炴�х被鍨�', prop: 'attributeDataType', sortable: true, + width:150, }, { label: '鍒濆鍊�', prop: 'defaultValue', sortable: true, + width:150, }, { label: '璇存槑', @@ -780,7 +898,8 @@ props: { label: 'TreeName', value: 'id', - children: 'children' + children: 'children', + name: 'name' } }, treeData: [ @@ -799,6 +918,7 @@ name: 'el-icon-tickets', desc: 'el-icon-chat-line-square' }, + treeLoading: false } }, created() { @@ -809,6 +929,7 @@ methods: { //鏍戣〃鏌ヨ getTreeList() { + this.treeLoading = true; getBizTypes().then(res => { const data = res.data.data.map(item => { this.processChildren(item); // 澶勭悊姣忎釜鑺傜偣 @@ -816,8 +937,8 @@ return item.attributes; // 杩斿洖澶勭悊鍚庣殑 attributes }); this.treeData[0].children = data; - console.log(this.treeData); this.inheritTreeData = data; + this.treeLoading = false; }); }, @@ -1171,7 +1292,7 @@ // 鏂板缂栬緫淇濆瓨 addDialogSavaHandler() { - if (!this.form.inputRevisionFlag && (!this.form.revisionRuleId || this.form.revisionRuleId === "")) { + if (this.form.revLevel !== '0' &&!this.form.inputRevisionFlag && (!this.form.revisionRuleId || this.form.revisionRuleId === "")) { this.$message.error('璇锋鏌ョ増鏈彿瑙勫垯涓嶈兘涓虹┖'); return; } @@ -1305,9 +1426,9 @@ if (res.data.code === 200) { this.checkViewVisible = true; const data = res.data.data.map(item => { - return{ - name:this.nodeRow.id, - source:item + return { + name: this.nodeRow.id, + source: item } }); this.checkViewData = data; @@ -1340,12 +1461,14 @@ }, // 涓�鑷存�ф鏌ユ寜閽偣鍑� - checkClickHandler(){ - checkBtmConsistency().then(res =>{ - if(res && res.data && res.data.data){ + checkClickHandler() { + this.createViewLoading = true; + checkBtmConsistency().then(res => { + this.createViewLoading = false; + if (res && res.data && res.data.data) { this.conCheckVisible = true; this.conCheckLoading = true; - if(res.data.code === 200){ + if (res.data.code === 200) { const data = res.data.data[0]; this.conDefaultCheckData = data; // 淇濈暀涓�浠藉師濮嬫暟鎹� this.conCheckLoading = false; @@ -1374,7 +1497,7 @@ }) this.conCheckData = outputData; } - }else { + } else { this.$message.success(res.data.msg); } }) @@ -1395,17 +1518,130 @@ }, // 鍒涘缓绱㈠紩鎸夐挳鐐瑰嚮 - indexClickHandler(){ - if(func.isEmptyObject(this.nodeRow)){ + indexClickHandler() { + if (func.isEmptyObject(this.nodeRow)) { this.$message.error('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�'); return; } + this.getLeftIndex(); + this.indexVisible = true; + }, + + // 宸︿晶鏍戞洿鏂� + getLeftIndex() { const params = { - "conditionMap[typename]":this.nodeRow.id + "conditionMap[typename]": this.nodeRow.id } getIndexByCondition(params).then(res => { - console.log(res); + if (res.data.code === 200) { + const data = res.data.data.map(item => { + return { + indexName: item.indexName, + name: `${item.indexName} ${item.attrNames}`, + id: item.oid + } + }) + this.indexLeftData = data; + } }) + }, + + // 绱㈠紩宸︿晶鏍戠偣鍑� + indexLeftNodeClick(row) { + this.indexLeftNodeRow = row; + }, + + // 鍒犻櫎宸︿晶鏍戠储寮� + deleteIndexLeftTreeClickHandler() { + if (func.isEmptyObject(this.indexLeftNodeRow)) { + this.$message.error('璇烽�夋嫨涓�鏉℃暟鎹繘琛屽垹闄�'); + return; + } + const params = { + btmName: this.nodeRow.id, + indexName: this.indexLeftNodeRow.indexName + }; + delIndex(params).then(res => { + if (res.data.code === 200) { + this.$message.success('鍒犻櫎绱㈠紩鎴愬姛'); + this.getLeftIndex(); + } + }) + }, + + //鍙充晶琛ㄦ牸娣诲姞灞炴�� + indexAttrClickAddHandler() { + if (func.isEmptyObject(this.indexAttrRow)) { + this.$message.error('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�'); + return; + } + this.indexData.push( + { + typeName: this.nodeRow.id, + attrNames: this.indexAttrRow.id, + indexName: this.indexForm.name, + desc: this.indexForm.desc + } + ) + this.indexFormRead = true; + this.indexAttrVisible = false; + }, + + // 鍙充晶灞炴�ц〃鏍艰鐐瑰嚮 + indexAttrRowClick(row) { + this.indexAttrRow = row; + }, + + // 鍙充晶琛ㄦ牸澧炲姞 + rightIndexAddClick() { + if (!this.indexForm.name) { + this.$message.error('璇疯緭鍏ョ储寮曞悕绉�'); + return; + } + + // 妫�鏌ユ槸鍚︿负鑻辨枃瀛楃 + const englishRegex = /^[A-Za-z]+$/; + if (!englishRegex.test(this.indexForm.name)) { + this.$message.error('绱㈠紩鍚嶇О鍙兘鍖呭惈鑻辨枃瀛楃'); + return; + } + this.indexLoading = true; + getAllAttributesByBtmId({btmId: this.nodeRow.id}).then(res => { + if (res.data.code === 200) { + const data = res.data.data.map(item => { + return { + id: item.id + } + }) + this.indexAttrData = data; + } + this.indexLoading = false; + this.indexAttrVisible = true; + }) + }, + + // 鍒涘缓淇濆瓨绱㈠紩 + indexClickAddHandler() { + const params = { + typeName: this.nodeRow.id, + attrNames: this.indexData.map(item => item.attrNames).join(','), + indexName: this.indexForm.name, + } + addIndex([params]).then(res => { + console.log(res) + this.$message.success('鍒涘缓鎴愬姛'); + this.indexDialogClose(); + }).catch(err => { + this.indexDialogClose(); + }) + }, + + // 绱㈠紩瀵硅瘽妗嗗彇娑� + indexDialogClose() { + this.indexFormRead = false; + this.indexForm = {}; + this.indexData = []; + this.indexVisible = false; } } } @@ -1426,66 +1662,26 @@ width: 100%; } - .headerCon { - .el-button { - width: 82px; - } + .el-tag{ + line-height:22px; + height: 24px; } -} - -.headerCon { - display: flex; - flex-wrap: wrap; - margin-bottom: 5px; - - .el-button + .el-button { - margin-left: 5px; - } - - .el-button { - margin-top: 5px; - } -} - -.headerCon > .el-button:nth-child(4) { - margin-left: 0; -} - -.headerCon > .el-button:nth-child(7) { - margin-left: 0; -} - -.headerCon > .el-button:nth-child(10) { - margin-left: 0; -} - -.miniBtn { - width: 82px; - text-align: center; - padding-left: 7px; -} - -.smallBtn { - width: 82px; - text-align: center; - padding-left: 4.5px; } .descBox { - width: 32%; - margin-left: 20px; + margin-right: 20px; } .dialogForm { display: flex; - justify-content: space-around; + justify-content: space-between; } .dialogForm > div { - width: 29%; - border: 1px solid #eee; + border: 1px solid #EBEEF5; + border-radius: 2px; padding: 25px 20px 5px 10px; /* 涓� 鍙� 涓� 宸� */ - box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2); /* 娣诲姞闃村奖鏁堟灉 */ + box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1); /* 娣诲姞闃村奖鏁堟灉 */ } -- Gitblit v1.9.3