...
|
...
|
@@ -2,36 +2,45 @@ |
2
|
2
|
<div>
|
3
|
3
|
<BasicTable :clickToRowSelect="false" @register="registerTable" :searchInfo="searchInfo">
|
4
|
4
|
<template #toolbar>
|
5
|
|
- <Authority value="api:yt:reportExport:export">
|
6
|
|
- <Popconfirm title="您确定要导出报表数据吗?" ok-text="确定" cancel-text="取消" @confirm="exportCharts()">
|
7
|
|
- <a-button type="primary"> 导出报表 </a-button>
|
8
|
|
- </Popconfirm>
|
9
|
|
- </Authority>
|
10
|
5
|
<Authority value="api:yt:reportExport:delete">
|
11
|
|
- <Popconfirm title="您确定要批量删除数据" ok-text="确定" cancel-text="取消" @confirm="handleDeleteOrBatchDelete(null)">
|
|
6
|
+ <Popconfirm
|
|
7
|
+ title="您确定要批量删除数据"
|
|
8
|
+ ok-text="确定"
|
|
9
|
+ cancel-text="取消"
|
|
10
|
+ @confirm="handleDeleteOrBatchDelete(null)"
|
|
11
|
+ >
|
12
|
12
|
<a-button type="primary" color="error" :disabled="hasBatchDelete"> 批量删除 </a-button>
|
13
|
13
|
</Popconfirm>
|
14
|
14
|
</Authority>
|
15
|
15
|
</template>
|
16
|
16
|
<template #action="{ record }">
|
17
|
|
- <TableAction :actions="[
|
18
|
|
- {
|
19
|
|
- label: '报表查看',
|
20
|
|
- icon: 'clarity:note-edit-line',
|
21
|
|
- auth: 'api:yt:reportExport:get',
|
22
|
|
- onClick: handleView.bind(null, record),
|
23
|
|
- },
|
24
|
|
- {
|
25
|
|
- label: '删除',
|
26
|
|
- icon: 'ant-design:delete-outlined',
|
27
|
|
- auth: 'api:yt:reportExport:delete',
|
28
|
|
- color: 'error',
|
29
|
|
- popConfirm: {
|
30
|
|
- title: '是否确认删除',
|
31
|
|
- confirm: handleDeleteOrBatchDelete.bind(null, record),
|
|
17
|
+ <TableAction
|
|
18
|
+ :actions="[
|
|
19
|
+ {
|
|
20
|
+ label: '报表导出',
|
|
21
|
+ icon: 'clarity:note-edit-line',
|
|
22
|
+ auth: 'api:yt:reportExport:export',
|
|
23
|
+ onClick: handleExport.bind(null, record),
|
|
24
|
+ ifShow: record.executeStatus === 1,
|
|
25
|
+ },
|
|
26
|
+ {
|
|
27
|
+ label: '报表查看',
|
|
28
|
+ icon: 'clarity:note-edit-line',
|
|
29
|
+ auth: 'api:yt:reportExport:get',
|
|
30
|
+ onClick: handleView.bind(null, record),
|
32
|
31
|
},
|
33
|
|
- },
|
34
|
|
- ]" />
|
|
32
|
+ {
|
|
33
|
+ label: '删除',
|
|
34
|
+ icon: 'ant-design:delete-outlined',
|
|
35
|
+ auth: 'api:yt:reportExport:delete',
|
|
36
|
+ color: 'error',
|
|
37
|
+ popConfirm: {
|
|
38
|
+ title: '是否确认删除',
|
|
39
|
+ confirm: handleDeleteOrBatchDelete.bind(null, record),
|
|
40
|
+ },
|
|
41
|
+ },
|
|
42
|
+ ]"
|
|
43
|
+ />
|
35
|
44
|
</template>
|
36
|
45
|
</BasicTable>
|
37
|
46
|
<ReportPreviewModal @register="registerModal" />
|
...
|
...
|
@@ -39,75 +48,67 @@ |
39
|
48
|
</template>
|
40
|
49
|
|
41
|
50
|
<script lang="ts" setup>
|
42
|
|
-import { reactive, nextTick } from 'vue';
|
43
|
|
-import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
44
|
|
-import { searchFormSchema, columns } from './config.data';
|
45
|
|
-import { Authority } from '/@/components/Authority';
|
46
|
|
-import { useBatchDelete } from '/@/hooks/web/useBatchDelete';
|
47
|
|
-import { Popconfirm } from 'ant-design-vue';
|
48
|
|
-import { useModal } from '/@/components/Modal';
|
49
|
|
-import ReportPreviewModal from './ReportPreviewModal.vue';
|
50
|
|
-import {
|
51
|
|
- exportPage,
|
52
|
|
- deleteExportManage
|
53
|
|
-} from '/@/api/export/exportManager';
|
54
|
|
-
|
55
|
|
-const searchInfo = reactive<Recordable>({});
|
|
51
|
+ import { reactive, nextTick } from 'vue';
|
|
52
|
+ import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
|
53
|
+ import { searchFormSchema, columns } from './config.data';
|
|
54
|
+ import { Authority } from '/@/components/Authority';
|
|
55
|
+ import { useBatchDelete } from '/@/hooks/web/useBatchDelete';
|
|
56
|
+ import { Popconfirm } from 'ant-design-vue';
|
|
57
|
+ import { useModal } from '/@/components/Modal';
|
|
58
|
+ import ReportPreviewModal from './ReportPreviewModal.vue';
|
|
59
|
+ import { exportPage, deleteExportManage } from '/@/api/export/exportManager';
|
|
60
|
+ import { downloadByUrl } from '/@/utils/file/download';
|
56
|
61
|
|
57
|
|
-const [registerTable, { reload, setProps, setTableData }] = useTable({
|
58
|
|
- title: '报表导出列表',
|
59
|
|
- api: exportPage,
|
60
|
|
- columns,
|
61
|
|
- showIndexColumn: false,
|
62
|
|
- clickToRowSelect: false,
|
63
|
|
- formConfig: {
|
64
|
|
- labelWidth: 120,
|
65
|
|
- schemas: searchFormSchema,
|
66
|
|
- },
|
67
|
|
- useSearchForm: true,
|
68
|
|
- showTableSetting: true,
|
69
|
|
- bordered: true,
|
70
|
|
- rowKey: 'id',
|
71
|
|
- actionColumn: {
|
72
|
|
- width: 200,
|
73
|
|
- title: '操作',
|
74
|
|
- dataIndex: 'action',
|
75
|
|
- slots: { customRender: 'action' },
|
76
|
|
- fixed: 'right',
|
77
|
|
- },
|
78
|
|
-});
|
79
|
|
-
|
80
|
|
-const handleSuccess = () => {
|
81
|
|
- reload();
|
82
|
|
-};
|
83
|
|
-
|
84
|
|
-const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions } = useBatchDelete(
|
85
|
|
- deleteExportManage,
|
86
|
|
- handleSuccess,
|
87
|
|
- setProps
|
88
|
|
-);
|
|
62
|
+ const searchInfo = reactive<Recordable>({});
|
|
63
|
+ const [registerTable, { reload, setProps }] = useTable({
|
|
64
|
+ title: '报表导出列表',
|
|
65
|
+ api: exportPage,
|
|
66
|
+ columns,
|
|
67
|
+ showIndexColumn: false,
|
|
68
|
+ clickToRowSelect: false,
|
|
69
|
+ formConfig: {
|
|
70
|
+ labelWidth: 120,
|
|
71
|
+ schemas: searchFormSchema,
|
|
72
|
+ },
|
|
73
|
+ useSearchForm: true,
|
|
74
|
+ showTableSetting: true,
|
|
75
|
+ bordered: true,
|
|
76
|
+ rowKey: 'id',
|
|
77
|
+ actionColumn: {
|
|
78
|
+ width: 200,
|
|
79
|
+ title: '操作',
|
|
80
|
+ dataIndex: 'action',
|
|
81
|
+ slots: { customRender: 'action' },
|
|
82
|
+ fixed: 'right',
|
|
83
|
+ },
|
|
84
|
+ });
|
89
|
85
|
|
90
|
|
-nextTick(() => {
|
91
|
|
- setProps(selectionOptions);
|
92
|
|
- setTableData([
|
93
|
|
- {
|
94
|
|
- reportConfigName: '1',
|
95
|
|
- organizationName: '2',
|
96
|
|
- dataCompare: 1,
|
97
|
|
- executeWay: 1,
|
98
|
|
- executeTime: 1,
|
99
|
|
- status: 2
|
100
|
|
- }
|
101
|
|
- ])
|
|
86
|
+ const handleSuccess = () => {
|
|
87
|
+ reload();
|
|
88
|
+ };
|
102
|
89
|
|
103
|
|
-});
|
|
90
|
+ const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions } = useBatchDelete(
|
|
91
|
+ deleteExportManage,
|
|
92
|
+ handleSuccess,
|
|
93
|
+ setProps
|
|
94
|
+ );
|
104
|
95
|
|
105
|
|
-const [registerModal, { openModal }] = useModal();
|
106
|
|
-const handleView = (_, record) => {
|
107
|
|
- openModal(true, {
|
108
|
|
- isUpdate: true,
|
109
|
|
- record,
|
|
96
|
+ nextTick(() => {
|
|
97
|
+ setProps(selectionOptions);
|
110
|
98
|
});
|
111
|
|
-};
|
112
|
|
-const exportCharts = () => { };
|
|
99
|
+
|
|
100
|
+ const [registerModal, { openModal }] = useModal();
|
|
101
|
+ const handleView = (_, record) => {
|
|
102
|
+ openModal(true, {
|
|
103
|
+ isUpdate: true,
|
|
104
|
+ record,
|
|
105
|
+ });
|
|
106
|
+ };
|
|
107
|
+ const handleExport = (record) => {
|
|
108
|
+ const url = record.reportPath;
|
|
109
|
+ downloadByUrl({
|
|
110
|
+ url,
|
|
111
|
+ target: '_self',
|
|
112
|
+ });
|
|
113
|
+ };
|
113
|
114
|
</script> |
...
|
...
|
|