Merge remote-tracking branch 'origin/master'
已修改31个文件
已删除1个文件
已添加11个文件
| | |
| | | try { |
| | | for (int sheetIndex = 0; sheetIndex < workbook.getNumberOfSheets(); sheetIndex++) { |
| | | Sheet sheet = workbook.getSheetAt(sheetIndex); |
| | | String sheetName=sheet.getSheetName(); |
| | | if(StringUtils.isNotBlank(excelOption.getSheetName())){ |
| | | if(!sheet.getSheetName().equalsIgnoreCase(excelOption.getSheetName())){ |
| | | continue; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.po; |
| | | |
| | | import com.vci.starter.poi.annotation.ExcelColumn; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | /** |
| | | * 表å/è¡¨æ ¼å¯¼å
¥è½¬æ¢å¯¹è±¡ |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class PortalVIPO implements java.io.Serializable { |
| | | |
| | | private static final long serialVersionUID = -4958371880356252841L; |
| | | |
| | | /** |
| | | * æå¨æ°æ®è¡ |
| | | */ |
| | | @ExcelColumn(rowIndexColumn = true,value = "") |
| | | private String rowIndex; |
| | | |
| | | /** |
| | | * ä¸å¡ç±»ååç§° |
| | | */ |
| | | @ExcelColumn(value="ä¸å¡ç±»ååç§°",nullable = false) |
| | | private String typeName; |
| | | |
| | | /** |
| | | * åç§° |
| | | */ |
| | | @ExcelColumn(value="åç§°",nullable = false) |
| | | private String viName; |
| | | |
| | | /** |
| | | *ä¸å¡ç±»å |
| | | */ |
| | | private short typeFlag; |
| | | /** |
| | | * ä¸å¡ç±»å |
| | | */ |
| | | @ExcelColumn(value="ä¸å¡ç±»å",nullable = false) |
| | | private String typeFlagText; |
| | | |
| | | /*** |
| | | * 表åç±»å |
| | | */ |
| | | private short viType; |
| | | /*** |
| | | * 表åç±»å |
| | | */ |
| | | @ExcelColumn(value="表åç±»å",nullable = false) |
| | | private String viTypeText; |
| | | /*** |
| | | * é
ç½®ä¿¡æ¯ |
| | | */ |
| | | private String prm; |
| | | /** |
| | | * é
ç½®ææ¬ |
| | | */ |
| | | @ExcelColumn(value="é
ç½®ææ¬") |
| | | private String prmFileName; |
| | | /*** |
| | | * 屿§ |
| | | */ |
| | | @ExcelColumn(value="屿§" ,nullable = false) |
| | | private String attributeKey; |
| | | /*** |
| | | * æ¥è¯¢æ¨¡æ¿åç§° |
| | | */ |
| | | @ExcelColumn(value="æ¥è¯¢æ¨¡æ¿åç§°" ) |
| | | private String qtName; |
| | | |
| | | /*** |
| | | * æ¥è¯¢æ¨¡æ¿é
ç½®ææ¬ |
| | | */ |
| | | @ExcelColumn(value="æ¥è¯¢æ¨¡æ¿é
ç½®ææ¬" ) |
| | | private String qtNameFile; |
| | | /*** |
| | | * æ¥è¯¢æ¨¡æ¿ä¸å¡ç±»å |
| | | */ |
| | | @ExcelColumn(value="æ¥è¯¢æ¨¡æ¿ä¸å¡ç±»å" ) |
| | | private String qtNameType; |
| | | |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.po; |
| | | |
| | | import com.vci.starter.poi.annotation.ExcelColumn; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | /** |
| | | * 表å/è¡¨æ ¼å¯¼å
¥è½¬æ¢å¯¹è±¡ |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class QTDPO implements java.io.Serializable { |
| | | |
| | | private static final long serialVersionUID = 8774827411052362064L; |
| | | /** |
| | | * æå¨æ°æ®è¡ |
| | | */ |
| | | @ExcelColumn(rowIndexColumn = true,value = "") |
| | | private String rowIndex; |
| | | |
| | | /** |
| | | * ä¸å¡ç±»ååç§° |
| | | */ |
| | | @ExcelColumn(value="ä¸å¡ç±»ååç§°") |
| | | private String typeName; |
| | | /** |
| | | * 龿¥ç±»ååç§° |
| | | */ |
| | | @ExcelColumn(value="龿¥ç±»ååç§°") |
| | | private String linkType; |
| | | |
| | | /** |
| | | *æ¥è¯¢æ¨¡æ¿å®ä¹åç§° |
| | | */ |
| | | @ExcelColumn(value="æ¥è¯¢æ¨¡æ¿å®ä¹åç§°" ) |
| | | private String QtdName; |
| | | |
| | | /*** |
| | | * 屿§ |
| | | */ |
| | | @ExcelColumn(value="屿§" ) |
| | | private String attributeKey; |
| | | |
| | | } |
| | |
| | | setOid(oid); |
| | | setText(text); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æé 彿° |
| | | * @param oid ä¸»é® |
| | | * @param text æ èç¹ææ¬ |
| | | */ |
| | | public Tree(String oid, String text,Object o){ |
| | | setOid(oid); |
| | | setText(text); |
| | | setData(o); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | |
| | | * åèç¹ |
| | | */ |
| | | private List<Tree> children = new ArrayList<Tree>(); |
| | | /** |
| | | * å±çº§ |
| | | */ |
| | | private int level; |
| | | /** |
| | | * 徿 |
| | | */ |
| | |
| | | * æåºç´¢å¼ |
| | | */ |
| | | private String index;//æåºç´¢å¼ |
| | | /*** |
| | | * å½åæ°æ®å¯¹è±¡ |
| | | */ |
| | | private Object data; |
| | | |
| | | /** |
| | | * å
¶ä»ç屿§ |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | public Object getData() { |
| | | return data; |
| | | } |
| | | |
| | | public void setData(Object data) { |
| | | this.data = data; |
| | | } |
| | | |
| | | public int getLevel() { |
| | | return level; |
| | | } |
| | | |
| | | public void setLevel(int level) { |
| | | this.level = level; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "Tree{" + |
| | |
| | | ", showCheckbox=" + showCheckbox + |
| | | ", checked=" + checked + |
| | | ", children=" + children + |
| | | ", level=" + level + |
| | | ", icon='" + icon + '\'' + |
| | | ", iconCls='" + iconCls + '\'' + |
| | | ", parentId='" + parentId + '\'' + |
| | |
| | | ", expanded=" + expanded + |
| | | ", href='" + href + '\'' + |
| | | ", index='" + index + '\'' + |
| | | ", data=" + data + |
| | | ", attributes=" + attributes + |
| | | '}'; |
| | | } |
| | |
| | | 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; |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.vci.starter.web.pagemodel.BaseQueryObject; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.pagemodel.OsAttributeVO; |
| | | import com.vci.starter.web.pagemodel.Tree; |
| | | import com.vci.starter.web.pagemodel.TreeQueryObject; |
| | | import com.vci.starter.web.util.ControllerUtil; |
| | | import com.vci.starter.web.util.LocalFileUtil; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | |
| | | */ |
| | | private Logger logger = LoggerFactory.getLogger(getClass()); |
| | | |
| | | |
| | | |
| | | /** |
| | | * è·åææä¸å¡ç±»åï¼æ å½¢ç»æï¼ |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | @GetMapping( "/getTreeAttributes") |
| | | @VciBusinessLog(operateName = "è·å屿§ï¼æ å½¢ç»æï¼") |
| | | public BaseResult<List<Tree>> getTreeAttributesByBtmName(TreeQueryObject treeQueryObject){ |
| | | try { |
| | | List<Tree> trees= attributeService.getTreeAttributesByBtmName(treeQueryObject); |
| | | return BaseResult.dataList(trees); |
| | | // return BaseResult.tree(trees); |
| | | }catch (Throwable e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "æ¥è¯¢ä¸å¡ç±»åæ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 屿§å表 |
| | | * @param baseQueryObject æ¥è¯¢å¯¹è±¡ |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.vci.web.controller; |
| | | |
| | | import com.vci.constant.FrameWorkLangCodeConstant; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.dto.ClonePortalVIDTOList; |
| | | import com.vci.dto.DeletePortalVIDTOList; |
| | | import com.vci.dto.OsBtmTypeDTO; |
| | | import com.vci.dto.PortalVIDTO; |
| | | import com.vci.pagemodel.KeyValue; |
| | | 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.DataGrid; |
| | | import com.vci.starter.web.util.ControllerUtil; |
| | | import com.vci.starter.web.util.LangBaseUtil; |
| | | import com.vci.starter.web.util.LocalFileUtil; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.web.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 org.springframework.web.multipart.MultipartFile; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.FileNotFoundException; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.List; |
| | |
| | | /** |
| | | * å¯¼åºæ°æ®åºç表信æ¯å°excel |
| | | * @param response ååºå¯¹è±¡ |
| | | * @param btmTypeIds ä¸å¡ç±»åçç¼å·ï¼ç¨éå·åå² |
| | | * @param ids ä¸å¡ç±»åçç¼å·ï¼ç¨éå·åå² |
| | | */ |
| | | @PostMapping("/exportExcel") |
| | | @VciBusinessLog(operateName = "导åºè¡¨å/è¡¨æ ¼å°excelä¸") |
| | | public void exportExcel(String btmTypeIds,HttpServletResponse response){ |
| | | String excelFileName = portalVIServiceI.exportToExcel(VciBaseUtil.str2List(btmTypeIds)); |
| | | public void exportExcel(String ids,HttpServletResponse response){ |
| | | String excelFileName = portalVIServiceI.exportToExcel(VciBaseUtil.str2List(ids)); |
| | | try { |
| | | ControllerUtil.writeFileToResponse(response,excelFileName); |
| | | } catch (IOException e) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å¯¼åºæ°æ®åºç表信æ¯å°excel |
| | | * @param file ä¸ä¼ çæä»¶ |
| | | */ |
| | | @PostMapping("/importData") |
| | | @VciBusinessLog(operateName = "导å
¥è¡¨å/è¡¨æ ¼") |
| | | public BaseResult importData(MultipartFile file){ |
| | | String excelFileName = LocalFileUtil.getDefaultTempFolder() + File.separator + LocalFileUtil.getFileNameForIE(file.getOriginalFilename()); |
| | | File file1 = new File(excelFileName); |
| | | try { |
| | | file.transferTo(new File(excelFileName)); |
| | | if (file != null) { |
| | | return portalVIServiceI.importData(file1); |
| | | } else { |
| | | return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"æ 导å
¥çæä»¶"}); |
| | | } |
| | | }catch (Throwable e) { |
| | | throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e); |
| | | }finally { |
| | | file1.delete(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·å屿§å段类å |
| | | */ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.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; |
| | | } |
| | |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.omd.atm.AttributeDef; |
| | | import com.vci.dto.OsAttributeDTO; |
| | | import com.vci.starter.web.pagemodel.BaseQueryObject; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.starter.web.pagemodel.DataGrid; |
| | | import com.vci.starter.web.pagemodel.*; |
| | | import com.vci.pagemodel.OsAttributeVO; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | |
| | | */ |
| | | public interface OsAttributeServiceI extends OsBaseServiceI{ |
| | | |
| | | /** |
| | | * è·åæ ç¶ |
| | | * @param treeQueryObject |
| | | * @return |
| | | */ |
| | | List<Tree> getTreeAttributesByBtmName(TreeQueryObject treeQueryObject); |
| | | /** |
| | | * è·åé»è®¤ç屿§ |
| | | * @return é»è®¤ç屿§å表 |
| | |
| | | */ |
| | | boolean isDefaultAttr(String attr); |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸å¡ç±»å/龿¥ç±»åè·å屿§ä¿¡æ¯ |
| | | * @param btName ä¸å¡ç±»å/龿¥ç±»å |
| | | * @param typeFlag 0:ä¸å¡ç±»å,1:龿¥ç±»å |
| | | * @param isDefault æ¯å¦å
å«é»è®¤å±æ§ trueï¼å
å«ï¼false ä¸å
å« |
| | | * @return |
| | | */ |
| | | List<OsAttributeVO> getOsAttributeVOSByBtName(String btName,int typeFlag,boolean isDefault)throws Exception; |
| | | |
| | | } |
| | |
| | | * @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; |
| | | } |
| | |
| | | import com.vci.starter.web.pagemodel.BaseQueryObject; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.starter.web.pagemodel.DataGrid; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | String exportToExcel(Collection<String> idList); |
| | | |
| | | /** |
| | | * 导å
¥è¡¨å/è¡¨æ ¼æ°æ® |
| | | * @param file ä¸ä¼ çæä»¶ |
| | | * @return |
| | | */ |
| | | public BaseResult importData(File file)throws Throwable; |
| | | /** |
| | | *æ¥è¯¢ææè¡¨åæè
è¡¨æ ¼ |
| | | * @return key æ¯çå½å¨æçç¼å·çè±æå°å |
| | | * @throws VciBaseException æ¥è¯¢çæ¶ååºé伿åºå¼å¸¸ |
| | |
| | | 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åè¡¨æ°æ® |
| | |
| | | import com.vci.client.mw.ClientSessionUtility; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.omd.atm.AttributeDef; |
| | | import com.vci.corba.omd.ltm.LinkType; |
| | | import com.vci.corba.omd.vrm.VersionRule; |
| | | import com.vci.dto.OsAttributeDTO; |
| | | import com.vci.dto.OsEnumDTO; |
| | | import com.vci.dto.OsEnumItemDTO; |
| | | import com.vci.omd.dataType.VTDataType; |
| | | import com.vci.pagemodel.OsEnumItemVO; |
| | | import com.vci.pagemodel.OsEnumVO; |
| | | import com.vci.pagemodel.OsUsedAttributeVO; |
| | | import com.vci.omd.objects.OtherInfo; |
| | | import com.vci.pagemodel.*; |
| | | import com.vci.po.OsAttributePO; |
| | | import com.vci.po.OsEnumPO; |
| | | import com.vci.starter.poi.bo.ReadExcelOption; |
| | |
| | | import com.vci.starter.web.annotation.log.VciUnLog; |
| | | import com.vci.starter.web.enumpck.VciFieldTypeEnum; |
| | | 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.pagemodel.*; |
| | | import com.vci.starter.web.util.*; |
| | | import com.vci.model.OsAttributeDO; |
| | | import com.vci.pagemodel.OsAttributeVO; |
| | | import com.vci.web.enumpck.PortalVITypeFlag; |
| | | import com.vci.web.properties.UsedNames; |
| | | import com.vci.web.service.OsAttributeServiceI; |
| | | import com.vci.web.service.OsBaseServiceI; |
| | |
| | | * é»è®¤å±æ§çæ å°ï¼keyæ¯å°å |
| | | */ |
| | | private static Map<String,OsAttributeVO> defaultAttributeVOMap = new HashMap<>(); |
| | | |
| | | @Override |
| | | public List<Tree> getTreeAttributesByBtmName(TreeQueryObject treeQueryObject) { |
| | | List<Tree> rootTreeList=new ArrayList<>(); |
| | | |
| | | Map<String, String> conditionMap = treeQueryObject.getConditionMap(); |
| | | if (conditionMap == null) { |
| | | conditionMap = new HashMap<>(); |
| | | } |
| | | String typeName = StringUtils.isBlank(conditionMap.get("typeName")) ? "" : conditionMap.get("typeName"); |
| | | if (StringUtils.isBlank(typeName)) { |
| | | VciBaseUtil.alertNotNull(typeName,"ä¸å¡ç±»ååç§°"); |
| | | } |
| | | try { |
| | | String typeFlag=StringUtils.isBlank(conditionMap.get("typeFlag"))?"":conditionMap.get("typeFlag"); |
| | | PortalVITypeFlag portalVITypeFlag= PortalVITypeFlag.getByName(typeFlag); |
| | | Short viTypeFlag=-1; |
| | | if(portalVITypeFlag!=null){ |
| | | viTypeFlag=portalVITypeFlag.getIntVal(); |
| | | } |
| | | boolean isDefault =Boolean.parseBoolean(conditionMap.get("isDefault")); |
| | | Tree tree = new Tree("root", "ã" + typeName + "ã屿§ä¿¡æ¯", "root"); |
| | | tree.setLevel(0); |
| | | rootTreeList.add(tree); |
| | | getChildTree(rootTreeList,typeName, viTypeFlag,isDefault); |
| | | }catch (Throwable e){ |
| | | e.printStackTrace(); |
| | | } |
| | | return rootTreeList; |
| | | } |
| | | |
| | | /** |
| | | * å¤ç屿§æ èç¹ |
| | | * @param parentTreeList |
| | | * @param refTypeName |
| | | * @param refFlag |
| | | * @param isDefault |
| | | * @throws Exception |
| | | */ |
| | | private void getChildTree(List<Tree> parentTreeList,String refTypeName,int refFlag,boolean isDefault) throws Exception { |
| | | for (Tree pTree : parentTreeList) { |
| | | if (pTree.getLevel()>= 3) { |
| | | continue; |
| | | } |
| | | Object o= pTree.getData(); |
| | | String pName=pTree.getText(); |
| | | boolean isOsAttributeVO=false; |
| | | if(o instanceof OsAttributeVO){ |
| | | isOsAttributeVO=true; |
| | | OsAttributeVO osAttributeVO=(OsAttributeVO)o; |
| | | String other = osAttributeVO.getOther(); |
| | | OtherInfo otherInfo = OtherInfo.getOtherInfoByText(other); |
| | | refFlag = otherInfo.getRefFlag(); |
| | | refTypeName = otherInfo.getRefTypeName(); |
| | | } |
| | | List<OsAttributeVO> childOsAttributeVOList=new ArrayList<>(); |
| | | if (refFlag != -1) { |
| | | // pName: 为åç
§å±æ§åå ä¸è·¯å¾ |
| | | childOsAttributeVOList=getOsAttributeVOSByBtName(refTypeName,refFlag,isDefault); |
| | | if(!CollectionUtils.isEmpty(childOsAttributeVOList)) { |
| | | List<Tree> childTreeList= new ArrayList<>(); |
| | | boolean finalIsOsAttributeVO = isOsAttributeVO; |
| | | childOsAttributeVOList.stream().forEach(childOsAttributeVO->{ |
| | | Tree childTree = new Tree(childOsAttributeVO.getOid(), childOsAttributeVO.getId(), childOsAttributeVO); |
| | | childTree.setOid(childOsAttributeVO.getOid()); |
| | | childTree.setParentName(pTree.getText()); |
| | | childTree.setParentId(pTree.getOid()); |
| | | childTree.setLevel(pTree.getLevel()+1); |
| | | childTree.setLeaf(true); |
| | | if(finalIsOsAttributeVO) { |
| | | childTree.setText(pName + "." + childOsAttributeVO.getId()); |
| | | }else{ |
| | | childTree.setText(childOsAttributeVO.getId()); |
| | | } |
| | | if (childTree.getLevel()>= 3) { |
| | | childTree.setLeaf(true); |
| | | } |
| | | childTreeList.add(childTree); |
| | | }); |
| | | if(childTreeList.size()>0){ |
| | | pTree.setChildren(childTreeList); |
| | | pTree.setExpanded(false); |
| | | getChildTree(childTreeList,refTypeName,refFlag,isDefault); |
| | | }else{ |
| | | pTree.setLeaf(true); |
| | | pTree.setExpanded(true); |
| | | } |
| | | |
| | | } |
| | | }else{ |
| | | pTree.setExpanded(true); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * è·åé»è®¤ç屿§ |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸å¡ç±»åè·å屿§ä¿¡æ¯ |
| | | * @param btName ä¸å¡ç±»å/龿¥ç±»å |
| | | * @param typeFlag 0:ä¸å¡ç±»å,1:龿¥ç±»å |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<OsAttributeVO> getOsAttributeVOSByBtName(String btName, int typeFlag,boolean isDefault) throws Exception{ |
| | | VciBaseUtil.alertNotNull(btName,"åæ°ä¸å
许为空",typeFlag,"åæ°ä¸å
许为空"); |
| | | List<OsAttributeVO> attributeVOS=new ArrayList<>(); |
| | | |
| | | try { |
| | | List<AttributeDef> attributeDefList=new ArrayList<>(); |
| | | if(typeFlag==0){ |
| | | AttributeDef [] attributeDefs= platformClientUtil.getBtmService().getAttributeDefs(btName); |
| | | if(attributeDefs!=null){ |
| | | attributeDefList.addAll(Arrays.stream(attributeDefs).collect(Collectors.toList())); |
| | | } |
| | | if(isDefault){ |
| | | AttributeDef [] sysAttributeDefs=platformClientUtil.getBtmService().getSysAttributeDefs(); |
| | | if(sysAttributeDefs!=null){ |
| | | attributeDefList.addAll(Arrays.stream(sysAttributeDefs).collect(Collectors.toList())); |
| | | } |
| | | } |
| | | }else{ |
| | | AttributeDef [] attributeDefs=platformClientUtil.getLinkTypeService().getAttributes(btName); |
| | | if(attributeDefs!=null){ |
| | | attributeDefList.addAll(Arrays.stream(attributeDefs).collect(Collectors.toList())); |
| | | } |
| | | if(isDefault){ |
| | | AttributeDef[] sysAbItems = platformClientUtil.getLinkTypeService().getSysAttributeDefs(); |
| | | if(sysAbItems!=null){ |
| | | attributeDefList.addAll(Arrays.stream(sysAbItems).collect(Collectors.toList())); |
| | | } |
| | | } |
| | | } |
| | | attributeVOS=attributeDO2VOs(attributeDefList); |
| | | }catch (PLException e){ |
| | | throw new Exception("æ ¹æ®ä¸å¡ç±»åè·å屿§å¼å¸¸"+e.getMessage()); |
| | | } |
| | | |
| | | return attributeVOS; |
| | | } |
| | | |
| | | /** |
| | | * æ¯å¦ä¸ºåç
§å±æ§ |
| | | * @param other é
ç½®çå
¶ä» |
| | | * @return true æ¯åç
§ |
| | |
| | | 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.constant.FrameWorkLangCodeConstant; |
| | | 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.po.PortalVIPO; |
| | | import com.vci.po.QTDPO; |
| | | import com.vci.starter.poi.bo.ReadExcelOption; |
| | | import com.vci.starter.poi.bo.WriteExcelData; |
| | | import com.vci.starter.web.enumpck.VciFieldTypeEnum; |
| | | 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.other.BtmQTExportData; |
| | | 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.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | 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() { |
| | | |
| | |
| | | dataGrid.setData(portalVIVOS); |
| | | dataGrid.setTotal(pagePortalVIArrayByPageInfoResult.total); |
| | | }else{ |
| | | dataGrid = new DataGrid<>("æ²ææ¥è¯¢å°æ°æ®"); |
| | | dataGrid = new DataGrid<>(); |
| | | } |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | |
| | | */ |
| | | @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()) { |
| | |
| | | short typeFlag = clonedestObject.getTypeFlag(); |
| | | if (viName != null) { |
| | | VciBaseUtil.alertNotNull(viName, "å
éåç§°ä¸å
许为空"); |
| | | //throw new PLException("1001",new String[]{"è¯·éæ©è¦å é¤ç对象ï¼}"}); |
| | | if( PortalVIMap.containsKey(viName)){ |
| | | throw new VciBaseException("å
éåç§°"+viName+"å·²åå¨ï¼è¯·æ ¸å¯¹ï¼"); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public String exportToExcel(Collection<String> idList) { |
| | | /*List<PortalVIVO> portalVIVOList= listByIds(idList); |
| | | String defaultTempFolder = LocalFileUtil.getDefaultTempFolder(); |
| | | String xfileName="export.xls"; |
| | | List<WriteExcelData> rowDataList = new ArrayList<>(); |
| | | final int[] index = {0}; |
| | | if(!CollectionUtils.isEmpty(portalVIVOList)) { |
| | | portalVIVOList.stream().forEach(PortalVIVO -> { |
| | | //å
æ¯åç§° |
| | | int rowIndex = index[0]; |
| | | WriteExcelData idED = new WriteExcelData(rowIndex, 0, btmId); |
| | | idED.setMerged(true); |
| | | if (attributeVOS.size() > 0) { |
| | | idED.setRowTo(rowIndex + attributeVOS.size() - 1 + 3); |
| | | } |
| | | rowDataList.add(idED); |
| | | List<WriteExcelData> qtRowDataList = new ArrayList<>(); |
| | | //VciBaseUtil.alertNotNull(idList); |
| | | List<PortalVIDTO> portalVIDTOList= listByIds(idList); |
| | | final int index=0; |
| | | |
| | | WriteExcelData nameED = new WriteExcelData(rowIndex, 1, btmTypeVO.getName()); |
| | | nameED.setMerged(true); |
| | | if (attributeVOS.size() > 0) { |
| | | nameED.setRowTo(rowIndex + attributeVOS.size() - 1 + 3); |
| | | } |
| | | rowDataList.add(nameED); |
| | | 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(rowIndex, 2, "id")); |
| | | rowDataList.add(new WriteExcelData(rowIndex, 3, "ç¼å·")); |
| | | rowDataList.add(new WriteExcelData(rowIndex, 4, "å符串")); |
| | | rowDataList.add(new WriteExcelData(rowIndex, 5, "æ¯")); |
| | | rowDataList.add(new WriteExcelData(rowIndex, 6, "50")); |
| | | rowIndex++; |
| | | rowDataList.add(new WriteExcelData(rowIndex, 2, "name")); |
| | | rowDataList.add(new WriteExcelData(rowIndex, 3, "åç§°")); |
| | | rowDataList.add(new WriteExcelData(rowIndex, 4, "å符串")); |
| | | rowDataList.add(new WriteExcelData(rowIndex, 5, "æ¯")); |
| | | rowDataList.add(new WriteExcelData(rowIndex, 6, "50")); |
| | | rowIndex++; |
| | | rowDataList.add(new WriteExcelData(rowIndex, 2, "description")); |
| | | rowDataList.add(new WriteExcelData(rowIndex, 3, "æè¿°")); |
| | | rowDataList.add(new WriteExcelData(rowIndex, 4, "å符串")); |
| | | rowDataList.add(new WriteExcelData(rowIndex, 5, "æ¯")); |
| | | rowDataList.add(new WriteExcelData(rowIndex, 6, "150")); |
| | | //å¤ç屿§ |
| | | rowIndex++; |
| | | for (int i = 0; i < attributeVOS.size(); i++) { |
| | | OsBtmTypeAttributeVO attributeVO = attributeVOS.get(i); |
| | | //å
æ¯å±æ§çè±æåç§° |
| | | rowDataList.add(new WriteExcelData(rowIndex, 2, attributeVO.getId())); |
| | | //ç¶å屿§ç䏿åç§° |
| | | rowDataList.add(new WriteExcelData(rowIndex, 3, attributeVO.getName())); |
| | | //屿§çç±»å |
| | | rowDataList.add(new WriteExcelData(rowIndex, 4, VciFieldTypeEnum.getTextByValue(attributeVO.getAttributeDataType()))); |
| | | //æ¯å¦å¯ä»¥ä¸ºç©º |
| | | rowDataList.add(new WriteExcelData(rowIndex, 5, attributeVO.isNullableFlag() ? "æ¯" : "å¦")); |
| | | //屿§é¿åº¦ |
| | | String length = attributeVO.getAttributeLength()==null?"":attributeVO.getAttributeLength() + "" ; |
| | | if (attributeVO.getPrecisionLength() != null) { |
| | | length = length + "(" + attributeVO.getPrecisionLength() + "," + attributeVO.getScaleLength() == null ? "2" : (attributeVO.getScaleLength() + "") + ")" ; |
| | | |
| | | 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]++; |
| | | }); |
| | | |
| | | } |
| | | rowDataList.add(new WriteExcelData(rowIndex, 6, length)); |
| | | //夿³¨ |
| | | rowDataList.add(new WriteExcelData(rowIndex, 7, attributeVO.getDescription() == null ? "" : attributeVO.getDescription())); |
| | | rowIndex++; |
| | | } |
| | | } 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; |
| | | if (portalVIDTO.getViType() == PortalVIType.Table.getIntVal()) {//妿坼å
¥çtableï¼åéè¦æ ¡éªè¡¨æ ¼å
³èçè¡¨åæ¯å¦åå¨ï¼å¦æä¸åå¨åå¨execl䏿¯å¦åå¨ |
| | | PortalVI[] pvs = platformClientUtil.getPortalService().getPortalVIArrayByTypeName(portalVIDTO.getTypeName()); |
| | | PRMDTO prmdto= portalVIDTO.getPrm(); |
| | | List<PRMItemDTO> prmItemDTOS= prmdto.getPrmItemList(); |
| | | if (!CollectionUtils.isEmpty(Arrays.asList(pvs))) { |
| | | Optional.ofNullable(prmItemDTOS).orElseGet(()->new ArrayList<>()).stream().forEach(prmItemDTO -> { |
| | | Arrays.stream(pvs).forEach(pv -> { |
| | | if (prmItemDTO.getItemInObj().equals(pv.typeName + ":" + pv.viName)) { |
| | | prmItemDTO.setItemInObj(pv.id); |
| | | } |
| | | }); |
| | | |
| | | }); |
| | | } |
| | | } |
| | | 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(),false); |
| | | 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(); |
| | | } |
| | | |
| | | index[0] = rowIndex; |
| | | rowIndex[0]++; |
| | | }); |
| | | } |
| | | */ |
| | | |
| | | return null; |
| | | |
| | | /* 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(); |
| | | } |
| | | |
| | | public List<PortalVIVO> listByIds(Collection idList){ |
| | | List<PortalVIVO> portalVIVOList=new ArrayList<>(); |
| | | @Override |
| | | public BaseResult importData(File file)throws Throwable{ |
| | | if (file == null) { |
| | | return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"æ 导å
¥çæä»¶"}); |
| | | } |
| | | try { |
| | | File unzip = ZipUtil.unzip(file); |
| | | String filePath=unzip.getAbsolutePath() + File.separator + "export.xls"; |
| | | File btmExcel = new File(filePath); |
| | | List<PortalVIPO> portalVIPOList=new ArrayList<>(); |
| | | List<QTDPO> QTDPOPOList=new ArrayList<>(); |
| | | try { |
| | | ReadExcelOption PortalVIPOReadExcelOption=new ReadExcelOption(); |
| | | PortalVIPOReadExcelOption.setSheetName("portalvi"); |
| | | PortalVIPOReadExcelOption.setSheetIndex(0); |
| | | portalVIPOList = ExcelUtil.readDataObjectFromExcel(btmExcel, PortalVIPO.class,PortalVIPOReadExcelOption); |
| | | //ä»execlè·åæ¥è¯¢æ¨¡æ¿å®ä¹. |
| | | /* ReadExcelOption QTDPOReadExcelOption=new ReadExcelOption(); |
| | | QTDPOReadExcelOption.setSheetName("QTD"); |
| | | QTDPOReadExcelOption.setSheetIndex(1); |
| | | QTDPOPOList = ExcelUtil.readDataObjectFromExcel(btmExcel, QTDPO.class,QTDPOReadExcelOption);*/ |
| | | }catch (VciBaseException e){ |
| | | throw new Throwable("读åexeclæ°æ®åºéï¼"+e.getMessage()); |
| | | } |
| | | List<PortalVI> portalVIList=new ArrayList<>(); |
| | | if(!CollectionUtils.isEmpty(portalVIPOList)){ |
| | | Map<String,String>formNameMap=new HashMap<>(); |
| | | StringBuffer checkInObj=new StringBuffer(); |
| | | StringBuffer checkPortalVI=new StringBuffer(); |
| | | List<String> sjkExitsList=new ArrayList<>(); |
| | | portalVIPOList.stream().forEach(portalVIPO -> { |
| | | PortalVI portalVI=new PortalVI(); |
| | | String ploid = ObjectUtility.getNewObjectID36(); |
| | | portalVI.id=ploid; |
| | | portalVI.viName=portalVIPO.getViName(); |
| | | portalVI.typeName=portalVIPO.getTypeName(); |
| | | portalVI.viType=PortalVIType.getByLabel(portalVIPO.getViTypeText()).getIntVal(); |
| | | portalVI.typeFlag=PortalVITypeFlag.getByLabel(portalVIPO.getTypeFlagText()).getIntVal(); |
| | | String fileName= portalVIPO.getPrmFileName(); |
| | | String prmStr = readLines(filePath+"."+fileName); |
| | | try { |
| | | PortalVI[] pvs = platformClientUtil.getPortalService().getPortalVIArrayByTypeName(portalVI.typeName); |
| | | if (portalVI.viType == PortalVIType.Table.getIntVal()) {//妿坼å
¥çtableï¼åéè¦æ ¡éªè¡¨æ ¼å
³èçè¡¨åæ¯å¦åå¨ï¼å¦æä¸åå¨åå¨execl䏿¯å¦åå¨ |
| | | formNameMap.put(portalVI.typeName + ":" + portalVI.viName, ploid); |
| | | PRMDO prmObj = UITools.getPRM(prmStr); |
| | | List<PRMItemDO> prmItemList = prmObj.getPrmItemList(); |
| | | |
| | | if (!CollectionUtils.isEmpty(prmItemList)) { |
| | | prmItemList.stream().forEach(prmItemDO -> { |
| | | if (!CollectionUtils.isEmpty(Arrays.asList(pvs))) { |
| | | Arrays.stream(pvs).forEach(pv -> { |
| | | if (prmItemDO.getItemInObj().equals(portalVI.typeName + ":" + pv.viName)) { |
| | | prmItemDO.setItemInObj(pv.id); |
| | | } |
| | | }); |
| | | } else { |
| | | if (formNameMap.containsKey(prmItemDO.getItemInObj())) { |
| | | prmItemDO.setItemInObj(formNameMap.get(prmItemDO.getItemInObj())); |
| | | } else { |
| | | if (!checkInObj.toString().contains(prmItemDO.getItemInObj())) { |
| | | String[] split = prmItemDO.getItemInObj().split(":"); |
| | | checkInObj.append(split[1]).append(","); |
| | | } |
| | | } |
| | | } |
| | | |
| | | }); |
| | | } |
| | | prmStr = UITools.getPRMText(prmObj); |
| | | } |
| | | portalVI.prm = prmStr.trim(); |
| | | //æ ¡éªè¡¨åæ¯å¦åå¨ |
| | | if (!CollectionUtils.isEmpty(Arrays.asList(pvs))) { |
| | | Arrays.stream(pvs).forEach(pv -> { |
| | | if (pv.viName.equals(portalVI.viName)) { |
| | | checkPortalVI.append(portalVI.viName).append(","); |
| | | } |
| | | }); |
| | | } |
| | | //æ ¡éªå±æ§æ¯å¦æ£ç¡® |
| | | List<OsAttributeVO> osAttributeVOList = osAttributeService.getOsAttributeVOSByBtName(portalVI.typeName, portalVI.typeFlag,false); |
| | | if (!CollectionUtils.isEmpty(osAttributeVOList)) { |
| | | List<String> filedList = osAttributeVOList.stream().map(OsAttributeVO::getId).collect(Collectors.toList()); |
| | | List<String> attributeList = VciBaseUtil.str2List(portalVIPO.getAttributeKey()); |
| | | //æ°æ®åºä¸åå¨ |
| | | List<String> sjkExitsLists = Optional.ofNullable(attributeList).orElseGet(() -> new ArrayList<>()).stream().filter(s -> !attributeList.contains(s)).collect(Collectors.toList()); |
| | | sjkExitsList.addAll(sjkExitsLists); |
| | | } |
| | | }catch (Throwable e){ |
| | | e.printStackTrace(); |
| | | } |
| | | portalVIList.add(portalVI); |
| | | if(StringUtils.isNotBlank(portalVIPO.getQtName())&&StringUtils.isNotBlank(portalVIPO.getQtNameFile())) { |
| | | QTInfo qt = new QTInfo(); |
| | | String qtText = readLines(filePath + "." + portalVIPO.getQtNameFile()); |
| | | qt.qtText=qtText; |
| | | qt.qtName = portalVIPO.getQtName(); |
| | | qt.btmName=portalVIPO.getQtName(); |
| | | QTInfo qt2 = null; |
| | | try { |
| | | qt2 = platformClientUtil.getQTDService().getQT(qt.qtName); |
| | | if (qt2 == null) { |
| | | platformClientUtil.getQTDService().saveQT(qt); |
| | | } |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | }); |
| | | if (checkInObj.length() > 0) { |
| | | throw new Throwable( checkInObj.toString() + "表åä¸åå¨ï¼"); |
| | | } |
| | | if (checkPortalVI.length() > 0) { |
| | | throw new Throwable( checkInObj.toString() + "åç§°å·²ç»åå¨ï¼"); |
| | | } |
| | | if(sjkExitsList.size()>0){ |
| | | throw new Throwable( checkInObj.toString() + "屿§å¨ç±»åä¸ä¸åå¨ï¼"); |
| | | } |
| | | for (PortalVI pvi : portalVIList) { |
| | | platformClientUtil.getPortalService().savePortalVI(pvi); |
| | | } |
| | | } |
| | | }catch (Throwable e){ |
| | | // throw new Throwable("导å
¥å¤±è´¥ï¼"+e.getMessage()); |
| | | return BaseResult.fail("导å
¥å¤±è´¥ï¼"+e.getMessage()); |
| | | } |
| | | return BaseResult.success("导å
¥æå"); |
| | | } |
| | | private String readLines(String filePath){ |
| | | StringBuffer sb=new StringBuffer(); |
| | | FileInputStream prmFile=null; |
| | | try { |
| | | prmFile = new FileInputStream(filePath); |
| | | List<String> prm= IOUtils.readLines(prmFile,"UTF-8"); |
| | | prm.stream().forEach(s -> { |
| | | sb.append(s); |
| | | }); |
| | | } catch (IOException e) { |
| | | IOUtils.closeQuietly(prmFile); |
| | | e.printStackTrace(); |
| | | }finally { |
| | | IOUtils.closeQuietly(prmFile); |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | /** |
| | | * æ·è´æ°æ®å°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("è¯·éæ©éè¦å¯¼åºçæ°æ®"); |
| | | } |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | }); |
| | | portalVIVOList= portalVIDOO2VOS(portalVIList); |
| | | portalVIVOList= portalVIO2DTOS(portalVIList); |
| | | return portalVIVOList; |
| | | } |
| | | private BaseResult savePortalVIDTO(PortalVIDTO portalVIDTO,boolean isEdit) { |
| | |
| | | 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 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); |
| | |
| | | margin: 50px auto; |
| | | } |
| | | .avue-dialog .el-dialog{ |
| | | top:47%; |
| | | max-height: calc(100% - 100px); |
| | | top:50%; |
| | | max-height: calc(100% - 80px); |
| | | -webkit-transform: translate(-50%, 0); |
| | | transform: translate(-50%, -50%); |
| | | margin-top: 0 !important; |
| | |
| | | .avue-dialog .el-dialog__body .avue-form{ |
| | | margin: 0px auto 40px; // åç¬ç»å¯¹è¯æ¡éçavue表åå ä¸ä¸è¾¹è· |
| | | } |
| | | .dialog-footer{ |
| | | background-color: #ffffff; |
| | | } |
| | | .avue-crud .avue-form { |
| | | margin: 0px auto !important; // è¡¨æ ¼å
ç表åï¼æ¯å¦:æç´¢æ ï¼ åæ¶ä¸è¾¹è· |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/router/axios'; |
| | | |
| | | // å表æ¥è¯¢ |
| | | export function gridPortalVIDatas(page,limit,params) { |
| | | return request({ |
| | | url: "/api/portalVIController/gridPortalVIDatas", |
| | | method: "get", |
| | | params:{ |
| | | page, |
| | | limit, |
| | | ...params |
| | | } |
| | | }); |
| | | } |
| | |
| | | }); |
| | | } |
| | | |
| | | // 龿¥ç±»åæ¥è¯¢æ¨¡æ¿æåºè®¾ç½®åæ®µä¸æï¼åæ°linkType=witoannotatelink&btmType=fileobject&direction=positive |
| | | export function getAllOrderbyAttributeByLink(params) { |
| | | return request({ |
| | | url: "/api/linkTypeController/getAllOrderbyAttributeByLink", |
| | | method: "get", |
| | | params |
| | | }); |
| | | } |
| | |
| | | import request from '@/router/axios'; |
| | | //龿¥ç±»åæ¥è¯¢æ¨¡æ¿ |
| | | //å表 |
| | | export function getObjTypeQTs(btName) { |
| | | return request({ |
| | | url: "/api/templateController/getObjTypeQTs", |
| | | method: "get", |
| | | params:{ |
| | | btName |
| | | } |
| | | }); |
| | | } |
| | | // å建 |
| | | export function linkSave(params) { |
| | | return request({ |
| | | url: "/api/templateController/linkSave", |
| | | method: "post", |
| | | data:params |
| | | }); |
| | | } |
| | | // å é¤ |
| | | export function deleteLinkTemplate(params) { |
| | | return request({ |
| | | url: "/api/templateController/deleteLinkTemplate", |
| | | method: "delete", |
| | | data:params |
| | | params:params |
| | | }); |
| | | } |
| | |
| | | }); |
| | | } |
| | | |
| | | export function getObjTypeQTs(params) { |
| | | return request({ |
| | | url: "/api/templateController/getObjTypeQTs", |
| | | method: "get", |
| | | params:{ |
| | | ...params |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹ |
| | | export function updateTemplate(params) { |
| | | return request({ |
| | |
| | | return request({ |
| | | url: "/api/templateController/deleteTemplate", |
| | | method: "delete", |
| | | data:params |
| | | params:{ |
| | | ...params |
| | | } |
| | | }); |
| | | } |
| | | |
| | |
| | | Object.assign(this.form, this.initValue); |
| | | } |
| | | }, |
| | | deep:true, |
| | | immediate: true, |
| | | }, |
| | | formData: { |
| | |
| | | }, |
| | | initItem(item){ |
| | | const type=this.columnType[item.type] || item.type; |
| | | item.text=item.text || item.label; |
| | | const col= { |
| | | ...item, |
| | | label: item.text, |
| | | prop: item.field, |
| | | showProp:item.showField, |
| | | type: type, |
| | | labelWidth: this.labelWidth || (item.text.length >= 6 ? 115 : 90), |
| | | disabled: !this.isEdit || item.readOnly || this.disabled, |
| | | disabled: item.readOnly || this.disabled, |
| | | span: item.span |
| | | ? item.span |
| | | : item.type === "textarea" |
| | |
| | | valueFormat: item.dateFormate || "yyyy-MM-dd HH:mm:ss", |
| | | format: item.dateFormate, |
| | | rules: this.isEdit?(type=="select" || type=="refer" || type=="date" || type=="datetime"?[{ |
| | | required: item.required, |
| | | required: item.required || false, |
| | | message: `è¯·éæ©${item.text}!`, |
| | | trigger: "change" |
| | | },{ |
| | | required: item.required, |
| | | required: item.required|| false, |
| | | message: `è¯·éæ©${item.text}!`, |
| | | trigger: "submit" |
| | | }]:[{ |
| | | required: item.required, |
| | | required: item.required|| false, |
| | | message: `请è¾å
¥${item.text}!`, |
| | | trigger: "blur" |
| | | },{ |
| | | required: item.required, |
| | | required: item.required|| false, |
| | | message: `请è¾å
¥${item.text}!`, |
| | | trigger: "submit" |
| | | }]):[] |
| | | }]):[], |
| | | ...item |
| | | }; |
| | | if(!this.isEdit){ |
| | | col.placeholder=col.label; |
| | | col.disabled=true; |
| | | } |
| | | if(col.type === 'richText'){ |
| | | this.subitemName = col.field; |
| | |
| | | }, |
| | | clearValidate(props){ |
| | | this.$refs.form.clearValidate(props) |
| | | }, |
| | | updateDic(prop,data){ |
| | | this.$refs.form.updateDic(prop,data) |
| | | } |
| | | }, |
| | | }; |
| | |
| | | default:'70%' |
| | | }, height: { |
| | | type: String, |
| | | default:'60%' |
| | | default:(document.body.clientHeight-400)+'px' |
| | | }, |
| | | reloadFormKey: { |
| | | type: String, |
| | |
| | | default:'70%' |
| | | }, height: { |
| | | type: String, |
| | | default:'60%' |
| | | default:(document.body.clientHeight-400)+'px' |
| | | }, |
| | | reloadFormKey: { |
| | | type: String, |
| | |
| | | default:'70%' |
| | | }, height: { |
| | | type: String, |
| | | default:'60%' |
| | | default:(document.body.clientHeight-400)+'px' |
| | | }, |
| | | reloadFormKey: { |
| | | type: String, |
| | |
| | | rConfig.options.tableConfig={ |
| | | cols:[{ |
| | | prop: 'code', |
| | | label: 'ç¨æ·å', |
| | | label: (this.$project.user.code || "è´¦å·"), |
| | | sortable: true, |
| | | width: 150, |
| | | search: true |
| | | },{ |
| | | prop: 'name', |
| | | label: 'å§å', |
| | | sortable: true, |
| | | width: 150, |
| | | search: true |
| | | }, { |
| | | prop: 'deptIdName', |
| | | label: 'æå±é¨é¨', |
| | | width: 260, |
| | | }, { |
| | | prop: 'sexText', |
| | | label: 'æ§å«', |
| | | width: 80 |
| | | }] |
| | | }; |
| | | rConfig.options.classifys=[{ |
| | | title:'é¨é¨', |
| | | treeUrl:'/org/deptController/referGrid', //åç±»çè·¯å¾ |
| | | queryByClassifyUrl:'/permission/userQueryController/listUserByDeptId', //'å表' |
| | | queryByClassifyUrl:'/permission/userQueryController/gridUserByDeptIdGet', //'å表' |
| | | queryField:'deptId', //åè¡¨æ°æ®ä¸åç±»çåæ®µ |
| | | classifyValueField:'id', //仿 ä¸è·åçåæ®µ |
| | | },{ |
| | | title:'è§è²', |
| | | treeUrl:'/permission/roleController/referGrid', //åç±»çè·¯å¾ |
| | | queryByClassifyUrl:'/permission/userQueryController/listUserByRoleId', //'å表' |
| | | queryByClassifyUrl:'/permission/userQueryController/gridUserInRoleIdGet', //'å表' |
| | | queryField:'roleId', //åè¡¨æ°æ®ä¸åç±»çåæ®µ |
| | | classifyValueField:'id', //仿 ä¸è·åçåæ®µ |
| | | }]; |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | refertype: this.referConfig.type, |
| | | refertype: this.referConfig.options.type, |
| | | emitData: {}, |
| | | width:this.referConfig.width || '900px', |
| | | height:this.referConfig.height || '500px' |
| | | width:this.referConfig.options.width, |
| | | height:this.referConfig.options.height |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | <div> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | v-dialog-resize |
| | | :title="title" |
| | | :visible.sync="visible" |
| | | :width="onlyTable?'60%': '80%'" |
| | |
| | | class="avue-dialog avue-dialog--top" |
| | | @close="dialogClose" |
| | | > |
| | | <el-container :style="{ 'height': height || '60vh' }"> |
| | | <el-aside width="300px" v-if="!onlyTable && classifys.length>0"> |
| | | <el-container :style="{ 'height': height }"> |
| | | <el-aside style="width:200px;height:100%" v-if="!onlyTable && classifys.length>0"> |
| | | <el-tabs type="border-card" style="height: 100%" @tab-click="tabClick" |
| | | v-model="tabName"> |
| | | <el-tab-pane |
| | |
| | | |
| | | <el-tree |
| | | class="filter-tree" |
| | | :style="'height: calc('+height+' - 100px);'" |
| | | :data="treeItem.treeData" |
| | | :lazy="lazy" |
| | | :load="treeLoad" |
| | |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </el-aside> |
| | | <el-main style="padding: 0 0 0 20px"> |
| | | <el-main style="padding: 0 0 0 20px;height:100%"> |
| | | <avue-crud |
| | | ref="referCrud" |
| | | v-model="formValue" |
| | |
| | | </el-container> |
| | | <div class="avue-dialog__footer"> |
| | | <div class="avue-dialog__footer--left valueInfo">{{ valueInfo }}</div> |
| | | <el-button @click="escHandler">å æ¶</el-button> |
| | | <el-button @click="clearValue">æ¸
空</el-button> |
| | | <el-button type="primary" @click="setValue">ç¡® å®</el-button> |
| | | <el-button @click="clearValue">æ¸
空</el-button> |
| | | <el-button @click="escHandler">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | |
| | | }, |
| | | height: { |
| | | type: String, |
| | | default:'500px' |
| | | default:(document.body.clientHeight-400)+'px' |
| | | }, |
| | | reloadFormKey: { |
| | | type: String, |
| | |
| | | lazy: this.referConfig.options.loadType == 'node', |
| | | loadType: { all: "all", node: "node" }, |
| | | url: this.referConfig.options.url || "referGrid", |
| | | query: {}, |
| | | query: {},//å表çæç´¢æ¡ä»¶ |
| | | where:{},//åè¡¨çæ¥è¯¢æ¡ä»¶ |
| | | loading: false, |
| | | page: { |
| | | layout: "sizes,prev,pager,next,jumper,total", |
| | | layout: "sizes,prev,pager,next,jumper,sizes,total", |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: this.referConfig.options.data |
| | |
| | | option: { |
| | | addBtn: false, |
| | | columnBtn: false, |
| | | calcHeight: 30, |
| | | tip: false, |
| | | menu: false, |
| | | searchShow: true, |
| | |
| | | reserveSelection: true, |
| | | dialogClickModal: false, |
| | | highlightCurrentRow: true, |
| | | height:parseInt(this.height)-150, |
| | | rowKey: "id", |
| | | rowParentKey: "parentId", |
| | | column: [], |
| | |
| | | tabClick:function (tab){ |
| | | this.currentTreeIndex= tab.index; |
| | | this.filterText=this.classifys[tab.index].filterText; |
| | | this.option.column.forEach(item => { |
| | | if (item.hideInClassify) { |
| | | let queryField = this.classifys[this.currentTreeIndex].queryField; |
| | | let inClassifyArray = item.hideInClassify.split(","); |
| | | if (inClassifyArray.find((value => value === queryField))) { |
| | | item.hide = true; |
| | | item.showColumn = false; |
| | | } else { |
| | | item.hide = false; |
| | | item.showColumn = true; |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | handleFocus() { |
| | | if (!this.disabled) { |
| | |
| | | this.$refs.referCrud.toggleSelection(); |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | if (this.url) { |
| | | this.loading = true; |
| | | getList( |
| | | Object.assign(params, this.params, this.query), |
| | | Object.assign(params, this.params,this.where, this.query), |
| | | page.currentPage, |
| | | page.pageSize, |
| | | this.url |
| | |
| | | where[this.classifys[this.currentTreeIndex].queryField] = data.attributes[classifyValueField]; |
| | | this.url = this.classifys[this.currentTreeIndex].queryByClassifyUrl || this.options.url; |
| | | this.page.currentPage=1; |
| | | this.onLoad(this.page, where); |
| | | this.where = where; |
| | | this.onLoad(this.page,where); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | <style lang="scss" scoped> |
| | | .valueInfo { |
| | | float: left; |
| | | border: 1px solid #e9e7e7; |
| | |
| | | padding: 6px 15px; |
| | | line-height: 1; |
| | | } |
| | | .filter-tree{ |
| | | overflow-y: auto; |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog v-dialogDrag |
| | | v-dialog-resize |
| | | :title="title" |
| | | :visible.sync="visible" |
| | | :width="width|| '450'" |
| | |
| | | }, |
| | | height: { |
| | | type: String, |
| | | default:'500px' |
| | | default:(document.body.clientHeight-500)+'px' |
| | | }, |
| | | reloadFormKey: { |
| | | type: String, |
| | |
| | | query: {}, |
| | | loading: false, |
| | | page: { |
| | | layout: "sizes,prev,pager,next,jumper,total", |
| | | layout: "sizes,prev,pager,next,jumper,sizes,total", |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: this.referConfig.options.data ? this.referConfig.options.data.length : 0 |
| | |
| | | prop: 'code', |
| | | label: 'ç¼å·', |
| | | sortable: true, |
| | | width: 150, |
| | | search: true |
| | | }, { |
| | | prop: 'name', |
| | | label: 'åç§°', |
| | | sortable: true, |
| | | width: 260, |
| | | search: true |
| | | }, { |
| | | prop: 'description', |
| | |
| | | }, { |
| | | prop: 'secretShow', |
| | | label: 'å¯çº§', |
| | | width: 60, |
| | | hide: (!this.controllerSecret) |
| | | }]; |
| | | } else { |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog v-dialogDrag |
| | | v-dialog-resize |
| | | :title="title" |
| | | :visible.sync="visible" |
| | | :width="width" |
| | | :style="'height:'+height || 'auto'" |
| | | :append-to-body="true" |
| | | class="avue-dialog avue-dialog--top" |
| | | @close="dialogClose"> |
| | |
| | | }, |
| | | height: { |
| | | type: String, |
| | | default:'500px' |
| | | default:(document.body.clientHeight-500)+'px' |
| | | }, |
| | | reloadFormKey: { |
| | | type: String, |
| | |
| | | }, |
| | | url: this.referConfig.options.url || 'referGrid', |
| | | method: this.referConfig.options.method || 'get', |
| | | query: {}, |
| | | query: this.referConfig.options.query || {orderBy: "createTime", orderMethod: "desc"}, |
| | | loading: false, |
| | | page: { |
| | | layout: "sizes,prev,pager,next,jumper,total", |
| | | layout: "sizes,prev,pager,next,jumper,sizes,total", |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: this.referConfig.options.data ? this.referConfig.options.data.length : 0 |
| | |
| | | default:'70%' |
| | | }, height: { |
| | | type: String, |
| | | default:'60%' |
| | | default:(document.body.clientHeight-650)+'px' |
| | | }, |
| | | reloadFormKey: { |
| | | type: String, |
| | |
| | | </div> |
| | | <!-- 左侧æ --> |
| | | <div style="height: calc(100vh - 330px);"> |
| | | <avue-tree ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <avue-tree ref="tree" v-loading="treeLoading" :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> |
| | |
| | | name: 'el-icon-tickets', |
| | | desc: 'el-icon-chat-line-square' |
| | | }, |
| | | treeLoading:false |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | methods: { |
| | | //æ 表æ¥è¯¢ |
| | | getTreeList() { |
| | | this.treeLoading = true; |
| | | getBizTypes().then(res => { |
| | | const data = res.data.data.map(item => { |
| | | this.processChildren(item); // å¤çæ¯ä¸ªèç¹ |
| | |
| | | return item.attributes; // è¿åå¤çåç attributes |
| | | }); |
| | | this.treeData[0].children = data; |
| | | console.log(this.treeData); |
| | | this.inheritTreeData = data; |
| | | this.treeLoading = false; |
| | | }); |
| | | }, |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-dialog v-dialogDrag |
| | | :title="dialog.title" |
| | | :visible.sync="dialog.showDialog" |
| | | width="1600px" |
| | | :append-to-body="true" |
| | | class="avue-dialog" |
| | | :destroy-on-close="true" |
| | | :close-on-click-modal="false" |
| | | @close="cancelDialog"> |
| | | <div style="min-height: 665px;max-height: 85vh;padding-bottom: 50px;"> |
| | | <basic-form key="linkQueryForm" style="margin-bottom: 0" |
| | | ref="form" |
| | | :span="4" |
| | | :formItems="formItems" |
| | | :formData="form" |
| | | @getFormData="getFormData"> |
| | | </basic-form> |
| | | <avue-crud ref="crud" title="设置æåº" |
| | | :data="orderInfoList" :option="crudOption"> |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <el-button icon="el-icon-plus" size="small" type="primary" @click="addRow">å建</el-button> |
| | | </template> |
| | | <template slot="menu" slot-scope="scope"> |
| | | <el-button icon="el-icon-delete" size="small" type="text" @click="rowDeleteHandler(scope)">å é¤ |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <el-dialog v-dialogDrag |
| | | title="å建" |
| | | :visible.sync="crudDialog.showDialog" |
| | | width="500px" |
| | | :append-to-body="true" |
| | | class="avue-dialog" |
| | | :destroy-on-close="true" |
| | | :close-on-click-modal="false" |
| | | @close="crudDialog.showDialog=false"> |
| | | <avue-form ref="tableForm" :option="tableFormOption" v-model="tableForm"></avue-form> |
| | | <div class="dialog-footer avue-dialog__footer"> |
| | | <el-button type="primary" plain size="small" @click="rowSave" >ä¿ å</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <el-container style="margin-top: 10px;"> |
| | | <el-aside style="width:350px"> |
| | | <fieldset> |
| | | <legend> 龿¥ç±»åå鿡件 </legend> |
| | | <div> |
| | | æ¥è¯¢æ¨¡æ¿å®ä¹ |
| | | <avue-select @change="linkQueryDefineChange" class="el-input--small" v-model="linkQueryDefineForm" placeholder="è¯·éæ©å
容" type="tree" :dic="linkQueryDefineDic" style="width:240px"></avue-select> |
| | | <avue-tree style="height: 265px" :data="linkTreeData" :option="treeOption" @node-drag-start="handleDragStart"> |
| | | </avue-tree> |
| | | </div> |
| | | </fieldset> |
| | | </el-aside> |
| | | <el-main> |
| | | <fieldset style="margin: 0 10px"> |
| | | <legend> æ¥è¯¢æ¡ä»¶ </legend> |
| | | <form-query-dialog style="height: 300px;" :queryCondition="queryCondition" :queryTree="queryTree"></form-query-dialog> |
| | | </fieldset> |
| | | </el-main> |
| | | <el-aside style="width:350px"> |
| | | <fieldset> |
| | | <legend> ä¸å¡ç±»åå鿡件 </legend> |
| | | <div> |
| | | æ¥è¯¢æ¨¡æ¿å®ä¹ |
| | | <avue-select @change="businessQueryDefineChange" class="el-input--small" v-model="businessQueryDefineForm" placeholder="è¯·éæ©å
容" type="tree" :dic="businessQueryDefineDic" style="width: 240px;"></avue-select> |
| | | <avue-tree style="height: 265px" :data="businessTreeData" :option="treeOption" @node-drag-start="handleDragStart"> |
| | | </avue-tree> |
| | | </div> |
| | | </fieldset> |
| | | </el-aside> |
| | | </el-container> |
| | | </div> |
| | | <div class="dialog-footer avue-dialog__footer"> |
| | | <el-button type="primary" plain size="small" @click="submitDialog" >ä¿ å</el-button> |
| | | <el-button size="small" @click="cancelDialog">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getAllOrderbyAttributeByLink} from "@/api/modeling/linkType/api"; |
| | | import {linkSave} from "@/api/queryTemplate/linkTypeQuery"; |
| | | import basicOption from "@/util/basic-option"; |
| | | import {gridTemplate} from "@/api/queryTemplate/queryDefine"; |
| | | import formQueryDialog from "./formQueryDialog.vue"; |
| | | export default { |
| | | name: "formDialog", |
| | | components:{formQueryDialog}, |
| | | data(){ |
| | | return { |
| | | dialog: { |
| | | showDialog: false, |
| | | title: "å建", |
| | | submitTxt: "ä¿å", |
| | | submitIcon: "el-icon-check", |
| | | loading: false, |
| | | type: "add", |
| | | }, |
| | | crudDialog: { |
| | | showDialog: false, |
| | | submitTxt: "ä¿å", |
| | | submitIcon: "el-icon-check", |
| | | }, |
| | | formItems:[{ |
| | | label: 'æ¥è¯¢æ¨¡æ¿åç§°', |
| | | prop: 'qtName', |
| | | type: 'input', |
| | | span:5, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请è¾å
¥æ¥è¯¢æ¨¡æ¿åç§°", |
| | | trigger: "blur" |
| | | }] |
| | | },{ |
| | | label: 'æ¹å', |
| | | prop: 'direction', |
| | | type: 'radio', |
| | | value:'positive', |
| | | labelWidth:70, |
| | | span: 3, |
| | | dicData: [{ |
| | | label: 'æ£å', |
| | | value: 'positive' |
| | | }, { |
| | | label: 'åå', |
| | | value: 'opposite' |
| | | }] |
| | | },{ |
| | | label: 'ä¸å¡ç±»å', |
| | | prop: 'btmType', |
| | | type: 'select', |
| | | labelWidth:110, |
| | | dicData: [] |
| | | }, { |
| | | label: 'çæ¬çæ¬¡', |
| | | prop: 'version', |
| | | type: 'select', |
| | | span:5, |
| | | dicData: [{ |
| | | label: 'å½åçæ¬å½åçæ¬¡', |
| | | value: 1 |
| | | }, { |
| | | label: 'å½åçæ¬ææ°çæ¬¡', |
| | | value: 2 |
| | | }, { |
| | | label: 'ææ°çæ¬ææ°çæ¬¡', |
| | | value: 3 |
| | | }, { |
| | | label: 'å·²åå¸çææ°çæ¬', |
| | | value: 7 |
| | | }], |
| | | value: 1 |
| | | },{ |
| | | label: 'æ¥è¯¢æ¯å¦æä¸çº§', |
| | | prop: 'queryISLeaf', |
| | | type: 'switch', |
| | | labelWidth:140, |
| | | dicData: [ { |
| | | label: 'å¦', |
| | | value: false |
| | | },{ |
| | | label: 'æ¯', |
| | | value: true |
| | | }], |
| | | value:false |
| | | }, { |
| | | label: 'åèç¹å±æ¬¡æ°', |
| | | prop: 'level', |
| | | type: 'number', |
| | | span:3, |
| | | value:1 |
| | | }], |
| | | form:{ |
| | | btmName:'', |
| | | qtName: '', |
| | | queryTemplate:{} |
| | | }, |
| | | //å·²ææåºå表é
ç½® |
| | | crudOption: { |
| | | ...basicOption, |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | selection: false, |
| | | height: "220", |
| | | tip: false, |
| | | column: [{ |
| | | label: 'æåºå段', |
| | | prop: 'orderField' |
| | | }, { |
| | | label: 'æåºæ¹å¼', |
| | | prop: 'orderMode' |
| | | }, { |
| | | label: 'ä¼å
级', |
| | | prop: 'level' |
| | | }] |
| | | }, |
| | | //å·²ææåº |
| | | orderInfoList:[], |
| | | //设置æåºå¼¹çªè¡¨åæ°æ® |
| | | tableForm:{ |
| | | orderField:'', |
| | | orderMode:'ASC', |
| | | level:'' |
| | | }, |
| | | //设置æåºå¼¹çªææå¯æåºå段 |
| | | orderFieldList:[], |
| | | //设置æåºå¼¹çªè¡¨åé
ç½® |
| | | tableFormOption: { |
| | | menuBtn: false, |
| | | submitBtn: false, |
| | | emptyBtn: false, |
| | | span:24, |
| | | column: [{ |
| | | label: 'æåºå段', |
| | | prop: 'orderField', |
| | | type:'select', |
| | | props: { |
| | | label: 'id', |
| | | value: 'id' |
| | | }, |
| | | rules: [{ |
| | | required: true, |
| | | message: "è¯·éæ©æåºå段", |
| | | trigger: "blur" |
| | | }] |
| | | }, { |
| | | label: 'æåºæ¹å¼', |
| | | prop: 'orderMode', |
| | | type: 'select', |
| | | dicData: [{ |
| | | label: 'ååº', |
| | | value: 'ASC' |
| | | }, { |
| | | label: 'éåº', |
| | | value: 'DESC' |
| | | }], |
| | | value: 'ASC' |
| | | }, { |
| | | label: 'ä¼å
级', |
| | | prop: 'level', |
| | | type: 'number', |
| | | min:1, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请è¾å
¥ä¼å
级", |
| | | trigger: "blur" |
| | | }] |
| | | }] |
| | | }, |
| | | treeOption:{ |
| | | defaultExpandAll:true, |
| | | menu: false, |
| | | addBtn: false, |
| | | filter:false, |
| | | draggable: true, |
| | | allowDrop: () => { |
| | | return false; |
| | | }, |
| | | allowDrag: () => { |
| | | return true; |
| | | }, |
| | | }, |
| | | linkQueryDefineForm:'',//龿¥ç±»åæ¥è¯¢æ¨¡æ¿å®ä¹éä¸å¼ |
| | | linkQueryDefineDic:[],//龿¥ç±»åæ¥è¯¢æ¨¡æ¿å®ä¹ä¸ææ°æ® |
| | | //龿¥ç±»åæ¥è¯¢æ¨¡æ¿å®ä¹éä¸é¡¹å±æ§ |
| | | linkTreeData: [], |
| | | businessQueryDefineForm:'',//ä¸å¡ç±»åæ¥è¯¢æ¨¡æ¿å®ä¹éä¸å¼ |
| | | businessQueryDefineDic:[],//ä¸å¡ç±»åæ¥è¯¢æ¨¡æ¿å®ä¹ä¸ææ°æ® |
| | | //ä¸å¡ç±»åæ¥è¯¢æ¨¡æ¿å®ä¹éä¸é¡¹å±æ§ |
| | | businessTreeData: [], |
| | | //é«çº§æ¥è¯¢æ¡ä»¶ |
| | | queryTree:{}, |
| | | //æ®éæ¥è¯¢æ¡ä»¶ |
| | | queryCondition:[] |
| | | }; |
| | | }, |
| | | watch: { |
| | | //æ¹å |
| | | 'form.direction': { |
| | | handler(val) { |
| | | if(val=='positive'){ |
| | | //æ£å |
| | | const dicData=this.treeData.btmItemsTo.map(item=>{ |
| | | return { |
| | | label: item, |
| | | value: item |
| | | } |
| | | }) |
| | | dicData.push({ |
| | | label: 'ææç±»å', |
| | | value: '*' |
| | | }) |
| | | this.$refs.form.updateDic('btmType', dicData); |
| | | this.form.btmType=dicData[0].value |
| | | this.getAllAttr(); |
| | | }else if(val=='opposite'){ |
| | | //åå |
| | | const dicData=this.treeData.btmItemsFrom.map(item=>{ |
| | | return { |
| | | label: item, |
| | | value: item |
| | | } |
| | | }) |
| | | dicData.push({ |
| | | label: 'ææç±»å', |
| | | value: '*' |
| | | }) |
| | | this.$refs.form.updateDic('btmType', dicData); |
| | | this.form.btmType=dicData[0].value |
| | | this.getAllAttr(); |
| | | } |
| | | }, |
| | | immediate: true, |
| | | }, |
| | | //ä¸å¡ç±»å |
| | | 'form.btmType': { |
| | | handler(val) { |
| | | if(val && val!='*'){ |
| | | this.getTemp(val,false); |
| | | } |
| | | }, |
| | | immediate: true, |
| | | }, |
| | | 'dialog.type': { |
| | | handler(val) { |
| | | if(val=='edit'){ |
| | | } |
| | | }, |
| | | immediate: true, |
| | | }, |
| | | }, |
| | | methods: { |
| | | openDialog(btmName, title, mode, data) { |
| | | this.dialog.title = title; |
| | | this.dialog.type = mode; |
| | | this.form.btmName = btmName; |
| | | this.treeData = data.treeData; |
| | | |
| | | if (data.selectData) { |
| | | this.selectData = data.selectData; |
| | | this.form.qtName = this.selectData.qtName; |
| | | this.form.direction = this.selectData.queryTemplate.direction; |
| | | this.form.btmType = this.selectData.queryTemplate.btmType; |
| | | this.form.version = this.selectData.queryTemplate.version; |
| | | this.form.queryISLeaf = this.selectData.queryTemplate.queryISLeaf; |
| | | this.form.level = this.selectData.queryTemplate.level; |
| | | if (data.selectData.queryTemplate.orderInfoList && data.selectData.queryTemplate.orderInfoList.length > 0) { |
| | | this.orderInfoList = JSON.parse(JSON.stringify(data.selectData.queryTemplate.orderInfoList));//å·²ææåº |
| | | } |
| | | this.queryCondition=this.selectData.queryTemplate.condition; |
| | | this.queryTree=this.selectData.queryTemplate.tree; |
| | | } else { |
| | | this.selectData = {}; |
| | | this.orderInfoList = []; |
| | | this.queryCondition=[]; |
| | | this.queryTree={}; |
| | | } |
| | | this.dialog.showDialog = true; |
| | | this.getTemp(data.treeData.label, true) |
| | | }, |
| | | cancelDialog() { |
| | | this.dialog.loading = false; |
| | | this.dialog.showDialog = false; |
| | | this.$nextTick(() => { |
| | | this.form = { |
| | | btmName: '', |
| | | qtName: '', |
| | | queryTemplate: {} |
| | | }; |
| | | this.orderInfoList =[]; |
| | | this.businessQueryDefineForm=''; |
| | | this.linkQueryDefineForm=''; |
| | | this.$refs.form.clearValidate(); |
| | | }); |
| | | }, |
| | | submitDialog() { |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | let formData={ |
| | | btmName:this.form.btmName, |
| | | qtName:this.form.qtName, |
| | | queryTemplate:{ |
| | | btmType:this.form.btmType, |
| | | clauseList:['*'], |
| | | direction:this.form.direction, |
| | | id:this.form.qtName, |
| | | level:this.form.level, |
| | | linkType:this.form.btmName, |
| | | orderInfoList:this.orderInfoList, |
| | | queryISLeaf:this.form.queryISLeaf, |
| | | recReturnMode:1,//éå½è¿åæ°æ®æ¨¡å¼:1ï¼RECRETURNMODE_FLAT, 2ï¼RECRETURNMODE_FILTER |
| | | rightFlag:true, |
| | | secretFlag:true, |
| | | type:'link', |
| | | version:this.form.version |
| | | } |
| | | } |
| | | formData.condition=[] |
| | | linkSave(formData).then(res => { |
| | | if (res.data.success) { |
| | | this.$message.success("ä¿åæå"); |
| | | this.cancelDialog(); |
| | | this.$emit("refresh"); |
| | | } |
| | | }); |
| | | } else { |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | getFormData(form) { |
| | | this.form = form; |
| | | }, |
| | | addRow() { |
| | | this.crudDialog.showDialog = true; |
| | | }, |
| | | // è¡å é¤ |
| | | rowDeleteHandler(data) { |
| | | this.orderInfoList.splice(data.index,1); |
| | | this.orderFieldList.unshift({ |
| | | id: data.row.orderField |
| | | }); |
| | | this.tableFormOption.column[0].dicData= this.orderFieldList |
| | | }, |
| | | //è·åæåºè®¾ç½®ä¸æææåºå段 |
| | | getAllAttr() { |
| | | getAllOrderbyAttributeByLink({ |
| | | name: this.treeData.label, |
| | | btmType: this.form.btmType, |
| | | direction: this.form.direction |
| | | }).then(res => { |
| | | const orderInfoStr = JSON.stringify(this.orderInfoList); |
| | | const dicData = []; |
| | | res.data.data.forEach(item => { |
| | | if (orderInfoStr.indexOf('"orderField":"' + item + '"') == -1) { |
| | | dicData.push({id: item}); |
| | | } |
| | | }) |
| | | this.tableFormOption.column[0].dicData=dicData; |
| | | this.orderFieldList=dicData; |
| | | }) |
| | | }, |
| | | //æåºè®¾ç½®ä¿å |
| | | rowSave() { |
| | | this.$refs.tableForm.validate((valid) => { |
| | | if(valid){ |
| | | this.orderInfoList.push(JSON.parse(JSON.stringify(this.tableForm))); |
| | | this.crudDialog.showDialog=false; |
| | | const orderInfoStr = JSON.stringify(this.orderInfoList); |
| | | const dicData = []; |
| | | this.orderFieldList.forEach(item => { |
| | | if (orderInfoStr.indexOf('"orderField":"' + item.id + '"') == -1) { |
| | | dicData.push(item); |
| | | } |
| | | }) |
| | | this.tableFormOption.column[0].dicData=dicData; |
| | | this.orderFieldList=dicData; |
| | | this.tableForm= { |
| | | orderField: '', |
| | | orderMode: 'ASC', |
| | | level: '' |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | //è·åæ¥è¯¢æ¨¡æ¿å®ä¹ä¸æ |
| | | getTemp(btmName,linkFlag) { |
| | | if (btmName) { |
| | | gridTemplate({btmName: btmName, linkFlag: linkFlag}).then(res => { |
| | | const data = res.data.data.map(item => { |
| | | item.label = item.name + '-' + (item.linkTypeName || item.btmName); |
| | | item.value = item.name; |
| | | return item; |
| | | }); |
| | | if(linkFlag){ |
| | | this.linkQueryDefineDic=data |
| | | data.length>0 && (this.linkQueryDefineForm=data[0].value); |
| | | }else { |
| | | this.businessQueryDefineDic=data; |
| | | data.length>0 && (this.businessQueryDefineForm= data[0].value); |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | linkQueryDefineChange(data) { |
| | | if (data.value) { |
| | | const childData = data.item.abNames.map(item => { |
| | | return { |
| | | label: item, |
| | | value: item |
| | | }; |
| | | }); |
| | | this.linkTreeData = [{ |
| | | label: data.value, |
| | | value: data.value, |
| | | children: childData |
| | | }] |
| | | } |
| | | }, |
| | | businessQueryDefineChange(data) { |
| | | if (data.value) { |
| | | const childData = data.item.abNames.map(item => { |
| | | return { |
| | | label: item, |
| | | value: item |
| | | }; |
| | | }); |
| | | this.businessTreeData = [{ |
| | | label: data.value, |
| | | value: data.value, |
| | | children: childData |
| | | }] |
| | | } |
| | | }, |
| | | // å¼å§ææ½æ èç¹äºä»¶ |
| | | handleDragStart(node, ev) { |
| | | // ä½¿ç¨ setData æ¹æ³è®¾ç½®æ°æ® |
| | | ev.dataTransfer.setData('item', JSON.stringify(node.data)); |
| | | }, |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | fieldset { |
| | | border-radius: 5px; |
| | | -webkit-box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1); |
| | | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1); |
| | | padding: 10px 6px; |
| | | box-sizing: border-box; |
| | | margin: 0; |
| | | border: 1px solid #EBEEF5; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div style="padding: 0 10px"> |
| | | <div style="text-align: center;margin-bottom: 10px"> |
| | | <avue-radio v-model="radioForm" :dic="radioDic" style="margin: 0 20px 0 0;display: inline-block"></avue-radio> |
| | | <el-button plain size="mini" type="primary" @click="clearValue">æ¸
空å¼</el-button> |
| | | <el-button plain size="mini" type="primary" @click="delAll">å é¤å
¨é¨æ¡ä»¶</el-button> |
| | | </div> |
| | | <div v-if="radioForm==0" @drop="drop" @dragover.prevent style="height: 220px;text-align: center;"> |
| | | <div v-for="condition in conditionList" class="el-input--small" style="margin-bottom: 5px;"> |
| | | <span style="width: 150px;display: inline-block;text-align: right" :title="condition.clause">{{condition.clause}}</span> |
| | | <avue-select v-model="condition.operator" type="tree" :dic="operatorDic" :clearable="false" style="width: 80px;margin: 0 5px;"></avue-select> |
| | | <avue-input v-model="condition.ordinaryValue" placeholder="" style="width: 300px;margin-right: 5px;"></avue-input> |
| | | <el-button plain size="mini" type="primary" @click="delAll">éæ©æ¥è¯¢æ¨¡æ¿</el-button> |
| | | </div> |
| | | </div> |
| | | <div v-else style="height: 220px;text-align: left"> |
| | | <avue-tree style="height: 220px" :data="treeData" :option="treeOption"></avue-tree> |
| | | </div> |
| | | <div style="text-align: right;margin-top: 10px;"> |
| | | <el-button v-if="radioForm==1" plain size="mini" type="primary" @click="addHandler">å¢å é»è¾</el-button> |
| | | <el-button v-if="radioForm==1" plain size="mini" type="primary" @click="del">ä¿®æ¹æ¡ä»¶</el-button> |
| | | <el-button v-if="radioForm==1" plain size="mini" type="primary" @click="del">å é¤</el-button> |
| | | <el-button plain size="mini" type="primary" @click="del">æ¥è¯¢</el-button> |
| | | <el-button plain size="mini" type="primary" @click="del">åæ¶</el-button> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: "formQueryDialog", |
| | | props: { |
| | | queryCondition: { |
| | | type: Array, |
| | | default: [] |
| | | }, |
| | | queryTree: { |
| | | type: Object, |
| | | default: {} |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | radioForm: 0, |
| | | radioDic: [{ |
| | | label: 'æ®é', |
| | | value: 0 |
| | | }, { |
| | | label: 'é«çº§', |
| | | value: 1 |
| | | }], |
| | | conditionList:this.queryCondition, |
| | | treeOption:{ |
| | | defaultExpandAll:true, |
| | | menu: false, |
| | | addBtn: false, |
| | | filter:false, |
| | | }, |
| | | treeData:this.queryTree, |
| | | //VTIntegerãVTDoubleãVTLong |
| | | operatorIntDic:[{ |
| | | label:'=', |
| | | value:'=' |
| | | },{ |
| | | label:'!=', |
| | | value:'!=' |
| | | },{ |
| | | label:'å
å«', |
| | | value:'å
å«' |
| | | },{ |
| | | label:'in', |
| | | value:'in' |
| | | },{ |
| | | label:'not in', |
| | | value:'not in' |
| | | },{ |
| | | label:'>=', |
| | | value:'>=' |
| | | },{ |
| | | label:'>', |
| | | value:'>' |
| | | },{ |
| | | label:'<=', |
| | | value:'<=' |
| | | },{ |
| | | label:'<', |
| | | value:'<' |
| | | }], |
| | | //VTDateTimeãVTDateãVTTime |
| | | operatorTimeDic:[{ |
| | | label:'=', |
| | | value:'=' |
| | | },{ |
| | | label:'!=', |
| | | value:'!=' |
| | | },{ |
| | | label:'in', |
| | | value:'in' |
| | | },{ |
| | | label:'not in', |
| | | value:'not in' |
| | | },{ |
| | | label:'>=', |
| | | value:'>=' |
| | | },{ |
| | | label:'<=', |
| | | value:'<=' |
| | | }], |
| | | //å
¶å® |
| | | operatorDic:[{ |
| | | label:'=', |
| | | value:'=' |
| | | },{ |
| | | label:'!=', |
| | | value:'!=' |
| | | },{ |
| | | label:'å
å«', |
| | | value:'å
å«' |
| | | },{ |
| | | label:'in', |
| | | value:'in' |
| | | },{ |
| | | label:'not in', |
| | | value:'not in' |
| | | }] |
| | | } |
| | | }, |
| | | methods:{ |
| | | // ææ½å°æ¶ |
| | | drop(event) { |
| | | // ä½¿ç¨ getData æ¹æ³è·åæ°æ® |
| | | const data = JSON.parse(event.dataTransfer.getData('item')); |
| | | const params = { |
| | | clause: data.value, |
| | | operator: '=', |
| | | ordinaryValue: '' |
| | | } |
| | | this.conditionList.push(params) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | ::v-deep .el-input--small .el-input__inner{ |
| | | height: 28px; |
| | | line-height: 28px; |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <el-container> |
| | | |
| | | <el-aside> |
| | | <basic-container> |
| | | <div ref="TreeBox" style="height: calc(100vh - 154px);!important;"> |
| | | <div ref="TreeBox" style="height: calc(100vh - 164px);!important;"> |
| | | <!-- 左侧æ --> |
| | | <div style="height: calc(100vh - 190px);"> |
| | | <div style="height: calc(100vh - 200px);"> |
| | | <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> |
| | | <div v-if="this.nodeRow && this.nodeRow.label"> |
| | | <el-button icon="el-icon-plus" size="small" type="primary" @click="addHandler">å建</el-button> |
| | | <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editHandler">ä¿®æ¹</el-button> |
| | | <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delHandler">å é¤</el-button> |
| | | <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">导åº</el-button> |
| | | <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">导å
¥</el-button> |
| | | </div> |
| | | <avue-crud ref="crud" |
| | | @selection-change="selectionChange" |
| | | @row-click="rowClick" |
| | | :data="crudData" :option="crudOption" :table-loading="tableLoading" style="margin-top: 10px"> |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <el-button icon="el-icon-plus" size="small" type="primary" @click="addHandler">å建</el-button> |
| | | <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editHandler">ä¿®æ¹</el-button> |
| | | <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delHandler">å é¤</el-button> |
| | | <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">导åº</el-button> |
| | | <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">导å
¥</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <form-dialog ref="formRef" @refresh="getTemp"></form-dialog> |
| | | </basic-container> |
| | | </el-main> |
| | | |
| | | </el-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {gridLink} from "@/api/modeling/linkType/api"; |
| | | import { gridTemplate, saveTemplate, updateTemplate} from "@/api/queryTemplate/queryDefine"; |
| | | import {deleteLinkTemplate} from "@/api/queryTemplate/linkTypeQuery"; |
| | | import func from "@/util/func"; |
| | | import {dateFormat} from "@/util/date"; |
| | | import {getObjTypeQTs,deleteLinkTemplate} from "@/api/queryTemplate/linkTypeQuery"; |
| | | import basicOption from "@/util/basic-option"; |
| | | import FormDialog from "./formDialog.vue" |
| | | |
| | | export default { |
| | | name: "index", |
| | | components: {FormDialog}, |
| | | data() { |
| | | return { |
| | | treeOption: { |
| | |
| | | height: "auto", |
| | | calcHeight: -40, |
| | | tip: false, |
| | | header:false, |
| | | column: [{ |
| | | label: 'æ¥è¯¢æ¨¡æ¿åç§°', |
| | | prop: 'name' |
| | | prop: 'qtName' |
| | | }, { |
| | | label: 'å建人', |
| | | prop: 'creator' |
| | | }, { |
| | | label: 'å建æ¶é´', |
| | | prop: 'createTime', |
| | | prop: 'createTimeText' |
| | | }, { |
| | | label: 'æ¹å', |
| | | prop: 'direction', |
| | | formatter:function (row, value) { |
| | | return dateFormat(new Date(value)) |
| | | if (row.queryTemplate.direction == 'positive') { |
| | | return 'æ£å' |
| | | }else{ |
| | | return 'åå' |
| | | } |
| | | } |
| | | }, { |
| | | label: 'ä¸å¡ç±»å', |
| | | prop: 'btmType', |
| | | formatter:function (row, value) { |
| | | return row.queryTemplate.btmType; |
| | | } |
| | | }, { |
| | | label: 'çæ¬çæ¬¡', |
| | | prop: 'version', |
| | | formatter:function (row, value) { |
| | | if(row.queryTemplate.version==1){ |
| | | return 'å½åçæ¬å½åçæ¬¡' |
| | | }else if(row.queryTemplate.version==2){ |
| | | return 'å½åçæ¬ææ°çæ¬¡' |
| | | }else if(row.queryTemplate.version==3){ |
| | | return 'ææ°çæ¬ææ°çæ¬¡' |
| | | }else if(row.queryTemplate.version==7){ |
| | | return 'å·²åå¸çææ°çæ¬' |
| | | }else { |
| | | return '' |
| | | } |
| | | } |
| | | }, { |
| | | label: 'æ¥è¯¢æ¯å¦æä¸çº§', |
| | | prop: 'queryISLeaf', |
| | | formatter:function (row, value) { |
| | | return row.queryTemplate.queryISLeaf |
| | | } |
| | | }, { |
| | | label: 'åèç¹å±æ¬¡æ°', |
| | | prop: 'level', |
| | | formatter:function (row, value) { |
| | | return row.queryTemplate.level; |
| | | } |
| | | }] |
| | | }, |
| | |
| | | this.tableLoading = true; |
| | | this.getTemp(); |
| | | }, |
| | | //è·åæ¥è¯¢æ¨¡æ¿å表 |
| | | getTemp() { |
| | | gridTemplate({btmName: this.nodeRow.label, linkFlag: true}).then(res => { |
| | | getObjTypeQTs(this.nodeRow.label).then(res => { |
| | | this.crudData = res.data.data; |
| | | this.tableLoading = false; |
| | | this.selectionClear(); |
| | | }) |
| | | }, |
| | | selectHandler(selection, row) { |
| | | |
| | | rowClick(row) { |
| | | this.$refs.crud.toggleSelection(); |
| | | this.$refs.crud.toggleRowSelection(row); //éä¸å½åè¡ |
| | | this.selectionRow = [row]; |
| | | }, |
| | | changeTemp(data) { |
| | | this.$refs.queryCrud.clearSelection(); |
| | | if (data.value != '') { |
| | | let abNames = data.item.abNames.join(',').toLowerCase().split(',') |
| | | |
| | | } |
| | | selectionChange(list) { |
| | | this.selectionRow = list; |
| | | }, |
| | | selectionClear() { |
| | | this.selectionRow = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | }, |
| | | //å建 |
| | | addHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('è¯·éæ©è¦æ·»å çèç¹'); |
| | | return; |
| | | } |
| | | this.title = 'add'; |
| | | this.visible = true; |
| | | this.$nextTick(() => { |
| | | this.$refs.formRef.openDialog(this.nodeRow.label,'å建','add',{treeData:this.nodeRow}); |
| | | this.$nextTick(()=>{ |
| | | this.$refs.formRef.formItems[0].disabled = false; |
| | | this.$refs.formRef.$refs.form.getInit(this.$refs.formRef.formItems) |
| | | }); |
| | | }, |
| | | //ä¿®æ¹ |
| | | editHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('请è³å°éæ©ä¸æ¡æ°æ®'); |
| | | if (this.selectionRow.length!=1) { |
| | | this.$message.error('è¯·éæ©ä¸æ¡æ°æ®'); |
| | | return; |
| | | } |
| | | this.form.name = this.templateForm; |
| | | this.title = 'edit'; |
| | | this.visible = true; |
| | | this.$nextTick(() => { |
| | | this.$refs.formRef.openDialog(this.nodeRow.label,'ä¿®æ¹','edit',{treeData:this.nodeRow,selectData:this.selectionRow[0]}); |
| | | this.$nextTick(()=>{ |
| | | debugger; |
| | | this.$refs.formRef.formItems[0].disabled = true; |
| | | this.$refs.formRef.$refs.form.getInit(this.$refs.formRef.formItems) |
| | | }); |
| | | }, |
| | | // æ°å¢ç¼è¾ä¿å |
| | | addDialogSavaHandler() { |
| | | this.$refs.form.validate((valid) => { |
| | | const saveFunction = this.title === 'add' ? saveTemplate : updateTemplate; |
| | | if (valid) { |
| | | saveFunction(this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.addDialogClose(); |
| | | } |
| | | }) |
| | | } else { |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | // æ°å¢ç¼è¾å¯¹è¯æ¡åæ¶ |
| | | addDialogClose() { |
| | | this.form = { |
| | | name: '' |
| | | }; |
| | | this.$refs.form.clearValidate(); |
| | | this.visible = false; |
| | | }, |
| | | //å é¤ |
| | | delHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | if (this.selectionRow.length==0) { |
| | | this.$message.error('è¯·éæ©æ°æ®'); |
| | | return; |
| | | } |
| | |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteLinkTemplate({ |
| | | name: this.templateForm, |
| | | btmName: this.nodeRow.label, |
| | | linkFlag: false |
| | | }).then(res => { |
| | | let names=this.selectionRow.map(item=>{ |
| | | return item.qtName |
| | | }) |
| | | deleteLinkTemplate({names:names.join(',')}).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTemp(); |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteTemplate({name:this.templateForm,btmName: this.nodeRow.label, linkFlag: this.radioForm == 1}).then(res => { |
| | | deleteTemplate({name:this.templateForm}).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTemp(); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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 v-for="(item,index) in formList" :key="index" :span="columnNumber"> |
| | | <el-tooltip :content="item.name" placement="top"> |
| | | <el-form-item :label="item.name + 'ï¼'" class="hiddenLabel"> |
| | | <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: 3, |
| | | 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);"> |
| | | <avue-tree :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <!-- 左侧æ --> |
| | | <div style="height: calc(100vh - 220px);"> |
| | | <div style="margin-bottom: 10px;display: flex;justify-content: center"> |
| | | <el-radio v-model="treeRadio" label="0" @input="TreeRadioChange">ä¸å¡ç±»åæ </el-radio> |
| | | <el-radio v-model="treeRadio" label="1" @input="TreeRadioChange">龿¥ç±»åæ </el-radio> |
| | | </div> |
| | | <avue-tree v-loading="treeLoading" :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-main> |
| | | <basic-container> |
| | | <avue-crud |
| | | v-if="!tableStatus" |
| | | :data="data" |
| | | :option="option" |
| | | :page.sync="page" |
| | | @size-change="sizeChange" |
| | | @current-change="currentChange"> |
| | | <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" @input="tableRadioChange">表å</el-radio> |
| | | <el-radio v-model="tableRadio" label="1" @input="tableRadioChange">è¡¨æ ¼<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 v-if="!tableStatus" 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" |
| | | import {gridPortalVIDatas} from "@/api/UI/formDefine/api" |
| | | import {getBizTypes} from "@/api/modeling/businessType/api"; |
| | | import {gridLink} from "@/api/modeling/linkType/api"; |
| | | import func from "@/util/func"; |
| | | |
| | | export default { |
| | | name: "index" |
| | | name: "index", |
| | | components: {FormDialog, TableDialog}, |
| | | data() { |
| | | return { |
| | | page: { |
| | | currentPage: 1, |
| | | pageSize: 10, |
| | | total: 0, |
| | | pageSizes: [10, 30, 50, 100], |
| | | }, |
| | | nodeRow: {}, |
| | | treeLoading: false, |
| | | option: { |
| | | ...basicOption, |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | column: [ |
| | | { |
| | | label: 'ä¸å¡åç§°', |
| | | prop: 'typeName', |
| | | }, |
| | | { |
| | | label: 'åç§°', |
| | | prop: 'viName', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: 'ç±»å', |
| | | prop: 'viTypeText', |
| | | }, |
| | | ] |
| | | }, |
| | | data: [], |
| | | tableRadio: "", |
| | | treeRadio: "0", |
| | | treeData: [], |
| | | treeOption: { |
| | | addBtn: false |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.getTreeList(); |
| | | }, |
| | | computed: { |
| | | tableStatus() { |
| | | return func.isEmptyObject(this.nodeRow) |
| | | } |
| | | }, |
| | | methods: { |
| | | // å³ä¾§æ°å¢ |
| | | addClickHandler() { |
| | | if (!this.tableRadio) { |
| | | this.$message.error('请å¨è¡¨æ ¼ä¸æ¹éæ©æ°å¢ç±»å'); |
| | | return; |
| | | } |
| | | |
| | | this.tableRadio === "0" ? this.$refs.formDialog.visible = true : this.$refs.tableDialog.visible = true; |
| | | }, |
| | | |
| | | // åå§åæ è¯·æ± |
| | | getTreeList() { |
| | | this.treeLoading = true; |
| | | getBizTypes().then(res => { |
| | | const data = res.data.data.map(item => { |
| | | item.label = item.attributes.id; |
| | | return item; |
| | | }); |
| | | this.treeData = data; |
| | | this.treeLoading = false; |
| | | }) |
| | | }, |
| | | |
| | | // 左侧ä¸å¡ç±»å忢 |
| | | TreeRadioChange(val) { |
| | | this.treeLoading = true; |
| | | this.resetTable(); |
| | | if (val === "0") { |
| | | getBizTypes().then(res => { |
| | | const data = res.data.data.map(item => { |
| | | item.label = item.attributes.id; |
| | | return item; |
| | | }); |
| | | this.treeData = data; |
| | | this.treeLoading = false; |
| | | }) |
| | | } else { |
| | | gridLink().then(res => { |
| | | const data = res.data.data.map(item => { |
| | | item.label = item.name; |
| | | return item; |
| | | }); |
| | | this.treeData = data; |
| | | this.treeLoading = false; |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | // 左侧æ ç¹å» |
| | | nodeClick(row) { |
| | | console.log(row); |
| | | this.tableRadio = null; |
| | | this.nodeRow = row; |
| | | this.getRightPortalVIDatas(row); |
| | | }, |
| | | |
| | | // éç½®è¡¨æ ¼å±ç¤ºä¿¡æ¯ å è¡¨æ ¼è¡¨åé项 |
| | | resetTable() { |
| | | this.data = []; |
| | | this.tableRadio = null; |
| | | }, |
| | | |
| | | // å³ä¾§ è¡¨æ ¼ 表å ä¿¡æ¯æ¥è¯¢ |
| | | getRightPortalVIDatas() { |
| | | const params = { |
| | | 'conditionMap[typeName]': this.treeRadio === '0' ? this.nodeRow.attributes.id : this.nodeRow.name, |
| | | 'conditionMap[viType]': this.tableRadio === '0' ? 'Form' : this.tableRadio === '1' ? 'Table' : '', |
| | | 'conditionMap[viTypeFlag]': this.treeRadio === '0' ? 'BtmType' : this.treeRadio === '1' ? 'LinkType' : '', |
| | | } |
| | | gridPortalVIDatas(this.page.currentPage, this.page.pageSize, params).then(res => { |
| | | console.log(res); |
| | | if (res.data.code === 200) { |
| | | const data = res.data.data; |
| | | this.data = data; |
| | | this.page.total = res.data.total; |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | sizeChange(val) { |
| | | this.page.pageSize = val; |
| | | this.getRightPortalVIDatas(); |
| | | }, |
| | | |
| | | // 页ç |
| | | currentChange(val) { |
| | | this.page.currentPage = val; |
| | | this.getRightPortalVIDatas(); |
| | | }, |
| | | |
| | | // è¡¨æ ¼ 表å忢 |
| | | tableRadioChange() { |
| | | this.getRightPortalVIDatas(); |
| | | }, |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | |
| | | .el-scrollbar__wrap { |
| | | overflow: auto !important; |
| | | } |
| | | .headerCon{ |
| | | .el-button{ |
| | | |
| | | .headerCon { |
| | | .el-button { |
| | | width: 82px; |
| | | } |
| | | } |