From 39d03b9e9fdae9a2a923f8fd7e88a5c48ce6499b Mon Sep 17 00:00:00 2001 From: yziiy <15979918+mayday-yziiy@user.noreply.gitee.com> Date: Fri, 19 Dec 2025 17:09:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/http/config.ts | 4 +- src/views/newuser/backpackList/hook.tsx | 4 +- src/views/newuser/newuserList/hook.tsx | 116 ++++++++++++------------ vite.config.ts | 4 +- 4 files changed, 64 insertions(+), 64 deletions(-) diff --git a/src/utils/http/config.ts b/src/utils/http/config.ts index 6e71674..5ce2bae 100644 --- a/src/utils/http/config.ts +++ b/src/utils/http/config.ts @@ -1,5 +1,5 @@ -// export const URL = "https://yushengapi.qxyushen.top"; -export const URL = "https://test.vespa.qxyushen.top"; +export const URL = "https://yushengapi.qxyushen.top"; +// export const URL = "https://test.vespa.qxyushen.top"; // https://vespa.qxyushen.top 正式 // http://1.13.101.98 // https://test.vespa.qxyushen.top diff --git a/src/views/newuser/backpackList/hook.tsx b/src/views/newuser/backpackList/hook.tsx index d42f0cb..ee0647c 100644 --- a/src/views/newuser/backpackList/hook.tsx +++ b/src/views/newuser/backpackList/hook.tsx @@ -61,11 +61,11 @@ export function useData() { }, { label: "累计获取数量", - prop: "is_tester" + prop: "total_num" }, { label: "用户礼物数量", - prop: "is_use_give" + prop: "num" }, { label: "获取时间", diff --git a/src/views/newuser/newuserList/hook.tsx b/src/views/newuser/newuserList/hook.tsx index bb74098..13228da 100644 --- a/src/views/newuser/newuserList/hook.tsx +++ b/src/views/newuser/newuserList/hook.tsx @@ -420,64 +420,64 @@ export function useData() { const exportFormRef = ref(null) const exportExcel = () => { let exportTableList = [] - // addDialog({ - // title: `导出数据`, - // props: { - // formInline: { - // time: '' - // } - // }, - // width: "40%", - // closeOnClickModal: false, - // contentRenderer: () => h(ExportForm, { ref: exportFormRef, formInline: null }), - // beforeSure: (done, { options }) => { - // const FormRef = exportFormRef.value.getRef(); - // const curData = options.props.formInline; - // const exportData = async (formData) => { - // const { data, code } = await queryList({ - // ...searchForm.value, - // coin1: searchForm.value.coin1 ? searchForm.value.coin1 : '', - // coin2: searchForm.value.coin2 ? searchForm.value.coin2 : '', - // page: pagination.value.currentPage, - // page_limit: pagination.value.pageSize - // }); - // if (code) { - // exportTableList = data.lists; - // const res = exportTableList.map(item => { - // const arr = []; - // tableLabel.value.forEach(column => { - // arr.push(item[column.prop as string]); - // }); - // return arr; - // }); - // const titleList = []; - // tableLabel.value.forEach(column => { - // titleList.push(column.label); - // }); - // res.unshift(titleList); - // const workSheet = utils.aoa_to_sheet(res); - // const workBook = utils.book_new(); - // utils.book_append_sheet(workBook, workSheet, "数据报表"); - // writeFile(workBook, `礼物记录列表统计${formData.start_time} - ${formData.end_time}.xlsx`); - // message("导出成功", { - // type: "success" - // }); - // done() - // } else { - // message("获取数据失败,请重试!", { - // type: "error" - // }); - // } - // } - // FormRef.validate(valid => { - // if (valid) { - // if (curData.time && curData.time.length) { - // exportData({ start_time: curData.time[0] || '', end_time: curData.time[1] || '' }) - // } - // } - // }); - // } - // }); + addDialog({ + title: `导出数据`, + props: { + formInline: { + time: '' + } + }, + width: "40%", + closeOnClickModal: false, + contentRenderer: () => h(ExportForm, { ref: exportFormRef, formInline: null }), + beforeSure: (done, { options }) => { + const FormRef = exportFormRef.value.getRef(); + const curData = options.props.formInline; + const exportData = async (formData) => { + const { data, code } = await queryList({ + ...searchForm.value, + coin1: searchForm.value.coin1 ? searchForm.value.coin1 : '', + coin2: searchForm.value.coin2 ? searchForm.value.coin2 : '', + page: 1, + page_limit: 10000 + }); + if (code) { + exportTableList = data.lists; + const res = exportTableList.map(item => { + const arr = []; + tableLabel.value.forEach(column => { + arr.push(item[column.prop as string]); + }); + return arr; + }); + const titleList = []; + tableLabel.value.forEach(column => { + titleList.push(column.label); + }); + res.unshift(titleList); + const workSheet = utils.aoa_to_sheet(res); + const workBook = utils.book_new(); + utils.book_append_sheet(workBook, workSheet, "数据报表"); + writeFile(workBook, `想会员列表统计${formData.start_time} - ${formData.end_time}.xlsx`); + message("导出成功", { + type: "success" + }); + done() + } else { + message("获取数据失败,请重试!", { + type: "error" + }); + } + } + FormRef.validate(valid => { + if (valid) { + if (curData.time && curData.time.length) { + exportData({ start_time: curData.time[0] || '', end_time: curData.time[1] || '' }) + } + } + }); + } + }); } // 找回账号 diff --git a/vite.config.ts b/vite.config.ts index e52c18a..be1425d 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -37,8 +37,8 @@ export default ({ mode }: ConfigEnv): UserConfigExport => { proxyReq.method = 'OPTIONS'; // https://test.vespa.qxyushen.top // 'http://yushenggliht.qxyushen.top' - // res.setHeader('Access-Control-Allow-Origin', 'http://yushenggliht.qxyushen.top'); - res.setHeader('Access-Control-Allow-Origin', 'https://test.vespa.qxyushen.top'); + res.setHeader('Access-Control-Allow-Origin', 'http://yushenggliht.qxyushen.top'); + // res.setHeader('Access-Control-Allow-Origin', 'https://test.vespa.qxyushen.top'); res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS'); res.setHeader('Access-Control-Allow-Headers', 'Content-Type, Authorization'); res.end();