From 7aecdb2df6694767d7d82c334b20d4e72a85534b Mon Sep 17 00:00:00 2001 From: ks3356143 <314298729@qq.com> Date: Thu, 25 Jul 2024 18:51:12 +0800 Subject: [PATCH] =?UTF-8?q?(create)=E6=96=B0=E5=A2=9E=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=89=80=E5=B1=9E=E6=96=87=E6=A1=A3=E7=89=87=E6=AE=B5crud?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cdTMP/src/api/system/fragment.ts | 24 +++- cdTMP/src/api/system/types/fragmentTypes.ts | 11 +- cdTMP/src/utils/enums/productTypes.ts | 8 +- cdTMP/src/utils/types/CommonType.ts | 4 +- .../src/views/dashboard/usermanage/index.vue | 3 + .../views/datamanage/abbreviation/index.vue | 5 +- .../views/datamanage/dictmanage/dataList.vue | 5 +- .../src/views/datamanage/dictmanage/index.vue | 5 +- .../views/datamanage/projContact/index.vue | 5 +- .../project/case/components/ProblemChoose.vue | 3 + cdTMP/src/views/project/case/index.vue | 3 + .../src/views/project/design-demand/index.vue | 5 +- cdTMP/src/views/project/dut/index.vue | 3 + cdTMP/src/views/project/round/index.vue | 3 + cdTMP/src/views/project/testDemand/index.vue | 3 + .../components/PageHeader/index.vue | 43 +++++++ .../testmanage/components/PageHeader/types.ts | 5 + .../views/testmanage/projBoard/cpns/Title.vue | 37 +++--- .../views/testmanage/projFragment/index.vue | 114 ++++++++++++++---- .../src/views/testmanage/projmanage/index.vue | 3 + 20 files changed, 231 insertions(+), 61 deletions(-) create mode 100644 cdTMP/src/views/testmanage/components/PageHeader/index.vue create mode 100644 cdTMP/src/views/testmanage/components/PageHeader/types.ts diff --git a/cdTMP/src/api/system/fragment.ts b/cdTMP/src/api/system/fragment.ts index e0f7242..e01698e 100644 --- a/cdTMP/src/api/system/fragment.ts +++ b/cdTMP/src/api/system/fragment.ts @@ -1,5 +1,5 @@ import { request } from "@/api/request" -import { IFragSearchCondition } from "./types/fragmentTypes" +import { IFragSearchCondition, IFragUpdateObject } from "./types/fragmentTypes" export class FragApi { /** * 根据参数获取文档片段 @@ -12,4 +12,26 @@ export class FragApi { params }) } + /** + * 根据fragment的对象更新数据库 + * @returns 是否更新成功 + */ + static update(id: any, data: IFragUpdateObject) { + return request({ + url: "system/userField/update/" + id, + method: "put", + data + }) + } + /** + * 根据id删除fragment + * @returns 返回被删除的id或错误消息 + */ + static delete(data) { + return request({ + url: "system/userField/delete", + method: "delete", + data + }) + } } diff --git a/cdTMP/src/api/system/types/fragmentTypes.ts b/cdTMP/src/api/system/types/fragmentTypes.ts index b00919d..0c19e65 100644 --- a/cdTMP/src/api/system/types/fragmentTypes.ts +++ b/cdTMP/src/api/system/types/fragmentTypes.ts @@ -17,6 +17,13 @@ export enum FragBelongDoc { export interface IFragSearchCondition { belongDocName?: FragBelongDoc name?: string - isMain?: boolean - projectId?: number + is_main?: boolean + projectId?: string +} + +/** + * 接口:更新文档片段的对象 + */ +export interface IFragUpdateObject extends IFragSearchCondition { + field_seq?: string } diff --git a/cdTMP/src/utils/enums/productTypes.ts b/cdTMP/src/utils/enums/productTypes.ts index 42feb46..92662e5 100644 --- a/cdTMP/src/utils/enums/productTypes.ts +++ b/cdTMP/src/utils/enums/productTypes.ts @@ -1,9 +1,9 @@ export enum ProductFileEnum { - dg = "大纲", - sm = "说明", - jl = "记录", + dg = "测评大纲", + sm = "测试说明", + jl = "测试记录", hsm = "回归说明", hjl = "回归记录", - bg = "报告", + bg = "测评报告", wtd = "问题单" } diff --git a/cdTMP/src/utils/types/CommonType.ts b/cdTMP/src/utils/types/CommonType.ts index 0bd1671..878ba2f 100644 --- a/cdTMP/src/utils/types/CommonType.ts +++ b/cdTMP/src/utils/types/CommonType.ts @@ -1,4 +1,4 @@ export interface IDictData { - label: string - value: T + label: T + value: number } diff --git a/cdTMP/src/views/dashboard/usermanage/index.vue b/cdTMP/src/views/dashboard/usermanage/index.vue index 247dcbb..ddbba51 100644 --- a/cdTMP/src/views/dashboard/usermanage/index.vue +++ b/cdTMP/src/views/dashboard/usermanage/index.vue @@ -43,6 +43,9 @@ const crudOptions = reactive({ rowSelection: { showCheckedAll: true }, + afterDelete(response) { + crudRef.value.setSelecteds([]) + }, // 是否显示操作列 operationColumn: true, operationWidth: 200, diff --git a/cdTMP/src/views/datamanage/abbreviation/index.vue b/cdTMP/src/views/datamanage/abbreviation/index.vue index 99d7cea..ac5b6fd 100644 --- a/cdTMP/src/views/datamanage/abbreviation/index.vue +++ b/cdTMP/src/views/datamanage/abbreviation/index.vue @@ -25,7 +25,10 @@ const crudOptions = ref({ showIndex: false, searchColNumber: 3, tablePagination: false, - rowSelection: { showCheckedAll: true } + rowSelection: { showCheckedAll: true }, + afterDelete(response) { + crudRef.value.setSelecteds([]) + } }) const crudColumns = ref([ { title: "ID", dataIndex: "id", addDisplay: false, editDisplay: false, width: 50, hide: true }, diff --git a/cdTMP/src/views/datamanage/dictmanage/dataList.vue b/cdTMP/src/views/datamanage/dictmanage/dataList.vue index c8d16d1..e5694ad 100644 --- a/cdTMP/src/views/datamanage/dictmanage/dataList.vue +++ b/cdTMP/src/views/datamanage/dictmanage/dataList.vue @@ -99,7 +99,10 @@ const crudOptions = ref({ }, add: { show: true, api: dictApi.saveDictItem }, edit: { show: true, api: dictApi.updateDictItemData }, - delete: { show: true, api: dictApi.realDeleteItem } + delete: { show: true, api: dictApi.realDeleteItem }, + afterDelete(response) { + crudRef.value.setSelecteds([]) + } }) // crudColumns diff --git a/cdTMP/src/views/datamanage/dictmanage/index.vue b/cdTMP/src/views/datamanage/dictmanage/index.vue index ecdf645..0b2f1a9 100644 --- a/cdTMP/src/views/datamanage/dictmanage/index.vue +++ b/cdTMP/src/views/datamanage/dictmanage/index.vue @@ -61,7 +61,10 @@ const crudOptions = ref({ searchColNumber: 4, tablePagination: false, operationColumn: true, - showTools: false + showTools: false, + afterDelete(response) { + crudRef.value.setSelecteds([]) + } }) const crudColumns = ref([ diff --git a/cdTMP/src/views/datamanage/projContact/index.vue b/cdTMP/src/views/datamanage/projContact/index.vue index c147dd0..ca11c93 100644 --- a/cdTMP/src/views/datamanage/projContact/index.vue +++ b/cdTMP/src/views/datamanage/projContact/index.vue @@ -26,7 +26,10 @@ const crudOptions = ref({ searchColNumber: 3, tablePagination: false, rowSelection: { showCheckedAll: true }, - showTools: false + showTools: false, + afterDelete(response) { + crudRef.value.setSelecteds([]) + } }) const crudColumns = ref([ { title: "ID", dataIndex: "id", addDisplay: false, editDisplay: false, width: 50, hide: true }, diff --git a/cdTMP/src/views/project/case/components/ProblemChoose.vue b/cdTMP/src/views/project/case/components/ProblemChoose.vue index bf43c13..8843e04 100644 --- a/cdTMP/src/views/project/case/components/ProblemChoose.vue +++ b/cdTMP/src/views/project/case/components/ProblemChoose.vue @@ -125,6 +125,9 @@ const crudOptions = ref({ showTools: false, // 不显示工具栏 operationColumn: true, operationColumnAlign: "center", // 操作列居中 + afterDelete(response) { + crudRef.value.setSelecteds([]) + }, isDbClickEdit: false, // 双击不编辑当前列 contextMenu: { enabled: true, diff --git a/cdTMP/src/views/project/case/index.vue b/cdTMP/src/views/project/case/index.vue index 88e6652..50e0109 100644 --- a/cdTMP/src/views/project/case/index.vue +++ b/cdTMP/src/views/project/case/index.vue @@ -106,6 +106,9 @@ const crudOptions = ref({ testDemand: testDemandNumber, case: caseNumber }, + afterDelete(response) { + crudRef.value.setSelecteds([]) + }, showIndex: false, showTools: false, operationColumnAlign: "center", diff --git a/cdTMP/src/views/project/design-demand/index.vue b/cdTMP/src/views/project/design-demand/index.vue index f89156c..40c9158 100644 --- a/cdTMP/src/views/project/design-demand/index.vue +++ b/cdTMP/src/views/project/design-demand/index.vue @@ -153,6 +153,9 @@ const crudOptions = ref({ add: { show: true, api: testDemandApi.save, text: "新增测试项" }, edit: { show: true, api: testDemandApi.update, text: "修改测试项" }, delete: { show: true, api: testDemandApi.delete }, + afterDelete(response) { + crudRef.value.setSelecteds([]) + }, showTools: false, beforeOpenAdd: function () { let key_split = route.query.key.split("-") @@ -198,7 +201,7 @@ const crudOptions = ref({ searchColNumber: 3, tablePagination: false, operationColumn: true, - operationColumnAlign:'center', + operationColumnAlign: "center", formOption: { width: 1200 } diff --git a/cdTMP/src/views/project/dut/index.vue b/cdTMP/src/views/project/dut/index.vue index b05b0ef..4ffc7d7 100644 --- a/cdTMP/src/views/project/dut/index.vue +++ b/cdTMP/src/views/project/dut/index.vue @@ -69,6 +69,9 @@ const crudOptions = ref({ add: { show: true, api: designDemandApi.save, text: "新增设计需求" }, edit: { show: true, api: designDemandApi.editDesignDemand, text: "编辑设计需求" }, delete: { show: true, api: designDemandApi.delete }, + afterDelete(response) { + crudRef.value.setSelecteds([]) + }, // 处理添加后函数 beforeOpenAdd: function () { let key_split = route.query.key.split("-") diff --git a/cdTMP/src/views/project/round/index.vue b/cdTMP/src/views/project/round/index.vue index 6b2fcbd..edd37fb 100644 --- a/cdTMP/src/views/project/round/index.vue +++ b/cdTMP/src/views/project/round/index.vue @@ -32,6 +32,9 @@ let beiceType = [ const crudOptions = ref({ api: dutApi.getDutList, add: { show: true, api: dutApi.save, text: "新增被测件" }, + afterDelete(response) { + crudRef.value.setSelecteds([]) + }, // 处理添加后函数 beforeOpenAdd: function () { let round_str = parseInt(route.query.key) + 1 diff --git a/cdTMP/src/views/project/testDemand/index.vue b/cdTMP/src/views/project/testDemand/index.vue index f053222..64c7d24 100644 --- a/cdTMP/src/views/project/testDemand/index.vue +++ b/cdTMP/src/views/project/testDemand/index.vue @@ -42,6 +42,9 @@ const crudOptions = ref({ delete: { show: true, api: caseApi.delete }, operationColumnAlign: "center", isDbClickEdit: false, // 关闭双击编辑 + afterDelete(response) { + crudRef.value.setSelecteds([]) + }, // 处理新增删除后树状图显示 beforeOpenAdd: function () { let key_split = route.query.key.split("-") diff --git a/cdTMP/src/views/testmanage/components/PageHeader/index.vue b/cdTMP/src/views/testmanage/components/PageHeader/index.vue new file mode 100644 index 0000000..61c17e8 --- /dev/null +++ b/cdTMP/src/views/testmanage/components/PageHeader/index.vue @@ -0,0 +1,43 @@ + + + + + diff --git a/cdTMP/src/views/testmanage/components/PageHeader/types.ts b/cdTMP/src/views/testmanage/components/PageHeader/types.ts new file mode 100644 index 0000000..07d76a9 --- /dev/null +++ b/cdTMP/src/views/testmanage/components/PageHeader/types.ts @@ -0,0 +1,5 @@ +export interface IPageHeaderProps { + title?: string + name?: string + step?: string // 可能出现项目状态 +} diff --git a/cdTMP/src/views/testmanage/projBoard/cpns/Title.vue b/cdTMP/src/views/testmanage/projBoard/cpns/Title.vue index 0859a56..96ecb12 100644 --- a/cdTMP/src/views/testmanage/projBoard/cpns/Title.vue +++ b/cdTMP/src/views/testmanage/projBoard/cpns/Title.vue @@ -1,25 +1,14 @@ -