Merge branch 'v1.8' of https://github.com/metersphere/metersphere into v1.8
This commit is contained in:
commit
c5362840fc
|
@ -283,6 +283,13 @@
|
||||||
<version>2.0.22</version>
|
<version>2.0.22</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- ApacheJMeter_core scope 是 runtime,这里去掉scope -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.codehaus.groovy</groupId>
|
||||||
|
<artifactId>groovy-jsr223</artifactId>
|
||||||
|
<version>2.5.10</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- 执行 js 代码依赖 -->
|
<!-- 执行 js 代码依赖 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.graalvm.sdk</groupId>
|
<groupId>org.graalvm.sdk</groupId>
|
||||||
|
|
|
@ -171,7 +171,7 @@ public class ApiDefinitionController {
|
||||||
@PostMapping(value = "/import", consumes = {"multipart/form-data"})
|
@PostMapping(value = "/import", consumes = {"multipart/form-data"})
|
||||||
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
|
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
|
||||||
public ApiDefinitionImport testCaseImport(@RequestPart(value = "file", required = false) MultipartFile file, @RequestPart("request") ApiTestImportRequest request) {
|
public ApiDefinitionImport testCaseImport(@RequestPart(value = "file", required = false) MultipartFile file, @RequestPart("request") ApiTestImportRequest request) {
|
||||||
return apiDefinitionService.apiTestImport(file, request);
|
return apiDefinitionService.apiTestImport(file, request);//95821329-9eaa-4d2a-aa24-e6f912994716"
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping(value = "/export/{type}")
|
@PostMapping(value = "/export/{type}")
|
||||||
|
|
|
@ -80,9 +80,9 @@ public class ESBParser extends EsbAbstractParser {
|
||||||
font.setFontHeightInPoints((short) 9);
|
font.setFontHeightInPoints((short) 9);
|
||||||
Map<String, XSSFCellStyle> cellStyleMap = createCellStle(workbook);
|
Map<String, XSSFCellStyle> cellStyleMap = createCellStle(workbook);
|
||||||
XSSFSheet headSheet = workbook.createSheet("公共报文头");
|
XSSFSheet headSheet = workbook.createSheet("公共报文头");
|
||||||
generateSheet(headSheet,true, font,cellStyleMap);
|
generateSheet(headSheet, font, cellStyleMap);
|
||||||
XSSFSheet bodySheet = workbook.createSheet("接口报文信息");
|
XSSFSheet bodySheet = workbook.createSheet("接口报文信息");
|
||||||
generateSheet(bodySheet, false,font,cellStyleMap);
|
generateSheet(bodySheet, font, cellStyleMap);
|
||||||
return workbook;
|
return workbook;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ public class ESBParser extends EsbAbstractParser {
|
||||||
return cellStype;
|
return cellStype;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void generateSheet(XSSFSheet sheet,boolean isHead, XSSFFont font,Map<String, XSSFCellStyle> cellStyleMap) {
|
private static void generateSheet(XSSFSheet sheet, XSSFFont font, Map<String, XSSFCellStyle> cellStyleMap) {
|
||||||
if (sheet == null) {
|
if (sheet == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -125,22 +125,12 @@ public class ESBParser extends EsbAbstractParser {
|
||||||
sheet.setColumnWidth(1, 4000);
|
sheet.setColumnWidth(1, 4000);
|
||||||
sheet.setColumnWidth(2, 4000);
|
sheet.setColumnWidth(2, 4000);
|
||||||
sheet.setColumnWidth(3, 4000);
|
sheet.setColumnWidth(3, 4000);
|
||||||
if(isHead){
|
|
||||||
sheet.setColumnWidth(4, 880);
|
sheet.setColumnWidth(4, 880);
|
||||||
sheet.setColumnWidth(5, 4000);
|
sheet.setColumnWidth(5, 4000);
|
||||||
sheet.setColumnWidth(6, 4000);
|
sheet.setColumnWidth(6, 4000);
|
||||||
sheet.setColumnWidth(7, 4000);
|
sheet.setColumnWidth(7, 4000);
|
||||||
sheet.setColumnWidth(8, 4000);
|
sheet.setColumnWidth(8, 4000);
|
||||||
sheet.setColumnWidth(9, 4000);
|
sheet.setColumnWidth(9, 4000);
|
||||||
}else {
|
|
||||||
sheet.setColumnWidth(4, 4000);
|
|
||||||
sheet.setColumnWidth(5, 880);
|
|
||||||
sheet.setColumnWidth(6, 4000);
|
|
||||||
sheet.setColumnWidth(7, 4000);
|
|
||||||
sheet.setColumnWidth(8, 4000);
|
|
||||||
sheet.setColumnWidth(9, 4000);
|
|
||||||
sheet.setColumnWidth(10, 4000);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 模版生成:
|
* 模版生成:
|
||||||
|
@ -160,7 +150,7 @@ public class ESBParser extends EsbAbstractParser {
|
||||||
setCellValue("交易名称", row1.createCell(1), font, cellStyleMap.get("default"));
|
setCellValue("交易名称", row1.createCell(1), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row1.createCell(2), font, cellStyleMap.get("default"));
|
setCellValue("", row1.createCell(2), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row1.createCell(3), font, cellStyleMap.get("default"));
|
setCellValue("", row1.createCell(3), font, cellStyleMap.get("default"));
|
||||||
if(isHead){
|
// if (isHead) {
|
||||||
setCellValue("", row1.createCell(4), font, cellStyleMap.get("default"));
|
setCellValue("", row1.createCell(4), font, cellStyleMap.get("default"));
|
||||||
setCellValue("服务名称", row1.createCell(5), font, cellStyleMap.get("default"));
|
setCellValue("服务名称", row1.createCell(5), font, cellStyleMap.get("default"));
|
||||||
setCellValue("服务场景", row1.createCell(6), font, cellStyleMap.get("default"));
|
setCellValue("服务场景", row1.createCell(6), font, cellStyleMap.get("default"));
|
||||||
|
@ -168,15 +158,15 @@ public class ESBParser extends EsbAbstractParser {
|
||||||
setCellValue("", row1.createCell(8), font, cellStyleMap.get("default"));
|
setCellValue("", row1.createCell(8), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row1.createCell(9), font, cellStyleMap.get("default"));
|
setCellValue("", row1.createCell(9), font, cellStyleMap.get("default"));
|
||||||
|
|
||||||
}else{
|
// } else {
|
||||||
setCellValue("", row1.createCell(4), font,cellStyleMap.get("default"));
|
// setCellValue("", row1.createCell(4), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row1.createCell(5), font,cellStyleMap.get("pop"));
|
// setCellValue("", row1.createCell(5), font, cellStyleMap.get("pop"));
|
||||||
setCellValue("服务名称", row1.createCell(6), font,cellStyleMap.get("default"));
|
// setCellValue("服务名称", row1.createCell(6), font, cellStyleMap.get("default"));
|
||||||
setCellValue("服务场景", row1.createCell(7), font,cellStyleMap.get("default"));
|
// setCellValue("服务场景", row1.createCell(7), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row1.createCell(8), font,cellStyleMap.get("default"));
|
// setCellValue("", row1.createCell(8), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row1.createCell(9), font,cellStyleMap.get("default"));
|
// setCellValue("", row1.createCell(9), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row1.createCell(10), font,cellStyleMap.get("default"));
|
// setCellValue("", row1.createCell(10), font, cellStyleMap.get("default"));
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
XSSFRow row2 = sheet.createRow(1);
|
XSSFRow row2 = sheet.createRow(1);
|
||||||
|
@ -184,29 +174,29 @@ public class ESBParser extends EsbAbstractParser {
|
||||||
setCellValue("请输入交易名称(必填)", row2.createCell(1), font, cellStyleMap.get("default"));
|
setCellValue("请输入交易名称(必填)", row2.createCell(1), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row2.createCell(2), font, cellStyleMap.get("default"));
|
setCellValue("", row2.createCell(2), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row2.createCell(3), font, cellStyleMap.get("default"));
|
setCellValue("", row2.createCell(3), font, cellStyleMap.get("default"));
|
||||||
if(isHead){
|
// if (isHead) {
|
||||||
setCellValue("", row2.createCell(4), font, cellStyleMap.get("pop"));
|
setCellValue("", row2.createCell(4), font, cellStyleMap.get("pop"));
|
||||||
setCellValue("请输入服务名称(如果不填,则以交易名称为主)", row2.createCell(5), font, null);
|
setCellValue("请输入服务名称(如果不填,则以交易名称为主)", row2.createCell(5), font, null);
|
||||||
setCellValue("请输入服务场景(选填)", row2.createCell(6), font, cellStyleMap.get("default"));
|
setCellValue("请输入服务场景(选填)", row2.createCell(6), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row2.createCell(7), font, cellStyleMap.get("default"));
|
setCellValue("", row2.createCell(7), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row2.createCell(8), font, cellStyleMap.get("default"));
|
setCellValue("", row2.createCell(8), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row2.createCell(9), font, cellStyleMap.get("default"));
|
setCellValue("", row2.createCell(9), font, cellStyleMap.get("default"));
|
||||||
}else{
|
// } else {
|
||||||
setCellValue("", row2.createCell(4), font,cellStyleMap.get("default"));
|
// setCellValue("", row2.createCell(4), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row2.createCell(5), font,cellStyleMap.get("pop"));
|
// setCellValue("", row2.createCell(5), font, cellStyleMap.get("pop"));
|
||||||
setCellValue("请输入服务名称(如果不填,则以交易名称为主)", row2.createCell(6), font,null);
|
// setCellValue("请输入服务名称(如果不填,则以交易名称为主)", row2.createCell(6), font, null);
|
||||||
setCellValue("请输入服务场景(选填)", row2.createCell(7), font,cellStyleMap.get("default"));
|
// setCellValue("请输入服务场景(选填)", row2.createCell(7), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row2.createCell(8), font,cellStyleMap.get("default"));
|
// setCellValue("", row2.createCell(8), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row2.createCell(9), font,cellStyleMap.get("default"));
|
// setCellValue("", row2.createCell(9), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row2.createCell(10), font,cellStyleMap.get("default"));
|
// setCellValue("", row2.createCell(10), font, cellStyleMap.get("default"));
|
||||||
}
|
// }
|
||||||
|
|
||||||
XSSFRow row3 = sheet.createRow(2);
|
XSSFRow row3 = sheet.createRow(2);
|
||||||
setCellValue("", row3.createCell(0), font, cellStyleMap.get("yellow"));
|
setCellValue("", row3.createCell(0), font, cellStyleMap.get("yellow"));
|
||||||
setCellValue("", row3.createCell(1), font, cellStyleMap.get("yellow"));
|
setCellValue("", row3.createCell(1), font, cellStyleMap.get("yellow"));
|
||||||
setCellValue("", row3.createCell(2), font, cellStyleMap.get("yellow"));
|
setCellValue("", row3.createCell(2), font, cellStyleMap.get("yellow"));
|
||||||
setCellValue("", row3.createCell(3), font, cellStyleMap.get("yellow"));
|
setCellValue("", row3.createCell(3), font, cellStyleMap.get("yellow"));
|
||||||
if(isHead){
|
// if (isHead) {
|
||||||
setCellValue("", row3.createCell(4), font, cellStyleMap.get("yellow"));
|
setCellValue("", row3.createCell(4), font, cellStyleMap.get("yellow"));
|
||||||
setCellValue("请输入系统名称", row3.createCell(5), font, cellStyleMap.get("yellow"));
|
setCellValue("请输入系统名称", row3.createCell(5), font, cellStyleMap.get("yellow"));
|
||||||
setCellValue("", row3.createCell(6), font, cellStyleMap.get("yellow"));
|
setCellValue("", row3.createCell(6), font, cellStyleMap.get("yellow"));
|
||||||
|
@ -217,25 +207,25 @@ public class ESBParser extends EsbAbstractParser {
|
||||||
sheet.addMergedRegion(region1);
|
sheet.addMergedRegion(region1);
|
||||||
CellRangeAddress region2 = new CellRangeAddress(2, 2, 5, 9);
|
CellRangeAddress region2 = new CellRangeAddress(2, 2, 5, 9);
|
||||||
sheet.addMergedRegion(region2);
|
sheet.addMergedRegion(region2);
|
||||||
}else{
|
// } else {
|
||||||
setCellValue("", row3.createCell(4), font,cellStyleMap.get("yellow"));
|
// setCellValue("", row3.createCell(4), font, cellStyleMap.get("yellow"));
|
||||||
setCellValue("", row3.createCell(5), font,cellStyleMap.get("yellow"));
|
// setCellValue("", row3.createCell(5), font, cellStyleMap.get("yellow"));
|
||||||
setCellValue("请输入系统名称", row3.createCell(6), font,cellStyleMap.get("yellow"));
|
// setCellValue("请输入系统名称", row3.createCell(6), font, cellStyleMap.get("yellow"));
|
||||||
setCellValue("", row3.createCell(7), font,cellStyleMap.get("yellow"));
|
// setCellValue("", row3.createCell(7), font, cellStyleMap.get("yellow"));
|
||||||
setCellValue("", row3.createCell(8), font,cellStyleMap.get("yellow"));
|
// setCellValue("", row3.createCell(8), font, cellStyleMap.get("yellow"));
|
||||||
setCellValue("", row3.createCell(9), font,cellStyleMap.get("yellow"));
|
// setCellValue("", row3.createCell(9), font, cellStyleMap.get("yellow"));
|
||||||
setCellValue("", row3.createCell(10), font,cellStyleMap.get("yellow"));
|
// setCellValue("", row3.createCell(10), font, cellStyleMap.get("yellow"));
|
||||||
CellRangeAddress region1 = new CellRangeAddress(2, 2, 0, 4);
|
// CellRangeAddress region1 = new CellRangeAddress(2, 2, 0, 4);
|
||||||
sheet.addMergedRegion(region1);
|
// sheet.addMergedRegion(region1);
|
||||||
CellRangeAddress region2 = new CellRangeAddress(2, 2, 6, 10);
|
// CellRangeAddress region2 = new CellRangeAddress(2, 2, 6, 10);
|
||||||
sheet.addMergedRegion(region2);
|
// sheet.addMergedRegion(region2);
|
||||||
}
|
// }
|
||||||
|
|
||||||
XSSFRow row4 = sheet.createRow(3);
|
XSSFRow row4 = sheet.createRow(3);
|
||||||
setCellValue("英文名称", row4.createCell(0), font, cellStyleMap.get("yellow"));
|
setCellValue("英文名称", row4.createCell(0), font, cellStyleMap.get("yellow"));
|
||||||
setCellValue("中文名称", row4.createCell(1), font, cellStyleMap.get("yellow"));
|
setCellValue("中文名称", row4.createCell(1), font, cellStyleMap.get("yellow"));
|
||||||
setCellValue("数据类型/长度", row4.createCell(2), font, cellStyleMap.get("yellow"));
|
setCellValue("数据类型/长度", row4.createCell(2), font, cellStyleMap.get("yellow"));
|
||||||
if(isHead){
|
// if (isHead) {
|
||||||
setCellValue("备注", row4.createCell(3), font, cellStyleMap.get("yellow"));
|
setCellValue("备注", row4.createCell(3), font, cellStyleMap.get("yellow"));
|
||||||
setCellValue("", row4.createCell(4), font, cellStyleMap.get("pop"));
|
setCellValue("", row4.createCell(4), font, cellStyleMap.get("pop"));
|
||||||
setCellValue("英文名称", row4.createCell(5), font, cellStyleMap.get("yellow"));
|
setCellValue("英文名称", row4.createCell(5), font, cellStyleMap.get("yellow"));
|
||||||
|
@ -243,16 +233,16 @@ public class ESBParser extends EsbAbstractParser {
|
||||||
setCellValue("中文名称", row4.createCell(7), font, cellStyleMap.get("yellow"));
|
setCellValue("中文名称", row4.createCell(7), font, cellStyleMap.get("yellow"));
|
||||||
setCellValue("备注", row4.createCell(8), font, cellStyleMap.get("yellow"));
|
setCellValue("备注", row4.createCell(8), font, cellStyleMap.get("yellow"));
|
||||||
setCellValue("所在报文位置", row4.createCell(9), font, cellStyleMap.get("yellow"));
|
setCellValue("所在报文位置", row4.createCell(9), font, cellStyleMap.get("yellow"));
|
||||||
}else {
|
// } else {
|
||||||
setCellValue("是否必输", row4.createCell(3), font,cellStyleMap.get("yellow"));
|
// setCellValue("是否必输", row4.createCell(3), font, cellStyleMap.get("yellow"));
|
||||||
setCellValue("备注", row4.createCell(4), font,cellStyleMap.get("yellow"));
|
// setCellValue("备注", row4.createCell(4), font, cellStyleMap.get("yellow"));
|
||||||
setCellValue("", row4.createCell(5), font,cellStyleMap.get("pop"));
|
// setCellValue("", row4.createCell(5), font, cellStyleMap.get("pop"));
|
||||||
setCellValue("英文名称", row4.createCell(6), font,cellStyleMap.get("yellow"));
|
// setCellValue("英文名称", row4.createCell(6), font, cellStyleMap.get("yellow"));
|
||||||
setCellValue("数据类型/长度", row4.createCell(7), font,cellStyleMap.get("yellow"));
|
// setCellValue("数据类型/长度", row4.createCell(7), font, cellStyleMap.get("yellow"));
|
||||||
setCellValue("中文名称", row4.createCell(8), font,cellStyleMap.get("yellow"));
|
// setCellValue("中文名称", row4.createCell(8), font, cellStyleMap.get("yellow"));
|
||||||
setCellValue("备注", row4.createCell(9), font,cellStyleMap.get("yellow"));
|
// setCellValue("备注", row4.createCell(9), font, cellStyleMap.get("yellow"));
|
||||||
setCellValue("所在报文位置", row4.createCell(10), font,cellStyleMap.get("yellow"));
|
// setCellValue("所在报文位置", row4.createCell(10), font, cellStyleMap.get("yellow"));
|
||||||
}
|
// }
|
||||||
|
|
||||||
XSSFRow row5 = sheet.createRow(4);
|
XSSFRow row5 = sheet.createRow(4);
|
||||||
setCellValue("输入", row5.createCell(0), font, cellStyleMap.get("green"));
|
setCellValue("输入", row5.createCell(0), font, cellStyleMap.get("green"));
|
||||||
|
@ -265,53 +255,53 @@ public class ESBParser extends EsbAbstractParser {
|
||||||
setCellValue("", row5.createCell(7), font, cellStyleMap.get("green"));
|
setCellValue("", row5.createCell(7), font, cellStyleMap.get("green"));
|
||||||
setCellValue("", row5.createCell(8), font, cellStyleMap.get("green"));
|
setCellValue("", row5.createCell(8), font, cellStyleMap.get("green"));
|
||||||
setCellValue("", row5.createCell(9), font, cellStyleMap.get("green"));
|
setCellValue("", row5.createCell(9), font, cellStyleMap.get("green"));
|
||||||
if(!isHead){
|
// if (!isHead) {
|
||||||
setCellValue("", row5.createCell(10), font,cellStyleMap.get("green"));
|
// setCellValue("", row5.createCell(10), font, cellStyleMap.get("green"));
|
||||||
}
|
// }
|
||||||
|
|
||||||
XSSFRow row6 = sheet.createRow(5);
|
XSSFRow row6 = sheet.createRow(5);
|
||||||
setCellValue("", row6.createCell(0), font, cellStyleMap.get("default"));
|
setCellValue("", row6.createCell(0), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row6.createCell(1), font, cellStyleMap.get("default"));
|
setCellValue("", row6.createCell(1), font, cellStyleMap.get("default"));
|
||||||
setCellValue("请输入STRING(具体长度) 或 ARRAY", row6.createCell(2), font, cellStyleMap.get("default"));
|
setCellValue("请输入STRING(具体长度) 或 ARRAY", row6.createCell(2), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row6.createCell(3), font, cellStyleMap.get("default"));
|
setCellValue("", row6.createCell(3), font, cellStyleMap.get("default"));
|
||||||
if(isHead){
|
// if (isHead) {
|
||||||
setCellValue("", row6.createCell(4), font, cellStyleMap.get("pop"));
|
setCellValue("", row6.createCell(4), font, cellStyleMap.get("pop"));
|
||||||
setCellValue("", row6.createCell(5), font, cellStyleMap.get("default"));
|
setCellValue("", row6.createCell(5), font, cellStyleMap.get("default"));
|
||||||
setCellValue("请输入STRING(具体长度) 或 ARRAY", row6.createCell(6), font, cellStyleMap.get("default"));
|
setCellValue("请输入STRING(具体长度) 或 ARRAY", row6.createCell(6), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row6.createCell(7), font, cellStyleMap.get("default"));
|
setCellValue("", row6.createCell(7), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row6.createCell(8), font, cellStyleMap.get("default"));
|
setCellValue("", row6.createCell(8), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row6.createCell(9), font, cellStyleMap.get("default"));
|
setCellValue("", row6.createCell(9), font, cellStyleMap.get("default"));
|
||||||
}else {
|
// } else {
|
||||||
setCellValue("", row6.createCell(4), font,cellStyleMap.get("default"));
|
// setCellValue("", row6.createCell(4), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row6.createCell(5), font,cellStyleMap.get("pop"));
|
// setCellValue("", row6.createCell(5), font, cellStyleMap.get("pop"));
|
||||||
setCellValue("", row6.createCell(6), font,cellStyleMap.get("default"));
|
// setCellValue("", row6.createCell(6), font, cellStyleMap.get("default"));
|
||||||
setCellValue("请输入STRING(具体长度) 或 ARRAY", row6.createCell(7), font,cellStyleMap.get("default"));
|
// setCellValue("请输入STRING(具体长度) 或 ARRAY", row6.createCell(7), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row6.createCell(8), font,cellStyleMap.get("default"));
|
// setCellValue("", row6.createCell(8), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row6.createCell(9), font,cellStyleMap.get("default"));
|
// setCellValue("", row6.createCell(9), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row6.createCell(10), font,cellStyleMap.get("default"));
|
// setCellValue("", row6.createCell(10), font, cellStyleMap.get("default"));
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
XSSFRow row7 = sheet.createRow(6);
|
XSSFRow row7 = sheet.createRow(6);
|
||||||
setCellValue("", row7.createCell(1), font, cellStyleMap.get("default"));
|
setCellValue("", row7.createCell(1), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row7.createCell(2), font, cellStyleMap.get("default"));
|
setCellValue("", row7.createCell(2), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row7.createCell(3), font, cellStyleMap.get("default"));
|
setCellValue("", row7.createCell(3), font, cellStyleMap.get("default"));
|
||||||
if(isHead){
|
// if (isHead) {
|
||||||
setCellValue("", row7.createCell(4), font, cellStyleMap.get("pop"));
|
setCellValue("", row7.createCell(4), font, cellStyleMap.get("pop"));
|
||||||
setCellValue("", row7.createCell(5), font, cellStyleMap.get("default"));
|
setCellValue("", row7.createCell(5), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row7.createCell(6), font, cellStyleMap.get("default"));
|
setCellValue("", row7.createCell(6), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row7.createCell(7), font, cellStyleMap.get("default"));
|
setCellValue("", row7.createCell(7), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row7.createCell(8), font, cellStyleMap.get("default"));
|
setCellValue("", row7.createCell(8), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row7.createCell(9), font, cellStyleMap.get("default"));
|
setCellValue("", row7.createCell(9), font, cellStyleMap.get("default"));
|
||||||
}else {
|
// } else {
|
||||||
setCellValue("", row7.createCell(4), font,cellStyleMap.get("default"));
|
// setCellValue("", row7.createCell(4), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row7.createCell(5), font,cellStyleMap.get("pop"));
|
// setCellValue("", row7.createCell(5), font, cellStyleMap.get("pop"));
|
||||||
setCellValue("", row7.createCell(6), font,cellStyleMap.get("default"));
|
// setCellValue("", row7.createCell(6), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row7.createCell(7), font,cellStyleMap.get("default"));
|
// setCellValue("", row7.createCell(7), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row7.createCell(8), font,cellStyleMap.get("default"));
|
// setCellValue("", row7.createCell(8), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row7.createCell(9), font,cellStyleMap.get("default"));
|
// setCellValue("", row7.createCell(9), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row7.createCell(10), font,cellStyleMap.get("default"));
|
// setCellValue("", row7.createCell(10), font, cellStyleMap.get("default"));
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
XSSFRow row8 = sheet.createRow(7);
|
XSSFRow row8 = sheet.createRow(7);
|
||||||
|
@ -325,9 +315,9 @@ public class ESBParser extends EsbAbstractParser {
|
||||||
setCellValue("", row8.createCell(7), font, cellStyleMap.get("green"));
|
setCellValue("", row8.createCell(7), font, cellStyleMap.get("green"));
|
||||||
setCellValue("", row8.createCell(8), font, cellStyleMap.get("green"));
|
setCellValue("", row8.createCell(8), font, cellStyleMap.get("green"));
|
||||||
setCellValue("", row8.createCell(9), font, cellStyleMap.get("green"));
|
setCellValue("", row8.createCell(9), font, cellStyleMap.get("green"));
|
||||||
if(!isHead){
|
// if (!isHead) {
|
||||||
setCellValue("", row8.createCell(10), font,cellStyleMap.get("green"));
|
// setCellValue("", row8.createCell(10), font, cellStyleMap.get("green"));
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
XSSFRow row9 = sheet.createRow(8);
|
XSSFRow row9 = sheet.createRow(8);
|
||||||
|
@ -335,23 +325,23 @@ public class ESBParser extends EsbAbstractParser {
|
||||||
setCellValue("", row9.createCell(1), font, cellStyleMap.get("default"));
|
setCellValue("", row9.createCell(1), font, cellStyleMap.get("default"));
|
||||||
setCellValue("请输入STRING(具体长度) 或 ARRAY", row9.createCell(2), font, cellStyleMap.get("default"));
|
setCellValue("请输入STRING(具体长度) 或 ARRAY", row9.createCell(2), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row9.createCell(3), font, cellStyleMap.get("default"));
|
setCellValue("", row9.createCell(3), font, cellStyleMap.get("default"));
|
||||||
if(isHead){
|
// if (isHead) {
|
||||||
setCellValue("", row9.createCell(4), font, cellStyleMap.get("pop"));
|
setCellValue("", row9.createCell(4), font, cellStyleMap.get("pop"));
|
||||||
setCellValue("", row9.createCell(5), font, cellStyleMap.get("default"));
|
setCellValue("", row9.createCell(5), font, cellStyleMap.get("default"));
|
||||||
setCellValue("请输入STRING(具体长度) 或 ARRAY", row9.createCell(6), font, cellStyleMap.get("default"));
|
setCellValue("请输入STRING(具体长度) 或 ARRAY", row9.createCell(6), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row9.createCell(7), font, cellStyleMap.get("default"));
|
setCellValue("", row9.createCell(7), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row9.createCell(8), font, cellStyleMap.get("default"));
|
setCellValue("", row9.createCell(8), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row9.createCell(9), font, cellStyleMap.get("default"));
|
setCellValue("", row9.createCell(9), font, cellStyleMap.get("default"));
|
||||||
}else {
|
// } else {
|
||||||
setCellValue("", row9.createCell(4), font,cellStyleMap.get("default"));
|
// setCellValue("", row9.createCell(4), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row9.createCell(5), font,cellStyleMap.get("pop"));
|
// setCellValue("", row9.createCell(5), font, cellStyleMap.get("pop"));
|
||||||
setCellValue("", row9.createCell(6), font,cellStyleMap.get("default"));
|
// setCellValue("", row9.createCell(6), font, cellStyleMap.get("default"));
|
||||||
setCellValue("请输入STRING(具体长度) 或 ARRAY", row9.createCell(7), font,cellStyleMap.get("default"));
|
// setCellValue("请输入STRING(具体长度) 或 ARRAY", row9.createCell(7), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row9.createCell(7), font,cellStyleMap.get("default"));
|
// setCellValue("", row9.createCell(7), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row9.createCell(8), font,cellStyleMap.get("default"));
|
// setCellValue("", row9.createCell(8), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row9.createCell(9), font,cellStyleMap.get("default"));
|
// setCellValue("", row9.createCell(9), font, cellStyleMap.get("default"));
|
||||||
setCellValue("", row9.createCell(10), font,cellStyleMap.get("default"));
|
// setCellValue("", row9.createCell(10), font, cellStyleMap.get("default"));
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -368,12 +358,9 @@ public class ESBParser extends EsbAbstractParser {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ApiDefinitionImport parse(InputStream source, ApiTestImportRequest request) throws Exception {
|
public ApiDefinitionImport parse(InputStream source, ApiTestImportRequest request) throws Exception {
|
||||||
EsbSheetDataStruct esbImportDataStruct = new EsbSheetDataStruct();
|
|
||||||
EsbExcelDataStruct excelDataStruct = this.esbImport(source);
|
EsbExcelDataStruct excelDataStruct = this.esbImport(source);
|
||||||
|
|
||||||
this.projectId = request.getProjectId();
|
this.projectId = request.getProjectId();
|
||||||
ApiDefinitionImport definitionImport = this.parseApiDefinitionImport(excelDataStruct, request);
|
ApiDefinitionImport definitionImport = this.parseApiDefinitionImport(excelDataStruct, request);
|
||||||
|
|
||||||
return definitionImport;
|
return definitionImport;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -411,14 +398,14 @@ public class ESBParser extends EsbAbstractParser {
|
||||||
int descIndex = 9;
|
int descIndex = 9;
|
||||||
int apiPositionIndex = 10;
|
int apiPositionIndex = 10;
|
||||||
int cellCount = 11;
|
int cellCount = 11;
|
||||||
if(isHeadSheet){
|
// if (isHeadSheet) {
|
||||||
apiNameIndex = 5;
|
apiNameIndex = 5;
|
||||||
apiDescIndex = 6;
|
apiDescIndex = 6;
|
||||||
chineNameIndex = 7;
|
chineNameIndex = 7;
|
||||||
descIndex = 8;
|
descIndex = 8;
|
||||||
apiPositionIndex = 9;
|
apiPositionIndex = 9;
|
||||||
cellCount = 10;
|
cellCount = 10;
|
||||||
}
|
// }
|
||||||
|
|
||||||
int rowCount = headSheet.getLastRowNum();
|
int rowCount = headSheet.getLastRowNum();
|
||||||
//根据模版样式,如果不是报文头,则要取接口信息
|
//根据模版样式,如果不是报文头,则要取接口信息
|
||||||
|
@ -437,7 +424,7 @@ public class ESBParser extends EsbAbstractParser {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//超过5行为空白,直接退出。
|
//超过10行为空白,直接退出。
|
||||||
//部分office/wpf生成的文件会出现几万多空行,容易造成内存溢出。这里进行判断,连续五行为空白时认为读取结束。
|
//部分office/wpf生成的文件会出现几万多空行,容易造成内存溢出。这里进行判断,连续五行为空白时认为读取结束。
|
||||||
int blankRowCount = 0;
|
int blankRowCount = 0;
|
||||||
boolean isRequest = true;
|
boolean isRequest = true;
|
||||||
|
@ -456,7 +443,7 @@ public class ESBParser extends EsbAbstractParser {
|
||||||
isRequest = false;
|
isRequest = false;
|
||||||
}
|
}
|
||||||
blankRowCount++;
|
blankRowCount++;
|
||||||
if (blankRowCount > 5) {
|
if (blankRowCount > 10) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -618,6 +605,8 @@ public class ESBParser extends EsbAbstractParser {
|
||||||
apiDefinition.setMethod("ESB");
|
apiDefinition.setMethod("ESB");
|
||||||
apiDefinition.setId(apiId);
|
apiDefinition.setId(apiId);
|
||||||
apiDefinition.setProjectId(this.projectId);
|
apiDefinition.setProjectId(this.projectId);
|
||||||
|
apiDefinition.setModuleId(importRequest.getModuleId());
|
||||||
|
apiDefinition.setModulePath(importRequest.getModulePath());
|
||||||
apiDefinition.setRequest(genTCPSampler());
|
apiDefinition.setRequest(genTCPSampler());
|
||||||
if (StringUtils.equalsIgnoreCase("schedule", importRequest.getType())) {
|
if (StringUtils.equalsIgnoreCase("schedule", importRequest.getType())) {
|
||||||
apiDefinition.setUserId(importRequest.getUserId());
|
apiDefinition.setUserId(importRequest.getUserId());
|
||||||
|
|
|
@ -24,6 +24,7 @@ import java.io.FileReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
|
@ -34,6 +35,10 @@ import javax.script.ScriptEngine;
|
||||||
import javax.script.ScriptEngineManager;
|
import javax.script.ScriptEngineManager;
|
||||||
import javax.script.ScriptException;
|
import javax.script.ScriptException;
|
||||||
|
|
||||||
|
import io.metersphere.base.domain.JarConfig;
|
||||||
|
import io.metersphere.commons.utils.CommonBeanFactory;
|
||||||
|
import io.metersphere.commons.utils.LogUtil;
|
||||||
|
import io.metersphere.service.JarConfigService;
|
||||||
import org.apache.commons.codec.digest.DigestUtils;
|
import org.apache.commons.codec.digest.DigestUtils;
|
||||||
import org.apache.commons.collections.map.LRUMap;
|
import org.apache.commons.collections.map.LRUMap;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
@ -45,9 +50,11 @@ import org.apache.jmeter.threads.JMeterContext;
|
||||||
import org.apache.jmeter.threads.JMeterContextService;
|
import org.apache.jmeter.threads.JMeterContextService;
|
||||||
import org.apache.jmeter.threads.JMeterVariables;
|
import org.apache.jmeter.threads.JMeterVariables;
|
||||||
import org.apache.jorphan.util.JOrphanUtils;
|
import org.apache.jorphan.util.JOrphanUtils;
|
||||||
|
import org.codehaus.groovy.jsr223.GroovyScriptEngineImpl;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base class for JSR223 Test elements
|
* Base class for JSR223 Test elements
|
||||||
*
|
*
|
||||||
|
@ -166,6 +173,9 @@ public abstract class JSR223TestElement extends ScriptingTestElement
|
||||||
*/
|
*/
|
||||||
protected Object processFileOrScript(ScriptEngine scriptEngine, final Bindings pBindings)
|
protected Object processFileOrScript(ScriptEngine scriptEngine, final Bindings pBindings)
|
||||||
throws IOException, ScriptException {
|
throws IOException, ScriptException {
|
||||||
|
|
||||||
|
this.loadGroovyJar(scriptEngine);
|
||||||
|
|
||||||
Bindings bindings = pBindings;
|
Bindings bindings = pBindings;
|
||||||
if (bindings == null) {
|
if (bindings == null) {
|
||||||
bindings = scriptEngine.createBindings();
|
bindings = scriptEngine.createBindings();
|
||||||
|
@ -250,6 +260,37 @@ public abstract class JSR223TestElement extends ScriptingTestElement
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* groovy 使用的是自己的类加载器,
|
||||||
|
* 这里再执行脚本前,使用 groovy的加载器加载jar包,
|
||||||
|
* 解决groovy脚本无法使用jar包的问题
|
||||||
|
* @Auth jianxing
|
||||||
|
* @param scriptEngine
|
||||||
|
*/
|
||||||
|
public static void loadGroovyJar(ScriptEngine scriptEngine) {
|
||||||
|
if (scriptEngine instanceof GroovyScriptEngineImpl) {
|
||||||
|
GroovyScriptEngineImpl groovyScriptEngine = (GroovyScriptEngineImpl) scriptEngine;
|
||||||
|
|
||||||
|
JarConfigService jarConfigService = CommonBeanFactory.getBean(JarConfigService.class);
|
||||||
|
List<JarConfig> jars = jarConfigService.list();
|
||||||
|
|
||||||
|
jars.forEach(jarConfig -> {
|
||||||
|
try {
|
||||||
|
String path = jarConfig.getPath();
|
||||||
|
File file = new File(path);
|
||||||
|
if (file.isDirectory() && !path.endsWith("/")) {
|
||||||
|
file = new File(path + "/");
|
||||||
|
}
|
||||||
|
groovyScriptEngine.getClassLoader().addURL(file.toURI().toURL());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
LogUtil.error(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return boolean true if element is not compilable or if compilation succeeds
|
* @return boolean true if element is not compilable or if compilation succeeds
|
||||||
* @throws IOException if script is missing
|
* @throws IOException if script is missing
|
||||||
|
|
|
@ -64,7 +64,7 @@
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="showXpackCompnent&&request.backEsbDataStruct != null">
|
<div v-else-if="showXpackCompnent&&request.backEsbDataStruct != null">
|
||||||
<esb-definition-response :currentProtocol="request.protocol" :request="request" :is-api-component="false"
|
<esb-definition-response v-xpack v-if="showXpackCompnent" :currentProtocol="request.protocol" :request="request" :is-api-component="false"
|
||||||
:show-options-button="false" :show-header="true" :result="request.requestResult"/>
|
:show-options-button="false" :show-header="true" :result="request.requestResult"/>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<el-row :gutter="10" class="json-path-suggest-button">
|
<el-row :gutter="10" class="json-path-suggest-button">
|
||||||
<el-button size="small" type="primary" @click="$emit('open')">
|
<el-button size="small" type="primary" @click="$emit('open')" @click.stop>
|
||||||
{{openTip}}
|
{{openTip}}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button size="small" type="danger" @click="$emit('clear')">
|
<el-button size="small" type="danger" @click="$emit('clear')">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<ms-drawer class="json-path-picker" :visible="visible" :size="30" @close="close" direction="right">
|
<ms-drawer class="json-path-picker" :visible="visible" :size="30" @close="close" direction="right" v-clickoutside="close">
|
||||||
<template v-slot:header>
|
<template v-slot:header>
|
||||||
<ms-instructions-icon :content="tip"/>
|
<ms-instructions-icon :content="tip"/>
|
||||||
{{tip}}
|
{{tip}}
|
||||||
|
@ -13,9 +13,37 @@ import MsDrawer from "../../../../common/components/MsDrawer";
|
||||||
import MsInstructionsIcon from "../../../../common/components/MsInstructionsIcon";
|
import MsInstructionsIcon from "../../../../common/components/MsInstructionsIcon";
|
||||||
|
|
||||||
let dotReplace = "#DOT_MASK#";
|
let dotReplace = "#DOT_MASK#";
|
||||||
|
|
||||||
|
const clickoutside = {
|
||||||
|
// 初始化指令
|
||||||
|
bind (el, binding, vnode) {
|
||||||
|
function documentHandler (e) {
|
||||||
|
// 这里判断点击的元素是否是本身,是本身,则返回
|
||||||
|
if (el.contains(e.target)) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
// 判断指令中是否绑定了函数
|
||||||
|
if (binding.expression) {
|
||||||
|
// 如果绑定了函数 则调用那个函数,此处binding.value就是handleClose方法
|
||||||
|
binding.value(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 给当前元素绑定个私有变量,方便在unbind中可以解除事件监听
|
||||||
|
el.__vueClickOutside__ = documentHandler
|
||||||
|
document.addEventListener('click', documentHandler)
|
||||||
|
},
|
||||||
|
update () { },
|
||||||
|
unbind (el, binding) {
|
||||||
|
// 解除事件监听
|
||||||
|
document.removeEventListener('click', el.__vueClickOutside__)
|
||||||
|
delete el.__vueClickOutside__
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "MsApiJsonpathSuggest",
|
name: "MsApiJsonpathSuggest",
|
||||||
components: {MsInstructionsIcon, MsDrawer},
|
components: {MsInstructionsIcon, MsDrawer},
|
||||||
|
directives: { clickoutside },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
visible: false,
|
visible: false,
|
||||||
|
|
|
@ -95,7 +95,7 @@
|
||||||
<!-- HTTP 请求返回数据 -->
|
<!-- HTTP 请求返回数据 -->
|
||||||
<p class="tip">{{$t('api_test.definition.request.res_param')}}</p>
|
<p class="tip">{{$t('api_test.definition.request.res_param')}}</p>
|
||||||
<div v-if="showXpackCompnent&&api.method==='ESB'">
|
<div v-if="showXpackCompnent&&api.method==='ESB'">
|
||||||
<esb-definition-response :currentProtocol="apiCase.request.protocol" :request="apiCase.request" :is-api-component="false" :show-options-button="false" :show-header="true" :api-item="apiCase"/>
|
<esb-definition-response v-xpack v-if="showXpackCompnent" :currentProtocol="apiCase.request.protocol" :request="apiCase.request" :is-api-component="false" :show-options-button="false" :show-header="true" :api-item="apiCase"/>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<api-response-component :currentProtocol="apiCase.request.protocol" :api-item="apiCase"/>
|
<api-response-component :currentProtocol="apiCase.request.protocol" :api-item="apiCase"/>
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
<p class="tip">{{ $t('api_test.definition.request.req_param') }} </p>
|
<p class="tip">{{ $t('api_test.definition.request.req_param') }} </p>
|
||||||
<esb-definition v-xpack v-if="showXpackCompnent" :show-script="false" :request="request" ref="esbDefinition"/>
|
<esb-definition v-xpack v-if="showXpackCompnent" :show-script="false" :request="request" ref="esbDefinition"/>
|
||||||
<p class="tip">{{$t('api_test.definition.request.res_param')}}</p>
|
<p class="tip">{{$t('api_test.definition.request.res_param')}}</p>
|
||||||
<esb-definition-response :is-api-component="true" :show-options-button="true" :request="request" />
|
<esb-definition-response v-xpack v-if="showXpackCompnent" :is-api-component="true" :show-options-button="true" :request="request" />
|
||||||
<!-- <api-response-component :currentProtocol="apiCase.request.protocol" :api-item="apiCase"/>-->
|
<!-- <api-response-component :currentProtocol="apiCase.request.protocol" :api-item="apiCase"/>-->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -428,11 +428,12 @@ export default {
|
||||||
var returnData = data;
|
var returnData = data;
|
||||||
if (data) {
|
if (data) {
|
||||||
|
|
||||||
if(dataType === 'XML'){
|
// if(dataType === 'XML'){
|
||||||
|
// returnData = "<xmp>"+returnData+"</xmp>";
|
||||||
|
// }else {
|
||||||
|
//
|
||||||
|
// }
|
||||||
returnData = "<xmp>"+returnData+"</xmp>";
|
returnData = "<xmp>"+returnData+"</xmp>";
|
||||||
}else{
|
|
||||||
returnData = data.replace(/\n/g, '<br>');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return returnData;
|
return returnData;
|
||||||
},
|
},
|
||||||
|
|
|
@ -97,7 +97,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import MsDialogFooter from "../../../../common/components/MsDialogFooter";
|
import MsDialogFooter from "../../../../common/components/MsDialogFooter";
|
||||||
import {listenGoBack, removeGoBackListener} from "@/common/js/utils";
|
import {listenGoBack, removeGoBackListener,hasLicense} from "@/common/js/utils";
|
||||||
import ScheduleImport from "@/business/components/api/definition/components/import/ImportScheduleEdit";
|
import ScheduleImport from "@/business/components/api/definition/components/import/ImportScheduleEdit";
|
||||||
import MsSelectTree from "../../../../common/select-tree/SelectTree";
|
import MsSelectTree from "../../../../common/select-tree/SelectTree";
|
||||||
|
|
||||||
|
@ -122,6 +122,7 @@
|
||||||
swaggerUrlEnable: false,
|
swaggerUrlEnable: false,
|
||||||
swaggerSynchronization: false,
|
swaggerSynchronization: false,
|
||||||
showEnvironmentSelect: true,
|
showEnvironmentSelect: true,
|
||||||
|
showXpackCompnent:false,
|
||||||
moduleObj: {
|
moduleObj: {
|
||||||
id: 'id',
|
id: 'id',
|
||||||
label: 'name',
|
label: 'name',
|
||||||
|
@ -228,7 +229,9 @@
|
||||||
this.platforms.splice(this.platforms.indexOf(this.esbPlanform), 1);
|
this.platforms.splice(this.platforms.indexOf(this.esbPlanform), 1);
|
||||||
}
|
}
|
||||||
if (this.propotal === 'TCP') {
|
if (this.propotal === 'TCP') {
|
||||||
|
if(hasLicense()){
|
||||||
this.platforms.push(this.esbPlanform);
|
this.platforms.push(this.esbPlanform);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
} else if (this.propotal === 'HTTP') {
|
} else if (this.propotal === 'HTTP') {
|
||||||
this.platforms.push(this.postmanPlanform);
|
this.platforms.push(this.postmanPlanform);
|
||||||
|
|
|
@ -454,14 +454,18 @@
|
||||||
item.tags = JSON.parse(item.tags);
|
item.tags = JSON.parse(item.tags);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (this.$refs.apiDefinitionTable) {
|
// if (this.$refs.apiDefinitionTable) {
|
||||||
setTimeout(() => {
|
// setTimeout(() => {
|
||||||
this.$refs.apiDefinitionTable.doLayout();
|
// this.$refs.apiDefinitionTable.doLayout();
|
||||||
this.result.loading = false;
|
// this.result.loading = false;
|
||||||
}, 500)
|
// }, 500)
|
||||||
}
|
// }
|
||||||
// nexttick:表格加载完成之后触发。判断是否需要勾选行
|
// nexttick:表格加载完成之后触发。判断是否需要勾选行
|
||||||
this.$nextTick(function(){
|
this.$nextTick(function(){
|
||||||
|
if (this.$refs.apiDefinitionTable) {
|
||||||
|
this.$refs.apiDefinitionTable.doLayout();
|
||||||
|
this.result.loading = false;
|
||||||
|
}
|
||||||
this.checkTableRowIsSelect();
|
this.checkTableRowIsSelect();
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue