ludc
2024-09-02 b9f3e4a899013ce21de3fc1ac127d137c7494595
Merge remote-tracking branch 'origin/master'
已修改31个文件
已删除1个文件
已添加11个文件
4129 ■■■■■ 文件已修改
Bin/jre/lib/security/trusted.libraries 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-poi/src/main/java/com/vci/starter/poi/util/ExcelUtil.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/PLActionExpDTO.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/PLActionParamDTO.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/po/PortalVIPO.java 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/po/QTDPO.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/pagemodel/Tree.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsActionController.java 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsAttributeController.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsLinkTypeController.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebPortalVIController.java 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/enumpck/ActionEnum.java 132 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/enumpck/PlTypetypeEnum.java 128 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsActionServiceI.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsAttributeServiceI.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsLinkTypeServiceI.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsPortalVIServiceI.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsActionServiceImpl.java 563 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsAttributeServiceImpl.java 151 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsPortalVIServiceImpl.java 437 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/App.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/api/UI/formDefine/api.js 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/api/modeling/linkType/api.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/api/queryTemplate/linkTypeQuery.js 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/api/queryTemplate/queryDefine.js 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/components/refer/BasicClassifyRefer.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/components/refer/orgDeptRefer.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/components/refer/orgUserRefer.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/components/refer/vciWebRefer.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/components/refer/vciWebReferClassify.vue 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/components/refer/vciWebReferDefalut.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/components/refer/vciWebReferTable.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/components/refer/vciWebReferTree.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/businessType/index.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue 536 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue 149 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue 160 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/queryDefine/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/formDialog.vue 603 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/tableDialog.vue 344 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/index.vue 228 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Bin/jre/lib/security/trusted.libraries
Source/plt-web/plt-web-parent/plt-poi/src/main/java/com/vci/starter/poi/util/ExcelUtil.java
@@ -997,6 +997,7 @@
        try {
            for (int sheetIndex = 0; sheetIndex < workbook.getNumberOfSheets(); sheetIndex++) {
                Sheet sheet = workbook.getSheetAt(sheetIndex);
                String sheetName=sheet.getSheetName();
                if(StringUtils.isNotBlank(excelOption.getSheetName())){
                    if(!sheet.getSheetName().equalsIgnoreCase(excelOption.getSheetName())){
                        continue;
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/PLActionExpDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,39 @@
package com.vci.dto;
import lombok.Data;
import java.util.List;
/**
 * Action导出传输对象
 * @author yuxc
 * @date 2024/8/27 17:46
 */
@Data
public class PLActionExpDTO implements java.io.Serializable{
    /**
     * ç¦æ­¢ä¿®æ”¹è¿™ä¸ªå€¼
     */
    private static final long serialVersionUID = 2009350578651813260L;
    /**
     * é€‰æ‹©å¯¼å‡ºæ•°æ®çš„æ¨¡å¼
     */
    private String dataType;//选择导出数据的模式
    /**
     * é€‰æ‹©ã€é€‰æ‹©ã€‘模式则需要传此参数
     */
    private List<String> chooseDataOid;
    /**
     * é¡µç 
     */
    private String pageNum;
    /**
     * æ‰€éœ€è¦å¯¼å‡ºçš„列
     */
    private List<String> columnName;
    /**
     * æ–‡ä»¶å
     */
    private String fileName;
}
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/PLActionParamDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,37 @@
package com.vci.dto;
import lombok.Data;
/**
 * Action参数列表传输对象
 * @author yuxc
 * @date 2024/8/28 16:40
 */
@Data
public class PLActionParamDTO implements java.io.Serializable{
    /**
     * ç¦æ­¢ä¿®æ”¹è¿™ä¸ªå€¼
     */
    private static final long serialVersionUID = 2009350578651813260L;
    /**
     * ä¸»é”®
     */
    public String oid;
    /**
     * å‚数名称
     */
    public String name;
    /**
     * é»˜è®¤å€¼
     */
    public String defaultValue;
    /**
     * æç¤ºä¿¡æ¯
     */
    public String description;
    /**
     * çˆ¶action的ID
     */
    public String action;
}
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/po/PortalVIPO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,88 @@
package com.vci.po;
import com.vci.starter.poi.annotation.ExcelColumn;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
 * è¡¨å•/表格导入转换对象
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PortalVIPO implements java.io.Serializable {
    private static final long serialVersionUID = -4958371880356252841L;
    /**
     * æ‰€åœ¨æ•°æ®è¡Œ
     */
    @ExcelColumn(rowIndexColumn = true,value = "")
    private String rowIndex;
    /**
     * ä¸šåŠ¡ç±»åž‹åç§°
     */
    @ExcelColumn(value="业务类型名称",nullable = false)
    private String typeName;
    /**
     * åç§°
     */
    @ExcelColumn(value="名称",nullable = false)
    private String viName;
    /**
     *业务类型
     */
    private short typeFlag;
    /**
     * ä¸šåŠ¡ç±»åž‹
     */
    @ExcelColumn(value="业务类型",nullable = false)
    private String typeFlagText;
    /***
     * è¡¨å•类型
     */
    private short viType;
    /***
     * è¡¨å•类型
     */
    @ExcelColumn(value="表单类型",nullable = false)
    private String viTypeText;
    /***
     * é…ç½®ä¿¡æ¯
     */
    private String prm;
    /**
     * é…ç½®æ–‡æœ¬
     */
    @ExcelColumn(value="配置文本")
    private String prmFileName;
    /***
     * å±žæ€§
     */
    @ExcelColumn(value="属性" ,nullable = false)
    private String attributeKey;
    /***
     * æŸ¥è¯¢æ¨¡æ¿åç§°
     */
    @ExcelColumn(value="查询模板名称" )
    private String qtName;
    /***
     * æŸ¥è¯¢æ¨¡æ¿é…ç½®æ–‡æœ¬
     */
    @ExcelColumn(value="查询模板配置文本" )
    private String qtNameFile;
    /***
     * æŸ¥è¯¢æ¨¡æ¿ä¸šåŠ¡ç±»åž‹
     */
    @ExcelColumn(value="查询模板业务类型" )
    private String qtNameType;
}
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/po/QTDPO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,46 @@
package com.vci.po;
import com.vci.starter.poi.annotation.ExcelColumn;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
 * è¡¨å•/表格导入转换对象
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class QTDPO implements java.io.Serializable {
    private static final long serialVersionUID = 8774827411052362064L;
    /**
     * æ‰€åœ¨æ•°æ®è¡Œ
     */
    @ExcelColumn(rowIndexColumn = true,value = "")
    private String rowIndex;
    /**
     * ä¸šåŠ¡ç±»åž‹åç§°
     */
    @ExcelColumn(value="业务类型名称")
    private String typeName;
    /**
     * é“¾æŽ¥ç±»åž‹åç§°
     */
    @ExcelColumn(value="链接类型名称")
    private String linkType;
    /**
     *查询模板定义名称
     */
    @ExcelColumn(value="查询模板定义名称" )
    private String QtdName;
    /***
     * å±žæ€§
     */
    @ExcelColumn(value="属性" )
    private String attributeKey;
}
Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/pagemodel/Tree.java
@@ -36,7 +36,19 @@
        setOid(oid);
        setText(text);
    }
    /**
     * æž„造函数
     * @param oid ä¸»é”®
     * @param text æ ‘节点文本
     */
    public Tree(String oid, String text,Object o){
        setOid(oid);
        setText(text);
        setData(o);
    }
    /**
     * ä¸»é”®
     */
@@ -63,6 +75,10 @@
     * å­èŠ‚ç‚¹
     */
    private List<Tree> children = new ArrayList<Tree>();
    /**
     * å±‚级
     */
    private  int level;
    /**
     * å›¾æ ‡
     */
@@ -99,6 +115,10 @@
     * æŽ’序索引
     */
    private String index;//排序索引
    /***
     * å½“前数据对象
     */
    private Object data;
    
    /**
     * å…¶ä»–的属性
@@ -383,6 +403,23 @@
        }
    }
    public Object getData() {
        return data;
    }
    public void setData(Object data) {
        this.data = data;
    }
    public int getLevel() {
        return level;
    }
    public void setLevel(int level) {
        this.level = level;
    }
    @Override
    public String toString() {
        return "Tree{" +
@@ -392,6 +429,7 @@
                ", showCheckbox=" + showCheckbox +
                ", checked=" + checked +
                ", children=" + children +
                ", level=" + level +
                ", icon='" + icon + '\'' +
                ", iconCls='" + iconCls + '\'' +
                ", parentId='" + parentId + '\'' +
@@ -400,6 +438,7 @@
                ", expanded=" + expanded +
                ", href='" + href + '\'' +
                ", index='" + index + '\'' +
                ", data=" + data +
                ", attributes=" + attributes +
                '}';
    }
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsActionController.java
@@ -1,13 +1,14 @@
package com.vci.web.controller;
import com.vci.corba.common.PLException;
import com.vci.dto.PLActionClsDTO;
import com.vci.dto.PLActionDTO;
import com.vci.dto.PLActionQueryDTO;
import com.vci.dto.*;
import com.vci.starter.web.exception.VciBaseException;
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.starter.web.util.VciBaseUtil;
import com.vci.web.service.OsActionServiceI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@@ -149,7 +150,7 @@
    }
    /**
     * å¯¼å‡ºAction
     * å¯¼å‡ºAction分类
     * @return
     */
    @PostMapping("/exportBeans")
@@ -157,4 +158,80 @@
        osActionServiceI.exportBeans(actionOid, response);
    }
    /**
     * å¯¼å…¥Action
     * @param file ä¸Šä¼ çš„æ–‡ä»¶
     * @return
     */
    @PostMapping("/impData")
    public BaseResult impData(MultipartFile file){
        try {
            return osActionServiceI.impData(file);
        }catch (Throwable e) {
            throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e);
        }
    }
    /**
     * å¯¼å‡ºAction
     * @param plActionExpDTO å¯¼å‡ºå±žæ€§è®¾ç½®å¯¹è±¡
     */
    @PostMapping("/exportAction")
    public void exportAction(@RequestBody PLActionExpDTO plActionExpDTO, HttpServletResponse response) throws PLException {
        try {
            osActionServiceI.exportAction(plActionExpDTO, response);
        }catch (Throwable e) {
        throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e);
        }
    }
    /**
     * ä¿å­˜Action参数数据
     * dto action传输对象
     * @return ä¿å­˜ç»“æžœ
     */
    @PostMapping("/savePLActionParam")
    public BaseResult savePLActionParam(@RequestBody PLActionParamDTO dto){
        try {
            return osActionServiceI.savePLActionParam(dto);
        } catch (PLException e) {
            BaseResult objectBaseResult = new BaseResult<>();
            objectBaseResult.setCode(Integer.parseInt(e.code));
            objectBaseResult.setMsg(Arrays.toString(e.messages));
            return objectBaseResult;
        }
    }
    /**
     * ä¿®æ”¹Action参数数据
     * dto action传输对象
     * @return ä¿å­˜ç»“æžœ
     */
    @PostMapping("/updatePLActionParam")
    public BaseResult updatePLActionParam(@RequestBody PLActionParamDTO dto){
        try {
            return osActionServiceI.updatePLActionParam(dto);
        } catch (PLException e) {
            BaseResult objectBaseResult = new BaseResult<>();
            objectBaseResult.setCode(Integer.parseInt(e.code));
            objectBaseResult.setMsg(Arrays.toString(e.messages));
            return objectBaseResult;
        }
    }
    /**
     * åˆ é™¤Action参数数据
     * oid å‚数主键
     * @return ä¿å­˜ç»“æžœ
     */
    @DeleteMapping("/deletePLActionParam")
    public BaseResult deletePLActionParam(String oid){
        try {
            return osActionServiceI.deletePLActionParam(oid);
        } catch (PLException e) {
            BaseResult objectBaseResult = new BaseResult<>();
            objectBaseResult.setCode(Integer.parseInt(e.code));
            objectBaseResult.setMsg(Arrays.toString(e.messages));
            return objectBaseResult;
        }
    }
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsAttributeController.java
@@ -8,6 +8,8 @@
import com.vci.starter.web.pagemodel.BaseQueryObject;
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.pagemodel.OsAttributeVO;
import com.vci.starter.web.pagemodel.Tree;
import com.vci.starter.web.pagemodel.TreeQueryObject;
import com.vci.starter.web.util.ControllerUtil;
import com.vci.starter.web.util.LocalFileUtil;
import com.vci.starter.web.util.VciBaseUtil;
@@ -46,6 +48,28 @@
     */
    private Logger logger = LoggerFactory.getLogger(getClass());
    /**
     * èŽ·å–æ‰€æœ‰ä¸šåŠ¡ç±»åž‹ï¼ˆæ ‘å½¢ç»“æž„ï¼‰
     * @return æŸ¥è¯¢ç»“æžœ
     */
    @GetMapping( "/getTreeAttributes")
    @VciBusinessLog(operateName = "获取属性(树形结构)")
    public BaseResult<List<Tree>> getTreeAttributesByBtmName(TreeQueryObject treeQueryObject){
        try {
            List<Tree>  trees=   attributeService.getTreeAttributesByBtmName(treeQueryObject);
            return BaseResult.dataList(trees);
          //  return BaseResult.tree(trees);
        }catch (Throwable e) {
            e.printStackTrace();
            String exceptionMessage = "查询业务类型时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
    }
    /**
     * å±žæ€§åˆ—表
     * @param baseQueryObject æŸ¥è¯¢å¯¹è±¡
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsLinkTypeController.java
@@ -279,4 +279,28 @@
            throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e);
        }
    }
    /**
     * èŽ·å–è®¾ç½®æŽ’åºå­—æ®µçš„æŽ’åºå­—æ®µ
     * @param linkType é“¾æŽ¥ç±»åž‹çš„编号
     * @param btmType ä¸šåŠ¡ç±»åž‹çš„ç¼–å·
     * @param direction æ­£/反向
     * @return å±žæ€§çš„信息
     */
    @GetMapping("/getAllOrderbyAttributeByLink")
    public BaseResult<List<String>> getAllOrderbyAttributeByLink(String linkType, String btmType, String direction){
        try {
            List<String> osLinkTypeAttributes = linkTypeService.getAllOrderbyAttributeByLink(linkType, btmType, direction);
            return BaseResult.dataList(osLinkTypeAttributes);
        } catch (PLException e) {
            BaseResult objectBaseResult = new BaseResult<>();
            objectBaseResult.setCode(Integer.parseInt(e.code));
            objectBaseResult.setMsg(Arrays.toString(e.messages));
            return objectBaseResult;
        } catch (ParseException e) {
            throw new RuntimeException(e);
        }
    }
}
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;
@@ -149,12 +148,12 @@
    /**
     * å¯¼å‡ºæ•°æ®åº“的表信息到excel
     * @param response å“åº”对象
     * @param btmTypeIds ä¸šåŠ¡ç±»åž‹çš„ç¼–å·ï¼Œç”¨é€—å·åˆ†å‰²
     * @param ids ä¸šåŠ¡ç±»åž‹çš„ç¼–å·ï¼Œç”¨é€—å·åˆ†å‰²
     */
    @PostMapping("/exportExcel")
    @VciBusinessLog(operateName = "导出表单/表格到excel中")
    public void exportExcel(String btmTypeIds,HttpServletResponse response){
        String excelFileName = portalVIServiceI.exportToExcel(VciBaseUtil.str2List(btmTypeIds));
    public void exportExcel(String ids,HttpServletResponse response){
        String excelFileName = portalVIServiceI.exportToExcel(VciBaseUtil.str2List(ids));
        try {
            ControllerUtil.writeFileToResponse(response,excelFileName);
        } catch (IOException e) {
@@ -165,6 +164,30 @@
            }
        }
    }
    /**
     * å¯¼å‡ºæ•°æ®åº“的表信息到excel
     * @param file ä¸Šä¼ çš„æ–‡ä»¶
     */
    @PostMapping("/importData")
    @VciBusinessLog(operateName = "导入表单/表格")
    public BaseResult importData(MultipartFile file){
        String excelFileName = LocalFileUtil.getDefaultTempFolder() + File.separator + LocalFileUtil.getFileNameForIE(file.getOriginalFilename());
        File file1 = new File(excelFileName);
        try {
            file.transferTo(new File(excelFileName));
            if (file != null) {
                return portalVIServiceI.importData(file1);
            } else {
                return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"无导入的文件"});
            }
        }catch (Throwable e) {
            throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e);
        }finally {
            file1.delete();
        }
    }
    /**
     * èŽ·å–å±žæ€§å­—æ®µç±»åž‹
     */
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/enumpck/ActionEnum.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,132 @@
package com.vci.web.enumpck;
import com.vci.pagemodel.KeyValue;
import com.vci.starter.web.enumpck.BaseEnum;
import java.util.ArrayList;
import java.util.List;
/**
 * Action枚举
 * @author yuxc
 *
 */
public enum ActionEnum implements BaseEnum{
    EXP_CHOOSE("0","选择"),
    EXP_ALL("1","全部"),
    EXP_PAGE("2","页码"),
    CLOUMN_PLNAME("名称","plName"),
    CLOUMN_PLCODE("编号","plCode"),
    CLOUMN_PLBSURL("类路径","plBSUrl"),
    CLOUMN_PLCSCLASS("链接地址","plCSClass"),
    CLOUMN_PLDESC("描述","plDesc"),
    CLOUMN_PLTYPETYPE("类型","plTypeType");
    /**
     * æžšä¸¾çš„值
     */
    private String value;
    /**
     * æžšä¸¾æ˜¾ç¤ºæ–‡æœ¬
     */
    private String text;
    /**
     * èŽ·å–æžšä¸¾å€¼
     *
     * @return æžšä¸¾å€¼
     */
    @Override
    public String getValue() {
        return value;
    }
    /**
     * è®¾ç½®æžšä¸¾å€¼
     *
     * @param value æžšä¸¾å€¼
     */
    public void setValue(String value) {
        this.value = value;
    }
    /**
     * èŽ·å–æžšä¸¾æ˜¾ç¤ºæ–‡æœ¬
     *
     * @return æ˜¾ç¤ºæ–‡æœ¬
     */
    @Override
    public String getText() {
        return text;
    }
    /**
     * è®¾ç½®æ˜¾ç¤ºæ–‡æœ¬
     *
     * @param text æ˜¾ç¤ºæ–‡æœ¬
     */
    public void setText(String text) {
        this.text = text;
    }
    ActionEnum(String value, String text) {
        this.value = value;
        this.text = text;
    }
    /**
     * æ ¹æ®åç§°èŽ·å–å¯¹åº”çš„æžšä¸¾å€¼
     *
     * @param text åç§°
     * @return æžšä¸¾å€¼
     */
    public static String getValueByText(String text) {
        for (ActionEnum actionEnum : ActionEnum.values()) {
            if (actionEnum.getText().equalsIgnoreCase(text)) {
                return actionEnum.getValue();
            }
        }
        return "";
    }
    /**
     * æ ¹æ®æžšä¸¾å€¼èŽ·å–åç§°
     *
     * @param value æžšä¸¾å€¼
     * @return åç§°
     */
    public static String getTextByValue(String value) {
        for (ActionEnum actionEnum : ActionEnum.values()) {
            if (actionEnum.getValue().equalsIgnoreCase(value)) {
                return actionEnum.getText();
            }
        }
        return "";
    }
    /**
     * æ ¹æ®æžšä¸¾å€¼èŽ·å–æžšä¸¾å¯¹è±¡
     *
     * @param value æžšä¸¾å€¼
     * @return æžšä¸¾å¯¹è±¡ï¼Œä¸å­˜åœ¨æ—¶å€™è¿”回null
     */
    public static ActionEnum forValue(String value) {
        for (ActionEnum actionEnum : ActionEnum.values()) {
            if (actionEnum.getValue().equalsIgnoreCase(value)) {
                return actionEnum;
            }
        }
        return null;
    }
    /**
     * æ ¹æ®æžšä¸¾å€¼èŽ·å–åç§°
     *
     * @return åç§°
     */
    public static List<KeyValue> getActionAll() {
        List<KeyValue> enumDataList=new ArrayList<>();
        for (ActionEnum actionEnum : ActionEnum.values()) {
            KeyValue enumData=new KeyValue();
            enumData.setKey(actionEnum.value);
            enumData.setValue(actionEnum.text);
            enumDataList.add(enumData);
        }
        return enumDataList;
    }
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/enumpck/PlTypetypeEnum.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,128 @@
package com.vci.web.enumpck;
import com.vci.pagemodel.KeyValue;
import com.vci.starter.web.enumpck.BaseEnum;
import java.util.ArrayList;
import java.util.List;
/**
 * Action枚举
 * @author yuxc
 *
 */
public enum PlTypetypeEnum implements BaseEnum{
    BUSINESS("business","业务类型"),
    LINK("link","链接类型");
    /**
     * æžšä¸¾çš„值
     */
    private String value;
    /**
     * æžšä¸¾æ˜¾ç¤ºæ–‡æœ¬
     */
    private String text;
    /**
     * èŽ·å–æžšä¸¾å€¼
     *
     * @return æžšä¸¾å€¼
     */
    @Override
    public String getValue() {
        return value;
    }
    /**
     * è®¾ç½®æžšä¸¾å€¼
     *
     * @param value æžšä¸¾å€¼
     */
    public void setValue(String value) {
        this.value = value;
    }
    /**
     * èŽ·å–æžšä¸¾æ˜¾ç¤ºæ–‡æœ¬
     *
     * @return æ˜¾ç¤ºæ–‡æœ¬
     */
    @Override
    public String getText() {
        return text;
    }
    /**
     * è®¾ç½®æ˜¾ç¤ºæ–‡æœ¬
     *
     * @param text æ˜¾ç¤ºæ–‡æœ¬
     */
    public void setText(String text) {
        this.text = text;
    }
    PlTypetypeEnum(String value, String text) {
        this.value = value;
        this.text = text;
    }
    /**
     * æ ¹æ®åç§°èŽ·å–å¯¹åº”çš„æžšä¸¾å€¼
     *
     * @param text åç§°
     * @return æžšä¸¾å€¼
     */
    public static String getValueByText(String text) {
        for (PlTypetypeEnum actionEnum : PlTypetypeEnum.values()) {
            if (actionEnum.getText().equalsIgnoreCase(text)) {
                return actionEnum.getValue();
            }
        }
        return "";
    }
    /**
     * æ ¹æ®æžšä¸¾å€¼èŽ·å–åç§°
     *
     * @param value æžšä¸¾å€¼
     * @return åç§°
     */
    public static String getTextByValue(String value) {
        for (PlTypetypeEnum actionEnum : PlTypetypeEnum.values()) {
            if (actionEnum.getValue().equalsIgnoreCase(value)) {
                return actionEnum.getText();
            }
        }
        return "";
    }
    /**
     * æ ¹æ®æžšä¸¾å€¼èŽ·å–æžšä¸¾å¯¹è±¡
     *
     * @param value æžšä¸¾å€¼
     * @return æžšä¸¾å¯¹è±¡ï¼Œä¸å­˜åœ¨æ—¶å€™è¿”回null
     */
    public static PlTypetypeEnum forValue(String value) {
        for (PlTypetypeEnum actionEnum : PlTypetypeEnum.values()) {
            if (actionEnum.getValue().equalsIgnoreCase(value)) {
                return actionEnum;
            }
        }
        return null;
    }
    /**
     * æ ¹æ®æžšä¸¾å€¼èŽ·å–åç§°
     *
     * @return åç§°
     */
    public static List<KeyValue> getActionAll() {
        List<KeyValue> enumDataList=new ArrayList<>();
        for (PlTypetypeEnum actionEnum : PlTypetypeEnum.values()) {
            KeyValue enumData=new KeyValue();
            enumData.setKey(actionEnum.value);
            enumData.setValue(actionEnum.text);
            enumDataList.add(enumData);
        }
        return enumDataList;
    }
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsActionServiceI.java
@@ -1,11 +1,10 @@
package com.vci.web.service;
import com.vci.corba.common.PLException;
import com.vci.dto.PLActionClsDTO;
import com.vci.dto.PLActionDTO;
import com.vci.dto.PLActionQueryDTO;
import com.vci.dto.*;
import com.vci.starter.web.pagemodel.BaseResult;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.FileNotFoundException;
@@ -65,4 +64,33 @@
     * @return
     */
    void exportBeans(List<String> actionOid, HttpServletResponse response) throws PLException, IOException;
    /**
     * å¯¼å…¥Action
     * @param file ä¸Šä¼ çš„æ–‡ä»¶
     * @return
     */
    BaseResult impData(MultipartFile file) throws IOException, PLException;
    /**
     * å¯¼å‡ºAction
     * @param plActionExpDTO å¯¼å‡ºå±žæ€§è®¾ç½®å¯¹è±¡
     */
    void exportAction(PLActionExpDTO plActionExpDTO, HttpServletResponse response) throws PLException, IOException;
    /**
     * ä¿å­˜Action参数数据
     * dto action传输对象
     * @return ä¿å­˜ç»“æžœ
     */
    BaseResult savePLActionParam(PLActionParamDTO dto) throws PLException;
    /**
     * ä¿®æ”¹Action参数数据
     * dto action传输对象
     * @return ä¿å­˜ç»“æžœ
     */
    BaseResult updatePLActionParam(PLActionParamDTO dto) throws PLException;
    /**
     * åˆ é™¤Action参数数据
     * oid å‚数主键
     * @return ä¿å­˜ç»“æžœ
     */
    BaseResult deletePLActionParam(String oid) throws PLException;
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsAttributeServiceI.java
@@ -3,9 +3,7 @@
import com.vci.corba.common.PLException;
import com.vci.corba.omd.atm.AttributeDef;
import com.vci.dto.OsAttributeDTO;
import com.vci.starter.web.pagemodel.BaseQueryObject;
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.starter.web.pagemodel.DataGrid;
import com.vci.starter.web.pagemodel.*;
import com.vci.pagemodel.OsAttributeVO;
import org.springframework.web.multipart.MultipartFile;
@@ -21,6 +19,12 @@
 */
public interface OsAttributeServiceI extends OsBaseServiceI{
    /**
     * èŽ·å–æ ‘çŠ¶
     * @param treeQueryObject
     * @return
     */
    List<Tree> getTreeAttributesByBtmName(TreeQueryObject treeQueryObject);
    /**
     * èŽ·å–é»˜è®¤çš„å±žæ€§
     * @return é»˜è®¤çš„属性列表
@@ -178,4 +182,13 @@
     */
    boolean isDefaultAttr(String attr);
    /**
     * æ ¹æ®ä¸šåŠ¡ç±»åž‹/链接类型获取属性信息
     * @param btName ä¸šåŠ¡ç±»åž‹/链接类型
     * @param typeFlag 0:业务类型,1:链接类型
     * @param isDefault æ˜¯å¦åŒ…含默认属性 true:包含,false ä¸åŒ…含
     * @return
     */
    List<OsAttributeVO> getOsAttributeVOSByBtName(String btName,int typeFlag,boolean isDefault)throws Exception;
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsLinkTypeServiceI.java
@@ -173,4 +173,13 @@
     * @return å±žæ€§çš„信息
     */
    List<OsLinkTypeAttributeVO> getAllAttributeByLink(String name) throws PLException, ParseException;
    /**
     * èŽ·å–è®¾ç½®æŽ’åºå­—æ®µçš„æŽ’åºå­—æ®µ
     * @param linkType é“¾æŽ¥ç±»åž‹çš„编号
     * @param btmType ä¸šåŠ¡ç±»åž‹çš„ç¼–å·
     * @param direction æ­£/反向
     * @return å±žæ€§çš„信息
     */
    List<String> getAllOrderbyAttributeByLink(String linkType, String btmType, String direction) throws PLException, ParseException;
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsPortalVIServiceI.java
@@ -9,7 +9,10 @@
import com.vci.starter.web.pagemodel.BaseQueryObject;
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.starter.web.pagemodel.DataGrid;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
import java.util.Map;
@@ -82,6 +85,12 @@
    String exportToExcel(Collection<String> idList);
    /**
     * å¯¼å…¥è¡¨å•/表格数据
     * @param file ä¸Šä¼ çš„æ–‡ä»¶
     * @return
     */
    public BaseResult importData(File  file)throws Throwable;
    /**
     *查询所有表单或者表格
     * @return key æ˜¯ç”Ÿå‘½å‘¨æœŸçš„编号的英文小写
     * @throws VciBaseException æŸ¥è¯¢çš„æ—¶å€™å‡ºé”™ä¼šæŠ›å‡ºå¼‚常
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsActionServiceImpl.java
@@ -1,27 +1,30 @@
package com.vci.web.service.impl;
import cn.hutool.core.io.FileUtil;
import com.vci.constant.FrameWorkLangCodeConstant;
import com.vci.corba.common.PLException;
import com.vci.corba.omd.ltm.LinkType;
import com.vci.corba.omd.qtm.QTInfo;
import com.vci.corba.portal.data.Constraint;
import com.vci.corba.portal.data.PLAction;
import com.vci.corba.portal.data.PLActionCls;
import com.vci.corba.portal.data.PLActionParam;
import com.vci.dto.PLActionClsDTO;
import com.vci.dto.PLActionDTO;
import com.vci.dto.PLActionQueryDTO;
import com.vci.dto.*;
import com.vci.starter.poi.bo.WriteExcelData;
import com.vci.starter.poi.bo.WriteExcelOption;
import com.vci.starter.poi.util.ExcelUtil;
import com.vci.starter.web.exception.VciBaseException;
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.starter.web.util.ControllerUtil;
import com.vci.starter.web.util.LangBaseUtil;
import com.vci.starter.web.util.LocalFileUtil;
import com.vci.web.enumpck.ActionEnum;
import com.vci.web.enumpck.PlTypetypeEnum;
import com.vci.web.other.ExportActionLogBean;
import com.vci.web.other.ExportBeans;
import com.vci.web.other.LinkQTExportData;
import com.vci.web.service.*;
import com.vci.web.util.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
@@ -302,7 +305,7 @@
    @Override
    public void exportBeans(List<String> actionOid, HttpServletResponse response) throws PLException, IOException {
        String defaultTempFolder = LocalFileUtil.getDefaultTempFolder();
        String vciqtmfFileName = defaultTempFolder + File.separator + "actionTemplateExp" + new Date().getTime() + ".vciamf";
        String vciqtmfFileName = defaultTempFolder + File.separator + "VCIACTIONMODELFILE" + new Date().getTime() + ".vciamf";
        HashMap exportBeans = new HashMap<String, Object>();
        getExportBeans(actionOid, exportBeans);// èŽ·å¾—å¯¼å‡ºBean同时,记录log
@@ -325,6 +328,550 @@
        FileUtil.del(defaultTempFolder + File.separator);
    }
    @Override
    public BaseResult impData(MultipartFile file) throws IOException, PLException {
        // å¯¼å…¥çš„对象
        ExportBeans exportBeans = null;
        if (file == null) {
            return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"无导入的文件"});
        }
        if (!file.getOriginalFilename().endsWith(".vciamf")) {
            throw new VciBaseException("仅能上传.vciqtf格式文件,请重新上传!");
        }
        HashMap map;
        try {
            ObjectInputStream obj = new ObjectInputStream(file.getInputStream());
            map = (HashMap) obj.readObject();
        } catch (ClassNotFoundException e) {
            return BaseResult.fail("导入对象未获取成功!!导入对象版本号不同!");
        }
        //最终的持久化
        ArrayList<PLActionCls> pLActionClsList = new ArrayList<>();
        // æ›´æ¢actionId后,可以从此导航中获得原来的id
        HashMap<String /* newId */, String /* oldId */> actionIdNav = new HashMap<String /* newId */, String /* oldId */>();
        // æ›´æ¢actionClsId后,可以从此导航中获得原来的id
        HashMap<String /* newId */, String /* oldId */> actionClsIdNav = new HashMap<String /* newId */, String /* oldId */>();
        //保存所有父分类,用id主key
        HashMap<String/*id*/,PLActionCls> actionClses = new HashMap<String/*id*/,PLActionCls>();
        // å­˜å‚¨ç¬¦åˆæ¡ä»¶çš„PLAction
        ArrayList<PLAction> optionPLActionList = new ArrayList<>();
        // å­˜å‚¨ç¬¦åˆæ¡ä»¶çš„PLActionCls
        ArrayList<PLActionCls> optionPLActionClsList =  new ArrayList<>();
        // åº“中的所有Action分类对象
        PLActionCls[] pLActionClses = null;
        exportBeans = (ExportBeans) map.get("exportBeans");
        // æ·»åŠ å¯¼å…¥çš„æ•°æ®
        addImportData(exportBeans, pLActionClsList, actionIdNav, actionClsIdNav, optionPLActionClsList, pLActionClses, optionPLActionList);
        // å°†PLActionCls ã€PLAction å¯¹åº”çš„set集合转换成数组(匹配原addExportTreeNode方法)
        PLActionCls[] newPLActionClsArray = new PLActionCls[optionPLActionClsList.size()];
        PLAction[] newPLActionArray = new PLAction[optionPLActionList.size()];
        optionPLActionClsList.toArray(newPLActionClsArray);
        optionPLActionList.toArray(newPLActionArray);
        //清楚分类id
        actionClses.clear();
        //保存所有分类id
        for (int i = 0; i < newPLActionClsArray.length; i++) {
            actionClses.put(newPLActionClsArray[i].id,newPLActionClsArray[i]);
        }
        //保存所有存在action的分类(子分类存在action也保存)
        HashSet<PLActionCls> pLActionClss =new HashSet<PLActionCls> ();
        for (int i = 0; i < newPLActionArray.length; i++) {
            //缓存该分类的所有父分类
            saveParentCls(newPLActionArray[i].plActionCls,pLActionClss,actionClses);
        }
        PLActionCls[] actionClslist = new PLActionCls[pLActionClss.size()];
        pLActionClss.toArray(actionClslist);
        PLActionClsDTO treDto = new PLActionClsDTO();
        treDto.setName("Action分类");
        Map<String, List<PLAction>> plActionMap = Arrays.stream(newPLActionArray).collect(Collectors.groupingBy(e -> e.plActionCls));
        Map<String, List<PLActionCls>> plActionClsMap = pLActionClss.stream().collect(Collectors.groupingBy(e -> e.pid));
        Map<String, List<PLActionCls>> allCls = Arrays.stream(platformClientUtil.getUIService().getPLActionClsArray()).collect(Collectors.groupingBy(e -> e.name));
        // æ·»åŠ å­èŠ‚ç‚¹(源树节点)
        for (Map.Entry<String, PLActionCls> entry : exportBeans.getPLActionClsBeans().entrySet()) {
            if (StringUtils.isBlank(entry.getValue().pid)) {
                PLActionClsDTO parentDto = new PLActionClsDTO();
                parentDto.setId(entry.getValue().id);
                parentDto.setName(entry.getValue().name);
                parentDto.setPid(entry.getValue().pid);
                parentDto.setDescription(entry.getValue().description);
                parentDto.setCreator(entry.getValue().creator);
                parentDto.setCreateTime(entry.getValue().createTime);
                parentDto.setSerialno(entry.getValue().serialno);
                addExportTreeNode(plActionClsMap, plActionMap, parentDto, allCls, exportBeans);
                treDto.getChilds().add(parentDto);
            }
        }
        PLActionClsDTO noDto = new PLActionClsDTO();
        noDto.setName("未分类");
        if(plActionMap.containsKey("")){
            for (PLAction plAction : plActionMap.get("")) {
                PLActionClsDTO childPrentDto = new PLActionClsDTO();
                if (plAction.plName.endsWith("@#修改$%")) {
                    childPrentDto.setName(plAction.plCode + "/" + plAction.plName.replace("@#修改$%", "【修改完成】"));
                    plAction.plName = plAction.plName.replace("@#修改$%", "");
                    platformClientUtil.getUIService().updatePLAction(plAction);
                }else
                if (plAction.plName.endsWith("@#存在在未分类中$%")) {
                    childPrentDto.setName(plAction.plCode + "/" + plAction.plName.replace("@#存在在未分类中$%", "【action存在在未分类中,修改完成】"));
                    plAction.plName = plAction.plName.replace("@#存在在未分类中$%", "");
                    platformClientUtil.getUIService().updatePLAction(plAction);
//                    plAction.plName = plAction.plName.replace("@#存在在未分类中$%", "【action存在在未分类中,修改Action并按导入文件创建action分类】");
                }
                else {
                    childPrentDto.setName(plAction.plCode + "/" + "【新增完成】");
//                    plAction.plName += "【新增】";
                    platformClientUtil.getUIService().savePLAction(plAction);
                }
                dealParam(exportBeans, plAction);
                childPrentDto.setId(plAction.plOId);
                childPrentDto.setPid(plAction.plActionCls);
                noDto.getChilds().add(childPrentDto);
            }
        }
        treDto.getChilds().add(noDto);
        return BaseResult.success(treDto);
    }
    /**
     * å¯¼å‡ºAction
     * @param plActionExpDTO å¯¼å‡ºå±žæ€§è®¾ç½®å¯¹è±¡
     */
    @Override
    public void exportAction(PLActionExpDTO plActionExpDTO, HttpServletResponse response) throws PLException, IOException {
        String defaultTempFolder = LocalFileUtil.getDefaultTempFolder();
        String excelPath = defaultTempFolder + File.separator + plActionExpDTO.getFileName() + ".xls";
        try {
            new File(excelPath).createNewFile();
        } catch (Throwable e) {
            throw new VciBaseException(LangBaseUtil.getErrorMsg(e), new String[]{excelPath}, e);
        }
        isValidPageForamt(plActionExpDTO);
        //设置列
        List<WriteExcelData> excelDataList = new ArrayList<>();
        //设置列头
        for (int index = 0; index < plActionExpDTO.getColumnName().size(); index++) {
            excelDataList.add(new WriteExcelData(0,index, plActionExpDTO.getColumnName().get(index)));
        }
        PLAction[] allPLAction ;
        if(plActionExpDTO.getDataType().equals(ActionEnum.EXP_ALL.getValue()) ||
                plActionExpDTO.getDataType().equals(ActionEnum.EXP_PAGE.getValue())){
            allPLAction = platformClientUtil.getUIService().getAllPLAction();
        }else{
            allPLAction = new PLAction[plActionExpDTO.getChooseDataOid().size()];
            for (int i = 0; i < plActionExpDTO.getChooseDataOid().size(); i++) {
                allPLAction[i] = platformClientUtil.getUIService().getPLActionById(plActionExpDTO.getChooseDataOid().get(i));
            }
        }
        if(Func.isEmpty(allPLAction)){
            excelDataList.add(new WriteExcelData(1,1, "根据属性名称未查询到属性信息,请刷新后尝试重新导出!"));
        }else{
            for (int i = 0; i < allPLAction.length; i++) {
                PLAction action = allPLAction[i];
                List<String> columnName = plActionExpDTO.getColumnName();
                for (int index = 0; index < columnName.size(); index++) {
                    switch (columnName.get(index)){
                        case "编号":
                            excelDataList.add(new WriteExcelData(i+1,index, action.plCode));
                            break;
                        case "类路径":
                            excelDataList.add(new WriteExcelData(i+1,index, action.plBSUrl));
                            break;
                        case "链接地址":
                            excelDataList.add(new WriteExcelData(i+1,index, action.plCSClass));
                            break;
                        case "描述":
                            excelDataList.add(new WriteExcelData(i+1,index, action.plDesc));
                            break;
                        case "类型":
                            excelDataList.add(new WriteExcelData(i+1,index, action.plTypeType.equals(PlTypetypeEnum.BUSINESS.getValue()) ?
                                    PlTypetypeEnum.BUSINESS.getText() : PlTypetypeEnum.LINK.getText()));
                            break;
                        case "名称":
                            excelDataList.add(new WriteExcelData(i+1,index, action.plName));
                            break;
                    }
                }
            }
        }
        WriteExcelOption excelOption = new WriteExcelOption(excelDataList);
        ExcelUtil.writeDataToFile(excelPath, excelOption);
        ControllerUtil.writeFileToResponse(response,excelPath);
        FileUtil.del(defaultTempFolder + File.separator);
    }
    /**
     * ä¿å­˜Action参数数据
     * dto action传输对象
     * @return ä¿å­˜ç»“æžœ
     */
    @Override
    public BaseResult savePLActionParam(PLActionParamDTO dto) throws PLException {
        if(dto.getName() == null || dto.getName().equals("")) {
            throw new PLException("500",new String[]{"参数名称不能为空"});
        }
        PLActionParam param = new PLActionParam();
        param.oid = "";
        param.name = dto.getName();
        param.defaultValue = dto.getDefaultValue();
        param.description = dto.getDescription();
        param.action = dto.getAction();
        String message = platformClientUtil.getUIService().createPLActionParam(param);
        if(message.startsWith("0")) {
            if(message.equals("01")) {
                throw new PLException("500",new String[]{"参数名已经存在!"});
            } else {
                throw new PLException("500",new String[]{"添加按钮参数时发生异常:" + message.substring(1)});
            }
        }
        return BaseResult.success();
    }
    @Override
    public BaseResult updatePLActionParam(PLActionParamDTO dto) throws PLException {
        if(dto.getName() == null || dto.getName().equals("")) {
            throw new PLException("500",new String[]{"参数名称不能为空"});
        }
        PLActionParam param = new PLActionParam();
        param.oid = dto.getOid();
        param.name = dto.getName();
        param.defaultValue = dto.getDefaultValue();
        param.description = dto.getDescription();
        param.action = dto.getAction();
        String message = platformClientUtil.getUIService().editPLActionParam(param);
        if(message.startsWith("0")) {
            if(message.equals("01")) {
                throw new PLException("500",new String[]{"参数名已经存在!"});
            } else {
                throw new PLException("500",new String[]{"添加按钮参数时发生异常:" + message.substring(1)});
            }
        }
        return BaseResult.success();
    }
    /**
     * åˆ é™¤Action参数数据
     * oid å‚数主键
     * @return ä¿å­˜ç»“æžœ
     */
    @Override
    public BaseResult deletePLActionParam(String oid) throws PLException {
        if(StringUtils.isBlank(oid)){
            throw new PLException("500", new String[]{"参数主键不能为空"});
        }
        String message = platformClientUtil.getUIService().deletePLActionParam(oid);
        if (message.startsWith("0")) {
            throw new PLException("500", new String[]{"删除按钮参数时发生异常:" + message.substring(1)});
        }
        return BaseResult.success();
    }
    public boolean isValidPageForamt(PLActionExpDTO plActionExpDTO) throws PLException {
        boolean res = false;
        if(plActionExpDTO.getDataType().equals(ActionEnum.EXP_ALL.getValue()) ||
                plActionExpDTO.getDataType().equals(ActionEnum.EXP_CHOOSE.getValue())) {
            res = true;
            return res;
        }
        if(StringUtils.isBlank(plActionExpDTO.getPageNum())){
            throw new PLException("500", new String[]{"页码不能为空"});
        } else{
            int pageCount = 1;//这里固定由于界面没有翻页功能
            String[] pages = plActionExpDTO.getPageNum().split("-");
            // ç”¨dobule接收输入的数据,防止输入超大值(大于Integer.MAX_VALUE)
            // è½¬æ¢æˆInteger,进行比较,及在提示内容中去掉double类型数据可能会出现的小数点
            if(pages.length == 1){
                double pageD = Double.parseDouble(pages[0]);
                if(pageD > Integer.MAX_VALUE){
                    throw new PLException("500", new String[]{"起始页码 " + String.valueOf(pageD) + " ä¸å¾—大于 " + Integer.MAX_VALUE});
                }else{
                    int page = (int)pageD;
                    if(page > pageCount){
                        throw new PLException("500", new String[]{"输入的页码 " + page + " ä¸å¾—大于总页数 " + pageCount});
                    } else if(page > Integer.MAX_VALUE){
                        throw new PLException("500", new String[]{"输入的页码 " + page + " ä¸å¾—大于 " + Integer.MAX_VALUE});
                    } else {
                        res = true;
                    }
                }
            } else{
                double pageStartD = Double.parseDouble(pages[0]);
                double pageEndD = Double.parseDouble(pages[1]);
                if(pageStartD > Integer.MAX_VALUE){
                    throw new PLException("500", new String[]{"起始页码 " + pageStartD + " ä¸å¾—大于 " + Integer.MAX_VALUE});
                } else if(pageEndD > Integer.MAX_VALUE){
                    throw new PLException("500", new String[]{"结束页码 " + pageEndD + " ä¸å¾—大于 " + Integer.MAX_VALUE});
                } else{
                    int pageStart = (int)pageStartD;
                    int pageEnd = (int)pageEndD;
                    if(pageStart > pageCount){
                        throw new PLException("500", new String[]{"起始页码 " + pageStart + " ä¸å¾—大于总页数 " + pageCount});
                    } else if(pageEnd > pageCount){
                        throw new PLException("500", new String[]{"结束页码 " + pageEnd + " ä¸å¾—大于总页数 " + pageCount});
                    } else if(pageStart > pageEnd){
                        throw new PLException("500", new String[]{"起始页码 " + pageStart + " ä¸å¾—大于结束页码 " + pageEnd});
                    } else{
                        res = true;
                    }
                }
            }
        }
        return res;
    }
    /**
     * å¤„理参数列表
     * @param exportBeans å¯¼å…¥æ•°æ®é›†åˆ
     * @param plAction action对象
     * @throws PLException
     */
    private void dealParam(ExportBeans exportBeans, PLAction plAction) throws PLException {
        PLActionParam[] plActionParamArrayByActionId = exportBeans.getPLActionParamArrayByActionId(plAction.plOId);
        PLActionParam[] paramArray = platformClientUtil.getUIService().getPLActionParamArrayByActionId(plAction.plOId);
        Map<String, List<PLActionParam>> params = Arrays.stream(paramArray).collect(Collectors.groupingBy(e -> e.oid));
        if(plActionParamArrayByActionId == null){
            return;
        }
        for (PLActionParam param : plActionParamArrayByActionId) {
            if(params.containsKey(param)){
                platformClientUtil.getUIService().editPLActionParam(param);
            }else {
                platformClientUtil.getUIService().createPLActionParam(param);
            }
        }
    }
    private void addExportTreeNode(Map<String, List<PLActionCls>> pLActionClses, Map<String, List<PLAction>> plActions,
                                   PLActionClsDTO parentDto,Map<String, List<PLActionCls>> allCls, ExportBeans exportBeans) throws PLException {
        //处理当前节点下的action
        if(plActions.containsKey(parentDto.getId())){
            for (PLAction plAction : plActions.get(parentDto.getId())) {
                PLActionClsDTO childPrentDto = new PLActionClsDTO();
                childPrentDto.setId(plAction.plOId);
                if (plAction.plName.endsWith("@#修改$%")) {
                    childPrentDto.setName(plAction.plCode + "/" + plAction.plName.replace("@#修改$%", "【修改成功】"));
//                    plAction.plName = plAction.plName.replace("@#修改$%", "【修改】");
                    plAction.plName = plAction.plName.replace("@#修改$%", "");
                    platformClientUtil.getUIService().updatePLAction(plAction);
                }else
                if (plAction.plName.endsWith("@#存在在未分类中$%")) {
                    childPrentDto.setName(plAction.plCode + "/" + plAction.plName.replace("@#存在在未分类中$%", "【action存在在未分类中,修改Action成功】"));
//                    plAction.plName = plAction.plName.replace("@#存在在未分类中$%", "【action存在在未分类中,修改Action并按导入文件创建action分类】");
                    plAction.plName = plAction.plName.replace("@#存在在未分类中$%", "");
                    platformClientUtil.getUIService().updatePLAction(plAction);
                }
                else {
                    childPrentDto.setName(plAction.plCode + "/" + plAction.plName.replace("@#新增%", "【新增成功】"));
//                    plAction.plName += "【新增】";
                    platformClientUtil.getUIService().savePLAction(plAction);
                }
                dealParam(exportBeans, plAction);
                childPrentDto.setPid(plAction.plActionCls);
                parentDto.getChilds().add(childPrentDto);
            }
        }
        if(pLActionClses.containsKey(parentDto.getId())){
            List<PLActionCls> plActionCls = pLActionClses.get(parentDto.getId());
            for (PLActionCls plActionCl : plActionCls) {
                PLActionClsDTO childParentDto = new PLActionClsDTO();
                childParentDto.setId(plActionCl.id);
                if(allCls.containsKey(childParentDto.getName())){
                    childParentDto.setName(plActionCl.name);
                }else {
                    childParentDto.setName(plActionCl.name + "【新增完成】");
                    platformClientUtil.getUIService().creaetePLActionCls(plActionCl);
                }
                childParentDto.setPid(plActionCl.pid);
                childParentDto.setDescription(plActionCl.description);
                childParentDto.setCreator(plActionCl.creator);
                childParentDto.setCreateTime(plActionCl.createTime);
                childParentDto.setSerialno(plActionCl.serialno);
                addExportTreeNode(pLActionClses, plActions, childParentDto, allCls, exportBeans);
                parentDto.getChilds().add(childParentDto);
            }
        }
    }
    /**
     * ä¿å­˜æ‰€æœ‰çˆ¶åˆ†ç±»
     * @param plActionCls
     * @param pLActionClsList
     */
    private void saveParentCls(String plActionCls, HashSet<PLActionCls> pLActionClsList,
                               HashMap<String/*id*/,PLActionCls> actionClses) {
        if(actionClses.containsKey(plActionCls)){
            PLActionCls pCls = actionClses.get(plActionCls);
            pLActionClsList.add(pCls);
            saveParentCls(pCls.pid, pLActionClsList, actionClses);
        }
    }
    private void addImportData(ExportBeans exportBeans, ArrayList<PLActionCls> pLActionClsList, HashMap<String /* newId */,
            String /* oldId */> actionIdNav,HashMap<String /* newId */, String /* oldId */> actionClsIdNav,
            ArrayList<PLActionCls> optionPLActionClsList, PLActionCls[] pLActionClses, ArrayList<PLAction> plActionList)
            throws PLException {
        HashMap<String, PLAction> pLActionBeans = exportBeans.getPLActions();
        if (pLActionBeans == null) {
            throw new VciBaseException("导入对象未获取成功!!");
        }
        //数据库中没有存在的数据对象,需要进行保存
//        ArrayList<PLAction> plActionList = new ArrayList<>();
        PLAction[] allPLAction = platformClientUtil.getUIService().getAllPLAction();
        Map<String, PLAction> allPLActionMap = Arrays.stream(allPLAction).collect(Collectors.toMap(e -> e.plOId, e -> e));
        Set<Map.Entry<String, PLAction>> plActions = pLActionBeans.entrySet();
        for (Map.Entry<String, PLAction> entry : plActions) {
            PLAction plAction = entry.getValue();
            PLAction plActionInDB =allPLActionMap.get(plAction.plOId);
            if (plActionInDB != null) {
                if( plActionInDB.plActionCls != ""){
                    plAction.plActionCls = plActionInDB.plActionCls;
                    // plAction.plOId = newId;
                    plAction.plName += "@#修改$%";
                    plActionList.add(plAction);
                    continue;
                }else{
                    plAction.plName += "@#存在在未分类中$%";
                }
            }
            // å°†è¯¥å®žä¾‹acion存入到plActionList中
            plActionList.add(plAction);
            // å®šä¹‰list存储当前action到数据库action的路径上的所有PLActionCls对象
            List<PLActionCls> plActionClsList = new ArrayList<PLActionCls>();
            // èŽ·å¾—åº“ä¸­çš„æœ€è¿‘çš„PLActionCls对象
            String pId = WebUtil.getSnowflakePk();
            String oId = WebUtil.getSnowflakePk();
            PLActionCls pLActionCls = getParentPLActionClsInDBById(plAction,
                    pId, plActionClsList, actionClsIdNav, exportBeans, optionPLActionClsList, pLActionClses);
            changePLActionOID(plAction, oId, pId, actionIdNav);
            if (plActionClsList.size() == 1) {
                // åˆ é™¤"未分类"分类对象
                PLActionCls plActionCls = plActionClsList.get(plActionClsList
                        .size() - 1);
                if(pLActionCls != null){
                    plAction.plActionCls = pLActionCls.id;
                    if(plActionCls.name.equals("未分类")){
                        plAction.plActionCls = "";
                    }
                    plActionClsList.remove(plActionClsList.size() - 1);
                }else{
                    if(plActionCls.name.equals("未分类")){
                        plActionClsList.remove(plActionClsList.size() - 1);
                    }else{
                        plActionCls.pid = "";
                    }
                }
            }
            if (plActionClsList.size() >= 2) {
                PLActionCls plActionCls2 = plActionClsList.get(plActionClsList
                        .size() - 2);
                PLActionCls plActionCls1 = plActionClsList.get(plActionClsList
                        .size() - 1);
                if (pLActionCls != null) {
                    // å°†å¯¼å…¥å¯¹è±¡ä¸Žâ€œåº“中的最近的PLActionCls对 è±¡â€name相同的对象
                    // çš„下一个PLActionCls对象父id改为库中“最近”PLActionCls对象id
                    plActionClsList.remove(plActionClsList.size() - 1);
                    plActionCls2.pid = pLActionCls.id;
                }else{
                    if(plActionCls1.name.equals("未分类")){
                        plActionClsList.remove(plActionClsList.size() - 1);
                        plActionCls2.pid = "";
                    }else{
                        plActionCls1.pid = "";
                    }
                }
            }
            // å¢žåŠ åˆ°æ•´ä½“list中用来最终持久化
            pLActionClsList.addAll(plActionClsList);
        }
    }
    private void changePLActionOID(PLAction plAction, String oId, String pId, HashMap<String /* newId */, String /* oldId */> actionIdNav) {
        actionIdNav.put(oId, plAction.plOId);
        plAction.plOId = oId;
        plAction.plActionCls = pId;
    }
    /***
     * èŽ·å¾—åº“ä¸­çš„PLActionCls对象,用来嫁接导入来的树
     *
     * @param
     * @param plActionClsList
     * @return
     */
    private PLActionCls getParentPLActionClsInDBById(Object plActionClsIdObj,
                                                     String newPLActionClsId, List<PLActionCls> plActionClsList,
                                                     HashMap<String /* newId */, String /* oldId */> actionClsIdNav,ExportBeans exportBeans,
                                                     ArrayList<PLActionCls> optionPLActionClsList, PLActionCls[] pLActionClses) {
        String pId = null;
        if (plActionClsIdObj instanceof PLAction) {
            pId = ((PLAction) plActionClsIdObj).plActionCls;
            if(pId.equals("")){
                PLActionCls noneCls = new PLActionCls("", "未分类", "", "", "", 0, (short)0);
                plActionClsList.add(noneCls);
                return noneCls;
            }
        }
        if (plActionClsIdObj instanceof PLActionCls) {
            pId = ((PLActionCls) plActionClsIdObj).pid;
            pId = actionClsIdNav.get(pId);
            if(pId.equals("")){
                pId = "null";
            }
        }
        PLActionCls plActionCls = exportBeans.getPLActionClsBeanById(pId);// ä»Žå¯¼å…¥å¯¹è±¡ä¸­èŽ·å¾—çˆ¶åˆ†ç±»
        PLActionCls tempPLActionCls = null;
        if (plActionCls != null) {// plActionCls为空 è¯æ˜Žçˆ¶èŠ‚ç‚¹ä¸ºæ ¹èŠ‚ç‚¹
            plActionClsList.add(plActionCls);
            if(optionPLActionClsList.contains(plActionCls)){
                return plActionCls ;
            }
            for (PLActionCls Cls : pLActionClses) {
                if ((plActionCls.id.equals("") && plActionCls.name.trim()
                        .equals("未分类"))
                        || plActionCls.name.trim().equals(Cls.name.trim())) {
                    tempPLActionCls = Cls;
                }
            }
            plActionCls.id = newPLActionClsId; // ä¿®æ”¹çˆ¶åˆ†ç±»id
        } else {
            return null;
        }
        if (tempPLActionCls == null) {
            String newClsId = WebUtil.getSnowflakePk();
            actionClsIdNav.put(newClsId, plActionCls.pid);
            plActionCls.pid = newClsId;
            return getParentPLActionClsInDBById(plActionCls, newClsId,
                    plActionClsList, actionClsIdNav, exportBeans, optionPLActionClsList, pLActionClses);
        }
        return tempPLActionCls;
    }
    /**
     * å¤„理导出的对象
     * @param actionOid ç•Œé¢é€‰æ‹©çš„action列表数据
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsAttributeServiceImpl.java
@@ -7,14 +7,14 @@
import com.vci.client.mw.ClientSessionUtility;
import com.vci.corba.common.PLException;
import com.vci.corba.omd.atm.AttributeDef;
import com.vci.corba.omd.ltm.LinkType;
import com.vci.corba.omd.vrm.VersionRule;
import com.vci.dto.OsAttributeDTO;
import com.vci.dto.OsEnumDTO;
import com.vci.dto.OsEnumItemDTO;
import com.vci.omd.dataType.VTDataType;
import com.vci.pagemodel.OsEnumItemVO;
import com.vci.pagemodel.OsEnumVO;
import com.vci.pagemodel.OsUsedAttributeVO;
import com.vci.omd.objects.OtherInfo;
import com.vci.pagemodel.*;
import com.vci.po.OsAttributePO;
import com.vci.po.OsEnumPO;
import com.vci.starter.poi.bo.ReadExcelOption;
@@ -25,12 +25,10 @@
import com.vci.starter.web.annotation.log.VciUnLog;
import com.vci.starter.web.enumpck.VciFieldTypeEnum;
import com.vci.starter.web.exception.VciBaseException;
import com.vci.starter.web.pagemodel.BaseQueryObject;
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.starter.web.pagemodel.DataGrid;
import com.vci.starter.web.pagemodel.*;
import com.vci.starter.web.util.*;
import com.vci.model.OsAttributeDO;
import com.vci.pagemodel.OsAttributeVO;
import com.vci.web.enumpck.PortalVITypeFlag;
import com.vci.web.properties.UsedNames;
import com.vci.web.service.OsAttributeServiceI;
import com.vci.web.service.OsBaseServiceI;
@@ -135,6 +133,101 @@
     * é»˜è®¤å±žæ€§çš„æ˜ å°„,key是小写
     */
    private static Map<String,OsAttributeVO> defaultAttributeVOMap = new HashMap<>();
    @Override
    public List<Tree> getTreeAttributesByBtmName(TreeQueryObject treeQueryObject) {
        List<Tree> rootTreeList=new ArrayList<>();
        Map<String, String> conditionMap = treeQueryObject.getConditionMap();
        if (conditionMap == null) {
            conditionMap = new HashMap<>();
        }
        String typeName = StringUtils.isBlank(conditionMap.get("typeName")) ? "" : conditionMap.get("typeName");
        if (StringUtils.isBlank(typeName)) {
            VciBaseUtil.alertNotNull(typeName,"业务类型名称");
        }
        try {
            String typeFlag=StringUtils.isBlank(conditionMap.get("typeFlag"))?"":conditionMap.get("typeFlag");
            PortalVITypeFlag portalVITypeFlag= PortalVITypeFlag.getByName(typeFlag);
            Short viTypeFlag=-1;
            if(portalVITypeFlag!=null){
                viTypeFlag=portalVITypeFlag.getIntVal();
            }
            boolean isDefault =Boolean.parseBoolean(conditionMap.get("isDefault"));
            Tree tree = new Tree("root", "【" + typeName + "】属性信息", "root");
            tree.setLevel(0);
            rootTreeList.add(tree);
            getChildTree(rootTreeList,typeName, viTypeFlag,isDefault);
        }catch (Throwable e){
         e.printStackTrace();
        }
        return rootTreeList;
    }
    /**
     * å¤Ÿç€å±žæ€§æ ‘节点
     * @param parentTreeList
     * @param refTypeName
     * @param refFlag
     * @param isDefault
     * @throws Exception
     */
    private void getChildTree(List<Tree> parentTreeList,String refTypeName,int refFlag,boolean isDefault) throws Exception {
        for (Tree pTree : parentTreeList) {
            if (pTree.getLevel()>= 3) {
                continue;
            }
            Object o= pTree.getData();
            String pName=pTree.getText();
            boolean isOsAttributeVO=false;
            if(o instanceof OsAttributeVO){
                isOsAttributeVO=true;
                OsAttributeVO osAttributeVO=(OsAttributeVO)o;
                String other = osAttributeVO.getOther();
                OtherInfo otherInfo = OtherInfo.getOtherInfoByText(other);
                refFlag = otherInfo.getRefFlag();
                refTypeName = otherInfo.getRefTypeName();
            }
            List<OsAttributeVO> childOsAttributeVOList=new ArrayList<>();
            if (refFlag != -1) {
                // pName: ä¸ºå‚照属性名加上路径
                childOsAttributeVOList=getOsAttributeVOSByBtName(refTypeName,refFlag,isDefault);
                if(!CollectionUtils.isEmpty(childOsAttributeVOList)) {
                    List<Tree> childTreeList= new ArrayList<>();
                    boolean finalIsOsAttributeVO = isOsAttributeVO;
                    childOsAttributeVOList.stream().forEach(childOsAttributeVO->{
                        Tree childTree = new Tree(childOsAttributeVO.getOid(), childOsAttributeVO.getId(), childOsAttributeVO);
                        childTree.setOid(childOsAttributeVO.getOid());
                        childTree.setParentName(pTree.getText());
                        childTree.setParentId(pTree.getOid());
                        childTree.setLevel(pTree.getLevel()+1);
                        childTree.setLeaf(true);
                        if(finalIsOsAttributeVO) {
                            childTree.setText(pName + "." + childOsAttributeVO.getId());
                        }else{
                            childTree.setText(childOsAttributeVO.getId());
                        }
                        if (childTree.getLevel()>= 3) {
                            childTree.setLeaf(true);
                        }
                        childTreeList.add(childTree);
                    });
                    if(childTreeList.size()>0){
                        pTree.setChildren(childTreeList);
                        pTree.setExpanded(false);
                        getChildTree(childTreeList,refTypeName,refFlag,isDefault);
                    }else{
                        pTree.setLeaf(true);
                        pTree.setExpanded(true);
                    }
                }
            }else{
                pTree.setExpanded(true);
            }
        }
    }
    /**
     * èŽ·å–é»˜è®¤çš„å±žæ€§
@@ -1136,6 +1229,50 @@
    }
    /**
     * æ ¹æ®ä¸šåŠ¡ç±»åž‹èŽ·å–å±žæ€§ä¿¡æ¯
     * @param btName ä¸šåŠ¡ç±»åž‹/链接类型
     * @param typeFlag 0:业务类型,1:链接类型
     * @return
     */
    @Override
    public List<OsAttributeVO> getOsAttributeVOSByBtName(String btName, int typeFlag,boolean isDefault) throws Exception{
        VciBaseUtil.alertNotNull(btName,"参数不允许为空",typeFlag,"参数不允许为空");
        List<OsAttributeVO> attributeVOS=new ArrayList<>();
        try {
            List<AttributeDef> attributeDefList=new ArrayList<>();
            if(typeFlag==0){
                AttributeDef [] attributeDefs=    platformClientUtil.getBtmService().getAttributeDefs(btName);
                if(attributeDefs!=null){
                    attributeDefList.addAll(Arrays.stream(attributeDefs).collect(Collectors.toList()));
                }
                if(isDefault){
                    AttributeDef [] sysAttributeDefs=platformClientUtil.getBtmService().getSysAttributeDefs();
                    if(sysAttributeDefs!=null){
                        attributeDefList.addAll(Arrays.stream(sysAttributeDefs).collect(Collectors.toList()));
                    }
                }
            }else{
                AttributeDef []    attributeDefs=platformClientUtil.getLinkTypeService().getAttributes(btName);
                if(attributeDefs!=null){
                    attributeDefList.addAll(Arrays.stream(attributeDefs).collect(Collectors.toList()));
                }
                if(isDefault){
                    AttributeDef[] sysAbItems = platformClientUtil.getLinkTypeService().getSysAttributeDefs();
                    if(sysAbItems!=null){
                        attributeDefList.addAll(Arrays.stream(sysAbItems).collect(Collectors.toList()));
                    }
                }
            }
            attributeVOS=attributeDO2VOs(attributeDefList);
        }catch (PLException e){
            throw new Exception("根据业务类型获取属性异常"+e.getMessage());
        }
        return attributeVOS;
    }
    /**
     * æ˜¯å¦ä¸ºå‚照属性
     * @param other é…ç½®çš„å…¶ä»–
     * @return true æ˜¯å‚ç…§
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java
@@ -4,6 +4,7 @@
import cn.hutool.core.util.ZipUtil;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.vci.common.qt.object.QTConstants;
import com.vci.constant.FrameWorkLangCodeConstant;
import com.vci.corba.common.PLException;
import com.vci.corba.omd.atm.AttributeDef;
@@ -752,6 +753,31 @@
        }
        return links;
    }
    /**
     * èŽ·å–è®¾ç½®æŽ’åºå­—æ®µçš„æŽ’åºå­—æ®µ
     * @param linkType é“¾æŽ¥ç±»åž‹çš„编号
     * @param btmType ä¸šåŠ¡ç±»åž‹çš„ç¼–å·
     * @param direction æ­£/反向
     * @return å±žæ€§çš„信息
     */
    @Override
    public List<String> getAllOrderbyAttributeByLink(String linkType, String btmType, String direction) throws PLException, ParseException {
        List<String> abNames = new ArrayList<>(Arrays.asList("OID", "Creator", "CreateTime", "LastModifier", "LASTMODIFYTIME", "F_OID",
                "F_REVISIONOID", "F_NAMEOID", "F_BtwName", "T_OID", "T_REVISIONOID", "T_NAMEOID", "T_BtwName", "TS" ));
        AttributeDef[] attributes = platformClientUtil.getLinkTypeService().getAttributes(linkType);
        for (AttributeDef attribute : attributes) {
            abNames.add(String.valueOf(attribute.name));
        }
        String wrapper = "T_OID.";
        if(direction.equals(QTConstants.DIRECTION_OPPOSITE)){
            wrapper = "F_OID.";
        }
        List<OsBtmTypeAttributeVO> bizTypeQTDs = btmService.getBizTypeQTDs(btmType);
        for (OsBtmTypeAttributeVO bizTypeQTD : bizTypeQTDs) {
            abNames.add(wrapper + bizTypeQTD.getId());
        }
        return abNames;
    }
    /**
     * ä¿®å¤é“¾æŽ¥ç±»åž‹çš„xml文件
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsPortalVIServiceImpl.java
@@ -1,26 +1,42 @@
package com.vci.web.service.impl;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.ZipUtil;
import com.vci.bo.ItemSeniorQueryBO;
import com.vci.common.utility.ObjectUtility;
import com.vci.constant.FrameWorkLangCodeConstant;
import com.vci.corba.common.PLException;
import com.vci.corba.omd.qtm.QTD;
import com.vci.corba.omd.qtm.QTInfo;
import com.vci.corba.portal.PortalService.GetPagePortalVIArrayByPageInfoResult;
import com.vci.corba.portal.data.PortalVI;
import com.vci.dto.*;
import com.vci.model.*;
import com.vci.pagemodel.*;
import com.vci.po.PortalVIPO;
import com.vci.po.QTDPO;
import com.vci.starter.poi.bo.ReadExcelOption;
import com.vci.starter.poi.bo.WriteExcelData;
import com.vci.starter.web.enumpck.VciFieldTypeEnum;
import com.vci.starter.poi.bo.WriteExcelOption;
import com.vci.starter.poi.util.ExcelUtil;
import com.vci.starter.web.exception.VciBaseException;
import com.vci.starter.web.pagemodel.BaseQueryObject;
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.starter.web.pagemodel.DataGrid;
import com.vci.starter.web.util.LocalFileUtil;
import com.vci.starter.web.util.VciBaseUtil;
import com.vci.starter.word.bo.WordMergeStartTableDataBO;
import com.vci.starter.word.util.WordUtil;
import com.vci.web.enumpck.ItemTypeEnum;
import com.vci.web.enumpck.PortalVIType;
import com.vci.web.enumpck.PortalVITypeFlag;
import com.vci.web.other.BtmQTExportData;
import com.vci.web.service.OsAttributeServiceI;
import com.vci.web.service.OsPortalVIServiceI;
import com.vci.web.service.OsQuereyTemplateServiceI;
import com.vci.web.util.PlatformClientUtil;
import com.vci.web.util.UITools;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -28,9 +44,11 @@
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.web.multipart.MultipartFile;
import java.io.*;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function;
import java.util.stream.Collectors;
@@ -51,13 +69,22 @@
    @Autowired(required = false)
    @Lazy
    private OsPortalVIServiceI self;
    /**
     * åŠ è½½è‡ªèº«
     */
    @Autowired(required = false)
   private OsAttributeServiceI osAttributeService;
    /**
     * å¹³å°çš„调用工具类
     */
    @Autowired
    private PlatformClientUtil platformClientUtil;
    /**
     * æŸ¥è¯¢æ¨¡æ¿æœåŠ¡
     */
    @Autowired
    private OsQuereyTemplateServiceI quereyTemplateServiceI;
    @Override
    public void clearCache() {
@@ -105,7 +132,7 @@
                dataGrid.setData(portalVIVOS);
                dataGrid.setTotal(pagePortalVIArrayByPageInfoResult.total);
            }else{
                dataGrid = new DataGrid<>("沒有查询到数据");
                dataGrid = new DataGrid<>();
            }
        } catch (PLException e) {
            e.printStackTrace();
@@ -134,7 +161,7 @@
     */
    @Override
    public PortalVIVO getPortalVIById(String id,String viType) throws PLException {
        VciBaseUtil.alertNotNull(id,"主键为空!");
        VciBaseUtil.alertNotNull(id,"主键");
        String lableName=PortalVIType.Form.getLabel();
        if(PortalVIType.Table.getName()==viType){
            lableName=PortalVIType.Table.getLabel();
@@ -159,7 +186,8 @@
    @Override
    public boolean delete(DeletePortalVIDTOList portalVIDTOList) throws PLException {
        if(portalVIDTOList==null||CollectionUtils.isEmpty(portalVIDTOList.getPortalVIDTOList())){
            VciBaseUtil.alertNotNull("请选择要删除的对象!");
          //  VciBaseUtil.alertNotNull("删除的对象");
            throw new PLException("1001",new String[]{"请选择要删除的对象!}"});
        }
        try {
            for(PortalVIDTO portalVIDTO:portalVIDTOList.getPortalVIDTOList()) {
@@ -235,6 +263,7 @@
                short typeFlag = clonedestObject.getTypeFlag();
                if (viName != null) {
                    VciBaseUtil.alertNotNull(viName, "克隆名称不允许为空");
                    //throw new PLException("1001",new String[]{"请选择要删除的对象!}"});
                    if(  PortalVIMap.containsKey(viName)){
                        throw  new VciBaseException("克隆名称"+viName+"已存在,请核对!");
                    }
@@ -260,77 +289,336 @@
    @Override
    public String exportToExcel(Collection<String> idList) {
        /*List<PortalVIVO>  portalVIVOList= listByIds(idList);
        String defaultTempFolder = LocalFileUtil.getDefaultTempFolder();
        String xfileName="export.xls";
        List<WriteExcelData> rowDataList = new ArrayList<>();
        final int[] index = {0};
        if(!CollectionUtils.isEmpty(portalVIVOList)) {
            portalVIVOList.stream().forEach(PortalVIVO -> {
                //先是名称
                int rowIndex = index[0];
                WriteExcelData idED = new WriteExcelData(rowIndex, 0, btmId);
                idED.setMerged(true);
                if (attributeVOS.size() > 0) {
                    idED.setRowTo(rowIndex + attributeVOS.size() - 1 + 3);
                }
                rowDataList.add(idED);
        List<WriteExcelData> qtRowDataList = new ArrayList<>();
        //VciBaseUtil.alertNotNull(idList);
        List<PortalVIDTO>  portalVIDTOList= listByIds(idList);
        final int index=0;
                WriteExcelData nameED = new WriteExcelData(rowIndex, 1, btmTypeVO.getName());
                nameED.setMerged(true);
                if (attributeVOS.size() > 0) {
                    nameED.setRowTo(rowIndex + attributeVOS.size() - 1 + 3);
                }
                rowDataList.add(nameED);
        String excelFileName = defaultTempFolder + File.separator + xfileName;
        File excelFile = new File(excelFileName);
        try {
            excelFile.createNewFile();
        }catch (Throwable e){
            String msg = "在创建excel文件的时候出现了错误";
            if(logger.isErrorEnabled()){
                logger.error(msg,e);
            }
            throw new VciBaseException(msg+",{0}",new String[]{excelFileName},e);
        }
                rowDataList.add(new WriteExcelData(rowIndex, 2, "id"));
                rowDataList.add(new WriteExcelData(rowIndex, 3, "编号"));
                rowDataList.add(new WriteExcelData(rowIndex, 4, "字符串"));
                rowDataList.add(new WriteExcelData(rowIndex, 5, "是"));
                rowDataList.add(new WriteExcelData(rowIndex, 6, "50"));
                rowIndex++;
                rowDataList.add(new WriteExcelData(rowIndex, 2, "name"));
                rowDataList.add(new WriteExcelData(rowIndex, 3, "名称"));
                rowDataList.add(new WriteExcelData(rowIndex, 4, "字符串"));
                rowDataList.add(new WriteExcelData(rowIndex, 5, "是"));
                rowDataList.add(new WriteExcelData(rowIndex, 6, "50"));
                rowIndex++;
                rowDataList.add(new WriteExcelData(rowIndex, 2, "description"));
                rowDataList.add(new WriteExcelData(rowIndex, 3, "描述"));
                rowDataList.add(new WriteExcelData(rowIndex, 4, "字符串"));
                rowDataList.add(new WriteExcelData(rowIndex, 5, "是"));
                rowDataList.add(new WriteExcelData(rowIndex, 6, "150"));
                //处理属性
                rowIndex++;
                for (int i = 0; i < attributeVOS.size(); i++) {
                    OsBtmTypeAttributeVO attributeVO = attributeVOS.get(i);
                    //先是属性的英文名称
                    rowDataList.add(new WriteExcelData(rowIndex, 2, attributeVO.getId()));
                    //然后属性的中文名称
                    rowDataList.add(new WriteExcelData(rowIndex, 3, attributeVO.getName()));
                    //属性的类型
                    rowDataList.add(new WriteExcelData(rowIndex, 4, VciFieldTypeEnum.getTextByValue(attributeVO.getAttributeDataType())));
                    //是否可以为空
                    rowDataList.add(new WriteExcelData(rowIndex, 5, attributeVO.isNullableFlag() ? "是" : "否"));
                    //属性长度
                    String length = attributeVO.getAttributeLength()==null?"":attributeVO.getAttributeLength() + "" ;
                    if (attributeVO.getPrecisionLength() != null) {
                        length = length + "(" + attributeVO.getPrecisionLength() + "," + attributeVO.getScaleLength() == null ? "2" : (attributeVO.getScaleLength() + "") + ")" ;
        rowDataList.add(new WriteExcelData(index, 0, "业务类型名称"));
        rowDataList.add(new WriteExcelData(index, 1, "名称"));
        rowDataList.add(new WriteExcelData(index, 2, "业务类型"));
        rowDataList.add(new WriteExcelData(index, 3, "表单类型"));
        rowDataList.add(new WriteExcelData(index, 4, "配置文本"));
        rowDataList.add(new WriteExcelData(index, 5, "属性"));
        rowDataList.add(new WriteExcelData(index, 6, "查询模板名称"));
        rowDataList.add(new WriteExcelData(index, 7, "查询模板配置文本"));
        rowDataList.add(new WriteExcelData(index, 8, "查询模板业务类型"));
        qtRowDataList.add(new WriteExcelData(index, 0, "业务类型名称"));
        qtRowDataList.add(new WriteExcelData(index, 1, "链接类型名称"));
        qtRowDataList.add(new WriteExcelData(index, 2, "查询模板定义名称"));
        qtRowDataList.add(new WriteExcelData(index, 3, "属性"));
        if(!CollectionUtils.isEmpty(portalVIDTOList)){
            final int[] rowIndex = {1};
            boolean isLink=PortalVITypeFlag.LinkType.getIntVal()== portalVIDTOList.get(0).getTypeFlag()?true:false;
            try {
                BaseResult baseResult=  quereyTemplateServiceI.queryTemplateList( portalVIDTOList.get(0).getTypeName(),isLink);
                if(baseResult.isSuccess()){
                    final int[] rowIndex1 = {1};
                    Collection< QTD> qtdList=  baseResult.getData();
                    if(!CollectionUtils.isEmpty(qtdList)){
                        qtdList.stream().forEach(qtd -> {
                            qtRowDataList.add(new WriteExcelData(rowIndex1[0], 0, qtd.btmName));
                            qtRowDataList.add(new WriteExcelData(rowIndex1[0], 1, qtd.linkTypeName));
                            qtRowDataList.add(new WriteExcelData(rowIndex1[0], 2, qtd.name));
                            qtRowDataList.add(new WriteExcelData(rowIndex1[0], 3, VciBaseUtil.array2String(qtd.abNames)));
                            rowIndex1[0]++;
                        });
                    }
                    rowDataList.add(new WriteExcelData(rowIndex, 6, length));
                    //备注
                    rowDataList.add(new WriteExcelData(rowIndex, 7, attributeVO.getDescription() == null ? "" : attributeVO.getDescription()));
                    rowIndex++;
                }
            } catch (PLException e) {
                e.printStackTrace();
            }
            portalVIDTOList.stream().forEach(portalVIDTO -> {
                //先是名称
                rowDataList.add(new WriteExcelData(rowIndex[0], 0, portalVIDTO.getTypeName()));//业务类型名称
                rowDataList.add(new WriteExcelData(rowIndex[0], 1, portalVIDTO.getViName()));//名称
                rowDataList.add(new WriteExcelData(rowIndex[0], 2, PortalVITypeFlag.getByIntVal(portalVIDTO.getTypeFlag()).getLabel()));//业务类型
                rowDataList.add(new WriteExcelData(rowIndex[0], 3,PortalVIType.getByIntVal(portalVIDTO.getViType()).getLabel()));//表单类型
                try {
                    String prmText=UITools.getPRMText(prmDOO2VIS(portalVIDTO.getPrm(),portalVIDTO.getViType()));
                    String prmTextFileName=    ObjectUtility.getNewObjectID36() + ".txt";
                    String prmTextFileNameAllName = xfileName + "." + prmTextFileName;
                    if (portalVIDTO.getViType() == PortalVIType.Table.getIntVal()) {//如果导入的table,则需要校验表格关联的表单是否存在,如果不存在则在execl中是否存在
                        PortalVI[] pvs = platformClientUtil.getPortalService().getPortalVIArrayByTypeName(portalVIDTO.getTypeName());
                        PRMDTO prmdto=   portalVIDTO.getPrm();
                        List<PRMItemDTO> prmItemDTOS=   prmdto.getPrmItemList();
                        if (!CollectionUtils.isEmpty(Arrays.asList(pvs))) {
                            Optional.ofNullable(prmItemDTOS).orElseGet(()->new ArrayList<>()).stream().forEach(prmItemDTO -> {
                                Arrays.stream(pvs).forEach(pv -> {
                                    if (prmItemDTO.getItemInObj().equals(pv.typeName + ":" + pv.viName)) {
                                        prmItemDTO.setItemInObj(pv.id);
                                    }
                                });
                            });
                        }
                    }
                    writeDataToFile(defaultTempFolder,prmTextFileNameAllName,prmText);
                    rowDataList.add(new WriteExcelData(rowIndex[0], 4,prmTextFileName));//配置文本
                } catch (Throwable e) {
                    e.printStackTrace();
                }
                String attributeStr="";
                try {
                    List<OsAttributeVO> osAttributeVOList=osAttributeService.getOsAttributeVOSByBtName(portalVIDTO.getTypeName(),portalVIDTO.getTypeFlag(),false);
                    if(!CollectionUtils.isEmpty(osAttributeVOList)){
                      List<String> filedList= osAttributeVOList.stream().map(OsAttributeVO::getId).collect(Collectors.toList());
                        attributeStr=VciBaseUtil.array2String(filedList.toArray(new String[]{}));
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
                rowDataList.add(new WriteExcelData(rowIndex[0], 5, attributeStr));//属性
              String qtName="";
                try {
                    QTInfo qt = platformClientUtil.getQTDService().getQT(portalVIDTO.getPrm().getFormQtName());
                    qtName=qt.qtName;
                    rowDataList.add(new WriteExcelData(rowIndex[0], 6,qtName));//查询模板名称
                    String qtFileName = ObjectUtility.getNewObjectID36() + ".txt";
                    String qtFileNameAllName = xfileName + "." + qtFileName;
                    writeDataToFile(defaultTempFolder,qtFileNameAllName,qt.qtText);
                    rowDataList.add(new WriteExcelData(rowIndex[0], 7, qtFileName));//查询模板配置文本
                    rowDataList.add(new WriteExcelData(rowIndex[0], 8, qt.btmName));//查询模板业务类型
                } catch (PLException e) {
                    e.printStackTrace();
                }
                index[0] = rowIndex;
                rowIndex[0]++;
            });
        }
*/
        return null;
       /* String excelTemplateFileName = "/excelTemplate/dataBaseExport.xls";
        if(this.getClass().getResource(excelTemplateFileName) == null){
            throw new VciBaseException("请联系管理员,系统中缺少{0}这个模板文件",new String[]{excelTemplateFileName});
        }
        try {
            ExcelUtil.copyFileFromJar(excelTemplateFileName,excelFile);
            //这个方法会关闭文件流
        }catch (Throwable e){
            String msg = "从模板文件拷贝到目标文件出现了错误";
            if(logger.isErrorEnabled()){
                logger.error(msg,e);
            }
            throw new VciBaseException(msg+",{0}",new String[]{excelFileName},e);
        }*/
        try{
            WriteExcelOption excelOption = new WriteExcelOption();
            excelOption.addSheetDataList("portalvi",rowDataList);
            excelOption.addSheetDataList("QTD",qtRowDataList);
            ExcelUtil.writeDataToFile(excelFile,excelOption);
        }catch (Throwable e){
            String msg = "把数据写入到excel文件中出现错误";
            if(logger.isErrorEnabled()){
                logger.error(msg,e);
            }
            throw new VciBaseException(msg+",{0}",new String[]{excelFileName},e);
        }
        File zip = ZipUtil.zip(defaultTempFolder);
        FileUtil.del(defaultTempFolder + File.separator);
        //最后返回excel文件名称
        return zip.getAbsoluteFile().getAbsolutePath();
    }
    public List<PortalVIVO> listByIds(Collection idList){
        List<PortalVIVO> portalVIVOList=new ArrayList<>();
    @Override
    public BaseResult importData(File file)throws Throwable{
        if (file == null) {
            return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"无导入的文件"});
        }
        try {
            File unzip = ZipUtil.unzip(file);
            String filePath=unzip.getAbsolutePath() + File.separator + "export.xls";
            File btmExcel = new File(filePath);
            List<PortalVIPO> portalVIPOList=new ArrayList<>();
            List<QTDPO> QTDPOPOList=new ArrayList<>();
            try {
                ReadExcelOption PortalVIPOReadExcelOption=new ReadExcelOption();
                PortalVIPOReadExcelOption.setSheetName("portalvi");
                PortalVIPOReadExcelOption.setSheetIndex(0);
                portalVIPOList = ExcelUtil.readDataObjectFromExcel(btmExcel, PortalVIPO.class,PortalVIPOReadExcelOption);
                //从execl获取查询模板定义.
               /* ReadExcelOption QTDPOReadExcelOption=new ReadExcelOption();
                QTDPOReadExcelOption.setSheetName("QTD");
                QTDPOReadExcelOption.setSheetIndex(1);
                QTDPOPOList = ExcelUtil.readDataObjectFromExcel(btmExcel, QTDPO.class,QTDPOReadExcelOption);*/
            }catch (VciBaseException e){
                throw  new Throwable("读取execl数据出错:"+e.getMessage());
            }
            List<PortalVI> portalVIList=new ArrayList<>();
            if(!CollectionUtils.isEmpty(portalVIPOList)){
                Map<String,String>formNameMap=new HashMap<>();
                StringBuffer checkInObj=new StringBuffer();
                StringBuffer checkPortalVI=new StringBuffer();
                List<String> sjkExitsList=new ArrayList<>();
                portalVIPOList.stream().forEach(portalVIPO -> {
                    PortalVI portalVI=new PortalVI();
                    String ploid = ObjectUtility.getNewObjectID36();
                    portalVI.id=ploid;
                    portalVI.viName=portalVIPO.getViName();
                    portalVI.typeName=portalVIPO.getTypeName();
                    portalVI.viType=PortalVIType.getByLabel(portalVIPO.getViTypeText()).getIntVal();
                    portalVI.typeFlag=PortalVITypeFlag.getByLabel(portalVIPO.getTypeFlagText()).getIntVal();
                    String fileName= portalVIPO.getPrmFileName();
                    String prmStr = readLines(filePath+"."+fileName);
                    try {
                        PortalVI[] pvs = platformClientUtil.getPortalService().getPortalVIArrayByTypeName(portalVI.typeName);
                        if (portalVI.viType == PortalVIType.Table.getIntVal()) {//如果导入的table,则需要校验表格关联的表单是否存在,如果不存在则在execl中是否存在
                            formNameMap.put(portalVI.typeName + ":" + portalVI.viName, ploid);
                            PRMDO prmObj = UITools.getPRM(prmStr);
                            List<PRMItemDO> prmItemList = prmObj.getPrmItemList();
                            if (!CollectionUtils.isEmpty(prmItemList)) {
                                prmItemList.stream().forEach(prmItemDO -> {
                                    if (!CollectionUtils.isEmpty(Arrays.asList(pvs))) {
                                        Arrays.stream(pvs).forEach(pv -> {
                                            if (prmItemDO.getItemInObj().equals(portalVI.typeName + ":" + pv.viName)) {
                                                prmItemDO.setItemInObj(pv.id);
                                            }
                                        });
                                    } else {
                                        if (formNameMap.containsKey(prmItemDO.getItemInObj())) {
                                            prmItemDO.setItemInObj(formNameMap.get(prmItemDO.getItemInObj()));
                                        } else {
                                            if (!checkInObj.toString().contains(prmItemDO.getItemInObj())) {
                                                String[] split = prmItemDO.getItemInObj().split(":");
                                                checkInObj.append(split[1]).append(",");
                                            }
                                        }
                                    }
                                });
                            }
                            prmStr = UITools.getPRMText(prmObj);
                        }
                        portalVI.prm = prmStr.trim();
                        //校验表单是否存在
                        if (!CollectionUtils.isEmpty(Arrays.asList(pvs))) {
                            Arrays.stream(pvs).forEach(pv -> {
                                if (pv.viName.equals(portalVI.viName)) {
                                    checkPortalVI.append(portalVI.viName).append(",");
                                }
                            });
                        }
                        //校验属性是否正确
                        List<OsAttributeVO> osAttributeVOList = osAttributeService.getOsAttributeVOSByBtName(portalVI.typeName, portalVI.typeFlag,false);
                        if (!CollectionUtils.isEmpty(osAttributeVOList)) {
                            List<String> filedList = osAttributeVOList.stream().map(OsAttributeVO::getId).collect(Collectors.toList());
                            List<String> attributeList = VciBaseUtil.str2List(portalVIPO.getAttributeKey());
                            //数据库不存在
                            List<String> sjkExitsLists = Optional.ofNullable(attributeList).orElseGet(() -> new ArrayList<>()).stream().filter(s -> !attributeList.contains(s)).collect(Collectors.toList());
                            sjkExitsList.addAll(sjkExitsLists);
                        }
                    }catch (Throwable e){
                        e.printStackTrace();
                    }
                    portalVIList.add(portalVI);
                    if(StringUtils.isNotBlank(portalVIPO.getQtName())&&StringUtils.isNotBlank(portalVIPO.getQtNameFile())) {
                        QTInfo qt = new QTInfo();
                        String qtText = readLines(filePath + "." + portalVIPO.getQtNameFile());
                        qt.qtText=qtText;
                        qt.qtName = portalVIPO.getQtName();
                        qt.btmName=portalVIPO.getQtName();
                        QTInfo qt2 = null;
                        try {
                            qt2 = platformClientUtil.getQTDService().getQT(qt.qtName);
                            if (qt2 == null) {
                                platformClientUtil.getQTDService().saveQT(qt);
                            }
                        } catch (PLException e) {
                            e.printStackTrace();
                        }
                    }
                });
                if (checkInObj.length() > 0) {
                    throw  new Throwable( checkInObj.toString() + "表单不存在!");
                }
                if (checkPortalVI.length() > 0) {
                    throw  new Throwable( checkInObj.toString() + "名称已经存在!");
                }
                if(sjkExitsList.size()>0){
                    throw  new Throwable( checkInObj.toString() + "属性在类型中不存在!");
                }
                for (PortalVI pvi : portalVIList) {
                    platformClientUtil.getPortalService().savePortalVI(pvi);
                }
            }
        }catch (Throwable e){
          //  throw new Throwable("导入失败:"+e.getMessage());
           return BaseResult.fail("导入失败:"+e.getMessage());
        }
        return BaseResult.success("导入成功");
    }
    private String readLines(String filePath){
        StringBuffer sb=new StringBuffer();
        FileInputStream prmFile=null;
        try {
            prmFile = new FileInputStream(filePath);
            List<String>  prm= IOUtils.readLines(prmFile,"UTF-8");
            prm.stream().forEach(s -> {
                sb.append(s);
            });
        } catch (IOException e) {
            IOUtils.closeQuietly(prmFile);
            e.printStackTrace();
        }finally {
            IOUtils.closeQuietly(prmFile);
        }
        return sb.toString();
    }
    /**
     * æ‹·è´æ•°æ®åˆ°word模板中
     * @param fileName è¦å†™å…¥çš„æ•°æ®
     * @return word æ–‡ä»¶è·¯å¾„
     */
    public String writeDataToFile(String defaultTempFolder,String fileName,String str){
        String tempFolder = LocalFileUtil.getDefaultTempFolder();
        //拷贝文件
        String filePath = tempFolder + File.separator + fileName;
        File file = new File(filePath);
        FileOutputStream out = null;
        try {
            file.createNewFile();
            out=  new FileOutputStream(file);
            IOUtils.write(str,out);
        }catch (Throwable e){
            IOUtils.closeQuietly(out);
            String msg = "在创建文件的时候出现了错误";
            if(logger.isErrorEnabled()){
                logger.error(msg,e);
            }
            throw new VciBaseException(msg+",{0}",new String[]{filePath},e);
        }finally {
            IOUtils.closeQuietly(out);
            //移动属性到链接类型文件夹里面去
            FileUtil.move(file, new File(defaultTempFolder),true);
            FileUtil.del(tempFolder);
        }
        return filePath;
    }
    public List<PortalVIDTO> listByIds(Collection idList){
        List<PortalVIDTO> portalVIVOList=new ArrayList<>();
        if(CollectionUtils.isEmpty(idList)){
            throw  new VciBaseException("请选择需要导出的数据");
        }
@@ -343,7 +631,7 @@
                e.printStackTrace();
            }
        });
        portalVIVOList=  portalVIDOO2VOS(portalVIList);
        portalVIVOList=  portalVIO2DTOS(portalVIList);
        return portalVIVOList;
    }
    private BaseResult savePortalVIDTO(PortalVIDTO portalVIDTO,boolean isEdit)  {
@@ -870,8 +1158,12 @@
        List<String> itemSelectoutFieldList= allKeyList.stream().filter(s ->!itemOutFieldList.stream().map(s1 -> s1).collect(Collectors.toList()).contains(s) ).collect(Collectors.toList());
        prmItemDTO.setItemSelectoutFieldList(itemSelectoutFieldList);//待选择的属性字段
        prmItemDTO.setItemOutFieldList(itemOutFieldList);//需要使用的集合
        List<String> itemSearchFieldList= itemOutFieldList.stream().filter(s ->!itemKeyFieldList.stream().map(s1 -> s1).collect(Collectors.toList()).contains(s) ).collect(Collectors.toList());
        prmItemDTO.setItemSearchFieldList(itemSearchFieldList);//待搜索字段
        List<String> itemSearchFieldList=new ArrayList<>();
        if(!CollectionUtils.isEmpty(itemKeyFieldList)){
            itemSearchFieldList= itemOutFieldList.stream().filter(s ->!itemKeyFieldList.contains(s)).collect(Collectors.toList());
        }else{
            itemSearchFieldList=itemOutFieldList;
        } prmItemDTO.setItemSearchFieldList(itemSearchFieldList);//待搜索字段
        prmItemDTO.setItemKeyFieldList(itemKeyFieldList);//搜索字段
    }
    /**
@@ -915,11 +1207,14 @@
    private List<KeyValue>  initItemFieldWidthList(String itemOutFields,String itemFieldWidth){
        List<KeyValue> keyValueList=new ArrayList<>();
        List<String>itemOutFieldList=   VciBaseUtil.str2List(itemOutFields);
        List<String>itemFieldWidthList=  VciBaseUtil.str2List(itemFieldWidth,":");
        List<String>itemFieldWidthList=  VciBaseUtil.str2List(itemFieldWidth,",");
        if(itemOutFieldList.size()>0) {
            for (int i = 0; i < itemOutFieldList.size(); i++) {
                KeyValue keyValue = new KeyValue();
                String with = itemFieldWidthList.get(i);
                String with="250";
                if(i<itemFieldWidthList.size()) {
                    with  = itemFieldWidthList.get(i);
               }
                keyValue.setKey(itemOutFieldList.get(i));
                keyValue.setValue(StringUtils.isBlank(with) ? "250" : with);
                keyValueList.add(keyValue);
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;
@@ -48,6 +48,9 @@
.avue-dialog .el-dialog__body .avue-form{
  margin: 0px auto 40px; // å•独给对话框里的avue表单加上下边距
}
.dialog-footer{
  background-color: #ffffff;
}
.avue-crud .avue-form {
  margin: 0px auto !important; // è¡¨æ ¼å†…的表单(比如:搜索栏) å–消下边距
}
Source/plt-web/plt-web-ui/src/api/UI/formDefine/api.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,14 @@
import request from '@/router/axios';
// åˆ—表查询
export function gridPortalVIDatas(page,limit,params) {
  return request({
    url: "/api/portalVIController/gridPortalVIDatas",
    method: "get",
    params:{
      page,
      limit,
      ...params
    }
  });
}
Source/plt-web/plt-web-ui/src/api/modeling/linkType/api.js
@@ -89,3 +89,11 @@
  });
}
// é“¾æŽ¥ç±»åž‹æŸ¥è¯¢æ¨¡æ¿æŽ’序设置字段下拉,参数linkType=witoannotatelink&btmType=fileobject&direction=positive
export function getAllOrderbyAttributeByLink(params) {
  return request({
    url: "/api/linkTypeController/getAllOrderbyAttributeByLink",
    method: "get",
    params
  });
}
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
  });
}
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
    }
  });
}
Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue
@@ -121,6 +121,7 @@
          Object.assign(this.form, this.initValue);
        }
      },
      deep:true,
      immediate: true,
    },
    formData: {
@@ -184,14 +185,14 @@
    },
    initItem(item){
      const type=this.columnType[item.type] || item.type;
      item.text=item.text || item.label;
      const col= {
        ...item,
        label: item.text,
        prop: item.field,
        showProp:item.showField,
        type: type,
        labelWidth: this.labelWidth || (item.text.length >= 6 ? 115 : 90),
        disabled: !this.isEdit || item.readOnly || this.disabled,
        disabled: item.readOnly || this.disabled,
        span: item.span
          ? item.span
          : item.type === "textarea"
@@ -206,25 +207,27 @@
        valueFormat: item.dateFormate || "yyyy-MM-dd HH:mm:ss",
        format: item.dateFormate,
        rules: this.isEdit?(type=="select" || type=="refer" || type=="date" || type=="datetime"?[{
          required: item.required,
          required: item.required || false,
          message: `请选择${item.text}!`,
          trigger: "change"
        },{
          required: item.required,
          required: item.required|| false,
          message: `请选择${item.text}!`,
          trigger: "submit"
        }]:[{
          required: item.required,
          required: item.required|| false,
          message: `请输入${item.text}!`,
          trigger: "blur"
        },{
          required: item.required,
          required: item.required|| false,
          message: `请输入${item.text}!`,
          trigger: "submit"
        }]):[]
        }]):[],
        ...item
      };
      if(!this.isEdit){
        col.placeholder=col.label;
        col.disabled=true;
      }
      if(col.type === 'richText'){
        this.subitemName = col.field;
@@ -340,6 +343,9 @@
    },
    clearValidate(props){
      this.$refs.form.clearValidate(props)
    },
    updateDic(prop,data){
      this.$refs.form.updateDic(prop,data)
    }
  },
};
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,
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,
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',  //从树上获取的字段
      }];
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: {
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>
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 {
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
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,
Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/businessType/index.vue
@@ -34,7 +34,7 @@
          </div>
          <!-- å·¦ä¾§æ ‘ -->
          <div style="height:  calc(100vh - 330px);">
            <avue-tree ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick">
            <avue-tree ref="tree" v-loading="treeLoading" :data="treeData" :option="treeOption" @node-click="nodeClick">
          <span slot-scope="{ node, data }" class="el-tree-node__label">
           <span style="font-size: 15px">
              <i class="el-icon-s-promotion"></i>
@@ -927,6 +927,7 @@
        name: 'el-icon-tickets',
        desc: 'el-icon-chat-line-square'
      },
      treeLoading:false
    }
  },
  created() {
@@ -937,6 +938,7 @@
  methods: {
    //树表查询
    getTreeList() {
      this.treeLoading = true;
      getBizTypes().then(res => {
        const data = res.data.data.map(item => {
          this.processChildren(item); // å¤„理每个节点
@@ -944,8 +946,8 @@
          return item.attributes; // è¿”回处理后的 attributes
        });
        this.treeData[0].children = data;
        console.log(this.treeData);
        this.inheritTreeData = data;
        this.treeLoading = false;
      });
    },
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,536 @@
<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>&nbsp;链接类型候选条件&nbsp;</legend>
            <div>
              æŸ¥è¯¢æ¨¡æ¿å®šä¹‰
              <avue-select @change="linkQueryDefineChange" class="el-input--small" v-model="linkQueryDefineForm" placeholder="请选择内容" type="tree" :dic="linkQueryDefineDic" style="width:240px"></avue-select>
              <avue-tree style="height: 265px" :data="linkTreeData" :option="treeOption"  @node-drag-start="handleDragStart">
              </avue-tree>
            </div>
          </fieldset>
        </el-aside>
        <el-main>
          <fieldset style="margin: 0 10px">
            <legend>&nbsp;查询条件&nbsp;</legend>
            <form-query-dialog style="height: 300px;" :queryCondition="queryCondition" :queryTree="queryTree"></form-query-dialog>
          </fieldset>
        </el-main>
        <el-aside style="width:350px">
          <fieldset>
            <legend>&nbsp;业务类型候选条件&nbsp;</legend>
            <div>
              æŸ¥è¯¢æ¨¡æ¿å®šä¹‰
              <avue-select @change="businessQueryDefineChange" class="el-input--small" v-model="businessQueryDefineForm" placeholder="请选择内容" type="tree" :dic="businessQueryDefineDic" style="width: 240px;"></avue-select>
              <avue-tree style="height: 265px" :data="businessTreeData" :option="treeOption"  @node-drag-start="handleDragStart">
              </avue-tree>
            </div>
          </fieldset>
        </el-aside>
      </el-container>
    </div>
    <div class="dialog-footer avue-dialog__footer">
      <el-button type="primary" plain size="small" @click="submitDialog" >保 å­˜</el-button>
      <el-button size="small" @click="cancelDialog">取 æ¶ˆ</el-button>
    </div>
  </el-dialog>
</template>
<script>
import {getAllOrderbyAttributeByLink} from "@/api/modeling/linkType/api";
import {linkSave} from "@/api/queryTemplate/linkTypeQuery";
import basicOption from "@/util/basic-option";
import {gridTemplate} from "@/api/queryTemplate/queryDefine";
import formQueryDialog from "./formQueryDialog.vue";
export default {
  name: "formDialog",
  components:{formQueryDialog},
  data(){
    return {
      dialog: {
        showDialog: false,
        title: "创建",
        submitTxt: "保存",
        submitIcon: "el-icon-check",
        loading: false,
        type: "add",
      },
      crudDialog: {
        showDialog: false,
        submitTxt: "保存",
        submitIcon: "el-icon-check",
      },
      formItems:[{
        label: '查询模板名称',
        prop: 'qtName',
        type: 'input',
        span:5,
        rules: [{
          required: true,
          message: "请输入查询模板名称",
          trigger: "blur"
        }]
      },{
        label: '方向',
        prop: 'direction',
        type: 'radio',
        value:'positive',
        labelWidth:70,
        span: 3,
        dicData: [{
          label: '正向',
          value: 'positive'
        }, {
          label: '反向',
          value: 'opposite'
        }]
      },{
        label: '业务类型',
        prop: 'btmType',
        type: 'select',
        labelWidth:110,
        dicData: []
      }, {
        label: '版本版次',
        prop: 'version',
        type: 'select',
        span:5,
        dicData: [{
          label: '当前版本当前版次',
          value: 1
        }, {
          label: '当前版本最新版次',
          value: 2
        }, {
          label: '最新版本最新版次',
          value: 3
        }, {
          label: '已发布的最新版本',
          value: 7
        }],
        value: 1
      },{
        label: '查询是否有下级',
        prop: 'queryISLeaf',
        type: 'switch',
        labelWidth:140,
        dicData: [ {
          label: '否',
          value: false
        },{
          label: '是',
          value: true
        }],
        value:false
      }, {
        label: '子节点层次数',
        prop: 'level',
        type: 'number',
        span:3,
        value:1
      }],
      form:{
        btmName:'',
        qtName: '',
        queryTemplate:{}
      },
      //已有排序列表配置
      crudOption: {
        ...basicOption,
        addBtn: false,
        editBtn: false,
        delBtn: false,
        selection: false,
        height: "220",
        tip: false,
        column: [{
          label: '排序字段',
          prop: 'orderField'
        }, {
          label: '排序方式',
          prop: 'orderMode'
        }, {
          label: '优先级',
          prop: 'level'
        }]
      },
      //已有排序
      orderInfoList:[],
      //设置排序弹窗表单数据
      tableForm:{
        orderField:'',
        orderMode:'ASC',
        level:''
      },
      //设置排序弹窗所有可排序字段
      orderFieldList:[],
      //设置排序弹窗表单配置
      tableFormOption: {
        menuBtn: false,
        submitBtn: false,
        emptyBtn: false,
        span:24,
        column: [{
          label: '排序字段',
          prop: 'orderField',
          type:'select',
          props: {
            label: 'id',
            value: 'id'
          },
          rules: [{
            required: true,
            message: "请选择排序字段",
            trigger: "blur"
          }]
        }, {
          label: '排序方式',
          prop: 'orderMode',
          type: 'select',
          dicData: [{
            label: '升序',
            value: 'ASC'
          }, {
            label: '降序',
            value: 'DESC'
          }],
          value: 'ASC'
        }, {
          label: '优先级',
          prop: 'level',
          type: 'number',
          min:1,
          rules: [{
            required: true,
            message: "请输入优先级",
            trigger: "blur"
          }]
        }]
      },
      treeOption:{
        defaultExpandAll:true,
        menu: false,
        addBtn: false,
        filter:false,
        draggable: true,
        allowDrop: () => {
          return false;
        },
        allowDrag: () => {
          return true;
        },
      },
      linkQueryDefineForm:'',//链接类型查询模板定义选中值
      linkQueryDefineDic:[],//链接类型查询模板定义下拉数据
      //链接类型查询模板定义选中项属性
      linkTreeData: [],
      businessQueryDefineForm:'',//业务类型查询模板定义选中值
      businessQueryDefineDic:[],//业务类型查询模板定义下拉数据
      //业务类型查询模板定义选中项属性
      businessTreeData: [],
      //高级查询条件
      queryTree:{},
      //普通查询条件
      queryCondition:[]
    };
  },
  watch: {
    //方向
    'form.direction': {
      handler(val) {
        if(val=='positive'){
          //正向
          const dicData=this.treeData.btmItemsTo.map(item=>{
            return {
              label: item,
              value: item
            }
          })
          dicData.push({
            label: '所有类型',
            value: '*'
          })
          this.$refs.form.updateDic('btmType', dicData);
          this.form.btmType=dicData[0].value
          this.getAllAttr();
        }else if(val=='opposite'){
          //反向
          const dicData=this.treeData.btmItemsFrom.map(item=>{
            return {
              label: item,
              value: item
            }
          })
          dicData.push({
            label: '所有类型',
            value: '*'
          })
          this.$refs.form.updateDic('btmType', dicData);
          this.form.btmType=dicData[0].value
          this.getAllAttr();
        }
      },
      immediate: true,
    },
    //业务类型
    'form.btmType': {
      handler(val) {
        if(val && val!='*'){
          this.getTemp(val,false);
        }
      },
      immediate: true,
    },
    'dialog.type': {
      handler(val) {
        if(val=='edit'){
        }
      },
      immediate: true,
    },
  },
  methods: {
    openDialog(btmName, title, mode, data) {
      this.dialog.title = title;
      this.dialog.type = mode;
      this.form.btmName = btmName;
      this.treeData = data.treeData;
      if (data.selectData) {
        this.selectData = data.selectData;
        this.form.qtName = this.selectData.qtName;
        this.form.direction = this.selectData.queryTemplate.direction;
        this.form.btmType = this.selectData.queryTemplate.btmType;
        this.form.version = this.selectData.queryTemplate.version;
        this.form.queryISLeaf = this.selectData.queryTemplate.queryISLeaf;
        this.form.level = this.selectData.queryTemplate.level;
        if (data.selectData.queryTemplate.orderInfoList && data.selectData.queryTemplate.orderInfoList.length > 0) {
          this.orderInfoList = JSON.parse(JSON.stringify(data.selectData.queryTemplate.orderInfoList));//已有排序
        }
        this.queryCondition=this.selectData.queryTemplate.condition;
        this.queryTree=this.selectData.queryTemplate.tree;
      } else {
        this.selectData = {};
        this.orderInfoList = [];
        this.queryCondition=[];
        this.queryTree={};
      }
      this.dialog.showDialog = true;
      this.getTemp(data.treeData.label, true)
    },
    cancelDialog() {
      this.dialog.loading = false;
      this.dialog.showDialog = false;
      this.$nextTick(() => {
        this.form = {
          btmName: '',
          qtName: '',
          queryTemplate: {}
        };
        this.orderInfoList =[];
        this.businessQueryDefineForm='';
        this.linkQueryDefineForm='';
        this.$refs.form.clearValidate();
      });
    },
    submitDialog() {
      this.$refs.form.validate((valid) => {
        if (valid) {
          let formData={
            btmName:this.form.btmName,
            qtName:this.form.qtName,
            queryTemplate:{
              btmType:this.form.btmType,
              clauseList:['*'],
              direction:this.form.direction,
              id:this.form.qtName,
              level:this.form.level,
              linkType:this.form.btmName,
              orderInfoList:this.orderInfoList,
              queryISLeaf:this.form.queryISLeaf,
              recReturnMode:1,//递归返回数据模式:1:RECRETURNMODE_FLAT, 2:RECRETURNMODE_FILTER
              rightFlag:true,
              secretFlag:true,
              type:'link',
              version:this.form.version
            }
          }
          formData.condition=[]
          linkSave(formData).then(res => {
            if (res.data.success) {
              this.$message.success("保存成功");
              this.cancelDialog();
              this.$emit("refresh");
            }
          });
        } else {
          return false;
        }
      });
    },
    getFormData(form) {
      this.form = form;
    },
    addRow() {
      this.crudDialog.showDialog = true;
    },
    // è¡Œåˆ é™¤
    rowDeleteHandler(data) {
      this.orderInfoList.splice(data.index,1);
      this.orderFieldList.unshift({
        id: data.row.orderField
      });
      this.tableFormOption.column[0].dicData= this.orderFieldList
    },
    //获取排序设置中所有排序字段
    getAllAttr() {
      getAllOrderbyAttributeByLink({
        name: this.treeData.label,
        btmType: this.form.btmType,
        direction: this.form.direction
      }).then(res => {
        const orderInfoStr = JSON.stringify(this.orderInfoList);
        const dicData = [];
        res.data.data.forEach(item => {
          if (orderInfoStr.indexOf('"orderField":"' + item + '"') == -1) {
            dicData.push({id: item});
          }
        })
        this.tableFormOption.column[0].dicData=dicData;
        this.orderFieldList=dicData;
      })
    },
    //排序设置保存
    rowSave() {
      this.$refs.tableForm.validate((valid) => {
        if(valid){
          this.orderInfoList.push(JSON.parse(JSON.stringify(this.tableForm)));
          this.crudDialog.showDialog=false;
          const orderInfoStr = JSON.stringify(this.orderInfoList);
          const dicData = [];
          this.orderFieldList.forEach(item => {
            if (orderInfoStr.indexOf('"orderField":"' + item.id + '"') == -1) {
              dicData.push(item);
            }
          })
          this.tableFormOption.column[0].dicData=dicData;
          this.orderFieldList=dicData;
          this.tableForm= {
            orderField: '',
            orderMode: 'ASC',
            level: ''
          }
        }
      })
    },
    //获取查询模板定义下拉
    getTemp(btmName,linkFlag) {
      if (btmName) {
        gridTemplate({btmName: btmName, linkFlag: linkFlag}).then(res => {
          const data = res.data.data.map(item => {
            item.label = item.name + '-' + (item.linkTypeName || item.btmName);
            item.value = item.name;
            return item;
          });
          if(linkFlag){
            this.linkQueryDefineDic=data
            data.length>0 && (this.linkQueryDefineForm=data[0].value);
          }else {
            this.businessQueryDefineDic=data;
            data.length>0 && (this.businessQueryDefineForm= data[0].value);
          }
        })
      }
    },
    linkQueryDefineChange(data) {
      if (data.value) {
        const childData = data.item.abNames.map(item => {
          return {
            label: item,
            value: item
          };
        });
        this.linkTreeData = [{
          label: data.value,
          value: data.value,
          children: childData
        }]
      }
    },
    businessQueryDefineChange(data) {
      if (data.value) {
        const childData = data.item.abNames.map(item => {
          return {
            label: item,
            value: item
          };
        });
        this.businessTreeData = [{
          label: data.value,
          value: data.value,
          children: childData
        }]
      }
    },
    // å¼€å§‹æ‹–拽树节点事件
    handleDragStart(node, ev) {
      // ä½¿ç”¨ setData æ–¹æ³•设置数据
      ev.dataTransfer.setData('item', JSON.stringify(node.data));
    },
  },
}
</script>
<style scoped>
fieldset {
  border-radius: 5px;
  -webkit-box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
  padding: 10px 6px;
  box-sizing: border-box;
  margin: 0;
  border: 1px solid #EBEEF5;
}
</style>
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,149 @@
<template>
  <div style="padding: 0 10px">
    <div style="text-align: center;margin-bottom: 10px">
      <avue-radio v-model="radioForm"  :dic="radioDic" style="margin: 0 20px 0 0;display: inline-block"></avue-radio>
      <el-button  plain size="mini" type="primary" @click="clearValue">清空值</el-button>
      <el-button  plain size="mini" type="primary" @click="delAll">删除全部条件</el-button>
    </div>
    <div v-if="radioForm==0" @drop="drop" @dragover.prevent style="height: 220px;text-align: center;">
      <div v-for="condition in conditionList" class="el-input--small" style="margin-bottom: 5px;">
        <span style="width: 150px;display: inline-block;text-align: right" :title="condition.clause">{{condition.clause}}</span>
        <avue-select v-model="condition.operator" type="tree" :dic="operatorDic" :clearable="false" style="width: 80px;margin: 0 5px;"></avue-select>
        <avue-input v-model="condition.ordinaryValue" placeholder="" style="width: 300px;margin-right: 5px;"></avue-input>
        <el-button  plain size="mini" type="primary" @click="delAll">选择查询模板</el-button>
      </div>
    </div>
    <div v-else style="height: 220px;text-align: left">
      <avue-tree style="height: 220px" :data="treeData" :option="treeOption"></avue-tree>
    </div>
    <div style="text-align: right;margin-top: 10px;">
      <el-button v-if="radioForm==1"  plain size="mini" type="primary" @click="addHandler">增加逻辑</el-button>
      <el-button v-if="radioForm==1"  plain size="mini" type="primary" @click="del">修改条件</el-button>
      <el-button v-if="radioForm==1"  plain size="mini" type="primary" @click="del">删除</el-button>
      <el-button  plain size="mini" type="primary" @click="del">查询</el-button>
      <el-button  plain size="mini" type="primary" @click="del">取消</el-button>
    </div>
  </div>
</template>
<script>
export default {
name: "formQueryDialog",
  props: {
    queryCondition: {
      type: Array,
      default: []
    },
    queryTree: {
      type: Object,
      default: {}
    },
  },
  data() {
    return {
      radioForm: 0,
      radioDic: [{
        label: '普通',
        value: 0
      }, {
        label: '高级',
        value: 1
      }],
      conditionList:this.queryCondition,
      treeOption:{
        defaultExpandAll:true,
        menu: false,
        addBtn: false,
        filter:false,
      },
      treeData:this.queryTree,
      //VTInteger、VTDouble、VTLong
      operatorIntDic:[{
        label:'=',
        value:'='
      },{
        label:'!=',
        value:'!='
      },{
        label:'包含',
        value:'包含'
      },{
        label:'in',
        value:'in'
      },{
        label:'not in',
        value:'not in'
      },{
        label:'>=',
        value:'>='
      },{
        label:'>',
        value:'>'
      },{
        label:'<=',
        value:'<='
      },{
        label:'<',
        value:'<'
      }],
      //VTDateTime、VTDate、VTTime
      operatorTimeDic:[{
        label:'=',
        value:'='
      },{
        label:'!=',
        value:'!='
      },{
        label:'in',
        value:'in'
      },{
        label:'not in',
        value:'not in'
      },{
        label:'>=',
        value:'>='
      },{
        label:'<=',
        value:'<='
      }],
      //其它
      operatorDic:[{
        label:'=',
        value:'='
      },{
        label:'!=',
        value:'!='
      },{
        label:'包含',
        value:'包含'
      },{
        label:'in',
        value:'in'
      },{
        label:'not in',
        value:'not in'
      }]
    }
  },
  methods:{
    // æ‹–拽到时
    drop(event) {
      // ä½¿ç”¨ getData æ–¹æ³•获取数据
      const data = JSON.parse(event.dataTransfer.getData('item'));
      const params = {
        clause: data.value,
        operator: '=',
        ordinaryValue: ''
      }
      this.conditionList.push(params)
    }
  }
}
</script>
<style scoped>
::v-deep .el-input--small .el-input__inner{
  height: 28px;
  line-height: 28px;
}
</style>
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue
@@ -1,11 +1,10 @@
<template>
  <el-container>
    <el-aside>
      <basic-container>
        <div ref="TreeBox" style="height: calc(100vh - 154px);!important;">
        <div ref="TreeBox" style="height: calc(100vh - 164px);!important;">
          <!-- å·¦ä¾§æ ‘         -->
          <div style="height:  calc(100vh - 190px);">
          <div style="height:  calc(100vh - 200px);">
            <avue-tree :data="treeData" :option="treeOption" @node-click="nodeClick">
          <span slot-scope="{ node, data }" class="el-tree-node__label">
           <span style="font-size: 15px">
@@ -21,32 +20,33 @@
    <el-main>
      <basic-container>
        <div v-if="this.nodeRow && this.nodeRow.label">
          <el-button icon="el-icon-plus" size="small" type="primary" @click="addHandler">创建</el-button>
          <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editHandler">修改</el-button>
          <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delHandler">删除</el-button>
          <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">导出</el-button>
          <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">导入</el-button>
        </div>
        <avue-crud  ref="crud"
                    @selection-change="selectionChange"
                    @row-click="rowClick"
                    :data="crudData" :option="crudOption" :table-loading="tableLoading" style="margin-top: 10px">
          <template slot="menuLeft" slot-scope="scope">
            <el-button icon="el-icon-plus" size="small" type="primary" @click="addHandler">创建</el-button>
            <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editHandler">修改</el-button>
            <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delHandler">删除</el-button>
            <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">导出</el-button>
            <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">导入</el-button>
          </template>
        </avue-crud>
        <form-dialog ref="formRef" @refresh="getTemp"></form-dialog>
      </basic-container>
    </el-main>
  </el-container>
</template>
<script>
import {gridLink} from "@/api/modeling/linkType/api";
import { gridTemplate, saveTemplate, updateTemplate} from "@/api/queryTemplate/queryDefine";
import {deleteLinkTemplate} from "@/api/queryTemplate/linkTypeQuery";
import func from "@/util/func";
import {dateFormat} from "@/util/date";
import {getObjTypeQTs,deleteLinkTemplate} from "@/api/queryTemplate/linkTypeQuery";
import basicOption from "@/util/basic-option";
import FormDialog from "./formDialog.vue"
export default {
  name: "index",
  components: {FormDialog},
  data() {
    return {
      treeOption: {
@@ -90,17 +90,59 @@
        height: "auto",
        calcHeight: -40,
        tip: false,
        header:false,
        column: [{
          label: '查询模板名称',
          prop: 'name'
          prop: 'qtName'
        }, {
          label: '创建人',
          prop: 'creator'
        }, {
          label: '创建时间',
          prop: 'createTime',
          prop: 'createTimeText'
        }, {
          label: '方向',
          prop: 'direction',
          formatter:function (row, value) {
            return dateFormat(new Date(value))
            if (row.queryTemplate.direction == 'positive') {
              return '正向'
            }else{
              return '反向'
            }
          }
        }, {
          label: '业务类型',
          prop: 'btmType',
          formatter:function (row, value) {
            return row.queryTemplate.btmType;
          }
        }, {
          label: '版本版次',
          prop: 'version',
          formatter:function (row, value) {
            if(row.queryTemplate.version==1){
              return '当前版本当前版次'
            }else  if(row.queryTemplate.version==2){
              return '当前版本最新版次'
            }else if(row.queryTemplate.version==3){
              return '最新版本最新版次'
            }else if(row.queryTemplate.version==7){
              return '已发布的最新版本'
            }else {
              return ''
            }
          }
        }, {
          label: '查询是否有下级',
          prop: 'queryISLeaf',
          formatter:function (row, value) {
            return row.queryTemplate.queryISLeaf
          }
        }, {
          label: '子节点层次数',
          prop: 'level',
          formatter:function (row, value) {
            return row.queryTemplate.level;
          }
        }]
      },
@@ -130,72 +172,50 @@
      this.tableLoading = true;
      this.getTemp();
    },
    //获取查询模板列表
    getTemp() {
      gridTemplate({btmName: this.nodeRow.label, linkFlag: true}).then(res => {
      getObjTypeQTs(this.nodeRow.label).then(res => {
        this.crudData = res.data.data;
        this.tableLoading = false;
        this.selectionClear();
      })
    },
    selectHandler(selection, row) {
    rowClick(row) {
      this.$refs.crud.toggleSelection();
      this.$refs.crud.toggleRowSelection(row); //选中当前行
      this.selectionRow = [row];
    },
    changeTemp(data) {
      this.$refs.queryCrud.clearSelection();
      if (data.value != '') {
        let abNames = data.item.abNames.join(',').toLowerCase().split(',')
      }
    selectionChange(list) {
      this.selectionRow = list;
    },
    selectionClear() {
      this.selectionRow = [];
      this.$refs.crud.toggleSelection();
    },
    //创建
    addHandler() {
      if (func.isEmptyObject(this.nodeRow)) {
        this.$message.error('请选择要添加的节点');
        return;
      }
      this.title = 'add';
      this.visible = true;
      this.$nextTick(() => {
      this.$refs.formRef.openDialog(this.nodeRow.label,'创建','add',{treeData:this.nodeRow});
      this.$nextTick(()=>{
        this.$refs.formRef.formItems[0].disabled = false;
        this.$refs.formRef.$refs.form.getInit(this.$refs.formRef.formItems)
      });
    },
    //修改
    editHandler() {
      if (func.isEmptyObject(this.nodeRow)) {
        this.$message.error('请至少选择一条数据');
      if (this.selectionRow.length!=1) {
        this.$message.error('请选择一条数据');
        return;
      }
      this.form.name = this.templateForm;
      this.title = 'edit';
      this.visible = true;
      this.$nextTick(() => {
      this.$refs.formRef.openDialog(this.nodeRow.label,'修改','edit',{treeData:this.nodeRow,selectData:this.selectionRow[0]});
      this.$nextTick(()=>{
        debugger;
        this.$refs.formRef.formItems[0].disabled = true;
        this.$refs.formRef.$refs.form.getInit(this.$refs.formRef.formItems)
      });
    },
    // æ–°å¢žç¼–辑保存
    addDialogSavaHandler() {
      this.$refs.form.validate((valid) => {
        const saveFunction = this.title === 'add' ? saveTemplate : updateTemplate;
        if (valid) {
          saveFunction(this.form).then(res => {
            if (res.data.code === 200) {
              this.$message.success(res.data.obj);
              this.addDialogClose();
            }
          })
        } else {
          return false;
        }
      });
    },
    // æ–°å¢žç¼–辑对话框取消
    addDialogClose() {
      this.form = {
        name: ''
      };
      this.$refs.form.clearValidate();
      this.visible = false;
    },
    //删除
    delHandler() {
      if (func.isEmptyObject(this.nodeRow)) {
      if (this.selectionRow.length==0) {
        this.$message.error('请选择数据');
        return;
      }
@@ -204,13 +224,13 @@
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        deleteLinkTemplate({
          name: this.templateForm,
          btmName: this.nodeRow.label,
          linkFlag: false
        }).then(res => {
        let names=this.selectionRow.map(item=>{
          return item.qtName
        })
        deleteLinkTemplate({names:names.join(',')}).then(res => {
          if (res.data.code === 200) {
            this.$message.success(res.data.obj);
            this.getTemp();
          }
        })
      }).catch(() => {
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();
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/formDialog.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,603 @@
<template>
  <el-dialog
    v-dialogDrag
    v-loading="loading"
    :visible.sync="visible"
    append-to-body="true"
    class="avue-dialog"
    title="表单"
    width="100%"
    @close="closeDialog"
  >
    <el-container>
      <div style="height: 79vh;display: flex;width: 100%;">
        <el-aside width="15%">
          <basic-container>
            <div style="height:650px;">
              <avue-tree
                :data="treeData"
                :option="treeOption"
                @node-drag-start="handleDragStart">
              </avue-tree>
            </div>
          </basic-container>
        </el-aside>
        <el-main>
          <basic-container>
            <div style="height: 645px" @drop="drop" @dragover.prevent>
              <div style="display: flex;justify-content: center">
                <span style="display: flex;align-items: center; margin-right: 5px;">
                 <p class="tableTopLabel">名称:</p>
                 <el-input v-model="name" placeholder="请输入内容" size="mini"></el-input>
                </span>
                <span style="display: flex;align-items: center; margin-right: 5px;">
                 <p class="tableTopLabel">查询模板名称:</p>
                 <el-input v-model="name" placeholder="请输入内容" size="mini"></el-input>
                </span>
                <span style="display: flex;align-items: center; margin-right: 5px;">
                 <p class="tableTopLabel">显示列数:</p>
                 <el-input v-model="name" placeholder="请输入内容" size="mini"></el-input>
                  <el-button plain size="mini" style="margin-left: 3px" type="success">设置</el-button>
                </span>
                <span style="display: flex;align-items: center; margin-right: 5px;">
                 <p class="tableTopLabel">位置:</p>
                 <el-input v-model="name" placeholder="请输入内容" size="mini"></el-input>
                  <el-button plain size="mini" style="margin-left: 3px" type="success">调整位置</el-button>
                </span>
              </div>
              <h3>页面定义</h3>
              <el-form ref="form" :model="form" :rules="rules" label-width="100px">
                <el-row>
                  <el-col v-for="(item,index) in formList" :key="index" :span="columnNumber">
                    <el-tooltip :content="item.name" placement="top">
                      <el-form-item :label="item.name + ':'" class="hiddenLabel">
                        <el-input v-model="item.value" :splaceholder="item.name" size="mini"></el-input>
                      </el-form-item>
                    </el-tooltip>
                  </el-col>
                </el-row>
              </el-form>
            </div>
            <div style="display: flex;justify-content: center;margin-top: 15px">
              <el-button icon="el-icon-check" size="small" type="primary">保存</el-button>
              <el-button icon="el-icon-delete" plain size="small" type="danger">清空</el-button>
              <el-button icon="el-icon-el-icon-close" plain size="small" type="primary">删除组件</el-button>
              <el-button icon="el-icon-plus" plain size="small" type="primary">添加自定义组件</el-button>
              <el-button icon="el-icon-zoom-in" plain size="small" type="primary">预览</el-button>
            </div>
          </basic-container>
        </el-main>
        <el-aside width="25%">
          <basic-container>
            <div style="height: 700px; overflow-y: auto;padding-right: 10px">
              <h3>设置</h3>
              <el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="85px">
                <el-row style="border-bottom: 1px solid #878585;padding-bottom: 10px">
                  <el-col :span="24">
                    <el-form-item label="使用字段">
                      <div style="display: flex">
                        <el-input v-model="user" placeholder="请输入内容" size="mini"></el-input>
                        <el-checkbox v-model="checked" style="margin-left: 5px; margin-right: 5px">只读</el-checkbox>
                        <el-checkbox v-model="checked" style="margin-left: 5px;margin-right: 0px">必填</el-checkbox>
                      </div>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item label="显示名称">
                      <el-input v-model="user" placeholder="请输入内容" size="mini"></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item class="rightLabel" label="显示类型">
                      <el-select v-model="form.region" placeholder="请选择活动区域" size="mini">
                        <el-option label="区域一" value="shanghai"></el-option>
                        <el-option label="区域二" value="beijing"></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                  <el-col :span="24">
                    <el-tooltip content="默认值表达式" placement="top">
                      <el-form-item class="hiddenLabel" label="默认值表达式">
                        <el-input v-model="user" placeholder="请输入内容" size="mini"></el-input>
                      </el-form-item>
                    </el-tooltip>
                  </el-col>
                  <el-col :span="24">
                    <!--                    <el-tooltip content="显示表达式" placement="top">-->
                    <el-form-item label="显示表达式">
                      <el-input v-model="user" placeholder="请输入内容" size="mini"></el-input>
                    </el-form-item>
                    <!--                    </el-tooltip>-->
                  </el-col>
                  <el-col :span="24">
                    <el-tooltip content="日期格式化字符串" placement="top">
                      <el-form-item class="hiddenLabel" label="日期格式化字符串:">
                        <el-input v-model="user" placeholder="请输入内容" size="mini"></el-input>
                      </el-form-item>
                    </el-tooltip>
                  </el-col>
                  <el-col :span="24">
                    <el-form-item label="占位方式">
                      <el-radio v-model="treeRadio" label="0">显示</el-radio>
                      <el-radio v-model="treeRadio" label="1">不显示</el-radio>
                    </el-form-item>
                  </el-col>
                  <el-col :span="24" style="height: 90px">
                    <el-form-item label="字段表达式">
                      <el-input
                        v-model="textarea2"
                        :rows="3"
                        placeholder="请输入内容"
                        resize="none"
                        type="textarea">
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="24" style="height: 90px">
                    <el-tooltip content="只读选择条件" placement="top">
                      <el-form-item class="hiddenLabel" label="只读选择条件">
                        <el-input
                          v-model="textarea2"
                          :rows="3"
                          placeholder="请输入内容"
                          resize="none"
                          type="textarea">
                        </el-input>
                      </el-form-item>
                    </el-tooltip>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item label="控制列">
                      <el-input v-model="user" placeholder="请输入内容" size="mini"></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item class="rightLabel" label="显示列条件" label-width="95px">
                      <el-input v-model="user" placeholder="请输入内容" size="mini"></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="24">
                    <el-form-item label="权限控制">
                      <div style="display: flex;align-items: center">
                        <el-input v-model="user" placeholder="请输入内容" size="mini"></el-input>
                        <el-button plain size="mini" style="margin-left: 3px" type="success">选择</el-button>
                      </div>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row style="margin-top: 10px;border-bottom: 1px solid #878585;padding-bottom: 10px">
                  <el-col :span="24" style="height: 90px">
                    <el-form-item label="脚本验证">
                      <el-input
                        v-model="textarea2"
                        :rows="3"
                        placeholder="请输入内容"
                        resize="none"
                        type="textarea">
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="24" style="height: 90px">
                    <el-form-item label="提示文字">
                      <el-input
                        v-model="textarea2"
                        :rows="3"
                        placeholder="请输入内容"
                        resize="none"
                        type="textarea">
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="24">
                    <el-form-item label="查询关联列">
                      <el-input v-model="user" placeholder="请输入内容" size="mini"></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="24">
                    <el-form-item label="自定义类">
                      <el-input v-model="user" placeholder="请输入内容" size="mini"></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="24">
                    <el-form-item label="存储路径">
                      <el-input v-model="user" placeholder="请输入内容" size="mini"></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="24">
                    <el-tooltip content="存储路径字段" placement="top">
                      <el-form-item class="hiddenLabel" label="存储路径字段">
                        <div style="display: flex">
                          <el-input v-model="user" placeholder="请输入内容" size="mini"></el-input>
                          <el-checkbox v-model="checked" style="margin-left: 5px">http存储</el-checkbox>
                        </div>
                      </el-form-item>
                    </el-tooltip>
                  </el-col>
                </el-row>
                <el-row style="margin-top: 10px;border-bottom: 1px solid #878585;padding-bottom: 10px">
                  <h4>选项列表</h4>
                  <el-col :span="12">
                    <el-form-item label="名称">
                      <el-input v-model="user" placeholder="请输入内容" size="mini"></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item class="rightLabel" label="值" label-width="95px">
                      <el-input v-model="user" placeholder="请输入内容" size="mini"></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="24" style="height: 190px">
                    <el-form-item>
                      <div style="height: 150px; width: 100%; border: 1px solid #bdbbbb;overflow-y: auto">
                        <el-table
                          :data="optionRightData"
                          :highlight-current-row="true"
                          :show-header="false"
                          border
                          stripe
                          style="width: 100%">
                          <el-table-column
                            align="center"
                            label="名称"
                            prop="name">
                            <template slot-scope="scope">
                              <el-tag size="medium">{{ scope.row.name }}</el-tag>
                            </template>
                          </el-table-column>
                          <el-table-column
                            align="center"
                            label="值"
                            prop="value">
                            <template slot-scope="scope">
                              <el-tag size="medium">{{ scope.row.value }}</el-tag>
                            </template>
                          </el-table-column>
                        </el-table>
                      </div>
                      <div style="display: flex;align-items: center;justify-content: center;margin-top: 5px">
                        <el-button plain size="mini" style="margin-right: 5px" type="success">添加</el-button>
                        <el-button plain size="mini" style="margin-left: 5px" type="danger">删除</el-button>
                      </div>
                    </el-form-item>
                  </el-col>
                  <el-col :span="24">
                    <el-form-item label="一级参照">
                      <el-input v-model="user" placeholder="请输入内容" size="mini"></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="24">
                    <el-form-item label="二级参照">
                      <el-input v-model="user" placeholder="请输入内容" size="mini"></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="24">
                    <el-form-item label="参照值">
                      <el-input v-model="user" placeholder="请输入内容" size="mini"></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row style="margin-top: 10px">
                  <el-col :span="24" style="height: 90px">
                    <el-form-item label="附加属性">
                      <el-input
                        v-model="textarea2"
                        :rows="3"
                        placeholder="请输入内容"
                        resize="none"
                        type="textarea">
                      </el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
            </div>
          </basic-container>
        </el-aside>
      </div>
    </el-container>
  </el-dialog>
</template>
<script>
export default {
  name: "formDialog",
  data() {
    return {
      formList: [],
      optionRightData: [
        {
          name: 'test',
          value: 'test'
        }
      ],
      form: {},
      rules: {},
      columnNumber: 3,
      loading: false,
      visible: false,
      treeOption: {
        menu: false,
        addBtn: false,
        draggable: true,
        allowDrop: () => {
          return false;
        },
        allowDrag: () => {
          return true;
        },
        // props: {
        //   label: 'name',
        //   value: 'id',
        //   children: 'children',
        // },
      },
      treeData: [
        {
          value: 0,
          label: '一级部门',
          children: [
            {
              value: 1,
              label: '一级部门1',
            }, {
              value: 2,
              label: '一级部门2',
            }
          ]
        }, {
          value: 3,
          label: '二级部门',
          children: [
            {
              value: 4,
              label: '二级部门1',
            }, {
              value: 5,
              label: '二级部门2',
            }
          ]
        },
        {
          value: 0,
          label: '一级部门',
          children: [
            {
              value: 1,
              label: '一级部门1',
            }, {
              value: 2,
              label: '一级部门2',
            }
          ]
        }, {
          value: 3,
          label: '二级部门',
          children: [
            {
              value: 4,
              label: '二级部门1',
            }, {
              value: 5,
              label: '二级部门2',
            }
          ]
        },
        {
          value: 0,
          label: '一级部门',
          children: [
            {
              value: 1,
              label: '一级部门1',
            }, {
              value: 2,
              label: '一级部门2',
            }
          ]
        }, {
          value: 3,
          label: '二级部门',
          children: [
            {
              value: 4,
              label: '二级部门1',
            }, {
              value: 5,
              label: '二级部门2',
            }
          ]
        },
        {
          value: 0,
          label: '一级部门',
          children: [
            {
              value: 1,
              label: '一级部门1',
            }, {
              value: 2,
              label: '一级部门2',
            }
          ]
        }, {
          value: 3,
          label: '二级部门',
          children: [
            {
              value: 4,
              label: '二级部门1',
            }, {
              value: 5,
              label: '二级部门2',
            }
          ]
        },
        {
          value: 0,
          label: '一级部门',
          children: [
            {
              value: 1,
              label: '一级部门1',
            }, {
              value: 2,
              label: '一级部门2',
            }
          ]
        }, {
          value: 3,
          label: '二级部门',
          children: [
            {
              value: 4,
              label: '二级部门1',
            }, {
              value: 5,
              label: '二级部门2',
            }
          ]
        },
        {
          value: 0,
          label: '一级部门',
          children: [
            {
              value: 1,
              label: '一级部门1',
            }, {
              value: 2,
              label: '一级部门2',
            }
          ]
        }, {
          value: 3,
          label: '二级部门',
          children: [
            {
              value: 4,
              label: '二级部门1',
            }, {
              value: 5,
              label: '二级部门2',
            }
          ]
        },
        {
          value: 0,
          label: '一级部门',
          children: [
            {
              value: 1,
              label: '一级部门1',
            }, {
              value: 2,
              label: '一级部门2',
            }
          ]
        }, {
          value: 3,
          label: '二级部门',
          children: [
            {
              value: 4,
              label: '二级部门1',
            }, {
              value: 5,
              label: '二级部门2',
            }
          ]
        }
      ]
    }
  },
  methods: {
    // å…³é—­å¯¹è¯æ¡†
    closeDialog() {
    },
    // å¼€å§‹æ‹–拽树节点事件
    handleDragStart(node, ev) {
      // ä½¿ç”¨ setData æ–¹æ³•设置数据
      ev.dataTransfer.setData('item', JSON.stringify(node.data));
    },
    // æ‹–拽到表单时
    drop(event) {
      // ä½¿ç”¨ getData æ–¹æ³•获取数据
      const data = JSON.parse(event.dataTransfer.getData('item'));
      console.log('data', data);
      const params = {
        name: data.label,
        value: '',
        type: ''
      }
      this.formList.push(params)
    }
  }
}
</script>
<style lang="scss" scoped>
::v-deep {
  .hiddenLabel {
    .el-form-item__label {
      white-space: nowrap; // é˜²æ­¢æ¢è¡Œ
      overflow: hidden; //隐藏超出部分
      text-overflow: ellipsis; //显示省略号
    }
  }
  .el-col {
    margin-bottom: 0px;
    height: 40px;
  }
  .rightLabel {
    .el-form-item__label {
      text-align: right !important;
    }
  }
}
.tableTopLabel {
  display: flex;
  flex-shrink: 0 !important;
  font-size: 14px
}
</style>
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/tableDialog.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,344 @@
<template>
  <el-dialog
    v-dialogDrag
    v-loading="loading"
    :visible.sync="visible"
    append-to-body="true"
    class="avue-dialog"
    title="表格"
    width="60%"
    @close="closeDialog"
  >
    <el-form :model="form" :rules="rules" label-position="right" label-width="100px">
      <el-row>
        <el-col :span="12">
          <el-form-item label="名称">
            <el-input v-model="user" placeholder="请输入内容" size="mini"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="每页行数">
            <el-input v-model="user" placeholder="请输入内容" size="mini"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="附加查询条件">
            <el-input v-model="user" placeholder="请输入内容" size="mini"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="绑定表单">
            <div style="display: flex;align-items: center;">
              <el-select v-model="form.region" placeholder="请选择活动区域" size="mini">
                <el-option label="区域一" value="shanghai"></el-option>
                <el-option label="区域二" value="beijing"></el-option>
              </el-select>
              <el-button plain size="mini" style="margin-left: 3px" type="success">选择</el-button>
            </div>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="父名称">
            <div style="display: flex;align-items: center;">
              <el-input v-model="user" placeholder="请输入内容" size="mini"></el-input>
              <el-checkbox v-model="checked" style="margin-left: 5px; margin-right: 5px">显示查询区域</el-checkbox>
              <el-checkbox v-model="checked" style="margin-left: 5px;margin-right: 0px">显示文件夹</el-checkbox>
            </div>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="显示字段">
            <div style="display: flex; align-items: center">
              <div style="height: 260px; width: 160px; border: 1px solid #bdbbbb;overflow-y: auto">
                <el-table
                  :data="showLifeTable"
                  style="width: 100%">
                  <el-table-column
                    align="center"
                    label="可使用字段"
                    prop="id">
                  </el-table-column>
                </el-table>
              </div>
              <div style="margin-left: 10px; margin-right: 10px">
                <el-button circle icon="el-icon-back" style="margin-right: 10px"></el-button>
                <el-button circle icon="el-icon-right"></el-button>
              </div>
              <div style="height: 260px; width: 160px; border: 1px solid #bdbbbb;overflow-y: auto">
                <el-table
                  :data="showRightTable"
                  style="width: 100%">
                  <el-table-column
                    align="center"
                    label="需要使用字段"
                    prop="id">
                  </el-table-column>
                </el-table>
              </div>
            </div>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="搜索字段">
            <div style="display: flex; align-items: center">
              <div style="height: 260px; width: 160px; border: 1px solid #bdbbbb;overflow-y: auto">
                <el-table
                  :data="searchLifeTable"
                  style="width: 100%">
                  <el-table-column
                    align="center"
                    label="可供搜索字段"
                    prop="id">
                  </el-table-column>
                </el-table>
              </div>
              <div style="margin-left: 10px; margin-right: 10px">
                <el-button circle icon="el-icon-back" style="margin-right: 10px"></el-button>
                <el-button circle icon="el-icon-right"></el-button>
              </div>
              <div style="height: 260px; width: 160px; border: 1px solid #bdbbbb;overflow-y: auto">
                <el-table
                  :data="searchRightTable"
                  style="width: 100%">
                  <el-table-column
                    align="center"
                    label="需搜索字段"
                    prop="id">
                  </el-table-column>
                </el-table>
              </div>
            </div>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="列">
            <el-select v-model="form.region" placeholder="请选择列" size="mini">
              <el-option label="区域一" value="shanghai"></el-option>
              <el-option label="区域二" value="beijing"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="宽度">
            <div style="display: flex;align-items: center;">
              <el-input v-model="user" placeholder="请输入内容" size="mini" style="width: 193px"></el-input>
              <el-button plain size="mini" style="margin-left: 3px" type="success">设置</el-button>
            </div>
          </el-form-item>
        </el-col>
      </el-row>
      <el-col :span="24">
        <el-form-item label="设置列宽">
          <div style="height: 150px; width: 100%; border: 1px solid #bdbbbb;overflow-y: auto">
            <el-table
              :data="columnWidthData"
              :highlight-current-row="true"
              border
              stripe
              style="width: 100%">
              <el-table-column
                align="center"
                label="列名"
                prop="id">
                <template slot-scope="scope">
                  <el-tag size="medium">{{ scope.row.id }}</el-tag>
                </template>
              </el-table-column>
              <el-table-column
                align="center"
                label="列宽"
                prop="width">
                <template slot-scope="scope">
                  <el-tag size="medium">{{ scope.row.width }}</el-tag>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="查询字段">
          <el-input v-model="user" placeholder="请输入内容" size="mini"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="查询次数">
          <el-input v-model="user" placeholder="请输入内容" size="mini"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="查询sql">
          <div style="display: flex;align-items: center">
            <el-input v-model="user" placeholder="请输入内容" size="mini"></el-input>
            <el-button plain size="mini" style="margin-left: 3px" type="success">添加</el-button>
            <el-button plain size="mini" style="margin-left: 3px" type="danger">删除</el-button>
          </div>
        </el-form-item>
      </el-col>
      <el-col :span="24">
        <el-form-item label="查询字段">
          <div style="height: 150px; width: 100%; border: 1px solid #bdbbbb;overflow-y: auto">
            <el-table
              :data="columnSearchData"
              :highlight-current-row="true"
              border
              stripe
              style="width: 100%">
              <el-table-column
                align="center"
                label="查询字段"
                prop="id">
                <template slot-scope="scope">
                  <el-tag size="medium">{{ scope.row.id }}</el-tag>
                </template>
              </el-table-column>
              <el-table-column
                align="center"
                label="查询次数"
                prop="name">
                <template slot-scope="scope">
                  <el-tag size="medium">{{ scope.row.name }}</el-tag>
                </template>
              </el-table-column>
              <el-table-column
                align="center"
                label="查询sql"
                prop="sql">
                <template slot-scope="scope">
                  <el-tag size="medium">{{ scope.row.sql }}</el-tag>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </el-form-item>
      </el-col>
      <el-col :span="24">
        <el-form-item label="双击操作">
          <el-select v-model="form.region" placeholder="请选择双击操作" size="mini">
            <el-option label="区域一" value="shanghai"></el-option>
            <el-option label="区域二" value="beijing"></el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="24">
        <el-form-item label="图片显示">
          <div style="display: flex;align-items: center">
            <div style="display: flex;align-items: center;width: 100%;">
              <span>长:</span>
              <el-input v-model="user" placeholder="请输入内容" size="mini"></el-input>
            </div>
            <div style="display: flex;align-items: center;width: 100%;margin-left: 30px">
              <span>宽:</span>
              <el-input v-model="user" placeholder="请输入内容" size="mini"></el-input>
            </div>
          </div>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="字符串截取">
          <el-input v-model="user" placeholder="请输入内容" size="mini"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="超链接">
          <el-input v-model="user" placeholder="请输入内容" size="mini"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="24">
        <el-form-item label="查询模板">
          <el-select v-model="form.region" placeholder="请选择查询模板" size="mini">
            <el-option label="区域一" value="shanghai"></el-option>
            <el-option label="区域二" value="beijing"></el-option>
          </el-select>
        </el-form-item>
      </el-col>
    </el-form>
    <span slot="footer" class="dialog-footer">
         <el-button>取 æ¶ˆ</el-button>
         <el-button type="primary">ç¡® å®š</el-button>
    </span>
  </el-dialog>
</template>
<script>
export default {
  name: "tableDialog",
  data() {
    return {
      columnSearchData: [
        {
          id: 'test',
          name: '3',
          sql: 'xxxxx'
        }
      ],
      columnWidthData: [
        {
          id: 'test',
          width: '250'
        }
      ],
      searchLifeTable: [],
      searchRightTable: [],
      showRightTable: [],
      showLifeTable: [
        {
          id: 'test1'
        },
        {
          id: 'test2'
        },
        {
          id: 'test1'
        },
        {
          id: 'test2'
        },
        {
          id: 'test1'
        },
        {
          id: 'test2'
        }
      ],
      rules: {},
      form: {},
      loading: false,
      visible: false
    }
  },
  methods: {
    closeDialog() {
    }
  }
}
</script>
<style lang="scss" scoped>
::v-deep {
  .el-form-item .el-select {
    //width: 100%;
  }
}
</style>
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/index.vue
@@ -4,24 +4,13 @@
    <el-aside>
      <basic-container>
        <div ref="TreeBox" style="height: calc(100vh - 144px);!important;">
          <div class="headerCon">
            <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addClickHandler">创建
            </el-button>
            <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editClickHandler">修改
            </el-button>
            <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delClickHandler">删除
            </el-button>
            <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">导出
            </el-button>
            <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="uploadClickHandler">导入
            </el-button>
            <el-button class="smallBtn" plain size="small" type="primary"
                       @click="checkViewClickHandler">查看使用范围
            </el-button>
          </div>
          <!-- å·¦ä¾§æ ‘         -->
          <div style="height:  calc(100vh - 280px);">
            <avue-tree :data="treeData" :option="treeOption" @node-click="nodeClick">
          <!-- å·¦ä¾§æ ‘ -->
          <div style="height:  calc(100vh - 220px);">
            <div style="margin-bottom: 10px;display: flex;justify-content: center">
              <el-radio v-model="treeRadio" label="0" @input="TreeRadioChange">业务类型树</el-radio>
              <el-radio v-model="treeRadio" label="1" @input="TreeRadioChange">链接类型树</el-radio>
            </div>
            <avue-tree v-loading="treeLoading" :data="treeData" :option="treeOption" @node-click="nodeClick">
          <span slot-scope="{ node, data }" class="el-tree-node__label">
           <span style="font-size: 15px">
              <i class="el-icon-s-promotion"></i>
@@ -36,15 +25,209 @@
    <el-main>
      <basic-container>
        <avue-crud
          v-if="!tableStatus"
          :data="data"
          :option="option"
          :page.sync="page"
          @size-change="sizeChange"
          @current-change="currentChange">
          <template slot="menuLeft">
            <div style="display: flex; align-items: center;">
               <span style="display: inline-block; margin-right: 10px;">
                <el-radio v-model="tableRadio" label="0" @input="tableRadioChange">表单</el-radio>
                <el-radio v-model="tableRadio" label="1" @input="tableRadioChange">表格<span style="color: red;">(先导入表单,再导入表格!)</span></el-radio>
               </span>
              <span style="display: flex;align-items: center; margin-right: 10px;">
                <p style="display: flex; flex-shrink: 0;font-size: 14px">名称:</p>
                <el-input v-model="input" placeholder="请输入内容" size="mini"></el-input>
              </span>
              <span style="display: flex; align-items: center;">
                <p
                  style="display: flex; align-items: center; margin: 0 10px 0 0;flex-shrink: 0;font-size: 14px">克隆目标:</p>
                <el-input v-model="input" placeholder="请输入内容" size="mini" style="margin-right: 10px;"></el-input>
                <el-button plain size="mini" type="success">克隆目标</el-button>
              </span>
            </div>
          </template>
          <template slot="menu" slot-scope="scope">
            <el-button icon="el-icon-edit" size="small" type="text" @click="editBtnClick(scope.row)">编辑
            </el-button>
            <el-button icon="el-icon-delete" size="small" type="text" @click="rowDeleteHandler(scope.row)">删除
            </el-button>
          </template>
        </avue-crud>
        <div v-if="!tableStatus" style="display: flex;justify-content: center;margin-top: 15px">
          <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addClickHandler">增加</el-button>
          <el-button icon="el-icon-delete" plain size="small" type="danger">删除</el-button>
          <el-button icon="el-icon-document-add" plain size="small" type="primary">克隆</el-button>
          <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadHandler">导入</el-button>
          <el-button icon="el-icon-download" plain size="small" type="primary" @click="downLoadHandler">导出</el-button>
        </div>
      </basic-container>
    </el-main>
    <form-dialog ref="formDialog"></form-dialog>
    <table-dialog ref="tableDialog"></table-dialog>
  </el-container>
</template>
<script>
import basicOption from "@/util/basic-option";
import FormDialog from "@/views/modelingMenu/ui/formDefine/components/formDialog";
import TableDialog from "@/views/modelingMenu/ui/formDefine/components/tableDialog"
import {gridPortalVIDatas} from "@/api/UI/formDefine/api"
import {getBizTypes} from "@/api/modeling/businessType/api";
import {gridLink} from "@/api/modeling/linkType/api";
import func from "@/util/func";
export default {
  name: "index"
  name: "index",
  components: {FormDialog, TableDialog},
  data() {
    return {
      page: {
        currentPage: 1,
        pageSize: 10,
        total: 0,
        pageSizes: [10, 30, 50, 100],
      },
      nodeRow: {},
      treeLoading: false,
      option: {
        ...basicOption,
        addBtn: false,
        editBtn: false,
        delBtn: false,
        column: [
          {
            label: '业务名称',
            prop: 'typeName',
          },
          {
            label: '名称',
            prop: 'viName',
            sortable: true,
          },
          {
            label: '类型',
            prop: 'viTypeText',
          },
        ]
      },
      data: [],
      tableRadio: "",
      treeRadio: "0",
      treeData: [],
      treeOption: {
        addBtn: false
      }
    }
  },
  created() {
    this.getTreeList();
  },
  computed: {
    tableStatus() {
      return func.isEmptyObject(this.nodeRow)
    }
  },
  methods: {
    // å³ä¾§æ–°å¢ž
    addClickHandler() {
      if (!this.tableRadio) {
        this.$message.error('请在表格上方选择新增类型');
        return;
      }
      this.tableRadio === "0" ? this.$refs.formDialog.visible = true : this.$refs.tableDialog.visible = true;
    },
    // åˆå§‹åŒ–树请求
    getTreeList() {
      this.treeLoading = true;
      getBizTypes().then(res => {
        const data = res.data.data.map(item => {
          item.label = item.attributes.id;
          return item;
        });
        this.treeData = data;
        this.treeLoading = false;
      })
    },
    // å·¦ä¾§ä¸šåŠ¡ç±»åž‹åˆ‡æ¢
    TreeRadioChange(val) {
      this.treeLoading = true;
      this.resetTable();
      if (val === "0") {
        getBizTypes().then(res => {
          const data = res.data.data.map(item => {
            item.label = item.attributes.id;
            return item;
          });
          this.treeData = data;
          this.treeLoading = false;
        })
      } else {
        gridLink().then(res => {
          const data = res.data.data.map(item => {
            item.label = item.name;
            return item;
          });
          this.treeData = data;
          this.treeLoading = false;
        })
      }
    },
    // å·¦ä¾§æ ‘点击
    nodeClick(row) {
      console.log(row);
      this.tableRadio = null;
      this.nodeRow = row;
      this.getRightPortalVIDatas(row);
    },
    // é‡ç½®è¡¨æ ¼å±•示信息 å’Œ è¡¨æ ¼è¡¨å•选项
    resetTable() {
      this.data = [];
      this.tableRadio = null;
    },
    // å³ä¾§ è¡¨æ ¼ è¡¨å• ä¿¡æ¯æŸ¥è¯¢
    getRightPortalVIDatas() {
      const params = {
        'conditionMap[typeName]': this.treeRadio === '0' ? this.nodeRow.attributes.id : this.nodeRow.name,
        'conditionMap[viType]': this.tableRadio === '0' ? 'Form' : this.tableRadio === '1' ? 'Table' : '',
        'conditionMap[viTypeFlag]': this.treeRadio === '0' ? 'BtmType' : this.treeRadio === '1' ? 'LinkType' : '',
      }
      gridPortalVIDatas(this.page.currentPage, this.page.pageSize, params).then(res => {
        console.log(res);
        if (res.data.code === 200) {
          const data = res.data.data;
          this.data = data;
          this.page.total = res.data.total;
        }
      })
    },
    sizeChange(val) {
      this.page.pageSize = val;
      this.getRightPortalVIDatas();
    },
    // é¡µç 
    currentChange(val) {
      this.page.currentPage = val;
      this.getRightPortalVIDatas();
    },
    // è¡¨æ ¼ è¡¨å•切换
    tableRadioChange() {
      this.getRightPortalVIDatas();
    },
  }
}
</script>
@@ -53,8 +236,9 @@
  .el-scrollbar__wrap {
    overflow: auto !important;
  }
  .headerCon{
    .el-button{
  .headerCon {
    .el-button {
      width: 82px;
    }
  }