feat: 更新依赖版本,调整钱包组件和导入作业详情的功能
This commit is contained in:
@@ -51,7 +51,7 @@
|
|||||||
"@better-scroll/core": "2.5.1",
|
"@better-scroll/core": "2.5.1",
|
||||||
"@elysiajs/eden": "^1.4.5",
|
"@elysiajs/eden": "^1.4.5",
|
||||||
"@iconify/vue": "5.0.0",
|
"@iconify/vue": "5.0.0",
|
||||||
"@riwa/api-types": "http://192.168.1.2:9538/api/capp-eden-0.0.44.tgz",
|
"@riwa/api-types": "http://192.168.1.2:9538/api/capp-eden-0.0.45.tgz",
|
||||||
"@sa/axios": "workspace:*",
|
"@sa/axios": "workspace:*",
|
||||||
"@sa/color": "workspace:*",
|
"@sa/color": "workspace:*",
|
||||||
"@sa/hooks": "workspace:*",
|
"@sa/hooks": "workspace:*",
|
||||||
|
|||||||
12
pnpm-lock.yaml
generated
12
pnpm-lock.yaml
generated
@@ -18,8 +18,8 @@ importers:
|
|||||||
specifier: 5.0.0
|
specifier: 5.0.0
|
||||||
version: 5.0.0(vue@3.5.25(typescript@5.9.3))
|
version: 5.0.0(vue@3.5.25(typescript@5.9.3))
|
||||||
'@riwa/api-types':
|
'@riwa/api-types':
|
||||||
specifier: http://192.168.1.2:9538/api/capp-eden-0.0.44.tgz
|
specifier: http://192.168.1.2:9538/api/capp-eden-0.0.45.tgz
|
||||||
version: '@capp/eden@http://192.168.1.2:9538/api/capp-eden-0.0.44.tgz(@elysiajs/eden@1.4.5(elysia@1.4.19(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3)))'
|
version: '@capp/eden@http://192.168.1.2:9538/api/capp-eden-0.0.45.tgz(@elysiajs/eden@1.4.5(elysia@1.4.19(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3)))'
|
||||||
'@sa/axios':
|
'@sa/axios':
|
||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
version: link:packages/axios
|
version: link:packages/axios
|
||||||
@@ -496,9 +496,9 @@ packages:
|
|||||||
'@borewit/text-codec@0.1.1':
|
'@borewit/text-codec@0.1.1':
|
||||||
resolution: {integrity: sha512-5L/uBxmjaCIX5h8Z+uu+kA9BQLkc/Wl06UGR5ajNRxu+/XjonB5i8JpgFMrPj3LXTCPA0pv8yxUvbUi+QthGGA==}
|
resolution: {integrity: sha512-5L/uBxmjaCIX5h8Z+uu+kA9BQLkc/Wl06UGR5ajNRxu+/XjonB5i8JpgFMrPj3LXTCPA0pv8yxUvbUi+QthGGA==}
|
||||||
|
|
||||||
'@capp/eden@http://192.168.1.2:9538/api/capp-eden-0.0.44.tgz':
|
'@capp/eden@http://192.168.1.2:9538/api/capp-eden-0.0.45.tgz':
|
||||||
resolution: {tarball: http://192.168.1.2:9538/api/capp-eden-0.0.44.tgz}
|
resolution: {tarball: http://192.168.1.2:9538/api/capp-eden-0.0.45.tgz}
|
||||||
version: 0.0.44
|
version: 0.0.45
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
'@elysiajs/eden': ^1.4.6
|
'@elysiajs/eden': ^1.4.6
|
||||||
|
|
||||||
@@ -4871,7 +4871,7 @@ snapshots:
|
|||||||
|
|
||||||
'@borewit/text-codec@0.1.1': {}
|
'@borewit/text-codec@0.1.1': {}
|
||||||
|
|
||||||
'@capp/eden@http://192.168.1.2:9538/api/capp-eden-0.0.44.tgz(@elysiajs/eden@1.4.5(elysia@1.4.19(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3)))':
|
'@capp/eden@http://192.168.1.2:9538/api/capp-eden-0.0.45.tgz(@elysiajs/eden@1.4.5(elysia@1.4.19(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3)))':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@elysiajs/eden': 1.4.5(elysia@1.4.19(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3))
|
'@elysiajs/eden': 1.4.5(elysia@1.4.19(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3))
|
||||||
|
|
||||||
|
|||||||
@@ -14,46 +14,26 @@ const emit = defineEmits<{
|
|||||||
(e: 'close'): void;
|
(e: 'close'): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
|
const { data: template, execute } = safeClient(() => client.api.admin.wallet_import.template.get(), {
|
||||||
|
immediate: false
|
||||||
|
});
|
||||||
|
|
||||||
async function handleDownloadTemplate() {
|
async function handleDownloadTemplate() {
|
||||||
downloading.value = true;
|
downloading.value = true;
|
||||||
try {
|
try {
|
||||||
const res = await client.api.admin.wallet_import.template.get();
|
await execute();
|
||||||
// debugger;
|
if (template.value) {
|
||||||
const result = await fetch('http://192.168.1.2:9538/api/admin/wallet_import/template', {
|
const blob = new Blob([template.value]);
|
||||||
method: 'GET',
|
const url = window.URL.createObjectURL(blob);
|
||||||
headers: {
|
const link = document.createElement('a');
|
||||||
Authorization: `Bearer ${localStg.get('token') || ''}`
|
link.href = url;
|
||||||
}
|
link.download = `批量上分模版-${new Date().getTime()}.xlsx`;
|
||||||
});
|
document.body.appendChild(link);
|
||||||
const blob = await result.blob();
|
link.click();
|
||||||
const url = window.URL.createObjectURL(blob);
|
document.body.removeChild(link);
|
||||||
const link = document.createElement('a');
|
window.URL.revokeObjectURL(url);
|
||||||
link.href = url;
|
window.$message?.success('模板下载成功');
|
||||||
link.download = `批量上分模版-${new Date().getTime()}.xlsx`;
|
}
|
||||||
document.body.appendChild(link);
|
|
||||||
link.click();
|
|
||||||
document.body.removeChild(link);
|
|
||||||
window.URL.revokeObjectURL(url);
|
|
||||||
window.$message?.success('模板下载成功');
|
|
||||||
// if (result.data?.value) {
|
|
||||||
// let blob: Blob;
|
|
||||||
// if (typeof result.data.value === 'string') {
|
|
||||||
// blob = new Blob([result.data.value]);
|
|
||||||
// } else {
|
|
||||||
// window.$message?.error('模板下载失败');
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// const url = window.URL.createObjectURL(blob);
|
|
||||||
// const link = document.createElement('a');
|
|
||||||
// link.href = url;
|
|
||||||
// link.download = `批量上分模版-${new Date().getTime()}.xlsx`;
|
|
||||||
// document.body.appendChild(link);
|
|
||||||
// link.click();
|
|
||||||
// document.body.removeChild(link);
|
|
||||||
// window.URL.revokeObjectURL(url);
|
|
||||||
// window.$message?.success('模板下载成功');
|
|
||||||
// }
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
window.$message?.error('模板下载失败');
|
window.$message?.error('模板下载失败');
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -1,12 +1,19 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useTemplateRef } from 'vue';
|
import { useTemplateRef } from 'vue';
|
||||||
|
import { NSelect, useDialog } from 'naive-ui';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { client, safeClient } from '@/service/api';
|
import { client, safeClient } from '@/service/api';
|
||||||
import type { TableBaseColumns, TableFetchData, TableFilterColumns, TableInst } from '@/components/table';
|
import type { TableBaseColumns, TableFetchData, TableFilterColumns, TableInst } from '@/components/table';
|
||||||
|
|
||||||
const tableInst = useTemplateRef<TableInst>('tableInst');
|
const tableInst = useTemplateRef<TableInst>('tableInst');
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
jobId: string;
|
||||||
|
}>();
|
||||||
const fetchData: TableFetchData = ({ pagination, filter }) => {
|
const fetchData: TableFetchData = ({ pagination, filter }) => {
|
||||||
return safeClient(() => client.api.admin.wallet_import.jobs.get({ query: { ...pagination, ...filter } }));
|
return safeClient(() =>
|
||||||
|
client.api.admin.wallet_import.jobs({ id: props.jobId }).items.get({ query: { ...pagination, ...filter } })
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const columns: TableBaseColumns = [
|
const columns: TableBaseColumns = [
|
||||||
@@ -47,7 +54,20 @@ const columns: TableBaseColumns = [
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
const filterColumns: TableFilterColumns = [];
|
const filterColumns: TableFilterColumns = [
|
||||||
|
{
|
||||||
|
key: 'status',
|
||||||
|
title: '状态',
|
||||||
|
component: NSelect,
|
||||||
|
componentProps: {
|
||||||
|
options: [
|
||||||
|
{ label: '成功', value: 'success' },
|
||||||
|
{ label: '失败', value: 'failed' },
|
||||||
|
{ label: '忽略', value: 'ignored' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
];
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -57,11 +77,7 @@ const filterColumns: TableFilterColumns = [];
|
|||||||
:columns="columns"
|
:columns="columns"
|
||||||
:filter-columns="filterColumns"
|
:filter-columns="filterColumns"
|
||||||
:scroll-x="1200"
|
:scroll-x="1200"
|
||||||
:header-operations="{
|
:show-header-operation="false"
|
||||||
add: false,
|
|
||||||
refresh: true,
|
|
||||||
columns: true
|
|
||||||
}"
|
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -25,27 +25,6 @@ const columns: TableBaseColumns = [
|
|||||||
key: 'createdBy',
|
key: 'createdBy',
|
||||||
title: '创建者'
|
title: '创建者'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
key: 'startedAt',
|
|
||||||
title: '开始时间',
|
|
||||||
render: (row: any) => {
|
|
||||||
return dayjs(row.startedAt).format('YYYY-MM-DD HH:mm');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'finishedAt',
|
|
||||||
title: '结束时间',
|
|
||||||
render: (row: any) => {
|
|
||||||
return dayjs(row.finishedAt).format('YYYY-MM-DD HH:mm');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'createdAt',
|
|
||||||
title: '创建时间',
|
|
||||||
render: (row: any) => {
|
|
||||||
return dayjs(row.createdAt).format('YYYY-MM-DD HH:mm');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
key: 'status',
|
key: 'status',
|
||||||
title: '状态'
|
title: '状态'
|
||||||
@@ -74,6 +53,27 @@ const columns: TableBaseColumns = [
|
|||||||
key: 'error',
|
key: 'error',
|
||||||
title: '错误信息'
|
title: '错误信息'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: 'startedAt',
|
||||||
|
title: '开始时间',
|
||||||
|
render: (row: any) => {
|
||||||
|
return dayjs(row.startedAt).format('YYYY-MM-DD HH:mm');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'finishedAt',
|
||||||
|
title: '结束时间',
|
||||||
|
render: (row: any) => {
|
||||||
|
return dayjs(row.finishedAt).format('YYYY-MM-DD HH:mm');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'createdAt',
|
||||||
|
title: '创建时间',
|
||||||
|
render: (row: any) => {
|
||||||
|
return dayjs(row.createdAt).format('YYYY-MM-DD HH:mm');
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
key: 'operations',
|
key: 'operations',
|
||||||
title: '操作',
|
title: '操作',
|
||||||
@@ -87,7 +87,7 @@ const columns: TableBaseColumns = [
|
|||||||
dialog.create({
|
dialog.create({
|
||||||
title: '导入明细',
|
title: '导入明细',
|
||||||
showIcon: false,
|
showIcon: false,
|
||||||
style: { width: '800px' },
|
style: { width: '1200px' },
|
||||||
content: () => h(ImportJobDetails, { jobId: row.id })
|
content: () => h(ImportJobDetails, { jobId: row.id })
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user