diff --git a/src/api/modules/newuserList.ts b/src/api/modules/newuserList.ts index 9cbbae0..ed7125b 100644 --- a/src/api/modules/newuserList.ts +++ b/src/api/modules/newuserList.ts @@ -110,4 +110,9 @@ export const querySingerSongList = data => { return http.request("post", "/adminapi/SingerSong/singerSongList", { data }); +} +export const findUserData = data => { + return http.request("post", "/adminapi/User/cancel_user_recovery", { + data + }); } \ No newline at end of file diff --git a/src/api/modules/statistics.ts b/src/api/modules/statistics.ts index 413a5f6..52a901b 100644 --- a/src/api/modules/statistics.ts +++ b/src/api/modules/statistics.ts @@ -45,4 +45,12 @@ export const queryRoomFlowRankList = params => { "/adminapi/Statistical/get_room_flow_statistics", { params } ); +}; +// 任务领取记录 +export const taskRankList = params => { + return http.request( + "get", + "/adminapi/Statistical/task_statistics", + { params } + ); }; \ No newline at end of file diff --git a/src/views/Nobility/userPowerByNobility/hook.tsx b/src/views/Nobility/userPowerByNobility/hook.tsx index 4d264fd..57b0c1e 100644 --- a/src/views/Nobility/userPowerByNobility/hook.tsx +++ b/src/views/Nobility/userPowerByNobility/hook.tsx @@ -18,7 +18,7 @@ export function useData() { }, { label: "用户Id", - prop: "user_id" + prop: "user_code" }, { label: "用户名称", diff --git a/src/views/Statistical/taskAssignment/hook.tsx b/src/views/Statistical/taskAssignment/hook.tsx new file mode 100644 index 0000000..c5e8307 --- /dev/null +++ b/src/views/Statistical/taskAssignment/hook.tsx @@ -0,0 +1,174 @@ +import { ref, h } from "vue"; +import { utils, writeFile } from "xlsx"; +import ExportForm from '@/components/exportDialog/index.vue'; +import { addDialog } from "@/components/ReDialog"; +import { message } from "@/utils/message"; +import { + taskRankList +} from "@/api/modules/statistics"; +export function useData() { + const loading = ref(true); + const tableList = ref([]); + const isShow = ref(false); + const total_price = ref(0) + const pagination = ref({ + total: 0, + pageSize: 10, + pageSizes: [10, 20, 50, 100], + currentPage: 1, + background: true + }); + const searchForm = ref({ + search_uid: "", + search_name: "", + search_task_id: '', + search_task_name: '', + begin_time: "", + end_time: "" + }); + const searchLabel = ref([ + { label: "用户ID", prop: "search_uid", type: "input" }, + { label: "用户昵称", prop: "search_name", type: "input" }, + { label: "任务ID", prop: "search_task_id", type: "input" }, + { label: "任务昵称", prop: "search_task_name", type: "input" }, + { label: "开始时间", prop: "begin_time", type: "date" }, + { label: "结束时间", prop: "end_time", type: "date" }, + ]); + const tableLabel = ref([ + { + label: "用户ID", + prop: "user_code" + }, + { + label: "用户名称", + prop: "nickname" + }, + { + label: "完成任务时间", + prop: "createtime" + }, + { + label: "任务名称", + prop: "task_name" + }, + { + label: "领取状态", + prop: "is_completed_str", + cellRenderer: ({ row }) => ( + {row.is_completed == 0 ? '未领取' : '已领取'} + ) + }, + { + label: "奖励内容", + prop: "reward_str" + }, + { + label: "奖励价值", + prop: "reward_price" + } + ]); + const onSearch = async (formData) => { + loading.value = true; + searchForm.value = { ...formData } + const { data, code } = await taskRankList({ + ...formData, + page: pagination.value.currentPage, + page_limit: pagination.value.pageSize, + + }); + if (code) { + tableList.value = data.lists.map(ele => { + return { + ...ele + } + }); + total_price.value = data.total_reward_price + pagination.value.total = data.count; + pagination.value.currentPage = data.page; + } + loading.value = false; + }; + const handleSizeChange = (val: number) => { + pagination.value.pageSize = val; + onSearch(searchForm.value); + }; + const handleCurrentChange = (val: number) => { + pagination.value.currentPage = val; + onSearch(searchForm.value); + }; + 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 taskRankList({ + ...formData, + page: 1, + page_limit: 20000 + }); + 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.begin_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({ begin_time: curData.time[0] || '', end_time: curData.time[1] || '' }) + } + } + }); + } + }); + + } + return { + searchForm, + searchLabel, + onSearch, + isShow, + tableList, + tableLabel, + pagination, + handleSizeChange, + handleCurrentChange, + loading, + total_price, + exportExcel + }; +} diff --git a/src/views/Statistical/taskAssignment/index.vue b/src/views/Statistical/taskAssignment/index.vue new file mode 100644 index 0000000..a24d7c6 --- /dev/null +++ b/src/views/Statistical/taskAssignment/index.vue @@ -0,0 +1,56 @@ + + + + \ No newline at end of file diff --git a/src/views/newuser/newuserList/hook.tsx b/src/views/newuser/newuserList/hook.tsx index 508f90b..bb74098 100644 --- a/src/views/newuser/newuserList/hook.tsx +++ b/src/views/newuser/newuserList/hook.tsx @@ -17,7 +17,8 @@ import { changePassWordByUser, setMoneyByUser, officialUserData, - banUserData + banUserData, + findUserData } from "@/api/modules/newuserList"; import { addDialog } from "@/components/ReDialog"; // import { object } from "vue-types"; @@ -35,6 +36,10 @@ export function useData() { const loading = ref(true); const tableList = ref([]); const isShow = ref(false); + const totalPrice = ref({ + total_coin: 0, + total_earnings: 0 + }) const pagination = ref({ total: 0, pageSize: 10, @@ -144,7 +149,7 @@ export function useData() { label: "登录状态", prop: "status", cellRenderer: ({ row }) => ( - {row.status_str} + {row.status_str} ) }, { @@ -171,6 +176,8 @@ export function useData() { if (code) { tableList.value = data.lists; pagination.value.total = data.count; + totalPrice.value.total_coin = data.total_coin; + totalPrice.value.total_earnings = data.total_earnings; pagination.value.currentPage = +data.page; } loading.value = false; @@ -473,6 +480,17 @@ export function useData() { // }); } + // 找回账号 + const FindData = async (rowData) => { + // console.log(rowData) + const { code } = await findUserData({ mobile: rowData.mobile }); + if (code) { + message(`操作成功`, { + type: "success" + }); + onSearch(searchForm.value); + } + } // 修改密码 const changePassword = async (rowData: any) => { addDialog({ @@ -532,6 +550,8 @@ export function useData() { onSeniorSearch, resetFieldsSearch, exportExcel, - changeSearchValue + changeSearchValue, + FindData, + totalPrice }; } \ No newline at end of file diff --git a/src/views/newuser/newuserList/index.vue b/src/views/newuser/newuserList/index.vue index fd426d1..b5d63bd 100644 --- a/src/views/newuser/newuserList/index.vue +++ b/src/views/newuser/newuserList/index.vue @@ -25,7 +25,9 @@ const { onSeniorSearch, resetFieldsSearch, exportExcel, - changeSearchValue + changeSearchValue, + FindData, + totalPrice } = useData(); defineOptions({ name: "newuserList" @@ -53,6 +55,10 @@ onMounted(() => {