chore(env): 启用开发环境API地址并清理冗余文件

- 启用 .env.development 中的 VITE_API_URL 配置
- 删除 src/views/glt/shopDealerOrder/components/Import.vue 文件
- 删除 src/views/glt/shopDealerOrder2/components/Import.vue 文件
- 删除 src/views/glt/shopDealerWithdraw/components/Import.vue 文件
- 删除 src/views/glt/shopDealerApply/index.vue 文件
- 删除 src/views/glt/shopDealerCapital/index.vue 文件
- 删除 src/views/glt/shopDealerOrder/index.vue 文件
- 从 shopDealerOrder 组件中移除导入模板说明信息
This commit is contained in:
2026-01-26 21:14:04 +08:00
parent b4c4f03dd0
commit c605d0619d
36 changed files with 373 additions and 7002 deletions

View File

@@ -1,19 +1,28 @@
<!-- 搜索表单 -->
<template>
<a-space :size="10" style="flex-wrap: wrap">
<a-button type="primary" class="ele-btn-icon" @click="add">
<template #icon>
<PlusOutlined />
</template>
<span>添加</span>
</a-button>
<a-input-search
allow-clear
placeholder="用户ID|订单编号"
style="width: 240px"
v-model:value="where.keywords"
@search="reload"
/>
<a-button type="dashed" @click="handleExport">导出xls</a-button>
</a-space>
</template>
<script lang="ts" setup>
import { PlusOutlined } from '@ant-design/icons-vue';
import type { GradeParam } from '@/api/user/grade/model';
import { watch } from 'vue';
import { ref, watch } from 'vue';
import { utils, writeFile } from 'xlsx';
import { message } from 'ant-design-vue';
import { pageShopDealerCapital } from '@/api/shop/shopDealerCapital';
import {
ShopDealerCapital,
ShopDealerCapitalParam
} from '@/api/shop/shopDealerCapital/model';
import { getTenantId } from '@/utils/domain';
import useSearch from '@/utils/use-search';
const props = withDefaults(
defineProps<{
@@ -24,15 +33,81 @@
);
const emit = defineEmits<{
(e: 'search', where?: GradeParam): void;
(e: 'search', where?: ShopDealerCapitalParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
// 新增
const add = () => {
emit('add');
const reload = () => {
emit('search', where);
};
// 表单数据
const { where } = useSearch<ShopDealerCapitalParam>({
keywords: '',
userId: undefined,
toUserId: undefined,
limit: 5000
});
const list = ref<ShopDealerCapital[]>([]);
// 导出
const handleExport = async () => {
const array: (string | number)[][] = [
[
'用户ID',
'流动类型',
'金额',
'订单编号',
'对方用户ID',
`创建时间`,
'租户ID'
]
];
// 按搜索结果导出
await pageShopDealerCapital(where)
.then((data) => {
list.value = data?.list || [];
list.value?.forEach((d: ShopDealerCapital) => {
array.push([
`${d.userId}`,
`${d.flowType == 10 ? '佣金收入' : ''}`,
`${d.money}`,
`${d.orderNo}`,
`${d.toUserId}`,
`${d.createTime}`,
`${d.tenantId}`
]);
});
const sheetName = `bak_shop_dealer_capital_${getTenantId()}`;
const workbook = {
SheetNames: [sheetName],
Sheets: {}
};
const sheet = utils.aoa_to_sheet(array);
workbook.Sheets[sheetName] = sheet;
// 设置列宽
sheet['!cols'] = [
{ wch: 10 },
{ wch: 20 },
{ wch: 20 },
{ wch: 15 },
{ wch: 10 },
{ wch: 10 },
{ wch: 20 }
];
message.loading('正在导出...');
setTimeout(() => {
writeFile(workbook, `${sheetName}.xlsx`);
}, 1000);
})
.catch((msg) => {
message.error(msg);
})
.finally(() => {});
};
watch(

View File

@@ -57,7 +57,6 @@
import { message, Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import type { EleProTable } from 'ele-admin-pro';
import { toDateString } from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
@@ -123,7 +122,6 @@
dataIndex: 'userId',
key: 'userId',
align: 'center',
width: 100,
fixed: 'left'
},
{
@@ -131,13 +129,13 @@
dataIndex: 'flowType',
key: 'flowType',
align: 'center',
width: 120,
customRender: ({ text }) => {
const typeMap = {
10: { text: '佣金收入', color: 'success' },
20: { text: '提现支出', color: 'warning' },
30: { text: '转账支出', color: 'error' },
40: { text: '转账收入', color: 'processing' }
40: { text: '转账收入', color: 'processing' },
50: { text: '新人注册奖', color: 'processing' }
};
const type = typeMap[text] || { text: '未知', color: 'default' };
return {
@@ -152,19 +150,20 @@
dataIndex: 'money',
key: 'money',
align: 'center',
width: 120,
customRender: ({ text, record }) => {
const amount = parseFloat(text || '0').toFixed(2);
const isIncome = record.flowType === 10 || record.flowType === 40;
const isIncome =
record.flowType === 10 ||
record.flowType === 40 ||
record.flowType === 50;
return {
type: 'span',
props: {
style: {
color: isIncome ? '#52c41a' : '#ff4d4f',
fontWeight: 'bold'
color: isIncome ? '#424242' : '#ff4d4f'
}
},
children: `${isIncome ? '+' : '-'}¥${amount}`
children: `${isIncome ? '' : '-'} ${amount}`
};
}
},
@@ -180,7 +179,6 @@
dataIndex: 'toUserId',
key: 'toUserId',
align: 'center',
width: 100,
customRender: ({ text }) => (text ? `ID: ${text}` : '-')
},
{
@@ -188,7 +186,6 @@
dataIndex: 'describe',
key: 'describe',
align: 'left',
width: 200,
ellipsis: true,
customRender: ({ text }) => text || '-'
},
@@ -197,24 +194,16 @@
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd')
},
{
title: '修改时间',
dataIndex: 'updateTime',
key: 'updateTime',
align: 'center'
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
sorter: true
}
// {
// title: '操作',
// key: 'action',
// width: 180,
// fixed: 'right',
// align: 'center',
// hideInSetting: true
// }
]);
/* 搜索 */