From 8680c52ad9bdcd3bd65f7e543e75e326ba4fd894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CXCYH=E2=80=9D?= <“1561381013@qq.com”> Date: Sun, 21 Apr 2024 02:49:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=92=8C=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- auto-imports.d.ts | 1 + components.d.ts | 1 + src/api/manage.js | 46 +++++ src/views/personal/project/detail/manage.vue | 195 ++++++++++++++----- 4 files changed, 196 insertions(+), 47 deletions(-) diff --git a/auto-imports.d.ts b/auto-imports.d.ts index 8139ac9..24e619c 100644 --- a/auto-imports.d.ts +++ b/auto-imports.d.ts @@ -2,4 +2,5 @@ export {} declare global { const ElMessage: typeof import('element-plus/es')['ElMessage'] + const ElMessageBox: typeof import('element-plus/es')['ElMessageBox'] } diff --git a/components.d.ts b/components.d.ts index 3410aed..8c0f53f 100644 --- a/components.d.ts +++ b/components.d.ts @@ -24,6 +24,7 @@ declare module '@vue/runtime-core' { ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] ElDescriptions: typeof import('element-plus/es')['ElDescriptions'] + ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem'] ElDialog: typeof import('element-plus/es')['ElDialog'] ElDivider: typeof import('element-plus/es')['ElDivider'] ElDropdown: typeof import('element-plus/es')['ElDropdown'] diff --git a/src/api/manage.js b/src/api/manage.js index 5a97cf7..6691ec5 100644 --- a/src/api/manage.js +++ b/src/api/manage.js @@ -219,6 +219,52 @@ export const addModule = (body,token) => { }) } +/** + * + * 删除子模块 + * @param {number} id 子模块ID + * @param {string} token 访问令牌 + * @returns {Promise>} + * + */ +export const deleteModule = (id,token) => { + return axios({ + url: api +"/project/module/delete?id=" +id , + method: "delete", + headers: { + 'Authorization': 'Bearer ' + token, + 'Timestamp': getCurrentTimestamp() + }, + + + + }) +} +/** + * + * 修改子模块 + * @param {number} id 子模块ID + * @param {Object} body 包含子模块更新信息的对象 + * @param {string} token 访问令牌 + * @returns {Promise>} + * + */ +export const editModule = ( body,id,token) => { + return axios({ + url: api +"/project/module/edit?id=" +id , + method: "put", + headers: { + 'Authorization': 'Bearer ' + token, + 'Timestamp': getCurrentTimestamp() + }, + data:body + + + + }) +} + + diff --git a/src/views/personal/project/detail/manage.vue b/src/views/personal/project/detail/manage.vue index 389bbd1..035ea54 100644 --- a/src/views/personal/project/detail/manage.vue +++ b/src/views/personal/project/detail/manage.vue @@ -2,8 +2,6 @@
- - @@ -11,48 +9,51 @@ -
{{ item.label }}
+
{{ item.label }}
-
{{ - item.value - }}
- - - - +
+ + +
+
-
- 编辑 - 删除 - + + {{ editMode ? '保存' : '编辑' }} + + 删除
- - +
+