更新版本

This commit is contained in:
2025-08-14 16:12:58 +08:00
parent 8b2c34d70b
commit 47e3c5f637
9 changed files with 1148 additions and 1542 deletions

2540
cdTMP/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
{
"name": "cdtmp",
"name": "testplant",
"private": true,
"version": "0.0.5",
"version": "0.0.6",
"type": "module",
"scripts": {
"dev": "vite",
@@ -13,54 +13,54 @@
"dependencies": {
"@arco-design/color": "^0.4.0",
"@arco-design/web-vue": "^2.57.0",
"@tanstack/vue-query": "^5.77.2",
"@tinymce/tinymce-vue": "^6.1.0",
"@vueuse/core": "^13.3.0",
"axios": "^1.9.0",
"@tanstack/vue-query": "^5.83.1",
"@tinymce/tinymce-vue": "^6.3.0",
"@vueuse/core": "^13.6.0",
"axios": "^1.11.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"dayjs": "^1.11.13",
"file2md5": "^1.3.0",
"lodash-es": "^4.17.21",
"lucide-vue-next": "^0.511.0",
"mammoth": "^1.9.0",
"lucide-vue-next": "^0.539.0",
"mammoth": "^1.10.0",
"mitt": "^3.0.1",
"nprogress": "^0.2.0",
"pinia": "^3.0.2",
"pinia": "^3.0.3",
"pinyin-match": "^1.2.8",
"postcss-import": "^16.1.0",
"postcss-import": "^16.1.1",
"qs": "^6.14.0",
"tailwind-merge": "^3.3.0",
"tinymce": "^7.9.0",
"tw-animate-css": "^1.3.0",
"vue": "^3.5.15",
"tailwind-merge": "^3.3.1",
"tinymce": "^8.0.2",
"tw-animate-css": "^1.3.6",
"vue": "^3.5.18",
"vue-clipboard3": "^2.0.0",
"vue-color-kit": "^1.0.6",
"vue-data-ui": "^2.7.6",
"vue-data-ui": "^2.17.11",
"vue-router": "^4.5.1",
"vuedraggable": "^2.24.3"
},
"devDependencies": {
"@tailwindcss/postcss": "^4.1.7",
"@tailwindcss/vite": "^4.1.7",
"@tailwindcss/postcss": "^4.1.11",
"@tailwindcss/vite": "^4.1.11",
"@types/lodash-es": "^4.17.12",
"@types/node": "^22.15.23",
"@types/node": "^24.2.1",
"@types/nprogress": "^0.2.3",
"@types/qs": "^6.14.0",
"@vitejs/plugin-vue": "^5.2.4",
"@vitejs/plugin-vue-jsx": "^4.2.0",
"@vue/babel-plugin-jsx": "^1.4.0",
"browserslist": "^4.24.5",
"eslint": "^9.27.0",
"eslint-plugin-vue": "^10.1.0",
"less": "^4.3.0",
"@vitejs/plugin-vue": "^6.0.1",
"@vitejs/plugin-vue-jsx": "^5.0.1",
"@vue/babel-plugin-jsx": "^1.5.0",
"browserslist": "^4.25.2",
"eslint": "^9.33.0",
"eslint-plugin-vue": "^10.4.0",
"less": "^4.4.0",
"less-loader": "^12.3.0",
"postcss": "^8.5.3",
"prettier": "^3.5.3",
"rollup-plugin-visualizer": "^6.0.1",
"tailwindcss": "^4.1.7",
"typescript": "^5.8.3",
"vite": "^6.3.5",
"vue-eslint-parser": "^10.1.3"
"postcss": "^8.5.6",
"prettier": "^3.6.2",
"rollup-plugin-visualizer": "^6.0.3",
"tailwindcss": "^4.1.11",
"typescript": "^5.9.2",
"vite": "^7.1.2",
"vue-eslint-parser": "^10.2.0"
}
}

View File

@@ -99,10 +99,15 @@ const submit = async () => {
if (isFunction(options.beforeEdit) && !(await options.beforeEdit(formData))) {
return false
}
if (!options.parameters) {
response = await options.edit.api(formData[options.pk], formData)
} else {
response = await options.edit.api(formData[options.pk], { ...formData, ...options.parameters })
// 修改源码2025-06-24使用try...catch捕获信息
try {
if (!options.parameters) {
response = await options.edit.api(formData[options.pk], formData)
} else {
response = await options.edit.api(formData[options.pk], { ...formData, ...options.parameters })
}
} catch (e) {
return false
}
isFunction(options.afterEdit) && (await options.afterEdit(response, formData))
}

View File

@@ -61,7 +61,7 @@
</a-button>
</a-tooltip>
<a-button-group shape="round" size="mini">
<a-button type="primary" @click="moveUp(index)">
<a-button type="primary" @click="moveUp(index)">
<icon-arrow-rise />
</a-button>
<a-button type="primary" @click="moveDown(index)">
@@ -100,6 +100,7 @@
<script setup lang="ts">
import { type Ref, nextTick } from "vue"
import { cloneDeep } from "lodash-es"
// 辅助函数当modelValue不是列表时候
function handleIsNotArray() {
@@ -129,7 +130,7 @@ const deleteItem = (index: number) => {
// 复制单项
const copyItem = (index: number) => {
const newItem = modelValue.value[index]
const newItem = cloneDeep(modelValue.value[index])
modelValue.value = [...modelValue.value, newItem]
}

View File

@@ -261,6 +261,20 @@ function swapItems(idx1, idx2) {
;[arr[idx1], arr[idx2]] = [arr[idx2], arr[idx1]]
}
// 辅助函数:触发充分性分析
// 2025-06-24新增子项后需对触发更新
function updateChongFen() {
if (formModel.value.testContent && formModel.value.testContent.length > 0) {
// 如果有testContent则更新“充分性要求”
const subItemFormData = formModel.value.testContent
const mapRes = subItemFormData.map((subItem) => subItem.subName || "")
formModel.value.adequacy &&
(formModel.value.adequacy = `测试用例覆盖${mapRes.join(
"、"
)}子项要求的全部内容。\n所有用例执行完毕对于未执行的用例说明未执行原因。`)
}
}
// 修改源码:上移动和下移动
const moveUp = (itemIndex) => {
const itemLength = formModel.value[props.component.dataIndex].length
@@ -270,6 +284,8 @@ const moveUp = (itemIndex) => {
}
// 进行移动
swapItems(itemIndex, itemIndex - 1)
// 2025-06-24修改
updateChongFen()
}
const moveDown = (itemIndex) => {
@@ -280,6 +296,8 @@ const moveDown = (itemIndex) => {
}
// 进行移动
swapItems(itemIndex, itemIndex + 1)
// 2025-06-24修改
updateChongFen()
}
const addItem = async (data = {}) => {
@@ -289,6 +307,8 @@ const addItem = async (data = {}) => {
viewFormList.value[index] = cloneDeep(formList)
rv("onAdd", { formList: viewFormList.value[index], newData, index }) // 修改源码深度复制data->newData
formModel.value[props.component.dataIndex].push(newData) // 修改源码深度复制data->newData
// 修改源码,触发充分性更新
updateChongFen()
}
const deleteItem = async (index) => {
@@ -298,6 +318,8 @@ const deleteItem = async (index) => {
await nextTick()
formModel.value[props.component.dataIndex].splice(index, 1)
}
// 2025-06-24修改
updateChongFen()
}
const getChildrenDataIndex = (index, dataIndex) => {

View File

@@ -1,5 +1,5 @@
<template>
<a-modal v-model:visible="visible" width="80%" draggable :footer="false" unmount-on-close>
<a-modal v-model:visible="visible" width="80%" draggable :footer="false">
<template #title>维护数据字典 {{ currentRow.name }}</template>
<!-- crud组件 -->
<div class="lg:w-full w-full lg:mt-0">
@@ -35,6 +35,7 @@ import useOpenChangeModal from "./useOpenChangeModal"
const currentRow = ref({ id: undefined, name: undefined }) // 当前选择的行
const { crudRef, crudOptions, columns } = useCrudRef(currentRow)
const { visible, changeSort, changeStatus, open } = useOpenChangeModal(crudRef, currentRow)
// 暴露自己的open方法
defineExpose({ open })

View File

@@ -24,10 +24,14 @@ export default function (updateApiFunc: Function, updateTreeFunc: Function, widt
return false
} else {
// 成功 **变化**
const res = await updateApiFunc(formData.value.id, { project_id, ...formData.value })
updateTreeFunc(res.data, project_id) // 刷新树节点信息
!(rightViewRef as any).value.refresh()
Message.success("修改成功")
try {
const res = await updateApiFunc(formData.value.id, { project_id, ...formData.value })
updateTreeFunc(res.data, project_id) // 刷新树节点信息
!(rightViewRef as any).value.refresh()
Message.success("修改成功")
} catch (e) {
return false
}
}
}
const modalOptions = {

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
1. tinymce 7.9.1