wangting
2024-08-30 0a9b9adee6c940e491aed4a6037af2eac53cda1e
Merge remote-tracking branch 'origin/master'
已修改7个文件
已删除1个文件
已添加3个文件
534 ■■■■■ 文件已修改
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/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/src/main/java/com/vci/web/controller/WebPortalVIController.java 33 ●●●● 补丁 | 查看 | 原始文档 | 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/OsPortalVIServiceImpl.java 169 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/api/UI/formDefine/api.js 14 ●●●●● 补丁 | 查看 | 原始文档 | 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/ui/formDefine/components/formDialog.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/index.vue 148 ●●●●● 补丁 | 查看 | 原始文档 | 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/po/PortalVIPO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,88 @@
package com.vci.po;
import com.vci.starter.poi.annotation.ExcelColumn;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
 * è¡¨å•/表格导入转换对象
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PortalVIPO implements java.io.Serializable {
    private static final long serialVersionUID = -4958371880356252841L;
    /**
     * æ‰€åœ¨æ•°æ®è¡Œ
     */
    @ExcelColumn(rowIndexColumn = true,value = "")
    private String rowIndex;
    /**
     * ä¸šåŠ¡ç±»åž‹åç§°
     */
    @ExcelColumn(value="业务类型名称",nullable = false)
    private String typeName;
    /**
     * åç§°
     */
    @ExcelColumn(value="名称",nullable = false)
    private String viName;
    /**
     *业务类型
     */
    private short typeFlag;
    /**
     * ä¸šåŠ¡ç±»åž‹
     */
    @ExcelColumn(value="业务类型",nullable = false)
    private String typeFlagText;
    /***
     * è¡¨å•类型
     */
    private short viType;
    /***
     * è¡¨å•类型
     */
    @ExcelColumn(value="表单类型",nullable = false)
    private String viTypeText;
    /***
     * é…ç½®ä¿¡æ¯
     */
    private String prm;
    /**
     * é…ç½®æ–‡æœ¬
     */
    @ExcelColumn(value="配置文本")
    private String prmFileName;
    /***
     * å±žæ€§
     */
    @ExcelColumn(value="属性" ,nullable = false)
    private String attributeKey;
    /***
     * æŸ¥è¯¢æ¨¡æ¿åç§°
     */
    @ExcelColumn(value="查询模板名称" )
    private String qtName;
    /***
     * æŸ¥è¯¢æ¨¡æ¿é…ç½®æ–‡æœ¬
     */
    @ExcelColumn(value="查询模板配置文本" )
    private String qtNameFile;
    /***
     * æŸ¥è¯¢æ¨¡æ¿ä¸šåŠ¡ç±»åž‹
     */
    @ExcelColumn(value="查询模板业务类型" )
    private String qtNameType;
}
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/po/QTDPO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,46 @@
package com.vci.po;
import com.vci.starter.poi.annotation.ExcelColumn;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
 * è¡¨å•/表格导入转换对象
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class QTDPO implements java.io.Serializable {
    private static final long serialVersionUID = 8774827411052362064L;
    /**
     * æ‰€åœ¨æ•°æ®è¡Œ
     */
    @ExcelColumn(rowIndexColumn = true,value = "")
    private String rowIndex;
    /**
     * ä¸šåŠ¡ç±»åž‹åç§°
     */
    @ExcelColumn(value="业务类型名称")
    private String typeName;
    /**
     * é“¾æŽ¥ç±»åž‹åç§°
     */
    @ExcelColumn(value="链接类型名称")
    private String linkType;
    /**
     *查询模板定义名称
     */
    @ExcelColumn(value="查询模板定义名称" )
    private String QtdName;
    /***
     * å±žæ€§
     */
    @ExcelColumn(value="属性" )
    private String attributeKey;
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebPortalVIController.java
@@ -1,13 +1,12 @@
package com.vci.web.controller;
import com.vci.constant.FrameWorkLangCodeConstant;
import com.vci.corba.common.PLException;
import com.vci.dto.ClonePortalVIDTOList;
import com.vci.dto.DeletePortalVIDTOList;
import com.vci.dto.OsBtmTypeDTO;
import com.vci.dto.PortalVIDTO;
import com.vci.pagemodel.KeyValue;
import com.vci.pagemodel.PortalVIVO;
import com.vci.starter.web.annotation.controller.VciUnCheckRight;
import com.vci.starter.web.annotation.log.VciBusinessLog;
import com.vci.starter.web.exception.VciBaseException;
import com.vci.starter.web.pagemodel.BaseQueryObject;
@@ -15,19 +14,19 @@
import com.vci.starter.web.pagemodel.DataGrid;
import com.vci.starter.web.util.ControllerUtil;
import com.vci.starter.web.util.LangBaseUtil;
import com.vci.starter.web.util.LocalFileUtil;
import com.vci.starter.web.util.VciBaseUtil;
import com.vci.web.enumpck.ItemDblEnum;
import com.vci.web.enumpck.ItemTypeEnum;
import com.vci.web.service.OsPortalVIServiceI;
import com.vci.web.service.WebBtmIOServiceI;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.FileNotFoundException;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.List;
@@ -165,6 +164,30 @@
            }
        }
    }
    /**
     * å¯¼å‡ºæ•°æ®åº“的表信息到excel
     * @param file ä¸Šä¼ çš„æ–‡ä»¶
     */
    @PostMapping("/importData")
    @VciBusinessLog(operateName = "导入表单/表格")
    public BaseResult importData(MultipartFile file){
        String excelFileName = LocalFileUtil.getDefaultTempFolder() + File.separator + LocalFileUtil.getFileNameForIE(file.getOriginalFilename());
        File file1 = new File(excelFileName);
        try {
            file.transferTo(new File(excelFileName));
            if (file != null) {
                return portalVIServiceI.importData(file1);
            } else {
                return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"无导入的文件"});
            }
        }catch (Throwable e) {
            throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e);
        }finally {
            file1.delete();
        }
    }
    /**
     * èŽ·å–å±žæ€§å­—æ®µç±»åž‹
     */
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsPortalVIServiceI.java
@@ -9,7 +9,10 @@
import com.vci.starter.web.pagemodel.BaseQueryObject;
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.starter.web.pagemodel.DataGrid;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
import java.util.Map;
@@ -82,6 +85,12 @@
    String exportToExcel(Collection<String> idList);
    /**
     * å¯¼å…¥è¡¨å•/表格数据
     * @param file ä¸Šä¼ çš„æ–‡ä»¶
     * @return
     */
    public BaseResult importData(File  file)throws Throwable;
    /**
     *查询所有表单或者表格
     * @return key æ˜¯ç”Ÿå‘½å‘¨æœŸçš„编号的英文小写
     * @throws VciBaseException æŸ¥è¯¢çš„æ—¶å€™å‡ºé”™ä¼šæŠ›å‡ºå¼‚常
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsPortalVIServiceImpl.java
@@ -4,6 +4,7 @@
import cn.hutool.core.util.ZipUtil;
import com.vci.bo.ItemSeniorQueryBO;
import com.vci.common.utility.ObjectUtility;
import com.vci.constant.FrameWorkLangCodeConstant;
import com.vci.corba.common.PLException;
import com.vci.corba.omd.qtm.QTD;
import com.vci.corba.omd.qtm.QTInfo;
@@ -12,6 +13,9 @@
import com.vci.dto.*;
import com.vci.model.*;
import com.vci.pagemodel.*;
import com.vci.po.PortalVIPO;
import com.vci.po.QTDPO;
import com.vci.starter.poi.bo.ReadExcelOption;
import com.vci.starter.poi.bo.WriteExcelData;
import com.vci.starter.poi.bo.WriteExcelOption;
import com.vci.starter.poi.util.ExcelUtil;
@@ -26,6 +30,7 @@
import com.vci.web.enumpck.ItemTypeEnum;
import com.vci.web.enumpck.PortalVIType;
import com.vci.web.enumpck.PortalVITypeFlag;
import com.vci.web.other.BtmQTExportData;
import com.vci.web.service.OsAttributeServiceI;
import com.vci.web.service.OsPortalVIServiceI;
import com.vci.web.service.OsQuereyTemplateServiceI;
@@ -39,6 +44,7 @@
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.web.multipart.MultipartFile;
import java.io.*;
import java.util.*;
@@ -126,7 +132,7 @@
                dataGrid.setData(portalVIVOS);
                dataGrid.setTotal(pagePortalVIArrayByPageInfoResult.total);
            }else{
                dataGrid = new DataGrid<>("沒有查询到数据");
                dataGrid = new DataGrid<>();
            }
        } catch (PLException e) {
            e.printStackTrace();
@@ -352,6 +358,21 @@
                    String prmText=UITools.getPRMText(prmDOO2VIS(portalVIDTO.getPrm(),portalVIDTO.getViType()));
                    String prmTextFileName=    ObjectUtility.getNewObjectID36() + ".txt";
                    String prmTextFileNameAllName = xfileName + "." + prmTextFileName;
                    if (portalVIDTO.getViType() == PortalVIType.Table.getIntVal()) {//如果导入的table,则需要校验表格关联的表单是否存在,如果不存在则在execl中是否存在
                        PortalVI[] pvs = platformClientUtil.getPortalService().getPortalVIArrayByTypeName(portalVIDTO.getTypeName());
                        PRMDTO prmdto=   portalVIDTO.getPrm();
                        List<PRMItemDTO> prmItemDTOS=   prmdto.getPrmItemList();
                        if (!CollectionUtils.isEmpty(Arrays.asList(pvs))) {
                            Optional.ofNullable(prmItemDTOS).orElseGet(()->new ArrayList<>()).stream().forEach(prmItemDTO -> {
                                Arrays.stream(pvs).forEach(pv -> {
                                    if (prmItemDTO.getItemInObj().equals(pv.typeName + ":" + pv.viName)) {
                                        prmItemDTO.setItemInObj(pv.id);
                                    }
                                });
                            });
                        }
                    }
                    writeDataToFile(defaultTempFolder,prmTextFileNameAllName,prmText);
                    rowDataList.add(new WriteExcelData(rowIndex[0], 4,prmTextFileName));//配置文本
@@ -420,6 +441,152 @@
        return zip.getAbsoluteFile().getAbsolutePath();
    }
    @Override
    public BaseResult importData(File file)throws Throwable{
        if (file == null) {
            return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"无导入的文件"});
        }
        try {
            File unzip = ZipUtil.unzip(file);
            String filePath=unzip.getAbsolutePath() + File.separator + "export.xls";
            File btmExcel = new File(filePath);
            List<PortalVIPO> portalVIPOList=new ArrayList<>();
            List<QTDPO> QTDPOPOList=new ArrayList<>();
            try {
                ReadExcelOption PortalVIPOReadExcelOption=new ReadExcelOption();
                PortalVIPOReadExcelOption.setSheetName("portalvi");
                PortalVIPOReadExcelOption.setSheetIndex(0);
                portalVIPOList = ExcelUtil.readDataObjectFromExcel(btmExcel, PortalVIPO.class,PortalVIPOReadExcelOption);
                //从execl获取查询模板定义.
               /* ReadExcelOption QTDPOReadExcelOption=new ReadExcelOption();
                QTDPOReadExcelOption.setSheetName("QTD");
                QTDPOReadExcelOption.setSheetIndex(1);
                QTDPOPOList = ExcelUtil.readDataObjectFromExcel(btmExcel, QTDPO.class,QTDPOReadExcelOption);*/
            }catch (VciBaseException e){
                throw  new Throwable("读取execl数据出错:"+e.getMessage());
            }
            List<PortalVI> portalVIList=new ArrayList<>();
            if(!CollectionUtils.isEmpty(portalVIPOList)){
                Map<String,String>formNameMap=new HashMap<>();
                StringBuffer checkInObj=new StringBuffer();
                StringBuffer checkPortalVI=new StringBuffer();
                List<String> sjkExitsList=new ArrayList<>();
                portalVIPOList.stream().forEach(portalVIPO -> {
                    PortalVI portalVI=new PortalVI();
                    String ploid = ObjectUtility.getNewObjectID36();
                    portalVI.id=ploid;
                    portalVI.viName=portalVIPO.getViName();
                    portalVI.typeName=portalVIPO.getTypeName();
                    portalVI.viType=PortalVIType.getByLabel(portalVIPO.getViTypeText()).getIntVal();
                    portalVI.typeFlag=PortalVITypeFlag.getByLabel(portalVIPO.getTypeFlagText()).getIntVal();
                    String fileName= portalVIPO.getPrmFileName();
                    String prmStr = readLines(filePath+"."+fileName);
                    try {
                        PortalVI[] pvs = platformClientUtil.getPortalService().getPortalVIArrayByTypeName(portalVI.typeName);
                        if (portalVI.viType == PortalVIType.Table.getIntVal()) {//如果导入的table,则需要校验表格关联的表单是否存在,如果不存在则在execl中是否存在
                            formNameMap.put(portalVI.typeName + ":" + portalVI.viName, ploid);
                            PRMDO prmObj = UITools.getPRM(prmStr);
                            List<PRMItemDO> prmItemList = prmObj.getPrmItemList();
                            if (!CollectionUtils.isEmpty(prmItemList)) {
                                prmItemList.stream().forEach(prmItemDO -> {
                                    if (!CollectionUtils.isEmpty(Arrays.asList(pvs))) {
                                        Arrays.stream(pvs).forEach(pv -> {
                                            if (prmItemDO.getItemInObj().equals(portalVI.typeName + ":" + pv.viName)) {
                                                prmItemDO.setItemInObj(pv.id);
                                            }
                                        });
                                    } else {
                                        if (formNameMap.containsKey(prmItemDO.getItemInObj())) {
                                            prmItemDO.setItemInObj(formNameMap.get(prmItemDO.getItemInObj()));
                                        } else {
                                            if (!checkInObj.toString().contains(prmItemDO.getItemInObj())) {
                                                String[] split = prmItemDO.getItemInObj().split(":");
                                                checkInObj.append(split[1]).append(",");
                                            }
                                        }
                                    }
                                });
                            }
                            prmStr = UITools.getPRMText(prmObj);
                        }
                        portalVI.prm = prmStr.trim();
                        //校验表单是否存在
                        if (!CollectionUtils.isEmpty(Arrays.asList(pvs))) {
                            Arrays.stream(pvs).forEach(pv -> {
                                if (pv.viName.equals(portalVI.viName)) {
                                    checkPortalVI.append(portalVI.viName).append(",");
                                }
                            });
                        }
                        //校验属性是否正确
                        List<OsAttributeVO> osAttributeVOList = osAttributeService.getOsAttributeVOSByBtName(portalVI.typeName, portalVI.typeFlag);
                        if (!CollectionUtils.isEmpty(osAttributeVOList)) {
                            List<String> filedList = osAttributeVOList.stream().map(OsAttributeVO::getId).collect(Collectors.toList());
                            List<String> attributeList = VciBaseUtil.str2List(portalVIPO.getAttributeKey());
                            //数据库不存在
                            List<String> sjkExitsLists = Optional.ofNullable(attributeList).orElseGet(() -> new ArrayList<>()).stream().filter(s -> !attributeList.contains(s)).collect(Collectors.toList());
                            sjkExitsList.addAll(sjkExitsLists);
                        }
                    }catch (Throwable e){
                        e.printStackTrace();
                    }
                    portalVIList.add(portalVI);
                    if(StringUtils.isNotBlank(portalVIPO.getQtName())&&StringUtils.isNotBlank(portalVIPO.getQtNameFile())) {
                        QTInfo qt = new QTInfo();
                        String qtText = readLines(filePath + "." + portalVIPO.getQtNameFile());
                        qt.qtText=qtText;
                        qt.qtName = portalVIPO.getQtName();
                        qt.btmName=portalVIPO.getQtName();
                        QTInfo qt2 = null;
                        try {
                            qt2 = platformClientUtil.getQTDService().getQT(qt.qtName);
                            if (qt2 == null) {
                                platformClientUtil.getQTDService().saveQT(qt);
                            }
                        } catch (PLException e) {
                            e.printStackTrace();
                        }
                    }
                });
                if (checkInObj.length() > 0) {
                    throw  new Throwable( checkInObj.toString() + "表单不存在!");
                }
                if (checkPortalVI.length() > 0) {
                    throw  new Throwable( checkInObj.toString() + "名称已经存在!");
                }
                if(sjkExitsList.size()>0){
                    throw  new Throwable( checkInObj.toString() + "属性在类型中不存在!");
                }
                for (PortalVI pvi : portalVIList) {
                    platformClientUtil.getPortalService().savePortalVI(pvi);
                }
            }
        }catch (Throwable e){
          //  throw new Throwable("导入失败:"+e.getMessage());
           return BaseResult.fail("导入失败:"+e.getMessage());
        }
        return BaseResult.success("导入成功");
    }
    private String readLines(String filePath){
        StringBuffer sb=new StringBuffer();
        FileInputStream prmFile=null;
        try {
            prmFile = new FileInputStream(filePath);
            List<String>  prm= IOUtils.readLines(prmFile,"UTF-8");
            prm.stream().forEach(s -> {
                sb.append(s);
            });
        } catch (IOException e) {
            IOUtils.closeQuietly(prmFile);
            e.printStackTrace();
        }finally {
            IOUtils.closeQuietly(prmFile);
        }
        return sb.toString();
    }
    /**
     * æ‹·è´æ•°æ®åˆ°word模板中
     * @param fileName è¦å†™å…¥çš„æ•°æ®
Source/plt-web/plt-web-ui/src/api/UI/formDefine/api.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,14 @@
import request from '@/router/axios';
// åˆ—表查询
export function gridPortalVIDatas(page,limit,params) {
  return request({
    url: "/api/portalVIController/gridPortalVIDatas",
    method: "get",
    params:{
      page,
      limit,
      ...params
    }
  });
}
Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/businessType/index.vue
@@ -34,7 +34,7 @@
          </div>
          <!-- å·¦ä¾§æ ‘ -->
          <div style="height:  calc(100vh - 330px);">
            <avue-tree ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick">
            <avue-tree ref="tree" v-loading="treeLoading" :data="treeData" :option="treeOption" @node-click="nodeClick">
          <span slot-scope="{ node, data }" class="el-tree-node__label">
           <span style="font-size: 15px">
              <i class="el-icon-s-promotion"></i>
@@ -927,6 +927,7 @@
        name: 'el-icon-tickets',
        desc: 'el-icon-chat-line-square'
      },
      treeLoading:false
    }
  },
  created() {
@@ -937,6 +938,7 @@
  methods: {
    //树表查询
    getTreeList() {
      this.treeLoading = true;
      getBizTypes().then(res => {
        const data = res.data.data.map(item => {
          this.processChildren(item); // å¤„理每个节点
@@ -944,8 +946,8 @@
          return item.attributes; // è¿”回处理后的 attributes
        });
        this.treeData[0].children = data;
        console.log(this.treeData);
        this.inheritTreeData = data;
        this.treeLoading = false;
      });
    },
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/formDialog.vue
@@ -24,9 +24,9 @@
          </basic-container>
        </el-aside>
        <el-main >
        <el-main>
          <basic-container>
            <div style="height: 645px" @drop="drop"  @dragover.prevent>
            <div style="height: 645px" @drop="drop" @dragover.prevent>
              <div style="display: flex;justify-content: center">
                <span style="display: flex;align-items: center; margin-right: 5px;">
                 <p class="tableTopLabel">名称:</p>
@@ -53,9 +53,9 @@
              <h3>页面定义</h3>
              <el-form ref="form" :model="form" :rules="rules" label-width="100px">
                <el-row>
                  <el-col :span="columnNumber">
                    <el-tooltip v-for="(item,index) in formList" :key="index" :content="item.name" placement="top">
                      <el-form-item class="hiddenLabel" :label="item.name + ':'">
                  <el-col v-for="(item,index) in formList" :key="index" :span="columnNumber">
                    <el-tooltip :content="item.name" placement="top">
                      <el-form-item :label="item.name + ':'" class="hiddenLabel">
                        <el-input v-model="item.value" :splaceholder="item.name" size="mini"></el-input>
                      </el-form-item>
                    </el-tooltip>
@@ -338,7 +338,7 @@
  name: "formDialog",
  data() {
    return {
      formList:[],
      formList: [],
      optionRightData: [
        {
          name: 'test',
@@ -347,7 +347,7 @@
      ],
      form: {},
      rules: {},
      columnNumber: 12,
      columnNumber: 3,
      loading: false,
      visible: false,
      treeOption: {
@@ -562,9 +562,9 @@
      const data = JSON.parse(event.dataTransfer.getData('item'));
      console.log('data', data);
      const params = {
        name:data.label,
        value:'',
        type:''
        name: data.label,
        value: '',
        type: ''
      }
      this.formList.push(params)
    }
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/index.vue
@@ -4,13 +4,13 @@
    <el-aside>
      <basic-container>
        <div ref="TreeBox" style="height: calc(100vh - 144px);!important;">
          <!-- å·¦ä¾§æ ‘         -->
          <div style="height:  calc(100vh - 280px);">
          <!-- å·¦ä¾§æ ‘ -->
          <div style="height:  calc(100vh - 220px);">
            <div style="margin-bottom: 10px;display: flex;justify-content: center">
              <el-radio v-model="treeRadio" label="0">业务类型树</el-radio>
              <el-radio v-model="treeRadio" label="1">链接类型树</el-radio>
              <el-radio v-model="treeRadio" label="0" @input="TreeRadioChange">业务类型树</el-radio>
              <el-radio v-model="treeRadio" label="1" @input="TreeRadioChange">链接类型树</el-radio>
            </div>
            <avue-tree :data="treeData" :option="treeOption" @node-click="nodeClick">
            <avue-tree v-loading="treeLoading" :data="treeData" :option="treeOption" @node-click="nodeClick">
          <span slot-scope="{ node, data }" class="el-tree-node__label">
           <span style="font-size: 15px">
              <i class="el-icon-s-promotion"></i>
@@ -26,13 +26,17 @@
    <el-main>
      <basic-container>
        <avue-crud
          v-if="!tableStatus"
          :data="data"
          :option="option">
          :option="option"
          :page.sync="page"
          @size-change="sizeChange"
          @current-change="currentChange">
          <template slot="menuLeft">
            <div style="display: flex; align-items: center;">
               <span style="display: inline-block; margin-right: 10px;">
                <el-radio v-model="tableRadio" label="0">表单</el-radio>
                <el-radio v-model="tableRadio" label="1">表格<span style="color: red;">(先导入表单,再导入表格!)</span></el-radio>
                <el-radio v-model="tableRadio" label="0" @input="tableRadioChange">表单</el-radio>
                <el-radio v-model="tableRadio" label="1" @input="tableRadioChange">表格<span style="color: red;">(先导入表单,再导入表格!)</span></el-radio>
               </span>
              <span style="display: flex;align-items: center; margin-right: 10px;">
                <p style="display: flex; flex-shrink: 0;font-size: 14px">名称:</p>
@@ -53,7 +57,7 @@
            </el-button>
          </template>
        </avue-crud>
        <div style="display: flex;justify-content: center;margin-top: 15px">
        <div v-if="!tableStatus" style="display: flex;justify-content: center;margin-top: 15px">
          <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addClickHandler">增加</el-button>
          <el-button icon="el-icon-delete" plain size="small" type="danger">删除</el-button>
          <el-button icon="el-icon-document-add" plain size="small" type="primary">克隆</el-button>
@@ -71,17 +75,44 @@
import basicOption from "@/util/basic-option";
import FormDialog from "@/views/modelingMenu/ui/formDefine/components/formDialog";
import TableDialog from "@/views/modelingMenu/ui/formDefine/components/tableDialog"
import {gridPortalVIDatas} from "@/api/UI/formDefine/api"
import {getBizTypes} from "@/api/modeling/businessType/api";
import {gridLink} from "@/api/modeling/linkType/api";
import func from "@/util/func";
export default {
  name: "index",
  components: {FormDialog, TableDialog},
  data() {
    return {
      page: {
        currentPage: 1,
        pageSize: 10,
        total: 0,
        pageSizes: [10, 30, 50, 100],
      },
      nodeRow: {},
      treeLoading: false,
      option: {
        ...basicOption,
        addBtn: false,
        editBtn: false,
        delBtn: false
        delBtn: false,
        column: [
          {
            label: '业务名称',
            prop: 'typeName',
          },
          {
            label: '名称',
            prop: 'viName',
            sortable: true,
          },
          {
            label: '类型',
            prop: 'viTypeText',
          },
        ]
      },
      data: [],
      tableRadio: "",
@@ -92,7 +123,16 @@
      }
    }
  },
  created() {
    this.getTreeList();
  },
  computed: {
    tableStatus() {
      return func.isEmptyObject(this.nodeRow)
    }
  },
  methods: {
    // å³ä¾§æ–°å¢ž
    addClickHandler() {
      if (!this.tableRadio) {
        this.$message.error('请在表格上方选择新增类型');
@@ -100,7 +140,93 @@
      }
      this.tableRadio === "0" ? this.$refs.formDialog.visible = true : this.$refs.tableDialog.visible = true;
    }
    },
    // åˆå§‹åŒ–树请求
    getTreeList() {
      this.treeLoading = true;
      getBizTypes().then(res => {
        const data = res.data.data.map(item => {
          item.label = item.attributes.id;
          return item;
        });
        this.treeData = data;
        this.treeLoading = false;
      })
    },
    // å·¦ä¾§ä¸šåŠ¡ç±»åž‹åˆ‡æ¢
    TreeRadioChange(val) {
      this.treeLoading = true;
      this.resetTable();
      if (val === "0") {
        getBizTypes().then(res => {
          const data = res.data.data.map(item => {
            item.label = item.attributes.id;
            return item;
          });
          this.treeData = data;
          this.treeLoading = false;
        })
      } else {
        gridLink().then(res => {
          const data = res.data.data.map(item => {
            item.label = item.name;
            return item;
          });
          this.treeData = data;
          this.treeLoading = false;
        })
      }
    },
    // å·¦ä¾§æ ‘点击
    nodeClick(row) {
      console.log(row);
      this.tableRadio = null;
      this.nodeRow = row;
      this.getRightPortalVIDatas(row);
    },
    // é‡ç½®è¡¨æ ¼å±•示信息 å’Œ è¡¨æ ¼è¡¨å•选项
    resetTable() {
      this.data = [];
      this.tableRadio = null;
    },
    // å³ä¾§ è¡¨æ ¼ è¡¨å• ä¿¡æ¯æŸ¥è¯¢
    getRightPortalVIDatas() {
      const params = {
        'conditionMap[typeName]': this.treeRadio === '0' ? this.nodeRow.attributes.id : this.nodeRow.name,
        'conditionMap[viType]': this.tableRadio === '0' ? 'Form' : this.tableRadio === '1' ? 'Table' : '',
        'conditionMap[viTypeFlag]': this.treeRadio === '0' ? 'BtmType' : this.treeRadio === '1' ? 'LinkType' : '',
      }
      gridPortalVIDatas(this.page.currentPage, this.page.pageSize, params).then(res => {
        console.log(res);
        if (res.data.code === 200) {
          const data = res.data.data;
          this.data = data;
          this.page.total = res.data.total;
        }
      })
    },
    sizeChange(val) {
      this.page.pageSize = val;
      this.getRightPortalVIDatas();
    },
    // é¡µç 
    currentChange(val) {
      this.page.currentPage = val;
      this.getRightPortalVIDatas();
    },
    // è¡¨æ ¼ è¡¨å•切换
    tableRadioChange() {
      this.getRightPortalVIDatas();
    },
  }
}
</script>