diff --git a/cdTMP/package-lock.json b/cdTMP/package-lock.json index 8a6fa13..3870de4 100644 --- a/cdTMP/package-lock.json +++ b/cdTMP/package-lock.json @@ -22,6 +22,7 @@ "monaco-editor": "^0.33.0", "nprogress": "^0.2.0", "pinia": "^2.1.3", + "pinyin-match": "^1.2.4", "postcss-import": "^15.1.0", "qs": "^6.11.2", "sortablejs": "^1.15.0", @@ -3576,6 +3577,11 @@ } } }, + "node_modules/pinyin-match": { + "version": "1.2.4", + "resolved": "https://registry.npmmirror.com/pinyin-match/-/pinyin-match-1.2.4.tgz", + "integrity": "sha512-HpUiaSxcG3rrpKAMZXq/rMHbEp7wvfu9B64lHJBy+63xAr/hVdBC8xqkWWPnNyjSb19ihdh8FnXo+9m6jAr9Mg==" + }, "node_modules/pirates": { "version": "4.0.5", "resolved": "https://registry.npmmirror.com/pirates/-/pirates-4.0.5.tgz", diff --git a/cdTMP/package.json b/cdTMP/package.json index c4882bf..351db64 100644 --- a/cdTMP/package.json +++ b/cdTMP/package.json @@ -25,6 +25,7 @@ "monaco-editor": "^0.33.0", "nprogress": "^0.2.0", "pinia": "^2.1.3", + "pinyin-match": "^1.2.4", "postcss-import": "^15.1.0", "qs": "^6.11.2", "sortablejs": "^1.15.0", diff --git a/cdTMP/pnpm-lock.yaml b/cdTMP/pnpm-lock.yaml index e12423e..46eac8c 100644 --- a/cdTMP/pnpm-lock.yaml +++ b/cdTMP/pnpm-lock.yaml @@ -47,6 +47,9 @@ dependencies: pinia: specifier: ^2.1.3 version: registry.npmmirror.com/pinia@2.1.3(vue@3.3.0) + pinyin-match: + specifier: ^1.2.4 + version: registry.npmmirror.com/pinyin-match@1.2.4 postcss-import: specifier: ^15.1.0 version: registry.npmmirror.com/postcss-import@15.1.0(postcss@8.4.24) @@ -3012,6 +3015,12 @@ packages: vue-demi: registry.npmmirror.com/vue-demi@0.14.5(vue@3.3.0) dev: false + registry.npmmirror.com/pinyin-match@1.2.4: + resolution: {integrity: sha512-HpUiaSxcG3rrpKAMZXq/rMHbEp7wvfu9B64lHJBy+63xAr/hVdBC8xqkWWPnNyjSb19ihdh8FnXo+9m6jAr9Mg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/pinyin-match/-/pinyin-match-1.2.4.tgz} + name: pinyin-match + version: 1.2.4 + dev: false + registry.npmmirror.com/pirates@4.0.5: resolution: {integrity: sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/pirates/-/pirates-4.0.5.tgz} name: pirates diff --git a/cdTMP/src/layout/project-layout.vue b/cdTMP/src/layout/project-layout.vue index fffac49..8f14ecf 100644 --- a/cdTMP/src/layout/project-layout.vue +++ b/cdTMP/src/layout/project-layout.vue @@ -15,7 +15,7 @@ {{ expandedKeys?.length ? "全部收缩" : "全部展开" }} { treeDataStore.initTreeData(projectId.value) }) - +// 1.定义展开的tree-key 2.定义全部展开的数据 3.定义展开收缩函数 -> 注意在treeStore里面使用递归处理 +const expandedKeys = ref([]) +const allExpandedKeys = ref([]) +const toggleExpanded = () => { + allExpandedKeys.value = treeDataStore.outExpandNode() + expandedKeys.value = expandedKeys?.value.length ? [] : allExpandedKeys.value +} /// 点击树状节点-参数1:节点数组,参数2:树node对象 - 添加双击处理方式 +let timerId = null +let count = 0 const pointNode = (value, data) => { - if (data.node.level === "0") { - router.push({ name: "round", query: { ...projectInfo.value, key: data.node.key } }) + count++ + if (timerId) { + return } - if (data.node.level === "1") { - router.push({ name: "dut", query: { ...projectInfo.value, key: data.node.key } }) - } - if (data.node.level === "2") { - router.push({ name: "designDemand", query: { ...projectInfo.value, key: data.node.key } }) - } - if (data.node.level === "3") { - router.push({ name: "testDemand", query: { ...projectInfo.value, key: data.node.key } }) - } - if (data.node.level === "4") { - router.push({ name: "case", query: { ...projectInfo.value, key: data.node.key } }) - } - if (data.node.level === "5") { - router.push({ name: "problem", query: { ...projectInfo.value, key: data.node.key } }) - } - treeDataStore.setCurrentNode(data.node.key) + timerId = setTimeout(async () => { + if (count > 1) { + // 双击触发 value是点击的节点,data是节点数据 + if (data.node.level == "0") { + projectApi.getDutInfo(projectInfo.value.id, data.node.key, data.node.level).then((res) => { + treeData.value[value].children = res.data + // 添加需要展开数据,注意不要一直push,判断在已展开节点是否包含点击的节点 + if (!expandedKeys.value.includes(value[0])) { + expandedKeys.value.push(value[0]) + } + }) + } + if (data.node.level == "1") { + projectApi.getDemandInfo(projectInfo.value.id, data.node.key, data.node.level).then((res) => { + data.node.children = res.data + if (!expandedKeys.value.includes(value[0])) { + expandedKeys.value.push(value[0]) + } + }) + } + if (data.node.level == "2") { + projectApi.getTestInfo(projectInfo.value.id, data.node.key, data.node.level).then((res) => { + data.node.children = res.data + if (!expandedKeys.value.includes(value[0])) { + expandedKeys.value.push(value[0]) + } + }) + } + if (data.node.level == "3") { + projectApi.getCaseInfo(projectInfo.value.id, data.node.key, data.node.level).then((res) => { + data.node.children = res.data + if (!expandedKeys.value.includes(value[0])) { + expandedKeys.value.push(value[0]) + } + }) + } + if (data.node.level == "4") { + projectApi.getProblemInfo(projectInfo.value.id, data.node.key, data.node.level).then((res) => { + data.node.children = res.data + if (!expandedKeys.value.includes(value[0])) { + expandedKeys.value.push(value[0]) + } + }) + } + count = 0 + clearTimeout(timerId) + timerId = null + } else { + // 单击触发 + if (data.node.level === "0") { + router.push({ name: "round", query: { ...projectInfo.value, key: data.node.key } }) + } + if (data.node.level === "1") { + router.push({ name: "dut", query: { ...projectInfo.value, key: data.node.key } }) + } + if (data.node.level === "2") { + router.push({ name: "designDemand", query: { ...projectInfo.value, key: data.node.key } }) + } + if (data.node.level === "3") { + router.push({ name: "testDemand", query: { ...projectInfo.value, key: data.node.key } }) + } + if (data.node.level === "4") { + router.push({ name: "case", query: { ...projectInfo.value, key: data.node.key } }) + } + if (data.node.level === "5") { + router.push({ name: "problem", query: { ...projectInfo.value, key: data.node.key } }) + } + treeDataStore.setCurrentNode(data.node.key) + count = 0 + clearTimeout(timerId) + timerId = null + } + }, 250) } /// 动态加载函数-参数1:树node对象 const loadMore = (nodeData) => { @@ -282,14 +348,6 @@ const handleRoundSubmit = async (value) => { } } -// 1.定义展开的tree-key 2.定义全部展开的数据 3.定义展开收缩函数 -> 注意在treeStore里面使用递归处理 -const expandedKeys = ref([]) -const allExpandedKeys = ref([]) -const toggleExpanded = () => { - allExpandedKeys.value = treeDataStore.outExpandNode() - expandedKeys.value = expandedKeys?.value.length ? [] : allExpandedKeys.value -} - /// 设置轮次弹窗的列信息 const roundColumn = ref([ { diff --git a/cdTMP/src/views/project/design-demand/index.vue b/cdTMP/src/views/project/design-demand/index.vue index 7969e5e..9cc4aaf 100644 --- a/cdTMP/src/views/project/design-demand/index.vue +++ b/cdTMP/src/views/project/design-demand/index.vue @@ -17,6 +17,8 @@ import { useRoute, useRouter } from "vue-router" import testDemandApi from "@/api/project/testDemand" import { useTreeDataStore } from "@/store" import commonApi from "@/api/common" +import PinYinMatch from "pinyin-match" + const treeDataStore = useTreeDataStore() const route = useRoute() const router = useRouter() @@ -38,16 +40,16 @@ const showType = (record) => { if (testTypeDict.value.data[i].key === record.testType) { let key_string = parseInt(record.key.substring(record.key.lastIndexOf("-") + 1)) + 1 let item = testTypeDict.value.data[i] - return item.show_title + "-" + record.ident + "-" + key_string.toString().padStart(3,"0") + return "XQ-" + record.ident + "-" + item.show_title + "-" + key_string.toString().padStart(3, "0") } } } // crud组件 const crudOptions = ref({ api: testDemandApi.getTestDemandList, - add: { show: true ,api:testDemandApi.save}, + add: { show: true, api: testDemandApi.save }, edit: { show: true, api: testDemandApi.update }, - delete: { show: true,api:testDemandApi.delete }, + delete: { show: true, api: testDemandApi.delete }, afterAdd: (res) => { let id = projectId.value treeDataStore.updateTestDemandTreeData(res.data, id) @@ -84,11 +86,13 @@ const crudColumns = ref([ }, { title: "标识", + width: 150, dataIndex: "ident", sortable: { sortDirections: ["ascend"] }, align: "center", search: true, - commonRules: [{ required: true, message: "标识是必填" }], + addDisabled: true, + editDisabled: true, validateTrigger: "blur" }, { @@ -125,13 +129,23 @@ const crudColumns = ref([ maxLength: 200, commonRules: [{ required: true, message: "测试类型必选" }], dict: { name: "testType", translation: true, props: { label: "title", value: "key" } }, - extra: "请保证测试类型选择正确" + extra: "请保证测试类型选择正确", + filterOption: function (inputValue, selectedOption) { + if(inputValue){ + let matchRes = PinYinMatch.match(selectedOption.label,inputValue) + if(matchRes){ + return true + } + } + } }, { title: "充分条件", hide: true, addDefaultValue: "覆盖需求相关功能", dataIndex: "adequacy", + formType: "textarea", + maxLength: 256, commonRules: [{ required: true, message: "充分性描述必填" }] }, { @@ -140,7 +154,7 @@ const crudColumns = ref([ dataIndex: "termination", formType: "textarea", showWordLimit: true, - maxLength: 200, + maxLength: 1024, addDefaultValue: "1.测试正常终止:测试项分解的所有用例执行完毕,达到充分性要求,相关记录完整;\n2.测试异常终止:由于某些特殊原因导致该测试项分解的测试用例不能完全执行,无法执行的原因已记录", commonRules: [{ required: true, message: "前提条件必填" }] @@ -150,13 +164,17 @@ const crudColumns = ref([ hide: true, addDefaultValue: "软件正常运行,外部接口通信正常", dataIndex: "premise", + formType: "textarea", + maxLength: 256, commonRules: [{ required: true, message: "前提条件必填" }] }, { title: "测试方法", align: "center", dataIndex: "testMethod", - commonRules: [{ required: true, message: "测试方法必填" }] + formType: "select", + multiple: true, + dict: { name: "testMethod", props: { label: "title", value: "key" }, translation: true } }, { title: "测试内容", diff --git a/cdTMP/src/views/project/dut/index.vue b/cdTMP/src/views/project/dut/index.vue index 2a86a9d..1e9a2f7 100644 --- a/cdTMP/src/views/project/dut/index.vue +++ b/cdTMP/src/views/project/dut/index.vue @@ -37,7 +37,7 @@ const showType = (record) => { if (demandTypeDict.value.data[i].key === record.demandType) { let key_string = parseInt(record.key.substring(record.key.lastIndexOf("-") + 1)) + 1 let item = demandTypeDict.value.data[i] - return item.show_title + "-" + record.ident + "-" + key_string.toString().padStart(3,"0") + return "SJ-" + record.ident + "-" + item.show_title + "-" + key_string.toString().padStart(3, "0") } } } diff --git a/cdTMP/src/views/project/testDemand/index.vue b/cdTMP/src/views/project/testDemand/index.vue index 87e9ddd..3285331 100644 --- a/cdTMP/src/views/project/testDemand/index.vue +++ b/cdTMP/src/views/project/testDemand/index.vue @@ -27,7 +27,7 @@ const projectId = ref(route.query.id) // 标识显示字段 const showType = (record) => { let key_string = parseInt(record.key.substring(record.key.lastIndexOf("-") + 1)) + 1 - return record.ident + "-" + "YL" + key_string.toString().padStart(3,"0") + return "YL-" + record.ident + "-" + key_string.toString().padStart(3,"0") } // crud设置 const crudOptions = ref({ @@ -125,7 +125,6 @@ const crudColumns = ref([ align: "center", search: true, formType: "select", - commonRules: [{ required: true, message: "设计人员必填" }], dict: { url: "system/user/list", translation: true, props: { label: "name", value: "name" } } }, { @@ -135,7 +134,6 @@ const crudColumns = ref([ align: "center", search: true, formType: "select", - commonRules: [{ required: true, message: "执行人员必填" }], dict: { url: "system/user/list", translation: true, props: { label: "name", value: "name" } } }, { @@ -145,7 +143,6 @@ const crudColumns = ref([ align: "center", search: true, formType: "select", - commonRules: [{ required: true, message: "审核人员必填" }], dict: { url: "system/user/list", translation: true, props: { label: "name", value: "name" } } }, { diff --git a/cdTMP/src/views/testmanage/projmanage/index.vue b/cdTMP/src/views/testmanage/projmanage/index.vue index 899d747..19c10dd 100644 --- a/cdTMP/src/views/testmanage/projmanage/index.vue +++ b/cdTMP/src/views/testmanage/projmanage/index.vue @@ -59,7 +59,10 @@ const crudOptions = ref({ { span: 8, formList: [{ dataIndex: "beginTime" }] }, { span: 8, formList: [{ dataIndex: "endTime" }] }, { span: 8, formList: [{ dataIndex: "duty_person" }] }, - { span: 8, formList: [{ dataIndex: "member" }] } + { span: 24, formList: [{ dataIndex: "member" }] }, + { span: 8, formList: [{ dataIndex: "quality_person" }] }, + { span: 8, formList: [{ dataIndex: "vise_person" }] }, + { span: 8, formList: [{ dataIndex: "config_person" }] }, ] }, { @@ -203,6 +206,30 @@ const crudColumns = ref([ dict: { url: "system/user/list", props: { label: "name", value: "name" }, translation: true }, commonRules: [{ required: true, message: "成员至少选择一个" }] }, + { + title: "质量保证", + dataIndex: "quality_person", + hide: true, + formType: "select", + dict: { url: "system/user/list", props: { label: "name", value: "name" }, translation: true }, + commonRules: [{ required: true, message: "至少选择一个质量保证员" }] + }, + { + title: "质量监督", + dataIndex: "vise_person", + hide: true, + formType: "select", + dict: { url: "system/user/list", props: { label: "name", value: "name" }, translation: true }, + commonRules: [{ required: true, message: "至少选择一个质量监督员" }] + }, + { + title: "配置管理", + dataIndex: "config_person", + hide: true, + formType: "select", + dict: { url: "system/user/list", props: { label: "name", value: "name" }, translation: true }, + commonRules: [{ required: true, message: "至少选择一个配置管理员" }] + }, { title: "关键等级", dataIndex: "security_level",