|
|
|
<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'), hidden: true },
|
|
|
|
{ width: 100, name: 'id', label: $t('id'), hidden: true },
|
|
|
|
{
|
|
|
|
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 { 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>
|