From 88c5cf35a5ea870378d7964086ed2c09ddc299c8 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期一, 09 九月 2024 17:52:05 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/enumpck/ControlAttributeType.java | 27 ++
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/enumpck/ControlType.java | 33 +++
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/OsAttributeDTO.java | 19 +
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/index.vue | 58 +++++
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/queryDefine/index.vue | 21 +
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue | 40 +++
Source/plt-web/plt-web-ui/src/App.vue | 15 +
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/OsAttributeVO.java | 29 ++
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue | 30 +-
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/enumpck/ItemTypeEnum.java | 84 ++++++++
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsQueryTemplateImpl.java | 4
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java | 193 +++++++++++++++++--
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsAttributeServiceImpl.java | 5
13 files changed, 506 insertions(+), 52 deletions(-)
diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/OsAttributeDTO.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/OsAttributeDTO.java
index 3731204..5232df6 100644
--- a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/OsAttributeDTO.java
+++ b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/OsAttributeDTO.java
@@ -38,6 +38,10 @@
* 灞炴�х被鍨嬶紝浣跨敤鏋氫妇VciFieldTypeEnum
*/
private String attributeDataType;
+ /**
+ * 灞炴�I鎺т欢鏄剧ず绫诲瀷
+ */
+ private String attributeUIType;
/**
* 鏄惁鍙互涓虹┖
@@ -301,6 +305,14 @@
this.scaleLength = scaleLength;
}
+ public String getAttributeUIType() {
+ return attributeUIType;
+ }
+
+ public void setAttributeUIType(String attributeUIType) {
+ this.attributeUIType = attributeUIType;
+ }
+
@Override
public String toString() {
return "OsAttributeDTO{" +
@@ -309,17 +321,24 @@
", name='" + name + '\'' +
", description='" + description + '\'' +
", attributeDataType='" + attributeDataType + '\'' +
+ ", attributeUIType='" + attributeUIType + '\'' +
", nullableFlag=" + nullableFlag +
", defaultValue='" + defaultValue + '\'' +
", enumId='" + enumId + '\'' +
", enumName='" + enumName + '\'' +
", btmTypeId='" + btmTypeId + '\'' +
", btmTypeName='" + btmTypeName + '\'' +
+ ", linkTypeName='" + linkTypeName + '\'' +
+ ", version=" + version +
", attrLength=" + attrLength +
", precisionLength=" + precisionLength +
", scaleLength=" + scaleLength +
", range='" + range + '\'' +
", ts=" + ts +
+ ", creator='" + creator + '\'' +
+ ", createTime=" + createTime +
+ ", lastModifier='" + lastModifier + '\'' +
+ ", lastModifyTime=" + lastModifyTime +
'}';
}
}
diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/OsAttributeVO.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/OsAttributeVO.java
index 1cad6e4..4de3c81 100644
--- a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/OsAttributeVO.java
+++ b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/OsAttributeVO.java
@@ -43,6 +43,14 @@
* 灞炴�х被鍨嬫樉绀烘枃鏈�
*/
private String attributeDataTypeText;
+ /**
+ * 灞炴�I鎺т欢鏄剧ず绫诲瀷
+ */
+ private String attributeUIType;
+ /**
+ * 灞炴�I鎺т欢鏄剧ず绫诲瀷鏂囨湰
+ */
+ private String attributeUITypeText;
/**
* 鏄惁鍙互涓虹┖
@@ -353,6 +361,22 @@
this.scaleLength = scaleLength;
}
+ public String getAttributeUIType() {
+ return attributeUIType;
+ }
+
+ public void setAttributeUIType(String attributeUIType) {
+ this.attributeUIType = attributeUIType;
+ }
+
+ public String getAttributeUITypeText() {
+ return attributeUITypeText;
+ }
+
+ public void setAttributeUITypeText(String attributeUITypeText) {
+ this.attributeUITypeText = attributeUITypeText;
+ }
+
@Override
public String toString() {
return "OsAttributeVO{" +
@@ -362,16 +386,21 @@
", description='" + description + '\'' +
", attributeDataType='" + attributeDataType + '\'' +
", attributeDataTypeText='" + attributeDataTypeText + '\'' +
+ ", attributeUIType='" + attributeUIType + '\'' +
+ ", attributeUITypeText='" + attributeUITypeText + '\'' +
", nullableFlag=" + nullableFlag +
", defaultValue='" + defaultValue + '\'' +
", enumId='" + enumId + '\'' +
", enumName='" + enumName + '\'' +
", btmTypeId='" + btmTypeId + '\'' +
", btmTypeName='" + btmTypeName + '\'' +
+ ", linkTypeName='" + linkTypeName + '\'' +
+ ", version=" + version +
", attrLength=" + attrLength +
", precisionLength=" + precisionLength +
", scaleLength=" + scaleLength +
", range='" + range + '\'' +
+ ", other='" + other + '\'' +
", btmname='" + btmname + '\'' +
", owner='" + owner + '\'' +
", creator='" + creator + '\'' +
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/enumpck/ControlAttributeType.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/enumpck/ControlAttributeType.java
new file mode 100644
index 0000000..7f86ad2
--- /dev/null
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/enumpck/ControlAttributeType.java
@@ -0,0 +1,27 @@
+package com.vci.web.enumpck;
+
+public enum ControlAttributeType {
+
+ VTString,
+ VTInteger,
+ VTLong,
+ VTDouble,
+ VTBoolean,
+ VTImage,
+ VTDate,
+ VTTime,
+ VTDateTime,
+ VTNote,
+ VTFilePath,
+ VTClob,
+ canzhao;
+ public static ControlType Parse(String value) {
+ for (ControlType ct : ControlType.values()) {
+ if (ct.name().equalsIgnoreCase(value)) {
+ return ct;
+ }
+ }
+
+ return null;
+ }
+}
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/enumpck/ControlType.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/enumpck/ControlType.java
new file mode 100644
index 0000000..e011ffd
--- /dev/null
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/enumpck/ControlType.java
@@ -0,0 +1,33 @@
+package com.vci.web.enumpck;
+
+public enum ControlType {
+ Text,
+ TextBtn,
+ TextArea,
+ RichText,
+ Number,
+ Password,
+ Radio,
+ Checkbox,
+ Select,
+ WebEditor,
+ Date,
+ Time,
+ Datetime,
+ Hidden,
+ Customform,
+ File,
+ MultiFile,
+ Custom,
+ UserChoose;
+
+ public static ControlType Parse(String value) {
+ for (ControlType ct : ControlType.values()) {
+ if (ct.name().equalsIgnoreCase(value)) {
+ return ct;
+ }
+ }
+
+ return null;
+ }
+}
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/enumpck/ItemTypeEnum.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/enumpck/ItemTypeEnum.java
index c2ef060..8db2a92 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/enumpck/ItemTypeEnum.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/enumpck/ItemTypeEnum.java
@@ -2,6 +2,7 @@
import com.vci.pagemodel.KeyValue;
import com.vci.starter.web.enumpck.BaseEnum;
+import com.vci.starter.web.enumpck.VciFieldTypeEnum;
import java.util.ArrayList;
import java.util.List;
@@ -141,4 +142,87 @@
}
return enumDataList;
}
+
+ /***
+ *鏍规嵁灞炴�х被鍨嬭幏鍙朥I灞炴�х被鍨�(鏂囨湰)
+ * @param key
+ * @return
+ */
+ public static String convertAttributeTypeTOUITypeTextByValue(String key,boolean isText){
+ String value=ItemTypeEnum.TEXT.getValue();
+ ItemTypeEnum itemTypeEnum=null;
+ if(ControlAttributeType.VTInteger.equals(key)||
+ ControlAttributeType.VTDouble.equals(key)
+ ){
+ value = ItemTypeEnum.NUMBER.getValue();
+ }
+ else if (ControlAttributeType.VTNote.equals(key)) {// textarea绫诲瀷
+ value = ItemTypeEnum.TEXTAREA.getValue();
+ }// 鏃ヨ捣绫诲瀷
+ else if (ControlAttributeType.VTDate.equals(key)) {//鏃ユ湡
+ value = ItemTypeEnum.DATE.getValue();
+ }else if(ControlAttributeType.VTDateTime.equals(key)){//鏃ユ湡鏃堕棿
+ value = ItemTypeEnum.DATETIME.getValue();
+ }else if( ControlAttributeType.VTTime.equals(key)){//鏃堕棿
+ value = ItemTypeEnum.TIME.getValue();
+ }
+ else if( ControlAttributeType.canzhao.equals(key)){//鍙傜収
+ value = ItemTypeEnum.TEXT.getValue();
+ }
+ else if( ControlAttributeType.VTBoolean.equals(key)){//boolean
+ value = ItemTypeEnum.CHECKBOX.getValue();
+ }else if( ControlAttributeType.VTFilePath.equals(key)){//鏂囦欢
+ value = ItemTypeEnum.FILE.getValue();
+ } else {
+ value = ItemTypeEnum.TEXT.getValue();
+ }
+ itemTypeEnum = forValue(value);
+ if(itemTypeEnum==null){
+ return "";
+ }else {
+ if (isText) {
+ value = itemTypeEnum.getText();
+ } else {
+ value = itemTypeEnum.getText();
+ }
+ }
+ return value;
+ }
+
+ /***
+ *鏍规嵁灞炴�х被鍨嬭幏鍙朥I灞炴�х被鍨�(鏂囨湰)
+ * @param key
+ * @return
+ */
+ public static String convertAttributeTypeTOUITypeValueByText(String key){
+ String value=ItemTypeEnum.TEXT.getValue();
+ if(ControlAttributeType.VTInteger.equals(key)||
+ ControlAttributeType.VTDouble.equals(key)
+ ){
+ value = ItemTypeEnum.NUMBER.getValue();
+ }
+ else if (ControlAttributeType.VTNote.equals(key)) {// textarea绫诲瀷
+ value = ItemTypeEnum.TEXTAREA.getValue();
+ }// 鏃ヨ捣绫诲瀷
+ else if (ControlAttributeType.VTDate.equals(key)) {//鏃ユ湡
+ value = ItemTypeEnum.DATE.getValue();
+ }else if(ControlAttributeType.VTDateTime.equals(key)){//鏃ユ湡鏃堕棿
+ value = ItemTypeEnum.DATETIME.getValue();
+ }else if( ControlAttributeType.VTTime.equals(key)){//鏃堕棿
+ value = ItemTypeEnum.TIME.getValue();
+ }
+ else if( ControlAttributeType.canzhao.equals(key)){//鍙傜収
+ value = ItemTypeEnum.TEXT.getValue();
+ }
+ else if( ControlAttributeType.VTBoolean.equals(key)){//boolean
+ value = ItemTypeEnum.CHECKBOX.getValue();
+ }else if( ControlAttributeType.VTFilePath.equals(key)){//鏂囦欢
+ value = ItemTypeEnum.FILE.getValue();
+ } else {
+ value = ItemTypeEnum.TEXT.getValue();
+ }
+ value= getTextByValue(value);
+ return value;
+ }
+
}
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsAttributeServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsAttributeServiceImpl.java
index ec96cc5..038360c 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsAttributeServiceImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsAttributeServiceImpl.java
@@ -28,6 +28,7 @@
import com.vci.starter.web.pagemodel.*;
import com.vci.starter.web.util.*;
import com.vci.model.OsAttributeDO;
+import com.vci.web.enumpck.ItemTypeEnum;
import com.vci.web.enumpck.PortalVITypeFlag;
import com.vci.web.properties.UsedNames;
import com.vci.web.service.OsAttributeServiceI;
@@ -347,6 +348,10 @@
attributeVO.setDescription(attribItem.description);
attributeVO.setAttributeDataType(attribItem.vtDataType);
attributeVO.setAttributeDataTypeText(VciFieldTypeEnum.getTextByValue(attribItem.vtDataType));
+ //鑾峰彇UI灞炴�х被鍨�
+ attributeVO.setAttributeUIType(ItemTypeEnum.convertAttributeTypeTOUITypeTextByValue(attribItem.vtDataType,false));
+ //鑾峰彇UI灞炴�х被鍨嬫枃鏈�
+ attributeVO.setAttributeUITypeText(ItemTypeEnum.convertAttributeTypeTOUITypeTextByValue(attribItem.vtDataType,true));
attributeVO.setDefaultValue(attribItem.defValue);
if(Func.isNotBlank(attribItem.rage)){
attributeVO.setRange(attribItem.rage.replace("<","<"));
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsQueryTemplateImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsQueryTemplateImpl.java
index 2f0e998..1ee2d5f 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsQueryTemplateImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsQueryTemplateImpl.java
@@ -272,6 +272,9 @@
if(att == null || "".equals(att.oid)){
att = allSysAttr.get(column.toLowerCase());
}
+ if(att == null){
+ throw new PLException("500", new String[]{"灞炴�у瓧娈碉細" + column + "鍦ㄥ睘鎬ф睜涓湭鏌ヨ鍒帮紝璇风‘璁わ紒锛�"});
+ }
leafInfoDTO.setClause(leafInfo.getClause());
leafInfoDTO.setOperator(leafInfo.getOperator());
@@ -1476,6 +1479,7 @@
if(!checkInfo.equals("OK")){
throw new PLException("500", new String[]{checkInfo});
}
+ qt.setId(qtInfoDTO.getQtName());
//璁剧疆鎺掑簭淇℃伅
qt.setOrderInfoList(qtInfoDTO.getQueryTemplate().getOrderInfoList());
QTInfo qtWrapper = new QTInfo();
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java
index 137973d..7cff12c 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java
@@ -33,6 +33,7 @@
import lombok.NoArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
@@ -57,6 +58,16 @@
@Resource
private PlatformClientUtil platformClientUtil;
+ /**
+ * 瑙掕壊
+ */
+ @Resource
+ private SmRoleQueryServiceI smRoleQueryServiceI;
+ /***
+ * 鏄惁鏄鐞嗗憳
+ */
+ @Autowired
+ RightControlUtil rightControlUtil;
/**
* 涓氬姟绫诲瀷
*/
@@ -1093,6 +1104,12 @@
return treeList;
}
+ /***
+ * UI鎺堟潈
+ * @param uiAuthorDTO
+ * @return
+ * @throws Exception
+ */
@Override
public boolean authorizedUI(UIAuthorDTO uiAuthorDTO) throws Exception {
boolean res=false;
@@ -1108,41 +1125,41 @@
treeQueryObject.setConditionMap(conditionMap);
List<Tree> treeList=this.getUIAuthor(treeQueryObject);
HashMap<String,Tree> allTreeMap=new HashMap<>();
+ Map<String,RoleRightVO> roleRightVOMap=new HashMap<>();
if(!CollectionUtil.isEmpty(treeList)){
+ if(StringUtils.isNotBlank(uiAuthorDTO.getRoleId())){
+ String userName= WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId();
+ RoleRightInfo[] rightInfos= platformClientUtil.getFrameworkService().getRoleRightList(uiAuthorDTO.getRoleId(),userName);
+ List<RoleRightVO> roleRightVOList=roleRightDOO2VOS(Arrays.asList(rightInfos));
+ roleRightVOMap=roleRightVOList.stream().collect(Collectors.toMap(RoleRightVO::getFuncId,roleRightVO ->roleRightVO));
+ }
convertTreeDOO2Map(treeList,allTreeMap);
List<RoleRightDTO> roleRightDTOList=new ArrayList<>();
List<Tree> selectTreeList= uiAuthorDTO.getSelectTreeList();
- getRoleRightDTOS(uiAuthorDTO.getRoleId(),selectTreeList,allTreeMap,roleRightDTOList);
+ getSelectedRoleRightObjs(uiAuthorDTO.getRoleId(),selectTreeList,allTreeMap,roleRightDTOList);
}
return res;
}
- private void getRoleRightDTOS(String roleOid,List<Tree> selectTreeList,HashMap<String,Tree> allTreeMap, List<RoleRightDTO> roleRightDTOList){
+ /**
+ *
+ * @param roleOid
+ * @param selectTreeList
+ * @param allTreeMap
+ * @param roleRightDTOList
+ */
+ private void getSelectedRoleRightObjs(String roleOid,List<Tree> selectTreeList,HashMap<String,Tree> allTreeMap, List<RoleRightDTO> roleRightDTOList){
+ Date date=new Date();
+ Map<String,RoleRightDTO> roleRightDTOMap=new HashMap<>();
selectTreeList.stream().forEach(tree -> {
RoleRightDTO roleRightDTO=new RoleRightDTO();
String id=ObjectUtility.getNewObjectID36();
Object data= tree.getData();
-
- if (data instanceof BizType) {//涓氬姟绫诲瀷
- BizType bizType=(BizType)data;
- roleRightDTO.setId(id);//涓婚敭
- roleRightDTO.setCreateUser(null);//鍒涘缓鑰�
- roleRightDTO.setCreateTime(null);//鍒涘缓鏃堕棿
- roleRightDTO.setModifyUser(null);//淇敼鑰�
- roleRightDTO.setModifyTime(null);//淇敼鏃堕棿
- roleRightDTO.setRoleId(roleOid);//瑙掕壊ID
- roleRightDTO.setRightValue(1);// 鏉冮檺鍊�
- roleRightDTO.setRightType((short) -1);//鏉冮檺绫诲瀷 鏉冮檺绫诲瀷锛岃秴绾х鐞嗗憳缁欑鐞嗗憳鎺堟潈涓�1锛岀鐞嗗憳缁欐櫘閫氱敤鎴锋巿鏉冧负2
- roleRightDTO.setFuncId(null);
- roleRightDTO.setLicensor(null);
- }else if (data instanceof PLUILayout){//UI
-
- }else if (data instanceof PLTabPage) {//UI涓婁笅鏂�
-
-
- }else if (data instanceof PLPageDefination) {//
-
-
+ if(data instanceof String){
+ getRightValue(roleOid,tree,allTreeMap,false,roleRightDTOMap);//鍚戜笅鑾峰彇鎵�鏈夋ā鍧楃殑鏉冮檺鍊�
+ }else if (!(data instanceof PLTabButton)) {//涓氬姟绫诲瀷
+ getRightValue(roleOid,tree,allTreeMap,true,roleRightDTOMap);//鍚戜笂澶勭悊
+ getRightValue(roleOid,tree,allTreeMap,false,roleRightDTOMap);//鍚戜笅澶勭悊锛堝寘鍚綋鍓嶈妭鐐癸級
}else if (data instanceof PLTabButton) {//鎸夐挳
}
@@ -1151,6 +1168,136 @@
}
+ /**
+ * 鑾峰彇鏉冮檺
+ * @param isUp 鏄惁鏄悜涓婅幏鍙栵紝濡傛灉鏄悜涓婅幏鍙栵紝浼犺繘鏉ョ殑蹇呯劧鏄ā鍧楄妭鐐癸紝涓斾笂绾фā鍧楀繀鐒舵槸娌℃湁閫変腑
+ */
+ private void getRightValue(String roleId,Tree node,HashMap<String,Tree> allTreeMap,boolean isUp,Map<String,RoleRightDTO> rightMap){
+ SessionInfo sessionInfo = WebThreadLocalUtil.getCurrentUserSessionInfoInThread();
+ String currentUserName = sessionInfo.getUserId();
+ boolean isDeveloper= rightControlUtil.isDeveloper(currentUserName);
+ String parentOid=node.getParentId();
+ if(allTreeMap.containsKey(parentOid)){
+ String id=ObjectUtility.getNewObjectID36();
+ Tree parentNode =allTreeMap.get(parentOid);
+ Object parentData= parentNode.getData();
+ if(isUp) {//鍚戜笂鑾峰彇锛屽瓨鍌ㄦ瘡涓笂绾фā鍧楃殑鏉冮檺鍊�
+ while (!"root".equals(parentNode.getData())){
+ String funcId = "";
+ if (parentData instanceof BizType) {
+ BizType bizType = (BizType) parentData;
+ funcId = bizType.name;
+ } else if (parentData instanceof PLUILayout) {
+ PLUILayout context = (PLUILayout)parentData;
+ funcId = context.plOId;
+ } else if (parentData instanceof PLTabPage) {
+ PLTabPage tab = (PLTabPage) parentData;
+ funcId = tab.plOId;
+ } else if (parentData instanceof PLPageDefination){
+ PLPageDefination pageDef = (PLPageDefination) parentData;
+ funcId = pageDef.plOId;
+ } else if (parentData instanceof PLTabButton) {
+ PLTabButton but = (PLTabButton)parentData;
+ funcId = but.plOId;
+ }
+ RoleRightDTO roleRightDTO = new RoleRightDTO();
+ roleRightDTO.setId(id);//涓婚敭
+ roleRightDTO.setFuncId(funcId);
+ if(isDeveloper) {
+ roleRightDTO.setRightType((short) 1);//鏉冮檺绫诲瀷 鏉冮檺绫诲瀷锛岃秴绾х鐞嗗憳缁欑鐞嗗憳鎺堟潈涓�1锛岀鐞嗗憳缁欐櫘閫氱敤鎴锋巿鏉冧负2
+ }else{
+ roleRightDTO.setRightType((short) 2);
+ }
+ roleRightDTO.setRightValue(1);// 鏉冮檺鍊硷紝娌℃湁鎿嶄綔鐨勬ā鍧楁潈闄愬�煎瓨鍌ㄤ负0
+ roleRightDTO.setRoleId(roleId);//瑙掕壊ID
+ roleRightDTO.setCreateUser(currentUserName);//鍒涘缓鑰�
+ roleRightDTO.setCreateTime(new Date());//鍒涘缓鏃堕棿
+ roleRightDTO.setModifyUser(currentUserName);//淇敼鑰�
+ roleRightDTO.setModifyTime(new Date());//淇敼鏃堕棿
+ roleRightDTO.setLicensor("");
+ if(!rightMap.containsKey(funcId)){
+ rightMap.put(funcId, roleRightDTO);
+ }
+ }
+ }else{
+ String funcId = "";
+ if(parentData instanceof String){
+ funcId = (String)parentData;
+ } else if (parentData instanceof BizType) {
+ BizType bizType = (BizType)parentData;
+ funcId = bizType.name;
+ } else if (parentData instanceof PLUILayout) {
+ PLUILayout context = (PLUILayout)parentData;
+ funcId = context.plOId;
+ } else if (parentData instanceof PLTabPage) {
+ PLTabPage tab = (PLTabPage) parentData;
+ funcId = tab.plOId;
+ } else if (parentData instanceof PLPageDefination){
+ PLPageDefination pageDef = (PLPageDefination) parentData;
+ funcId = pageDef.plOId;
+ } else if (parentData instanceof PLTabButton) {
+ PLTabButton but = (PLTabButton)parentData;
+ funcId = but.plOId;
+ }
+ if(!(parentData instanceof PLPageDefination)) {//瀛愯妭鐐逛笉鏄搷浣�
+ if(!rightMap.containsKey(funcId)&&!funcId.equals("root")){
+ RoleRightDTO roleRightDTO = new RoleRightDTO();
+ roleRightDTO.setFuncId(funcId);
+ if(isDeveloper) {
+ roleRightDTO.setRightType((short) 1);//鏉冮檺绫诲瀷 鏉冮檺绫诲瀷锛岃秴绾х鐞嗗憳缁欑鐞嗗憳鎺堟潈涓�1锛岀鐞嗗憳缁欐櫘閫氱敤鎴锋巿鏉冧负2
+ }else{
+ roleRightDTO.setRightType((short) 2);
+ }
+ roleRightDTO.setRightValue(0);//娌℃湁鎿嶄綔鐨勬ā鍧楁潈闄愬�煎瓨鍌ㄤ负0
+ roleRightDTO.setRoleId(roleId);
+ roleRightDTO.setCreateUser(currentUserName);
+ roleRightDTO.setCreateTime(new Date());
+ roleRightDTO.setModifyUser(currentUserName);
+ roleRightDTO.setModifyTime(new Date());
+ roleRightDTO.setLicensor("");
+ rightMap.put(funcId, roleRightDTO);
+ }
+ for(int i = 0;i < parentNode.getChildren().size();i++){
+ //瀵规瘡涓瓙鍚戜笅閫掑綊閬嶅巻
+ getRightValue(roleId,parentNode.getChildren().get(i),allTreeMap,false,rightMap);
+ }
+ }else {
+ if(!rightMap.containsKey(funcId)){
+ RoleRightDTO roleRightDTO = new RoleRightDTO();
+ roleRightDTO.setFuncId(funcId);
+ roleRightDTO.setRightType((short)2); // 璁剧疆UI鏉冮檺
+ roleRightDTO.setRightValue(countRightValue(parentNode,true));//娌℃湁鎿嶄綔鐨勬ā鍧楁潈闄愬�煎瓨鍌ㄤ负0
+ roleRightDTO.setRoleId(roleId);
+
+ roleRightDTO.setCreateUser(currentUserName);
+ roleRightDTO.setCreateTime(new Date());
+ roleRightDTO.setModifyUser(currentUserName);
+ roleRightDTO.setModifyTime(new Date());
+ roleRightDTO.setLicensor("");
+ rightMap.put(funcId, roleRightDTO);
+ }
+ }
+ }
+
+ }
+ }
+ /**
+ * 浼犲叆鐩存帴鎸傛帴鎿嶄綔鐨勬ā鍧楃殑鑺傜偣,璁$畻璇ヨ妭鐐圭殑鏉冮檺鍊�
+ * @param node 妯″潡鑺傜偣
+ * @param isAll 鏄惁瀛愮骇鍏ㄩ儴閫変腑
+ * @return
+ */
+ private long countRightValue(Tree node,boolean isAll){
+ long value = 0;
+ for(int i = 0;i < node.getChildren().size();i++){
+ Tree childNode = (Tree)node.getChildren().get(i);
+ if(isAll && node.getData() instanceof PLTabButton ){
+ PLTabButton obj = (PLTabButton)node.getData();
+ value += (long)Math.pow(2, obj.plSeq);//绱鍔犱笂鍚勪釜鎿嶄綔鐨勬潈闄愬��
+ }
+ }
+ return value;
+ }
/**
*
diff --git a/Source/plt-web/plt-web-ui/src/App.vue b/Source/plt-web/plt-web-ui/src/App.vue
index 421e759..a3f276c 100644
--- a/Source/plt-web/plt-web-ui/src/App.vue
+++ b/Source/plt-web/plt-web-ui/src/App.vue
@@ -59,11 +59,24 @@
margin-bottom: 0;
}
.avue-crud .avue-crud__menu{
- min-height: 32px;
+ min-height: 26px;
}
.avue-crud .avue-crud__menu .el-button{
margin-bottom: 5px;
}
+.avue-crud .avue-crud__menu .el-button--text{
+ padding: 2px 6px;
+}
+.avue-crud table td{
+ line-height: 22px;
+}
+.el-table .cell{
+ line-height: 22px;
+}
+.el-table .cell .el-tag{
+ line-height: 20px;
+ height: 22px;
+}
.avue-crud__pagination{
padding: 15px 0 10px;
}
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/index.vue
index 3e8d85d..4bdc47c 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/index.vue
@@ -37,6 +37,19 @@
<!--瀵煎叆 -->
<upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="瀵煎叆"
@updata="uploadCallBack"></upload-file>
+
+ <div>
+ <fieldset>
+ <legend> 鏌ヨ鏉′欢 </legend>
+ <form-query-dialog ref="formQuery"
+ style="height: 260px;"
+ :readOnly="true"
+ :queryCondition="queryCondition"
+ :queryTree="queryTree"
+ :levelFlag.sync="levelFlag"
+ ></form-query-dialog>
+ </fieldset>
+ </div>
</basic-container>
</el-main>
@@ -51,9 +64,10 @@
import func from "@/util/func";
import {dateFormat} from "@/util/date";
import FormDialog from "./formDialog.vue"
+import formQueryDialog from "@/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue";
export default {
name: "index",
- components: {FormDialog},
+ components: {FormDialog,formQueryDialog},
data() {
return {
treeOption: {
@@ -68,7 +82,7 @@
}
},
nodeRow: {},
- treeData: [ {
+ treeData: [{
label: '涓氬姟绫诲瀷鏍�',
oid: 'topNode',
children: []
@@ -95,7 +109,7 @@
selection: true,
menu: false,
height: "auto",
- calcHeight: -40,
+ calcHeight: 300,
tip: false,
header:false,
column: [{
@@ -115,6 +129,11 @@
],
upFileType: ['vciqtf'],
fileUrl: 'api/templateController/impBtmTemplate',
+ //楂樼骇鏌ヨ鏉′欢
+ queryTree:{},
+ //鏅�氭煡璇㈡潯浠�
+ queryCondition:[],
+ levelFlag:0
}
},
created() {
@@ -126,14 +145,24 @@
const loading = this.$loading({});
getBizTypes().then(res => {
const data = res.data.data.map(item => {
- item.label = item.attributes.id;
- return item;
+ this.processChildren(item); // 澶勭悊姣忎釜鑺傜偣
+ item.attributes.label = item.attributes.id;
+ return item.attributes;
});
this.treeData[0].children = data;
loading.close();
})
},
-
+ // 澶勭悊鏍戝舰缁撴瀯
+ processChildren(item) {
+ if (item.children && item.children.length > 0) {
+ item.attributes.children = item.children.map(child => {
+ child.attributes.label = child.attributes.id;
+ this.processChildren(child); // 閫掑綊澶勭悊姣忎釜瀛愯妭鐐�
+ return child.attributes; // 鍙繑鍥炲瓙鑺傜偣鐨� attributes
+ });
+ }
+ },
// 鏍戠偣鍑�
nodeClick(row) {
this.nodeRow = row;
@@ -145,12 +174,19 @@
getObjTypeQTs(this.nodeRow.label).then(res => {
this.crudData = res.data.data;
this.tableLoading = false;
+ this.queryCondition=[];
+ this.queryTree={};
+ this.levelFlag=0;
})
},
rowClick(row) {
this.$refs.crud.toggleSelection();
this.$refs.crud.toggleRowSelection(row); //閫変腑褰撳墠琛�
this.selectionRow = [row];
+
+ this.queryCondition=row.queryTemplate.condition;
+ this.queryTree=row.tree;
+ this.levelFlag=row.levelFlag;
},
selectionChange(list) {
this.selectionRow = list;
@@ -286,5 +322,13 @@
text-align: center;
padding-left: 4.5px;
}
-
+fieldset {
+ border-radius: 5px;
+ -webkit-box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
+ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
+ padding: 10px 6px;
+ box-sizing: border-box;
+ margin: 10px 0 0 0;
+ border: 1px solid #EBEEF5;
+}
</style>
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue
index 237f483..612fa18 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue
@@ -1,34 +1,34 @@
<template>
<div style="padding: 0 10px">
<div style="text-align: center;margin-bottom: 10px">
- <avue-radio v-model="radioForm" :dic="radioDic" style="margin: 0 20px 0 0;display: inline-block"></avue-radio>
- <el-button plain size="mini" type="primary" @click="clearValue">娓呯┖鍊�</el-button>
- <el-button plain size="mini" type="primary" @click="delAll">鍒犻櫎鍏ㄩ儴鏉′欢</el-button>
+ <avue-radio v-model="radioForm" :disabled ="readOnly" :dic="radioDic" style="margin: 0 20px 0 0;display: inline-block"></avue-radio>
+ <el-button v-if="!readOnly" plain size="mini" type="primary" @click="clearValue">娓呯┖鍊�</el-button>
+ <el-button v-if="!readOnly" plain size="mini" type="primary" @click="delAll">鍒犻櫎鍏ㄩ儴鏉′欢</el-button>
</div>
<div v-if="radioForm==0" @drop="drop" @dragover.prevent style="height: 220px;text-align: center;">
<div v-for="(condition,index) in conditionList" :key="index" class="el-input--small" style="margin-bottom: 5px; text-align:left">
<span style="width: 200px;display: inline-block;text-align: right" :title="condition.clause">{{condition.clause}}</span>
- <avue-select v-model="condition.operator" type="tree" :dic="condition.operatorDic" :clearable="false" style="width: 80px;margin: 0 5px;"></avue-select>
- <el-date-picker v-if="condition.type=='VTDate'" v-model="condition.ordinaryValue" style="width:300px;margin-right: 5px;display: inline-block;" value-format="YYYY-MM-DD"
+ <avue-select :disabled ="readOnly" v-model="condition.operator" type="tree" :dic="condition.operatorDic" :clearable="false" style="width: 80px;margin: 0 5px;"></avue-select>
+ <el-date-picker :disabled ="readOnly" v-if="condition.type=='VTDate'" v-model="condition.ordinaryValue" style="width:300px;margin-right: 5px;display: inline-block;" value-format="YYYY-MM-DD"
type="date">
</el-date-picker>
- <el-date-picker v-else-if="condition.type=='VTDateTime'" v-model="condition.ordinaryValue" style="width:300px;margin-right: 5px;display: inline-block;"
+ <el-date-picker :disabled ="readOnly" v-else-if="condition.type=='VTDateTime'" v-model="condition.ordinaryValue" style="width:300px;margin-right: 5px;display: inline-block;"
type="datetime">
</el-date-picker>
- <el-time-select v-else-if="condition.type=='VTTime'" v-model="condition.ordinaryValue" value-format="HH:mm:ss" style="width:300px;margin-right: 5px;display: inline-block;">
+ <el-time-select :disabled ="readOnly" v-else-if="condition.type=='VTTime'" v-model="condition.ordinaryValue" value-format="HH:mm:ss" style="width:300px;margin-right: 5px;display: inline-block;">
</el-time-select>
- <avue-input-number v-else-if="condition.type=='VTInteger'" precision="0" v-model="condition.ordinaryValue" style="width:300px;margin-right: 5px;display: inline-block;"></avue-input-number>
- <avue-input-number v-else-if="condition.type=='VTLong' || condition.type=='VTDouble'" v-model="condition.ordinaryValue" style="width:300px;margin-right: 5px;display: inline-block;"></avue-input-number>
- <avue-input v-else v-model="condition.ordinaryValue" placeholder="" style="width: 300px;margin-right: 5px;"></avue-input>
- <el-button plain size="mini" type="primary" @click="checkTemp(index)">閫夋嫨鏌ヨ妯℃澘</el-button>
- <el-button size="mini" type="danger" icon="el-icon-delete" @click="delCondition(index)" style="padding: 7px 8px"></el-button>
+ <avue-input-number :disabled ="readOnly" v-else-if="condition.type=='VTInteger'" precision="0" v-model="condition.ordinaryValue" style="width:300px;margin-right: 5px;display: inline-block;"></avue-input-number>
+ <avue-input-number :disabled ="readOnly" v-else-if="condition.type=='VTLong' || condition.type=='VTDouble'" v-model="condition.ordinaryValue" style="width:300px;margin-right: 5px;display: inline-block;"></avue-input-number>
+ <avue-input :disabled ="readOnly" v-else v-model="condition.ordinaryValue" placeholder="" style="width: 300px;margin-right: 5px;"></avue-input>
+ <el-button v-if="!readOnly" plain size="mini" type="primary" @click="checkTemp(index)">閫夋嫨鏌ヨ妯℃澘</el-button>
+ <el-button v-if="!readOnly" size="mini" type="danger" icon="el-icon-delete" @click="delCondition(index)" style="padding: 7px 8px"></el-button>
</div>
</div>
<div v-else @drop="drop" @dragover.prevent style="height: 220px;text-align: left">
<avue-tree ref="tree" @node-drag-end="handleDragEnd" @node-drag-leave="handleDragLeave" @node-drag-over="handleDragOver"
style="height: 220px" :data="treeData" :option="treeOption" @node-click="nodeClick" node-key="value"></avue-tree>
</div>
- <div style="text-align: right;margin-top: 10px;">
+ <div v-if="!readOnly" style="text-align: right;margin-top: 10px;">
<el-button v-if="radioForm==1" plain size="mini" type="primary" @click="addHandler">澧炲姞閫昏緫</el-button>
<el-button v-if="radioForm==1" plain size="mini" type="primary" @click="editHandler">淇敼鏉′欢</el-button>
<el-button v-if="radioForm==1" plain size="mini" type="primary" @click="delHandler">鍒犻櫎</el-button>
@@ -132,6 +132,10 @@
levelFlag:{
type: Number,
default: 0
+ },
+ readOnly:{
+ type:Boolean,
+ default:false
}
},
data() {
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue
index a5d706a..b8cc2f9 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue
@@ -36,6 +36,18 @@
<!--瀵煎叆 -->
<upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="瀵煎叆"
@updata="uploadCallBack"></upload-file>
+ <div>
+ <fieldset>
+ <legend> 鏌ヨ鏉′欢 </legend>
+ <form-query-dialog ref="formQuery"
+ style="height: 260px;"
+ :readOnly="true"
+ :queryCondition="queryCondition"
+ :queryTree="queryTree"
+ :levelFlag.sync="levelFlag"
+ ></form-query-dialog>
+ </fieldset>
+ </div>
</basic-container>
</el-main>
</el-container>
@@ -48,10 +60,11 @@
import basicOption from "@/util/basic-option";
import FormDialog from "./formDialog.vue"
import func from "@/util/func";
+import formQueryDialog from "@/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue";
export default {
name: "index",
- components: {FormDialog},
+ components: {FormDialog,formQueryDialog},
data() {
return {
treeOption: {
@@ -83,7 +96,7 @@
selection: true,
menu: false,
height: "auto",
- calcHeight: -40,
+ calcHeight: 300,
tip: false,
header:false,
column: [{
@@ -151,6 +164,11 @@
],
upFileType: ['vciqtf'],
fileUrl: 'api/templateController/impLinkTemplate',
+ //楂樼骇鏌ヨ鏉′欢
+ queryTree:{},
+ //鏅�氭煡璇㈡潯浠�
+ queryCondition:[],
+ levelFlag:0
}
},
created() {
@@ -182,12 +200,20 @@
this.crudData = res.data.data;
this.tableLoading = false;
this.selectionClear();
+
+ this.queryCondition=[];
+ this.queryTree={};
+ this.levelFlag=0;
})
},
rowClick(row) {
this.$refs.crud.toggleSelection();
this.$refs.crud.toggleRowSelection(row); //閫変腑褰撳墠琛�
this.selectionRow = [row];
+
+ this.queryCondition=row.queryTemplate.condition;
+ this.queryTree=row.tree;
+ this.levelFlag=row.levelFlag;
},
selectionChange(list) {
this.selectionRow = list;
@@ -323,5 +349,13 @@
text-align: center;
padding-left: 4.5px;
}
-
+fieldset {
+ border-radius: 5px;
+ -webkit-box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
+ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
+ padding: 10px 6px;
+ box-sizing: border-box;
+ margin: 10px 0 0 0;
+ border: 1px solid #EBEEF5;
+}
</style>
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/queryDefine/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/queryDefine/index.vue
index 441a5c2..4a4395b 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/queryDefine/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/queryDefine/index.vue
@@ -170,8 +170,9 @@
if (newval ==0) {
getBizTypes().then(res => {
const data = res.data.data.map(item => {
- item.label=item.attributes.id;
- return item;
+ this.processChildren(item); // 澶勭悊姣忎釜鑺傜偣
+ item.attributes.label = item.attributes.id;
+ return item.attributes;
});
this.treeData = data;
loading.close();
@@ -195,14 +196,24 @@
const loading = this.$loading({});
getBizTypes().then(res => {
const data = res.data.data.map(item => {
- item.label=item.attributes.id;
- return item;
+ this.processChildren(item); // 澶勭悊姣忎釜鑺傜偣
+ item.attributes.label = item.attributes.id;
+ return item.attributes;
});
this.treeData = data;
loading.close();
})
},
-
+ // 澶勭悊涓氬姟绫诲瀷鏍戝舰缁撴瀯
+ processChildren(item) {
+ if (item.children && item.children.length > 0) {
+ item.attributes.children = item.children.map(child => {
+ child.attributes.label = child.attributes.id;
+ this.processChildren(child); // 閫掑綊澶勭悊姣忎釜瀛愯妭鐐�
+ return child.attributes; // 鍙繑鍥炲瓙鑺傜偣鐨� attributes
+ });
+ }
+ },
// 鏍戠偣鍑�
nodeClick(row) {
this.nodeRow = row;
--
Gitblit v1.9.3