From 8620da7c3fb168e3dcaa528c3412fde7201619b2 Mon Sep 17 00:00:00 2001
From: xiejun <xiejun@vci-tech.com>
Date: 星期四, 12 九月 2024 17:51:01 +0800
Subject: [PATCH] 属性类型对象加UI控件类型字段
---
Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/businessType/index.vue | 281 ++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 263 insertions(+), 18 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..00c4b4b 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
@@ -34,7 +34,7 @@
</div>
<!-- 宸︿晶鏍� -->
<div style="height: calc(100vh - 330px);">
- <avue-tree ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick">
+ <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>
@@ -451,7 +451,7 @@
</span>
</el-dialog>
- <!-- 涓�鑷存�ф鏌� -->
+ <!-- 鏌ョ湅绱㈠紩 -->
<el-dialog
v-dialogDrag
:visible.sync="indexVisible"
@@ -459,8 +459,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 @click="indexAttrVisible = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="indexAttrClickAddHandler">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="indexDialogClose">鍙� 娑�</el-button>
+ <el-button type="primary" @click="indexClickAddHandler">淇� 瀛�</el-button>
+ </span>
</el-dialog>
</el-container>
@@ -478,7 +531,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 +545,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: {
@@ -799,6 +927,7 @@
name: 'el-icon-tickets',
desc: 'el-icon-chat-line-square'
},
+ treeLoading:false
}
},
created() {
@@ -809,6 +938,7 @@
methods: {
//鏍戣〃鏌ヨ
getTreeList() {
+ this.treeLoading = true;
getBizTypes().then(res => {
const data = res.data.data.map(item => {
this.processChildren(item); // 澶勭悊姣忎釜鑺傜偣
@@ -816,8 +946,8 @@
return item.attributes; // 杩斿洖澶勭悊鍚庣殑 attributes
});
this.treeData[0].children = data;
- console.log(this.treeData);
this.inheritTreeData = data;
+ this.treeLoading = false;
});
},
@@ -1305,9 +1435,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 +1470,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 +1506,7 @@
})
this.conCheckData = outputData;
}
- }else {
+ } else {
this.$message.success(res.data.msg);
}
})
@@ -1395,17 +1527,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;
}
}
}
--
Gitblit v1.9.3