|
@@ -5,7 +5,7 @@ import { dict } from '@fast-crud/fast-crud';
|
|
import axios from 'axios';
|
|
import axios from 'axios';
|
|
import { getServiceEnvConfig } from '~/.env-config';
|
|
import { getServiceEnvConfig } from '~/.env-config';
|
|
import type { AddArchivesParams } from './api';
|
|
import type { AddArchivesParams } from './api';
|
|
-import { getArchives, getFile, addArchives, deleteArchives } from './api';
|
|
|
|
|
|
+import { getArchives, getFile, addArchives, deleteArchives, downloadArchives } from './api';
|
|
const { url, proxyPattern } = getServiceEnvConfig(import.meta.env);
|
|
const { url, proxyPattern } = getServiceEnvConfig(import.meta.env);
|
|
const isHttpProxy = import.meta.env.VITE_HTTP_PROXY === 'Y';
|
|
const isHttpProxy = import.meta.env.VITE_HTTP_PROXY === 'Y';
|
|
export default function createCrudOptions(crudOptionsProps: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
|
export default function createCrudOptions(crudOptionsProps: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
|
@@ -84,7 +84,29 @@ export default function createCrudOptions(crudOptionsProps: CreateCrudOptionsPro
|
|
show: false
|
|
show: false
|
|
},
|
|
},
|
|
actionbar: {
|
|
actionbar: {
|
|
- show: true
|
|
|
|
|
|
+ show: true,
|
|
|
|
+ buttons: {
|
|
|
|
+ download: {
|
|
|
|
+ text: '打包下载档案',
|
|
|
|
+ title: '下载当前学员所有档案',
|
|
|
|
+ circle: false,
|
|
|
|
+ tooltip: {
|
|
|
|
+ slots: {
|
|
|
|
+ default() {
|
|
|
|
+ return '下载当前学员所有档案';
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ click: async () => {
|
|
|
|
+ if (!crudOptionsProps.context) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ const { data } = await downloadArchives(crudOptionsProps.context.studentNumber);
|
|
|
|
+ const fileUrl = `http://localhost:3200/proxy-pattern/archive/getFileByToken?archiveToken=${data}`;
|
|
|
|
+ window.location.href = fileUrl;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
},
|
|
},
|
|
form: {
|
|
form: {
|
|
wrapper: {
|
|
wrapper: {
|