Compare commits
41 Commits
667eae1d30
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2e6490800 | ||
|
|
a6b943d619 | ||
|
|
0e60b07b76 | ||
|
|
6f9b034ae4 | ||
|
|
12fd1dd5a7 | ||
|
|
741da92c20 | ||
|
|
939c749854 | ||
|
|
ca5f75a3e8 | ||
|
|
11acfb33d0 | ||
|
|
b6fdbb7893 | ||
|
|
fdad0344ad | ||
|
|
05e60b5877 | ||
|
|
d7eacafa34 | ||
|
|
ab336bdfc9 | ||
|
|
3e3beca568 | ||
|
|
34b750690f | ||
|
|
30ef4a186a | ||
|
|
b368fda1a7 | ||
|
|
062582cf14 | ||
|
|
18838360c2 | ||
|
|
ec9bd399da | ||
|
|
883fde1fc6 | ||
|
|
77877138a3 | ||
|
|
0bc50a93de | ||
|
|
160eaf8404 | ||
|
|
33bacae962 | ||
|
|
6131759745 | ||
|
|
7acce52a6b | ||
|
|
7b8a2f5161 | ||
|
|
1f463aa651 | ||
|
|
419d6da9a6 | ||
|
|
d8785b0da1 | ||
|
|
434d0a9ec8 | ||
|
|
aba429e311 | ||
|
|
fba111a140 | ||
|
|
c8a023ef31 | ||
|
|
a479867023 | ||
|
|
98616cbe0f | ||
|
|
abc2a7b2fb | ||
|
|
950e6d09ec | ||
|
|
b340fa58c7 |
@@ -4,7 +4,7 @@
|
||||
<ReDialog />
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<!-- 测试 -->
|
||||
<script lang="ts">
|
||||
import { defineComponent } from "vue";
|
||||
import { ElConfigProvider } from "element-plus";
|
||||
|
||||
@@ -46,4 +46,9 @@ export const getLogInfo = params => {
|
||||
"/adminapi/Adminlog/detail",
|
||||
{ params }
|
||||
);
|
||||
};
|
||||
};
|
||||
export const apiPassWord = data => {
|
||||
return http.request<Result>("post", "/adminapi/User/changePwd", {
|
||||
data
|
||||
});
|
||||
}
|
||||
61
src/api/modules/expression.ts
Normal file
61
src/api/modules/expression.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
import { http } from "@/utils/http";
|
||||
|
||||
type Result = {
|
||||
code: string;
|
||||
data: any;
|
||||
};
|
||||
|
||||
export const queryClassifyList = params => {
|
||||
return http.request<Result>(
|
||||
"get",
|
||||
"/adminapi/RoomEmoji/emoji_type_list",
|
||||
{ params }
|
||||
);
|
||||
};
|
||||
|
||||
// 分类新增
|
||||
export const addClassifyData = data => {
|
||||
return http.request<Result>("post", "/adminapi/RoomEmoji/add_emoji_type", {
|
||||
data
|
||||
});
|
||||
}
|
||||
// 修改分类
|
||||
export const editClassifyData = data => {
|
||||
return http.request<Result>("post", "/adminapi/RoomEmoji/edit_emoji_type", {
|
||||
data
|
||||
});
|
||||
}
|
||||
// 删除分类
|
||||
export const removeClassifyData = data => {
|
||||
return http.request<Result>("post", "/adminapi/RoomEmoji/del_emoji_type", {
|
||||
data
|
||||
});
|
||||
};
|
||||
// 列表
|
||||
export const queryList = params => {
|
||||
return http.request<Result>(
|
||||
"get",
|
||||
"/adminapi/RoomEmoji/emoji_list",
|
||||
{ params }
|
||||
);
|
||||
};
|
||||
|
||||
// 新增
|
||||
export const addData = data => {
|
||||
return http.request<Result>("post", "/adminapi/RoomEmoji/add_emoji", {
|
||||
data
|
||||
});
|
||||
}
|
||||
// 编辑
|
||||
export const editData = data => {
|
||||
return http.request<Result>("post", "/adminapi/RoomEmoji/edit_emoji", {
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 删除
|
||||
export const removeData = data => {
|
||||
return http.request<Result>("post", "/adminapi/RoomEmoji/del_emoji", {
|
||||
data
|
||||
});
|
||||
};
|
||||
40
src/api/modules/hourlyChart.ts
Normal file
40
src/api/modules/hourlyChart.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import { http } from "@/utils/http";
|
||||
|
||||
|
||||
type Result = {
|
||||
code: string;
|
||||
data: any;
|
||||
};
|
||||
|
||||
export const queryList = params => {
|
||||
return http.request<Result>(
|
||||
"get",
|
||||
"/adminapi/RoomHourRanking/room_hour_ranking",
|
||||
{ params }
|
||||
);
|
||||
};
|
||||
export const queryTimeList = () => {
|
||||
return http.request<Result>(
|
||||
"get",
|
||||
"/adminapi/RoomHourRanking/time_period_correspondence"
|
||||
);
|
||||
};
|
||||
export const getRuleSetting = () => {
|
||||
return http.request<Result>(
|
||||
"get",
|
||||
"/adminapi/RoomHourRanking/room_hour_ranking_config"
|
||||
);
|
||||
};
|
||||
export const settingRuleApi = (data) => {
|
||||
return http.request<Result>(
|
||||
"post",
|
||||
"/adminapi/RoomHourRanking/room_hour_ranking_config_edit",
|
||||
{ data }
|
||||
);
|
||||
}
|
||||
export const settingRuleTable = () => {
|
||||
return http.request<Result>(
|
||||
"get",
|
||||
"/adminapi/RoomHourRanking/core_config_list"
|
||||
);
|
||||
}
|
||||
@@ -33,10 +33,10 @@ export const getInfo = params => {
|
||||
{ params }
|
||||
);
|
||||
};
|
||||
export const getUserList = () => {
|
||||
export const getUserList = params => {
|
||||
return http.request<Result>(
|
||||
"get",
|
||||
"/adminapi/User/get_user_list"
|
||||
"/adminapi/User/get_user_list", { params }
|
||||
);
|
||||
};
|
||||
export const getRoomList = () => {
|
||||
|
||||
@@ -280,3 +280,18 @@ export const queryLockRecord = params => {
|
||||
{ params }
|
||||
);
|
||||
};
|
||||
// 获取房间红包列表
|
||||
export const queryRedEnvelopeList = params => {
|
||||
return http.request<Result>(
|
||||
"get",
|
||||
"/adminapi/Room/room_redpacket_list",
|
||||
{ params }
|
||||
);
|
||||
};
|
||||
export const getRedEnvelopeDetail = params => {
|
||||
return http.request<Result>(
|
||||
"get",
|
||||
"/adminapi/Room/room_redpacket_detail",
|
||||
{ params }
|
||||
);
|
||||
};
|
||||
@@ -3,6 +3,7 @@ import { http } from "@/utils/http";
|
||||
type Result = {
|
||||
code: string;
|
||||
data: any;
|
||||
msg: string;
|
||||
};
|
||||
// 工会列表
|
||||
export const queryUnionList = params => {
|
||||
@@ -105,4 +106,10 @@ export const grantSubsidyBybatch = data => {
|
||||
return http.request<Result>("post", "/adminapi/Guild/subsidy_give_batch", {
|
||||
data
|
||||
});
|
||||
};
|
||||
// 隐藏或者展示工会
|
||||
export const changeStatus = data => {
|
||||
return http.request<Result>("post", "/adminapi/Guild/guild_show_status_edit", {
|
||||
data
|
||||
});
|
||||
};
|
||||
@@ -4,7 +4,7 @@
|
||||
class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||
<el-form-item v-for="(item, index) in LabelList" :key="index" :label="item.label" :prop="item.prop">
|
||||
<el-input v-if="item.type === 'input'" v-model="form[item.prop]" :placeholder="`请输入${item.label}`" clearable
|
||||
class="!w-[180px]" />
|
||||
class="!w-[180px]" @change="changeValue" />
|
||||
<!-- 选择器 -->
|
||||
<el-select class="!w-[180px]" :placeholder="`请选择${item.label}`" v-if="item.type === 'select'" clearable
|
||||
v-model="form[item.prop]">
|
||||
@@ -12,11 +12,11 @@
|
||||
</el-select>
|
||||
<!-- 时间 -->
|
||||
<el-date-picker v-if="item.type === 'date'" clearable v-model="form[item.prop]" :disabled-date="disabledDate"
|
||||
type="date" class="!w-[160px]" :placeholder="`请选择${item.label}`" format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD" />
|
||||
type="datetime" class="!w-[160px]" :placeholder="`请选择${item.label}`" format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY-MM-DD HH:mm:ss" />
|
||||
<!-- 时间范围 daterange-->
|
||||
<el-date-picker :disabled-date="disabledDate" v-if="item.type === 'daterange'" format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD" v-model="form[item.prop]" type="daterange" range-separator="至"
|
||||
value-format="YYYY-MM-DD" v-model="form[item.prop]" type="datetime" range-separator="至"
|
||||
start-placeholder="开始日期" end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
@@ -34,7 +34,7 @@ import { ref } from 'vue';
|
||||
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
||||
import Refresh from "@iconify-icons/ep/refresh";
|
||||
const props = defineProps(['LabelList', 'formData', 'isSenior'])
|
||||
const emit = defineEmits(["handleSearch", "openSearch", 'resetFields']);
|
||||
const emit = defineEmits(["handleSearch", "openSearch", 'resetFields', 'changeValue']);
|
||||
const formRef = ref(null)
|
||||
const loading = ref(false)
|
||||
const form = ref({ ...props.formData })
|
||||
@@ -48,6 +48,9 @@ const onSearch = () => {
|
||||
const openSeniorSearch = () => {
|
||||
emit('openSearch')
|
||||
}
|
||||
const changeValue = () => {
|
||||
emit('changeValue', form.value)
|
||||
}
|
||||
const resetForm = () => {
|
||||
formRef.value.resetFields()
|
||||
emit('resetFields')
|
||||
|
||||
@@ -76,10 +76,15 @@ const handleFileSuccess = ({ data, code }, file, fileList) => {
|
||||
<template>
|
||||
<!-- {{ acceptType http://md.xscmmidi.site }} -->
|
||||
<el-upload v-model:file-list="fileList" drag multiple class="pure-upload" list-type="picture-card"
|
||||
:accept="acceptType ? acceptType : 'image/jpeg,image/png,image/gif'"
|
||||
:action="`${URL}/adminapi/UploadFile/file_upload`" :limit="limit" name="files"
|
||||
:headers="{ Authorization: getToken().accessToken }" :on-exceed="onExceed" :before-upload="onBefore"
|
||||
:on-success="handleFileSuccess">
|
||||
:accept="acceptType ? acceptType : 'image/jpeg,image/png,image/gif'" :action="`${URL}/adminapi/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/file_upload`" :limit="limit" name="files" :headers="{ Authorization: getToken().accessToken }"
|
||||
:on-exceed="onExceed" :before-upload="onBefore" :on-success="handleFileSuccess">
|
||||
<IconifyIconOffline :icon="Add" class="m-auto mt-4" width="30" />
|
||||
<template #file="{ file }">
|
||||
<div v-if="file.status == 'ready' || file.status == 'uploading'" class="mt-[35%] m-auto">
|
||||
|
||||
@@ -24,9 +24,10 @@ defineExpose({ getRef });
|
||||
|
||||
<template>
|
||||
<el-form ref="ruleFormRef" :model="newFormInline" :rules="formRules" label-width="120px">
|
||||
<el-form-item label="选择时间" prop="time">
|
||||
<el-date-picker v-model="newFormInline.time" format="YYYY-MM-DD" :disabled-date="disabledDate"
|
||||
value-format="YYYY-MM-DD" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
|
||||
<el-form-item label="选择导出时间" prop="time">
|
||||
<el-date-picker v-model="newFormInline.time" format="YYYY-MM-DD HH:mm:ss" :disabled-date="disabledDate"
|
||||
value-format="YYYY-MM-DD HH:mm:ss" type="datetimerange" range-separator="至" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export const URL = "https://md.xscmmidi.site";
|
||||
// http://md.xscmmidi.site 正式
|
||||
// http://tmd.xscmmidi.site 测试
|
||||
// https://md.xscmmidi.site 正式
|
||||
// https://tmd.xscmmidi.site 测试
|
||||
// 声网appId 在这里换
|
||||
export const appIdBySw = 'a3f0f0c78307434fa1c697c3429fbdcf'
|
||||
export const appIdBySw = 'a3f0f0c78307434fa1c697c3429fbdcf';
|
||||
@@ -18,6 +18,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -18,6 +18,7 @@ export function useData() {
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
currentPage: 1,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
background: true
|
||||
});
|
||||
const tableLabel = ref([
|
||||
@@ -101,7 +102,7 @@ export function useData() {
|
||||
type: rowData?.type ?? "",
|
||||
num: rowData?.num ?? "",
|
||||
gift_id: rowData?.gift_id ?? "",
|
||||
gift_bag_id: rowData?.gift_bag_id ?? "",
|
||||
gift_bag_id: propRowData.value.id ?? "",
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
@@ -26,6 +26,7 @@ onMounted(() => {
|
||||
|
||||
|
||||
<template>
|
||||
<!-- 首充好礼的礼物列表 -->
|
||||
<div class="main">
|
||||
<div ref="contentRef" :class="['flex', deviceDetection() ? 'flex-wrap' : '']">
|
||||
<PureTableBar title="" :class="[isShow && !deviceDetection() ? '!w-[60vw]' : 'w-full']" :columns="tableLabel"
|
||||
|
||||
@@ -57,5 +57,9 @@ defineExpose({ getRef });
|
||||
<el-form-item label="所得金币文字" prop="diamond">
|
||||
<el-input v-model="newFormInline.diamond" clearable placeholder="请输入所得金币文字" />
|
||||
</el-form-item>
|
||||
<el-form-item label="活动结束时间" prop="activity_end_time">
|
||||
<el-date-picker style="width: 100%;" clearable v-model="newFormInline.activity_end_time" type="datetime"
|
||||
:placeholder="`请选择活动结束时间`" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
74
src/views/Activities/goodGift/giftPack/form.vue
Normal file
74
src/views/Activities/goodGift/giftPack/form.vue
Normal file
@@ -0,0 +1,74 @@
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
ref,
|
||||
onMounted
|
||||
} from "vue";
|
||||
import { queryGiftList, queryAdornmentList } from '@/api/modules/activities'
|
||||
const ruleFormRef = ref();
|
||||
const formRules = ref({
|
||||
num: [{ required: true, message: "数量为必填项", trigger: "blur" }],
|
||||
type: [{ required: true, message: "请选择类型", trigger: "change" }],
|
||||
gift_id: [{ required: true, message: "请选择", trigger: "change" }],
|
||||
});
|
||||
const props = defineProps(["formInline"]);
|
||||
const typeList = ref([]);
|
||||
const adornmentList = ref([]);
|
||||
const newFormInline = ref(
|
||||
props.formInline
|
||||
? props.formInline
|
||||
: {
|
||||
type: "",
|
||||
num: "",
|
||||
gift_id: "",
|
||||
gift_bag_id: "",
|
||||
}
|
||||
);
|
||||
function getRef() {
|
||||
return ruleFormRef.value;
|
||||
}
|
||||
const getList = async () => {
|
||||
const { data, code } = await queryGiftList({ type: 3 })
|
||||
typeList.value = code ? data : []
|
||||
}
|
||||
const getAdornmentList = async () => {
|
||||
const { data, code } = await queryAdornmentList()
|
||||
adornmentList.value = code ? data : []
|
||||
}
|
||||
const changeType = () => {
|
||||
newFormInline.value.gift_id = ''
|
||||
}
|
||||
onMounted(() => {
|
||||
getList()
|
||||
getAdornmentList()
|
||||
})
|
||||
defineExpose({ getRef });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-form ref="ruleFormRef" :model="newFormInline" :rules="formRules" label-width="120px">
|
||||
<el-form-item label="类型" prop="type">
|
||||
<el-radio-group v-model="newFormInline.type" @change="changeType">
|
||||
<el-radio label="金币" :value="1" />
|
||||
<el-radio label="礼物" :value="2" />
|
||||
<el-radio label="装扮" :value="3" />
|
||||
<el-radio label="钻石" :value="4" />
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="[1, 2, 4].includes(newFormInline.type)"
|
||||
:label="newFormInline.type === 1 ? '金币数量' : newFormInline.type === 2 ? '礼物数量' : newFormInline.type === 3 ? '装扮天数' : '钻石数量'"
|
||||
prop="num">
|
||||
<el-input-number v-model="newFormInline.num" :min="1" :max="10000" label="请输入"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="[2, 3].includes(newFormInline.type)" :label="`选择${newFormInline.type === 2 ? '礼物' : '装扮'}`"
|
||||
prop="gift_id">
|
||||
<el-select v-if="newFormInline.type === 2" v-model="newFormInline.gift_id" placeholder="请选择礼物">
|
||||
<el-option v-for="item in typeList" :key="item.gid" :label="item.gift_name" :value="item.gid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select v-else v-model="newFormInline.gift_id" placeholder="请选择装扮">
|
||||
<el-option v-for="item in adornmentList" :key="item.id" :label="item.name" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
175
src/views/Activities/goodGift/giftPack/hook.tsx
Normal file
175
src/views/Activities/goodGift/giftPack/hook.tsx
Normal file
@@ -0,0 +1,175 @@
|
||||
import { ref, h, nextTick } from "vue";
|
||||
import editForm from "./form.vue";
|
||||
import { message } from "@/utils/message";
|
||||
import {
|
||||
queryGiftPack,
|
||||
addGiftPackData,
|
||||
editGiftPackData,
|
||||
deteleGiftPackData
|
||||
} from "@/api/modules/activities";
|
||||
import { addDialog } from "@/components/ReDialog";
|
||||
export function useData() {
|
||||
const formRef = ref();
|
||||
const propRowData = ref(null)
|
||||
const loading = ref(true);
|
||||
const tableList = ref([]);
|
||||
const isShow = ref(false);
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
currentPage: 1,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
background: true
|
||||
});
|
||||
const tableLabel = ref([
|
||||
{
|
||||
label: "ID",
|
||||
prop: "id"
|
||||
},
|
||||
{
|
||||
label: "礼物名称",
|
||||
prop: "name"
|
||||
},
|
||||
{
|
||||
label: "封面图",
|
||||
prop: "icon",
|
||||
cellRenderer: ({ row }) => (
|
||||
<el-image
|
||||
fit="cover"
|
||||
preview-teleported={true}
|
||||
src={row.icon}
|
||||
preview-src-list={Array.of(row.icon)}
|
||||
class="w-[50px] h-[50px] align-middle"
|
||||
/>
|
||||
)
|
||||
},
|
||||
{
|
||||
label: "数量",
|
||||
prop: "num"
|
||||
},
|
||||
{
|
||||
label: "价格",
|
||||
prop: "gold"
|
||||
},
|
||||
{
|
||||
label: "类型",
|
||||
prop: "type_str"
|
||||
},
|
||||
{
|
||||
label: "添加时间",
|
||||
prop: "createtime"
|
||||
},
|
||||
{
|
||||
label: "操作",
|
||||
fixed: "right",
|
||||
width: 210,
|
||||
slot: "operation"
|
||||
}
|
||||
]);
|
||||
const onSearch = async (rowData) => {
|
||||
propRowData.value = { ...rowData }
|
||||
loading.value = true;
|
||||
const { data, code } = await queryGiftPack({
|
||||
gift_bag_id: propRowData.value.id,
|
||||
page: pagination.value.currentPage,
|
||||
page_limit: pagination.value.pageSize
|
||||
});
|
||||
if (code) {
|
||||
tableList.value = data.lists.map(ele => {
|
||||
return {
|
||||
...ele
|
||||
}
|
||||
});
|
||||
pagination.value.total = data.count;
|
||||
pagination.value.currentPage = data.page;
|
||||
}
|
||||
loading.value = false;
|
||||
};
|
||||
const handleSizeChange = (val: number) => {
|
||||
pagination.value.pageSize = val;
|
||||
onSearch(propRowData.value);
|
||||
};
|
||||
const handleCurrentChange = (val: number) => {
|
||||
pagination.value.currentPage = val;
|
||||
onSearch(propRowData.value);
|
||||
};
|
||||
// 新增
|
||||
const openDialog = (title = "新增", rowData: any) => {
|
||||
addDialog({
|
||||
title: `${title}礼物`,
|
||||
props: {
|
||||
formInline: {
|
||||
type: rowData?.type ?? "",
|
||||
num: rowData?.num ?? "",
|
||||
gift_id: rowData?.gift_id ?? "",
|
||||
gift_bag_id: propRowData.value.id,
|
||||
|
||||
}
|
||||
},
|
||||
width: "40%",
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(editForm, { ref: formRef, formInline: null }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const FormRef = formRef.value.getRef();
|
||||
const curData = options.props.formInline;
|
||||
const saveData = async form => {
|
||||
const { code } = await addGiftPackData(form);
|
||||
if (code) {
|
||||
message("新增成功", { type: "success" });
|
||||
onSearch(propRowData.value);
|
||||
done();
|
||||
} else {
|
||||
message("新增失败", { type: "error" });
|
||||
}
|
||||
};
|
||||
const updateData = async form => {
|
||||
const { code } = await editGiftPackData({
|
||||
...form,
|
||||
id: rowData.id
|
||||
});
|
||||
if (code) {
|
||||
message("修改成功", { type: "success" });
|
||||
onSearch(propRowData.value);
|
||||
done();
|
||||
} else {
|
||||
message("修改失败", { type: "error" });
|
||||
}
|
||||
};
|
||||
FormRef.validate(valid => {
|
||||
if (valid) {
|
||||
console.log("curData", curData);
|
||||
// 表单规则校验通过
|
||||
if (title === "新增") {
|
||||
// 实际开发先调用新增接口,再进行下面操作
|
||||
saveData(curData);
|
||||
} else {
|
||||
// 实际开发先调用修改接口,再进行下面操作
|
||||
updateData(curData);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
const handleDelete = async rowData => {
|
||||
const { code } = await deteleGiftPackData({ id: rowData.id });
|
||||
if (code) {
|
||||
message(`您删除了名称为${rowData.name}的这条数据`, {
|
||||
type: "success"
|
||||
});
|
||||
onSearch(propRowData.value);
|
||||
}
|
||||
};
|
||||
return {
|
||||
onSearch,
|
||||
isShow,
|
||||
tableList,
|
||||
tableLabel,
|
||||
pagination,
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
handleDelete,
|
||||
loading,
|
||||
openDialog
|
||||
};
|
||||
}
|
||||
64
src/views/Activities/goodGift/giftPack/index.vue
Normal file
64
src/views/Activities/goodGift/giftPack/index.vue
Normal file
@@ -0,0 +1,64 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted } from "vue";
|
||||
import { useData } from "./hook";
|
||||
import { PureTableBar } from "@/components/RePureTableBar";
|
||||
import { deviceDetection } from "@pureadmin/utils";
|
||||
const props = defineProps(["rowData"]);
|
||||
const {
|
||||
onSearch,
|
||||
isShow,
|
||||
tableList,
|
||||
pagination,
|
||||
tableLabel,
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
openDialog,
|
||||
handleDelete,
|
||||
loading,
|
||||
} = useData();
|
||||
defineOptions({
|
||||
name: "RechargeList"
|
||||
});
|
||||
onMounted(() => {
|
||||
onSearch(props.rowData);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<template>
|
||||
<!-- 天降好礼的礼物列表 -->
|
||||
<div class="main">
|
||||
<div ref="contentRef" :class="['flex', deviceDetection() ? 'flex-wrap' : '']">
|
||||
<PureTableBar title="" :class="[isShow && !deviceDetection() ? '!w-[60vw]' : 'w-full']" :columns="tableLabel"
|
||||
@refresh="onSearch">
|
||||
<template #buttons>
|
||||
<el-button type="primary" @click="openDialog('新增', {})">
|
||||
添加礼物
|
||||
</el-button>
|
||||
</template>
|
||||
<template v-slot="{ size, dynamicColumns }">
|
||||
<pure-table ref="tableRef" align-whole="center" showOverflowTooltip table-layout="auto" default-expand-all
|
||||
:loading="loading" :size="size" row-key="id" adaptive :adaptiveConfig="{ offsetBottom: 108 }"
|
||||
:data="tableList" :columns="dynamicColumns" :pagination="{ ...pagination, size }" :header-cell-style="{
|
||||
background: 'var(--el-fill-color-light)',
|
||||
color: 'var(--el-text-color-primary)'
|
||||
}" @page-current-change="handleCurrentChange" @page-size-change="handleSizeChange">
|
||||
<template #operation="{ row }">
|
||||
|
||||
<el-button link type="primary" :size="size" @click="openDialog('编辑', row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-popconfirm :title="`是否确认删除这条数据`" @confirm="handleDelete(row)">
|
||||
<template #reference>
|
||||
<el-button link type="primary" :size="size"> 删除 </el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
|
||||
</pure-table>
|
||||
</template>
|
||||
</PureTableBar>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped lang="scss"></style>
|
||||
@@ -2,6 +2,7 @@ import { ref, h, nextTick } from "vue";
|
||||
import editForm from "./form.vue";
|
||||
import { message } from "@/utils/message";
|
||||
import recordList from "./record.vue"
|
||||
import giftPackView from './giftPack/index.vue';
|
||||
import {
|
||||
getGoodGiftInfo,
|
||||
setGoodGiftConfig
|
||||
@@ -16,6 +17,7 @@ export function useData() {
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
currentPage: 1,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
background: true
|
||||
});
|
||||
const tableLabel = ref([
|
||||
@@ -54,6 +56,11 @@ export function useData() {
|
||||
label: "所得金币文字",
|
||||
prop: "diamond"
|
||||
},
|
||||
{
|
||||
label: "操作",
|
||||
fixed: "right",
|
||||
slot: "operation"
|
||||
}
|
||||
]);
|
||||
const onSearch = async () => {
|
||||
loading.value = true;
|
||||
@@ -91,7 +98,8 @@ export function useData() {
|
||||
counter: rowData?.counter ?? "",
|
||||
money: rowData?.money ?? "",
|
||||
money_str: rowData?.money_str ?? "",
|
||||
diamond: rowData?.diamond ?? ""
|
||||
diamond: rowData?.diamond ?? "",
|
||||
activity_end_time: rowData?.activity_end_time ?? "",
|
||||
}
|
||||
},
|
||||
width: "40%",
|
||||
@@ -130,6 +138,18 @@ export function useData() {
|
||||
contentRenderer: () => h(recordList, { ref: formRef, formInline: null }),
|
||||
});
|
||||
};
|
||||
const openGiftPark = (rowData) => {
|
||||
addDialog({
|
||||
title: `礼包列表`,
|
||||
width: "60%",
|
||||
closeOnClickModal: false,
|
||||
hideFooter: true,
|
||||
props: {
|
||||
rowData
|
||||
},
|
||||
contentRenderer: () => h(giftPackView, { ref: formRef, formInline: null }),
|
||||
});
|
||||
}
|
||||
return {
|
||||
onSearch,
|
||||
isShow,
|
||||
@@ -140,6 +160,7 @@ export function useData() {
|
||||
handleCurrentChange,
|
||||
loading,
|
||||
setConfig,
|
||||
DistributionRecord
|
||||
DistributionRecord,
|
||||
openGiftPark
|
||||
};
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ const {
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
DistributionRecord,
|
||||
openGiftPark,
|
||||
loading,
|
||||
} = useData();
|
||||
defineOptions({
|
||||
@@ -44,6 +45,11 @@ onMounted(() => {
|
||||
background: 'var(--el-fill-color-light)',
|
||||
color: 'var(--el-text-color-primary)'
|
||||
}" @page-current-change="handleCurrentChange" @page-size-change="handleSizeChange">
|
||||
<template #operation="{ row }">
|
||||
<el-button link type="primary" :size="size" @click="openGiftPark(row)">
|
||||
查看礼包列表
|
||||
</el-button>
|
||||
</template>
|
||||
</pure-table>
|
||||
</template>
|
||||
</PureTableBar>
|
||||
|
||||
54
src/views/Activities/newcomer/form.vue
Normal file
54
src/views/Activities/newcomer/form.vue
Normal file
@@ -0,0 +1,54 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
const ruleFormRef = ref();
|
||||
const formRules = ref({
|
||||
title: [{ required: true, message: "请输入新人礼包标题", trigger: "blur" }],
|
||||
money: [{ required: true, message: "请输入价值", trigger: "blur" }],
|
||||
status: [{ required: true, message: "请选择状态", trigger: "change" }],
|
||||
name: [{ required: true, message: "请输入新人礼包名称", trigger: "blur" }, { min: 1, max: 10, message: '长度在 1 到 10 个字符', trigger: 'blur' }]
|
||||
});
|
||||
const props = defineProps(["formInline"]);
|
||||
const newFormInline = ref(
|
||||
props.formInline
|
||||
? props.formInline
|
||||
: {
|
||||
name: "",
|
||||
title: "",
|
||||
status: "",
|
||||
title1: "",
|
||||
title2: "",
|
||||
money: ""
|
||||
|
||||
}
|
||||
);
|
||||
function getRef() {
|
||||
return ruleFormRef.value;
|
||||
}
|
||||
defineExpose({ getRef });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-form ref="ruleFormRef" :model="newFormInline" :rules="formRules" label-width="120px">
|
||||
<el-form-item label="新人礼包名称" prop="name">
|
||||
<el-input v-model="newFormInline.name" clearable placeholder="请输入新人礼包名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="新人礼包标题" prop="title">
|
||||
<el-input v-model="newFormInline.title" clearable placeholder="请输入新人礼包标题" />
|
||||
</el-form-item>
|
||||
<el-form-item label="副标题1" prop="title1">
|
||||
<el-input v-model="newFormInline.title1" clearable placeholder="请输入副标题1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="副标题2" prop="title2">
|
||||
<el-input v-model="newFormInline.title2" clearable placeholder="请输入副标题2" />
|
||||
</el-form-item>
|
||||
<el-form-item label="价值(元)" prop="money">
|
||||
<el-input v-model="newFormInline.money" clearable placeholder="请输入价值(元)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="newFormInline.status">
|
||||
<el-radio label="开启" :value="1" />
|
||||
<el-radio label="关闭" :value="0" />
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
188
src/views/Activities/newcomer/hook.tsx
Normal file
188
src/views/Activities/newcomer/hook.tsx
Normal file
@@ -0,0 +1,188 @@
|
||||
import { ref, h } from "vue";
|
||||
import editForm from "./form.vue";
|
||||
import { message } from "@/utils/message";
|
||||
import recordList from "./record.vue";
|
||||
import giftPackView from '../giftPack/index.vue';
|
||||
import {
|
||||
queryFirstCharge,
|
||||
addChargeTypeData,
|
||||
editChargeTypeData,
|
||||
deteleChargeTypeData
|
||||
} from "@/api/modules/activities";
|
||||
import { addDialog } from "@/components/ReDialog";
|
||||
export function useData() {
|
||||
const formRef = ref();
|
||||
const loading = ref(true);
|
||||
const tableList = ref([]);
|
||||
const isShow = ref(false);
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
const tableLabel = ref([
|
||||
{
|
||||
label: "ID",
|
||||
prop: "id"
|
||||
},
|
||||
{
|
||||
label: "新人礼包名称",
|
||||
prop: "name"
|
||||
},
|
||||
{
|
||||
label: "新人礼包标题",
|
||||
prop: "title"
|
||||
},
|
||||
{
|
||||
label: "副标题1",
|
||||
prop: "title1"
|
||||
},
|
||||
{
|
||||
label: "副标题2",
|
||||
prop: "title2"
|
||||
},
|
||||
{
|
||||
label: "价值(元)",
|
||||
prop: "money"
|
||||
},
|
||||
{
|
||||
label: "状态",
|
||||
prop: "status_str"
|
||||
},
|
||||
{
|
||||
label: "操作",
|
||||
fixed: "right",
|
||||
width: 210,
|
||||
slot: "operation"
|
||||
}
|
||||
]);
|
||||
const onSearch = async () => {
|
||||
loading.value = true;
|
||||
const { data, code } = await queryFirstCharge({
|
||||
page: pagination.value.currentPage,
|
||||
page_limit: pagination.value.pageSize,
|
||||
activities_id: 7
|
||||
});
|
||||
if (code) {
|
||||
tableList.value = data.lists;
|
||||
pagination.value.total = data.count;
|
||||
pagination.value.currentPage = data.page;
|
||||
}
|
||||
loading.value = false;
|
||||
};
|
||||
const handleSizeChange = (val: number) => {
|
||||
pagination.value.pageSize = val;
|
||||
onSearch();
|
||||
};
|
||||
const handleCurrentChange = (val: number) => {
|
||||
pagination.value.currentPage = val;
|
||||
onSearch();
|
||||
};
|
||||
const handleDelete = async rowData => {
|
||||
const { code } = await deteleChargeTypeData({ id: rowData.id });
|
||||
if (code) {
|
||||
message(`您删除了名称为${rowData.name}的这条数据`, {
|
||||
type: "success"
|
||||
});
|
||||
onSearch();
|
||||
}
|
||||
};
|
||||
const DistributionRecord = () => {
|
||||
addDialog({
|
||||
title: `发放记录`,
|
||||
width: "60%",
|
||||
closeOnClickModal: false,
|
||||
hideFooter: true,
|
||||
contentRenderer: () => h(recordList, { ref: formRef, formInline: null }),
|
||||
});
|
||||
};
|
||||
// 新增
|
||||
const openDialog = (title = "新增", rowData: any) => {
|
||||
addDialog({
|
||||
title: `${title}首充分类`,
|
||||
props: {
|
||||
formInline: {
|
||||
title: rowData?.title ?? "",
|
||||
name: rowData?.name ?? "",
|
||||
status: rowData?.status ?? "",
|
||||
title1: rowData?.title1 ?? "",
|
||||
title2: rowData?.title2 ?? "",
|
||||
money: rowData?.money ?? ""
|
||||
}
|
||||
},
|
||||
width: "40%",
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(editForm, { ref: formRef, formInline: null }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const FormRef = formRef.value.getRef();
|
||||
const curData = options.props.formInline;
|
||||
const saveData = async form => {
|
||||
const { code } = await addChargeTypeData({ ...form, activities_id: 7 });
|
||||
if (code) {
|
||||
message("新增成功", { type: "success" });
|
||||
onSearch();
|
||||
done();
|
||||
} else {
|
||||
message("新增失败", { type: "error" });
|
||||
}
|
||||
};
|
||||
const updateData = async form => {
|
||||
const { code } = await editChargeTypeData({
|
||||
...form,
|
||||
id: rowData.id,
|
||||
activities_id: 7
|
||||
});
|
||||
if (code) {
|
||||
message("修改成功", { type: "success" });
|
||||
onSearch();
|
||||
done();
|
||||
} else {
|
||||
message("修改失败", { type: "error" });
|
||||
}
|
||||
};
|
||||
FormRef.validate(valid => {
|
||||
if (valid) {
|
||||
console.log("curData", curData);
|
||||
// 表单规则校验通过
|
||||
if (title === "新增") {
|
||||
// 实际开发先调用新增接口,再进行下面操作
|
||||
saveData(curData);
|
||||
} else {
|
||||
// 实际开发先调用修改接口,再进行下面操作
|
||||
updateData(curData);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
// 打开礼物列表
|
||||
const openGiftPark = (rowData: any) => {
|
||||
addDialog({
|
||||
title: `礼包列表`,
|
||||
width: "60%",
|
||||
closeOnClickModal: false,
|
||||
hideFooter: true,
|
||||
props: {
|
||||
rowData
|
||||
},
|
||||
contentRenderer: () => h(giftPackView, { ref: formRef, formInline: null }),
|
||||
});
|
||||
}
|
||||
return {
|
||||
onSearch,
|
||||
isShow,
|
||||
tableList,
|
||||
tableLabel,
|
||||
pagination,
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
loading,
|
||||
handleDelete,
|
||||
openDialog,
|
||||
openGiftPark,
|
||||
DistributionRecord
|
||||
};
|
||||
}
|
||||
72
src/views/Activities/newcomer/index.vue
Normal file
72
src/views/Activities/newcomer/index.vue
Normal file
@@ -0,0 +1,72 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted } from "vue";
|
||||
import { useData } from "./hook";
|
||||
import SearchForm from "@/components/SearchForm/index.vue";
|
||||
import { PureTableBar } from "@/components/RePureTableBar";
|
||||
import { deviceDetection } from "@pureadmin/utils";
|
||||
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
||||
import AddFill from "@iconify-icons/ri/add-circle-line";
|
||||
const {
|
||||
DistributionRecord,
|
||||
onSearch,
|
||||
isShow,
|
||||
tableList,
|
||||
pagination,
|
||||
tableLabel,
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
handleDelete,
|
||||
loading,
|
||||
openGiftPark,
|
||||
openDialog
|
||||
} = useData();
|
||||
defineOptions({
|
||||
name: "RechargeList"
|
||||
});
|
||||
onMounted(() => {
|
||||
onSearch();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<template>
|
||||
<div class="main">
|
||||
<div ref="contentRef" :class="['flex', deviceDetection() ? 'flex-wrap' : '']">
|
||||
<PureTableBar title="新人礼包" :class="[isShow && !deviceDetection() ? '!w-[60vw]' : 'w-full']" :columns="tableLabel"
|
||||
@refresh="onSearch">
|
||||
<template #buttons>
|
||||
<el-button link type="primary" @click="DistributionRecord">
|
||||
发放记录
|
||||
</el-button>
|
||||
<!-- <el-button type="primary" :icon="useRenderIcon(AddFill)" @click="openDialog('新增', {})">
|
||||
新增礼包类型
|
||||
</el-button> -->
|
||||
</template>
|
||||
<template v-slot="{ size, dynamicColumns }">
|
||||
<pure-table ref="tableRef" align-whole="center" showOverflowTooltip table-layout="auto" default-expand-all
|
||||
:loading="loading" :size="size" row-key="id" adaptive :adaptiveConfig="{ offsetBottom: 108 }"
|
||||
:data="tableList" :columns="dynamicColumns" :pagination="{ ...pagination, size }" :header-cell-style="{
|
||||
background: 'var(--el-fill-color-light)',
|
||||
color: 'var(--el-text-color-primary)'
|
||||
}" @page-current-change="handleCurrentChange" @page-size-change="handleSizeChange">
|
||||
<template #operation="{ row }">
|
||||
<el-button link type="primary" :size="size" @click="openGiftPark(row)">
|
||||
查看礼包列表
|
||||
</el-button>
|
||||
<el-button link type="primary" :size="size" @click="openDialog('编辑', row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<!-- <el-popconfirm :title="`是否确认删除这条数据`" @confirm="handleDelete(row)">
|
||||
<template #reference>
|
||||
<el-button link type="primary" :size="size"> 删除 </el-button>
|
||||
</template>
|
||||
</el-popconfirm> -->
|
||||
|
||||
</template>
|
||||
</pure-table>
|
||||
</template>
|
||||
</PureTableBar>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped lang="scss"></style>
|
||||
79
src/views/Activities/newcomer/record.vue
Normal file
79
src/views/Activities/newcomer/record.vue
Normal file
@@ -0,0 +1,79 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import { queryChargeRecord } from '@/api/modules/activities';
|
||||
import { PureTableBar } from "@/components/RePureTableBar";
|
||||
import { deviceDetection } from "@pureadmin/utils";
|
||||
const props = defineProps(["rowData"]);
|
||||
const isShow = ref(false)
|
||||
const loading = ref(true);
|
||||
const tableList = ref([]);
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
const tableLabel = ref([
|
||||
{
|
||||
label: "ID",
|
||||
prop: "id"
|
||||
},
|
||||
{
|
||||
label: "首充类型",
|
||||
prop: "gift_bag_type"
|
||||
},
|
||||
{
|
||||
label: "首充价格",
|
||||
prop: "money"
|
||||
},
|
||||
{
|
||||
label: "操作人员",
|
||||
prop: "user_name"
|
||||
},
|
||||
{
|
||||
label: "时间",
|
||||
prop: "createtime"
|
||||
}
|
||||
])
|
||||
const getRecordList = async () => {
|
||||
const { code, data } = await queryChargeRecord({
|
||||
page: pagination.value.currentPage,
|
||||
page_limit: pagination.value.pageSize,
|
||||
activities_id: 7
|
||||
})
|
||||
if (code) {
|
||||
tableList.value = data.lists;
|
||||
pagination.value.total = data.count;
|
||||
pagination.value.currentPage = data.page;
|
||||
}
|
||||
loading.value = false;
|
||||
}
|
||||
const handleSizeChange = (val: number) => {
|
||||
pagination.value.pageSize = val;
|
||||
getRecordList();
|
||||
};
|
||||
const handleCurrentChange = (val: number) => {
|
||||
pagination.value.currentPage = val;
|
||||
getRecordList();
|
||||
};
|
||||
onMounted(() => {
|
||||
getRecordList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div ref="contentRef" :class="['flex', deviceDetection() ? 'flex-wrap' : '']">
|
||||
<PureTableBar title="新人礼包发放记录" :class="[isShow && !deviceDetection() ? '!w-[60vw]' : 'w-full']"
|
||||
:columns="tableLabel" @refresh="getRecordList">
|
||||
<template v-slot="{ size, dynamicColumns }">
|
||||
<pure-table ref="tableRef" align-whole="center" showOverflowTooltip table-layout="auto" default-expand-all
|
||||
:loading="loading" :size="size" row-key="id" adaptive :adaptiveConfig="{ offsetBottom: 108 }"
|
||||
:data="tableList" :columns="dynamicColumns" :pagination="{ ...pagination }" :header-cell-style="{
|
||||
background: 'var(--el-fill-color-light)',
|
||||
color: 'var(--el-text-color-primary)'
|
||||
}" @page-current-change="handleCurrentChange" @page-size-change="handleSizeChange">
|
||||
</pure-table>
|
||||
</template>
|
||||
</PureTableBar>
|
||||
</div>
|
||||
</template>
|
||||
@@ -6,8 +6,10 @@ import {
|
||||
addData,
|
||||
editData,
|
||||
deleteData,
|
||||
getDataInfo
|
||||
getDataInfo,
|
||||
apiPassWord
|
||||
} from "@/api/modules/admin";
|
||||
import passwordForm from './password.vue';
|
||||
import { addDialog } from "@/components/ReDialog";
|
||||
export function useData() {
|
||||
const formRef = ref();
|
||||
@@ -18,6 +20,7 @@ export function useData() {
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
currentPage: 1,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
background: true
|
||||
});
|
||||
const indexMethod = (index: number) => {
|
||||
@@ -142,6 +145,42 @@ export function useData() {
|
||||
onSearch();
|
||||
}
|
||||
};
|
||||
const settingPassWord = (title, rowData) => {
|
||||
addDialog({
|
||||
title: title,
|
||||
width: "40%",
|
||||
props: {
|
||||
formInline: {
|
||||
new_pwd: ""
|
||||
}
|
||||
},
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(passwordForm, { ref: formRef, formInline: null }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const FormRef = formRef.value.getRef();
|
||||
const curData = options.props.formInline;
|
||||
const updatePassWord = async form => {
|
||||
const { code } = await editData({
|
||||
password: form.new_pwd,
|
||||
id: rowData.id
|
||||
});
|
||||
if (code) {
|
||||
message("设置成功", { type: "success" });
|
||||
onSearch();
|
||||
done();
|
||||
} else {
|
||||
message("设置失败", { type: "error" });
|
||||
}
|
||||
};
|
||||
FormRef.validate(valid => {
|
||||
if (valid) {
|
||||
console.log("curData", curData.new_pwd);
|
||||
updatePassWord({ new_pwd: curData.new_pwd, user_id: rowData.id })
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
return {
|
||||
onSearch,
|
||||
isShow,
|
||||
@@ -152,6 +191,7 @@ export function useData() {
|
||||
handleCurrentChange,
|
||||
loading,
|
||||
openDialog,
|
||||
handleDelete
|
||||
handleDelete,
|
||||
settingPassWord
|
||||
};
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ const {
|
||||
handleCurrentChange,
|
||||
openDialog,
|
||||
loading,
|
||||
settingPassWord,
|
||||
handleDelete
|
||||
} = useData();
|
||||
defineOptions({
|
||||
@@ -44,6 +45,9 @@ onMounted(() => {
|
||||
color: 'var(--el-text-color-primary)'
|
||||
}" @page-size-change="handleSizeChange" @page-current-change="handleCurrentChange">
|
||||
<template #operation="{ row }">
|
||||
<el-button link type="primary" :size="size" @click="settingPassWord('设置密码', row)">
|
||||
设置密码
|
||||
</el-button>
|
||||
<el-button link type="primary" :size="size" @click="openDialog('编辑', row)">
|
||||
编辑
|
||||
</el-button>
|
||||
|
||||
30
src/views/Admin/userList/password.vue
Normal file
30
src/views/Admin/userList/password.vue
Normal file
@@ -0,0 +1,30 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
const ruleFormRef = ref();
|
||||
const formRules = ref({
|
||||
new_pwd: [
|
||||
{ required: true, message: "密码为必填项", trigger: "blur" }
|
||||
]
|
||||
});
|
||||
const props = defineProps(["formInline"]);
|
||||
const newFormInline = ref(
|
||||
props.formInline
|
||||
? props.formInline
|
||||
: {
|
||||
user_id: "",
|
||||
new_pwd: ""
|
||||
}
|
||||
);
|
||||
function getRef() {
|
||||
return ruleFormRef.value;
|
||||
}
|
||||
defineExpose({ getRef });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-form ref="ruleFormRef" :model="newFormInline" :rules="formRules" label-width="120px">
|
||||
<el-form-item label="设置新的密码" prop="new_pwd">
|
||||
<el-input placeholder="请输入密码" v-model="newFormInline.new_pwd" show-password></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
@@ -12,6 +12,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -21,6 +21,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -13,6 +13,7 @@ export function useData() {
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
currentPage: 1,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
background: true
|
||||
});
|
||||
const searchForm = ref({
|
||||
|
||||
8
src/views/BlindBox/turntable/Turntable.vue
Normal file
8
src/views/BlindBox/turntable/Turntable.vue
Normal file
@@ -0,0 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import lotteryView from '@/views/room/roomList/Turntable/lotteryResults.vue'
|
||||
</script>
|
||||
<template>
|
||||
<div class="viewPage">
|
||||
<lotteryView></lotteryView>
|
||||
</div>
|
||||
</template>
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
getBlindBoxRule,
|
||||
settingBlindBoxRule
|
||||
} from "@/api/modules/blindBox";
|
||||
import TurntableView from './Turntable.vue';
|
||||
import editForm from "./form.vue";
|
||||
import settingRuleView from './settingRule.vue'
|
||||
import { addDialog } from "@/components/ReDialog";
|
||||
@@ -22,6 +23,7 @@ export function useData() {
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
currentPage: 1,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
background: true
|
||||
});
|
||||
const searchForm = ref({
|
||||
@@ -76,6 +78,10 @@ export function useData() {
|
||||
label: "每期数量",
|
||||
prop: "quantity"
|
||||
},
|
||||
{
|
||||
label: "未开数量",
|
||||
prop: "remaining_number"
|
||||
},
|
||||
{
|
||||
label: "多少次后可参与开奖",
|
||||
prop: "weight"
|
||||
@@ -265,6 +271,16 @@ export function useData() {
|
||||
}
|
||||
});
|
||||
}
|
||||
// 开奖记录
|
||||
const openLotteryRecord = () => {
|
||||
addDialog({
|
||||
title: `盲盒转盘开奖记录`,
|
||||
fullscreen: true,
|
||||
hideFooter: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(TurntableView, { ref: formRef, formInline: null })
|
||||
});
|
||||
}
|
||||
return {
|
||||
searchForm,
|
||||
searchLabel,
|
||||
@@ -285,6 +301,7 @@ export function useData() {
|
||||
openDialog,
|
||||
resetSetting,
|
||||
handleDelete,
|
||||
setting
|
||||
setting,
|
||||
openLotteryRecord
|
||||
};
|
||||
}
|
||||
@@ -26,6 +26,7 @@ const {
|
||||
openDialog,
|
||||
resetSetting,
|
||||
handleDelete,
|
||||
openLotteryRecord,
|
||||
setting
|
||||
} = useData();
|
||||
onMounted(() => {
|
||||
@@ -56,8 +57,10 @@ defineOptions({
|
||||
<PureTableBar title="盲盒转盘列表" :class="[isShow && !deviceDetection() ? '!w-[60vw]' : 'w-full']"
|
||||
:columns="tableLabel" @refresh="onSearch">
|
||||
<template #buttons>
|
||||
<el-button type="text" @click="openLotteryRecord">开奖记录</el-button>
|
||||
<el-popconfirm :title="`是否重置当前盲盒转盘的规则数量`" @confirm="resetSetting(row)">
|
||||
<template #reference>
|
||||
|
||||
<el-button type="primary">
|
||||
重置数量
|
||||
</el-button>
|
||||
|
||||
@@ -28,6 +28,7 @@ export function useData() {
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
currentPage: 1,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
background: true
|
||||
});
|
||||
const tableLabel = ref([
|
||||
|
||||
@@ -21,6 +21,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -43,14 +43,15 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
const statisticsList = ref([
|
||||
{ label: "总收入(¥)", prop: "total_money" },
|
||||
// { label: "总收入(¥)", prop: "total_money" },
|
||||
{ label: "未支付(¥)", prop: "unpaid_money" },
|
||||
{
|
||||
label: "已支付(¥)", prop: "paid_money"
|
||||
label: "总收入(¥)", prop: "paid_money"
|
||||
},
|
||||
{ label: "微信支付(¥)", prop: "wx_money" },
|
||||
{ label: "支付宝支付(¥)", prop: "ali_money" },
|
||||
|
||||
@@ -57,6 +57,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -21,6 +21,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
@@ -54,6 +55,10 @@ export function useData() {
|
||||
label: "数量(金币/钻石)",
|
||||
prop: "change_value"
|
||||
},
|
||||
{
|
||||
label: "备注",
|
||||
prop: "remarks",
|
||||
},
|
||||
{
|
||||
label: "支付时间",
|
||||
prop: "createtime",
|
||||
|
||||
@@ -23,6 +23,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -14,6 +14,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -14,6 +14,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -22,6 +22,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -9,6 +9,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -9,6 +9,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -22,6 +22,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -22,6 +22,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -14,6 +14,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -14,6 +14,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -13,6 +13,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -13,18 +13,11 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
const statisticsList = ref([
|
||||
{ label: "礼物总数量", prop: "gift_num" },
|
||||
{ label: "礼物总价", prop: "total_price" },
|
||||
{
|
||||
label: "平台收益(30%)", prop: "app_earning"
|
||||
},
|
||||
{ label: "接收人收益(60%)", prop: "receive_earning" },
|
||||
{ label: "房主收益(10%)", prop: "room_owner_earning" },
|
||||
])
|
||||
const statisticsList = ref()
|
||||
|
||||
const totalData = ref(null)
|
||||
const searchForm = ref({
|
||||
@@ -53,7 +46,8 @@ export function useData() {
|
||||
{ label: "开始时间", prop: "start_time", type: "date" },
|
||||
{ label: "结束时间", prop: "end_time", type: "date" },
|
||||
]);
|
||||
const tableLabel = ref([
|
||||
const tableLabel = ref([])
|
||||
const tableLabelS = ref([
|
||||
{
|
||||
label: "送礼人ID-昵称",
|
||||
prop: "send_user"
|
||||
@@ -82,18 +76,6 @@ export function useData() {
|
||||
label: "礼物总价(金币)",
|
||||
prop: "total_price"
|
||||
},
|
||||
{
|
||||
label: "平台收益(30%)钻石",
|
||||
prop: "app_earning"
|
||||
},
|
||||
{
|
||||
label: "接收人收益(60%)钻石",
|
||||
prop: "gift_user_earning"
|
||||
},
|
||||
{
|
||||
label: "房主收益(10%)钻石",
|
||||
prop: "room_owner_earning"
|
||||
},
|
||||
{
|
||||
label: "来源",
|
||||
prop: "type",
|
||||
@@ -116,6 +98,41 @@ export function useData() {
|
||||
|
||||
});
|
||||
if (code) {
|
||||
const objLabel = [
|
||||
{
|
||||
label: `平台收益(${data.total.app_earning_ratio}%)钻石`,
|
||||
prop: "app_earning"
|
||||
},
|
||||
{
|
||||
label: `接收人收益(${data.total.receive_earning_ratio}%)钻石`,
|
||||
prop: "gift_user_earning"
|
||||
},
|
||||
{
|
||||
label: `房主收益(${data.total.room_owner_earning_ratio}%)钻石`,
|
||||
prop: "room_owner_earning"
|
||||
}
|
||||
]
|
||||
const objStatistics = [
|
||||
{
|
||||
label: `平台收益(${data.total.app_earning_ratio}%)钻石`,
|
||||
prop: "app_earning"
|
||||
},
|
||||
{
|
||||
label: `接收人收益(${data.total.receive_earning_ratio}%)钻石`,
|
||||
prop: "receive_earning"
|
||||
},
|
||||
{
|
||||
label: `房主收益(${data.total.room_owner_earning_ratio}%)钻石`,
|
||||
prop: "room_owner_earning"
|
||||
}
|
||||
]
|
||||
statisticsList.value = [...[
|
||||
{ label: "礼物总数量", prop: "gift_num" },
|
||||
{ label: "礼物总价", prop: "total_price" }
|
||||
], ...objStatistics]
|
||||
tableLabel.value = [...tableLabelS.value]
|
||||
tableLabel.value.splice(7, 0, ...objLabel)
|
||||
console.log(tableLabel.value)
|
||||
tableList.value = data.lists.map(ele => {
|
||||
return {
|
||||
...ele,
|
||||
@@ -124,9 +141,11 @@ export function useData() {
|
||||
gift_user_earning: parseFloat(ele.gift_user_earning),
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
totalData.value = data.total;
|
||||
pagination.value.total = data.count;
|
||||
pagination.value.currentPage = data.page;
|
||||
pagination.value.currentPage = parseFloat(data.page);
|
||||
}
|
||||
loading.value = false;
|
||||
};
|
||||
@@ -136,7 +155,7 @@ export function useData() {
|
||||
};
|
||||
const handleCurrentChange = (val: number) => {
|
||||
pagination.value.currentPage = val;
|
||||
console.log(searchForm.value, 'yzy')
|
||||
// console.log(searchForm.value, 'yzy')
|
||||
onSearch(searchForm.value);
|
||||
};
|
||||
const exportFormRef = ref(null)
|
||||
@@ -158,6 +177,11 @@ export function useData() {
|
||||
const exportData = async (formData) => {
|
||||
const { data, code } = await queryGiftGiveList({
|
||||
...formData,
|
||||
send_user: searchForm.value.send_user,
|
||||
gift_user: searchForm.value.gift_user,
|
||||
from_id: searchForm.value.from_id,
|
||||
gift_id: searchForm.value.gift_id,
|
||||
from: searchForm.value.from,
|
||||
page: 1,
|
||||
page_limit: 20000
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted } from "vue";
|
||||
import { onBeforeMount } from "vue";
|
||||
import { useData } from "./hook";
|
||||
import SearchForm from "@/components/SearchForm/index.vue";
|
||||
import { PureTableBar } from "@/components/RePureTableBar";
|
||||
@@ -19,7 +19,7 @@ const {
|
||||
statisticsList,
|
||||
loading
|
||||
} = useData();
|
||||
onMounted(() => {
|
||||
onBeforeMount(() => {
|
||||
onSearch(searchForm.value);
|
||||
});
|
||||
defineOptions({
|
||||
@@ -37,10 +37,9 @@ defineOptions({
|
||||
</div>
|
||||
</div>
|
||||
<div ref="contentRef" :class="['flex', deviceDetection() ? 'flex-wrap' : '']">
|
||||
<PureTableBar title="礼物统计列表" :class="[isShow && !deviceDetection() ? '!w-[60vw]' : 'w-full']"
|
||||
<PureTableBar v-if="!loading" title="礼物统计列表" :class="[isShow && !deviceDetection() ? '!w-[60vw]' : 'w-full']"
|
||||
:columns="tableLabel" @refresh="onSearch">
|
||||
<template #buttons>
|
||||
<!-- <div style="display: inline-flex;align-items: center;" class="mr-10">总计:{{ total_price }}</div> -->
|
||||
<el-button type="primary" @click="exportExcel">
|
||||
导出
|
||||
</el-button>
|
||||
|
||||
@@ -13,6 +13,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -14,6 +14,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -24,6 +24,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -24,6 +24,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import RichText from '@/components/RichText/index.vue';
|
||||
const ruleFormRef = ref();
|
||||
const formRules = ref({
|
||||
version: [{ required: true, message: "版本号为必填项", trigger: "blur" }],
|
||||
@@ -31,7 +32,9 @@ const newFormInline = ref(
|
||||
function getRef() {
|
||||
return ruleFormRef.value;
|
||||
}
|
||||
|
||||
function chanageEditorValue(val) {
|
||||
newFormInline.value.content = val
|
||||
}
|
||||
defineExpose({ getRef });
|
||||
</script>
|
||||
|
||||
@@ -53,7 +56,9 @@ defineExpose({ getRef });
|
||||
<el-input v-model="newFormInline.downloadurl" clearable placeholder="请输入下载链接" />
|
||||
</el-form-item>
|
||||
<el-form-item label="更新内容" prop="content">
|
||||
<el-input v-model="newFormInline.content" type="textarea" clearable placeholder="请输入更新内容" />
|
||||
<RichText style="border: 1px solid #ccc;" :echoValue="newFormInline.content" @changeValue="chanageEditorValue">
|
||||
</RichText>
|
||||
<!-- <el-input v-model="newFormInline.content" type="textarea" clearable placeholder="请输入更新内容" /> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="强制更新" prop="enforce">
|
||||
<el-radio-group v-model="newFormInline.enforce">
|
||||
@@ -63,8 +68,9 @@ defineExpose({ getRef });
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="newFormInline.status">
|
||||
<el-radio label="启用" :value="1" />
|
||||
<el-radio label="禁用" :value="0" />
|
||||
<el-radio label="待发布" :value="0" />
|
||||
<el-radio label="已发布" :value="1" />
|
||||
<el-radio label="禁用" :value="2" />
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
@@ -18,6 +18,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
@@ -70,16 +71,7 @@ export function useData() {
|
||||
label: "启用状态",
|
||||
prop: "status",
|
||||
cellRenderer: ({ row, props }) => (
|
||||
<el-switch
|
||||
v-model={row.status}
|
||||
onChange={() => onChange(row as any)}
|
||||
active-value={1}
|
||||
inactive-value={0}
|
||||
active-text="启用"
|
||||
inactive-text="禁用"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949">
|
||||
</el-switch>
|
||||
<el-tag type={row.status === 0 ? 'info' : row.status === 1 ? 'success' : 'danger'}>{row.status === 0 ? '待发布' : row.status === 1 ? '已发布' : '禁用'}</el-tag>
|
||||
)
|
||||
},
|
||||
{
|
||||
@@ -143,7 +135,7 @@ export function useData() {
|
||||
const openDialog = (title = "新增", rowData: any) => {
|
||||
// console.log(rowData, '编辑');
|
||||
addDialog({
|
||||
title: `${title}广告`,
|
||||
title: `${title}版本`,
|
||||
props: {
|
||||
formInline: {
|
||||
version: rowData?.newversion ?? "",
|
||||
|
||||
@@ -16,6 +16,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -22,6 +22,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -22,6 +22,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -21,6 +21,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -22,6 +22,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -51,6 +51,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -18,6 +18,7 @@ export function useData() {
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
currentPage: 1,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
background: true
|
||||
});
|
||||
const searchForm = ref({
|
||||
@@ -88,12 +89,12 @@ export function useData() {
|
||||
searchForm.value = { ...formData }
|
||||
const { data, code } = await queryList({
|
||||
...formData,
|
||||
pageNum: pagination.value.currentPage,
|
||||
pageSize: pagination.value.pageSize
|
||||
page: pagination.value.currentPage,
|
||||
page_limit: pagination.value.pageSize
|
||||
});
|
||||
if (code) {
|
||||
tableList.value = data.lists;
|
||||
pagination.value.total = data.totalRow;
|
||||
pagination.value.total = data.count;
|
||||
pagination.value.currentPage = data.pageNumber;
|
||||
}
|
||||
loading.value = false;
|
||||
|
||||
@@ -1,22 +1,31 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import SearchForm from "@/components/SearchForm/index.vue";
|
||||
import { getUserList } from '@/api/modules/message'
|
||||
const selectUserList = ref([]);
|
||||
const userList = ref([])
|
||||
function getRef() {
|
||||
return selectUserList.value;
|
||||
}
|
||||
const searchLabel = ref([
|
||||
{ label: "用户ID", prop: "user_code", type: "input" }
|
||||
]);
|
||||
const searchForm = ref({})
|
||||
const multipleTable = ref(null)
|
||||
const onSearch = (formData) => {
|
||||
userList.value = []
|
||||
selectUserList.value = []
|
||||
getAllUserList(formData)
|
||||
}
|
||||
const props = defineProps(["userList"]);
|
||||
const getAllUserList = async () => {
|
||||
const { code, data } = await getUserList()
|
||||
const getAllUserList = async (form) => {
|
||||
const { code, data } = await getUserList({ ...form })
|
||||
userList.value = code ? data : []
|
||||
setTimeout(() => {
|
||||
if (userList.value.length) {
|
||||
userList.value.forEach(ele => {
|
||||
const listData = props.userList.map(e => { return Number(e) })
|
||||
if (listData.includes(ele.id)) {
|
||||
selectUserList.value.push()
|
||||
multipleTable.value.toggleRowSelection(ele, true)
|
||||
}
|
||||
})
|
||||
@@ -27,12 +36,13 @@ function handleSelectionChange(val) {
|
||||
selectUserList.value = val
|
||||
}
|
||||
onMounted(() => {
|
||||
getAllUserList()
|
||||
getAllUserList(searchForm.value)
|
||||
})
|
||||
defineExpose({ getRef });
|
||||
</script>
|
||||
<template>
|
||||
<div style="margin-bottom: 20px;">
|
||||
<SearchForm class="pb-2" :LabelList="searchLabel" :formData="searchForm" @handleSearch="onSearch"></SearchForm>
|
||||
<el-table ref="multipleTable" :data="userList" row-key="id" border style="width: 100%" max-height="550"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55">
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
import { ref } from "vue";
|
||||
import { ref, h } from "vue";
|
||||
import {
|
||||
queryList
|
||||
} from "@/api/modules/backpack";
|
||||
import { utils, writeFile } from "xlsx";
|
||||
import { message } from "@/utils/message";
|
||||
import ExportForm from '@/components/exportDialog/index.vue';
|
||||
import { addDialog } from "@/components/ReDialog";
|
||||
export function useData() {
|
||||
const loading = ref(true);
|
||||
const tableList = ref([]);
|
||||
@@ -10,6 +14,7 @@ export function useData() {
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
currentPage: 1,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
background: true
|
||||
});
|
||||
const searchForm = ref({
|
||||
@@ -93,6 +98,67 @@ export function useData() {
|
||||
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 queryList({
|
||||
...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,
|
||||
@@ -103,6 +169,7 @@ export function useData() {
|
||||
pagination,
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
exportExcel,
|
||||
loading,
|
||||
detailData
|
||||
};
|
||||
|
||||
@@ -13,6 +13,7 @@ const {
|
||||
tableList,
|
||||
pagination,
|
||||
tableLabel,
|
||||
exportExcel,
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
loading
|
||||
@@ -33,7 +34,12 @@ defineOptions({
|
||||
<PureTableBar title="背包列表" :class="[isShow && !deviceDetection() ? '!w-[60vw]' : 'w-full']" :columns="tableLabel"
|
||||
@refresh="onSearch">
|
||||
<template #buttons>
|
||||
<div v-if="detailData">总计:礼物 {{ detailData.gift_count }} 个,价值 {{ detailData.gift_total }} 金币</div>
|
||||
<div v-if="detailData" style="display:inline-flex;align-items: center;" class="mr-5">总计:礼物 {{
|
||||
detailData.gift_count }} 个,价值
|
||||
{{ detailData.gift_total }} 金币</div>
|
||||
<el-button type="primary" @click="exportExcel">
|
||||
导出
|
||||
</el-button>
|
||||
</template>
|
||||
<template v-slot="{ size, dynamicColumns }">
|
||||
<pure-table ref="tableRef" align-whole="center" showOverflowTooltip table-layout="auto" default-expand-all
|
||||
|
||||
@@ -15,6 +15,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import { ref, onMounted, h } from "vue";
|
||||
import ExportForm from '@/components/exportDialog/index.vue';
|
||||
import SearchForm from "@/components/SearchForm/index.vue";
|
||||
import { utils, writeFile } from "xlsx";
|
||||
const exportFormRef = ref(null)
|
||||
import { addDialog } from "@/components/ReDialog";
|
||||
import { message } from "@/utils/message";
|
||||
const props = defineProps(["userInfo"]);
|
||||
import {
|
||||
userLogData,
|
||||
@@ -44,7 +50,6 @@ const getLogData = async (type) => {
|
||||
}
|
||||
const getPhotoAlbum = async () => {
|
||||
const { data, code } = await userPhotoAlbum({ user_id: userData.value.userId })
|
||||
// console.log(data, code, '相册')
|
||||
photoAlbums.value = code ? data : []
|
||||
}
|
||||
const deleteAlbum = async (rowData) => {
|
||||
@@ -102,6 +107,72 @@ const handleCurrentChange = (val: number) => {
|
||||
getLogData(activeIndex.value == '1' ? 1 : 2)
|
||||
};
|
||||
//
|
||||
const exportTable = (activeIndex) => {
|
||||
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 userLogData({
|
||||
user_id: userData.value.userId, type: activeIndex.value == '1' ? 1 : 2, page: 1, page_limit: 10000
|
||||
})
|
||||
if (code) {
|
||||
exportTableList = data.lists;
|
||||
const res = exportTableList.map(item => {
|
||||
const arr = [];
|
||||
dynamicColumns.value.forEach(column => {
|
||||
arr.push(item[column.prop as string]);
|
||||
});
|
||||
return arr;
|
||||
});
|
||||
const titleList = [];
|
||||
dynamicColumns.value.forEach(column => {
|
||||
titleList.push(column.label);
|
||||
});
|
||||
res.unshift(titleList);
|
||||
console.log(titleList)
|
||||
const workSheet = utils.aoa_to_sheet(res);
|
||||
const workBook = utils.book_new();
|
||||
utils.book_append_sheet(workBook, workSheet, "数据报表");
|
||||
writeFile(workBook, `${activeIndex.value == '1' ? '金币' : '钻石'}统计——${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 searchForm = ref({})
|
||||
const searchLabel = ref([])
|
||||
const onSearch = async () => {
|
||||
|
||||
}
|
||||
const resetFieldsSearch = () => {
|
||||
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div class="viewPage">
|
||||
@@ -124,9 +195,15 @@ const handleCurrentChange = (val: number) => {
|
||||
</div>
|
||||
<div style="margin-top: 20px;">
|
||||
<el-tabs v-model="activeIndex" @tab-click="handleClick">
|
||||
|
||||
<el-tab-pane label="金币收支" name="1">
|
||||
<pure-table ref="tableRef" align-whole="center" showOverflowTooltip table-layout="auto"
|
||||
:adaptiveConfig="{ offsetBottom: 108 }" :data="tableList" :columns="dynamicColumns"
|
||||
<div class="mb-5 flex" style="float: right;align-items: center;">
|
||||
<!-- <SearchForm class="pb-2" :LabelList="searchLabel" :formData="searchForm" @handleSearch="onSearch"
|
||||
@resetFields="resetFieldsSearch" :isSenior="false" /> -->
|
||||
<el-button @click="exportTable(activeIndex)" type="primary">导出当前表格</el-button>
|
||||
</div>
|
||||
<pure-table v-if="activeIndex == 1" ref="tableRef" align-whole="center" showOverflowTooltip
|
||||
table-layout="auto" :adaptiveConfig="{ offsetBottom: 108 }" :data="tableList" :columns="dynamicColumns"
|
||||
:pagination="{ ...pagination }" @page-size-change="handleSizeChange"
|
||||
@page-current-change="handleCurrentChange" :header-cell-style="{
|
||||
background: 'var(--el-fill-color-light)',
|
||||
@@ -135,8 +212,11 @@ const handleCurrentChange = (val: number) => {
|
||||
</pure-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="钻石收支" name="2">
|
||||
<pure-table ref="tableRef" align-whole="center" showOverflowTooltip table-layout="auto"
|
||||
:adaptiveConfig="{ offsetBottom: 108 }" @page-size-change="handleSizeChange"
|
||||
<div class="mb-5" style="float: right;">
|
||||
<el-button @click="exportTable(activeIndex)" type="primary">导出当前表格</el-button>
|
||||
</div>
|
||||
<pure-table v-if="activeIndex == 2" ref="tableRef" align-whole="center" showOverflowTooltip
|
||||
table-layout="auto" :adaptiveConfig="{ offsetBottom: 108 }" @page-size-change="handleSizeChange"
|
||||
@page-current-change="handleCurrentChange" :data="tableList" :columns="dynamicColumns"
|
||||
:pagination="{ ...pagination }" :header-cell-style="{
|
||||
background: 'var(--el-fill-color-light)',
|
||||
@@ -146,28 +226,32 @@ const handleCurrentChange = (val: number) => {
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="ta的相册" name="3">
|
||||
<!-- {{ photoAlbums }} -->
|
||||
<div v-if="photoAlbums.length > 0" class="albums-container">
|
||||
<div v-for="(album, index) in photoAlbums" :key="index" class="album-card" @click="openAlbum(album)">
|
||||
<img :src="album.image" class="album-cover" alt="Album cover">
|
||||
<div class="album-info">
|
||||
<div class="album-title">{{ album.name }}</div>
|
||||
<div class="album-stats">
|
||||
<span><i class="fas fa-images"></i> {{ album.img_num }} 张照片</span>
|
||||
<!-- <el-popconfirm title="确定删除吗?" @confirm="deleteAlbum(album)">
|
||||
<template v-if="activeIndex == 3">
|
||||
<div v-if="photoAlbums.length > 0" class="albums-container">
|
||||
<div v-for="(album, index) in photoAlbums" :key="index" class="album-card" @click="openAlbum(album)">
|
||||
<img :src="album.image" class="album-cover" alt="Album cover">
|
||||
<div class="album-info">
|
||||
<div class="album-title">{{ album.name }}</div>
|
||||
<div class="album-stats">
|
||||
<span><i class="fas fa-images"></i> {{ album.img_num }} 张照片</span>
|
||||
<!-- <el-popconfirm title="确定删除吗?" @confirm="deleteAlbum(album)">
|
||||
<el-button size="small">删除</el-button>
|
||||
</el-popconfirm> -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="empty-album">
|
||||
<i class="fas fa-images"></i>
|
||||
<h3>暂无相册</h3>
|
||||
<p>该用户还没有创建任何相册</p>
|
||||
</div>
|
||||
<div v-else class="empty-album">
|
||||
<i class="fas fa-images"></i>
|
||||
<h3>暂无相册</h3>
|
||||
<p>该用户还没有创建任何相册</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -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';
|
||||
@@ -17,6 +20,7 @@ import {
|
||||
banUserData
|
||||
} from "@/api/modules/newuserList";
|
||||
import { addDialog } from "@/components/ReDialog";
|
||||
import { object } from "vue-types";
|
||||
export function useData() {
|
||||
const formRef = ref();
|
||||
const searchFormMore = ref({
|
||||
@@ -34,6 +38,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
@@ -150,10 +155,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
|
||||
});
|
||||
@@ -337,6 +346,12 @@ export function useData() {
|
||||
}
|
||||
});
|
||||
}
|
||||
const changeSearchValue = (form) => {
|
||||
Object.keys(form).forEach(ele => {
|
||||
searchForm.value[ele] = form[ele]
|
||||
})
|
||||
console.log(searchForm.value)
|
||||
}
|
||||
const resetFieldsSearch = () => {
|
||||
searchFormMore.value = {
|
||||
user_code: '',
|
||||
@@ -393,7 +408,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 +508,7 @@ export function useData() {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
searchForm,
|
||||
searchLabel,
|
||||
@@ -450,6 +528,8 @@ export function useData() {
|
||||
changePassword,
|
||||
setUserFund,
|
||||
onSeniorSearch,
|
||||
resetFieldsSearch
|
||||
resetFieldsSearch,
|
||||
exportExcel,
|
||||
changeSearchValue
|
||||
};
|
||||
}
|
||||
@@ -23,7 +23,9 @@ const {
|
||||
changePassword,
|
||||
setUserFund,
|
||||
onSeniorSearch,
|
||||
resetFieldsSearch
|
||||
resetFieldsSearch,
|
||||
exportExcel,
|
||||
changeSearchValue
|
||||
} = useData();
|
||||
defineOptions({
|
||||
name: "newuserList"
|
||||
@@ -46,10 +48,15 @@ onMounted(() => {
|
||||
<template>
|
||||
<div class="main">
|
||||
<SearchForm class="pb-2" :LabelList="searchLabel" :formData="searchForm" @handleSearch="onSearch"
|
||||
@openSearch="onSeniorSearch" @resetFields="resetFieldsSearch" :isSenior="true" />
|
||||
@openSearch="onSeniorSearch" @changeValue="changeSearchValue" @resetFields="resetFieldsSearch" :isSenior="true" />
|
||||
<div ref="contentRef" :class="['flex', deviceDetection() ? 'flex-wrap' : '']">
|
||||
<PureTableBar title="会员列表" :class="[isShow && !deviceDetection() ? '!w-[60vw]' : 'w-full']" :columns="tableLabel"
|
||||
@refresh="onSearch">
|
||||
<template #buttons>
|
||||
<el-button type="primary" @click="exportExcel">
|
||||
导出
|
||||
</el-button>
|
||||
</template>
|
||||
<template v-slot="{ size, dynamicColumns }">
|
||||
<pure-table ref="tableRef" align-whole="center" showOverflowTooltip table-layout="auto" :loading="loading"
|
||||
:size="size" adaptive :adaptiveConfig="{ offsetBottom: 108 }" :data="tableList" :columns="dynamicColumns"
|
||||
|
||||
@@ -17,6 +17,7 @@ export function useData() {
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
currentPage: 1,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
background: true
|
||||
});
|
||||
const tableLabel = ref([
|
||||
|
||||
@@ -14,6 +14,7 @@ export function useData() {
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
currentPage: 1,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
background: true
|
||||
});
|
||||
const searchForm = ref({
|
||||
|
||||
147
src/views/paradise/drawOrlockList/Results.vue
Normal file
147
src/views/paradise/drawOrlockList/Results.vue
Normal file
@@ -0,0 +1,147 @@
|
||||
<script setup lang="ts">
|
||||
// 开奖记录
|
||||
import { ref, onMounted, nextTick } from "vue";
|
||||
import SearchForm from "@/components/SearchForm/index.vue";
|
||||
import {
|
||||
queryBoxTypeList
|
||||
} from "@/api/modules/blindBox";
|
||||
import {
|
||||
queryLockRecord
|
||||
} from "@/api/modules/room";
|
||||
const searchLabel = ref([
|
||||
{ label: "用户ID", prop: "user_id", type: "input" },
|
||||
{ label: "开奖期数", prop: "periods", type: "input" },
|
||||
{ label: "礼物ID", prop: "gift_id", type: "input" },
|
||||
]);
|
||||
const props = defineProps(["roomId"]);
|
||||
const typeList = ref([])
|
||||
const searchForm = ref({
|
||||
user_id: "",
|
||||
gift_id: "",
|
||||
periods: ""
|
||||
});
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
const statisticsData = ref()
|
||||
const tableList = ref([])
|
||||
const statisticsList = ref([
|
||||
{ label: "今日锁定次数", prop: "locking_num" }
|
||||
])
|
||||
const dynamicflowColumns = ref([
|
||||
{
|
||||
label: "ID",
|
||||
prop: "id"
|
||||
},
|
||||
{
|
||||
label: "期数",
|
||||
prop: "periods"
|
||||
},
|
||||
{
|
||||
label: "锁定ID",
|
||||
prop: "user"
|
||||
},
|
||||
{
|
||||
label: "支付价格",
|
||||
prop: "pay_price"
|
||||
},
|
||||
{
|
||||
label: "房间名称",
|
||||
prop: "room_name"
|
||||
},
|
||||
{
|
||||
label: "礼物ID",
|
||||
prop: "gift_id"
|
||||
},
|
||||
{
|
||||
label: "礼物名称",
|
||||
prop: "gift_name"
|
||||
},
|
||||
{
|
||||
label: "礼物价格",
|
||||
prop: "gift_price"
|
||||
},
|
||||
{
|
||||
label: "锁定数量",
|
||||
prop: "locking_num"
|
||||
},
|
||||
{
|
||||
label: "是否收入背包",
|
||||
prop: "is_send_str"
|
||||
},
|
||||
{
|
||||
label: "创建时间",
|
||||
prop: "createtime"
|
||||
}
|
||||
])
|
||||
const getData = async (formData) => {
|
||||
searchForm.value = { ...formData }
|
||||
const { data, code } = await queryLockRecord({
|
||||
...formData,
|
||||
page: pagination.value.currentPage,
|
||||
page_limit: pagination.value.pageSize,
|
||||
room_id: props.roomId
|
||||
})
|
||||
if (code) {
|
||||
tableList.value = data.lists
|
||||
statisticsData.value = {
|
||||
locking_num: data.locking_num
|
||||
}
|
||||
pagination.value.total = data.count;
|
||||
pagination.value.currentPage = data.page;
|
||||
}
|
||||
}
|
||||
const handleSizeChange = (val: number) => {
|
||||
pagination.value.pageSize = val;
|
||||
getData(searchForm.value)
|
||||
};
|
||||
const handleCurrentChange = (val: number) => {
|
||||
pagination.value.currentPage = val;
|
||||
getData(searchForm.value)
|
||||
};
|
||||
onMounted(() => {
|
||||
getData(searchForm.value)
|
||||
// getType()
|
||||
})
|
||||
</script>
|
||||
<template>
|
||||
<div class="viewPage">
|
||||
<div class="content-flex" v-if="statisticsData">
|
||||
<div class="box" v-for="(ele, index) in statisticsList">
|
||||
<el-statistic :precision="2" decimal-separator="." :value="statisticsData[ele.prop] || 0"
|
||||
:suffix="ele.tip || ''" :title="ele.label"></el-statistic>
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
<SearchForm class="pb-2" :LabelList="searchLabel" :formData="searchForm" @handleSearch="getData" />
|
||||
<pure-table class="mt-5" ref="tableRef" align-whole="center" showOverflowTooltip table-layout="auto"
|
||||
default-expand-all row-key="id" :adaptiveConfig="{ offsetBottom: 108 }" :data="tableList"
|
||||
:columns="dynamicflowColumns" :pagination="{ ...pagination }" :header-cell-style="{
|
||||
background: 'var(--el-fill-color-light)',
|
||||
color: 'var(--el-text-color-primary)'
|
||||
}" @page-current-change="handleCurrentChange" @page-size-change="handleSizeChange">
|
||||
</pure-table>
|
||||
</div>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.content-flex {
|
||||
width: 100%;
|
||||
display: inline-flex;
|
||||
background-color: #f5f5f5;
|
||||
padding: 20px;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
26
src/views/paradise/drawOrlockList/index.vue
Normal file
26
src/views/paradise/drawOrlockList/index.vue
Normal file
@@ -0,0 +1,26 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import statisticsView from './statistics.vue'
|
||||
import lotteryView from './Results.vue'
|
||||
// const props = defineProps(["roomDetail"]);
|
||||
|
||||
// console.log(props.roomDetail.room_id)
|
||||
const activeList = ref([{ index: 0, name: '开奖统计' }, { index: 1, name: '锁定记录' }])
|
||||
const activeIndex = ref(0)
|
||||
const changeIndex = (data) => {
|
||||
activeIndex.value = data.index
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div class="viewPage" style="background-color: #fff;padding: 20px;min-height: 83vh;">
|
||||
<el-row>
|
||||
<el-button @click="changeIndex(ele)" :type="activeIndex === ele.index ? 'primary' : ''" v-for="ele in activeList"
|
||||
:key="ele.index">{{
|
||||
ele.name }}</el-button>
|
||||
</el-row>
|
||||
<div class="mt-5">
|
||||
<statisticsView v-if="activeIndex === 0" />
|
||||
<lotteryView v-else></lotteryView>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
182
src/views/paradise/drawOrlockList/statistics.vue
Normal file
182
src/views/paradise/drawOrlockList/statistics.vue
Normal file
@@ -0,0 +1,182 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, nextTick } from "vue";
|
||||
import SearchForm from "@/components/SearchForm/index.vue";
|
||||
import { message } from "@/utils/message";
|
||||
import {
|
||||
resetBlindBoxRule
|
||||
} from "@/api/modules/blindBox";
|
||||
import {
|
||||
queryTurntableRecord
|
||||
} from "@/api/modules/room";
|
||||
const searchLabel = ref([
|
||||
{ label: "用户ID", prop: "user_id", type: "input" },
|
||||
{ label: "开奖期数", prop: "periods", type: "input" },
|
||||
{ label: "礼物ID", prop: "gift_id", type: "input" },
|
||||
{ label: "房间ID", prop: "room_id", type: "input" }
|
||||
]);
|
||||
const props = defineProps(["roomId"]);
|
||||
const searchForm = ref({
|
||||
gift_bag_id: 13,
|
||||
user_id: '',
|
||||
gift_id: "",
|
||||
gift_name: ""
|
||||
});
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
const statisticsData = ref()
|
||||
const tableList = ref([])
|
||||
const statisticsList = ref([
|
||||
{ label: "总抽奖次数", prop: "total" },
|
||||
{ label: "总抽奖金额(支出)", prop: "total_money" },
|
||||
{
|
||||
label: "总礼物价值(收入)", prop: "total_gift_money"
|
||||
},
|
||||
{ label: "统计(收入/支出)", prop: "ratio", tip: "%" },
|
||||
{ label: "用户盈亏", prop: "profit_loss" },
|
||||
{ label: "用户盈亏比", prop: "profit_loss_ratio", tip: "%" },
|
||||
{ label: "平台盈亏", prop: "platform_profit_loss" },
|
||||
{ label: "平台盈亏比", prop: "platform_profit_loss_ratio", tip: "%" },
|
||||
])
|
||||
const dynamicflowColumns = ref([
|
||||
{
|
||||
label: "ID",
|
||||
prop: "id"
|
||||
},
|
||||
{
|
||||
label: "期数",
|
||||
prop: "periods"
|
||||
},
|
||||
{
|
||||
label: "开奖人ID",
|
||||
prop: "user_name"
|
||||
},
|
||||
{
|
||||
label: "房间名称",
|
||||
prop: "room_name"
|
||||
},
|
||||
{
|
||||
label: "支付价格",
|
||||
prop: "bag_price"
|
||||
},
|
||||
{
|
||||
label: "礼物ID",
|
||||
prop: "gift_id"
|
||||
},
|
||||
{
|
||||
label: "礼物名称",
|
||||
prop: "gift_name"
|
||||
},
|
||||
{
|
||||
label: "礼物价格",
|
||||
prop: "gift_price"
|
||||
},
|
||||
{
|
||||
label: "抽中数量",
|
||||
prop: "gift_num"
|
||||
},
|
||||
{
|
||||
label: "创建时间",
|
||||
prop: "createtime"
|
||||
}
|
||||
])
|
||||
const getData = async (formData) => {
|
||||
searchForm.value = { ...formData }
|
||||
const { data, code } = await queryTurntableRecord({
|
||||
...formData,
|
||||
page: pagination.value.currentPage,
|
||||
page_limit: pagination.value.pageSize,
|
||||
room_id: props.roomId
|
||||
})
|
||||
if (code) {
|
||||
tableList.value = data.lists.map(ele => {
|
||||
return {
|
||||
...ele, ...data.total_data,
|
||||
is_public_screen: data.is_public_screen === 1 ? '显示' : '隐藏',
|
||||
is_public_server: data.is_public_server === 1 ? '显示' : '隐藏',
|
||||
is_world_show: data.is_world_show === 1 ? '显示' : '隐藏',
|
||||
}
|
||||
});
|
||||
statisticsData.value = data.total_data
|
||||
pagination.value.total = data.count;
|
||||
pagination.value.currentPage = data.page;
|
||||
}
|
||||
}
|
||||
const handleSizeChange = (val: number) => {
|
||||
pagination.value.pageSize = val;
|
||||
getData(searchForm.value)
|
||||
};
|
||||
const handleCurrentChange = (val: number) => {
|
||||
pagination.value.currentPage = val;
|
||||
getData(searchForm.value)
|
||||
};
|
||||
const resetSetting = async () => {
|
||||
const { data, code } = await resetBlindBoxRule({
|
||||
gift_bag_id: searchForm.value.gift_bag_id,
|
||||
room_id: props.roomId
|
||||
})
|
||||
if (code) {
|
||||
message(`重置成功`, {
|
||||
type: "success"
|
||||
});
|
||||
getData(searchForm.value)
|
||||
}
|
||||
}
|
||||
onMounted(() => {
|
||||
getData(searchForm.value)
|
||||
// getType()
|
||||
})
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<div class="viewPage">
|
||||
|
||||
<div class="content-flex" v-if="statisticsData">
|
||||
<div class="box" v-for="(ele, index) in statisticsList">
|
||||
<el-statistic :precision="2" decimal-separator="." :value="statisticsData[ele.prop] || 0"
|
||||
:suffix="ele.tip || ''" :title="ele.label"></el-statistic>
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="display: inline-flex;justify-content: space-between;align-items: center;width: 100%;">
|
||||
<SearchForm class="pb-2" :LabelList="searchLabel" :formData="searchForm" @handleSearch="getData" />
|
||||
<el-popconfirm :title="`是否重置当前巡乐会数量吗?`" @confirm="resetSetting">
|
||||
<template #reference>
|
||||
<el-button type="primary" style="margin-bottom: 18px;">
|
||||
重置数量
|
||||
</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</div>
|
||||
<pure-table class="mt-5" ref="tableRef" align-whole="center" showOverflowTooltip table-layout="auto"
|
||||
default-expand-all row-key="id" :adaptiveConfig="{ offsetBottom: 108 }" :data="tableList"
|
||||
:columns="dynamicflowColumns" :pagination="{ ...pagination }" :header-cell-style="{
|
||||
background: 'var(--el-fill-color-light)',
|
||||
color: 'var(--el-text-color-primary)'
|
||||
}" @page-current-change="handleCurrentChange" @page-size-change="handleSizeChange">
|
||||
</pure-table>
|
||||
</div>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.content-flex {
|
||||
width: 100%;
|
||||
display: inline-flex;
|
||||
background-color: #f5f5f5;
|
||||
padding: 20px;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
justify-content: space-between
|
||||
}
|
||||
</style>
|
||||
@@ -21,6 +21,7 @@ export function useData() {
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
currentPage: 1,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
background: true
|
||||
});
|
||||
const searchForm = ref({
|
||||
@@ -72,6 +73,10 @@ export function useData() {
|
||||
label: "每期数量",
|
||||
prop: "quantity"
|
||||
},
|
||||
{
|
||||
label: "未开数量",
|
||||
prop: "remaining_number"
|
||||
},
|
||||
{
|
||||
label: "多少次后可参与开奖",
|
||||
prop: "weight"
|
||||
|
||||
@@ -16,6 +16,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -18,6 +18,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
22
src/views/room/RedEnvelope/form.vue
Normal file
22
src/views/room/RedEnvelope/form.vue
Normal file
@@ -0,0 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
const props = defineProps(["rowData"]);
|
||||
const detailData = ref({ record_lists: [] })
|
||||
console.log(props.rowData)
|
||||
detailData.value = { ...props.rowData }
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<el-table :data="detailData.record_lists" border style="width: 100%">
|
||||
<el-table-column prop="user_code" label="领取用户ID">
|
||||
</el-table-column>
|
||||
<el-table-column prop="nickname" label="领取用户昵称">
|
||||
</el-table-column>
|
||||
<el-table-column prop="createtime_text" label="抢红包时间">
|
||||
</el-table-column>
|
||||
<el-table-column prop="amount" label="获得金额">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
229
src/views/room/RedEnvelope/hook.tsx
Normal file
229
src/views/room/RedEnvelope/hook.tsx
Normal file
@@ -0,0 +1,229 @@
|
||||
import { ref, h, nextTick } from "vue";
|
||||
import editForm from "./form.vue";
|
||||
import { message } from "@/utils/message";
|
||||
import { utils, writeFile } from "xlsx";
|
||||
import {
|
||||
queryRedEnvelopeList,
|
||||
getRedEnvelopeDetail
|
||||
} from "@/api/modules/room";
|
||||
import ExportForm from '@/components/exportDialog/index.vue';
|
||||
import { addDialog } from "@/components/ReDialog";
|
||||
export function useData() {
|
||||
const formRef = ref();
|
||||
const loading = ref(true);
|
||||
const tableList = ref([]);
|
||||
const isShow = ref(false);
|
||||
const searchForm = ref({
|
||||
room_id: "",
|
||||
status: "",
|
||||
stime: "",
|
||||
etime: ""
|
||||
});
|
||||
// //状态:0=未开始,1=进行中,2=已结束,3=已退回',
|
||||
const searchLabel = ref([
|
||||
{ label: "房间ID", prop: "room_id", type: "input" },
|
||||
{
|
||||
label: "红包状态", prop: "status", type: "select",
|
||||
optionList: [
|
||||
{ label: "未开始", value: 0 },
|
||||
{ label: "进行中", value: 1 },
|
||||
{ label: "已结束", value: 2 },
|
||||
{ label: "已退回", value: 3 }
|
||||
]
|
||||
},
|
||||
{ label: "开始时间", prop: "stime", type: "date" },
|
||||
{ label: "结束时间", prop: "etime", type: "date" }
|
||||
]);
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
const tableLabel = ref([
|
||||
{
|
||||
label: "房间ID",
|
||||
prop: "room_id"
|
||||
},
|
||||
{
|
||||
label: "房间名字",
|
||||
prop: "room_name"
|
||||
},
|
||||
{
|
||||
label: "发放人ID",
|
||||
prop: "user_code"
|
||||
},
|
||||
{
|
||||
label: "发放人昵称",
|
||||
prop: "nickname"
|
||||
},
|
||||
{
|
||||
label: "红包类型",
|
||||
prop: "type_text"
|
||||
},
|
||||
{
|
||||
label: "口令",
|
||||
prop: "password"
|
||||
},
|
||||
{
|
||||
label: "多少秒后开抢",
|
||||
prop: "countdown"
|
||||
},
|
||||
{
|
||||
label: "币种",
|
||||
prop: "coin_type_text"
|
||||
},
|
||||
{
|
||||
label: "总金额",
|
||||
prop: "total_amount"
|
||||
},
|
||||
{
|
||||
label: "总数量",
|
||||
prop: "total_count"
|
||||
},
|
||||
{
|
||||
label: "剩余金额",
|
||||
prop: "left_amount"
|
||||
},
|
||||
{
|
||||
label: "剩余数量",
|
||||
prop: "left_count"
|
||||
},
|
||||
{
|
||||
label: "状态",
|
||||
prop: "status_text"
|
||||
},
|
||||
{
|
||||
label: "红包备注",
|
||||
prop: "remark"
|
||||
},
|
||||
{
|
||||
label: "创建时间",
|
||||
prop: "createtime"
|
||||
},
|
||||
{
|
||||
label: "操作",
|
||||
fixed: "right",
|
||||
width: 210,
|
||||
slot: "operation"
|
||||
}
|
||||
]);
|
||||
const onSearch = async (formData) => {
|
||||
loading.value = true;
|
||||
searchForm.value = { ...formData }
|
||||
const { data, code } = await queryRedEnvelopeList({
|
||||
...formData,
|
||||
page: pagination.value.currentPage,
|
||||
page_limit: pagination.value.pageSize
|
||||
});
|
||||
if (code) {
|
||||
tableList.value = data.lists;
|
||||
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 openDialog = async (title = "审核", rowData: any) => {
|
||||
const { code, data } = await getRedEnvelopeDetail({ redpacket_id: rowData.id })
|
||||
if (!code) return
|
||||
nextTick(() => {
|
||||
addDialog({
|
||||
title: `${title}`,
|
||||
props: {
|
||||
rowData: data
|
||||
},
|
||||
width: "40%",
|
||||
hideFooter: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(editForm, { ref: formRef, formInline: null })
|
||||
});
|
||||
})
|
||||
|
||||
};
|
||||
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 queryRedEnvelopeList({
|
||||
stime: formData.search_status_time,
|
||||
etime: formData.search_end_time,
|
||||
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.search_status_time} - ${formData.search_end_time}.xlsx`);
|
||||
message("导出成功", {
|
||||
type: "success"
|
||||
});
|
||||
done()
|
||||
} else {
|
||||
message("获取数据失败,请重试!", {
|
||||
type: "error"
|
||||
});
|
||||
}
|
||||
}
|
||||
FormRef.validate(valid => {
|
||||
if (valid) {
|
||||
if (curData.time && curData.time.length) {
|
||||
exportData({ search_status_time: curData.time[0] || '', search_end_time: curData.time[1] || '' })
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
return {
|
||||
searchForm,
|
||||
searchLabel,
|
||||
onSearch,
|
||||
isShow,
|
||||
tableList,
|
||||
tableLabel,
|
||||
pagination,
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
loading,
|
||||
openDialog,
|
||||
exportExcel
|
||||
};
|
||||
}
|
||||
58
src/views/room/RedEnvelope/index.vue
Normal file
58
src/views/room/RedEnvelope/index.vue
Normal file
@@ -0,0 +1,58 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted } from "vue";
|
||||
import { useData } from "./hook";
|
||||
import SearchForm from "@/components/SearchForm/index.vue";
|
||||
import { PureTableBar } from "@/components/RePureTableBar";
|
||||
import { deviceDetection } from "@pureadmin/utils";
|
||||
const {
|
||||
searchLabel,
|
||||
searchForm,
|
||||
onSearch,
|
||||
isShow,
|
||||
exportExcel,
|
||||
tableList,
|
||||
pagination,
|
||||
tableLabel,
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
loading,
|
||||
openDialog,
|
||||
} = useData();
|
||||
defineOptions({
|
||||
name: "roomSubsidy"
|
||||
});
|
||||
onMounted(() => {
|
||||
onSearch(searchForm.value);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<template>
|
||||
<div class="main">
|
||||
<SearchForm class="pb-2" :LabelList="searchLabel" :formData="searchForm" @handleSearch="onSearch" />
|
||||
<div ref="contentRef" :class="['flex', deviceDetection() ? 'flex-wrap' : '']">
|
||||
<PureTableBar title="房间红包发放" :class="[isShow && !deviceDetection() ? '!w-[60vw]' : 'w-full']"
|
||||
:columns="tableLabel" @refresh="onSearch">
|
||||
<template #buttons>
|
||||
<el-button type="primary" @click="exportExcel">导出</el-button>
|
||||
</template>
|
||||
<template v-slot="{ size, dynamicColumns }">
|
||||
<pure-table ref="tableRef" align-whole="center" showOverflowTooltip table-layout="auto" default-expand-all
|
||||
:loading="loading" :size="size" row-key="id" adaptive :adaptiveConfig="{ offsetBottom: 108 }"
|
||||
:data="tableList" :columns="dynamicColumns" :pagination="{ ...pagination, size }" :header-cell-style="{
|
||||
background: 'var(--el-fill-color-light)',
|
||||
color: 'var(--el-text-color-primary)'
|
||||
}" @page-current-change="handleCurrentChange" @page-size-change="handleSizeChange">
|
||||
|
||||
<template #operation="{ row }">
|
||||
<el-button v-if="row.status !== 0" link type="primary" :size="size" @click="openDialog('查看领取详情', row)">
|
||||
查看领取详情
|
||||
</el-button>
|
||||
</template>
|
||||
</pure-table>
|
||||
</template>
|
||||
</PureTableBar>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped lang="scss"></style>
|
||||
28
src/views/room/expression/TypeList/form.vue
Normal file
28
src/views/room/expression/TypeList/form.vue
Normal file
@@ -0,0 +1,28 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
const ruleFormRef = ref();
|
||||
const formRules = ref({
|
||||
type_name: [{ required: true, message: "请输入分类名称", trigger: "blur" }],
|
||||
});
|
||||
const props = defineProps(["formInline"]);
|
||||
const newFormInline = ref(
|
||||
props.formInline
|
||||
? props.formInline
|
||||
: {
|
||||
id: "",
|
||||
type_name: ""
|
||||
}
|
||||
);
|
||||
function getRef() {
|
||||
return ruleFormRef.value;
|
||||
}
|
||||
defineExpose({ getRef });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-form ref="ruleFormRef" :model="newFormInline" :rules="formRules" label-width="120px">
|
||||
<el-form-item label="分类名称" prop="type_name">
|
||||
<el-input v-model="newFormInline.type_name" clearable placeholder="请输入分类名称" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
156
src/views/room/expression/TypeList/index.vue
Normal file
156
src/views/room/expression/TypeList/index.vue
Normal file
@@ -0,0 +1,156 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, h } from "vue";
|
||||
import editForm from "./form.vue";
|
||||
import { message } from "@/utils/message";
|
||||
import { addDialog } from "@/components/ReDialog";
|
||||
import {
|
||||
queryClassifyList,
|
||||
addClassifyData,
|
||||
editClassifyData,
|
||||
removeClassifyData
|
||||
} from "@/api/modules/expression";
|
||||
const typeList = ref([])
|
||||
const tableList = ref([])
|
||||
const dynamicflowColumns = ref([
|
||||
{
|
||||
label: "ID",
|
||||
prop: "id"
|
||||
},
|
||||
{
|
||||
label: "分类名称",
|
||||
prop: "type_name"
|
||||
},
|
||||
{
|
||||
label: "操作",
|
||||
fixed: "right",
|
||||
width: 210,
|
||||
slot: "operation"
|
||||
}
|
||||
])
|
||||
const getType = async () => {
|
||||
const { code, data } = await queryClassifyList({})
|
||||
typeList.value = code ? data.map(ele => {
|
||||
return {
|
||||
label: ele.name,
|
||||
value: ele.id
|
||||
}
|
||||
}) : []
|
||||
if (code) {
|
||||
tableList.value = data
|
||||
}
|
||||
}
|
||||
const formRef = ref(null)
|
||||
const handleDelete = async (rowData) => {
|
||||
const { code } = await removeClassifyData({ id: rowData.id });
|
||||
if (code) {
|
||||
message(`您删除了表情名称为【${rowData.type_name}】的这条数据`, {
|
||||
type: "success"
|
||||
});
|
||||
getType();
|
||||
}
|
||||
}
|
||||
const addTypeName = (title = "新增", rowData: any) => {
|
||||
addDialog({
|
||||
title: `${title}分类`,
|
||||
props: {
|
||||
formInline: {
|
||||
id: rowData?.id ?? "",
|
||||
type_name: rowData?.type_name ?? "",
|
||||
// status: rowData?.status ?? "",
|
||||
}
|
||||
},
|
||||
width: "40%",
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(editForm, { ref: formRef, formInline: null }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const FormRef = formRef.value.getRef();
|
||||
const curData = options.props.formInline;
|
||||
const saveData = async form => {
|
||||
// console.log(form)
|
||||
const { code, msg } = await addClassifyData(form);
|
||||
if (code) {
|
||||
message("新增成功", { type: "success" });
|
||||
getType();
|
||||
done();
|
||||
} else {
|
||||
message(msg, { type: "error" });
|
||||
}
|
||||
};
|
||||
const updateData = async form => {
|
||||
const { code, msg } = await editClassifyData({
|
||||
...form,
|
||||
id: rowData.id
|
||||
});
|
||||
if (code) {
|
||||
message("修改成功", { type: "success" });
|
||||
getType();
|
||||
done();
|
||||
} else {
|
||||
message(msg, { type: "error" });
|
||||
}
|
||||
};
|
||||
FormRef.validate(valid => {
|
||||
if (valid) {
|
||||
console.log("curData", curData);
|
||||
// 表单规则校验通过
|
||||
if (title === "新增") {
|
||||
// 实际开发先调用新增接口,再进行下面操作
|
||||
saveData(curData);
|
||||
} else {
|
||||
// 实际开发先调用修改接口,再进行下面操作
|
||||
updateData(curData);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
onMounted(() => {
|
||||
getType()
|
||||
})
|
||||
</script>
|
||||
<template>
|
||||
<div class="viewPage" v-if="typeList && typeList.length">
|
||||
<div style="display: inline-flex;justify-content: flex-end;width: 100%;">
|
||||
<el-button type="primary" @click="addTypeName('新增', null)">
|
||||
新增
|
||||
</el-button>
|
||||
</div>
|
||||
<pure-table class="mt-5" ref="tableRef" align-whole="center" showOverflowTooltip table-layout="auto"
|
||||
default-expand-all row-key="id" :adaptiveConfig="{ offsetBottom: 108 }" :data="tableList"
|
||||
:columns="dynamicflowColumns" :header-cell-style="{
|
||||
background: 'var(--el-fill-color-light)',
|
||||
color: 'var(--el-text-color-primary)'
|
||||
}">
|
||||
<template #operation="{ row }">
|
||||
<el-button link type="primary" @click="addTypeName('编辑', row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-popconfirm :title="`是否确认删除表情名称为【${row.type_name}】的这条数据`" @confirm="handleDelete(row)">
|
||||
<template #reference>
|
||||
<el-button link type="primary"> 删除 </el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</pure-table>
|
||||
</div>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.content-flex {
|
||||
width: 100%;
|
||||
display: inline-flex;
|
||||
background-color: #f5f5f5;
|
||||
padding: 20px;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
justify-content: space-between
|
||||
}
|
||||
</style>
|
||||
77
src/views/room/expression/form.vue
Normal file
77
src/views/room/expression/form.vue
Normal file
@@ -0,0 +1,77 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import uploadImage from '@/components/UploadImage/index.vue';
|
||||
import { queryClassifyList } from '@/api/modules/expression'
|
||||
const ruleFormRef = ref();
|
||||
const typeList = ref([])
|
||||
const labelList = ref([])
|
||||
const formRules = ref({
|
||||
type_id: [{ required: true, message: "请选择表情分类", trigger: "change" }],
|
||||
name: [{ required: true, message: "请输入表情名称", trigger: "blur" }],
|
||||
image: [{ required: true, message: "请上传表情图", trigger: "change" }],
|
||||
status: [{ required: true, message: "请选择状态", trigger: "change" }]
|
||||
});
|
||||
const props = defineProps(["formInline"]);
|
||||
const newFormInline = ref(
|
||||
props.formInline
|
||||
? props.formInline
|
||||
: {
|
||||
pid: "",
|
||||
name: "",
|
||||
image: "",
|
||||
animate_image: "",
|
||||
sort: "",
|
||||
type_id: "",
|
||||
status: ""
|
||||
}
|
||||
);
|
||||
function getRef() {
|
||||
return ruleFormRef.value;
|
||||
}
|
||||
function handleFileSuccess(list) {
|
||||
newFormInline.value.animate_image = list.join(',')
|
||||
}
|
||||
function handlePlayFileSuccess(list) {
|
||||
newFormInline.value.image = list.join(',')
|
||||
}
|
||||
const getTypeList = async () => {
|
||||
const { data, code } = await queryClassifyList({})
|
||||
typeList.value = code ? data : []
|
||||
console.log(typeList.value)
|
||||
}
|
||||
onMounted(() => {
|
||||
getTypeList()
|
||||
})
|
||||
defineExpose({ getRef });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-form ref="ruleFormRef" :model="newFormInline" :rules="formRules" label-width="120px">
|
||||
<el-form-item label="上级ID" prop="pid">
|
||||
<el-input v-model="newFormInline.pid" clearable placeholder="请输入上级ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="表情类型" prop="type_id">
|
||||
<el-select v-model="newFormInline.type_id" placeholder="请选择表情类型">
|
||||
<el-option v-for="item in typeList" :key="item.id" :label="item.type_name" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="表情名称" prop="name">
|
||||
<el-input v-model="newFormInline.name" clearable placeholder="请输入表情名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="表情图" prop="image">
|
||||
<uploadImage @handleSuccess="handlePlayFileSuccess" :acceptType="'.jpg,.jpeg,.png,.gif'" :limit="1"
|
||||
:echoUrl="newFormInline.image" />
|
||||
</el-form-item>
|
||||
<el-form-item label="表情动图" prop="animate_image">
|
||||
<uploadImage @handleSuccess="handleFileSuccess" :acceptType="'.jpg,.jpeg,.png,.gif'" :limit="1"
|
||||
:echoUrl="newFormInline.animate_image" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="newFormInline.status">
|
||||
<el-radio :label="1">显示</el-radio>
|
||||
<el-radio :label="2">隐藏</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
199
src/views/room/expression/hook.tsx
Normal file
199
src/views/room/expression/hook.tsx
Normal file
@@ -0,0 +1,199 @@
|
||||
import { ref, h } from "vue";
|
||||
import editForm from "./form.vue";
|
||||
import TypeListView from './TypeList/index.vue';
|
||||
import { message } from "@/utils/message";
|
||||
import {
|
||||
queryList,
|
||||
addData,
|
||||
editData,
|
||||
removeData
|
||||
} from "@/api/modules/expression";
|
||||
import { addDialog } from "@/components/ReDialog";
|
||||
|
||||
export function useData() {
|
||||
const formRef = ref();
|
||||
const loading = ref(true);
|
||||
const tableList = ref([]);
|
||||
const isShow = ref(false);
|
||||
const searchForm = ref({
|
||||
id: "",
|
||||
name: ""
|
||||
});
|
||||
const searchLabel = ref([
|
||||
{ label: "表情ID", prop: "id", type: "input" },
|
||||
{ label: "表情名称", prop: "name", type: "input" }
|
||||
]);
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
const tableLabel = ref([
|
||||
{
|
||||
label: "ID",
|
||||
prop: "id"
|
||||
},
|
||||
{
|
||||
label: "表情名称",
|
||||
prop: "name"
|
||||
},
|
||||
{
|
||||
label: "图片",
|
||||
prop: "image",
|
||||
cellRenderer: ({ row }) => (
|
||||
<el-image
|
||||
fit="cover"
|
||||
preview-teleported={true}
|
||||
src={row.image}
|
||||
preview-src-list={Array.of(row.image)}
|
||||
class="w-[50px] h-[50px] align-middle"
|
||||
/>
|
||||
)
|
||||
},
|
||||
{
|
||||
label: "表情分类",
|
||||
prop: "type_str"
|
||||
},
|
||||
{
|
||||
label: "状态",
|
||||
prop: "status",
|
||||
cellRenderer: ({ row }) => (
|
||||
<el-tag type={row.status === 1 ? 'success' : 'error'}>{row.status_str}</el-tag>
|
||||
)
|
||||
},
|
||||
{
|
||||
label: "修改时间",
|
||||
prop: "createtime"
|
||||
},
|
||||
{
|
||||
label: "创建时间",
|
||||
prop: "createtime"
|
||||
},
|
||||
{
|
||||
label: "操作",
|
||||
fixed: "right",
|
||||
width: 210,
|
||||
slot: "operation"
|
||||
}
|
||||
]);
|
||||
const onSearch = async (formData) => {
|
||||
loading.value = true;
|
||||
searchForm.value = { ...formData }
|
||||
const { data, code } = await queryList({
|
||||
...formData,
|
||||
page: pagination.value.currentPage,
|
||||
page_limit: pagination.value.pageSize
|
||||
});
|
||||
if (code) {
|
||||
tableList.value = data.list;
|
||||
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 handleDelete = async rowData => {
|
||||
const { code } = await removeData({ id: rowData.id });
|
||||
if (code) {
|
||||
message(`您删除了表情名称为【${rowData.name}】的这条数据`, {
|
||||
type: "success"
|
||||
});
|
||||
onSearch(searchForm.value);
|
||||
}
|
||||
};
|
||||
// 新增
|
||||
const openDialog = async (title = "新增", rowData: any) => {
|
||||
addDialog({
|
||||
title: `${title}礼物`,
|
||||
props: {
|
||||
formInline: {
|
||||
pid: rowData?.pid ?? "",
|
||||
name: rowData?.name ?? "",
|
||||
image: rowData?.image ?? "",
|
||||
animate_image: rowData?.animate_image ?? "",
|
||||
sort: rowData?.sort ?? "",
|
||||
type_id: rowData?.type_id ?? "",
|
||||
status: rowData?.status ?? ""
|
||||
}
|
||||
},
|
||||
width: "40%",
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(editForm, { ref: formRef, formInline: null }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const FormRef = formRef.value.getRef();
|
||||
const curData = options.props.formInline;
|
||||
const saveData = async form => {
|
||||
console.log(form)
|
||||
const { code, msg } = await addData(form);
|
||||
if (code) {
|
||||
message("新增成功", { type: "success" });
|
||||
onSearch(searchForm.value);
|
||||
done();
|
||||
} else {
|
||||
message(msg, { type: "error" });
|
||||
}
|
||||
};
|
||||
const updateData = async form => {
|
||||
const { code, msg } = await editData({
|
||||
...form,
|
||||
id: rowData.id
|
||||
});
|
||||
if (code) {
|
||||
message("修改成功", { type: "success" });
|
||||
onSearch(searchForm.value);
|
||||
done();
|
||||
} else {
|
||||
message(msg, { type: "error" });
|
||||
}
|
||||
};
|
||||
FormRef.validate(valid => {
|
||||
if (valid) {
|
||||
console.log("curData", curData);
|
||||
// 表单规则校验通过
|
||||
if (title === "新增") {
|
||||
// 实际开发先调用新增接口,再进行下面操作
|
||||
saveData(curData);
|
||||
} else {
|
||||
// 实际开发先调用修改接口,再进行下面操作
|
||||
updateData(curData);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
// 查看表情分类
|
||||
const openTypeDialog = () => {
|
||||
addDialog({
|
||||
title: `表情包分类列表`,
|
||||
width: "60%",
|
||||
closeOnClickModal: false,
|
||||
hideFooter: true,
|
||||
contentRenderer: () => h(TypeListView)
|
||||
});
|
||||
}
|
||||
return {
|
||||
searchForm,
|
||||
searchLabel,
|
||||
onSearch,
|
||||
isShow,
|
||||
tableList,
|
||||
tableLabel,
|
||||
pagination,
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
loading,
|
||||
handleDelete,
|
||||
openDialog,
|
||||
openTypeDialog
|
||||
};
|
||||
}
|
||||
68
src/views/room/expression/index.vue
Normal file
68
src/views/room/expression/index.vue
Normal file
@@ -0,0 +1,68 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted } from "vue";
|
||||
import { useData } from "./hook";
|
||||
import SearchForm from "@/components/SearchForm/index.vue";
|
||||
import { PureTableBar } from "@/components/RePureTableBar";
|
||||
import { deviceDetection } from "@pureadmin/utils";
|
||||
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
||||
import AddFill from "@iconify-icons/ri/add-circle-line";
|
||||
const {
|
||||
searchLabel,
|
||||
searchForm,
|
||||
onSearch,
|
||||
isShow,
|
||||
tableList,
|
||||
pagination,
|
||||
tableLabel,
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
loading,
|
||||
handleDelete,
|
||||
openTypeDialog,
|
||||
openDialog
|
||||
} = useData();
|
||||
defineOptions({
|
||||
name: "giftList"
|
||||
});
|
||||
onMounted(() => {
|
||||
onSearch(searchForm.value);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<template>
|
||||
<div class="main">
|
||||
<SearchForm class="pb-2" :LabelList="searchLabel" :formData="searchForm" @handleSearch="onSearch" />
|
||||
<div ref="contentRef" :class="['flex', deviceDetection() ? 'flex-wrap' : '']">
|
||||
<PureTableBar title="表情包列表" :class="[isShow && !deviceDetection() ? '!w-[60vw]' : 'w-full']" :columns="tableLabel"
|
||||
@refresh="onSearch">
|
||||
<template #buttons>
|
||||
<el-button type="text" @click="openTypeDialog">表情分类列表</el-button>
|
||||
<el-button type="primary" :icon="useRenderIcon(AddFill)" @click="openDialog('新增', {})">
|
||||
新增表情包
|
||||
</el-button>
|
||||
</template>
|
||||
<template v-slot="{ size, dynamicColumns }">
|
||||
<pure-table ref="tableRef" align-whole="center" showOverflowTooltip table-layout="auto" default-expand-all
|
||||
:loading="loading" :size="size" row-key="id" adaptive :adaptiveConfig="{ offsetBottom: 108 }"
|
||||
:data="tableList" :columns="dynamicColumns" :pagination="{ ...pagination, size }" :header-cell-style="{
|
||||
background: 'var(--el-fill-color-light)',
|
||||
color: 'var(--el-text-color-primary)'
|
||||
}" @page-current-change="handleCurrentChange" @page-size-change="handleSizeChange">
|
||||
<template #operation="{ row }">
|
||||
<el-button link type="primary" :size="size" @click="openDialog('编辑', row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-popconfirm :title="`是否确认删除表情名称为【${row.name}】的这条数据`" @confirm="handleDelete(row)">
|
||||
<template #reference>
|
||||
<el-button link type="primary" :size="size"> 删除 </el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</pure-table>
|
||||
</template>
|
||||
</PureTableBar>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped lang="scss"></style>
|
||||
198
src/views/room/hourlyChart/hook.tsx
Normal file
198
src/views/room/hourlyChart/hook.tsx
Normal file
@@ -0,0 +1,198 @@
|
||||
import { ref, h, nextTick } from "vue";
|
||||
import { utils, writeFile } from "xlsx";
|
||||
import { message } from "@/utils/message";
|
||||
import ExportForm from '@/components/exportDialog/index.vue';
|
||||
import ruleView from './ruleform.vue';
|
||||
import { queryList, settingRuleApi, getRuleSetting, settingRuleTable } from '@/api/modules/hourlyChart';
|
||||
import { addDialog } from "@/components/ReDialog";
|
||||
export function useData() {
|
||||
const formRef = ref();
|
||||
const loading = ref(true);
|
||||
const tableList = ref([]);
|
||||
const isShow = ref(false);
|
||||
const searchForm = ref({
|
||||
search_ranking: "",
|
||||
search_stime: "",
|
||||
search_etime: ""
|
||||
});
|
||||
const searchLabel = ref([
|
||||
{ label: "排名", prop: "search_ranking", type: "input" },
|
||||
{ label: "开始时间", prop: "search_stime", type: "date" },
|
||||
{ label: "结束时间", prop: "search_etime", type: "date" },
|
||||
]);
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
const tableLabel = ref([
|
||||
{
|
||||
label: "排名",
|
||||
prop: "ranking"
|
||||
},
|
||||
{
|
||||
label: "房间ID",
|
||||
prop: "room_id"
|
||||
},
|
||||
{
|
||||
label: "房间名称",
|
||||
prop: "room_name"
|
||||
},
|
||||
{
|
||||
label: "房主名称",
|
||||
prop: "nickname"
|
||||
},
|
||||
{
|
||||
label: "锁定流水总值",
|
||||
prop: "flowing_water"
|
||||
},
|
||||
{
|
||||
label: "全服播报",
|
||||
prop: "is_public_server",
|
||||
cellRenderer: ({ row }) => (
|
||||
<el-tag type={row.is_public_server === 1 ? 'success' : 'error'}>{row.is_public_server === 1 ? '显示' : '隐藏'}</el-tag>
|
||||
)
|
||||
},
|
||||
{
|
||||
label: "本期开始时间",
|
||||
prop: "stime",
|
||||
width: 300,
|
||||
cellRenderer: ({ row }) => (
|
||||
<span>{row.stime} - {row.etime}</span>
|
||||
)
|
||||
}
|
||||
]);
|
||||
const onSearch = async (formData) => {
|
||||
loading.value = true;
|
||||
searchForm.value = { ...formData }
|
||||
const { data, code } = await queryList({
|
||||
...formData,
|
||||
page: pagination.value.currentPage,
|
||||
page_limit: pagination.value.pageSize
|
||||
});
|
||||
if (code) {
|
||||
tableList.value = data.lists;
|
||||
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 settingRule = async () => {
|
||||
const ruleInfo = await getRuleSetting()
|
||||
const ruleTable = await settingRuleTable()
|
||||
console.log(ruleTable)
|
||||
nextTick(() => {
|
||||
addDialog({
|
||||
title: `设置规则`,
|
||||
props: {
|
||||
ruleInfo: {
|
||||
...ruleInfo.data,
|
||||
},
|
||||
ruleJson: ruleTable.data
|
||||
},
|
||||
fullscreen: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(ruleView, { ref: formRef, formInline: null }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const formData = formRef.value.confrimData();
|
||||
const SaveSetting = async (form) => {
|
||||
const { code } = await settingRuleApi({ ...form });
|
||||
if (code) {
|
||||
message("设置成功", { type: "success" });
|
||||
done();
|
||||
} else {
|
||||
message("设置失败", { type: "error" });
|
||||
}
|
||||
};
|
||||
SaveSetting(formData)
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
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({
|
||||
search_stime: formData.begin_time,
|
||||
search_etime: formData.end_time,
|
||||
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,
|
||||
exportExcel,
|
||||
settingRule
|
||||
};
|
||||
}
|
||||
57
src/views/room/hourlyChart/index.vue
Normal file
57
src/views/room/hourlyChart/index.vue
Normal file
@@ -0,0 +1,57 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted } from "vue";
|
||||
import { useData } from "./hook";
|
||||
import SearchForm from "@/components/SearchForm/index.vue";
|
||||
import { PureTableBar } from "@/components/RePureTableBar";
|
||||
import { deviceDetection } from "@pureadmin/utils";
|
||||
const {
|
||||
searchLabel,
|
||||
searchForm,
|
||||
onSearch,
|
||||
isShow,
|
||||
tableList,
|
||||
pagination,
|
||||
tableLabel,
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
loading,
|
||||
exportExcel,
|
||||
settingRule
|
||||
} = useData();
|
||||
defineOptions({
|
||||
name: "hourlyChart"
|
||||
});
|
||||
onMounted(() => {
|
||||
onSearch(searchForm.value);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<template>
|
||||
<div class="main">
|
||||
<SearchForm class="pb-2" :LabelList="searchLabel" :formData="searchForm" @handleSearch="onSearch" />
|
||||
<div ref="contentRef" :class="['flex', deviceDetection() ? 'flex-wrap' : '']">
|
||||
<PureTableBar title="小时榜数据列表" :class="[isShow && !deviceDetection() ? '!w-[60vw]' : 'w-full']"
|
||||
:columns="tableLabel" @refresh="onSearch">
|
||||
<template #buttons>
|
||||
<el-button type="primary" @click="exportExcel">
|
||||
导出
|
||||
</el-button>
|
||||
<el-button @click="settingRule">
|
||||
设置规则
|
||||
</el-button>
|
||||
</template>
|
||||
<template v-slot="{ size, dynamicColumns }">
|
||||
<pure-table ref="tableRef" align-whole="center" showOverflowTooltip table-layout="auto" default-expand-all
|
||||
:loading="loading" :size="size" row-key="id" adaptive :adaptiveConfig="{ offsetBottom: 108 }"
|
||||
:data="tableList" :columns="dynamicColumns" :pagination="{ ...pagination, size }" :header-cell-style="{
|
||||
background: 'var(--el-fill-color-light)',
|
||||
color: 'var(--el-text-color-primary)'
|
||||
}" @page-current-change="handleCurrentChange" @page-size-change="handleSizeChange">
|
||||
</pure-table>
|
||||
</template>
|
||||
</PureTableBar>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped lang="scss"></style>
|
||||
151
src/views/room/hourlyChart/reward.vue
Normal file
151
src/views/room/hourlyChart/reward.vue
Normal file
@@ -0,0 +1,151 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import { queryGiftByTypeList } from '@/api/modules/blindBox';
|
||||
import { queryAdornmentList } from '@/api/modules/activities'
|
||||
const ruleFormRef = ref();
|
||||
const formRules = ref({
|
||||
coin: [{ required: true, message: "请输入金币数量", trigger: "blur" }],
|
||||
inlet_bag_id: [{ required: true, message: "请选择礼物", trigger: "change" }],
|
||||
avatar_id: [{ required: true, message: "请选择头像框", trigger: "change" }],
|
||||
mount_id: [{ required: true, message: "请选择坐骑", trigger: "change" }],
|
||||
});
|
||||
const saveGiftForm = ref({})
|
||||
const props = defineProps(["formInline"]);
|
||||
const checkList = ref([])
|
||||
const newFormInline = ref(
|
||||
props.formInline
|
||||
? props.formInline
|
||||
: {
|
||||
}
|
||||
);
|
||||
const newFormData = ref({
|
||||
coin: 0,
|
||||
inlet_bag_id: '',
|
||||
avatar_id: '',
|
||||
mount_id: ''
|
||||
})
|
||||
|
||||
function getRef() {
|
||||
return ruleFormRef.value;
|
||||
}
|
||||
const handleChange = (ele) => {
|
||||
const type = newFormInline.value.content.map(s => { return s.type })
|
||||
if (type.includes(0)) {
|
||||
newFormInline.value.content.forEach((item, index) => {
|
||||
newFormInline.value.content[index].value = ele
|
||||
})
|
||||
} else {
|
||||
newFormInline.value.content.push({ type: 0, value: ele })
|
||||
}
|
||||
}
|
||||
// 礼物
|
||||
const giftList = ref([])
|
||||
const getList = async () => {
|
||||
const { data, code } = await queryGiftByTypeList({ type: 3 })
|
||||
giftList.value = code ? data : []
|
||||
}
|
||||
// 道具
|
||||
const AdornmentList = ref([])
|
||||
const getAdornmentList = async () => {
|
||||
const { data, code } = await queryAdornmentList()
|
||||
AdornmentList.value = code ? data : []
|
||||
}
|
||||
// 选择礼物
|
||||
const changeGife = (ele, typeProps) => {
|
||||
if (ele) {
|
||||
const valueProp = ele.split('_')
|
||||
const valueId = valueProp[0] || 0
|
||||
const valueName = valueProp[1] || ''
|
||||
const type = newFormInline.value.content.map(s => { return s.type })
|
||||
if (type.includes(typeProps)) {
|
||||
newFormInline.value.content.forEach((item, index) => {
|
||||
newFormInline.value.content[index].value = valueId
|
||||
})
|
||||
} else {
|
||||
newFormInline.value.content.push({ type: typeProps, value: valueId, name: valueName })
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
const getContent = () => {
|
||||
saveGiftForm.value = {
|
||||
index: newFormInline.value.index,
|
||||
content: newFormInline.value.content
|
||||
}
|
||||
return saveGiftForm.value;
|
||||
|
||||
}
|
||||
const chengeCheckValue = (ele) => {
|
||||
// const checkList = ele.map(v => { return +v })
|
||||
// newFormInline.value.content.forEach((ele, eleIndex) => {
|
||||
// if (checkList.includes(ele.type)) {
|
||||
// newFormInline.value.content.splice(eleIndex, 1)
|
||||
// }
|
||||
// })
|
||||
}
|
||||
onMounted(() => {
|
||||
getList()
|
||||
getAdornmentList()
|
||||
if (props.formInline) {
|
||||
if (props.formInline.content.length) {
|
||||
let list = [...props.formInline.content]
|
||||
list.forEach(child => {
|
||||
checkList.value.push(child.type)
|
||||
if (child.type === 0) newFormData.value.coin = child.value
|
||||
if (child.type === 1) newFormData.value.inlet_bag_id = `${+child.value}_${child.name}`
|
||||
if (child.type === 2) newFormData.value.avatar_id = `${+child.value}_${child.name}`
|
||||
if (child.type === 3) newFormData.value.mount_id = `${+child.value}_${child.name}`
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
defineExpose({ getRef, getContent });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-form ref="ruleFormRef" :model="newFormData" :rules="formRules" label-width="120px">
|
||||
<el-form-item label="选择类型" prop="version">
|
||||
<el-checkbox-group v-model="checkList" @change="chengeCheckValue">
|
||||
<el-checkbox :value="0">金币</el-checkbox>
|
||||
<el-checkbox :value="1">礼物</el-checkbox>
|
||||
<el-checkbox :value="2">头像框</el-checkbox>
|
||||
<el-checkbox :value="3">坐骑</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<template v-if="checkList.includes(0)">
|
||||
<el-form-item label="输入金币数量" prop="coin">
|
||||
<el-input-number v-model="newFormData.coin" @change="handleChange"></el-input-number>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-if="checkList.includes(1)">
|
||||
<el-form-item label="选择奖励礼物" prop="inlet_bag_id">
|
||||
<el-select v-model="newFormData.inlet_bag_id" placeholder="请选择礼物" @change="(ele) => changeGife(ele, 1)">
|
||||
<el-option v-for="item in giftList" :key="item.gid" :label="item.gift_name"
|
||||
:value="`${item.gid}_${item.gift_name}`">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
</template>
|
||||
<template v-if="checkList.includes(2)">
|
||||
<el-form-item label="选择奖励头像框" prop="avatar_id">
|
||||
<el-select v-model="newFormData.avatar_id" placeholder="请选择头像框" @change="(ele) => changeGife(ele, 2)">
|
||||
<el-option v-for="item in AdornmentList" :key="item.id" :label="item.name" :value="`${item.id}_${item.name}`">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
</template>
|
||||
<template v-if="checkList.includes(3)">
|
||||
<el-form-item label="选择奖励坐骑" prop="mount_id">
|
||||
<el-select v-model="newFormData.mount_id" placeholder="请选择坐骑" @change="(ele) => changeGife(ele, 3)">
|
||||
<el-option v-for="item in AdornmentList" :key="item.id
|
||||
" :label="item.name" :value="`${item.id}_${item.name}`
|
||||
">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
</template>
|
||||
</el-form>
|
||||
</template>
|
||||
289
src/views/room/hourlyChart/ruleform.vue
Normal file
289
src/views/room/hourlyChart/ruleform.vue
Normal file
@@ -0,0 +1,289 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, h } from "vue";
|
||||
import { addDialog } from "@/components/ReDialog";
|
||||
import { queryTimeList } from '@/api/modules/hourlyChart';
|
||||
import rewardView from './reward.vue';
|
||||
const ruleFormRef = ref();
|
||||
// const formRules = ref({
|
||||
// admin_id: [{ required: true }], room_id: [{ required: true }],
|
||||
// room_name: [{ required: true, message: '请输入房间名称', trigger: 'blur' }],
|
||||
// room_intro: [{ required: true, message: '请输入房间公告', trigger: 'blur' }],
|
||||
// room_cover: [{ required: true, message: '请上传房间封面', trigger: 'blur' }],
|
||||
// room_background_id: [{ required: true, message: '请选择房间背景', trigger: 'change' }],
|
||||
// type_id: [{ required: true, message: '请选择房间分类', trigger: 'change' }],
|
||||
// is_earnings: [{ required: true, message: '请选择', trigger: 'change' }],
|
||||
// is_top: [{ required: true, message: '请选择', trigger: 'change' }],
|
||||
// is_hot: [{ required: true, message: '请选择', trigger: 'change' }],
|
||||
// is_recommend: [{ required: true, message: '请选择', trigger: 'change' }],
|
||||
// is_room_password: [{ required: true, message: '请选择', trigger: 'change' }],
|
||||
// room_password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
|
||||
// room_status: [{ required: true, message: '请选择', trigger: 'change' }],
|
||||
// is_show_room: [{ required: true, message: '请选择', trigger: 'change' }],
|
||||
// is_robot_num: [{ required: true, message: '请选择', trigger: 'change' }],
|
||||
// robot_num: [{ required: true, message: '请输入机器人数量', trigger: 'blur' }]
|
||||
// });
|
||||
const props = defineProps(["formInline", "ruleInfo", 'ruleJson']);
|
||||
const newFormInline = ref(
|
||||
props.formInline
|
||||
? props.ruleInfo
|
||||
: {
|
||||
|
||||
}
|
||||
);
|
||||
function getRef() {
|
||||
return ruleFormRef.value;
|
||||
}
|
||||
const getRuleInfo = async () => {
|
||||
}
|
||||
const dataList = ref([])
|
||||
const options = ref([])
|
||||
const TimeOptions = ref([])
|
||||
const confrimData = () => {
|
||||
const list = dataList.value.map(ele => {
|
||||
return {
|
||||
time: ele.time,
|
||||
reward: ele.reward
|
||||
|
||||
}
|
||||
})
|
||||
const formData = {
|
||||
is_open_red_pack: newFormInline.value.is_open_red_pack,
|
||||
is_public_server: newFormInline.value.is_public_server,
|
||||
broadcast_times: newFormInline.value.broadcast_timesType === 25 ? 25 : newFormInline.value.broadcast_times.length ? newFormInline.value.broadcast_times.join(',') : '',
|
||||
is_open_xlh: newFormInline.value.is_open_xlh,
|
||||
min_price: newFormInline.value.min_price,
|
||||
open_time: newFormInline.value.open_timeType === 1 ? `${newFormInline.value.time_date} ${newFormInline.value.time_hour}` : 0,
|
||||
id: newFormInline.value.id,
|
||||
timeJson: JSON.stringify(list),
|
||||
}
|
||||
console.log(formData, '提交的')
|
||||
return formData
|
||||
}
|
||||
const formRef = ref({})
|
||||
// 选择奖励弹窗
|
||||
const settingReward = (time, content) => {
|
||||
addDialog({
|
||||
title: `选择奖励`,
|
||||
props: {
|
||||
formInline: content
|
||||
},
|
||||
width: "40%",
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(rewardView, { ref: formRef, formInline: null }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const FormRef = formRef.value.getRef();
|
||||
const curData = formRef.value.getContent();
|
||||
FormRef.validate(valid => {
|
||||
if (valid) {
|
||||
content = curData
|
||||
done();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
// 获取后台时间段配置
|
||||
const getTimeInfo = async () => {
|
||||
TimeOptions.value = []
|
||||
for (let i = 0; i <= 24; i++) {
|
||||
TimeOptions.value.push(`${i < 10 ? `0${i}` : i}:00`)
|
||||
}
|
||||
const { data, code } = await queryTimeList()
|
||||
if (code) {
|
||||
Object.keys(data).forEach(ele => {
|
||||
options.value.push({
|
||||
id: +ele,
|
||||
value: data[ele]
|
||||
})
|
||||
})
|
||||
}
|
||||
// 构建表格
|
||||
buildTable()
|
||||
}
|
||||
// 构建所有表格的时间段
|
||||
const buildTable = () => {
|
||||
dataList.value = []
|
||||
if (props.ruleJson) {
|
||||
props.ruleJson.forEach(ele => {
|
||||
const list = ele.reward.map(v => {
|
||||
return { ...v, name: `第${v.index + 1}名` }
|
||||
})
|
||||
dataList.value.push({ time: ele.time, reward: list })
|
||||
})
|
||||
|
||||
} else {
|
||||
options.value.forEach(t => {
|
||||
let reward = []
|
||||
for (let i = 0; i < 20; i++) {
|
||||
const item = {
|
||||
index: i,
|
||||
name: `第${i + 1}名`,
|
||||
content: []
|
||||
}
|
||||
reward.push(item)
|
||||
}
|
||||
dataList.value.push({ time: t.value, reward: reward })
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
const handleClose = (list, data, dataIndex) => {
|
||||
list.splice(dataIndex, 1)
|
||||
}
|
||||
if (props.ruleInfo) {
|
||||
newFormInline.value = {
|
||||
is_open_red_pack: props.ruleInfo.is_open_red_pack,
|
||||
is_public_server: props.ruleInfo.is_public_server,
|
||||
broadcast_times: props.ruleInfo,
|
||||
is_open_xlh: props.ruleInfo.is_open_xlh,
|
||||
min_price: props.ruleInfo.min_price,
|
||||
open_time: props.ruleInfo.open_time,
|
||||
id: props.ruleInfo.id,
|
||||
}
|
||||
// 回显时间飘屏
|
||||
newFormInline.value.broadcast_timesType = props.ruleInfo.broadcast_times == '25' ? 25 : 2
|
||||
if (newFormInline.value.broadcast_timesType === 2) {
|
||||
if (props.ruleInfo.broadcast_times) {
|
||||
newFormInline.value.broadcast_times = props.ruleInfo.broadcast_times.split(',').map(v => { return +v })
|
||||
console.log()
|
||||
} else {
|
||||
newFormInline.value.broadcast_times = []
|
||||
}
|
||||
}
|
||||
// 回显小时榜开启时间
|
||||
newFormInline.value.open_timeType = props.ruleInfo.open_time == 0 ? 0 : 1
|
||||
if (newFormInline.value.open_timeType) {
|
||||
const date = props.ruleInfo.open_time.split(' ')
|
||||
console.log(date)
|
||||
if (date) {
|
||||
newFormInline.value.time_date = date[0]
|
||||
newFormInline.value.time_hour = date[1]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getRuleInfo()
|
||||
getTimeInfo()
|
||||
})
|
||||
defineExpose({ getRef, confrimData });
|
||||
</script>
|
||||
<template>
|
||||
<div>
|
||||
<el-form ref="ruleFormRef" :model="newFormInline" label-width="200px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="小时榜结果是否飘屏" prop="is_public_server">
|
||||
<el-switch v-model="newFormInline.is_public_server" :active-value="1" :inactive-value="2"
|
||||
active-color="#13ce66" inactive-color="#ff4949">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="什么时段飘屏" prop="room_intro" v-if="newFormInline.is_public_server === 1">
|
||||
<el-radio-group v-model="newFormInline.broadcast_timesType">
|
||||
<el-radio :label="25">全时段</el-radio>
|
||||
<el-radio :label="2">自定义</el-radio>
|
||||
</el-radio-group>
|
||||
<template v-if="newFormInline.broadcast_timesType === 2">
|
||||
<el-select class="mt-5" v-model="newFormInline.broadcast_times" multiple placeholder="请选择">
|
||||
<el-option v-for="item in options" :key="item.id" :label="item.value" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="小时榜是否开启" prop="open_time">
|
||||
<el-switch v-model="newFormInline.open_timeType" :active-value="1" :inactive-value="0"
|
||||
active-color="#13ce66" inactive-color="#ff4949">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="newFormInline.open_timeType === 1">
|
||||
<el-form-item label="小时榜开启时间" prop="room_intro">
|
||||
<div style="display: inline-flex;">
|
||||
<div>
|
||||
<el-date-picker v-model="newFormInline.time_date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
|
||||
type="date" placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
<div style="width: 100px;margin-left: 10px;">
|
||||
<el-select v-model="newFormInline.time_hour" placeholder="请选择时间点">
|
||||
<el-option v-for="item in TimeOptions" :key="item" :label="item" :value="item">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否显示巡乐会入口" prop="is_open_xlh">
|
||||
<el-switch v-model="newFormInline.is_open_xlh" :active-value="1" :inactive-value="0" active-color="#13ce66"
|
||||
inactive-color="#ff4949">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否显示房间红包入口" prop="is_open_red_pack">
|
||||
<el-switch v-model="newFormInline.is_open_red_pack" :active-value="1" :inactive-value="0"
|
||||
active-color="#13ce66" inactive-color="#ff4949">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="获奖励最少流水" prop="min_price">
|
||||
<el-input-number v-model="newFormInline.min_price"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="核心表格配置" prop="room_intro">
|
||||
<div style="width: 80vw;overflow: auto;height: 500px;border: 1px solid gray; padding: 20px;margin-top: 10px;">
|
||||
<div v-for="ele in dataList" :key="ele" style="width: 100%;">
|
||||
<div style="font-weight: bolder;">{{ ele.time }}</div>
|
||||
<div style="width:100%;display: inline-flex;margin-top: 20px;">
|
||||
<div v-for="item in ele.reward"
|
||||
style="min-width: 200px;cursor: pointer;border-bottom: 1px solid gray;padding-bottom: 20px;margin-bottom: 20px;width: 100%;"
|
||||
@click="settingReward(ele, item)">
|
||||
<div>{{ item.name }}</div>
|
||||
<div v-if="item.content.length === 0">
|
||||
<el-button type="text">+ 添加奖励</el-button>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div v-for="(child, childIndex) in item.content">
|
||||
<el-tag v-if="child.type === 0" closable @close="handleClose(item.content, child, childIndex)">{{
|
||||
`金币 X
|
||||
${child.value || child.coin}`
|
||||
}}</el-tag>
|
||||
<el-tag v-if="child.type === 1" closable type="success"
|
||||
@close="handleClose(item.content, child, childIndex)">{{ `礼物:
|
||||
${child.name}`
|
||||
}}</el-tag>
|
||||
<el-tag v-if="child.type === 2" closable type="info"
|
||||
@close="handleClose(item.content, child, childIndex)">{{ `${child.name}`
|
||||
}}</el-tag>
|
||||
<el-tag v-if="child.type === 3" closable type="warning"
|
||||
@close="handleClose(item.content, child, childIndex)">{{ `${child.name}`
|
||||
}}</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
@@ -6,6 +6,8 @@ import {
|
||||
queryMovieRoom,
|
||||
banMovieRoom
|
||||
} from "@/api/modules/room";
|
||||
import { utils, writeFile } from "xlsx";
|
||||
import ExportForm from '@/components/exportDialog/index.vue';
|
||||
export function useData() {
|
||||
const loading = ref(true);
|
||||
const tableList = ref([]);
|
||||
@@ -13,7 +15,9 @@ export function useData() {
|
||||
const searchForm = ref({
|
||||
search_room_number: "",
|
||||
search_onwer_number: "",
|
||||
room_status: ""
|
||||
room_status: "",
|
||||
start_time: "",
|
||||
end_time: ""
|
||||
});
|
||||
const searchLabel = ref([
|
||||
{ label: "房间号", prop: "search_room_number", type: "input" },
|
||||
@@ -25,12 +29,15 @@ export function useData() {
|
||||
{ label: "封禁", value: 2 },
|
||||
{ label: "关闭", value: 3 }
|
||||
]
|
||||
}
|
||||
},
|
||||
{ label: "开始时间", prop: "start_time", type: "date" },
|
||||
{ label: "结束时间", prop: "end_time", type: "date" },
|
||||
|
||||
]);
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
@@ -47,6 +54,14 @@ export function useData() {
|
||||
label: "房主昵称",
|
||||
prop: "user_nickname"
|
||||
},
|
||||
{
|
||||
label: "观众ID",
|
||||
prop: "cp_user_id"
|
||||
},
|
||||
{
|
||||
label: "观众昵称",
|
||||
prop: "cp_nickname"
|
||||
},
|
||||
{
|
||||
label: "房间名称",
|
||||
prop: "room_name"
|
||||
@@ -76,7 +91,10 @@ export function useData() {
|
||||
label: "状态",
|
||||
prop: "room_status_str",
|
||||
},
|
||||
|
||||
{
|
||||
label: "房间总流水",
|
||||
prop: "liushui"
|
||||
},
|
||||
{
|
||||
label: "创建时间",
|
||||
prop: "createtime"
|
||||
@@ -134,6 +152,67 @@ 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 queryMovieRoom({
|
||||
...formData,
|
||||
page: 1,
|
||||
page_limit: 200000
|
||||
});
|
||||
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, `CP电影房统计${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] || '' })
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
return {
|
||||
searchForm,
|
||||
searchLabel,
|
||||
@@ -146,6 +225,7 @@ export function useData() {
|
||||
handleCurrentChange,
|
||||
loading,
|
||||
joinMovieRoom,
|
||||
handleBan
|
||||
handleBan,
|
||||
exportExcel
|
||||
};
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ const {
|
||||
tableList,
|
||||
pagination,
|
||||
tableLabel,
|
||||
exportExcel,
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
handleBan,
|
||||
@@ -33,6 +34,12 @@ onMounted(() => {
|
||||
<div ref="contentRef" :class="['flex', deviceDetection() ? 'flex-wrap' : '']">
|
||||
<PureTableBar title="Cp电影房列表" :class="[isShow && !deviceDetection() ? '!w-[60vw]' : 'w-full']"
|
||||
:columns="tableLabel" @refresh="onSearch">
|
||||
<template #buttons>
|
||||
<!-- <div style="display: inline-flex;align-items: center;" class="mr-10">总计:{{ total_price }}</div> -->
|
||||
<el-button type="primary" @click="exportExcel">
|
||||
导出
|
||||
</el-button>
|
||||
</template>
|
||||
<template v-slot="{ size, dynamicColumns }">
|
||||
<pure-table ref="tableRef" align-whole="center" showOverflowTooltip table-layout="auto" default-expand-all
|
||||
:loading="loading" :size="size" row-key="id" adaptive :adaptiveConfig="{ offsetBottom: 108 }"
|
||||
|
||||
@@ -21,6 +21,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -32,6 +32,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
@@ -145,8 +146,8 @@ export function useData() {
|
||||
};
|
||||
FormRef.validate(valid => {
|
||||
if (valid) {
|
||||
console.log("curData", curData);
|
||||
delete curData.remark
|
||||
// console.log("curData", curData);
|
||||
// delete curData.remark
|
||||
// 表单规则校验通过
|
||||
if (title === "审核") {
|
||||
saveData(curData);
|
||||
|
||||
@@ -25,6 +25,7 @@ export function useData() {
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
|
||||
@@ -13,14 +13,14 @@ const changeIndex = (data) => {
|
||||
</script>
|
||||
<template>
|
||||
<div class="viewPage">
|
||||
<el-row>
|
||||
<!-- <el-row>
|
||||
<el-button @click="changeIndex(ele)" :type="activeIndex === ele.index ? 'primary' : ''" v-for="ele in activeList"
|
||||
:key="ele.index">{{
|
||||
ele.name }}</el-button>
|
||||
</el-row>
|
||||
</el-row> -->
|
||||
<div>
|
||||
<statisticsView v-if="activeIndex === 0" :roomId="props.roomDetail.room_id" />
|
||||
<lotteryView v-else :roomId="props.roomDetail.room_id"></lotteryView>
|
||||
<!-- <lotteryView v-else :roomId="props.roomDetail.room_id"></lotteryView> -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -66,6 +66,10 @@ const dynamicflowColumns = ref([
|
||||
label: "开奖人ID",
|
||||
prop: "user_name"
|
||||
},
|
||||
{
|
||||
label: "房间名称",
|
||||
prop: "room_name"
|
||||
},
|
||||
{
|
||||
label: "支付价格",
|
||||
prop: "bag_price"
|
||||
|
||||
@@ -36,8 +36,10 @@ const statisticsList = ref([
|
||||
label: "总礼物价值(收入)", prop: "total_gift_money"
|
||||
},
|
||||
{ label: "统计(收入/支出)", prop: "ratio", tip: "%" },
|
||||
{ label: "盈亏(收入-支出)", prop: "profit_loss" },
|
||||
{ label: "盈亏比(盈亏/支出)", prop: "profit_loss_ratio", tip: "%" },
|
||||
{ label: "用户盈亏", prop: "profit_loss" },
|
||||
{ label: "用户盈亏比", prop: "profit_loss_ratio", tip: "%" },
|
||||
{ label: "平台盈亏", prop: "platform_profit_loss" },
|
||||
{ label: "平台盈亏比", prop: "platform_profit_loss_ratio", tip: "%" },
|
||||
])
|
||||
const dynamicflowColumns = ref([
|
||||
{
|
||||
|
||||
@@ -3,10 +3,13 @@ import editForm from "./form.vue";
|
||||
import detailView from './detail.vue';
|
||||
import TurntableView from './Turntable/Turntable.vue';
|
||||
import XunLeHuiView from './XunLeHui/index.vue';
|
||||
import { utils, writeFile } from "xlsx";
|
||||
import { message } from "@/utils/message";
|
||||
import ExportForm from '@/components/exportDialog/index.vue';
|
||||
import {
|
||||
queryList,
|
||||
getRoomDetail,
|
||||
queryClassifyList,
|
||||
deleteRoomData,
|
||||
updateRoomData
|
||||
} from "@/api/modules/room";
|
||||
@@ -33,11 +36,36 @@ export function useData() {
|
||||
{ label: "封禁", value: 2 },
|
||||
{ label: "关闭", value: 3 }
|
||||
]
|
||||
},
|
||||
{
|
||||
label: "是否热门",
|
||||
prop: "is_hot",
|
||||
type: "select",
|
||||
optionList: [
|
||||
{ label: "是", value: 2 },
|
||||
{ label: "否", value: 1 }
|
||||
]
|
||||
},
|
||||
{
|
||||
label: "是否置顶",
|
||||
prop: "is_top",
|
||||
type: "select",
|
||||
optionList: [
|
||||
{ label: "是", value: 2 },
|
||||
{ label: "否", value: 1 }
|
||||
]
|
||||
},
|
||||
{
|
||||
label: "房间类型",
|
||||
prop: "type_id",
|
||||
type: "select",
|
||||
optionList: []
|
||||
}
|
||||
]);
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
@@ -111,6 +139,14 @@ export function useData() {
|
||||
slot: "operation"
|
||||
}
|
||||
]);
|
||||
const getListType = async () => {
|
||||
const { data, code } = await queryClassifyList({});
|
||||
if (code) {
|
||||
searchLabel.value[searchLabel.value.length - 1].optionList = data.lists.map(ele => {
|
||||
return { label: ele.type_name, value: ele.id }
|
||||
})
|
||||
}
|
||||
}
|
||||
const onSearch = async (formData) => {
|
||||
loading.value = true;
|
||||
searchForm.value = { ...formData }
|
||||
@@ -242,6 +278,67 @@ 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({
|
||||
...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,
|
||||
@@ -253,9 +350,11 @@ export function useData() {
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
loading,
|
||||
exportExcel,
|
||||
viewDetail,
|
||||
editDialog,
|
||||
viewTurntableData,
|
||||
viewXunLeHuiData
|
||||
viewXunLeHuiData,
|
||||
getListType
|
||||
};
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user