提交 fc2fab39 编写于 作者: Z zhaoke

* Add show zentao case.

上级 9fb86044
......@@ -8,6 +8,7 @@ type SyncSettings struct {
SuiteId int `json:"suiteId"`
TaskId int `json:"taskId"`
CaseId int `json:"caseId"`
CaseIds []int `json:"caseIds"`
CasePath string `json:"casePath"`
Lang string `json:"lang"`
......
......@@ -29,11 +29,14 @@ type ZtfModule struct {
Cases map[int]ZtfCaseInModule
}
type ZtfCaseInModule struct {
Id int
Title string
Product int
Module int
Case int // case id in task
Id int
Title string
Product int
Module int
Case int // case id in task
Type string
StatusName string
LastRunResult string
}
type ZtfSuite struct {
......
......@@ -3,6 +3,11 @@ package execHelper
import (
"bufio"
"fmt"
"io"
"os"
"os/exec"
"strings"
commConsts "github.com/easysoft/zentaoatf/internal/pkg/consts"
commDomain "github.com/easysoft/zentaoatf/internal/pkg/domain"
configHelper "github.com/easysoft/zentaoatf/internal/pkg/helper/config"
......@@ -15,10 +20,6 @@ import (
"github.com/fatih/color"
"github.com/kataras/iris/v12"
"github.com/kataras/iris/v12/websocket"
"io"
"os"
"os/exec"
"strings"
)
func RunFile(filePath, workspacePath string, conf commDomain.WorkspaceConf,
......@@ -162,8 +163,6 @@ func RunFile(filePath, workspacePath string, conf commDomain.WorkspaceConf,
}
}
cmd.Wait()
ExitCurrCase:
errOutputArr := make([]string, 0)
if !isTerminal {
......@@ -180,5 +179,7 @@ ExitCurrCase:
stdOutput = strings.Join(stdOutputArr, "")
errOutput = strings.Join(errOutputArr, "")
cmd.Wait()
return
}
......@@ -2,13 +2,14 @@ package execHelper
import (
"fmt"
i118Utils "github.com/easysoft/zentaoatf/pkg/lib/i118"
logUtils "github.com/easysoft/zentaoatf/pkg/lib/log"
stringUtils "github.com/easysoft/zentaoatf/pkg/lib/string"
"regexp"
"strconv"
"strings"
i118Utils "github.com/easysoft/zentaoatf/pkg/lib/i118"
logUtils "github.com/easysoft/zentaoatf/pkg/lib/log"
stringUtils "github.com/easysoft/zentaoatf/pkg/lib/string"
commConsts "github.com/easysoft/zentaoatf/internal/pkg/consts"
commDomain "github.com/easysoft/zentaoatf/internal/pkg/domain"
langHelper "github.com/easysoft/zentaoatf/internal/pkg/helper/lang"
......@@ -22,7 +23,7 @@ import (
func CheckCaseResult(scriptFile string, logs string, report *commDomain.ZtfReport, scriptIdx int,
total int, secs string, pathMaxWidth int, numbMaxWidth int,
wsMsg *websocket.Message) {
wsMsg *websocket.Message, errOutput string) {
steps, isOldFormat := scriptHelper.GetStepAndExpectMap(scriptFile)
......@@ -45,13 +46,13 @@ func CheckCaseResult(scriptFile string, logs string, report *commDomain.ZtfRepor
language := langHelper.GetLangByFile(scriptFile)
ValidateCaseResult(scriptFile, language, steps, skip, actualArr, report,
scriptIdx, total, secs, pathMaxWidth, numbMaxWidth, wsMsg)
scriptIdx, total, secs, pathMaxWidth, numbMaxWidth, wsMsg, errOutput)
}
func ValidateCaseResult(scriptFile string, langType string,
steps []commDomain.ZentaoCaseStep, skip bool, actualArr [][]string, report *commDomain.ZtfReport,
scriptIdx int, total int, secs string, pathMaxWidth int, numbMaxWidth int,
wsMsg *websocket.Message) {
wsMsg *websocket.Message, errOutput string) {
key := stringUtils.Md5(scriptFile)
......@@ -65,7 +66,7 @@ func ValidateCaseResult(scriptFile string, langType string,
caseResult = commConsts.SKIP
} else {
stepIdxToCheck := 0
for _, step := range steps { // iterate by checkpoints
for index, step := range steps { // iterate by checkpoints
stepName := strings.TrimSpace(step.Desc)
expect := strings.TrimSpace(step.Expect)
......@@ -82,6 +83,9 @@ func ValidateCaseResult(scriptFile string, langType string,
}
stepResult, checkpointLogs := ValidateStepResult(langType, expectLines, actualLines)
if errOutput != "" && index == 0 && len(checkpointLogs) > 0 {
checkpointLogs[0].Actual = errOutput
}
stepLog := commDomain.StepLog{Id: strconv.Itoa(stepIdxToCheck), Name: stepName, Status: stepResult, CheckPoints: checkpointLogs}
stepLogs = append(stepLogs, stepLog)
if stepResult == commConsts.FAIL {
......
......@@ -2,12 +2,13 @@ package execHelper
import (
"fmt"
"strings"
"time"
dateUtils "github.com/easysoft/zentaoatf/pkg/lib/date"
i118Utils "github.com/easysoft/zentaoatf/pkg/lib/i118"
logUtils "github.com/easysoft/zentaoatf/pkg/lib/log"
stringUtils "github.com/easysoft/zentaoatf/pkg/lib/string"
"strings"
"time"
commConsts "github.com/easysoft/zentaoatf/internal/pkg/consts"
commDomain "github.com/easysoft/zentaoatf/internal/pkg/domain"
......@@ -54,7 +55,8 @@ func ExecScript(scriptFile, workspacePath string,
entTime := time.Now()
secs := fmt.Sprintf("%.2f", float32(entTime.Sub(startTime)/time.Second))
report.WorkspacePath = workspacePath
CheckCaseResult(scriptFile, logs, report, scriptIdx, total, secs, pathMaxWidth, numbMaxWidth, wsMsg)
CheckCaseResult(scriptFile, logs, report, scriptIdx, total, secs, pathMaxWidth, numbMaxWidth, wsMsg, errOutput)
endMsg := i118Utils.Sprintf("end_execution", scriptFile, dateUtils.DateTimeStr(entTime))
if commConsts.ExecFrom != commConsts.FromCmd {
......
......@@ -3,6 +3,11 @@ package execHelper
import (
"bufio"
"errors"
"io"
"os/exec"
"strings"
"time"
commConsts "github.com/easysoft/zentaoatf/internal/pkg/consts"
configHelper "github.com/easysoft/zentaoatf/internal/pkg/helper/config"
websocketHelper "github.com/easysoft/zentaoatf/internal/pkg/helper/websocket"
......@@ -16,10 +21,6 @@ import (
"github.com/fatih/color"
"github.com/kataras/iris/v12"
"github.com/kataras/iris/v12/websocket"
"io"
"os/exec"
"strings"
"time"
)
func ExecUnit(ch chan int,
......@@ -155,8 +156,6 @@ func RunUnitTest(ch chan int, cmdStr, workspacePath string, wsMsg *websocket.Mes
}
}
cmd.Wait()
ExitUnitTest:
errOutputArr := make([]string, 0)
if !isTerminal {
......@@ -181,5 +180,7 @@ ExitUnitTest:
logUtils.ExecFilef(errOutput)
}
cmd.Wait()
return
}
......@@ -63,26 +63,36 @@ func PrepareBug(workspacePath, seq string, caseIdStr string, productId int) (bug
}
steps := make([]string, 0)
stepsArray := make([]map[string]interface{}, 0)
stepIds := ""
for _, step := range cs.Steps {
if step.Status == commConsts.FAIL {
stepIds += step.Id + "_"
}
stepsContent := GenBugStepText(step)
steps = append(steps, stepsContent)
stepsArray = append(stepsArray, map[string]interface{}{
"name": step.Name,
"status": step.Status,
"steps": stepsContent,
})
}
bug = commDomain.ZtfBug{
Title: cs.Title,
Case: cs.Id,
Product: productId,
Steps: strings.Join(steps, "\n"), StepIds: stepIds,
Steps: strings.Join(steps, "\n"),
StepIds: stepIds,
Uid: uuid.NewV4().String(),
Type: "codeerror", Severity: 3, Pri: 3, OpenedBuild: []string{"trunk"},
CaseVersion: "0", OldTaskID: "0",
}
if commConsts.ExecFrom != commConsts.FromCmd {
jsonSteps, _ := json.Marshal(stepsArray)
bug.Steps = string(jsonSteps)
}
return
}
......
......@@ -3,9 +3,13 @@ package zentaoHelper
import (
"encoding/json"
"fmt"
"sort"
"strconv"
"strings"
"github.com/bitly/go-simplejson"
commConsts "github.com/easysoft/zentaoatf/internal/pkg/consts"
"github.com/easysoft/zentaoatf/internal/pkg/domain"
commDomain "github.com/easysoft/zentaoatf/internal/pkg/domain"
configHelper "github.com/easysoft/zentaoatf/internal/pkg/helper/config"
scriptHelper "github.com/easysoft/zentaoatf/internal/pkg/helper/script"
serverDomain "github.com/easysoft/zentaoatf/internal/server/modules/v1/domain"
......@@ -16,9 +20,6 @@ import (
logUtils "github.com/easysoft/zentaoatf/pkg/lib/log"
stdinUtils "github.com/easysoft/zentaoatf/pkg/lib/stdin"
"github.com/kataras/iris/v12"
"sort"
"strconv"
"strings"
)
func CommitCase(caseId int, title string,
......@@ -223,6 +224,21 @@ func LoadTestCasesDetail(productId, moduleId, suiteId, taskId int,
return
}
func LoadTestCasesDetailByCaseIds(caseIds []int,
config commDomain.WorkspaceConf) (cases []commDomain.ZtfCase, err error) {
for _, caseId := range caseIds {
cs, err := GetTestCaseDetail(caseId, config)
if err != nil {
continue
}
cases = append(cases, cs)
}
return
}
func GetTestCaseDetail(caseId int, config commDomain.WorkspaceConf) (cs commDomain.ZtfCase, err error) {
csWithSteps, err := GetCaseById(config.Url, caseId)
stepArr := genCaseSteps(csWithSteps)
......
......@@ -2,10 +2,11 @@ package zentaoHelper
import (
"fmt"
"path/filepath"
fileUtils "github.com/easysoft/zentaoatf/pkg/lib/file"
i118Utils "github.com/easysoft/zentaoatf/pkg/lib/i118"
logUtils "github.com/easysoft/zentaoatf/pkg/lib/log"
"path/filepath"
commDomain "github.com/easysoft/zentaoatf/internal/pkg/domain"
langHelper "github.com/easysoft/zentaoatf/internal/pkg/helper/lang"
......@@ -39,6 +40,8 @@ func SyncFromZentao(settings commDomain.SyncSettings, config commDomain.Workspac
if err == nil {
cases = append(cases, cs)
}
} else if len(settings.CaseIds) > 0 {
cases, err = LoadTestCasesDetailByCaseIds(settings.CaseIds, config)
} else {
cases, err = LoadTestCasesDetail(productId, moduleId, suiteId, taskId, config)
}
......
......@@ -143,6 +143,28 @@ func (c *ZentaoCtrl) ListTask(ctx iris.Context) {
ctx.JSON(c.SuccessResp(data))
}
func (c *ZentaoCtrl) ListCase(ctx iris.Context) {
siteId, err := ctx.URLParamInt("currSiteId")
productId, err := ctx.URLParamInt("currProductId")
moduleId := ctx.URLParamIntDefault("moduleId", 0)
suiteId := ctx.URLParamIntDefault("suiteId", 0)
taskId := ctx.URLParamIntDefault("taskId", 0)
if siteId == 0 || productId == 0 {
ctx.JSON(c.ErrResp(commConsts.ParamErr, err.Error()))
return
}
site, _ := c.SiteService.Get(uint(siteId))
config := configHelper.LoadBySite(site)
casesResp, err := zentaoHelper.LoadTestCaseSimple(productId, moduleId, suiteId, taskId, config)
if err != nil {
ctx.JSON(c.ErrResp(commConsts.ErrZentaoRequest, err.Error()))
return
}
ctx.JSON(c.SuccessResp(casesResp.Cases))
}
func (c *ZentaoCtrl) ListBugFields(ctx iris.Context) {
siteId, _ := ctx.URLParamInt("currSiteId")
productId, _ := ctx.URLParamInt("currProductId")
......
......@@ -29,6 +29,7 @@ func (m *ZentaoModule) Party() module.WebModule {
index.Get("/listModule", m.ZentaoCtrl.ListModule).Name = "模块列表"
index.Get("/listSuite", m.ZentaoCtrl.ListSuite).Name = "套件列表"
index.Get("/listTask", m.ZentaoCtrl.ListTask).Name = "任务列表"
index.Get("/listCase", m.ZentaoCtrl.ListCase).Name = "用例列表"
index.Get("/listBugFields", m.ZentaoCtrl.ListBugFields).Name = "获取缺陷属性数据"
}
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
%s
......
......@@ -18,6 +18,7 @@
type="checkbox"
class="z-thead-checkbox"
v-model="setting.isCheckAll"
@click="checkAll"
/>
</div>
</th>
......@@ -61,6 +62,7 @@
}
"
:value="row[setting.keyColumn]"
:checked="row.checked"
@click="checked"/>
</div>
</td>
......@@ -95,6 +97,7 @@
}
"
:value="row[setting.keyColumn]"
:checked="row.checked"
@click="checked"/>
</div>
</td>
......@@ -268,6 +271,10 @@ export default defineComponent({
type: Boolean,
default: false,
},
isCheckAll: {
type: Boolean,
default: false,
},
//Returns data type for checked of Checkbox
checkedReturnType: {
type: String,
......@@ -402,7 +409,7 @@ export default defineComponent({
// Enable slot mode
isSlotMode: props.isSlotMode,
// Whether to select all
isCheckAll: false,
isCheckAll: props.isCheckAll,
// Hide paging
isHidePaging: props.isHidePaging,
// KEY field name
......@@ -525,26 +532,44 @@ export default defineComponent({
/**
* Check all checkboxes for monitoring
*/
watch(
() => setting.isCheckAll,
(state: boolean) => {
let isChecked: Array<string | unknown> = [];
rowCheckbox.value.forEach((val: HTMLInputElement, i: number) => {
if (val) {
val.checked = state;
if (val.checked) {
if (props.checkedReturnType == "row") {
isChecked.push(localRows.value[i]);
} else {
isChecked.push(val.value);
}
// watch(
// () => setting.isCheckAll,
// (state: boolean) => {
// let isChecked: Array<string | unknown> = [];
// rowCheckbox.value.forEach((val: HTMLInputElement, i: number) => {
// if (val) {
// val.checked = state;
// if (val.checked) {
// if (props.checkedReturnType == "row") {
// isChecked.push(localRows.value[i]);
// } else {
// isChecked.push(val.value);
// }
// }
// }
// });
// // 回傳畫面上選上的資料 (Return the selected data on the screen)
// emit("return-checked-rows", isChecked);
// }
// );
}
const checkAll = (event: Event) => {
event.stopPropagation();
setting.isCheckAll = !setting.isCheckAll;
let isChecked: Array<string | unknown> = [];
rowCheckbox.value.forEach((val: HTMLInputElement, i: number) => {
val.checked = setting.isCheckAll;
if (val.checked) {
if (props.checkedReturnType == "row") {
isChecked.push(localRows.value[i]);
} else {
isChecked.push(val.value);
}
}
});
// 回傳畫面上選上的資料 (Return the selected data on the screen)
emit("return-checked-rows", isChecked);
}
);
}
});
// 回傳畫面上選上的資料 (Return the selected data on the screen)
emit("return-checked-rows", isChecked);
}
/**
......@@ -554,7 +579,7 @@ export default defineComponent({
event.stopPropagation();
let isChecked: Array<string | unknown> = [];
rowCheckbox.value.forEach((val: HTMLInputElement, i: number) => {
if (val && val.checked) {
if (val.checked) {
if (props.checkedReturnType == "row") {
isChecked.push(localRows.value[i]);
} else {
......@@ -562,6 +587,7 @@ export default defineComponent({
}
}
});
setting.isCheckAll = isChecked.length >= localRows.value.length;
// 回傳畫面上選上的資料 (Return the selected data on the screen)
emit("return-checked-rows", isChecked);
};
......@@ -745,6 +771,7 @@ export default defineComponent({
setting,
rowCheckbox,
checked,
checkAll,
doSort,
prevPage,
movePage,
......
......@@ -38,6 +38,15 @@ export default {
'none': 'None',
'all': 'All',
'only_failed': 'Only Failed',
'case_type_config': 'Configuration',
'case_type_feature': 'Feature',
'case_type_install': 'Installation',
'case_type_security': 'Security',
'case_type_performance': 'Performance',
'case_type_standard': 'Standard Specification',
'case_type_automation': 'TestScript',
'case_type_designdefect': 'DesignDefect',
'case_type_others': 'Others',
'zentao_site': 'Zentao Site',
'local': 'Local',
......@@ -229,6 +238,7 @@ export default {
'open-in-terminal': 'Open In Terminal',
'pls_select_task': 'Please select task',
'pls_select_step': 'Please select step',
'or_input_task_name': 'Or input new task name',
'task_name': 'Zentao Task Name',
......@@ -241,6 +251,7 @@ export default {
'pls_title': 'Please input title.',
'pls_name': 'Please input name.',
'pls_select_case': 'Please select cases.',
'pls_select_co_case': 'Please select cases.',
'pls_module': 'Please select module.',
'pls_suite': 'Please select suite.',
'pls_task': 'Please select task.',
......
......@@ -41,6 +41,15 @@ export default {
'all': '所有',
'none': '',
'only_failed': '仅失败用例',
'case_type_config': '配置相关',
'case_type_feature': '功能测试',
'case_type_install': '安装部署',
'case_type_security': '安全相关',
'case_type_performance': '性能测试',
'case_type_standard': '标准规范',
'case_type_automation': '测试脚本',
'case_type_designdefect': '设计缺陷',
'case_type_others': '其他',
'zentao_site': '禅道站点',
'local': '本地',
......@@ -240,6 +249,7 @@ export default {
'open-in-terminal': '从此位置打开命令行',
'pls_select_task': '请选择任务',
'pls_select_step': '请选择步骤',
'or_input_task_name': '或输入新任务标题',
'task_name': '禅道任务标题',
......@@ -252,6 +262,7 @@ export default {
'pls_title': '请输入标题',
'pls_name': '请输入名称',
'pls_select_case': '请选择需要执行的用例',
'pls_select_co_case': '请选择用例',
'pls_module': '请选择模块',
'pls_suite': '请选择套件',
'pls_task': '请选择任务',
......
......@@ -62,6 +62,15 @@ export async function queryTask(productId: string): Promise<any> {
});
}
export async function queryCase(params): Promise<any> {
return request({
url: `/${apiPath}/listCase`,
method: 'GET',
params,
});
}
export async function queryBugFields(): Promise<any> {
return request({
url: `/${apiPath}/listBugFields`,
......
......@@ -65,7 +65,13 @@
</FormItem>
<FormItem name="type" :label="t('step')">
<textarea v-model="modelRef.steps" rows="6" />
<div class="steps-contain">
<div class="steps-select" v-for="(item,index) in steps" :key="index">
<input type="checkbox" :id="'cbox'+index" :value="index" :checked="item.checked" @click="stepSelect" />
<label :for="'cbox'+index" :class="'steps-label step-' + item.status">{{item.name}}</label>
</div>
<textarea v-model="modelRef.steps" rows="6" />
</div>
</FormItem>
</Form>
</ZModal>
......@@ -121,13 +127,19 @@ let types = ref([])
let builds = ref([])
let severities = ref([])
let priorities = ref([])
const steps = ref([] as any)
const getBugData = () => {
prepareBugData(props.data).then((jsn) => {
steps.value = JSON.parse(jsn.data.steps);
steps.value.map((item, index) => {
item.checked = true;
});
modelRef.value = jsn.data
modelRef.value.module = ''
modelRef.value.severity = ''+modelRef.value.severity
modelRef.value.pri = ''+modelRef.value.pri
genSteps();
getBugFields()
})
}
......@@ -158,6 +170,10 @@ const submit = () => {
data.severity = parseInt(data.severity)
data.pri = parseInt(data.pri)
if (!Array.isArray(data.openedBuild)) data.openedBuild = [data.openedBuild]
if (data.steps == '') {
notification.error({message: t('pls_select_step')})
return
}
submitBugToZentao(data).then((json) => {
console.log('json', json)
......@@ -182,11 +198,44 @@ const clearFormData = () => {
modelRef.value = {};
};
const stepSelect = (val) => {
const index = val.target.value;
steps.value[index].checked = val.target.checked;
genSteps();
}
const genSteps = () => {
let newSteps = [] as any;
steps.value.forEach((item) => {
if (item.checked) {
newSteps.push(item.steps);
}
});
modelRef.value.steps = newSteps.join('\n');
}
defineExpose({
clearFormData,
});
</script>
<style lang="less" scoped>
.steps-contain{
display: flex;
flex: 1;
flex-direction: column;
.steps-select{
display: flex;
.steps-label{
margin-left: 10px;
}
.step-fail{
color: var(--color-red);
}
.step-pass{
color: var(--color-green);
}
}
}
</style>
......@@ -8,7 +8,7 @@
>
<Form>
<FormItem labelWidth="140px" :label="t('module')">
<select v-model="modelRef.moduleId">
<select v-model="modelRef.moduleId" @change="fetchCases">
<option key="" value="">&nbsp;</option>
<option v-for="item in modules" :key="item.id" :value="item.id">
<span v-html="item.name"></span>
......@@ -17,7 +17,7 @@
</FormItem>
<FormItem labelWidth="140px" :label="t('suite')">
<select v-model="modelRef.suiteId">
<select v-model="modelRef.suiteId" @change="fetchCases">
<option key="" value="">&nbsp;</option>
<option v-for="item in suites" :key="item.id" :value="item.id">
{{ item.name }}
......@@ -26,7 +26,7 @@
</FormItem>
<FormItem labelWidth="140px" :label="t('task')">
<select v-model="modelRef.taskId">
<select v-model="modelRef.taskId" @change="fetchCases">
<option key="" value="">&nbsp;</option>
<option v-for="item in tasks" :key="item.id" :value="item.id">
{{ item.name }}
......@@ -49,6 +49,28 @@
<FormItem labelWidth="140px" :label="t('independent_expect')">
<Switch v-model="modelRef.independentFile" />
</FormItem>
<Table
v-if="cases.length > 0"
:columns="columns"
:rows="cases"
:isHidePaging="true"
:isSlotMode="true"
:sortable="{}"
:hasCheckbox="true"
:isCheckAll="true"
ref="tableRef"
@return-checked-rows="onCheckedRows"
>
<template #Type="record">
{{ t('case_type_' + record.value.Type) }}
</template>
<template #LastRunResult="record">
{{ record.value.LastRunResult == '' ? '' : t(record.value.LastRunResult) }}
</template>
</Table>
<p v-else class="empty-tip">
{{ t("empty_data") }}
</p>
</Form>
</ZModal>
</template>
......@@ -74,6 +96,9 @@ import notification from "@/utils/notification";
import { useForm } from "@/utils/form";
import Switch from "@/components/Switch.vue";
import { ZentaoData } from "@/store/zentao";
import {queryCase} from "@/services/zentao";
import Table from "@/components/Table.vue";
export interface FormWorkspaceProps {
show?: boolean;
......@@ -122,13 +147,19 @@ const cancel = () => {
};
const submit = () => {
if(selectedCases.value.length === 0) {
notification.error({
message: t("pls_select_co_case"),
});
return;
}
if(disabled.value) {
return;
}
disabled.value = true;
console.log("syncFromZentaoSubmit", console.log(modelRef.value));
console.log("syncFromZentaoSubmit", console.log(selectedCases.value));
if (validate()) {
emit("submit", modelRef.value);
emit("submit", {caseIds:selectedCases.value, ...modelRef.value});
}
};
......@@ -143,6 +174,22 @@ const langs = computed<any[]>(() => store.state.Zentao.langs);
const modules = computed<any[]>(() => store.state.Zentao.modules);
const suites = computed<any[]>(() => store.state.Zentao.suites);
const tasks = computed<any[]>(() => store.state.Zentao.tasks);
const selectedCases = ref([] as number[]);
const cases = ref([]);
const fetchCases = () => {
queryCase({
siteId: currSite.value.id,
productId: currProduct.value.id,
...modelRef.value,
}).then((res) => {
res.data.forEach((item, index) => {
res.data[index].checked = true;
selectedCases.value.push(item.Id);
});
cases.value = res.data;
});
}
const fetchData = () => {
if(currSite.value.id == undefined || currSite.value.id <= 1
|| currProduct.value.id == undefined || currProduct.value.id <= 0) return;
......@@ -159,6 +206,7 @@ const fetchData = () => {
productId: currProduct.value.id,
});
};
fetchCases();
fetchData();
watch(
......@@ -190,6 +238,47 @@ const selectWorkspace = () => {
};
selectWorkspace();
const columns = ref([] as any[]);
const setColumns = () => {
columns.value = [
{
isKey: true,
label: t("no"),
field: "Id",
width: "60px",
},
{
label: t("title"),
field: "Title",
width: "60px",
},
{
label: t("type"),
field: "Type",
width: "60px",
},
{
label: t("status"),
field: "StatusName",
width: "60px",
},
{
label: t("result"),
field: "LastRunResult",
width: "60px",
},
];
};
setColumns();
const tableRef = ref({} as any);
const onCheckedRows = (rows: any[]) => {
selectedCases.value = rows.map((item) => {
return parseInt(item);
});
}
defineExpose({
clearFormData,
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册