将代码更新到羽声代码库

This commit is contained in:
yziiy
2025-10-23 11:06:41 +08:00
parent b30b13af4e
commit 95d858f71f
551 changed files with 6693 additions and 274 deletions

View File

@@ -1,5 +1,8 @@
import { h, ref, nextTick } from "vue";
import editForm from "./form.vue";
import { ElMessageBox } from "element-plus";
import ExportForm from '@/components/exportDialog/index.vue';
import { utils, writeFile } from "xlsx";
import detailView from './detail.vue';
import banUserView from './banUser.vue';
import changePassView from './password.vue';
@@ -34,6 +37,7 @@ export function useData() {
const pagination = ref({
total: 0,
pageSize: 10,
pageSizes: [10, 20, 50, 100],
currentPage: 1,
background: true
});
@@ -150,10 +154,14 @@ export function useData() {
const onSearch = async (formData) => {
loading.value = true;
searchForm.value = { ...formData }
// console.log(searchForm.value, formData, 111)
if (!formData) {
resetFieldsSearch()
}
const { data, code } = await queryList({
...formData,
coin1: formData.coin1 ? formData.coin1 : '',
coin2: formData.coin2 ? formData.coin2 : '',
// coin1: searchForm.value.coin1 ? searchForm.value.coin1 : '',
// coin2: searchForm.value.coin2 ? searchForm.value.coin2 : '',
page: pagination.value.currentPage,
page_limit: pagination.value.pageSize
});
@@ -393,7 +401,69 @@ 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] || '' })
// }
// }
// });
// }
// });
}
// 修改密码
const changePassword = async (rowData: any) => {
addDialog({
@@ -431,6 +501,7 @@ export function useData() {
}
});
};
return {
searchForm,
searchLabel,
@@ -450,6 +521,7 @@ export function useData() {
changePassword,
setUserFund,
onSeniorSearch,
resetFieldsSearch
resetFieldsSearch,
exportExcel
};
}