大纲模版完成

This commit is contained in:
2025-04-21 19:07:07 +08:00
parent 68c93f5d83
commit 7fe6ecf765
8 changed files with 136 additions and 95 deletions

View File

@@ -308,4 +308,15 @@ export default {
params
})
},
/**
*
* @returns 生成-代码质量度量分析表
*/
createIndicates(params = {}) {
return request({
url: `/generate/create/indicators`,
method: "get",
params
})
},
}

View File

@@ -3,126 +3,135 @@
- @Link XXX
-->
<template>
<div class="ma-content-block">
<a-space class="flex">
<a-button type="primary" @click="visible = true">
<template #icon><icon-select-all /></template>{{ props.text }}
</a-button>
<a-tag size="large" color="blue" v-if="props.isEcho">已选择 {{ isArray(selecteds) ? selecteds.length : 0 }} </a-tag>
<a-input-tag v-model="userList" v-if="props.isEcho" :style="{ width:'320px' }" :placeholder="'请点击前面按钮' + props.text" :max-tag-count="3" disabled/>
</a-space>
<div class="ma-content-block">
<a-space class="flex">
<a-button type="primary" @click="visible = true">
<template #icon><icon-select-all /></template>{{ props.text }}
</a-button>
<a-tag size="large" color="blue" v-if="props.isEcho"
>已选择 {{ isArray(selecteds) ? selecteds.length : 0 }} </a-tag
>
<a-input-tag
v-model="userList"
v-if="props.isEcho"
:style="{ width: '320px' }"
:placeholder="'请点击前面按钮' + props.text"
:max-tag-count="3"
disabled
/>
</a-space>
<a-modal v-model:visible="visible" width="1000px" draggable :on-before-ok="close" unmountOnClose>
<template #title>{{ props.text }}</template>
<a-modal v-model:visible="visible" width="1000px" draggable :on-before-ok="close" unmountOnClose>
<template #title>{{ props.text }}</template>
<ma-crud
ref="crudRef"
:options="crud"
:columns="columns"
v-model:selected-keys="selecteds"
@selection-change="selectHandler"
/>
</a-modal>
</div>
<ma-crud
ref="crudRef"
:options="crud"
:columns="columns"
v-model:selected-keys="selecteds"
@selection-change="selectHandler"
/>
</a-modal>
</div>
</template>
<script setup>
import { onMounted, ref, watch } from 'vue'
import commonApi from '@/api/common'
import { Message } from '@arco-design/web-vue'
import { isArray, isEmpty } from 'lodash-es'
import { onMounted, ref, watch } from "vue"
import commonApi from "@/api/common"
import { Message } from "@arco-design/web-vue"
import { isArray, isEmpty } from "lodash-es"
const props = defineProps({
const props = defineProps({
modelValue: { type: Array },
isEcho: { type: Boolean, default: false },
multiple: { type: Boolean, default: true },
onlyId: { type: Boolean, default: true },
text: { type: String, default: '选择用户' }
})
text: { type: String, default: "选择用户" }
})
const emit = defineEmits(['update:modelValue', 'success'])
const emit = defineEmits(["update:modelValue", "success"])
const visible = ref(false)
const selecteds = ref([])
const userList = ref([])
const visible = ref(false)
const selecteds = ref([])
const userList = ref([])
onMounted(() => {
onMounted(() => {
if (props.isEcho && props.onlyId) selecteds.value = props.modelValue
})
})
watch(
() => props.modelValue,
val => {
if (props.isEcho && props.onlyId) selecteds.value = val
watch(
() => props.modelValue,
(val) => {
if (props.isEcho && props.onlyId) selecteds.value = val
}
)
)
const selectHandler = (rows) => {
const selectHandler = (rows) => {
selecteds.value = rows
}
}
const close = async (done) => {
const close = async (done) => {
if (isArray(selecteds.value) && selecteds.value.length > 0) {
const response = await commonApi.getUserInfoByIds({ ids: selecteds.value })
if (! isEmpty(response) && isArray(response.data)) {
userList.value = response.data.map( item => {
return `${item.username}(${item.id})`
})
if (props.onlyId) {
emit('update:modelValue', selecteds.value)
} else {
emit('update:modelValue', response.data)
const response = await commonApi.getUserInfoByIds({ ids: selecteds.value })
if (!isEmpty(response) && isArray(response.data)) {
userList.value = response.data.map((item) => {
return `${item.username}(${item.id})`
})
if (props.onlyId) {
emit("update:modelValue", selecteds.value)
} else {
emit("update:modelValue", response.data)
}
emit("success", true)
Message.success("选择成功")
}
emit('success', true)
Message.success('选择成功')
}
} else {
emit('update:modelValue', [])
userList.value = []
emit("update:modelValue", [])
userList.value = []
}
done(true)
}
}
const crud = ref({
const crud = ref({
showIndex: false,
api: commonApi.getUserList,
rowSelection: props.multiple ? { type: 'checkbox', showCheckedAll: true } : { type: 'radio' }
})
rowSelection: props.multiple ? { type: "checkbox", showCheckedAll: true } : { type: "radio" }
})
const columns = ref([
{ title: '账户', dataIndex: 'username', search: true },
{ title: '昵称', dataIndex: 'nickname', search: true },
{ title: '手机', dataIndex: 'phone', search: true },
{ title: '邮箱', dataIndex: 'email', search: true },
const columns = ref([
{ title: "账户", dataIndex: "username", search: true },
{ title: "昵称", dataIndex: "nickname", search: true },
{ title: "手机", dataIndex: "phone", search: true },
{ title: "邮箱", dataIndex: "email", search: true },
{
title: '部门',
dataIndex: 'dept_id',
search: true,
formType: 'tree-select',
hide: true,
dict: { url: 'system/common/getDeptTreeList' }
title: "部门",
dataIndex: "dept_id",
search: true,
formType: "tree-select",
hide: true,
dict: { url: "system/common/getDeptTreeList" }
},
{
title: '角色',
dataIndex: 'role_id',
search: true,
formType: 'select',
hide: true,
dict: { url: 'system/common/getRoleList', props: { label: 'name', value: 'code' } }
title: "角色",
dataIndex: "role_id",
search: true,
formType: "select",
hide: true,
dict: { url: "system/common/getRoleList", props: { label: "name", value: "code" } }
},
{
title: '岗位',
dataIndex: 'post_id',
search: true,
formType: 'select',
hide: true,
dict: { url: 'system/common/getPostList', props: { label: 'name', value: 'code' } }
},
])
title: "岗位",
dataIndex: "post_id",
search: true,
formType: "select",
hide: true,
dict: { url: "system/common/getPostList", props: { label: "name", value: "code" } }
}
])
</script>
<style scoped>
:deep(.arco-tabs-nav-type-capsule .arco-tabs-nav-tab) {
justify-content: flex-start;
justify-content: flex-start;
}
</style>

View File

@@ -58,7 +58,7 @@ export default function useCrudRef(currentRow: Ref<{ id: number | string; name:
dataIndex: "sort",
formType: "input-number",
addDefaultValue: 1,
width: 130,
width: 150,
min: 0,
max: 1000
},

View File

@@ -73,6 +73,7 @@ export default function (crudOrFormRef: any) {
dataIndex: "testMethod",
formType: "select",
multiple: true,
maxTagCount: 5,
dict: { name: "testMethod", props: { label: "title", value: "key" }, translation: true }
},
{
@@ -120,7 +121,7 @@ export default function (crudOrFormRef: any) {
title: "操作与预期",
dataIndex: "subStep",
formType: "steptable"
},
}
]
}
])

View File

@@ -95,12 +95,14 @@ export default function (crudOrFormRef: any) {
{
title: "接口类型",
dataIndex: "type",
hide: true
hide: true,
placeholder:"请填写接口类型或协议例如UART"
},
{
title: "接口内容",
title: "接口数据",
dataIndex: "protocal",
hide: true
hide: true,
placeholder:"请填写接口的交互数据例如XX分级数据"
}
]
}

View File

@@ -37,7 +37,21 @@
</a-list-item>
<a-list-item v-for="(frag, index) in fragmentList" :key="index">
<div class="fragment-item">
<div class="fragment-name">{{ frag.name }}</div>
<div class="fragment-name text-center">{{ frag.name }}</div>
<a-divider direction="vertical" />
<template v-if="frag.isLock">
<!-- 表示已经被锁住了 -->
<a-popover title="片段被锁定">
<icon-lock style="color: red" size="20" />
<template #content>
<p>文档片段已经被设置为锁定word中开发工具>属性解锁</p>
<p style="color: red">注意被锁定的片段无法被平台数据覆盖!</p>
</template>
</a-popover>
</template>
<template v-else="frag.isLock">
<icon-unlock style="color: green" size="20" />
</template>
<a-divider direction="vertical" />
<a-switch v-model="frag.isCover"></a-switch>
</div>
@@ -88,6 +102,7 @@ import useSeitaiModal from "../hooks/useSeitaiModal"
export interface IFragmentItem {
name: string
isCover: boolean
isLock: boolean // 是否锁定
}
// ~~~~1.文档片段展示功能~~~~
@@ -114,9 +129,10 @@ const open = async (documentType: DocumentType, id: number) => {
documentType
})
// 填充到fragmentList
fragmentList.value = data.map((it: string) => ({
name: it,
isCover: false
fragmentList.value = data.map((it: { frag_name: string; isLock: boolean }) => ({
name: it.frag_name,
isCover: false,
isLock: it.isLock // 是否锁定
}))
fragmentListPending.value = false
} catch (err) {

View File

@@ -25,7 +25,7 @@ export default {
window.URL.revokeObjectURL(url) // 释放 URL 对象
// 上面是触发下载
isComplete.value = true
Message.success("文档生成并下载成功!")
Message.success("文档生成并下载成功,请打开问题全选->F9更新其中的域!")
} catch (err) {
isComplete.value = true
visible.value = false

View File

@@ -42,7 +42,7 @@ const useGenerateSecond = function () {
dgGenerateApi.createPerformance({ id }), // 生成-被测软件性能
dgGenerateApi.createBaseInformation({ id }), // 生成-被测软件基本信息
dgGenerateApi.createLevelAndType({ id }), // 生成-测试级别和测试类型 -【修改】
dgGenerateApi.createStrategy({ id }), // 生成-测试级别和测试类型 -【新增】
dgGenerateApi.createStrategy({ id }), // 生成-测试策略 -【新增】
dgGenerateApi.createYzComparison({ id }), // 生成-研总-测试项对照表
dgGenerateApi.createXqComparison({ id }), // 生成-需求规格说明-测试项对照表
dgGenerateApi.createFanXqComparison({ id }), // 生成-反向测试项-需求规格说明对照表
@@ -56,6 +56,8 @@ const useGenerateSecond = function () {
dgGenerateApi.createDynamicHard({ id }), // 生成-动态硬件和固件项
dgGenerateApi.createTestData({ id }), // 生成-测评数据
dgGenerateApi.createEnvDiff({ id }), // 生成-环境差异性分析
// 2025年4月21日新增
dgGenerateApi.createIndicates({ id }) // 生成主要功能和性能指标(包括摸底)
]).finally(() => {
isGenerating.value = false
isDgLoading.value = false