|
|
@@ -25,9 +25,6 @@ onMounted(()=>{
|
|
|
})
|
|
|
|
|
|
|
|
|
-type Action = {
|
|
|
- description: String,
|
|
|
-}
|
|
|
type docxList = {
|
|
|
docxName: String,
|
|
|
docxMessageList?: Array<object>
|
|
|
@@ -40,7 +37,10 @@ const textarea = ref('')
|
|
|
|
|
|
//历史操作记录
|
|
|
const actionList = ref<any>([]);
|
|
|
-actionList.value = useStore.DocxList[itemIndex.value].actionList
|
|
|
+
|
|
|
+// actionList.value = [{
|
|
|
+// description: "操作记录"
|
|
|
+// }]
|
|
|
|
|
|
interface InputVariable {
|
|
|
name: string;
|
|
|
@@ -82,9 +82,9 @@ const docxMessage = (index: number) => {
|
|
|
|
|
|
//细化用例
|
|
|
const handleImproveButton = (p: { row: any }) => {
|
|
|
- console.log(p.row);
|
|
|
- let improve_id = p.row.id+1;
|
|
|
|
|
|
+ let improve_id = p.row.编号;
|
|
|
+ console.log(improve_id)
|
|
|
//调接口
|
|
|
const data: {
|
|
|
inputVariables: InputVariable[];
|
|
|
@@ -121,10 +121,11 @@ const handleImproveButton = (p: { row: any }) => {
|
|
|
const parsedOutput = JSON.stringify(JSON.parse(output)).replace(/"```json\\n/g, '').replace(/\\n/g, '').replace(/\\/g, '').replace(/ /g,'');
|
|
|
//更新用例列表
|
|
|
useStore.DocxList[itemIndex.value].docxMessageList = parseTestCases(parsedOutput);
|
|
|
+ testCase.value = useStore.DocxList[itemIndex.value].docxMessageList;
|
|
|
//更新操作记录
|
|
|
- useStore.DocxList[itemIndex.value].actionList.push({
|
|
|
- description: "细化用例"+improve_id
|
|
|
- });
|
|
|
+ actionList.value.push({description: "细化用例"+improve_id});
|
|
|
+ useStore.DocxList[itemIndex.value].actionList = actionList;
|
|
|
+
|
|
|
})
|
|
|
.catch((error: AxiosError<any>) => {
|
|
|
console.log(error);
|
|
|
@@ -134,7 +135,7 @@ const handleImproveButton = (p: { row: any }) => {
|
|
|
// 删除用例
|
|
|
const deteleList = (scope: { row: any }) => {
|
|
|
|
|
|
- const delete_id = scope.row.id+1;
|
|
|
+ const delete_id = scope.row.编号;
|
|
|
console.log(delete_id)
|
|
|
const data: {
|
|
|
inputVariables: InputVariable[];
|
|
|
@@ -172,10 +173,10 @@ const deteleList = (scope: { row: any }) => {
|
|
|
|
|
|
//更新用例列表
|
|
|
useStore.DocxList[itemIndex.value].docxMessageList = parseTestCases(parsedOutput);
|
|
|
+ testCase.value = useStore.DocxList[itemIndex.value].docxMessageList;
|
|
|
//更新操作记录
|
|
|
- useStore.DocxList[itemIndex.value].actionList.push({
|
|
|
- description: "删除用例"+delete_id
|
|
|
- });
|
|
|
+ actionList.value.push({description: "删除用例"+delete_id})
|
|
|
+ useStore.DocxList[itemIndex.value].actionList = actionList;
|
|
|
})
|
|
|
.catch((error: AxiosError<any>) => {
|
|
|
console.log(error);
|
|
|
@@ -223,11 +224,10 @@ const addDocxList = () => {
|
|
|
const parsedOutput = JSON.stringify(JSON.parse(output)).replace(/"```json\\n/g, '').replace(/\\n/g, '').replace(/\\/g, '').replace(/ /g,'');
|
|
|
//更新用例列表
|
|
|
useStore.DocxList[itemIndex.value].docxMessageList = parseTestCases(parsedOutput);
|
|
|
+ testCase.value = useStore.DocxList[itemIndex.value].docxMessageList
|
|
|
//更新操作记录
|
|
|
-
|
|
|
- useStore.DocxList[itemIndex.value].actionList.push({
|
|
|
- description: "添加用例"
|
|
|
- });
|
|
|
+ actionList.value.push({description: "添加用例"})
|
|
|
+ useStore.DocxList[itemIndex.value].actionList = actionList;
|
|
|
loadingInstance1.close()
|
|
|
ElMessage({
|
|
|
message: '添加成功',
|
|
|
@@ -331,8 +331,8 @@ function Showecharts() {
|
|
|
</el-row>
|
|
|
<el-col class="container">
|
|
|
<el-table :data="testCase" style="width: 100%" border>
|
|
|
- <el-table-column label="编号" prop="编号" width="80" />
|
|
|
- <el-table-column label="用例标题" prop="用例标题" min-width="200" />
|
|
|
+ <el-table-column label="编号" prop="编号" width="100" />
|
|
|
+ <el-table-column label="用例标题" prop="用例标题" min-width="50" />
|
|
|
<el-table-column show-overflow-tooltip label="简短描述" prop="简短描述" min-width="150" />
|
|
|
<el-table-column width="60">
|
|
|
<template #default="scope">
|
|
|
@@ -364,6 +364,7 @@ function Showecharts() {
|
|
|
</div>
|
|
|
<div class="timeline">
|
|
|
<div class="header-Box">
|
|
|
+ <span>操作记录</span>
|
|
|
<el-timeline>
|
|
|
<el-timeline-item v-for="(activity, index) in actionList" :key="index" :timestamp="activity.time"
|
|
|
size=large>
|