From 9900d07ca84f9a1718f8b8781c567ecae9f232b6 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期五, 30 八月 2024 15:48:06 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
Source/plt-web/plt-web-ui/src/components/refer/vciWebReferClassify.vue | 46 +
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/po/PortalVIPO.java | 88 ++++
Source/plt-web/plt-web-ui/src/api/queryTemplate/linkTypeQuery.js | 20 +
Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue | 16
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsPortalVIServiceI.java | 9
Source/plt-web/plt-web-ui/src/components/refer/vciWebReferTable.vue | 8
Source/plt-web/plt-web-ui/src/components/refer/vciWebReferTree.vue | 2
Source/plt-web/plt-web-ui/src/components/refer/orgDeptRefer.vue | 2
Source/plt-web/plt-web-ui/src/components/refer/BasicClassifyRefer.vue | 2
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/po/QTDPO.java | 46 ++
Source/plt-web/plt-web-ui/src/components/refer/vciWebRefer.vue | 6
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/queryDefine/index.vue | 2
Source/plt-web/plt-web-parent/plt-poi/src/main/java/com/vci/starter/poi/util/ExcelUtil.java | 1
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue | 120 ++---
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebPortalVIController.java | 33 +
Source/plt-web/plt-web-ui/src/App.vue | 4
Source/plt-web/plt-web-ui/src/components/refer/orgUserRefer.vue | 12
Source/plt-web/plt-web-ui/src/api/queryTemplate/queryDefine.js | 14
Source/plt-web/plt-web-ui/src/api/modeling/linkType/api.js | 8
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsPortalVIServiceImpl.java | 169 ++++++++
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue | 487 +++++++++++++++++++++++++
Source/plt-web/plt-web-ui/src/components/refer/vciWebReferDefalut.vue | 8
22 files changed, 973 insertions(+), 130 deletions(-)
diff --git a/Source/plt-web/plt-web-parent/plt-poi/src/main/java/com/vci/starter/poi/util/ExcelUtil.java b/Source/plt-web/plt-web-parent/plt-poi/src/main/java/com/vci/starter/poi/util/ExcelUtil.java
index 2ed445e..a5d5e0e 100644
--- a/Source/plt-web/plt-web-parent/plt-poi/src/main/java/com/vci/starter/poi/util/ExcelUtil.java
+++ b/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;
diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/po/PortalVIPO.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/po/PortalVIPO.java
new file mode 100644
index 0000000..3e077ef
--- /dev/null
+++ b/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;
+
+
+
+}
diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/po/QTDPO.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/po/QTDPO.java
new file mode 100644
index 0000000..5b42103
--- /dev/null
+++ b/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;
+
+}
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebPortalVIController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebPortalVIController.java
index 3d37d4c..c14d6ed 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebPortalVIController.java
+++ b/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();
+ }
+ }
+
/**
* 鑾峰彇灞炴�у瓧娈电被鍨�
*/
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsPortalVIServiceI.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsPortalVIServiceI.java
index 223f0d6..abde37b 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsPortalVIServiceI.java
+++ b/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 鏌ヨ鐨勬椂鍊欏嚭閿欎細鎶涘嚭寮傚父
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsPortalVIServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsPortalVIServiceImpl.java
index b8a46a6..45abd95 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsPortalVIServiceImpl.java
+++ b/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()) {//濡傛灉瀵煎叆鐨則able锛屽垯闇�瑕佹牎楠岃〃鏍煎叧鑱旂殑琛ㄥ崟鏄惁瀛樺湪锛屽鏋滀笉瀛樺湪鍒欏湪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);
+ //浠巈xecl鑾峰彇鏌ヨ妯℃澘瀹氫箟.
+ /* 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()) {//濡傛灉瀵煎叆鐨則able锛屽垯闇�瑕佹牎楠岃〃鏍煎叧鑱旂殑琛ㄥ崟鏄惁瀛樺湪锛屽鏋滀笉瀛樺湪鍒欏湪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();
+ }
/**
* 鎷疯礉鏁版嵁鍒皐ord妯℃澘涓�
* @param fileName 瑕佸啓鍏ョ殑鏁版嵁
diff --git a/Source/plt-web/plt-web-ui/src/App.vue b/Source/plt-web/plt-web-ui/src/App.vue
index 7fc0795..a19b123 100644
--- a/Source/plt-web/plt-web-ui/src/App.vue
+++ b/Source/plt-web/plt-web-ui/src/App.vue
@@ -35,8 +35,8 @@
margin: 50px auto;
}
.avue-dialog .el-dialog{
- top:47%;
- max-height: calc(100% - 100px);
+ top:50%;
+ max-height: calc(100% - 80px);
-webkit-transform: translate(-50%, 0);
transform: translate(-50%, -50%);
margin-top: 0 !important;
diff --git a/Source/plt-web/plt-web-ui/src/api/modeling/linkType/api.js b/Source/plt-web/plt-web-ui/src/api/modeling/linkType/api.js
index 1621bf1..862ce13 100644
--- a/Source/plt-web/plt-web-ui/src/api/modeling/linkType/api.js
+++ b/Source/plt-web/plt-web-ui/src/api/modeling/linkType/api.js
@@ -89,3 +89,11 @@
});
}
+// 閾炬帴绫诲瀷鏌ヨ妯℃澘鎺掑簭璁剧疆瀛楁涓嬫媺锛屽弬鏁發inkType=witoannotatelink&btmType=fileobject&direction=positive
+export function getAllOrderbyAttributeByLink(params) {
+ return request({
+ url: "/api/linkTypeController/getAllOrderbyAttributeByLink",
+ method: "get",
+ params
+ });
+}
diff --git a/Source/plt-web/plt-web-ui/src/api/queryTemplate/linkTypeQuery.js b/Source/plt-web/plt-web-ui/src/api/queryTemplate/linkTypeQuery.js
index 12b013c..6e55884 100644
--- a/Source/plt-web/plt-web-ui/src/api/queryTemplate/linkTypeQuery.js
+++ b/Source/plt-web/plt-web-ui/src/api/queryTemplate/linkTypeQuery.js
@@ -1,10 +1,28 @@
import request from '@/router/axios';
//閾炬帴绫诲瀷鏌ヨ妯℃澘
+//鍒楄〃
+export function getObjTypeQTs(btName) {
+ return request({
+ url: "/api/templateController/getObjTypeQTs",
+ method: "get",
+ params:{
+ btName
+ }
+ });
+}
+// 鍒涘缓
+export function linkSave(params) {
+ return request({
+ url: "/api/templateController/linkSave",
+ method: "post",
+ data:params
+ });
+}
// 鍒犻櫎
export function deleteLinkTemplate(params) {
return request({
url: "/api/templateController/deleteLinkTemplate",
method: "delete",
- data:params
+ params:params
});
}
diff --git a/Source/plt-web/plt-web-ui/src/api/queryTemplate/queryDefine.js b/Source/plt-web/plt-web-ui/src/api/queryTemplate/queryDefine.js
index 38c5e44..4d9946c 100644
--- a/Source/plt-web/plt-web-ui/src/api/queryTemplate/queryDefine.js
+++ b/Source/plt-web/plt-web-ui/src/api/queryTemplate/queryDefine.js
@@ -11,16 +11,6 @@
});
}
-export function getObjTypeQTs(params) {
- return request({
- url: "/api/templateController/getObjTypeQTs",
- method: "get",
- params:{
- ...params
- }
- });
-}
-
// 淇敼
export function updateTemplate(params) {
return request({
@@ -44,7 +34,9 @@
return request({
url: "/api/templateController/deleteTemplate",
method: "delete",
- data:params
+ params:{
+ ...params
+ }
});
}
diff --git a/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue b/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue
index ca5e5b4..8591918 100644
--- a/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue
+++ b/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue
@@ -184,8 +184,8 @@
},
initItem(item){
const type=this.columnType[item.type] || item.type;
+ item.text=item.text || item.label;
const col= {
- ...item,
label: item.text,
prop: item.field,
showProp:item.showField,
@@ -206,22 +206,23 @@
valueFormat: item.dateFormate || "yyyy-MM-dd HH:mm:ss",
format: item.dateFormate,
rules: this.isEdit?(type=="select" || type=="refer" || type=="date" || type=="datetime"?[{
- required: item.required,
+ required: item.required || false,
message: `璇烽�夋嫨${item.text}!`,
trigger: "change"
},{
- required: item.required,
+ required: item.required|| false,
message: `璇烽�夋嫨${item.text}!`,
trigger: "submit"
}]:[{
- required: item.required,
+ required: item.required|| false,
message: `璇疯緭鍏�${item.text}!`,
trigger: "blur"
},{
- required: item.required,
+ required: item.required|| false,
message: `璇疯緭鍏�${item.text}!`,
trigger: "submit"
- }]):[]
+ }]):[],
+ ...item
};
if(!this.isEdit){
col.placeholder=col.label;
@@ -340,6 +341,9 @@
},
clearValidate(props){
this.$refs.form.clearValidate(props)
+ },
+ updateDic(prop,data){
+ this.$refs.form.updateDic(prop,data)
}
},
};
diff --git a/Source/plt-web/plt-web-ui/src/components/refer/BasicClassifyRefer.vue b/Source/plt-web/plt-web-ui/src/components/refer/BasicClassifyRefer.vue
index 0071ba0..13c9cb2 100644
--- a/Source/plt-web/plt-web-ui/src/components/refer/BasicClassifyRefer.vue
+++ b/Source/plt-web/plt-web-ui/src/components/refer/BasicClassifyRefer.vue
@@ -47,7 +47,7 @@
default:'70%'
}, height: {
type: String,
- default:'60%'
+ default:(document.body.clientHeight-400)+'px'
},
reloadFormKey: {
type: String,
diff --git a/Source/plt-web/plt-web-ui/src/components/refer/orgDeptRefer.vue b/Source/plt-web/plt-web-ui/src/components/refer/orgDeptRefer.vue
index 407dbd3..fd70d32 100644
--- a/Source/plt-web/plt-web-ui/src/components/refer/orgDeptRefer.vue
+++ b/Source/plt-web/plt-web-ui/src/components/refer/orgDeptRefer.vue
@@ -66,7 +66,7 @@
default:'70%'
}, height: {
type: String,
- default:'60%'
+ default:(document.body.clientHeight-400)+'px'
},
reloadFormKey: {
type: String,
diff --git a/Source/plt-web/plt-web-ui/src/components/refer/orgUserRefer.vue b/Source/plt-web/plt-web-ui/src/components/refer/orgUserRefer.vue
index 611d217..8bc2df6 100644
--- a/Source/plt-web/plt-web-ui/src/components/refer/orgUserRefer.vue
+++ b/Source/plt-web/plt-web-ui/src/components/refer/orgUserRefer.vue
@@ -48,7 +48,7 @@
default:'70%'
}, height: {
type: String,
- default:'60%'
+ default:(document.body.clientHeight-400)+'px'
},
reloadFormKey: {
type: String,
@@ -73,36 +73,32 @@
rConfig.options.tableConfig={
cols:[{
prop: 'code',
- label: '鐢ㄦ埛鍚�',
+ label: (this.$project.user.code || "璐﹀彿"),
sortable: true,
- width: 150,
search: true
},{
prop: 'name',
label: '濮撳悕',
sortable: true,
- width: 150,
search: true
}, {
prop: 'deptIdName',
label: '鎵�灞為儴闂�',
- width: 260,
}, {
prop: 'sexText',
label: '鎬у埆',
- width: 80
}]
};
rConfig.options.classifys=[{
title:'閮ㄩ棬',
treeUrl:'/org/deptController/referGrid', //鍒嗙被鐨勮矾寰�
- queryByClassifyUrl:'/permission/userQueryController/listUserByDeptId', //'鍒楄〃'
+ queryByClassifyUrl:'/permission/userQueryController/gridUserByDeptIdGet', //'鍒楄〃'
queryField:'deptId', //鍒楄〃鏁版嵁涓垎绫荤殑瀛楁
classifyValueField:'id', //浠庢爲涓婅幏鍙栫殑瀛楁
},{
title:'瑙掕壊',
treeUrl:'/permission/roleController/referGrid', //鍒嗙被鐨勮矾寰�
- queryByClassifyUrl:'/permission/userQueryController/listUserByRoleId', //'鍒楄〃'
+ queryByClassifyUrl:'/permission/userQueryController/gridUserInRoleIdGet', //'鍒楄〃'
queryField:'roleId', //鍒楄〃鏁版嵁涓垎绫荤殑瀛楁
classifyValueField:'id', //浠庢爲涓婅幏鍙栫殑瀛楁
}];
diff --git a/Source/plt-web/plt-web-ui/src/components/refer/vciWebRefer.vue b/Source/plt-web/plt-web-ui/src/components/refer/vciWebRefer.vue
index c07ef45..71b1c3d 100644
--- a/Source/plt-web/plt-web-ui/src/components/refer/vciWebRefer.vue
+++ b/Source/plt-web/plt-web-ui/src/components/refer/vciWebRefer.vue
@@ -178,10 +178,10 @@
},
data() {
return {
- refertype: this.referConfig.type,
+ refertype: this.referConfig.options.type,
emitData: {},
- width:this.referConfig.width || '900px',
- height:this.referConfig.height || '500px'
+ width:this.referConfig.options.width,
+ height:this.referConfig.options.height
};
},
computed: {
diff --git a/Source/plt-web/plt-web-ui/src/components/refer/vciWebReferClassify.vue b/Source/plt-web/plt-web-ui/src/components/refer/vciWebReferClassify.vue
index 61847dd..aca0056 100644
--- a/Source/plt-web/plt-web-ui/src/components/refer/vciWebReferClassify.vue
+++ b/Source/plt-web/plt-web-ui/src/components/refer/vciWebReferClassify.vue
@@ -3,6 +3,7 @@
<div>
<el-dialog
v-dialogDrag
+ v-dialog-resize
:title="title"
:visible.sync="visible"
:width="onlyTable?'60%': '80%'"
@@ -10,8 +11,8 @@
class="avue-dialog avue-dialog--top"
@close="dialogClose"
>
- <el-container :style="{ 'height': height || '60vh' }">
- <el-aside width="300px" v-if="!onlyTable && classifys.length>0">
+ <el-container :style="{ 'height': height }">
+ <el-aside style="width:200px;height:100%" v-if="!onlyTable && classifys.length>0">
<el-tabs type="border-card" style="height: 100%" @tab-click="tabClick"
v-model="tabName">
<el-tab-pane
@@ -25,6 +26,7 @@
<el-tree
class="filter-tree"
+ :style="'height: calc('+height+' - 100px);'"
:data="treeItem.treeData"
:lazy="lazy"
:load="treeLoad"
@@ -37,7 +39,7 @@
</el-tab-pane>
</el-tabs>
</el-aside>
- <el-main style="padding: 0 0 0 20px">
+ <el-main style="padding: 0 0 0 20px;height:100%">
<avue-crud
ref="referCrud"
v-model="formValue"
@@ -62,9 +64,9 @@
</el-container>
<div class="avue-dialog__footer">
<div class="avue-dialog__footer--left valueInfo">{{ valueInfo }}</div>
- <el-button @click="escHandler">鍙� 娑�</el-button>
- <el-button @click="clearValue">娓� 绌�</el-button>
<el-button type="primary" @click="setValue">纭� 瀹�</el-button>
+ <el-button @click="clearValue">娓� 绌�</el-button>
+ <el-button @click="escHandler">鍙� 娑�</el-button>
</div>
</el-dialog>
@@ -113,7 +115,7 @@
},
height: {
type: String,
- default:'500px'
+ default:(document.body.clientHeight-400)+'px'
},
reloadFormKey: {
type: String,
@@ -153,10 +155,11 @@
lazy: this.referConfig.options.loadType == 'node',
loadType: { all: "all", node: "node" },
url: this.referConfig.options.url || "referGrid",
- query: {},
+ query: {},//鍒楄〃鐨勬悳绱㈡潯浠�
+ where:{},//鍒楄〃鐨勬煡璇㈡潯浠�
loading: false,
page: {
- layout: "sizes,prev,pager,next,jumper,total",
+ layout: "sizes,prev,pager,next,jumper,sizes,total",
pageSize: 10,
currentPage: 1,
total: this.referConfig.options.data
@@ -168,7 +171,6 @@
option: {
addBtn: false,
columnBtn: false,
- calcHeight: 30,
tip: false,
menu: false,
searchShow: true,
@@ -180,6 +182,7 @@
reserveSelection: true,
dialogClickModal: false,
highlightCurrentRow: true,
+ height:parseInt(this.height)-150,
rowKey: "id",
rowParentKey: "parentId",
column: [],
@@ -273,6 +276,19 @@
tabClick:function (tab){
this.currentTreeIndex= tab.index;
this.filterText=this.classifys[tab.index].filterText;
+ this.option.column.forEach(item => {
+ if (item.hideInClassify) {
+ let queryField = this.classifys[this.currentTreeIndex].queryField;
+ let inClassifyArray = item.hideInClassify.split(",");
+ if (inClassifyArray.find((value => value === queryField))) {
+ item.hide = true;
+ item.showColumn = false;
+ } else {
+ item.hide = false;
+ item.showColumn = true;
+ }
+ }
+ });
},
handleFocus() {
if (!this.disabled) {
@@ -476,13 +492,13 @@
this.$refs.referCrud.toggleSelection();
},
refreshChange() {
- this.onLoad(this.page, this.query);
+ this.onLoad(this.page);
},
onLoad(page, params = {}) {
if (this.url) {
this.loading = true;
getList(
- Object.assign(params, this.params, this.query),
+ Object.assign(params, this.params,this.where, this.query),
page.currentPage,
page.pageSize,
this.url
@@ -558,13 +574,14 @@
where[this.classifys[this.currentTreeIndex].queryField] = data.attributes[classifyValueField];
this.url = this.classifys[this.currentTreeIndex].queryByClassifyUrl || this.options.url;
this.page.currentPage=1;
- this.onLoad(this.page, where);
+ this.where = where;
+ this.onLoad(this.page,where);
},
},
};
</script>
-<style scoped>
+<style lang="scss" scoped>
.valueInfo {
float: left;
border: 1px solid #e9e7e7;
@@ -573,4 +590,7 @@
padding: 6px 15px;
line-height: 1;
}
+.filter-tree{
+ overflow-y: auto;
+}
</style>
diff --git a/Source/plt-web/plt-web-ui/src/components/refer/vciWebReferDefalut.vue b/Source/plt-web/plt-web-ui/src/components/refer/vciWebReferDefalut.vue
index f704b53..973e0fa 100644
--- a/Source/plt-web/plt-web-ui/src/components/refer/vciWebReferDefalut.vue
+++ b/Source/plt-web/plt-web-ui/src/components/refer/vciWebReferDefalut.vue
@@ -1,6 +1,7 @@
<template>
<div>
<el-dialog v-dialogDrag
+ v-dialog-resize
:title="title"
:visible.sync="visible"
:width="width|| '450'"
@@ -74,7 +75,7 @@
},
height: {
type: String,
- default:'500px'
+ default:(document.body.clientHeight-500)+'px'
},
reloadFormKey: {
type: String,
@@ -99,7 +100,7 @@
query: {},
loading: false,
page: {
- layout: "sizes,prev,pager,next,jumper,total",
+ layout: "sizes,prev,pager,next,jumper,sizes,total",
pageSize: 10,
currentPage: 1,
total: this.referConfig.options.data ? this.referConfig.options.data.length : 0
@@ -206,13 +207,11 @@
prop: 'code',
label: '缂栧彿',
sortable: true,
- width: 150,
search: true
}, {
prop: 'name',
label: '鍚嶇О',
sortable: true,
- width: 260,
search: true
}, {
prop: 'description',
@@ -220,7 +219,6 @@
}, {
prop: 'secretShow',
label: '瀵嗙骇',
- width: 60,
hide: (!this.controllerSecret)
}];
} else {
diff --git a/Source/plt-web/plt-web-ui/src/components/refer/vciWebReferTable.vue b/Source/plt-web/plt-web-ui/src/components/refer/vciWebReferTable.vue
index 4771f2f..b55e6e8 100644
--- a/Source/plt-web/plt-web-ui/src/components/refer/vciWebReferTable.vue
+++ b/Source/plt-web/plt-web-ui/src/components/refer/vciWebReferTable.vue
@@ -1,10 +1,10 @@
<template>
<div>
<el-dialog v-dialogDrag
+ v-dialog-resize
:title="title"
:visible.sync="visible"
:width="width"
- :style="'height:'+height || 'auto'"
:append-to-body="true"
class="avue-dialog avue-dialog--top"
@close="dialogClose">
@@ -78,7 +78,7 @@
},
height: {
type: String,
- default:'500px'
+ default:(document.body.clientHeight-500)+'px'
},
reloadFormKey: {
type: String,
@@ -100,10 +100,10 @@
},
url: this.referConfig.options.url || 'referGrid',
method: this.referConfig.options.method || 'get',
- query: {},
+ query: this.referConfig.options.query || {orderBy: "createTime", orderMethod: "desc"},
loading: false,
page: {
- layout: "sizes,prev,pager,next,jumper,total",
+ layout: "sizes,prev,pager,next,jumper,sizes,total",
pageSize: 10,
currentPage: 1,
total: this.referConfig.options.data ? this.referConfig.options.data.length : 0
diff --git a/Source/plt-web/plt-web-ui/src/components/refer/vciWebReferTree.vue b/Source/plt-web/plt-web-ui/src/components/refer/vciWebReferTree.vue
index 365ce65..902c469 100644
--- a/Source/plt-web/plt-web-ui/src/components/refer/vciWebReferTree.vue
+++ b/Source/plt-web/plt-web-ui/src/components/refer/vciWebReferTree.vue
@@ -44,7 +44,7 @@
default:'70%'
}, height: {
type: String,
- default:'60%'
+ default:(document.body.clientHeight-650)+'px'
},
reloadFormKey: {
type: String,
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue
new file mode 100644
index 0000000..6ed5d5c
--- /dev/null
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue
@@ -0,0 +1,487 @@
+<template>
+ <el-dialog v-dialogDrag
+ :title="dialog.title"
+ :visible.sync="dialog.showDialog"
+ width="1600px"
+ :append-to-body="true"
+ class="avue-dialog"
+ :destroy-on-close="true"
+ :close-on-click-modal="false"
+ @close="cancelDialog">
+ <div style="min-height: 665px;max-height: 85vh;padding-bottom: 50px;">
+ <basic-form key="linkQueryForm" style="margin-bottom: 0"
+ ref="form"
+ :span="4"
+ :formItems="formItems"
+ :formData="form"
+ @getFormData="getFormData">
+ </basic-form>
+ <avue-crud ref="crud" title="璁剧疆鎺掑簭"
+ :data="orderInfoList" :option="crudOption">
+ <template slot="menuLeft" slot-scope="scope">
+ <el-button icon="el-icon-plus" size="small" type="primary" @click="addRow">鍒涘缓</el-button>
+ </template>
+ <template slot="menu" slot-scope="scope">
+ <el-button icon="el-icon-delete" size="small" type="text" @click="rowDeleteHandler(scope)">鍒犻櫎
+ </el-button>
+ </template>
+ </avue-crud>
+ <el-dialog v-dialogDrag
+ title="鍒涘缓"
+ :visible.sync="crudDialog.showDialog"
+ width="500px"
+ :append-to-body="true"
+ class="avue-dialog"
+ :destroy-on-close="true"
+ :close-on-click-modal="false"
+ @close="crudDialog.showDialog=false">
+ <avue-form ref="tableForm" :option="tableFormOption" v-model="tableForm"></avue-form>
+ <div class="dialog-footer avue-dialog__footer">
+ <el-button type="primary" plain size="small" @click="rowSave" >淇� 瀛�</el-button>
+ </div>
+ </el-dialog>
+ <el-container style="margin-top: 10px;">
+ <el-aside style="width:350px">
+ <fieldset>
+ <legend> 閾炬帴绫诲瀷鍊欓�夋潯浠� </legend>
+ <div>
+ 鏌ヨ妯℃澘瀹氫箟
+ <avue-select @change="linkQueryDefineChange" class="el-input--small" v-model="linkQueryDefineForm" placeholder="璇烽�夋嫨鍐呭" type="tree" :dic="linkQueryDefineDic" style="width:240px"></avue-select>
+ <avue-tree style="height: 265px" :data="linkTreeData" :option="treeOption">
+ </avue-tree>
+ </div>
+ </fieldset>
+ </el-aside>
+ <el-main>
+ <fieldset style="margin: 0 10px">
+ <legend> 鏌ヨ鏉′欢 </legend>
+ <div style="height: 300px;">
+
+ </div>
+ </fieldset>
+ </el-main>
+ <el-aside style="width:350px">
+ <fieldset>
+ <legend> 涓氬姟绫诲瀷鍊欓�夋潯浠� </legend>
+ <div>
+ 鏌ヨ妯℃澘瀹氫箟
+ <avue-select @change="businessQueryDefineChange" class="el-input--small" v-model="businessQueryDefineForm" placeholder="璇烽�夋嫨鍐呭" type="tree" :dic="businessQueryDefineDic" style="width: 240px;"></avue-select>
+ <avue-tree style="height: 265px" :data="businessTreeData" :option="treeOption">
+ </avue-tree>
+ </div>
+ </fieldset>
+ </el-aside>
+ </el-container>
+ </div>
+ <div class="dialog-footer avue-dialog__footer">
+ <el-button type="primary" plain size="small" @click="submitDialog" >淇� 瀛�</el-button>
+ <el-button size="small" @click="cancelDialog">鍙� 娑�</el-button>
+ </div>
+ </el-dialog>
+</template>
+
+<script>
+import {getAllOrderbyAttributeByLink} from "@/api/modeling/linkType/api";
+import {linkSave} from "@/api/queryTemplate/linkTypeQuery";
+import basicOption from "@/util/basic-option";
+import {gridTemplate} from "@/api/queryTemplate/queryDefine";
+import {deleteAttributes} from "@/api/modeling/attributePool/api";
+export default {
+ name: "formDialog",
+ data(){
+ return {
+ dialog: {
+ showDialog: false,
+ title: "鍒涘缓",
+ submitTxt: "淇濆瓨",
+ submitIcon: "el-icon-check",
+ loading: false,
+ type: "add",
+ },
+ crudDialog: {
+ showDialog: false,
+ submitTxt: "淇濆瓨",
+ submitIcon: "el-icon-check",
+ },
+ formItems:[{
+ label: '鏌ヨ妯℃澘鍚嶇О',
+ prop: 'qtName',
+ type: 'input',
+ span:5,
+ rules: [{
+ required: true,
+ message: "璇疯緭鍏ユ煡璇㈡ā鏉垮悕绉�",
+ trigger: "blur"
+ }]
+ },{
+ label: '鏂瑰悜',
+ prop: 'direction',
+ type: 'radio',
+ value:'positive',
+ labelWidth:70,
+ span: 3,
+ dicData: [{
+ label: '姝e悜',
+ value: 'positive'
+ }, {
+ label: '鍙嶅悜',
+ value: 'opposite'
+ }]
+ },{
+ label: '涓氬姟绫诲瀷',
+ prop: 'btmType',
+ type: 'select',
+ labelWidth:110,
+ dicData: []
+ }, {
+ label: '鐗堟湰鐗堟',
+ prop: 'version',
+ type: 'select',
+ span:5,
+ dicData: [{
+ label: '褰撳墠鐗堟湰褰撳墠鐗堟',
+ value: 1
+ }, {
+ label: '褰撳墠鐗堟湰鏈�鏂扮増娆�',
+ value: 2
+ }, {
+ label: '鏈�鏂扮増鏈渶鏂扮増娆�',
+ value: 3
+ }, {
+ label: '宸插彂甯冪殑鏈�鏂扮増鏈�',
+ value: 7
+ }],
+ value: 1
+ },{
+ label: '鏌ヨ鏄惁鏈変笅绾�',
+ prop: 'queryISLeaf',
+ type: 'switch',
+ labelWidth:140,
+ dicData: [ {
+ label: '鍚�',
+ value: false
+ },{
+ label: '鏄�',
+ value: true
+ }],
+ value:false
+ }, {
+ label: '瀛愯妭鐐瑰眰娆℃暟',
+ prop: 'level',
+ type: 'number',
+ span:3,
+ value:1
+ }],
+ form:{
+ btmName:'',
+ qtName: '',
+ queryTemplate:{
+
+ }
+ },
+ formTemplate:{
+ btmName:'',
+ qtName: '',
+ queryTemplate:{
+
+ }
+ },
+ //宸叉湁鎺掑簭鍒楄〃閰嶇疆
+ crudOption: {
+ ...basicOption,
+ addBtn: false,
+ editBtn: false,
+ delBtn: false,
+ selection: false,
+ height: "220",
+ tip: false,
+ column: [{
+ label: '鎺掑簭瀛楁',
+ prop: 'orderField'
+ }, {
+ label: '鎺掑簭鏂瑰紡',
+ prop: 'orderMode'
+ }, {
+ label: '浼樺厛绾�',
+ prop: 'level'
+ }]
+ },
+ //宸叉湁鎺掑簭
+ orderInfoList:[],
+ //璁剧疆鎺掑簭寮圭獥琛ㄥ崟鏁版嵁
+ tableForm:{
+ orderField:'',
+ orderMode:'ASC',
+ level:''
+ },
+ //璁剧疆鎺掑簭寮圭獥鎵�鏈夊彲鎺掑簭瀛楁
+ orderFieldList:[],
+ //璁剧疆鎺掑簭寮圭獥琛ㄥ崟閰嶇疆
+ tableFormOption: {
+ menuBtn: false,
+ submitBtn: false,
+ emptyBtn: false,
+ span:24,
+ column: [{
+ label: '鎺掑簭瀛楁',
+ prop: 'orderField',
+ type:'select',
+ props: {
+ label: 'id',
+ value: 'id'
+ },
+ rules: [{
+ required: true,
+ message: "璇烽�夋嫨鎺掑簭瀛楁",
+ trigger: "blur"
+ }]
+ }, {
+ label: '鎺掑簭鏂瑰紡',
+ prop: 'orderMode',
+ type: 'select',
+ dicData: [{
+ label: '鍗囧簭',
+ value: 'ASC'
+ }, {
+ label: '闄嶅簭',
+ value: 'DESC'
+ }],
+ value: 'ASC'
+ }, {
+ label: '浼樺厛绾�',
+ prop: 'level',
+ type: 'number',
+ min:1,
+ rules: [{
+ required: true,
+ message: "璇疯緭鍏ヤ紭鍏堢骇",
+ trigger: "blur"
+ }]
+ }]
+ },
+ treeOption:{
+ defaultExpandAll:true,
+ menu: false,
+ addBtn: false,
+ filter:false,
+ },
+ linkQueryDefineForm:'',//閾炬帴绫诲瀷鏌ヨ妯℃澘瀹氫箟閫変腑鍊�
+ linkQueryDefineDic:[],//閾炬帴绫诲瀷鏌ヨ妯℃澘瀹氫箟涓嬫媺鏁版嵁
+ //閾炬帴绫诲瀷鏌ヨ妯℃澘瀹氫箟閫変腑椤瑰睘鎬�
+ linkTreeData: [],
+ businessQueryDefineForm:'',//涓氬姟绫诲瀷鏌ヨ妯℃澘瀹氫箟閫変腑鍊�
+ businessQueryDefineDic:[],//涓氬姟绫诲瀷鏌ヨ妯℃澘瀹氫箟涓嬫媺鏁版嵁
+ //涓氬姟绫诲瀷鏌ヨ妯℃澘瀹氫箟閫変腑椤瑰睘鎬�
+ businessTreeData: [],
+ };
+ },
+ watch: {
+ //鏂瑰悜
+ 'form.direction': {
+ handler(val) {
+ if(val=='positive'){
+ //姝e悜
+ const dicData=this.treeData.btmItemsTo.map(item=>{
+ return {
+ label: item,
+ value: item
+ }
+ })
+ dicData.push({
+ label: '鎵�鏈夌被鍨�',
+ value: '*'
+ })
+ this.$refs.form.updateDic('btmType', dicData);
+ this.form.btmType=dicData[0].value
+ this.getAllAttr();
+ }else if(val=='opposite'){
+ //鍙嶅悜
+ const dicData=this.treeData.btmItemsFrom.map(item=>{
+ return {
+ label: item,
+ value: item
+ }
+ })
+ dicData.push({
+ label: '鎵�鏈夌被鍨�',
+ value: '*'
+ })
+ this.$refs.form.updateDic('btmType', dicData);
+ this.form.btmType=dicData[0].value
+ this.getAllAttr();
+ }
+ },
+ immediate: true,
+ },
+ //涓氬姟绫诲瀷
+ 'form.btmType': {
+ handler(val) {
+ if(val && val!='*'){
+ this.getTemp(val,false);
+ }
+ },
+ immediate: true,
+ },
+ },
+ methods: {
+ openDialog(btmName, title, mode, data) {
+ this.dialog.title = title;
+ this.dialog.showDialog = true;
+ this.dialog.type = mode;
+ this.form.btmName = btmName;
+ this.treeData = data.treeData;
+
+ if (data.selectData) {
+ this.selectData = data.selectData;
+ this.orderInfoList = JSON.parse(JSON.stringify(data.selectData.queryTemplate.orderInfoList));//宸叉湁鎺掑簭
+ } else {
+ this.selectData = {};
+ this.orderInfoList =[];
+ }
+ this.getTemp(data.treeData.label,true)
+ },
+ cancelDialog() {
+ this.$nextTick(() => {
+ this.form = this.formTemplate;
+ this.orderInfoList =[];
+ this.dialog.loading = false;
+ this.dialog.showDialog = false;
+ this.$refs.form.resetFields();
+ this.businessQueryDefineForm='';
+ this.linkQueryDefineForm='';
+ });
+ },
+ submitDialog() {
+ this.$refs.form.validate((valid) => {
+ if (valid) {
+ linkSave(this.form).then(res => {
+ if (res.success) {
+ this.$message.success("淇濆瓨鎴愬姛");
+ this.cancelDialog();
+ this.$emit("refresh");
+ }
+ });
+ } else {
+ return false;
+ }
+ });
+ },
+ getFormData(form) {
+ this.form = form;
+ },
+ addRow() {
+ this.crudDialog.showDialog = true;
+ },
+ // 琛屽垹闄�
+ rowDeleteHandler(data) {
+ this.orderInfoList.splice(data.index,1);
+ this.orderFieldList.unshift({
+ id: data.row.orderField
+ });
+ this.tableFormOption.column[0].dicData= this.orderFieldList
+ },
+ //鑾峰彇鎺掑簭璁剧疆涓墍鏈夋帓搴忓瓧娈�
+ getAllAttr() {
+ getAllOrderbyAttributeByLink({
+ name: this.treeData.label,
+ btmType: this.form.btmType,
+ direction: this.form.direction
+ }).then(res => {
+ const orderInfoStr = JSON.stringify(this.orderInfoList);
+ const dicData = [];
+ res.data.data.forEach(item => {
+ if (orderInfoStr.indexOf('"orderField":"' + item + '"') == -1) {
+ dicData.push({id: item});
+ }
+ })
+ this.tableFormOption.column[0].dicData=dicData;
+ this.orderFieldList=dicData;
+ })
+ },
+ //鎺掑簭璁剧疆淇濆瓨
+ rowSave() {
+ this.$refs.tableForm.validate((valid) => {
+ if(valid){
+ this.orderInfoList.push(JSON.parse(JSON.stringify(this.tableForm)));
+ this.crudDialog.showDialog=false;
+ const orderInfoStr = JSON.stringify(this.orderInfoList);
+ const dicData = [];
+ this.orderFieldList.forEach(item => {
+ if (orderInfoStr.indexOf('"orderField":"' + item.id + '"') == -1) {
+ dicData.push(item);
+ }
+ })
+ this.tableFormOption.column[0].dicData=dicData;
+ this.orderFieldList=dicData;
+ this.tableForm= {
+ orderField: '',
+ orderMode: 'ASC',
+ level: ''
+ }
+ }
+ })
+ },
+ //鑾峰彇鏌ヨ妯℃澘瀹氫箟涓嬫媺
+ getTemp(btmName,linkFlag) {
+ if (btmName) {
+ gridTemplate({btmName: btmName, linkFlag: linkFlag}).then(res => {
+ const data = res.data.data.map(item => {
+ item.label = item.name + '-' + (item.linkTypeName || item.btmName);
+ item.value = item.name;
+ return item;
+ });
+ if(linkFlag){
+ this.linkQueryDefineDic=data
+ data.length>0 && (this.linkQueryDefineForm=data[0].value);
+ }else {
+ this.businessQueryDefineDic=data;
+ data.length>0 && (this.businessQueryDefineForm= data[0].value);
+ }
+ })
+ }
+ },
+ linkQueryDefineChange(data) {
+ if (data.value) {
+ const childData = data.item.abNames.map(item => {
+ return {
+ label: item,
+ value: item
+ };
+ });
+ this.linkTreeData = [{
+ label: data.value,
+ value: data.value,
+ children: childData
+ }]
+ }
+ },
+ businessQueryDefineChange(data) {
+ if (data.value) {
+ const childData = data.item.abNames.map(item => {
+ return {
+ label: item,
+ value: item
+ };
+ });
+ this.businessTreeData = [{
+ label: data.value,
+ value: data.value,
+ children: childData
+ }]
+ }
+ }
+ },
+}
+</script>
+
+<style scoped>
+fieldset {
+ border-radius: 5px;
+ -webkit-box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
+ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
+ padding: 10px 6px;
+ box-sizing: border-box;
+ margin: 0;
+ border: 1px solid #EBEEF5;
+}
+</style>
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue
index 5d18cfc..3fbb71a 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue
@@ -1,6 +1,5 @@
<template>
<el-container>
-
<el-aside>
<basic-container>
<div ref="TreeBox" style="height: calc(100vh - 154px);!important;">
@@ -21,32 +20,37 @@
<el-main>
<basic-container>
+ <div v-if="this.nodeRow && this.nodeRow.label">
+ <el-button icon="el-icon-plus" size="small" type="primary" @click="addHandler">鍒涘缓</el-button>
+ <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editHandler">淇敼</el-button>
+ <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delHandler">鍒犻櫎</el-button>
+ <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">瀵煎嚭</el-button>
+ <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">瀵煎叆</el-button>
+ </div>
<avue-crud ref="crud"
+ @selection-change="selectionChange"
+ @row-click="rowClick"
:data="crudData" :option="crudOption" :table-loading="tableLoading" style="margin-top: 10px">
- <template slot="menuLeft" slot-scope="scope">
- <el-button icon="el-icon-plus" size="small" type="primary" @click="addHandler">鍒涘缓</el-button>
- <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editHandler">淇敼</el-button>
- <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delHandler">鍒犻櫎</el-button>
- <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">瀵煎嚭</el-button>
- <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">瀵煎叆</el-button>
- </template>
</avue-crud>
+ <form-dialog ref="formRef" @refresh="getTemp"></form-dialog>
</basic-container>
</el-main>
-
+ <div style="width: 300px;">111</div>
</el-container>
</template>
<script>
import {gridLink} from "@/api/modeling/linkType/api";
import { gridTemplate, saveTemplate, updateTemplate} from "@/api/queryTemplate/queryDefine";
-import {deleteLinkTemplate} from "@/api/queryTemplate/linkTypeQuery";
+import {getObjTypeQTs,deleteLinkTemplate} from "@/api/queryTemplate/linkTypeQuery";
import func from "@/util/func";
import {dateFormat} from "@/util/date";
import basicOption from "@/util/basic-option";
+import FormDialog from "./formDialog.vue"
export default {
name: "index",
+ components: {FormDialog},
data() {
return {
treeOption: {
@@ -90,17 +94,31 @@
height: "auto",
calcHeight: -40,
tip: false,
+ header:false,
column: [{
label: '鏌ヨ妯℃澘鍚嶇О',
- prop: 'name'
+ prop: 'qtName'
}, {
label: '鍒涘缓浜�',
prop: 'creator'
}, {
label: '鍒涘缓鏃堕棿',
- prop: 'createTime',
+ prop: 'createTimeText'
+ }, {
+ label: '鏂瑰悜',
+ prop: 'direction',
formatter:function (row, value) {
- return dateFormat(new Date(value))
+ if (row.queryTemplate.direction == 'positive') {
+ return '姝e悜'
+ }else{
+ return '鍙嶅悜'
+ }
+ }
+ }, {
+ label: '涓氬姟绫诲瀷',
+ prop: 'btmType',
+ formatter:function (row, value) {
+ return row.queryTemplate.btmType;
}
}]
},
@@ -130,72 +148,41 @@
this.tableLoading = true;
this.getTemp();
},
+ //鑾峰彇鏌ヨ妯℃澘鍒楄〃
getTemp() {
- gridTemplate({btmName: this.nodeRow.label, linkFlag: true}).then(res => {
+ getObjTypeQTs(this.nodeRow.label).then(res => {
this.crudData = res.data.data;
this.tableLoading = false;
+ this.selectionClear();
})
},
- selectHandler(selection, row) {
-
+ rowClick(row) {
+ this.$refs.crud.toggleSelection();
+ this.$refs.crud.toggleRowSelection(row); //閫変腑褰撳墠琛�
+ this.selectionRow = [row];
},
- changeTemp(data) {
- this.$refs.queryCrud.clearSelection();
- if (data.value != '') {
- let abNames = data.item.abNames.join(',').toLowerCase().split(',')
-
- }
+ selectionChange(list) {
+ this.selectionRow = list;
+ },
+ selectionClear() {
+ this.selectionRow = [];
+ this.$refs.crud.toggleSelection();
},
//鍒涘缓
addHandler() {
- if (func.isEmptyObject(this.nodeRow)) {
- this.$message.error('璇烽�夋嫨瑕佹坊鍔犵殑鑺傜偣');
- return;
- }
- this.title = 'add';
- this.visible = true;
- this.$nextTick(() => {
- });
+ this.$refs.formRef.openDialog(this.nodeRow.label,'鍒涘缓','add',{treeData:this.nodeRow});
},
//淇敼
editHandler() {
- if (func.isEmptyObject(this.nodeRow)) {
- this.$message.error('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�');
+ if (this.selectionRow.length!=1) {
+ this.$message.error('璇烽�夋嫨涓�鏉℃暟鎹�');
return;
}
- this.form.name = this.templateForm;
- this.title = 'edit';
- this.visible = true;
- this.$nextTick(() => {
- });
- },
- // 鏂板缂栬緫淇濆瓨
- addDialogSavaHandler() {
- this.$refs.form.validate((valid) => {
- const saveFunction = this.title === 'add' ? saveTemplate : updateTemplate;
- if (valid) {
- saveFunction(this.form).then(res => {
- if (res.data.code === 200) {
- this.$message.success(res.data.obj);
- this.addDialogClose();
- }
- })
- } else {
- return false;
- }
- });
- },
- // 鏂板缂栬緫瀵硅瘽妗嗗彇娑�
- addDialogClose() {
- this.form = {
- name: ''
- };
- this.$refs.form.clearValidate();
- this.visible = false;
+ this.$refs.formRef.openDialog(this.nodeRow.label,'淇敼','edit',{treeData:this.nodeRow,selectData:this.selectionRow[0]});
},
//鍒犻櫎
delHandler() {
- if (func.isEmptyObject(this.nodeRow)) {
+ if (this.selectionRow.length==0) {
this.$message.error('璇烽�夋嫨鏁版嵁');
return;
}
@@ -204,11 +191,10 @@
cancelButtonText: '鍙栨秷',
type: 'warning'
}).then(() => {
- deleteLinkTemplate({
- name: this.templateForm,
- btmName: this.nodeRow.label,
- linkFlag: false
- }).then(res => {
+ let names=this.selectionRow.map(item=>{
+ return item.qtName
+ })
+ deleteLinkTemplate(names).then(res => {
if (res.data.code === 200) {
this.$message.success(res.data.obj);
}
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/queryDefine/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/queryDefine/index.vue
index 7dd9032..441a5c2 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/queryDefine/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/queryDefine/index.vue
@@ -335,7 +335,7 @@
cancelButtonText: '鍙栨秷',
type: 'warning'
}).then(() => {
- deleteTemplate({name:this.templateForm,btmName: this.nodeRow.label, linkFlag: this.radioForm == 1}).then(res => {
+ deleteTemplate({name:this.templateForm}).then(res => {
if (res.data.code === 200) {
this.$message.success(res.data.obj);
this.getTemp();
--
Gitblit v1.9.3