feat: 项目模块添加进展功能
This commit is contained in:
@@ -18,5 +18,6 @@
|
|||||||
"code": "Project Code",
|
"code": "Project Code",
|
||||||
"name": "Project Name",
|
"name": "Project Name",
|
||||||
"envInfoFile": "Environment Info Attachment",
|
"envInfoFile": "Environment Info Attachment",
|
||||||
"list": "Project List"
|
"list": "Project List",
|
||||||
|
"progress": "Progress"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,5 +18,6 @@
|
|||||||
"code": "项目编号",
|
"code": "项目编号",
|
||||||
"name": "项目名称",
|
"name": "项目名称",
|
||||||
"envInfoFile": "环境信息附件",
|
"envInfoFile": "环境信息附件",
|
||||||
"list": "项目列表"
|
"list": "项目列表",
|
||||||
|
"progress": "进展"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -510,6 +510,11 @@ export function useGridColumns(
|
|||||||
code: 'edit',
|
code: 'edit',
|
||||||
show: hasAccessByCodes(['license:project:update']),
|
show: hasAccessByCodes(['license:project:update']),
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// code: 'progress',
|
||||||
|
// text: $t('project.progress'),
|
||||||
|
// show: hasAccessByCodes(['license:project:update']),
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
code: 'delete',
|
code: 'delete',
|
||||||
show: hasAccessByCodes(['license:project:delete']),
|
show: hasAccessByCodes(['license:project:delete']),
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import type {
|
|||||||
} from '#/adapter/vxe-table';
|
} from '#/adapter/vxe-table';
|
||||||
import type { ProjectApi } from '#/api/license/project';
|
import type { ProjectApi } from '#/api/license/project';
|
||||||
|
|
||||||
import { Page, useVbenModal } from '@vben/common-ui';
|
import { Page, useVbenDrawer, useVbenModal } from '@vben/common-ui';
|
||||||
import { downloadFileFromBlobPart } from '@vben/utils';
|
import { downloadFileFromBlobPart } from '@vben/utils';
|
||||||
|
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
@@ -20,12 +20,18 @@ import { $t } from '#/locales';
|
|||||||
|
|
||||||
import { useGridColumns, useGridFormSchema } from './data';
|
import { useGridColumns, useGridFormSchema } from './data';
|
||||||
import Form from './modules/form.vue';
|
import Form from './modules/form.vue';
|
||||||
|
import Progress from './modules/progress.vue';
|
||||||
|
|
||||||
const [FormModal, formModalApi] = useVbenModal({
|
const [FormModal, formModalApi] = useVbenModal({
|
||||||
connectedComponent: Form,
|
connectedComponent: Form,
|
||||||
destroyOnClose: true,
|
destroyOnClose: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const [ProgressDrawer, progressDrawerApi] = useVbenDrawer({
|
||||||
|
connectedComponent: Progress,
|
||||||
|
destroyOnClose: true,
|
||||||
|
});
|
||||||
|
|
||||||
/** 刷新表格 */
|
/** 刷新表格 */
|
||||||
function onRefresh() {
|
function onRefresh() {
|
||||||
gridApi.query();
|
gridApi.query();
|
||||||
@@ -41,6 +47,11 @@ function onEdit(row: ProjectApi.Project) {
|
|||||||
formModalApi.setData(row).open();
|
formModalApi.setData(row).open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 项目进展 */
|
||||||
|
function onProgress(row: ProjectApi.Project) {
|
||||||
|
progressDrawerApi.setData(row).open();
|
||||||
|
}
|
||||||
|
|
||||||
/** 删除项目 */
|
/** 删除项目 */
|
||||||
async function onDelete(row: ProjectApi.Project) {
|
async function onDelete(row: ProjectApi.Project) {
|
||||||
const hideLoading = message.loading({
|
const hideLoading = message.loading({
|
||||||
@@ -78,6 +89,10 @@ function onActionClick({ code, row }: OnActionClickParams<ProjectApi.Project>) {
|
|||||||
onEdit(row);
|
onEdit(row);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'progress': {
|
||||||
|
onProgress(row);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,6 +138,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
<template>
|
<template>
|
||||||
<Page auto-content-height>
|
<Page auto-content-height>
|
||||||
<FormModal @success="onRefresh" />
|
<FormModal @success="onRefresh" />
|
||||||
|
<ProgressDrawer @success="onRefresh" />
|
||||||
|
|
||||||
<Grid :table-title="$t('project.list')">
|
<Grid :table-title="$t('project.list')">
|
||||||
<template #toolbar-tools>
|
<template #toolbar-tools>
|
||||||
|
|||||||
41
apps/web-antd/src/views/license/project/modules/progress.vue
Normal file
41
apps/web-antd/src/views/license/project/modules/progress.vue
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
import type { ProjectApi } from '#/api/license/project';
|
||||||
|
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
|
import { useVbenDrawer } from '@vben/common-ui';
|
||||||
|
|
||||||
|
import { getProject } from '#/api/license/project';
|
||||||
|
|
||||||
|
const projectData = ref<ProjectApi.Project>();
|
||||||
|
|
||||||
|
const [Drawer, drawerApi] = useVbenDrawer({
|
||||||
|
async onConfirm() {},
|
||||||
|
async onOpenChange(isOpen: boolean) {
|
||||||
|
if (!isOpen) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 加载数据
|
||||||
|
let data = drawerApi.getData<ProjectApi.Project>();
|
||||||
|
if (!data) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (data.id) {
|
||||||
|
drawerApi.lock();
|
||||||
|
try {
|
||||||
|
data = await getProject(data.id);
|
||||||
|
} finally {
|
||||||
|
drawerApi.unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 设置到 values
|
||||||
|
projectData.value = data;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<Drawer :title="projectData?.name" class="w-[800px]">
|
||||||
|
<div>进展测试</div>
|
||||||
|
<div>{{ projectData }}</div>
|
||||||
|
</Drawer>
|
||||||
|
</template>
|
||||||
Reference in New Issue
Block a user