From c86748a2c254ea22ac8f57d7984cc4743efaaed7 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期五, 26 七月 2024 16:53:07 +0800
Subject: [PATCH] Merge branch 'master' of http://dev.vci-tech.com:1065/r/PLTWEB
---
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsLinkTypeController.java | 73 +++
Source/plt-web/plt-web-ui/src/util/basic-option.js | 1
Source/plt-web/plt-web-ui/src/api/modeling/linkType/api.js | 18
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsLinkTypeServiceI.java | 23 +
Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue | 676 +++++++++++++++++++++++++----
Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/linkType/index.vue | 283 ++++++++++++
Source/plt-web/plt-web-ui/src/api/modeling/attributePool/api.js | 36 +
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java | 234 ++++++++++
8 files changed, 1,249 insertions(+), 95 deletions(-)
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsLinkTypeController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsLinkTypeController.java
index 8b592a7..6400b16 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsLinkTypeController.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsLinkTypeController.java
@@ -18,8 +18,11 @@
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
+import java.io.IOException;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.stream.Collectors;
/**
@@ -155,4 +158,74 @@
return objectBaseResult;
}
}
+ /**
+ * 閾炬帴绫诲瀷鍒犻櫎
+ * linkType 閾炬帴绫诲瀷瀵硅薄
+ * @return 鍒犻櫎缁撴灉
+ */
+ @DeleteMapping("/deleteLink")
+ public BaseResult deleteLink(@RequestBody LinkType linkType){
+ try {
+ return linkTypeService.deleteLink(linkType);
+ } catch (PLException e) {
+ BaseResult objectBaseResult = new BaseResult<>();
+ objectBaseResult.setCode(Integer.parseInt(e.code));
+ objectBaseResult.setMsg(Arrays.toString(e.messages));
+ return objectBaseResult;
+ }
+ }
+
+ /**
+ * 涓�鑷存�ф鏌�
+ * @return 鍒犻櫎缁撴灉
+ */
+ @GetMapping("/checkLinkType")
+ public BaseResult checkLinkType(){
+ try {
+ return linkTypeService.checkLinkType();
+ } catch (PLException e) {
+ BaseResult objectBaseResult = new BaseResult<>();
+ objectBaseResult.setCode(Integer.parseInt(e.code));
+ objectBaseResult.setMsg(Arrays.toString(e.messages));
+ return objectBaseResult;
+ }
+ }
+
+ /**
+ * 涓�鑷存�ф鏌ヤ慨澶嶆暟鎹簱琛�
+ * repairData 闇�瑕佷慨澶嶇殑鏁版嵁
+ * @return 淇缁撴灉
+ */
+ @PostMapping("/repairTable")
+ public BaseResult repairTable(@RequestBody String repairData){
+ try {
+ return linkTypeService.repairTable(repairData);
+ } catch (PLException e) {
+ BaseResult objectBaseResult = new BaseResult<>();
+ objectBaseResult.setCode(Integer.parseInt(e.code));
+ objectBaseResult.setMsg(Arrays.toString(e.messages));
+ return objectBaseResult;
+ } catch (IOException e) {
+ BaseResult objectBaseResult = new BaseResult<>();
+ objectBaseResult.setCode(500);
+ objectBaseResult.setMsg(e.getMessage());
+ return objectBaseResult;
+ }
+ }
+
+ /**
+ * 鍒涘缓瑙嗗浘
+ * @return 鍒涘缓缁撴灉
+ */
+ @PostMapping("/createView")
+ public BaseResult createView(){
+ try {
+ return linkTypeService.createView();
+ } catch (PLException e) {
+ BaseResult objectBaseResult = new BaseResult<>();
+ objectBaseResult.setCode(Integer.parseInt(e.code));
+ objectBaseResult.setMsg(Arrays.toString(e.messages));
+ return objectBaseResult;
+ }
+ }
}
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsLinkTypeServiceI.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsLinkTypeServiceI.java
index fd64b1b..0fae7cb 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsLinkTypeServiceI.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsLinkTypeServiceI.java
@@ -9,6 +9,7 @@
import com.vci.pagemodel.OsLinkTypeAttributeVO;
import com.vci.pagemodel.OsLinkTypeVO;
+import java.io.IOException;
import java.util.Collection;
import java.util.List;
import java.util.Map;
@@ -122,4 +123,26 @@
* @return 淇濆瓨缁撴灉
*/
BaseResult addAndEditLink(LinkType linkType, Boolean addFlag) throws PLException;
+ /**
+ * 閾炬帴绫诲瀷鍒犻櫎
+ * linkType 閾炬帴绫诲瀷瀵硅薄
+ * @return 鍒犻櫎缁撴灉
+ */
+ BaseResult deleteLink(LinkType linkType) throws PLException;
+ /**
+ * 涓�鑷存�ф鏌�
+ * @return 鍒犻櫎缁撴灉
+ */
+ BaseResult checkLinkType() throws PLException;
+ /**
+ * 涓�鑷存�ф鏌ヤ慨澶嶆暟鎹簱琛�
+ * repairData 闇�瑕佷慨澶嶇殑鏁版嵁
+ * @return 淇缁撴灉
+ */
+ BaseResult repairTable(String repairData) throws PLException, IOException;
+ /**
+ * 鍒涘缓瑙嗗浘
+ * @return 鍒涘缓缁撴灉
+ */
+ BaseResult createView() throws PLException;
}
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java
index d785735..8b2cf40 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java
@@ -1,7 +1,10 @@
package com.vci.web.service.impl;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
import com.vci.corba.common.PLException;
import com.vci.corba.omd.atm.AttributeDef;
+import com.vci.corba.omd.btm.BizType;
import com.vci.corba.omd.data.BusinessObject;
import com.vci.corba.omd.ltm.LinkType;
import com.vci.omd.utils.ObjectTool;
@@ -26,6 +29,7 @@
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
+import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
@@ -369,6 +373,236 @@
platformClientUtil.getLinkTypeService().modifyLinkType(linkType);
return BaseResult.success(null,"淇濆瓨鎴愬姛锛�");
}
+ /**
+ * 閾炬帴绫诲瀷鍒犻櫎
+ * linkType 閾炬帴绫诲瀷瀵硅薄
+ * @return 鍒犻櫎缁撴灉
+ */
+ @Override
+ public BaseResult deleteLink(LinkType linkType) throws PLException {
+ if(platformClientUtil.getLinkTypeService().hasData(linkType.name)){
+ throw new PLException("500",new String[] {"绫诲瀷宸叉湁瀹炰緥, 涓嶈繘琛屽垹闄ゆ搷浣�"});
+ }
+ boolean flag = platformClientUtil.getLinkTypeService().deleteLinkType(linkType);
+ if(!flag){
+ throw new PLException("500",new String[] {"鍒犻櫎澶辫触"});
+ }else{
+ return BaseResult.success();
+ }
+ }
+ /**
+ * 涓�鑷存�ф鏌�
+ * @return 鍒犻櫎缁撴灉
+ */
+ @Override
+ public BaseResult checkLinkType() throws PLException {
+ String[] result = platformClientUtil.getLinkTypeService().linkTypeConsistencyCheck();
+ Map<String, String> dbCheckMap = new HashMap<String, String>();
+ for(int i = 0; i < result.length; i++){
+ String info = result[i];
+ if(info.equals("")){
+ continue;
+ }
+ String[] infos = info.split("/DML");
+ String typeName = infos[0];
+ String dml = infos[1];
+ dbCheckMap.put(typeName, dml);
+ }
+ Map<String, List<String>> btmCheckMap = usedBtmCheck();
+ if(dbCheckMap.size() < 1 && (btmCheckMap == null || btmCheckMap.size() < 1)){
+ return BaseResult.successMsg("鏁版嵁搴撲腑鐨勮〃缁撴瀯涓庣被鍨嬩竴鑷�, 閾炬帴绫诲瀷寮曠敤鐨勪笟鍔$被鍨嬪叏閮ㄦ纭瓨鍦�,鏃犻渶淇!!");
+ }else{
+ Map<String,Object> returnData = new HashMap<>();
+ returnData.put("dbCheckMap",dbCheckMap);
+ returnData.put("btmCheckMap",btmCheckMap);
+ List<Map> list = new ArrayList<>();
+ list.add(returnData);
+ return BaseResult.dataList(500,list,"闇�瑕佽繘琛屽垪鐨勪慨澶嶏紒锛�");
+ }
+ }
+
+ /**
+ * 涓�鑷存�ф鏌ヤ慨澶嶆暟鎹簱琛�
+ * repairData 闇�瑕佷慨澶嶇殑鏁版嵁
+ * @return 淇缁撴灉
+ */
+ @Override
+ public BaseResult repairTable(String repairData) throws PLException, IOException {
+ Map<String, Object> map = new ObjectMapper().readValue(repairData, new TypeReference<Map<String,Object>>(){});
+ HashMap<String,Object> dbCheckMap = (HashMap<String, Object>) map.get("dbCheckMap");
+ HashMap<String,List<String>> btmCheckMap = (HashMap<String, List<String>>) map.get("btmCheckMap");
+ List returnList = new ArrayList<>();
+ Map returnMap = new HashMap();
+ if(dbCheckMap.size() > 0){
+ List<String> list = getRepairDML(dbCheckMap);
+ if(list.size() < 1){
+ return BaseResult.success();
+ }
+ String[] result = platformClientUtil.getLinkTypeService().executeRepair(list.toArray(new String[0]));
+ List<String> resultList = Arrays.asList(result);
+ for (String typeName : resultList) {
+ if(dbCheckMap.containsKey(typeName)){
+ dbCheckMap.remove(typeName);
+ }else if(dbCheckMap.containsKey(typeName + "_ADD")){
+ String sql = String.valueOf(dbCheckMap.get(typeName));
+ sql = sql.substring(sql.indexOf(";") + 1, sql.length());
+ dbCheckMap.put(typeName, sql);
+ }else if(dbCheckMap.containsKey(typeName + "_DROP")){
+ String sql = String.valueOf(dbCheckMap.get(typeName));
+ sql = sql.substring(0, sql.indexOf(";"));
+ dbCheckMap.put(typeName, sql);
+ }
+ }
+ if(!dbCheckMap.isEmpty()){
+ returnMap.put("dbCheckMap",dbCheckMap);
+ }
+ }
+
+ if(btmCheckMap.size() > 0){
+ List<String> result = repairXml(btmCheckMap);
+ for(int i = 0; i < result.size(); i++){
+ String typeName = result.get(i);
+ if(btmCheckMap.containsKey(typeName)){
+ btmCheckMap.remove(typeName);
+ }
+ }
+ if(!btmCheckMap.isEmpty()){
+ returnMap.put("btmCheckMap",btmCheckMap);
+ }
+ }
+ returnList.add(returnMap);
+ return BaseResult.success(returnList);
+ }
+ /**
+ * 鍒涘缓瑙嗗浘
+ * @return 鍒涘缓缁撴灉
+ */
+ @Override
+ public BaseResult createView() throws PLException {
+ boolean f = platformClientUtil.getLinkTypeService().createView();
+ if(f){
+ return BaseResult.success("鍒涘缓瑙嗗浘鎴愬姛");
+ }else{
+ return BaseResult.success("鍒涘缓瑙嗗浘澶辫触");
+ }
+ }
+
+
+ /**
+ * 淇閾炬帴绫诲瀷鐨剎ml鏂囦欢
+ * @return
+ */
+ private List<String> repairXml(HashMap<String, List<String>> btmCheckMap){
+ List<String> result = new ArrayList<String>();
+ for(Iterator<String> ite = btmCheckMap.keySet().iterator(); ite.hasNext();){
+ String linkName = ite.next();
+ List<String> list = btmCheckMap.get(linkName);
+ LinkType link = null;
+ try {
+ link = platformClientUtil.getLinkTypeService().getLinkType(linkName);
+ } catch (PLException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ continue;
+ }
+ //灏唋ist涓寘鍚殑F_btm绉婚櫎, 閲嶆柊璁剧疆btmItemsFrom
+ String[] btms_ = link.btmItemsFrom;
+ List<String> btms = new ArrayList<String>();
+ for(int i = 0; i < btms_.length; i++){
+ if(!list.contains("F_" + btms_[i])){
+ btms.add(btms_[i]);
+ }else{
+ if(link.primitivesFrom.equals(btms_[i])){
+ link.primitivesFrom = "";
+ }
+ }
+ }
+ link.btmItemsFrom = btms.toArray(new String[0]);
+
+ //灏唋ist涓寘鍚殑T_btm绉婚櫎, 閲嶆柊璁剧疆btmItemsTo
+ btms_ = link.btmItemsTo;
+ btms = new ArrayList<String>();
+ for(int i = 0; i < btms_.length; i++){
+ if(!list.contains("T_" + btms_[i])){
+ btms.add(btms_[i]);
+ }else{
+ if(link.primitivesTo.equals(btms_[i])){
+ link.primitivesTo = "";
+ }
+ }
+ }
+ link.btmItemsTo = btms.toArray(new String[0]);
+ link.id = link.name;
+ try {
+ if(platformClientUtil.getLinkTypeService().modifyLinkType(link)){
+ result.add(linkName);
+ }
+ } catch (PLException e) {
+ e.printStackTrace();
+ }
+ }
+ return result;
+ }
+ /**
+ * 鑾峰彇闇�瑕佷慨澶嶇殑浼猻ql
+ * @return
+ */
+ private List<String> getRepairDML(HashMap<String, Object> dbCheckMap) {
+ List<String> list = new ArrayList<String>();
+ for(Iterator<String> ite = dbCheckMap.keySet().iterator(); ite.hasNext();){
+ String type = ite.next();
+ String dml = String.valueOf(dbCheckMap.get(type));
+ list.add(type + "/DML" + dml);
+ }
+ return list;
+ }
+ /**
+ * 妫�鏌ユ墍鏈夌殑閾炬帴绫诲瀷, 褰撻摼鎺ョ被鍨嬩腑寮曠敤鐨勪笟鍔$被鍨嬪凡缁忎笉瀛樺湪鏃�, 鍒犻櫎璇ラ摼鎺ョ被鍨嬩腑瀵逛笟鍔$被鍨嬬殑寮曠敤
+ * @return
+ */
+ private Map<String, List<String>> usedBtmCheck(){
+ try {
+ Map<String, List<String>> map = new HashMap<String, List<String>>();
+ LinkType[] links = platformClientUtil.getLinkTypeService().getLinkTypes();
+ for(int i = 0; i < links.length; i++){
+ LinkType link = links[i];
+ String[] btms = link.btmItemsFrom;
+ for(int k = 0; k < btms.length; k++){
+ String btmName = btms[k];
+ BizType btm = platformClientUtil.getBtmService().getBizTypeByName(btmName);
+ if(btm == null || btm.name.equals("")){
+ List<String> list = map.get(link.name);
+ if(list == null){
+ list = new ArrayList<String>();
+ list.add("F_" + btmName);
+ }else{
+ list.add("F_" + btmName);
+ }
+ map.put(link.name, list);
+ }
+ }
+ btms = link.btmItemsTo;
+ for(int k = 0; k < btms.length; k++){
+ String btmName = btms[k];
+ BizType btm = platformClientUtil.getBtmService().getBizTypeByName(btmName);
+ if(btm == null || btm.name.equals("")){
+ List<String> list = map.get(link.name);
+ if(list == null){
+ list = new ArrayList<String>();
+ list.add("T_" + btmName);
+ }else{
+ list.add("T_" + btmName);
+ }
+ map.put(link.name, list);
+ }
+ }
+ }
+ return map;
+ } catch (PLException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
/**
diff --git a/Source/plt-web/plt-web-ui/src/api/modeling/attributePool/api.js b/Source/plt-web/plt-web-ui/src/api/modeling/attributePool/api.js
index 3a10e9c..1a9549c 100644
--- a/Source/plt-web/plt-web-ui/src/api/modeling/attributePool/api.js
+++ b/Source/plt-web/plt-web-ui/src/api/modeling/attributePool/api.js
@@ -12,3 +12,39 @@
}
});
}
+
+// // 鍒涘缓
+// export function gridAttribute(params) {
+// return request({
+// url: "/api/attributeController/gridAttribute",
+// method: "post",
+// params
+// });
+// }
+
+// 鍒犻櫎
+export function deleteAttributes(params) {
+ return request({
+ url: "/api/attributeController/deleteAttributes",
+ method: "delete",
+ data:params
+ });
+}
+
+// 鏌ョ湅搴旂敤鑼冨洿
+export function getUsedAttributeList(params) {
+ return request({
+ url: "/api/attributeController/getUsedAttributeList",
+ method: "get",
+ params:params
+ });
+}
+
+// 鏋氫妇绫诲瀷閫夋嫨妗嗘煡璇�
+export function getEnumMapByType(params) {
+ return request({
+ url: "/api/webEnumController/getEnumMapByType",
+ method: "get",
+ params:params
+ });
+}
diff --git a/Source/plt-web/plt-web-ui/src/api/modeling/linkType/api.js b/Source/plt-web/plt-web-ui/src/api/modeling/linkType/api.js
new file mode 100644
index 0000000..9ee39f9
--- /dev/null
+++ b/Source/plt-web/plt-web-ui/src/api/modeling/linkType/api.js
@@ -0,0 +1,18 @@
+import request from '@/router/axios';
+
+// 鍒楄〃鏌ヨ
+export function gridLink() {
+ return request({
+ url: "/api/linkTypeController/gridLink",
+ method: "get",
+ });
+}
+
+// 閫氳繃灞炴�ф睜杩斿洖鐨� attributes 鑾峰彇瀹屾暣鐨勪俊鎭�
+export function getByAttributeNames(params) {
+ return request({
+ url: "/api/attributeController/getByAttributeNames",
+ method: "get",
+ params
+ });
+}
diff --git a/Source/plt-web/plt-web-ui/src/util/basic-option.js b/Source/plt-web/plt-web-ui/src/util/basic-option.js
index 1c2b03c..e34e741 100644
--- a/Source/plt-web/plt-web-ui/src/util/basic-option.js
+++ b/Source/plt-web/plt-web-ui/src/util/basic-option.js
@@ -9,6 +9,7 @@
stripe:true,
headerAlign: 'center',
align: 'center',
+ emptyText: '鏆傛棤鍐呭',
// selection 鏄惁鏈夐�夋嫨妗�
// indexFixed:true/left/right, 鍥哄畾鍒�
// menu:false, 鏄惁鏈夋搷浣滄爮
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 871f037..1220e90 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
@@ -35,109 +35,370 @@
<el-aside width="30%">
<basic-container>
- <div style="height: 85vh; overflow-y: auto">
- <el-descriptions :column="1" border size="medium" title="灞炴�ч」">
- <el-descriptions-item>
- <template slot="label">
- 鍚嶇О
- </template>
- 鍚嶇О
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label">
- 鏍囩
- </template>
- 鏍囩
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label">
- 鎻忚堪
- </template>
- 鎻忚堪
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label">
- 鎿嶄綔绫诲瀷
- </template>
- 鎿嶄綔绫诲瀷
- </el-descriptions-item>
- </el-descriptions>
+ <div style="height: 85vh; overflow-y: auto">
+ <el-descriptions :column="1" border size="medium" title="灞炴�ч」">
+ <el-descriptions-item>
+ <template slot="label">
+ 鍚嶇О
+ </template>
+ {{ lastItem.id }}
+ </el-descriptions-item>
+ <el-descriptions-item>
+ <template slot="label">
+ 鏍囩
+ </template>
+ {{ lastItem.name }}
+ </el-descriptions-item>
+ <el-descriptions-item>
+ <template slot="label">
+ 鎻忚堪
+ </template>
+ {{ lastItem.description }}
+ </el-descriptions-item>
+ <el-descriptions-item>
+ <template slot="label">
+ 鎿嶄綔绫诲瀷
+ </template>
+ {{ lastItem.attributeDataType }}
+ </el-descriptions-item>
+ </el-descriptions>
- <el-descriptions :column="1" border class="margin-top" size="medium" title="VTString">
- <el-descriptions-item>
- <template slot="label">
- 鍏佽涓虹┖
- </template>
- <el-tag type="success">鏄�</el-tag>
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label">
- 绮惧害
- </template>
- 绮惧害
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label">
- 闀垮害
- </template>
- 闀垮害
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label">
- 榛樿鍊�
- </template>
- 榛樿鍊�
- </el-descriptions-item>
- </el-descriptions>
+ <!-- 鍊煎煙 -->
+ <el-descriptions v-if="!isSpecialDataType" :column="1" :title="lastItem.attributeDataType" border
+ class="margin-top"
+ size="medium">
+ <el-descriptions-item>
+ <template slot="label">
+ 鍏佽涓虹┖
+ </template>
+ <el-tag :type="lastItem.nullableFlag ? 'success' : 'danger'">
+ {{ lastItem.nullableFlag ? '鏄�' : '鍚�' }}
+ </el-tag>
+ </el-descriptions-item>
+ <el-descriptions-item v-if="accuracy">
+ <template slot="label">
+ 绮惧害
+ </template>
+ 绮惧害
+ </el-descriptions-item>
+ <el-descriptions-item v-if="length">
+ <template slot="label">
+ 闀垮害
+ </template>
+ {{ lastItem.attrLength }}
+ </el-descriptions-item>
+ <el-descriptions-item>
+ <template slot="label">
+ 榛樿鍊�
+ </template>
+ {{ lastItem.defaultValue }}
+ </el-descriptions-item>
+ </el-descriptions>
- <el-descriptions :column="1" border class="margin-top" size="medium" title="鍊煎煙">
- <el-descriptions-item>
- <template slot="label">
- 褰撳墠绫诲瀷
- </template>
- 涓氬姟绫诲瀷
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label">
- 褰撳墠绫诲瀷鍊�
- </template>
+ <!-- VTString -->
+ <el-descriptions v-if="lastItem.attributeDataType === 'VTString' || !lastItem.attributeDataType"
+ :column="1" border class="margin-top" size="medium" title="鍊煎煙">
+ <el-descriptions-item>
+ <template slot="label">
+ 褰撳墠绫诲瀷
+ </template>
+ {{ lastItem.version ? '閾炬帴绫诲瀷' : '涓氬姟绫诲瀷' }}
+ </el-descriptions-item>
+ <el-descriptions-item>
+ <template slot="label">
+ 褰撳墠绫诲瀷鍊�
+ </template>
+ {{ lastItem.version ? lastItem.linkTypeName : lastItem.btmTypeId }}
+ </el-descriptions-item>
+ <el-descriptions-item v-if="lastItem.version">
+ <template slot="label">
+ 褰撳墠鐗堟湰娆�
+ </template>
+ {{ lastItem.version }}
+ </el-descriptions-item>
+ <el-descriptions-item>
+ <template slot="label">
+ 浣跨敤鏋氫妇
+ </template>
+ <el-tag :type="lastItem.enumId ? 'success' : 'danger'">
+ {{ lastItem.enumId ? '鏄�' : '鍚�' }}
+ </el-tag>
+ </el-descriptions-item>
+ <el-descriptions-item>
+ <template slot="label">
+ 鏋氫妇绫诲瀷
+ </template>
+ {{ lastItem.enumId }}
+ </el-descriptions-item>
+ <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-descriptions-item>
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label">
- 褰撳墠鐗堟湰娆�
- </template>
+ </el-descriptions>
+ <!-- VTInteger && VTInteger -->
+ <el-descriptions
+ v-if="lastItem.attributeDataType === 'VTInteger' || lastItem.attributeDataType === 'VTInteger'"
+ :column="1" border class="margin-top" size="medium" title="鍊煎煙">
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label">
- 浣跨敤鏋氫妇
- </template>
- <el-tag type="success">鏄�</el-tag>
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label">
- 鏋氫妇绫诲瀷
- </template>
- 鏋氫妇绫诲瀷
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label">
- 鏋氫妇鍊�
- </template>
+ <el-descriptions-item>
+ <template slot="label">
+ 浣跨敤鏋氫妇
+ </template>
+ <el-tag :type="lastItem.enumId ? 'success' : 'danger'">
+ {{ lastItem.enumId ? '鏄�' : '鍚�' }}
+ </el-tag>
+ </el-descriptions-item>
+ <el-descriptions-item>
+ <template slot="label">
+ 鏋氫妇绫诲瀷
+ </template>
+ {{ lastItem.enumId }}
+ </el-descriptions-item>
+ <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-descriptions-item>
- </el-descriptions-item>
+ </el-descriptions>
+ <!-- VTDouble -->
+ <el-descriptions v-if="lastItem.attributeDataType === 'VTDouble'"
+ :column="1" border class="margin-top" size="medium" title="鍊煎煙">
- </el-descriptions>
+ <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-descriptions-item>
- </div>
+ </el-descriptions>
+ <!-- VTDate VTTime VTDateTime VTNote VTFilePath VTClob鍧囦笉鏄剧ず VTBoolean涓嶆樉绀哄�煎煙 鍙樉绀虹被鍨� -->
+ </div>
</basic-container>
</el-aside>
+
+ <!-- 鏌ョ湅浣跨敤鑼冨洿 -->
+ <el-dialog
+ v-dialogDrag
+ v-loading="checkViewLoading"
+ :visible.sync="checkViewVisible"
+ append-to-body="true"
+ class="avue-dialog"
+ title="鏌ョ湅浣跨敤鑼冨洿"
+ width="70%"
+ >
+ <avue-crud
+ ref="checkViewCrud"
+ :data="checkViewData"
+ :option="checkViewOption"
+ @search-change="checkHandleSearch"
+ @search-reset="checkHandleReset"
+ >
+
+ </avue-crud>
+ </el-dialog>
+
+ <!-- 鏂板瀵硅瘽妗� -->
+ <el-dialog
+ v-dialogDrag
+ v-loading="addLoading"
+ :visible.sync="addVisible"
+ append-to-body="true"
+ class="avue-dialog"
+ title="鍒涘缓"
+ width="65%"
+ >
+ <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+ <el-row>
+ <div class="addDialog">
+ <div>
+
+ <h3>灞炴�ч」</h3>
+
+ <el-col :span="12">
+ <el-form-item label="鍚嶇О锛�" prop="id">
+ <el-input v-model="form.id"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鏍囩锛�">
+ <el-input v-model="form.name"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="灞炴�х被鍨嬶細">
+ <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="12">
+ <el-form-item label="鎻忚堪锛�">
+ <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="闀垮害锛�">
+ <el-input v-model="form.attrLength"></el-input>
+ </el-form-item>
+
+ <el-form-item v-if="form.attributeDataType === 'VTDouble'" label="绮惧害锛�">
+ <el-input v-model="form.precisionLength"></el-input>
+ </el-form-item>
+
+ <el-form-item v-if="form.attributeDataType === 'VTDouble'" label="闀垮害锛�">
+ <el-input v-model="form.scaleLength"></el-input>
+ </el-form-item>
+
+
+ <el-form-item v-if="form.attributeDataType !== 'VTBoolean'" label="榛樿鍊硷細">
+ <el-input v-model="form.defaultValue"></el-input>
+ </el-form-item>
+
+ <el-form-item v-if="form.attributeDataType === 'VTBoolean'" label="榛樿鍊硷細">
+ <el-select>
+ <el-option label="false" value="false"></el-option>
+ <el-option label="true" value="true"></el-option>
+ </el-select>
+ </el-form-item>
+
+ <el-form-item label="鍏佽涓虹┖锛�">
+ <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-form-item label="褰撳墠鍊煎煙绫诲瀷锛�">
+ <el-select v-model="form.attributeSelectType" placeholder="璇烽�夋嫨灞炴�х被鍨�" @change="attributeSelectTypeChange">
+ <el-option label="涓氬姟绫诲瀷" value="business"></el-option>
+ <el-option label="閾炬帴绫诲瀷" value="link"></el-option>
+ </el-select>
+ </el-form-item>
+
+
+ <el-form-item label="閫夋嫨鍙傜収绫诲瀷锛�">
+ <el-input v-model="form.attrLength"></el-input>
+ </el-form-item>
+
+
+ <el-form-item label="浣跨敤鏋氫妇锛�">
+ <el-switch v-model="form.enumSwitch" @change="switchEnumChange"></el-switch>
+ </el-form-item>
+
+
+ <el-form-item :label="form.enumSwitch ? '鏋氫妇閫夋嫨锛�' : '娣诲姞鏋氫妇鍊硷細'">
+ <el-select v-if="form.enumSwitch" v-model="form.attributeDataTypePick" 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="褰撳墠鏋氫妇鍊硷細">
+ <textarea v-model="form.range"
+ style="width: 330px; height: 80px; border: 1px solid #DCDFE6; overflow: auto; text-align: left;resize: none;">
+ </textarea>
+ </el-form-item>
+ </div>
+ <!-- VTInteger VTLong -->
+ <div v-if="form.attributeDataType === 'VTInteger' || form.attributeDataType === 'VTLong' " class="right">
+ <h3>鍊煎煙</h3>
+
+ <el-form-item label="浣跨敤鏋氫妇锛�">
+ <el-switch v-model="form.enumSwitch" @change="switchEnumChange"></el-switch>
+ </el-form-item>
+
+
+ <el-form-item :label="form.enumSwitch ? '鏋氫妇閫夋嫨锛�' : '娣诲姞鏋氫妇鍊硷細'">
+ <el-select v-if="form.enumSwitch" v-model="form.attributeDataTypePick" 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"> ></el-button>
+ <el-button size="mini"> <</el-button>
+ <el-button size="mini"> >=</el-button>
+ <el-button size="mini"> <=</el-button>
+ <el-button size="mini"> =</el-button>
+ <el-button size="mini"> !=</el-button>
+ <el-button size="mini"> ( )</el-button>
+ </div>
+ </el-form-item>
+ <el-form-item label="褰撳墠鏋氫妇鍊硷細">
+ <textarea v-model="form.range"
+ style="width: 330px; height: 80px; border: 1px solid #DCDFE6; overflow: auto; text-align: left;resize: none;">
+ </textarea>
+ </el-form-item>
+ </div>
+ <!-- VTDouble -->
+ <div v-if="form.attributeDataType === 'VTDouble'" class="right">
+ <h3>鍊煎煙</h3>
+
+
+ <el-form-item label="娣诲姞鏋氫妇鍊硷細">
+ <el-input v-model="form.enumAddValue">
+ </el-input>
+ </el-form-item>
+ <el-form-item label="杩愮畻绗︼細">
+ <div>
+ <el-button size="mini"> ></el-button>
+ <el-button size="mini"> <</el-button>
+ <el-button size="mini"> >=</el-button>
+ <el-button size="mini"> <=</el-button>
+ <el-button size="mini"> =</el-button>
+ <el-button size="mini"> !=</el-button>
+ <el-button size="mini"> ( )</el-button>
+ </div>
+ </el-form-item>
+ <el-form-item label="褰撳墠鏋氫妇鍊硷細">
+ <textarea v-model="form.range"
+ style="width: 330px; height: 80px; border: 1px solid #DCDFE6; overflow: auto; text-align: left;resize: none;">
+ </textarea>
+ </el-form-item>
+ </div>
+ </div>
+ </div>
+ </el-row>
+ </el-form>
+ </el-dialog>
</el-container>
</template>
<script>
-import {gridAttribute} from "@/api/modeling/attributePool/api";
+import {gridAttribute, getUsedAttributeList, getEnumMapByType} from "@/api/modeling/attributePool/api";
import basicOption from '@/util/basic-option';
import {column} from "./option"
@@ -163,7 +424,100 @@
pageSizes: [10, 30, 50, 100],
},
searchParams: {},
- selectList: []
+ selectList: [],
+ checkViewData: [],
+ checkViewDataSearch: [],
+ checkViewVisible: false,
+ checkViewLoading: false,
+ checkViewOption: {
+ ...basicOption,
+ addBtn: false,
+ menu: false,
+ searchMenuSpan: 8,
+ refreshBtn: false,
+ selection: false,
+ column: [
+ {
+ label: '鍚嶇О',
+ prop: 'attributeName',
+ sortable: true,
+ },
+ {
+ label: '鏉ユ簮',
+ prop: 'source',
+ sortable: true,
+ search: true
+ },
+ {
+ label: '璇存槑',
+ prop: 'desc',
+ }
+ ]
+ },
+ addVisible: false,
+ addLoading: false,
+ form: {
+ id: "",
+ name: "",
+ attributeDataType: "VTString",
+ description: "",
+ nullableFlag: true,
+ attrLength: 50,
+ enumId: false,
+ enumSwitch: false,
+ attributeDataTypePick: "",
+ enumAddValue: '',
+ range: ''
+ },
+ defaultForm: {
+ id: "",
+ name: "",
+ attributeDataType: "VTString",
+ description: "",
+ nullableFlag: true,
+ attrLength: 50,
+ enumId: false,
+ enumSwitch: false,
+ attributeDataTypePick: "",
+ enumAddValue: '',
+ range: '',
+ attributeSelectType:'business'
+ },
+ rules: [],
+ typeSelectList: ['VTString', 'VTInteger', 'VTLong', 'VTDouble', 'VTBoolean', 'VTDate', 'VTTime', 'VTDateTime', 'VTNote', 'VTFilePath', 'VTClob'],
+ attributeDataTypePickList: [],
+ enumAddListChange: []
+ }
+ },
+ computed: {
+ lastItem() {
+ return this.selectList.length > 0 ? this.selectList[this.selectList.length - 1] : {};
+ },
+ isSpecialDataType() {
+ // 瀹氫箟涓�涓寘鍚墍鏈夐渶瑕佹瘮杈冪殑绫诲瀷鐨勬暟缁�
+ const specialTypes = ['VTDate', 'VTTime', 'VTDateTime', 'VTNote', 'VTFilePath', 'VTClob'];
+ // 鍒ゆ柇 lastItem.attributeDataType 鏄惁鍦ㄨ繖涓暟缁勪腑
+ return specialTypes.includes(this.lastItem.attributeDataType);
+ },
+ rangeList() {
+ if (this.lastItem.range) {
+ return this.lastItem.range.split(';');
+ }
+ },
+ accuracy() {
+ return this.lastItem.attributeDataType === 'VTDouble';
+ },
+ length() {
+ return this.lastItem.attributeDataType === 'VTString' || this.lastItem.attributeDataType === 'VTDoubule';
+ },
+ // 绛変簬鍏朵腑浠ヤ笅鍊� 涓嶅睍绀烘灇涓�
+ hideType() {
+ return this.form.attributeDataType === 'VTNote' ||
+ this.form.attributeDataType === 'VTDate' ||
+ this.form.attributeDataType === 'VTTime' ||
+ this.form.attributeDataType === 'VTClob' ||
+ this.form.attributeDataType === 'VTDateTime' ||
+ this.form.attributeDataType === 'VTFilePath';
}
},
methods: {
@@ -203,6 +557,7 @@
// 鐐瑰嚮琛�
rowClickHandler(row) {
this.$refs.userCrud.toggleRowSelection(row);
+ console.log(row);
},
// 鏉℃暟
@@ -215,16 +570,60 @@
this.page.currentPage = val;
},
+ // 鍒涘缓鎵撳紑瀵硅瘽妗�
rowSaveHandlerClick() {
+ this.addVisible = true;
+ this.form = this.defaultForm;
+ this.getEnumMapByTypeHandler('VTString');
},
allDelHandler() {
},
+ // 鏌ョ湅浣跨敤鑼冨洿
chekView() {
+ if (this.selectList.length <= 0) {
+ this.$message.warning('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�');
+ return;
+ }
+ if (this.selectList.length > 1) {
+ this.$message.warning('鍙兘閫夋嫨涓�鏉℃暟鎹繘琛屾煡鐪�');
+ return;
+ }
+
+ getUsedAttributeList({attributeName: this.selectList[0].id}).then(res => {
+ if (res.data.code === 200) {
+ this.checkViewVisible = true;
+ this.checkViewData = res.data.data;
+ this.checkViewDataSearch = res.data.data;
+ }
+ })
+ },
+
+ // 鏌ョ湅浣跨敤鑼冨洿鏌ヨ
+ checkHandleSearch(params, done) {
+ const {source} = params;
+
+ if (!params.source) {
+ this.checkViewData = this.checkViewDataSearch;
+ return done();
+ }
+ ;
+
+ this.checkViewData = this.checkViewData.filter(item => {
+ return item.source && item.source.includes(source);
+ });
+
+ done();
},
+
+ // 鏌ョ湅浣跨敤鑼冨洿閲嶇疆
+ checkHandleReset() {
+ this.checkViewData = this.checkViewDataSearch;
+ },
+
editBtnClick() {
@@ -232,13 +631,106 @@
rowDeleteHandler() {
+ },
+
+ // 灞炴�х被鍨嬩笅鎷夋change
+ attributeDataTypeChange(val) {
+ this.getEnumMapByTypeHandler(val);
+ this.form.enumSwitch = false;
+ },
+
+ // 灞炴�х被鍨嬩笅鎷夋鏁版嵁澶勭悊
+ getEnumMapByTypeHandler(val) {
+ const enumType = {
+ VTString: 'String',
+ VTInteger: 'Integer',
+ VTLong: 'Integer',
+ };
+ if (enumType[val]) {
+ const string = enumType[val];
+ getEnumMapByType({enumType: string}).then(res => {
+ const data = res.data.data;
+ this.attributeDataTypePickList = data.flatMap(obj =>
+ Object.entries(obj).map(([key, values]) => ({
+ key: key,
+ values: values
+ }))
+ );
+ })
+ }
+ },
+
+ // 浣跨敤鏋氫妇鏃� 鏋氫妇閫夋嫨涓嬫媺妗哻hange浜嬩欢
+ enumSelectChange(val) {
+ const list = this.attributeDataTypePickList.find(item => item.key === val).values;
+ this.form.range = list.join('\n');
+ },
+
+ // 浣跨敤鏋氫妇switch婊戝潡change浜嬩欢
+ switchEnumChange(status) {
+ if (status) {
+ this.form.attributeDataTypePick = this.attributeDataTypePickList[0].key;
+ const list = this.attributeDataTypePickList[0].values;
+ this.form.range = list.join('\n');
+ } else {
+ this.form.range = "";
+ }
+ },
+
+ // 涓嶄娇鐢ㄦ灇涓� 鎵嬪姩娣诲姞鏋氫妇鍊�
+ enumAddHandler() {
+ // 妫�鏌ュ拰杞崲 this.form.range 涓烘暟缁勶紝鍚屾椂鎺掗櫎绌哄��
+ let currentRangeArray = this.form.range ? this.form.range.split('\n').filter(item => item.trim() !== '') : [];
+
+ let newValue = this.form.enumAddValue.trim();
+ if (currentRangeArray.includes(newValue)) {
+ this.$message.error('璇ュ�煎煙瑙勫垯宸茬粡瀛樺湪锛�')
+ return;
+ }
+
+ currentRangeArray.push(newValue);
+ this.enumAddListChange = currentRangeArray;
+ this.form.range = currentRangeArray.join('\n');
+ this.form.enumAddValue = "";
+ },
+
+ // 鍊煎煙绫诲瀷鍒囨崲
+ attributeSelectTypeChange(){
+
}
}
}
</script>
<style lang="scss" scoped>
-.margin-top{
+.margin-top {
margin-top: 25px;
}
+
+.left {
+ width: 45%;
+ height: 100%;
+ margin-right: 60px;
+}
+
+.right {
+ height: 100%;
+ width: auto;
+ margin-left: 60px;
+}
+
+.addDialogBottom {
+ width: 100%;
+ display: flex;
+ flex-direction: row;
+}
+
+.addDialogBottom > .el-divider--vertical {
+ width: 2px;
+ height: 78%;
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -10%);
+}
</style>
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/linkType/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/linkType/index.vue
index e153ed7..80ea9f4 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/linkType/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/linkType/index.vue
@@ -1,13 +1,290 @@
<template>
- <p>閾炬帴绫诲瀷</p>
+ <el-container>
+ <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">鍒涘缓
+ </el-button>
+ <el-button icon="el-icon-edit" plain size="small" type="primary">淇敼
+ </el-button>
+ <el-button icon="el-icon-delete" plain size="small" type="danger">鍒犻櫎
+ </el-button>
+ <el-button icon="el-icon-view" plain size="small" type="primary">鏌ョ湅
+ </el-button>
+ <el-button icon="el-icon-download" plain size="small" type="primary">瀵煎嚭
+ </el-button>
+ <el-button icon="el-icon-upload2" plain size="small" type="primary">瀵煎叆
+ </el-button>
+ <el-button icon="el-icon-circle-plus-outline" plain size="small"
+ type="primary">鍒涘缓瑙嗗浘
+ </el-button>
+ <el-button icon="el-icon-menu" plain size="small"
+ type="primary">涓�鑷存�ф鏌�
+ </el-button>
+ </div>
+ <!-- 宸︿晶鏍� -->
+ <div style="height: calc(100vh - 300px);">
+ <avue-tree :data="treeData" :option="treeOption" @node-click="nodeClick">
+ <span slot-scope="{ node, data }" class="el-tree-node__label">
+ <span>
+ <i class="el-icon-s-promotion"></i>
+ {{ (node || {}).label }}
+ </span>
+ </span>
+ </avue-tree>
+ </div>
+ </div>
+ </basic-container>
+ </el-aside>
+
+ <el-main>
+ <basic-container>
+ <div>
+ <el-descriptions :column="2" border class="margin-top" size="medium">
+ <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+ :labelStyle="descriptionOption.labelStyle">
+ <template slot="label">
+ <i :class="icons.id"></i>
+ 鍚嶇О
+ </template>
+ {{ nodeRow.name }}
+ </el-descriptions-item>
+ <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+ :labelStyle="descriptionOption.labelStyle">
+ <template slot="label">
+ <i :class="icons.name"></i>
+ 鏍囩
+ </template>
+ {{ nodeRow.tag }}
+ </el-descriptions-item>
+ <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+ :labelStyle="descriptionOption.labelStyle">
+ <template slot="label">
+ <i :class="icons.tableName"></i>
+ 瀹炵幇绫�
+ </template>
+ {{ nodeRow.implClass }}
+ </el-descriptions-item>
+ <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+ :labelStyle="descriptionOption.labelStyle">
+ <template slot="label">
+ <i :class="icons.domain"></i>
+ 褰㈢姸
+ </template>
+ <el-tag v-if="nodeRow.shape" size="small">
+ {{ nodeRow.shape }}
+ </el-tag>
+ </el-descriptions-item>
+ <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+ :labelStyle="descriptionOption.labelStyle">
+ <template slot="label">
+ <i :class="icons.desc"></i>
+ 鎻忚堪
+ </template>
+ {{ nodeRow.description }}
+ </el-descriptions-item>
+ </el-descriptions>
+
+ <el-descriptions :column="3" border class="margin-top" direction="vertical">
+ <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+ :labelStyle="descriptionOption.labelStyle">
+ <template slot="label">
+ <i :class="icons.from"></i>
+ From绔被鍨�
+ </template>
+ <span v-for="item in nodeRow.btmItemsFrom" style="margin-left:2px;">
+ <el-tag effect="plain" size="small" style="margin-top: 2px;">
+ {{ item }}
+ </el-tag>
+ </span>
+ </el-descriptions-item>
+ <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+ :labelStyle="descriptionOption.labelStyle">
+ <template slot="label">
+ <i :class="icons.from"></i>
+ Form绔富绫诲瀷
+ </template>
+ <el-tag v-if="nodeRow.primitivesFrom" effect="plain" size="small">
+ {{ nodeRow.primitivesFrom === '璇烽�夋嫨' ? nodeRow.btmItemsFrom[0] : nodeRow.primitivesFrom }}
+ </el-tag>
+ </el-descriptions-item>
+ <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+ :labelStyle="descriptionOption.labelStyle">
+ <template slot="label">
+ <i :class="icons.from"></i>
+ From绔搴斿叧绯�
+ </template>
+ <el-tag v-if="nodeRow.relationFrom" effect="plain" size="small">{{ nodeRow.relationFrom }}</el-tag>
+ </el-descriptions-item>
+
+ </el-descriptions>
+
+ <el-descriptions :column="3" border class="margin-top" direction="vertical">
+ <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+ :labelStyle="descriptionOption.labelStyle">
+ <template slot="label">
+ <i :class="icons.to"></i>
+ To绔被鍨�
+ </template>
+ <span v-for="item in nodeRow.btmItemsTo" style="margin-left:2px;">
+ <el-tag effect="plain" size="small" style="margin-top: 2px;">
+ {{ item }}
+ </el-tag>
+ </span>
+ </el-descriptions-item>
+ <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+ :labelStyle="descriptionOption.labelStyle">
+ <template slot="label">
+ <i :class="icons.to"></i>
+ To绔富绫诲瀷
+ </template>
+ <el-tag v-if="nodeRow.primitivesTo" effect="plain" size="small">
+ {{ nodeRow.primitivesTo === '璇烽�夋嫨' ? nodeRow.btmItemsTo[0] : nodeRow.primitivesTo }}
+ </el-tag>
+ </el-descriptions-item>
+ <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+ :labelStyle="descriptionOption.labelStyle">
+ <template slot="label">
+ <i :class="icons.to"></i>
+ To绔搴斿叧绯�
+ </template>
+ <el-tag v-if="nodeRow.relationTo" effect="plain" size="small">{{ nodeRow.relationTo }}</el-tag>
+ </el-descriptions-item>
+
+ </el-descriptions>
+ </div>
+ <div style="margin-top: 20px">
+ <h3>灞炴�ф睜鍒楄〃</h3>
+ <avue-crud
+ :data="tableData"
+ :option="tableOption"
+ ></avue-crud>
+ </div>
+ </basic-container>
+ </el-main>
+ </el-container>
</template>
<script>
+import {gridLink} from "@/api/modeling/linkType/api";
+import basicOption from '@/util/basic-option'
+
export default {
- name: "index"
+ name: "index",
+ data() {
+ return {
+ treeOption: {
+ height: 'auto',
+ defaultExpandAll: false,
+ menu: false,
+ addBtn: false,
+ props: {
+ label: 'name',
+ value: 'name',
+ children: 'children'
+ }
+ },
+ treeData: [],
+ tableData: [],
+ tableOption: {
+ ...basicOption,
+ editBtn: false,
+ refreshBtn: false,
+ selection: false,
+ // index:false,
+ column: [
+ {
+ label: '灞炴�у悕',
+ prop: 'attributeName',
+ sortable: true,
+ },
+ {
+ label: '灞炴�х被鍨�',
+ prop: 'source',
+ sortable: true,
+ },
+ {
+ label: '鍒濆鍊�',
+ prop: 'source',
+ sortable: true,
+ },
+ {
+ label: '璇存槑',
+ prop: 'desc',
+ }
+ ]
+ },
+ nodeRow: {},
+ descriptionOption: {
+ labelStyle: 'text-align:center;width:120px',
+ contentStyle: 'width:240px;text-align:center;word-break;break-all;'
+ },
+ icons: {
+ id: 'el-icon-finished',
+ name: 'el-icon-tickets',
+ tableName: 'el-icon-date',
+ domain: 'el-icon-connection',
+ from: 'el-icon-sort-down',
+ to: 'el-icon-sort-up',
+ main: 'el-icon-warning-outline',
+ desc: 'el-icon-chat-line-square'
+ },
+ }
+ },
+ created() {
+ this.getTreeList();
+ },
+ mounted() {
+
+ },
+ methods: {
+ // 鏍憃nLoad璇锋眰
+ getTreeList() {
+ gridLink().then(res => {
+ const data = res.data.data;
+ this.treeData = data;
+ this.tableLoading = false;
+ }).catch(err => {
+ this.$message.error(err)
+ });
+ },
+
+ // 鏍戠偣鍑讳簨浠�
+ nodeClick(row) {
+ console.log(row);
+ this.nodeRow = row;
+ }
+ }
}
</script>
-<style scoped>
+<style lang="scss" scoped>
+::v-deep {
+ .el-scrollbar__wrap {
+ overflow: auto !important;
+ }
+}
+.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;
+}
</style>
--
Gitblit v1.9.3