diff --git a/cdTMP/src/api/monitor/operationLog.js b/cdTMP/src/api/monitor/operationLog.js index 08a4af6..ad7d470 100644 --- a/cdTMP/src/api/monitor/operationLog.js +++ b/cdTMP/src/api/monitor/operationLog.js @@ -10,5 +10,16 @@ export default { method: "get", params }) + }, + /** + * 操作日志删除 + * @returns 后台返回的删除信息 + */ + deleteOperationLogs(params = { day: 7 }) { + return request({ + url: `/system/log/operation_delete`, + method: "get", + params + }) } } diff --git a/cdTMP/src/api/project/case.js b/cdTMP/src/api/project/case.js index df1be28..84fe69d 100644 --- a/cdTMP/src/api/project/case.js +++ b/cdTMP/src/api/project/case.js @@ -44,4 +44,37 @@ export default { data }) }, + /** + * 右键点击需求创建测试用例 + * @returns 成功或失败信息 + */ + createByDemand(params = {}) { + return request({ + url: "/project/case/create_by_demand", + method: "post", + data: params + }) + }, + /** + * 拖拽大功能:拖拽测试用例到测试项节点,移动还是复制 + * @returns 返回case的key用于刷新树状图的数据 + */ + copyOrMoveCaseToDemand(params = {}) { + return request({ + url: "/project/case/copy_or_move_to_demand", + method: "get", + params + }) + }, + /** + * 拖拽大功能:拖拽测试用例到用例节点(都是用例),移动还是复制 + * @returns 返回case的key用于刷新树状图的数据 + */ + copyOrMoveCaseByCase(params = {}) { + return request({ + url: "/project/case/copy_or_move_by_case", + method: "get", + params + }) + } } diff --git a/cdTMP/src/api/project/designDemand.js b/cdTMP/src/api/project/designDemand.js index 70b2117..2e5f803 100644 --- a/cdTMP/src/api/project/designDemand.js +++ b/cdTMP/src/api/project/designDemand.js @@ -56,4 +56,15 @@ export default { data }) }, + /** + * 获取级联选择器所需要的(复制功能)级联design列表 + * @returns data_list:三级级联列表 + */ + getRelatedCasDesign(params = {}) { + return request({ + url: "/project/designDemand/getRelatedDesign", + method: "get", + params + }) + }, } diff --git a/cdTMP/src/api/project/testDemand.js b/cdTMP/src/api/project/testDemand.js index b5d4990..9c5658c 100644 --- a/cdTMP/src/api/project/testDemand.js +++ b/cdTMP/src/api/project/testDemand.js @@ -76,5 +76,16 @@ export default { method: "post", data: params }) + }, + /** + * 复制demand到指定design下面 + * @returns 复制是否成功 + */ + copyToDesign(params = {}) { + return request({ + url: "/project/testDemand/copy_to_design", + method: "post", + data: params + }) } } diff --git a/cdTMP/src/layout/page-layout.vue b/cdTMP/src/layout/page-layout.vue index 746908d..2e2af80 100644 --- a/cdTMP/src/layout/page-layout.vue +++ b/cdTMP/src/layout/page-layout.vue @@ -4,18 +4,29 @@ - + diff --git a/cdTMP/src/layout/project-layout.vue b/cdTMP/src/layout/project-layout.vue index daa306e..2a1f2e1 100644 --- a/cdTMP/src/layout/project-layout.vue +++ b/cdTMP/src/layout/project-layout.vue @@ -22,11 +22,15 @@ @@ -81,6 +86,11 @@ /> + + diff --git a/cdTMP/src/views/project/case/components/ProblemChoose.vue b/cdTMP/src/views/project/case/components/ProblemChoose.vue index 9139b28..0b4ce26 100644 --- a/cdTMP/src/views/project/case/components/ProblemChoose.vue +++ b/cdTMP/src/views/project/case/components/ProblemChoose.vue @@ -196,7 +196,7 @@ const columns = ref([ validateTrigger: "blur" }, { - title: "标识", + title: "问题标识", align: "center", sortable: { sortDirections: ["ascend"] }, width: 140, diff --git a/cdTMP/src/views/project/case/index.vue b/cdTMP/src/views/project/case/index.vue index 5079c32..51693fa 100644 --- a/cdTMP/src/views/project/case/index.vue +++ b/cdTMP/src/views/project/case/index.vue @@ -98,6 +98,7 @@ const crudOptions = ref({ case: caseNumber }, showIndex: false, + showTools: false, rowSelection: { showCheckedAll: true }, searchColNumber: 3, tablePagination: false, @@ -201,7 +202,7 @@ const crudColumns = ref([ validateTrigger: "blur" }, { - title: "标识", + title: "问题标识", align: "center", sortable: { sortDirections: ["ascend"] }, width: 140, diff --git a/cdTMP/src/views/project/design-demand/index.vue b/cdTMP/src/views/project/design-demand/index.vue index c62b523..3eaa530 100644 --- a/cdTMP/src/views/project/design-demand/index.vue +++ b/cdTMP/src/views/project/design-demand/index.vue @@ -141,9 +141,8 @@ const showType = (record) => { let len = testTypeDict.value.data.length for (let i = 0; i < len; i++) { 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 "XQ-" + record.ident + "-" + item.show_title + "-" + key_string.toString().padStart(3, "0") + return "XQ-" + item.show_title + "-" + record.ident } } } @@ -153,6 +152,7 @@ const crudOptions = ref({ add: { show: true, api: testDemandApi.save, text: "新增测试项" }, edit: { show: true, api: testDemandApi.update, text: "修改测试项" }, delete: { show: true, api: testDemandApi.delete }, + showTools: false, beforeOpenAdd: function () { let key_split = route.query.key.split("-") let round_key = key_split[0] @@ -181,6 +181,9 @@ const crudOptions = ref({ }, afterDelete: (res, record) => { let id = projectId.value + if (!record) { + record = { key: route.query.key + "-X" } + } treeDataStore.updateTestDemandTreeData(record, id) }, parameters: { @@ -206,15 +209,15 @@ const crudColumns = ref([ dataIndex: "id" }, { - title: "标识", + title: "测项标识", width: 150, dataIndex: "ident", sortable: { sortDirections: ["ascend"] }, align: "center", search: true, - addDisabled: true, - editDisabled: true, - validateTrigger: "blur" + validateTrigger: "blur", + placeholder: "请填写测试项的标识,注意标识不能重复", + commonRules: [{ required: true, message: "测试项标识必填" }] }, { title: "名称", @@ -261,36 +264,7 @@ const crudColumns = ref([ } }, { - title: "充分条件", - hide: true, - addDefaultValue: "覆盖需求相关功能", - dataIndex: "adequacy", - formType: "textarea", - maxLength: 256, - commonRules: [{ required: true, message: "充分性描述必填" }] - }, - { - title: "终止条件", - hide: true, - dataIndex: "termination", - formType: "textarea", - showWordLimit: true, - maxLength: 1024, - addDefaultValue: - "1.测试正常终止:测试项分解的所有用例执行完毕,达到充分性要求,相关记录完整;\n2.测试异常终止:由于某些特殊原因导致该测试项分解的测试用例不能完全执行,无法执行的原因已记录", - commonRules: [{ required: true, message: "前提条件必填" }] - }, - { - title: "前提条件", - hide: true, - addDefaultValue: "软件正常运行,外部接口通信正常", - dataIndex: "premise", - formType: "textarea", - maxLength: 256, - commonRules: [{ required: true, message: "前提条件必填" }] - }, - { - title: "测试方法", + title: "测试手段", align: "center", dataIndex: "testMethod", formType: "select", @@ -298,24 +272,70 @@ const crudColumns = ref([ dict: { name: "testMethod", props: { label: "title", value: "key" }, translation: true } }, { - title: "测试内容", + title: "充分性要求", + hide: true, + addDefaultValue: "覆盖需求相关功能", + dataIndex: "adequacy", + formType: "textarea", + maxLength: 256, + commonRules: [{ required: true, message: "充分性描述必填" }], + addDefaultValue: + "测试用例覆盖XX子项名称1、XX子项名称2、XX子项名称3子项要求的全部内容。\n所有用例执行完毕,对于未执行的用例说明未执行原因。" + }, + { + title: "测试子项", hide: true, dataIndex: "testContent", - commonRules: [{ required: true, message: "测试内容必填" }], + commonRules: [{ required: true, message: "测试方法是必填的" }], formType: "children-form", - type: "table", formList: [ { - title: "测试分解", - dataIndex: "testXuQiu" + title: "子项名称", + dataIndex: "subName", + placeholder: "对应测试项描述标题,和测试方法的标题", + rules: [{ required: true, message: "测试子项名称必填" }], + onChange: (ev) => { + // 取出子项的对象数组 + const subItemFormData = crudRef.value.getFormData().testContent + // 取出充分性条件字段字符串 + const mapRes = subItemFormData.map((subItem) => subItem.subName) + crudRef.value.getFormData().adequacy = `测试用例覆盖${mapRes}子项要求的全部内容。\n所有用例执行完毕,对于未执行的用例说明未执行原因。` + } }, { - title: "预期", - dataIndex: "testYuQi" + title: "子项描述", + dataIndex: "subDesc", + placeholder: "对应大纲测试项表格的测试项描述", + rules: [{ required: true, message: "测试子项描述必填" }] + }, + { + title: "条件", + dataIndex: "condition", + placeholder: "在什么环境和前置条件下" + }, + { + title: "操作", + dataIndex: "operation", + placeholder: "通过xxx操作" + }, + { + title: "观察", + dataIndex: "observe", + placeholder: "查看xxx内容" + }, + { + title: "期望", + dataIndex: "expect", + placeholder: "xxx结果正确" } ] } ]) +// 暴露给route-view的刷新表格函数 +const refreshCrudTable = () => { + crudRef.value.refresh() +} +defineExpose({ refreshCrudTable }) diff --git a/cdTMP/src/views/testmanage/projmanage/index.vue b/cdTMP/src/views/testmanage/projmanage/index.vue index 14afb94..d2b6340 100644 --- a/cdTMP/src/views/testmanage/projmanage/index.vue +++ b/cdTMP/src/views/testmanage/projmanage/index.vue @@ -248,6 +248,7 @@ const crudOptions = ref({ operationColumn: true, operationWidth: 500, showIndex: false, + showTools: false, // 处理弹窗的title beforeOpenAdd: function () { crudRef.value.crudFormRef.actionTitle = "项目" @@ -377,8 +378,8 @@ const crudOptions = ref({ // CRUD-CLOMNS const crudColumns = ref([ { - title: "标识", - width: 70, + title: "项目标识", + width: 90, sortable: { sortDirections: ["ascend"] }, dataIndex: "ident", search: true,