移除测试文件
This commit is contained in:
56
cdTMP/package-lock.json
generated
56
cdTMP/package-lock.json
generated
@@ -32,7 +32,7 @@
|
||||
"vue": "^3.5.25",
|
||||
"vue-clipboard3": "^2.0.0",
|
||||
"vue-color-kit": "^1.0.6",
|
||||
"vue-data-ui": "^3.7.14",
|
||||
"vue-data-ui": "^3.7.15",
|
||||
"vue-router": "^4.6.3",
|
||||
"vuedraggable": "^2.24.3"
|
||||
},
|
||||
@@ -46,13 +46,13 @@
|
||||
"@vitejs/plugin-vue": "^6.0.2",
|
||||
"@vitejs/plugin-vue-jsx": "^5.1.2",
|
||||
"@vue/babel-plugin-jsx": "^2.0.1",
|
||||
"browserslist": "^4.28.0",
|
||||
"browserslist": "^4.28.1",
|
||||
"eslint": "^9.39.1",
|
||||
"eslint-plugin-vue": "^10.6.2",
|
||||
"less": "^4.4.2",
|
||||
"less-loader": "^12.3.0",
|
||||
"postcss": "^8.5.6",
|
||||
"prettier": "^3.7.3",
|
||||
"prettier": "^3.7.4",
|
||||
"rollup-plugin-visualizer": "^6.0.5",
|
||||
"tailwindcss": "^4.1.17",
|
||||
"typescript": "^5.9.3",
|
||||
@@ -2338,9 +2338,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/baseline-browser-mapping": {
|
||||
"version": "2.8.28",
|
||||
"resolved": "https://registry.npmmirror.com/baseline-browser-mapping/-/baseline-browser-mapping-2.8.28.tgz",
|
||||
"integrity": "sha512-gYjt7OIqdM0PcttNYP2aVrr2G0bMALkBaoehD4BuRGjAOtipg0b6wHg1yNL+s5zSnLZZrGHOw4IrND8CD+3oIQ==",
|
||||
"version": "2.9.0",
|
||||
"resolved": "https://registry.npmmirror.com/baseline-browser-mapping/-/baseline-browser-mapping-2.9.0.tgz",
|
||||
"integrity": "sha512-Mh++g+2LPfzZToywfE1BUzvZbfOY52Nil0rn9H1CPC5DJ7fX+Vir7nToBeoiSbB1zTNeGYbELEvJESujgGrzXw==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
@@ -2381,9 +2381,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/browserslist": {
|
||||
"version": "4.28.0",
|
||||
"resolved": "https://registry.npmmirror.com/browserslist/-/browserslist-4.28.0.tgz",
|
||||
"integrity": "sha512-tbydkR/CxfMwelN0vwdP/pLkDwyAASZ+VfWm4EOwlB6SWhx1sYnWLqo8N5j0rAzPfzfRaxt0mM/4wPU/Su84RQ==",
|
||||
"version": "4.28.1",
|
||||
"resolved": "https://registry.npmmirror.com/browserslist/-/browserslist-4.28.1.tgz",
|
||||
"integrity": "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -2402,11 +2402,11 @@
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"baseline-browser-mapping": "^2.8.25",
|
||||
"caniuse-lite": "^1.0.30001754",
|
||||
"electron-to-chromium": "^1.5.249",
|
||||
"baseline-browser-mapping": "^2.9.0",
|
||||
"caniuse-lite": "^1.0.30001759",
|
||||
"electron-to-chromium": "^1.5.263",
|
||||
"node-releases": "^2.0.27",
|
||||
"update-browserslist-db": "^1.1.4"
|
||||
"update-browserslist-db": "^1.2.0"
|
||||
},
|
||||
"bin": {
|
||||
"browserslist": "cli.js"
|
||||
@@ -2455,9 +2455,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/caniuse-lite": {
|
||||
"version": "1.0.30001755",
|
||||
"resolved": "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001755.tgz",
|
||||
"integrity": "sha512-44V+Jm6ctPj7R52Na4TLi3Zri4dWUljJd+RDm+j8LtNCc/ihLCT+X1TzoOAkRETEWqjuLnh9581Tl80FvK7jVA==",
|
||||
"version": "1.0.30001759",
|
||||
"resolved": "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001759.tgz",
|
||||
"integrity": "sha512-Pzfx9fOKoKvevQf8oCXoyNRQ5QyxJj+3O0Rqx2V5oxT61KGx8+n6hV/IUyJeifUci2clnmmKVpvtiqRzgiWjSw==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -2755,9 +2755,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/electron-to-chromium": {
|
||||
"version": "1.5.254",
|
||||
"resolved": "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.5.254.tgz",
|
||||
"integrity": "sha512-DcUsWpVhv9svsKRxnSCZ86SjD+sp32SGidNB37KpqXJncp1mfUgKbHvBomE89WJDbfVKw1mdv5+ikrvd43r+Bg==",
|
||||
"version": "1.5.264",
|
||||
"resolved": "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.5.264.tgz",
|
||||
"integrity": "sha512-1tEf0nLgltC3iy9wtlYDlQDc5Rg9lEKVjEmIHJ21rI9OcqkvD45K1oyNIRA4rR1z3LgJ7KeGzEBojVcV6m4qjA==",
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
@@ -4622,9 +4622,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/prettier": {
|
||||
"version": "3.7.3",
|
||||
"resolved": "https://registry.npmmirror.com/prettier/-/prettier-3.7.3.tgz",
|
||||
"integrity": "sha512-QgODejq9K3OzoBbuyobZlUhznP5SKwPqp+6Q6xw6o8gnhr4O85L2U915iM2IDcfF2NPXVaM9zlo9tdwipnYwzg==",
|
||||
"version": "3.7.4",
|
||||
"resolved": "https://registry.npmmirror.com/prettier/-/prettier-3.7.4.tgz",
|
||||
"integrity": "sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
@@ -5299,9 +5299,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/update-browserslist-db": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmmirror.com/update-browserslist-db/-/update-browserslist-db-1.1.4.tgz",
|
||||
"integrity": "sha512-q0SPT4xyU84saUX+tomz1WLkxUbuaJnR1xWt17M7fJtEJigJeWUNGUqrauFXsHnqev9y9JTRGwk13tFBuKby4A==",
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmmirror.com/update-browserslist-db/-/update-browserslist-db-1.2.1.tgz",
|
||||
"integrity": "sha512-R9NcHbbZ45RoWfTdhn1J9SS7zxNvlddv4YRrHTUaFdtjbmfncfedB45EC9IaqJQ97iAR1GZgOfyRQO+ExIF6EQ==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -5462,9 +5462,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/vue-data-ui": {
|
||||
"version": "3.7.14",
|
||||
"resolved": "https://registry.npmmirror.com/vue-data-ui/-/vue-data-ui-3.7.14.tgz",
|
||||
"integrity": "sha512-MhEd3ZN0w1VVAnJPwo1xCcx1bg8owGm3+4Apn/kxO/dh+k3NqOXdGjaRrKOZdqc63l1GQ03hrAVknYxpILo9hA==",
|
||||
"version": "3.7.15",
|
||||
"resolved": "https://registry.npmmirror.com/vue-data-ui/-/vue-data-ui-3.7.15.tgz",
|
||||
"integrity": "sha512-JGYwU4tWiRC9FmIsApaCOHgmVqAMMJOihaThqVcqwEpUyGOdzH0fkWyQcZcovEqWXzL5YnziG/9ncMoYN784ng==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"jspdf": "^3.0.1",
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
"vue": "^3.5.25",
|
||||
"vue-clipboard3": "^2.0.0",
|
||||
"vue-color-kit": "^1.0.6",
|
||||
"vue-data-ui": "^3.7.14",
|
||||
"vue-data-ui": "^3.7.15",
|
||||
"vue-router": "^4.6.3",
|
||||
"vuedraggable": "^2.24.3"
|
||||
},
|
||||
@@ -49,13 +49,13 @@
|
||||
"@vitejs/plugin-vue": "^6.0.2",
|
||||
"@vitejs/plugin-vue-jsx": "^5.1.2",
|
||||
"@vue/babel-plugin-jsx": "^2.0.1",
|
||||
"browserslist": "^4.28.0",
|
||||
"browserslist": "^4.28.1",
|
||||
"eslint": "^9.39.1",
|
||||
"eslint-plugin-vue": "^10.6.2",
|
||||
"less": "^4.4.2",
|
||||
"less-loader": "^12.3.0",
|
||||
"postcss": "^8.5.6",
|
||||
"prettier": "^3.7.3",
|
||||
"prettier": "^3.7.4",
|
||||
"rollup-plugin-visualizer": "^6.0.5",
|
||||
"tailwindcss": "^4.1.17",
|
||||
"typescript": "^5.9.3",
|
||||
|
||||
@@ -13,6 +13,14 @@ export default {
|
||||
* @returns 可流式或一次性
|
||||
*/
|
||||
getAiTestItem(data: DataRowType) {
|
||||
if (import.meta.env.DEV) {
|
||||
return request({
|
||||
url: `/local_doc_qa/testing_item`,
|
||||
timeout: 20000,
|
||||
method: "post",
|
||||
data
|
||||
})
|
||||
}
|
||||
return request({
|
||||
url: `${AI_API_BASE}/api/local_doc_qa/testing_item`,
|
||||
timeout: 20000,
|
||||
|
||||
@@ -33,7 +33,7 @@ export default {
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 添加被测件
|
||||
* 添加测试项
|
||||
* @returns
|
||||
*/
|
||||
save(params = {}) {
|
||||
|
||||
@@ -65,6 +65,7 @@ const useTreeDataStore = defineStore("treeDataStore", {
|
||||
},
|
||||
// 新增删除designDemand后tree显示-注意传的是测试项的key
|
||||
async updateDesignDemandTreeData(data, projrctId) {
|
||||
console.log(data);
|
||||
let temp = data.key.split("-")
|
||||
temp.pop(-1)
|
||||
let roundKey = temp[0]
|
||||
|
||||
@@ -10,10 +10,7 @@
|
||||
<img src="@/assets/img/wxwx-logo.svg" width="45" /><span>{{ $title }}</span>
|
||||
</div>
|
||||
<div class="slogan flex justify-end">
|
||||
<span
|
||||
class="font-extrabold bg-clip-text text-transparent bg-gradient-to-r from-blue-500 to-purple-600"
|
||||
>---- 为测评服务,打造测评高地</span
|
||||
>
|
||||
<span class="font-extrabold bg-clip-text text-transparent bg-gradient-to-r from-blue-500 to-purple-600">---- 为测评服务,打造测评高地</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -28,14 +25,7 @@
|
||||
{ maxLength: 30, message: '用户名不能超过30个字符' }
|
||||
]"
|
||||
>
|
||||
<a-input
|
||||
v-model="form.username"
|
||||
class="w-full"
|
||||
size="large"
|
||||
placeholder="用户名"
|
||||
allow-clear
|
||||
:max-length="30"
|
||||
>
|
||||
<a-input v-model="form.username" class="w-full" size="large" placeholder="用户名" allow-clear :max-length="30">
|
||||
<template #prefix><icon-user /></template>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
@@ -48,13 +38,7 @@
|
||||
{ maxLength: 30, message: '密码不超过30字符' }
|
||||
]"
|
||||
>
|
||||
<a-input-password
|
||||
v-model="form.password"
|
||||
placeholder="请输入密码"
|
||||
size="large"
|
||||
allow-clear
|
||||
:max-length="30"
|
||||
>
|
||||
<a-input-password v-model="form.password" placeholder="请输入密码" size="large" allow-clear :max-length="30">
|
||||
<template #prefix><icon-lock /></template>
|
||||
</a-input-password>
|
||||
</a-form-item>
|
||||
@@ -70,13 +54,7 @@
|
||||
}
|
||||
]"
|
||||
>
|
||||
<a-input
|
||||
v-model="form.code"
|
||||
placeholder="请输入验证码"
|
||||
size="large"
|
||||
allow-clear
|
||||
:max-length="4"
|
||||
>
|
||||
<a-input v-model="form.code" placeholder="请输入验证码" size="large" allow-clear :max-length="4">
|
||||
<template #prefix><icon-safe /></template>
|
||||
<template #append>
|
||||
<verify-code ref="Verify" />
|
||||
@@ -85,9 +63,7 @@
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item :hide-label="true" class="mt-5">
|
||||
<a-button html-type="submit" type="primary" long size="large" :loading="loading">
|
||||
登录
|
||||
</a-button>
|
||||
<a-button html-type="submit" type="primary" long size="large" :loading="loading"> 登录 </a-button>
|
||||
</a-form-item>
|
||||
|
||||
<a-divider orientation="center">未来登录方式</a-divider>
|
||||
@@ -115,7 +91,7 @@ const router = useRouter()
|
||||
const userStore = useUserStore()
|
||||
// 绑定登录form的数据
|
||||
// const form = reactive({ username: "superAdmin", password: "admin123", code: "" })
|
||||
const form = reactive({ username: "", password: "", code: "" })
|
||||
const form = reactive({ username: "superAdmin", password: "admin123", code: "" })
|
||||
// 获取验证码dom && arco表单loading
|
||||
const Verify = ref(null)
|
||||
const loading = ref(null)
|
||||
@@ -185,7 +161,9 @@ const handleSubmit = async ({ values, errors }) => {
|
||||
top: 50%;
|
||||
margin-top: -255px;
|
||||
border-radius: var(--border-radius-small);
|
||||
box-shadow: rgba(0, 0, 0, 0.25) 0px 14px 28px, rgba(0, 0, 0, 0.22) 0px 10px 10px;
|
||||
box-shadow:
|
||||
rgba(0, 0, 0, 0.25) 0px 14px 28px,
|
||||
rgba(0, 0, 0, 0.22) 0px 10px 10px;
|
||||
backdrop-filter: blur(3px);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,12 +49,7 @@ export default defineComponent({
|
||||
{{
|
||||
default: () => (
|
||||
<div class="preview-container">
|
||||
<div
|
||||
class="button-like"
|
||||
ref={buttonLikeRef}
|
||||
onMouseenter={onMouseenter}
|
||||
onMouseleave={onMouseleave}
|
||||
>
|
||||
<div class="button-like" ref={buttonLikeRef} onMouseenter={onMouseenter} onMouseleave={onMouseleave}>
|
||||
<icon-find-replace />
|
||||
{hoverText.value && <span class="ml-2">{hoverText.value}</span>}
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="ai-modal-container">
|
||||
<a-modal v-model:visible="visible" width="80%" unmount-on-close draggable>
|
||||
<a-modal v-model:visible="visible" width="80%" unmount-on-close draggable :footer="false">
|
||||
<template #title> AI生成测试项 </template>
|
||||
<div class="flex flex-col">
|
||||
<a-button type="primary" :disabled="generateLoading" @click="generateClick">{{
|
||||
@@ -24,10 +24,10 @@
|
||||
<div class="item-container">
|
||||
<a-input-group>
|
||||
<div class="index-hao">{{ indexTu[index] }}</div>
|
||||
测试项:
|
||||
<span class="label">测试项:</span>
|
||||
<a-input placeholder="测试项标识" v-model="item.ident" :style="{ width: '100px' }" @click.stop.prevent></a-input>
|
||||
<a-input placeholder="测试项名称" v-model="item.title" :style="{ width: '200px' }" @click.stop.prevent></a-input>
|
||||
<a-select placeholder="选择优先级" v-model="item.priority" :style="{ width: '100px' }">
|
||||
<a-input placeholder="测试项名称" v-model="item.title" :style="{ width: '250px' }" @click.stop.prevent></a-input>
|
||||
<a-select placeholder="选择优先级" v-model="item.priority" :style="{ width: '150px' }">
|
||||
<a-option value="1">高</a-option>
|
||||
<a-option value="2">中</a-option>
|
||||
<a-option value="3">低</a-option>
|
||||
@@ -37,7 +37,7 @@
|
||||
{{ type.title }}
|
||||
</a-option>
|
||||
</a-select>
|
||||
<a-select placeholder="选择测试手段" multiple v-model="item.testMethod" :style="{ width: '250px' }">
|
||||
<a-select placeholder="选择测试手段" multiple v-model="item.testMethod" :style="{ width: '400px' }">
|
||||
<a-option v-for="method in testMethod" :key="method.key" :value="method.key">
|
||||
{{ method.title }}
|
||||
</a-option>
|
||||
@@ -56,17 +56,17 @@
|
||||
<tr class="arco-table-tr">
|
||||
<th class="arco-table-th" :width="100">
|
||||
<span class="arco-table-cell arco-table-cell-align-center">
|
||||
<span class="arco-table-th-title">子项序号</span>
|
||||
<span class="arco-table-th-title label">子项序号</span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="arco-table-th" :width="400">
|
||||
<span class="arco-table-cell arco-table-cell-align-center">
|
||||
<span class="arco-table-th-title">测试子项描述</span>
|
||||
<span class="arco-table-th-title label">测试子项描述</span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="arco-table-th" :width="800">
|
||||
<span class="arco-table-cell arco-table-cell-align-center">
|
||||
<span class="arco-table-th-title">测试子项步骤</span>
|
||||
<span class="arco-table-th-title label">测试子项步骤</span>
|
||||
</span>
|
||||
</th>
|
||||
</tr>
|
||||
@@ -98,7 +98,11 @@
|
||||
</a-list-item>
|
||||
</template>
|
||||
</a-list>
|
||||
<div class="luButton">
|
||||
<a-button :loading="luButtonLoading" type="primary" @click="luButtonClick">确认录入测试项</a-button>
|
||||
</div>
|
||||
</div>
|
||||
<ParentPreview :parent-key="currentKey" />
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
@@ -112,6 +116,9 @@ import OpeAndExpect from "./OpeAndExpect.vue" // 操作和预期子表格
|
||||
import aiApi from "@/api/outs/aiApi"
|
||||
import { Message } from "@arco-design/web-vue"
|
||||
import tool from "@/utils/tool"
|
||||
import { isEmpty } from "lodash-es"
|
||||
import demandApi from "@/api/project/testDemand"
|
||||
import ParentPreview from "@/views/project/ParentPreview/index.vue"
|
||||
|
||||
// 常量
|
||||
const indexTu = "①②③④⑤⑥⑦⑧⑨⑩⑪⑫⑬⑭⑮⑯⑰⑱⑲⑳㉑㉒㉓㉔㉕㉖㉗㉘㉙㉚"
|
||||
@@ -132,6 +139,7 @@ fetchTestType()
|
||||
|
||||
// 初始化设计需求
|
||||
const route = useRoute()
|
||||
const currentKey: string = route.query.key as string
|
||||
const getDesign = async () => {
|
||||
try {
|
||||
const res = await designApi.getDesignDemandOne({ project_id: route.query.id, key: route.query.key })
|
||||
@@ -158,11 +166,30 @@ const generateClick = async () => {
|
||||
// 变量:给AI的问题
|
||||
const question = tool.htmlToTextWithDOM(designObj.value?.description || "")
|
||||
console.log("给AI的问题如下:", question)
|
||||
// 请求后处理结果
|
||||
const res = await aiApi.getAiTestItem({ question: question, stream: false })
|
||||
// 判断真实接口和开发环境接口
|
||||
let tempSolve: any = null
|
||||
if (res.data) {
|
||||
// 说明是开发环境
|
||||
tempSolve = res.data
|
||||
} else {
|
||||
tempSolve = res
|
||||
}
|
||||
const solveRes = JSON.parse(tempSolve.history[0].at(-1))
|
||||
console.log("AI生成测试项结果:", solveRes)
|
||||
// 给Vue渲染测试项
|
||||
dataList.value = solveRes
|
||||
dataList.value.forEach((it: any) => {
|
||||
it.ident = designObj.value.ident
|
||||
it.priority = "1"
|
||||
it.testType = "4"
|
||||
it.testMethod = ["4"]
|
||||
})
|
||||
percent.value = 1.0 // 完成进度
|
||||
console.log("AI接口返回如下", res)
|
||||
Message.success("生成测试项成功,请完善信息后录入数据")
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
percent.value = 0.0
|
||||
} finally {
|
||||
stopProgressSimulation()
|
||||
@@ -199,6 +226,79 @@ onUnmounted(() => {
|
||||
|
||||
// defineModel
|
||||
const visible = defineModel<boolean>("visible", { default: false })
|
||||
|
||||
// 录入按钮相关
|
||||
const luButtonLoading = ref(false)
|
||||
const emit = defineEmits(["updateTable"])
|
||||
const luButtonClick = async () => {
|
||||
// 1.检查是否还未生成测试项
|
||||
if (isEmpty(dataList.value)) {
|
||||
Message.warning("您还未生成测试项,请生成后再试")
|
||||
return
|
||||
}
|
||||
// 2.检查测试项标识、测试项名称、优先级、测试类型、测试手段是否填写
|
||||
const testItem: any = dataList.value.at(0)
|
||||
if (!testItem.title.trim()) {
|
||||
Message.warning("请先填写测试项名称!")
|
||||
return
|
||||
}
|
||||
if (!testItem.demandDescription.trim()) {
|
||||
Message.warning("请填写测试项描述后再试!")
|
||||
return
|
||||
}
|
||||
if (testItem.testMethod.length === 0) {
|
||||
Message.warning("请先选择测试手段后再试!")
|
||||
return
|
||||
}
|
||||
// 3.组装接口需要的数据
|
||||
const projectId = route.query.id
|
||||
const splitKey: string[] = (route.query.key as any).split("-")
|
||||
const round = splitKey[0]
|
||||
const dut = splitKey[1]
|
||||
const designDemand = splitKey.at(-1)
|
||||
const adequacy: string = "测试用例覆盖测试子项要求的全部内容。\n所有用例执行完毕,对于未执行用例说明未执行原因。"
|
||||
const ident = testItem.ident
|
||||
const name = testItem.title
|
||||
const testType = testItem.testType
|
||||
const testMethod = testItem.testMethod
|
||||
const testDesciption = testItem.demandDescription
|
||||
const priority = testItem.priority
|
||||
const testContent = testItem.children.map(({ name: subName, ...rest }) => ({
|
||||
subName,
|
||||
...rest
|
||||
}))
|
||||
// 4.异步录入啦
|
||||
try {
|
||||
// 首先设置状态
|
||||
luButtonLoading.value = true
|
||||
generateLoading.value = true
|
||||
await demandApi.save({
|
||||
projectId,
|
||||
round,
|
||||
dut,
|
||||
designDemand,
|
||||
adequacy,
|
||||
ident,
|
||||
name,
|
||||
testType,
|
||||
testMethod,
|
||||
testDesciption,
|
||||
priority,
|
||||
testContent
|
||||
})
|
||||
// 请求成功后需要:清除dataList内容,关闭弹窗,提示新增成功,刷新树状结构以及表格(给父组件刷新)
|
||||
dataList.value = []
|
||||
visible.value = false
|
||||
Message.success("录入测试项成功")
|
||||
emit("updateTable")
|
||||
} catch (e) {
|
||||
} finally {
|
||||
luButtonLoading.value = false
|
||||
generateLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 悬浮按钮显示上级设计需求内容
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
@@ -216,4 +316,12 @@ const visible = defineModel<boolean>("visible", { default: false })
|
||||
:deep(.arco-progress-line) {
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
.label {
|
||||
font-weight: 700;
|
||||
}
|
||||
.luButton {
|
||||
margin-left: auto;
|
||||
padding: 10px;
|
||||
padding-right: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
<tr class="arco-table-tr">
|
||||
<th class="arco-table-th" :width="400">
|
||||
<span class="arco-table-cell arco-table-cell-align-center">
|
||||
<span class="arco-table-th-title">操作</span>
|
||||
<span class="arco-table-th-title label">操作</span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="arco-table-th" :width="400">
|
||||
<span class="arco-table-cell arco-table-cell-align-center">
|
||||
<span class="arco-table-th-title">预期</span>
|
||||
<span class="arco-table-th-title label">预期</span>
|
||||
</span>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
<!-- 批量修改优先级 -->
|
||||
<ReplacePriority @modifySuccess="crudRef.refresh()" ref="replacePriorityRef" />
|
||||
<!-- AI-Modal -->
|
||||
<AiModal v-model:visible="ai_modal_visible"></AiModal>
|
||||
<AiModal @updateTable="handleAiRefresh" v-model:visible="ai_modal_visible"></AiModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -81,6 +81,7 @@ import { Message } from "@arco-design/web-vue"
|
||||
import AiButton from "@/components/ai-button/index.vue"
|
||||
import AiModal from "./AiModal.vue"
|
||||
// hooks
|
||||
import { useTreeDataStore } from "@/store"
|
||||
import useCrudOpMore from "./hooks/useCrudOpMore"
|
||||
import useColumn from "./hooks/useColumns"
|
||||
import useRalateDemand from "./hooks/useRalateDemand"
|
||||
@@ -89,6 +90,7 @@ import ReplaceModel from "@/views/project/opeSets/components/DesignTable/Replace
|
||||
import ReplacePriority from "@/views/project/opeSets/components/DemandTable/ReplacePriority.vue"
|
||||
// inits
|
||||
const route = useRoute()
|
||||
const treeDataStore = useTreeDataStore()
|
||||
// refs
|
||||
const crudRef = ref(null)
|
||||
|
||||
@@ -114,8 +116,7 @@ const { projectId, crudOptions, handleBeforeCancel } = useCrudOpMore(crudRef)
|
||||
const crudColumns = useColumn(crudRef)
|
||||
|
||||
// 关联弹窗、关联的事件处理
|
||||
const { visible, relatedData, options, cascaderLoading, computedRelatedData, handleOpenRelationCSX, handleRelatedOk } =
|
||||
useRalateDemand(projectId)
|
||||
const { visible, relatedData, options, cascaderLoading, computedRelatedData, handleOpenRelationCSX, handleRelatedOk } = useRalateDemand(projectId)
|
||||
|
||||
// 标识显示字段
|
||||
const testTypeDict = ref([])
|
||||
@@ -139,10 +140,13 @@ const ai_modal_visible = ref(false)
|
||||
const handleAiButtonClick = () => {
|
||||
ai_modal_visible.value = true
|
||||
}
|
||||
|
||||
const handleAiRefresh = () => {
|
||||
refreshCrudTable()
|
||||
}
|
||||
// 暴露给route-view的刷新表格函数
|
||||
const refreshCrudTable = () => {
|
||||
crudRef.value.refresh()
|
||||
treeDataStore.updateTestDemandTreeData({ key: route.query.key + "-0" }, projectId.value)
|
||||
}
|
||||
defineExpose({ refreshCrudTable })
|
||||
defineOptions({
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user