Bin/jre/lib/security/trusted.libraries
Source/plt-web/plt-web-parent/plt-poi/src/main/java/com/vci/starter/poi/util/ExcelUtil.java
@@ -997,6 +997,7 @@ 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; Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/po/PortalVIPO.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,88 @@ 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; } Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/po/QTDPO.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,46 @@ 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; } Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebPortalVIController.java
@@ -1,13 +1,12 @@ 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; @@ -15,19 +14,19 @@ 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; @@ -165,6 +164,30 @@ } } } /** * å¯¼åºæ°æ®åºç表信æ¯å°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(); } } /** * è·å屿§å段类å */ Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsPortalVIServiceI.java
@@ -9,7 +9,10 @@ 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; @@ -82,6 +85,12 @@ String exportToExcel(Collection<String> idList); /** * å¯¼å ¥è¡¨å/è¡¨æ ¼æ°æ® * @param file ä¸ä¼ çæä»¶ * @return */ public BaseResult importData(File file)throws Throwable; /** *æ¥è¯¢ææè¡¨åæè è¡¨æ ¼ * @return key æ¯çå½å¨æçç¼å·çè±æå°å * @throws VciBaseException æ¥è¯¢çæ¶ååºé伿åºå¼å¸¸ Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsPortalVIServiceImpl.java
@@ -4,6 +4,7 @@ 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; @@ -12,6 +13,9 @@ 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.poi.bo.WriteExcelOption; import com.vci.starter.poi.util.ExcelUtil; @@ -26,6 +30,7 @@ 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; @@ -39,6 +44,7 @@ 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.*; @@ -126,7 +132,7 @@ dataGrid.setData(portalVIVOS); dataGrid.setTotal(pagePortalVIArrayByPageInfoResult.total); }else{ dataGrid = new DataGrid<>("æ²ææ¥è¯¢å°æ°æ®"); dataGrid = new DataGrid<>(); } } catch (PLException e) { e.printStackTrace(); @@ -352,6 +358,21 @@ 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));//é ç½®ææ¬ @@ -420,6 +441,152 @@ return zip.getAbsoluteFile().getAbsolutePath(); } @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); 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 è¦åå ¥çæ°æ® Source/plt-web/plt-web-ui/src/api/UI/formDefine/api.js
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,14 @@ import request from '@/router/axios'; // å表æ¥è¯¢ export function gridPortalVIDatas(page,limit,params) { return request({ url: "/api/portalVIController/gridPortalVIDatas", method: "get", params:{ page, limit, ...params } }); } Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/businessType/index.vue
@@ -34,7 +34,7 @@ </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> @@ -927,6 +927,7 @@ name: 'el-icon-tickets', desc: 'el-icon-chat-line-square' }, treeLoading:false } }, created() { @@ -937,6 +938,7 @@ methods: { //æ 表æ¥è¯¢ getTreeList() { this.treeLoading = true; getBizTypes().then(res => { const data = res.data.data.map(item => { this.processChildren(item); // å¤çæ¯ä¸ªèç¹ @@ -944,8 +946,8 @@ return item.attributes; // è¿åå¤çåç attributes }); this.treeData[0].children = data; console.log(this.treeData); this.inheritTreeData = data; this.treeLoading = false; }); }, Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/formDialog.vue
@@ -24,9 +24,9 @@ </basic-container> </el-aside> <el-main > <el-main> <basic-container> <div style="height: 645px" @drop="drop" @dragover.prevent> <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> @@ -53,9 +53,9 @@ <h3>页é¢å®ä¹</h3> <el-form ref="form" :model="form" :rules="rules" label-width="100px"> <el-row> <el-col :span="columnNumber"> <el-tooltip v-for="(item,index) in formList" :key="index" :content="item.name" placement="top"> <el-form-item class="hiddenLabel" :label="item.name + 'ï¼'"> <el-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> @@ -338,7 +338,7 @@ name: "formDialog", data() { return { formList:[], formList: [], optionRightData: [ { name: 'test', @@ -347,7 +347,7 @@ ], form: {}, rules: {}, columnNumber: 12, columnNumber: 3, loading: false, visible: false, treeOption: { @@ -562,9 +562,9 @@ const data = JSON.parse(event.dataTransfer.getData('item')); console.log('data', data); const params = { name:data.label, value:'', type:'' name: data.label, value: '', type: '' } this.formList.push(params) } Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/index.vue
@@ -4,13 +4,13 @@ <el-aside> <basic-container> <div ref="TreeBox" style="height: calc(100vh - 144px);!important;"> <!-- 左侧æ --> <div style="height: calc(100vh - 280px);"> <!-- 左侧æ --> <div style="height: calc(100vh - 220px);"> <div style="margin-bottom: 10px;display: flex;justify-content: center"> <el-radio v-model="treeRadio" label="0">ä¸å¡ç±»åæ </el-radio> <el-radio v-model="treeRadio" label="1">龿¥ç±»åæ </el-radio> <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 :data="treeData" :option="treeOption" @node-click="nodeClick"> <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> @@ -26,13 +26,17 @@ <el-main> <basic-container> <avue-crud v-if="!tableStatus" :data="data" :option="option"> :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">表å</el-radio> <el-radio v-model="tableRadio" label="1">è¡¨æ ¼<span style="color: red;">ï¼å å¯¼å ¥è¡¨åï¼åå¯¼å ¥è¡¨æ ¼ï¼ï¼</span></el-radio> <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> @@ -53,7 +57,7 @@ </el-button> </template> </avue-crud> <div style="display: flex;justify-content: center;margin-top: 15px"> <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> @@ -71,17 +75,44 @@ 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", 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 delBtn: false, column: [ { label: 'ä¸å¡åç§°', prop: 'typeName', }, { label: 'åç§°', prop: 'viName', sortable: true, }, { label: 'ç±»å', prop: 'viTypeText', }, ] }, data: [], tableRadio: "", @@ -92,7 +123,16 @@ } } }, created() { this.getTreeList(); }, computed: { tableStatus() { return func.isEmptyObject(this.nodeRow) } }, methods: { // å³ä¾§æ°å¢ addClickHandler() { if (!this.tableRadio) { this.$message.error('请å¨è¡¨æ ¼ä¸æ¹éæ©æ°å¢ç±»å'); @@ -100,7 +140,93 @@ } 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>