317 changed files with 19557 additions and 13230 deletions
@ -1,4 +1,4 @@ |
|||
[ |
|||
"io.sc.creditreport.core.company.Document", |
|||
"io.sc.creditreport.core.person.Document" |
|||
] |
|||
{ "type": "JAVA_CLASS", "order": 1000, "id": "io.sc.creditreport.core.company.Document", "parent": "re.dictionary.category.engine", "code": "io.sc.creditreport.core.company.Document", "nameI18nKey": "io.sc.creditreport.core.company.Document", "description": "企业征信报告", "version": 2}, |
|||
{ "type": "JAVA_CLASS", "order": 2000, "id": "io.sc.creditreport.core.person.Document", "parent": "re.dictionary.category.engine", "code": "io.sc.creditreport.core.person.Document", "nameI18nKey": "io.sc.creditreport.core.person.Document", "description": "企业征信报告", "version": 2} |
|||
] |
|||
|
@ -0,0 +1,18 @@ |
|||
[ |
|||
{ |
|||
"name" : "parseCompanyCreditReport", |
|||
"signature" : "parseCompanyCreditReport(xml)", |
|||
"description" : "将 xml 解析成征信报告对象(企业)", |
|||
"enable" : true, |
|||
"mathXml" : "<mspace></mspace>\n<mrow>\n <mo>parseCompanyCreditReport</mo>\n <mi>(</mi>\n <mspace></mspace>\n <mi>xml</mi>\n <mspace></mspace>\n <mi>)</mi>\n</mrow>\n<mspace></mspace>", |
|||
"body" : "def parseCompanyCreditReport(String xml){\n return io.sc.creditreport.core.CreditReportParser.parseCompanyCreditReport(xml);\n}" |
|||
}, |
|||
{ |
|||
"name" : "parsePersonCreditReport", |
|||
"signature" : "parsePersonCreditReport(xml)", |
|||
"description" : "将 xml 解析成征信报告对象(个人)", |
|||
"enable" : true, |
|||
"mathXml" : "<mspace></mspace>\n<mrow>\n <mo>parsePersonCreditReport</mo>\n <mi>(</mi>\n <mspace></mspace>\n <mi>xml</mi>\n <mspace></mspace>\n <mi>)</mi>\n</mrow>\n<mspace></mspace>", |
|||
"body" : "def parsePersonCreditReport(String xml){\n return io.sc.creditreport.core.CreditReportParser.parsePersonCreditReport(xml);\n}" |
|||
} |
|||
] |
@ -1,213 +0,0 @@ |
|||
package io.sc.engine.rule.core.enums; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.math.BigInteger; |
|||
import java.util.Calendar; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
import io.sc.engine.rule.core.classes.ResourceAbstract; |
|||
import io.sc.engine.rule.core.classes.RuleResult; |
|||
import io.sc.engine.rule.core.classes.SingleRuleResult; |
|||
import io.sc.engine.rule.core.util.DateUtil; |
|||
import io.sc.engine.rule.core.util.JacksonObjectMapper; |
|||
|
|||
import com.fasterxml.jackson.core.JsonProcessingException; |
|||
|
|||
/** |
|||
* 值类型 |
|||
* @author wangshaoping |
|||
* |
|||
*/ |
|||
public enum ValueType { |
|||
Boolean, //布尔
|
|||
Long, //整数
|
|||
Float, //浮点数
|
|||
Decimal, //小数
|
|||
String, //字符串
|
|||
Date, //日期
|
|||
List, //列表
|
|||
Map, //字典
|
|||
RuleResult, //规则结果值
|
|||
SingleRuleResult, //单规则结果值
|
|||
ResourceAbstract; //资源摘要
|
|||
|
|||
public static boolean isBase(Object o){ |
|||
if(o==null){ |
|||
return true; |
|||
} |
|||
return isBase(o.getClass()); |
|||
} |
|||
|
|||
public static boolean isBase(Class<?> clazz){ |
|||
if(clazz.isPrimitive()){ |
|||
return true; |
|||
} |
|||
if( |
|||
Byte.class.equals(clazz) |
|||
|| Short.class.equals(clazz) |
|||
|| Integer.class.equals(clazz) |
|||
|| BigInteger.class.equals(clazz) |
|||
|| Long.class.equals(clazz) |
|||
|| Float.class.equals(clazz) |
|||
|| Double.class.equals(clazz) |
|||
|| BigDecimal.class.equals(clazz) |
|||
|| String.class.equals(clazz) |
|||
|| Calendar.class.equals(clazz) |
|||
|| Date.class.equals(clazz) |
|||
){ |
|||
return true; |
|||
} |
|||
return false; |
|||
} |
|||
|
|||
public static boolean isList(Class<?> clazz){ |
|||
return List.class.isAssignableFrom(clazz); |
|||
} |
|||
|
|||
public static boolean isMap(Class<?> clazz){ |
|||
return Map.class.isAssignableFrom(clazz); |
|||
} |
|||
|
|||
public String getJavaType() { |
|||
switch(this) { |
|||
case Boolean: |
|||
return "java.lang.Boolean"; |
|||
case Long: |
|||
return "java.lang.Long"; |
|||
case Float: |
|||
return "java.lang.Float"; |
|||
case Decimal: |
|||
return "java.math.BigDecimal"; |
|||
case String: |
|||
return "java.lang.String"; |
|||
case Date: |
|||
return "java.util.Date"; |
|||
case List: |
|||
return "java.util.List"; |
|||
case Map: |
|||
return "java.util.Map"; |
|||
case RuleResult: |
|||
return "io.sc.engine.rule.core.classes.RuleResult"; |
|||
case SingleRuleResult: |
|||
return "io.sc.engine.rule.core.classes.SingleRuleResult"; |
|||
case ResourceAbstract: |
|||
return "io.sc.engine.rule.core.classes.ResourceAbstract"; |
|||
default: |
|||
return this.toString(); |
|||
} |
|||
} |
|||
|
|||
public String getSimpleJavaType() { |
|||
switch(this) { |
|||
case Boolean: |
|||
return "Boolean"; |
|||
case Long: |
|||
return "Long"; |
|||
case Float: |
|||
return "Float"; |
|||
case Decimal: |
|||
return "BigDecimal"; |
|||
case String: |
|||
return "String"; |
|||
case Date: |
|||
return "Date"; |
|||
case List: |
|||
return "List"; |
|||
case Map: |
|||
return "Map"; |
|||
case RuleResult: |
|||
return "RuleResult"; |
|||
case SingleRuleResult: |
|||
return "SingleRuleResult"; |
|||
case ResourceAbstract: |
|||
return "ResourceAbstract"; |
|||
default: |
|||
return this.toString(); |
|||
} |
|||
} |
|||
|
|||
public static String getSimpleJavaType(String type) { |
|||
if(Boolean.getJavaType().equals(type)) { |
|||
return Boolean.getSimpleJavaType(); |
|||
}else if(Long.getJavaType().equals(type)) { |
|||
return Long.getSimpleJavaType(); |
|||
}else if(Float.getJavaType().equals(type)) { |
|||
return Float.getSimpleJavaType(); |
|||
}else if(Decimal.getJavaType().equals(type)) { |
|||
return Decimal.getSimpleJavaType(); |
|||
}else if(String.getJavaType().equals(type)) { |
|||
return String.getSimpleJavaType(); |
|||
}else if(Date.getJavaType().equals(type)) { |
|||
return Date.getSimpleJavaType(); |
|||
}else if(List.getJavaType().equals(type)) { |
|||
return List.getSimpleJavaType(); |
|||
}else if(Map.getJavaType().equals(type)) { |
|||
return Map.getSimpleJavaType(); |
|||
}else if(RuleResult.getJavaType().equals(type)) { |
|||
return RuleResult.getSimpleJavaType(); |
|||
}else if(SingleRuleResult.getJavaType().equals(type)) { |
|||
return SingleRuleResult.getSimpleJavaType(); |
|||
}else if(ResourceAbstract.getJavaType().equals(type)) { |
|||
return ResourceAbstract.getSimpleJavaType(); |
|||
}else { |
|||
return type; |
|||
} |
|||
} |
|||
|
|||
public static boolean isBaseType(String type) { |
|||
if( |
|||
Boolean.getJavaType().equals(type) || Boolean.getSimpleJavaType().equals(type) |
|||
|| Long.getJavaType().equals(type) || Long.getSimpleJavaType().equals(type) |
|||
|| Float.getJavaType().equals(type) || Float.getSimpleJavaType().equals(type) |
|||
|| Decimal.getJavaType().equals(type) || Decimal.getSimpleJavaType().equals(type) |
|||
|| String.getJavaType().equals(type) || String.getSimpleJavaType().equals(type) |
|||
|| Date.getJavaType().equals(type)|| Date.getSimpleJavaType().equals(type) |
|||
|| List.getJavaType().equals(type)|| List.getSimpleJavaType().equals(type) |
|||
|| Map.getJavaType().equals(type)|| Map.getSimpleJavaType().equals(type) |
|||
|| RuleResult.getJavaType().equals(type)|| RuleResult.getSimpleJavaType().equals(type) |
|||
|| SingleRuleResult.getJavaType().equals(type)|| SingleRuleResult.getSimpleJavaType().equals(type) |
|||
|| ResourceAbstract.getJavaType().equals(type)|| ResourceAbstract.getSimpleJavaType().equals(type) |
|||
) { |
|||
return true; |
|||
} |
|||
return false; |
|||
} |
|||
|
|||
public static String generateSampleValue(String type) { |
|||
if(Boolean.getJavaType().equals(type)) { |
|||
return "true"; |
|||
}else if(Long.getJavaType().equals(type)) { |
|||
return "1"; |
|||
}else if(Float.getJavaType().equals(type)) { |
|||
return "1.0"; |
|||
}else if(Decimal.getJavaType().equals(type)) { |
|||
return "1.0"; |
|||
}else if(String.getJavaType().equals(type)) { |
|||
return "\"string\""; |
|||
}else if(Date.getJavaType().equals(type)) { |
|||
return "\"" + DateUtil.formatDate(new Date(), DateUtil.yyyy_MM_dd_HH_mm_ss) + "\""; |
|||
}else if(List.getJavaType().equals(type)) { |
|||
return "new ArrayList<Object>()"; |
|||
}else if(Map.getJavaType().equals(type)) { |
|||
return "new LinkedHashMap<String,Object>()"; |
|||
}else if(RuleResult.getJavaType().equals(type)) { |
|||
try { |
|||
return JacksonObjectMapper.getDefaultObjectMapper().writeValueAsString(new RuleResult()); |
|||
} catch (JsonProcessingException e) { |
|||
} |
|||
}else if(SingleRuleResult.getJavaType().equals(type)) { |
|||
try { |
|||
return JacksonObjectMapper.getDefaultObjectMapper().writeValueAsString(new SingleRuleResult()); |
|||
} catch (JsonProcessingException e) { |
|||
} |
|||
}else if(ResourceAbstract.getJavaType().equals(type)) { |
|||
try { |
|||
return JacksonObjectMapper.getDefaultObjectMapper().writeValueAsString(new ResourceAbstract()); |
|||
} catch (JsonProcessingException e) { |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
} |
@ -1,47 +0,0 @@ |
|||
package io.sc.engine.rule.core.po.resource; |
|||
|
|||
import java.util.Date; |
|||
|
|||
import io.sc.engine.rule.core.enums.DeployStatus; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
|||
|
|||
@JsonIgnoreProperties(ignoreUnknown=true) |
|||
public abstract class ReleasableResource extends Resource{ |
|||
protected DeployStatus status; //状态
|
|||
protected Integer version; //版本
|
|||
protected Date effectiveDate; //生效日期
|
|||
protected String imports; //imports
|
|||
|
|||
public DeployStatus getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(DeployStatus status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
public Integer getVersion() { |
|||
return version; |
|||
} |
|||
|
|||
public void setVersion(Integer version) { |
|||
this.version = version; |
|||
} |
|||
|
|||
public Date getEffectiveDate() { |
|||
return effectiveDate; |
|||
} |
|||
|
|||
public void setEffectiveDate(Date effectiveDate) { |
|||
this.effectiveDate = effectiveDate; |
|||
} |
|||
|
|||
public String getImports() { |
|||
return imports; |
|||
} |
|||
|
|||
public void setImports(String imports) { |
|||
this.imports = imports; |
|||
} |
|||
} |
@ -1,15 +0,0 @@ |
|||
package io.sc.engine.rule.core.po.testcase; |
|||
|
|||
import io.sc.engine.rule.core.enums.TestCaseOwnerType; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
|||
import com.fasterxml.jackson.annotation.JsonTypeName; |
|||
|
|||
@JsonTypeName("SCORE_CARD") |
|||
@JsonIgnoreProperties(ignoreUnknown=true) |
|||
public class ScoreCardTestCase extends ResourceTestCase{ |
|||
@Override |
|||
public TestCaseOwnerType getType() { |
|||
return TestCaseOwnerType.SCORE_CARD; |
|||
} |
|||
} |
@ -0,0 +1,66 @@ |
|||
package io.sc.engine.rule.core.util; |
|||
|
|||
import org.springframework.util.StringUtils; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.math.BigInteger; |
|||
import java.util.*; |
|||
|
|||
public class ValueTypeUtil { |
|||
private static final Map<String,Class<?>> BASE_CLASS_MAP = new HashMap<>(); |
|||
|
|||
static { |
|||
BASE_CLASS_MAP.put(Boolean.class.getName(),Boolean.class); |
|||
BASE_CLASS_MAP.put(Byte.class.getName(),Byte.class); |
|||
BASE_CLASS_MAP.put(Character.class.getName(),Character.class); |
|||
BASE_CLASS_MAP.put(Short.class.getName(),Short.class); |
|||
BASE_CLASS_MAP.put(Integer.class.getName(),Integer.class); |
|||
BASE_CLASS_MAP.put(Long.class.getName(),Long.class); |
|||
BASE_CLASS_MAP.put(Float.class.getName(),Float.class); |
|||
BASE_CLASS_MAP.put(Double.class.getName(),Double.class); |
|||
BASE_CLASS_MAP.put(BigInteger.class.getName(),BigInteger.class); |
|||
BASE_CLASS_MAP.put(BigDecimal.class.getName(),BigDecimal.class); |
|||
|
|||
BASE_CLASS_MAP.put(String.class.getName(),String.class); |
|||
BASE_CLASS_MAP.put(Date.class.getName(),Date.class); |
|||
BASE_CLASS_MAP.put(Calendar.class.getName(),Calendar.class); |
|||
|
|||
} |
|||
|
|||
public static boolean isBase(Class<?> type){ |
|||
return isBase(type.getName()); |
|||
} |
|||
|
|||
public static boolean isBase(String type){ |
|||
return BASE_CLASS_MAP.containsKey(type); |
|||
} |
|||
|
|||
public static boolean isList(Class<?> clazz){ |
|||
return List.class.isAssignableFrom(clazz); |
|||
} |
|||
|
|||
public static boolean isMap(Class<?> clazz){ |
|||
return Map.class.isAssignableFrom(clazz); |
|||
} |
|||
|
|||
public static String generateSampleValue(String type) { |
|||
if(Boolean.class.getName().equals(type)) { |
|||
return "true"; |
|||
}else if(Long.class.getName().equals(type)) { |
|||
return "1"; |
|||
}else if(Float.class.getName().equals(type)) { |
|||
return "1.0"; |
|||
}else if(BigDecimal.class.getName().equals(type)) { |
|||
return "1.0"; |
|||
}else if(String.class.getName().equals(type)) { |
|||
return "\"string\""; |
|||
}else if(Date.class.getName().equals(type)) { |
|||
return "\"" + DateUtil.formatDate(new Date(), DateUtil.yyyy_MM_dd_HH_mm_ss) + "\""; |
|||
}else if(List.class.getName().equals(type)) { |
|||
return "new ArrayList<Object>()"; |
|||
}else if(Map.class.getName().equals(type)) { |
|||
return "new LinkedHashMap<String,Object>()"; |
|||
} |
|||
return null; |
|||
} |
|||
} |
@ -0,0 +1,16 @@ |
|||
[ |
|||
{ "type": "FOLDER", "order": 1000, "id": "re.dictionary.category.base", "parent": null, "code": "re.dictionary.category.base", "nameI18nKey": "re.dictionary.category.base", "description": "基本类型", "version": null}, |
|||
{ "type": "JAVA_CLASS", "order": 100, "id": "java.lang.Boolean", "parent": "re.dictionary.category.base", "code": "java.lang.Boolean", "nameI18nKey": "java.lang.Boolean", "description": "布尔类型", "version": null}, |
|||
{ "type": "JAVA_CLASS", "order": 200, "id": "java.lang.Long", "parent": "re.dictionary.category.base", "code": "java.lang.Long", "nameI18nKey": "java.lang.Long", "description": "整数类型", "version": null}, |
|||
{ "type": "JAVA_CLASS", "order": 300, "id": "java.lang.Float", "parent": "re.dictionary.category.base", "code": "java.lang.Float", "nameI18nKey": "java.lang.Float", "description": "浮点数类型", "version": null}, |
|||
{ "type": "JAVA_CLASS", "order": 400, "id": "java.math.BigDecimal", "parent": "re.dictionary.category.base", "code": "java.math.BigDecimal", "nameI18nKey": "java.math.BigDecimal", "description": "小数类型", "version": null}, |
|||
{ "type": "JAVA_CLASS", "order": 500, "id": "java.lang.String", "parent": "re.dictionary.category.base", "code": "java.lang.String", "nameI18nKey": "java.lang.String", "description": "字符串类型", "version": null}, |
|||
{ "type": "JAVA_CLASS", "order": 600, "id": "java.util.Date", "parent": "re.dictionary.category.base", "code": "java.util.Date", "nameI18nKey": "java.util.Date", "description": "日期类型", "version": null}, |
|||
{ "type": "JAVA_CLASS", "order": 700, "id": "java.util.List", "parent": "re.dictionary.category.base", "code": "java.util.List", "nameI18nKey": "java.util.List", "description": "列表类型", "version": null}, |
|||
{ "type": "JAVA_CLASS", "order": 800, "id": "java.util.Map", "parent": "re.dictionary.category.base", "code": "java.util.Map", "nameI18nKey": "java.util.Map", "description": "字典类型", "version": null}, |
|||
{ "type": "FOLDER", "order": 2000, "id": "re.dictionary.category.engine", "parent": null, "code": "re.dictionary.category.engine", "nameI18nKey": "re.dictionary.category.engine", "description": "引擎内置类型", "version": null}, |
|||
{ "type": "JAVA_CLASS", "order": 100, "id": "io.sc.engine.rule.core.classes.ResourceAbstract", "parent": "re.dictionary.category.engine", "code": "io.sc.engine.rule.core.classes.ResourceAbstract", "nameI18nKey": "io.sc.engine.rule.core.classes.ResourceAbstract", "description": "资源摘要", "version": null}, |
|||
{ "type": "JAVA_CLASS", "order": 200, "id": "io.sc.engine.rule.core.classes.RuleResult", "parent": "re.dictionary.category.engine", "code": "io.sc.engine.rule.core.classes.RuleResult", "nameI18nKey": "io.sc.engine.rule.core.classes.RuleResult", "description": "规则集结果", "version": null}, |
|||
{ "type": "JAVA_CLASS", "order": 300, "id": "io.sc.engine.rule.core.classes.SingleRuleResult", "parent": "re.dictionary.category.engine", "code": "io.sc.engine.rule.core.classes.SingleRuleResult", "nameI18nKey": "io.sc.engine.rule.core.classes.SingleRuleResult", "description": "单规则结果", "version": null}, |
|||
{ "type": "FOLDER", "order": 3000, "id": "re.dictionary.category.customization", "parent": null, "code": "re.dictionary.category.customization", "nameI18nKey": "re.dictionary.category.customization", "description": "用户自定义类型", "version": null} |
|||
] |
@ -0,0 +1,3 @@ |
|||
re.dictionary.category.base=Base |
|||
re.dictionary.category.engine=Engine |
|||
re.dictionary.category.customization=User Customization |
@ -0,0 +1,3 @@ |
|||
re.dictionary.category.base=\u57FA\u672C\u985E\u578B |
|||
re.dictionary.category.engine=\u5F15\u64CE\u5167\u7F6E\u985E\u578B |
|||
re.dictionary.category.customization=\u7528\u6236\u81EA\u5B9A\u7FA9\u985E\u578B |
@ -0,0 +1,3 @@ |
|||
re.dictionary.category.base=\u57FA\u672C\u7C7B\u578B |
|||
re.dictionary.category.engine=\u5F15\u64CE\u5185\u7F6E\u7C7B\u578B |
|||
re.dictionary.category.customization=\u7528\u6237\u81EA\u5B9A\u4E49\u7C7B\u578B |
@ -1,25 +0,0 @@ |
|||
import { Tools } from 'platform-core'; |
|||
|
|||
const PassOrNotFormater = (value) => { |
|||
if (Tools.isUndefinedOrNull(value)) { |
|||
return ''; |
|||
} |
|||
if (value === 'PASSED') { |
|||
return { |
|||
componentType: 'QIcon', |
|||
attrs: { name: 'bi-check-circle', size: '20px', color: 'green' }, |
|||
}; |
|||
} else if (value === 'UN_PASSED') { |
|||
return { |
|||
componentType: 'QIcon', |
|||
attrs: { name: 'bi-x-circle', size: '20px', color: 'red' }, |
|||
}; |
|||
} else if (value === 'ERROR') { |
|||
return { |
|||
componentType: 'QIcon', |
|||
attrs: { name: 'bi-x-circle', size: '20px', color: 'red' }, |
|||
}; |
|||
} |
|||
}; |
|||
|
|||
export default PassOrNotFormater; |
@ -1,155 +0,0 @@ |
|||
<template> |
|||
<w-grid |
|||
ref="gridRef" |
|||
:title="$t('re.resources.designer.testCase.grid.title')" |
|||
dense-body |
|||
class="px-1" |
|||
hide-bottom |
|||
:config-button="false" |
|||
selection="multiple" |
|||
:checkbox-selection="false" |
|||
:tree="false" |
|||
:fetch-data-url="Environment.apiContextPath('/api/re/testCase/findByOwnerId?ownerId=' + lib.id)" |
|||
:data-url="Environment.apiContextPath('/api/re/testCase')" |
|||
:pageable="false" |
|||
:toolbar-configure="{ noIcon: false }" |
|||
:toolbar-actions="[ |
|||
'refresh', |
|||
'separator', |
|||
'add', |
|||
'clone', |
|||
{ |
|||
extend: 'clone', |
|||
name: 'deepClone', |
|||
label: $t('deepClone'), |
|||
icon: 'bi-copy', |
|||
click: (arg) => { |
|||
axios.post(Environment.apiContextPath('/api/re/testCase/deepClone/' + arg.selected.id), {}, { loading: true }).then((response) => { |
|||
gridRef.refresh(); |
|||
}); |
|||
}, |
|||
}, |
|||
'edit', |
|||
'remove', |
|||
'separator', |
|||
{ |
|||
name: 'execute', |
|||
label: $t('execute'), |
|||
icon: 'bi-caret-right', |
|||
click: (arg) => { |
|||
axios.post(Environment.apiContextPath('/api/re/testCase/executeTestCase/' + arg.selected.id), {}, { loading: true }).then((response) => { |
|||
gridRef.refresh(); |
|||
}); |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'executeAll', |
|||
label: $t('executeAll'), |
|||
icon: 'bi-caret-right-fill', |
|||
click: (arg) => { |
|||
axios.post(Environment.apiContextPath('/api/re/testCase/executeAllLibTestCase/' + lib.id), {}, { loading: true }).then((response) => { |
|||
gridRef.refresh(); |
|||
}); |
|||
}, |
|||
}, |
|||
'separator', |
|||
'view', |
|||
'separator', |
|||
'export', |
|||
]" |
|||
:columns="[ |
|||
{ width: 50, name: 'order', label: $t('order'), showIf: false }, |
|||
{ width: 100, name: 'id', label: $t('id'), showIf: false }, |
|||
{ |
|||
width: 80, |
|||
name: 'testResult', |
|||
label: $t('re.resources.designer.testCase.grid.entity.testResult'), |
|||
align: 'center', |
|||
sortable: false, |
|||
format: PassOrNotFormater, |
|||
}, |
|||
{ width: 150, name: 'lastTestDate', label: $t('re.resources.designer.testCase.grid.entity.lastTestDate') }, |
|||
{ width: 200, name: 'name', label: $t('name') }, |
|||
{ width: '100%', name: 'description', label: $t('description') }, |
|||
]" |
|||
:editor="{ |
|||
dialog: { |
|||
width: '600px', |
|||
height: '250px', |
|||
}, |
|||
form: { |
|||
colsNum: 1, |
|||
fields: [ |
|||
{ name: 'order', label: $t('order'), type: 'w-text', showIf: false }, |
|||
{ name: 'id', label: $t('id'), type: 'w-text', showIf: false }, |
|||
{ name: 'ownerType', label: $t('ownerType'), type: 'w-text', defaultValue: 'LIB', showIf: false }, |
|||
{ name: 'owner', label: $t('owner'), type: 'w-text', defaultValue: lib.id, showIf: false }, |
|||
{ name: 'name', label: $t('name'), type: 'w-text', requiredIf: true }, |
|||
{ name: 'description', label: $t('description'), type: 'w-text' }, |
|||
], |
|||
}, |
|||
}" |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'order', label: $t('order') }, |
|||
{ name: 'id', label: $t('id') }, |
|||
{ name: 'name', label: $t('name') }, |
|||
{ name: 'description', label: $t('description') }, |
|||
|
|||
{ name: 'dataComeFrom', label: $t('dataComeFrom') }, |
|||
{ name: 'creator', label: $t('creator') }, |
|||
{ name: 'createDate', label: $t('createDate') }, |
|||
{ name: 'lastModifier', label: $t('lastModifier') }, |
|||
{ name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.none() }, |
|||
{ name: 'corporationCode', label: $t('corporationCode') }, |
|||
], |
|||
}, |
|||
}" |
|||
v-bind="attrs" |
|||
></w-grid> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import 'tailwindcss/utilities.css'; |
|||
import { onMounted, ref, useAttrs } from 'vue'; |
|||
import { axios, Environment, EnumTools, Formater, Options, Tools } from 'platform-core'; |
|||
import PassOrNotFormater from '@/utils/PassOrNotFormater'; |
|||
|
|||
const attrs = useAttrs(); |
|||
|
|||
const props = defineProps({ |
|||
lib: { type: Object, default: undefined }, |
|||
}); |
|||
|
|||
const gridRef = ref(); |
|||
|
|||
const refresh = () => { |
|||
gridRef?.value?.refresh(); |
|||
}; |
|||
|
|||
onMounted(() => { |
|||
gridRef?.value?.refresh(); |
|||
}); |
|||
|
|||
defineExpose({ |
|||
refresh, |
|||
}); |
|||
|
|||
const Enums = await EnumTools.fetch([ |
|||
'io.sc.platform.core.enums.RoundingMode', |
|||
'io.sc.engine.rule.core.enums.ParameterType', |
|||
'io.sc.engine.rule.core.enums.DeployStatus', |
|||
]); |
|||
let ValueTypeMap = {}; |
|||
let ValueTypeList = []; |
|||
const response = await axios.get(Environment.apiContextPath('/api/re/dictionary/getAllDictionaryMap')); |
|||
if (response && response.data) { |
|||
ValueTypeMap = {}; |
|||
ValueTypeList = []; |
|||
response.data.forEach((item) => { |
|||
ValueTypeMap[item.key] = item.value; |
|||
ValueTypeList.push({ value: item.key, label: item.value }); |
|||
}); |
|||
} |
|||
</script> |
@ -1,210 +0,0 @@ |
|||
<template> |
|||
<w-grid |
|||
ref="gridRef" |
|||
:title="$t('re.resources.designer.testCaseParameter.grid.title')" |
|||
dense-body |
|||
class="px-1" |
|||
hide-bottom |
|||
:config-button="false" |
|||
selection="multiple" |
|||
:checkbox-selection="false" |
|||
:tree="false" |
|||
:tree-icon=" |
|||
(row) => { |
|||
if (row.category === 'M') { |
|||
return { name: 'folder', color: 'amber' }; |
|||
} else { |
|||
return { name: 'bi-p-circle' }; |
|||
} |
|||
} |
|||
" |
|||
db-click-operation="edit" |
|||
:fetch-data-url="Environment.apiContextPath('/api/re/testCaseParameter/findByTestCase?testCaseId=' + testCase.id)" |
|||
:data-url="Environment.apiContextPath('/api/re/testCaseParameter')" |
|||
:pageable="false" |
|||
:toolbar-configure="{ noIcon: false }" |
|||
:toolbar-actions="[ |
|||
'refresh', |
|||
'separator', |
|||
{ |
|||
extend: 'edit', |
|||
}, |
|||
'separator', |
|||
{ |
|||
name: 'execute', |
|||
label: $t('execute'), |
|||
icon: 'bi-caret-right', |
|||
click: () => { |
|||
axios.post(Environment.apiContextPath('/api/re/testCase/executeTestCase/' + testCase.id), {}, { loading: true }).then(() => { |
|||
gridRef?.refresh(); |
|||
}); |
|||
}, |
|||
}, |
|||
'separator', |
|||
'view', |
|||
'separator', |
|||
'export', |
|||
]" |
|||
:columns="[ |
|||
{ width: 300, name: 'name', label: $t('name') }, |
|||
{ width: 100, name: 'indicatorType', label: $t('type'), format: Formater.enum(Enums.IndicatorType) }, |
|||
{ |
|||
width: 100, |
|||
name: 'valueType', |
|||
label: $t('re.resources.designer.parameter.grid.entity.valueType'), |
|||
format: (value, row) => { |
|||
return ValueTypeMap[value]; |
|||
// if (row.valueTypeVersion) { |
|||
// return ValueTypeMap[value] + ' (V' + row.valueTypeVersion + ')'; |
|||
// } |
|||
// if (row.valueType == 'java.math.BigDecimal') { |
|||
// if (row.valueRoundingMode == 'HALF_UP') { |
|||
// return ValueTypeMap[value] + '(' + row.valueScale + ')'; |
|||
// } else { |
|||
// return ValueTypeMap[value] + '(' + row.valueScale + ',' + Formater.enum(Enums.RoundingMode)(row.valueRoundingMode) + ')'; |
|||
// } |
|||
// } |
|||
// var result = ValueTypeMap[value]; |
|||
// result = result || row.valueType; |
|||
// if (result) { |
|||
// result = result.replace('<', '<'); |
|||
// result = result.replace('>', '>'); |
|||
// } |
|||
// return result; |
|||
}, |
|||
}, |
|||
{ width: 100, name: 'defaultValue', label: $t('defaultValue') }, |
|||
{ width: 100, name: 'inputValue', label: $t('re.resources.designer.testCaseParameter.grid.entity.inputValue') }, |
|||
{ width: 100, name: 'expectValue', label: $t('re.resources.designer.testCaseParameter.grid.entity.expectValue') }, |
|||
{ width: 100, name: 'resultValue', label: $t('re.resources.designer.testCaseParameter.grid.entity.resultValue') }, |
|||
{ width: 100, name: 'skipCheck', label: $t('re.resources.designer.testCaseParameter.grid.entity.skipCheck') }, |
|||
{ width: 100, name: 'testResult', label: $t('re.resources.designer.testCaseParameter.grid.entity.testResult'), format: PassOrNotFormater }, |
|||
]" |
|||
:editor="{ |
|||
dialog: { |
|||
width: '600px', |
|||
}, |
|||
form: { |
|||
colsNum: 1, |
|||
fields: [ |
|||
{ name: 'testCase', label: $t('testCase'), type: 'w-text', defaultValue: testCase.id, showIf: false }, |
|||
{ name: 'id', label: $t('id'), type: 'w-text', showIf: false }, |
|||
{ name: 'source', label: $t('source'), type: 'w-text', showIf: false }, |
|||
{ name: 'parameterType', label: $t('parameterType'), type: 'w-text', showIf: false }, |
|||
{ name: 'scoreCardVarType', label: $t('scoreCardVarType'), type: 'w-text', showIf: false }, |
|||
{ name: 'indicatorType', label: $t('indicatorType'), type: 'w-text', showIf: false }, |
|||
{ |
|||
name: 'inputValue', |
|||
label: $t('re.resources.designer.testCaseParameter.grid.entity.inputValue'), |
|||
type: 'w-code-mirror', |
|||
rows: 4, |
|||
showIf: (arg) => { |
|||
const parameterType = arg.form.getFieldValue('parameterType'); |
|||
const scoreCardVarType = arg.form.getFieldValue('scoreCardVarType'); |
|||
const indicatorType = arg.form.getFieldValue('indicatorType'); |
|||
if ( |
|||
(!Tools.isUndefinedOrNull(parameterType) && (parameterType === 'IN' || parameterType === 'IN_OPTION' || parameterType === 'INDICATOR')) || |
|||
(!Tools.isUndefinedOrNull(scoreCardVarType) && scoreCardVarType !== 'RESULT') || |
|||
(!Tools.isUndefinedOrNull(indicatorType) && indicatorType === 'INTERFACE') |
|||
) { |
|||
return true; |
|||
} |
|||
return false; |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'expectValue', |
|||
label: $t('re.resources.designer.testCaseParameter.grid.entity.expectValue'), |
|||
type: 'w-code-mirror', |
|||
rows: 4, |
|||
showIf: (arg) => { |
|||
const parameterType = arg.form.getFieldValue('parameterType'); |
|||
const scoreCardVarType = arg.form.getFieldValue('scoreCardVarType'); |
|||
const indicatorType = arg.form.getFieldValue('indicatorType'); |
|||
if ( |
|||
(!Tools.isUndefinedOrNull(parameterType) && |
|||
(parameterType === 'INTERMEDIATE' || parameterType === 'OUT' || parameterType === 'RULE_RESULT' || parameterType === 'SINGLE_RULE_RESULT')) || |
|||
!Tools.isUndefinedOrNull(scoreCardVarType) || |
|||
(!Tools.isUndefinedOrNull(indicatorType) && indicatorType === 'INDICATOR') |
|||
) { |
|||
return true; |
|||
} |
|||
return false; |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'resultValue', |
|||
label: $t('re.resources.designer.testCaseParameter.grid.entity.resultValue'), |
|||
type: 'w-code-mirror', |
|||
rows: 4, |
|||
lang: 'json', |
|||
}, |
|||
{ name: 'skipCheck', label: $t('re.resources.designer.testCaseParameter.grid.entity.skipCheck'), type: 'w-checkbox' }, |
|||
], |
|||
}, |
|||
}" |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'dataComeFrom', label: $t('dataComeFrom') }, |
|||
{ name: 'creator', label: $t('creator') }, |
|||
{ name: 'createDate', label: $t('createDate') }, |
|||
{ name: 'lastModifier', label: $t('lastModifier') }, |
|||
{ name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.none() }, |
|||
{ name: 'corporationCode', label: $t('corporationCode') }, |
|||
], |
|||
}, |
|||
}" |
|||
@row-click=" |
|||
(evt, row, index) => { |
|||
emit('rowClick', evt, row, index); |
|||
} |
|||
" |
|||
@before-request-data=" |
|||
() => { |
|||
emit('beforeRequestData'); |
|||
} |
|||
" |
|||
></w-grid> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import 'tailwindcss/utilities.css'; |
|||
import { onMounted, ref } from 'vue'; |
|||
import { axios, Environment, EnumTools, Formater, Options, Tools } from 'platform-core'; |
|||
import PassOrNotFormater from '@/utils/PassOrNotFormater'; |
|||
|
|||
const props = defineProps({ |
|||
testCase: { type: Object, default: undefined }, |
|||
}); |
|||
|
|||
const emit = defineEmits<{ |
|||
(e: 'rowClick', evt: Event, row: any, index: number): void; |
|||
(e: 'beforeRequestData', requestParams: URLSearchParams | any, callback: any): void; |
|||
}>(); |
|||
|
|||
const gridRef = ref(); |
|||
|
|||
const refresh = () => { |
|||
gridRef?.value?.refresh(); |
|||
}; |
|||
|
|||
onMounted(() => { |
|||
gridRef?.value?.refresh(); |
|||
}); |
|||
|
|||
defineExpose({ |
|||
refresh, |
|||
}); |
|||
|
|||
const Enums = await EnumTools.fetch(['io.sc.engine.rule.core.enums.IndicatorType', 'io.sc.platform.core.enums.RoundingMode']); |
|||
|
|||
let ValueTypeMap = {}; |
|||
const response = await axios.get(Environment.apiContextPath('/api/re/dictionary/getAllDictionaryMap')); |
|||
if (response && response.data) { |
|||
ValueTypeMap = {}; |
|||
response.data.forEach((item) => { |
|||
ValueTypeMap[item.key] = item.value; |
|||
}); |
|||
} |
|||
</script> |
@ -0,0 +1,76 @@ |
|||
<template> |
|||
<w-dialog ref="dialogRef" :title="$t('upload')" width="600px" :can-maximize="false"> |
|||
<q-form action="post"> |
|||
<div class="row py-1"> |
|||
<div class="col-1"></div> |
|||
<div class="col-10"> |
|||
<q-file ref="fileRef" v-model="modelValue.file" :label="$t('file.single.tip')" dense outlined clearable counter accept=".xlsx"> |
|||
<template #prepend> |
|||
<q-icon name="cloud_upload" /> |
|||
</template> |
|||
</q-file> |
|||
</div> |
|||
<div class="col-1"></div> |
|||
</div> |
|||
<div class="row py-1"> |
|||
<div class="col-1"></div> |
|||
<div class="col-10 row justify-center q-gutter-md py-2"> |
|||
<q-btn icon="bi-database-up" :label="$t('import')" color="primary" no-caps @click="importData"></q-btn> |
|||
</div> |
|||
<div class="col-1"></div> |
|||
</div> |
|||
</q-form> |
|||
</w-dialog> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref, reactive } from 'vue'; |
|||
import { axios, Environment } from 'platform-core'; |
|||
|
|||
const props = defineProps({ |
|||
lib: { type: Object, default: undefined }, |
|||
}); |
|||
|
|||
const emit = defineEmits<{ |
|||
(e: 'afterImported', evt: Event): void; |
|||
}>(); |
|||
|
|||
const dialogRef = ref(); |
|||
const modelValue = reactive({ |
|||
file: undefined, |
|||
}); |
|||
const fileRef = ref(); |
|||
|
|||
const importData = () => { |
|||
axios |
|||
.post( |
|||
Environment.apiContextPath('/api/re/template/uploadIndicatorTemplate/' + props.lib?.id), |
|||
{ |
|||
file: fileRef.value.nativeEl.files[0], |
|||
}, |
|||
{ |
|||
loading: true, |
|||
headers: { |
|||
'Content-Type': 'multipart/form-data', |
|||
}, |
|||
}, |
|||
) |
|||
.then(() => { |
|||
close(); |
|||
emit('afterImported'); |
|||
}); |
|||
}; |
|||
|
|||
const open = () => { |
|||
modelValue.file = undefined; |
|||
dialogRef.value.show(); |
|||
}; |
|||
|
|||
const close = () => { |
|||
dialogRef.value.hide(); |
|||
}; |
|||
|
|||
defineExpose({ |
|||
open, |
|||
close, |
|||
}); |
|||
</script> |
@ -1,204 +0,0 @@ |
|||
<template> |
|||
<w-grid |
|||
ref="gridRef" |
|||
:title="$t('re.resources.designer.testCaseParameter.grid.title')" |
|||
dense-body |
|||
class="px-1" |
|||
hide-bottom |
|||
:config-button="false" |
|||
selection="multiple" |
|||
:checkbox-selection="false" |
|||
:tree="true" |
|||
:tree-icon=" |
|||
(row) => { |
|||
if (row.category === 'M') { |
|||
return { name: 'folder', color: 'amber' }; |
|||
} else { |
|||
return { name: 'bi-p-circle' }; |
|||
} |
|||
} |
|||
" |
|||
db-click-operation="edit" |
|||
:tree-default-expand-all="true" |
|||
:fetch-data-url="Environment.apiContextPath('/api/re/testCaseParameter/findByTestCase?testCaseId=' + testCase.id)" |
|||
:data-url="Environment.apiContextPath('/api/re/testCaseParameter')" |
|||
:pageable="false" |
|||
:toolbar-configure="{ noIcon: false }" |
|||
:toolbar-actions="[ |
|||
'refresh', |
|||
'separator', |
|||
'expand', |
|||
'separator', |
|||
{ |
|||
extend: 'edit', |
|||
enableIf: (arg) => { |
|||
return arg.selected && arg.selected.category !== 'M'; |
|||
}, |
|||
}, |
|||
'separator', |
|||
{ |
|||
name: 'execute', |
|||
label: $t('execute'), |
|||
icon: 'bi-caret-right', |
|||
click: () => { |
|||
axios.post(Environment.apiContextPath('/api/re/testCase/executeTestCase/' + testCase.id), {}, { loading: true }).then(() => { |
|||
gridRef?.refresh(); |
|||
}); |
|||
}, |
|||
}, |
|||
'separator', |
|||
'view', |
|||
'separator', |
|||
'export', |
|||
]" |
|||
:columns="[ |
|||
{ width: 350, name: 'name', label: $t('name'), sortable: false }, |
|||
{ width: 100, name: 'parameterType', label: $t('type'), format: Formater.enum(Enums.ParameterType), sortable: false }, |
|||
{ |
|||
width: 90, |
|||
name: 'valueType', |
|||
label: $t('re.resources.designer.parameter.grid.entity.valueType'), |
|||
sortable: false, |
|||
format: (value) => { |
|||
return ValueTypeMap[value]; |
|||
}, |
|||
}, |
|||
{ width: 90, name: 'defaultValue', label: $t('defaultValue'), sortable: false }, |
|||
{ width: 90, name: 'inputValue', label: $t('re.resources.designer.testCaseParameter.grid.entity.inputValue'), sortable: false }, |
|||
{ width: 90, name: 'expectValue', label: $t('re.resources.designer.testCaseParameter.grid.entity.expectValue'), sortable: false }, |
|||
{ width: 90, name: 'resultValue', label: $t('re.resources.designer.testCaseParameter.grid.entity.resultValue'), sortable: false }, |
|||
{ width: 80, name: 'skipCheck', label: $t('re.resources.designer.testCaseParameter.grid.entity.skipCheck'), sortable: false }, |
|||
{ |
|||
width: 80, |
|||
name: 'testResult', |
|||
label: $t('re.resources.designer.testCaseParameter.grid.entity.testResult'), |
|||
format: PassOrNotFormater, |
|||
sortable: false, |
|||
}, |
|||
]" |
|||
:editor="{ |
|||
dialog: { |
|||
width: '600px', |
|||
}, |
|||
form: { |
|||
colsNum: 1, |
|||
fields: [ |
|||
{ name: 'testCase', label: $t('testCase'), type: 'w-text', defaultValue: testCase.id, showIf: false }, |
|||
{ name: 'id', label: $t('id'), type: 'w-text', showIf: false }, |
|||
{ name: 'source', label: $t('source'), type: 'w-text', showIf: false }, |
|||
{ name: 'parameterType', label: $t('parameterType'), type: 'w-text', showIf: false }, |
|||
{ name: 'scoreCardVarType', label: $t('scoreCardVarType'), type: 'w-text', showIf: false }, |
|||
{ name: 'indicatorType', label: $t('indicatorType'), type: 'w-text', showIf: false }, |
|||
{ |
|||
name: 'inputValue', |
|||
label: $t('re.resources.designer.testCaseParameter.grid.entity.inputValue'), |
|||
type: 'w-code-mirror', |
|||
toolbar: false, |
|||
rows: 10, |
|||
showIf: (arg) => { |
|||
const parameterType = arg.form.getFieldValue('parameterType'); |
|||
const scoreCardVarType = arg.form.getFieldValue('scoreCardVarType'); |
|||
const indicatorType = arg.form.getFieldValue('indicatorType'); |
|||
if ( |
|||
(!Tools.isUndefinedOrNull(parameterType) && (parameterType === 'IN' || parameterType === 'IN_OPTION' || parameterType === 'INDICATOR')) || |
|||
(!Tools.isUndefinedOrNull(scoreCardVarType) && scoreCardVarType !== 'RESULT') || |
|||
(!Tools.isUndefinedOrNull(indicatorType) && indicatorType === 'INTERFACE') |
|||
) { |
|||
return true; |
|||
} |
|||
return false; |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'expectValue', |
|||
label: $t('re.resources.designer.testCaseParameter.grid.entity.expectValue'), |
|||
type: 'w-code-mirror', |
|||
toolbar: false, |
|||
rows: 10, |
|||
showIf: (arg) => { |
|||
const parameterType = arg.form.getFieldValue('parameterType'); |
|||
const scoreCardVarType = arg.form.getFieldValue('scoreCardVarType'); |
|||
const indicatorType = arg.form.getFieldValue('indicatorType'); |
|||
if ( |
|||
(!Tools.isUndefinedOrNull(parameterType) && |
|||
(parameterType === 'INTERMEDIATE' || parameterType === 'OUT' || parameterType === 'RULE_RESULT' || parameterType === 'SINGLE_RULE_RESULT')) || |
|||
!Tools.isUndefinedOrNull(scoreCardVarType) || |
|||
(!Tools.isUndefinedOrNull(indicatorType) && indicatorType === 'INDICATOR') |
|||
) { |
|||
return true; |
|||
} |
|||
return false; |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'resultValue', |
|||
label: $t('re.resources.designer.testCaseParameter.grid.entity.resultValue'), |
|||
type: 'w-code-mirror', |
|||
toolbar: false, |
|||
rows: 10, |
|||
lang: 'json', |
|||
}, |
|||
{ name: 'skipCheck', label: $t('re.resources.designer.testCaseParameter.grid.entity.skipCheck'), type: 'w-checkbox' }, |
|||
], |
|||
}, |
|||
}" |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'dataComeFrom', label: $t('dataComeFrom') }, |
|||
{ name: 'creator', label: $t('creator') }, |
|||
{ name: 'createDate', label: $t('createDate') }, |
|||
{ name: 'lastModifier', label: $t('lastModifier') }, |
|||
{ name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.none() }, |
|||
{ name: 'corporationCode', label: $t('corporationCode') }, |
|||
], |
|||
}, |
|||
}" |
|||
@row-click=" |
|||
(evt, row, index) => { |
|||
emit('rowClick', evt, row, index); |
|||
} |
|||
" |
|||
@before-request-data=" |
|||
() => { |
|||
emit('beforeRequestData'); |
|||
} |
|||
" |
|||
></w-grid> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import 'tailwindcss/utilities.css'; |
|||
import { onMounted, ref } from 'vue'; |
|||
import { axios, Environment, EnumTools, Formater, Options, Tools } from 'platform-core'; |
|||
import PassOrNotFormater from '@/utils/PassOrNotFormater'; |
|||
|
|||
const props = defineProps({ |
|||
testCase: { type: Object, default: undefined }, |
|||
}); |
|||
|
|||
const emit = defineEmits<{ |
|||
(e: 'rowClick', evt: Event, row: any, index: number): void; |
|||
(e: 'beforeRequestData', requestParams: URLSearchParams | any, callback: any): void; |
|||
}>(); |
|||
|
|||
const gridRef = ref(); |
|||
|
|||
const refresh = () => { |
|||
gridRef.value.refresh(); |
|||
}; |
|||
|
|||
defineExpose({ |
|||
refresh, |
|||
}); |
|||
|
|||
const Enums = await EnumTools.fetch(['io.sc.engine.rule.core.enums.ParameterType']); |
|||
let ValueTypeMap = {}; |
|||
const response = await axios.get(Environment.apiContextPath('/api/re/dictionary/getAllDictionaryMap')); |
|||
if (response && response.data) { |
|||
ValueTypeMap = {}; |
|||
response.data.forEach((item) => { |
|||
ValueTypeMap[item.key] = item.value; |
|||
}); |
|||
} |
|||
</script> |
@ -1,201 +0,0 @@ |
|||
<template> |
|||
<div style="height: 100%"> |
|||
<w-grid |
|||
ref="gridRef" |
|||
:title="$t('re.resources.designer.testCase.grid.title')" |
|||
dense-body |
|||
class="px-1" |
|||
hide-bottom |
|||
:config-button="false" |
|||
selection="multiple" |
|||
:checkbox-selection="false" |
|||
:tree="false" |
|||
:fetch-data-url="Environment.apiContextPath('/api/re/testCase/findByOwnerId?ownerId=' + model.resource)" |
|||
:data-url="Environment.apiContextPath('/api/re/testCase')" |
|||
:pageable="false" |
|||
:sort-by="['-lastModifyDate']" |
|||
:toolbar-configure="{ noIcon: false }" |
|||
:toolbar-actions="[ |
|||
'refresh', |
|||
'separator', |
|||
'add', |
|||
'clone', |
|||
{ |
|||
extend: 'clone', |
|||
name: 'deepClone', |
|||
label: $t('deepClone'), |
|||
icon: 'bi-copy', |
|||
click: (arg) => {}, |
|||
}, |
|||
'edit', |
|||
'remove', |
|||
'separator', |
|||
[ |
|||
{ |
|||
name: 'execute', |
|||
label: $t('execute'), |
|||
icon: 'bi-caret-right', |
|||
click: (arg) => { |
|||
axios.post(Environment.apiContextPath('/api/re/testCase/executeTestCase/' + arg.selected.id), {}, { loading: true }).then((response) => { |
|||
gridRef.refresh(); |
|||
}); |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'executeAll', |
|||
label: $t('executeAll'), |
|||
icon: 'bi-fast-forward', |
|||
click: (arg) => { |
|||
axios.post(Environment.apiContextPath('/api/re/testCase/executeAllTestCase/' + model.resource), {}, { loading: true }).then((response) => { |
|||
gridRef.refresh(); |
|||
}); |
|||
}, |
|||
}, |
|||
], |
|||
'separator', |
|||
[ |
|||
{ |
|||
name: 'batchTest', |
|||
label: $t('re.resources.designer.testCase.grid.tools.batchTest'), |
|||
}, |
|||
{ |
|||
name: 'download', |
|||
label: $t('re.resources.designer.testCase.grid.tools.download'), |
|||
icon: 'bi-box-arrow-in-down', |
|||
click: (arg) => { |
|||
Downloader.post(Environment.apiContextPath('/api/re/testCase/downloadTemplate/' + model.resource), {}, { loading: true }); |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'upload', |
|||
label: $t('re.resources.designer.testCase.grid.tools.upload'), |
|||
icon: 'bi-box-arrow-in-up', |
|||
click: (arg) => { |
|||
uploadTestCaseDialogRef.open(); |
|||
}, |
|||
}, |
|||
], |
|||
|
|||
'separator', |
|||
'view', |
|||
'separator', |
|||
'export', |
|||
]" |
|||
:columns="[ |
|||
{ width: 60, name: 'order', label: $t('order'), align: 'right', showIf: false }, |
|||
{ width: 100, name: 'id', label: $t('id'), showIf: false }, |
|||
{ |
|||
width: 60, |
|||
name: 'testResult', |
|||
label: $t('re.resources.designer.testCase.grid.entity.testResult'), |
|||
align: 'center', |
|||
format: PassOrNotFormater, |
|||
}, |
|||
{ width: 150, name: 'lastTestDate', label: $t('re.resources.designer.testCase.grid.entity.lastTestDate') }, |
|||
{ width: 400, name: 'name', label: $t('name') }, |
|||
{ width: '100%', name: 'description', label: $t('description') }, |
|||
{ width: 140, name: 'lastModifyDate', label: $t('lastModifyDate') }, |
|||
]" |
|||
:editor="{ |
|||
dialog: { |
|||
width: '600px', |
|||
height: '250px', |
|||
}, |
|||
form: { |
|||
colsNum: 1, |
|||
fields: [ |
|||
{ name: 'id', label: $t('id'), type: 'w-text', showIf: false }, |
|||
{ name: 'ownerType', label: $t('ownerType'), type: 'w-text', defaultValue: 'MODEL', showIf: false }, |
|||
{ name: 'owner', label: $t('owner'), type: 'w-text', defaultValue: model.resource, showIf: false }, |
|||
{ name: 'ownerId', label: $t('ownerId'), type: 'w-text', defaultValue: model.resource, showIf: false }, |
|||
{ name: 'name', label: $t('name'), type: 'w-text', requiredIf: true }, |
|||
{ name: 'description', label: $t('description'), type: 'w-text' }, |
|||
{ name: 'order', label: $t('order'), type: 'w-number' }, |
|||
], |
|||
}, |
|||
}" |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'order', label: $t('order') }, |
|||
{ name: 'id', label: $t('id') }, |
|||
{ name: 'name', label: $t('name') }, |
|||
{ name: 'description', label: $t('description') }, |
|||
|
|||
{ name: 'dataComeFrom', label: $t('dataComeFrom') }, |
|||
{ name: 'creator', label: $t('creator') }, |
|||
{ name: 'createDate', label: $t('createDate') }, |
|||
{ name: 'lastModifier', label: $t('lastModifier') }, |
|||
{ name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.none() }, |
|||
{ name: 'corporationCode', label: $t('corporationCode') }, |
|||
], |
|||
}, |
|||
}" |
|||
@row-click=" |
|||
(args) => { |
|||
emit('rowClick', args.evt, args.row, args.index); |
|||
} |
|||
" |
|||
@before-request-data=" |
|||
() => { |
|||
emit('beforeRequestData'); |
|||
} |
|||
" |
|||
@after-editor-open=" |
|||
(row) => { |
|||
console.log(gridRef.getEditorForm()); |
|||
} |
|||
" |
|||
></w-grid> |
|||
<UploadTestCaseDialog ref="uploadTestCaseDialogRef"></UploadTestCaseDialog> |
|||
</div> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import 'tailwindcss/utilities.css'; |
|||
import { onMounted, ref } from 'vue'; |
|||
import { axios, Environment, EnumTools, Formater, Options, Tools, Downloader } from 'platform-core'; |
|||
import PassOrNotFormater from '@/utils/PassOrNotFormater'; |
|||
import UploadTestCaseDialog from '@/views/shared/UploadTestCaseDialog.vue'; |
|||
|
|||
const props = defineProps({ |
|||
model: { type: Object, default: undefined }, |
|||
}); |
|||
|
|||
const emit = defineEmits<{ |
|||
(e: 'rowClick', evt: Event, row: any, index: number): void; |
|||
(e: 'beforeRequestData', requestParams: URLSearchParams | any, callback: any): void; |
|||
}>(); |
|||
|
|||
const gridRef = ref(); |
|||
const uploadTestCaseDialogRef = ref(); |
|||
|
|||
const refresh = () => { |
|||
gridRef.value.refresh(); |
|||
}; |
|||
|
|||
defineExpose({ |
|||
refresh, |
|||
}); |
|||
|
|||
const Enums = await EnumTools.fetch([ |
|||
'io.sc.platform.core.enums.RoundingMode', |
|||
'io.sc.engine.rule.core.enums.ParameterType', |
|||
'io.sc.engine.rule.core.enums.DeployStatus', |
|||
]); |
|||
let ValueTypeMap = {}; |
|||
let ValueTypeList = []; |
|||
const response = await axios.get(Environment.apiContextPath('/api/re/dictionary/getAllDictionaryMap')); |
|||
if (response && response.data) { |
|||
ValueTypeMap = {}; |
|||
ValueTypeList = []; |
|||
response.data.forEach((item) => { |
|||
ValueTypeMap[item.key] = item.value; |
|||
ValueTypeList.push({ value: item.key, label: item.value }); |
|||
}); |
|||
} |
|||
|
|||
onMounted(() => { |
|||
gridRef.value.refresh(); |
|||
}); |
|||
</script> |
@ -0,0 +1,23 @@ |
|||
<template> |
|||
<w-dialog ref="dialogRef" width="600px" height="500px" :can-maximize="false"> |
|||
<div class="pt-2" style="height: 100%"></div> |
|||
</w-dialog> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref } from 'vue'; |
|||
|
|||
const dialogRef = ref(); |
|||
|
|||
const open = () => { |
|||
dialogRef.value.show(); |
|||
}; |
|||
|
|||
const close = () => { |
|||
dialogRef.value.hide(); |
|||
}; |
|||
|
|||
defineExpose({ |
|||
open, |
|||
close, |
|||
}); |
|||
</script> |
@ -0,0 +1,28 @@ |
|||
import { axios, Environment, Tools } from 'platform-core'; |
|||
|
|||
class LibManager { |
|||
private static LIB_MAP = new Map(); |
|||
private static FORMATER = (value: any, row: any) => { |
|||
const key = row.libCode + (Tools.isNill(row.libVersion) ? '' : ':' + row.libVersion); |
|||
return LibManager.LIB_MAP.get(key); |
|||
}; |
|||
|
|||
public static getFormater() { |
|||
return LibManager.FORMATER; |
|||
} |
|||
|
|||
public static async load() { |
|||
LibManager.LIB_MAP.clear(); |
|||
const response = await axios.get(Environment.apiContextPath('/api/re/lib')); |
|||
if (response && response.data && response.data.content) { |
|||
for (const item of response.data.content) { |
|||
if (item.type !== 'FOLDER') { |
|||
const key = item.code + (Tools.isNill(item.version) ? '' : ':' + item.version); |
|||
LibManager.LIB_MAP.set(key, item.name + '(V' + item.version + ')'); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
export { LibManager }; |
@ -1,14 +0,0 @@ |
|||
<template> |
|||
<div> |
|||
<q-chip v-if="status === 'HISTORY'" :label="$t('io.sc.engine.rule.core.enums.DeployStatus.HISTORY')" dense></q-chip> |
|||
<q-chip v-if="status === 'ON_LINE'" color="green" text-color="white" :label="$t('io.sc.engine.rule.core.enums.DeployStatus.ON_LINE')" dense></q-chip> |
|||
<q-chip v-if="status === 'OFF_LINE'" color="brown" text-color="white" :label="$t('io.sc.engine.rule.core.enums.DeployStatus.OFF_LINE')" dense></q-chip> |
|||
<q-chip v-if="status === 'SKETCH'" color="blue-grey" text-color="white" :label="$t('io.sc.engine.rule.core.enums.DeployStatus.SKETCH')" dense></q-chip> |
|||
<q-chip v-if="status === 'APPROVING'" color="orange" text-color="white" :label="$t('io.sc.engine.rule.core.enums.DeployStatus.APPROVING')" dense></q-chip> |
|||
</div> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
const props = defineProps({ |
|||
status: { type: String, default: '' }, |
|||
}); |
|||
</script> |
@ -0,0 +1,472 @@ |
|||
<template> |
|||
<w-dialog |
|||
ref="dialogRef" |
|||
:title="$t('re.indicator.grid.title')" |
|||
width="1248px" |
|||
height="500px" |
|||
:can-maximize="true" |
|||
:buttons="[ |
|||
{ |
|||
label: $t('confirm'), |
|||
noCaps: true, |
|||
click: (args: any) => { |
|||
axios |
|||
.post(Environment.apiContextPath('/api/re/model/parameter/addIndicators'), { |
|||
modelId: modelId, |
|||
indicators: indicatorGridRef.getTickedRows(), |
|||
}) |
|||
.then((response) => { |
|||
close(); |
|||
parameterGrid.refresh(); |
|||
}); |
|||
}, |
|||
}, |
|||
]" |
|||
> |
|||
<q-splitter :model-value="70" unit="%" separator-style="width: 3px;" class="w-full" style="height: 100%"> |
|||
<template #before> |
|||
<div class="pr-1" style="width: 100%; height: 100%"> |
|||
<w-echarts |
|||
:option="{ |
|||
tooltip: { |
|||
trigger: 'item', |
|||
triggerOn: 'mousemove', |
|||
}, |
|||
series: [ |
|||
{ |
|||
type: 'tree', |
|||
data: [data], |
|||
top: '1%', |
|||
left: '15%', |
|||
bottom: '1%', |
|||
right: '7%', |
|||
symbolSize: 7, |
|||
orient: 'RL', |
|||
label: { |
|||
position: 'right', |
|||
verticalAlign: 'middle', |
|||
align: 'left', |
|||
}, |
|||
leaves: { |
|||
label: { |
|||
position: 'left', |
|||
verticalAlign: 'middle', |
|||
align: 'right', |
|||
}, |
|||
}, |
|||
emphasis: { |
|||
focus: 'descendant', |
|||
}, |
|||
expandAndCollapse: true, |
|||
animationDuration: 550, |
|||
animationDurationUpdate: 750, |
|||
}, |
|||
], |
|||
}" |
|||
></w-echarts> |
|||
</div> |
|||
</template> |
|||
<template #after> |
|||
<div class="pl-1" style="height: 100%"></div> |
|||
</template> |
|||
</q-splitter> |
|||
</w-dialog> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref } from 'vue'; |
|||
import { axios, Environment, EnumTools, CorporationAuditorEntityManager } from 'platform-core'; |
|||
import { ValueTypeManager } from '@/views/shared/ValueTypeManager'; |
|||
import { EngineEnums } from '@/views/shared/enums/EngineEnums'; |
|||
|
|||
const dialogRef = ref(); |
|||
|
|||
const open = (sourceCode: string) => { |
|||
dialogRef.value.show(); |
|||
}; |
|||
|
|||
const close = () => { |
|||
dialogRef.value.hide(); |
|||
}; |
|||
|
|||
defineExpose({ |
|||
open, |
|||
close, |
|||
}); |
|||
|
|||
const data = { |
|||
name: 'flare', |
|||
children: [ |
|||
{ |
|||
name: 'analytics', |
|||
children: [ |
|||
{ |
|||
name: 'cluster', |
|||
children: [ |
|||
{ name: 'AgglomerativeCluster', value: 3938 }, |
|||
{ name: 'CommunityStructure', value: 3812 }, |
|||
{ name: 'HierarchicalCluster', value: 6714 }, |
|||
{ name: 'MergeEdge', value: 743 }, |
|||
], |
|||
}, |
|||
{ |
|||
name: 'graph', |
|||
children: [ |
|||
{ name: 'BetweennessCentrality', value: 3534 }, |
|||
{ name: 'LinkDistance', value: 5731 }, |
|||
{ name: 'MaxFlowMinCut', value: 7840 }, |
|||
{ name: 'ShortestPaths', value: 5914 }, |
|||
{ name: 'SpanningTree', value: 3416 }, |
|||
], |
|||
}, |
|||
{ |
|||
name: 'optimization', |
|||
children: [{ name: 'AspectRatioBanker', value: 7074 }], |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
name: 'animate', |
|||
children: [ |
|||
{ name: 'Easing', value: 17010 }, |
|||
{ name: 'FunctionSequence', value: 5842 }, |
|||
{ |
|||
name: 'interpolate', |
|||
children: [ |
|||
{ name: 'ArrayInterpolator', value: 1983 }, |
|||
{ name: 'ColorInterpolator', value: 2047 }, |
|||
{ name: 'DateInterpolator', value: 1375 }, |
|||
{ name: 'Interpolator', value: 8746 }, |
|||
{ name: 'MatrixInterpolator', value: 2202 }, |
|||
{ name: 'NumberInterpolator', value: 1382 }, |
|||
{ name: 'ObjectInterpolator', value: 1629 }, |
|||
{ name: 'PointInterpolator', value: 1675 }, |
|||
{ name: 'RectangleInterpolator', value: 2042 }, |
|||
], |
|||
}, |
|||
{ name: 'ISchedulable', value: 1041 }, |
|||
{ name: 'Parallel', value: 5176 }, |
|||
{ name: 'Pause', value: 449 }, |
|||
{ name: 'Scheduler', value: 5593 }, |
|||
{ name: 'Sequence', value: 5534 }, |
|||
{ name: 'Transition', value: 9201 }, |
|||
{ name: 'Transitioner', value: 19975 }, |
|||
{ name: 'TransitionEvent', value: 1116 }, |
|||
{ name: 'Tween', value: 6006 }, |
|||
], |
|||
}, |
|||
{ |
|||
name: 'data', |
|||
children: [ |
|||
{ |
|||
name: 'converters', |
|||
children: [ |
|||
{ name: 'Converters', value: 721 }, |
|||
{ name: 'DelimitedTextConverter', value: 4294 }, |
|||
{ name: 'GraphMLConverter', value: 9800 }, |
|||
{ name: 'IDataConverter', value: 1314 }, |
|||
{ name: 'JSONConverter', value: 2220 }, |
|||
], |
|||
}, |
|||
{ name: 'DataField', value: 1759 }, |
|||
{ name: 'DataSchema', value: 2165 }, |
|||
{ name: 'DataSet', value: 586 }, |
|||
{ name: 'DataSource', value: 3331 }, |
|||
{ name: 'DataTable', value: 772 }, |
|||
{ name: 'DataUtil', value: 3322 }, |
|||
], |
|||
}, |
|||
{ |
|||
name: 'display', |
|||
children: [ |
|||
{ name: 'DirtySprite', value: 8833 }, |
|||
{ name: 'LineSprite', value: 1732 }, |
|||
{ name: 'RectSprite', value: 3623 }, |
|||
{ name: 'TextSprite', value: 10066 }, |
|||
], |
|||
}, |
|||
{ |
|||
name: 'flex', |
|||
children: [{ name: 'FlareVis', value: 4116 }], |
|||
}, |
|||
{ |
|||
name: 'physics', |
|||
children: [ |
|||
{ name: 'DragForce', value: 1082 }, |
|||
{ name: 'GravityForce', value: 1336 }, |
|||
{ name: 'IForce', value: 319 }, |
|||
{ name: 'NBodyForce', value: 10498 }, |
|||
{ name: 'Particle', value: 2822 }, |
|||
{ name: 'Simulation', value: 9983 }, |
|||
{ name: 'Spring', value: 2213 }, |
|||
{ name: 'SpringForce', value: 1681 }, |
|||
], |
|||
}, |
|||
{ |
|||
name: 'query', |
|||
children: [ |
|||
{ name: 'AggregateExpression', value: 1616 }, |
|||
{ name: 'And', value: 1027 }, |
|||
{ name: 'Arithmetic', value: 3891 }, |
|||
{ name: 'Average', value: 891 }, |
|||
{ name: 'BinaryExpression', value: 2893 }, |
|||
{ name: 'Comparison', value: 5103 }, |
|||
{ name: 'CompositeExpression', value: 3677 }, |
|||
{ name: 'Count', value: 781 }, |
|||
{ name: 'DateUtil', value: 4141 }, |
|||
{ name: 'Distinct', value: 933 }, |
|||
{ name: 'Expression', value: 5130 }, |
|||
{ name: 'ExpressionIterator', value: 3617 }, |
|||
{ name: 'Fn', value: 3240 }, |
|||
{ name: 'If', value: 2732 }, |
|||
{ name: 'IsA', value: 2039 }, |
|||
{ name: 'Literal', value: 1214 }, |
|||
{ name: 'Match', value: 3748 }, |
|||
{ name: 'Maximum', value: 843 }, |
|||
{ |
|||
name: 'methods', |
|||
children: [ |
|||
{ name: 'add', value: 593 }, |
|||
{ name: 'and', value: 330 }, |
|||
{ name: 'average', value: 287 }, |
|||
{ name: 'count', value: 277 }, |
|||
{ name: 'distinct', value: 292 }, |
|||
{ name: 'div', value: 595 }, |
|||
{ name: 'eq', value: 594 }, |
|||
{ name: 'fn', value: 460 }, |
|||
{ name: 'gt', value: 603 }, |
|||
{ name: 'gte', value: 625 }, |
|||
{ name: 'iff', value: 748 }, |
|||
{ name: 'isa', value: 461 }, |
|||
{ name: 'lt', value: 597 }, |
|||
{ name: 'lte', value: 619 }, |
|||
{ name: 'max', value: 283 }, |
|||
{ name: 'min', value: 283 }, |
|||
{ name: 'mod', value: 591 }, |
|||
{ name: 'mul', value: 603 }, |
|||
{ name: 'neq', value: 599 }, |
|||
{ name: 'not', value: 386 }, |
|||
{ name: 'or', value: 323 }, |
|||
{ name: 'orderby', value: 307 }, |
|||
{ name: 'range', value: 772 }, |
|||
{ name: 'select', value: 296 }, |
|||
{ name: 'stddev', value: 363 }, |
|||
{ name: 'sub', value: 600 }, |
|||
{ name: 'sum', value: 280 }, |
|||
{ name: 'update', value: 307 }, |
|||
{ name: 'variance', value: 335 }, |
|||
{ name: 'where', value: 299 }, |
|||
{ name: 'xor', value: 354 }, |
|||
{ name: '-', value: 264 }, |
|||
], |
|||
}, |
|||
{ name: 'Minimum', value: 843 }, |
|||
{ name: 'Not', value: 1554 }, |
|||
{ name: 'Or', value: 970 }, |
|||
{ name: 'Query', value: 13896 }, |
|||
{ name: 'Range', value: 1594 }, |
|||
{ name: 'StringUtil', value: 4130 }, |
|||
{ name: 'Sum', value: 791 }, |
|||
{ name: 'Variable', value: 1124 }, |
|||
{ name: 'Variance', value: 1876 }, |
|||
{ name: 'Xor', value: 1101 }, |
|||
], |
|||
}, |
|||
{ |
|||
name: 'scale', |
|||
children: [ |
|||
{ name: 'IScaleMap', value: 2105 }, |
|||
{ name: 'LinearScale', value: 1316 }, |
|||
{ name: 'LogScale', value: 3151 }, |
|||
{ name: 'OrdinalScale', value: 3770 }, |
|||
{ name: 'QuantileScale', value: 2435 }, |
|||
{ name: 'QuantitativeScale', value: 4839 }, |
|||
{ name: 'RootScale', value: 1756 }, |
|||
{ name: 'Scale', value: 4268 }, |
|||
{ name: 'ScaleType', value: 1821 }, |
|||
{ name: 'TimeScale', value: 5833 }, |
|||
], |
|||
}, |
|||
{ |
|||
name: 'util', |
|||
children: [ |
|||
{ name: 'Arrays', value: 8258 }, |
|||
{ name: 'Colors', value: 10001 }, |
|||
{ name: 'Dates', value: 8217 }, |
|||
{ name: 'Displays', value: 12555 }, |
|||
{ name: 'Filter', value: 2324 }, |
|||
{ name: 'Geometry', value: 10993 }, |
|||
{ |
|||
name: 'heap', |
|||
children: [ |
|||
{ name: 'FibonacciHeap', value: 9354 }, |
|||
{ name: 'HeapNode', value: 1233 }, |
|||
], |
|||
}, |
|||
{ name: 'IEvaluable', value: 335 }, |
|||
{ name: 'IPredicate', value: 383 }, |
|||
{ name: 'IValueProxy', value: 874 }, |
|||
{ |
|||
name: 'math', |
|||
children: [ |
|||
{ name: 'DenseMatrix', value: 3165 }, |
|||
{ name: 'IMatrix', value: 2815 }, |
|||
{ name: 'SparseMatrix', value: 3366 }, |
|||
], |
|||
}, |
|||
{ name: 'Maths', value: 17705 }, |
|||
{ name: 'Orientation', value: 1486 }, |
|||
{ |
|||
name: 'palette', |
|||
children: [ |
|||
{ name: 'ColorPalette', value: 6367 }, |
|||
{ name: 'Palette', value: 1229 }, |
|||
{ name: 'ShapePalette', value: 2059 }, |
|||
{ name: 'SizePalette', value: 2291 }, |
|||
], |
|||
}, |
|||
{ name: 'Property', value: 5559 }, |
|||
{ name: 'Shapes', value: 19118 }, |
|||
{ name: 'Sort', value: 6887 }, |
|||
{ name: 'Stats', value: 6557 }, |
|||
{ name: 'Strings', value: 22026 }, |
|||
], |
|||
}, |
|||
{ |
|||
name: 'vis', |
|||
children: [ |
|||
{ |
|||
name: 'axis', |
|||
children: [ |
|||
{ name: 'Axes', value: 1302 }, |
|||
{ name: 'Axis', value: 24593 }, |
|||
{ name: 'AxisGridLine', value: 652 }, |
|||
{ name: 'AxisLabel', value: 636 }, |
|||
{ name: 'CartesianAxes', value: 6703 }, |
|||
], |
|||
}, |
|||
{ |
|||
name: 'controls', |
|||
children: [ |
|||
{ name: 'AnchorControl', value: 2138 }, |
|||
{ name: 'ClickControl', value: 3824 }, |
|||
{ name: 'Control', value: 1353 }, |
|||
{ name: 'ControlList', value: 4665 }, |
|||
{ name: 'DragControl', value: 2649 }, |
|||
{ name: 'ExpandControl', value: 2832 }, |
|||
{ name: 'HoverControl', value: 4896 }, |
|||
{ name: 'IControl', value: 763 }, |
|||
{ name: 'PanZoomControl', value: 5222 }, |
|||
{ name: 'SelectionControl', value: 7862 }, |
|||
{ name: 'TooltipControl', value: 8435 }, |
|||
], |
|||
}, |
|||
{ |
|||
name: 'data', |
|||
children: [ |
|||
{ name: 'Data', value: 20544 }, |
|||
{ name: 'DataList', value: 19788 }, |
|||
{ name: 'DataSprite', value: 10349 }, |
|||
{ name: 'EdgeSprite', value: 3301 }, |
|||
{ name: 'NodeSprite', value: 19382 }, |
|||
{ |
|||
name: 'render', |
|||
children: [ |
|||
{ name: 'ArrowType', value: 698 }, |
|||
{ name: 'EdgeRenderer', value: 5569 }, |
|||
{ name: 'IRenderer', value: 353 }, |
|||
{ name: 'ShapeRenderer', value: 2247 }, |
|||
], |
|||
}, |
|||
{ name: 'ScaleBinding', value: 11275 }, |
|||
{ name: 'Tree', value: 7147 }, |
|||
{ name: 'TreeBuilder', value: 9930 }, |
|||
], |
|||
}, |
|||
{ |
|||
name: 'events', |
|||
children: [ |
|||
{ name: 'DataEvent', value: 2313 }, |
|||
{ name: 'SelectionEvent', value: 1880 }, |
|||
{ name: 'TooltipEvent', value: 1701 }, |
|||
{ name: 'VisualizationEvent', value: 1117 }, |
|||
], |
|||
}, |
|||
{ |
|||
name: 'legend', |
|||
children: [ |
|||
{ name: 'Legend', value: 20859 }, |
|||
{ name: 'LegendItem', value: 4614 }, |
|||
{ name: 'LegendRange', value: 10530 }, |
|||
], |
|||
}, |
|||
{ |
|||
name: 'operator', |
|||
children: [ |
|||
{ |
|||
name: 'distortion', |
|||
children: [ |
|||
{ name: 'BifocalDistortion', value: 4461 }, |
|||
{ name: 'Distortion', value: 6314 }, |
|||
{ name: 'FisheyeDistortion', value: 3444 }, |
|||
], |
|||
}, |
|||
{ |
|||
name: 'encoder', |
|||
children: [ |
|||
{ name: 'ColorEncoder', value: 3179 }, |
|||
{ name: 'Encoder', value: 4060 }, |
|||
{ name: 'PropertyEncoder', value: 4138 }, |
|||
{ name: 'ShapeEncoder', value: 1690 }, |
|||
{ name: 'SizeEncoder', value: 1830 }, |
|||
], |
|||
}, |
|||
{ |
|||
name: 'filter', |
|||
children: [ |
|||
{ name: 'FisheyeTreeFilter', value: 5219 }, |
|||
{ name: 'GraphDistanceFilter', value: 3165 }, |
|||
{ name: 'VisibilityFilter', value: 3509 }, |
|||
], |
|||
}, |
|||
{ name: 'IOperator', value: 1286 }, |
|||
{ |
|||
name: 'label', |
|||
children: [ |
|||
{ name: 'Labeler', value: 9956 }, |
|||
{ name: 'RadialLabeler', value: 3899 }, |
|||
{ name: 'StackedAreaLabeler', value: 3202 }, |
|||
], |
|||
}, |
|||
{ |
|||
name: 'layout', |
|||
children: [ |
|||
{ name: 'AxisLayout', value: 6725 }, |
|||
{ name: 'BundledEdgeRouter', value: 3727 }, |
|||
{ name: 'CircleLayout', value: 9317 }, |
|||
{ name: 'CirclePackingLayout', value: 12003 }, |
|||
{ name: 'DendrogramLayout', value: 4853 }, |
|||
{ name: 'ForceDirectedLayout', value: 8411 }, |
|||
{ name: 'IcicleTreeLayout', value: 4864 }, |
|||
{ name: 'IndentedTreeLayout', value: 3174 }, |
|||
{ name: 'Layout', value: 7881 }, |
|||
{ name: 'NodeLinkTreeLayout', value: 12870 }, |
|||
{ name: 'PieLayout', value: 2728 }, |
|||
{ name: 'RadialTreeLayout', value: 12348 }, |
|||
{ name: 'RandomLayout', value: 870 }, |
|||
{ name: 'StackedAreaLayout', value: 9121 }, |
|||
{ name: 'TreeMapLayout', value: 9191 }, |
|||
], |
|||
}, |
|||
{ name: 'Operator', value: 2490 }, |
|||
{ name: 'OperatorList', value: 5248 }, |
|||
{ name: 'OperatorSequence', value: 4190 }, |
|||
{ name: 'OperatorSwitch', value: 2581 }, |
|||
{ name: 'SortOperator', value: 2023 }, |
|||
], |
|||
}, |
|||
{ name: 'Visualization', value: 16540 }, |
|||
], |
|||
}, |
|||
], |
|||
}; |
|||
</script> |
@ -0,0 +1,82 @@ |
|||
<template> |
|||
<w-dialog ref="dialogRef" :title="$t('upload')" width="600px" :can-maximize="false"> |
|||
<q-form action="post"> |
|||
<div class="row py-1"> |
|||
<div class="col-1"></div> |
|||
<div class="col-10"> |
|||
<q-file ref="fileRef" v-model="modelValue.file" :label="$t('file.single.tip')" dense outlined clearable counter accept=".xlsx"> |
|||
<template #prepend> |
|||
<q-icon name="cloud_upload" /> |
|||
</template> |
|||
</q-file> |
|||
</div> |
|||
<div class="col-1"></div> |
|||
</div> |
|||
<div class="row py-1"> |
|||
<div class="col-1"></div> |
|||
<div class="col-10 row justify-center q-gutter-md py-2"> |
|||
<q-btn icon="bi-database-up" :label="$t('import')" color="primary" no-caps @click="upload"></q-btn> |
|||
</div> |
|||
<div class="col-1"></div> |
|||
</div> |
|||
</q-form> |
|||
</w-dialog> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref, reactive } from 'vue'; |
|||
import { axios, Environment, Downloader } from 'platform-core'; |
|||
|
|||
const props = defineProps({ |
|||
downloadUrl: { type: String, default: undefined }, |
|||
uploadUrl: { type: String, default: undefined }, |
|||
}); |
|||
|
|||
const emit = defineEmits<{ |
|||
(e: 'afterImported', evt: Event): void; |
|||
}>(); |
|||
|
|||
const dialogRef = ref(); |
|||
const modelValue = reactive({ |
|||
file: undefined, |
|||
}); |
|||
const fileRef = ref(); |
|||
|
|||
const download = () => { |
|||
Downloader.post(props.downloadUrl, {}, { loading: true }); |
|||
}; |
|||
|
|||
const upload = () => { |
|||
axios |
|||
.post( |
|||
props.uploadUrl, |
|||
{ |
|||
file: fileRef.value.nativeEl.files[0], |
|||
}, |
|||
{ |
|||
loading: true, |
|||
headers: { |
|||
'Content-Type': 'multipart/form-data', |
|||
}, |
|||
}, |
|||
) |
|||
.then(() => { |
|||
close(); |
|||
emit('afterImported'); |
|||
}); |
|||
}; |
|||
|
|||
const open = () => { |
|||
modelValue.file = undefined; |
|||
dialogRef.value.show(); |
|||
}; |
|||
|
|||
const close = () => { |
|||
dialogRef.value.hide(); |
|||
}; |
|||
|
|||
defineExpose({ |
|||
open, |
|||
close, |
|||
download, |
|||
}); |
|||
</script> |
@ -0,0 +1,41 @@ |
|||
import { $t, Environment, Downloader } from 'platform-core'; |
|||
import { cli } from 'webpack'; |
|||
|
|||
class TemplateImportAndExportManager { |
|||
#dialogRef: any; |
|||
|
|||
constructor(dialogRef: any) { |
|||
this.#dialogRef = dialogRef; |
|||
} |
|||
|
|||
public getToolbarAction(): any[] { |
|||
return [ |
|||
[ |
|||
{ |
|||
name: 'templateImportAndExport', |
|||
label: $t('re.templateImportAndExport.action.group'), |
|||
icon: '', |
|||
click: undefined, |
|||
}, |
|||
{ |
|||
name: 'downloadExcelTemplate', |
|||
label: $t('re.templateImportAndExport.action.downloadTemplate'), |
|||
icon: '', |
|||
click: (args: any) => { |
|||
this.#dialogRef.value.download(); |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'uploadExcel', |
|||
label: $t('re.templateImportAndExport.action.upload'), |
|||
icon: '', |
|||
click: (args: any) => { |
|||
this.#dialogRef.value.open(); |
|||
}, |
|||
}, |
|||
], |
|||
]; |
|||
} |
|||
} |
|||
|
|||
export { TemplateImportAndExportManager }; |
@ -0,0 +1,246 @@ |
|||
<template> |
|||
<div style="width: 100%; height: 100%"> |
|||
<w-grid |
|||
ref="gridRef" |
|||
:title="$t('re.lib.tab.testcase.title')" |
|||
dense-body |
|||
dense-bottom |
|||
:config-button="true" |
|||
selection="multiple" |
|||
:checkbox-selection="true" |
|||
db-click-operation="edit" |
|||
:tree="false" |
|||
:fetch-data-url="fetchDataUrlComputed" |
|||
:data-url="Environment.apiContextPath('/api/re/testCase')" |
|||
:pageable="true" |
|||
:pagination="{ rowsPerPage: 50 }" |
|||
:sort-by="['-lastModifyDate']" |
|||
:toolbar-configure="{ noIcon: false }" |
|||
:toolbar-actions="getActions()" |
|||
:query-form-cols-num="6" |
|||
:query-form-fields=" |
|||
Tools.isNill(owner) |
|||
? [ |
|||
{ colSpan: 2, name: 'name', label: $t('name'), type: 'w-text', clearable: true }, |
|||
{ colSpan: 3, name: 'description', label: $t('description'), type: 'w-text', clearable: true }, |
|||
] |
|||
: [] |
|||
" |
|||
:columns="[ |
|||
{ width: 100, name: 'id', label: $t('id'), showIf: false }, |
|||
{ |
|||
width: 60, |
|||
name: 'testResult', |
|||
label: $t('re.testcase.grid.entity.testResult'), |
|||
align: 'center', |
|||
format: EngineEnums.TestResult.formater, |
|||
}, |
|||
{ width: 150, name: 'lastTestDate', label: $t('re.testcase.grid.entity.lastTestDate') }, |
|||
{ width: 290, name: 'name', label: $t('name') }, |
|||
{ width: 200, name: 'description', label: $t('description') }, |
|||
{ |
|||
width: 80, |
|||
name: 'ownerType', |
|||
label: $t('re.testcase.grid.entity.ownerType'), |
|||
sortable: false, |
|||
format: EngineEnums.TestCaseOwnerType.formater, |
|||
}, |
|||
{ |
|||
width: 190, |
|||
name: 'ownerDescription', |
|||
label: $t('re.testcase.grid.entity.ownerDescription'), |
|||
sortable: false, |
|||
format: (value: any, row: any) => { |
|||
return Tools.initialize(row.ownerName, '') + (Tools.isNill(row.ownerVersion) ? '' : '(V' + row.ownerVersion + ')'); |
|||
}, |
|||
}, |
|||
{ |
|||
width: 80, |
|||
name: 'ownerStatus', |
|||
label: $t('re.testcase.grid.entity.ownerStatus'), |
|||
sortable: false, |
|||
align: 'center', |
|||
format: EngineEnums.DeployStatus.formater, |
|||
}, |
|||
]" |
|||
:editor="{ |
|||
dialog: { |
|||
width: '600px', |
|||
}, |
|||
form: { |
|||
colsNum: 1, |
|||
fields: [ |
|||
{ name: 'id', label: $t('id'), type: 'w-text', showIf: false }, |
|||
{ name: 'name', label: $t('name'), type: 'w-text', requiredIf: true }, |
|||
{ name: 'description', label: $t('description'), type: 'w-text' }, |
|||
...getEditorFields(), |
|||
], |
|||
}, |
|||
}" |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'id', label: $t('id') }, |
|||
{ name: 'name', label: $t('name') }, |
|||
{ name: 'description', label: $t('description') }, |
|||
{ name: 'ownerId', label: $t('re.testcase.grid.entity.ownerId') }, |
|||
{ name: 'ownerType', label: $t('re.testcase.grid.entity.ownerType'), format: Formater.none() }, |
|||
{ name: 'ownerCode', label: $t('re.testcase.grid.entity.ownerCode') }, |
|||
{ name: 'ownerName', label: $t('re.testcase.grid.entity.ownerName') }, |
|||
{ name: 'ownerVersion', label: $t('re.testcase.grid.entity.ownerVersion') }, |
|||
{ name: 'ownerStatus', label: $t('re.testcase.grid.entity.ownerStatus'), format: Formater.none() }, |
|||
], |
|||
}, |
|||
}" |
|||
v-bind="attrs" |
|||
@row-click=" |
|||
(args) => { |
|||
emit('rowClick', args); |
|||
} |
|||
" |
|||
@before-request-data=" |
|||
(args: any) => { |
|||
emit('beforeRequestData', args); |
|||
} |
|||
" |
|||
></w-grid> |
|||
<UploadTestCaseDialog ref="uploadTestCaseDialogRef"></UploadTestCaseDialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { ref, useAttrs, computed } from 'vue'; |
|||
import { $t, axios, Environment, Tools, Downloader, Formater } from 'platform-core'; |
|||
import { ValueTypeManager } from '@/views/shared/ValueTypeManager'; |
|||
import { EngineEnums } from '@/views/shared/enums/EngineEnums'; |
|||
import UploadTestCaseDialog from './UploadTestCaseDialog.vue'; |
|||
|
|||
const attrs = useAttrs(); |
|||
const props = defineProps({ |
|||
owner: { type: Object, default: undefined }, |
|||
}); |
|||
const emit = defineEmits<{ |
|||
(e: 'rowClick', args): void; |
|||
(e: 'beforeRequestData', args): void; |
|||
}>(); |
|||
|
|||
const gridRef = ref(); |
|||
const uploadTestCaseDialogRef = ref(); |
|||
const valueTypeManager = new ValueTypeManager(); |
|||
|
|||
const fetchDataUrlComputed = computed(() => { |
|||
if (Tools.isNill(props.owner)) { |
|||
return Environment.apiContextPath('/api/re/testCase/find'); |
|||
} else { |
|||
return Environment.apiContextPath('/api/re/testCase/findByOwnerId?ownerId=' + Tools.initialize(props.owner?.id, '')); |
|||
} |
|||
}); |
|||
|
|||
const actionMap = { |
|||
deepClone: { |
|||
extend: 'clone', |
|||
name: 'deepClone', |
|||
label: $t('deepClone'), |
|||
icon: 'bi-copy', |
|||
click: (args: any) => { |
|||
axios.post(Environment.apiContextPath('/api/re/testCase/deepClone/' + args.selected.id), {}, { loading: true }).then((response) => { |
|||
gridRef.value.refresh(); |
|||
}); |
|||
}, |
|||
}, |
|||
execute: { |
|||
name: 'execute', |
|||
label: $t('execute'), |
|||
icon: 'bi-caret-right', |
|||
enableIf: (args: any) => { |
|||
return args.selected; |
|||
}, |
|||
click: (args: any) => { |
|||
const tickeds = args.tickeds; |
|||
if (tickeds && tickeds.length > 0) { |
|||
const ids = Tools.extractProperties(tickeds, 'id'); |
|||
if (ids && ids.length > 0) { |
|||
axios.post(Environment.apiContextPath('/api/re/testCase/execute'), ids, { loading: true }).then((response) => { |
|||
gridRef.value.refresh(); |
|||
}); |
|||
} |
|||
} |
|||
}, |
|||
}, |
|||
executeAll: { |
|||
name: 'executeAll', |
|||
label: $t('executeAll'), |
|||
icon: 'bi-caret-right-fill', |
|||
click: (args: any) => { |
|||
axios.post(Environment.apiContextPath('/api/re/testCase/executeAll'), {}, { loading: true }).then(() => { |
|||
gridRef.value?.refresh(); |
|||
}); |
|||
}, |
|||
}, |
|||
batchTest: { |
|||
name: 'batchTest', |
|||
label: $t('re.testcase.grid.tools.batchTest'), |
|||
icon: 'bi-list-check', |
|||
}, |
|||
download: { |
|||
name: 'download', |
|||
label: $t('re.testcase.grid.tools.download'), |
|||
icon: 'bi-box-arrow-in-down', |
|||
click: (args: any) => { |
|||
Downloader.post(Environment.apiContextPath('/api/re/testCase/downloadTemplate/' + props.owner.resource), {}, { loading: true }); |
|||
}, |
|||
}, |
|||
upload: { |
|||
name: 'upload', |
|||
label: $t('re.testcase.grid.tools.upload'), |
|||
icon: 'bi-box-arrow-in-up', |
|||
click: (args: any) => { |
|||
uploadTestCaseDialogRef.value.open(); |
|||
}, |
|||
}, |
|||
}; |
|||
|
|||
const getActions = () => { |
|||
if (Tools.isNill(props.owner)) { |
|||
return ['query', actionMap['execute'], actionMap['executeAll'], [actionMap['batchTest'], actionMap['upload']], 'separator', 'view', 'separator', 'export']; |
|||
} else { |
|||
return [ |
|||
'refresh', |
|||
'separator', |
|||
['add', 'clone', actionMap['deepClone']], |
|||
'edit', |
|||
'remove', |
|||
'separator', |
|||
actionMap['execute'], |
|||
actionMap['executeAll'], |
|||
'separator', |
|||
[actionMap['batchTest'], actionMap['download'], actionMap['upload']], |
|||
'separator', |
|||
'view', |
|||
'separator', |
|||
'export', |
|||
]; |
|||
} |
|||
}; |
|||
|
|||
const getEditorFields = () => { |
|||
if (Tools.isNill(props.owner)) { |
|||
return []; |
|||
} |
|||
if (props.owner.type === 'INDICATOR') { |
|||
return [ |
|||
{ name: 'ownerType', label: $t('ownerType'), type: 'w-text', defaultValue: 'LIB', showIf: false }, |
|||
{ name: 'owner', label: $t('owner'), type: 'w-text', defaultValue: props.owner.id, showIf: false }, |
|||
]; |
|||
} else { |
|||
return [ |
|||
{ name: 'ownerType', label: $t('ownerType'), type: 'w-text', defaultValue: 'MODEL', showIf: false }, |
|||
{ name: 'owner', label: $t('owner'), type: 'w-text', defaultValue: props.owner.id, showIf: false }, |
|||
]; |
|||
} |
|||
}; |
|||
|
|||
await EngineEnums.init(); |
|||
await valueTypeManager.init(); |
|||
</script> |
@ -0,0 +1,213 @@ |
|||
<template> |
|||
<div style="width: 100%; height: 100%"> |
|||
<w-grid |
|||
ref="gridRef" |
|||
:title="$t('re.testCaseParameter.grid.title')" |
|||
dense-body |
|||
hide-bottom |
|||
:config-button="true" |
|||
selection="multiple" |
|||
:checkbox-selection="false" |
|||
:tree="true" |
|||
:tree-icon=" |
|||
(row) => { |
|||
if (row.category === 'F') { |
|||
return { name: 'folder', color: 'amber' }; |
|||
} else { |
|||
return { name: 'bi-p-circle' }; |
|||
} |
|||
} |
|||
" |
|||
db-click-operation="edit" |
|||
:tree-default-expand-all="true" |
|||
:fetch-data-url="Environment.apiContextPath('/api/re/testCaseParameter/findByTestCase?testCaseId=' + Tools.initialize(testCase?.id, ''))" |
|||
:data-url="Environment.apiContextPath('/api/re/testCaseParameter')" |
|||
:pageable="false" |
|||
:toolbar-configure="{ noIcon: false }" |
|||
:toolbar-actions="[ |
|||
'refresh', |
|||
'separator', |
|||
'expand', |
|||
'separator', |
|||
{ |
|||
extend: 'edit', |
|||
enableIf: (args: any) => { |
|||
return args.selected && args.selected.category !== 'M'; |
|||
}, |
|||
}, |
|||
'separator', |
|||
{ |
|||
name: 'execute', |
|||
label: $t('execute'), |
|||
icon: 'bi-caret-right', |
|||
click: (args: any) => { |
|||
axios.post(Environment.apiContextPath('/api/re/testCase/execute/' + Tools.initialize(testCase?.id, '')), {}, { loading: true }).then(() => { |
|||
testcaseParameterGridRef?.refresh(); |
|||
}); |
|||
}, |
|||
}, |
|||
'separator', |
|||
{ |
|||
name: 'simulate', |
|||
label: $t('simulate'), |
|||
icon: 'monitor', |
|||
click: (args: any) => { |
|||
simulatorDialogRef.open(); |
|||
}, |
|||
}, |
|||
'separator', |
|||
'view', |
|||
'separator', |
|||
'export', |
|||
]" |
|||
:columns="[ |
|||
{ width: '100%', name: 'name', label: $t('name'), sortable: false }, |
|||
{ |
|||
width: 100, |
|||
name: 'parameterType', |
|||
label: $t('type'), |
|||
sortable: false, |
|||
format: (value: any, row: any) => { |
|||
if (row.parameterType) { |
|||
return EngineEnums.ParameterType.formater(row.parameterType); |
|||
} |
|||
if (row.indicatorType) { |
|||
return EngineEnums.IndicatorType.formater(row.indicatorType); |
|||
} |
|||
}, |
|||
}, |
|||
...valueTypeManager.getColumns([], false), |
|||
{ width: 100, name: 'inputValue', label: $t('re.testCaseParameter.grid.entity.inputValue'), sortable: false }, |
|||
{ width: 100, name: 'expectValue', label: $t('re.testCaseParameter.grid.entity.expectValue'), sortable: false }, |
|||
{ width: 100, name: 'resultValue', label: $t('re.testCaseParameter.grid.entity.resultValue'), sortable: false }, |
|||
{ |
|||
width: 70, |
|||
name: 'skipCheck', |
|||
label: $t('re.testCaseParameter.grid.entity.skipCheck'), |
|||
sortable: false, |
|||
format: Formater.checkTag(), |
|||
}, |
|||
{ |
|||
width: 60, |
|||
name: 'testResult', |
|||
label: $t('re.testCaseParameter.grid.entity.testResult'), |
|||
sortable: false, |
|||
align: 'center', |
|||
format: EngineEnums.TestResult.formater, |
|||
}, |
|||
]" |
|||
:editor="{ |
|||
dialog: { |
|||
width: '600px', |
|||
}, |
|||
form: { |
|||
colsNum: 1, |
|||
fields: [ |
|||
{ name: 'testCase', label: $t('testCase'), type: 'w-text', defaultValue: Tools.initialize(testCase?.id, ''), showIf: false }, |
|||
{ name: 'id', label: $t('id'), type: 'w-text', showIf: false }, |
|||
{ name: 'source', label: $t('source'), type: 'w-text', showIf: false }, |
|||
{ name: 'parameterType', label: $t('parameterType'), type: 'w-text', showIf: false }, |
|||
{ name: 'scoreCardVarType', label: $t('scoreCardVarType'), type: 'w-text', showIf: false }, |
|||
{ name: 'indicatorType', label: $t('indicatorType'), type: 'w-text', showIf: false }, |
|||
{ |
|||
name: 'inputValue', |
|||
label: $t('re.testCaseParameter.grid.entity.inputValue'), |
|||
type: 'w-code-mirror', |
|||
toolbar: false, |
|||
rows: 4, |
|||
showIf: (arg) => { |
|||
const parameterType = arg.form.getFieldValue('parameterType'); |
|||
const scoreCardVarType = arg.form.getFieldValue('scoreCardVarType'); |
|||
const indicatorType = arg.form.getFieldValue('indicatorType'); |
|||
if ( |
|||
(!Tools.isUndefinedOrNull(parameterType) && (parameterType === 'IN' || parameterType === 'IN_OPTION' || parameterType === 'INDICATOR')) || |
|||
(!Tools.isUndefinedOrNull(scoreCardVarType) && scoreCardVarType !== 'RESULT') || |
|||
(!Tools.isUndefinedOrNull(indicatorType) && indicatorType === 'INTERFACE') |
|||
) { |
|||
return true; |
|||
} |
|||
return false; |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'expectValue', |
|||
label: $t('re.testCaseParameter.grid.entity.expectValue'), |
|||
type: 'w-code-mirror', |
|||
toolbar: false, |
|||
rows: 4, |
|||
showIf: (arg) => { |
|||
const parameterType = arg.form.getFieldValue('parameterType'); |
|||
const scoreCardVarType = arg.form.getFieldValue('scoreCardVarType'); |
|||
const indicatorType = arg.form.getFieldValue('indicatorType'); |
|||
if ( |
|||
(!Tools.isUndefinedOrNull(parameterType) && |
|||
(parameterType === 'INTERMEDIATE' || |
|||
parameterType === 'OUT' || |
|||
parameterType === 'RULE_RESULT' || |
|||
parameterType === 'SINGLE_RULE_RESULT')) || |
|||
!Tools.isUndefinedOrNull(scoreCardVarType) || |
|||
(!Tools.isUndefinedOrNull(indicatorType) && indicatorType === 'INDICATOR') |
|||
) { |
|||
return true; |
|||
} |
|||
return false; |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'resultValue', |
|||
label: $t('re.testCaseParameter.grid.entity.resultValue'), |
|||
type: 'w-code-mirror', |
|||
toolbar: false, |
|||
rows: 4, |
|||
lang: 'json', |
|||
}, |
|||
{ name: 'skipCheck', label: $t('re.testCaseParameter.grid.entity.skipCheck'), type: 'w-checkbox' }, |
|||
], |
|||
}, |
|||
}" |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'testCaseId', label: $t('re.testCaseParameter.grid.entity.testCaseId') }, |
|||
{ name: 'id', label: $t('id') }, |
|||
{ name: 'inputValue', label: $t('re.testCaseParameter.grid.entity.inputValue') }, |
|||
{ name: 'expectValue', label: $t('re.testCaseParameter.grid.entity.expectValue') }, |
|||
{ name: 'resultValue', label: $t('re.testCaseParameter.grid.entity.resultValue') }, |
|||
{ name: 'skipCheck', label: $t('re.testCaseParameter.grid.entity.skipCheck') }, |
|||
], |
|||
}, |
|||
}" |
|||
v-bind="attrs" |
|||
></w-grid> |
|||
<SimulatorDialog ref="simulatorDialogRef"></SimulatorDialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { ref, useAttrs, computed } from 'vue'; |
|||
import { axios, Environment, Formater, Tools } from 'platform-core'; |
|||
import { ValueTypeManager } from '@/views/shared/ValueTypeManager'; |
|||
import { EngineEnums } from '@/views/shared/enums/EngineEnums'; |
|||
import SimulatorDialog from './SimulatorDialog.vue'; |
|||
|
|||
const attrs = useAttrs(); |
|||
const props = defineProps({ |
|||
testCase: { type: Object, default: undefined }, |
|||
}); |
|||
|
|||
const gridRef = ref(); |
|||
const simulatorDialogRef = ref(); |
|||
const valueTypeManager = new ValueTypeManager(); |
|||
|
|||
const refresh = () => { |
|||
gridRef?.value?.refresh(); |
|||
}; |
|||
|
|||
defineExpose({ |
|||
refresh, |
|||
}); |
|||
|
|||
await EngineEnums.init(); |
|||
await valueTypeManager.init(); |
|||
</script> |
@ -0,0 +1,260 @@ |
|||
import { eventBus, $t, axios, Environment, Tools, Formater } from 'platform-core'; |
|||
import { EngineEnums } from '@/views/shared/enums/EngineEnums'; |
|||
|
|||
class ValueTypeManager { |
|||
private static FETCH_URL = '/api/re/dictionary/searchDictionaries'; |
|||
private valueTypeMap = new Map(); |
|||
|
|||
constructor() { |
|||
eventBus.on('dictionaryChanged', this.dictionaryChanged); |
|||
} |
|||
|
|||
public async init() { |
|||
await EngineEnums.init(); |
|||
await this.dictionaryChanged(); |
|||
} |
|||
|
|||
public async dictionaryChanged() { |
|||
this.valueTypeMap.clear(); |
|||
const response = await axios.get(Environment.apiContextPath(ValueTypeManager.FETCH_URL)); |
|||
const items = response?.data; |
|||
for (const item of items) { |
|||
const key = item.code + (Tools.isNill(item.version) ? '' : ':' + item.version); |
|||
const value = { |
|||
label: $t(item.nameI18nKey), |
|||
version: item.version, |
|||
}; |
|||
this.valueTypeMap.set(key, value); |
|||
} |
|||
} |
|||
|
|||
public getColumns(columnNames: string[] = [], sortable: boolean = true): any { |
|||
const columns = { |
|||
valueType: { |
|||
width: 120, |
|||
name: 'valueType', |
|||
label: $t('valueType'), |
|||
sortable: sortable, |
|||
format: (value: any, row: any) => { |
|||
let scaleAndRoundingMode = ''; |
|||
//小数
|
|||
if (row.valueType == 'java.math.BigDecimal') { |
|||
if (!Tools.isNill(row.valueScale)) { |
|||
scaleAndRoundingMode += row.valueScale; |
|||
} |
|||
if (!Tools.isNill(row.valueRoundingMode)) { |
|||
if (row.valueRoundingMode !== 'HALF_UP') { |
|||
const roundingMode = EngineEnums.RoundingMode.formater(row.valueRoundingMode); |
|||
scaleAndRoundingMode += ',' + roundingMode; |
|||
} |
|||
} |
|||
} |
|||
|
|||
let result = ''; |
|||
const key = row.valueType + (Tools.isNill(row.valueTypeVersion) ? '' : ':' + row.valueTypeVersion); |
|||
const valueType = this.valueTypeMap.get(key); |
|||
if (valueType) { |
|||
result += valueType.label; |
|||
let description = ''; |
|||
if (!Tools.isNill(valueType.version)) { |
|||
description += 'V' + valueType.version; |
|||
} |
|||
if (!Tools.isEmpty(scaleAndRoundingMode)) { |
|||
description += description ? ',' + scaleAndRoundingMode : scaleAndRoundingMode; |
|||
} |
|||
if (!Tools.isEmpty(description)) { |
|||
result += '(' + description + ')'; |
|||
} |
|||
} |
|||
return result; |
|||
}, |
|||
}, |
|||
valueTypeIsList: { |
|||
width: 70, |
|||
name: 'valueTypeIsList', |
|||
label: $t('re.parameter.grid.entity.valueTypeIsList'), |
|||
sortable: sortable, |
|||
format: Formater.checkTag(), |
|||
}, |
|||
defaultValue: { width: 100, name: 'defaultValue', label: $t('defaultValue'), sortable: sortable }, |
|||
}; |
|||
|
|||
const result: any = []; |
|||
if (Tools.isArray(columnNames) && columnNames.length > 0) { |
|||
for (const columnName of columnNames) { |
|||
const column = columns[columnName]; |
|||
if (column) { |
|||
result.push(column); |
|||
} |
|||
} |
|||
} else { |
|||
result.push(columns.valueType); |
|||
result.push(columns.valueTypeIsList); |
|||
result.push(columns.defaultValue); |
|||
} |
|||
return result; |
|||
} |
|||
|
|||
public getEditorFields(): any { |
|||
return [ |
|||
{ |
|||
name: 'valueTypeSelect', |
|||
label: $t('re.parameter.grid.entity.valueType'), |
|||
type: 'w-grid-select', |
|||
requiredIf: true, |
|||
displayValue: (args: any) => { |
|||
const data = args.data; |
|||
if (data.type === 'UD_JAVA_CLASS' || data.type === 'ENUM') { |
|||
return data.nameI18nKey + (data.version ? '(V' + data.version + ')' : ''); |
|||
} else { |
|||
return $t(data.code) + (data.version ? '(V' + data.version + ')' : ''); |
|||
} |
|||
}, |
|||
onUpdateValue: (args: any) => { |
|||
if (args.data) { |
|||
args.form.setFieldValue('valueType', args.data.code); |
|||
args.form.setFieldValue('valueTypeVersion', Tools.isNill(args.data.version) ? null : args.data.version); |
|||
} |
|||
}, |
|||
selectableIf: (args: any) => { |
|||
if (args.row.type === 'FOLDER') { |
|||
return false; |
|||
} else { |
|||
return true; |
|||
} |
|||
}, |
|||
grid: { |
|||
title: $t('re.parameter.grid.entity.valueType'), |
|||
height: 300, |
|||
denseBody: true, |
|||
hideBottom: true, |
|||
configButton: true, |
|||
checkboxSelection: false, |
|||
tree: true, |
|||
treeIcon: (row: any) => { |
|||
if (row.type === 'FOLDER') { |
|||
return { name: 'folder', color: 'amber' }; |
|||
} else { |
|||
return { name: 'bi-card-list' }; |
|||
} |
|||
}, |
|||
dataUrl: Environment.apiContextPath(ValueTypeManager.FETCH_URL), |
|||
pageable: false, |
|||
sortBy: ['order'], |
|||
toolbarConfigure: { noIcon: false }, |
|||
toolbarActions: ['refresh', 'expand'], |
|||
columns: [ |
|||
{ |
|||
width: '100%', |
|||
name: 'name', |
|||
label: $t('name'), |
|||
format: (value, row) => { |
|||
return $t(row.nameI18nKey); |
|||
}, |
|||
}, |
|||
{ |
|||
width: 100, |
|||
name: 'type', |
|||
label: $t('type'), |
|||
format: (value, row) => { |
|||
if (value === 'FOLDER') { |
|||
return ''; |
|||
} else { |
|||
return EngineEnums.DictionaryType.formater(value); |
|||
} |
|||
}, |
|||
}, |
|||
{ width: 60, name: 'version', label: $t('version'), align: 'right' }, |
|||
], |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'valueType', |
|||
label: $t('re.parameter.grid.entity.valueType'), |
|||
type: 'w-text', |
|||
showIf: (args: any) => { |
|||
return false; |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'valueTypeVersion', |
|||
label: $t('re.parameter.grid.entity.valueTypeVersion'), |
|||
type: 'w-text', |
|||
showIf: (args: any) => { |
|||
return false; |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'valueScale', |
|||
label: $t('re.parameter.grid.entity.valueScale'), |
|||
type: 'w-integer', |
|||
defaultValue: 6, |
|||
showIf: (args: any) => { |
|||
const valueType = args.form.getFieldValue('valueType'); |
|||
if (valueType == 'java.math.BigDecimal') { |
|||
return true; |
|||
} |
|||
return false; |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'valueRoundingMode', |
|||
label: $t('re.parameter.grid.entity.valueRoundingMode'), |
|||
type: 'w-select', |
|||
options: EngineEnums.RoundingMode.options, |
|||
defaultValue: 'HALF_UP', |
|||
showIf: (args: any) => { |
|||
const valueType = args.form.getFieldValue('valueType'); |
|||
if (valueType == 'java.math.BigDecimal') { |
|||
return true; |
|||
} |
|||
return false; |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'valueTypeIsList', |
|||
label: $t('re.parameter.grid.entity.valueTypeIsList'), |
|||
type: 'w-checkbox', |
|||
defaultValue: false, |
|||
showIf: (args: any) => { |
|||
return args.form.getFieldValue('type') !== 'IN_OPTION'; |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'defaultValue', |
|||
label: $t('defaultValue'), |
|||
type: 'w-code-mirror', |
|||
lang: 'json', |
|||
rows: 4, |
|||
toolbar: false, |
|||
}, |
|||
]; |
|||
} |
|||
|
|||
public getViewerFields(): any { |
|||
return [ |
|||
{ name: 'valueType', label: $t('re.parameter.grid.entity.valueType'), format: Formater.none() }, |
|||
{ name: 'valueTypeVersion', label: $t('re.parameter.grid.entity.valueTypeVersion'), format: Formater.none() }, |
|||
{ name: 'valueScale', label: $t('re.parameter.grid.entity.valueScale'), format: Formater.none() }, |
|||
{ name: 'valueRoundingMode', label: $t('re.parameter.grid.entity.valueRoundingMode'), format: Formater.none() }, |
|||
{ name: 'valueTypeIsList', label: $t('re.parameter.grid.entity.valueTypeIsList'), format: Formater.none() }, |
|||
{ name: 'defaultValue', label: $t('defaultValue'), format: Formater.none() }, |
|||
]; |
|||
} |
|||
|
|||
public beforeEditorDataSubmit(args: any): void {} |
|||
|
|||
public afterEditorOpen(args: any): void { |
|||
const form = args.grid?.getEditorForm(); |
|||
if (form && form.getStatus() !== 'add') { |
|||
let url = ValueTypeManager.FETCH_URL; |
|||
url += '?code=' + args.data.valueType; |
|||
url += '&version=' + (Tools.isNill(args.data.valueTypeVersion) ? '' : args.data.valueTypeVersion); |
|||
axios.get(Environment.apiContextPath(url)).then((response: any) => { |
|||
form?.getFieldComponent('valueTypeSelect')?.setValue(response?.data[0]?.id); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
|
|||
export { ValueTypeManager }; |
@ -0,0 +1,97 @@ |
|||
import type { EnumType } from 'platform-core'; |
|||
import { EnumTools, Formater, Options } from 'platform-core'; |
|||
import DeployStatusTag from '@/views/shared/tags/DeployStatusTag.vue'; |
|||
import TestResultTag from '@/views/shared/tags/TestResultTag.vue'; |
|||
|
|||
class EngineEnums { |
|||
private static loaded: boolean = false; |
|||
private static enumNames = [ |
|||
'io.sc.platform.core.enums.RoundingMode', |
|||
'io.sc.engine.rule.core.enums.DeployStatus', |
|||
'io.sc.engine.rule.core.enums.DictionaryType', |
|||
'io.sc.engine.rule.core.enums.ExecuteMode', |
|||
'io.sc.engine.rule.core.enums.HttpAuthorizationType', |
|||
'io.sc.engine.rule.core.enums.HttpMethodType', |
|||
'io.sc.engine.rule.core.enums.IndicatorType', |
|||
'io.sc.engine.rule.core.enums.LibType', |
|||
'io.sc.engine.rule.core.enums.ModelCategory', |
|||
'io.sc.engine.rule.core.enums.ParameterType', |
|||
'io.sc.engine.rule.core.enums.ProcessorType', |
|||
'io.sc.engine.rule.core.enums.ResourceType', |
|||
'io.sc.engine.rule.core.enums.RuntimeInputParameterType', |
|||
'io.sc.engine.rule.core.enums.ScoreCardVarType', |
|||
'io.sc.engine.rule.core.enums.TestCaseOwnerType', |
|||
'io.sc.engine.rule.core.enums.TestResult', |
|||
'io.sc.engine.rule.core.enums.ValidatorType', |
|||
]; |
|||
public static RoundingMode: any; |
|||
public static DeployStatus: any; |
|||
public static DictionaryType: any; |
|||
public static ExecuteMode: any; |
|||
public static HttpAuthorizationType: any; |
|||
public static HttpMethodType: any; |
|||
public static IndicatorType: any; |
|||
public static LibType: any; |
|||
public static ModelCategory: any; |
|||
public static ParameterType: any; |
|||
public static ProcessorType: any; |
|||
public static ResourceType: any; |
|||
public static RuntimeInputParameterType: any; |
|||
public static ScoreCardVarType: any; |
|||
public static TestCaseOwnerType: any; |
|||
public static TestResult: any; |
|||
public static ValidatorType: any; |
|||
public static ValueType: any; |
|||
|
|||
public static async init() { |
|||
if (!EngineEnums.loaded) { |
|||
const Enums = await EnumTools.fetch(EngineEnums.enumNames); |
|||
EngineEnums.RoundingMode = EngineEnums.createEnum(Enums.RoundingMode); |
|||
EngineEnums.DeployStatus = EngineEnums.createTagEnum(Enums.DeployStatus, (value: any, row: any) => { |
|||
return { |
|||
componentType: DeployStatusTag, |
|||
attrs: { value: value }, |
|||
}; |
|||
}); |
|||
EngineEnums.DictionaryType = EngineEnums.createEnum(Enums.DictionaryType); |
|||
EngineEnums.ExecuteMode = EngineEnums.createEnum(Enums.ExecuteMode); |
|||
EngineEnums.HttpAuthorizationType = EngineEnums.createEnum(Enums.HttpAuthorizationType); |
|||
EngineEnums.HttpMethodType = EngineEnums.createEnum(Enums.HttpMethodType); |
|||
EngineEnums.IndicatorType = EngineEnums.createEnum(Enums.IndicatorType); |
|||
EngineEnums.LibType = EngineEnums.createEnum(Enums.LibType); |
|||
EngineEnums.ModelCategory = EngineEnums.createEnum(Enums.ModelCategory); |
|||
EngineEnums.ParameterType = EngineEnums.createEnum(Enums.ParameterType); |
|||
EngineEnums.ProcessorType = EngineEnums.createEnum(Enums.ProcessorType); |
|||
EngineEnums.ResourceType = EngineEnums.createEnum(Enums.ResourceType); |
|||
EngineEnums.RuntimeInputParameterType = EngineEnums.createEnum(Enums.RuntimeInputParameterType); |
|||
EngineEnums.ScoreCardVarType = EngineEnums.createEnum(Enums.ScoreCardVarType); |
|||
EngineEnums.TestCaseOwnerType = EngineEnums.createEnum(Enums.TestCaseOwnerType); |
|||
EngineEnums.TestResult = EngineEnums.createTagEnum(Enums.TestResult, (value: any, row: any) => { |
|||
return { |
|||
componentType: TestResultTag, |
|||
attrs: { value: value }, |
|||
}; |
|||
}); |
|||
EngineEnums.ValidatorType = EngineEnums.createEnum(Enums.ValidatorType); |
|||
EngineEnums.ValueType = EngineEnums.createEnum(Enums.ValueType); |
|||
} |
|||
} |
|||
|
|||
private static createTagEnum(enumType: EnumType, formater: any) { |
|||
return { |
|||
i18nMessage: Formater.enum(enumType), |
|||
formater: formater, |
|||
options: Options.enum(enumType), |
|||
}; |
|||
} |
|||
|
|||
private static createEnum(enumType: EnumType) { |
|||
return { |
|||
i18nMessage: Formater.enum(enumType), |
|||
formater: Formater.enum(enumType), |
|||
options: Options.enum(enumType), |
|||
}; |
|||
} |
|||
} |
|||
|
|||
export { EngineEnums }; |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue