diff --git a/components.d.ts b/components.d.ts index 85e3c23..c543c2a 100644 --- a/components.d.ts +++ b/components.d.ts @@ -13,7 +13,7 @@ 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'] - ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete'] + ElAlert: typeof import('element-plus/es')['ElAlert'] ElBadge: typeof import('element-plus/es')['ElBadge'] ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] @@ -24,7 +24,6 @@ declare module '@vue/runtime-core' { 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'] @@ -36,6 +35,7 @@ declare module '@vue/runtime-core' { ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] ElOption: typeof import('element-plus/es')['ElOption'] ElPagination: typeof import('element-plus/es')['ElPagination'] + ElPopover: typeof import('element-plus/es')['ElPopover'] ElProgress: typeof import('element-plus/es')['ElProgress'] ElRow: typeof import('element-plus/es')['ElRow'] ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] diff --git a/src/api/project.js b/src/api/project.js index e8a0f23..5a3e008 100644 --- a/src/api/project.js +++ b/src/api/project.js @@ -160,9 +160,6 @@ export function GetChildModById(sysId, token) { }); } -//查询子模块 - - //新增子模块 export function AddChildModule(data, token) { return request({ diff --git a/src/views/personal/project/charge.vue b/src/views/personal/project/charge.vue index 0ca1192..93fbd8e 100644 --- a/src/views/personal/project/charge.vue +++ b/src/views/personal/project/charge.vue @@ -421,7 +421,6 @@ const AddDialogVisible = ref(false); const DeleteDialogVisible = ref(false); const DeleteMulDialogVisible = ref(false); const EditDialogVisible = ref(false); -const AppointDialogVisible = ref(false); const tableData = ref([]); const listLoading = ref(false); const token = getToken(); @@ -433,10 +432,6 @@ const editId = reactive({ id:'', }) const searchData = reactive({ name:'', }); const deleteDatas = reactive({ ids: '' }); const deleteData = reactive({ id: '' }); -const currentRowData = ref([]); -let appointOptions = reactive({option:''}); -const selectedPrincipal = ref(''); - const AddFormData = reactive({ name: '', description: '', @@ -623,6 +618,28 @@ function CancelDelete() { //编辑项目 +function toggleEditDialog(row) { + console.log("Editing row:", row); // 打印行数据,用于调试 + // 假设 EditFormData 是用于存储编辑表单数据的响应式对象 + EditFormData.name = row.name; + EditFormData.description = row.description; + EditFormData.tags = row.tags.toString(); + EditFormData.files = row.files; + EditFormData.cycle = row.cycle; + EditFormData.workLoad = row.workLoad; + EditFormData.status = row.status; + editId.id = row.id + EditFormData.principalId = row.principalId; + EditFormData.projectId = row.id; + EditDialogVisible.value = true; // 显示编辑对话框 +} + + +function CancelEdit() { + EditDialogVisible.value = false; +} + + async function editProject() { console.log("edit token:", token); try { @@ -653,27 +670,6 @@ async function SearchProjectByName() { } } - -function toggleEditDialog(row) { - console.log("Editing row:", row); // 打印行数据,用于调试 - // 假设 EditFormData 是用于存储编辑表单数据的响应式对象 - EditFormData.name = row.name; - EditFormData.description = row.description; - EditFormData.tags = row.tags.toString(); - EditFormData.files = row.files; - EditFormData.cycle = row.cycle; - EditFormData.workLoad = row.workLoad; - EditFormData.status = row.status; - editId.id = row.id - EditFormData.principalId = row.principalId; - EditDialogVisible.value = true; // 显示编辑对话框 -} - - -function CancelEdit() { - EditDialogVisible.value = false; -} - function reset() { searchData.name = ''; getList(); diff --git a/src/views/personal/project/childSystem/charge.vue b/src/views/personal/project/childSystem/charge.vue index 80f17f7..4cd2c88 100644 --- a/src/views/personal/project/childSystem/charge.vue +++ b/src/views/personal/project/childSystem/charge.vue @@ -287,49 +287,36 @@ > - - - - - - - + + +
+ +
+
+
+ - - - - -
@@ -363,6 +350,15 @@ + + + - + + + 确认删除该项目吗? + + + + 确认删除该子模块吗? @@ -279,17 +295,23 @@ - +
+ +
- - - - - item.id); } +function toggleMulDeleteDialog() { + if (deleteDatas.ids.length === 0) { + ElMessage({ + message: '请选择要删除的子模块', + type: 'warning', + duration: 2500 + }); + } else { + DeleteMulDialogVisible.value = true; + } +} + +async function deleteMulChildModule() { + try { + const res = await DeleteChildModule(deleteDatas.ids, token); + if (res.code === 200) { + ElMessage({ + message: '删除成功', + type: 'success', + }); + console.log("多个子模块删除成功"); + DeleteMulDialogVisible.value = false; + getChildModuleById(); + } else { + console.error("'多个子模块删除失败:", res); + } + } finally { + listLoading.value = false; + } +} + +//取消多个删除 +function CancelMulDelete() { + DeleteMulDialogVisible.value = false; +} + +//删除单个子模块 +function toggleDeleteDialog(row) { + deleteData.id = row.id; + DeleteDialogVisible.value = true; +} + +async function deleteChildModule() { + try { + const res = await DeleteChildModule(deleteData.id, token); + if (res.code === 200) { + ElMessage({ + message: '删除成功', + type: 'success', + }); + console.log("单个子模块删除成功"); + DeleteDialogVisible.value = false; + getChildModuleById(); + } else { + console.error("单个子模块删除失败:", res); + } + } finally { + listLoading.value = false; + } +} + +//取消单个删除 function CancelDelete() { DeleteDialogVisible.value = false; } +//编辑子模块 function toggleEditDialog(row) { - console.log("Editing row:", row); // 打印行数据,用于调试 EditFormData.name = row.name; EditFormData.description = row.description; EditFormData.status = row.status; @@ -547,10 +603,31 @@ function toggleEditDialog(row) { EditDialogVisible.value = true; // 显示编辑对话框 } +async function editChildModule() { + try { + const response = await EditChildModule(editId, EditFormData, token); + if (response.code === 200) { + listLoading.value = true; + ElMessage({ + message: '修改成功', + type: 'success', + }) + getChildModuleById(); + } else { + console.error("修改失败,响应内容:", response); + } + } finally { + listLoading.value = false; + AddDialogVisible.value = false; + } +} + +//取消编辑 function CancelEdit() { EditDialogVisible.value = false; } + function reset() { searchData.name = ''; getChildModuleById();