Commit 54b22571 by Neo Turing

完善比对测试功能:更新TestDataItem接口、实现点击编辑模式、优化删除按钮样式

parent 8cbb38c2
......@@ -78,6 +78,7 @@ declare module 'vue' {
NTag: typeof import('naive-ui')['NTag']
NText: typeof import('naive-ui')['NText']
NTooltip: typeof import('naive-ui')['NTooltip']
NTree: typeof import('naive-ui')['NTree']
NUpload: typeof import('naive-ui')['NUpload']
NWatermark: typeof import('naive-ui')['NWatermark']
PinToggler: typeof import('./../components/common/pin-toggler.vue')['default']
......
......@@ -119,7 +119,6 @@
<script setup lang="ts">
import { h, ref, computed, resolveComponent, watch, withDefaults, onBeforeUnmount } from 'vue';
// import type { DataTableColumns } from 'naive-ui';
interface FileItem {
Kvid: string;
......
......@@ -203,11 +203,19 @@ const isCurrentRowReadonly = computed(() => {
* @usage 在组件初始化和激活时调用,用于填充文件类型下拉选择器
*/
async function fetchTitleOptions() {
// 如果已有数据则不重复加载
if (titleOptions.value.length > 0) {
return;
}
try {
loading.value = true;
const response = await axios.post('/Restful/Kivii.Standards.Entities.Standard/Query.json?Type=文件审核');
const response = await axios.get('/Restful/Kivii.Standards.Entities.Standard/Query.json', {
params: {
Type:'文件审核'
}
});
if (response.data && response.data.Results) {
titleOptions.value = response.data.Results.map((item: any, index: number) => ({
label: item.Title,
......@@ -354,8 +362,6 @@ watch(
onMounted(() => {
if (props.active) {
fetchTitleOptions();
if (props.item && props.item.Kvid && props.item.Kvid !== detailedData.Kvid) {
fetchDataByReportKvid(props.item.Kvid);
}
......@@ -365,9 +371,7 @@ onMounted(() => {
watch(
() => props.active,
(newActive) => {
if (newActive && titleOptions.value.length === 0) {
fetchTitleOptions();
if (newActive) {
if (props.item && props.item.Kvid && props.item.Kvid !== detailedData.Kvid) {
fetchDataByReportKvid(props.item.Kvid);
}
......@@ -719,6 +723,7 @@ async function handleFileListClosed(files: any[]) {
label-field="label"
value-field="value"
@update:value="handleTitleChange"
@focus="fetchTitleOptions"
class="selector-input"
></NSelect>
......
......@@ -347,8 +347,7 @@ function saveApplication(submit = true) {
<!-- 步骤3: 比对测试选择 -->
<ComparisonTest
v-if="visitedSteps.has(2) && currentStep === 2"
:test-items="testItems"
:save-as-draft="false"
:item="formModel"
:active="currentStep === 2"
@update:test-items="newItems => (testItems = newItems)"
></ComparisonTest>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment