From bf22977631345620486d3929e285ae9212ecac3e Mon Sep 17 00:00:00 2001 From: wangting <675591594@qq.com> Date: 星期三, 23 十月 2024 17:54:07 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/index.vue | 1 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/LogBasicController.java | 31 +++++ Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/formDialog.vue | 129 ++++++++++++++++++-- Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/index.vue | 32 +++-- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/LogBasicServiceI.java | 7 + Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/tableDialog.vue | 21 ++ Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/LogQueryCriteriaDTO.java | 4 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsAttributeController.java | 2 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java | 50 +++++--- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/LogBasicServiceImpl.java | 69 +++++++++++ 10 files changed, 285 insertions(+), 61 deletions(-) diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/LogQueryCriteriaDTO.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/LogQueryCriteriaDTO.java index 18019d0..e23592d 100644 --- a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/LogQueryCriteriaDTO.java +++ b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/LogQueryCriteriaDTO.java @@ -34,11 +34,11 @@ int pageNo; //椤甸潰鏉℃暟 int pageSize; - //鏌ヨ绫诲瀷(绠$悊鍛樻棩蹇楋紝鏅�氭棩蹇�) + //鏌ヨ绫诲瀷(绠$悊鍛樻棩蹇�1锛屾櫘閫氭棩蹇�2) String roleType; /** - * 鏍圭粷roleType鏌ヨ鍑烘潵鐨勭敤鎴峰悕锛屽悗缁牴鎹繖涓弬鏁版煡璇㈡寚瀹氱殑鏃ュ織 + * 鏍规嵁roleType鏌ヨ鍑烘潵鐨勭敤鎴峰悕锛屽悗缁牴鎹繖涓弬鏁版煡璇㈡寚瀹氱殑鏃ュ織 */ private List<String> userNameList; diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/LogBasicController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/LogBasicController.java index e35e925..aeb3b35 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/LogBasicController.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/LogBasicController.java @@ -4,13 +4,20 @@ import com.vci.starter.web.annotation.log.VciBusinessLog; import com.vci.starter.web.exception.VciBaseException; import com.vci.starter.web.pagemodel.BaseResult; +import com.vci.starter.web.util.ControllerUtil; import com.vci.starter.web.util.VciBaseUtil; import com.vci.web.service.LogBasicServiceI; +import com.vci.web.util.Func; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.Date; /** * 骞冲彴鏃ュ織鎺у埗鍣� @@ -125,4 +132,28 @@ throw new VciBaseException(errorMsg); } } + + /** + * 瀵煎嚭鏃ュ織 + * @param dto 瀵煎嚭鏌ヨ浼犲弬鏁板璞� + * @param response + */ + @PostMapping( "/exportLogs") + @VciBusinessLog(operateName = "瀵煎嚭鏃ュ織") + public void exportLogs(@RequestBody LogQueryCriteriaDTO dto, HttpServletResponse response){ + try { + String excelPath = logBasicServiceI.exportLogs(dto); + ControllerUtil.writeFileToResponse(response,excelPath); + } catch (Exception e) { + String msg = "瀵煎嚭鏃ュ織鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e); + try { + //鍑洪敊鏃� + e.printStackTrace(); + ControllerUtil.writeDataToResponse(response,"error_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss") + ".txt", StringUtils.isNotBlank(msg)?msg.getBytes():new byte[0],null); + } catch (IOException ioException) { + ioException.printStackTrace(); + } + } + } + } diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsAttributeController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsAttributeController.java index 8b982bd..2323993 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsAttributeController.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsAttributeController.java @@ -191,7 +191,7 @@ String excelPath = attributeService.exportAttributes(exportFileName,attrNames,false); ControllerUtil.writeFileToResponse(response,excelPath); } catch (Exception e) { - String msg = "瀵煎嚭鏋氫妇鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e); + String msg = "瀵煎嚭灞炴�ф椂鍑虹幇閿欒锛屽師鍥狅細" + VciBaseUtil.getExceptionMessage(e); try { //鍑洪敊鏃� e.printStackTrace(); diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/LogBasicServiceI.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/LogBasicServiceI.java index 995a7ce..e29f5fe 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/LogBasicServiceI.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/LogBasicServiceI.java @@ -16,18 +16,21 @@ * @return 鏌ヨ缁撴灉 */ BaseResult getPeroid() throws PLException; + /** * 淇濆瓨鏈熼檺璁剧疆 * period 鏈熼檺缂栫爜 * @return 淇濆瓨缁撴灉 */ BaseResult savePeriod(String period) throws PLException; + /** * 鍒犻櫎鏃ュ織 * period 鏈熼檺缂栫爜 * @return 淇濆瓨缁撴灉 */ BaseResult deleteLog(String deleteDate) throws PLException; + /** * 鏌ヨ鏃ュ織 * @param dto 鏌ヨ鏉′欢浼犺緭瀵硅薄 @@ -35,8 +38,12 @@ * @throws PLException */ BaseResult getLogListByContion(LogQueryCriteriaDTO dto) throws PLException; + /** * 鎿嶄綔鐢ㄦ埛鑾峰彇 */ BaseResult getOperatingUsers() throws PLException; + + String exportLogs(LogQueryCriteriaDTO dto) throws PLException; + } diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/LogBasicServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/LogBasicServiceImpl.java index bc75fa7..5e6b4fc 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/LogBasicServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/LogBasicServiceImpl.java @@ -10,7 +10,14 @@ import com.vci.dto.LogPeriodInfoDTO; import com.vci.dto.LogQueryCriteriaDTO; import com.vci.frameworkcore.compatibility.SmUserQueryServiceI; +import com.vci.starter.poi.bo.WriteExcelData; +import com.vci.starter.poi.bo.WriteExcelOption; +import com.vci.starter.poi.util.ExcelUtil; +import com.vci.starter.web.exception.VciBaseException; import com.vci.starter.web.pagemodel.BaseResult; +import com.vci.starter.web.util.LangBaseUtil; +import com.vci.starter.web.util.LocalFileUtil; +import com.vci.starter.web.util.VciBaseUtil; import com.vci.web.service.*; import com.vci.web.util.*; import org.apache.commons.lang3.StringUtils; @@ -19,9 +26,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.io.File; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; /** @@ -136,6 +145,7 @@ */ @Override public BaseResult getLogListByContion(LogQueryCriteriaDTO queryDto) throws PLException { + VciBaseUtil.alertNotNull(queryDto,"鏃ュ織鏌ヨ鍙傛暟瀵硅薄"); List<String> userNameList = userQueryServiceI.queryUserNameByRoleType(queryDto.getRoleType()); queryDto.setUserNameList(userNameList); String querySql = getSQL(queryDto); @@ -188,13 +198,66 @@ } /** + * 瀵煎嚭鏃ュ織 + * @param dto 瀵煎嚭鐨勬枃浠跺悕 + * @return + */ + @Override + public String exportLogs(LogQueryCriteriaDTO dto) throws PLException{ + BaseResult logListByContion = this.getLogListByContion(dto); + Collection<LogInfoDTO> logList = logListByContion.getData(); + + //鐣岄潰娌′紶鍚嶇О锛屼娇鐢ㄩ粯璁ゅ鍑哄悕绉� + String exportFileName = "鏃ュ織瀵煎嚭_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss"); + //璁剧疆鍒楀悕 + List<String> columns = new ArrayList<>( + Arrays.asList("鐢ㄦ埛鍚�", "濮撳悕", "鐢ㄦ埛ip","妯″潡", "鎿嶄綔", "鏃堕棿", "鎿嶄綔缁撴灉","鎻忚堪") + ); + + //鍐檈xcel + String excelPath = LocalFileUtil.getDefaultTempFolder() + File.separator + exportFileName + ".xls"; + try { + new File(excelPath).createNewFile(); + } catch (Throwable e) { + throw new VciBaseException(LangBaseUtil.getErrorMsg(e), new String[]{excelPath}, e); + } + //璁剧疆鍒� + List<WriteExcelData> excelDataList = new ArrayList<>(); + //璁剧疆鍒楀ご + for (int index = 0; index < columns.size(); index++) { + excelDataList.add(new WriteExcelData(0,index, columns.get(index))); + } + + if(Func.isEmpty(logList)){ + excelDataList.add(new WriteExcelData(1,1, "瀵煎嚭鐨勬棩蹇楀垪琛ㄤ负绌猴紒")); + }else{ + //鍏堟寜鐓у睘鎬х被鍨嬫帓搴忥紝涓嶅悓灞炴�х被鍨嬪鍑虹殑鏁版嵁涔辩殑鏁堟灉 + AtomicInteger i = new AtomicInteger(); + logList.stream().forEach(log->{ + excelDataList.add(new WriteExcelData(i.get() +1,0, log.getUsername())); + excelDataList.add(new WriteExcelData(i.get() +1,1, log.getTruename())); + excelDataList.add(new WriteExcelData(i.get() +1,2, log.getUserIp())); + excelDataList.add(new WriteExcelData(i.get() +1,3, log.getModuleName())); + excelDataList.add(new WriteExcelData(i.get() +1,4, log.getType())); + excelDataList.add(new WriteExcelData(i.get() +1,5, log.getDate())); + excelDataList.add(new WriteExcelData(i.get() +1,6, log.getLogType())); + excelDataList.add(new WriteExcelData(i.get() +1,7, log.getResult())); + i.getAndIncrement(); + }); + } + WriteExcelOption excelOption = new WriteExcelOption(excelDataList); + ExcelUtil.writeDataToFile(excelPath, excelOption); + return excelPath; + } + + /** * 鑾峰彇鐢ㄦ埛淇℃伅 * @param userNames 鐢ㄦ埛鍚嶇О * @return 鐢ㄦ埛淇℃伅 * @throws PLException */ private List<UserObject> getUsersByUserNames(List<String> userNames) throws PLException { - List<UserObject> userList = new ArrayList<UserObject>(); + List<UserObject> userList = new ArrayList<>(); for(String userName : userNames){ UserInfo userInfo = platformClientUtil.getFrameworkService().fetchUserInfoByName(userName); UserObject user = new UserObject(); @@ -250,7 +313,7 @@ public String getSQL(LogQueryCriteriaDTO dto) throws PLException { StringBuffer sql = new StringBuffer(""); // int period = getPeriod(LOG_SAVE_PERIOD);//鑾峰彇淇濆瓨鏈熼檺锛屼互鏈堜负鍗曚綅 - int period = platformClientUtil.getLogService().getCurPeriod();;//鑾峰彇淇濆瓨鏈熼檺锛屼互鏈堜负鍗曚綅 + int period = platformClientUtil.getLogService().getCurPeriod();//鑾峰彇淇濆瓨鏈熼檺锛屼互鏈堜负鍗曚綅 //涓嬮潰鏄嫾鍑篠QL if(period != 0){ sql.append(" to_date(PLDATE) >= add_months(to_date(sysdate),"+(-period)+")"); @@ -413,4 +476,6 @@ res = true; return res; } + + } 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 c59c90b..2dd03e2 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,5 +1,7 @@ package com.vci.web.service.impl; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import com.vci.common.utility.ObjectUtility; import com.vci.corba.common.PLException; import com.vci.corba.common.data.UserEntityInfo; @@ -1788,8 +1790,13 @@ convertTreeDOO2Map(treeList,allTreeMap); List<RoleRightDTO> roleRightDTOList = new ArrayList<>(); List<Tree> selectTreeList = uiAuthorDTO.getSelectTreeList(); - List<Tree> selectTreeList2 = this.authTreeListConvert(selectTreeList); - getSelectedRoleRightObjs_old(uiAuthorDTO.getRoleId(),selectTreeList2,allTreeMap,roleRightDTOList); + List<Tree> filterSelectTreeList = this.authTreeListConvert(selectTreeList); + //杩囨护鍑洪�夋嫨鐨勬寜閽� + List<String> checkButtonList = selectTreeList.stream() + .filter(item -> item.getData() instanceof PLTabButton || item.isLeaf()) + .map(item -> item.getOid()).collect(Collectors.toList()); + + getSelectedRoleRightObjs(uiAuthorDTO.getRoleId(),filterSelectTreeList,checkButtonList,allTreeMap,roleRightDTOList); SessionInfo sessionInfo = WebThreadLocalUtil.getCurrentUserSessionInfoInThread(); String currentUserName = sessionInfo.getUserId(); //boolean isDeveloper = rightControlUtil.isDeveloper(currentUserName); @@ -1811,7 +1818,6 @@ * @param selectTreeList */ private List<Tree> authTreeListConvert(List<Tree> selectTreeList){ - // 鍒涘缓涓�涓寘鍚彟涓�涓泦鍚堜腑婊¤冻鏉′欢鐨� oid 鐨勯泦鍚� List<String> validOids = selectTreeList.stream() .filter(Tree::isChecked) // checked 涓� true @@ -1830,19 +1836,20 @@ * @param allTreeMap * @param roleRightDTOList */ - private void getSelectedRoleRightObjs_old(String roleOid, List<Tree> selectTreeList, HashMap<String,Tree> allTreeMap, List<RoleRightDTO> roleRightDTOList){ + private void getSelectedRoleRightObjs(String roleOid, List<Tree> selectTreeList, List<String> checkButtonList, HashMap<String,Tree> allTreeMap, List<RoleRightDTO> roleRightDTOList){ Map<String,RoleRightDTO> roleRightDTOMap = new HashMap<>(); + if(!CollectionUtil.isEmpty(selectTreeList)){ selectTreeList.stream().forEach(tree -> { String oid = tree.getOid(); if(allTreeMap.containsKey(oid)){ tree = allTreeMap.get(oid); - Object data = tree.getData(); + Object data = tree.getData(); if (data instanceof String) { - getRightValue(roleOid, tree, allTreeMap, false, roleRightDTOMap);//鍚戜笅鑾峰彇鎵�鏈夋ā鍧楃殑鏉冮檺鍊� + getRightValue(roleOid, tree, allTreeMap, checkButtonList,false, roleRightDTOMap);//鍚戜笅鑾峰彇鎵�鏈夋ā鍧楃殑鏉冮檺鍊� } else if (!(data instanceof PLTabButton)) {//涓氬姟绫诲瀷 - getRightValue(roleOid, tree, allTreeMap, true, roleRightDTOMap);//鍚戜笂澶勭悊 - getRightValue(roleOid, tree, allTreeMap, false, roleRightDTOMap);//鍚戜笅澶勭悊锛堝寘鍚綋鍓嶈妭鐐癸級 + getRightValue(roleOid, tree, allTreeMap, checkButtonList, true, roleRightDTOMap);//鍚戜笂澶勭悊 + getRightValue(roleOid, tree, allTreeMap, checkButtonList, false, roleRightDTOMap);//鍚戜笅澶勭悊锛堝寘鍚綋鍓嶈妭鐐癸級 } else if (data instanceof PLTabButton) {//鎸夐挳 String parrentId=tree.getParentId(); if(allTreeMap.containsKey(parrentId)){ @@ -1851,7 +1858,7 @@ boolean isDeveloper = rightControlUtil.isDeveloper(currentUserName); Tree parentNode= allTreeMap.get(parrentId); String funcId = parentNode.getOid(); - getRightValue(roleOid, tree, allTreeMap, true, roleRightDTOMap);//鍚戜笂澶勭悊璇ユ搷浣滅埗绾х殑涓婄骇妯″潡鏉冮檺(涓嶅寘鍚埗鑺傜偣) + getRightValue(roleOid, parentNode, allTreeMap, checkButtonList, true, roleRightDTOMap);//鍚戜笂澶勭悊璇ユ搷浣滅埗绾х殑涓婄骇妯″潡鏉冮檺(涓嶅寘鍚埗鑺傜偣) if(!roleRightDTOMap.containsKey(funcId)){ RoleRightDTO roleRightDTO = new RoleRightDTO(); roleRightDTO.setId(ObjectUtility.getNewObjectID36());//涓婚敭 @@ -1862,7 +1869,7 @@ }else{ roleRightDTO.setRightType((short) 2); } - roleRightDTO.setRightValue(countRightValue(parentNode,false));// 鏉冮檺鍊硷紝娌℃湁鎿嶄綔鐨勬ā鍧楁潈闄愬�煎瓨鍌ㄤ负0 + roleRightDTO.setRightValue(countRightValue(parentNode,checkButtonList,false));// 鏉冮檺鍊硷紝娌℃湁鎿嶄綔鐨勬ā鍧楁潈闄愬�煎瓨鍌ㄤ负0 roleRightDTO.setRoleId(roleOid);//瑙掕壊ID roleRightDTO.setCreateUser(currentUserName);//鍒涘缓鑰� roleRightDTO.setCreateTime(VciDateUtil.date2Str(new Date(),""));//鍒涘缓鏃堕棿 @@ -1891,16 +1898,18 @@ * 鑾峰彇鏉冮檺 * @param isUp 鏄惁鏄悜涓婅幏鍙栵紝濡傛灉鏄悜涓婅幏鍙栵紝浼犺繘鏉ョ殑蹇呯劧鏄ā鍧楄妭鐐癸紝涓斾笂绾фā鍧楀繀鐒舵槸娌℃湁閫変腑 */ - private void getRightValue(String roleId,Tree node,HashMap<String,Tree> allTreeMap,boolean isUp,Map<String,RoleRightDTO> rightMap){ + private void getRightValue(String roleId,Tree node,Map<String,Tree> allTreeMap,List<String> checkButton,boolean isUp,Map<String,RoleRightDTO> rightMap){ SessionInfo sessionInfo = WebThreadLocalUtil.getCurrentUserSessionInfoInThread(); String currentUserName = sessionInfo.getUserId(); boolean isDeveloper= rightControlUtil.isDeveloper(currentUserName); String id=ObjectUtility.getNewObjectID36(); Object data=node.getData(); if(isUp) {//鍚戜笂鑾峰彇锛屽瓨鍌ㄦ瘡涓笂绾фā鍧楃殑鏉冮檺鍊� - while (!"root".equals(node.getData())){ - data=node.getData(); - String oid=node.getOid(); + String parentId = node.getParentId(); + Tree parentNode = allTreeMap.get(parentId); + while (!"root".equals(parentNode.getData())){ + data=parentNode.getData(); + String oid=parentNode.getOid(); if(allTreeMap.containsKey(oid)){ String funcId = ""; if (data instanceof BizType) { @@ -1937,9 +1946,9 @@ if(!rightMap.containsKey(funcId)){ rightMap.put(funcId, roleRightDTO); } - oid= node.getParentId(); + oid = parentNode.getParentId(); if(allTreeMap.containsKey(oid)) { - node=allTreeMap.get(oid); + parentNode = allTreeMap.get(oid); } } } @@ -1983,14 +1992,14 @@ } for (int i = 0; i < node.getChildren().size(); i++) { //瀵规瘡涓瓙鍚戜笅閫掑綊閬嶅巻 - getRightValue(roleId, node.getChildren().get(i), allTreeMap, false, rightMap); + getRightValue(roleId, node.getChildren().get(i), allTreeMap, checkButton,false, rightMap); } } else { if (!rightMap.containsKey(funcId)) { RoleRightDTO roleRightDTO = new RoleRightDTO(); roleRightDTO.setFuncId(funcId); roleRightDTO.setRightType((short) 2); // 璁剧疆UI鏉冮檺 - roleRightDTO.setRightValue(countRightValue(node, true));//娌℃湁鎿嶄綔鐨勬ā鍧楁潈闄愬�煎瓨鍌ㄤ负0 + roleRightDTO.setRightValue(countRightValue(node, checkButton,true));//娌℃湁鎿嶄綔鐨勬ā鍧楁潈闄愬�煎瓨鍌ㄤ负0 roleRightDTO.setRoleId(roleId); roleRightDTO.setCreateUser(currentUserName); @@ -2010,11 +2019,12 @@ * @param isAll 鏄惁瀛愮骇鍏ㄩ儴閫変腑 * @return */ - private long countRightValue(Tree node,boolean isAll){ + private long countRightValue(Tree node,List<String> checkButton,boolean isAll){ long value = 0; for(int i = 0; i < node.getChildren().size(); i++){ Tree childNode = (Tree)node.getChildren().get(i); - if(isAll || node.getData() instanceof PLTabButton ){ + //node.getData() instanceof PLTabButton杩欏効搴旇鎹㈡垚鏄惁鏄�変腑鐨勬寜閽妭鐐� + if(isAll || checkButton.contains(node.getOid())){ PLTabButton obj = (PLTabButton)childNode.getData(); value += (long)Math.pow(2, obj.plSeq);//绱鍔犱笂鍚勪釜鎿嶄綔鐨勬潈闄愬�� } diff --git a/Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/index.vue b/Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/index.vue index 4c265d2..a77bb26 100644 --- a/Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/index.vue +++ b/Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/index.vue @@ -250,31 +250,35 @@ checked: true, expanded: true, data:item.data, + parentId:item.parentId, level: item.level, + leaf:item.leaf, oid: item.oid, text: item.text } }) - // const parentData = selectParentList.map(item => { - // return { - // checked: false, - // expanded: true, - // data:item.data, - // level: item.level, - // oid: item.oid, - // text: item.text - // } - // }) - // // 鍦ㄥ崐閫夌姸鎬佷腑杩囨护鎺夐《绾ц妭鐐� oid 涓� root - // const filterSelectTreeData = parentData.filter(item => item.oid !== 'root'); + const parentData = selectParentList.map(item => { + return { + checked: false, + expanded: true, + data:item.data, + parentId:item.parentId, + level: item.level, + leaf:item.leaf, + oid: item.oid, + text: item.text + } + }) + // 鍦ㄥ崐閫夌姸鎬佷腑杩囨护鎺夐《绾ц妭鐐� oid 涓� root + const filterSelectTreeData = parentData.filter(item => item.oid !== 'root'); - const data = [...selectTreeData]; + const data = [...selectTreeData,...filterSelectTreeData]; const formData = { roleId: this.nodeRow.oid, type: this.type, context: this.context, - selectTreeList: selectTreeList + selectTreeList: data } authorizedUI(formData).then(res => { if (res.data.success) { diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/formDialog.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/formDialog.vue index 017da53..cabe032 100644 --- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/formDialog.vue +++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/formDialog.vue @@ -129,7 +129,7 @@ </el-button> <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addCustomClickHandler">娣诲姞鑷畾涔夌粍浠� </el-button> - <el-button icon="el-icon-zoom-in" plain size="small" type="primary">棰勮</el-button> + <el-button icon="el-icon-zoom-in" plain size="small" type="primary" @click="checkViewHandler" >棰勮</el-button> </div> </basic-container> </el-main> @@ -408,7 +408,7 @@ append-to-body="true" class="avue-dialog" title="琛ㄥ崟" - width="40%" + width="50%" @close="closeCustomDialog"> <el-form ref="form" :model="customForm" :rules="rules" label-position="left" label-width="85px"> <el-row style="border-bottom: 1px solid #878585;padding-bottom: 10px"> @@ -436,7 +436,7 @@ <el-col :span="12"> <el-form-item class="rightLabel" label="鏄剧ず绫诲瀷"> - <el-select v-model="customForm.itemType" placeholder="璇烽�夋嫨绫诲瀷" size="mini"> + <el-select v-model="customForm.itemType" placeholder="璇烽�夋嫨绫诲瀷" size="mini" @change="customItemTypeChange"> <el-option v-for="(item,index) in showSelectList" :key="index" :label="item.label" :value="item.value"></el-option> </el-select> @@ -668,6 +668,82 @@ <el-button type="primary" @click="customSaveHandler">纭� 瀹�</el-button> </span> </el-dialog> + <el-dialog + v-dialogDrag + :visible.sync="checkViewVisible" + append-to-body="true" + class="avue-dialog" + title="棰勮" + width="80%"> + <el-form ref="form" :model="form" :rules="rules" label-width="100px"> + <el-row> + <el-col v-for="(item,index) in formList" :key="index" :span="topForm.columnNumber"> + <el-form-item :class="['hiddenLabel', { 'active-border': activeItem.text === item.text }]" + :label="item.itemName + '锛�'" + style="padding-left: 5px" @click.native="formItemClick(item,index)"> + <el-input + v-if="item.itemType === 'text' || + item.itemType === 'custom' || + item.itemType === 'customform'|| + item.itemType === 'hidden' || + item.itemType === 'specialCharacter'" + v-model="item.value" :placeholder="item.text" + size="mini"></el-input> + + <div v-if="item.itemType === 'textbtn'" style="display: flex;align-items: center"> + <el-input v-model="item.value" :placeholder="item.text" size="mini"></el-input> + <el-button icon="el-icon-edit" plain size="mini" style="height: 28px;" + type="primary"></el-button> + </div> + + <el-input + v-if="item.itemType === 'textarea' || item.itemType === 'richtext' || item.itemType === 'webeditor'" + v-model="item.value" + :placeholder="item.text" + :rows="2" + type="textarea"> + </el-input> + + <el-input-number v-if="item.itemType === 'number'" v-model="item.value" :max="99999" + :min="1"></el-input-number> + <el-input v-if="item.itemType === 'password'" v-model="input" placeholder="璇疯緭鍏ュ瘑鐮�" + show-password></el-input> + <el-radio v-if="item.itemType === 'radio'" v-model="item.value"></el-radio> + <el-checkbox v-if="item.itemType === 'checkbox'" v-model="item.value"></el-checkbox> + <el-select v-if="item.itemType === 'select' || item.itemType === 'multiselect'" + v-model="item.value" :disabled="true" placeholder="璇烽�夋嫨" size="mini"> + </el-select> + <el-date-picker + v-if="item.itemType === 'date' || item.itemType === 'datetime'" + v-model="item.value" + :placeholder="item.itemType === 'date' ? '璇烽�夋嫨鏃ユ湡' : '璇烽�夋嫨鏃ユ湡鏃堕棿'" + type="date"> + </el-date-picker> + + <el-time-select + v-if="item.itemType === 'time'" + v-model="item.value" + :picker-options="{ + start: '08:30', + step: '00:15', + end: '18:30' + }" + placeholder="閫夋嫨鏃堕棿"> + </el-time-select> + <el-button v-if="item.itemType === 'file'" + v-model="item.value" plain size="mini" type="primary"> + 涓婁紶鏂囦欢 + </el-button> + <el-button v-if="item.itemType === 'multiFile'" + v-model="item.value" plain size="mini" type="primary"> + 澶氭枃浠朵笂浼� + </el-button> + + </el-form-item> + </el-col> + </el-row> + </el-form> + </el-dialog> </el-dialog> </template> @@ -695,6 +771,7 @@ }, data() { return { + checkViewVisible: false, optionObj: { optionName: '', optionValue: '' @@ -908,6 +985,7 @@ this.activeItem = item; this.activeItemIndex = index; this.form = {...item}; + // console.log(item,index); this.topForm.position = index += 1; }, @@ -1088,10 +1166,8 @@ prmItemList: this.formList }, } - console.log(params); savePortalVI(params).then(res => { - console.log(res); - if(res.data.code === 200){ + if (res.data.code === 200) { this.$message.success(res.data.obj); this.visible = false; this.closeDialog(); @@ -1110,12 +1186,14 @@ this.$message.error('璇峰湪鍙充晶閫夋嫨鏁版嵁鍚庤繘琛屾搷浣滐紒'); return; } - const targetObject = this.formList.find(item => item.text === this.form.text); - if (targetObject) { - targetObject.itemType = val; + }, + + // 鑷畾涔夌粍浠朵慨鏀规樉绀虹被鍨� + customItemTypeChange(val) { + if (val) { + this.customClearFormBottom(); } - this.form.itemType = val; }, // 鑷畾涔夌粍浠朵繚瀛� @@ -1126,6 +1204,11 @@ } if (!this.customForm.itemType) { this.$message.error('璇烽�夋嫨鏄剧ず绫诲瀷'); + return; + } + const status = this.formList.some(item => item.text === this.customForm.text); + if(status){ + this.$message.error('璇锋鏌ユ槸鍚︽坊鍔犵浉鍚岄」'); return; } this.formList.push(this.customForm); @@ -1148,6 +1231,13 @@ this.form.itemListTable = this.form.itemListTxt = this.form.itemListVal = this.form.itemStyle = ""; }, + // 鑷畾涔夌粍浠舵竻绌轰笉鍚岀被鍨嬭〃鍗曚笅鏂圭粦瀹氬�� + customClearFormBottom() { + this.customOptionObj = {}; + this.customForm.itemKeyValueList = []; + this.customForm.itemListTable = this.customForm.itemListTxt = this.customForm.itemListVal = this.customForm.itemStyle = ""; + }, + // 鑷畾涔夎〃鍗曚娇鐢ㄥ瓧娈甸�夋嫨 customTextHandler() { @@ -1155,17 +1245,22 @@ // 鍙充晶琛ㄥ崟搴旂敤鎸夐挳 asideFormHandler() { + if(!this.form.text){ + this.$message.error('璇锋坊鍔犱竴鏉℃暟鎹繘琛屼繚瀛橈紒'); + return; + } + this.formList = this.formList.map(item => + item.text === this.form.text ? this.form : item + ); + this.$message.success('搴旂敤鎴愬姛'); }, - customClearFormBottom() { - this.optionObj = {}; - this.form.itemKeyValueList = []; - this.form.itemListTable = ""; - this.form.itemListTxt = ""; - this.form.itemListVal = ""; - this.form.itemStyle = ""; + // 棰勮鎸夐挳 + checkViewHandler(){ + this.checkViewVisible = true; } + } } </script> diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/tableDialog.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/tableDialog.vue index 320ee99..ef4e680 100644 --- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/tableDialog.vue +++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/tableDialog.vue @@ -284,7 +284,8 @@ <el-col :span="24"> <el-form-item label="鏌ヨ妯℃澘"> <el-select v-model="form.itemQtName" placeholder="璇烽�夋嫨鏌ヨ妯℃澘" size="mini"> - <el-option v-for="(item,index) in searchQtNameList" :key="index" :label="item.qtName" :value="item.qtName"></el-option> + <el-option v-for="(item,index) in searchQtNameList" :key="index" :label="item.qtName" + :value="item.qtName"></el-option> </el-select> </el-form-item> </el-col> @@ -344,7 +345,7 @@ }, data() { return { - searchQtNameList:[], + searchQtNameList: [], formLoading: false, itemImgHeight: '', itemImgWidth: '', @@ -509,7 +510,7 @@ }, // 鏌ヨ妯℃澘涓嬫媺鎺ュ彛鏌ヨ - getSearchSelectList(){ + getSearchSelectList() { getObjTypeQTs({btName: this.treeRadio === '0' ? this.TreeNodeRow.id : this.TreeNodeRow.name}).then(res => { this.searchQtNameList = res.data.data; }) @@ -604,6 +605,18 @@ this.$message.error('璇烽�夋嫨涓�鏉℃暟鎹�'); return; } + + + const onlyFlag = this.form.itemOutFieldList.some(item => item.id === this.showLabelLeftRow.id); + + if (onlyFlag) { + this.$message.error('璇锋鏌ユ槸鍚︽湁閲嶅椤�'); + this.form.itemSelectOutFieldList = this.form.itemSelectOutFieldList.filter(selectItem => + !this.form.itemOutFieldList.some(outItem => outItem.id === selectItem.id) + ) + return; + } + this.form.itemOutFieldList.push(this.showLabelLeftRow); this.form.itemSearchFieldList = this.form.itemOutFieldList; @@ -679,7 +692,7 @@ // 鏌ヨ妯℃澘娣诲姞 searchAddClickHandler() { - if(!this.form.searchLabel){ + if (!this.form.searchLabel) { this.$message.error('鏌ヨ瀛楁涓嶈兘涓虹┖!'); return; } diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/index.vue index f92c433..e1b47da 100644 --- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/index.vue +++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/index.vue @@ -264,7 +264,6 @@ // 宸︿晶鏍戠偣鍑� nodeClick(row) { - console.log(row); this.tableRadio = null; this.nodeRow = row; this.getRightPortalVIDatas(row); -- Gitblit v1.9.3