feat: 更新依赖版本,调整钱包组件和导入作业详情的功能
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
"@better-scroll/core": "2.5.1",
|
||||
"@elysiajs/eden": "^1.4.5",
|
||||
"@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/color": "workspace:*",
|
||||
"@sa/hooks": "workspace:*",
|
||||
|
||||
12
pnpm-lock.yaml
generated
12
pnpm-lock.yaml
generated
@@ -18,8 +18,8 @@ importers:
|
||||
specifier: 5.0.0
|
||||
version: 5.0.0(vue@3.5.25(typescript@5.9.3))
|
||||
'@riwa/api-types':
|
||||
specifier: http://192.168.1.2:9538/api/capp-eden-0.0.44.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)))'
|
||||
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.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':
|
||||
specifier: workspace:*
|
||||
version: link:packages/axios
|
||||
@@ -496,9 +496,9 @@ packages:
|
||||
'@borewit/text-codec@0.1.1':
|
||||
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':
|
||||
resolution: {tarball: http://192.168.1.2:9538/api/capp-eden-0.0.44.tgz}
|
||||
version: 0.0.44
|
||||
'@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.45.tgz}
|
||||
version: 0.0.45
|
||||
peerDependencies:
|
||||
'@elysiajs/eden': ^1.4.6
|
||||
|
||||
@@ -4871,7 +4871,7 @@ snapshots:
|
||||
|
||||
'@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:
|
||||
'@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;
|
||||
}>();
|
||||
|
||||
const { data: template, execute } = safeClient(() => client.api.admin.wallet_import.template.get(), {
|
||||
immediate: false
|
||||
});
|
||||
|
||||
async function handleDownloadTemplate() {
|
||||
downloading.value = true;
|
||||
try {
|
||||
const res = await client.api.admin.wallet_import.template.get();
|
||||
// debugger;
|
||||
const result = await fetch('http://192.168.1.2:9538/api/admin/wallet_import/template', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Authorization: `Bearer ${localStg.get('token') || ''}`
|
||||
}
|
||||
});
|
||||
const blob = await result.blob();
|
||||
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('模板下载成功');
|
||||
// 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('模板下载成功');
|
||||
// }
|
||||
await execute();
|
||||
if (template.value) {
|
||||
const blob = new Blob([template.value]);
|
||||
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) {
|
||||
window.$message?.error('模板下载失败');
|
||||
} finally {
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
<script lang="ts" setup>
|
||||
import { useTemplateRef } from 'vue';
|
||||
import { NSelect, useDialog } from 'naive-ui';
|
||||
import dayjs from 'dayjs';
|
||||
import { client, safeClient } from '@/service/api';
|
||||
import type { TableBaseColumns, TableFetchData, TableFilterColumns, TableInst } from '@/components/table';
|
||||
|
||||
const tableInst = useTemplateRef<TableInst>('tableInst');
|
||||
|
||||
const props = defineProps<{
|
||||
jobId: string;
|
||||
}>();
|
||||
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 = [
|
||||
@@ -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>
|
||||
|
||||
<template>
|
||||
@@ -57,11 +77,7 @@ const filterColumns: TableFilterColumns = [];
|
||||
:columns="columns"
|
||||
:filter-columns="filterColumns"
|
||||
:scroll-x="1200"
|
||||
:header-operations="{
|
||||
add: false,
|
||||
refresh: true,
|
||||
columns: true
|
||||
}"
|
||||
:show-header-operation="false"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -25,27 +25,6 @@ const columns: TableBaseColumns = [
|
||||
key: 'createdBy',
|
||||
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',
|
||||
title: '状态'
|
||||
@@ -74,6 +53,27 @@ const columns: TableBaseColumns = [
|
||||
key: 'error',
|
||||
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',
|
||||
title: '操作',
|
||||
@@ -87,7 +87,7 @@ const columns: TableBaseColumns = [
|
||||
dialog.create({
|
||||
title: '导入明细',
|
||||
showIcon: false,
|
||||
style: { width: '800px' },
|
||||
style: { width: '1200px' },
|
||||
content: () => h(ImportJobDetails, { jobId: row.id })
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user