wangting
2024-10-24 c93ff74fb5a47d38554d40b5ab00cfe07eac1f2a
Merge remote-tracking branch 'origin/master'
已修改14个文件
799 ■■■■ 文件已修改
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/PRMDTO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsPvolumesController.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/UIManagerController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/LogBasicServiceI.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsPvolumesServiceI.java 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/UIManagerServiceI.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/LogBasicServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsPortalVIServiceImpl.java 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsPvolumesServiceImpl.java 104 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/api/UI/uiDefine.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/tableDialog.vue 515 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/index.vue 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/PRMDTO.java
@@ -2,7 +2,7 @@
import java.util.List;
public class PRMDTO implements   java.io.Serializable {
public class PRMDTO implements java.io.Serializable {
    private static final long serialVersionUID = -9069714336905186990L;
    /**
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsPvolumesController.java
@@ -3,11 +3,15 @@
import com.vci.corba.common.PLException;
import com.vci.corba.framework.data.PvolumeInfo;
import com.vci.dto.*;
import com.vci.starter.web.annotation.log.VciBusinessLog;
import com.vci.starter.web.exception.VciBaseException;
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.starter.web.util.ControllerUtil;
import com.vci.starter.web.util.VciBaseUtil;
import com.vci.web.service.OsActionServiceI;
import com.vci.web.service.OsPvolumesServiceI;
import com.vci.web.util.Func;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -15,6 +19,7 @@
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
@@ -106,4 +111,46 @@
            return objectBaseResult;
        }
    }
    /**
     * 为文件柜分配成员
     * @param pvolumId
     * @param userIds
     * @return
     */
    @PostMapping("/savePvolumeUser")
    public BaseResult savePvolumeUser(String pvolumId ,String userIds){
        try {
            return osPvolumesServiceI.savePvolumeUser(pvolumId,Func.toStrList(userIds)) ? BaseResult.success("文件柜分配成员成功!"):BaseResult.fail("文件柜分配成员失败!");
        } catch (PLException e) {
            BaseResult objectBaseResult = new BaseResult<>();
            objectBaseResult.setCode(Integer.parseInt(e.code));
            objectBaseResult.setMsg(Arrays.toString(e.messages));
            return objectBaseResult;
        }
    }
    /**
     * 导出选中的文件柜信息
     * @param exportFileName 导出的文件名
     * @param pvolumeIds 需要导出的属性英文名称
     * @param response
     */
    @GetMapping( "/exportPvolumes")
    @VciBusinessLog(operateName = "导出选中的文件柜信息")
    public void exportPvolumes(String exportFileName, String pvolumeIds, HttpServletResponse response){
        try {
            String excelPath = osPvolumesServiceI.exportPvolumes(exportFileName,pvolumeIds);
            ControllerUtil.writeFileToResponse(response,excelPath);
        } catch (Exception e) {
            String msg = "导出文件柜时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            try {
                e.printStackTrace();
                ControllerUtil.writeDataToResponse(response,"error_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss") + ".txt", StringUtils.isNotBlank(msg)?msg.getBytes():new byte[0],null);
            } catch (IOException ioException) {
                ioException.printStackTrace();
            }
        }
    }
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/UIManagerController.java
@@ -535,7 +535,7 @@
     * @param  tabButtonVO
     * @return 修改结果
     */
    @PutMapping("/updateTabbutton")
    @PutMapping("/updateTabButton")
    public BaseResult updateTabButton(@RequestBody PLTabButtonVO tabButtonVO){
        try {
            return uiManagerService.updateTabButton(tabButtonVO);
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/LogBasicServiceI.java
@@ -44,6 +44,11 @@
     */
    BaseResult getOperatingUsers() throws PLException;
    /**
     * 导出日志
     * @param dto 导出的文件名
     * @return
     */
    String exportLogs(LogQueryCriteriaDTO dto) throws PLException;
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsPvolumesServiceI.java
@@ -1,12 +1,10 @@
package com.vci.web.service;
import com.vci.corba.common.PLException;
import com.vci.corba.framework.data.PvolumeInfo;
import com.vci.dto.*;
import com.vci.starter.web.pagemodel.BaseResult;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
/**
@@ -40,4 +38,25 @@
     * @return 删除结果
     */
    BaseResult deletePvolume(String ids) throws PLException;
    /**
     * 文件柜导出
     * @param exportFileName 导出的文件名
     * @param pvolumeIds 导出选中的卷id
     * @return
     * @throws PLException
     */
    String exportPvolumes(String exportFileName,String pvolumeIds) throws PLException;
    /**
     * 根据卷id查询卷
     * @param ids
     * @return
     */
    List<PvolumeInfo> getPvolumeInfoByIds(List<String> ids) throws PLException;
    /**
     * 为文件柜分配成员
     * @param pvolumId
     * @param userIds
     * @return
     */
    boolean savePvolumeUser(String pvolumId ,List<String> userIds) throws PLException;
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/UIManagerServiceI.java
@@ -175,7 +175,7 @@
     * @param tabButtonVO
     * @return
     */
    boolean saveOrUpdateTapButton(PLTabButtonVO tabButtonVO,boolean isAdd);
    boolean saveOrUpdateTabButton(PLTabButtonVO tabButtonVO,boolean isAdd);
    /**
     * 删除单个按钮配置
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/LogBasicServiceImpl.java
@@ -239,7 +239,6 @@
        if(Func.isEmpty(logList)){
            excelDataList.add(new WriteExcelData(1,1, "导出的日志列表为空!"));
        }else{
            //先按照属性类型排序,不同属性类型导出的数据乱的效果
            AtomicInteger i = new AtomicInteger();
            Arrays.stream(logList).forEach(log->{
                excelDataList.add(new WriteExcelData(i.get() +1,0, log.username));
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsPortalVIServiceImpl.java
@@ -573,6 +573,7 @@
        }
        return BaseResult.success("导入成功");
    }
    private String readLines(String filePath){
        StringBuffer sb=new StringBuffer();
        FileInputStream prmFile=null;
@@ -590,6 +591,7 @@
        }
        return sb.toString();
    }
    /**
     * 拷贝数据到word模板中
     * @param fileName 要写入的数据
@@ -620,6 +622,7 @@
        }
        return filePath;
    }
    public List<PortalVIDTO> listByIds(Collection idList){
        List<PortalVIDTO> portalVIVOList=new ArrayList<>();
        if(CollectionUtils.isEmpty(idList)){
@@ -637,13 +640,15 @@
        portalVIVOList=  portalVIO2DTOS(portalVIList);
        return portalVIVOList;
    }
    private BaseResult savePortalVIDTO(PortalVIDTO portalVIDTO,boolean isEdit)  {
    private BaseResult savePortalVIDTO(PortalVIDTO portalVIDTO,boolean isEdit)  {
        boolean _isBtm=false;
        boolean flag = false;
        String labelName=PortalVIType.Form.getName();
        try {
            VciBaseUtil.alertNotNull(portalVIDTO.getViName(),"名称");
            VciBaseUtil.alertNotNull(
                    portalVIDTO.getViName(),"名称"
                    ,portalVIDTO.getPrm().getFormQtName(),"绑定表单");
            if(portalVIDTO.getPrm()==null||portalVIDTO.getPrm().getPrmItemList()==null||portalVIDTO.getPrm().getPrmItemList().size()==0){
                throw  new Throwable(labelName+",未设置");
            }
@@ -706,6 +711,7 @@
        }
        return  BaseResult.success("保存"+labelName+"成功!");
    }
    @Override
    public Map<String, PortalVIVO> selectAllPortalVIMap() throws VciBaseException {
        return null;
@@ -757,7 +763,6 @@
        return "";
    }
    /**
     * 枚举的数据对象转换为显示对象
     *
@@ -773,6 +778,7 @@
        });
        return portalVIVOS;
    }
    /**
     * 表单的数据对象转换为显示对象
     * @param portalVIDTOS 表单的对象
@@ -787,6 +793,7 @@
        });
        return portalVIS;
    }
    /**
     * 表单的数据对象转换为显示对象
     * @param PortalVIS 表单的对象
@@ -811,13 +818,13 @@
     */
    @Override
    public  PortalVI portalVIDTOO2VI(PortalVIDTO portalVIDTO) {
        PortalVI portalVI=new PortalVI();
        portalVI.id=portalVIDTO.getId();
        portalVI.typeFlag= portalVIDTO.getTypeFlag();
        portalVI.typeName=portalVIDTO.getTypeName();
        portalVI.viName=portalVIDTO.getViName();
        portalVI.viType=portalVIDTO.getViType();
        short viType =portalVIDTO.getViType();
        PortalVI portalVI = new PortalVI();
        portalVI.id = portalVIDTO.getId();
        portalVI.typeFlag = portalVIDTO.getTypeFlag();
        portalVI.typeName = portalVIDTO.getTypeName();
        portalVI.viName = portalVIDTO.getViName();
        portalVI.viType = portalVIDTO.getViType();
        short viType = portalVIDTO.getViType();
        PRMDO prmdo = prmDOO2VIS(portalVIDTO.getPrm(),viType);
        try {
            portalVI.prm=UITools.getPRMText(prmdo);
@@ -826,6 +833,7 @@
        }
        return portalVI;
    }
    /**
     * 表单的数据对象转换为显示对象
     * @param portalVI
@@ -844,6 +852,7 @@
        portalVIDTO.setPrm(prmDOO2DTOS(prmdo,viType));
        return portalVIDTO;
    }
    /**
     * 表单数据对象转换
     * @param prmdto
@@ -1210,25 +1219,25 @@
        prmItemDO.setItemOutFields(VciBaseUtil.array2String(prmItemDTO.getItemOutFieldList().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());
       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();
       List<String> itemSeniorQueryColsList=new ArrayList<>();
       List<ItemSeniorQueryBO> itemSeniorQueryBOS = prmItemDTO.getItemSeniorQueryBOS();
       List<String> itemSeniorQueryColsList = new ArrayList<>();
       List<String> itemSeniorQueryColsCountsList=new ArrayList<>();
       List<String> itemQuerySqlList=new ArrayList<>();
       List<String> itemQuerySqlList = new ArrayList<>();
       itemSeniorQueryBOS.stream().forEach(itemSeniorQueryBO -> {
           String itemSeniorQueryCols= itemSeniorQueryBO.getItemSeniorQueryCols();
           String itemSeniorQueryColsCounts=itemSeniorQueryBO.getItemSeniorQueryColsCounts();
           String itemQuerySql=itemSeniorQueryBO.getItemQuerySql();
           String itemSeniorQueryCols = itemSeniorQueryBO.getItemSeniorQueryCols();
           String itemSeniorQueryColsCounts = itemSeniorQueryBO.getItemSeniorQueryColsCounts();
           String itemQuerySql = itemSeniorQueryBO.getItemQuerySql();
           if(StringUtils.isNotBlank(itemSeniorQueryCols)) {
               itemSeniorQueryColsList.add(itemSeniorQueryCols);
           }
            if(StringUtils.isNotBlank(itemSeniorQueryColsCounts)) {
                itemSeniorQueryColsCountsList.add(itemSeniorQueryColsCounts);
            }
            if(StringUtils.isNotBlank(itemQuerySql)){
                itemQuerySqlList.add(itemQuerySql);
            }
           if(StringUtils.isNotBlank(itemSeniorQueryColsCounts)) {
               itemSeniorQueryColsCountsList.add(itemSeniorQueryColsCounts);
           }
           if(StringUtils.isNotBlank(itemQuerySql)){
               itemQuerySqlList.add(itemQuerySql);
           }
        });
        prmItemDO.setItemSeniorQueryCols(VciBaseUtil.array2String(itemSeniorQueryColsList.toArray(new String[]{})));
        prmItemDO.setItemSeniorQueryColsCounts(VciBaseUtil.array2String(itemSeniorQueryColsCountsList.toArray(new String[]{})));
@@ -1241,8 +1250,8 @@
     */
    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>itemOutFieldList = VciBaseUtil.str2List(itemOutFields);
        List<String>itemFieldWidthList =VciBaseUtil.str2List(itemFieldWidth,",");
        if(itemOutFieldList.size()>0) {
            for (int i = 0; i < itemOutFieldList.size(); i++) {
                KeyValue keyValue = new KeyValue();
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsPvolumesServiceImpl.java
@@ -1,39 +1,26 @@
package com.vci.web.service.impl;
import cn.hutool.core.io.FileUtil;
import com.vci.constant.FrameWorkLangCodeConstant;
import com.vci.corba.common.PLException;
import com.vci.corba.common.data.UserEntityInfo;
import com.vci.corba.framework.data.PvolumeInfo;
import com.vci.corba.portal.data.Constraint;
import com.vci.corba.portal.data.PLAction;
import com.vci.corba.portal.data.PLActionCls;
import com.vci.corba.portal.data.PLActionParam;
import com.vci.dto.*;
import com.vci.starter.poi.bo.WriteExcelData;
import com.vci.starter.poi.bo.WriteExcelOption;
import com.vci.starter.poi.util.ExcelUtil;
import com.vci.starter.web.exception.VciBaseException;
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.starter.web.util.ControllerUtil;
import com.vci.starter.web.util.LangBaseUtil;
import com.vci.starter.web.util.LocalFileUtil;
import com.vci.web.enumpck.ActionEnum;
import com.vci.web.enumpck.PlTypetypeEnum;
import com.vci.web.other.ExportActionLogBean;
import com.vci.web.other.ExportBeans;
import com.vci.web.service.OsActionServiceI;
import com.vci.starter.web.util.VciBaseUtil;
import com.vci.starter.web.util.WebThreadLocalUtil;
import com.vci.web.service.OsPvolumesServiceI;
import com.vci.web.util.Func;
import com.vci.web.util.PinyinCommon;
import com.vci.web.util.PlatformClientUtil;
import com.vci.web.util.WebUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.util.*;
import java.util.stream.Collectors;
@@ -133,6 +120,7 @@
        }
        return BaseResult.success("修改成功!");
    }
    /**
     * 删除卷
     * @param ids 主键集合
@@ -160,6 +148,92 @@
    }
    /**
     * 文件柜导出
     * @param exportFileName 导出的文件名
     * @param pvolumeIds 导出选中的卷id
     * @return
     * @throws PLException
     */
    @Override
    public String exportPvolumes(String exportFileName, String pvolumeIds) throws PLException {
        if(Func.isBlank(pvolumeIds)){
            throw new PLException("500",new String[]{"请勾选要导出的数据!"});
        }
        //界面没传名称,使用默认导出名称
        exportFileName = Func.isBlank(exportFileName) ?  "文件柜导出_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss"):exportFileName;
        //设置列名
        List<String> columns = new ArrayList<>(Arrays.asList("卷名","机器类型","路径名称","首选路径","服务器","卷服务"));
        //写excel
        String excelPath = LocalFileUtil.getDefaultTempFolder() + File.separator + exportFileName +  ".xls";
        try {
            new File(excelPath).createNewFile();
        } catch (Throwable e) {
            throw new VciBaseException(LangBaseUtil.getErrorMsg(e), new String[]{excelPath}, e);
        }
        //设置列
        List<WriteExcelData> excelDataList = new ArrayList<>();
        //设置列头
        for (int index = 0; index < columns.size(); index++) {
            excelDataList.add(new WriteExcelData(0,index, columns.get(index)));
        }
        //按照文件柜ID查询文件柜
        List<String> pvolumeIdList = Func.toStrList(pvolumeIds);
        List<PvolumeInfo> pvolumeInfoList = this.getPvolumeInfoByIds(pvolumeIdList);
        if(Func.isEmpty(pvolumeInfoList)){
            excelDataList.add(new WriteExcelData(1,1, "未获取到要导出的文件柜信息,请刷新后尝试重新导出!"));
        }else{
            for (int i = 0; i < pvolumeInfoList.size(); i++) {
                PvolumeInfo pvolumeInfo = pvolumeInfoList.get(i);
                excelDataList.add(new WriteExcelData(i+1,0, pvolumeInfo.name));
                excelDataList.add(new WriteExcelData(i+1,1, pvolumeInfo.type));
                excelDataList.add(new WriteExcelData(i+1,2, pvolumeInfo.path));
                excelDataList.add(new WriteExcelData(i+1,3, pvolumeInfo.isvalid));
                excelDataList.add(new WriteExcelData(i+1,4, pvolumeInfo.host));
                excelDataList.add(new WriteExcelData(i+1,5, pvolumeInfo.service));
            }
        }
        WriteExcelOption excelOption = new WriteExcelOption(excelDataList);
        ExcelUtil.writeDataToFile(excelPath, excelOption);
        return excelPath;
    }
    /**
     * 根据卷id查询卷
     * @param ids
     * @return
     */
    @Override
    public List<PvolumeInfo> getPvolumeInfoByIds(List<String> ids) throws PLException {
        List<PvolumeInfo> pvolumeInfos = new ArrayList<>();
        if(Func.isEmpty(ids)){
            return pvolumeInfos;
        }
        PvolumeInfo[] allPvolumes = platformClientUtil.getFrameworkService().getAllPvolumes();
        if (Func.isEmpty(allPvolumes)){
            return pvolumeInfos;
        }
        pvolumeInfos = Arrays.stream(allPvolumes).filter(pvolumeInfo -> ids.contains(pvolumeInfo.id)).collect(Collectors.toList());
        return pvolumeInfos;
    }
    /**
     * 为文件柜分配成员----这个功能现在没用上,平台的保存方法是注释掉的
     * @param pvolumId
     * @param userIds
     * @return
     */
    @Override
    public boolean savePvolumeUser(String pvolumId ,List<String> userIds) throws PLException {
        VciBaseUtil.alertNotNull(pvolumId,"文件柜主键",userIds,"用户主键集合");
        UserEntityInfo userEntityInfo = new UserEntityInfo();
        userEntityInfo.setUserName(WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId());
        boolean resBoolean = platformClientUtil.getFrameworkService().savePvolumeUser(pvolumId, userIds.toArray(new String[userIds.size()]), userEntityInfo);
        return resBoolean;
    }
    /**
     * 卷 从Corba端转到Hibernate对象端
     * @param pvoInfo
     * @return
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java
@@ -1368,7 +1368,7 @@
     */
    @Override
    public BaseResult addTabButton(PLTabButtonVO tabButtonVO) {
        boolean res = this.saveOrUpdateTapButton(tabButtonVO, true);
        boolean res = this.saveOrUpdateTabButton(tabButtonVO, true);
        return res ? BaseResult.success("按钮配置添加成功!"):BaseResult.success("按钮配置添加失败!");
    }
@@ -1379,7 +1379,7 @@
     */
    @Override
    public BaseResult updateTabButton(PLTabButtonVO tabButtonVO) {
        boolean res = this.saveOrUpdateTapButton(tabButtonVO, false);
        boolean res = this.saveOrUpdateTabButton(tabButtonVO, false);
        return res ? BaseResult.success("按钮配置修改成功!"):BaseResult.success("按钮配置修改失败!");
    }
@@ -1389,11 +1389,10 @@
     * @return
     */
    @Override
    public boolean saveOrUpdateTapButton(PLTabButtonVO tabButtonVO,boolean isAdd){
        VciBaseUtil.alertNotNull(tabButtonVO,"按钮配置对象",tabButtonVO.getLabel(),"参数名称");
    public boolean saveOrUpdateTabButton(PLTabButtonVO tabButtonVO,boolean isAdd){
        VciBaseUtil.alertNotNull(tabButtonVO,"按钮配置对象",tabButtonVO.getLabel(),"参数名称",tabButtonVO.getTableOId(),"页面定义主键");
        //检查当前添加的列表是否重复,但是这儿只支持单条数据保存,所有当前列表判重可以前端来做
        //String btnParamValidate = this.geCheckRes();
        if (tabButtonVO.getSeq() < 1 || tabButtonVO.getSeq() > 63) {
            throw new VciBaseException("按序号超出范围,请修改,按钮【编号】只能在【1-63】范围内。");
        }
Source/plt-web/plt-web-ui/src/api/UI/uiDefine.js
@@ -72,7 +72,7 @@
    method: 'post',
    responseType: 'blob',
    data: {
      params
      ...params
    }
  })
}
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/tableDialog.vue
@@ -9,10 +9,10 @@
    width="60%"
    @close="closeDialog"
  >
    <el-form v-loading="formLoading" :model="form" :rules="rules" label-position="right" label-width="100px">
    <el-form ref="form" v-loading="formLoading" :model="form" :rules="rules" label-position="right" label-width="100px">
      <el-row>
        <el-col :span="12">
          <el-form-item label="名称">
          <el-form-item label="名称" prop="viName">
            <el-input v-model="form.viName" placeholder="请输入名称" size="mini"></el-input>
          </el-form-item>
        </el-col>
@@ -30,14 +30,14 @@
        </el-col>
        <el-col :span="12">
          <el-form-item label="绑定表单">
          <el-form-item label="绑定表单" prop="itemInObj">
            <div style="display: flex;align-items: center;">
              <el-select v-model="form.itemInObj" clearable placeholder="请选择绑定表单" size="mini">
              <el-select v-model="form.itemInObj" clearable placeholder="请选择绑定表单" size="mini"
                         @change="formSelectChange">
                <el-option v-for="(item,index) in selectList" :key="index" :label="item.viName"
                           :value="item.id"></el-option>
              </el-select>
              <el-button plain size="mini" style="margin-left: 3px" type="success" @click="formSelectClickHandler">选择
              </el-button>
            </div>
          </el-form-item>
        </el-col>
@@ -54,131 +54,42 @@
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="显示字段">
            <div style="display: flex; align-items: center">
              <div style="height: 260px; width: 160px; border: 1px solid #bdbbbb;overflow-y: auto">
                <el-table
                  :data="form.itemSelectOutFieldList"
                  :highlight-current-row="true"
                  style="width: 100%"
                  @row-click="showLabelLeftRowClick">
                  <el-table-column
                    align="center"
                    label="可使用字段"
                    prop="id">
                  </el-table-column>
                </el-table>
              </div>
              <div style="margin-left: 10px; margin-right: 10px">
                <el-button circle icon="el-icon-back" style="margin-right: 10px"
                           @click="showLeftTransferClick"></el-button>
                <el-button circle icon="el-icon-right" @click="showRightTransferClick"></el-button>
              </div>
              <div style="height: 260px; width: 160px; border: 1px solid #bdbbbb;overflow-y: auto">
                <el-table
                  :data="form.itemOutFieldList"
                  :highlight-current-row="true"
                  style="width: 100%"
                  @row-click="showLabelRightRowClick">
                  <el-table-column
                    align="center"
                    label="需要使用字段"
                    prop="id">
                  </el-table-column>
                </el-table>
              </div>
            </div>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="搜索字段">
            <div style="display: flex; align-items: center">
              <div style="height: 260px; width: 160px; border: 1px solid #bdbbbb;overflow-y: auto">
                <el-table
                  :data="form.itemSearchFieldList"
                  :highlight-current-row="true"
                  style="width: 100%"
                  @row-click="searchLeftRowClick">
                  <el-table-column
                    align="center"
                    label="可供搜索字段"
                    prop="id">
                  </el-table-column>
                </el-table>
              </div>
              <div style="margin-left: 10px; margin-right: 10px">
                <el-button circle icon="el-icon-back" style="margin-right: 10px"
                           @click="searchLeftTransferClick"></el-button>
                <el-button circle icon="el-icon-right" @click="searchRightTransferClick"></el-button>
              </div>
              <div style="height: 260px; width: 160px; border: 1px solid #bdbbbb;overflow-y: auto">
                <el-table
                  :data="form.itemKeyFieldList"
                  :highlight-current-row="true"
                  style="width: 100%"
                  @row-click="searchRightRowClick">
                  <el-table-column
                    align="center"
                    label="需搜索字段"
                    prop="id">
                  </el-table-column>
                </el-table>
              </div>
            </div>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="列">
            <el-select v-model="form.itemFileWidthSelect" placeholder="请选择列" size="mini" @change="itemFileWidthChange">
              <el-option v-for="(item,index) in form.itemFieldWidthList" :key="index" :label="item.key"
                         :value="item.key"></el-option>
        <el-col :span="24">
          <el-form-item label="显示字段" prop="showLabel">
            <el-select v-model="form.itemOutFieldList" multiple placeholder="请选择" style="width: 100%"
                       @change="outFileChange">
              <el-option
                v-for="(item,index) in form.itemSelectOutFieldList"
                :key="index"
                :label="item.id"
                :value="item.id">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="宽度">
            <div style="display: flex;align-items: center;">
              <el-input v-model="form.itemWidth" placeholder="请输入宽度" size="mini" style="width: 193px"
                        type="number"></el-input>
              <el-button plain size="mini" style="margin-left: 3px" type="success" @click="widthSetUpClickHandler">设置
              </el-button>
            </div>
        <el-col :span="24">
          <el-form-item label="搜索字段">
            <el-select v-model="form.itemKeyFieldList" multiple placeholder="请选择" style="width: 100%">
              <el-option
                v-for="(item,index) in form.itemSearchFieldList"
                :key="index"
                :label="item.id"
                :value="item.id">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-col :span="24">
        <el-form-item label="设置列宽">
          <div style="height: 150px; width: 100%; border: 1px solid #bdbbbb;overflow-y: auto">
            <el-table
              :data="form.itemFieldWidthList"
              :highlight-current-row="true"
              border
              stripe
              style="width: 100%"
              @row-click="itemFileWidthRowClick">
              <el-table-column
                align="center"
                label="列名"
                prop="key">
                <template slot-scope="scope">
                  <el-tag size="medium">{{ scope.row.key }}</el-tag>
                </template>
              </el-table-column>
              <el-table-column
                align="center"
                label="列宽"
                prop="value">
                <template slot-scope="scope">
                  <el-tag size="medium">{{ scope.row.value }}</el-tag>
                </template>
              </el-table-column>
            </el-table>
          </div>
          <avue-crud
            :data="form.itemFieldWidthList"
            :option="fileWidthOption">
          </avue-crud>
        </el-form-item>
      </el-col>
@@ -295,29 +206,6 @@
         <el-button @click="closeDialog">取 消</el-button>
         <el-button type="primary" @click="dialogSaveClickHandler">确 定</el-button>
    </span>
    <el-dialog
      v-dialogDrag
      v-loading="selectFormLoading"
      :visible.sync="selectFormVisible"
      append-to-body="true"
      class="avue-dialog"
      title="表单选择"
      width="50%">
      <avue-crud
        ref="crud"
        :data="selectFormData"
        :option="selectFormOption"
        @selection-change="selectionChange"
        @row-click="rowClick">
      </avue-crud>
      <span slot="footer" class="dialog-footer">
         <el-button @click="selectFormVisible = false">取 消</el-button>
         <el-button type="primary" @click="selectFormAddClickHandler">确 定</el-button>
    </span>
    </el-dialog>
  </el-dialog>
</template>
@@ -345,6 +233,35 @@
  },
  data() {
    return {
      fileWidthOption: {
        ...basicOption,
        addBtn: false,
        editBtn: false,
        delBtn: false,
        refreshBtn: false,
        highlightCurrentRow: true,
        height: 200,
        menu: false,
        selection: false,
        column: [
          {
            label: '列名',
            prop: 'key',
          },
          {
            label: '列宽',
            prop: 'value',
            cell: true,
            rules: [
              {
                required: true,
                message: '请输入列宽',
                trigger: 'blur'
              }
            ]
          }
        ]
      },
      searchQtNameList: [],
      formLoading: false,
      itemImgHeight: '',
@@ -376,7 +293,23 @@
      selectFormData: [],
      selectFormLoading: false,
      selectFormVisible: false,
      rules: {},
      rules: {
        viName: [{
          required: true,
          message: '请输入名称',
          trigger: 'blur'
        }],
        itemInObj: [{
          required: true,
          message: '请选择绑定表单',
          trigger: 'change'
        }],
        showLabel: [{
          required: true,
          message: '请选择显示字段',
          trigger: 'submit'
        }],
      },
      form: {
        viName: '', // 名称
        itemPageSize: '', // 每页可显示行数
@@ -391,7 +324,6 @@
        itemKeyFieldList: [], // 需要搜索字段
        itemWidth: '250', // 宽度
        itemFieldWidthList: [], // 设置列宽数组 与 itemOutFieldList 相匹配
        itemFileWidthSelect: '', // 列下拉框
        searchLabel: '', // 查询字段
        searchNumber: '1', // 查询次数
        searchSql: '', // 查询sql
@@ -416,7 +348,6 @@
        itemKeyFieldList: [], // 需要搜索字段
        itemWidth: '250', // 宽度
        itemFieldWidthList: [], // 设置列宽数组 与 itemOutFieldList 相匹配
        itemFileWidthSelect: '', // 列下拉框
        searchLabel: '', // 查询字段
        searchNumber: '1', // 查询次数
        searchSql: '', // 查询sql
@@ -440,33 +371,6 @@
    }
  },
  methods: {
    // 关闭对话框
    closeDialog() {
      this.visible = false;
      this.form = {...this.defaultForm};
    },
    // 选择表单关闭对话框
    closeSelectFormDialog() {
    },
    // 选择绑定表单
    formSelectClickHandler() {
      this.selectFormVisible = true;
      const params = {
        'conditionMap[typeName]': this.treeRadio === '0' ? this.TreeNodeRow.id : this.TreeNodeRow.name,
        'conditionMap[viType]': 'Form',
        'conditionMap[viTypeFlag]': this.treeRadio === '0' ? 'BtmType' : this.treeRadio === '1' ? 'LinkType' : '',
      }
      gridPortalVIDatas(1, -1, params).then(res => {
        if (res.data.code === 200) {
          const data = res.data.data;
          this.selectFormData = data;
        }
      });
    },
    // 获取初始化表格里需要的默认数据
    getFormSelectList() {
      this.formLoading = true;
@@ -502,53 +406,45 @@
          const list = data.filter(item =>
            !this.form.itemOutFieldList.some(outItem => outItem.id === item.id)
          );
          this.getSearchSelectList();
          this.getSearchSelectList(); // 选择表单下拉接口
          this.getFormSelect(); // 查询模板下拉接口
          this.getDbList(); // 双击操作下拉接口
          this.$set(this.form, 'itemSelectOutFieldList', list);
          this.formLoading = false;
        }
      })
    },
    // 查询模板下拉接口查询
    getSearchSelectList() {
      getObjTypeQTs({btName: this.treeRadio === '0' ? this.TreeNodeRow.id : this.TreeNodeRow.name}).then(res => {
        this.searchQtNameList = res.data.data;
      })
    // 关闭对话框
    closeDialog() {
      this.visible = false;
      this.$refs.form.clearValidate();
      this.form = {...this.defaultForm};
    },
    // 表格多选
    selectionChange(list) {
      this.selectList = list;
    },
    // 行点击
    rowClick(row) {
      func.rowClickHandler(
        row,
        this.$refs.crud,
        this.lastIndex,
        (newIndex) => {
          this.lastIndex = newIndex;
        },
        () => {
          this.selectList = [];
        }
      );
    },
    // 表单选择确定
    selectFormAddClickHandler() {
      if (this.selectList.length <= 0) {
        this.$message.error('请至少选择一条数据');
        return;
      }
      if (this.selectList.length > 1) {
        this.$message.error('只能选择一条数据');
        return;
      }
    // 获取选择表单数据
    getFormSelect() {
      const params = {
        id: this.selectList[0].id,
        'conditionMap[typeName]': this.treeRadio === '0' ? this.TreeNodeRow.id : this.TreeNodeRow.name,
        'conditionMap[viType]': 'Form',
        'conditionMap[viTypeFlag]': this.treeRadio === '0' ? 'BtmType' : this.treeRadio === '1' ? 'LinkType' : '',
      }
      gridPortalVIDatas(1, -1, params).then(res => {
        if (res.data.code === 200) {
          const data = res.data.data;
          this.selectList = data;
        }
      });
    },
    // 表单选择change事件
    formSelectChange(val) {
      // console.log(val);
      this.form.itemOutFieldList = [];
      this.form.itemKeyFieldList = [];
      this.form.itemFieldWidthList = [];
      const params = {
        id: val,
        viType: '1'
      }
      getPortalVIById(params).then(res => {
@@ -559,120 +455,32 @@
            }
          });
          this.form.itemSelectOutFieldList = data;
          this.selectFormVisible = false;
        }
      })
      this.form.itemInObj = this.selectList[0].id;
    },
    // 显示字段左侧表格行点击
    showLabelLeftRowClick(row) {
      this.showLabelLeftRow = row;
    // 显示字段change
    outFileChange(val) {
      this.form.itemSearchFieldList = this.form.itemOutFieldList.map(item => {
        return {
          id: item
        }
      })
      this.form.itemFieldWidthList = this.form.itemOutFieldList.map(item => {
        return {
          $cellEdit: true,
          key: item,
          value: '250',
        }
      })
    },
    // 显示字段右侧表格行点击
    showLabelRightRowClick(row) {
      this.showLabelRightRow = row;
    },
    // 搜索字段左侧表格行点击
    searchLeftRowClick(row) {
      this.searchLeftRow = row;
    },
    // 搜索字段右侧表格行点击
    searchRightRowClick(row) {
      this.searchRightRow = row;
    },
    // 显示字段穿梭框左移
    showLeftTransferClick() {
      if (func.isEmptyObject(this.showLabelRightRow)) {
        this.$message.error('请选择一条数据');
        return;
      }
      this.form.itemSelectOutFieldList.unshift(this.showLabelRightRow);
      this.form.itemOutFieldList = this.form.itemOutFieldList.filter(item => item.id !== this.showLabelRightRow.id);
      this.form.itemSearchFieldList = this.form.itemOutFieldList;
      this.form.itemFieldWidthList = this.form.itemFieldWidthList.filter(item => item.key !== this.showLabelRightRow.id);
      this.form.itemFileWidthSelect = this.form.itemFieldWidthList.length >= 1 ? this.form.itemFieldWidthList[0].key : '';
      this.showLabelRightRow = {};
    },
    // 显示字段穿梭框右移
    showRightTransferClick() {
      if (func.isEmptyObject(this.showLabelLeftRow)) {
        this.$message.error('请选择一条数据');
        return;
      }
      const onlyFlag = this.form.itemOutFieldList.some(item => item.id === this.showLabelLeftRow.id);
      if (onlyFlag) {
        this.$message.error('请检查是否有重复项');
        this.form.itemSelectOutFieldList = this.form.itemSelectOutFieldList.filter(selectItem =>
          !this.form.itemOutFieldList.some(outItem => outItem.id === selectItem.id)
      )
        return;
      }
      this.form.itemOutFieldList.push(this.showLabelLeftRow);
      this.form.itemSearchFieldList = this.form.itemOutFieldList;
      // 过滤 itemSelectOutFieldList,移除 id 与 showLabelLeftRow.id 相同的对象
      this.form.itemSelectOutFieldList = this.form.itemSelectOutFieldList.filter(item => item.id !== this.showLabelLeftRow.id);
      this.form.itemFieldWidthList.push({
        key: this.showLabelLeftRow.id,
        value: this.form.itemWidth
      });
      this.form.itemFileWidthSelect = this.form.itemFieldWidthList[0].key;
      this.showLabelLeftRow = {};
    },
    // 搜索字段穿梭框左移
    searchLeftTransferClick() {
      if (func.isEmptyObject(this.searchRightRow)) {
        this.$message.error('请选择一条数据');
        return;
      }
      this.form.itemSearchFieldList.unshift(this.searchRightRow);
      this.form.itemKeyFieldList = this.form.itemKeyFieldList.filter(item => item.id !== this.searchRightRow.id)
      this.searchRightRow = {};
    },
    // 搜索自动穿梭框右移
    searchRightTransferClick() {
      if (func.isEmptyObject(this.searchLeftRow)) {
        this.$message.error('请选择一条数据');
        return;
      }
      this.form.itemKeyFieldList.push(this.searchLeftRow);
      this.form.itemSearchFieldList = this.form.itemSearchFieldList.filter(item => item.id !== this.searchLeftRow.id);
      this.searchLeftRow = {};
    },
    // 设置列宽行点击
    itemFileWidthRowClick(row) {
      this.itemFileWidthRow = row;
      this.form.itemFileWidthSelect = row.key;
      this.form.itemWidth = row.value;
    },
    // 列下拉change
    itemFileWidthChange(val) {
      this.itemFileWidthChangeVal = val;
    },
    // 设置宽度
    widthSetUpClickHandler() {
      if (this.form.itemFileWidthSelect) {
        const item = this.form.itemFieldWidthList.find(item => item.key === this.form.itemFileWidthSelect);
        item.value = this.form.itemWidth;
      }
    // 查询模板下拉接口查询
    getSearchSelectList() {
      getObjTypeQTs({btName: this.treeRadio === '0' ? this.TreeNodeRow.id : this.TreeNodeRow.name}).then(res => {
        this.searchQtNameList = res.data.data;
      })
    },
    // 获取双击操作数据
@@ -715,36 +523,43 @@
    // 表格对话框保存
    dialogSaveClickHandler() {
      const paramsForm = {...this.form};
      paramsForm.itemSelectOutFieldList = this.form.itemSelectOutFieldList.map(item => item.id); // 可使用字段
      paramsForm.itemOutFieldList = this.form.itemOutFieldList.map(item => item.id); // 需要使用字段
      paramsForm.itemSearchFieldList = this.form.itemSearchFieldList.map(item => item.id); // 可供搜索字段
      paramsForm.itemKeyFieldList = this.form.itemKeyFieldList.map(item => item.id); // 需要使用字段
      paramsForm.itemImgWH = `${this.itemImgWidth},${this.itemImgHeight}`;
      const params = {
        id: this.form.editNodeId,
        prm: {
          formQtName: '',
          prmItemList: [
            paramsForm
          ],
        },
        typeFlag: this.treeRadio,
        typeFlagText: this.treeRadio === '0' ? "业务类型的表单" : '链接类型的表单',
        typeName: this.treeRadio === '0' ? this.TreeNodeRow.id : this.TreeNodeRow.name, // 业务类型名 or 链接类型名
        viName: this.form.viName,
        viType: 0,
        viTypeText: "表格"
      }
      savePortalVI(params).then(res => {
        // console.log(params);
        if (res.data.code === 200) {
          this.$message.success(res.data.obj);
          // this.closeDialog();
          this.$emit('updataTable');
          this.visible = false;
      this.$refs.form.validate((valid) => {
        if (valid) {
          const paramsForm = {...this.form};
          paramsForm.itemSelectOutFieldList = this.form.itemSelectOutFieldList.map(item => item.id); // 可使用字段
          paramsForm.itemOutFieldList = this.form.itemOutFieldList; // 需要使用字段
          paramsForm.itemSearchFieldList = this.form.itemSearchFieldList.map(item => item.id); // 可供搜索字段
          paramsForm.itemKeyFieldList = this.form.itemKeyFieldList; // 需要使用字段
          paramsForm.itemImgWH = `${this.itemImgWidth},${this.itemImgHeight}`;
          const params = {
            id: this.form.editNodeId,
            prm: {
              formQtName: '',
              prmItemList: [
                paramsForm
              ],
            },
            typeFlag: this.treeRadio,
            typeFlagText: this.treeRadio === '0' ? "业务类型的表单" : '链接类型的表单',
            typeName: this.treeRadio === '0' ? this.TreeNodeRow.id : this.TreeNodeRow.name, // 业务类型名 or 链接类型名
            viName: this.form.viName,
            viType: 0,
            viTypeText: "表格"
          }
          savePortalVI(params).then(res => {
            // console.log(params);
            if (res.data.code === 200) {
              this.$message.success(res.data.obj);
              // this.closeDialog();
              this.$emit('updataTable');
              // this.$refs.form.clearValidate();
              this.visible = false;
            }
          })
        } else {
          return false;
        }
      })
      });
    }
  }
}
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/index.vue
@@ -204,8 +204,9 @@
        this.$refs.formDialog.getTreeList();
      } else {
        this.$refs.tableDialog.visible = true;
        this.$refs.tableDialog.getDbList();
        this.$refs.tableDialog.getSearchSelectList();
        this.$refs.tableDialog.getDbList(); // 双击操作下拉接口
        this.$refs.tableDialog.getSearchSelectList(); // 选择表单下拉接口
        this.$refs.tableDialog.getFormSelect(); // 查询模板下拉接口
      }
    },
@@ -329,14 +330,18 @@
            // 更新表单
            this.$refs.tableDialog.form = {
              ...prmItem,
              itemFieldWidthList:prmItem.itemFieldWidthList.map(item => {
                return{
                  ...item,
                  $cellEdit: true,
                }
              }),
              viName: res.data.obj.viName,
              editNodeId: row.id,
              itemOutFieldList: (prmItem.itemOutFieldList || []).map(item => ({id: item})),
              itemOutFieldList: (prmItem.itemOutFieldList || []),
              itemSearchFieldList: (prmItem.itemSearchFieldList || []).map(item => ({id: item})),
              itemKeyFieldList: (prmItem.itemKeyFieldList || []).map(item => ({id: item})),
              searchLabel: prmItem.itemSeniorQueryCols || '',
              searchNumber: prmItem.itemSeniorQueryColsCounts || '1',
              searchSql: prmItem.itemQuerySql || '',
              itemKeyFieldList: (prmItem.itemKeyFieldList || []),
              searchNumber: '1',
              itemFileWidthSelect: (prmItem.itemFieldWidthList && prmItem.itemFieldWidthList.length > 0) ? prmItem.itemFieldWidthList[0].key : '',
              itemWidth: (prmItem.itemFieldWidthList && prmItem.itemFieldWidthList.length > 0) ? prmItem.itemFieldWidthList[0].value : '250'
            };
@@ -345,9 +350,6 @@
            const [width = '0', height = '0'] = (prmItem.itemImgWH || '0,0').split(',');
            this.$refs.tableDialog.itemImgWidth = width;
            this.$refs.tableDialog.itemImgHeight = height;
            // 双击操作获取数据方法
            this.$refs.tableDialog.getDbList();
            // 显示对话框
            this.$refs.tableDialog.visible = true;
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue
@@ -996,6 +996,7 @@
        this.$message.error('请选择一条数据');
        return;
      }
      console.log(this.selectList);
      this.btnDesignVisible = true;
      this.formBtnOid = this.selectList[0].id;
      this.getTabBtnTree();
@@ -1121,7 +1122,8 @@
      const params = this.saveType === 'add' ? {
        ...this.basicForm,
        parentId: this.nodeTreeRow.oId === 'parentNode' ? '' : this.nodeTreeRow.parentId,
        buttonParams: bottomParams
        buttonParams: bottomParams,
        tableOId:this.selectList[0].id
      } : {
        ...this.basicForm,
        buttonParams: bottomParams