From 7b3d5fb08fdbd2ce574c3b9ab666c8c7082be728 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期五, 06 九月 2024 15:38:35 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/RoleRightDTO.java | 123 + Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/UIManagerServiceI.java | 29 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/tt.xml | 58 Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/PRMItemDTO.java | 14 Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/QueryTemplateDTO.java | 164 ++ Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/index.vue | 97 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/HMSysModConfigController.java | 19 Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formDialog.vue | 514 +++++++ Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsQueryTemplateController.java | 1 Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/MenuVO.java | 3 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsPortalVIServiceImpl.java | 38 Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/LeafValueDto.java | 35 Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/UIAuthorDTO.java | 73 + Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue | 740 +++++++++- Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/ConditionItemDTO.java | 57 Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formQueryDialog.vue | 677 +++++++++ Source/plt-web/plt-web-ui/src/api/queryTemplate/linkTypeQuery.js | 30 Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/ConditionDTO.java | 59 Source/plt-web/plt-web-ui/src/components/PLT-basic-component/upload-file.vue | 3 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsQuereyTemplateServiceI.java | 1 Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue | 52 Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/model/PRMItemDO.java | 15 Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/RoleRightVO.java | 137 + Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebPortalVIController.java | 12 Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/QTInfoDTO.java | 2 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java | 214 +- Source/plt-web/plt-web-ui/src/App.vue | 1 Source/plt-web/plt-web-ui/src/api/queryTemplate/queryDefine.js | 22 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/UIManagerController.java | 41 Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/model/RoleRightDO.java | 142 ++ Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/LeafInfoDTO.java | 48 Source/plt-web/plt-web-parent/plt-web/src/main/resources/application-dev.yml | 4 Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/PRMItemVO.java | 14 Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue | 137 + Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsQueryTemplateImpl.java | 186 + Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java | 336 ++++ 36 files changed, 3,712 insertions(+), 386 deletions(-) diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/ConditionDTO.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/ConditionDTO.java new file mode 100644 index 0000000..4d5b98e --- /dev/null +++ b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/ConditionDTO.java @@ -0,0 +1,59 @@ +package com.vci.dto; + +import com.vci.common.qt.object.ConditionItem; +import lombok.Data; + +import java.util.Iterator; +import java.util.Map; + +/** + * 鏉′欢浼犺緭瀵硅薄 + * @author yuxc + * @date 2024/9/4 + */ +@Data +public class ConditionDTO { + private String rootCIName; + private Map<String, ConditionItemDTO> ciMap; + + public ConditionDTO() { + } + + public String getRootCIName() { + return this.rootCIName; + } + + public void setRootCIName(String rootCIName) { + this.rootCIName = rootCIName; + } + + public String getRootCINameByCIMap(Map<String, ConditionItem> ciMap) { + String rootCIName = ""; + if (ciMap != null) { + Iterator<String> i = ciMap.keySet().iterator(); + + while(i.hasNext()) { + String ciName = (String)i.next(); + if (rootCIName.equals("")) { + rootCIName = ciName; + } else { + int rootInt = Integer.valueOf(rootCIName.substring(2)); + int ciInt = Integer.valueOf(ciName.substring(2)); + if (ciInt > rootInt) { + rootCIName = ciName; + } + } + } + } + + return rootCIName; + } + + public Map<String, ConditionItemDTO> getCIMap() { + return this.ciMap; + } + + public void setCIMap(Map<String, ConditionItemDTO> cIMap) { + this.ciMap = cIMap; + } +} diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/ConditionItemDTO.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/ConditionItemDTO.java new file mode 100644 index 0000000..abe7f32 --- /dev/null +++ b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/ConditionItemDTO.java @@ -0,0 +1,57 @@ +package com.vci.dto; + +import com.vci.common.qt.object.ChildrenInfo; +import com.vci.common.qt.object.ConditionItem; +import com.vci.common.qt.object.LeafInfo; +import lombok.Data; + +import java.util.Iterator; +import java.util.Map; + +/** + * 鏉′欢鍒楄〃浼犺緭瀵硅薄 + * @author yuxc + * @date 2024/9/4 + */ +@Data +public class ConditionItemDTO { + private String id; + private LeafInfoDTO leafInfo; + private ChildrenInfo childrenInfo; + private boolean leafFlag; + + public ConditionItemDTO() { + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public LeafInfoDTO getLeafInfo() { + return this.leafInfo; + } + + public void setLeafInfo(LeafInfoDTO leafInfo) { + this.leafInfo = leafInfo; + } + + public ChildrenInfo getChildrenInfo() { + return this.childrenInfo; + } + + public void setChildrenInfo(ChildrenInfo childrenInfo) { + this.childrenInfo = childrenInfo; + } + + public boolean isLeaf() { + return this.leafFlag; + } + + public void setLeafFlag(boolean leafFlag) { + this.leafFlag = leafFlag; + } +} diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/LeafInfoDTO.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/LeafInfoDTO.java new file mode 100644 index 0000000..5326fb2 --- /dev/null +++ b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/LeafInfoDTO.java @@ -0,0 +1,48 @@ +package com.vci.dto; + +import com.vci.common.qt.object.ConditionItem; +import com.vci.common.qt.object.LeafValue; +import lombok.Data; + +import java.util.Iterator; +import java.util.Map; + +/** + * 鍙跺瓙鏉′欢浼犺緭瀵硅薄 + * @author yuxc + * @date 2024/9/4 + */ +@Data +public class LeafInfoDTO { + private String clause; + private String operator; + private String type; + private LeafValueDto value; + + public LeafInfoDTO() { + } + + public String getClause() { + return this.clause; + } + + public void setClause(String clause) { + this.clause = clause; + } + + public String getOperator() { + return this.operator; + } + + public void setOperator(String operator) { + this.operator = operator; + } + + public LeafValueDto getValue() { + return this.value; + } + + public void setValue(LeafValueDto value) { + this.value = value; + } +} diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/LeafValueDto.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/LeafValueDto.java new file mode 100644 index 0000000..31e9269 --- /dev/null +++ b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/LeafValueDto.java @@ -0,0 +1,35 @@ +package com.vci.dto; + +import lombok.Data; + +/** + * 鍙跺瓙鍊间紶杈撳璞� + * @author yuxc + * @date 2024/9/4 + */ +@Data +public class LeafValueDto { + private String ordinaryValue; + private QueryTemplateDTO queryTemplate; + + public LeafValueDto() { + } + + public String getOrdinaryValue() { + return this.ordinaryValue; + } + + public void setOrdinaryValue(String ordinaryValue) { + this.ordinaryValue = ordinaryValue; + } + + public QueryTemplateDTO getQueryTemplate() { + return this.queryTemplate; + } + + public void setQueryTemplate(QueryTemplateDTO queryTemplate) { + this.queryTemplate = queryTemplate; + } + + +} diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/PRMItemDTO.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/PRMItemDTO.java index 73670f7..11387e0 100644 --- a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/PRMItemDTO.java +++ b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/PRMItemDTO.java @@ -141,6 +141,11 @@ * 鏋氫妇鍊� */ private List<String> itemValueList = null; + /*** + * 鏋氫妇鍊奸泦鍚� + */ + private List<KeyValue> itemKeyValueList=new ArrayList<>(); + /** *涓�绾у弬鐓� */ @@ -695,6 +700,14 @@ // } + public List<KeyValue> getItemKeyValueList() { + return itemKeyValueList; + } + + public void setItemKeyValueList(List<KeyValue> itemKeyValueList) { + this.itemKeyValueList = itemKeyValueList; + } + @Override public String toString() { return "PRMItemDTO{" + @@ -729,6 +742,7 @@ ", itemScript='" + itemScript + '\'' + ", itemTips='" + itemTips + '\'' + ", itemValueList=" + itemValueList + + ", itemKeyValueList=" + itemKeyValueList + ", itemListTable='" + itemListTable + '\'' + ", itemListTxt='" + itemListTxt + '\'' + ", itemListVal='" + itemListVal + '\'' + diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/QTInfoDTO.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/QTInfoDTO.java index 094b3db..485ebeb 100644 --- a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/QTInfoDTO.java +++ b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/QTInfoDTO.java @@ -31,7 +31,7 @@ //鏌ヨ妯℃澘鍚� private String qtText; //鏌ヨ妯℃澘淇℃伅 - private QueryTemplate queryTemplate; + private QueryTemplateDTO queryTemplate; //鏌ヨ鏉′欢锛屽悗绔繘琛岀浉鍏宠В鏋� private List<HashMap<String,String>> condition; private HashMap<String,Object> tree = new HashMap<>(); diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/QueryTemplateDTO.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/QueryTemplateDTO.java new file mode 100644 index 0000000..e0036a1 --- /dev/null +++ b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/QueryTemplateDTO.java @@ -0,0 +1,164 @@ +package com.vci.dto; + + +import com.vci.common.qt.object.Condition; +import com.vci.common.qt.object.OrderInfo; +import com.vci.common.qt.object.PageInfo; +import lombok.Data; +import java.util.List; + +/** + * 鏌ヨ妯℃澘浼犺緭瀵硅薄 + * @author yuxc + * @date 2024/8/7 + */ +@Data +public class QueryTemplateDTO { + private String id; + private String type; + private List<String> clauseList; + private String linkType; + private String btmType; + private boolean queryChildrenFlag = false; + private boolean queryISLeaf = false; + private boolean rightFlag = true; + private boolean secretFlag = true; + private String direction = "positive"; + private ConditionDTO condition; + private int version = 0; + private PageInfo pageInfo; + private List<OrderInfo> orderInfoList; + private int level = 1; + private int recReturnMode = 1; + + public QueryTemplateDTO() { + } + + public String getLinkType() { + return this.linkType; + } + + public void setLinkType(String linkType) { + this.linkType = linkType; + } + + public String getBtmType() { + return this.btmType; + } + + public void setBtmType(String btmType) { + this.btmType = btmType; + } + + public boolean isQueryChildren() { + return this.queryChildrenFlag; + } + + public void setQueryChildrenFlag(boolean queryChildrenFlag) { + this.queryChildrenFlag = queryChildrenFlag; + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public List<String> getClauseList() { + return this.clauseList; + } + + public void setClauseList(List<String> clauseList) { + this.clauseList = clauseList; + } + + public ConditionDTO getCondition() { + return this.condition; + } + + public void setCondition(ConditionDTO condition) { + this.condition = condition; + } + + public int getVersion() { + return this.version; + } + + public void setVersion(int version) { + this.version = version; + } + + public String getDirection() { + return this.direction; + } + + public void setDirection(String direction) { + this.direction = direction; + } + + public PageInfo getPageInfo() { + return this.pageInfo; + } + + public void setPageInfo(PageInfo pageInfo) { + this.pageInfo = pageInfo; + } + + public List<OrderInfo> getOrderInfoList() { + return this.orderInfoList; + } + + public void setOrderInfoList(List<OrderInfo> orderInfoList) { + this.orderInfoList = orderInfoList; + } + + public int getLevel() { + return this.level; + } + + public void setLevel(int level) { + this.level = level; + } + + public int getRecReturnMode() { + return this.recReturnMode; + } + + public void setRecReturnMode(int recReturnMode) { + this.recReturnMode = recReturnMode; + } + + public boolean isQueryISLeaf() { + return this.queryISLeaf; + } + + public void setQueryISLeaf(boolean queryISLeaf) { + this.queryISLeaf = queryISLeaf; + } + + public boolean isRightFlag() { + return this.rightFlag; + } + + public void setRightFlag(boolean rightFlag) { + this.rightFlag = rightFlag; + } + + public boolean isSecretFlag() { + return this.secretFlag; + } + + public void setSecretFlag(boolean secretFlag) { + this.secretFlag = secretFlag; + } +} diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/RoleRightDTO.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/RoleRightDTO.java new file mode 100644 index 0000000..4e3b571 --- /dev/null +++ b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/RoleRightDTO.java @@ -0,0 +1,123 @@ +package com.vci.dto; + +import java.io.Serializable; +import java.util.Date; + +/** + * UI鏉冮檺 + * @author xiej + * @date 2024-09-05 + */ +public class RoleRightDTO implements Serializable { + + + private static final long serialVersionUID = 2956142041726150499L; + + /** + * ID + */ + private String id = ""; + /** + *瑙掕壊ID + */ + private String roleId = ""; + /** + * 妯″潡ID + */ + private String funcId = ""; + /** + * 鏉冮檺鍊� + */ + private long rightValue = -1; + /** + * 鏉冮檺绫诲瀷锛岃秴绾х鐞嗗憳缁欑鐞嗗憳鎺堟潈涓�1锛岀鐞嗗憳缁欐櫘閫氱敤鎴锋巿鏉冧负2 + */ + private short rightType = -1; + + /**鏂板鏁版嵁鍒涘缓鑰咃紝淇敼鑰咃紝鍒涘缓鏃堕棿锛屼慨鏀规椂闂达紝鎺堟潈鑰�***/ + private String createUser = ""; + private Date createTime = new Date(); + private String licensor = ""; + private String modifyUser = ""; + private Date modifyTime = new Date(); + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getRoleId() { + return roleId; + } + + public void setRoleId(String roleId) { + this.roleId = roleId; + } + + public String getFuncId() { + return funcId; + } + + public void setFuncId(String funcId) { + this.funcId = funcId; + } + + public long getRightValue() { + return rightValue; + } + + public void setRightValue(long rightValue) { + this.rightValue = rightValue; + } + + public short getRightType() { + return rightType; + } + + public void setRightType(short rightType) { + this.rightType = rightType; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getLicensor() { + return licensor; + } + + public void setLicensor(String licensor) { + this.licensor = licensor; + } + + public String getModifyUser() { + return modifyUser; + } + + public void setModifyUser(String modifyUser) { + this.modifyUser = modifyUser; + } + + public Date getModifyTime() { + return modifyTime; + } + + public void setModifyTime(Date modifyTime) { + this.modifyTime = modifyTime; + } +} diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/UIAuthorDTO.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/UIAuthorDTO.java new file mode 100644 index 0000000..6dfa82d --- /dev/null +++ b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/UIAuthorDTO.java @@ -0,0 +1,73 @@ +package com.vci.dto; + +import com.vci.starter.web.pagemodel.Tree; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; +/** + * 鎺堟潈瀵硅薄 + * @author xiej + * @date 2024-09-05 + */ +public class UIAuthorDTO implements Serializable { + private static final long serialVersionUID = -1996329568646378902L; + /** + *瑙掕壊ID + */ + private String roleId; + /** + *涓氬姟绫诲瀷 + */ + private String type; + /** + *涓婁笅鏂� + */ + private String context; + /** + * 鎺堟潈鐨勮妭鐐� + */ + List<Tree> selectTreeList; + + public String getRoleId() { + return roleId; + } + + public void setRoleId(String roleId) { + this.roleId = roleId; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getContext() { + return context; + } + + public void setContext(String context) { + this.context = context; + } + + public List<Tree> getSelectTreeList() { + return selectTreeList; + } + + public void setSelectTreeList(List<Tree> selectTreeList) { + this.selectTreeList = selectTreeList; + } + + @Override + public String toString() { + return "UIAuthorDTO{" + + "roleId='" + roleId + '\'' + + ", type='" + type + '\'' + + ", context='" + context + '\'' + + ", selectTreeList=" + selectTreeList + + '}'; + } +} diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/model/PRMItemDO.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/model/PRMItemDO.java index c758bb8..24ffb05 100644 --- a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/model/PRMItemDO.java +++ b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/model/PRMItemDO.java @@ -127,7 +127,10 @@ * 鏋氫妇鍊� */ private List<String> itemValueList = null; - + /*** + * 鏋氫妇鍊奸泦鍚� + */ + private List<KeyValue> itemKeyValueList=new ArrayList<>(); /** *涓�绾у弬鐓� */ @@ -664,6 +667,15 @@ public void setItemDateFormat(String itemDateFormat) { this.itemDateFormat = itemDateFormat; } + + public List<KeyValue> getItemKeyValueList() { + return itemKeyValueList; + } + + public void setItemKeyValueList(List<KeyValue> itemKeyValueList) { + this.itemKeyValueList = itemKeyValueList; + } + @Override public String toString() { return "PRMItemDO{" + @@ -693,6 +705,7 @@ ", itemScript='" + itemScript + '\'' + ", itemTips='" + itemTips + '\'' + ", itemValueList=" + itemValueList + + ", itemKeyValueList=" + itemKeyValueList + ", itemListTable='" + itemListTable + '\'' + ", itemListTxt='" + itemListTxt + '\'' + ", itemListVal='" + itemListVal + '\'' + diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/model/RoleRightDO.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/model/RoleRightDO.java new file mode 100644 index 0000000..a2af5d9 --- /dev/null +++ b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/model/RoleRightDO.java @@ -0,0 +1,142 @@ +package com.vci.model; + +import com.vci.starter.web.annotation.Transient; +import com.vci.starter.web.annotation.VciBtmType; +import com.vci.starter.web.constant.FrameWorkLcStatusConstant; + +import java.io.Serializable; +import java.util.Date; + +/** + * UI鏉冮檺 + * @author xiej + * @date 2024-09-05 + */ +@VciBtmType(name = "UIAuthor",text = "UI鏉冮檺",tableName = "PLROLERIGHT",lifeCycle = FrameWorkLcStatusConstant.EMTYPE_LIFE_CYCLE) +@Transient +public class RoleRightDO implements Serializable { + private static final long serialVersionUID = -5073244242126466800L; + /** + * ID + */ + private String id = ""; + /** + *瑙掕壊ID + */ + private String roleId = ""; + /** + * 妯″潡ID + */ + private String funcId = ""; + /** + * 鏉冮檺鍊� + */ + private long rightValue = -1; + /** + * 鏉冮檺绫诲瀷锛岃秴绾х鐞嗗憳缁欑鐞嗗憳鎺堟潈涓�1锛岀鐞嗗憳缁欐櫘閫氱敤鎴锋巿鏉冧负2 + */ + private short rightType = -1; + + /**鏂板鏁版嵁鍒涘缓鑰咃紝淇敼鑰咃紝鍒涘缓鏃堕棿锛屼慨鏀规椂闂达紝鎺堟潈鑰�***/ + private String createUser = ""; + private Date createTime = new Date(); + private String licensor = ""; + private String modifyUser = ""; + private Date modifyTime = new Date(); + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getRoleId() { + return roleId; + } + + public void setRoleId(String roleId) { + this.roleId = roleId; + } + + public String getFuncId() { + return funcId; + } + + public void setFuncId(String funcId) { + this.funcId = funcId; + } + + public long getRightValue() { + return rightValue; + } + + public void setRightValue(long rightValue) { + this.rightValue = rightValue; + } + + public short getRightType() { + return rightType; + } + + public void setRightType(short rightType) { + this.rightType = rightType; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getLicensor() { + return licensor; + } + + public void setLicensor(String licensor) { + this.licensor = licensor; + } + + public String getModifyUser() { + return modifyUser; + } + + public void setModifyUser(String modifyUser) { + this.modifyUser = modifyUser; + } + + public Date getModifyTime() { + return modifyTime; + } + + public void setModifyTime(Date modifyTime) { + this.modifyTime = modifyTime; + } + + @Override + public String toString() { + return "RoleRightDTO{" + + "id='" + id + '\'' + + ", roleId='" + roleId + '\'' + + ", funcId='" + funcId + '\'' + + ", rightValue=" + rightValue + + ", rightType=" + rightType + + ", createUser='" + createUser + '\'' + + ", createTime=" + createTime + + ", licensor='" + licensor + '\'' + + ", modifyUser='" + modifyUser + '\'' + + ", modifyTime=" + modifyTime + + '}'; + } +} diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/MenuVO.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/MenuVO.java index 5c73e12..06cda7c 100644 --- a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/MenuVO.java +++ b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/MenuVO.java @@ -3,6 +3,7 @@ import java.io.Serializable; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -27,7 +28,7 @@ /** * 瀛愬瓩鑺傜偣 */ - private List<MenuVO> children; + private List<MenuVO> children = new ArrayList<>(); /** * 鏄惁鏈夊瓙瀛欒妭鐐� diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/PRMItemVO.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/PRMItemVO.java index 667ea91..8632263 100644 --- a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/PRMItemVO.java +++ b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/PRMItemVO.java @@ -144,7 +144,10 @@ * 鏋氫妇鍊� */ private List<String> itemValueList = null; - + /*** + * 鏋氫妇鍊奸泦鍚� + */ + private List<KeyValue> itemKeyValueList=new ArrayList<>(); /** *涓�绾у弬鐓� @@ -633,6 +636,14 @@ this.itemSearchFieldList = itemSearchFieldList; } + public List<KeyValue> getItemKeyValueList() { + return itemKeyValueList; + } + + public void setItemKeyValueList(List<KeyValue> itemKeyValueList) { + this.itemKeyValueList = itemKeyValueList; + } + @Override public String toString() { return "PRMItemVO{" + @@ -667,6 +678,7 @@ ", itemScript='" + itemScript + '\'' + ", itemTips='" + itemTips + '\'' + ", itemValueList=" + itemValueList + + ", itemKeyValueList=" + itemKeyValueList + ", itemListTable='" + itemListTable + '\'' + ", itemListTxt='" + itemListTxt + '\'' + ", itemListVal='" + itemListVal + '\'' + diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/RoleRightVO.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/RoleRightVO.java new file mode 100644 index 0000000..3c6ff70 --- /dev/null +++ b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/RoleRightVO.java @@ -0,0 +1,137 @@ +package com.vci.pagemodel; + +import java.io.Serializable; +import java.util.Date; + +public class RoleRightVO implements Serializable { + + + private static final long serialVersionUID = 2030418807220108229L; + /** + * ID + */ + private String id = ""; + /** + *瑙掕壊ID + */ + private String roleId = ""; + /** + * 妯″潡ID + */ + private String funcId = ""; + /** + * 鏉冮檺鍊� + */ + private long rightValue = -1; + /** + * 鏉冮檺绫诲瀷锛岃秴绾х鐞嗗憳缁欑鐞嗗憳鎺堟潈涓�1锛岀鐞嗗憳缁欐櫘閫氱敤鎴锋巿鏉冧负2 + */ + private short rightType = -1; + /** + * 鏉冮檺绫诲瀷 + */ + private String rigthTypeText=""; + + /**鏂板鏁版嵁鍒涘缓鑰咃紝淇敼鑰咃紝鍒涘缓鏃堕棿锛屼慨鏀规椂闂达紝鎺堟潈鑰�***/ + private String createUser = ""; + private String createTime = ""; + private String licensor = ""; + private String modifyUser = ""; + private String modifyTime =""; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getRoleId() { + return roleId; + } + + public void setRoleId(String roleId) { + this.roleId = roleId; + } + + public String getFuncId() { + return funcId; + } + + public void setFuncId(String funcId) { + this.funcId = funcId; + } + + public long getRightValue() { + return rightValue; + } + + public void setRightValue(long rightValue) { + this.rightValue = rightValue; + } + + public short getRightType() { + return rightType; + } + + public void setRightType(short rightType) { + this.rightType = rightType; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getLicensor() { + return licensor; + } + + public void setLicensor(String licensor) { + this.licensor = licensor; + } + + public String getModifyUser() { + return modifyUser; + } + + public void setModifyUser(String modifyUser) { + this.modifyUser = modifyUser; + } + + public String getModifyTime() { + return modifyTime; + } + + public void setModifyTime(String modifyTime) { + this.modifyTime = modifyTime; + } + + @Override + public String toString() { + return "RoleRightVO{" + + "id='" + id + '\'' + + ", roleId='" + roleId + '\'' + + ", funcId='" + funcId + '\'' + + ", rightValue=" + rightValue + + ", rightType=" + rightType + + ", createUser='" + createUser + '\'' + + ", createTime=" + createTime + + ", licensor='" + licensor + '\'' + + ", modifyUser='" + modifyUser + '\'' + + ", modifyTime=" + modifyTime + + '}'; + } +} diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java index 7ee7870..daa7f5c 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java @@ -508,78 +508,47 @@ return functionVOList.stream().sorted(Comparator.comparing(s -> s.getSort())).collect(Collectors.toList()); } - public List<MenuVO> findChildAuthFunctionVO(String parentId,MenuVO functionVO) throws PLException { -// List<FunctionInfo> menus = map.get(parentOid); + public void findChildAuthFunctionVO(MenuVO functionVO, boolean isAll) throws PLException { //0琛ㄧず娌℃湁妯″潡涔熸病鏈夋搷浣滐紝1琛ㄧず鏈夋ā鍧楋紝2琛ㄧず鏈夋搷浣� - long l = platformClientUtil.getFrameworkService().checkChildObject(parentId); - -// funcObj.setFuncType(funcType); -// -// if(funcType == 1){ -// FunctionObject[] funcObjs = new FunctionClientDelegate().getModuleListByParentId(funcObj.getId(),false); -// for(int i=0;i<funcObjs.length;i++){ -// VCIBaseTreeNode curNode = new VCIBaseTreeNode(funcObjs[i].getName(), funcObjs[i]); -// treeModel.insertNodeInto(curNode, node,node.getChildCount()); -// setChildNode(curNode,funcObjs[i]); -// } -// }else if(funcType == 2){ -// FuncOperationObject[] funcOperateObjs = new FuncOperationClientDelegate().getFuncOperationByModuleId(funcObj.getId(), "", true); -// for (int j = 0; j < funcOperateObjs.length; j++) { -// VCIBaseTreeNode childNode = new VCIBaseTreeNode(funcOperateObjs[j].getOperAlias(),funcOperateObjs[j]); -// UserObject user = rightManagementClient.fetchUserInfoByName(PLTApplication.getUserEntityObject().getUserName()); -//// if(user.getUserType() == 0 || childNode.toString().equals("鏌ョ湅")){ -//// treeModel.insertNodeInto(childNode, node,node.getChildCount()); -//// childNode.setLeaf(true); -//// }else{ -//// boolean res = initRoleRightByType(childNode); -//// if(res){ -// treeModel.insertNodeInto(childNode, node,node.getChildCount()); -// childNode.setLeaf(true); -//// } -//// } -// } -// }else{ -// functionVO.setHasChildren(false); -// } -// -// -// -// -// -// int funcType = funcDel.checkChildObject(funcObj.getId()); -// funcObj.setFuncType(funcType); -// -// - List<MenuVO> functionVOList = new ArrayList<>(); -// if(menus == null){ -// return functionVOList; -// } -// for (FunctionInfo menu : menus) { -// if(!menu.isValid){ -// continue; -// } -// MenuVO functionVO = new MenuVO(); -// functionVO.setId(menu.id); -// functionVO.setSource(menu.image); -//// if(StringUtils.isBlank(menu.resourceB) ){ -//// continue; -//// } -// functionVO.setPath(menu.resourceB); -// functionVO.setCode(menu.aliasName); -// functionVO.setAlias(menu.aliasName); -// functionVO.setParentId(menu.parentId); -// functionVO.setName(menu.name); -// functionVO.getMeta().put("keepAlive",false); -// functionVO.setSort((int) menu.seq); -// functionVO.setChildren(findChildAuthFunctionVO(menu.id,functionVO)); -// if(functionVO.getChildren().size() > 0){ -// functionVO.setHasChildren(true); -// }else { -// functionVO.setHasChildren(false); -// } -// functionVOList.add(functionVO); -// } - return functionVOList.stream().sorted(Comparator.comparing(s -> s.getSort())).collect(Collectors.toList()); + long type = platformClientUtil.getFrameworkService().checkChildObject(functionVO.getId()); + if(type == 1){ + FunctionInfo[] funcObjs = platformClientUtil.getFrameworkService().getModuleListByParentId(functionVO.getId(), isAll); + for (FunctionInfo funcObj : funcObjs) { + MenuVO menuVO = new MenuVO(); + menuVO.setId(funcObj.id); + menuVO.setSource(funcObj.image); + menuVO.setPath(funcObj.resourceB); + menuVO.setCode(funcObj.aliasName); + menuVO.setAlias(funcObj.aliasName); + menuVO.setParentId(funcObj.parentId); + menuVO.setChildType((int) type); + menuVO.setName(funcObj.name); + menuVO.getMeta().put("keepAlive",false); + menuVO.setSort((int) funcObj.seq); + findChildAuthFunctionVO(menuVO, isAll); + functionVO.getChildren().add(menuVO); + } + }else if(type == 2){ + FuncOperationInfo[] infos = platformClientUtil.getFrameworkService().getFuncOperationByModule(functionVO.getId(), "", true); + for (FuncOperationInfo info : infos) { + MenuVO menuVO = new MenuVO(); + menuVO.setChildType((int) type); + menuVO.setId(info.id); + menuVO.setFuncId(info.funcId); + menuVO.setCode(info.operIndentify); + menuVO.setOperId(info.operId); + menuVO.setName(info.operName); + menuVO.setAlias(info.operAlias); + menuVO.setRemark(info.operDesc); + menuVO.setSort((int) info.number); + menuVO.setModeType("FunctionObject"); + menuVO.setIsValid(info.isValid); + menuVO.setHasChildren(false); + functionVO.getChildren().add(menuVO); + } + }else{ + functionVO.setHasChildren(false); + } } @Override @@ -943,9 +912,9 @@ @Override public List<MenuVO> getSysModelAuthTreeMenuByPID(String parentId,String modeType,boolean isAll) throws VciBaseException, PLException { List<MenuVO> menuVOList = new ArrayList<>(); - if(Func.isBlank(parentId)){ - return menuVOList; - } +// if(Func.isBlank(parentId)){ +// return menuVOList; +// } SessionInfo sessionInfo = WebUtil.getCurrentUserSessionInfoNotException(); boolean adminOrDeveloperOrRoot = rightControlUtil.isAdminOrDeveloperOrRoot(sessionInfo.getUserId()); if (adminOrDeveloperOrRoot) { @@ -974,6 +943,7 @@ functionVO.setName(menu.name); functionVO.getMeta().put("keepAlive",false); functionVO.setSort((int) menu.seq); + findChildAuthFunctionVO(functionVO, isAll); // try { // functionVO.setChildren(findChildAuthFunctionVO(menu.id)); // } catch (PLException e) { @@ -989,58 +959,58 @@ } functionVOList.add(functionVO); } + return functionVOList; - - RoleRightInfo[] userRoleRights = rightControlUtil.getRoleRightByUserName(sessionInfo.getUserId()); - Map<String, List<FunctionInfo>> map = rightControlUtil.getAllChildrenFunctionsByUserName( - parentId, sessionInfo.getUserId(), userRoleRights); - - if(Func.isEmpty(map.get(parentId))) { - return functionVOList; - } - for (FunctionInfo menu : map.get(parentId)) { - if(!menu.isValid){ - continue; - } - MenuVO functionVO = new MenuVO(); - functionVO.setId(menu.id); - functionVO.setSource(menu.image); - //if(StringUtils.isBlank(menu.resourceB)){ - // continue; - //} - functionVO.setPath(menu.resourceB); - functionVO.setParentId(menu.parentId); - functionVO.setCode(menu.aliasName); - functionVO.setAlias(menu.aliasName); - functionVO.setName(menu.name); - functionVO.getMeta().put("keepAlive",false); - functionVO.setSort((int) menu.seq); -// try { -// functionVO.setChildren(findChildAuthFunctionVO(menu.id, map)); -// } catch (PLException e) { -// e.printStackTrace(); -// String errorMsg = "鑿滃崟鏌ヨ鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e); -// logger.error(errorMsg); -// throw new VciBaseException(errorMsg); +// RoleRightInfo[] userRoleRights = rightControlUtil.getRoleRightByUserName(sessionInfo.getUserId()); +// Map<String, List<FunctionInfo>> map = rightControlUtil.getAllChildrenFunctionsByUserName( +// parentId, sessionInfo.getUserId(), userRoleRights); +// +// if(Func.isEmpty(map.get(parentId))) { +// return functionVOList; +// } +// for (FunctionInfo menu : map.get(parentId)) { +// if(!menu.isValid){ +// continue; // } - if(functionVO.getChildren().size() > 0){ - functionVO.setHasChildren(true); - }else { - functionVO.setHasChildren(false); - } - functionVOList.add(functionVO); - } - //濡傛灉鏄紑鍙戞垨鑰呮祴璇曠敤鎴凤紝闇�鍝熻幏鍙栫郴缁熸ā鍧楅厤缃彍鍗� - if(adminOrDeveloperOrRoot){ - //鑾峰彇棣栭〉绯荤粺妯″潡閰嶇疆鑿滃崟 - MenuVO menuVO = JsonConfigReader.getSysModuleConf().getSysModuleNode(); - if(Func.isNotEmpty(menuVO)){ - functionVOList.add(menuVO); - } - } - return functionVOList.stream().sorted(Comparator.comparing(s -> s.getSort())).collect(Collectors.toList()); +// MenuVO functionVO = new MenuVO(); +// functionVO.setId(menu.id); +// functionVO.setSource(menu.image); +// //if(StringUtils.isBlank(menu.resourceB)){ +// // continue; +// //} +// functionVO.setPath(menu.resourceB); +// functionVO.setParentId(menu.parentId); +// functionVO.setCode(menu.aliasName); +// functionVO.setAlias(menu.aliasName); +// functionVO.setName(menu.name); +// functionVO.getMeta().put("keepAlive",false); +// functionVO.setSort((int) menu.seq); +//// try { +//// functionVO.setChildren(findChildAuthFunctionVO(menu.id, map)); +//// } catch (PLException e) { +//// e.printStackTrace(); +//// String errorMsg = "鑿滃崟鏌ヨ鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e); +//// logger.error(errorMsg); +//// throw new VciBaseException(errorMsg); +//// } +// if(functionVO.getChildren().size() > 0){ +// functionVO.setHasChildren(true); +// }else { +// functionVO.setHasChildren(false); +// } +// functionVOList.add(functionVO); +// } +// //濡傛灉鏄紑鍙戞垨鑰呮祴璇曠敤鎴凤紝闇�鍝熻幏鍙栫郴缁熸ā鍧楅厤缃彍鍗� +// if(adminOrDeveloperOrRoot){ +// //鑾峰彇棣栭〉绯荤粺妯″潡閰嶇疆鑿滃崟 +// MenuVO menuVO = JsonConfigReader.getSysModuleConf().getSysModuleNode(); +// if(Func.isNotEmpty(menuVO)){ +// functionVOList.add(menuVO); +// } +// } +// return functionVOList.stream().sorted(Comparator.comparing(s -> s.getSort())).collect(Collectors.toList()); diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/HMSysModConfigController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/HMSysModConfigController.java index 01f81e0..8f42517 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/HMSysModConfigController.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/HMSysModConfigController.java @@ -72,6 +72,25 @@ } } + + /** + * 鑾峰彇褰撳墠妯″潡涓嬬殑瀛愭ā鍧� + * @param parentId + * @param modeType + * @return + */ + @GetMapping("/getSysModelAuthTreeMenuByPID") + public BaseResult<List<MenuVO>> getSysModelAuthTreeMenuByPID(String parentId, String modeType) { + try { + return BaseResult.dataList(functionQueryService.getSysModelAuthTreeMenuByPID(parentId,modeType,true)); + }catch (Exception e){ + e.printStackTrace(); + String errorMsg = "鏌ヨ瀛愭ā鍧楁椂鍑虹幇閿欒锛屽師鍥狅細"+ VciBaseUtil.getExceptionMessage(e); + logger.error(errorMsg); + throw new VciBaseException(errorMsg); + } + } + /** * 娣诲姞妯″潡 * @param menuVO diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsQueryTemplateController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsQueryTemplateController.java index c81ec59..2db280d 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsQueryTemplateController.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsQueryTemplateController.java @@ -62,6 +62,7 @@ * 鏌ヨ妯℃澘鐨勫垪琛ㄦ坊鍔犱簡瀛楁鐨勭浉鍏冲睘鎬� * @param btmName 绫诲瀷 * @param linkFlag 鏄惁閾炬帴绫诲瀷 锛歵rue 閾炬帴绫诲瀷 锛宖alse 涓氬姟绫诲瀷 + * @param direction 姝e弽鏂瑰悜 * @return 鏌ヨ妯℃澘鐨勫垪琛� */ @GetMapping("/queryTemplateListByAttr") diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/UIManagerController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/UIManagerController.java index 324c57f..9540755 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/UIManagerController.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/UIManagerController.java @@ -3,9 +3,10 @@ import com.vci.corba.common.PLException; import com.vci.corba.portal.data.PLTabPage; import com.vci.corba.portal.data.PLUILayout; -import com.vci.dto.OsBtmTypeDTO; +import com.vci.dto.RoleRightDTO; +import com.vci.dto.UIAuthorDTO; +import com.vci.starter.web.pagemodel.Tree; import com.vci.pagemodel.PLUILayoutCloneVO; -import com.vci.starter.web.annotation.controller.VciUnCheckRight; import com.vci.starter.web.annotation.log.VciBusinessLog; import com.vci.starter.web.exception.VciBaseException; import com.vci.starter.web.pagemodel.BaseQueryObject; @@ -21,7 +22,6 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; -import java.util.Arrays; import java.util.List; /** @@ -266,4 +266,39 @@ } } + /** + * 鏍规嵁瑙掕壊鑾峰彇UI/琛ㄥ崟/鎸夐挳鐨勬潈闄�. + * @param baseQueryObject + * @return + */ + @GetMapping( "/getUIAuthor") + @VciBusinessLog(operateName = "UI鎺堟潈锛堟爲褰㈢粨鏋勶級") + public BaseResult getUIAuthor(BaseQueryObject baseQueryObject){ + try { + return BaseResult.dataList( uiManagerService.getUIAuthor(baseQueryObject)); + }catch (Throwable e) { + e.printStackTrace(); + String exceptionMessage = "UI鎺堟潈鍔犺浇鍑虹幇閿欒锛屽師鍥狅細" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); + } + } + + /*** + * @param selectTreeList 鍕鹃�夌殑闇�瑕佷繚瀛樼殑鏁版嵁瀵硅薄 + * @return + */ + @PostMapping( "/authorizedUI") + @VciBusinessLog(operateName = "UI鎺堟潈") + public BaseResult authorizedUI(UIAuthorDTO uiAuthorDTO){ + try { + return uiManagerService.authorizedUI(uiAuthorDTO)?BaseResult.success("鎺堟潈鎴愬姛!"):BaseResult.fail("鎺堟潈澶辫触锛�"); + }catch (Throwable e) { + e.printStackTrace(); + String exceptionMessage = "UI鎺堟潈鍑虹幇閿欒锛屽師鍥狅細" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); + } + } + } diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebPortalVIController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebPortalVIController.java index c14d6ed..6471de0 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebPortalVIController.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebPortalVIController.java @@ -32,10 +32,11 @@ import java.util.List; /** - * 鍏紡鎺у埗鍣� + * 琛ㄥ崟/琛ㄦ牸鎺у埗鍣� * @author weidy * @date 2022-2-11 */ +@VciBusinessLog(modelName="琛ㄥ崟/琛ㄦ牸鎺у埗鍣�",notStore=true) @RestController @RequestMapping("/portalVIController") public class WebPortalVIController { @@ -95,7 +96,7 @@ } /** - * 涓氬姟绫诲瀷鍒犻櫎 + * 琛ㄥ崟/table鍒犻櫎 * btmTypeDTO 涓氬姟绫诲瀷瀵硅薄 * @return 鍒犻櫎缁撴灉 */ @@ -112,7 +113,7 @@ } } /** - * 涓氬姟绫诲瀷鍒犻櫎 + * 琛ㄥ崟/table鍒犻櫎 * btmTypeDTO 涓氬姟绫诲瀷瀵硅薄 * @return 鍒犻櫎缁撴灉 */ @@ -128,8 +129,11 @@ return BaseResult.fail(exceptionMessage); } } + /** - * + * 琛ㄥ崟/table鍏嬮殕 + * @param portalVIDTOList clong瀵硅薄 + * @return */ @PostMapping("/clone") @VciBusinessLog(operateName = "鍏嬮殕琛ㄥ崟/琛ㄦ牸") diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsQuereyTemplateServiceI.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsQuereyTemplateServiceI.java index 96d2986..7f0b927 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsQuereyTemplateServiceI.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsQuereyTemplateServiceI.java @@ -157,6 +157,7 @@ * 鏌ヨ妯℃澘鐨勫垪琛ㄦ坊鍔犱簡瀛楁鐨勭浉鍏冲睘鎬� * @param btmName 绫诲瀷 * @param linkFlag 鏄惁閾炬帴绫诲瀷 锛歵rue 閾炬帴绫诲瀷 锛宖alse 涓氬姟绫诲瀷 + * @param direction 姝e弽鏂瑰悜 * @return 鏌ヨ妯℃澘鐨勫垪琛� */ BaseResult queryTemplateListByAttr(String btmName, Boolean linkFlag, String direction) throws PLException; diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/UIManagerServiceI.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/UIManagerServiceI.java index 3a61408..1bf3112 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/UIManagerServiceI.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/UIManagerServiceI.java @@ -1,17 +1,20 @@ package com.vci.web.service; import com.vci.corba.common.PLException; +import com.vci.corba.portal.data.PLUILayout; import com.vci.corba.portal.data.PLPageDefination; import com.vci.corba.portal.data.PLTabPage; -import com.vci.corba.portal.data.PLUILayout; -import com.vci.model.PLDefination; -import com.vci.pagemodel.PLDefinationVO; import com.vci.pagemodel.PLUILayoutCloneVO; +import com.vci.starter.web.exception.VciBaseException; import com.vci.starter.web.pagemodel.BaseQueryObject; import com.vci.starter.web.pagemodel.BaseResult; import com.vci.starter.web.pagemodel.DataGrid; +import com.vci.dto.RoleRightDTO; +import com.vci.dto.UIAuthorDTO; +import com.vci.starter.web.pagemodel.Tree; +import com.vci.model.PLDefination; +import com.vci.pagemodel.PLDefinationVO; import org.springframework.web.multipart.MultipartFile; - import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.List; @@ -139,4 +142,22 @@ //閰嶇疆鎸夐挳鐩稿叧鎺ュ彛 + + /** + * 鑾峰彇UI鏉冮檺鏍� + * @param baseQueryObject + * @return + * @throws VciBaseException + */ + List<Tree> getUIAuthor(BaseQueryObject baseQueryObject)throws Exception; + + /*** + * UI鎺堟潈 + * @param uiAuthorDTO + * @return + * @throws Exception + */ + public boolean authorizedUI(UIAuthorDTO uiAuthorDTO)throws Exception; + + } diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsPortalVIServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsPortalVIServiceImpl.java index f6ed246..36e1356 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsPortalVIServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsPortalVIServiceImpl.java @@ -168,6 +168,9 @@ } PortalVIVO portalVIVO=new PortalVIVO(); PortalVI portalVI= platformClientUtil.getPortalService().getPortalVIById(id); + if(portalVI==null||StringUtils.isBlank(portalVI.id)){ + throw new VciBaseException("鏍规嵁涓婚敭鏈煡璇㈠埌鏁版嵁"); + } portalVIVO=portalVIDOO2VO(portalVI); return portalVIVO; } @@ -640,7 +643,7 @@ boolean flag = false; String labelName=PortalVIType.Form.getName(); try { - VciBaseUtil.alertNotNull(portalVIDTO.getViName(),"鍚嶇О涓嶈兘涓虹┖锛�"); + VciBaseUtil.alertNotNull(portalVIDTO.getViName(),"鍚嶇О"); if(portalVIDTO.getPrm()==null||portalVIDTO.getPrm().getPrmItemList()==null||portalVIDTO.getPrm().getPrmItemList().size()==0){ throw new Throwable(labelName+"锛屾湭璁剧疆"); } @@ -985,6 +988,15 @@ prmItemDO.setItemHttpPathField(prmItemDTO.getItemHttpPathField()); if(viType==PortalVIType.Table.getIntVal()) {//濡傛灉鏄〃鏍� initTableConfigDTOO2DOData(prmItemDO,prmItemDTO); + }else{ + List<String> itemValueList=new ArrayList<>(); + List<KeyValue> keyValueList=prmItemDTO.getItemKeyValueList(); + Optional.ofNullable(keyValueList).orElseGet(()->new ArrayList<>()).stream().forEach(keyValue -> { + String value= keyValue.getValue()+"{"+keyValue.getKey()+"}"; + itemValueList.add(value); + }); + prmItemDO.setItemValueList(itemValueList); + } return prmItemDO; } @@ -1049,8 +1061,20 @@ prmItemVO.setItemIsHttpSave(prmItemDO.getItemIsHttpSave()); prmItemVO.setItemHttpVolumnPath(prmItemDO.getItemHttpVolumnPath()); prmItemVO.setItemHttpPathField(prmItemDO.getItemHttpPathField()); + if(viType==PortalVIType.Table.getIntVal()) {//濡傛灉鏄〃鏍� initTableConfigDOO2VOData(prmItemVO,prmItemDO); + }else{ + List<String> enumList= prmItemDO.getItemValueList(); + List<KeyValue>itemKeyValueList=new ArrayList<>(); + Optional.ofNullable(enumList).orElseGet(()->new ArrayList<>()).stream().forEach(enumValue->{ + List<String> keyValueList= VciBaseUtil.str2List(VciBaseUtil.removeComma(enumValue,"}"),"\\{"); + KeyValue keyValue=new KeyValue(); + keyValue.setKey(keyValueList.get(1)); + keyValue.setValue(keyValueList.get(0)); + itemKeyValueList.add(keyValue); + }); + prmItemVO.setItemKeyValueList(itemKeyValueList); } return prmItemVO; } @@ -1117,6 +1141,17 @@ prmItemDTO.setItemHttpPathField(prmItemDO.getItemHttpPathField()); if(viType==PortalVIType.Table.getIntVal()) {//濡傛灉鏄〃鏍� initTableConfigDOO2VOData(prmItemDTO,prmItemDO); + }else{ + List<String> enumList= prmItemDO.getItemValueList(); + List<KeyValue>itemKeyValueList=new ArrayList<>(); + Optional.ofNullable(enumList).orElseGet(()->new ArrayList<>()).stream().forEach(enumValue->{ + List<String> keyValueList= VciBaseUtil.str2List(VciBaseUtil.removeComma(enumValue,"}"),"\\{"); + KeyValue keyValue=new KeyValue(); + keyValue.setKey(keyValueList.get(1)); + keyValue.setValue(keyValueList.get(0)); + itemKeyValueList.add(keyValue); + }); + prmItemDTO.setItemKeyValueList(itemKeyValueList); } return prmItemDTO; } @@ -1258,7 +1293,6 @@ private List<String> getRefFormVIName(String refFormOid){ List<String> keyList=new ArrayList<>(); try { - PortalVI refFormVI = UITools.getService().getPortalVIById(refFormOid); PortalVIVO portalVIVO= portalVIDOO2VO(refFormVI); if(portalVIVO!=null&&portalVIVO.getPrm().getPrmItemList().size()>0){ 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 79a32e7..5b993f0 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 @@ -16,9 +16,7 @@ import com.vci.corba.omd.ltm.LinkType; import com.vci.corba.omd.qtm.QTD; import com.vci.corba.omd.qtm.QTInfo; -import com.vci.dto.AttributeDefDTO; -import com.vci.dto.QTDDTO; -import com.vci.dto.QTInfoDTO; +import com.vci.dto.*; import com.vci.omd.constants.SystemAttribute; import com.vci.omd.objects.OtherInfo; import com.vci.po.OsLinkTypePO; @@ -196,6 +194,9 @@ VciBaseUtil.alertNotNull(btName,"绫诲瀷鍚�"); QTInfo[] objTypeQTs = platformClientUtil.getQTDService().getObjTypeQTs(btName); List<QTInfoDTO> dtos = new ArrayList<>(); + Map<String, AttributeDef> allSysAttr = Arrays.stream(platformClientUtil.getBtmService().getSysAttributeDefs()).collect(Collectors.toMap(e -> e.name, e -> e)); + allSysAttr.putAll(Arrays.stream(platformClientUtil.getLinkTypeService().getSysAttributeDefs()).collect(Collectors.toMap(e -> e.name, e -> e))); + for (QTInfo obj : objTypeQTs) { QTInfoDTO qtInfoDTO = new QTInfoDTO(); qtInfoDTO.setCreator(obj.creator); @@ -206,13 +207,84 @@ qtInfoDTO.setQtUIText(obj.qtUIText); if(StringUtils.isNotBlank(obj.qtUIText)){ //灏嗙粰瀹氱殑String鏂囨湰瑙f瀽涓篨ML鏂囨。骞惰繑鍥炴柊鍒涘缓鐨刣ocument - qtInfoDTO.setTree(analysisXml(obj)); + qtInfoDTO.setTree(analysisXml(obj, allSysAttr)); } - qtInfoDTO.setQueryTemplate(OQTool.getQTByDoc(DocumentHelper.parseText(obj.qtText), obj.qtName)); + QueryTemplate qtByDoc = OQTool.getQTByDoc(DocumentHelper.parseText(obj.qtText), obj.qtName); + qtInfoDTO.setQueryTemplate(queryTemplateToDto(qtByDoc, allSysAttr)); qtInfoDTO.setCreateTimeText(DateFormatUtils.format(new Date(obj.createTime), DateUtil.PATTERN_DATETIME)); dtos.add(qtInfoDTO); } return BaseResult.dataList(dtos); + } + + /** + * 瀵硅薄杞崲 + * @param qtByDoc 妯℃澘瀵硅薄 + * @param allSysAttr 鎵�鏈夌郴缁熷睘鎬� + * @return 妯℃澘浼犺緭瀵硅薄 + * @throws PLException + */ + private QueryTemplateDTO queryTemplateToDto(QueryTemplate qtByDoc, Map<String, AttributeDef> allSysAttr) throws PLException { + QueryTemplateDTO dto = new QueryTemplateDTO(); + dto.setId(qtByDoc.getId()); + dto.setBtmType(qtByDoc.getBtmType()); + dto.setDirection(qtByDoc.getDirection()); + dto.setLevel(qtByDoc.getLevel()); + dto.setQueryChildrenFlag(qtByDoc.isQueryChildren()); + dto.setQueryISLeaf(qtByDoc.isQueryISLeaf()); + dto.setClauseList(qtByDoc.getClauseList()); + dto.setPageInfo(qtByDoc.getPageInfo()); + dto.setLinkType(qtByDoc.getLinkType()); + dto.setVersion(qtByDoc.getVersion()); + dto.setType(qtByDoc.getType()); + dto.setSecretFlag(qtByDoc.isSecretFlag()); + dto.setRightFlag(qtByDoc.isRightFlag()); + dto.setOrderInfoList(qtByDoc.getOrderInfoList()); + dto.setRecReturnMode(qtByDoc.getRecReturnMode()); + Condition con = qtByDoc.getCondition(); + if(con != null){ + ConditionDTO conDto = new ConditionDTO(); + conDto.setRootCIName(con.getRootCIName()); + Map<String, ConditionItem> ciMap = con.getCIMap(); + Map<String, ConditionItemDTO> ciMapDto = new HashMap<>(); + for (String key : ciMap.keySet()) { + ConditionItem item = ciMap.get(key); + LeafInfo leafInfo = item.getLeafInfo(); + ConditionItemDTO itemDTO = new ConditionItemDTO(); + itemDTO.setChildrenInfo(item.getChildrenInfo()); + itemDTO.setId(item.getId()); + itemDTO.setLeafFlag(item.isLeaf()); + ciMapDto.put(key, itemDTO); + if(leafInfo == null){ + continue; + } + LeafInfoDTO leafInfoDTO = new LeafInfoDTO(); + itemDTO.setLeafInfo(leafInfoDTO); + //澶勭悊鏌ヨ瀛楁绫诲瀷 + String column = leafInfo.getClause(); + if(column.contains(".")){ + column = StringUtils.substringAfterLast(column, "."); + } + AttributeDef att = platformClientUtil.getAttributeService().getAttributeDefByName(column); + if(att == null || "".equals(att.oid)){ + att = allSysAttr.get(column.toLowerCase()); + } + leafInfoDTO.setClause(leafInfo.getClause()); + + leafInfoDTO.setOperator(leafInfo.getOperator()); + leafInfoDTO.setType(att.vtDataType); + if(leafInfo.getValue() != null ){ + LeafValueDto valueDto = new LeafValueDto(); + valueDto.setOrdinaryValue(leafInfo.getValue().getOrdinaryValue()); + valueDto.setQueryTemplate(leafInfo.getValue().getQueryTemplate() != null ? queryTemplateToDto(leafInfo.getValue().getQueryTemplate(),allSysAttr) : null); + leafInfoDTO.setValue(valueDto); + } + + } + conDto.setCIMap(ciMapDto); + dto.setCondition(conDto); + } + return dto; } /** @@ -221,14 +293,13 @@ * @return * @throws DocumentException */ - private HashMap<String,Object> analysisXml(QTInfo obj) throws DocumentException { + private HashMap<String,Object> analysisXml(QTInfo obj, Map<String, AttributeDef> allSysAttr) throws DocumentException, PLException { org.dom4j.Document document = DocumentHelper.parseText(obj.qtUIText); if(document == null){ return null; } //鑾峰彇鏍硅妭鐐�,鍦ㄤ緥瀛愪腑灏辨槸responsedata鑺傜偣 Element root = document.getRootElement(); - List<HashMap<String,Object>> treeList = new ArrayList<>(); HashMap<String,Object> treeMap = new HashMap<>(); treeMap.put("connector",root.getText()); List<Element> children = root.elements(); @@ -236,9 +307,20 @@ for(Iterator<Element> i = children.iterator(); i.hasNext();){ Element child = i.next(); if(AND.equals(child.getText()) || OR.equals(child.getText())){ - childList.add(addDefaultMutableTree(child)); + childList.add(addDefaultMutableTree(child, allSysAttr)); }else { - childList.add(child.getText().trim()); + String column = StringUtils.substringBefore(child.getText().trim(), " "); + + if(column.contains(".")){ + column = StringUtils.substringAfterLast(column, "."); + } + AttributeDef att = platformClientUtil.getAttributeService().getAttributeDefByName(column); + if(att == null || "".equals(att.oid)){ + att = allSysAttr.get(column.toLowerCase()); + } + HashMap<String, String> data = new HashMap<>(); + data.put("column",child.getText().trim()); + data.put("type",att.vtDataType); } } treeMap.put("child",childList); @@ -249,7 +331,7 @@ * 灏嗗瓙鑺傜偣杞负map缁撴瀯 * @param element */ - public Map<String, Object> addDefaultMutableTree(Element element){ + public Map<String, Object> addDefaultMutableTree(Element element, Map<String, AttributeDef> allSysAttr) throws PLException { List<Object> childList = new ArrayList<>(); List<Element> children = element.elements(); HashMap<String,Object> treeMap = new HashMap<>(); @@ -257,9 +339,21 @@ for(Iterator<Element> i = children.iterator(); i.hasNext();){ Element child = i.next(); if(AND.equals(child.getText()) || OR.equals(child.getText())){ - childList.add(addDefaultMutableTree(child)); + childList.add(addDefaultMutableTree(child, allSysAttr)); }else { - childList.add(child.getText().trim()); + String column = StringUtils.substringBefore(child.getText().trim(), " "); + + if(column.contains(".")){ + column = StringUtils.substringAfterLast(column, "."); + } + AttributeDef att = platformClientUtil.getAttributeService().getAttributeDefByName(column); + if(att == null || "".equals(att.oid)){ + att = allSysAttr.get(column.toLowerCase()); + } + HashMap<String, String> data = new HashMap<>(); + data.put("column",child.getText().trim()); + data.put("type",att.vtDataType); + childList.add(data); } } treeMap.put("child",childList); @@ -1571,51 +1665,27 @@ tree.put("children", childList); return BaseResult.success(tree); } - + /** + * 鏌ヨ妯℃澘鐨勫垪琛ㄦ坊鍔犱簡瀛楁鐨勭浉鍏冲睘鎬� + * @param btmName 绫诲瀷 + * @param linkFlag 鏄惁閾炬帴绫诲瀷 锛歵rue 閾炬帴绫诲瀷 锛宖alse 涓氬姟绫诲瀷 + * @param direction 姝e弽鏂瑰悜 + * @return 鏌ヨ妯℃澘鐨勫垪琛� + */ @Override public BaseResult queryTemplateListByAttr(String btmName, Boolean linkFlag, String direction) throws PLException { //杩斿洖鐨勭晫闈笅鎷夋鏄剧ず鏍� List<QTDDTO> qtddtos = new ArrayList<>(); - + //灏嗛摼鎺ョ被鍨嬩笌涓氬姟绫诲瀷鐨勬墍鏈夐粯璁ゅ瓧娈垫煡璇㈠嚭鏉ユ斁鍒癿ap閲岄潰鏂逛究鍚庣画璋冪敤 Map<String, AttributeDef> allSysAttr = Arrays.stream(platformClientUtil.getBtmService().getSysAttributeDefs()).collect(Collectors.toMap(e -> e.name, e -> e)); - -// if(linkFlag){ -// QTD[] qtdArray = platformClientUtil.getQTDService().getLinkTypeQTDs(btmName); -// for (QTD qtd : qtdArray) { -// QTDDTO qtddto = new QTDDTO(); -// qtddto.setName(qtd.name); -// qtddto.setCreateTime(qtd.createTime); -// qtddto.setLinkTypeName(qtd.linkTypeName); -// qtddto.setBtmName(qtd.btmName); -// qtddto.setCreator(qtd.creator); -// for (String abName : qtd.abNames) { -// AttributeDef att = platformClientUtil.getAttributeService().getAttributeDefByName(abName); -// AttributeDefDTO attrDto = new AttributeDefDTO(); -// attrDto.setDescription(att.description); -// attrDto.setLabel(att.label); -// attrDto.setOid(att.oid); -// attrDto.setCreator(att.creator); -// attrDto.setName(att.name); -// attrDto.setDefValue(att.defValue); -// attrDto.setRage(att.rage); -// attrDto.setVtDataType(att.vtDataType); -// attrDto.setOther(att.other); -// qtddto.getAttrs().add(attrDto); -// } -// qtddtos.add(qtddto); -// } -// -// }else { -// Map<String, AttributeDef> lSysAttr = Arrays.stream(platformClientUtil.getLinkTypeService().getSysAttributeDefs()).collect(Collectors.toMap(e -> e.name, e -> e)); allSysAttr.putAll(Arrays.stream(platformClientUtil.getLinkTypeService().getSysAttributeDefs()).collect(Collectors.toMap(e -> e.name, e -> e))); QTD[] qtdArray = null; + //鏌ヨ鐩稿叧绫诲瀷鐨勬煡璇㈡ā鏉胯繘琛屽鐞� if(linkFlag){ qtdArray = platformClientUtil.getQTDService().getLinkTypeQTDs(btmName); }else { qtdArray = platformClientUtil.getQTDService().getBizTypeQTDs(btmName); } - -// QTD[] for (QTD qtd : qtdArray) { QTDDTO qtddto = new QTDDTO(); qtddto.setName(qtd.name); @@ -1625,13 +1695,20 @@ qtddto.setCreator(qtd.creator); for (String abName : qtd.abNames) { AttributeDef att = platformClientUtil.getAttributeService().getAttributeDefByName(abName); + //濡傛灉鍦ㄥ睘鎬ф帴鍙d腑娌℃湁鏌ュ埌鐩稿叧瀛楁搴旇灏卞湪榛樿瀛楁涓� if(att == null || "".equals(att.oid)){ att = allSysAttr.get(abName.toLowerCase()); } if(direction != null) { if (direction.equals(QTConstants.DIRECTION_POSITIVE)) { + if(att == null ){ + throw new PLException("500",new String[]{"灞炴�у瓧娈�:"+ abName +"鏈煡璇㈠埌锛岃纭锛�"}); + } att.name = "T_OID." + abName; } else if (direction.equals(QTConstants.DIRECTION_OPPOSITE)) { + if(att == null ){ + throw new PLException("500",new String[]{"灞炴�у瓧娈�:"+ abName +"鏈煡璇㈠埌锛岃纭锛�"}); + } att.name = "F_OID." + abName; } }else{ @@ -1653,9 +1730,14 @@ } qtddtos.add(qtddto); } -// } - return BaseResult.dataList(Arrays.asList(qtddtos)); + return BaseResult.dataList(qtddtos); } + + /** + * 瀛愯妭鐐瑰鐞� + * @param attributeDefByName 鐖惰妭鐐圭殑灞炴�т俊鎭� + * @param allSysAttr 鎵�鏈夐粯璁ゅ瓧娈� + */ private void addNode(AttributeDefDTO attributeDefByName, Map<String, AttributeDef> allSysAttr){ if(attributeDefByName.getLayersNum() >= 3){ @@ -1666,7 +1748,6 @@ if(abName.contains(".")){ abName = abName.substring(abName.lastIndexOf(".") + 1); } -// qtddto.getAttrs().add(attributeDefByName); if(SystemAttribute.sysAttList().contains(abName.toUpperCase())){ return; } @@ -1706,10 +1787,7 @@ addNode(attrDto, allSysAttr); } //绯荤粺灞炴�D,NAME,DESCRIPTION -// AttributeDef[] sysAttributeDefs = platformClientUtil.getBtmService().getSysAttributeDefs(); -// for (int i = 0; i < sysAttributeDefs.length; i++) { for (int i = 0; i < SystemAttribute.bosysAttList().size(); i++) { -// addNode(node, new DefaultMutableTreeNode(pName + SystemAttribute.bosysAttList().get(i))); AttributeDef attributeDef = allSysAttr.get(SystemAttribute.bosysAttList().get(i).toLowerCase()); AttributeDefDTO attrDto = new AttributeDefDTO(); attrDto.setDescription(attributeDef.description); @@ -1743,7 +1821,6 @@ String[] abNames = link.attributes; for(int i = 0; i < abNames.length; i++){ String abName_ = abNames[i]; -// DefaultMutableTreeNode node_ = new DefaultMutableTreeNode(pName + abName_); AttributeDef att = platformClientUtil.getAttributeService().getAttributeDefByName(abName_); if(att == null || att.oid.equals("")){ att = allSysAttr.get(abName_.toLowerCase()); @@ -1764,11 +1841,6 @@ } //绯荤粺灞炴�D,NAME,DESCRIPTION for (int i = 0; i < SystemAttribute.losysAttList().size(); i++) { -// addNode(node, new DefaultMutableTreeNode(pName + SystemAttribute.losysAttList().get(i))); -// } -// AttributeDef[] sysAttributeDefs = platformClientUtil.getLinkTypeService().getSysAttributeDefs(); -// for (int i = 0; i < sysAttributeDefs.length; i++) { -// addNode(node, new DefaultMutableTreeNode(pName + SystemAttribute.bosysAttList().get(i))); AttributeDef sysAttributeDefs = allSysAttr.get(SystemAttribute.losysAttList().get(i).toLowerCase()); AttributeDefDTO attrDto = new AttributeDefDTO(); attrDto.setDescription(sysAttributeDefs.description); 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 b3595cf..ff8396d 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 @@ -1,22 +1,36 @@ package com.vci.web.service.impl; +import com.sun.jnlp.ApiDialog; import com.vci.client.mw.ClientContextVariable; import com.vci.common.qt.object.QTConstants; import com.vci.common.utility.ObjectUtility; import com.vci.corba.common.PLException; +import com.vci.corba.framework.data.RoleRightInfo; +import com.vci.corba.omd.btm.BizType; import com.vci.corba.portal.PortalService; import com.vci.corba.portal.data.*; +import com.vci.dto.RoleRightDTO; +import com.vci.dto.UIAuthorDTO; +import com.vci.frameworkcore.compatibility.SmRoleQueryServiceI; +import com.vci.pagemodel.OsBtmTypeVO; import com.vci.model.PLDefination; import com.vci.pagemodel.PLDefinationVO; import com.vci.pagemodel.PLUILayoutCloneVO; +import com.vci.pagemodel.RoleRightVO; import com.vci.starter.web.exception.VciBaseException; +import com.vci.starter.web.pagemodel.*; import com.vci.starter.web.pagemodel.BaseQueryObject; import com.vci.starter.web.pagemodel.BaseResult; import com.vci.starter.web.pagemodel.DataGrid; import com.vci.starter.web.pagemodel.SessionInfo; import com.vci.starter.web.util.VciBaseUtil; +import com.vci.starter.web.util.VciDateUtil; import com.vci.starter.web.util.WebThreadLocalUtil; +import com.vci.web.service.OsBtmServiceI; import com.vci.web.service.UIManagerServiceI; +import com.vci.web.util.*; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.ss.formula.functions.T; import com.vci.web.util.Func; import com.vci.web.util.PlatformClientUtil; import com.vci.web.util.UITools; @@ -32,6 +46,9 @@ import javax.swing.*; import javax.swing.text.JTextComponent; import java.io.IOException; +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; import java.util.*; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -49,6 +66,18 @@ */ @Resource private PlatformClientUtil platformClientUtil; + + /** + * 瑙掕壊 + */ + @Resource + private SmRoleQueryServiceI smRoleQueryServiceI; + + /** + * 涓氬姟绫诲瀷 + */ + @Resource + private OsBtmServiceI osBtmServiceI; /** * 鏃ュ織 @@ -95,6 +124,37 @@ List<PLUILayout> pluiLayouts = Arrays.asList(res); dataGrid.setData(pluiLayouts); return dataGrid; + } + + /** + * ton閫氳繃涓氬姟绫诲瀷鍜屽悕绉版煡璇� + * @param btemName + * @param context + * @return + * @throws PLException + */ + public List<PLUILayout> getUIContextDataByBtName(String btemName,String context) throws PLException { + VciBaseUtil.alertNotNull(btemName,"涓氬姟绫诲瀷"); + List<PLUILayout> pluiLayoutList=new ArrayList<>(); + List<String> contextList= VciBaseUtil.str2List(context); + if(StringUtils.isNotBlank(context)){ + contextList=VciBaseUtil.str2List(context); + }else{ + contextList.add(""); + } + contextList.stream().forEach(code->{ + PLUILayout[] pluiLayouts= new PLUILayout[0]; + try { + pluiLayouts = platformClientUtil.getUIService().getPLUILayoutEntityByTypeAndCode(btemName,code); + } catch (PLException e) { + e.printStackTrace(); + } + if(pluiLayouts!=null&&pluiLayouts.length>0) { + pluiLayoutList.addAll(Arrays.stream(pluiLayouts).collect(Collectors.toList())); + } + }); + + return pluiLayoutList; } /** @@ -726,6 +786,282 @@ } /** + * 鑾峰彇UI鎺堟潈鏍� + * @param treeQueryObject + * @return + * @throws Exception + */ + @Override + public List<Tree> getUIAuthor(BaseQueryObject treeQueryObject) throws Exception { + + Map<String, String> conditionMap = treeQueryObject.getConditionMap(); + if (conditionMap == null) { + conditionMap = new HashMap<>(); + } + String roleId = StringUtils.isBlank(conditionMap.get("roleId")) ? "" : conditionMap.get("roleId"); + String type = StringUtils.isBlank(conditionMap.get("type")) ? "" : conditionMap.get("type"); + String context = StringUtils.isBlank(conditionMap.get("context")) ? "" : conditionMap.get("context"); + boolean showCheckBox = Boolean.parseBoolean(conditionMap.get("showCheckBox")); + Map<String,RoleRightVO> roleRightVOMap=new HashMap<>(); + if(StringUtils.isNotBlank(roleId)){ + String userName= WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId(); + RoleRightInfo[] rightInfos= platformClientUtil.getFrameworkService().getRoleRightList(roleId,userName); + List<RoleRightVO> roleRightVOList=roleRightDOO2VOS(Arrays.asList(rightInfos)); + roleRightVOMap=roleRightVOList.stream().collect(Collectors.toMap(RoleRightVO::getFuncId,roleRightVO ->roleRightVO)); + } + BizType[] bizTypes=osBtmServiceI.getBizTypes(type); + List<Tree> treeList=new ArrayList<>(); + Tree rootNode =new Tree("root","鍔熻兘妯″潡","root"); + rootNode.setLevel(0); + rootNode.setShowCheckbox(true); + rootNode.setExpanded(true); + List<Tree> childList=new ArrayList<>(); + for (int i = 0; i < bizTypes.length; i++) { + Tree bizTypeTree = new Tree(bizTypes[i].oid,bizTypes[i].name,bizTypes[i]);//(btmItems[i].label+" ["+ btmItems[i].name+"]", btmItems[i]); + bizTypeTree.setLevel(1); + bizTypeTree.setShowCheckbox(true); + bizTypeTree.setParentId(rootNode.getOid()); + bizTypeTree.setParentName(rootNode.getText()); + bizTypeTree.setShowCheckbox(true); + bizTypeTree.setParentBtmName(bizTypes[i].name); + childList.add(bizTypeTree); + if(roleRightVOMap.containsKey(bizTypes[i].oid)){ + List<PLUILayout>contextList=getUIContextDataByBtName(bizTypes[i].name,context); + List<Tree> btmChildList=new ArrayList<>(); + btmChildList.add(bizTypeTree); + setChildNode(btmChildList,contextList,roleRightVOMap,showCheckBox); + } + } + rootNode.setChildren(childList); + treeList.add(rootNode); + return treeList; + } + + @Override + public boolean authorizedUI(UIAuthorDTO uiAuthorDTO) throws Exception { + boolean res=false; + if(uiAuthorDTO==null||CollectionUtil.isEmpty(uiAuthorDTO.getSelectTreeList())){ + throw new VciBaseException("璇烽�夋嫨鑺傜偣杩涜鎺堟潈!"); + } + BaseQueryObject treeQueryObject=new BaseQueryObject(); + Map<String,String> conditionMap = new HashMap<>(); + conditionMap.put("roleId",uiAuthorDTO.getRoleId()); + conditionMap.put("type",uiAuthorDTO.getType()); + conditionMap.put("context",uiAuthorDTO.getContext()); + conditionMap.put("showCheckBox","true"); + treeQueryObject.setConditionMap(conditionMap); + List<Tree> treeList=this.getUIAuthor(treeQueryObject); + HashMap<String,Tree> allTreeMap=new HashMap<>(); + if(!CollectionUtil.isEmpty(treeList)){ + convertTreeDOO2Map(treeList,allTreeMap); + List<RoleRightDTO> roleRightDTOList=new ArrayList<>(); + List<Tree> selectTreeList= uiAuthorDTO.getSelectTreeList(); + getRoleRightDTOS(uiAuthorDTO.getRoleId(),selectTreeList,allTreeMap,roleRightDTOList); + } + return res; + } + + private void getRoleRightDTOS(String roleOid,List<Tree> selectTreeList,HashMap<String,Tree> allTreeMap, List<RoleRightDTO> roleRightDTOList){ + 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) {// + + + }else if (data instanceof PLTabButton) {//鎸夐挳 + + } + }); + + + + } + + /** + * + * @param treeList 鏍戣妭鐐� + * @param allTreeMap锛屾墍鏈夌殑鑺傜偣 + */ + private void convertTreeDOO2Map(List<Tree> treeList,Map<String,Tree> allTreeMap){ + Optional.ofNullable(treeList).orElseGet(()->new ArrayList<Tree>()).stream().forEach(tree -> { + List<Tree> childTreeList= tree.getChildren(); + allTreeMap.put(tree.getOid(),tree); + if(!CollectionUtil.isEmpty(childTreeList)){ + convertTreeDOO2Map(childTreeList,allTreeMap); + } + }); + } + private void setChildNode(List<Tree> parentTree, List<PLUILayout>contextList,Map<String,RoleRightVO> roleRightVOMap,boolean isShowCheckBox){ + Optional.ofNullable(parentTree).orElseGet(()->new ArrayList<Tree>()).stream().forEach(pTree -> { + Object funcObj= pTree.getData(); + List<Tree> chiledTreeList=new ArrayList<>(); + if (funcObj instanceof BizType) {//涓氬姟绫诲瀷 + BizType bizType = (BizType) funcObj; + if(!CollectionUtil.isEmpty(contextList)) { + contextList.stream().forEach(context->{ + Tree childTree=new Tree(context.plOId,context.plName+"("+context.plCode+")",context); + childTree.setParentName(pTree.getText()); + childTree.setParentBtmName(pTree.getParentBtmName()); + childTree.setParentId(pTree.getOid()); + childTree.setLevel(pTree.getLevel()+1); + childTree.setShowCheckbox(isShowCheckBox); + chiledTreeList.add(childTree); + }); + pTree.setChildren(chiledTreeList); + } + if(!CollectionUtil.isEmpty(chiledTreeList)) { + setChildNode(chiledTreeList, contextList, roleRightVOMap, isShowCheckBox); + } + }else if (funcObj instanceof PLUILayout){//UI + PLUILayout context = (PLUILayout) funcObj; + PLTabPage[] pages = new PLTabPage[0]; + try { + pages = platformClientUtil.getUIService().getPLTabPagesByPageDefinationOId(context.plOId); + } catch (PLException e) { + e.printStackTrace(); + } + if(pages!=null&&pages.length>0){ + List<PLTabPage> plTabPageList= Arrays.stream(pages).collect(Collectors.toList()); + plTabPageList.stream().forEach(plTabPage -> { + Tree childTree=new Tree(plTabPage.plOId,plTabPage.plName,plTabPage); + childTree.setParentName(pTree.getText()); + childTree.setParentId(pTree.getOid()); + childTree.setParentBtmName(pTree.getParentBtmName()); + childTree.setLevel(pTree.getLevel()+1); + childTree.setShowCheckbox(isShowCheckBox); + chiledTreeList.add(childTree); + }); + pTree.setChildren(chiledTreeList); + } + if(!CollectionUtil.isEmpty(chiledTreeList)) { + setChildNode(chiledTreeList, contextList, roleRightVOMap, isShowCheckBox); + } + + }else if (funcObj instanceof PLTabPage) {//涓婁笅鏂� + PLTabPage plTabPage = (PLTabPage) funcObj; + List<PLPageDefination>plPageDefinationList=new ArrayList<>(); + try { + PLPageDefination[] pLPageDefinations = platformClientUtil.getUIService().getPLPageDefinationsByPageContextOId(plTabPage.plOId); + if(pLPageDefinations!=null&&pLPageDefinations.length>0){ + plPageDefinationList= Arrays.stream(pLPageDefinations).collect(Collectors.toList()); + plPageDefinationList.stream().forEach(plPageDefination -> { + Tree childTree=new Tree(plPageDefination.plOId,plPageDefination.name,plPageDefination); + childTree.setParentName(pTree.getText()); + childTree.setParentId(pTree.getOid()); + childTree.setParentBtmName(pTree.getParentBtmName()); + childTree.setLevel(pTree.getLevel()+1); + childTree.setShowCheckbox(isShowCheckBox); + chiledTreeList.add(childTree); + }); + pTree.setChildren(chiledTreeList); + } + if(!CollectionUtil.isEmpty(chiledTreeList)) { + setChildNode(chiledTreeList, contextList, roleRightVOMap, isShowCheckBox); + } + } catch (PLException e) { + e.printStackTrace(); + } + + }else if (funcObj instanceof PLPageDefination) {// + PLPageDefination plPageDefination = (PLPageDefination) funcObj; + try { + List<PLTabButton>plTabButtonList=new ArrayList<>(); + PLTabButton[] pLTabButtons = platformClientUtil.getUIService().getPLTabButtonsByTableOId(plPageDefination.plOId); + if(pLTabButtons!=null&&pLTabButtons.length>0){ + plTabButtonList= Arrays.stream(pLTabButtons).collect(Collectors.toList()); + plTabButtonList.stream().forEach(plTabButton -> { + Tree childTree=new Tree(plTabButton.plOId,plTabButton.plLabel,plTabButton); + childTree.setParentName(pTree.getText()); + childTree.setParentId(pTree.getOid()); + childTree.setParentBtmName(pTree.getParentBtmName()); + childTree.setLevel(pTree.getLevel()+1); + childTree.setShowCheckbox(isShowCheckBox); + childTree.setLeaf(true); + chiledTreeList.add(childTree); + }); + pTree.setChildren(chiledTreeList); + } + if(!CollectionUtil.isEmpty(chiledTreeList)) { + setChildNode(chiledTreeList, contextList, roleRightVOMap, isShowCheckBox); + } + } catch (PLException e) { + e.printStackTrace(); + } + + }else if (funcObj instanceof PLTabButton) {//鎸夐挳 + PLTabButton plTabButton= (PLTabButton) funcObj; + String id =plTabButton.plTableOId; + if(roleRightVOMap.containsKey(id)){ + RoleRightVO roleRightVO = roleRightVOMap.get(id); + Long rightValue = roleRightVO.getRightValue(); + int nodeValue = plTabButton.plSeq; + if (nodeValue >= 0 && nodeValue <= 63) { + long preValue = (rightValue >> nodeValue) & 1; + if (preValue == 1) { + pTree.setChecked(true); + } + } + }else{ + pTree.setChecked(false); + } + } + }); + } + /** + * UI瑙掕壊瀵硅薄杞崲 + * @param infos + * @return + */ + private List<RoleRightVO> roleRightDOO2VOS(List<RoleRightInfo> infos){ + List<RoleRightVO> roleRightVOS=new ArrayList<>(); + Optional.ofNullable(infos).orElseGet(()->new ArrayList<>()).stream().forEach(info -> { + RoleRightVO vo=roleRightDOO2VO(info); + roleRightVOS.add(vo); + }); + + return roleRightVOS; + } + + /** + * UI瑙掕壊瀵硅薄杞崲 + * @param info + * @return + */ + private RoleRightVO roleRightDOO2VO(RoleRightInfo info){ + RoleRightVO vo=new RoleRightVO(); + vo.setId(info.id); + vo.setCreateTime(VciDateUtil.date2Str(VciDateUtil.long2Date(info.createTime),"")); + vo.setCreateUser(info.createUser); + vo.setRoleId(info.roleId); + vo.setRightType(info.rightType); + vo.setLicensor(info.licensor); + vo.setRightValue(info.rightValue); + vo.setFuncId(info.funcId); + vo.setModifyTime(VciDateUtil.date2Str(VciDateUtil.long2Date(info.modifyTime),"")); + vo.setModifyUser(info.modifyUser); + return vo; + } + + /** * 鎺у埗鍖鸿妭鐐瑰強鍏跺瓙鑺傜偣鐨勫厠闅� * @param obj */ diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/tt.xml b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/tt.xml new file mode 100644 index 0000000..77520d7 --- /dev/null +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/tt.xml @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="UTF-8"?> +<JD_DATASET> + <JD_SHOWCOLS>3</JD_SHOWCOLS> + <JD_FORMQTNAME></JD_FORMQTNAME> + <JD_ITEM> + <JD_field></JD_field> + <JD_or></JD_or> + <JD_eq></JD_eq> + <JD_trim></JD_trim> + <JD_dbl>0</JD_dbl> + <JD_cut></JD_cut> + <JD_inObj>assignedpartform</JD_inObj> + <JD_addFilter>test闄勫姞鏌ヨ鏉′欢</JD_addFilter> + <JD_outType></JD_outType> + <JD_pageSize>10</JD_pageSize> + <JD_imgWH>60,</JD_imgWH> + <JD_outFields>workcontextoid.productnumber,isexpire,partoid.name</JD_outFields> + <JD_keyFields></JD_keyFields> + <JD_bat></JD_bat> + <JD_txf></JD_txf> + <JD_name></JD_name> + <JD_type></JD_type> + <JD_value></JD_value> + <JD_showExpression></JD_showExpression> + <JD_dateFormat></JD_dateFormat> + <JD_cols></JD_cols> + <JD_rows></JD_rows> + <JD_style></JD_style> + <JD_script></JD_script> + <JD_tips></JD_tips> + <JD_valuelist></JD_valuelist> + <JD_listTable></JD_listTable> + <JD_listTxt></JD_listTxt> + <JD_listVal></JD_listVal> + <JD_isEditable></JD_isEditable> + <JD_EditableProgram></JD_EditableProgram> + <JD_qtName></JD_qtName> + <JD_isRequired></JD_isRequired> + <JD_seniorQueryCols></JD_seniorQueryCols> + <JD_seniorQueryColsCounts></JD_seniorQueryColsCounts> + <JD_hrefFields></JD_hrefFields> + <JD_hrefConf></JD_hrefConf> + <JD_queryRefFields></JD_queryRefFields> + <JD_customClass></JD_customClass> + <JD_ctrlDisplyCol></JD_ctrlDisplyCol> + <JD_ctrlDisplyCondition></JD_ctrlDisplyCondition> + <JD_isHttpSave></JD_isHttpSave> + <JD_httpVolumnPath></JD_httpVolumnPath> + <JD_httpPathField></JD_httpPathField> + <JD_editCondition></JD_editCondition> + <JD_isNavigatorExpand>true</JD_isNavigatorExpand> + <JD_isShowFolder>true</JD_isShowFolder> + <JD_parentFolderName>father</JD_parentFolderName> + <JD_filterColWidth>250</JD_filterColWidth> + <JD_QuerySql></JD_QuerySql> + <JD_right></JD_right> + </JD_ITEM> +</JD_DATASET> \ No newline at end of file diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/resources/application-dev.yml b/Source/plt-web/plt-web-parent/plt-web/src/main/resources/application-dev.yml index 0ac1964..c541904 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/resources/application-dev.yml +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/resources/application-dev.yml @@ -6,7 +6,7 @@ private-token-key: vciweb20210212 ###tomcat鐩稿叧鐨勯厤缃� server: - port: 12000 + port: 12005 servlet: context-path: /web tomcat: @@ -42,7 +42,7 @@ host: localhost # ip鍦板潃 database: 2 # redis鏁版嵁搴� 0-15 port: 6379 # 绔彛鍙� - password: 123456 # 鏃犲瘑鐮佷笉濉� + password: foobared # 鏃犲瘑鐮佷笉濉� timeout: 30000s # 杩炴帴瓒呮椂鏃堕棿 锛堥粯璁�1澶╋級 lettuce: shutdown-timeout: 100ms # 鍏抽棴瓒呮椂鏃堕棿 榛樿 100ms diff --git a/Source/plt-web/plt-web-ui/src/App.vue b/Source/plt-web/plt-web-ui/src/App.vue index 0664619..421e759 100644 --- a/Source/plt-web/plt-web-ui/src/App.vue +++ b/Source/plt-web/plt-web-ui/src/App.vue @@ -50,6 +50,7 @@ } .dialog-footer{ background-color: #ffffff; + z-index: 10000; } .avue-crud .avue-form { margin: 0px auto !important; // 琛ㄦ牸鍐呯殑琛ㄥ崟锛堟瘮濡�:鎼滅储鏍忥級 鍙栨秷涓嬭竟璺� diff --git a/Source/plt-web/plt-web-ui/src/api/queryTemplate/linkTypeQuery.js b/Source/plt-web/plt-web-ui/src/api/queryTemplate/linkTypeQuery.js index 6e55884..c8539ec 100644 --- a/Source/plt-web/plt-web-ui/src/api/queryTemplate/linkTypeQuery.js +++ b/Source/plt-web/plt-web-ui/src/api/queryTemplate/linkTypeQuery.js @@ -26,3 +26,33 @@ params:params }); } +// 鏌ヨ鏉′欢鐨勬煡璇㈡帴鍙o紝鎺ュ彛鏂瑰紡POST锛屽弬鏁颁笌淇濆瓨鎺ュ彛浼犲弬涓�鑷� +export function getCriteria(params) { + return request({ + url: "/api/templateController/getCriteria", + method: "post", + data:params + }); +} + +// 瀵煎嚭 +export function expLinkTemplate (params) { + return request({ + url: '/api/templateController/expLinkTemplate', + method: 'get', + //headers: {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'}, + responseType: 'blob', + params + }) +} + +// 瀵煎叆 +export function impLinkTemplate (params) { + return request({ + url: '/api/templateController/impLinkTemplate', + method: 'get', + headers: {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'}, + responseType: 'blob', + params + }) +} diff --git a/Source/plt-web/plt-web-ui/src/api/queryTemplate/queryDefine.js b/Source/plt-web/plt-web-ui/src/api/queryTemplate/queryDefine.js index 4d9946c..71c3460 100644 --- a/Source/plt-web/plt-web-ui/src/api/queryTemplate/queryDefine.js +++ b/Source/plt-web/plt-web-ui/src/api/queryTemplate/queryDefine.js @@ -1,6 +1,7 @@ import request from '@/router/axios'; //鏌ヨ妯℃澘瀹氫箟 // 妯℃澘鍒楄〃瀹氫箟涓嬫媺妗嗘煡璇� +//btmName: 绫诲瀷鍚�, linkFlag: 鏄惁閾炬帴绫诲瀷 export function gridTemplate(params) { return request({ url: "/api/templateController/queryTemplateList", @@ -11,6 +12,27 @@ }); } +//閾炬帴绫诲瀷鏌ヨ妯℃澘鍊欓�夋潯浠� +//btmName: 閾炬帴绫诲瀷鍚�, linkFlag: 鏄惁閾炬帴绫诲瀷 +//btmName: 涓氬姟绫诲瀷鍚�, linkFlag: 鏄惁閾炬帴绫诲瀷锛宒irection锛氭鍚戝弽鍚� +export function queryTemplateListByAttr(params) { + return request({ + url: "/api/templateController/queryTemplateListByAttr", + method: "get", + params:{ + ...params + } + }); +} + +//鑾峰彇鎵�鏈夋煡璇㈡ā鏉� +export function getAllQTs(page,limit) { + return request({ + url: "/api/templateController/getAllQTs", + method: "get" + }); +} + // 淇敼 export function updateTemplate(params) { return request({ diff --git a/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/upload-file.vue b/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/upload-file.vue index 1195fc0..7e23662 100644 --- a/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/upload-file.vue +++ b/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/upload-file.vue @@ -125,11 +125,10 @@ }, // 鏂囦欢涓婁紶鎴愬姛 onSuccess(resbonse) { - console.log(resbonse); if (resbonse.code === 200) { this.$message.success("瀵煎叆鎴愬姛锛�"); this.visible = false; - this.$emit('updata'); + this.$emit('updata',resbonse); } else { this.$message.error(resbonse.msg); } diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formDialog.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formDialog.vue new file mode 100644 index 0000000..5d3b778 --- /dev/null +++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formDialog.vue @@ -0,0 +1,514 @@ +<template> + <el-dialog v-dialogDrag + :title="dialog.title" + :visible.sync="dialog.showDialog" + width="1620px" + :append-to-body="true" + class="avue-dialog" + :destroy-on-close="true" + :close-on-click-modal="false" + @close="cancelDialog"> + <div style="min-height: 665px;max-height: 85vh;padding-bottom: 50px;"> + <basic-form key="linkQueryForm" style="margin-bottom: 0" + ref="form" + :span="4" + :formItems="formItems" + :formData="form" + @getFormData="getFormData"> + </basic-form> + <avue-crud ref="crud" title="璁剧疆鎺掑簭" + :data="orderInfoList" :option="crudOption"> + <template slot="menuLeft" slot-scope="scope"> + <el-button icon="el-icon-plus" size="small" type="primary" @click="addRow">鍒涘缓</el-button> + </template> + <template slot="menu" slot-scope="scope"> + <el-button icon="el-icon-delete" size="small" type="text" @click="rowDeleteHandler(scope)">鍒犻櫎 + </el-button> + </template> + </avue-crud> + <el-dialog v-dialogDrag + title="鍒涘缓" + :visible.sync="crudDialog.showDialog" + width="500px" + :append-to-body="true" + class="avue-dialog" + :destroy-on-close="true" + :close-on-click-modal="false" + @close="crudDialog.showDialog=false"> + <avue-form ref="tableForm" :option="tableFormOption" v-model="tableForm"></avue-form> + <div class="dialog-footer avue-dialog__footer"> + <el-button type="primary" plain size="small" @click="rowSave" >淇� 瀛�</el-button> + </div> + </el-dialog> + <el-container style="margin-top: 10px;"> + <el-aside style="width:350px"> + <fieldset> + <legend> 閾炬帴绫诲瀷鍊欓�夋潯浠� </legend> + <div> + 鏌ヨ妯℃澘瀹氫箟 + <avue-select @change="linkQueryDefineChange" class="el-input--small" v-model="linkQueryDefineForm" placeholder="璇烽�夋嫨鍐呭" type="tree" :dic="linkQueryDefineDic" style="width:240px"></avue-select> + <avue-tree style="height: 265px" :data="linkTreeData" :option="treeOption" @node-drag-start="handleDragStart"> + </avue-tree> + </div> + </fieldset> + </el-aside> + <el-main> + <fieldset style="margin: 0 10px"> + <legend> 鏌ヨ鏉′欢 </legend> + <form-query-dialog ref="formQuery" + style="height: 300px;" + :queryCondition="queryCondition" + :queryTree="queryTree" + :levelFlag.sync="form.levelFlag" + ></form-query-dialog> + </fieldset> + </el-main> + <el-aside style="width:350px"> + <fieldset> + <legend> 涓氬姟绫诲瀷鍊欓�夋潯浠� </legend> + <div> + 鏌ヨ妯℃澘瀹氫箟 + <avue-select @change="businessQueryDefineChange" class="el-input--small" v-model="businessQueryDefineForm" placeholder="璇烽�夋嫨鍐呭" type="tree" :dic="businessQueryDefineDic" style="width: 240px;"></avue-select> + <avue-tree style="height: 265px" :data="businessTreeData" :option="treeOption" @node-drag-start="handleDragStart"> + </avue-tree> + </div> + </fieldset> + </el-aside> + </el-container> + </div> + <div class="dialog-footer avue-dialog__footer"> + <el-button type="primary" plain size="small" @click="submitDialog" >淇� 瀛�</el-button> + <el-button size="small" @click="cancelDialog">鍙� 娑�</el-button> + </div> + </el-dialog> +</template> + +<script> +import {getAllOrderbyAttributeByLink} from "@/api/modeling/linkType/api"; +import {linkSave} from "@/api/queryTemplate/linkTypeQuery"; +import basicOption from "@/util/basic-option"; +import {queryTemplateListByAttr} from "@/api/queryTemplate/queryDefine"; +import formQueryDialog from "./formQueryDialog.vue"; +export default { + name: "formDialog", + components:{formQueryDialog}, + data(){ + return { + dialog: { + showDialog: false, + title: "鍒涘缓", + submitTxt: "淇濆瓨", + submitIcon: "el-icon-check", + loading: false, + type: "add", + }, + crudDialog: { + showDialog: false, + submitTxt: "淇濆瓨", + submitIcon: "el-icon-check", + }, + formItems:[{ + label: '鏌ヨ妯℃澘鍚嶇О', + prop: 'qtName', + type: 'input', + span:5, + rules: [{ + required: true, + message: "璇疯緭鍏ユ煡璇㈡ā鏉垮悕绉�", + trigger: "blur" + }] + }], + form:{ + btmName:'', + qtName: '', + levelFlag:0,//0:鏅�氭煡璇㈡ā鏉�; 1:楂樼骇鏌ヨ妯℃澘" + queryTemplate:{} + }, + //宸叉湁鎺掑簭鍒楄〃閰嶇疆 + crudOption: { + ...basicOption, + addBtn: false, + editBtn: false, + delBtn: false, + selection: false, + height: "220", + tip: false, + column: [{ + label: '鎺掑簭瀛楁', + prop: 'orderField' + }, { + label: '鎺掑簭鏂瑰紡', + prop: 'orderMode' + }, { + label: '浼樺厛绾�', + prop: 'level' + }] + }, + //宸叉湁鎺掑簭 + orderInfoList:[], + //璁剧疆鎺掑簭寮圭獥琛ㄥ崟鏁版嵁 + tableForm:{ + orderField:'', + orderMode:'ASC', + level:'' + }, + //璁剧疆鎺掑簭寮圭獥鎵�鏈夊彲鎺掑簭瀛楁 + orderFieldList:[], + //璁剧疆鎺掑簭寮圭獥琛ㄥ崟閰嶇疆 + tableFormOption: { + menuBtn: false, + submitBtn: false, + emptyBtn: false, + span:24, + column: [{ + label: '鎺掑簭瀛楁', + prop: 'orderField', + type:'select', + props: { + label: 'id', + value: 'id' + }, + rules: [{ + required: true, + message: "璇烽�夋嫨鎺掑簭瀛楁", + trigger: "blur" + }] + }, { + label: '鎺掑簭鏂瑰紡', + prop: 'orderMode', + type: 'select', + dicData: [{ + label: '鍗囧簭', + value: 'ASC' + }, { + label: '闄嶅簭', + value: 'DESC' + }], + value: 'ASC' + }, { + label: '浼樺厛绾�', + prop: 'level', + type: 'number', + min:1, + rules: [{ + required: true, + message: "璇疯緭鍏ヤ紭鍏堢骇", + trigger: "blur" + }] + }] + }, + treeOption:{ + defaultExpandAll:true, + menu: false, + addBtn: false, + filter:false, + draggable: true, + allowDrop: () => { + return false; + }, + allowDrag: () => { + return true; + }, + }, + linkQueryDefineForm:'',//閾炬帴绫诲瀷鏌ヨ妯℃澘瀹氫箟閫変腑鍊� + linkQueryDefineDic:[],//閾炬帴绫诲瀷鏌ヨ妯℃澘瀹氫箟涓嬫媺鏁版嵁 + //閾炬帴绫诲瀷鏌ヨ妯℃澘瀹氫箟閫変腑椤瑰睘鎬� + linkTreeData: [], + businessQueryDefineForm:'',//涓氬姟绫诲瀷鏌ヨ妯℃澘瀹氫箟閫変腑鍊� + businessQueryDefineDic:[],//涓氬姟绫诲瀷鏌ヨ妯℃澘瀹氫箟涓嬫媺鏁版嵁 + //涓氬姟绫诲瀷鏌ヨ妯℃澘瀹氫箟閫変腑椤瑰睘鎬� + businessTreeData: [], + //楂樼骇鏌ヨ鏉′欢 + queryTree:{}, + //鏅�氭煡璇㈡潯浠� + queryCondition:[], + + }; + }, + watch: { + //鏂瑰悜 + 'form.direction': { + handler(val) { + if(val=='positive'){ + //姝e悜 + const dicData=this.treeData.btmItemsTo.map(item=>{ + return { + label: item, + value: item + } + }) + dicData.push({ + label: '鎵�鏈夌被鍨�', + value: '*' + }) + this.$refs.form.updateDic('btmType', dicData); + this.form.btmType=dicData[0].value + this.getAllAttr(); + }else if(val=='opposite'){ + //鍙嶅悜 + const dicData=this.treeData.btmItemsFrom.map(item=>{ + return { + label: item, + value: item + } + }) + dicData.push({ + label: '鎵�鏈夌被鍨�', + value: '*' + }) + this.$refs.form.updateDic('btmType', dicData); + this.form.btmType=dicData[0].value + this.getAllAttr(); + } + }, + immediate: true, + }, + //涓氬姟绫诲瀷 + 'form.btmType': { + handler(val) { + if(val && val!='*'){ + this.getTemp(val,false); + } + }, + immediate: true, + } + }, + methods: { + openDialog(btmName, title, mode, data) { + this.dialog.title = title; + this.dialog.type = mode; + this.form.btmName = btmName; + this.treeData = data.treeData; + + if (data.selectData) { + this.selectData = data.selectData; + this.form.qtName = this.selectData.qtName; + if (data.selectData.queryTemplate.orderInfoList && data.selectData.queryTemplate.orderInfoList.length > 0) { + this.orderInfoList = JSON.parse(JSON.stringify(data.selectData.queryTemplate.orderInfoList));//宸叉湁鎺掑簭 + } + this.queryCondition=this.selectData.queryTemplate.condition; + this.queryTree=this.selectData.tree; + this.form.levelFlag=this.selectData.levelFlag; + } else { + this.selectData = {}; + this.orderInfoList = []; + this.queryCondition=[]; + this.queryTree={ + connector:'骞朵笖', + child:[] + }; + } + this.dialog.showDialog = true; + this.getTemp(data.treeData.label, true) + }, + cancelDialog() { + this.dialog.loading = false; + this.dialog.showDialog = false; + this.$nextTick(() => { + this.form = { + btmName: '', + qtName: '', + levelFlag:0, + queryTemplate: {} + }; + this.orderInfoList =[]; + this.businessQueryDefineForm=''; + this.linkQueryDefineForm=''; + this.$refs.form.clearValidate(); + }); + }, + submitDialog() { + this.$refs.form.validate((valid) => { + if (valid) { + const formData=this.initFormData(); + console.log(formData) + linkSave(formData).then(res => { + if (res.data.success) { + this.$message.success("淇濆瓨鎴愬姛"); + this.cancelDialog(); + this.$emit("refresh"); + } + }); + } else { + return false; + } + }); + }, + initFormData() { + let formData = { + btmName: this.form.btmName, + qtName: this.form.qtName, + levelFlag: this.form.levelFlag, + queryTemplate: { + btmType: this.form.btmType, + clauseList: ['*'], + id: this.form.qtName, + level: this.form.level, + linkType: this.form.btmName, + orderInfoList: this.orderInfoList, + recReturnMode: 1,//閫掑綊杩斿洖鏁版嵁妯″紡:1锛歊ECRETURNMODE_FLAT, 2锛歊ECRETURNMODE_FILTER + rightFlag: true, + secretFlag: true, + type: 'link', + version: this.form.version + } + } + if (formData.levelFlag == 1) { + //楂樼骇 + let that = this; + function initValue(nodeChild) { + let children = []; + if (nodeChild) { + nodeChild.forEach((item, index) => { + if (item.label != '骞朵笖' && item.label != '鎴栬��') { + children.push(item.label); + } else { + children.push({ + connector: item.label, + child: initValue(item.children) + }) + } + }) + } + return children; + } + + let treeData = { + connector: this.$refs.formQuery.treeData[0].label + }; + if (this.$refs.formQuery.treeData[0].children) { + treeData.child = initValue(this.$refs.formQuery.treeData[0].children); + } + formData.tree = treeData + } + + formData.condition = this.$refs.formQuery.conditionList; + + return formData; + }, + getFormData(form) { + this.form = form; + }, + addRow() { + this.crudDialog.showDialog = true; + }, + // 琛屽垹闄� + rowDeleteHandler(data) { + this.orderInfoList.splice(data.index,1); + this.orderFieldList.unshift({ + id: data.row.orderField + }); + this.tableFormOption.column[0].dicData= this.orderFieldList + }, + //鑾峰彇鎺掑簭璁剧疆涓墍鏈夋帓搴忓瓧娈� + getAllAttr() { + getAllOrderbyAttributeByLink({ + name: this.treeData.label, + btmType: this.form.btmType, + direction: this.form.direction + }).then(res => { + const orderInfoStr = JSON.stringify(this.orderInfoList); + const dicData = []; + res.data.data.forEach(item => { + if (orderInfoStr.indexOf('"orderField":"' + item + '"') == -1) { + dicData.push({id: item}); + } + }) + this.tableFormOption.column[0].dicData=dicData; + this.orderFieldList=dicData; + }) + }, + //鎺掑簭璁剧疆淇濆瓨 + rowSave() { + this.$refs.tableForm.validate((valid) => { + if(valid){ + this.orderInfoList.push(JSON.parse(JSON.stringify(this.tableForm))); + this.crudDialog.showDialog=false; + const orderInfoStr = JSON.stringify(this.orderInfoList); + const dicData = []; + this.orderFieldList.forEach(item => { + if (orderInfoStr.indexOf('"orderField":"' + item.id + '"') == -1) { + dicData.push(item); + } + }) + this.tableFormOption.column[0].dicData=dicData; + this.orderFieldList=dicData; + this.tableForm= { + orderField: '', + orderMode: 'ASC', + level: '' + } + } + }) + }, + //鑾峰彇鏌ヨ妯℃澘瀹氫箟涓嬫媺 + getTemp(btmName,linkFlag) { + if (btmName) { + queryTemplateListByAttr({btmName: btmName, linkFlag: linkFlag,direction:this.form.direction}).then(res => { + const data = res.data.data.map(item => { + item.label = item.name + '-' + (item.linkTypeName || item.btmName); + item.value = item.name; + return item; + }); + if(linkFlag){ + this.linkQueryDefineDic=data + data.length>0 && (this.linkQueryDefineForm=data[0].value); + }else { + this.businessQueryDefineDic=data; + data.length>0 && (this.businessQueryDefineForm= data[0].value); + } + }) + } + }, + linkQueryDefineChange(data) { + if (data.value) { + const childData = data.item.attrs.map(item => { + return { + label: item.name, + value: item.name, + atttributes:item + }; + }); + this.linkTreeData = [{ + label: data.value, + value: data.value, + children: childData + }] + } + }, + businessQueryDefineChange(data) { + if (data.value) { + const childData = data.item.attrs.map(item => { + return { + label: item.name, + value: item.name, + atttributes:item + }; + }); + this.businessTreeData = [{ + label: data.value, + value: data.value, + children: childData + }] + } + }, + // 寮�濮嬫嫋鎷芥爲鑺傜偣浜嬩欢 + handleDragStart(node, ev) { + // 浣跨敤 setData 鏂规硶璁剧疆鏁版嵁 + ev.dataTransfer.setData('item', JSON.stringify(node.data)); + }, + }, +} +</script> + +<style scoped> +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: 0; + border: 1px solid #EBEEF5; +} +</style> diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formQueryDialog.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formQueryDialog.vue new file mode 100644 index 0000000..677e8bd --- /dev/null +++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formQueryDialog.vue @@ -0,0 +1,677 @@ +<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> + </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" + 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;" + 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> + <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> + </div> + </div> + <div v-else style="height: 220px;text-align: left"> + <avue-tree ref="tree" @node-drop="handleDrop" style="height: 220px" :data="treeData" :option="treeOption" @node-click="nodeClick" node-key="value"></avue-tree> + </div> + <div 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> + <el-button plain size="mini" type="primary" @click="queryHandler">鏌ヨ</el-button> + <el-button plain size="mini" type="primary" @click="">鍙栨秷</el-button> + </div> + + <el-dialog v-dialogDrag + :title="dialog.title" + :visible.sync="dialog.showDialog" + width="550px" + :append-to-body="true" + class="avue-dialog" + :destroy-on-close="true" + :close-on-click-modal="false" + @close="dialog.showDialog=false"> + <div style="height: 200px;"> + {{clickNode.showLabel}} + <avue-select v-if="['VTInteger','VTDouble','VTLong'].includes(clickNode.type)" v-model="clickNode.operator" type="tree" :dic="operatorIntDic" :clearable="false" style="width: 80px;margin: 0 5px;"></avue-select> + <avue-select v-else-if="['VTDateTime','VTDate','VTTime'].includes(clickNode.type)" v-model="clickNode.operator" type="tree" :dic="operatorDateDic" :clearable="false" style="width: 80px;margin: 0 5px;"></avue-select> + <avue-select v-else v-model="clickNode.operator" type="tree" :dic="operatorDic" :clearable="false" style="width: 80px;margin: 0 5px;"></avue-select> + <el-date-picker v-if="clickNode.type=='VTDate'" v-model="clickNode.inputValue" style="width:300px;display: inline-block;" value-format="YYYY-MM-DD" + type="date"> + </el-date-picker> + <el-date-picker v-else-if="clickNode.type=='VTDateTime'" v-model="clickNode.inputValue" style="width:350px;display: inline-block;" + type="datetime"> + </el-date-picker> + <el-time-select v-else-if="clickNode.type=='VTTime'" v-model="clickNode.inputValue" value-format="HH:mm:ss" style="width:300px;display: inline-block;"> + </el-time-select> + <avue-input-number v-else-if="clickNode.type=='VTInteger'" precision="0" v-model="clickNode.inputValue" style="width:300px;display: inline-block;"></avue-input-number> + <avue-input-number v-else-if="clickNode.type=='VTLong' || clickNode.type=='VTDouble'" v-model="clickNode.inputValue" style="width:300px;display: inline-block;"></avue-input-number> + <avue-input v-else v-model="clickNode.inputValue" type="textarea" style="width: 300px;margin-right: 5px;vertical-align: top;"></avue-input> + </div> + <div class="dialog-footer avue-dialog__footer"> + <el-button size="small" @click="checkTemp" v-if="!['VTInteger','VTDouble','VTLong','VTDateTime','VTDate','VTTime'].includes(clickNode.type)">閫夋嫨鏌ヨ妯℃澘</el-button> + <el-button type="primary" plain size="small" @click="submitDialog" >淇� 瀛�</el-button> + <el-button size="small" @click="dialog.showDialog=false">鍙� 娑�</el-button> + </div> + </el-dialog> + <el-dialog v-dialogDrag + :title="queryDialog.title" + :visible.sync="queryDialog.showDialog" + width="800px" + :append-to-body="true" + class="avue-dialog" + :destroy-on-close="true" + :close-on-click-modal="false" + @close="cancleQueryDialog"> + <div class="el-input--small"> + 杈撳叆鏌ヨ瀛楁锛�<avue-input v-model="queryField" style="width: 500px;margin-bottom: 10px"></avue-input> + <avue-crud ref="crud" :data="crudData" :option="crudOption" + :page.sync="page" + :table-loading="tableLoading" + @selection-change="selectionChange" + @row-click="rowClick" + @size-change="sizeChange" + @current-change="currentChange"> + </avue-crud> + </div> + <div class="dialog-footer avue-dialog__footer"> + <el-button type="primary" plain size="small" @click="submitQueryDialog" >纭� 瀹�</el-button> + <el-button size="small" @click="cancleQueryDialog">鍙� 娑�</el-button> + </div> + </el-dialog> + <el-dialog v-dialogDrag + :title="queryResultDialog.title" + :visible.sync="queryResultDialog.showDialog" + width="900px" + :append-to-body="true" + class="avue-dialog" + :destroy-on-close="true" + :close-on-click-modal="false" + @close="queryResultDialog.showDialog='false'"> + <div class="el-input--small"> + <avue-crud ref="crud" :data="resultData" :option="resultOption" + :table-loading="queryResultDialog.loading"> + </avue-crud> + </div> + </el-dialog> + </div> +</template> + +<script> +import basicOption from "@/util/basic-option"; +import {getAllQTs} from "@/api/queryTemplate/queryDefine"; +import {getCriteria} from "@/api/queryTemplate/linkTypeQuery"; + +export default { +name: "formQueryDialog", + props: { + queryCondition: { + type: Array, + default: [] + }, + queryTree: { + type: Object, + default: {} + }, + levelFlag:{ + type: Number, + default: 0 + } + }, + data() { + return { + dialog: { + showDialog: false, + title: "鏌ヨ鏉′欢璁剧疆妗�", + loading: false + }, + queryDialog: { + showDialog: false, + title: "閫夋嫨鏌ヨ妯℃澘", + loading: false + }, + queryResultDialog: { + showDialog: false, + title: "鏌ヨ缁撴灉", + loading: false + }, + radioDic: [{ + label: '鏅��', + value: 0 + }, { + label: '楂樼骇', + value: 1 + }], + conditionList:[], + treeData:[], + treeOption:{ + defaultExpandAll:true, + menu: false, + addBtn: false, + filter:false, + draggable: true, + allowDrop: (draggingNode, dropNode, type) => { + debugger; + if (dropNode.data.label === '骞朵笖' || dropNode.data.label === '鎴栬��') { + return true; + } else { + this.$message.error('璇烽�変腑閫昏緫鏉′欢娣诲姞鏌ヨ椤�'); + return false; + } + }, + allowDrag: (draggingNode) => { + return false; + }, + }, + page: { + currentPage: 1, + pageSize: 10, + total: 0, + pageSizes: [10, 30, 50, 100], + }, + crudData:[], + crudOption: { + ...basicOption, + addBtn: false, + editBtn: false, + delBtn: false, + tip: false, + header: false, + height: window.innerHeight-220, + menu: false, + column: [{ + label: '鏌ヨ妯℃澘鍚嶇О', + prop: 'qtName', + sortable: true, + }, { + label: '閾炬帴绫诲瀷鎴栦笟鍔$被鍨�', + prop: 'btmName', + sortable: true, + }] + }, + tableLoading: false, + selectionRow:[], + queryField:'', + resultData:[], + resultOption: { + ...basicOption, + addBtn: false, + editBtn: false, + delBtn: false, + tip: false, + header: false, + height: window.innerHeight-220, + menu: false, + column: [{ + label: 'OID', + prop: 'OID', + }, { + label: 'CREATOR', + prop: 'CREATOR' + }, { + label: 'CREATETIME', + prop: 'CREATETIME' + }] + }, + clickNode:{}, + operatorIntDic:[{ + label: '=', + value: '=' + }, { + label: '!=', + value: '!=' + }, { + label: '鍖呭惈', + value: '鍖呭惈' + }, { + label: 'in', + value: 'in' + }, { + label: 'not in', + value: 'not in' + }, { + label: '>=', + value: '>=' + }, { + label: '>', + value: '>' + }, { + label: '<=', + value: '<=' + }, { + label: '<', + value: '<' + }], + operatorDateDic : [{ + label: '=', + value: '=' + }, { + label: '!=', + value: '!=' + }, { + label: 'in', + value: 'in' + }, { + label: 'not in', + value: 'not in' + }, { + label: '>=', + value: '>=' + }, { + label: '<=', + value: '<=' + }], + operatorDic : [{ + label: '=', + value: '=' + }, { + label: '!=', + value: '!=' + }, { + label: '鍖呭惈', + value: '鍖呭惈' + }, { + label: 'in', + value: 'in' + }, { + label: 'not in', + value: 'not in' + }] + } + }, + computed: { + radioForm:{ + get() { + return this.levelFlag; + }, + set(value) { + this.$emit('update:levelFlag', value); + } + } + }, + watch: { + queryCondition:{ + handler(val) { + if(val && val.cIMap){ + let list=[]; + let that=this; + let getValue =function(queryTemplate,item) { + for (let key in queryTemplate.condition.cIMap) { + if (queryTemplate.condition.cIMap[key].leaf) { + item.clause += '.' + queryTemplate.condition.cIMap[key].leafInfo.clause; + if (queryTemplate.condition.cIMap[key].leafInfo.value.queryTemplate) { + getValue(queryTemplate.condition.cIMap[key].leafInfo.value.queryTemplate, item) + } else { + item.ordinaryValue = queryTemplate.condition.cIMap[key].leafInfo.value.ordinaryValue; + item.type=queryTemplate.condition.cIMap[key].leafInfo.type; + if(['VTInteger','VTDouble','VTLong'].includes(item.type)){ + item.operatorDic=that.operatorIntDic; + }else if(['VTDateTime','VTDate','VTTime'].includes(item.type)){ + item.operatorDic=that.operatorDateDic; + }else{ + item.operatorDic=that.operatorDic; + } + } + } + } + } + for (let key in val.cIMap) { + if (this.queryCondition.cIMap[key].leaf) { + let clause=this.queryCondition.cIMap[key].leafInfo.clause; + let operator= this.queryCondition.cIMap[key].leafInfo.operator; + let item={ + clause: clause, + operator: operator, + ordinaryValue: '', + operatorDic :[] + } + if(this.queryCondition.cIMap[key].leafInfo.value.queryTemplate) { + getValue(this.queryCondition.cIMap[key].leafInfo.value.queryTemplate, item) + }else { + item.ordinaryValue=this.queryCondition.cIMap[key].leafInfo.value.ordinaryValue; + item.type=this.queryCondition.cIMap[key].leafInfo.type; + if(['VTInteger','VTDouble','VTLong'].includes(item.type)){ + item.operatorDic=that.operatorIntDic; + }else if(['VTDateTime','VTDate','VTTime'].includes(item.type)){ + item.operatorDic=that.operatorDateDic; + }else{ + item.operatorDic=that.operatorDic; + } + } + list.push(item) + } + } + this.conditionList= list; + }else{ + this.conditionList=[] + } + }, + immediate: true, + deep:true + }, + queryTree:{ + handler(val) { + this.treeIndex=0; + if(val && Object.keys(val).length>0){ + let treeData = []; + let that=this; + function initValue(nodeChild) { + let children=[]; + if(nodeChild){ + nodeChild.forEach((item,index)=>{ + that.treeIndex++; + if(item.column !=null && item.column != undefined){ + children.push({ + label:item.column, + value:item.column+that.treeIndex, + type:item.type, + valueIndex:'v'+that.treeIndex + }) + }else { + children.push({ + label:item.connector, + value:item.connector+that.treeIndex, + valueIndex:'v'+that.treeIndex, + children:initValue(item.child) + }) + } + }) + } + return children; + } + const node={ + label:val.connector, + value:val.connector+this.treeIndex, + valueIndex:'v'+this.treeIndex, + children:initValue(val.child) + } + treeData.push(node) + this.treeData = treeData; + }else { + this.treeData=[{ + label: '骞朵笖', + value: '骞朵笖' + this.treeIndex, + valueIndex: 'v' + this.treeIndex, + connector: '骞朵笖', + children: [] + }] + } + }, + immediate: true, + deep:true + } + }, + created() { + this.getTemp(); + }, + methods: { + // 鎷栨嫿鍒版椂 + drop(event) { + // 浣跨敤 getData 鏂规硶鑾峰彇鏁版嵁 + const data = JSON.parse(event.dataTransfer.getData('item')); + if (this.radioForm == 0) { + const params = { + clause: data.value, + operator: '=', + ordinaryValue: '' + } + if (data.atttributes.vtDataType == 'VTInteger' || data.atttributes.vtDataType == 'VTDouble' || data.atttributes.vtDataType == 'VTLong') { + params.operatorDic =JSON.parse(JSON.stringify(this.operatorIntDic)) ; + } else if (data.atttributes.vtDataType == 'VTDateTime' || data.atttributes.vtDataType == 'VTDate' || data.atttributes.vtDataType == 'VTTime') { + params.operatorDic = JSON.parse(JSON.stringify(this.operatorDateDic)) + } else { + params.operatorDic = JSON.parse(JSON.stringify(this.operatorDic)) + } + params.type=data.atttributes.vtDataType; + this.conditionList.push(params) + }else {debugger; + if (this.clickNode.label != '骞朵笖' && this.clickNode.label != '鎴栬��') { + this.$message.error('璇烽�変腑閫昏緫鏉′欢娣诲姞鏌ヨ椤�'); + return; + } + this.treeIndex++; + this.$refs.tree.append({ + label: data.value, + value: data.value + this.treeIndex, + valueIndex: 'v' + this.treeIndex, + children: [] + }, this.clickNode); + } + }, + handleDrop(draggingNode, dropNode, dropType, ev) { + debugger; + console.log('tree drop: ', dropNode.label, dropType); + }, + //鍒犻櫎鏅�氭煡璇㈡潯浠� + delCondition(index) { + this.conditionList.splice(index, 1); + }, + //娓呯┖鍊� + clearValue() { + if (this.radioForm == 0) { + this.conditionList.map(item => { + item.ordinaryValue = ''; + return item; + }) + this.conditionList = this.conditionList + } else { + if(this.treeData[0] && this.treeData[0].children) { + this.clearTreeValue(this.treeData[0].children) + } + } + }, + clearTreeValue(nodes){ + nodes.forEach((node,index)=>{ + if(node.children){ + this.clearTreeValue(node.children) + }else { + let values=node.label.split(' '); + if(values.length>2){ + node.label=values[0]+' '+values[1]; + } + } + }) + }, + //鍒犻櫎鍏ㄩ儴鏉′欢 + delAll() { + if (this.radioForm == 0) { + this.conditionList = []; + } else { + this.treeIndex = 0; + this.treeData = []; + this.clickNode={}; + } + }, + nodeClick(data) { + this.clickNode = data + }, + //鏍� 澧炲姞閫昏緫鏉′欢 + addHandler() { + if (Object.keys(this.clickNode).length>0) { + if (this.clickNode.label == '骞朵笖' || this.clickNode.label == '鎴栬��') { + this.treeIndex++; + this.$refs.tree.append({ + label: '骞朵笖', + value: '骞朵笖' + this.treeIndex, + valueIndex: 'v' + this.treeIndex, + children: [] + }, this.$refs.tree.getCurrentNode()); + } else { + this.$message.error("鍙兘瀵归�昏緫鏉′欢澧炲姞閫昏緫鏉′欢"); + } + } else { + if(this.treeData.length==0){ + this.treeIndex = 0; + this.treeData = [{ + label: '骞朵笖', + value: '骞朵笖' + this.treeIndex, + valueIndex: 'v' + this.treeIndex, + connector: '骞朵笖', + children: [] + }] + }else { + this.$message.warning("璇烽�夋嫨鏌ヨ鏉′欢"); + } + } + }, + //鏍� 淇敼鏉′欢 + editHandler() { + if (Object.keys(this.clickNode).length>0) { + if (this.clickNode.label == '骞朵笖') { + this.clickNode.label = '鎴栬��' + } else if (this.clickNode.label == '鎴栬��') { + this.clickNode.label = '骞朵笖' + } else { + const values= this.clickNode.label.split(' '); + this.clickNode.inputValue=''; + if(values.length>1){ + this.clickNode.operator=values[1]; + if(values.length>2){ + if(['VTDateTime','VTDate','VTTime'].includes(this.clickNode.type)){ + this.clickNode.inputValue=new Date(values[2]); + }else { + this.clickNode.inputValue=values[2]; + } + } + } + if(values[0].indexOf('.')!=-1){ + const labels=values[0].split('.') + this.clickNode.showLabel=labels[labels.length-1]; + }else { + this.clickNode.showLabel=values[0]; + } + this.dialog.showDialog = true; + } + } else { + this.$message.warning("璇烽�夋嫨鏌ヨ鏉′欢"); + } + }, + //鏍� 鍒犻櫎鏉′欢 + delHandler() { + if (Object.keys(this.clickNode).length>0) { + this.$confirm('鎮ㄧ‘瀹氳鍒犻櫎鎵�閫夋嫨鐨勬潯浠跺悧锛�', '鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(() => { + this.$refs.tree.remove(this.clickNode); + this.clickNode = {}; + }) + } else { + this.$message.warning("璇烽�夋嫨鏌ヨ鏉′欢"); + } + }, + //鏌ヨ + queryHandler(){ + this.$parent.$parent.$parent.$parent.$refs.form.validate((valid) => { + if (valid) { + this.queryResultDialog.loading=true; + const formData=this.$parent.$parent.$parent.$parent.initFormData(); + getCriteria(formData).then(res => { + if (res.data.success) { + this.resultData=res.data.data; + this.queryResultDialog.showDialog=true; + this.queryResultDialog.loading=false; + } + }); + } else { + return false; + } + }); + }, + //閫夋嫨鏌ヨ妯℃澘 + checkTemp(index) { + if(index>=0){ + if(['VTInteger','VTDouble','VTLong','VTDateTime','VTDate','VTTime'].includes(this.conditionList[index].type)){ + return false; + } + } + this.queryIndex=index; + this.queryDialog.showDialog=true; + this.$nextTick(()=>{ + this.$refs.crud.doLayout(); + }); + }, + //鏌ヨ鏉′欢淇濆瓨 + submitDialog() { + const values= this.clickNode.label.split(' '); + this.clickNode.label = values[0]+' '+this.clickNode.operator+' '+this.clickNode.inputValue; + this.dialog.showDialog = false; + }, + //鑾峰彇鏌ヨ妯℃澘鍒楄〃 + getTemp() { + getAllQTs(this.page.currentPage, this.page.pageSize).then(res => { + this.crudData = res.data.data; + this.tableLoading = false; + }) + }, + rowClick(row) { + this.$refs.crud.toggleSelection(); + this.$refs.crud.toggleRowSelection(row); //閫変腑褰撳墠琛� + this.selectionRow = [row]; + }, + selectionChange(list) { + this.selectionRow = list; + }, + selectionClear() { + this.selectionRow = []; + this.$refs.crud.toggleSelection(); + }, + //閫夋嫨鏌ヨ妯℃澘 + submitQueryDialog() { + if (this.selectionRow.length == 0) { + this.$message.error('璇烽�夋嫨鏌ヨ妯℃澘鍐嶈繘琛屾搷浣�'); + return; + } + if (this.queryField == '') { + this.$message.error('璇峰~鍐欒緭鍏ユ煡璇㈠瓧娈�'); + return; + } + const value = this.selectionRow[0].qtName + ';' + this.queryField + if (this.radioForm == 0) { + //鏅�� + this.conditionList[this.queryIndex].ordinaryValue = value; + } else { + this.clickNode.inputValue = value; + } + this.cancleQueryDialog(); + }, + cancleQueryDialog(){ + this.queryDialog.showDialog = false; + this.selectionClear(); + this.queryField=''; + this.queryIndex=null; + }, + sizeChange(val) { + this.page.pageSize = val; + this.getTemp(); + }, + + // 椤电爜 + currentChange(val) { + this.page.currentPage = val; + this.getTemp(); + }, + } +} +</script> + +<style scoped> +::v-deep .el-input--small .el-input__inner{ + height: 28px; + line-height: 28px; +} +</style> 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 ddeabbc..a17252d 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 @@ -21,16 +21,19 @@ <el-main> <basic-container> + <div v-if="this.nodeRow && this.nodeRow.label"> + <el-button icon="el-icon-plus" size="small" type="primary" @click="addHandler">鍒涘缓</el-button> + <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editHandler">淇敼</el-button> + <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delHandler">鍒犻櫎</el-button> + <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">瀵煎嚭</el-button> + <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">瀵煎叆</el-button> + </div> <avue-crud ref="crud" + @selection-change="selectionChange" + @row-click="rowClick" :data="crudData" :option="crudOption" :table-loading="tableLoading" style="margin-top: 10px"> - <template slot="menuLeft" slot-scope="scope"> - <el-button icon="el-icon-plus" size="small" type="primary" @click="addHandler">鍒涘缓</el-button> - <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editHandler">淇敼</el-button> - <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delHandler">鍒犻櫎</el-button> - <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">瀵煎嚭</el-button> - <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">瀵煎叆</el-button> - </template> </avue-crud> + <form-dialog ref="formRef" @refresh="getTemp"></form-dialog> </basic-container> </el-main> @@ -43,8 +46,11 @@ import basicOption from "@/util/basic-option"; import func from "@/util/func"; import {dateFormat} from "@/util/date"; +import FormDialog from "./formDialog.vue" +import {deleteLinkTemplate} from "@/api/queryTemplate/linkTypeQuery"; export default { name: "index", + components: {FormDialog}, data() { return { treeOption: { @@ -134,66 +140,41 @@ this.tableLoading = false; }) }, - selectHandler(selection, row) { - + rowClick(row) { + this.$refs.crud.toggleSelection(); + this.$refs.crud.toggleRowSelection(row); //閫変腑褰撳墠琛� + this.selectionRow = [row]; }, - changeTemp(data) { - this.$refs.queryCrud.clearSelection(); - if (data.value != '') { - let abNames = data.item.abNames.join(',').toLowerCase().split(',') - - } + selectionChange(list) { + this.selectionRow = list; + }, + selectionClear() { + this.selectionRow = []; + this.$refs.crud.toggleSelection(); }, //鍒涘缓 addHandler() { - if (func.isEmptyObject(this.nodeRow)) { - this.$message.error('璇烽�夋嫨瑕佹坊鍔犵殑鑺傜偣'); - return; - } - this.title = 'add'; - this.visible = true; - this.$nextTick(() => { + this.$refs.formRef.openDialog(this.nodeRow.label,'鍒涘缓','add',{treeData:this.nodeRow}); + this.$nextTick(()=>{ + this.$refs.formRef.formItems[0].disabled = false; + this.$refs.formRef.$refs.form.getInit(this.$refs.formRef.formItems) }); }, //淇敼 editHandler() { - if (func.isEmptyObject(this.nodeRow)) { - this.$message.error('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�'); + if (this.selectionRow.length!=1) { + this.$message.error('璇烽�夋嫨涓�鏉℃暟鎹�'); return; } - this.form.name = this.templateForm; - this.title = 'edit'; - this.visible = true; - this.$nextTick(() => { + this.$refs.formRef.openDialog(this.nodeRow.label,'淇敼','edit',{treeData:this.nodeRow,selectData:this.selectionRow[0]}); + this.$nextTick(()=>{ + this.$refs.formRef.formItems[0].disabled = true; + this.$refs.formRef.$refs.form.getInit(this.$refs.formRef.formItems) }); - }, - // 鏂板缂栬緫淇濆瓨 - addDialogSavaHandler() { - this.$refs.form.validate((valid) => { - const saveFunction = this.title === 'add' ? saveTemplate : updateTemplate; - if (valid) { - saveFunction(this.form).then(res => { - if (res.data.code === 200) { - this.$message.success(res.data.obj); - this.addDialogClose(); - } - }) - } else { - return false; - } - }); - }, - // 鏂板缂栬緫瀵硅瘽妗嗗彇娑� - addDialogClose() { - this.form = { - name: '' - }; - this.$refs.form.clearValidate(); - this.visible = false; }, //鍒犻櫎 delHandler() { - if (func.isEmptyObject(this.nodeRow)) { + if (this.selectionRow.length==0) { this.$message.error('璇烽�夋嫨鏁版嵁'); return; } @@ -202,13 +183,13 @@ cancelButtonText: '鍙栨秷', type: 'warning' }).then(() => { - deleteTemplate({ - name: this.templateForm, - btmName: this.nodeRow.label, - linkFlag: false - }).then(res => { + let names=this.selectionRow.map(item=>{ + return item.qtName + }) + deleteLinkTemplate({names:names.join(',')}).then(res => { if (res.data.code === 200) { this.$message.success(res.data.obj); + this.getTemp(); } }) }).catch(() => { diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue index 2b7229c..91d6197 100644 --- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue +++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue @@ -2,7 +2,7 @@ <el-dialog v-dialogDrag :title="dialog.title" :visible.sync="dialog.showDialog" - width="1600px" + width="1620px" :append-to-body="true" class="avue-dialog" :destroy-on-close="true" @@ -47,7 +47,7 @@ <div> 鏌ヨ妯℃澘瀹氫箟 <avue-select @change="linkQueryDefineChange" class="el-input--small" v-model="linkQueryDefineForm" placeholder="璇烽�夋嫨鍐呭" type="tree" :dic="linkQueryDefineDic" style="width:240px"></avue-select> - <avue-tree style="height: 265px" :data="linkTreeData" :option="treeOption" @node-drag-start="handleDragStart"> + <avue-tree style="height: 265px" :data="linkTreeData" :option="treeOption" @node-drag-start="handleDragStart" @node-drag-end="handleDragEnd"> </avue-tree> </div> </fieldset> @@ -55,7 +55,12 @@ <el-main> <fieldset style="margin: 0 10px"> <legend> 鏌ヨ鏉′欢 </legend> - <form-query-dialog style="height: 300px;" :queryCondition="queryCondition" :queryTree="queryTree"></form-query-dialog> + <form-query-dialog ref="formQuery" + style="height: 300px;" + :queryCondition="queryCondition" + :queryTree="queryTree" + :levelFlag.sync="form.levelFlag" + ></form-query-dialog> </fieldset> </el-main> <el-aside style="width:350px"> @@ -64,7 +69,7 @@ <div> 鏌ヨ妯℃澘瀹氫箟 <avue-select @change="businessQueryDefineChange" class="el-input--small" v-model="businessQueryDefineForm" placeholder="璇烽�夋嫨鍐呭" type="tree" :dic="businessQueryDefineDic" style="width: 240px;"></avue-select> - <avue-tree style="height: 265px" :data="businessTreeData" :option="treeOption" @node-drag-start="handleDragStart"> + <avue-tree style="height: 265px" :data="businessTreeData" :option="treeOption" @node-drag-start="handleDragStart" @node-drag-end="handleDragEnd"> </avue-tree> </div> </fieldset> @@ -82,7 +87,7 @@ import {getAllOrderbyAttributeByLink} from "@/api/modeling/linkType/api"; import {linkSave} from "@/api/queryTemplate/linkTypeQuery"; import basicOption from "@/util/basic-option"; -import {gridTemplate} from "@/api/queryTemplate/queryDefine"; +import {queryTemplateListByAttr} from "@/api/queryTemplate/queryDefine"; import formQueryDialog from "./formQueryDialog.vue"; export default { name: "formDialog", @@ -174,6 +179,7 @@ form:{ btmName:'', qtName: '', + levelFlag:0,//0:鏅�氭煡璇㈡ā鏉�; 1:楂樼骇鏌ヨ妯℃澘" queryTemplate:{} }, //宸叉湁鎺掑簭鍒楄〃閰嶇疆 @@ -273,7 +279,8 @@ //楂樼骇鏌ヨ鏉′欢 queryTree:{}, //鏅�氭煡璇㈡潯浠� - queryCondition:[] + queryCondition:[], + }; }, watch: { @@ -322,14 +329,7 @@ } }, immediate: true, - }, - 'dialog.type': { - handler(val) { - if(val=='edit'){ - } - }, - immediate: true, - }, + } }, methods: { openDialog(btmName, title, mode, data) { @@ -350,12 +350,16 @@ this.orderInfoList = JSON.parse(JSON.stringify(data.selectData.queryTemplate.orderInfoList));//宸叉湁鎺掑簭 } this.queryCondition=this.selectData.queryTemplate.condition; - this.queryTree=this.selectData.queryTemplate.tree; + this.queryTree=this.selectData.tree; + this.form.levelFlag=this.selectData.levelFlag; } else { this.selectData = {}; this.orderInfoList = []; this.queryCondition=[]; - this.queryTree={}; + this.queryTree={ + connector:'骞朵笖', + child:[] + }; } this.dialog.showDialog = true; this.getTemp(data.treeData.label, true) @@ -367,6 +371,7 @@ this.form = { btmName: '', qtName: '', + levelFlag:0, queryTemplate: {} }; this.orderInfoList =[]; @@ -378,26 +383,8 @@ submitDialog() { this.$refs.form.validate((valid) => { if (valid) { - let formData={ - btmName:this.form.btmName, - qtName:this.form.qtName, - queryTemplate:{ - btmType:this.form.btmType, - clauseList:['*'], - direction:this.form.direction, - id:this.form.qtName, - level:this.form.level, - linkType:this.form.btmName, - orderInfoList:this.orderInfoList, - queryISLeaf:this.form.queryISLeaf, - recReturnMode:1,//閫掑綊杩斿洖鏁版嵁妯″紡:1锛歊ECRETURNMODE_FLAT, 2锛歊ECRETURNMODE_FILTER - rightFlag:true, - secretFlag:true, - type:'link', - version:this.form.version - } - } - formData.condition=[] + const formData=this.initFormData(); + console.log(formData) linkSave(formData).then(res => { if (res.data.success) { this.$message.success("淇濆瓨鎴愬姛"); @@ -409,6 +396,60 @@ return false; } }); + }, + initFormData() { + let formData = { + btmName: this.form.btmName, + qtName: this.form.qtName, + levelFlag: this.form.levelFlag, + queryTemplate: { + btmType: this.form.btmType, + clauseList: ['*'], + direction: this.form.direction, + id: this.form.qtName, + level: this.form.level, + linkType: this.form.btmName, + orderInfoList: this.orderInfoList, + queryISLeaf: this.form.queryISLeaf, + recReturnMode: 1,//閫掑綊杩斿洖鏁版嵁妯″紡:1锛歊ECRETURNMODE_FLAT, 2锛歊ECRETURNMODE_FILTER + rightFlag: true, + secretFlag: true, + type: 'link', + version: this.form.version + } + } + if (formData.levelFlag == 1) { + //楂樼骇 + let that = this; + function initValue(nodeChild) { + let children = []; + if (nodeChild) { + nodeChild.forEach((item, index) => { + if (item.label != '骞朵笖' && item.label != '鎴栬��') { + children.push(item.label); + } else { + children.push({ + connector: item.label, + child: initValue(item.children) + }) + } + }) + } + return children; + } + + let treeData = { + connector: this.$refs.formQuery.treeData[0].label + }; + if (this.$refs.formQuery.treeData[0].children) { + treeData.child = initValue(this.$refs.formQuery.treeData[0].children); + } + formData.tree = treeData + } + + formData.condition = this.$refs.formQuery.conditionList; + + return formData; }, getFormData(form) { this.form = form; @@ -468,7 +509,7 @@ //鑾峰彇鏌ヨ妯℃澘瀹氫箟涓嬫媺 getTemp(btmName,linkFlag) { if (btmName) { - gridTemplate({btmName: btmName, linkFlag: linkFlag}).then(res => { + queryTemplateListByAttr({btmName: btmName, linkFlag: linkFlag,direction:this.form.direction}).then(res => { const data = res.data.data.map(item => { item.label = item.name + '-' + (item.linkTypeName || item.btmName); item.value = item.name; @@ -486,10 +527,11 @@ }, linkQueryDefineChange(data) { if (data.value) { - const childData = data.item.abNames.map(item => { + const childData = data.item.attrs.map(item => { return { - label: item, - value: item + label: item.name, + value: item.name, + atttributes:item }; }); this.linkTreeData = [{ @@ -501,10 +543,11 @@ }, businessQueryDefineChange(data) { if (data.value) { - const childData = data.item.abNames.map(item => { + const childData = data.item.attrs.map(item => { return { - label: item, - value: item + label: item.name, + value: item.name, + atttributes:item }; }); this.businessTreeData = [{ @@ -518,7 +561,15 @@ handleDragStart(node, ev) { // 浣跨敤 setData 鏂规硶璁剧疆鏁版嵁 ev.dataTransfer.setData('item', JSON.stringify(node.data)); + if(this.form.levelFlag==1){ + this.$refs.formQuery.$refs.tree.$emit('tree-node-drag-start', ev,{node:this.$refs.formQuery.initItem(node)}); + } }, + handleDragEnd(draggingNode,endNode,position,ev){ + if(this.form.levelFlag==1) { + this.$refs.formQuery.$refs.tree.$emit('tree-node-drag-end', ev); + } + } }, } </script> 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 20164a4..96e4274 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 @@ -6,27 +6,116 @@ <el-button 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 in conditionList" class="el-input--small" style="margin-bottom: 5px;"> - <span style="width: 150px;display: inline-block;text-align: right" :title="condition.clause">{{condition.clause}}</span> - <avue-select v-model="condition.operator" type="tree" :dic="operatorDic" :clearable="false" style="width: 80px;margin: 0 5px;"></avue-select> - <avue-input v-model="condition.ordinaryValue" placeholder="" style="width: 300px;margin-right: 5px;"></avue-input> - <el-button plain size="mini" type="primary" @click="delAll">閫夋嫨鏌ヨ妯℃澘</el-button> + <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" + 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;" + 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> + <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> </div> </div> - <div v-else style="height: 220px;text-align: left"> - <avue-tree style="height: 220px" :data="treeData" :option="treeOption"></avue-tree> + <div v-else @drop="drop" @dragover.prevent style="height: 220px;text-align: left"> + <avue-tree ref="tree" @node-drop="handleDrop" @node-drag-end="handleDragEnd" style="height: 220px" :data="treeData" :option="treeOption" @node-click="nodeClick" node-key="value"></avue-tree> </div> <div 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="del">淇敼鏉′欢</el-button> - <el-button v-if="radioForm==1" plain size="mini" type="primary" @click="del">鍒犻櫎</el-button> - <el-button plain size="mini" type="primary" @click="del">鏌ヨ</el-button> - <el-button plain size="mini" type="primary" @click="del">鍙栨秷</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> + <el-button plain size="mini" type="primary" @click="queryHandler">鏌ヨ</el-button> + <el-button plain size="mini" type="primary" @click="">鍙栨秷</el-button> </div> + + <!--淇敼鏉′欢--> + <el-dialog v-dialogDrag + :title="dialog.title" + :visible.sync="dialog.showDialog" + width="550px" + :append-to-body="true" + class="avue-dialog" + :destroy-on-close="true" + :close-on-click-modal="false" + @close="dialog.showDialog=false"> + <div style="height: 200px;"> + {{clickNode.showLabel}} + <avue-select v-if="['VTInteger','VTDouble','VTLong'].includes(clickNode.type)" v-model="clickNode.operator" type="tree" :dic="operatorIntDic" :clearable="false" style="width: 80px;margin: 0 5px;"></avue-select> + <avue-select v-else-if="['VTDateTime','VTDate','VTTime'].includes(clickNode.type)" v-model="clickNode.operator" type="tree" :dic="operatorDateDic" :clearable="false" style="width: 80px;margin: 0 5px;"></avue-select> + <avue-select v-else v-model="clickNode.operator" type="tree" :dic="operatorDic" :clearable="false" style="width: 80px;margin: 0 5px;"></avue-select> + <el-date-picker v-if="clickNode.type=='VTDate'" v-model="clickNode.inputValue" style="width:300px;display: inline-block;" value-format="YYYY-MM-DD" + type="date"> + </el-date-picker> + <el-date-picker v-else-if="clickNode.type=='VTDateTime'" v-model="clickNode.inputValue" style="width:350px;display: inline-block;" + type="datetime"> + </el-date-picker> + <el-time-select v-else-if="clickNode.type=='VTTime'" v-model="clickNode.inputValue" value-format="HH:mm:ss" style="width:300px;display: inline-block;"> + </el-time-select> + <avue-input-number v-else-if="clickNode.type=='VTInteger'" precision="0" v-model="clickNode.inputValue" style="width:300px;display: inline-block;"></avue-input-number> + <avue-input-number v-else-if="clickNode.type=='VTLong' || clickNode.type=='VTDouble'" v-model="clickNode.inputValue" style="width:300px;display: inline-block;"></avue-input-number> + <avue-input v-else v-model="clickNode.inputValue" type="textarea" style="width: 300px;margin-right: 5px;vertical-align: top;"></avue-input> + </div> + <div class="dialog-footer avue-dialog__footer"> + <el-button size="small" @click="checkTemp" v-if="!['VTInteger','VTDouble','VTLong','VTDateTime','VTDate','VTTime'].includes(clickNode.type)">閫夋嫨鏌ヨ妯℃澘</el-button> + <el-button type="primary" plain size="small" @click="submitDialog" >淇� 瀛�</el-button> + <el-button size="small" @click="dialog.showDialog=false">鍙� 娑�</el-button> + </div> + </el-dialog> + <el-dialog v-dialogDrag + :title="queryDialog.title" + :visible.sync="queryDialog.showDialog" + width="800px" + :append-to-body="true" + class="avue-dialog" + :destroy-on-close="true" + :close-on-click-modal="false" + @close="cancleQueryDialog"> + <div class="el-input--small"> + 杈撳叆鏌ヨ瀛楁锛�<avue-input v-model="queryField" style="width: 500px;margin-bottom: 10px"></avue-input> + <avue-crud ref="crud" :data="crudData" :option="crudOption" + :page.sync="page" + :table-loading="tableLoading" + @selection-change="selectionChange" + @row-click="rowClick" + @size-change="sizeChange" + @current-change="currentChange"> + </avue-crud> + </div> + <div class="dialog-footer avue-dialog__footer"> + <el-button type="primary" plain size="small" @click="submitQueryDialog" >纭� 瀹�</el-button> + <el-button size="small" @click="cancleQueryDialog">鍙� 娑�</el-button> + </div> + </el-dialog> + <el-dialog v-dialogDrag + :title="queryResultDialog.title" + :visible.sync="queryResultDialog.showDialog" + width="900px" + :append-to-body="true" + class="avue-dialog" + :destroy-on-close="true" + :close-on-click-modal="false" + @close="queryResultDialog.showDialog='false'"> + <div class="el-input--small"> + <avue-crud ref="crud" :data="resultData" :option="resultOption" + :table-loading="queryResultDialog.loading"> + </avue-crud> + </div> + </el-dialog> </div> </template> <script> +import basicOption from "@/util/basic-option"; +import {getAllQTs} from "@/api/queryTemplate/queryDefine"; +import {getCriteria} from "@/api/queryTemplate/linkTypeQuery"; +import {dateFormat} from "@/util/date" export default { name: "formQueryDialog", props: { @@ -38,10 +127,28 @@ type: Object, default: {} }, + levelFlag:{ + type: Number, + default: 0 + } }, data() { return { - radioForm: 0, + dialog: { + showDialog: false, + title: "鏌ヨ鏉′欢璁剧疆妗�", + loading: false + }, + queryDialog: { + showDialog: false, + title: "閫夋嫨鏌ヨ妯℃澘", + loading: false + }, + queryResultDialog: { + showDialog: false, + title: "鏌ヨ缁撴灉", + loading: false + }, radioDic: [{ label: '鏅��', value: 0 @@ -49,94 +156,561 @@ label: '楂樼骇', value: 1 }], - conditionList:this.queryCondition, + conditionList:[], + treeData:[], treeOption:{ defaultExpandAll:true, menu: false, addBtn: false, filter:false, + draggable: true, + allowDrop: (draggingNode, dropNode, type) => { + debugger; + if (dropNode.data.label === '骞朵笖' || dropNode.data.label === '鎴栬��') { + return true; + } else { + this.$message.error('璇烽�変腑閫昏緫鏉′欢娣诲姞鏌ヨ椤�'); + return false; + } + }, + allowDrag: (draggingNode) => { + return false; + }, }, - treeData:this.queryTree, - //VTInteger銆乂TDouble銆乂TLong + page: { + currentPage: 1, + pageSize: 10, + total: 0, + pageSizes: [10, 30, 50, 100], + }, + crudData:[], + crudOption: { + ...basicOption, + addBtn: false, + editBtn: false, + delBtn: false, + tip: false, + header: false, + height: window.innerHeight-220, + menu: false, + column: [{ + label: '鏌ヨ妯℃澘鍚嶇О', + prop: 'qtName', + sortable: true, + }, { + label: '閾炬帴绫诲瀷鎴栦笟鍔$被鍨�', + prop: 'btmName', + sortable: true, + }] + }, + tableLoading: false, + selectionRow:[], + queryField:'', + resultData:[], + resultOption: { + ...basicOption, + addBtn: false, + editBtn: false, + delBtn: false, + tip: false, + header: false, + height: window.innerHeight-220, + menu: false, + column: [{ + label: 'OID', + prop: 'OID', + }, { + label: 'CREATOR', + prop: 'CREATOR' + }, { + label: 'CREATETIME', + prop: 'CREATETIME' + }] + }, + clickNode:{}, operatorIntDic:[{ - label:'=', - value:'=' - },{ - label:'!=', - value:'!=' - },{ - label:'鍖呭惈', - value:'鍖呭惈' - },{ - label:'in', - value:'in' - },{ - label:'not in', - value:'not in' - },{ - label:'>=', - value:'>=' - },{ - label:'>', - value:'>' - },{ - label:'<=', - value:'<=' - },{ - label:'<', - value:'<' + label: '=', + value: '=' + }, { + label: '!=', + value: '!=' + }, { + label: '鍖呭惈', + value: '鍖呭惈' + }, { + label: 'in', + value: 'in' + }, { + label: 'not in', + value: 'not in' + }, { + label: '>=', + value: '>=' + }, { + label: '>', + value: '>' + }, { + label: '<=', + value: '<=' + }, { + label: '<', + value: '<' }], - //VTDateTime銆乂TDate銆乂TTime - operatorTimeDic:[{ - label:'=', - value:'=' - },{ - label:'!=', - value:'!=' - },{ - label:'in', - value:'in' - },{ - label:'not in', - value:'not in' - },{ - label:'>=', - value:'>=' - },{ - label:'<=', - value:'<=' + operatorDateDic : [{ + label: '=', + value: '=' + }, { + label: '!=', + value: '!=' + }, { + label: 'in', + value: 'in' + }, { + label: 'not in', + value: 'not in' + }, { + label: '>=', + value: '>=' + }, { + label: '<=', + value: '<=' }], - //鍏跺畠 - operatorDic:[{ - label:'=', - value:'=' - },{ - label:'!=', - value:'!=' - },{ - label:'鍖呭惈', - value:'鍖呭惈' - },{ - label:'in', - value:'in' - },{ - label:'not in', - value:'not in' + operatorDic : [{ + label: '=', + value: '=' + }, { + label: '!=', + value: '!=' + }, { + label: '鍖呭惈', + value: '鍖呭惈' + }, { + label: 'in', + value: 'in' + }, { + label: 'not in', + value: 'not in' }] } }, - methods:{ + computed: { + radioForm:{ + get() { + return this.levelFlag; + }, + set(value) { + this.$emit('update:levelFlag', value); + } + } + }, + watch: { + queryCondition:{ + handler(val) { + if(val && val.cIMap){ + let list=[]; + let that=this; + let getValue =function(queryTemplate,item) { + for (let key in queryTemplate.condition.cIMap) { + if (queryTemplate.condition.cIMap[key].leaf) { + item.clause += '.' + queryTemplate.condition.cIMap[key].leafInfo.clause; + if (queryTemplate.condition.cIMap[key].leafInfo.value.queryTemplate) { + getValue(queryTemplate.condition.cIMap[key].leafInfo.value.queryTemplate, item) + } else { + item.ordinaryValue = queryTemplate.condition.cIMap[key].leafInfo.value.ordinaryValue; + item.type=queryTemplate.condition.cIMap[key].leafInfo.type; + if(['VTInteger','VTDouble','VTLong'].includes(item.type)){ + item.operatorDic=that.operatorIntDic; + }else if(['VTDateTime','VTDate','VTTime'].includes(item.type)){ + item.operatorDic=that.operatorDateDic; + }else{ + item.operatorDic=that.operatorDic; + } + } + } + } + } + for (let key in val.cIMap) { + if (this.queryCondition.cIMap[key].leaf) { + let clause=this.queryCondition.cIMap[key].leafInfo.clause; + let operator= this.queryCondition.cIMap[key].leafInfo.operator; + let item={ + clause: clause, + operator: operator, + ordinaryValue: '', + operatorDic :[] + } + if(this.queryCondition.cIMap[key].leafInfo.value.queryTemplate) { + getValue(this.queryCondition.cIMap[key].leafInfo.value.queryTemplate, item) + }else { + item.ordinaryValue=this.queryCondition.cIMap[key].leafInfo.value.ordinaryValue; + item.type=this.queryCondition.cIMap[key].leafInfo.type; + if(['VTInteger','VTDouble','VTLong'].includes(item.type)){ + item.operatorDic=that.operatorIntDic; + }else if(['VTDateTime','VTDate','VTTime'].includes(item.type)){ + item.operatorDic=that.operatorDateDic; + }else{ + item.operatorDic=that.operatorDic; + } + } + list.push(item) + } + } + this.conditionList= list; + }else{ + this.conditionList=[] + } + }, + immediate: true, + deep:true + }, + queryTree:{ + handler(val) { + this.treeIndex=0; + if(val && Object.keys(val).length>0){ + let treeData = []; + let that=this; + function initValue(nodeChild) { + let children=[]; + if(nodeChild){ + nodeChild.forEach((item,index)=>{ + that.treeIndex++; + if(item.column !=null && item.column != undefined){ + const values= item.column.split(' '); + let inputValue=''; + let operator=''; + let showLabel='' + if(item.column.indexOf('not in')!=-1){ + operator='not in'; + if(values.length>3){ + inputValue=values[3]; + } + }else{ + if(values.length>1){ + operator=values[1]; + if(values.length>2){ + inputValue=values[2]; + } + } + } + + if(values[0].indexOf('.')!=-1){ + const labels=values[0].split('.') + showLabel=labels[labels.length-1]; + }else { + showLabel=values[0]; + } + children.push({ + label:item.column, + value:item.column+that.treeIndex, + type:item.type, + valueIndex:'v'+that.treeIndex, + inputValue:inputValue, + operator:operator, + showLabel:showLabel + }) + }else { + children.push({ + label:item.connector, + value:item.connector+that.treeIndex, + valueIndex:'v'+that.treeIndex, + children:initValue(item.child) + }) + } + }) + } + return children; + } + const node={ + label:val.connector, + value:val.connector+this.treeIndex, + valueIndex:'v'+this.treeIndex, + children:initValue(val.child) + } + treeData.push(node) + this.treeData = treeData; + }else { + this.treeData=[{ + label: '骞朵笖', + value: '骞朵笖' + this.treeIndex, + valueIndex: 'v' + this.treeIndex, + connector: '骞朵笖', + children: [] + }] + } + }, + immediate: true, + deep:true + } + }, + created() { + this.getTemp(); + }, + methods: { // 鎷栨嫿鍒版椂 drop(event) { // 浣跨敤 getData 鏂规硶鑾峰彇鏁版嵁 const data = JSON.parse(event.dataTransfer.getData('item')); - const params = { - clause: data.value, - operator: '=', - ordinaryValue: '' + if (this.radioForm == 0) { + const params = { + clause: data.value, + operator: '=', + ordinaryValue: '' + } + if (data.atttributes.vtDataType == 'VTInteger' || data.atttributes.vtDataType == 'VTDouble' || data.atttributes.vtDataType == 'VTLong') { + params.operatorDic =JSON.parse(JSON.stringify(this.operatorIntDic)) ; + } else if (data.atttributes.vtDataType == 'VTDateTime' || data.atttributes.vtDataType == 'VTDate' || data.atttributes.vtDataType == 'VTTime') { + params.operatorDic = JSON.parse(JSON.stringify(this.operatorDateDic)) + } else { + params.operatorDic = JSON.parse(JSON.stringify(this.operatorDic)) + } + params.type=data.atttributes.vtDataType; + this.conditionList.push(params) + }else { + if (this.clickNode.label != '骞朵笖' && this.clickNode.label != '鎴栬��') { + this.$message.error('璇烽�変腑閫昏緫鏉′欢娣诲姞鏌ヨ椤�'); + return; + } + this.$refs.tree.append(this.initItem(data), this.clickNode); } - this.conditionList.push(params) - } + }, + initItem(data){ + this.treeIndex++; + let item={ + label: data.value, + value: data.value + this.treeIndex, + valueIndex: 'v' + this.treeIndex, + type:data.vtDataType, + children: [], + inputValue:data.value, + operator:'=', + showLabel:data.value + }; + let showLabel=''; + if(data.value.indexOf('.')!=-1){ + const labels=data.value.split('.') + showLabel=labels[labels.length-1]; + }else { + showLabel=data.value; + } + item.showLabel=showLabel; + return item + }, + handleDrop(draggingNode, dropNode, dropType, ev) { + debugger; + console.log('tree drop: ', dropNode.label, dropType); + }, + handleDragEnd(draggingNode, dropNode, dropType, ev) { + debugger; + console.log('tree drag end: ', dropNode && dropNode.label, dropType); + }, + //鍒犻櫎鏅�氭煡璇㈡潯浠� + delCondition(index) { + this.conditionList.splice(index, 1); + }, + //娓呯┖鍊� + clearValue() { + if (this.radioForm == 0) { + this.conditionList.map(item => { + item.ordinaryValue = ''; + return item; + }) + this.conditionList = this.conditionList + } else { + if(this.treeData[0] && this.treeData[0].children) { + this.clearTreeValue(this.treeData[0].children) + } + } + }, + clearTreeValue(nodes){ + nodes.forEach((node,index)=>{ + if(node.children){ + this.clearTreeValue(node.children) + }else { + if(node.label.indexOf('not in')!=-1){ + node.label=node.label.split(' ')[0]+' not in' + }else { + let values = node.label.split(' '); + if (values.length > 2) { + node.label = values[0] + ' ' + values[1]; + } + } + } + }) + }, + //鍒犻櫎鍏ㄩ儴鏉′欢 + delAll() { + if (this.radioForm == 0) { + this.conditionList = []; + } else { + this.treeIndex = 0; + this.treeData = []; + this.clickNode={}; + } + }, + nodeClick(data) { + this.clickNode = data + }, + //鏍� 澧炲姞閫昏緫鏉′欢 + addHandler() { + if (Object.keys(this.clickNode).length>0) { + if (this.clickNode.label == '骞朵笖' || this.clickNode.label == '鎴栬��') { + this.treeIndex++; + this.$refs.tree.append({ + label: '骞朵笖', + value: '骞朵笖' + this.treeIndex, + valueIndex: 'v' + this.treeIndex, + children: [] + }, this.$refs.tree.getCurrentNode()); + } else { + this.$message.error("鍙兘瀵归�昏緫鏉′欢澧炲姞閫昏緫鏉′欢"); + } + } else { + if(this.treeData.length==0){ + this.treeIndex = 0; + this.treeData = [{ + label: '骞朵笖', + value: '骞朵笖' + this.treeIndex, + valueIndex: 'v' + this.treeIndex, + connector: '骞朵笖', + children: [] + }] + }else { + this.$message.warning("璇烽�夋嫨鏌ヨ鏉′欢"); + } + } + }, + //鏍� 淇敼鏉′欢 + editHandler() { + if (Object.keys(this.clickNode).length>0) { + if (this.clickNode.label == '骞朵笖') { + this.clickNode.label = '鎴栬��' + } else if (this.clickNode.label == '鎴栬��') { + this.clickNode.label = '骞朵笖' + } else { + this.dialog.showDialog = true; + } + } else { + this.$message.warning("璇烽�夋嫨鏌ヨ鏉′欢"); + } + }, + //鏍� 鍒犻櫎鏉′欢 + delHandler() { + if (Object.keys(this.clickNode).length>0) { + this.$confirm('鎮ㄧ‘瀹氳鍒犻櫎鎵�閫夋嫨鐨勬潯浠跺悧锛�', '鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(() => { + this.$refs.tree.remove(this.clickNode); + this.clickNode = {}; + }) + } else { + this.$message.warning("璇烽�夋嫨鏌ヨ鏉′欢"); + } + }, + //鏌ヨ + queryHandler(){ + this.$parent.$parent.$parent.$parent.$refs.form.validate((valid) => { + if (valid) { + this.queryResultDialog.loading=true; + const formData=this.$parent.$parent.$parent.$parent.initFormData(); + getCriteria(formData).then(res => { + if (res.data.success) { + this.resultData=res.data.data; + this.queryResultDialog.showDialog=true; + this.queryResultDialog.loading=false; + } + }); + } else { + return false; + } + }); + }, + //閫夋嫨鏌ヨ妯℃澘 + checkTemp(index) { + if(index>=0){ + if(['VTInteger','VTDouble','VTLong','VTDateTime','VTDate','VTTime'].includes(this.conditionList[index].type)){ + return false; + } + } + this.queryIndex=index; + this.queryDialog.showDialog=true; + this.$nextTick(()=>{ + this.$refs.crud.doLayout(); + }); + }, + //鏌ヨ鏉′欢淇濆瓨 + submitDialog() { + const values= this.clickNode.label.split(' '); + this.clickNode.label = values[0]+' '+this.clickNode.operator+' '+this.clickNode.inputValue; + try{ + if(['VTDateTime'].includes(this.clickNode.type)){ + this.clickNode.label = values[0]+' '+this.clickNode.operator+' '+dateFormat(this.clickNode.inputValue); + }else if(['VTDate'].includes(this.clickNode.type)){ + this.clickNode.label = values[0]+' '+this.clickNode.operator+' '+dateFormat(this.clickNode.inputValue ,'yyyy-MM-dd'); + }else if(['VTTime'].includes(this.clickNode.type)){ + this.clickNode.label = values[0]+' '+this.clickNode.operator+' '+dateFormat(this.clickNode.inputValue ,'hh:mm:ss'); + } + }catch (e) { + + } + + this.dialog.showDialog = false; + }, + //鑾峰彇鏌ヨ妯℃澘鍒楄〃 + getTemp() { + getAllQTs(this.page.currentPage, this.page.pageSize).then(res => { + this.crudData = res.data.data; + this.tableLoading = false; + }) + }, + rowClick(row) { + this.$refs.crud.toggleSelection(); + this.$refs.crud.toggleRowSelection(row); //閫変腑褰撳墠琛� + this.selectionRow = [row]; + }, + selectionChange(list) { + this.selectionRow = list; + }, + selectionClear() { + this.selectionRow = []; + this.$refs.crud.toggleSelection(); + }, + //閫夋嫨鏌ヨ妯℃澘 + submitQueryDialog() { + if (this.selectionRow.length == 0) { + this.$message.error('璇烽�夋嫨鏌ヨ妯℃澘鍐嶈繘琛屾搷浣�'); + return; + } + if (this.queryField == '') { + this.$message.error('璇峰~鍐欒緭鍏ユ煡璇㈠瓧娈�'); + return; + } + const value = this.selectionRow[0].qtName + ';' + this.queryField + if (this.radioForm == 0) { + //鏅�� + this.conditionList[this.queryIndex].ordinaryValue = value; + } else { + this.clickNode.inputValue = value; + } + this.cancleQueryDialog(); + }, + cancleQueryDialog(){ + this.queryDialog.showDialog = false; + this.selectionClear(); + this.queryField=''; + this.queryIndex=null; + }, + sizeChange(val) { + this.page.pageSize = val; + this.getTemp(); + }, + + // 椤电爜 + currentChange(val) { + this.page.currentPage = val; + this.getTemp(); + }, } } </script> 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 76df4c5..2134676 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 @@ -33,6 +33,9 @@ :data="crudData" :option="crudOption" :table-loading="tableLoading" style="margin-top: 10px"> </avue-crud> <form-dialog ref="formRef" @refresh="getTemp"></form-dialog> + <!--瀵煎叆 --> + <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="瀵煎叆" + @updata="uploadCallBack"></upload-file> </basic-container> </el-main> </el-container> @@ -40,9 +43,10 @@ <script> import {gridLink} from "@/api/modeling/linkType/api"; -import {getObjTypeQTs,deleteLinkTemplate} from "@/api/queryTemplate/linkTypeQuery"; +import {getObjTypeQTs,deleteLinkTemplate,expLinkTemplate,impLinkTemplate} from "@/api/queryTemplate/linkTypeQuery"; import basicOption from "@/util/basic-option"; import FormDialog from "./formDialog.vue" +import func from "@/util/func"; export default { name: "index", @@ -103,6 +107,7 @@ }, { label: '鏂瑰悜', prop: 'direction', + width:80, formatter:function (row, value) { if (row.queryTemplate.direction == 'positive') { return '姝e悜' @@ -113,6 +118,7 @@ }, { label: '涓氬姟绫诲瀷', prop: 'btmType', + width: 130, formatter:function (row, value) { return row.queryTemplate.btmType; } @@ -135,18 +141,25 @@ }, { label: '鏌ヨ鏄惁鏈変笅绾�', prop: 'queryISLeaf', + width: 120, formatter:function (row, value) { return row.queryTemplate.queryISLeaf } }, { label: '瀛愯妭鐐瑰眰娆℃暟', prop: 'level', + width: 100, formatter:function (row, value) { return row.queryTemplate.level; } }] }, selectionRow: [], + tipList: [ + "瀵煎叆浠呰兘涓婁紶.vciqtf鏍煎紡鏂囦欢" + ], + upFileType: ['vciqtf'], + fileUrl: 'api/templateController/impLinkTemplate', } }, created() { @@ -208,7 +221,6 @@ } this.$refs.formRef.openDialog(this.nodeRow.label,'淇敼','edit',{treeData:this.nodeRow,selectData:this.selectionRow[0]}); this.$nextTick(()=>{ - debugger; this.$refs.formRef.formItems[0].disabled = true; this.$refs.formRef.$refs.form.getInit(this.$refs.formRef.formItems) }); @@ -239,6 +251,42 @@ message: '宸插彇娑堝垹闄�' }); }); + }, + //瀵煎嚭 + exportClickHandler(){ + if (this.selectionRow.length <= 0) { + this.$message.warning('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹繘琛屽鍑�'); + return; + } + + let qtNames = this.selectionRow.map(item => item.qtName).join(','); + expLinkTemplate({qtNames: qtNames}).then(res => { + func.downloadFileByBlobHandler(res); + this.$message.success('瀵煎嚭鎴愬姛'); + }) + }, + upLoadClickHandler(){ + this.$refs.upload.visible = true; + }, + uploadCallBack(res){ + function getText(child){ + let text='' + if(child[0].children && child[0].children.length>0){ + text=getText(child[0].children) + }else{ + text=child[0].text ||child[0]; + } + return text + } + if(res.obj) { + if (res.obj.children) { + this.$message.info(getText(res.obj.children)); + } + } + if(res.data){ + this.crudData = res.data; + } + //this.getTemp(); } } } -- Gitblit v1.9.3