|
@@ -1,19 +1,22 @@
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
import type { OnActionClickParams, VxeTableGridOptions } from '#/adapter';
|
|
import type { OnActionClickParams, VxeTableGridOptions } from '#/adapter';
|
|
|
|
|
|
|
|
|
|
+import { useRouter } from 'vue-router';
|
|
|
|
|
+
|
|
|
import { Page, useVbenModal } from '@vben/common-ui';
|
|
import { Page, useVbenModal } from '@vben/common-ui';
|
|
|
|
|
|
|
|
import { Button, message } from 'ant-design-vue';
|
|
import { Button, message } from 'ant-design-vue';
|
|
|
|
|
|
|
|
import { useTableGridOptions, useVbenVxeGrid } from '#/adapter';
|
|
import { useTableGridOptions, useVbenVxeGrid } from '#/adapter';
|
|
|
import { TableApi } from '#/api';
|
|
import { TableApi } from '#/api';
|
|
|
-import FormDesign from '#/views/form/design/form-modal.vue';
|
|
|
|
|
import FormMenuEdit from '#/views/system/menu/components/editMenu.vue';
|
|
import FormMenuEdit from '#/views/system/menu/components/editMenu.vue';
|
|
|
|
|
|
|
|
import FormEdit from './components/edit.vue';
|
|
import FormEdit from './components/edit.vue';
|
|
|
import FormPreview from './components/preview.vue';
|
|
import FormPreview from './components/preview.vue';
|
|
|
import { useColumns, useSearchSchema } from './data.config';
|
|
import { useColumns, useSearchSchema } from './data.config';
|
|
|
|
|
|
|
|
|
|
+const router = useRouter();
|
|
|
|
|
+
|
|
|
const [FormEditModal, formEditApi] = useVbenModal({
|
|
const [FormEditModal, formEditApi] = useVbenModal({
|
|
|
connectedComponent: FormEdit,
|
|
connectedComponent: FormEdit,
|
|
|
});
|
|
});
|
|
@@ -26,10 +29,6 @@ const [FormPreviewModal, formPreviewApi] = useVbenModal({
|
|
|
connectedComponent: FormPreview,
|
|
connectedComponent: FormPreview,
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-const [FormDesignModal, formDesignApi] = useVbenModal({
|
|
|
|
|
- connectedComponent: FormDesign,
|
|
|
|
|
-});
|
|
|
|
|
-
|
|
|
|
|
const handleDelete = async (id: number) => {
|
|
const handleDelete = async (id: number) => {
|
|
|
await TableApi.deleteDetail(id);
|
|
await TableApi.deleteDetail(id);
|
|
|
message.success('数据删除成功');
|
|
message.success('数据删除成功');
|
|
@@ -70,17 +69,6 @@ const handleCreateMenu = (record: any) => {
|
|
|
.open();
|
|
.open();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-const handleDesign = (id: number) => {
|
|
|
|
|
- formDesignApi
|
|
|
|
|
- .setData({
|
|
|
|
|
- isUpdate: false,
|
|
|
|
|
- baseData: {
|
|
|
|
|
- id,
|
|
|
|
|
- },
|
|
|
|
|
- })
|
|
|
|
|
- .open();
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
const handleActionClick = async ({
|
|
const handleActionClick = async ({
|
|
|
code,
|
|
code,
|
|
|
row,
|
|
row,
|
|
@@ -91,7 +79,12 @@ const handleActionClick = async ({
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
case 'design': {
|
|
case 'design': {
|
|
|
- handleDesign(row.id);
|
|
|
|
|
|
|
+ router.push({
|
|
|
|
|
+ name: 'formDesign',
|
|
|
|
|
+ params: {
|
|
|
|
|
+ id: row.id,
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
case 'edit': {
|
|
case 'edit': {
|
|
@@ -137,7 +130,6 @@ const [Grid, { reload }] = useVbenVxeGrid(
|
|
|
<FormEditModal :close-on-click-modal="false" @success="handelSuccess" />
|
|
<FormEditModal :close-on-click-modal="false" @success="handelSuccess" />
|
|
|
<FormMenuEditModal :close-on-click-modal="false" @success="handelSuccess" />
|
|
<FormMenuEditModal :close-on-click-modal="false" @success="handelSuccess" />
|
|
|
<FormPreviewModal :close-on-click-modal="false" />
|
|
<FormPreviewModal :close-on-click-modal="false" />
|
|
|
- <FormDesignModal :close-on-click-modal="false" />
|
|
|
|
|
<Grid>
|
|
<Grid>
|
|
|
<template #toolbar-tools>
|
|
<template #toolbar-tools>
|
|
|
<Button
|
|
<Button
|