Merge remote-tracking branch 'origin/master'
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.constant; |
| | | |
| | | public class PortalVIEnumConstant { |
| | | |
| | | /** |
| | | * 表åç±»åæä¸¾ |
| | | */ |
| | | public static final String PORTALVI_VI_TYPE = "portalVIType"; |
| | | |
| | | /*** |
| | | * 表åä¸å¡ç±»åæä¸¾ |
| | | */ |
| | | public static final String PORTALVI_VI_FLAG = "portalVITypeFlag"; |
| | | } |
| | |
| | | * 0: ä¸å¡ç±»å; 1: 龿¥ç±»å. é»è®¤0 |
| | | */ |
| | | private short typeFlag; |
| | | |
| | | /** |
| | | * ä¸å¡ç±»åæ¾ç¤ºå¼ |
| | | */ |
| | | private String typeFlagText; |
| | | /** |
| | | * ç±»åå |
| | | */ |
| | |
| | | * è§å¾ç±»å: è¾å
¥è¡¨åæå页å表 |
| | | */ |
| | | private short viType; |
| | | /** |
| | | *表åç±»å |
| | | */ |
| | | private String viTypeText; |
| | | /** |
| | | * å®ä¹è¯¦æ
|
| | | */ |
| | |
| | | this.prm = prm; |
| | | } |
| | | |
| | | public String getTypeFlagText() { |
| | | return typeFlagText; |
| | | } |
| | | |
| | | public void setTypeFlagText(String typeFlagText) { |
| | | this.typeFlagText = typeFlagText; |
| | | } |
| | | |
| | | public String getViTypeText() { |
| | | return viTypeText; |
| | | } |
| | | |
| | | public void setViTypeText(String viTypeText) { |
| | | this.viTypeText = viTypeText; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "PortalVIVO{" + |
| | | return "PortalVIDTO{" + |
| | | "id='" + id + '\'' + |
| | | ", typeFlag=" + typeFlag + |
| | | ", typeFlagText='" + typeFlagText + '\'' + |
| | | ", typeName='" + typeName + '\'' + |
| | | ", viName='" + viName + '\'' + |
| | | ", viType=" + viType + |
| | | ", viTypeText='" + viTypeText + '\'' + |
| | | ", prm=" + prm + |
| | | '}'; |
| | | } |
| | |
| | | package com.vci.model; |
| | | |
| | | import com.vci.constant.PortalVIEnumConstant; |
| | | import com.vci.starter.web.annotation.Transient; |
| | | import com.vci.starter.web.annotation.VciBtmType; |
| | | import com.vci.starter.web.annotation.VciUseEnum; |
| | | import com.vci.starter.web.constant.FrameWorkLcStatusConstant; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 0: ä¸å¡ç±»å; 1: 龿¥ç±»å. é»è®¤0 |
| | | */ |
| | | |
| | | @VciUseEnum(value = PortalVIEnumConstant.PORTALVI_VI_FLAG,defaultValue = "0",showTextField = "typeFlagText") |
| | | private short typeFlag; |
| | | /** |
| | | * ä¸å¡ç±»åæ¾ç¤ºææ¬ |
| | | */ |
| | | private String typeFlagText; |
| | | /** |
| | | * ç±»åå |
| | | */ |
| | |
| | | /** |
| | | * è§å¾ç±»å: è¾å
¥è¡¨åæå页å表 |
| | | */ |
| | | @VciUseEnum(value = PortalVIEnumConstant.PORTALVI_VI_TYPE,defaultValue = "0",showTextField = "viTypeText") |
| | | private short viType; |
| | | /** |
| | | * è§å¾ç±»åæ¾ç¤ºææ¬ |
| | | */ |
| | | private String viTypeText; |
| | | /** |
| | | * å®ä¹è¯¦æ
|
| | | */ |
| | |
| | | this.prm = prm; |
| | | } |
| | | |
| | | public String getTypeFlagText() { |
| | | return typeFlagText; |
| | | } |
| | | |
| | | public void setTypeFlagText(String typeFlagText) { |
| | | this.typeFlagText = typeFlagText; |
| | | } |
| | | |
| | | public String getViTypeText() { |
| | | return viTypeText; |
| | | } |
| | | |
| | | public void setViTypeText(String viTypeText) { |
| | | this.viTypeText = viTypeText; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "PortalVIVO{" + |
| | | return "PortalVIDO{" + |
| | | "id='" + id + '\'' + |
| | | ", typeFlag=" + typeFlag + |
| | | ", typeFlagText='" + typeFlagText + '\'' + |
| | | ", typeName='" + typeName + '\'' + |
| | | ", viName='" + viName + '\'' + |
| | | ", viType=" + viType + |
| | | ", viTypeText='" + viTypeText + '\'' + |
| | | ", prm='" + prm + '\'' + |
| | | '}'; |
| | | } |
| | |
| | | package com.vci.pagemodel; |
| | | |
| | | import com.vci.common.portal.enums.PortalVIType; |
| | | import com.vci.constant.EnumIdConstant; |
| | | import com.vci.starter.web.annotation.VciUseEnum; |
| | | |
| | | /** |
| | | * |
| | | * è¡¨åæ¾ç¤ºå¯¹è±¡ |
| | |
| | | */ |
| | | private short typeFlag; |
| | | /** |
| | | * ä¸å¡ç±»åæ¾ç¤ºå¼ |
| | | */ |
| | | private String typeFlagText; |
| | | /** |
| | | * ç±»åå |
| | | */ |
| | | private String typeName; |
| | |
| | | * è§å¾å |
| | | */ |
| | | private String viName; |
| | | |
| | | /** |
| | | * è§å¾ç±»å: è¾å
¥è¡¨åæå页å表 |
| | | */ |
| | | private short viType; |
| | | /** |
| | | *表åç±»å |
| | | */ |
| | | private String viTypeText; |
| | | /** |
| | | * å®ä¹è¯¦æ
|
| | | */ |
| | |
| | | this.prm = prm; |
| | | } |
| | | |
| | | public String getTypeFlagText() { |
| | | return typeFlagText; |
| | | } |
| | | |
| | | public void setTypeFlagText(String typeFlagText) { |
| | | this.typeFlagText = typeFlagText; |
| | | } |
| | | |
| | | public String getViTypeText() { |
| | | return viTypeText; |
| | | } |
| | | |
| | | public void setViTypeText(String viTypeText) { |
| | | this.viTypeText = viTypeText; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "PortalVIVO{" + |
| | | "id='" + id + '\'' + |
| | | ", typeFlag=" + typeFlag + |
| | | ", typeFlagText='" + typeFlagText + '\'' + |
| | | ", typeName='" + typeName + '\'' + |
| | | ", viName='" + viName + '\'' + |
| | | ", viType=" + viType + |
| | | ", viTypeText='" + viTypeText + '\'' + |
| | | ", prm=" + prm + |
| | | '}'; |
| | | } |
| | |
| | | import com.vci.pagemodel.PortalVIVO; |
| | | import com.vci.starter.web.annotation.controller.VciUnCheckRight; |
| | | import com.vci.starter.web.annotation.log.VciBusinessLog; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.BaseQueryObject; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.starter.web.pagemodel.DataGrid; |
| | | import com.vci.starter.web.util.ControllerUtil; |
| | | import com.vci.starter.web.util.LangBaseUtil; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.web.enumpck.ItemDblEnum; |
| | | import com.vci.web.enumpck.ItemTypeEnum; |
| | | import com.vci.web.service.OsPortalVIServiceI; |
| | | import com.vci.web.service.WebBtmIOServiceI; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.FileNotFoundException; |
| | | import java.io.IOException; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | /** |
| | | *æ ¹æ®è¡¨åidè·åå
·ä½æ°æ® |
| | | * @param id |
| | | * @param viType |
| | | * @return |
| | | */ |
| | | @GetMapping( "/getPortalVIById") |
| | | @VciBusinessLog(operateName = "è·å表å/è¡¨æ ¼æ°æ®") |
| | | public BaseResult getPortalVIById(@RequestBody String id,@RequestBody String viType){ |
| | | public BaseResult getPortalVIById(@RequestParam("id") String id,@RequestParam("viType") String viType){ |
| | | try{ |
| | | PortalVIVO portalVIVO= portalVIServiceI.getPortalVIById(id,viType); |
| | | return BaseResult.success(portalVIVO); |
| | | }catch (Throwable e){ |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "å建ä¸å¡ç±»åæ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | String exceptionMessage = "è·å表å/è¡¨æ ¼æ°æ®æ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | |
| | | */ |
| | | @DeleteMapping("/deleteByIds") |
| | | @VciBusinessLog(operateName = "å é¤è¡¨å/è¡¨æ ¼") |
| | | public BaseResult deleteByIds(@RequestBody String ids){ |
| | | public BaseResult deleteByIds(@RequestParam("ids") String ids){ |
| | | try { |
| | | return portalVIServiceI.delete(ids) ? BaseResult.success("å 餿åï¼"):BaseResult.fail("å é¤å¤±è´¥ï¼"); |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "å é¤è¡¨åæ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | String exceptionMessage = VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | |
| | | * |
| | | */ |
| | | @PostMapping("/clone") |
| | | @VciBusinessLog(operateName = "å é¤è¡¨å/è¡¨æ ¼") |
| | | @VciBusinessLog(operateName = "å
é表å/è¡¨æ ¼") |
| | | public BaseResult clone(@RequestBody ClonePortalVIDTOList portalVIDTOList){ |
| | | try { |
| | | return portalVIServiceI.clone(portalVIDTOList) ? BaseResult.success("å 餿åï¼"):BaseResult.fail("å é¤å¤±è´¥ï¼"); |
| | | return portalVIServiceI.clone(portalVIDTOList) ? BaseResult.success("å
éæåï¼"):BaseResult.fail("å
é失败ï¼"); |
| | | } catch (Throwable e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "å é¤è¡¨åæ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * å¯¼åºæ°æ®åºç表信æ¯å°excel |
| | | * @param response ååºå¯¹è±¡ |
| | | * @param btmTypeIds ä¸å¡ç±»åçç¼å·ï¼ç¨éå·åå² |
| | | */ |
| | | @PostMapping("/exportExcel") |
| | | @VciBusinessLog(operateName = "导åºè¡¨å/è¡¨æ ¼å°excelä¸") |
| | | public void exportExcel(String btmTypeIds,HttpServletResponse response){ |
| | | String excelFileName = portalVIServiceI.exportToExcel(VciBaseUtil.str2List(btmTypeIds)); |
| | | try { |
| | | ControllerUtil.writeFileToResponse(response,excelFileName); |
| | | } catch (IOException e) { |
| | | try { |
| | | ControllerUtil.writeDataToResponse(response, LangBaseUtil.getErrorMsg(e).getBytes(StandardCharsets.UTF_8),null); |
| | | } catch (IOException ex) { |
| | | ex.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | /** |
| | | * è·å屿§å段类å |
| | |
| | | * è·åè¶
龿¥å¼¹åºæ¹æ³ |
| | | */ |
| | | @GetMapping("/getItemDblList") |
| | | @VciBusinessLog(operateName = "屿§å段类å") |
| | | @VciBusinessLog(operateName = "è¶
龿¥ç±»å") |
| | | public BaseResult<List<KeyValue>> getItemDblList(){ |
| | | return BaseResult.dataList(ItemDblEnum.getEnumAll()); |
| | | } |
| | |
| | | package com.vci.web.enumpck; |
| | | |
| | | import com.vci.common.portal.enums.GetByType; |
| | | import com.vci.constant.PortalVIEnumConstant; |
| | | import com.vci.starter.web.annotation.VciEnum; |
| | | |
| | | /** |
| | | * 表åç±»å |
| | | * @author xiej |
| | | * |
| | | */ |
| | | @VciEnum(name = PortalVIEnumConstant.PORTALVI_VI_TYPE,text = "表åç±»å") |
| | | public enum PortalVIType { |
| | | Form("Form", "表å", (short)1), |
| | | Table("Table", "è¡¨æ ¼", (short)0); |
| | |
| | | public void setIntVal(short intVal) { |
| | | this.intVal = intVal; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.vci.web.enumpck; |
| | | |
| | | import com.vci.common.portal.enums.GetByType; |
| | | import com.vci.constant.PortalVIEnumConstant; |
| | | import com.vci.starter.web.annotation.VciEnum; |
| | | |
| | | /** |
| | | * è¡¨åæ è®°ç±»å |
| | | * @author xiej |
| | | * |
| | | */ |
| | | @VciEnum(name = PortalVIEnumConstant.PORTALVI_VI_FLAG,text = "表åæå±ä¸å¡ç±»åæä¸¾") |
| | | public enum PortalVITypeFlag { |
| | | LinkType("LinkType", "龿¥ç±»åç表å", (short)1), |
| | | BtmType("BtmType", "ä¸å¡ç±»åç表å", (short)0); |
| | |
| | | */ |
| | | boolean clone(ClonePortalVIDTOList portalVIDTOList)throws Throwable; |
| | | |
| | | |
| | | /** |
| | | * 导åºè¡¨å/è¡¨æ ¼çä¿¡æ¯å°Excelä¸ |
| | | * @param idList ä¸å¡ç±»åçç¼å·éå |
| | | * @return excelçå
¨è·¯å¾ |
| | | */ |
| | | String exportToExcel(Collection<String> idList); |
| | | |
| | | /** |
| | | *æ¥è¯¢ææè¡¨åæè
è¡¨æ ¼ |
| | |
| | | import com.vci.dto.*; |
| | | import com.vci.model.*; |
| | | import com.vci.pagemodel.*; |
| | | import com.vci.starter.poi.bo.WriteExcelData; |
| | | 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 java.util.*; |
| | | import java.util.concurrent.atomic.AtomicBoolean; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /* |
| | |
| | | throw new VciBaseException("è¯·éæ©è¦å
éç对象!"); |
| | | } |
| | | try { |
| | | String typeName=clonePortalVIDTOList.getClonePortalVIDTOList().get(0).getTypeName(); |
| | | PortalVI[] portalVIS= platformClientUtil.getPortalService().getPortalVIArrayByTypeName(typeName); |
| | | Map<String, PortalVIVO> PortalVIMap=new HashMap<>(); |
| | | if(!CollectionUtils.isEmpty(Arrays.asList(portalVIS))) { |
| | | List<PortalVIVO> portalVIVOS = portalVIDOO2VOS(Arrays.asList(portalVIS)); |
| | | PortalVIMap =portalVIVOS.stream().collect(Collectors.toMap(PortalVIVO::getViName, Function.identity())); |
| | | } |
| | | List<PortalVI> portalVIList=new ArrayList<>(); |
| | | for (ClonePortalVIDTO clonedestObject : clonePortalVIDTOList.getClonePortalVIDTOList()) { |
| | | String viName = clonedestObject.getViName(); |
| | | PortalVIDTO portalVIDTO = clonedestObject.getOldPortalVIDTO(); |
| | | String typeName = clonedestObject.getTypeName(); |
| | | short typeFlag = clonedestObject.getTypeFlag(); |
| | | if (viName != null) { |
| | | VciBaseUtil.alertNotNull(viName, "å
éåç§°ä¸å
许为空"); |
| | | if( PortalVIMap.containsKey(viName)){ |
| | | throw new VciBaseException("å
éåç§°"+viName+"å·²åå¨ï¼è¯·æ ¸å¯¹ï¼"); |
| | | } |
| | | PortalVI portalVI = UITools.getService().getPortalVIById(portalVIDTO.getId()); |
| | | portalVI.id = ObjectUtility.getNewObjectID36(); |
| | | portalVI.viName = viName; |
| | |
| | | if (typeFlag == PortalVITypeFlag.BtmType.getIntVal() || typeFlag == PortalVITypeFlag.LinkType.getIntVal()) { |
| | | portalVI.typeFlag = typeFlag; |
| | | } |
| | | UITools.getService().savePortalVI(portalVI); |
| | | platformClientUtil.getPortalService().savePortalVI(portalVI); |
| | | portalVIList.add(portalVI); |
| | | } |
| | | } |
| | | }catch (PLException e){ |
| | |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public String exportToExcel(Collection<String> idList) { |
| | | /*List<PortalVIVO> portalVIVOList= listByIds(idList); |
| | | 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); |
| | | |
| | | 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); |
| | | |
| | | 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(rowIndex, 6, length)); |
| | | //夿³¨ |
| | | rowDataList.add(new WriteExcelData(rowIndex, 7, attributeVO.getDescription() == null ? "" : attributeVO.getDescription())); |
| | | rowIndex++; |
| | | } |
| | | |
| | | index[0] = rowIndex; |
| | | }); |
| | | } |
| | | */ |
| | | |
| | | return null; |
| | | } |
| | | |
| | | public List<PortalVIVO> listByIds(Collection idList){ |
| | | List<PortalVIVO> portalVIVOList=new ArrayList<>(); |
| | | if(CollectionUtils.isEmpty(idList)){ |
| | | throw new VciBaseException("è¯·éæ©éè¦å¯¼åºçæ°æ®"); |
| | | } |
| | | List<PortalVI> portalVIList=new ArrayList<>(); |
| | | idList.stream().forEach(id->{ |
| | | try { |
| | | PortalVI portalVI= platformClientUtil.getPortalService().getPortalVIById(id.toString()); |
| | | portalVIList.add(portalVI); |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | }); |
| | | portalVIVOList= portalVIDOO2VOS(portalVIList); |
| | | return portalVIVOList; |
| | | } |
| | | private BaseResult savePortalVIDTO(PortalVIDTO portalVIDTO,boolean isEdit) { |
| | | |
| | | boolean _isBtm=false; |
| | |
| | | public PortalVIVO portalVIDOO2VO(PortalVI portalVI) { |
| | | PortalVIVO portalVIVO=new PortalVIVO(); |
| | | portalVIVO.setId(portalVI.id); |
| | | portalVIVO.setTypeFlagText(PortalVITypeFlag.getByIntVal(portalVI.typeFlag).getLabel()); |
| | | portalVIVO.setTypeFlag(portalVI.typeFlag); |
| | | portalVIVO.setTypeName(portalVI.typeName); |
| | | portalVIVO.setViName(portalVI.viName); |
| | | portalVIVO.setViType(portalVI.viType); |
| | | portalVIVO.setViTypeText(PortalVIType.getByIntVal(portalVI.viType).getLabel()); |
| | | |
| | | String prm= portalVI.prm; |
| | | if(StringUtils.isNotBlank(prm)) { |
| | | PRMDO prmdo = UITools.getPRM(prm); |
| | |
| | | List<String> itemSelectoutFieldList= allKeyList.stream().filter(s ->!itemOutFieldList.stream().map(s1 -> s1).collect(Collectors.toList()).contains(s) ).collect(Collectors.toList()); |
| | | prmItemVO.setItemSelectoutFieldList(itemSelectoutFieldList);//å¾
éæ©ç屿§å段 |
| | | prmItemVO.setItemOutFieldList(itemOutFieldList);//éè¦ä½¿ç¨çéå |
| | | List<String> itemSearchFieldList= itemOutFieldList.stream().filter(s ->!itemKeyFieldList.stream().map(s1 -> s1).collect(Collectors.toList()).contains(s) ).collect(Collectors.toList()); |
| | | // List<String> itemSearchFieldList= itemOutFieldList.stream().filter(s ->!CollectionUtils.isEmpty(itemKeyFieldList).stream().map(s1 -> s1).collect(Collectors.toList()).contains(s) ).collect(Collectors.toList()); |
| | | List<String> itemSearchFieldList=new ArrayList<>(); |
| | | if(!CollectionUtils.isEmpty(itemKeyFieldList)){ |
| | | itemSearchFieldList= itemOutFieldList.stream().filter(s ->!itemKeyFieldList.contains(s)).collect(Collectors.toList()); |
| | | }else{ |
| | | itemSearchFieldList=itemOutFieldList; |
| | | } |
| | | prmItemVO.setItemSearchFieldList(itemSearchFieldList);//å¾
æç´¢å段 |
| | | prmItemVO.setItemKeyFieldList(itemKeyFieldList);//æç´¢å段 |
| | | } |
| | |
| | | private void initTableConfigDTOO2DOData(PRMItemDO prmItemDO,PRMItemDTO prmItemDTO){ |
| | | |
| | | prmItemDO.setItemOutFields(VciBaseUtil.array2String(prmItemDTO.getItemOutFieldList().toArray(new String[]{})));//éè¦ä½¿ç¨çåæ®µ |
| | | prmItemDO.setItemKeyFields(VciBaseUtil.array2String(prmItemDTO.getItemKeyFieldList().toArray(new String[]{})));//éè¦æç´¢çåæ®µ |
| | | prmItemDO.setItemKeyFields(CollectionUtils.isEmpty(prmItemDTO.getItemKeyFieldList())?"":VciBaseUtil.array2String(prmItemDTO.getItemKeyFieldList().toArray(new String[]{})));//éè¦æç´¢çåæ®µ |
| | | List<String> newItemFieldWidthList=prmItemDTO.getItemFieldWidthList().stream().map(KeyValue::getValue).distinct().collect(Collectors.toList()); |
| | | prmItemDO.setItemFieldWidth(VciBaseUtil.array2String(newItemFieldWidthList.toArray(new String[]{}),":"));//åæ®µå®½åº¦ |
| | | List<ItemSeniorQueryBO> itemSeniorQueryBOS= prmItemDTO.getItemSeniorQueryBOS(); |
| | |
| | | private List<KeyValue> initItemFieldWidthList(String itemOutFields,String itemFieldWidth){ |
| | | List<KeyValue> keyValueList=new ArrayList<>(); |
| | | List<String>itemOutFieldList= VciBaseUtil.str2List(itemOutFields); |
| | | List<String>itemFieldWidthList= VciBaseUtil.str2List(itemFieldWidth); |
| | | List<String>itemFieldWidthList= VciBaseUtil.str2List(itemFieldWidth,":"); |
| | | if(itemOutFieldList.size()>0) { |
| | | for (int i = 0; i < itemOutFieldList.size(); i++) { |
| | | KeyValue keyValue = new KeyValue(); |
| | |
| | | params |
| | | }); |
| | | } |
| | | |
| | | // å é¤ç´¢å¼ |
| | | export function delIndex(params) { |
| | | return request({ |
| | | url: "/api/btmTypeController/delIndex", |
| | | method: "delete", |
| | | params |
| | | }); |
| | | } |
| | | |
| | | // åå»ºç´¢å¼ |
| | | export function addIndex(params) { |
| | | return request({ |
| | | url: "/api/btmTypeController/addIndex", |
| | | method: "post", |
| | | data:params |
| | | }); |
| | | } |
| | | |
| | |
| | | // å¢å æä½ç±»å |
| | | export function addOperationType(data) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/addOperationType", |
| | | url: "/api/hmSysModConfigController/addFuncOperationType", |
| | | method: "post", |
| | | data |
| | | }); |
| | | } |
| | | |
| | | // å¯¼åº |
| | | export const exportModule = (params) => { |
| | | return request({ |
| | | url: '/api/hmSysModConfigController/exportModule', |
| | | method: 'get', |
| | | headers: {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'}, |
| | | responseType: 'blob', |
| | | params |
| | | }) |
| | | } |
| | | |
| | | // ä¿®æ¹å«å |
| | | export function updateAlias(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/updateAlias", |
| | | method: "put", |
| | | data:params |
| | | }); |
| | | } |
| | | |
| | | // å 餿¨¡åä¸å
³èçæä½ç±»å |
| | | export function delFuncOperation(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/delFuncOperation", |
| | | method: "delete", |
| | | data:params |
| | | }); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/router/axios'; |
| | | |
| | | // æ°å¢ |
| | | export function addOperationType(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/addOperationType", |
| | | method: "post", |
| | | data:params |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹ |
| | | export function updateOperationType(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/updateOperationType", |
| | | method: "put", |
| | | data:params |
| | | }); |
| | | } |
| | | |
| | | // å é¤ |
| | | export function delOperationType(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/delOperationType", |
| | | method: "delete", |
| | | data:params |
| | | }); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/router/axios'; |
| | | |
| | | // å表æ¥è¯¢ |
| | | export function getAppConfigCategoryInfo(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/getAppConfigCategoryInfo", |
| | | method: "get", |
| | | params |
| | | }); |
| | | } |
| | | |
| | | // é
置项æ¥è¯¢ |
| | | export function getAppConfigDetailsByID(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/getAppConfigDetailsByID", |
| | | method: "get", |
| | | params |
| | | }); |
| | | } |
| | | |
| | | // å¢å é
ç½® |
| | | export function addAppConf(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/addAppConf", |
| | | method: "post", |
| | | data: params |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹é
ç½® |
| | | export function updateAppConf(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/updateAppConf", |
| | | method: "put", |
| | | data: params |
| | | }); |
| | | } |
| | | |
| | | // å¯¼åº |
| | | export function exportSysConf(params) { |
| | | return request({ |
| | | url: '/api/hmSysModConfigController/exportSysConf', |
| | | method: 'post', |
| | | headers: {'Content-Type': 'application/json;charset=UTF-8'}, |
| | | responseType: 'blob', |
| | | data: params |
| | | }) |
| | | } |
| | | |
| | | |
| | |
| | | style="text-align: center" |
| | | width="50%" |
| | | @close="dialogClose"> |
| | | <div style="margin-bottom: 20px;" v-if="topMethodsObj !== {} && topMethodsObj"> |
| | | <div> |
| | | <span>å¯¼åºæ¹å¼ï¼</span> |
| | | <el-radio-group v-model="radio"> |
| | | <el-radio :label="0" v-if="topMethodsObj.select">éæ©</el-radio> |
| | | <el-radio :label="1" v-if="topMethodsObj.all">å
¨é¨</el-radio> |
| | | <el-radio :label="2" v-if="topMethodsObj.page">页ç </el-radio> |
| | | </el-radio-group> |
| | | <span v-if="radio === 2" style="margin-left: 20px;color: #F56C6C; "> |
| | | <el-input v-model="pageExport" style="width: 150px"></el-input> ï¼è¾å
¥é¡µç æè
页é¢èå´ï¼å¦ï¼1-10ï¼</span> |
| | | </div> |
| | | </div> |
| | | <el-transfer |
| | | v-model="rightRoleData" |
| | | v-loading="loading" |
| | |
| | | style="text-align: left; display: inline-block;"> |
| | | </el-transfer> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <div class="valueInfo" v-if="bottomValue">已设置çå¼ä¸ºï¼[{{bottomValue}}]</div> |
| | | <el-button @click="visible = false" size="small">å æ¶</el-button> |
| | | <el-button type="primary" @click="sendHandler" size="small">ç¡® å®</el-button> |
| | | <div v-if="bottomValue" class="valueInfo">已设置çå¼ä¸ºï¼[{{ bottomValue }}]</div> |
| | | <el-button size="small" @click="visible = false">å æ¶</el-button> |
| | | <el-button size="small" type="primary" @click="sendHandler">ç¡® å®</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import func from "@/util/func"; |
| | | |
| | | export default { |
| | | name: "transfer", |
| | | props: ['title', 'leftRoleData', 'rightRoleData', 'transferTitle' , 'bottomValue'], |
| | | props: ['title', 'leftRoleData', 'rightRoleData', 'transferTitle', 'bottomValue', 'topMethodsObj', 'selectList'], |
| | | /** |
| | | * topMethodsObj:{ |
| | | select:true, |
| | | all:true, |
| | | page:false |
| | | }, |
| | | æ§å¶é¡¶å±éæ©é¡¹æ¯å¦å±ç¤ºï¼éè¦é
åselectListä½¿ç¨ |
| | | * @returns {object} |
| | | */ |
| | | data() { |
| | | return { |
| | | radio: 0, |
| | | pageExport: "", |
| | | visible: false, // éè¿ this.$refs.transfer.visible = true; å¼å¯åç»ä»¶å¯¹è¯æ¡ |
| | | data: [], |
| | | loading: false, |
| | |
| | | this.leftRoleData = []; |
| | | }, |
| | | sendHandler() { |
| | | this.$emit('transferSend', this.rightRoleData); |
| | | if (func.isEmptyObject(this.topMethodsObj)) { |
| | | this.$emit('transferSend', this.rightRoleData); |
| | | } else { |
| | | if (this.radio === 0) { |
| | | if (this.selectList.length <= 0) { |
| | | this.$message.warning('è¯·éæ©è¦å¯¼åºç模æ¿') |
| | | return |
| | | } |
| | | this.$emit('transferSend', this.rightRoleData, 0); |
| | | } else if (this.radio === 1) { |
| | | this.$emit('transferSend', this.rightRoleData, 1); |
| | | } |
| | | } |
| | | |
| | | this.visible = false; |
| | | }, |
| | | } |
| | |
| | | /deep/ .el-transfer-panel__list.is-filterable { |
| | | height: 323px; /* ç©¿æ¢æ¡å表é«åº¦ */ |
| | | } |
| | | .valueInfo{ |
| | | |
| | | .valueInfo { |
| | | float: left; |
| | | border: 1px solid #E9E7E7; |
| | | display: inline-block; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <p>transferSelect</p> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: "transferSelect" |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | |
| | | </ul> |
| | | <Divider left="30px" text="éæ©æä»¶åä¼èªå¨ä¸ä¼ "></Divider> |
| | | <el-upload |
| | | :name="fileName" |
| | | :action="fileUrl" |
| | | :before-upload="beforeUpload" |
| | | :data="fileData" |
| | |
| | | type: Array, |
| | | default: () => [] |
| | | }, |
| | | fileName: { |
| | | type: String, |
| | | default: () => "file" |
| | | }, |
| | | // å¯¹è¯æ¡å¤´é¨åç§° |
| | | title: { |
| | | type: String, |
| | |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- ä¸è´æ§æ£æ¥ --> |
| | | <!-- æ¥çç´¢å¼ --> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :visible.sync="indexVisible" |
| | |
| | | class="avue-dialog" |
| | | title="ç´¢å¼ä¿¡æ¯" |
| | | width="60%" |
| | | @close="indexDialogClose" |
| | | > |
| | | |
| | | <div v-loading="indexLoading" style="display: flex;height: 500px;width: 100%"> |
| | | <basic-container> |
| | | <div style="height: 390px"> |
| | | <el-button plain size="mini" style="margin-bottom: 5px" type="danger" |
| | | @click="deleteIndexLeftTreeClickHandler">å é¤ç´¢å¼ |
| | | </el-button> |
| | | <avue-tree |
| | | :data="indexLeftData" |
| | | :option="indexLeftOption" |
| | | @node-click="indexLeftNodeClick"></avue-tree> |
| | | </div> |
| | | </basic-container> |
| | | <div style="padding: 20px;width: 75%"> |
| | | <div> |
| | | <el-form ref="form" :model="indexForm" label-width="90px" size="mini"> |
| | | <el-form-item label="ç´¢å¼åç§°ï¼"> |
| | | <el-input v-model="indexForm.name" :readOnly="indexFormRead"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°ï¼"> |
| | | <el-input v-model="indexForm.desc"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div style="display: flex;justify-content: center"> |
| | | <el-button plain size="mini" type="success" @click="rightIndexAddClick">å¢å </el-button> |
| | | <el-button plain size="mini" type="danger">å é¤</el-button> |
| | | </div> |
| | | </div> |
| | | <avue-crud |
| | | :data="indexData" |
| | | :option="indexOption"></avue-crud> |
| | | </div> |
| | | </div> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :visible.sync="indexAttrVisible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | title="屿§ä¿¡æ¯" |
| | | width="60%" |
| | | > |
| | | <avue-crud |
| | | :data="indexAttrData" |
| | | :option="indexAttrOption" |
| | | @row-click="indexAttrRowClick"></avue-crud> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="indexAttrVisible = false">å æ¶</el-button> |
| | | <el-button type="primary" @click="indexAttrClickAddHandler">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="indexDialogClose">å æ¶</el-button> |
| | | <el-button type="primary" @click="indexClickAddHandler">ä¿ å</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | </el-container> |
| | |
| | | getUsedBtmLinkList, |
| | | checkBtmConsistency, |
| | | executeRepair, |
| | | getIndexByCondition |
| | | getIndexByCondition, |
| | | delIndex, |
| | | getAllAttributesByBtmId, |
| | | addIndex |
| | | } from "@/api/modeling/businessType/api" |
| | | import {gridAttribute} from "@/api/modeling/attributePool/api"; |
| | | import func from "@/util/func"; |
| | |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | indexVisible:false, |
| | | indexLoading: false, |
| | | indexFormRead: false, |
| | | indexAttrRow: {}, |
| | | indexAttrOption: { |
| | | ...basicOption, |
| | | height: 380, |
| | | highlightCurrentRow: true, |
| | | addBtn: false, |
| | | refreshBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | selection: false, |
| | | menu: false, |
| | | column: [ |
| | | { |
| | | label: '屿§ä¿¡æ¯', |
| | | prop: 'id', |
| | | sortable: true, |
| | | }, |
| | | ] |
| | | }, |
| | | indexAttrData: [], |
| | | indexData: [], |
| | | indexAttrVisible: false, |
| | | indexLeftNodeRow: {}, |
| | | indexForm: { |
| | | name: '', |
| | | desc: '' |
| | | }, |
| | | indexLeftData: [], |
| | | indexLeftOption: { |
| | | height: 'auto', |
| | | menu: false, |
| | | addBtn: false, |
| | | props: { |
| | | label: 'name', |
| | | value: 'id', |
| | | children: 'children', |
| | | }, |
| | | }, |
| | | indexOption: { |
| | | ...basicOption, |
| | | height: 280, |
| | | addBtn: false, |
| | | refreshBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | selection: false, |
| | | menu: false, |
| | | column: [ |
| | | { |
| | | label: 'ä¸å¡ç±»ååç§°', |
| | | prop: 'typeName', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: 'ç´¢å¼åç§°', |
| | | prop: 'indexName', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: '屿§åç§°', |
| | | prop: 'attrNames', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: 'æè¿°', |
| | | prop: 'desc', |
| | | sortable: true, |
| | | }, |
| | | ] |
| | | }, |
| | | indexVisible: false, |
| | | conDefaultCheckData: [], // ä¿çä¸ä¸ªæ¥å£è¿åçæ°æ® |
| | | conCheckLoading: false, |
| | | conCheckOption: { |
| | |
| | | if (res.data.code === 200) { |
| | | this.checkViewVisible = true; |
| | | const data = res.data.data.map(item => { |
| | | return{ |
| | | name:this.nodeRow.id, |
| | | source:item |
| | | return { |
| | | name: this.nodeRow.id, |
| | | source: item |
| | | } |
| | | }); |
| | | this.checkViewData = data; |
| | |
| | | }, |
| | | |
| | | // ä¸è´æ§æ£æ¥æé®ç¹å» |
| | | checkClickHandler(){ |
| | | checkBtmConsistency().then(res =>{ |
| | | if(res && res.data && res.data.data){ |
| | | checkClickHandler() { |
| | | this.createViewLoading = true; |
| | | checkBtmConsistency().then(res => { |
| | | this.createViewLoading = false; |
| | | if (res && res.data && res.data.data) { |
| | | this.conCheckVisible = true; |
| | | this.conCheckLoading = true; |
| | | if(res.data.code === 200){ |
| | | if (res.data.code === 200) { |
| | | const data = res.data.data[0]; |
| | | this.conDefaultCheckData = data; // ä¿çä¸ä»½åå§æ°æ® |
| | | this.conCheckLoading = false; |
| | |
| | | }) |
| | | this.conCheckData = outputData; |
| | | } |
| | | }else { |
| | | } else { |
| | | this.$message.success(res.data.msg); |
| | | } |
| | | }) |
| | |
| | | }, |
| | | |
| | | // åå»ºç´¢å¼æé®ç¹å» |
| | | indexClickHandler(){ |
| | | if(func.isEmptyObject(this.nodeRow)){ |
| | | indexClickHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('请è³å°éæ©ä¸æ¡æ°æ®'); |
| | | return; |
| | | } |
| | | this.getLeftIndex(); |
| | | this.indexVisible = true; |
| | | }, |
| | | |
| | | // å·¦ä¾§æ æ´æ° |
| | | getLeftIndex() { |
| | | const params = { |
| | | "conditionMap[typename]":this.nodeRow.id |
| | | "conditionMap[typename]": this.nodeRow.id |
| | | } |
| | | getIndexByCondition(params).then(res => { |
| | | console.log(res); |
| | | if (res.data.code === 200) { |
| | | const data = res.data.data.map(item => { |
| | | return { |
| | | indexName: item.indexName, |
| | | name: `${item.indexName} ${item.attrNames}`, |
| | | id: item.oid |
| | | } |
| | | }) |
| | | this.indexLeftData = data; |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // ç´¢å¼å·¦ä¾§æ ç¹å» |
| | | indexLeftNodeClick(row) { |
| | | this.indexLeftNodeRow = row; |
| | | }, |
| | | |
| | | // å é¤å·¦ä¾§æ ç´¢å¼ |
| | | deleteIndexLeftTreeClickHandler() { |
| | | if (func.isEmptyObject(this.indexLeftNodeRow)) { |
| | | this.$message.error('è¯·éæ©ä¸æ¡æ°æ®è¿è¡å é¤'); |
| | | return; |
| | | } |
| | | const params = { |
| | | btmName: this.nodeRow.id, |
| | | indexName: this.indexLeftNodeRow.indexName |
| | | }; |
| | | delIndex(params).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success('å é¤ç´¢å¼æå'); |
| | | this.getLeftIndex(); |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | //å³ä¾§è¡¨æ ¼æ·»å 屿§ |
| | | indexAttrClickAddHandler() { |
| | | if (func.isEmptyObject(this.indexAttrRow)) { |
| | | this.$message.error('请è³å°éæ©ä¸æ¡æ°æ®'); |
| | | return; |
| | | } |
| | | this.indexData.push( |
| | | { |
| | | typeName: this.nodeRow.id, |
| | | attrNames: this.indexAttrRow.id, |
| | | indexName: this.indexForm.name, |
| | | desc: this.indexForm.desc |
| | | } |
| | | ) |
| | | this.indexFormRead = true; |
| | | this.indexAttrVisible = false; |
| | | }, |
| | | |
| | | // å³ä¾§å±æ§è¡¨æ ¼è¡ç¹å» |
| | | indexAttrRowClick(row) { |
| | | this.indexAttrRow = row; |
| | | }, |
| | | |
| | | // å³ä¾§è¡¨æ ¼å¢å |
| | | rightIndexAddClick() { |
| | | if (!this.indexForm.name) { |
| | | this.$message.error('请è¾å
¥ç´¢å¼åç§°'); |
| | | return; |
| | | } |
| | | |
| | | // æ£æ¥æ¯å¦ä¸ºè±æå符 |
| | | const englishRegex = /^[A-Za-z]+$/; |
| | | if (!englishRegex.test(this.indexForm.name)) { |
| | | this.$message.error('ç´¢å¼åç§°åªè½å
å«è±æå符'); |
| | | return; |
| | | } |
| | | this.indexLoading = true; |
| | | getAllAttributesByBtmId({btmId: this.nodeRow.id}).then(res => { |
| | | if (res.data.code === 200) { |
| | | const data = res.data.data.map(item => { |
| | | return { |
| | | id: item.id |
| | | } |
| | | }) |
| | | this.indexAttrData = data; |
| | | } |
| | | this.indexLoading = false; |
| | | this.indexAttrVisible = true; |
| | | }) |
| | | }, |
| | | |
| | | // å建ä¿åç´¢å¼ |
| | | indexClickAddHandler() { |
| | | const params = { |
| | | typeName: this.nodeRow.id, |
| | | attrNames: this.indexData.map(item => item.attrNames).join(','), |
| | | indexName: this.indexForm.name, |
| | | } |
| | | addIndex([params]).then(res => { |
| | | console.log(res) |
| | | this.$message.success('å建æå'); |
| | | this.indexDialogClose(); |
| | | }).catch(err => { |
| | | this.indexDialogClose(); |
| | | }) |
| | | }, |
| | | |
| | | // ç´¢å¼å¯¹è¯æ¡åæ¶ |
| | | indexDialogClose() { |
| | | this.indexFormRead = false; |
| | | this.indexForm = {}; |
| | | this.indexData = []; |
| | | this.indexVisible = false; |
| | | } |
| | | } |
| | | } |
| | |
| | | <template> |
| | | <el-container> |
| | | <el-container v-loading="createdLoading"> |
| | | <el-aside> |
| | | <basic-container> |
| | | <div style="max-height: calc(100vh - 170px);overflow: auto"> |
| | |
| | | </el-button> |
| | | </div> |
| | | <div v-if="form.childType === 0" class="btnBox"> |
| | | <el-button icon="el-icon-edit" plain size="small" type="primary">ä¿®æ¹å«å |
| | | <el-button icon="el-icon-edit" plain size="small" type="primary" @click="updataAliasClickHandler">ä¿®æ¹å«å |
| | | </el-button> |
| | | <el-button icon="el-icon-close" plain size="small" type="danger">å é¤ |
| | | <el-button icon="el-icon-close" plain size="small" type="danger" @click="deleteOperationClickHandler">å é¤ |
| | | </el-button> |
| | | </div> |
| | | </basic-container> |
| | |
| | | <el-button type="primary" @click="methodsSaveClickHandler">ä¿ å</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <!--导å
¥ --> |
| | | <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" fileName="files" title="导å
¥" |
| | | @updata="resetFormValue"></upload-file> |
| | | </el-container> |
| | | </template> |
| | | |
| | |
| | | updateModel, |
| | | delModule, |
| | | exportFunctionSql, |
| | | addOperationType |
| | | addOperationType, |
| | | exportModule, |
| | | updateAlias, |
| | | delFuncOperation |
| | | } from "@/api/systemModel/mangeModel/api" |
| | | import func from "@/util/func"; |
| | | import basicOption from "@/util/basic-option"; |
| | |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | tipList: [], |
| | | upFileType: ['xls', 'xlsx'], |
| | | fileUrl: 'api/hmSysModConfigController/importModule', |
| | | createdLoading: false, |
| | | lastIndex: null, |
| | | methodsList: [], |
| | | methodsData: [], |
| | |
| | | methods: { |
| | | // æ è¡ç¹å» |
| | | nodeClick(row) { |
| | | console.log(row.childType); |
| | | this.form = {...row}; |
| | | this.nodeRow = {...row}; |
| | | this.addStatus = false; |
| | |
| | | |
| | | // æ°å¢æé® |
| | | addClickHandler() { |
| | | this.resetFormValue(); |
| | | // this.resetFormValue(); |
| | | this.defalutName.forEach(key => { |
| | | this.form[key] = null; |
| | | }) |
| | | this.form.isValid = false; |
| | | this.addStatus = true; |
| | | this.editStatus = false; |
| | | }, |
| | | |
| | | // æ¸
空表åç»å®å¼ |
| | | resetFormValue() { |
| | | this.defalutName.forEach(key => { |
| | | this.form[key] = null; |
| | | }) |
| | | this.form.isValid = false; |
| | | this.form = {}; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | }, |
| | | |
| | | // æ°å¢ä¿åæé® |
| | |
| | | return |
| | | } |
| | | if (this.form.name.length > 128) { |
| | | this.$message.error('模ååé¿åº¦è¶
è¿128ï¼'); |
| | | this.$message.error('模ååé¿åº¦ä¸è½è¶
è¿128ï¼'); |
| | | return |
| | | } |
| | | if (this.form.remark && this.form.remark.length > 255) { |
| | | this.$message.error('æè¿°é¿åº¦è¶
è¿255ï¼'); |
| | | this.$message.error('æè¿°é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.resourceDotNet && this.form.resourceDotNet.length > 255) { |
| | | this.$message.error('.NETæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | this.$message.error('.NETæ è¯é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.pathC && this.form.pathC.length > 255) { |
| | | this.$message.error('C/Sæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | this.$message.error('C/Sæ è¯é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.resourceMobile && this.form.resourceMobile.length > 255) { |
| | | this.$message.error('Mobileæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | this.$message.error('Mobileæ è¯é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | this.form.parentId = this.form.id; |
| | |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.addStatus = false; |
| | | // this.resetFormValue(); |
| | | this.form.childType = null; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | |
| | | |
| | | // ä¿®æ¹æé® |
| | | editClickHandler() { |
| | | console.log(this.form); |
| | | this.editStatus = true; |
| | | this.addStatus = false; |
| | | }, |
| | |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.editStatus = false; |
| | | // this.resetFormValue(); |
| | | this.form.childType = null; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | |
| | | type: 'warning' |
| | | }).then(() => { |
| | | delModule(this.form).then(res => { |
| | | console.log(res); |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.resetFormValue(); |
| | | this.addStatus = false; |
| | | this.editStatus = false; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | |
| | | if (res.data.code === 200) { |
| | | this.methodsVisble = false; |
| | | this.$message.success(res.data.msg); |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | this.resetFormValue(); |
| | | this.form.childType = null; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | | }, |
| | |
| | | } |
| | | ); |
| | | }, |
| | | |
| | | // ä¿®æ¹å«å |
| | | updataAliasClickHandler() { |
| | | const params = { |
| | | id: this.form.id, |
| | | isValid: this.form.isValid, |
| | | alias: this.form.alias |
| | | } |
| | | updateAlias(params).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // å 餿¨¡åä¸å
³èçæä½ç±»å |
| | | deleteOperationClickHandler() { |
| | | this.$confirm('æ¨ç¡®å®è¦å é¤æéæ©çæ°æ®åï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | const params = { |
| | | funcId: this.form.funcId, |
| | | operId: this.form.operId |
| | | } |
| | | delFuncOperation(params).then(res => { |
| | | console.log(res); |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.resetFormValue(); |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | // å¯¼åº |
| | | exportClickHandler() { |
| | | this.createdLoading = true; |
| | | exportModule().then(res => { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.createdLoading = false |
| | | this.$message.success('å¯¼åºæå'); |
| | | }).catch(err => { |
| | | this.$message.error(err); |
| | | }) |
| | | }, |
| | | |
| | | // 导å
¥ |
| | | upLoadClickHandler() { |
| | | this.$refs.upload.visible = true; |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <template> |
| | | <el-container> |
| | | <el-container v-loading="createdLoading"> |
| | | <el-aside> |
| | | <basic-container> |
| | | <div style="max-height: calc(100vh - 170px);overflow: auto"> |
| | |
| | | </el-button> |
| | | </div> |
| | | <div v-if="form.childType === 0" class="btnBox"> |
| | | <el-button icon="el-icon-edit" plain size="small" type="primary">ä¿®æ¹å«å |
| | | <el-button icon="el-icon-edit" plain size="small" type="primary" @click="updataAliasClickHandler">ä¿®æ¹å«å |
| | | </el-button> |
| | | <el-button icon="el-icon-close" plain size="small" type="danger">å é¤ |
| | | <el-button icon="el-icon-close" plain size="small" type="danger" @click="deleteOperationClickHandler">å é¤ |
| | | </el-button> |
| | | </div> |
| | | </basic-container> |
| | |
| | | <el-button type="primary" @click="methodsSaveClickHandler">ä¿ å</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <!--导å
¥ --> |
| | | <upload-file ref="upload" fileName="files" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="导å
¥" |
| | | @updata="resetFormValue"></upload-file> |
| | | </el-container> |
| | | </template> |
| | | |
| | |
| | | updateModel, |
| | | delModule, |
| | | exportFunctionSql, |
| | | addOperationType |
| | | addOperationType, |
| | | exportModule, |
| | | updateAlias, |
| | | delFuncOperation |
| | | } from "@/api/systemModel/mangeModel/api" |
| | | import func from "@/util/func"; |
| | | import basicOption from "@/util/basic-option"; |
| | |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | tipList: [], |
| | | upFileType: ['xls', 'xlsx'], |
| | | fileUrl: 'api/hmSysModConfigController/importModule', |
| | | createdLoading: false, |
| | | lastIndex: null, |
| | | methodsList: [], |
| | | methodsData: [], |
| | |
| | | |
| | | // æ°å¢æé® |
| | | addClickHandler() { |
| | | this.resetFormValue(); |
| | | // this.resetFormValue(); |
| | | this.defalutName.forEach(key => { |
| | | this.form[key] = null; |
| | | }) |
| | | this.form.isValid = false; |
| | | this.addStatus = true; |
| | | this.editStatus = false; |
| | | }, |
| | | |
| | | // æ¸
空表åç»å®å¼ |
| | | resetFormValue() { |
| | | this.defalutName.forEach(key => { |
| | | this.form[key] = null; |
| | | }) |
| | | this.form.isValid = false; |
| | | this.form = {}; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | }, |
| | | |
| | | // æ°å¢ä¿åæé® |
| | |
| | | return |
| | | } |
| | | if (this.form.name.length > 128) { |
| | | this.$message.error('模ååé¿åº¦è¶
è¿128ï¼'); |
| | | this.$message.error('模ååé¿åº¦ä¸è½è¶
è¿128ï¼'); |
| | | return |
| | | } |
| | | if (this.form.remark && this.form.remark.length > 255) { |
| | | this.$message.error('æè¿°é¿åº¦è¶
è¿255ï¼'); |
| | | this.$message.error('æè¿°é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.resourceDotNet && this.form.resourceDotNet.length > 255) { |
| | | this.$message.error('.NETæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | this.$message.error('.NETæ è¯é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.pathC && this.form.pathC.length > 255) { |
| | | this.$message.error('C/Sæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | this.$message.error('C/Sæ è¯é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.resourceMobile && this.form.resourceMobile.length > 255) { |
| | | this.$message.error('Mobileæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | this.$message.error('Mobileæ è¯é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | this.form.parentId = this.form.id; |
| | |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.addStatus = false; |
| | | // this.resetFormValue(); |
| | | this.form.childType = null; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | |
| | | |
| | | // ä¿®æ¹æé® |
| | | editClickHandler() { |
| | | console.log(this.form); |
| | | this.editStatus = true; |
| | | this.addStatus = false; |
| | | }, |
| | |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.editStatus = false; |
| | | // this.resetFormValue(); |
| | | this.form.childType = null; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | |
| | | type: 'warning' |
| | | }).then(() => { |
| | | delModule(this.form).then(res => { |
| | | console.log(res); |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.resetFormValue(); |
| | | this.addStatus = false; |
| | | this.editStatus = false; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | |
| | | if (res.data.code === 200) { |
| | | this.methodsVisble = false; |
| | | this.$message.success(res.data.msg); |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | this.resetFormValue(); |
| | | this.form.childType = null; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | | }, |
| | |
| | | } |
| | | ); |
| | | }, |
| | | |
| | | // ä¿®æ¹å«å |
| | | updataAliasClickHandler() { |
| | | const params = { |
| | | id: this.form.id, |
| | | isValid: this.form.isValid, |
| | | alias: this.form.alias |
| | | } |
| | | updateAlias(params).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // å 餿¨¡åä¸å
³èçæä½ç±»å |
| | | deleteOperationClickHandler() { |
| | | console.log(this.form); |
| | | const params = { |
| | | funcId: this.form.funcId, |
| | | operId: this.form.operId |
| | | } |
| | | delFuncOperation(params).then(res => { |
| | | console.log(res); |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.resetFormValue(); |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // å¯¼åº |
| | | exportClickHandler() { |
| | | this.createdLoading = true; |
| | | exportModule().then(res => { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.createdLoading = false |
| | | this.$message.success('å¯¼åºæå'); |
| | | }).catch(err => { |
| | | this.$message.error(err); |
| | | }) |
| | | }, |
| | | |
| | | // 导å
¥ |
| | | upLoadClickHandler() { |
| | | this.$refs.upload.visible = true; |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <el-aside> |
| | | <basic-container> |
| | | <div style="max-height: calc(100vh - 170px);overflow: auto"> |
| | | <avue-tree ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <avue-tree :key="refresh" ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <span slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <span style="font-size: 15px"> |
| | | <i class="el-icon-s-promotion"></i> |
| | |
| | | <el-form-item label="å«åï¼"> |
| | | <el-input v-model="form.alias" placeholder="请è¾å
¥å«å"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="ç¼å·ï¼"> |
| | | <el-input v-model="form.sort" placeholder="请è¾å
¥ç¼å·"></el-input> |
| | | <el-form-item label="顺åºï¼"> |
| | | <el-input-number v-model="form.sort" :min="0" :max="9999" label="顺åº"></el-input-number> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°ï¼"> |
| | | <el-input v-model="form.remark" placeholder="请è¾å
¥æè¿°"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div class="btnBox"> |
| | | <el-button v-if="!addStatus" :disabled="mangeShowBtn ? false : !childTypeBtn" icon="el-icon-plus" plain |
| | | <div v-if="nodeRow.childType === 0 || nodeRow.childType === -1" class="btnBox"> |
| | | <el-button v-if="!addStatus" :disabled="nodeRow.childType === 0" icon="el-icon-plus" plain |
| | | size="small" |
| | | type="primary" @click="addClickHandler">å¢å |
| | | </el-button> |
| | | <el-button v-if="addStatus" icon="el-icon-check" plain size="small" |
| | | type="success" @click="addSaveClickHandler">ä¿å |
| | | </el-button> |
| | | <el-button :disabled="mangeShowBtn" icon="el-icon-edit" plain size="small" type="primary" |
| | | @click="addClickHandler">ä¿®æ¹ |
| | | <el-button v-if="!editStatus" :disabled="nodeRow.childType === -1" icon="el-icon-edit" plain size="small" type="primary" |
| | | @click="editClickHandler">ä¿®æ¹ |
| | | </el-button> |
| | | <el-button :disabled="mangeShowBtn" icon="el-icon-close" plain size="small" type="danger" |
| | | @click="addClickHandler">å é¤ |
| | | <el-button v-if="editStatus" icon="el-icon-check" plain size="small" |
| | | type="success" @click="editSaveClickHandler">ä¿å |
| | | </el-button> |
| | | <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">导å
¥sql |
| | | <el-button :disabled="nodeRow.childType === -1" icon="el-icon-close" plain size="small" type="danger" |
| | | @click="delClickHandler">å é¤ |
| | | </el-button> |
| | | <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="sqlClickExportClick">导åºsql |
| | | </el-button> |
| | | </div> |
| | | </basic-container> |
| | |
| | | |
| | | <script> |
| | | //管çåè½æ¨¡å |
| | | import {getSysModelTreeMenuByPID, addModel} from "@/api/systemModel/mangeModel/api" |
| | | import {exportFunctionSql, getSysModelTreeMenuByPID} from "@/api/systemModel/mangeModel/api" |
| | | import {addOperationType,updateOperationType,delOperationType} from "@/api/systemModel/operateType/api" |
| | | import func from "@/util/func"; |
| | | |
| | | export default { |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | refresh:Math.random(), |
| | | editStatus:false, |
| | | addStatus: false, |
| | | nodeRow: {}, |
| | | form: {}, |
| | |
| | | treeLoad: (node, resolve) => { |
| | | const params = { |
| | | parentId: node.level === 0 ? "operateNode" : node.data.id, |
| | | modeType: node.level === 0 ? "firstNode" : node.data.modeType, |
| | | modeType: node.level === 0 ? 'firstNode' : "", |
| | | } |
| | | getSysModelTreeMenuByPID(params).then(res => { |
| | | resolve(res.data.data.map(item => { |
| | |
| | | created() { |
| | | }, |
| | | computed: { |
| | | /** |
| | | * childType |
| | | * 为-1 å
¨é¨æé®å±ç¤º ç¦ç¨ä¿®æ¹ å é¤ å¢å æä½ç±»å |
| | | * ä¸ä¸º-1 éè å é¤éç³»ç»æ¨¡å å é¤ä¸å¡æ¨¡å |
| | | * 为1æ¶ ç¦ç¨æä½ç±»åã导å
¥ãå¯¼åº |
| | | * 为2æ¶ ç¦ç¨å¢å 导å
¥ å¯¼åº |
| | | * mangeShowBtn 为 true è¯´ææ¯é¡¶å±èç¹ å
¨é¨æé®å±ç¤º ç¦ç¨ä¿®æ¹ å é¤ å¢å æä½ç±»å |
| | | * @returns {Number} |
| | | */ |
| | | mangeShowBtn() { |
| | | return this.form.childType === -1; |
| | | }, |
| | | childTypeBtn() { |
| | | return this.form.childType === 1; |
| | | } |
| | | }, |
| | | methods: { |
| | | // æ è¡ç¹å» |
| | |
| | | this.form = {...row}; |
| | | this.nodeRow = {...row}; |
| | | this.addStatus = false; |
| | | this.editStatus = false; |
| | | }, |
| | | // æ¸
空表åç»å®å¼ |
| | | resetFormValue() { |
| | | this.form = {}; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | }, |
| | | |
| | | |
| | | // æ°å¢æé® |
| | | addClickHandler() { |
| | | for (const key in this.form) { |
| | | if (this.form.hasOwnProperty(key)) { |
| | | this.form[key] = null; |
| | | } |
| | | } |
| | | this.form = {}; |
| | | this.addStatus = true; |
| | | this.editStatus = false; |
| | | }, |
| | | |
| | | // ä¿åæé® |
| | | addSaveClickHandler() { |
| | | console.log(this.form) |
| | | if (!this.form.name) { |
| | | this.$message.error('模ååä¸è½ä¸ºç©º'); |
| | | this.$message.error('åç§°ä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (!this.form.code) { |
| | | this.$message.error('æ è¯ä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (!this.form.alias) { |
| | | this.$message.error('å«åä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (!this.form.sort) { |
| | | this.$message.error('顺åºä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (this.form.name.length > 128) { |
| | | this.$message.error('模ååé¿åº¦è¶
è¿128ï¼'); |
| | | this.$message.error('åç§°é¿åº¦ä¸è½è¶
è¿128ï¼'); |
| | | return |
| | | } |
| | | if (this.form.remark && this.form.remark.length > 255) { |
| | | this.$message.error('æè¿°é¿åº¦è¶
è¿255ï¼'); |
| | | this.$message.error('æè¿°é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.resourceDotNet && this.form.resourceDotNet.length > 255) { |
| | | this.$message.error('.NETæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | if (this.form.alias && this.form.alias.length > 255) { |
| | | this.$message.error('å«åé¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.pathc && this.form.pathc.length > 255) { |
| | | this.$message.error('C/Sæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.resourceMobile && this.form.resourceMobile.length > 255) { |
| | | this.$message.error('Mobileæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | return |
| | | } |
| | | console.log(this.nodeRow); |
| | | this.form.parentId = this.nodeRow.id; |
| | | this.form.modeType = this.nodeRow.modeType; |
| | | addModel(this.form).then(res => { |
| | | console.log(res) |
| | | this.addStatus = false; |
| | | const params = { |
| | | name:this.form.name, |
| | | identify:this.form.code, |
| | | alias:this.form.alias, |
| | | desc:this.form.remark, |
| | | seq:this.form.sort |
| | | } |
| | | addOperationType(params).then(res => { |
| | | if(res.data.code === 200){ |
| | | this.$message.success(res.data.msg); |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | this.addStatus = false; |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | // ä¿®æ¹æé® |
| | | editClickHandler(){ |
| | | this.addStatus = false; |
| | | this.editStatus = true; |
| | | }, |
| | | |
| | | // ä¿®æ¹ä¿å |
| | | editSaveClickHandler(){ |
| | | console.log(this.form); |
| | | if (!this.form.name) { |
| | | this.$message.error('åç§°ä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (!this.form.code) { |
| | | this.$message.error('æ è¯ä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (!this.form.alias) { |
| | | this.$message.error('å«åä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (!this.form.sort) { |
| | | this.$message.error('顺åºä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (this.form.name.length > 128) { |
| | | this.$message.error('åç§°é¿åº¦ä¸è½è¶
è¿128ï¼'); |
| | | return |
| | | } |
| | | if (this.form.remark && this.form.remark.length > 255) { |
| | | this.$message.error('æè¿°é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.alias && this.form.alias.length > 255) { |
| | | this.$message.error('å«åé¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | }; |
| | | const params = { |
| | | id:this.form.id, |
| | | name:this.form.name, |
| | | identify:this.form.code, |
| | | alias:this.form.alias, |
| | | desc:this.form.remark, |
| | | seq:this.form.sort |
| | | } |
| | | updateOperationType(params).then(res => { |
| | | if(res.data.code === 200){ |
| | | this.$message.success(res.data.msg); |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | this.editStatus = false; |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // å é¤ |
| | | delClickHandler(){ |
| | | this.$confirm('æ¨ç¡®å®è¦å é¤æéæ©çæ°æ®åï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | delOperationType(this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.resetFormValue(); |
| | | this.addStatus = false; |
| | | this.editStatus = false; |
| | | this.nodeRow = {}; |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | // 导åºsql |
| | | sqlClickExportClick() { |
| | | exportFunctionSql({isFunction: false}).then(res => { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.$message.success('å¯¼åºæå'); |
| | | }).catch(err => { |
| | | this.$message.error(err); |
| | | }); |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <template> |
| | | <el-container> |
| | | <el-aside> |
| | | <basic-container> |
| | | <div style="max-height: calc(100vh - 170px);overflow: auto"> |
| | | <avue-tree :key="refresh" ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <span slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <span style="font-size: 15px"> |
| | | <i class="el-icon-s-promotion"></i> |
| | | {{ (node || {}).label }} |
| | | </span> |
| | | </span> |
| | | </avue-tree> |
| | | </div> |
| | | </basic-container> |
| | | </el-aside> |
| | | <el-main> |
| | | <basic-container> |
| | | |
| | | <avue-crud |
| | | ref="crud" |
| | | :data="configData" |
| | | :option="nodeRow.id === 'firstNode'? firstOption : configOption" |
| | | :table-loading="configLoading" |
| | | @selection-change="selectChange" |
| | | @row-click="rowClickHandler"> |
| | | <template slot="menuLeft"> |
| | | <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addClickHandler">å¢å |
| | | </el-button> |
| | | <el-button icon="el-icon-close" plain size="small" type="danger" @click="delClickHandler">å é¤ |
| | | </el-button> |
| | | <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">å¯¼åº |
| | | </el-button> |
| | | </template> |
| | | |
| | | <template #menu="{row,index,size}"> |
| | | <el-button icon="el-icon-edit" size="small" type="text" @click.stop="rowEditHandler(row,index)">ç¼è¾ |
| | | </el-button> |
| | | <el-button icon="el-icon-delete" size="small" type="text" @click.stop="rowDeleteHandler(row)">å é¤</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </el-main> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :title="nodeRow.id === 'firstNode' ? 'é
置项åç±»' : 'é
置项'" |
| | | :visible.sync="addVisible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | width="50%" |
| | | @close="addVisibleClose"> |
| | | <el-form ref="form" :model="form" label-width="80px"> |
| | | <el-form-item label="åç§°ï¼"> |
| | | <el-input v-model="form.name"></el-input> |
| | | </el-form-item> |
| | | <el-form-item v-if="nodeRow.id !== 'firstNode'" label="keyï¼"> |
| | | <el-input v-model="form.key"></el-input> |
| | | </el-form-item> |
| | | <el-form-item v-if="nodeRow.id !== 'firstNode'" label="valueï¼"> |
| | | <el-input v-model="form.value"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°ï¼"> |
| | | <el-input v-model="form.desc" type="textarea"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button size="small" @click="addVisibleClose">å æ¶</el-button> |
| | | <el-button size="small" type="primary" @click="addSaveClickHandler">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- 导åºç©¿æ¢æ¡ --> |
| | | <transfer ref="transfer" :left-role-data="leftRoleData" :right-role-data="rightRoleData" |
| | | :select-list="selectList" :top-methods-obj="topMethodsObj" :transferTitle="transferTitle" title="导åº" |
| | | @transferSend="exportSendHandler"> |
| | | </transfer> |
| | | </el-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getAppConfigCategoryInfo, |
| | | getAppConfigDetailsByID, |
| | | addAppConf, |
| | | updateAppConf, |
| | | exportSysConf |
| | | } from "@/api/systemModel/systemConfig/api" |
| | | import basicOption from "@/util/basic-option"; |
| | | import func from "@/util/func"; |
| | | |
| | | export default { |
| | | name: "index" |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | topMethodsObj: { |
| | | select: true, |
| | | all: true, |
| | | page: false |
| | | }, |
| | | transferTitle: ['æªéæ©', '已鿩'], |
| | | leftRoleData: [], |
| | | rightRoleData: [], |
| | | editStatus: false, |
| | | form: { |
| | | name: "", |
| | | desc: "" |
| | | }, |
| | | addVisible: false, |
| | | nodeRow: {}, |
| | | configLoading: false, |
| | | configData: [], |
| | | configOption: { |
| | | ...basicOption, |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | column: [ |
| | | { |
| | | label: 'åç§°', |
| | | prop: 'name', |
| | | sortable: true |
| | | }, |
| | | { |
| | | label: 'key', |
| | | prop: 'key', |
| | | sortable: true |
| | | }, |
| | | { |
| | | label: 'value', |
| | | prop: 'value', |
| | | overHidden: true, |
| | | sortable: true |
| | | }, |
| | | { |
| | | label: 'æè¿°', |
| | | overHidden: true, |
| | | prop: 'desc', |
| | | } |
| | | ] |
| | | }, |
| | | defaultData: [], // é¡¶å±èç¹æ°å¢åèµå¼æ°ç» |
| | | firstOption: { |
| | | ...basicOption, |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | column: [ |
| | | { |
| | | label: 'åç§°', |
| | | prop: 'name', |
| | | sortable: true |
| | | }, |
| | | { |
| | | label: 'æè¿°', |
| | | prop: 'desc', |
| | | } |
| | | ] |
| | | }, |
| | | refresh: Math.random(), |
| | | treeOption: { |
| | | height: 'auto', |
| | | menu: false, |
| | | addBtn: false, |
| | | defaultExpandAll: true, |
| | | props: { |
| | | label: 'name', |
| | | value: 'id', |
| | | children: 'children', |
| | | }, |
| | | }, |
| | | treeData: [ |
| | | { |
| | | name: 'ç³»ç»é
ç½®åç±»', |
| | | id: 'firstNode', |
| | | children: [] |
| | | } |
| | | ], |
| | | selectList: [], |
| | | lastIndex: null |
| | | } |
| | | }, |
| | | created() { |
| | | this.getTreeList(); |
| | | }, |
| | | methods: { |
| | | // å·¦ä¾§æ æ¥è¯¢ |
| | | getTreeList(val) { |
| | | getAppConfigCategoryInfo().then(res => { |
| | | if (res.data.code === 200) { |
| | | const data = res.data.data; |
| | | this.treeData[0].children = data; |
| | | if (val === 'save') { |
| | | this.configData = data; |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // æ èç¹ç¹å» |
| | | nodeClick(row) { |
| | | console.log(row); |
| | | this.nodeRow = row; |
| | | if (row.id === 'firstNode') { |
| | | this.configData = row.children; |
| | | } else { |
| | | this.configLoading = true; |
| | | getAppConfigDetailsByID({clsId: row.id}).then(res => { |
| | | if (res.data.code === 200) { |
| | | const data = res.data.data; |
| | | this.configData = data; |
| | | this.configLoading = false; |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | // å¢å æé® |
| | | addClickHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('è¯·éæ©ä¸æ¡èç¹è¿è¡æ·»å ï¼') |
| | | return; |
| | | } |
| | | this.addVisible = true; |
| | | this.editStatus = false; |
| | | }, |
| | | |
| | | // æ°å¢å¯¹è¯æ¡å
³é |
| | | addVisibleClose() { |
| | | Object.keys(this.form).forEach(key => { |
| | | this.form[key] = ""; |
| | | }) |
| | | this.addVisible = false; |
| | | }, |
| | | |
| | | // ä¿å |
| | | addSaveClickHandler() { |
| | | if (this.nodeRow.id === 'firstNode') { |
| | | if (!this.form.name) { |
| | | this.$message.error('åç§°ä¸è½ä¸ºç©ºï¼'); |
| | | return; |
| | | } |
| | | } else { |
| | | if (!this.form.name) { |
| | | this.$message.error('åç§°ä¸è½ä¸ºç©ºï¼'); |
| | | return; |
| | | } |
| | | if (!this.form.key) { |
| | | this.$message.error('keyå¼ä¸è½ä¸ºç©ºï¼'); |
| | | return; |
| | | } |
| | | if (!this.form.value) { |
| | | this.$message.error('valueå¼ä¸è½ä¸ºç©ºï¼'); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | const params = this.nodeRow.id === 'firstNode' ? { |
| | | appConfigDetailInfo: { |
| | | name: this.form.name, |
| | | desc: this.form.desc, |
| | | id: this.editStatus ? this.form.id : null |
| | | }, |
| | | isConfCategorys: true //true表示ç»é¡¶å±æ·»å é
置项åç±» |
| | | } : { |
| | | appConfigDetailInfo: { |
| | | categoryId: this.nodeRow.id, |
| | | name: this.form.name, |
| | | desc: this.form.desc, |
| | | key: this.form.key, |
| | | value: this.form.value, |
| | | id: this.editStatus ? this.form.id : null |
| | | }, |
| | | isConfCategorys: false //true表示ç»é¡¶å±æ·»å é
置项åç±» |
| | | } |
| | | const saveApi = this.editStatus ? updateAppConf : addAppConf; |
| | | saveApi(params).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.addVisibleClose(); |
| | | if (this.nodeRow.id === 'firstNode') { |
| | | this.getTreeList('save'); |
| | | } else { |
| | | this.configLoading = true; |
| | | getAppConfigDetailsByID({clsId: this.nodeRow.id}).then(res => { |
| | | if (res.data.code === 200) { |
| | | const data = res.data.data; |
| | | this.configData = data; |
| | | this.configLoading = false; |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // ç¼è¾æé® |
| | | rowEditHandler(row) { |
| | | this.addVisible = true; |
| | | this.form = {...row}; |
| | | this.editStatus = true; |
| | | }, |
| | | |
| | | // è¡å é¤ |
| | | rowDeleteHandler(row) { |
| | | const params = { |
| | | ids: row.id, |
| | | isConfCategorys: this.nodeRow.id === 'firstNode' ? true : false |
| | | } |
| | | getAppConfigCategoryInfo(params).then(res => { |
| | | console.log(res) |
| | | if (res.data.code === 200) { |
| | | this.$message.success('å 餿å'); |
| | | if (this.nodeRow.id === 'firstNode') { |
| | | this.getTreeList('save'); |
| | | } else { |
| | | this.configLoading = true; |
| | | getAppConfigDetailsByID({clsId: this.nodeRow.id}).then(res => { |
| | | if (res.data.code === 200) { |
| | | const data = res.data.data; |
| | | this.configData = data; |
| | | this.configLoading = false; |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // éæ©æ¡ |
| | | selectChange(row) { |
| | | this.selectList = row; |
| | | }, |
| | | |
| | | // ç¹å»è¡ |
| | | rowClickHandler(row) { |
| | | func.rowClickHandler( |
| | | row, |
| | | this.$refs.crud, |
| | | this.lastIndex, |
| | | (newIndex) => { |
| | | this.lastIndex = newIndex; |
| | | }, |
| | | () => { |
| | | this.selectList = []; |
| | | } |
| | | ); |
| | | }, |
| | | |
| | | // å¤éå é¤ |
| | | delClickHandler() { |
| | | if (this.selectList.length <= 0) { |
| | | this.$message.error('请è³å°éæ©ä¸æ¡æ°æ®'); |
| | | return; |
| | | } |
| | | const params = { |
| | | ids: this.selectList.map(item => { |
| | | return item.id |
| | | }).join(','), |
| | | isConfCategorys: this.nodeRow.id === 'firstNode' ? true : false |
| | | } |
| | | getAppConfigCategoryInfo(params).then(res => { |
| | | console.log(res) |
| | | if (res.data.code === 200) { |
| | | this.$message.success('å 餿å'); |
| | | if (this.nodeRow.id === 'firstNode') { |
| | | this.getTreeList('save'); |
| | | } else { |
| | | this.configLoading = true; |
| | | getAppConfigDetailsByID({clsId: this.nodeRow.id}).then(res => { |
| | | if (res.data.code === 200) { |
| | | const data = res.data.data; |
| | | this.configData = data; |
| | | this.configLoading = false; |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // å¯¼åºæé® |
| | | exportClickHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('请è³å°éæ©ä¸æ¡æ°æ®'); |
| | | return; |
| | | } |
| | | this.leftRoleData = this.nodeRow.id === 'firstNode' ? [ |
| | | { |
| | | name: 'åç§°', |
| | | oid: 'name' |
| | | }, |
| | | { |
| | | name: 'æè¿°', |
| | | oid: 'desc' |
| | | } |
| | | ] : [ |
| | | { |
| | | name: 'åç§°', |
| | | oid: 'name' |
| | | }, |
| | | { |
| | | name: 'key', |
| | | oid: 'key' |
| | | }, |
| | | { |
| | | name: 'value', |
| | | oid: 'value' |
| | | }, |
| | | { |
| | | name: 'æè¿°', |
| | | oid: 'desc' |
| | | } |
| | | ] |
| | | this.$refs.transfer.visible = true; |
| | | }, |
| | | |
| | | // 导åºä¿å |
| | | exportSendHandler(row, index) { |
| | | console.log(row, index); |
| | | const params = { |
| | | expType: index === 0 ? 'select' : index === 1 ? 'all' : '', |
| | | expAttrNames: row, |
| | | selectDataIdentify: index === 0 ? this.selectList.map(item => { |
| | | return item.id |
| | | }) : null, |
| | | conditionMap: { |
| | | "isExpAppConfDetail": this.nodeRow.id === 'firstNode' ? false : true, |
| | | "clsId": this.nodeRow.id !== 'firstNode' ? this.nodeRow.id : null |
| | | } |
| | | } |
| | | exportSysConf(params).then(res => { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.$message.success('å¯¼åºæå'); |
| | | }).catch(err => { |
| | | this.$message.error(err); |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | |
| | | <template> |
| | | |
| | | <basic-container> |
| | | <div class="container"> |
| | | <el-form ref="form" :model="form" label-width="150px"> |
| | | <el-form-item label="å½åå¨çº¿ç¨æ·äººæ°"> |
| | | <div style="display: flex;"> |
| | | <el-input v-model="form.name" :readOnly="true"></el-input> |
| | | <el-button plain style="margin-left: 10px"> å·æ°</el-button> |
| | | </div> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: "index" |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | form: { |
| | | name: '0' |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | .container { |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | width: 500px; |
| | | height: 500px; |
| | | margin: auto; |
| | | } |
| | | </style> |