Merge remote-tracking branch 'origin/master'
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.constant; |
| | | |
| | | public class PortalVIEnumConstant { |
| | | |
| | | /** |
| | | * 表åç±»åæä¸¾ |
| | | */ |
| | | public static final String PORTALVI_VI_TYPE = "portalVIType"; |
| | | |
| | | /*** |
| | | * 表åä¸å¡ç±»åæä¸¾ |
| | | */ |
| | | public static final String PORTALVI_VI_FLAG = "portalVITypeFlag"; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Action导åºä¼ è¾å¯¹è±¡ |
| | | * @author yuxc |
| | | * @date 2024/8/27 17:46 |
| | | */ |
| | | @Data |
| | | public class PLActionExpDTO implements java.io.Serializable{ |
| | | |
| | | /** |
| | | * ç¦æ¢ä¿®æ¹è¿ä¸ªå¼ |
| | | */ |
| | | private static final long serialVersionUID = 2009350578651813260L; |
| | | /** |
| | | * éæ©å¯¼åºæ°æ®çæ¨¡å¼ |
| | | */ |
| | | private String dataType;//éæ©å¯¼åºæ°æ®çæ¨¡å¼ |
| | | /** |
| | | * éæ©ãéæ©ãæ¨¡å¼åéè¦ä¼ æ¤åæ° |
| | | */ |
| | | private List<String> chooseDataOid; |
| | | /** |
| | | * 页ç |
| | | */ |
| | | private String pageNum; |
| | | /** |
| | | * æéè¦å¯¼åºçå |
| | | */ |
| | | private List<String> columnName; |
| | | /** |
| | | * æä»¶å |
| | | */ |
| | | private String fileName; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * Actionåæ°åè¡¨ä¼ è¾å¯¹è±¡ |
| | | * @author yuxc |
| | | * @date 2024/8/28 16:40 |
| | | */ |
| | | @Data |
| | | public class PLActionParamDTO implements java.io.Serializable{ |
| | | |
| | | /** |
| | | * ç¦æ¢ä¿®æ¹è¿ä¸ªå¼ |
| | | */ |
| | | private static final long serialVersionUID = 2009350578651813260L; |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | public String oid; |
| | | /** |
| | | * åæ°åç§° |
| | | */ |
| | | public String name; |
| | | /** |
| | | * é»è®¤å¼ |
| | | */ |
| | | public String defaultValue; |
| | | /** |
| | | * æç¤ºä¿¡æ¯ |
| | | */ |
| | | public String description; |
| | | /** |
| | | * ç¶actionçID |
| | | */ |
| | | public String action; |
| | | } |
| | |
| | | * 0: ä¸å¡ç±»å; 1: 龿¥ç±»å. é»è®¤0 |
| | | */ |
| | | private short typeFlag; |
| | | |
| | | /** |
| | | * ä¸å¡ç±»åæ¾ç¤ºå¼ |
| | | */ |
| | | private String typeFlagText; |
| | | /** |
| | | * ç±»åå |
| | | */ |
| | |
| | | * è§å¾ç±»å: è¾å
¥è¡¨åæå页å表 |
| | | */ |
| | | private short viType; |
| | | /** |
| | | *表åç±»å |
| | | */ |
| | | private String viTypeText; |
| | | /** |
| | | * å®ä¹è¯¦æ
|
| | | */ |
| | |
| | | this.prm = prm; |
| | | } |
| | | |
| | | public String getTypeFlagText() { |
| | | return typeFlagText; |
| | | } |
| | | |
| | | public void setTypeFlagText(String typeFlagText) { |
| | | this.typeFlagText = typeFlagText; |
| | | } |
| | | |
| | | public String getViTypeText() { |
| | | return viTypeText; |
| | | } |
| | | |
| | | public void setViTypeText(String viTypeText) { |
| | | this.viTypeText = viTypeText; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "PortalVIVO{" + |
| | | return "PortalVIDTO{" + |
| | | "id='" + id + '\'' + |
| | | ", typeFlag=" + typeFlag + |
| | | ", typeFlagText='" + typeFlagText + '\'' + |
| | | ", typeName='" + typeName + '\'' + |
| | | ", viName='" + viName + '\'' + |
| | | ", viType=" + viType + |
| | | ", viTypeText='" + viTypeText + '\'' + |
| | | ", prm=" + prm + |
| | | '}'; |
| | | } |
| | |
| | | package com.vci.model; |
| | | |
| | | import com.vci.constant.PortalVIEnumConstant; |
| | | import com.vci.starter.web.annotation.Transient; |
| | | import com.vci.starter.web.annotation.VciBtmType; |
| | | import com.vci.starter.web.annotation.VciUseEnum; |
| | | import com.vci.starter.web.constant.FrameWorkLcStatusConstant; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 0: ä¸å¡ç±»å; 1: 龿¥ç±»å. é»è®¤0 |
| | | */ |
| | | |
| | | @VciUseEnum(value = PortalVIEnumConstant.PORTALVI_VI_FLAG,defaultValue = "0",showTextField = "typeFlagText") |
| | | private short typeFlag; |
| | | /** |
| | | * ä¸å¡ç±»åæ¾ç¤ºææ¬ |
| | | */ |
| | | private String typeFlagText; |
| | | /** |
| | | * ç±»åå |
| | | */ |
| | |
| | | /** |
| | | * è§å¾ç±»å: è¾å
¥è¡¨åæå页å表 |
| | | */ |
| | | @VciUseEnum(value = PortalVIEnumConstant.PORTALVI_VI_TYPE,defaultValue = "0",showTextField = "viTypeText") |
| | | private short viType; |
| | | /** |
| | | * è§å¾ç±»åæ¾ç¤ºææ¬ |
| | | */ |
| | | private String viTypeText; |
| | | /** |
| | | * å®ä¹è¯¦æ
|
| | | */ |
| | |
| | | this.prm = prm; |
| | | } |
| | | |
| | | public String getTypeFlagText() { |
| | | return typeFlagText; |
| | | } |
| | | |
| | | public void setTypeFlagText(String typeFlagText) { |
| | | this.typeFlagText = typeFlagText; |
| | | } |
| | | |
| | | public String getViTypeText() { |
| | | return viTypeText; |
| | | } |
| | | |
| | | public void setViTypeText(String viTypeText) { |
| | | this.viTypeText = viTypeText; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "PortalVIVO{" + |
| | | return "PortalVIDO{" + |
| | | "id='" + id + '\'' + |
| | | ", typeFlag=" + typeFlag + |
| | | ", typeFlagText='" + typeFlagText + '\'' + |
| | | ", typeName='" + typeName + '\'' + |
| | | ", viName='" + viName + '\'' + |
| | | ", viType=" + viType + |
| | | ", viTypeText='" + viTypeText + '\'' + |
| | | ", prm='" + prm + '\'' + |
| | | '}'; |
| | | } |
| | |
| | | package com.vci.pagemodel; |
| | | |
| | | import com.vci.common.portal.enums.PortalVIType; |
| | | import com.vci.constant.EnumIdConstant; |
| | | import com.vci.starter.web.annotation.VciUseEnum; |
| | | |
| | | /** |
| | | * |
| | | * è¡¨åæ¾ç¤ºå¯¹è±¡ |
| | |
| | | */ |
| | | private short typeFlag; |
| | | /** |
| | | * ä¸å¡ç±»åæ¾ç¤ºå¼ |
| | | */ |
| | | private String typeFlagText; |
| | | /** |
| | | * ç±»åå |
| | | */ |
| | | private String typeName; |
| | |
| | | * è§å¾å |
| | | */ |
| | | private String viName; |
| | | |
| | | /** |
| | | * è§å¾ç±»å: è¾å
¥è¡¨åæå页å表 |
| | | */ |
| | | private short viType; |
| | | /** |
| | | *表åç±»å |
| | | */ |
| | | private String viTypeText; |
| | | /** |
| | | * å®ä¹è¯¦æ
|
| | | */ |
| | |
| | | this.prm = prm; |
| | | } |
| | | |
| | | public String getTypeFlagText() { |
| | | return typeFlagText; |
| | | } |
| | | |
| | | public void setTypeFlagText(String typeFlagText) { |
| | | this.typeFlagText = typeFlagText; |
| | | } |
| | | |
| | | public String getViTypeText() { |
| | | return viTypeText; |
| | | } |
| | | |
| | | public void setViTypeText(String viTypeText) { |
| | | this.viTypeText = viTypeText; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "PortalVIVO{" + |
| | | "id='" + id + '\'' + |
| | | ", typeFlag=" + typeFlag + |
| | | ", typeFlagText='" + typeFlagText + '\'' + |
| | | ", typeName='" + typeName + '\'' + |
| | | ", viName='" + viName + '\'' + |
| | | ", viType=" + viType + |
| | | ", viTypeText='" + viTypeText + '\'' + |
| | | ", prm=" + prm + |
| | | '}'; |
| | | } |
| | |
| | | throw new VciBaseException(String.valueOf(e.code),e.messages); |
| | | } |
| | | } |
| | | }else if(parentId.equals("sysOptionNode")){ |
| | | }else if(parentId.equals("operateNode")){ |
| | | //å è½½æææä½ |
| | | try{ |
| | | //å°è¿åçèç¹å¤å±å¥ä¸å½åç¶èç¹ |
| | | MenuVO parentNode = JsonConfigReader.getSysModuleConf().getOperateNode(); |
| | | List<MenuVO> menuVOS = new ArrayList<>(); |
| | | //妿æ¥è¯¢çæ¯ç¬¬ä¸å±èç¹å°±éè¦ç´æ¥è¿åsysOptionNodeèç¹ |
| | | if(Func.isNotBlank(modeType) && modeType.equals("firstNode")){ |
| | | menuVOList.add(parentNode); |
| | | return menuVOList; |
| | | } |
| | | OperateInfo[] operateInfos = platformClientUtil.getFrameworkService().getOperateTreeList(parentId); |
| | | for(int i = 0; i < operateInfos.length;i++ ){ |
| | | OperateInfo operateInfo = operateInfos[i]; |
| | |
| | | menuVO.setSort((int) operateInfo.seq); |
| | | menuVO.setModeType("operateObject"); |
| | | menuVO.setHasChildren(false); |
| | | menuVOS.add(menuVO); |
| | | menuVOList.add(menuVO); |
| | | } |
| | | parentNode.setChildren(menuVOS); |
| | | menuVOList.add(parentNode); |
| | | }catch (PLException e) { |
| | | e.printStackTrace(); |
| | | throw new VciBaseException(String.valueOf(e.code),new String[]{VciBaseUtil.getExceptionMessage(e)}); |
| | |
| | | package com.vci.web.controller; |
| | | |
| | | import com.vci.constant.FrameWorkLangCodeConstant; |
| | | import com.vci.corba.framework.data.AppConfigDetailInfo; |
| | | import com.vci.corba.framework.data.FuncOperationInfo; |
| | | import com.vci.corba.framework.data.OperateInfo; |
| | | import com.vci.frameworkcore.compatibility.ISmFunctionQueryService; |
| | |
| | | import com.vci.pagemodel.AppConfigDetailInfoVO; |
| | | import com.vci.pagemodel.ExpExcelConditionVO; |
| | | import com.vci.pagemodel.MenuVO; |
| | | import com.vci.starter.web.annotation.controller.VciUnCheckRight; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.starter.web.util.ControllerUtil; |
| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | |
| | | return BaseResult.success(hmSysModConfigService.addOperationType(operateInfo),"æ·»å æä½ç±»åæå"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | String errorMsg = "å 餿¨¡åæ¶åºç°é误ï¼åå ï¼"+ VciBaseUtil.getExceptionMessage(e); |
| | | String errorMsg = "æ·»å æä½ç±»åæ¶åºç°é误ï¼åå ï¼"+ VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(errorMsg); |
| | | throw new VciBaseException(errorMsg); |
| | | } |
| | |
| | | package com.vci.web.controller; |
| | | |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.dto.PLActionClsDTO; |
| | | import com.vci.dto.PLActionDTO; |
| | | import com.vci.dto.PLActionQueryDTO; |
| | | import com.vci.dto.*; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.web.service.OsActionServiceI; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 导åºAction |
| | | * 导åºActionåç±» |
| | | * @return |
| | | */ |
| | | @PostMapping("/exportBeans") |
| | |
| | | osActionServiceI.exportBeans(actionOid, response); |
| | | } |
| | | |
| | | /** |
| | | * 导å
¥Action |
| | | * @param file ä¸ä¼ çæä»¶ |
| | | * @return |
| | | */ |
| | | @PostMapping("/impData") |
| | | public BaseResult impData(MultipartFile file){ |
| | | try { |
| | | return osActionServiceI.impData(file); |
| | | }catch (Throwable e) { |
| | | throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 导åºAction |
| | | * @param plActionExpDTO 导åºå±æ§è®¾ç½®å¯¹è±¡ |
| | | */ |
| | | @PostMapping("/exportAction") |
| | | public void exportAction(@RequestBody PLActionExpDTO plActionExpDTO, HttpServletResponse response) throws PLException { |
| | | try { |
| | | osActionServiceI.exportAction(plActionExpDTO, response); |
| | | }catch (Throwable e) { |
| | | throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä¿åActionåæ°æ°æ® |
| | | * dto actionä¼ è¾å¯¹è±¡ |
| | | * @return ä¿åç»æ |
| | | */ |
| | | @PostMapping("/savePLActionParam") |
| | | public BaseResult savePLActionParam(@RequestBody PLActionParamDTO dto){ |
| | | try { |
| | | return osActionServiceI.savePLActionParam(dto); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹Actionåæ°æ°æ® |
| | | * dto actionä¼ è¾å¯¹è±¡ |
| | | * @return ä¿åç»æ |
| | | */ |
| | | @PostMapping("/updatePLActionParam") |
| | | public BaseResult updatePLActionParam(@RequestBody PLActionParamDTO dto){ |
| | | try { |
| | | return osActionServiceI.updatePLActionParam(dto); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | /** |
| | | * å é¤Actionåæ°æ°æ® |
| | | * oid åæ°ä¸»é® |
| | | * @return ä¿åç»æ |
| | | */ |
| | | @DeleteMapping("/deletePLActionParam") |
| | | public BaseResult deletePLActionParam(String oid){ |
| | | try { |
| | | return osActionServiceI.deletePLActionParam(oid); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | } |
| | |
| | | throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * è·å设置æåºå段çæåºå段 |
| | | * @param linkType 龿¥ç±»åçç¼å· |
| | | * @param btmType ä¸å¡ç±»åçç¼å· |
| | | * @param direction æ£/åå |
| | | * @return 屿§çä¿¡æ¯ |
| | | */ |
| | | @GetMapping("/getAllOrderbyAttributeByLink") |
| | | public BaseResult<List<String>> getAllOrderbyAttributeByLink(String linkType, String btmType, String direction){ |
| | | |
| | | try { |
| | | List<String> osLinkTypeAttributes = linkTypeService.getAllOrderbyAttributeByLink(linkType, btmType, direction); |
| | | return BaseResult.dataList(osLinkTypeAttributes); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } catch (ParseException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * ä¸å¡ç±»åæ¥è¯¢æ¨¡æ¿ä¸çæ¥è¯¢æ¡ä»¶çæ¥è¯¢æé®æ¥è¯¢listå表 |
| | | * @param qtInfoDTO |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | @PostMapping("/getCriteriaBtm") |
| | | public BaseResult getCriteriaBtm(@RequestBody QTInfoDTO qtInfoDTO){ |
| | | try { |
| | | return quereyTemplateServiceI.getCriteriaBtm(qtInfoDTO); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¡ä»¶ä¸çéæ©æ¥è¯¢æ¨¡æ¿å¯¹è¯æ¡ï¼æ¥è¯¢å
¨é¨æ¨¡æ¿åæå¯¹åºçä¸å¡ç±»åæé¾æ¥ç±»ååï¼ |
| | | * @return |
| | | */ |
| | | @GetMapping("/getAllQTs") |
| | | public BaseResult getAllQTs(){ |
| | | try { |
| | | return quereyTemplateServiceI.getAllQTs(); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¨¡æ¿å表 |
| | | * @param btName ç±»ååç§° |
| | | * @return æ¥è¯¢ç»æ |
| | |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä¸å¡ç±»åæ¥è¯¢æ¨¡æ¿ä¿å |
| | | * @param qtInfoDTO ä¿åä¼ è¾å¯¹è±¡ |
| | | * @return ä¿åç»æ |
| | | */ |
| | | @PostMapping("/btmSave") |
| | | public BaseResult btmSave(@RequestBody QTInfoDTO qtInfoDTO){ |
| | | try { |
| | | return quereyTemplateServiceI.btmSave(qtInfoDTO); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°æ°æ®åºç»æ |
| | | * @return æ´æ°ç»æ |
| | | */ |
| | | @PostMapping("/updateDBStructure") |
| | | public BaseResult btmSave(){ |
| | | try { |
| | | return quereyTemplateServiceI.updateDBStructure(); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä¸å¡ç±»åæ¥è¯¢æ¨¡æ¿æ æ¥è¯¢ï¼ç¨äºçé¢ç导åºåè½ |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | @GetMapping("/getBtmQtTree") |
| | | public BaseResult getBtmQtTree(){ |
| | | try { |
| | | return quereyTemplateServiceI.getBtmQtTree(); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 导åºä¸å¡ç±»åæ¥è¯¢æ¨¡æ¿ |
| | | * names æ¥è¯¢æ¨¡æ¿å |
| | | * @return |
| | | */ |
| | | @PostMapping("/expBtmQTTemplate") |
| | | public void expBtmQTTemplate(@RequestBody List<String> names,HttpServletResponse response) throws PLException, IOException { |
| | | quereyTemplateServiceI.expBtmQTTemplate(names, response); |
| | | } |
| | | |
| | | /** |
| | | * 导å
¥ä¸å¡ç±»åæ¥è¯¢æ¨¡æ¿ |
| | | * @param file ä¸ä¼ çæä»¶ |
| | | * @return 导å
¥ç»æ |
| | | */ |
| | | @PostMapping("/impBtmTemplate") |
| | | public BaseResult impBtmTemplate(MultipartFile file){ |
| | | try { |
| | | return quereyTemplateServiceI.impBtmTemplate(file); |
| | | }catch (Throwable e) { |
| | | throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | @GetMapping(value = "/getAllAttributesByBtmId") |
| | | @VciBusinessLog(operateName = "æ¥çä¸å¡ç±»åç屿§") |
| | | public BaseResult<List<OsBtmTypeAttributeVO>> getAllAttributesByBtmId(String btmId){ |
| | | List<OsBtmTypeAttributeVO> osBtmTypeAttributeVOS = btmService.listAttributeByBtmIdHasDefault(btmId); |
| | | List<OsBtmTypeAttributeVO> osBtmTypeAttributeVOS = null; |
| | | try { |
| | | osBtmTypeAttributeVOS = btmService.listAttributeByBtmIdHasDefault(btmId); |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | throw new VciBaseException(exceptionMessage); |
| | | } |
| | | return BaseResult.dataList(osBtmTypeAttributeVOS); |
| | | } |
| | | |
| | |
| | | String hasDefaultAttr = baseQueryObject.getConditionMap().getOrDefault("hasDefaultAttr","false"); |
| | | String attrId = baseQueryObject.getConditionMap().containsKey("name")?baseQueryObject.getConditionMap().get("name").replace("*",""):""; |
| | | String attrName = baseQueryObject.getConditionMap().containsKey("label") ? baseQueryObject.getConditionMap().get("label").replace("*","") : ""; |
| | | List<OsBtmTypeAttributeVO> boAttrs = btmService.listAttributeByBtmId(btmTypeId); |
| | | List<OsBtmTypeAttributeVO> boAttrs = null; |
| | | try { |
| | | boAttrs = btmService.listAttributeByBtmId(btmTypeId); |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | throw new VciBaseException(exceptionMessage); |
| | | } |
| | | if(boAttrs == null){ |
| | | boAttrs = new ArrayList<>(); |
| | | } |
| | |
| | | String attrId = baseQueryObject.getConditionMap().containsKey("name")?baseQueryObject.getConditionMap().get("name").replace("*",""):""; |
| | | String attrName = baseQueryObject.getConditionMap().containsKey("label") ? baseQueryObject.getConditionMap().get("label").replace("*","") : ""; |
| | | OsBtmTypeVO btmTypeVO = btmService.selectByOid(btmTypeOid); |
| | | List<OsBtmTypeAttributeVO> boAttrs = btmService.listAttributeByBtmId(btmTypeVO.getId()); |
| | | List<OsBtmTypeAttributeVO> boAttrs = null; |
| | | try { |
| | | boAttrs = btmService.listAttributeByBtmId(btmTypeVO.getId()); |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | throw new VciBaseException(exceptionMessage); |
| | | } |
| | | List<OsBtmTypeAttributeVO> attrList = boAttrs.stream().filter(s->{ |
| | | boolean usedFlag = true; |
| | | if(StringUtils.isNotBlank(attrId) && !s.getId().contains(attrId)){ |
| | |
| | | package com.vci.web.controller; |
| | | |
| | | import com.vci.corba.common.PLException; |
| | | 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.starter.web.util.LangBaseUtil; |
| | | import com.vci.dto.OsCodeGenSchemaDTO; |
| | | import com.vci.pagemodel.OsCodeGenSchemaVO; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.web.service.OsCodeGenSchemaServiceI; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | */ |
| | | @PostMapping(value = "/productCodeFile") |
| | | public BaseResult productCodeFile(String oid){ |
| | | codeGenSchemaService.productCodeFile(oid); |
| | | return BaseResult.success(); |
| | | try { |
| | | codeGenSchemaService.productCodeFile(oid); |
| | | return BaseResult.success(); |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = VciBaseUtil.getExceptionMessage(e); |
| | | throw new VciBaseException(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.vci.pagemodel.PortalVIVO; |
| | | 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; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.starter.web.pagemodel.DataGrid; |
| | | import com.vci.starter.web.util.ControllerUtil; |
| | | import com.vci.starter.web.util.LangBaseUtil; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.web.enumpck.ItemDblEnum; |
| | | import com.vci.web.enumpck.ItemTypeEnum; |
| | | import com.vci.web.service.OsPortalVIServiceI; |
| | | import com.vci.web.service.WebBtmIOServiceI; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.FileNotFoundException; |
| | | import java.io.IOException; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | /** |
| | | *æ ¹æ®è¡¨åidè·åå
·ä½æ°æ® |
| | | * @param id |
| | | * @param viType |
| | | * @return |
| | | */ |
| | | @GetMapping( "/getPortalVIById") |
| | | @VciBusinessLog(operateName = "è·å表å/è¡¨æ ¼æ°æ®") |
| | | public BaseResult getPortalVIById(@RequestBody String id,@RequestBody String viType){ |
| | | public BaseResult getPortalVIById(@RequestParam("id") String id,@RequestParam("viType") String viType){ |
| | | try{ |
| | | PortalVIVO portalVIVO= portalVIServiceI.getPortalVIById(id,viType); |
| | | return BaseResult.success(portalVIVO); |
| | | }catch (Throwable e){ |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "å建ä¸å¡ç±»åæ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | String exceptionMessage = "è·å表å/è¡¨æ ¼æ°æ®æ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | |
| | | */ |
| | | @DeleteMapping("/deleteByIds") |
| | | @VciBusinessLog(operateName = "å é¤è¡¨å/è¡¨æ ¼") |
| | | public BaseResult deleteByIds(@RequestBody String ids){ |
| | | public BaseResult deleteByIds(@RequestParam("ids") String ids){ |
| | | try { |
| | | return portalVIServiceI.delete(ids) ? BaseResult.success("å 餿åï¼"):BaseResult.fail("å é¤å¤±è´¥ï¼"); |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "å é¤è¡¨åæ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | String exceptionMessage = VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | |
| | | * |
| | | */ |
| | | @PostMapping("/clone") |
| | | @VciBusinessLog(operateName = "å é¤è¡¨å/è¡¨æ ¼") |
| | | @VciBusinessLog(operateName = "å
é表å/è¡¨æ ¼") |
| | | public BaseResult clone(@RequestBody ClonePortalVIDTOList portalVIDTOList){ |
| | | try { |
| | | return portalVIServiceI.clone(portalVIDTOList) ? BaseResult.success("å 餿åï¼"):BaseResult.fail("å é¤å¤±è´¥ï¼"); |
| | | return portalVIServiceI.clone(portalVIDTOList) ? BaseResult.success("å
éæåï¼"):BaseResult.fail("å
é失败ï¼"); |
| | | } catch (Throwable e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "å é¤è¡¨åæ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * å¯¼åºæ°æ®åºç表信æ¯å°excel |
| | | * @param response ååºå¯¹è±¡ |
| | | * @param ids ä¸å¡ç±»åçç¼å·ï¼ç¨éå·åå² |
| | | */ |
| | | @PostMapping("/exportExcel") |
| | | @VciBusinessLog(operateName = "导åºè¡¨å/è¡¨æ ¼å°excelä¸") |
| | | public void exportExcel(String ids,HttpServletResponse response){ |
| | | String excelFileName = portalVIServiceI.exportToExcel(VciBaseUtil.str2List(ids)); |
| | | try { |
| | | ControllerUtil.writeFileToResponse(response,excelFileName); |
| | | } catch (IOException e) { |
| | | try { |
| | | ControllerUtil.writeDataToResponse(response, LangBaseUtil.getErrorMsg(e).getBytes(StandardCharsets.UTF_8),null); |
| | | } catch (IOException ex) { |
| | | ex.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | /** |
| | | * è·å屿§å段类å |
| | |
| | | * è·åè¶
龿¥å¼¹åºæ¹æ³ |
| | | */ |
| | | @GetMapping("/getItemDblList") |
| | | @VciBusinessLog(operateName = "屿§å段类å") |
| | | @VciBusinessLog(operateName = "è¶
龿¥ç±»å") |
| | | public BaseResult<List<KeyValue>> getItemDblList(){ |
| | | return BaseResult.dataList(ItemDblEnum.getEnumAll()); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.web.enumpck; |
| | | import com.vci.pagemodel.KeyValue; |
| | | import com.vci.starter.web.enumpck.BaseEnum; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | /** |
| | | * Actionæä¸¾ |
| | | * @author yuxc |
| | | * |
| | | */ |
| | | public enum ActionEnum implements BaseEnum{ |
| | | EXP_CHOOSE("0","éæ©"), |
| | | EXP_ALL("1","å
¨é¨"), |
| | | EXP_PAGE("2","页ç "), |
| | | CLOUMN_PLNAME("åç§°","plName"), |
| | | CLOUMN_PLCODE("ç¼å·","plCode"), |
| | | CLOUMN_PLBSURL("类路å¾","plBSUrl"), |
| | | CLOUMN_PLCSCLASS("龿¥å°å","plCSClass"), |
| | | CLOUMN_PLDESC("æè¿°","plDesc"), |
| | | CLOUMN_PLTYPETYPE("ç±»å","plTypeType"); |
| | | /** |
| | | * æä¸¾çå¼ |
| | | */ |
| | | private String value; |
| | | |
| | | /** |
| | | * æä¸¾æ¾ç¤ºææ¬ |
| | | */ |
| | | private String text; |
| | | |
| | | /** |
| | | * è·åæä¸¾å¼ |
| | | * |
| | | * @return æä¸¾å¼ |
| | | */ |
| | | @Override |
| | | public String getValue() { |
| | | return value; |
| | | } |
| | | |
| | | /** |
| | | * 设置æä¸¾å¼ |
| | | * |
| | | * @param value æä¸¾å¼ |
| | | */ |
| | | public void setValue(String value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | /** |
| | | * è·åæä¸¾æ¾ç¤ºææ¬ |
| | | * |
| | | * @return æ¾ç¤ºææ¬ |
| | | */ |
| | | @Override |
| | | public String getText() { |
| | | return text; |
| | | } |
| | | |
| | | /** |
| | | * 设置æ¾ç¤ºææ¬ |
| | | * |
| | | * @param text æ¾ç¤ºææ¬ |
| | | */ |
| | | public void setText(String text) { |
| | | this.text = text; |
| | | } |
| | | ActionEnum(String value, String text) { |
| | | this.value = value; |
| | | this.text = text; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ ¹æ®åç§°è·å对åºçæä¸¾å¼ |
| | | * |
| | | * @param text åç§° |
| | | * @return æä¸¾å¼ |
| | | */ |
| | | public static String getValueByText(String text) { |
| | | for (ActionEnum actionEnum : ActionEnum.values()) { |
| | | if (actionEnum.getText().equalsIgnoreCase(text)) { |
| | | return actionEnum.getValue(); |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æä¸¾å¼è·ååç§° |
| | | * |
| | | * @param value æä¸¾å¼ |
| | | * @return åç§° |
| | | */ |
| | | public static String getTextByValue(String value) { |
| | | for (ActionEnum actionEnum : ActionEnum.values()) { |
| | | if (actionEnum.getValue().equalsIgnoreCase(value)) { |
| | | return actionEnum.getText(); |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | /** |
| | | * æ ¹æ®æä¸¾å¼è·åæä¸¾å¯¹è±¡ |
| | | * |
| | | * @param value æä¸¾å¼ |
| | | * @return æä¸¾å¯¹è±¡ï¼ä¸å卿¶åè¿ånull |
| | | */ |
| | | public static ActionEnum forValue(String value) { |
| | | for (ActionEnum actionEnum : ActionEnum.values()) { |
| | | if (actionEnum.getValue().equalsIgnoreCase(value)) { |
| | | return actionEnum; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | * æ ¹æ®æä¸¾å¼è·ååç§° |
| | | * |
| | | * @return åç§° |
| | | */ |
| | | public static List<KeyValue> getActionAll() { |
| | | List<KeyValue> enumDataList=new ArrayList<>(); |
| | | for (ActionEnum actionEnum : ActionEnum.values()) { |
| | | KeyValue enumData=new KeyValue(); |
| | | enumData.setKey(actionEnum.value); |
| | | enumData.setValue(actionEnum.text); |
| | | enumDataList.add(enumData); |
| | | } |
| | | return enumDataList; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.web.enumpck; |
| | | |
| | | import com.vci.pagemodel.KeyValue; |
| | | import com.vci.starter.web.enumpck.BaseEnum; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Actionæä¸¾ |
| | | * @author yuxc |
| | | * |
| | | */ |
| | | public enum PlTypetypeEnum implements BaseEnum{ |
| | | BUSINESS("business","ä¸å¡ç±»å"), |
| | | LINK("link","龿¥ç±»å"); |
| | | /** |
| | | * æä¸¾çå¼ |
| | | */ |
| | | private String value; |
| | | |
| | | /** |
| | | * æä¸¾æ¾ç¤ºææ¬ |
| | | */ |
| | | private String text; |
| | | |
| | | /** |
| | | * è·åæä¸¾å¼ |
| | | * |
| | | * @return æä¸¾å¼ |
| | | */ |
| | | @Override |
| | | public String getValue() { |
| | | return value; |
| | | } |
| | | |
| | | /** |
| | | * 设置æä¸¾å¼ |
| | | * |
| | | * @param value æä¸¾å¼ |
| | | */ |
| | | public void setValue(String value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | /** |
| | | * è·åæä¸¾æ¾ç¤ºææ¬ |
| | | * |
| | | * @return æ¾ç¤ºææ¬ |
| | | */ |
| | | @Override |
| | | public String getText() { |
| | | return text; |
| | | } |
| | | |
| | | /** |
| | | * 设置æ¾ç¤ºææ¬ |
| | | * |
| | | * @param text æ¾ç¤ºææ¬ |
| | | */ |
| | | public void setText(String text) { |
| | | this.text = text; |
| | | } |
| | | PlTypetypeEnum(String value, String text) { |
| | | this.value = value; |
| | | this.text = text; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ ¹æ®åç§°è·å对åºçæä¸¾å¼ |
| | | * |
| | | * @param text åç§° |
| | | * @return æä¸¾å¼ |
| | | */ |
| | | public static String getValueByText(String text) { |
| | | for (PlTypetypeEnum actionEnum : PlTypetypeEnum.values()) { |
| | | if (actionEnum.getText().equalsIgnoreCase(text)) { |
| | | return actionEnum.getValue(); |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æä¸¾å¼è·ååç§° |
| | | * |
| | | * @param value æä¸¾å¼ |
| | | * @return åç§° |
| | | */ |
| | | public static String getTextByValue(String value) { |
| | | for (PlTypetypeEnum actionEnum : PlTypetypeEnum.values()) { |
| | | if (actionEnum.getValue().equalsIgnoreCase(value)) { |
| | | return actionEnum.getText(); |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | /** |
| | | * æ ¹æ®æä¸¾å¼è·åæä¸¾å¯¹è±¡ |
| | | * |
| | | * @param value æä¸¾å¼ |
| | | * @return æä¸¾å¯¹è±¡ï¼ä¸å卿¶åè¿ånull |
| | | */ |
| | | public static PlTypetypeEnum forValue(String value) { |
| | | for (PlTypetypeEnum actionEnum : PlTypetypeEnum.values()) { |
| | | if (actionEnum.getValue().equalsIgnoreCase(value)) { |
| | | return actionEnum; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | * æ ¹æ®æä¸¾å¼è·ååç§° |
| | | * |
| | | * @return åç§° |
| | | */ |
| | | public static List<KeyValue> getActionAll() { |
| | | List<KeyValue> enumDataList=new ArrayList<>(); |
| | | for (PlTypetypeEnum actionEnum : PlTypetypeEnum.values()) { |
| | | KeyValue enumData=new KeyValue(); |
| | | enumData.setKey(actionEnum.value); |
| | | enumData.setValue(actionEnum.text); |
| | | enumDataList.add(enumData); |
| | | } |
| | | return enumDataList; |
| | | } |
| | | } |
| | |
| | | package com.vci.web.enumpck; |
| | | |
| | | import com.vci.common.portal.enums.GetByType; |
| | | import com.vci.constant.PortalVIEnumConstant; |
| | | import com.vci.starter.web.annotation.VciEnum; |
| | | |
| | | /** |
| | | * 表åç±»å |
| | | * @author xiej |
| | | * |
| | | */ |
| | | @VciEnum(name = PortalVIEnumConstant.PORTALVI_VI_TYPE,text = "表åç±»å") |
| | | public enum PortalVIType { |
| | | Form("Form", "表å", (short)1), |
| | | Table("Table", "è¡¨æ ¼", (short)0); |
| | |
| | | public void setIntVal(short intVal) { |
| | | this.intVal = intVal; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.vci.web.enumpck; |
| | | |
| | | import com.vci.common.portal.enums.GetByType; |
| | | import com.vci.constant.PortalVIEnumConstant; |
| | | import com.vci.starter.web.annotation.VciEnum; |
| | | |
| | | /** |
| | | * è¡¨åæ è®°ç±»å |
| | | * @author xiej |
| | | * |
| | | */ |
| | | @VciEnum(name = PortalVIEnumConstant.PORTALVI_VI_FLAG,text = "表åæå±ä¸å¡ç±»åæä¸¾") |
| | | public enum PortalVITypeFlag { |
| | | LinkType("LinkType", "龿¥ç±»åç表å", (short)1), |
| | | BtmType("BtmType", "ä¸å¡ç±»åç表å", (short)0); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.web.other; |
| | | |
| | | import com.vci.corba.omd.btm.BizType; |
| | | import com.vci.corba.omd.ltm.LinkType; |
| | | import com.vci.corba.omd.qtm.QTD; |
| | | import com.vci.corba.omd.qtm.QTInfo; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¸å¡ç±»å模æ¿å¯¼åºæ°æ®ç±»ï¼å¯åºååä¸ºæ¨¡æ¿æä»¶,åæ¶ä¹å
¼å¯¼åºæ°æ®æ§å¶ç±» |
| | | * @Title :QTExportData.java |
| | | * @Description : |
| | | * @Copyright :å®åè¿è¾¾ç§ææéå
¬å¸ |
| | | * @Author :å¹³å°ä¸è§åé¨/ZhongGY/E-mail:zhonggy@vci-tech.com |
| | | * @Date :2015-6-8 |
| | | * @Version :1 |
| | | * @Other :äº§çæ³¨é:Alt+Shift+J |
| | | */ |
| | | public class BtmQTExportData implements Serializable{ |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | /** |
| | | * éè¦åºååçæ¨¡æ¿æ°æ® |
| | | */ |
| | | // |
| | | private Map<String/*ç±»ååç§°*/, BizType/*ç±»å对象*/> selectedBtmItems = new HashMap<String, BizType>(); |
| | | private Map<String/*ç±»ååç§°*/,String[]/*ç±»åæå±å±æ§*/> selectedBtmAttrs = new HashMap<String, String[]>(); |
| | | private Map<String/*æ¥è¯¢æ¨¡æ¿åç§°*/, QTInfo/*æ¥è¯¢æ¨¡æ¿å¯¹è±¡*/> allSelectedQTs = new HashMap<String, QTInfo>(); |
| | | private Map<String/*ç±»ååç§°*/, QTD[]/*æ¥è¯¢æ¨¡æ¿å®ä¹*/> allQTDs = new HashMap<String, QTD[]>(); |
| | | |
| | | |
| | | public Map<String, BizType> getSelectedBtmItems() { |
| | | return selectedBtmItems; |
| | | } |
| | | |
| | | public void setSelectedBtmItems(Map<String, BizType> selectedBtmItems) { |
| | | this.selectedBtmItems = selectedBtmItems; |
| | | } |
| | | |
| | | public Map<String, String[]> getSelectedBtmAttrs() { |
| | | return selectedBtmAttrs; |
| | | } |
| | | |
| | | public void setSelectedBtmAttrs(Map<String, String[]> selectedBtmAttrs) { |
| | | this.selectedBtmAttrs = selectedBtmAttrs; |
| | | } |
| | | |
| | | public Map<String, QTD[]> getAllQTDs() { |
| | | return allQTDs; |
| | | } |
| | | |
| | | public void setAllQTDs(Map<String, QTD[]> allQTDs) { |
| | | this.allQTDs = allQTDs; |
| | | } |
| | | |
| | | public Map<String, QTInfo> getAllQTs() { |
| | | return allSelectedQTs; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.vci.web.service; |
| | | |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.dto.PLActionClsDTO; |
| | | import com.vci.dto.PLActionDTO; |
| | | import com.vci.dto.PLActionQueryDTO; |
| | | import com.vci.dto.*; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.FileNotFoundException; |
| | |
| | | * @return |
| | | */ |
| | | void exportBeans(List<String> actionOid, HttpServletResponse response) throws PLException, IOException; |
| | | /** |
| | | * 导å
¥Action |
| | | * @param file ä¸ä¼ çæä»¶ |
| | | * @return |
| | | */ |
| | | BaseResult impData(MultipartFile file) throws IOException, PLException; |
| | | /** |
| | | * 导åºAction |
| | | * @param plActionExpDTO 导åºå±æ§è®¾ç½®å¯¹è±¡ |
| | | */ |
| | | void exportAction(PLActionExpDTO plActionExpDTO, HttpServletResponse response) throws PLException, IOException; |
| | | /** |
| | | * ä¿åActionåæ°æ°æ® |
| | | * dto actionä¼ è¾å¯¹è±¡ |
| | | * @return ä¿åç»æ |
| | | */ |
| | | BaseResult savePLActionParam(PLActionParamDTO dto) throws PLException; |
| | | /** |
| | | * ä¿®æ¹Actionåæ°æ°æ® |
| | | * dto actionä¼ è¾å¯¹è±¡ |
| | | * @return ä¿åç»æ |
| | | */ |
| | | BaseResult updatePLActionParam(PLActionParamDTO dto) throws PLException; |
| | | /** |
| | | * å é¤Actionåæ°æ°æ® |
| | | * oid åæ°ä¸»é® |
| | | * @return ä¿åç»æ |
| | | */ |
| | | BaseResult deletePLActionParam(String oid) throws PLException; |
| | | } |
| | |
| | | */ |
| | | boolean isDefaultAttr(String attr); |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸å¡ç±»å/龿¥ç±»åè·å屿§ä¿¡æ¯ |
| | | * @param btName ä¸å¡ç±»å/龿¥ç±»å |
| | | * @param typeFlag 0:ä¸å¡ç±»å,1:龿¥ç±»å |
| | | * @return |
| | | */ |
| | | List<OsAttributeVO> getOsAttributeVOSByBtName(String btName,int typeFlag)throws Exception; |
| | | |
| | | } |
| | |
| | | * @param btmId ä¸å¡ç±»åçç¼å· |
| | | * @return 屿§çå
容 |
| | | */ |
| | | List<OsBtmTypeAttributeVO> listAttributeByBtmId(String btmId); |
| | | List<OsBtmTypeAttributeVO> listAttributeByBtmId(String btmId) throws PLException; |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸å¡ç±»åè·åå
å«ç屿§--å
å«åºç¡å±æ§ |
| | | * @param btmId ä¸å¡ç±»åçç¼å· |
| | | * @return 屿§çå
容 |
| | | */ |
| | | List<OsBtmTypeAttributeVO> listAttributeByBtmIdHasDefault(String btmId); |
| | | List<OsBtmTypeAttributeVO> listAttributeByBtmIdHasDefault(String btmId) throws PLException; |
| | | |
| | | /** |
| | | * åç
§ä¸å¡ç±»å |
| | |
| | | package com.vci.web.service; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.DataGrid; |
| | | import com.vci.starter.web.pagemodel.PageHelper; |
| | |
| | | * @param oid æ¹æ¡çä¸»é® |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼æ¹æ¡ä¸åå¨ä¼æåºå¼å¸¸ |
| | | */ |
| | | void productCodeFile(String oid) throws VciBaseException; |
| | | void productCodeFile(String oid) throws VciBaseException, PLException; |
| | | |
| | | /** |
| | | * é¢è§ä»£ç æä»¶ |
| | |
| | | * @return 屿§çä¿¡æ¯ |
| | | */ |
| | | List<OsLinkTypeAttributeVO> getAllAttributeByLink(String name) throws PLException, ParseException; |
| | | |
| | | /** |
| | | * è·å设置æåºå段çæåºå段 |
| | | * @param linkType 龿¥ç±»åçç¼å· |
| | | * @param btmType ä¸å¡ç±»åçç¼å· |
| | | * @param direction æ£/åå |
| | | * @return 屿§çä¿¡æ¯ |
| | | */ |
| | | List<String> getAllOrderbyAttributeByLink(String linkType, String btmType, String direction) throws PLException, ParseException; |
| | | } |
| | |
| | | */ |
| | | boolean clone(ClonePortalVIDTOList portalVIDTOList)throws Throwable; |
| | | |
| | | |
| | | /** |
| | | * 导åºè¡¨å/è¡¨æ ¼çä¿¡æ¯å°Excelä¸ |
| | | * @param idList ä¸å¡ç±»åçç¼å·éå |
| | | * @return excelçå
¨è·¯å¾ |
| | | */ |
| | | String exportToExcel(Collection<String> idList); |
| | | |
| | | /** |
| | | *æ¥è¯¢ææè¡¨åæè
è¡¨æ ¼ |
| | |
| | | import com.vci.corba.common.PLException; |
| | | 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.QTInfoDTO; |
| | | import com.vci.pagemodel.OsBtmTypeAttributeVO; |
| | | import com.vci.pagemodel.OsLinkTypeAttributeVO; |
| | |
| | | */ |
| | | BaseResult deleteTemplate(String name) throws PLException; |
| | | /** |
| | | * |
| | | * @param qtInfoDTO ä¼ è¾çæ°æ®å¯¹è±¡ï¼ |
| | | * linkTypeName 龿¥ç±»åã |
| | | * rdPositive æ¹åï¼trueæ£åï¼falseåå |
| | |
| | | * @return æä½ç»æ |
| | | */ |
| | | BaseResult deleteLinkTemplate(List<String> templateNames) throws PLException; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¡ä»¶ä¸çæ¥è¯¢æé® |
| | | * @param qtInfoDTO |
| | | * @return |
| | | * @throws PLException |
| | | */ |
| | | BaseResult getCriteriaBtm(QTInfoDTO qtInfoDTO) throws PLException; |
| | | |
| | | /** |
| | | * ä¸å¡ç±»åæ¥è¯¢æ¨¡æ¿ä¿å |
| | | * @param qtInfoDTO ä¿åä¼ è¾å¯¹è±¡ |
| | | * @return ä¿åç»æ |
| | | */ |
| | | BaseResult btmSave(QTInfoDTO qtInfoDTO) throws PLException; |
| | | |
| | | /** |
| | | * æ´æ°æ°æ®åºç»æ |
| | | * @return ä¿åç»æ |
| | | */ |
| | | BaseResult updateDBStructure() throws PLException; |
| | | |
| | | /** |
| | | * ä¸å¡ç±»åæ¥è¯¢æ¨¡æ¿æ æ¥è¯¢ï¼ç¨äºçé¢ç导åºåè½ |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | BaseResult getBtmQtTree() throws PLException; |
| | | |
| | | /** |
| | | * 导åºä¸å¡ç±»åæ¥è¯¢æ¨¡æ¿ |
| | | * names æ¥è¯¢æ¨¡æ¿å |
| | | * @return |
| | | */ |
| | | void expBtmQTTemplate(List<String> names, HttpServletResponse response) throws PLException,IOException ; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¡ä»¶ä¸çéæ©æ¥è¯¢æ¨¡æ¿å¯¹è¯æ¡ï¼æ¥è¯¢å
¨é¨æ¨¡æ¿åæå¯¹åºçä¸å¡ç±»åæé¾æ¥ç±»ååï¼ |
| | | * @return |
| | | */ |
| | | BaseResult getAllQTs() throws PLException; |
| | | |
| | | /** |
| | | * 导å
¥ä¸å¡ç±»åæ¥è¯¢æ¨¡æ¿ |
| | | * @param file ä¸ä¼ çæä»¶ |
| | | * @return 导å
¥ç»æ |
| | | */ |
| | | BaseResult impBtmTemplate(MultipartFile file) throws IOException, ClassNotFoundException; |
| | | |
| | | } |
| | |
| | | package com.vci.web.service.impl; |
| | | import cn.hutool.core.io.FileUtil; |
| | | import com.vci.constant.FrameWorkLangCodeConstant; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.omd.ltm.LinkType; |
| | | import com.vci.corba.omd.qtm.QTInfo; |
| | | import com.vci.corba.portal.data.Constraint; |
| | | import com.vci.corba.portal.data.PLAction; |
| | | import com.vci.corba.portal.data.PLActionCls; |
| | | import com.vci.corba.portal.data.PLActionParam; |
| | | import com.vci.dto.PLActionClsDTO; |
| | | import com.vci.dto.PLActionDTO; |
| | | import com.vci.dto.PLActionQueryDTO; |
| | | import com.vci.dto.*; |
| | | 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.ControllerUtil; |
| | | import com.vci.starter.web.util.LangBaseUtil; |
| | | import com.vci.starter.web.util.LocalFileUtil; |
| | | import com.vci.web.enumpck.ActionEnum; |
| | | import com.vci.web.enumpck.PlTypetypeEnum; |
| | | import com.vci.web.other.ExportActionLogBean; |
| | | import com.vci.web.other.ExportBeans; |
| | | import com.vci.web.other.LinkQTExportData; |
| | | import com.vci.web.service.*; |
| | | import com.vci.web.util.*; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.*; |
| | |
| | | @Override |
| | | public void exportBeans(List<String> actionOid, HttpServletResponse response) throws PLException, IOException { |
| | | String defaultTempFolder = LocalFileUtil.getDefaultTempFolder(); |
| | | String vciqtmfFileName = defaultTempFolder + File.separator + "actionTemplateExp" + new Date().getTime() + ".vciamf"; |
| | | String vciqtmfFileName = defaultTempFolder + File.separator + "VCIACTIONMODELFILE" + new Date().getTime() + ".vciamf"; |
| | | HashMap exportBeans = new HashMap<String, Object>(); |
| | | getExportBeans(actionOid, exportBeans);// è·å¾å¯¼åºBeanåæ¶ï¼è®°å½log |
| | | |
| | |
| | | FileUtil.del(defaultTempFolder + File.separator); |
| | | } |
| | | |
| | | @Override |
| | | public BaseResult impData(MultipartFile file) throws IOException, PLException { |
| | | // 导å
¥ç对象 |
| | | ExportBeans exportBeans = null; |
| | | if (file == null) { |
| | | return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"æ 导å
¥çæä»¶"}); |
| | | } |
| | | if (!file.getOriginalFilename().endsWith(".vciamf")) { |
| | | throw new VciBaseException("ä»
è½ä¸ä¼ .vciqtfæ ¼å¼æä»¶ï¼è¯·éæ°ä¸ä¼ ï¼"); |
| | | } |
| | | HashMap map; |
| | | try { |
| | | ObjectInputStream obj = new ObjectInputStream(file.getInputStream()); |
| | | map = (HashMap) obj.readObject(); |
| | | } catch (ClassNotFoundException e) { |
| | | return BaseResult.fail("导å
¥å¯¹è±¡æªè·åæåï¼ï¼å¯¼å
¥å¯¹è±¡çæ¬å·ä¸åï¼"); |
| | | } |
| | | //æç»çæä¹
å |
| | | ArrayList<PLActionCls> pLActionClsList = new ArrayList<>(); |
| | | // æ´æ¢actionIdåï¼å¯ä»¥ä»æ¤å¯¼èªä¸è·å¾åæ¥çid |
| | | HashMap<String /* newId */, String /* oldId */> actionIdNav = new HashMap<String /* newId */, String /* oldId */>(); |
| | | // æ´æ¢actionClsIdåï¼å¯ä»¥ä»æ¤å¯¼èªä¸è·å¾åæ¥çid |
| | | HashMap<String /* newId */, String /* oldId */> actionClsIdNav = new HashMap<String /* newId */, String /* oldId */>(); |
| | | //ä¿åææç¶åç±»ï¼ç¨id主key |
| | | HashMap<String/*id*/,PLActionCls> actionClses = new HashMap<String/*id*/,PLActionCls>(); |
| | | // åå¨ç¬¦åæ¡ä»¶çPLAction |
| | | ArrayList<PLAction> optionPLActionList = new ArrayList<>(); |
| | | // åå¨ç¬¦åæ¡ä»¶çPLActionCls |
| | | ArrayList<PLActionCls> optionPLActionClsList = new ArrayList<>(); |
| | | // åºä¸çææActionå类对象 |
| | | PLActionCls[] pLActionClses = null; |
| | | exportBeans = (ExportBeans) map.get("exportBeans"); |
| | | // æ·»å 导å
¥çæ°æ® |
| | | addImportData(exportBeans, pLActionClsList, actionIdNav, actionClsIdNav, optionPLActionClsList, pLActionClses, optionPLActionList); |
| | | // å°PLActionCls ãPLAction 对åºçsetéåè½¬æ¢ææ°ç»ï¼å¹é
åaddExportTreeNodeæ¹æ³ï¼ |
| | | PLActionCls[] newPLActionClsArray = new PLActionCls[optionPLActionClsList.size()]; |
| | | PLAction[] newPLActionArray = new PLAction[optionPLActionList.size()]; |
| | | optionPLActionClsList.toArray(newPLActionClsArray); |
| | | optionPLActionList.toArray(newPLActionArray); |
| | | //æ¸
æ¥åç±»id |
| | | actionClses.clear(); |
| | | //ä¿åææåç±»id |
| | | for (int i = 0; i < newPLActionClsArray.length; i++) { |
| | | actionClses.put(newPLActionClsArray[i].id,newPLActionClsArray[i]); |
| | | } |
| | | //ä¿åææåå¨actionçåç±»ï¼ååç±»åå¨actionä¹ä¿åï¼ |
| | | HashSet<PLActionCls> pLActionClss =new HashSet<PLActionCls> (); |
| | | for (int i = 0; i < newPLActionArray.length; i++) { |
| | | //ç¼å该åç±»çææç¶åç±» |
| | | saveParentCls(newPLActionArray[i].plActionCls,pLActionClss,actionClses); |
| | | } |
| | | PLActionCls[] actionClslist = new PLActionCls[pLActionClss.size()]; |
| | | pLActionClss.toArray(actionClslist); |
| | | PLActionClsDTO treDto = new PLActionClsDTO(); |
| | | treDto.setName("Actionåç±»"); |
| | | |
| | | Map<String, List<PLAction>> plActionMap = Arrays.stream(newPLActionArray).collect(Collectors.groupingBy(e -> e.plActionCls)); |
| | | Map<String, List<PLActionCls>> plActionClsMap = pLActionClss.stream().collect(Collectors.groupingBy(e -> e.pid)); |
| | | Map<String, List<PLActionCls>> allCls = Arrays.stream(platformClientUtil.getUIService().getPLActionClsArray()).collect(Collectors.groupingBy(e -> e.name)); |
| | | // æ·»å åèç¹(æºæ èç¹) |
| | | for (Map.Entry<String, PLActionCls> entry : exportBeans.getPLActionClsBeans().entrySet()) { |
| | | if (StringUtils.isBlank(entry.getValue().pid)) { |
| | | PLActionClsDTO parentDto = new PLActionClsDTO(); |
| | | parentDto.setId(entry.getValue().id); |
| | | parentDto.setName(entry.getValue().name); |
| | | parentDto.setPid(entry.getValue().pid); |
| | | parentDto.setDescription(entry.getValue().description); |
| | | parentDto.setCreator(entry.getValue().creator); |
| | | parentDto.setCreateTime(entry.getValue().createTime); |
| | | parentDto.setSerialno(entry.getValue().serialno); |
| | | addExportTreeNode(plActionClsMap, plActionMap, parentDto, allCls, exportBeans); |
| | | treDto.getChilds().add(parentDto); |
| | | } |
| | | } |
| | | PLActionClsDTO noDto = new PLActionClsDTO(); |
| | | noDto.setName("æªåç±»"); |
| | | if(plActionMap.containsKey("")){ |
| | | for (PLAction plAction : plActionMap.get("")) { |
| | | PLActionClsDTO childPrentDto = new PLActionClsDTO(); |
| | | if (plAction.plName.endsWith("@#ä¿®æ¹$%")) { |
| | | childPrentDto.setName(plAction.plCode + "/" + plAction.plName.replace("@#ä¿®æ¹$%", "ãä¿®æ¹å®æã")); |
| | | plAction.plName = plAction.plName.replace("@#ä¿®æ¹$%", ""); |
| | | platformClientUtil.getUIService().updatePLAction(plAction); |
| | | }else |
| | | if (plAction.plName.endsWith("@#åå¨å¨æªåç±»ä¸$%")) { |
| | | childPrentDto.setName(plAction.plCode + "/" + plAction.plName.replace("@#åå¨å¨æªåç±»ä¸$%", "ãactionåå¨å¨æªåç±»ä¸ï¼ä¿®æ¹å®æã")); |
| | | plAction.plName = plAction.plName.replace("@#åå¨å¨æªåç±»ä¸$%", ""); |
| | | platformClientUtil.getUIService().updatePLAction(plAction); |
| | | // plAction.plName = plAction.plName.replace("@#åå¨å¨æªåç±»ä¸$%", "ãactionåå¨å¨æªåç±»ä¸ï¼ä¿®æ¹Actionå¹¶æå¯¼å
¥æä»¶å建actionåç±»ã"); |
| | | } |
| | | else { |
| | | childPrentDto.setName(plAction.plCode + "/" + "ãæ°å¢å®æã"); |
| | | // plAction.plName += "ãæ°å¢ã"; |
| | | platformClientUtil.getUIService().savePLAction(plAction); |
| | | } |
| | | dealParam(exportBeans, plAction); |
| | | childPrentDto.setId(plAction.plOId); |
| | | childPrentDto.setPid(plAction.plActionCls); |
| | | noDto.getChilds().add(childPrentDto); |
| | | } |
| | | } |
| | | treDto.getChilds().add(noDto); |
| | | |
| | | return BaseResult.success(treDto); |
| | | } |
| | | /** |
| | | * 导åºAction |
| | | * @param plActionExpDTO 导åºå±æ§è®¾ç½®å¯¹è±¡ |
| | | */ |
| | | @Override |
| | | public void exportAction(PLActionExpDTO plActionExpDTO, HttpServletResponse response) throws PLException, IOException { |
| | | String defaultTempFolder = LocalFileUtil.getDefaultTempFolder(); |
| | | String excelPath = defaultTempFolder + File.separator + plActionExpDTO.getFileName() + ".xls"; |
| | | try { |
| | | new File(excelPath).createNewFile(); |
| | | } catch (Throwable e) { |
| | | throw new VciBaseException(LangBaseUtil.getErrorMsg(e), new String[]{excelPath}, e); |
| | | } |
| | | isValidPageForamt(plActionExpDTO); |
| | | //设置å |
| | | List<WriteExcelData> excelDataList = new ArrayList<>(); |
| | | //设置å头 |
| | | for (int index = 0; index < plActionExpDTO.getColumnName().size(); index++) { |
| | | excelDataList.add(new WriteExcelData(0,index, plActionExpDTO.getColumnName().get(index))); |
| | | } |
| | | PLAction[] allPLAction ; |
| | | if(plActionExpDTO.getDataType().equals(ActionEnum.EXP_ALL.getValue()) || |
| | | plActionExpDTO.getDataType().equals(ActionEnum.EXP_PAGE.getValue())){ |
| | | allPLAction = platformClientUtil.getUIService().getAllPLAction(); |
| | | }else{ |
| | | allPLAction = new PLAction[plActionExpDTO.getChooseDataOid().size()]; |
| | | for (int i = 0; i < plActionExpDTO.getChooseDataOid().size(); i++) { |
| | | allPLAction[i] = platformClientUtil.getUIService().getPLActionById(plActionExpDTO.getChooseDataOid().get(i)); |
| | | } |
| | | } |
| | | if(Func.isEmpty(allPLAction)){ |
| | | excelDataList.add(new WriteExcelData(1,1, "æ ¹æ®å±æ§åç§°æªæ¥è¯¢å°å±æ§ä¿¡æ¯ï¼è¯·å·æ°åå°è¯éæ°å¯¼åºï¼")); |
| | | }else{ |
| | | for (int i = 0; i < allPLAction.length; i++) { |
| | | PLAction action = allPLAction[i]; |
| | | List<String> columnName = plActionExpDTO.getColumnName(); |
| | | for (int index = 0; index < columnName.size(); index++) { |
| | | switch (columnName.get(index)){ |
| | | case "ç¼å·": |
| | | excelDataList.add(new WriteExcelData(i+1,index, action.plCode)); |
| | | break; |
| | | case "类路å¾": |
| | | excelDataList.add(new WriteExcelData(i+1,index, action.plBSUrl)); |
| | | break; |
| | | case "龿¥å°å": |
| | | excelDataList.add(new WriteExcelData(i+1,index, action.plCSClass)); |
| | | break; |
| | | case "æè¿°": |
| | | excelDataList.add(new WriteExcelData(i+1,index, action.plDesc)); |
| | | break; |
| | | case "ç±»å": |
| | | excelDataList.add(new WriteExcelData(i+1,index, action.plTypeType.equals(PlTypetypeEnum.BUSINESS.getValue()) ? |
| | | PlTypetypeEnum.BUSINESS.getText() : PlTypetypeEnum.LINK.getText())); |
| | | break; |
| | | case "åç§°": |
| | | excelDataList.add(new WriteExcelData(i+1,index, action.plName)); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | WriteExcelOption excelOption = new WriteExcelOption(excelDataList); |
| | | ExcelUtil.writeDataToFile(excelPath, excelOption); |
| | | ControllerUtil.writeFileToResponse(response,excelPath); |
| | | FileUtil.del(defaultTempFolder + File.separator); |
| | | } |
| | | /** |
| | | * ä¿åActionåæ°æ°æ® |
| | | * dto actionä¼ è¾å¯¹è±¡ |
| | | * @return ä¿åç»æ |
| | | */ |
| | | @Override |
| | | public BaseResult savePLActionParam(PLActionParamDTO dto) throws PLException { |
| | | if(dto.getName() == null || dto.getName().equals("")) { |
| | | throw new PLException("500",new String[]{"åæ°åç§°ä¸è½ä¸ºç©º"}); |
| | | } |
| | | PLActionParam param = new PLActionParam(); |
| | | param.oid = ""; |
| | | param.name = dto.getName(); |
| | | param.defaultValue = dto.getDefaultValue(); |
| | | param.description = dto.getDescription(); |
| | | param.action = dto.getAction(); |
| | | String message = platformClientUtil.getUIService().createPLActionParam(param); |
| | | |
| | | if(message.startsWith("0")) { |
| | | if(message.equals("01")) { |
| | | throw new PLException("500",new String[]{"åæ°åå·²ç»åå¨ï¼"}); |
| | | } else { |
| | | throw new PLException("500",new String[]{"æ·»å æé®åæ°æ¶åçå¼å¸¸ï¼" + message.substring(1)}); |
| | | } |
| | | } |
| | | return BaseResult.success(); |
| | | } |
| | | |
| | | @Override |
| | | public BaseResult updatePLActionParam(PLActionParamDTO dto) throws PLException { |
| | | if(dto.getName() == null || dto.getName().equals("")) { |
| | | throw new PLException("500",new String[]{"åæ°åç§°ä¸è½ä¸ºç©º"}); |
| | | } |
| | | PLActionParam param = new PLActionParam(); |
| | | param.oid = dto.getOid(); |
| | | param.name = dto.getName(); |
| | | param.defaultValue = dto.getDefaultValue(); |
| | | param.description = dto.getDescription(); |
| | | param.action = dto.getAction(); |
| | | String message = platformClientUtil.getUIService().editPLActionParam(param); |
| | | |
| | | if(message.startsWith("0")) { |
| | | if(message.equals("01")) { |
| | | throw new PLException("500",new String[]{"åæ°åå·²ç»åå¨ï¼"}); |
| | | } else { |
| | | throw new PLException("500",new String[]{"æ·»å æé®åæ°æ¶åçå¼å¸¸ï¼" + message.substring(1)}); |
| | | } |
| | | } |
| | | return BaseResult.success(); |
| | | } |
| | | /** |
| | | * å é¤Actionåæ°æ°æ® |
| | | * oid åæ°ä¸»é® |
| | | * @return ä¿åç»æ |
| | | */ |
| | | @Override |
| | | public BaseResult deletePLActionParam(String oid) throws PLException { |
| | | if(StringUtils.isBlank(oid)){ |
| | | throw new PLException("500", new String[]{"忰䏻é®ä¸è½ä¸ºç©º"}); |
| | | } |
| | | String message = platformClientUtil.getUIService().deletePLActionParam(oid); |
| | | if (message.startsWith("0")) { |
| | | throw new PLException("500", new String[]{"å 餿é®åæ°æ¶åçå¼å¸¸ï¼" + message.substring(1)}); |
| | | } |
| | | return BaseResult.success(); |
| | | } |
| | | |
| | | public boolean isValidPageForamt(PLActionExpDTO plActionExpDTO) throws PLException { |
| | | |
| | | boolean res = false; |
| | | if(plActionExpDTO.getDataType().equals(ActionEnum.EXP_ALL.getValue()) || |
| | | plActionExpDTO.getDataType().equals(ActionEnum.EXP_CHOOSE.getValue())) { |
| | | res = true; |
| | | return res; |
| | | } |
| | | if(StringUtils.isBlank(plActionExpDTO.getPageNum())){ |
| | | throw new PLException("500", new String[]{"页ç ä¸è½ä¸ºç©º"}); |
| | | } else{ |
| | | int pageCount = 1;//è¿éåºå®ç±äºç颿²¡æç¿»é¡µåè½ |
| | | String[] pages = plActionExpDTO.getPageNum().split("-"); |
| | | |
| | | // ç¨dobuleæ¥æ¶è¾å
¥çæ°æ®ï¼é²æ¢è¾å
¥è¶
大å¼ï¼å¤§äºInteger.MAX_VALUEï¼ |
| | | // è½¬æ¢æIntegerï¼è¿è¡æ¯è¾ï¼åå¨æç¤ºå
容ä¸å»ædoubleç±»åæ°æ®å¯è½ä¼åºç°çå°æ°ç¹ |
| | | if(pages.length == 1){ |
| | | double pageD = Double.parseDouble(pages[0]); |
| | | if(pageD > Integer.MAX_VALUE){ |
| | | throw new PLException("500", new String[]{"èµ·å§é¡µç " + String.valueOf(pageD) + " ä¸å¾å¤§äº " + Integer.MAX_VALUE}); |
| | | }else{ |
| | | int page = (int)pageD; |
| | | if(page > pageCount){ |
| | | throw new PLException("500", new String[]{"è¾å
¥ç页ç " + page + " ä¸å¾å¤§äºæ»é¡µæ° " + pageCount}); |
| | | } else if(page > Integer.MAX_VALUE){ |
| | | throw new PLException("500", new String[]{"è¾å
¥ç页ç " + page + " ä¸å¾å¤§äº " + Integer.MAX_VALUE}); |
| | | } else { |
| | | res = true; |
| | | } |
| | | } |
| | | } else{ |
| | | double pageStartD = Double.parseDouble(pages[0]); |
| | | double pageEndD = Double.parseDouble(pages[1]); |
| | | if(pageStartD > Integer.MAX_VALUE){ |
| | | throw new PLException("500", new String[]{"èµ·å§é¡µç " + pageStartD + " ä¸å¾å¤§äº " + Integer.MAX_VALUE}); |
| | | } else if(pageEndD > Integer.MAX_VALUE){ |
| | | throw new PLException("500", new String[]{"ç»æé¡µç " + pageEndD + " ä¸å¾å¤§äº " + Integer.MAX_VALUE}); |
| | | } else{ |
| | | int pageStart = (int)pageStartD; |
| | | int pageEnd = (int)pageEndD; |
| | | if(pageStart > pageCount){ |
| | | throw new PLException("500", new String[]{"èµ·å§é¡µç " + pageStart + " ä¸å¾å¤§äºæ»é¡µæ° " + pageCount}); |
| | | } else if(pageEnd > pageCount){ |
| | | throw new PLException("500", new String[]{"ç»æé¡µç " + pageEnd + " ä¸å¾å¤§äºæ»é¡µæ° " + pageCount}); |
| | | } else if(pageStart > pageEnd){ |
| | | throw new PLException("500", new String[]{"èµ·å§é¡µç " + pageStart + " ä¸å¾å¤§äºç»æé¡µç " + pageEnd}); |
| | | } else{ |
| | | res = true; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å¤çåæ°å表 |
| | | * @param exportBeans 导å
¥æ°æ®éå |
| | | * @param plAction action对象 |
| | | * @throws PLException |
| | | */ |
| | | private void dealParam(ExportBeans exportBeans, PLAction plAction) throws PLException { |
| | | PLActionParam[] plActionParamArrayByActionId = exportBeans.getPLActionParamArrayByActionId(plAction.plOId); |
| | | PLActionParam[] paramArray = platformClientUtil.getUIService().getPLActionParamArrayByActionId(plAction.plOId); |
| | | Map<String, List<PLActionParam>> params = Arrays.stream(paramArray).collect(Collectors.groupingBy(e -> e.oid)); |
| | | if(plActionParamArrayByActionId == null){ |
| | | return; |
| | | } |
| | | for (PLActionParam param : plActionParamArrayByActionId) { |
| | | if(params.containsKey(param)){ |
| | | platformClientUtil.getUIService().editPLActionParam(param); |
| | | }else { |
| | | platformClientUtil.getUIService().createPLActionParam(param); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void addExportTreeNode(Map<String, List<PLActionCls>> pLActionClses, Map<String, List<PLAction>> plActions, |
| | | PLActionClsDTO parentDto,Map<String, List<PLActionCls>> allCls, ExportBeans exportBeans) throws PLException { |
| | | |
| | | //å¤çå½åèç¹ä¸çaction |
| | | if(plActions.containsKey(parentDto.getId())){ |
| | | for (PLAction plAction : plActions.get(parentDto.getId())) { |
| | | PLActionClsDTO childPrentDto = new PLActionClsDTO(); |
| | | childPrentDto.setId(plAction.plOId); |
| | | if (plAction.plName.endsWith("@#ä¿®æ¹$%")) { |
| | | childPrentDto.setName(plAction.plCode + "/" + plAction.plName.replace("@#ä¿®æ¹$%", "ãä¿®æ¹æåã")); |
| | | // plAction.plName = plAction.plName.replace("@#ä¿®æ¹$%", "ãä¿®æ¹ã"); |
| | | plAction.plName = plAction.plName.replace("@#ä¿®æ¹$%", ""); |
| | | platformClientUtil.getUIService().updatePLAction(plAction); |
| | | }else |
| | | if (plAction.plName.endsWith("@#åå¨å¨æªåç±»ä¸$%")) { |
| | | childPrentDto.setName(plAction.plCode + "/" + plAction.plName.replace("@#åå¨å¨æªåç±»ä¸$%", "ãactionåå¨å¨æªåç±»ä¸ï¼ä¿®æ¹Actionæåã")); |
| | | // plAction.plName = plAction.plName.replace("@#åå¨å¨æªåç±»ä¸$%", "ãactionåå¨å¨æªåç±»ä¸ï¼ä¿®æ¹Actionå¹¶æå¯¼å
¥æä»¶å建actionåç±»ã"); |
| | | plAction.plName = plAction.plName.replace("@#åå¨å¨æªåç±»ä¸$%", ""); |
| | | platformClientUtil.getUIService().updatePLAction(plAction); |
| | | } |
| | | else { |
| | | childPrentDto.setName(plAction.plCode + "/" + plAction.plName.replace("@#æ°å¢%", "ãæ°å¢æåã")); |
| | | // plAction.plName += "ãæ°å¢ã"; |
| | | platformClientUtil.getUIService().savePLAction(plAction); |
| | | } |
| | | dealParam(exportBeans, plAction); |
| | | childPrentDto.setPid(plAction.plActionCls); |
| | | parentDto.getChilds().add(childPrentDto); |
| | | } |
| | | } |
| | | if(pLActionClses.containsKey(parentDto.getId())){ |
| | | List<PLActionCls> plActionCls = pLActionClses.get(parentDto.getId()); |
| | | for (PLActionCls plActionCl : plActionCls) { |
| | | PLActionClsDTO childParentDto = new PLActionClsDTO(); |
| | | childParentDto.setId(plActionCl.id); |
| | | if(allCls.containsKey(childParentDto.getName())){ |
| | | childParentDto.setName(plActionCl.name); |
| | | }else { |
| | | childParentDto.setName(plActionCl.name + "ãæ°å¢å®æã"); |
| | | platformClientUtil.getUIService().creaetePLActionCls(plActionCl); |
| | | } |
| | | childParentDto.setPid(plActionCl.pid); |
| | | childParentDto.setDescription(plActionCl.description); |
| | | childParentDto.setCreator(plActionCl.creator); |
| | | childParentDto.setCreateTime(plActionCl.createTime); |
| | | childParentDto.setSerialno(plActionCl.serialno); |
| | | addExportTreeNode(pLActionClses, plActions, childParentDto, allCls, exportBeans); |
| | | parentDto.getChilds().add(childParentDto); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ä¿åææç¶åç±» |
| | | * @param plActionCls |
| | | * @param pLActionClsList |
| | | */ |
| | | private void saveParentCls(String plActionCls, HashSet<PLActionCls> pLActionClsList, |
| | | HashMap<String/*id*/,PLActionCls> actionClses) { |
| | | if(actionClses.containsKey(plActionCls)){ |
| | | PLActionCls pCls = actionClses.get(plActionCls); |
| | | pLActionClsList.add(pCls); |
| | | saveParentCls(pCls.pid, pLActionClsList, actionClses); |
| | | } |
| | | |
| | | } |
| | | |
| | | private void addImportData(ExportBeans exportBeans, ArrayList<PLActionCls> pLActionClsList, HashMap<String /* newId */, |
| | | String /* oldId */> actionIdNav,HashMap<String /* newId */, String /* oldId */> actionClsIdNav, |
| | | ArrayList<PLActionCls> optionPLActionClsList, PLActionCls[] pLActionClses, ArrayList<PLAction> plActionList) |
| | | throws PLException { |
| | | HashMap<String, PLAction> pLActionBeans = exportBeans.getPLActions(); |
| | | if (pLActionBeans == null) { |
| | | throw new VciBaseException("导å
¥å¯¹è±¡æªè·åæåï¼ï¼"); |
| | | } |
| | | //æ°æ®åºä¸æ²¡æåå¨çæ°æ®å¯¹è±¡ï¼éè¦è¿è¡ä¿å |
| | | // ArrayList<PLAction> plActionList = new ArrayList<>(); |
| | | PLAction[] allPLAction = platformClientUtil.getUIService().getAllPLAction(); |
| | | Map<String, PLAction> allPLActionMap = Arrays.stream(allPLAction).collect(Collectors.toMap(e -> e.plOId, e -> e)); |
| | | Set<Map.Entry<String, PLAction>> plActions = pLActionBeans.entrySet(); |
| | | for (Map.Entry<String, PLAction> entry : plActions) { |
| | | PLAction plAction = entry.getValue(); |
| | | PLAction plActionInDB =allPLActionMap.get(plAction.plOId); |
| | | |
| | | if (plActionInDB != null) { |
| | | if( plActionInDB.plActionCls != ""){ |
| | | plAction.plActionCls = plActionInDB.plActionCls; |
| | | // plAction.plOId = newId; |
| | | plAction.plName += "@#ä¿®æ¹$%"; |
| | | plActionList.add(plAction); |
| | | continue; |
| | | }else{ |
| | | plAction.plName += "@#åå¨å¨æªåç±»ä¸$%"; |
| | | } |
| | | |
| | | } |
| | | // å°è¯¥å®ä¾acionåå
¥å°plActionListä¸ |
| | | plActionList.add(plAction); |
| | | |
| | | // å®ä¹liståå¨å½åactionå°æ°æ®åºactionçè·¯å¾ä¸çææPLActionCls对象 |
| | | List<PLActionCls> plActionClsList = new ArrayList<PLActionCls>(); |
| | | // è·å¾åºä¸çæè¿çPLActionCls对象 |
| | | String pId = WebUtil.getSnowflakePk(); |
| | | String oId = WebUtil.getSnowflakePk(); |
| | | |
| | | PLActionCls pLActionCls = getParentPLActionClsInDBById(plAction, |
| | | pId, plActionClsList, actionClsIdNav, exportBeans, optionPLActionClsList, pLActionClses); |
| | | |
| | | changePLActionOID(plAction, oId, pId, actionIdNav); |
| | | |
| | | if (plActionClsList.size() == 1) { |
| | | // å é¤"æªåç±»"å类对象 |
| | | PLActionCls plActionCls = plActionClsList.get(plActionClsList |
| | | .size() - 1); |
| | | |
| | | if(pLActionCls != null){ |
| | | plAction.plActionCls = pLActionCls.id; |
| | | if(plActionCls.name.equals("æªåç±»")){ |
| | | plAction.plActionCls = ""; |
| | | } |
| | | plActionClsList.remove(plActionClsList.size() - 1); |
| | | }else{ |
| | | if(plActionCls.name.equals("æªåç±»")){ |
| | | plActionClsList.remove(plActionClsList.size() - 1); |
| | | }else{ |
| | | plActionCls.pid = ""; |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | if (plActionClsList.size() >= 2) { |
| | | |
| | | PLActionCls plActionCls2 = plActionClsList.get(plActionClsList |
| | | .size() - 2); |
| | | PLActionCls plActionCls1 = plActionClsList.get(plActionClsList |
| | | .size() - 1); |
| | | if (pLActionCls != null) { |
| | | // å°å¯¼å
¥å¯¹è±¡ä¸âåºä¸çæè¿çPLActionCls对 象ânameç¸åç对象 |
| | | // çä¸ä¸ä¸ªPLActionCls对象ç¶idæ¹ä¸ºåºä¸âæè¿âPLActionCls对象id |
| | | plActionClsList.remove(plActionClsList.size() - 1); |
| | | plActionCls2.pid = pLActionCls.id; |
| | | }else{ |
| | | if(plActionCls1.name.equals("æªåç±»")){ |
| | | plActionClsList.remove(plActionClsList.size() - 1); |
| | | plActionCls2.pid = ""; |
| | | }else{ |
| | | plActionCls1.pid = ""; |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | // å¢å å°æ´ä½listä¸ç¨æ¥æç»æä¹
å |
| | | pLActionClsList.addAll(plActionClsList); |
| | | } |
| | | } |
| | | |
| | | |
| | | private void changePLActionOID(PLAction plAction, String oId, String pId, HashMap<String /* newId */, String /* oldId */> actionIdNav) { |
| | | actionIdNav.put(oId, plAction.plOId); |
| | | plAction.plOId = oId; |
| | | plAction.plActionCls = pId; |
| | | } |
| | | /*** |
| | | * è·å¾åºä¸çPLActionCls对象ï¼ç¨æ¥å«æ¥å¯¼å
¥æ¥çæ |
| | | * |
| | | * @param |
| | | * @param plActionClsList |
| | | * @return |
| | | */ |
| | | private PLActionCls getParentPLActionClsInDBById(Object plActionClsIdObj, |
| | | String newPLActionClsId, List<PLActionCls> plActionClsList, |
| | | HashMap<String /* newId */, String /* oldId */> actionClsIdNav,ExportBeans exportBeans, |
| | | ArrayList<PLActionCls> optionPLActionClsList, PLActionCls[] pLActionClses) { |
| | | String pId = null; |
| | | if (plActionClsIdObj instanceof PLAction) { |
| | | pId = ((PLAction) plActionClsIdObj).plActionCls; |
| | | if(pId.equals("")){ |
| | | PLActionCls noneCls = new PLActionCls("", "æªåç±»", "", "", "", 0, (short)0); |
| | | plActionClsList.add(noneCls); |
| | | return noneCls; |
| | | } |
| | | } |
| | | if (plActionClsIdObj instanceof PLActionCls) { |
| | | pId = ((PLActionCls) plActionClsIdObj).pid; |
| | | pId = actionClsIdNav.get(pId); |
| | | if(pId.equals("")){ |
| | | pId = "null"; |
| | | } |
| | | |
| | | } |
| | | |
| | | PLActionCls plActionCls = exportBeans.getPLActionClsBeanById(pId);// ä»å¯¼å
¥å¯¹è±¡ä¸è·å¾ç¶åç±» |
| | | |
| | | |
| | | PLActionCls tempPLActionCls = null; |
| | | if (plActionCls != null) {// plActionCls为空 è¯æç¶èç¹ä¸ºæ ¹èç¹ |
| | | |
| | | plActionClsList.add(plActionCls); |
| | | if(optionPLActionClsList.contains(plActionCls)){ |
| | | return plActionCls ; |
| | | } |
| | | for (PLActionCls Cls : pLActionClses) { |
| | | if ((plActionCls.id.equals("") && plActionCls.name.trim() |
| | | .equals("æªåç±»")) |
| | | || plActionCls.name.trim().equals(Cls.name.trim())) { |
| | | tempPLActionCls = Cls; |
| | | } |
| | | } |
| | | plActionCls.id = newPLActionClsId; // ä¿®æ¹ç¶åç±»id |
| | | } else { |
| | | return null; |
| | | } |
| | | |
| | | if (tempPLActionCls == null) { |
| | | String newClsId = WebUtil.getSnowflakePk(); |
| | | actionClsIdNav.put(newClsId, plActionCls.pid); |
| | | plActionCls.pid = newClsId; |
| | | return getParentPLActionClsInDBById(plActionCls, newClsId, |
| | | plActionClsList, actionClsIdNav, exportBeans, optionPLActionClsList, pLActionClses); |
| | | } |
| | | return tempPLActionCls; |
| | | } |
| | | |
| | | /** |
| | | * å¤ç导åºç对象 |
| | | * @param actionOid çé¢éæ©çactionåè¡¨æ°æ® |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸å¡ç±»åè·å屿§ä¿¡æ¯ |
| | | * @param btName ä¸å¡ç±»å/龿¥ç±»å |
| | | * @param typeFlag 0:ä¸å¡ç±»å,1:龿¥ç±»å |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<OsAttributeVO> getOsAttributeVOSByBtName(String btName, int typeFlag) throws Exception{ |
| | | VciBaseUtil.alertNotNull(btName,"åæ°ä¸å
许为空",typeFlag,"åæ°ä¸å
许为空"); |
| | | List<OsAttributeVO> attributeVOS=new ArrayList<>(); |
| | | try { |
| | | AttributeDef[] attributeDefs=new AttributeDef[]{}; |
| | | if(typeFlag==0){ |
| | | attributeDefs= platformClientUtil.getBtmService().getAttributeDefs(btName); |
| | | }else{ |
| | | attributeDefs=platformClientUtil.getLinkTypeService().getAttributes(btName); |
| | | } |
| | | attributeVOS=attributeDO2VOs(Arrays.asList(attributeDefs)); |
| | | }catch (PLException e){ |
| | | throw new Exception("æ ¹æ®ä¸å¡ç±»åè·å屿§å¼å¸¸"+e.getMessage()); |
| | | } |
| | | |
| | | return attributeVOS; |
| | | } |
| | | |
| | | /** |
| | | * æ¯å¦ä¸ºåç
§å±æ§ |
| | | * @param other é
ç½®çå
¶ä» |
| | | * @return true æ¯åç
§ |
| | |
| | | import com.vci.starter.poi.constant.ExcelLangCodeConstant; |
| | | import com.vci.starter.poi.util.ExcelUtil; |
| | | import com.vci.starter.web.annotation.log.VciUnLog; |
| | | import com.vci.starter.web.constant.QueryOptionConstant; |
| | | import com.vci.starter.web.enumpck.BooleanEnum; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | |
| | | * @return 屿§çå
容 |
| | | */ |
| | | @Override |
| | | public List<OsBtmTypeAttributeVO> listAttributeByBtmId(String btmId) { |
| | | public List<OsBtmTypeAttributeVO> listAttributeByBtmId(String btmId) throws PLException { |
| | | VciBaseUtil.alertNotNull(btmId,"ä¸å¡ç±»åçç¼å·"); |
| | | OsBtmTypeVO btmTypeVO = getBtmById(btmId); |
| | | BizType[] bizTypes = platformClientUtil.getBtmService().getBizTypes(btmId); |
| | | if(Func.isEmpty(bizTypes)){ |
| | | return new ArrayList<>(); |
| | | } |
| | | BizType bizType = bizTypes[0]; |
| | | OsBtmTypeVO btmTypeVO = btmDO2VO(bizType); |
| | | List<OsBtmTypeAttributeVO> attributes = btmTypeVO.getAttributes(); |
| | | if(attributes == null){ |
| | | attributes = new ArrayList<>(); |
| | |
| | | * @return 屿§çå
容 |
| | | */ |
| | | @Override |
| | | public List<OsBtmTypeAttributeVO> listAttributeByBtmIdHasDefault(String btmId) { |
| | | public List<OsBtmTypeAttributeVO> listAttributeByBtmIdHasDefault(String btmId) throws PLException { |
| | | List<OsBtmTypeAttributeVO> attrVOs = listAttributeByBtmId(btmId); |
| | | if(attrVOs == null){ |
| | | attrVOs = new ArrayList<>(); |
| | |
| | | public boolean addIndex(List<IndexObject> indexObjectList) throws PLException { |
| | | VciBaseUtil.alertNotNull(indexObjectList,"æ°å¢çç´¢å¼ä¿¡æ¯"); |
| | | String btmName = indexObjectList.get(0).getTypeName(); |
| | | String indexNames = indexObjectList.stream().map(IndexObject::getIndexName).collect(Collectors.joining()); |
| | | String indexNames = indexObjectList.stream().map(IndexObject::getIndexName).collect(Collectors.joining(",")); |
| | | String[] oldindexAttr = {indexNames}; |
| | | BusinessObject bo; |
| | | List<BusinessObject> boList = new ArrayList<>(); |
| | | //å
æ¥è¯¢å½åæ·»å ç´¢å¼æ¯å¦å·²ç»åå¨ï¼å¦æåå¨å°±å
å é¤åæ°å¢å®ç°æ¿æ¢æä½ |
| | | Map<String, String> conditionMap = new HashMap<>(); |
| | | conditionMap.put("typename",btmName); |
| | | //å
è¿æ ·å¤çï¼å端ç°å¨åªåäºå次ä¿åï¼æä»¥ä¸ç¨in |
| | | conditionMap.put("indexname", indexNames); |
| | | List<IndexObject> indexObjects = getIndexByCondition(conditionMap); |
| | | if(indexObjects!=null && indexObjects.size()>0){ |
| | | //ç´¢å¼ä¸å卿¶å é¤å°±ä¼æ¥éç´¢å¼ä¸åå¨ï¼æä»¥è¿éæç´¢å¼æå»å é¤ |
| | |
| | | package com.vci.web.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.starter.revision.service.RevisionModelUtil; |
| | | import com.vci.starter.web.annotation.Column; |
| | | import com.vci.starter.web.constant.FrameWorkLcStatusConstant; |
| | |
| | | * @throws VciBaseException åæ°ä¸ºç©ºï¼æ¹æ¡ä¸åå¨ä¼æåºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public void productCodeFile(String oid) throws VciBaseException { |
| | | public void productCodeFile(String oid) throws VciBaseException, PLException { |
| | | OsCodeGenSchemaDO codeGenSchemaDO = selectByOid(oid); |
| | | //å¤çä¸´æ¶æä»¶å¤¹ï¼å¨ä¸´æ¶æä»¶å¤¹ä¸æ·»å codes/{ä¸å¡ç±»åçè±æåç§°} |
| | | String tempFolder =LocalFileUtil.getProjectFolder(); |
| | |
| | | import cn.hutool.core.util.ZipUtil; |
| | | import com.fasterxml.jackson.core.type.TypeReference; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.vci.common.qt.object.QTConstants; |
| | | import com.vci.constant.FrameWorkLangCodeConstant; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.omd.atm.AttributeDef; |
| | |
| | | } |
| | | return links; |
| | | } |
| | | /** |
| | | * è·å设置æåºå段çæåºå段 |
| | | * @param linkType 龿¥ç±»åçç¼å· |
| | | * @param btmType ä¸å¡ç±»åçç¼å· |
| | | * @param direction æ£/åå |
| | | * @return 屿§çä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | public List<String> getAllOrderbyAttributeByLink(String linkType, String btmType, String direction) throws PLException, ParseException { |
| | | List<String> abNames = new ArrayList<>(Arrays.asList("OID", "Creator", "CreateTime", "LastModifier", "LASTMODIFYTIME", "F_OID", |
| | | "F_REVISIONOID", "F_NAMEOID", "F_BtwName", "T_OID", "T_REVISIONOID", "T_NAMEOID", "T_BtwName", "TS" )); |
| | | AttributeDef[] attributes = platformClientUtil.getLinkTypeService().getAttributes(linkType); |
| | | for (AttributeDef attribute : attributes) { |
| | | abNames.add(String.valueOf(attribute.name)); |
| | | } |
| | | String wrapper = "T_OID."; |
| | | if(direction.equals(QTConstants.DIRECTION_OPPOSITE)){ |
| | | wrapper = "F_OID."; |
| | | } |
| | | List<OsBtmTypeAttributeVO> bizTypeQTDs = btmService.getBizTypeQTDs(btmType); |
| | | for (OsBtmTypeAttributeVO bizTypeQTD : bizTypeQTDs) { |
| | | abNames.add(wrapper + bizTypeQTD.getId()); |
| | | } |
| | | return abNames; |
| | | } |
| | | |
| | | /** |
| | | * ä¿®å¤é¾æ¥ç±»åçxmlæä»¶ |
| | |
| | | package com.vci.web.service.impl; |
| | | |
| | | import cn.hutool.core.io.FileUtil; |
| | | import cn.hutool.core.util.ZipUtil; |
| | | import com.vci.bo.ItemSeniorQueryBO; |
| | | import com.vci.common.utility.ObjectUtility; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.omd.qtm.QTD; |
| | | import com.vci.corba.omd.qtm.QTInfo; |
| | | import com.vci.corba.portal.PortalService.GetPagePortalVIArrayByPageInfoResult; |
| | | import com.vci.corba.portal.data.PortalVI; |
| | | import com.vci.dto.*; |
| | | import com.vci.model.*; |
| | | import com.vci.pagemodel.*; |
| | | 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.BaseQueryObject; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.starter.web.pagemodel.DataGrid; |
| | | import com.vci.starter.web.util.LocalFileUtil; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.starter.word.bo.WordMergeStartTableDataBO; |
| | | import com.vci.starter.word.util.WordUtil; |
| | | import com.vci.web.enumpck.ItemTypeEnum; |
| | | import com.vci.web.enumpck.PortalVIType; |
| | | import com.vci.web.enumpck.PortalVITypeFlag; |
| | | import com.vci.web.service.OsAttributeServiceI; |
| | | import com.vci.web.service.OsPortalVIServiceI; |
| | | import com.vci.web.service.OsQuereyTemplateServiceI; |
| | | import com.vci.web.util.PlatformClientUtil; |
| | | import com.vci.web.util.UITools; |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.io.*; |
| | | import java.util.*; |
| | | import java.util.concurrent.atomic.AtomicBoolean; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /* |
| | |
| | | @Autowired(required = false) |
| | | @Lazy |
| | | private OsPortalVIServiceI self; |
| | | |
| | | /** |
| | | * å è½½èªèº« |
| | | */ |
| | | @Autowired(required = false) |
| | | private OsAttributeServiceI osAttributeService; |
| | | /** |
| | | * å¹³å°çè°ç¨å·¥å
·ç±» |
| | | */ |
| | | @Autowired |
| | | private PlatformClientUtil platformClientUtil; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¨¡æ¿æå¡ |
| | | */ |
| | | @Autowired |
| | | private OsQuereyTemplateServiceI quereyTemplateServiceI; |
| | | @Override |
| | | public void clearCache() { |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public PortalVIVO getPortalVIById(String id,String viType) throws PLException { |
| | | VciBaseUtil.alertNotNull(id,"主é®ä¸ºç©ºï¼"); |
| | | VciBaseUtil.alertNotNull(id,"主é®"); |
| | | String lableName=PortalVIType.Form.getLabel(); |
| | | if(PortalVIType.Table.getName()==viType){ |
| | | lableName=PortalVIType.Table.getLabel(); |
| | |
| | | @Override |
| | | public boolean delete(DeletePortalVIDTOList portalVIDTOList) throws PLException { |
| | | if(portalVIDTOList==null||CollectionUtils.isEmpty(portalVIDTOList.getPortalVIDTOList())){ |
| | | VciBaseUtil.alertNotNull("è¯·éæ©è¦å é¤ç对象!"); |
| | | // VciBaseUtil.alertNotNull("å é¤ç对象"); |
| | | throw new PLException("1001",new String[]{"è¯·éæ©è¦å é¤ç对象ï¼}"}); |
| | | } |
| | | try { |
| | | for(PortalVIDTO portalVIDTO:portalVIDTOList.getPortalVIDTOList()) { |
| | |
| | | throw new VciBaseException("è¯·éæ©è¦å
éç对象!"); |
| | | } |
| | | try { |
| | | String typeName=clonePortalVIDTOList.getClonePortalVIDTOList().get(0).getTypeName(); |
| | | PortalVI[] portalVIS= platformClientUtil.getPortalService().getPortalVIArrayByTypeName(typeName); |
| | | Map<String, PortalVIVO> PortalVIMap=new HashMap<>(); |
| | | if(!CollectionUtils.isEmpty(Arrays.asList(portalVIS))) { |
| | | List<PortalVIVO> portalVIVOS = portalVIDOO2VOS(Arrays.asList(portalVIS)); |
| | | PortalVIMap =portalVIVOS.stream().collect(Collectors.toMap(PortalVIVO::getViName, Function.identity())); |
| | | } |
| | | List<PortalVI> portalVIList=new ArrayList<>(); |
| | | for (ClonePortalVIDTO clonedestObject : clonePortalVIDTOList.getClonePortalVIDTOList()) { |
| | | String viName = clonedestObject.getViName(); |
| | | PortalVIDTO portalVIDTO = clonedestObject.getOldPortalVIDTO(); |
| | | String typeName = clonedestObject.getTypeName(); |
| | | short typeFlag = clonedestObject.getTypeFlag(); |
| | | if (viName != null) { |
| | | VciBaseUtil.alertNotNull(viName, "å
éåç§°ä¸å
许为空"); |
| | | //throw new PLException("1001",new String[]{"è¯·éæ©è¦å é¤ç对象ï¼}"}); |
| | | if( PortalVIMap.containsKey(viName)){ |
| | | throw new VciBaseException("å
éåç§°"+viName+"å·²åå¨ï¼è¯·æ ¸å¯¹ï¼"); |
| | | } |
| | | PortalVI portalVI = UITools.getService().getPortalVIById(portalVIDTO.getId()); |
| | | portalVI.id = ObjectUtility.getNewObjectID36(); |
| | | portalVI.viName = viName; |
| | |
| | | if (typeFlag == PortalVITypeFlag.BtmType.getIntVal() || typeFlag == PortalVITypeFlag.LinkType.getIntVal()) { |
| | | portalVI.typeFlag = typeFlag; |
| | | } |
| | | UITools.getService().savePortalVI(portalVI); |
| | | platformClientUtil.getPortalService().savePortalVI(portalVI); |
| | | portalVIList.add(portalVI); |
| | | } |
| | | } |
| | | }catch (PLException e){ |
| | |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public String exportToExcel(Collection<String> idList) { |
| | | String defaultTempFolder = LocalFileUtil.getDefaultTempFolder(); |
| | | String xfileName="export.xls"; |
| | | List<WriteExcelData> rowDataList = new ArrayList<>(); |
| | | List<WriteExcelData> qtRowDataList = new ArrayList<>(); |
| | | //VciBaseUtil.alertNotNull(idList); |
| | | List<PortalVIDTO> portalVIDTOList= listByIds(idList); |
| | | final int index=0; |
| | | |
| | | String excelFileName = defaultTempFolder + File.separator + xfileName; |
| | | File excelFile = new File(excelFileName); |
| | | try { |
| | | excelFile.createNewFile(); |
| | | }catch (Throwable e){ |
| | | String msg = "å¨å建excelæä»¶çæ¶ååºç°äºé误"; |
| | | if(logger.isErrorEnabled()){ |
| | | logger.error(msg,e); |
| | | } |
| | | throw new VciBaseException(msg+",{0}",new String[]{excelFileName},e); |
| | | } |
| | | |
| | | |
| | | rowDataList.add(new WriteExcelData(index, 0, "ä¸å¡ç±»ååç§°")); |
| | | rowDataList.add(new WriteExcelData(index, 1, "åç§°")); |
| | | rowDataList.add(new WriteExcelData(index, 2, "ä¸å¡ç±»å")); |
| | | rowDataList.add(new WriteExcelData(index, 3, "表åç±»å")); |
| | | rowDataList.add(new WriteExcelData(index, 4, "é
ç½®ææ¬")); |
| | | rowDataList.add(new WriteExcelData(index, 5, "屿§")); |
| | | rowDataList.add(new WriteExcelData(index, 6, "æ¥è¯¢æ¨¡æ¿åç§°")); |
| | | rowDataList.add(new WriteExcelData(index, 7, "æ¥è¯¢æ¨¡æ¿é
ç½®ææ¬")); |
| | | rowDataList.add(new WriteExcelData(index, 8, "æ¥è¯¢æ¨¡æ¿ä¸å¡ç±»å")); |
| | | |
| | | |
| | | qtRowDataList.add(new WriteExcelData(index, 0, "ä¸å¡ç±»ååç§°")); |
| | | qtRowDataList.add(new WriteExcelData(index, 1, "龿¥ç±»ååç§°")); |
| | | qtRowDataList.add(new WriteExcelData(index, 2, "æ¥è¯¢æ¨¡æ¿å®ä¹åç§°")); |
| | | qtRowDataList.add(new WriteExcelData(index, 3, "屿§")); |
| | | |
| | | if(!CollectionUtils.isEmpty(portalVIDTOList)){ |
| | | final int[] rowIndex = {1}; |
| | | boolean isLink=PortalVITypeFlag.LinkType.getIntVal()== portalVIDTOList.get(0).getTypeFlag()?true:false; |
| | | try { |
| | | BaseResult baseResult= quereyTemplateServiceI.queryTemplateList( portalVIDTOList.get(0).getTypeName(),isLink); |
| | | if(baseResult.isSuccess()){ |
| | | final int[] rowIndex1 = {1}; |
| | | Collection< QTD> qtdList= baseResult.getData(); |
| | | if(!CollectionUtils.isEmpty(qtdList)){ |
| | | qtdList.stream().forEach(qtd -> { |
| | | qtRowDataList.add(new WriteExcelData(rowIndex1[0], 0, qtd.btmName)); |
| | | qtRowDataList.add(new WriteExcelData(rowIndex1[0], 1, qtd.linkTypeName)); |
| | | qtRowDataList.add(new WriteExcelData(rowIndex1[0], 2, qtd.name)); |
| | | qtRowDataList.add(new WriteExcelData(rowIndex1[0], 3, VciBaseUtil.array2String(qtd.abNames))); |
| | | rowIndex1[0]++; |
| | | }); |
| | | |
| | | } |
| | | } |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | portalVIDTOList.stream().forEach(portalVIDTO -> { |
| | | //å
æ¯åç§° |
| | | rowDataList.add(new WriteExcelData(rowIndex[0], 0, portalVIDTO.getTypeName()));//ä¸å¡ç±»ååç§° |
| | | rowDataList.add(new WriteExcelData(rowIndex[0], 1, portalVIDTO.getViName()));//åç§° |
| | | rowDataList.add(new WriteExcelData(rowIndex[0], 2, PortalVITypeFlag.getByIntVal(portalVIDTO.getTypeFlag()).getLabel()));//ä¸å¡ç±»å |
| | | rowDataList.add(new WriteExcelData(rowIndex[0], 3,PortalVIType.getByIntVal(portalVIDTO.getViType()).getLabel()));//表åç±»å |
| | | try { |
| | | String prmText=UITools.getPRMText(prmDOO2VIS(portalVIDTO.getPrm(),portalVIDTO.getViType())); |
| | | String prmTextFileName= ObjectUtility.getNewObjectID36() + ".txt"; |
| | | String prmTextFileNameAllName = xfileName + "." + prmTextFileName; |
| | | writeDataToFile(defaultTempFolder,prmTextFileNameAllName,prmText); |
| | | rowDataList.add(new WriteExcelData(rowIndex[0], 4,prmTextFileName));//é
ç½®ææ¬ |
| | | |
| | | } catch (Throwable e) { |
| | | e.printStackTrace(); |
| | | } |
| | | String attributeStr=""; |
| | | try { |
| | | List<OsAttributeVO> osAttributeVOList=osAttributeService.getOsAttributeVOSByBtName(portalVIDTO.getTypeName(),portalVIDTO.getTypeFlag()); |
| | | if(!CollectionUtils.isEmpty(osAttributeVOList)){ |
| | | List<String> filedList= osAttributeVOList.stream().map(OsAttributeVO::getId).collect(Collectors.toList()); |
| | | attributeStr=VciBaseUtil.array2String(filedList.toArray(new String[]{})); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | rowDataList.add(new WriteExcelData(rowIndex[0], 5, attributeStr));//屿§ |
| | | String qtName=""; |
| | | try { |
| | | QTInfo qt = platformClientUtil.getQTDService().getQT(portalVIDTO.getPrm().getFormQtName()); |
| | | qtName=qt.qtName; |
| | | rowDataList.add(new WriteExcelData(rowIndex[0], 6,qtName));//æ¥è¯¢æ¨¡æ¿åç§° |
| | | String qtFileName = ObjectUtility.getNewObjectID36() + ".txt"; |
| | | String qtFileNameAllName = xfileName + "." + qtFileName; |
| | | writeDataToFile(defaultTempFolder,qtFileNameAllName,qt.qtText); |
| | | rowDataList.add(new WriteExcelData(rowIndex[0], 7, qtFileName));//æ¥è¯¢æ¨¡æ¿é
ç½®ææ¬ |
| | | rowDataList.add(new WriteExcelData(rowIndex[0], 8, qt.btmName));//æ¥è¯¢æ¨¡æ¿ä¸å¡ç±»å |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | rowIndex[0]++; |
| | | }); |
| | | } |
| | | |
| | | |
| | | /* String excelTemplateFileName = "/excelTemplate/dataBaseExport.xls"; |
| | | if(this.getClass().getResource(excelTemplateFileName) == null){ |
| | | throw new VciBaseException("请è系管çåï¼ç³»ç»ä¸ç¼ºå°{0}è¿ä¸ªæ¨¡æ¿æä»¶",new String[]{excelTemplateFileName}); |
| | | } |
| | | try { |
| | | ExcelUtil.copyFileFromJar(excelTemplateFileName,excelFile); |
| | | //è¿ä¸ªæ¹æ³ä¼å
³éæä»¶æµ |
| | | }catch (Throwable e){ |
| | | String msg = "仿¨¡æ¿æä»¶æ·è´å°ç®æ æä»¶åºç°äºé误"; |
| | | if(logger.isErrorEnabled()){ |
| | | logger.error(msg,e); |
| | | } |
| | | throw new VciBaseException(msg+",{0}",new String[]{excelFileName},e); |
| | | }*/ |
| | | try{ |
| | | WriteExcelOption excelOption = new WriteExcelOption(); |
| | | excelOption.addSheetDataList("portalvi",rowDataList); |
| | | excelOption.addSheetDataList("QTD",qtRowDataList); |
| | | ExcelUtil.writeDataToFile(excelFile,excelOption); |
| | | }catch (Throwable e){ |
| | | String msg = "ææ°æ®åå
¥å°excelæä»¶ä¸åºç°é误"; |
| | | if(logger.isErrorEnabled()){ |
| | | logger.error(msg,e); |
| | | } |
| | | throw new VciBaseException(msg+",{0}",new String[]{excelFileName},e); |
| | | } |
| | | File zip = ZipUtil.zip(defaultTempFolder); |
| | | FileUtil.del(defaultTempFolder + File.separator); |
| | | //æåè¿åexcelæä»¶åç§° |
| | | return zip.getAbsoluteFile().getAbsolutePath(); |
| | | } |
| | | |
| | | /** |
| | | * æ·è´æ°æ®å°word模æ¿ä¸ |
| | | * @param fileName è¦åå
¥çæ°æ® |
| | | * @return word æä»¶è·¯å¾ |
| | | */ |
| | | public String writeDataToFile(String defaultTempFolder,String fileName,String str){ |
| | | String tempFolder = LocalFileUtil.getDefaultTempFolder(); |
| | | //æ·è´æä»¶ |
| | | String filePath = tempFolder + File.separator + fileName; |
| | | File file = new File(filePath); |
| | | FileOutputStream out = null; |
| | | try { |
| | | file.createNewFile(); |
| | | out= new FileOutputStream(file); |
| | | IOUtils.write(str,out); |
| | | }catch (Throwable e){ |
| | | IOUtils.closeQuietly(out); |
| | | String msg = "å¨å建æä»¶çæ¶ååºç°äºé误"; |
| | | if(logger.isErrorEnabled()){ |
| | | logger.error(msg,e); |
| | | } |
| | | throw new VciBaseException(msg+",{0}",new String[]{filePath},e); |
| | | }finally { |
| | | IOUtils.closeQuietly(out); |
| | | //ç§»å¨å±æ§å°é¾æ¥ç±»åæä»¶å¤¹éé¢å» |
| | | FileUtil.move(file, new File(defaultTempFolder),true); |
| | | FileUtil.del(tempFolder); |
| | | } |
| | | return filePath; |
| | | } |
| | | public List<PortalVIDTO> listByIds(Collection idList){ |
| | | List<PortalVIDTO> portalVIVOList=new ArrayList<>(); |
| | | if(CollectionUtils.isEmpty(idList)){ |
| | | throw new VciBaseException("è¯·éæ©éè¦å¯¼åºçæ°æ®"); |
| | | } |
| | | List<PortalVI> portalVIList=new ArrayList<>(); |
| | | idList.stream().forEach(id->{ |
| | | try { |
| | | PortalVI portalVI= platformClientUtil.getPortalService().getPortalVIById(id.toString()); |
| | | portalVIList.add(portalVI); |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | }); |
| | | portalVIVOList= portalVIO2DTOS(portalVIList); |
| | | return portalVIVOList; |
| | | } |
| | | private BaseResult savePortalVIDTO(PortalVIDTO portalVIDTO,boolean isEdit) { |
| | | |
| | | boolean _isBtm=false; |
| | |
| | | public PortalVIVO portalVIDOO2VO(PortalVI portalVI) { |
| | | PortalVIVO portalVIVO=new PortalVIVO(); |
| | | portalVIVO.setId(portalVI.id); |
| | | portalVIVO.setTypeFlagText(PortalVITypeFlag.getByIntVal(portalVI.typeFlag).getLabel()); |
| | | portalVIVO.setTypeFlag(portalVI.typeFlag); |
| | | portalVIVO.setTypeName(portalVI.typeName); |
| | | portalVIVO.setViName(portalVI.viName); |
| | | portalVIVO.setViType(portalVI.viType); |
| | | portalVIVO.setViTypeText(PortalVIType.getByIntVal(portalVI.viType).getLabel()); |
| | | |
| | | String prm= portalVI.prm; |
| | | if(StringUtils.isNotBlank(prm)) { |
| | | PRMDO prmdo = UITools.getPRM(prm); |
| | |
| | | List<String> itemSelectoutFieldList= allKeyList.stream().filter(s ->!itemOutFieldList.stream().map(s1 -> s1).collect(Collectors.toList()).contains(s) ).collect(Collectors.toList()); |
| | | prmItemVO.setItemSelectoutFieldList(itemSelectoutFieldList);//å¾
éæ©ç屿§å段 |
| | | prmItemVO.setItemOutFieldList(itemOutFieldList);//éè¦ä½¿ç¨çéå |
| | | List<String> itemSearchFieldList= itemOutFieldList.stream().filter(s ->!itemKeyFieldList.stream().map(s1 -> s1).collect(Collectors.toList()).contains(s) ).collect(Collectors.toList()); |
| | | // List<String> itemSearchFieldList= itemOutFieldList.stream().filter(s ->!CollectionUtils.isEmpty(itemKeyFieldList).stream().map(s1 -> s1).collect(Collectors.toList()).contains(s) ).collect(Collectors.toList()); |
| | | List<String> itemSearchFieldList=new ArrayList<>(); |
| | | if(!CollectionUtils.isEmpty(itemKeyFieldList)){ |
| | | itemSearchFieldList= itemOutFieldList.stream().filter(s ->!itemKeyFieldList.contains(s)).collect(Collectors.toList()); |
| | | }else{ |
| | | itemSearchFieldList=itemOutFieldList; |
| | | } |
| | | prmItemVO.setItemSearchFieldList(itemSearchFieldList);//å¾
æç´¢å段 |
| | | prmItemVO.setItemKeyFieldList(itemKeyFieldList);//æç´¢å段 |
| | | } |
| | |
| | | List<String> itemSelectoutFieldList= allKeyList.stream().filter(s ->!itemOutFieldList.stream().map(s1 -> s1).collect(Collectors.toList()).contains(s) ).collect(Collectors.toList()); |
| | | prmItemDTO.setItemSelectoutFieldList(itemSelectoutFieldList);//å¾
éæ©ç屿§å段 |
| | | prmItemDTO.setItemOutFieldList(itemOutFieldList);//éè¦ä½¿ç¨çéå |
| | | List<String> itemSearchFieldList= itemOutFieldList.stream().filter(s ->!itemKeyFieldList.stream().map(s1 -> s1).collect(Collectors.toList()).contains(s) ).collect(Collectors.toList()); |
| | | prmItemDTO.setItemSearchFieldList(itemSearchFieldList);//å¾
æç´¢å段 |
| | | List<String> itemSearchFieldList=new ArrayList<>(); |
| | | if(!CollectionUtils.isEmpty(itemKeyFieldList)){ |
| | | itemSearchFieldList= itemOutFieldList.stream().filter(s ->!itemKeyFieldList.contains(s)).collect(Collectors.toList()); |
| | | }else{ |
| | | itemSearchFieldList=itemOutFieldList; |
| | | } prmItemDTO.setItemSearchFieldList(itemSearchFieldList);//å¾
æç´¢å段 |
| | | prmItemDTO.setItemKeyFieldList(itemKeyFieldList);//æç´¢å段 |
| | | } |
| | | /** |
| | |
| | | private void initTableConfigDTOO2DOData(PRMItemDO prmItemDO,PRMItemDTO prmItemDTO){ |
| | | |
| | | prmItemDO.setItemOutFields(VciBaseUtil.array2String(prmItemDTO.getItemOutFieldList().toArray(new String[]{})));//éè¦ä½¿ç¨çåæ®µ |
| | | prmItemDO.setItemKeyFields(VciBaseUtil.array2String(prmItemDTO.getItemKeyFieldList().toArray(new String[]{})));//éè¦æç´¢çåæ®µ |
| | | prmItemDO.setItemKeyFields(CollectionUtils.isEmpty(prmItemDTO.getItemKeyFieldList())?"":VciBaseUtil.array2String(prmItemDTO.getItemKeyFieldList().toArray(new String[]{})));//éè¦æç´¢çåæ®µ |
| | | List<String> newItemFieldWidthList=prmItemDTO.getItemFieldWidthList().stream().map(KeyValue::getValue).distinct().collect(Collectors.toList()); |
| | | prmItemDO.setItemFieldWidth(VciBaseUtil.array2String(newItemFieldWidthList.toArray(new String[]{}),":"));//åæ®µå®½åº¦ |
| | | List<ItemSeniorQueryBO> itemSeniorQueryBOS= prmItemDTO.getItemSeniorQueryBOS(); |
| | |
| | | private List<KeyValue> initItemFieldWidthList(String itemOutFields,String itemFieldWidth){ |
| | | List<KeyValue> keyValueList=new ArrayList<>(); |
| | | List<String>itemOutFieldList= VciBaseUtil.str2List(itemOutFields); |
| | | List<String>itemFieldWidthList= VciBaseUtil.str2List(itemFieldWidth); |
| | | List<String>itemFieldWidthList= VciBaseUtil.str2List(itemFieldWidth,","); |
| | | if(itemOutFieldList.size()>0) { |
| | | for (int i = 0; i < itemOutFieldList.size(); i++) { |
| | | KeyValue keyValue = new KeyValue(); |
| | | String with = itemFieldWidthList.get(i); |
| | | String with="250"; |
| | | if(i<itemFieldWidthList.size()) { |
| | | with = itemFieldWidthList.get(i); |
| | | } |
| | | keyValue.setKey(itemOutFieldList.get(i)); |
| | | keyValue.setValue(StringUtils.isBlank(with) ? "250" : with); |
| | | keyValueList.add(keyValue); |
| | |
| | | import cn.hutool.core.io.FileUtil; |
| | | import cn.hutool.core.util.ZipUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.vci.client.ClientSession; |
| | | import com.vci.client.common.oq.OQTool; |
| | | import com.vci.client.common.providers.ClientServiceProvider; |
| | | import com.vci.common.qt.object.*; |
| | | import com.vci.constant.FrameWorkLangCodeConstant; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.omd.atm.AttributeDef; |
| | | import com.vci.corba.omd.btm.BizType; |
| | | import com.vci.corba.omd.data.BusinessObject; |
| | | import com.vci.corba.omd.data.LinkObject; |
| | | import com.vci.corba.omd.ltm.LinkType; |
| | | import com.vci.corba.omd.qtm.QTD; |
| | |
| | | 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.pagemodel.DataGrid; |
| | | import com.vci.starter.web.pagemodel.Tree; |
| | | import com.vci.starter.web.util.*; |
| | | import com.vci.web.other.BtmQTExportData; |
| | | import com.vci.web.other.LinkQTExportData; |
| | | import com.vci.web.service.*; |
| | | import com.vci.web.util.DateUtil; |
| | |
| | | import com.vci.web.util.WebUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.commons.lang3.time.DateFormatUtils; |
| | | import org.dom4j.Document; |
| | | import org.dom4j.DocumentException; |
| | | import org.dom4j.DocumentHelper; |
| | | import org.dom4j.Element; |
| | | import org.jdesktop.swingx.JXDatePicker; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.swing.*; |
| | | import java.awt.*; |
| | | import java.io.*; |
| | | import java.util.*; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¨¡æ¿ |
| | | * ä¿åæ¥è¯¢æ¨¡æ¿ |
| | | * @param qtd æ¥è¯¢æ¨¡æ¿å®ä½ç±» |
| | | * @return ä¿åç»æ |
| | | */ |
| | |
| | | } |
| | | } |
| | | /** |
| | | * |
| | | * @param dataMap ä¼ è¾çæ°æ®å¯¹è±¡ï¼ |
| | | * @param qtInfoDTO ä¼ è¾çæ°æ®å¯¹è±¡ï¼ |
| | | * linkTypeName 龿¥ç±»åã |
| | | * rdPositive æ¹åï¼trueæ£åï¼falseåå |
| | | * btmName ä¸å¡ç±»ååç§° |
| | |
| | | */ |
| | | @Override |
| | | public BaseResult getCriteria(QTInfoDTO qtInfoDTO) throws PLException { |
| | | QueryTemplate qt = getQT(qtInfoDTO); |
| | | QueryTemplate qt = getQT(qtInfoDTO,true); |
| | | String checkInfo = OQTool.checkQT(qt); |
| | | if(!checkInfo.equals("OK")){ |
| | | throw new PLException("500", new String[]{checkInfo}); |
| | |
| | | qtInfoDTO.setBtmName(obj.btmName); |
| | | qtInfoDTO.setQtName(obj.qtName); |
| | | qtInfoDTO.setLevelFlag(obj.levelFlag); |
| | | // qtInfoDTO.setQtText(obj.qtText); |
| | | //qtInfoDTO.setQtText(obj.qtText); |
| | | qtInfoDTO.setQtUIText(obj.qtUIText); |
| | | if(StringUtils.isNotBlank(obj.qtUIText)){ |
| | | //å°ç»å®çStringææ¬è§£æä¸ºXMLææ¡£å¹¶è¿åæ°å建çdocument |
| | |
| | | */ |
| | | @Override |
| | | public BaseResult linkSave(QTInfoDTO qtInfoDTO) throws PLException { |
| | | QueryTemplate qt = getQT(qtInfoDTO); |
| | | QueryTemplate qt = getQT(qtInfoDTO,true); |
| | | String checkInfo = OQTool.checkQT(qt); |
| | | if(!checkInfo.equals("OK")){ |
| | | throw new PLException("500", new String[]{checkInfo}); |
| | |
| | | * ç»è£
æ¥è¯¢æ¨¡æ¿ |
| | | * @return |
| | | */ |
| | | public QueryTemplate getQT(QTInfoDTO qtInfoDTO) throws PLException { |
| | | public QueryTemplate getQT(QTInfoDTO qtInfoDTO,boolean isLinkType) throws PLException { |
| | | QueryTemplate qt = new QueryTemplate(); |
| | | qt.setType(QTConstants.TYPE_LINK); |
| | | //TODO String qtId = |
| | | qt.setLinkType(qtInfoDTO.getBtmName()); |
| | | qt.setDirection(qtInfoDTO.getQueryTemplate().getDirection()); |
| | | qt.setBtmType(qtInfoDTO.getQueryTemplate().getBtmType()); |
| | | |
| | | qt.setVersion(qtInfoDTO.getQueryTemplate().getVersion()); |
| | | qt.setQueryISLeaf(qtInfoDTO.getQueryTemplate().isQueryISLeaf()); |
| | | qt.setLevel(qtInfoDTO.getQueryTemplate().getLevel()); |
| | | if(isLinkType){ |
| | | qt.setType(QTConstants.TYPE_LINK); |
| | | qt.setLinkType(qtInfoDTO.getBtmName()); |
| | | qt.setDirection(qtInfoDTO.getQueryTemplate().getDirection()); |
| | | qt.setBtmType(qtInfoDTO.getQueryTemplate().getBtmType()); |
| | | qt.setVersion(qtInfoDTO.getQueryTemplate().getVersion()); |
| | | qt.setQueryISLeaf(qtInfoDTO.getQueryTemplate().isQueryISLeaf()); |
| | | qt.setLevel(qtInfoDTO.getQueryTemplate().getLevel()); |
| | | }else{ |
| | | qt.setType(QTConstants.TYPE_BTM); |
| | | qt.setBtmType(qtInfoDTO.getBtmName()); |
| | | } |
| | | |
| | | List<String> clauseList = new ArrayList<String>(); |
| | | //TODO æ¥è¯¢å æ¾ç¤ºå |
| | | clauseList.add("*"); |
| | |
| | | // return qt; |
| | | // } |
| | | |
| | | |
| | | /** |
| | | * è¿åæ¥è¯¢ççæ¬ |
| | | * @return |
| | |
| | | return version; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ ¡éªåæ° |
| | | * @param qtd |
| | |
| | | throw new PLException("500", new String[]{"该模æ¿å®ä¹åå·²ç»è¢«ä½¿ç¨, è¯·æ´æ¢"}); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导åºé¾æ¥ç±»åæ¥è¯¢æ¨¡æ¿ |
| | |
| | | } |
| | | } |
| | | |
| | | private void getPLQtBtmItem2(String string, BizType bizType, List<BizType> ltsNew) { |
| | | // TODO Auto-generated method stub |
| | | try { |
| | | BizType queryBizType = platformClientUtil.getBtmService().getBizTypes(string)[0]; |
| | | BizType[] btmArray = platformClientUtil.getBtmService().getBizTypes(""); |
| | | String[] strings = queryBizType.apNameArray; |
| | | boolean b = true; |
| | | for (int i = 0; i < btmArray.length; i++) { |
| | | if (btmArray[i].name.equals(string)) { |
| | | b = false; |
| | | if (Arrays.equals(bizType.apNameArray, strings)) { |
| | | btmArray[i].name += "ãä¸å¡ç±»åå·²åå¨ã"; |
| | | ltsNew.add(btmArray[i]); |
| | | } else { |
| | | btmArray[i].name += "ãä¸å¡ç±»ååå¨ä½å±æ§ä¸ä¸è´ã"; |
| | | ltsNew.add(btmArray[i]); |
| | | } |
| | | } |
| | | } |
| | | if (b) { |
| | | bizType.name += "ãä¸å¡ç±»åä¸åå¨ã"; |
| | | ltsNew.add(bizType); |
| | | } |
| | | } catch (PLException e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | private void getPLQtWrapper(String string, QTInfo qtWrapper, List<LinkType> ltsNew, List<QTInfo> qTWrapperNew, Map<String/*ç±»ååç§°*/, QTD[]/*æ¥è¯¢æ¨¡æ¿å®ä¹*/> newNorepQTDs) { |
| | | try { |
| | | QTInfo[] qtws = platformClientUtil.getQTDService().getAllQTs(); |
| | |
| | | } |
| | | } |
| | | |
| | | private void getPLBtmQtWrapper(String string, QTInfo qtWrapper, List<BizType> ltsNew, List<QTInfo> qTWrapperNew, Map<String/*ç±»ååç§°*/, QTD[]/*æ¥è¯¢æ¨¡æ¿å®ä¹*/> newNorepQTDs) { |
| | | try { |
| | | QTInfo[] qtws = platformClientUtil.getQTDService().getAllQTs(); |
| | | boolean islaet = true; |
| | | for (int i = 0; i < qtws.length; i++) { |
| | | if (string.equals(qtws[i].qtName)) { |
| | | islaet = false; |
| | | for (BizType lt : ltsNew) { |
| | | if (qtWrapper.btmName.equals(lt.name.substring(0, |
| | | lt.name.indexOf("ã")))) { |
| | | if (lt.name.endsWith("ãä¸å¡ç±»åå·²åå¨ã")) { |
| | | qtWrapper.qtName += "ãæ¥è¯¢æ¨¡æ¿å·²åå¨ï¼ä¸å¯¼å
¥ã"; |
| | | qTWrapperNew.add(qtWrapper); |
| | | }else if(lt.name.endsWith("ãä¸å¡ç±»ååå¨ä½å±æ§ä¸ä¸è´ã")){ |
| | | qtWrapper.qtName += "ãæ¥è¯¢æ¨¡æ¿æå±ä¸å¡ç±»å屿§ä¸ä¸è´ï¼ä¸å¯¼å
¥ã"; |
| | | qTWrapperNew.add(qtWrapper); |
| | | }else{ |
| | | qtWrapper.qtName += "ãæ¥è¯¢æ¨¡æ¿æå±ä¸å¡ç±»åä¸åå¨ï¼ä¸å¯¼å
¥ã"; |
| | | qTWrapperNew.add(qtWrapper); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (islaet) { |
| | | for (BizType btmItem : ltsNew) { |
| | | if (qtWrapper.btmName.equals(btmItem.name.substring(0, |
| | | btmItem.name.indexOf("ã")))) { |
| | | if (btmItem.name.endsWith("ãä¸å¡ç±»åå·²åå¨ã")) { |
| | | //夿æ¥è¯¢æ¨¡æ¿å®ä¹æ¯å¦åå¨ï¼è¿è¡ä¿å |
| | | QTD[] qtds = newNorepQTDs.get(qtWrapper.btmName); |
| | | if(qtds != null){ |
| | | for (QTD qtd : qtds) { |
| | | QTD qtdByName = platformClientUtil.getQTDService().getQTDByName(qtd.name); |
| | | if(!(qtdByName != null && StringUtils.isNotBlank(qtdByName.name))){ |
| | | boolean b = platformClientUtil.getQTDService().addQTD(qtd); |
| | | if(!b){ |
| | | qtWrapper.qtName += qtWrapper.qtName+"导å
¥æ¥è¯¢æ¨¡æ¿å®ä¹ã" + qtdByName.name + "ã失败ï¼"; |
| | | } |
| | | } |
| | | } |
| | | newNorepQTDs.remove(qtWrapper.btmName); |
| | | } |
| | | boolean success = platformClientUtil.getQTDService().saveQT(qtWrapper); |
| | | if(!success){ |
| | | qtWrapper.qtName += qtWrapper.qtName+"导å
¥å¤±è´¥ï¼"; |
| | | }else { |
| | | qtWrapper.qtName += "ãæ¥è¯¢æ¨¡æ¿å¯¼å
¥æåï¼ã"; |
| | | } |
| | | qTWrapperNew.add(qtWrapper); |
| | | }else if(btmItem.name.endsWith("ãä¸å¡ç±»ååå¨ä½å±æ§ä¸ä¸è´ã")){ |
| | | qtWrapper.qtName += "ãæ¥è¯¢æ¨¡æ¿æå±ä¸å¡ç±»å屿§ä¸ä¸è´ï¼ä¸å¯¼å
¥ã"; |
| | | qTWrapperNew.add(qtWrapper); |
| | | }else{ |
| | | qtWrapper.qtName += "ãæ¥è¯¢æ¨¡æ¿æå±ä¸å¡ç±»åä¸åå¨ï¼ä¸å¯¼å
¥ã"; |
| | | qTWrapperNew.add(qtWrapper); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | //æ ¹æ®éæ©çæ¥è¯¢æ¨¡æ¿è¿æ»¤æ¨¡æ¿å®ä¹ |
| | | private Map<String, QTD[]> getnewNorepQTDs(Map<String, QTD[]> norepQTDs, |
| | | Map<String, QTInfo> allQTs) { |
| | |
| | | if(!b){ |
| | | return BaseResult.fail("å é¤å¤±è´¥ï¼ï¼ï¼"); |
| | | } |
| | | return BaseResult.success(); |
| | | return BaseResult.success("æ¥è¯¢æ¨¡æ¿å 餿åï¼"); |
| | | } |
| | | |
| | | /** |
| | | * @param qtInfoDTO ä¼ è¾çæ°æ®å¯¹è±¡ï¼ |
| | | * linkTypeName 龿¥ç±»åã |
| | | * rdPositive æ¹åï¼trueæ£åï¼falseåå |
| | | * btmName ä¸å¡ç±»ååç§° |
| | | * combRelaType ä¸å¡ç±»åéæ©å¼ |
| | | * versionValue çæ¬çæ¬¡å¼ |
| | | * isQueryIsLeaf æ¯å¦éæ©ä¸çº§ |
| | | * level åèç¹å±æ° |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | @Override |
| | | public BaseResult getCriteriaBtm(QTInfoDTO qtInfoDTO) throws PLException { |
| | | QueryTemplate qt = getQT(qtInfoDTO,false); |
| | | String checkInfo = OQTool.checkQT(qt); |
| | | if(!checkInfo.equals("OK")){ |
| | | throw new PLException("500", new String[]{checkInfo}); |
| | | } |
| | | qt.setId("qt1"); |
| | | BusinessObject[] result = platformClientUtil.getQueryService().findBTMObjects(qt.getId(), OQTool.qtTOXMl(qt).asXML()); |
| | | return BaseResult.dataList(Arrays.asList(result)); |
| | | } |
| | | |
| | | /** |
| | | * ä¸å¡ç±»åæ¥è¯¢æ¨¡æ¿ä¿å |
| | | * @param qtInfoDTO ä¿åä¼ è¾å¯¹è±¡ |
| | | * @return ä¿åç»æ |
| | | */ |
| | | @Override |
| | | public BaseResult btmSave(QTInfoDTO qtInfoDTO) throws PLException { |
| | | VciBaseUtil.alertNotNull( |
| | | qtInfoDTO,"ä¿åçä¸å¡ç±»å模æ¿å¯¹è±¡", |
| | | qtInfoDTO.getBtmName(),"è¯·éæ©ä¸å¡ç±»ååæ¥è¯¢æ¨¡æ¿å®ä¹æ¥å建æ¥è¯¢æ¨¡æ¿" |
| | | ); |
| | | |
| | | //add by caill start éåæ®éæ¥è¯¢æ¨¡æ¿è¾å
¥æ¡ä¸çå¼åæ ¡éª |
| | | // ArrayList<String> list = cpm_centerPanel.getList(); |
| | | // for(int i=0;i<list.size();i++){ |
| | | // String text = (String) list.get(i); |
| | | // if(text.contains("'")){ |
| | | // JOptionPane.showMessageDialog(cp_mainPanel, "æ¡ä»¶å¼ä¸å
å«äºéæ³å符", "éæ³å符", JOptionPane.ERROR_MESSAGE); |
| | | // return; |
| | | // } |
| | | // } |
| | | //ä¿åä¹å带åºå·²éæ©çqtName |
| | | QueryTemplate qt = getQT(qtInfoDTO,false); |
| | | //å端è°ç¨è¿ä¸ªæ¹æ³isExistsQT() |
| | | /*if(isExists(qtName)){ |
| | | return BaseResult.success("","该æ¥è¯¢æ¨¡æ¿åå·²ç»åå¨,æ¯å¦è¦çï¼"); |
| | | }*/ |
| | | String checkInfo = OQTool.checkQT(qt); |
| | | if(!checkInfo.equals("OK")){ |
| | | throw new PLException("500", new String[]{checkInfo}); |
| | | } |
| | | //设置æåºä¿¡æ¯ |
| | | qt.setOrderInfoList(qtInfoDTO.getQueryTemplate().getOrderInfoList()); |
| | | QTInfo qtWrapper = new QTInfo(); |
| | | qtWrapper.qtName = qtInfoDTO.getQtName(); |
| | | qtWrapper.btmName = qt.getBtmType(); |
| | | qtWrapper.creator = WebUtil.getCurrentUserId(); |
| | | qtWrapper.createTime = System.currentTimeMillis(); |
| | | if(qtInfoDTO.getTree() == null){ |
| | | qtWrapper.qtUIText = ""; |
| | | }else{ |
| | | //å½å¾éäºé«çº§æ¥è¯¢æ¶éè¦å¤çé«çº§æ¥è¯¢çç¸å
³æ¡ä»¶ |
| | | qtWrapper.qtUIText = getSeniorXML(qtInfoDTO); |
| | | } |
| | | qtWrapper.levelFlag = qtInfoDTO.getLevelFlag(); |
| | | qtWrapper.qtText = OQTool.qtTOXMl(qt).asXML(); |
| | | boolean saveFlag = platformClientUtil.getQTDService().saveQT(qtWrapper); |
| | | if(saveFlag){ |
| | | return BaseResult.success("ä¿åæ¥è¯¢æ¨¡æ¿æå"); |
| | | }else{ |
| | | return BaseResult.fail("ä¿åæ¥è¯¢æ¨¡æ¿å¤±è´¥"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°æ°æ®åºç»æ |
| | | * @return ä¿åç»æ |
| | | */ |
| | | @Override |
| | | public BaseResult updateDBStructure() throws PLException { |
| | | boolean f = platformClientUtil.getQTDService().updateQT(); |
| | | if(f){ |
| | | return BaseResult.success("æ´æ°æå"); |
| | | }else{ |
| | | return BaseResult.fail("æ´æ°å¤±è´¥"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä¸å¡ç±»åæ¥è¯¢æ¨¡æ¿æ æ¥è¯¢ï¼ç¨äºçé¢ç导åºåè½ |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | @Override |
| | | public BaseResult getBtmQtTree() throws PLException { |
| | | BizType[] bizTypes= null; |
| | | QTInfo[] qts = null; |
| | | HashMap<String,Object> tree = new HashMap(); |
| | | tree.put("text","ä¸å¡ç±»å"); |
| | | if (bizTypes == null) { |
| | | List<BizType> es = new ArrayList<>(); |
| | | bizTypes = platformClientUtil.getBtmService().getBizTypes(""); |
| | | for (BizType lt : bizTypes) { |
| | | QTInfo[] qtWrappers = platformClientUtil.getQTDService().getObjTypeQTs(lt.name); |
| | | if (qtWrappers.length!=0) { |
| | | es.add(lt); |
| | | } |
| | | } |
| | | bizTypes = es.toArray(new BizType[es.size()]); |
| | | //TODO:éä¿®æ£æ²¡æå
³èæ¥è¯¢æ¨¡æ¿ä¸å¡ç±»å廿 |
| | | qts = platformClientUtil.getQTDService().getAllQTs();//è·åæææ¥è¯¢æ¨¡æ¿ |
| | | } |
| | | List<HashMap<String,Object>> childList = new ArrayList<>(); |
| | | //æ·»å ä¸å¡ç±»åæ ¹èç¹ |
| | | for (BizType plAction : bizTypes) { |
| | | HashMap<String,Object> childTree = new HashMap(); |
| | | childTree.put("text", plAction.label + "/" +plAction.name); |
| | | childTree.put("oid", plAction.oid); |
| | | //tree.put("children", childTree); |
| | | addExportTreeNode(plAction, qts, childTree); |
| | | childList.add(childTree); |
| | | } |
| | | tree.put("children", childList); |
| | | return BaseResult.success(tree); |
| | | } |
| | | |
| | | /** |
| | | * 导åºä¸å¡ç±»åæ¥è¯¢æ¨¡æ¿ |
| | | * names æ¥è¯¢æ¨¡æ¿å |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void expBtmQTTemplate(List<String> names, HttpServletResponse response) throws PLException, IOException { |
| | | String defaultTempFolder = LocalFileUtil.getDefaultTempFolder(); |
| | | String vciqtmfFileName = defaultTempFolder + File.separator + "BtmTemplateExp" + new Date().getTime() + ".vciqtf"; |
| | | BtmQTExportData exportData = new BtmQTExportData(); |
| | | for (String name : names) { |
| | | QTInfo qt = platformClientUtil.getQTDService().getQT(name); |
| | | exportData.getAllQTs().put(qt.qtName,qt); |
| | | BizType[] bizTypes = platformClientUtil.getBtmService().getBizTypes(qt.btmName); |
| | | for (int i = 0; i < bizTypes.length; i++) { |
| | | BizType bizType = bizTypes[i]; |
| | | if(bizTypes != null && !bizType.oid.equals("")){ |
| | | exportData.getSelectedBtmItems().put(bizType.name, bizType); |
| | | exportData.getSelectedBtmAttrs().put(bizType.name, bizType.apNameArray); |
| | | exportData.getAllQTDs().put(bizType.name, platformClientUtil.getQTDService().getBizTypeQTDs(bizType.name)); |
| | | } |
| | | } |
| | | } |
| | | ObjectOutputStream vciamfFileStream = null; |
| | | try { |
| | | File vciqtmfFile = new File(vciqtmfFileName); |
| | | vciamfFileStream = new ObjectOutputStream(new FileOutputStream(vciqtmfFile)); |
| | | vciamfFileStream.writeObject(exportData); |
| | | }finally { |
| | | try { |
| | | if (vciamfFileStream != null) { |
| | | vciamfFileStream.flush(); |
| | | vciamfFileStream.close(); |
| | | } |
| | | } catch (Exception e) { |
| | | throw new PLException("500",new String[]{"å¯¼åºæµå
³éå¼å¸¸ï¼"}); |
| | | } |
| | | } |
| | | ControllerUtil.writeFileToResponse(response,vciqtmfFileName); |
| | | FileUtil.del(defaultTempFolder + File.separator); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¡ä»¶ä¸çéæ©æ¥è¯¢æ¨¡æ¿å¯¹è¯æ¡ï¼æ¥è¯¢å
¨é¨æ¨¡æ¿åæå¯¹åºçä¸å¡ç±»åæé¾æ¥ç±»ååï¼ |
| | | * @return |
| | | */ |
| | | @Override |
| | | public BaseResult getAllQTs() throws PLException { |
| | | QTInfo[] allQTs = platformClientUtil.getQTDService().getAllQTs(); |
| | | DataGrid<QTInfo> dataGrid = new DataGrid<>(); |
| | | dataGrid.setData(Arrays.asList(allQTs)); |
| | | dataGrid.setTotal(allQTs.length); |
| | | return BaseResult.dataGrid(dataGrid); |
| | | } |
| | | |
| | | /** |
| | | * 导å
¥ä¸å¡ç±»åæ¥è¯¢æ¨¡æ¿ |
| | | * @param file ä¸ä¼ çæä»¶ |
| | | * @return 导å
¥ç»æ |
| | | */ |
| | | @Override |
| | | public BaseResult impBtmTemplate(MultipartFile file) throws IOException, ClassNotFoundException { |
| | | if (file == null) { |
| | | return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"æ 导å
¥çæä»¶"}); |
| | | } |
| | | if (!file.getOriginalFilename().endsWith(".vciqtf")) { |
| | | throw new VciBaseException("ä»
è½ä¸ä¼ .vciqtfæ ¼å¼æä»¶ï¼è¯·éæ°ä¸ä¼ ï¼"); |
| | | } |
| | | ObjectInputStream obj = new ObjectInputStream( |
| | | file.getInputStream()); |
| | | BtmQTExportData qtExportData = (BtmQTExportData) obj.readObject(); |
| | | List<BizType> ltsNew = new ArrayList<>(); |
| | | List<QTInfo> qTWrapperNew = new ArrayList<>(); |
| | | Map<String/* ç±»ååç§° */, QTD[]/* æ¥è¯¢æ¨¡æ¿å®ä¹ */> norepQTDs = new HashMap<String, QTD[]>(); |
| | | addImportBtmData(qtExportData, ltsNew, qTWrapperNew, norepQTDs); |
| | | QTInfo[] qts = qTWrapperNew |
| | | .toArray(new QTInfo[qTWrapperNew.size()]); |
| | | //å¤çæ çè¿å |
| | | HashMap<String,Object> tree = new HashMap(); |
| | | tree.put("text","ä¸å¡ç±»å"); |
| | | List<HashMap<String,Object>> childList = new ArrayList<>(); |
| | | //æ·»å ä¸å¡ç±»åæ ¹èç¹ |
| | | for (BizType plAction : ltsNew) { |
| | | HashMap<String,Object> childTree = new HashMap(); |
| | | childTree.put("text", plAction.label + "/" +plAction.name); |
| | | childTree.put("oid", plAction.oid); |
| | | addExportTreeNode(plAction, qts, childTree); |
| | | childList.add(childTree); |
| | | } |
| | | tree.put("children", childList); |
| | | return BaseResult.success(tree); |
| | | } |
| | | |
| | | // æ°æ®è¿æ»¤ |
| | | private void addImportBtmData(BtmQTExportData qtExportData, List<BizType> ltsNew, List<QTInfo> qTWrapperNew, |
| | | Map<String/* ç±»ååç§° */, QTD[]/* æ¥è¯¢æ¨¡æ¿å®ä¹ */> norepQTDs) { |
| | | Map<String/* ç±»ååç§° */, QTD[]/* æ¥è¯¢æ¨¡æ¿å®ä¹ */> allQTDs = qtExportData |
| | | .getAllQTDs(); |
| | | Map<String/* ç±»ååç§° */, BizType/* ç±»å对象 */> selectedBtmItems = qtExportData |
| | | .getSelectedBtmItems(); |
| | | Map<String/* ç±»ååç§° */, String[]/* ç±»åæå±å±æ§ */> selectedBtmAttrs = qtExportData |
| | | .getSelectedBtmAttrs(); |
| | | Map<String/* æ¥è¯¢æ¨¡æ¿åç§° */, QTInfo/* æ¥è¯¢æ¨¡æ¿å¯¹è±¡ */> allSelectedQTs = qtExportData |
| | | .getAllQTs(); |
| | | if (allQTDs.size() == 0 || allQTDs == null |
| | | || selectedBtmItems.size() == 0 || selectedBtmItems == null |
| | | || selectedBtmAttrs.size() == 0 || selectedBtmAttrs == null |
| | | || allSelectedQTs.size() == 0 || allSelectedQTs == null) { |
| | | throw new VciBaseException("导å
¥çæ¨¡æ¿æ°æ®æè¯¯!!!"); |
| | | } |
| | | Set<Map.Entry<String, QTD[]>> pLActions = allQTDs.entrySet(); |
| | | Set<Map.Entry<String, QTInfo>> pLQts = allSelectedQTs.entrySet(); |
| | | Set<Map.Entry<String, BizType>> btmpLQts = selectedBtmItems.entrySet(); |
| | | for (Map.Entry<String, QTD[]> entry : pLActions) { |
| | | String string = entry.getKey(); |
| | | QTD[] qtds = entry.getValue(); |
| | | getPLQtIsInDB(string, qtds, norepQTDs); |
| | | } |
| | | for (Map.Entry<String, BizType> entry : btmpLQts) { |
| | | String string = entry.getKey(); |
| | | BizType bizType = entry.getValue(); |
| | | getPLQtBtmItem2(string, bizType, ltsNew); |
| | | } |
| | | Map<String/*ç±»ååç§°*/, QTD[]/*æ¥è¯¢æ¨¡æ¿å®ä¹*/> newNorepQTDs = getnewNorepQTDs(norepQTDs,allSelectedQTs); |
| | | for (Map.Entry<String, QTInfo> entry : pLQts) { |
| | | String string = entry.getKey(); |
| | | QTInfo qtWrapper = entry.getValue(); |
| | | getPLBtmQtWrapper(string, qtWrapper, ltsNew, qTWrapperNew, newNorepQTDs); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * çæå¯¼åºæ 鿩以å导å
¥æ æ¾ç¤º |
| | | * @param bizType |
| | | * @param qts |
| | | * @param tree |
| | | */ |
| | | private void addExportTreeNode(BizType bizType/*ä¸å¡ç±»å*/,QTInfo[] qts/*æ¥è¯¢æ¨¡æ¿å¯¹è±¡*/,HashMap<String,Object> tree) { |
| | | List<String> childList = new ArrayList<>(); |
| | | // æ·»å æ¥è¯¢æ¨¡æ¿å¯¹è±¡åèç¹ |
| | | for (QTInfo qtItem : qts) { |
| | | //å¤ç导å
¥æ¶æ æ³è¿è¡ç±»å夿 |
| | | int splitLength = bizType.name.indexOf("ã"); |
| | | if(splitLength == -1){ |
| | | splitLength = bizType.name.length(); |
| | | } |
| | | if (qtItem.btmName.equals(bizType.name.substring(0, |
| | | splitLength))) { |
| | | childList.add(qtItem.qtName); |
| | | } |
| | | } |
| | | tree.put("children",childList); |
| | | } |
| | | |
| | | } |
| | |
| | | if(!CollectionUtils.isEmpty(btmTypeVOList)) { |
| | | btmTypeVOList.stream().forEach(btmTypeVO -> { |
| | | String btmId = btmTypeVO.getId(); |
| | | List<OsBtmTypeAttributeVO> attributeVOS = btmService.listAttributeByBtmId(btmId); |
| | | List<OsBtmTypeAttributeVO> attributeVOS = null; |
| | | try { |
| | | attributeVOS = btmService.listAttributeByBtmId(btmId); |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | throw new VciBaseException(VciBaseUtil.getExceptionMessage(e)); |
| | | } |
| | | //å
æ¯åç§° |
| | | int rowIndex = index[0]; |
| | | WriteExcelData idED = new WriteExcelData(rowIndex, 0, btmId); |
| | |
| | | params |
| | | }); |
| | | } |
| | | |
| | | // å é¤ç´¢å¼ |
| | | export function delIndex(params) { |
| | | return request({ |
| | | url: "/api/btmTypeController/delIndex", |
| | | method: "delete", |
| | | params |
| | | }); |
| | | } |
| | | |
| | | // åå»ºç´¢å¼ |
| | | export function addIndex(params) { |
| | | return request({ |
| | | url: "/api/btmTypeController/addIndex", |
| | | method: "post", |
| | | data:params |
| | | }); |
| | | } |
| | | |
| | |
| | | // å¢å æä½ç±»å |
| | | export function addOperationType(data) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/addOperationType", |
| | | url: "/api/hmSysModConfigController/addFuncOperationType", |
| | | method: "post", |
| | | data |
| | | }); |
| | | } |
| | | |
| | | // å¯¼åº |
| | | export const exportModule = (params) => { |
| | | return request({ |
| | | url: '/api/hmSysModConfigController/exportModule', |
| | | method: 'get', |
| | | headers: {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'}, |
| | | responseType: 'blob', |
| | | params |
| | | }) |
| | | } |
| | | |
| | | // ä¿®æ¹å«å |
| | | export function updateAlias(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/updateAlias", |
| | | method: "put", |
| | | data:params |
| | | }); |
| | | } |
| | | |
| | | // å 餿¨¡åä¸å
³èçæä½ç±»å |
| | | export function delFuncOperation(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/delFuncOperation", |
| | | method: "delete", |
| | | data:params |
| | | }); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/router/axios'; |
| | | |
| | | // æ°å¢ |
| | | export function addOperationType(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/addOperationType", |
| | | method: "post", |
| | | data:params |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹ |
| | | export function updateOperationType(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/updateOperationType", |
| | | method: "put", |
| | | data:params |
| | | }); |
| | | } |
| | | |
| | | // å é¤ |
| | | export function delOperationType(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/delOperationType", |
| | | method: "delete", |
| | | data:params |
| | | }); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/router/axios'; |
| | | |
| | | // å表æ¥è¯¢ |
| | | export function getAppConfigCategoryInfo(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/getAppConfigCategoryInfo", |
| | | method: "get", |
| | | params |
| | | }); |
| | | } |
| | | |
| | | // é
置项æ¥è¯¢ |
| | | export function getAppConfigDetailsByID(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/getAppConfigDetailsByID", |
| | | method: "get", |
| | | params |
| | | }); |
| | | } |
| | | |
| | | // å¢å é
ç½® |
| | | export function addAppConf(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/addAppConf", |
| | | method: "post", |
| | | data: params |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹é
ç½® |
| | | export function updateAppConf(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/updateAppConf", |
| | | method: "put", |
| | | data: params |
| | | }); |
| | | } |
| | | |
| | | // å¯¼åº |
| | | export function exportSysConf(params) { |
| | | return request({ |
| | | url: '/api/hmSysModConfigController/exportSysConf', |
| | | method: 'post', |
| | | headers: {'Content-Type': 'application/json;charset=UTF-8'}, |
| | | responseType: 'blob', |
| | | data: params |
| | | }) |
| | | } |
| | | |
| | | |
| | |
| | | style="text-align: center" |
| | | width="50%" |
| | | @close="dialogClose"> |
| | | <div style="margin-bottom: 20px;" v-if="topMethodsObj !== {} && topMethodsObj"> |
| | | <div> |
| | | <span>å¯¼åºæ¹å¼ï¼</span> |
| | | <el-radio-group v-model="radio"> |
| | | <el-radio :label="0" v-if="topMethodsObj.select">éæ©</el-radio> |
| | | <el-radio :label="1" v-if="topMethodsObj.all">å
¨é¨</el-radio> |
| | | <el-radio :label="2" v-if="topMethodsObj.page">页ç </el-radio> |
| | | </el-radio-group> |
| | | <span v-if="radio === 2" style="margin-left: 20px;color: #F56C6C; "> |
| | | <el-input v-model="pageExport" style="width: 150px"></el-input> ï¼è¾å
¥é¡µç æè
页é¢èå´ï¼å¦ï¼1-10ï¼</span> |
| | | </div> |
| | | </div> |
| | | <el-transfer |
| | | v-model="rightRoleData" |
| | | v-loading="loading" |
| | |
| | | style="text-align: left; display: inline-block;"> |
| | | </el-transfer> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <div class="valueInfo" v-if="bottomValue">已设置çå¼ä¸ºï¼[{{bottomValue}}]</div> |
| | | <el-button @click="visible = false" size="small">å æ¶</el-button> |
| | | <el-button type="primary" @click="sendHandler" size="small">ç¡® å®</el-button> |
| | | <div v-if="bottomValue" class="valueInfo">已设置çå¼ä¸ºï¼[{{ bottomValue }}]</div> |
| | | <el-button size="small" @click="visible = false">å æ¶</el-button> |
| | | <el-button size="small" type="primary" @click="sendHandler">ç¡® å®</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import func from "@/util/func"; |
| | | |
| | | export default { |
| | | name: "transfer", |
| | | props: ['title', 'leftRoleData', 'rightRoleData', 'transferTitle' , 'bottomValue'], |
| | | props: ['title', 'leftRoleData', 'rightRoleData', 'transferTitle', 'bottomValue', 'topMethodsObj', 'selectList'], |
| | | /** |
| | | * topMethodsObj:{ |
| | | select:true, |
| | | all:true, |
| | | page:false |
| | | }, |
| | | æ§å¶é¡¶å±éæ©é¡¹æ¯å¦å±ç¤ºï¼éè¦é
åselectListä½¿ç¨ |
| | | * @returns {object} |
| | | */ |
| | | data() { |
| | | return { |
| | | radio: 0, |
| | | pageExport: "", |
| | | visible: false, // éè¿ this.$refs.transfer.visible = true; å¼å¯åç»ä»¶å¯¹è¯æ¡ |
| | | data: [], |
| | | loading: false, |
| | |
| | | this.leftRoleData = []; |
| | | }, |
| | | sendHandler() { |
| | | this.$emit('transferSend', this.rightRoleData); |
| | | if (func.isEmptyObject(this.topMethodsObj)) { |
| | | this.$emit('transferSend', this.rightRoleData); |
| | | } else { |
| | | if (this.radio === 0) { |
| | | if (this.selectList.length <= 0) { |
| | | this.$message.warning('è¯·éæ©è¦å¯¼åºç模æ¿') |
| | | return |
| | | } |
| | | this.$emit('transferSend', this.rightRoleData, 0); |
| | | } else if (this.radio === 1) { |
| | | this.$emit('transferSend', this.rightRoleData, 1); |
| | | } |
| | | } |
| | | |
| | | this.visible = false; |
| | | }, |
| | | } |
| | |
| | | /deep/ .el-transfer-panel__list.is-filterable { |
| | | height: 323px; /* ç©¿æ¢æ¡å表é«åº¦ */ |
| | | } |
| | | .valueInfo{ |
| | | |
| | | .valueInfo { |
| | | float: left; |
| | | border: 1px solid #E9E7E7; |
| | | display: inline-block; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <p>transferSelect</p> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: "transferSelect" |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | |
| | | </ul> |
| | | <Divider left="30px" text="éæ©æä»¶åä¼èªå¨ä¸ä¼ "></Divider> |
| | | <el-upload |
| | | :name="fileName" |
| | | :action="fileUrl" |
| | | :before-upload="beforeUpload" |
| | | :data="fileData" |
| | |
| | | type: Array, |
| | | default: () => [] |
| | | }, |
| | | fileName: { |
| | | type: String, |
| | | default: () => "file" |
| | | }, |
| | | // å¯¹è¯æ¡å¤´é¨åç§° |
| | | title: { |
| | | type: String, |
| | |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- ä¸è´æ§æ£æ¥ --> |
| | | <!-- æ¥çç´¢å¼ --> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :visible.sync="indexVisible" |
| | |
| | | class="avue-dialog" |
| | | title="ç´¢å¼ä¿¡æ¯" |
| | | width="60%" |
| | | @close="indexDialogClose" |
| | | > |
| | | |
| | | <div v-loading="indexLoading" style="display: flex;height: 500px;width: 100%"> |
| | | <basic-container> |
| | | <div style="height: 390px"> |
| | | <el-button plain size="mini" style="margin-bottom: 5px" type="danger" |
| | | @click="deleteIndexLeftTreeClickHandler">å é¤ç´¢å¼ |
| | | </el-button> |
| | | <avue-tree |
| | | :data="indexLeftData" |
| | | :option="indexLeftOption" |
| | | @node-click="indexLeftNodeClick"></avue-tree> |
| | | </div> |
| | | </basic-container> |
| | | <div style="padding: 20px;width: 75%"> |
| | | <div> |
| | | <el-form ref="form" :model="indexForm" label-width="90px" size="mini"> |
| | | <el-form-item label="ç´¢å¼åç§°ï¼"> |
| | | <el-input v-model="indexForm.name" :readOnly="indexFormRead"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°ï¼"> |
| | | <el-input v-model="indexForm.desc"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div style="display: flex;justify-content: center"> |
| | | <el-button plain size="mini" type="success" @click="rightIndexAddClick">å¢å </el-button> |
| | | <el-button plain size="mini" type="danger">å é¤</el-button> |
| | | </div> |
| | | </div> |
| | | <avue-crud |
| | | :data="indexData" |
| | | :option="indexOption"></avue-crud> |
| | | </div> |
| | | </div> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :visible.sync="indexAttrVisible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | title="屿§ä¿¡æ¯" |
| | | width="60%" |
| | | > |
| | | <avue-crud |
| | | :data="indexAttrData" |
| | | :option="indexAttrOption" |
| | | @row-click="indexAttrRowClick"></avue-crud> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="indexAttrVisible = false">å æ¶</el-button> |
| | | <el-button type="primary" @click="indexAttrClickAddHandler">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="indexDialogClose">å æ¶</el-button> |
| | | <el-button type="primary" @click="indexClickAddHandler">ä¿ å</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | </el-container> |
| | |
| | | getUsedBtmLinkList, |
| | | checkBtmConsistency, |
| | | executeRepair, |
| | | getIndexByCondition |
| | | getIndexByCondition, |
| | | delIndex, |
| | | getAllAttributesByBtmId, |
| | | addIndex |
| | | } from "@/api/modeling/businessType/api" |
| | | import {gridAttribute} from "@/api/modeling/attributePool/api"; |
| | | import func from "@/util/func"; |
| | |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | indexVisible:false, |
| | | indexLoading: false, |
| | | indexFormRead: false, |
| | | indexAttrRow: {}, |
| | | indexAttrOption: { |
| | | ...basicOption, |
| | | height: 380, |
| | | highlightCurrentRow: true, |
| | | addBtn: false, |
| | | refreshBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | selection: false, |
| | | menu: false, |
| | | column: [ |
| | | { |
| | | label: '屿§ä¿¡æ¯', |
| | | prop: 'id', |
| | | sortable: true, |
| | | }, |
| | | ] |
| | | }, |
| | | indexAttrData: [], |
| | | indexData: [], |
| | | indexAttrVisible: false, |
| | | indexLeftNodeRow: {}, |
| | | indexForm: { |
| | | name: '', |
| | | desc: '' |
| | | }, |
| | | indexLeftData: [], |
| | | indexLeftOption: { |
| | | height: 'auto', |
| | | menu: false, |
| | | addBtn: false, |
| | | props: { |
| | | label: 'name', |
| | | value: 'id', |
| | | children: 'children', |
| | | }, |
| | | }, |
| | | indexOption: { |
| | | ...basicOption, |
| | | height: 280, |
| | | addBtn: false, |
| | | refreshBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | selection: false, |
| | | menu: false, |
| | | column: [ |
| | | { |
| | | label: 'ä¸å¡ç±»ååç§°', |
| | | prop: 'typeName', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: 'ç´¢å¼åç§°', |
| | | prop: 'indexName', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: '屿§åç§°', |
| | | prop: 'attrNames', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: 'æè¿°', |
| | | prop: 'desc', |
| | | sortable: true, |
| | | }, |
| | | ] |
| | | }, |
| | | indexVisible: false, |
| | | conDefaultCheckData: [], // ä¿çä¸ä¸ªæ¥å£è¿åçæ°æ® |
| | | conCheckLoading: false, |
| | | conCheckOption: { |
| | |
| | | if (res.data.code === 200) { |
| | | this.checkViewVisible = true; |
| | | const data = res.data.data.map(item => { |
| | | return{ |
| | | name:this.nodeRow.id, |
| | | source:item |
| | | return { |
| | | name: this.nodeRow.id, |
| | | source: item |
| | | } |
| | | }); |
| | | this.checkViewData = data; |
| | |
| | | }, |
| | | |
| | | // ä¸è´æ§æ£æ¥æé®ç¹å» |
| | | checkClickHandler(){ |
| | | checkBtmConsistency().then(res =>{ |
| | | if(res && res.data && res.data.data){ |
| | | checkClickHandler() { |
| | | this.createViewLoading = true; |
| | | checkBtmConsistency().then(res => { |
| | | this.createViewLoading = false; |
| | | if (res && res.data && res.data.data) { |
| | | this.conCheckVisible = true; |
| | | this.conCheckLoading = true; |
| | | if(res.data.code === 200){ |
| | | if (res.data.code === 200) { |
| | | const data = res.data.data[0]; |
| | | this.conDefaultCheckData = data; // ä¿çä¸ä»½åå§æ°æ® |
| | | this.conCheckLoading = false; |
| | |
| | | }) |
| | | this.conCheckData = outputData; |
| | | } |
| | | }else { |
| | | } else { |
| | | this.$message.success(res.data.msg); |
| | | } |
| | | }) |
| | |
| | | }, |
| | | |
| | | // åå»ºç´¢å¼æé®ç¹å» |
| | | indexClickHandler(){ |
| | | if(func.isEmptyObject(this.nodeRow)){ |
| | | indexClickHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('请è³å°éæ©ä¸æ¡æ°æ®'); |
| | | return; |
| | | } |
| | | this.getLeftIndex(); |
| | | this.indexVisible = true; |
| | | }, |
| | | |
| | | // å·¦ä¾§æ æ´æ° |
| | | getLeftIndex() { |
| | | const params = { |
| | | "conditionMap[typename]":this.nodeRow.id |
| | | "conditionMap[typename]": this.nodeRow.id |
| | | } |
| | | getIndexByCondition(params).then(res => { |
| | | console.log(res); |
| | | if (res.data.code === 200) { |
| | | const data = res.data.data.map(item => { |
| | | return { |
| | | indexName: item.indexName, |
| | | name: `${item.indexName} ${item.attrNames}`, |
| | | id: item.oid |
| | | } |
| | | }) |
| | | this.indexLeftData = data; |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // ç´¢å¼å·¦ä¾§æ ç¹å» |
| | | indexLeftNodeClick(row) { |
| | | this.indexLeftNodeRow = row; |
| | | }, |
| | | |
| | | // å é¤å·¦ä¾§æ ç´¢å¼ |
| | | deleteIndexLeftTreeClickHandler() { |
| | | if (func.isEmptyObject(this.indexLeftNodeRow)) { |
| | | this.$message.error('è¯·éæ©ä¸æ¡æ°æ®è¿è¡å é¤'); |
| | | return; |
| | | } |
| | | const params = { |
| | | btmName: this.nodeRow.id, |
| | | indexName: this.indexLeftNodeRow.indexName |
| | | }; |
| | | delIndex(params).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success('å é¤ç´¢å¼æå'); |
| | | this.getLeftIndex(); |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | //å³ä¾§è¡¨æ ¼æ·»å 屿§ |
| | | indexAttrClickAddHandler() { |
| | | if (func.isEmptyObject(this.indexAttrRow)) { |
| | | this.$message.error('请è³å°éæ©ä¸æ¡æ°æ®'); |
| | | return; |
| | | } |
| | | this.indexData.push( |
| | | { |
| | | typeName: this.nodeRow.id, |
| | | attrNames: this.indexAttrRow.id, |
| | | indexName: this.indexForm.name, |
| | | desc: this.indexForm.desc |
| | | } |
| | | ) |
| | | this.indexFormRead = true; |
| | | this.indexAttrVisible = false; |
| | | }, |
| | | |
| | | // å³ä¾§å±æ§è¡¨æ ¼è¡ç¹å» |
| | | indexAttrRowClick(row) { |
| | | this.indexAttrRow = row; |
| | | }, |
| | | |
| | | // å³ä¾§è¡¨æ ¼å¢å |
| | | rightIndexAddClick() { |
| | | if (!this.indexForm.name) { |
| | | this.$message.error('请è¾å
¥ç´¢å¼åç§°'); |
| | | return; |
| | | } |
| | | |
| | | // æ£æ¥æ¯å¦ä¸ºè±æå符 |
| | | const englishRegex = /^[A-Za-z]+$/; |
| | | if (!englishRegex.test(this.indexForm.name)) { |
| | | this.$message.error('ç´¢å¼åç§°åªè½å
å«è±æå符'); |
| | | return; |
| | | } |
| | | this.indexLoading = true; |
| | | getAllAttributesByBtmId({btmId: this.nodeRow.id}).then(res => { |
| | | if (res.data.code === 200) { |
| | | const data = res.data.data.map(item => { |
| | | return { |
| | | id: item.id |
| | | } |
| | | }) |
| | | this.indexAttrData = data; |
| | | } |
| | | this.indexLoading = false; |
| | | this.indexAttrVisible = true; |
| | | }) |
| | | }, |
| | | |
| | | // å建ä¿åç´¢å¼ |
| | | indexClickAddHandler() { |
| | | const params = { |
| | | typeName: this.nodeRow.id, |
| | | attrNames: this.indexData.map(item => item.attrNames).join(','), |
| | | indexName: this.indexForm.name, |
| | | } |
| | | addIndex([params]).then(res => { |
| | | console.log(res) |
| | | this.$message.success('å建æå'); |
| | | this.indexDialogClose(); |
| | | }).catch(err => { |
| | | this.indexDialogClose(); |
| | | }) |
| | | }, |
| | | |
| | | // ç´¢å¼å¯¹è¯æ¡åæ¶ |
| | | indexDialogClose() { |
| | | this.indexFormRead = false; |
| | | this.indexForm = {}; |
| | | this.indexData = []; |
| | | this.indexVisible = false; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | v-loading="loading" |
| | | :visible.sync="visible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | title="表å" |
| | | width="100%" |
| | | @close="closeDialog" |
| | | > |
| | | <el-container> |
| | | <div style="height: 79vh;display: flex;width: 100%;"> |
| | | |
| | | <el-aside width="15%"> |
| | | <basic-container> |
| | | <div style="height:650px;"> |
| | | <avue-tree |
| | | :data="treeData" |
| | | :option="treeOption" |
| | | @node-drag-start="handleDragStart"> |
| | | </avue-tree> |
| | | </div> |
| | | </basic-container> |
| | | </el-aside> |
| | | |
| | | <el-main > |
| | | <basic-container> |
| | | <div style="height: 645px" @drop="drop" @dragover.prevent> |
| | | <div style="display: flex;justify-content: center"> |
| | | <span style="display: flex;align-items: center; margin-right: 5px;"> |
| | | <p class="tableTopLabel">åç§°ï¼</p> |
| | | <el-input v-model="name" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | </span> |
| | | |
| | | <span style="display: flex;align-items: center; margin-right: 5px;"> |
| | | <p class="tableTopLabel">æ¥è¯¢æ¨¡æ¿åç§°ï¼</p> |
| | | <el-input v-model="name" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | </span> |
| | | |
| | | <span style="display: flex;align-items: center; margin-right: 5px;"> |
| | | <p class="tableTopLabel">æ¾ç¤ºåæ°ï¼</p> |
| | | <el-input v-model="name" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | <el-button plain size="mini" style="margin-left: 3px" type="success">设置</el-button> |
| | | </span> |
| | | |
| | | <span style="display: flex;align-items: center; margin-right: 5px;"> |
| | | <p class="tableTopLabel">ä½ç½®ï¼</p> |
| | | <el-input v-model="name" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | <el-button plain size="mini" style="margin-left: 3px" type="success">è°æ´ä½ç½®</el-button> |
| | | </span> |
| | | </div> |
| | | <h3>页é¢å®ä¹</h3> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="100px"> |
| | | <el-row> |
| | | <el-col :span="columnNumber"> |
| | | <el-tooltip v-for="(item,index) in formList" :key="index" :content="item.name" placement="top"> |
| | | <el-form-item class="hiddenLabel" :label="item.name + 'ï¼'"> |
| | | <el-input v-model="item.value" :splaceholder="item.name" size="mini"></el-input> |
| | | </el-form-item> |
| | | </el-tooltip> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </div> |
| | | <div style="display: flex;justify-content: center;margin-top: 15px"> |
| | | <el-button icon="el-icon-check" size="small" type="primary">ä¿å</el-button> |
| | | <el-button icon="el-icon-delete" plain size="small" type="danger">æ¸
空</el-button> |
| | | <el-button icon="el-icon-el-icon-close" plain size="small" type="primary">å é¤ç»ä»¶</el-button> |
| | | <el-button icon="el-icon-plus" plain size="small" type="primary">æ·»å èªå®ä¹ç»ä»¶</el-button> |
| | | <el-button icon="el-icon-zoom-in" plain size="small" type="primary">é¢è§</el-button> |
| | | </div> |
| | | </basic-container> |
| | | </el-main> |
| | | |
| | | <el-aside width="25%"> |
| | | <basic-container> |
| | | <div style="height: 700px; overflow-y: auto;padding-right: 10px"> |
| | | <h3>设置</h3> |
| | | <el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="85px"> |
| | | <el-row style="border-bottom: 1px solid #878585;padding-bottom: 10px"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="使ç¨å段"> |
| | | <div style="display: flex"> |
| | | <el-input v-model="user" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | <el-checkbox v-model="checked" style="margin-left: 5px; margin-right: 5px">åªè¯»</el-checkbox> |
| | | <el-checkbox v-model="checked" style="margin-left: 5px;margin-right: 0px">å¿
å¡«</el-checkbox> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ¾ç¤ºåç§°"> |
| | | <el-input v-model="user" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item class="rightLabel" label="æ¾ç¤ºç±»å"> |
| | | <el-select v-model="form.region" placeholder="è¯·éæ©æ´»å¨åºå" size="mini"> |
| | | <el-option label="åºåä¸" value="shanghai"></el-option> |
| | | <el-option label="åºåäº" value="beijing"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="24"> |
| | | <el-tooltip content="é»è®¤å¼è¡¨è¾¾å¼" placement="top"> |
| | | <el-form-item class="hiddenLabel" label="é»è®¤å¼è¡¨è¾¾å¼"> |
| | | <el-input v-model="user" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | </el-form-item> |
| | | </el-tooltip> |
| | | </el-col> |
| | | |
| | | <el-col :span="24"> |
| | | <!-- <el-tooltip content="æ¾ç¤ºè¡¨è¾¾å¼" placement="top">--> |
| | | <el-form-item label="æ¾ç¤ºè¡¨è¾¾å¼"> |
| | | <el-input v-model="user" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | </el-form-item> |
| | | <!-- </el-tooltip>--> |
| | | </el-col> |
| | | |
| | | <el-col :span="24"> |
| | | <el-tooltip content="æ¥ææ ¼å¼åå符串" placement="top"> |
| | | <el-form-item class="hiddenLabel" label="æ¥ææ ¼å¼åå符串ï¼"> |
| | | <el-input v-model="user" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | </el-form-item> |
| | | </el-tooltip> |
| | | </el-col> |
| | | |
| | | <el-col :span="24"> |
| | | <el-form-item label="å 使¹å¼"> |
| | | <el-radio v-model="treeRadio" label="0">æ¾ç¤º</el-radio> |
| | | <el-radio v-model="treeRadio" label="1">䏿¾ç¤º</el-radio> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="24" style="height: 90px"> |
| | | <el-form-item label="åæ®µè¡¨è¾¾å¼"> |
| | | <el-input |
| | | v-model="textarea2" |
| | | :rows="3" |
| | | placeholder="请è¾å
¥å
容" |
| | | resize="none" |
| | | type="textarea"> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="24" style="height: 90px"> |
| | | <el-tooltip content="åªè¯»éæ©æ¡ä»¶" placement="top"> |
| | | <el-form-item class="hiddenLabel" label="åªè¯»éæ©æ¡ä»¶"> |
| | | <el-input |
| | | v-model="textarea2" |
| | | :rows="3" |
| | | placeholder="请è¾å
¥å
容" |
| | | resize="none" |
| | | type="textarea"> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-tooltip> |
| | | </el-col> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ§å¶å"> |
| | | <el-input v-model="user" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item class="rightLabel" label="æ¾ç¤ºåæ¡ä»¶" label-width="95px"> |
| | | <el-input v-model="user" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="24"> |
| | | <el-form-item label="æéæ§å¶"> |
| | | <div style="display: flex;align-items: center"> |
| | | <el-input v-model="user" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | <el-button plain size="mini" style="margin-left: 3px" type="success">éæ©</el-button> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | </el-row> |
| | | <el-row style="margin-top: 10px;border-bottom: 1px solid #878585;padding-bottom: 10px"> |
| | | <el-col :span="24" style="height: 90px"> |
| | | <el-form-item label="èæ¬éªè¯"> |
| | | <el-input |
| | | v-model="textarea2" |
| | | :rows="3" |
| | | placeholder="请è¾å
¥å
容" |
| | | resize="none" |
| | | type="textarea"> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="24" style="height: 90px"> |
| | | <el-form-item label="æç¤ºæå"> |
| | | <el-input |
| | | v-model="textarea2" |
| | | :rows="3" |
| | | placeholder="请è¾å
¥å
容" |
| | | resize="none" |
| | | type="textarea"> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="24"> |
| | | <el-form-item label="æ¥è¯¢å
³èå"> |
| | | <el-input v-model="user" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="24"> |
| | | <el-form-item label="èªå®ä¹ç±»"> |
| | | <el-input v-model="user" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="24"> |
| | | <el-form-item label="åå¨è·¯å¾"> |
| | | <el-input v-model="user" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="24"> |
| | | <el-tooltip content="åå¨è·¯å¾å段" placement="top"> |
| | | <el-form-item class="hiddenLabel" label="åå¨è·¯å¾å段"> |
| | | <div style="display: flex"> |
| | | <el-input v-model="user" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | <el-checkbox v-model="checked" style="margin-left: 5px">httpåå¨</el-checkbox> |
| | | </div> |
| | | </el-form-item> |
| | | </el-tooltip> |
| | | </el-col> |
| | | |
| | | </el-row> |
| | | |
| | | <el-row style="margin-top: 10px;border-bottom: 1px solid #878585;padding-bottom: 10px"> |
| | | <h4>é项å表</h4> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åç§°"> |
| | | <el-input v-model="user" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item class="rightLabel" label="å¼" label-width="95px"> |
| | | <el-input v-model="user" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="24" style="height: 190px"> |
| | | <el-form-item> |
| | | <div style="height: 150px; width: 100%; border: 1px solid #bdbbbb;overflow-y: auto"> |
| | | <el-table |
| | | :data="optionRightData" |
| | | :highlight-current-row="true" |
| | | :show-header="false" |
| | | border |
| | | stripe |
| | | style="width: 100%"> |
| | | <el-table-column |
| | | align="center" |
| | | label="åç§°" |
| | | prop="name"> |
| | | <template slot-scope="scope"> |
| | | <el-tag size="medium">{{ scope.row.name }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | label="å¼" |
| | | prop="value"> |
| | | <template slot-scope="scope"> |
| | | <el-tag size="medium">{{ scope.row.value }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <div style="display: flex;align-items: center;justify-content: center;margin-top: 5px"> |
| | | <el-button plain size="mini" style="margin-right: 5px" type="success">æ·»å </el-button> |
| | | <el-button plain size="mini" style="margin-left: 5px" type="danger">å é¤</el-button> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="24"> |
| | | <el-form-item label="ä¸çº§åç
§"> |
| | | <el-input v-model="user" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="24"> |
| | | <el-form-item label="äºçº§åç
§"> |
| | | <el-input v-model="user" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="24"> |
| | | <el-form-item label="åç
§å¼"> |
| | | <el-input v-model="user" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row style="margin-top: 10px"> |
| | | <el-col :span="24" style="height: 90px"> |
| | | <el-form-item label="éå 屿§"> |
| | | <el-input |
| | | v-model="textarea2" |
| | | :rows="3" |
| | | placeholder="请è¾å
¥å
容" |
| | | resize="none" |
| | | type="textarea"> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | </el-form> |
| | | </div> |
| | | </basic-container> |
| | | </el-aside> |
| | | |
| | | </div> |
| | | |
| | | </el-container> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | export default { |
| | | name: "formDialog", |
| | | data() { |
| | | return { |
| | | formList:[], |
| | | optionRightData: [ |
| | | { |
| | | name: 'test', |
| | | value: 'test' |
| | | } |
| | | ], |
| | | form: {}, |
| | | rules: {}, |
| | | columnNumber: 12, |
| | | loading: false, |
| | | visible: false, |
| | | treeOption: { |
| | | menu: false, |
| | | addBtn: false, |
| | | draggable: true, |
| | | allowDrop: () => { |
| | | return false; |
| | | }, |
| | | allowDrag: () => { |
| | | return true; |
| | | }, |
| | | // props: { |
| | | // label: 'name', |
| | | // value: 'id', |
| | | // children: 'children', |
| | | // }, |
| | | }, |
| | | treeData: [ |
| | | { |
| | | value: 0, |
| | | label: 'ä¸çº§é¨é¨', |
| | | children: [ |
| | | { |
| | | value: 1, |
| | | label: 'ä¸çº§é¨é¨1', |
| | | }, { |
| | | value: 2, |
| | | label: 'ä¸çº§é¨é¨2', |
| | | } |
| | | ] |
| | | }, { |
| | | value: 3, |
| | | label: 'äºçº§é¨é¨', |
| | | children: [ |
| | | { |
| | | value: 4, |
| | | label: 'äºçº§é¨é¨1', |
| | | }, { |
| | | value: 5, |
| | | label: 'äºçº§é¨é¨2', |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value: 0, |
| | | label: 'ä¸çº§é¨é¨', |
| | | children: [ |
| | | { |
| | | value: 1, |
| | | label: 'ä¸çº§é¨é¨1', |
| | | }, { |
| | | value: 2, |
| | | label: 'ä¸çº§é¨é¨2', |
| | | } |
| | | ] |
| | | }, { |
| | | value: 3, |
| | | label: 'äºçº§é¨é¨', |
| | | children: [ |
| | | { |
| | | value: 4, |
| | | label: 'äºçº§é¨é¨1', |
| | | }, { |
| | | value: 5, |
| | | label: 'äºçº§é¨é¨2', |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value: 0, |
| | | label: 'ä¸çº§é¨é¨', |
| | | children: [ |
| | | { |
| | | value: 1, |
| | | label: 'ä¸çº§é¨é¨1', |
| | | }, { |
| | | value: 2, |
| | | label: 'ä¸çº§é¨é¨2', |
| | | } |
| | | ] |
| | | }, { |
| | | value: 3, |
| | | label: 'äºçº§é¨é¨', |
| | | children: [ |
| | | { |
| | | value: 4, |
| | | label: 'äºçº§é¨é¨1', |
| | | }, { |
| | | value: 5, |
| | | label: 'äºçº§é¨é¨2', |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value: 0, |
| | | label: 'ä¸çº§é¨é¨', |
| | | children: [ |
| | | { |
| | | value: 1, |
| | | label: 'ä¸çº§é¨é¨1', |
| | | }, { |
| | | value: 2, |
| | | label: 'ä¸çº§é¨é¨2', |
| | | } |
| | | ] |
| | | }, { |
| | | value: 3, |
| | | label: 'äºçº§é¨é¨', |
| | | children: [ |
| | | { |
| | | value: 4, |
| | | label: 'äºçº§é¨é¨1', |
| | | }, { |
| | | value: 5, |
| | | label: 'äºçº§é¨é¨2', |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value: 0, |
| | | label: 'ä¸çº§é¨é¨', |
| | | children: [ |
| | | { |
| | | value: 1, |
| | | label: 'ä¸çº§é¨é¨1', |
| | | }, { |
| | | value: 2, |
| | | label: 'ä¸çº§é¨é¨2', |
| | | } |
| | | ] |
| | | }, { |
| | | value: 3, |
| | | label: 'äºçº§é¨é¨', |
| | | children: [ |
| | | { |
| | | value: 4, |
| | | label: 'äºçº§é¨é¨1', |
| | | }, { |
| | | value: 5, |
| | | label: 'äºçº§é¨é¨2', |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value: 0, |
| | | label: 'ä¸çº§é¨é¨', |
| | | children: [ |
| | | { |
| | | value: 1, |
| | | label: 'ä¸çº§é¨é¨1', |
| | | }, { |
| | | value: 2, |
| | | label: 'ä¸çº§é¨é¨2', |
| | | } |
| | | ] |
| | | }, { |
| | | value: 3, |
| | | label: 'äºçº§é¨é¨', |
| | | children: [ |
| | | { |
| | | value: 4, |
| | | label: 'äºçº§é¨é¨1', |
| | | }, { |
| | | value: 5, |
| | | label: 'äºçº§é¨é¨2', |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value: 0, |
| | | label: 'ä¸çº§é¨é¨', |
| | | children: [ |
| | | { |
| | | value: 1, |
| | | label: 'ä¸çº§é¨é¨1', |
| | | }, { |
| | | value: 2, |
| | | label: 'ä¸çº§é¨é¨2', |
| | | } |
| | | ] |
| | | }, { |
| | | value: 3, |
| | | label: 'äºçº§é¨é¨', |
| | | children: [ |
| | | { |
| | | value: 4, |
| | | label: 'äºçº§é¨é¨1', |
| | | }, { |
| | | value: 5, |
| | | label: 'äºçº§é¨é¨2', |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | } |
| | | }, |
| | | methods: { |
| | | // å
³éå¯¹è¯æ¡ |
| | | closeDialog() { |
| | | }, |
| | | |
| | | // å¼å§ææ½æ èç¹äºä»¶ |
| | | handleDragStart(node, ev) { |
| | | // ä½¿ç¨ setData æ¹æ³è®¾ç½®æ°æ® |
| | | ev.dataTransfer.setData('item', JSON.stringify(node.data)); |
| | | }, |
| | | |
| | | // ææ½å°è¡¨åæ¶ |
| | | drop(event) { |
| | | // ä½¿ç¨ getData æ¹æ³è·åæ°æ® |
| | | const data = JSON.parse(event.dataTransfer.getData('item')); |
| | | console.log('data', data); |
| | | const params = { |
| | | name:data.label, |
| | | value:'', |
| | | type:'' |
| | | } |
| | | this.formList.push(params) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | ::v-deep { |
| | | .hiddenLabel { |
| | | .el-form-item__label { |
| | | white-space: nowrap; // 鲿¢æ¢è¡ |
| | | overflow: hidden; //éèè¶
åºé¨å |
| | | text-overflow: ellipsis; //æ¾ç¤ºçç¥å· |
| | | } |
| | | } |
| | | |
| | | .el-col { |
| | | margin-bottom: 0px; |
| | | height: 40px; |
| | | } |
| | | |
| | | .rightLabel { |
| | | .el-form-item__label { |
| | | text-align: right !important; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .tableTopLabel { |
| | | display: flex; |
| | | flex-shrink: 0 !important; |
| | | font-size: 14px |
| | | } |
| | | |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | v-loading="loading" |
| | | :visible.sync="visible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | title="è¡¨æ ¼" |
| | | width="60%" |
| | | @close="closeDialog" |
| | | > |
| | | <el-form :model="form" :rules="rules" label-position="right" label-width="100px"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åç§°"> |
| | | <el-input v-model="user" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ¯é¡µè¡æ°"> |
| | | <el-input v-model="user" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="24"> |
| | | <el-form-item label="éå æ¥è¯¢æ¡ä»¶"> |
| | | <el-input v-model="user" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç»å®è¡¨å"> |
| | | <div style="display: flex;align-items: center;"> |
| | | <el-select v-model="form.region" placeholder="è¯·éæ©æ´»å¨åºå" size="mini"> |
| | | <el-option label="åºåä¸" value="shanghai"></el-option> |
| | | <el-option label="åºåäº" value="beijing"></el-option> |
| | | </el-select> |
| | | <el-button plain size="mini" style="margin-left: 3px" type="success">éæ©</el-button> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç¶åç§°"> |
| | | <div style="display: flex;align-items: center;"> |
| | | <el-input v-model="user" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | <el-checkbox v-model="checked" style="margin-left: 5px; margin-right: 5px">æ¾ç¤ºæ¥è¯¢åºå</el-checkbox> |
| | | <el-checkbox v-model="checked" style="margin-left: 5px;margin-right: 0px">æ¾ç¤ºæä»¶å¤¹</el-checkbox> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ¾ç¤ºå段"> |
| | | <div style="display: flex; align-items: center"> |
| | | <div style="height: 260px; width: 160px; border: 1px solid #bdbbbb;overflow-y: auto"> |
| | | <el-table |
| | | :data="showLifeTable" |
| | | style="width: 100%"> |
| | | <el-table-column |
| | | align="center" |
| | | label="å¯ä½¿ç¨å段" |
| | | prop="id"> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <div style="margin-left: 10px; margin-right: 10px"> |
| | | <el-button circle icon="el-icon-back" style="margin-right: 10px"></el-button> |
| | | <el-button circle icon="el-icon-right"></el-button> |
| | | </div> |
| | | <div style="height: 260px; width: 160px; border: 1px solid #bdbbbb;overflow-y: auto"> |
| | | <el-table |
| | | :data="showRightTable" |
| | | style="width: 100%"> |
| | | <el-table-column |
| | | align="center" |
| | | label="éè¦ä½¿ç¨å段" |
| | | prop="id"> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item label="æç´¢å段"> |
| | | <div style="display: flex; align-items: center"> |
| | | <div style="height: 260px; width: 160px; border: 1px solid #bdbbbb;overflow-y: auto"> |
| | | <el-table |
| | | :data="searchLifeTable" |
| | | style="width: 100%"> |
| | | <el-table-column |
| | | align="center" |
| | | label="å¯ä¾æç´¢å段" |
| | | prop="id"> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <div style="margin-left: 10px; margin-right: 10px"> |
| | | <el-button circle icon="el-icon-back" style="margin-right: 10px"></el-button> |
| | | <el-button circle icon="el-icon-right"></el-button> |
| | | </div> |
| | | <div style="height: 260px; width: 160px; border: 1px solid #bdbbbb;overflow-y: auto"> |
| | | <el-table |
| | | :data="searchRightTable" |
| | | style="width: 100%"> |
| | | <el-table-column |
| | | align="center" |
| | | label="éæç´¢å段" |
| | | prop="id"> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item label="å"> |
| | | <el-select v-model="form.region" placeholder="è¯·éæ©å" size="mini"> |
| | | <el-option label="åºåä¸" value="shanghai"></el-option> |
| | | <el-option label="åºåäº" value="beijing"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item label="宽度"> |
| | | <div style="display: flex;align-items: center;"> |
| | | <el-input v-model="user" placeholder="请è¾å
¥å
容" size="mini" style="width: 193px"></el-input> |
| | | <el-button plain size="mini" style="margin-left: 3px" type="success">设置</el-button> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-col :span="24"> |
| | | <el-form-item label="设置å宽"> |
| | | <div style="height: 150px; width: 100%; border: 1px solid #bdbbbb;overflow-y: auto"> |
| | | <el-table |
| | | :data="columnWidthData" |
| | | :highlight-current-row="true" |
| | | border |
| | | stripe |
| | | style="width: 100%"> |
| | | <el-table-column |
| | | align="center" |
| | | label="åå" |
| | | prop="id"> |
| | | <template slot-scope="scope"> |
| | | <el-tag size="medium">{{ scope.row.id }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | label="å宽" |
| | | prop="width"> |
| | | <template slot-scope="scope"> |
| | | <el-tag size="medium">{{ scope.row.width }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="8"> |
| | | <el-form-item label="æ¥è¯¢å段"> |
| | | <el-input v-model="user" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="8"> |
| | | <el-form-item label="æ¥è¯¢æ¬¡æ°"> |
| | | <el-input v-model="user" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="8"> |
| | | <el-form-item label="æ¥è¯¢sql"> |
| | | <div style="display: flex;align-items: center"> |
| | | <el-input v-model="user" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | <el-button plain size="mini" style="margin-left: 3px" type="success">æ·»å </el-button> |
| | | <el-button plain size="mini" style="margin-left: 3px" type="danger">å é¤</el-button> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="24"> |
| | | <el-form-item label="æ¥è¯¢å段"> |
| | | <div style="height: 150px; width: 100%; border: 1px solid #bdbbbb;overflow-y: auto"> |
| | | <el-table |
| | | :data="columnSearchData" |
| | | :highlight-current-row="true" |
| | | border |
| | | stripe |
| | | style="width: 100%"> |
| | | <el-table-column |
| | | align="center" |
| | | label="æ¥è¯¢å段" |
| | | prop="id"> |
| | | <template slot-scope="scope"> |
| | | <el-tag size="medium">{{ scope.row.id }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | label="æ¥è¯¢æ¬¡æ°" |
| | | prop="name"> |
| | | <template slot-scope="scope"> |
| | | <el-tag size="medium">{{ scope.row.name }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | label="æ¥è¯¢sql" |
| | | prop="sql"> |
| | | <template slot-scope="scope"> |
| | | <el-tag size="medium">{{ scope.row.sql }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="24"> |
| | | <el-form-item label="å廿ä½"> |
| | | <el-select v-model="form.region" placeholder="è¯·éæ©å廿ä½" size="mini"> |
| | | <el-option label="åºåä¸" value="shanghai"></el-option> |
| | | <el-option label="åºåäº" value="beijing"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="24"> |
| | | <el-form-item label="å¾çæ¾ç¤º"> |
| | | <div style="display: flex;align-items: center"> |
| | | <div style="display: flex;align-items: center;width: 100%;"> |
| | | <span>é¿ï¼</span> |
| | | <el-input v-model="user" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | </div> |
| | | <div style="display: flex;align-items: center;width: 100%;margin-left: 30px"> |
| | | <span>宽ï¼</span> |
| | | <el-input v-model="user" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item label="å符串æªå"> |
| | | <el-input v-model="user" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="8"> |
| | | <el-form-item label="è¶
龿¥"> |
| | | <el-input v-model="user" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="24"> |
| | | <el-form-item label="æ¥è¯¢æ¨¡æ¿"> |
| | | <el-select v-model="form.region" placeholder="è¯·éæ©æ¥è¯¢æ¨¡æ¿" size="mini"> |
| | | <el-option label="åºåä¸" value="shanghai"></el-option> |
| | | <el-option label="åºåäº" value="beijing"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-form> |
| | | |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button>å æ¶</el-button> |
| | | <el-button type="primary">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: "tableDialog", |
| | | data() { |
| | | return { |
| | | columnSearchData: [ |
| | | { |
| | | id: 'test', |
| | | name: '3', |
| | | sql: 'xxxxx' |
| | | } |
| | | ], |
| | | columnWidthData: [ |
| | | { |
| | | id: 'test', |
| | | width: '250' |
| | | } |
| | | ], |
| | | searchLifeTable: [], |
| | | searchRightTable: [], |
| | | showRightTable: [], |
| | | showLifeTable: [ |
| | | { |
| | | id: 'test1' |
| | | }, |
| | | { |
| | | id: 'test2' |
| | | }, |
| | | { |
| | | id: 'test1' |
| | | }, |
| | | { |
| | | id: 'test2' |
| | | }, |
| | | { |
| | | id: 'test1' |
| | | }, |
| | | { |
| | | id: 'test2' |
| | | } |
| | | ], |
| | | rules: {}, |
| | | form: {}, |
| | | loading: false, |
| | | visible: false |
| | | } |
| | | }, |
| | | methods: { |
| | | closeDialog() { |
| | | |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | ::v-deep { |
| | | .el-form-item .el-select { |
| | | //width: 100%; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <el-aside> |
| | | <basic-container> |
| | | <div ref="TreeBox" style="height: calc(100vh - 144px);!important;"> |
| | | <div class="headerCon"> |
| | | <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addClickHandler">å建 |
| | | </el-button> |
| | | <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editClickHandler">ä¿®æ¹ |
| | | </el-button> |
| | | <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delClickHandler">å é¤ |
| | | </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> |
| | | <el-button class="smallBtn" plain size="small" type="primary" |
| | | @click="checkViewClickHandler">æ¥ç使ç¨èå´ |
| | | </el-button> |
| | | </div> |
| | | <!-- 左侧æ --> |
| | | <div style="height: calc(100vh - 280px);"> |
| | | <div style="margin-bottom: 10px;display: flex;justify-content: center"> |
| | | <el-radio v-model="treeRadio" label="0">ä¸å¡ç±»åæ </el-radio> |
| | | <el-radio v-model="treeRadio" label="1">龿¥ç±»åæ </el-radio> |
| | | </div> |
| | | <avue-tree :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <span slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <span style="font-size: 15px"> |
| | |
| | | |
| | | <el-main> |
| | | <basic-container> |
| | | <avue-crud |
| | | :data="data" |
| | | :option="option"> |
| | | <template slot="menuLeft"> |
| | | <div style="display: flex; align-items: center;"> |
| | | <span style="display: inline-block; margin-right: 10px;"> |
| | | <el-radio v-model="tableRadio" label="0">表å</el-radio> |
| | | <el-radio v-model="tableRadio" label="1">è¡¨æ ¼<span style="color: red;">ï¼å
导å
¥è¡¨åï¼å导å
¥è¡¨æ ¼ï¼ï¼</span></el-radio> |
| | | </span> |
| | | <span style="display: flex;align-items: center; margin-right: 10px;"> |
| | | <p style="display: flex; flex-shrink: 0;font-size: 14px">åç§°ï¼</p> |
| | | <el-input v-model="input" placeholder="请è¾å
¥å
容" size="mini"></el-input> |
| | | </span> |
| | | <span style="display: flex; align-items: center;"> |
| | | <p |
| | | style="display: flex; align-items: center; margin: 0 10px 0 0;flex-shrink: 0;font-size: 14px">å
éç®æ ï¼</p> |
| | | <el-input v-model="input" placeholder="请è¾å
¥å
容" size="mini" style="margin-right: 10px;"></el-input> |
| | | <el-button plain size="mini" type="success">å
éç®æ </el-button> |
| | | </span> |
| | | </div> |
| | | </template> |
| | | <template slot="menu" slot-scope="scope"> |
| | | <el-button icon="el-icon-edit" size="small" type="text" @click="editBtnClick(scope.row)">ç¼è¾ |
| | | </el-button> |
| | | <el-button icon="el-icon-delete" size="small" type="text" @click="rowDeleteHandler(scope.row)">å é¤ |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <div style="display: flex;justify-content: center;margin-top: 15px"> |
| | | <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addClickHandler">å¢å </el-button> |
| | | <el-button icon="el-icon-delete" plain size="small" type="danger">å é¤</el-button> |
| | | <el-button icon="el-icon-document-add" plain size="small" type="primary">å
é</el-button> |
| | | <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadHandler">导å
¥</el-button> |
| | | <el-button icon="el-icon-download" plain size="small" type="primary" @click="downLoadHandler">导åº</el-button> |
| | | </div> |
| | | </basic-container> |
| | | </el-main> |
| | | |
| | | <form-dialog ref="formDialog"></form-dialog> |
| | | <table-dialog ref="tableDialog"></table-dialog> |
| | | </el-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import basicOption from "@/util/basic-option"; |
| | | import FormDialog from "@/views/modelingMenu/ui/formDefine/components/formDialog"; |
| | | import TableDialog from "@/views/modelingMenu/ui/formDefine/components/tableDialog" |
| | | |
| | | export default { |
| | | name: "index" |
| | | name: "index", |
| | | components: {FormDialog, TableDialog}, |
| | | data() { |
| | | return { |
| | | option: { |
| | | ...basicOption, |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false |
| | | }, |
| | | data: [], |
| | | tableRadio: "", |
| | | treeRadio: "0", |
| | | treeData: [], |
| | | treeOption: { |
| | | addBtn: false |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | addClickHandler() { |
| | | if (!this.tableRadio) { |
| | | this.$message.error('请å¨è¡¨æ ¼ä¸æ¹éæ©æ°å¢ç±»å'); |
| | | return; |
| | | } |
| | | |
| | | this.tableRadio === "0" ? this.$refs.formDialog.visible = true : this.$refs.tableDialog.visible = true; |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | |
| | | .el-scrollbar__wrap { |
| | | overflow: auto !important; |
| | | } |
| | | .headerCon{ |
| | | .el-button{ |
| | | |
| | | .headerCon { |
| | | .el-button { |
| | | width: 82px; |
| | | } |
| | | } |
| | |
| | | <template> |
| | | <el-container> |
| | | <el-container v-loading="createdLoading"> |
| | | <el-aside> |
| | | <basic-container> |
| | | <div style="max-height: calc(100vh - 170px);overflow: auto"> |
| | |
| | | </el-button> |
| | | </div> |
| | | <div v-if="form.childType === 0" class="btnBox"> |
| | | <el-button icon="el-icon-edit" plain size="small" type="primary">ä¿®æ¹å«å |
| | | <el-button icon="el-icon-edit" plain size="small" type="primary" @click="updataAliasClickHandler">ä¿®æ¹å«å |
| | | </el-button> |
| | | <el-button icon="el-icon-close" plain size="small" type="danger">å é¤ |
| | | <el-button icon="el-icon-close" plain size="small" type="danger" @click="deleteOperationClickHandler">å é¤ |
| | | </el-button> |
| | | </div> |
| | | </basic-container> |
| | |
| | | <el-button type="primary" @click="methodsSaveClickHandler">ä¿ å</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <!--导å
¥ --> |
| | | <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" fileName="files" title="导å
¥" |
| | | @updata="resetFormValue"></upload-file> |
| | | </el-container> |
| | | </template> |
| | | |
| | |
| | | updateModel, |
| | | delModule, |
| | | exportFunctionSql, |
| | | addOperationType |
| | | addOperationType, |
| | | exportModule, |
| | | updateAlias, |
| | | delFuncOperation |
| | | } from "@/api/systemModel/mangeModel/api" |
| | | import func from "@/util/func"; |
| | | import basicOption from "@/util/basic-option"; |
| | |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | tipList: [], |
| | | upFileType: ['xls', 'xlsx'], |
| | | fileUrl: 'api/hmSysModConfigController/importModule', |
| | | createdLoading: false, |
| | | lastIndex: null, |
| | | methodsList: [], |
| | | methodsData: [], |
| | |
| | | methods: { |
| | | // æ è¡ç¹å» |
| | | nodeClick(row) { |
| | | console.log(row.childType); |
| | | this.form = {...row}; |
| | | this.nodeRow = {...row}; |
| | | this.addStatus = false; |
| | |
| | | |
| | | // æ°å¢æé® |
| | | addClickHandler() { |
| | | this.resetFormValue(); |
| | | // this.resetFormValue(); |
| | | this.defalutName.forEach(key => { |
| | | this.form[key] = null; |
| | | }) |
| | | this.form.isValid = false; |
| | | this.addStatus = true; |
| | | this.editStatus = false; |
| | | }, |
| | | |
| | | // æ¸
空表åç»å®å¼ |
| | | resetFormValue() { |
| | | this.defalutName.forEach(key => { |
| | | this.form[key] = null; |
| | | }) |
| | | this.form.isValid = false; |
| | | this.form = {}; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | }, |
| | | |
| | | // æ°å¢ä¿åæé® |
| | |
| | | return |
| | | } |
| | | if (this.form.name.length > 128) { |
| | | this.$message.error('模ååé¿åº¦è¶
è¿128ï¼'); |
| | | this.$message.error('模ååé¿åº¦ä¸è½è¶
è¿128ï¼'); |
| | | return |
| | | } |
| | | if (this.form.remark && this.form.remark.length > 255) { |
| | | this.$message.error('æè¿°é¿åº¦è¶
è¿255ï¼'); |
| | | this.$message.error('æè¿°é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.resourceDotNet && this.form.resourceDotNet.length > 255) { |
| | | this.$message.error('.NETæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | this.$message.error('.NETæ è¯é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.pathC && this.form.pathC.length > 255) { |
| | | this.$message.error('C/Sæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | this.$message.error('C/Sæ è¯é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.resourceMobile && this.form.resourceMobile.length > 255) { |
| | | this.$message.error('Mobileæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | this.$message.error('Mobileæ è¯é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | this.form.parentId = this.form.id; |
| | |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.addStatus = false; |
| | | // this.resetFormValue(); |
| | | this.form.childType = null; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | |
| | | |
| | | // ä¿®æ¹æé® |
| | | editClickHandler() { |
| | | console.log(this.form); |
| | | this.editStatus = true; |
| | | this.addStatus = false; |
| | | }, |
| | |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.editStatus = false; |
| | | // this.resetFormValue(); |
| | | this.form.childType = null; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | |
| | | type: 'warning' |
| | | }).then(() => { |
| | | delModule(this.form).then(res => { |
| | | console.log(res); |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.resetFormValue(); |
| | | this.addStatus = false; |
| | | this.editStatus = false; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | |
| | | if (res.data.code === 200) { |
| | | this.methodsVisble = false; |
| | | this.$message.success(res.data.msg); |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | this.resetFormValue(); |
| | | this.form.childType = null; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | | }, |
| | |
| | | } |
| | | ); |
| | | }, |
| | | |
| | | // ä¿®æ¹å«å |
| | | updataAliasClickHandler() { |
| | | const params = { |
| | | id: this.form.id, |
| | | isValid: this.form.isValid, |
| | | alias: this.form.alias |
| | | } |
| | | updateAlias(params).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // å 餿¨¡åä¸å
³èçæä½ç±»å |
| | | deleteOperationClickHandler() { |
| | | this.$confirm('æ¨ç¡®å®è¦å é¤æéæ©çæ°æ®åï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | const params = { |
| | | funcId: this.form.funcId, |
| | | operId: this.form.operId |
| | | } |
| | | delFuncOperation(params).then(res => { |
| | | console.log(res); |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.resetFormValue(); |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | // å¯¼åº |
| | | exportClickHandler() { |
| | | this.createdLoading = true; |
| | | exportModule().then(res => { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.createdLoading = false |
| | | this.$message.success('å¯¼åºæå'); |
| | | }).catch(err => { |
| | | this.$message.error(err); |
| | | }) |
| | | }, |
| | | |
| | | // 导å
¥ |
| | | upLoadClickHandler() { |
| | | this.$refs.upload.visible = true; |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <template> |
| | | <el-container> |
| | | <el-container v-loading="createdLoading"> |
| | | <el-aside> |
| | | <basic-container> |
| | | <div style="max-height: calc(100vh - 170px);overflow: auto"> |
| | |
| | | </el-button> |
| | | </div> |
| | | <div v-if="form.childType === 0" class="btnBox"> |
| | | <el-button icon="el-icon-edit" plain size="small" type="primary">ä¿®æ¹å«å |
| | | <el-button icon="el-icon-edit" plain size="small" type="primary" @click="updataAliasClickHandler">ä¿®æ¹å«å |
| | | </el-button> |
| | | <el-button icon="el-icon-close" plain size="small" type="danger">å é¤ |
| | | <el-button icon="el-icon-close" plain size="small" type="danger" @click="deleteOperationClickHandler">å é¤ |
| | | </el-button> |
| | | </div> |
| | | </basic-container> |
| | |
| | | <el-button type="primary" @click="methodsSaveClickHandler">ä¿ å</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <!--导å
¥ --> |
| | | <upload-file ref="upload" fileName="files" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="导å
¥" |
| | | @updata="resetFormValue"></upload-file> |
| | | </el-container> |
| | | </template> |
| | | |
| | |
| | | updateModel, |
| | | delModule, |
| | | exportFunctionSql, |
| | | addOperationType |
| | | addOperationType, |
| | | exportModule, |
| | | updateAlias, |
| | | delFuncOperation |
| | | } from "@/api/systemModel/mangeModel/api" |
| | | import func from "@/util/func"; |
| | | import basicOption from "@/util/basic-option"; |
| | |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | tipList: [], |
| | | upFileType: ['xls', 'xlsx'], |
| | | fileUrl: 'api/hmSysModConfigController/importModule', |
| | | createdLoading: false, |
| | | lastIndex: null, |
| | | methodsList: [], |
| | | methodsData: [], |
| | |
| | | |
| | | // æ°å¢æé® |
| | | addClickHandler() { |
| | | this.resetFormValue(); |
| | | // this.resetFormValue(); |
| | | this.defalutName.forEach(key => { |
| | | this.form[key] = null; |
| | | }) |
| | | this.form.isValid = false; |
| | | this.addStatus = true; |
| | | this.editStatus = false; |
| | | }, |
| | | |
| | | // æ¸
空表åç»å®å¼ |
| | | resetFormValue() { |
| | | this.defalutName.forEach(key => { |
| | | this.form[key] = null; |
| | | }) |
| | | this.form.isValid = false; |
| | | this.form = {}; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | }, |
| | | |
| | | // æ°å¢ä¿åæé® |
| | |
| | | return |
| | | } |
| | | if (this.form.name.length > 128) { |
| | | this.$message.error('模ååé¿åº¦è¶
è¿128ï¼'); |
| | | this.$message.error('模ååé¿åº¦ä¸è½è¶
è¿128ï¼'); |
| | | return |
| | | } |
| | | if (this.form.remark && this.form.remark.length > 255) { |
| | | this.$message.error('æè¿°é¿åº¦è¶
è¿255ï¼'); |
| | | this.$message.error('æè¿°é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.resourceDotNet && this.form.resourceDotNet.length > 255) { |
| | | this.$message.error('.NETæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | this.$message.error('.NETæ è¯é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.pathC && this.form.pathC.length > 255) { |
| | | this.$message.error('C/Sæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | this.$message.error('C/Sæ è¯é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.resourceMobile && this.form.resourceMobile.length > 255) { |
| | | this.$message.error('Mobileæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | this.$message.error('Mobileæ è¯é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | this.form.parentId = this.form.id; |
| | |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.addStatus = false; |
| | | // this.resetFormValue(); |
| | | this.form.childType = null; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | |
| | | |
| | | // ä¿®æ¹æé® |
| | | editClickHandler() { |
| | | console.log(this.form); |
| | | this.editStatus = true; |
| | | this.addStatus = false; |
| | | }, |
| | |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.editStatus = false; |
| | | // this.resetFormValue(); |
| | | this.form.childType = null; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | |
| | | type: 'warning' |
| | | }).then(() => { |
| | | delModule(this.form).then(res => { |
| | | console.log(res); |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.resetFormValue(); |
| | | this.addStatus = false; |
| | | this.editStatus = false; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | |
| | | if (res.data.code === 200) { |
| | | this.methodsVisble = false; |
| | | this.$message.success(res.data.msg); |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | this.resetFormValue(); |
| | | this.form.childType = null; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | | }, |
| | |
| | | } |
| | | ); |
| | | }, |
| | | |
| | | // ä¿®æ¹å«å |
| | | updataAliasClickHandler() { |
| | | const params = { |
| | | id: this.form.id, |
| | | isValid: this.form.isValid, |
| | | alias: this.form.alias |
| | | } |
| | | updateAlias(params).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // å 餿¨¡åä¸å
³èçæä½ç±»å |
| | | deleteOperationClickHandler() { |
| | | console.log(this.form); |
| | | const params = { |
| | | funcId: this.form.funcId, |
| | | operId: this.form.operId |
| | | } |
| | | delFuncOperation(params).then(res => { |
| | | console.log(res); |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.resetFormValue(); |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // å¯¼åº |
| | | exportClickHandler() { |
| | | this.createdLoading = true; |
| | | exportModule().then(res => { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.createdLoading = false |
| | | this.$message.success('å¯¼åºæå'); |
| | | }).catch(err => { |
| | | this.$message.error(err); |
| | | }) |
| | | }, |
| | | |
| | | // 导å
¥ |
| | | upLoadClickHandler() { |
| | | this.$refs.upload.visible = true; |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <el-aside> |
| | | <basic-container> |
| | | <div style="max-height: calc(100vh - 170px);overflow: auto"> |
| | | <avue-tree ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <avue-tree :key="refresh" ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <span slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <span style="font-size: 15px"> |
| | | <i class="el-icon-s-promotion"></i> |
| | |
| | | <el-form-item label="å«åï¼"> |
| | | <el-input v-model="form.alias" placeholder="请è¾å
¥å«å"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="ç¼å·ï¼"> |
| | | <el-input v-model="form.sort" placeholder="请è¾å
¥ç¼å·"></el-input> |
| | | <el-form-item label="顺åºï¼"> |
| | | <el-input-number v-model="form.sort" :min="0" :max="9999" label="顺åº"></el-input-number> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°ï¼"> |
| | | <el-input v-model="form.remark" placeholder="请è¾å
¥æè¿°"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div class="btnBox"> |
| | | <el-button v-if="!addStatus" :disabled="mangeShowBtn ? false : !childTypeBtn" icon="el-icon-plus" plain |
| | | <div v-if="nodeRow.childType === 0 || nodeRow.childType === -1" class="btnBox"> |
| | | <el-button v-if="!addStatus" :disabled="nodeRow.childType === 0" icon="el-icon-plus" plain |
| | | size="small" |
| | | type="primary" @click="addClickHandler">å¢å |
| | | </el-button> |
| | | <el-button v-if="addStatus" icon="el-icon-check" plain size="small" |
| | | type="success" @click="addSaveClickHandler">ä¿å |
| | | </el-button> |
| | | <el-button :disabled="mangeShowBtn" icon="el-icon-edit" plain size="small" type="primary" |
| | | @click="addClickHandler">ä¿®æ¹ |
| | | <el-button v-if="!editStatus" :disabled="nodeRow.childType === -1" icon="el-icon-edit" plain size="small" type="primary" |
| | | @click="editClickHandler">ä¿®æ¹ |
| | | </el-button> |
| | | <el-button :disabled="mangeShowBtn" icon="el-icon-close" plain size="small" type="danger" |
| | | @click="addClickHandler">å é¤ |
| | | <el-button v-if="editStatus" icon="el-icon-check" plain size="small" |
| | | type="success" @click="editSaveClickHandler">ä¿å |
| | | </el-button> |
| | | <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">导å
¥sql |
| | | <el-button :disabled="nodeRow.childType === -1" icon="el-icon-close" plain size="small" type="danger" |
| | | @click="delClickHandler">å é¤ |
| | | </el-button> |
| | | <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="sqlClickExportClick">导åºsql |
| | | </el-button> |
| | | </div> |
| | | </basic-container> |
| | |
| | | |
| | | <script> |
| | | //管çåè½æ¨¡å |
| | | import {getSysModelTreeMenuByPID, addModel} from "@/api/systemModel/mangeModel/api" |
| | | import {exportFunctionSql, getSysModelTreeMenuByPID} from "@/api/systemModel/mangeModel/api" |
| | | import {addOperationType,updateOperationType,delOperationType} from "@/api/systemModel/operateType/api" |
| | | import func from "@/util/func"; |
| | | |
| | | export default { |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | refresh:Math.random(), |
| | | editStatus:false, |
| | | addStatus: false, |
| | | nodeRow: {}, |
| | | form: {}, |
| | |
| | | treeLoad: (node, resolve) => { |
| | | const params = { |
| | | parentId: node.level === 0 ? "operateNode" : node.data.id, |
| | | modeType: node.level === 0 ? "firstNode" : node.data.modeType, |
| | | modeType: node.level === 0 ? 'firstNode' : "", |
| | | } |
| | | getSysModelTreeMenuByPID(params).then(res => { |
| | | resolve(res.data.data.map(item => { |
| | |
| | | created() { |
| | | }, |
| | | computed: { |
| | | /** |
| | | * childType |
| | | * 为-1 å
¨é¨æé®å±ç¤º ç¦ç¨ä¿®æ¹ å é¤ å¢å æä½ç±»å |
| | | * ä¸ä¸º-1 éè å é¤éç³»ç»æ¨¡å å é¤ä¸å¡æ¨¡å |
| | | * 为1æ¶ ç¦ç¨æä½ç±»åã导å
¥ãå¯¼åº |
| | | * 为2æ¶ ç¦ç¨å¢å 导å
¥ å¯¼åº |
| | | * mangeShowBtn 为 true è¯´ææ¯é¡¶å±èç¹ å
¨é¨æé®å±ç¤º ç¦ç¨ä¿®æ¹ å é¤ å¢å æä½ç±»å |
| | | * @returns {Number} |
| | | */ |
| | | mangeShowBtn() { |
| | | return this.form.childType === -1; |
| | | }, |
| | | childTypeBtn() { |
| | | return this.form.childType === 1; |
| | | } |
| | | }, |
| | | methods: { |
| | | // æ è¡ç¹å» |
| | |
| | | this.form = {...row}; |
| | | this.nodeRow = {...row}; |
| | | this.addStatus = false; |
| | | this.editStatus = false; |
| | | }, |
| | | // æ¸
空表åç»å®å¼ |
| | | resetFormValue() { |
| | | this.form = {}; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | }, |
| | | |
| | | |
| | | // æ°å¢æé® |
| | | addClickHandler() { |
| | | for (const key in this.form) { |
| | | if (this.form.hasOwnProperty(key)) { |
| | | this.form[key] = null; |
| | | } |
| | | } |
| | | this.form = {}; |
| | | this.addStatus = true; |
| | | this.editStatus = false; |
| | | }, |
| | | |
| | | // ä¿åæé® |
| | | addSaveClickHandler() { |
| | | console.log(this.form) |
| | | if (!this.form.name) { |
| | | this.$message.error('模ååä¸è½ä¸ºç©º'); |
| | | this.$message.error('åç§°ä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (!this.form.code) { |
| | | this.$message.error('æ è¯ä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (!this.form.alias) { |
| | | this.$message.error('å«åä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (!this.form.sort) { |
| | | this.$message.error('顺åºä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (this.form.name.length > 128) { |
| | | this.$message.error('模ååé¿åº¦è¶
è¿128ï¼'); |
| | | this.$message.error('åç§°é¿åº¦ä¸è½è¶
è¿128ï¼'); |
| | | return |
| | | } |
| | | if (this.form.remark && this.form.remark.length > 255) { |
| | | this.$message.error('æè¿°é¿åº¦è¶
è¿255ï¼'); |
| | | this.$message.error('æè¿°é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.resourceDotNet && this.form.resourceDotNet.length > 255) { |
| | | this.$message.error('.NETæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | if (this.form.alias && this.form.alias.length > 255) { |
| | | this.$message.error('å«åé¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.pathc && this.form.pathc.length > 255) { |
| | | this.$message.error('C/Sæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.resourceMobile && this.form.resourceMobile.length > 255) { |
| | | this.$message.error('Mobileæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | return |
| | | } |
| | | console.log(this.nodeRow); |
| | | this.form.parentId = this.nodeRow.id; |
| | | this.form.modeType = this.nodeRow.modeType; |
| | | addModel(this.form).then(res => { |
| | | console.log(res) |
| | | this.addStatus = false; |
| | | const params = { |
| | | name:this.form.name, |
| | | identify:this.form.code, |
| | | alias:this.form.alias, |
| | | desc:this.form.remark, |
| | | seq:this.form.sort |
| | | } |
| | | addOperationType(params).then(res => { |
| | | if(res.data.code === 200){ |
| | | this.$message.success(res.data.msg); |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | this.addStatus = false; |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | // ä¿®æ¹æé® |
| | | editClickHandler(){ |
| | | this.addStatus = false; |
| | | this.editStatus = true; |
| | | }, |
| | | |
| | | // ä¿®æ¹ä¿å |
| | | editSaveClickHandler(){ |
| | | console.log(this.form); |
| | | if (!this.form.name) { |
| | | this.$message.error('åç§°ä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (!this.form.code) { |
| | | this.$message.error('æ è¯ä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (!this.form.alias) { |
| | | this.$message.error('å«åä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (!this.form.sort) { |
| | | this.$message.error('顺åºä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (this.form.name.length > 128) { |
| | | this.$message.error('åç§°é¿åº¦ä¸è½è¶
è¿128ï¼'); |
| | | return |
| | | } |
| | | if (this.form.remark && this.form.remark.length > 255) { |
| | | this.$message.error('æè¿°é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.alias && this.form.alias.length > 255) { |
| | | this.$message.error('å«åé¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | }; |
| | | const params = { |
| | | id:this.form.id, |
| | | name:this.form.name, |
| | | identify:this.form.code, |
| | | alias:this.form.alias, |
| | | desc:this.form.remark, |
| | | seq:this.form.sort |
| | | } |
| | | updateOperationType(params).then(res => { |
| | | if(res.data.code === 200){ |
| | | this.$message.success(res.data.msg); |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | this.editStatus = false; |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // å é¤ |
| | | delClickHandler(){ |
| | | this.$confirm('æ¨ç¡®å®è¦å é¤æéæ©çæ°æ®åï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | delOperationType(this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.resetFormValue(); |
| | | this.addStatus = false; |
| | | this.editStatus = false; |
| | | this.nodeRow = {}; |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | // 导åºsql |
| | | sqlClickExportClick() { |
| | | exportFunctionSql({isFunction: false}).then(res => { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.$message.success('å¯¼åºæå'); |
| | | }).catch(err => { |
| | | this.$message.error(err); |
| | | }); |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <template> |
| | | <el-container> |
| | | <el-aside> |
| | | <basic-container> |
| | | <div style="max-height: calc(100vh - 170px);overflow: auto"> |
| | | <avue-tree :key="refresh" ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <span slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <span style="font-size: 15px"> |
| | | <i class="el-icon-s-promotion"></i> |
| | | {{ (node || {}).label }} |
| | | </span> |
| | | </span> |
| | | </avue-tree> |
| | | </div> |
| | | </basic-container> |
| | | </el-aside> |
| | | <el-main> |
| | | <basic-container> |
| | | |
| | | <avue-crud |
| | | ref="crud" |
| | | :data="configData" |
| | | :option="nodeRow.id === 'firstNode'? firstOption : configOption" |
| | | :table-loading="configLoading" |
| | | @selection-change="selectChange" |
| | | @row-click="rowClickHandler"> |
| | | <template slot="menuLeft"> |
| | | <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addClickHandler">å¢å |
| | | </el-button> |
| | | <el-button icon="el-icon-close" plain size="small" type="danger" @click="delClickHandler">å é¤ |
| | | </el-button> |
| | | <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">å¯¼åº |
| | | </el-button> |
| | | </template> |
| | | |
| | | <template #menu="{row,index,size}"> |
| | | <el-button icon="el-icon-edit" size="small" type="text" @click.stop="rowEditHandler(row,index)">ç¼è¾ |
| | | </el-button> |
| | | <el-button icon="el-icon-delete" size="small" type="text" @click.stop="rowDeleteHandler(row)">å é¤</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </el-main> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :title="nodeRow.id === 'firstNode' ? 'é
置项åç±»' : 'é
置项'" |
| | | :visible.sync="addVisible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | width="50%" |
| | | @close="addVisibleClose"> |
| | | <el-form ref="form" :model="form" label-width="80px"> |
| | | <el-form-item label="åç§°ï¼"> |
| | | <el-input v-model="form.name"></el-input> |
| | | </el-form-item> |
| | | <el-form-item v-if="nodeRow.id !== 'firstNode'" label="keyï¼"> |
| | | <el-input v-model="form.key"></el-input> |
| | | </el-form-item> |
| | | <el-form-item v-if="nodeRow.id !== 'firstNode'" label="valueï¼"> |
| | | <el-input v-model="form.value"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°ï¼"> |
| | | <el-input v-model="form.desc" type="textarea"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button size="small" @click="addVisibleClose">å æ¶</el-button> |
| | | <el-button size="small" type="primary" @click="addSaveClickHandler">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- 导åºç©¿æ¢æ¡ --> |
| | | <transfer ref="transfer" :left-role-data="leftRoleData" :right-role-data="rightRoleData" |
| | | :select-list="selectList" :top-methods-obj="topMethodsObj" :transferTitle="transferTitle" title="导åº" |
| | | @transferSend="exportSendHandler"> |
| | | </transfer> |
| | | </el-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getAppConfigCategoryInfo, |
| | | getAppConfigDetailsByID, |
| | | addAppConf, |
| | | updateAppConf, |
| | | exportSysConf |
| | | } from "@/api/systemModel/systemConfig/api" |
| | | import basicOption from "@/util/basic-option"; |
| | | import func from "@/util/func"; |
| | | |
| | | export default { |
| | | name: "index" |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | topMethodsObj: { |
| | | select: true, |
| | | all: true, |
| | | page: false |
| | | }, |
| | | transferTitle: ['æªéæ©', '已鿩'], |
| | | leftRoleData: [], |
| | | rightRoleData: [], |
| | | editStatus: false, |
| | | form: { |
| | | name: "", |
| | | desc: "" |
| | | }, |
| | | addVisible: false, |
| | | nodeRow: {}, |
| | | configLoading: false, |
| | | configData: [], |
| | | configOption: { |
| | | ...basicOption, |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | column: [ |
| | | { |
| | | label: 'åç§°', |
| | | prop: 'name', |
| | | sortable: true |
| | | }, |
| | | { |
| | | label: 'key', |
| | | prop: 'key', |
| | | sortable: true |
| | | }, |
| | | { |
| | | label: 'value', |
| | | prop: 'value', |
| | | overHidden: true, |
| | | sortable: true |
| | | }, |
| | | { |
| | | label: 'æè¿°', |
| | | overHidden: true, |
| | | prop: 'desc', |
| | | } |
| | | ] |
| | | }, |
| | | defaultData: [], // é¡¶å±èç¹æ°å¢åèµå¼æ°ç» |
| | | firstOption: { |
| | | ...basicOption, |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | column: [ |
| | | { |
| | | label: 'åç§°', |
| | | prop: 'name', |
| | | sortable: true |
| | | }, |
| | | { |
| | | label: 'æè¿°', |
| | | prop: 'desc', |
| | | } |
| | | ] |
| | | }, |
| | | refresh: Math.random(), |
| | | treeOption: { |
| | | height: 'auto', |
| | | menu: false, |
| | | addBtn: false, |
| | | defaultExpandAll: true, |
| | | props: { |
| | | label: 'name', |
| | | value: 'id', |
| | | children: 'children', |
| | | }, |
| | | }, |
| | | treeData: [ |
| | | { |
| | | name: 'ç³»ç»é
ç½®åç±»', |
| | | id: 'firstNode', |
| | | children: [] |
| | | } |
| | | ], |
| | | selectList: [], |
| | | lastIndex: null |
| | | } |
| | | }, |
| | | created() { |
| | | this.getTreeList(); |
| | | }, |
| | | methods: { |
| | | // å·¦ä¾§æ æ¥è¯¢ |
| | | getTreeList(val) { |
| | | getAppConfigCategoryInfo().then(res => { |
| | | if (res.data.code === 200) { |
| | | const data = res.data.data; |
| | | this.treeData[0].children = data; |
| | | if (val === 'save') { |
| | | this.configData = data; |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // æ èç¹ç¹å» |
| | | nodeClick(row) { |
| | | console.log(row); |
| | | this.nodeRow = row; |
| | | if (row.id === 'firstNode') { |
| | | this.configData = row.children; |
| | | } else { |
| | | this.configLoading = true; |
| | | getAppConfigDetailsByID({clsId: row.id}).then(res => { |
| | | if (res.data.code === 200) { |
| | | const data = res.data.data; |
| | | this.configData = data; |
| | | this.configLoading = false; |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | // å¢å æé® |
| | | addClickHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('è¯·éæ©ä¸æ¡èç¹è¿è¡æ·»å ï¼') |
| | | return; |
| | | } |
| | | this.addVisible = true; |
| | | this.editStatus = false; |
| | | }, |
| | | |
| | | // æ°å¢å¯¹è¯æ¡å
³é |
| | | addVisibleClose() { |
| | | Object.keys(this.form).forEach(key => { |
| | | this.form[key] = ""; |
| | | }) |
| | | this.addVisible = false; |
| | | }, |
| | | |
| | | // ä¿å |
| | | addSaveClickHandler() { |
| | | if (this.nodeRow.id === 'firstNode') { |
| | | if (!this.form.name) { |
| | | this.$message.error('åç§°ä¸è½ä¸ºç©ºï¼'); |
| | | return; |
| | | } |
| | | } else { |
| | | if (!this.form.name) { |
| | | this.$message.error('åç§°ä¸è½ä¸ºç©ºï¼'); |
| | | return; |
| | | } |
| | | if (!this.form.key) { |
| | | this.$message.error('keyå¼ä¸è½ä¸ºç©ºï¼'); |
| | | return; |
| | | } |
| | | if (!this.form.value) { |
| | | this.$message.error('valueå¼ä¸è½ä¸ºç©ºï¼'); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | const params = this.nodeRow.id === 'firstNode' ? { |
| | | appConfigDetailInfo: { |
| | | name: this.form.name, |
| | | desc: this.form.desc, |
| | | id: this.editStatus ? this.form.id : null |
| | | }, |
| | | isConfCategorys: true //true表示ç»é¡¶å±æ·»å é
置项åç±» |
| | | } : { |
| | | appConfigDetailInfo: { |
| | | categoryId: this.nodeRow.id, |
| | | name: this.form.name, |
| | | desc: this.form.desc, |
| | | key: this.form.key, |
| | | value: this.form.value, |
| | | id: this.editStatus ? this.form.id : null |
| | | }, |
| | | isConfCategorys: false //true表示ç»é¡¶å±æ·»å é
置项åç±» |
| | | } |
| | | const saveApi = this.editStatus ? updateAppConf : addAppConf; |
| | | saveApi(params).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.addVisibleClose(); |
| | | if (this.nodeRow.id === 'firstNode') { |
| | | this.getTreeList('save'); |
| | | } else { |
| | | this.configLoading = true; |
| | | getAppConfigDetailsByID({clsId: this.nodeRow.id}).then(res => { |
| | | if (res.data.code === 200) { |
| | | const data = res.data.data; |
| | | this.configData = data; |
| | | this.configLoading = false; |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // ç¼è¾æé® |
| | | rowEditHandler(row) { |
| | | this.addVisible = true; |
| | | this.form = {...row}; |
| | | this.editStatus = true; |
| | | }, |
| | | |
| | | // è¡å é¤ |
| | | rowDeleteHandler(row) { |
| | | const params = { |
| | | ids: row.id, |
| | | isConfCategorys: this.nodeRow.id === 'firstNode' ? true : false |
| | | } |
| | | getAppConfigCategoryInfo(params).then(res => { |
| | | console.log(res) |
| | | if (res.data.code === 200) { |
| | | this.$message.success('å 餿å'); |
| | | if (this.nodeRow.id === 'firstNode') { |
| | | this.getTreeList('save'); |
| | | } else { |
| | | this.configLoading = true; |
| | | getAppConfigDetailsByID({clsId: this.nodeRow.id}).then(res => { |
| | | if (res.data.code === 200) { |
| | | const data = res.data.data; |
| | | this.configData = data; |
| | | this.configLoading = false; |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // éæ©æ¡ |
| | | selectChange(row) { |
| | | this.selectList = row; |
| | | }, |
| | | |
| | | // ç¹å»è¡ |
| | | rowClickHandler(row) { |
| | | func.rowClickHandler( |
| | | row, |
| | | this.$refs.crud, |
| | | this.lastIndex, |
| | | (newIndex) => { |
| | | this.lastIndex = newIndex; |
| | | }, |
| | | () => { |
| | | this.selectList = []; |
| | | } |
| | | ); |
| | | }, |
| | | |
| | | // å¤éå é¤ |
| | | delClickHandler() { |
| | | if (this.selectList.length <= 0) { |
| | | this.$message.error('请è³å°éæ©ä¸æ¡æ°æ®'); |
| | | return; |
| | | } |
| | | const params = { |
| | | ids: this.selectList.map(item => { |
| | | return item.id |
| | | }).join(','), |
| | | isConfCategorys: this.nodeRow.id === 'firstNode' ? true : false |
| | | } |
| | | getAppConfigCategoryInfo(params).then(res => { |
| | | console.log(res) |
| | | if (res.data.code === 200) { |
| | | this.$message.success('å 餿å'); |
| | | if (this.nodeRow.id === 'firstNode') { |
| | | this.getTreeList('save'); |
| | | } else { |
| | | this.configLoading = true; |
| | | getAppConfigDetailsByID({clsId: this.nodeRow.id}).then(res => { |
| | | if (res.data.code === 200) { |
| | | const data = res.data.data; |
| | | this.configData = data; |
| | | this.configLoading = false; |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // å¯¼åºæé® |
| | | exportClickHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('请è³å°éæ©ä¸æ¡æ°æ®'); |
| | | return; |
| | | } |
| | | this.leftRoleData = this.nodeRow.id === 'firstNode' ? [ |
| | | { |
| | | name: 'åç§°', |
| | | oid: 'name' |
| | | }, |
| | | { |
| | | name: 'æè¿°', |
| | | oid: 'desc' |
| | | } |
| | | ] : [ |
| | | { |
| | | name: 'åç§°', |
| | | oid: 'name' |
| | | }, |
| | | { |
| | | name: 'key', |
| | | oid: 'key' |
| | | }, |
| | | { |
| | | name: 'value', |
| | | oid: 'value' |
| | | }, |
| | | { |
| | | name: 'æè¿°', |
| | | oid: 'desc' |
| | | } |
| | | ] |
| | | this.$refs.transfer.visible = true; |
| | | }, |
| | | |
| | | // 导åºä¿å |
| | | exportSendHandler(row, index) { |
| | | console.log(row, index); |
| | | const params = { |
| | | expType: index === 0 ? 'select' : index === 1 ? 'all' : '', |
| | | expAttrNames: row, |
| | | selectDataIdentify: index === 0 ? this.selectList.map(item => { |
| | | return item.id |
| | | }) : null, |
| | | conditionMap: { |
| | | "isExpAppConfDetail": this.nodeRow.id === 'firstNode' ? false : true, |
| | | "clsId": this.nodeRow.id !== 'firstNode' ? this.nodeRow.id : null |
| | | } |
| | | } |
| | | exportSysConf(params).then(res => { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.$message.success('å¯¼åºæå'); |
| | | }).catch(err => { |
| | | this.$message.error(err); |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | |
| | | <template> |
| | | |
| | | <basic-container> |
| | | <div class="container"> |
| | | <el-form ref="form" :model="form" label-width="150px"> |
| | | <el-form-item label="å½åå¨çº¿ç¨æ·äººæ°"> |
| | | <div style="display: flex;"> |
| | | <el-input v-model="form.name" :readOnly="true"></el-input> |
| | | <el-button plain style="margin-left: 10px"> å·æ°</el-button> |
| | | </div> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: "index" |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | form: { |
| | | name: '0' |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | .container { |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | width: 500px; |
| | | height: 500px; |
| | | margin: auto; |
| | | } |
| | | </style> |