|
|
@@ -1,6 +1,6 @@
|
|
|
<script setup lang="ts">
|
|
|
-import { ref,onMounted} from "vue";
|
|
|
-import { useRouter } from 'vue-router';
|
|
|
+import {ref, onMounted, defineProps} from "vue";
|
|
|
+import { useRouter,useRoute } from 'vue-router';
|
|
|
import { DocxList,Action,useDocxStore } from '../pinia/docx'
|
|
|
import axios, {AxiosResponse, AxiosError, AxiosRequestConfig} from 'axios';
|
|
|
import {ElLoading, ElMessage} from 'element-plus'
|
|
|
@@ -12,29 +12,140 @@ const token = 'sk-HcDTZ2PXVVKd7wkLBGhaf2S3YxZ5Jr7G7SBO974cZdQ='
|
|
|
|
|
|
//关于路由
|
|
|
const router = useRouter();
|
|
|
-const gotoLastPage = () => {
|
|
|
- router.push('/upload');
|
|
|
-};
|
|
|
-const gotoNextPage = () => {
|
|
|
- router.push('/tcFinalList');
|
|
|
-};
|
|
|
+const route = useRoute();
|
|
|
+console.log(route.query.id)
|
|
|
+
|
|
|
+const temp1 = [
|
|
|
+ {
|
|
|
+ "编号": "TC001.1",
|
|
|
+ "用例标题": "用户未登录",
|
|
|
+ "简短描述": "验证用户未登录时无法访问新增挡板页面"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "编号": "TC002.1",
|
|
|
+ "用例标题": "用户登录",
|
|
|
+ "简短描述": "验证用户登录后能否访问挡板设置"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "编号": "TC003.1",
|
|
|
+ "用例标题": "访问挡板配置",
|
|
|
+ "简短描述": "验证登录用户能否进入挡板配置"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "编号": "TC004.1",
|
|
|
+ "用例标题": "新增挡板页面加载",
|
|
|
+ "简短描述": "验证用户点击新增挡板后页面是否正确加载"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "编号": "TC005.1",
|
|
|
+ "用例标题": "选择HTTP协议",
|
|
|
+ "简短描述": "验证用户在协议类型选择时,系统是否显示FORM选项"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "编号": "TC006.1",
|
|
|
+ "用例标题": "选择非HTTP协议",
|
|
|
+ "简短描述": "验证用户在非HTTP协议下,系统是否不显示FORM选项"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "编号": "TC007.1",
|
|
|
+ "用例标题": "选择FORM报文格式",
|
|
|
+ "简短描述": "验证用户在HTTP协议下,系统是否允许选择FORM报文格式"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "编号": "TC008.1",
|
|
|
+ "用例标题": "选择非FORM报文格式",
|
|
|
+ "简短描述": "验证用户在HTTP协议下,系统是否允许选择非FORM报文格式"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "编号": "TC009.1",
|
|
|
+ "用例标题": "输入服务方",
|
|
|
+ "简短描述": "验证用户输入服务方字段时,系统是否允许输入"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "编号": "TC010.1",
|
|
|
+ "用例标题": "输入消费方",
|
|
|
+ "简短描述": "验证用户输入消费方字段时,系统是否允许输入"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "编号": "TC011.1",
|
|
|
+ "用例标题": "输入URL前缀",
|
|
|
+ "简短描述": "验证用户输入URL前缀字段时,系统是否允许输入"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "编号": "TC012.1",
|
|
|
+ "用例标题": "输入挡板类型",
|
|
|
+ "简短描述": "验证用户输入挡板类型时,系统是否允许选择"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "编号": "TC013.1",
|
|
|
+ "用例标题": "输入挡板名称",
|
|
|
+ "简短描述": "验证用户输入挡板名称字段时,系统是否允许输入"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "编号": "TC014.1",
|
|
|
+ "用例标题": "选择测试环境",
|
|
|
+ "简短描述": "验证用户选择测试环境时,系统是否显示下拉选项"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "编号": "TC015.1",
|
|
|
+ "用例标题": "输入非法编码格式",
|
|
|
+ "简短描述": "验证用户输入非法编码格式时,系统是否显示错误提示"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "编号": "TC016.1",
|
|
|
+ "用例标题": "点击取消按钮",
|
|
|
+ "简短描述": "验证用户点击取消按钮时,是否返回上一级页面"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "编号": "TC017.1",
|
|
|
+ "用例标题": "点击确定按钮-正确输入",
|
|
|
+ "简短描述": "验证用户输入合法信息后点击确定,挡板是否成功保存"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "编号": "TC017.2",
|
|
|
+ "用例标题": "点击确定按钮-非法输入",
|
|
|
+ "简短描述": "验证用户输入非法信息后点击确定,系统是否显示错误提示"
|
|
|
+ }
|
|
|
+]
|
|
|
+
|
|
|
+//const temp2 = [{"description":"生成用例", "times":"2024-05-24"}]
|
|
|
+
|
|
|
+// //历史操作记录
|
|
|
+// const actionList = ref<Action[]>([])
|
|
|
+// // actionList.value = JSON.parse(useStore.taskList[itemIndex.value].actionList)
|
|
|
+// console.log(actionList.value)
|
|
|
+
|
|
|
+// let testCase: Array<any> = []
|
|
|
+// 默认展示第一个列表
|
|
|
+// testCase = (JSON.parse(useStore.taskList[itemIndex.value].testCaseList))
|
|
|
+function findById(i): any{
|
|
|
+ console.log(useStore.taskList)
|
|
|
+ for (let item of useStore.taskList){
|
|
|
+ console.log(item.testCaseListId)
|
|
|
+ if(item.testCaseListId == i){
|
|
|
+ console.log(item)
|
|
|
+ return item;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const testCase = ref<any>([])
|
|
|
+const actionList = ref<any>([])
|
|
|
+const itemIndex = ref(route.query.id)
|
|
|
+
|
|
|
+let res = findById(itemIndex.value)
|
|
|
+console.log(res)
|
|
|
+testCase.value = JSON.parse(res.testCaseList)
|
|
|
+actionList.value = JSON.parse(res.actionList)
|
|
|
+
|
|
|
+console.log(testCase)
|
|
|
+
|
|
|
|
|
|
onMounted(()=>{
|
|
|
- Showecharts()
|
|
|
})
|
|
|
|
|
|
-const docxList = ref<DocxList[]>([])
|
|
|
-docxList.value = useStore.DocxList
|
|
|
-const itemIndex = ref(0)
|
|
|
const textarea = ref('')
|
|
|
|
|
|
-//历史操作记录
|
|
|
-const actionList = ref<Action[]>([])
|
|
|
-console.log(useStore.DocxList[itemIndex.value])
|
|
|
-actionList.value = useStore.DocxList[itemIndex.value].actionList;
|
|
|
-console.log(actionList.value)
|
|
|
-
|
|
|
-
|
|
|
function parseOutput(output: string): any[] {
|
|
|
const leftIndex = output.indexOf("[")
|
|
|
const rightIndex = output.lastIndexOf("]")
|
|
|
@@ -46,15 +157,6 @@ function parseOutput(output: string): any[] {
|
|
|
return testCaseArray;
|
|
|
}
|
|
|
|
|
|
-const testCase = ref<any>([]);
|
|
|
-// 默认展示第一个列表
|
|
|
-testCase.value = useStore.DocxList[itemIndex.value].docxMessageList
|
|
|
-console.log(testCase.value)
|
|
|
-console.log(actionList.value)
|
|
|
-const docxMessage = (index: number) => {
|
|
|
- itemIndex.value = index
|
|
|
- testCase.value = useStore.DocxList[itemIndex.value].docxMessageList
|
|
|
-}
|
|
|
|
|
|
//细化用例
|
|
|
const handleImproveButton = (p: { row: any }) => {
|
|
|
@@ -252,75 +354,62 @@ const addDocxList = () => {
|
|
|
}
|
|
|
}
|
|
|
// echarts-bxo
|
|
|
-function Showecharts() {
|
|
|
- var chartDom = document.getElementById('pt');
|
|
|
- var myChart = echarts.init(chartDom);
|
|
|
- var option;
|
|
|
-
|
|
|
- option = {
|
|
|
- tooltip: {
|
|
|
- trigger: 'item'
|
|
|
- },
|
|
|
- legend: {
|
|
|
- top: '5%',
|
|
|
- left: 'center',
|
|
|
- textStyle:{
|
|
|
- fontSize:8
|
|
|
- }
|
|
|
- },
|
|
|
- series: [
|
|
|
- {
|
|
|
- name: 'Access From',
|
|
|
- type: 'pie',
|
|
|
- radius: ['40%', '70%'],
|
|
|
- avoidLabelOverlap: false,
|
|
|
- padAngle: 5,
|
|
|
- itemStyle: {
|
|
|
- borderRadius: 10
|
|
|
- },
|
|
|
- label: {
|
|
|
- show: false,
|
|
|
- position: 'center',
|
|
|
- fontSize:12
|
|
|
- },
|
|
|
- emphasis: {
|
|
|
- label: {
|
|
|
- show: true,
|
|
|
- fontSize: 40,
|
|
|
- fontWeight:700
|
|
|
- }
|
|
|
- },
|
|
|
- labelLine: {
|
|
|
- show: false
|
|
|
- },
|
|
|
- data: [
|
|
|
- { value:useStore.DocxList.length, name: '.docx文件'},
|
|
|
- {value:5,name:'.excel文件'},
|
|
|
- {value:6,name:'.ppt文件'}
|
|
|
- ]
|
|
|
- }
|
|
|
- ]
|
|
|
- };
|
|
|
- option && myChart.setOption(option);
|
|
|
-}
|
|
|
+// function Showecharts() {
|
|
|
+// var chartDom = document.getElementById('pt');
|
|
|
+// var myChart = echarts.init(chartDom);
|
|
|
+// var option;
|
|
|
+//
|
|
|
+// option = {
|
|
|
+// tooltip: {
|
|
|
+// trigger: 'item'
|
|
|
+// },
|
|
|
+// legend: {
|
|
|
+// top: '5%',
|
|
|
+// left: 'center',
|
|
|
+// textStyle:{
|
|
|
+// fontSize:8
|
|
|
+// }
|
|
|
+// },
|
|
|
+// series: [
|
|
|
+// {
|
|
|
+// name: 'Access From',
|
|
|
+// type: 'pie',
|
|
|
+// radius: ['40%', '70%'],
|
|
|
+// avoidLabelOverlap: false,
|
|
|
+// padAngle: 5,
|
|
|
+// itemStyle: {
|
|
|
+// borderRadius: 10
|
|
|
+// },
|
|
|
+// label: {
|
|
|
+// show: false,
|
|
|
+// position: 'center',
|
|
|
+// fontSize:12
|
|
|
+// },
|
|
|
+// emphasis: {
|
|
|
+// label: {
|
|
|
+// show: true,
|
|
|
+// fontSize: 40,
|
|
|
+// fontWeight:700
|
|
|
+// }
|
|
|
+// },
|
|
|
+// labelLine: {
|
|
|
+// show: false
|
|
|
+// },
|
|
|
+// data: [
|
|
|
+// { value:useStore.DocxList.length, name: '.docx文件'},
|
|
|
+// {value:5,name:'.excel文件'},
|
|
|
+// {value:6,name:'.ppt文件'}
|
|
|
+// ]
|
|
|
+// }
|
|
|
+// ]
|
|
|
+// };
|
|
|
+// option && myChart.setOption(option);
|
|
|
+// }
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
+ <router-view :key="route.fullPath" />
|
|
|
<el-container>
|
|
|
-<!-- <el-aside width="200px" style="overflow: hidden; margin-right:20px;">-->
|
|
|
-<!-- <el-card style="width:100%; border:0;" body-style="padding:0; margin:0;">-->
|
|
|
-<!-- <template #header>-->
|
|
|
-<!-- <div class="card-header">-->
|
|
|
-<!-- <span style ="font-size: 20px">文件名</span>-->
|
|
|
-<!-- </div>-->
|
|
|
-<!-- </template>-->
|
|
|
-<!-- <div class="card-item" v-for="(item, index) in docxList" :key="index" @click="docxMessage(index)"-->
|
|
|
-<!-- :class="{ active: index == itemIndex }">-->
|
|
|
-<!-- {{ item.docxName }}-->
|
|
|
-<!-- </div>-->
|
|
|
-<!-- </el-card>-->
|
|
|
-<!-- </el-aside>-->
|
|
|
-
|
|
|
<el-container>
|
|
|
<el-main style="display:flex; overflow: hidden; margin: 0; padding: 0;">
|
|
|
<div class="root">
|