From 94ac22007336d69b200d99ce1eb53899d600c690 Mon Sep 17 00:00:00 2001 From: GUjiYN <2946459904@qq.com> Date: Sat, 20 Apr 2024 14:36:46 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E4=B8=9A=E5=8A=A1):=20=E5=AD=90=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E7=9B=B8=E5=85=B3=E6=88=91=E8=B4=9F=E8=B4=A3=E7=9A=84?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E8=BF=9B=E8=A1=8C=E5=AE=8C=E5=96=841?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 16 - src/api/project.js | 45 +- src/router/index.ts | 7 +- src/views/personal/project/charge.vue | 34 +- .../personal/project/childSystem/charge.vue | 385 ++++++++------- .../personal/project/childmodel/charge.vue | 440 ++++++++++++++++++ 6 files changed, 708 insertions(+), 219 deletions(-) diff --git a/components.d.ts b/components.d.ts index 0a90341..fc390cc 100644 --- a/components.d.ts +++ b/components.d.ts @@ -13,21 +13,16 @@ declare module '@vue/runtime-core' { DropdownMenu: typeof import('./src/components/Share/DropdownMenu.vue')['default'] Dropzone: typeof import('./src/components/Dropzone/index.vue')['default'] EditorImage: typeof import('./src/components/Tinymce/components/EditorImage.vue')['default'] - ElAlert: typeof import('element-plus/es')['ElAlert'] - ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete'] ElBadge: typeof import('element-plus/es')['ElBadge'] ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] ElButton: typeof import('element-plus/es')['ElButton'] ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup'] ElCard: typeof import('element-plus/es')['ElCard'] - ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] - ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup'] ElCol: typeof import('element-plus/es')['ElCol'] ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] ElDialog: typeof import('element-plus/es')['ElDialog'] - ElDivider: typeof import('element-plus/es')['ElDivider'] ElDropdown: typeof import('element-plus/es')['ElDropdown'] ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem'] ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu'] @@ -41,10 +36,6 @@ declare module '@vue/runtime-core' { ElPagination: typeof import('element-plus/es')['ElPagination'] ElPopover: typeof import('element-plus/es')['ElPopover'] ElProgress: typeof import('element-plus/es')['ElProgress'] - ElRadio: typeof import('element-plus/es')['ElRadio'] - ElRadioButton: typeof import('element-plus/es')['ElRadioButton'] - ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] - ElRate: typeof import('element-plus/es')['ElRate'] ElRow: typeof import('element-plus/es')['ElRow'] ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] ElSelect: typeof import('element-plus/es')['ElSelect'] @@ -52,12 +43,8 @@ declare module '@vue/runtime-core' { ElSwitch: typeof import('element-plus/es')['ElSwitch'] ElTable: typeof import('element-plus/es')['ElTable'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] - ElTabPane: typeof import('element-plus/es')['ElTabPane'] - ElTabs: typeof import('element-plus/es')['ElTabs'] ElTag: typeof import('element-plus/es')['ElTag'] - ElTimePicker: typeof import('element-plus/es')['ElTimePicker'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] - ElTree: typeof import('element-plus/es')['ElTree'] ElUpload: typeof import('element-plus/es')['ElUpload'] ErrorLog: typeof import('./src/components/ErrorLog/index.vue')['default'] GithubCorner: typeof import('./src/components/GithubCorner/index.vue')['default'] @@ -85,7 +72,4 @@ declare module '@vue/runtime-core' { UploadExcel: typeof import('./src/components/UploadExcel/index.vue')['default'] VueCountTo: typeof import('./src/components/vue-count-to/vue-countTo.vue')['default'] } - export interface ComponentCustomProperties { - vLoading: typeof import('element-plus/es')['ElLoadingDirective'] - } } diff --git a/src/api/project.js b/src/api/project.js index d2ae2c3..849c5ad 100644 --- a/src/api/project.js +++ b/src/api/project.js @@ -76,7 +76,7 @@ export function GetProjectByName(name, token) { //根据项目id查询子系统 export function GetChildSysById(projectId, token) { return request({ - url: '/module/get', + url: "/module/get?projectId=" + projectId , method: 'get', params: { projectId }, headers: { @@ -88,7 +88,7 @@ export function GetChildSysById(projectId, token) { } //根据项目名和子系统名查询子模块 -export function GetChildModuleByName(projectName, childName, token) { +export function GetChildSysByName(projectName, childName, token) { return request({ url: '/project/module/get/name', method: 'get', @@ -101,3 +101,44 @@ export function GetChildModuleByName(projectName, childName, token) { }); } +//新增子系统 +export function AddChildSystem(data, token) { + return request({ + url: '/project/child/add', + method: 'post', + data, + headers: { + 'Authorization':'Bearer '+ token, + 'content-type': 'application/json;charset=utf-8', + 'Timestamp': getCurrentTimestamp() + } + }); +} + +//新增子模块 +export function AddChildModule(data, token) { + return request({ + url: '/project/module/add', + method: 'post', + data, + headers: { + 'Authorization':'Bearer '+ token, + 'content-type': 'application/json;charset=utf-8', + 'Timestamp': getCurrentTimestamp() + } + }); +} + +//删除子模块 +export function DeleteChildModule(id, token) { + return request({ + url: '/project/module/delete', + method: 'delete', + params:{ id }, + headers: { + 'Authorization':'Bearer '+ token, + 'content-type': 'application/json;charset=utf-8', + 'Timestamp': getCurrentTimestamp() + } + }); +} diff --git a/src/router/index.ts b/src/router/index.ts index e8fda07..6de007a 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -188,17 +188,16 @@ export const asyncRoutes:RouteRecordRaw[] = [ }, //我负责的子系统和子模块 { - path: 'childSysCharge/:name', + path: 'childSysCharge', component: () => import('@/views/personal/project/childSystem/charge.vue'), name: 'ChildSysCharge', - meta: { title: '子系统', breadcrumb: true , affix: true }, - props: true + meta: { title: '子系统', breadcrumb: true , hidden: true }, }, { path: 'childModCharge', component: () => import('@/views/personal/project/childmodel/charge.vue'), name: 'ChildModCharge', - meta: { title: '子模块', breadcrumb: true , hidden: true } + meta: { title: '子模块', breadcrumb: true , hidden: true } }, //我管理的子系统和子模块 { diff --git a/src/views/personal/project/charge.vue b/src/views/personal/project/charge.vue index 8dabd35..2483a96 100644 --- a/src/views/personal/project/charge.vue +++ b/src/views/personal/project/charge.vue @@ -232,10 +232,10 @@ }" > - 未开始 - 进行中 - 已完成 - 暂停 + 未开始 + 进行中 + 已完成 + 已暂停 @@ -526,29 +526,9 @@ async function SearchProjectByName() { } } -/* - -async function toChildSystem(projectName) { - console.log("search token:", token, "project name:", projectName); - listLoading.value = true; // 显示加载状态 - try { - const response = await GetChildProjectByName(projectName, token); - if (response && response.data && response.data.name) { - console.log("Child project name:", response.data.name); - router.push({ name: 'ChildSysCharge', params: { name: response.data.name } }); - } else { - console.error("未获取到预期的子系统名称,响应内容:", response); - } - } catch (error) { - console.error('查询子系统名称失败:', error); - } finally { - listLoading.value = false; // 隐藏加载状态 - } -} -*/ - -function toChildSystem(projectId) { - router.push({ name: 'ChildSysCharge', params: { name: projectId } }); +function toChildSystem(id) { + console.log("projectId:", id); + router.push({ name: 'ChildSysCharge', quary: { id: 4 } }); } diff --git a/src/views/personal/project/childSystem/charge.vue b/src/views/personal/project/childSystem/charge.vue index 6ee1141..476007b 100644 --- a/src/views/personal/project/childSystem/charge.vue +++ b/src/views/personal/project/childSystem/charge.vue @@ -2,13 +2,14 @@
@@ -20,7 +21,7 @@
- + 查询 @@ -38,7 +39,7 @@
子系统列表
- + 新增 @@ -50,6 +51,7 @@
+ @@ -103,7 +105,7 @@ diff --git a/src/views/personal/project/childmodel/charge.vue b/src/views/personal/project/childmodel/charge.vue index e69de29..3f8072f 100644 --- a/src/views/personal/project/childmodel/charge.vue +++ b/src/views/personal/project/childmodel/charge.vue @@ -0,0 +1,440 @@ + + +