Compare commits
56 Commits
7191f62075
...
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 | ||
|
|
667eae1d30 | ||
|
|
0d7a41fade | ||
|
|
ed8a1d368d | ||
|
|
903f2004aa | ||
|
|
096bbc80a6 | ||
|
|
87135855b5 | ||
|
|
8ecc4ddd8a | ||
|
|
21cd30c3bd | ||
|
|
f958c96aec | ||
|
|
61e604b12c | ||
|
|
6515a343b4 | ||
|
|
d26ac895c2 | ||
|
|
065316cde5 | ||
|
|
0f28def6a5 | ||
|
|
cd4c050838 |
@@ -4,7 +4,7 @@
|
|||||||
<ReDialog />
|
<ReDialog />
|
||||||
</el-config-provider>
|
</el-config-provider>
|
||||||
</template>
|
</template>
|
||||||
|
<!-- 测试 -->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from "vue";
|
import { defineComponent } from "vue";
|
||||||
import { ElConfigProvider } from "element-plus";
|
import { ElConfigProvider } from "element-plus";
|
||||||
|
|||||||
@@ -46,4 +46,9 @@ export const getLogInfo = params => {
|
|||||||
"/adminapi/Adminlog/detail",
|
"/adminapi/Adminlog/detail",
|
||||||
{ params }
|
{ params }
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
export const apiPassWord = data => {
|
||||||
|
return http.request<Result>("post", "/adminapi/User/changePwd", {
|
||||||
|
data
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -73,4 +73,26 @@ export const removeBlindBoxData = data => {
|
|||||||
"/adminapi/BlindBox/blind_box_del",
|
"/adminapi/BlindBox/blind_box_del",
|
||||||
{ data }
|
{ data }
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
// 巡乐会设置
|
||||||
|
export const getXunLeRule = params => {
|
||||||
|
return http.request<Result>(
|
||||||
|
"get",
|
||||||
|
"/adminapi/BlindBox/xunlehui_rule_detail",
|
||||||
|
{ params }
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const queryGiftByTypeList = params => {
|
||||||
|
return http.request<Result>(
|
||||||
|
"get",
|
||||||
|
"/adminapi/BlindBox/blind_box_gifts", { params }
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export const settingXunLeRule = data => {
|
||||||
|
return http.request<Result>(
|
||||||
|
"post",
|
||||||
|
"/adminapi/BlindBox/xunlehui_set_rule",
|
||||||
|
{ 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 }
|
{ params }
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
export const getUserList = () => {
|
export const getUserList = params => {
|
||||||
return http.request<Result>(
|
return http.request<Result>(
|
||||||
"get",
|
"get",
|
||||||
"/adminapi/User/get_user_list"
|
"/adminapi/User/get_user_list", { params }
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
export const getRoomList = () => {
|
export const getRoomList = () => {
|
||||||
|
|||||||
@@ -256,3 +256,42 @@ export const getRoomToken = data => {
|
|||||||
data
|
data
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
// 盲盒转盘统计 adminapi/BlindBox/blind_box_turntable_lists
|
||||||
|
export const queryTurntableList = params => {
|
||||||
|
return http.request<Result>(
|
||||||
|
"get",
|
||||||
|
"/adminapi/BlindBox/blind_box_turntable_lists",
|
||||||
|
{ params }
|
||||||
|
);
|
||||||
|
};
|
||||||
|
// 盲盒转盘开奖记录
|
||||||
|
export const queryTurntableRecord = params => {
|
||||||
|
return http.request<Result>(
|
||||||
|
"get",
|
||||||
|
"/adminapi/BlindBox/blind_box_turntable_open_record",
|
||||||
|
{ params }
|
||||||
|
);
|
||||||
|
};
|
||||||
|
// 巡乐会锁定记录
|
||||||
|
export const queryLockRecord = params => {
|
||||||
|
return http.request<Result>(
|
||||||
|
"get",
|
||||||
|
"/adminapi/BlindBox/xlh_lock_record",
|
||||||
|
{ 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 = {
|
type Result = {
|
||||||
code: string;
|
code: string;
|
||||||
data: any;
|
data: any;
|
||||||
|
msg: string;
|
||||||
};
|
};
|
||||||
// 工会列表
|
// 工会列表
|
||||||
export const queryUnionList = params => {
|
export const queryUnionList = params => {
|
||||||
@@ -105,4 +106,10 @@ export const grantSubsidyBybatch = data => {
|
|||||||
return http.request<Result>("post", "/adminapi/Guild/subsidy_give_batch", {
|
return http.request<Result>("post", "/adminapi/Guild/subsidy_give_batch", {
|
||||||
data
|
data
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
// 隐藏或者展示工会
|
||||||
|
export const changeStatus = data => {
|
||||||
|
return http.request<Result>("post", "/adminapi/Guild/guild_show_status_edit", {
|
||||||
|
data
|
||||||
|
});
|
||||||
};
|
};
|
||||||
@@ -3,7 +3,7 @@ import "@wangeditor/editor/dist/css/style.css";
|
|||||||
import { baseUrlApi } from '@/utils/http/httpConfig.ts';
|
import { baseUrlApi } from '@/utils/http/httpConfig.ts';
|
||||||
import { Editor, Toolbar } from "@wangeditor/editor-for-vue";
|
import { Editor, Toolbar } from "@wangeditor/editor-for-vue";
|
||||||
import { onBeforeUnmount, ref, shallowRef, onMounted, watch } from "vue";
|
import { onBeforeUnmount, ref, shallowRef, onMounted, watch } from "vue";
|
||||||
|
import { URL } from "@/utils/http/config";
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "BaseEditor"
|
name: "BaseEditor"
|
||||||
});
|
});
|
||||||
@@ -27,7 +27,7 @@ const editorConfig = {
|
|||||||
|
|
||||||
editorConfig.MENU_CONF["uploadImage"] = {
|
editorConfig.MENU_CONF["uploadImage"] = {
|
||||||
// 服务端上传地址,根据实际业务改写
|
// 服务端上传地址,根据实际业务改写
|
||||||
server: 'http://chat.qxmier.com/adminapi/UploadFile/file_upload',
|
server: `${URL}/adminapi/UploadFile/file_upload`,
|
||||||
// form-data 的 fieldName,根据实际业务改写
|
// form-data 的 fieldName,根据实际业务改写
|
||||||
fieldName: "files",
|
fieldName: "files",
|
||||||
// 选择文件时的类型限制,根据实际业务改写
|
// 选择文件时的类型限制,根据实际业务改写
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
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-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
|
<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
|
<el-select class="!w-[180px]" :placeholder="`请选择${item.label}`" v-if="item.type === 'select'" clearable
|
||||||
v-model="form[item.prop]">
|
v-model="form[item.prop]">
|
||||||
@@ -12,11 +12,11 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
<!-- 时间 -->
|
<!-- 时间 -->
|
||||||
<el-date-picker v-if="item.type === 'date'" clearable v-model="form[item.prop]" :disabled-date="disabledDate"
|
<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"
|
type="datetime" class="!w-[160px]" :placeholder="`请选择${item.label}`" format="YYYY-MM-DD HH:mm:ss"
|
||||||
value-format="YYYY-MM-DD" />
|
value-format="YYYY-MM-DD HH:mm:ss" />
|
||||||
<!-- 时间范围 daterange-->
|
<!-- 时间范围 daterange-->
|
||||||
<el-date-picker :disabled-date="disabledDate" v-if="item.type === 'daterange'" format="YYYY-MM-DD"
|
<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="结束日期">
|
start-placeholder="开始日期" end-placeholder="结束日期">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -34,7 +34,7 @@ import { ref } from 'vue';
|
|||||||
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
||||||
import Refresh from "@iconify-icons/ep/refresh";
|
import Refresh from "@iconify-icons/ep/refresh";
|
||||||
const props = defineProps(['LabelList', 'formData', 'isSenior'])
|
const props = defineProps(['LabelList', 'formData', 'isSenior'])
|
||||||
const emit = defineEmits(["handleSearch", "openSearch", 'resetFields']);
|
const emit = defineEmits(["handleSearch", "openSearch", 'resetFields', 'changeValue']);
|
||||||
const formRef = ref(null)
|
const formRef = ref(null)
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const form = ref({ ...props.formData })
|
const form = ref({ ...props.formData })
|
||||||
@@ -48,6 +48,9 @@ const onSearch = () => {
|
|||||||
const openSeniorSearch = () => {
|
const openSeniorSearch = () => {
|
||||||
emit('openSearch')
|
emit('openSearch')
|
||||||
}
|
}
|
||||||
|
const changeValue = () => {
|
||||||
|
emit('changeValue', form.value)
|
||||||
|
}
|
||||||
const resetForm = () => {
|
const resetForm = () => {
|
||||||
formRef.value.resetFields()
|
formRef.value.resetFields()
|
||||||
emit('resetFields')
|
emit('resetFields')
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import Delete from "@iconify-icons/ri/delete-bin-7-line";
|
|||||||
defineOptions({
|
defineOptions({
|
||||||
name: "upload"
|
name: "upload"
|
||||||
});
|
});
|
||||||
|
import { URL } from "@/utils/http/config";
|
||||||
const fileList = ref([]);
|
const fileList = ref([]);
|
||||||
const curOpenImgIndex = ref(0);
|
const curOpenImgIndex = ref(0);
|
||||||
const dialogVisible = ref(false);
|
const dialogVisible = ref(false);
|
||||||
@@ -74,12 +74,17 @@ const handleFileSuccess = ({ data, code }, file, fileList) => {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<!-- {{ acceptType http://chat.qxmier.com }} -->
|
<!-- {{ acceptType http://md.xscmmidi.site }} -->
|
||||||
<el-upload v-model:file-list="fileList" drag multiple class="pure-upload" list-type="picture-card"
|
<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'"
|
:accept="acceptType ? acceptType : 'image/jpeg,image/png,image/gif'" :action="`${URL}/adminapi/
|
||||||
action="http://chat.qxmier.com/adminapi/UploadFile/file_upload" :limit="limit" name="files"
|
|
||||||
:headers="{ Authorization: getToken().accessToken }" :on-exceed="onExceed" :before-upload="onBefore"
|
|
||||||
:on-success="handleFileSuccess">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/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" />
|
<IconifyIconOffline :icon="Add" class="m-auto mt-4" width="30" />
|
||||||
<template #file="{ file }">
|
<template #file="{ file }">
|
||||||
<div v-if="file.status == 'ready' || file.status == 'uploading'" class="mt-[35%] m-auto">
|
<div v-if="file.status == 'ready' || file.status == 'uploading'" class="mt-[35%] m-auto">
|
||||||
|
|||||||
@@ -24,9 +24,10 @@ defineExpose({ getRef });
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-form ref="ruleFormRef" :model="newFormInline" :rules="formRules" label-width="120px">
|
<el-form ref="ruleFormRef" :model="newFormInline" :rules="formRules" label-width="120px">
|
||||||
<el-form-item label="选择时间" prop="time">
|
<el-form-item label="选择导出时间" prop="time">
|
||||||
<el-date-picker v-model="newFormInline.time" format="YYYY-MM-DD" :disabled-date="disabledDate"
|
<el-date-picker v-model="newFormInline.time" format="YYYY-MM-DD HH:mm:ss" :disabled-date="disabledDate"
|
||||||
value-format="YYYY-MM-DD" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
|
value-format="YYYY-MM-DD HH:mm:ss" type="datetimerange" range-separator="至" start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
export const URL = "http://chat.qxmier.com";
|
export const URL = "https://md.xscmmidi.site";
|
||||||
// http://chat.qxmier.com 正式
|
// https://md.xscmmidi.site 正式
|
||||||
// http://vschat.qxmier.com 测试
|
// https://tmd.xscmmidi.site 测试
|
||||||
|
// 声网appId 在这里换
|
||||||
|
export const appIdBySw = 'a3f0f0c78307434fa1c697c3429fbdcf';
|
||||||
@@ -159,8 +159,6 @@ class PureHttp {
|
|||||||
...param,
|
...param,
|
||||||
...axiosConfig
|
...axiosConfig
|
||||||
} as PureHttpRequestConfig;
|
} as PureHttpRequestConfig;
|
||||||
console.log(config)
|
|
||||||
console.log(getToken())
|
|
||||||
// 单独处理自定义请求/响应回调
|
// 单独处理自定义请求/响应回调
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
PureHttp.axiosInstance
|
PureHttp.axiosInstance
|
||||||
@@ -198,5 +196,4 @@ class PureHttp {
|
|||||||
return this.request<T>("get", url, params, config);
|
return this.request<T>("get", url, params, config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const http = new PureHttp();
|
export const http = new PureHttp();
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ export function useData() {
|
|||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
const tableLabel = ref([
|
const tableLabel = ref([
|
||||||
@@ -101,7 +102,7 @@ export function useData() {
|
|||||||
type: rowData?.type ?? "",
|
type: rowData?.type ?? "",
|
||||||
num: rowData?.num ?? "",
|
num: rowData?.num ?? "",
|
||||||
gift_id: rowData?.gift_id ?? "",
|
gift_id: rowData?.gift_id ?? "",
|
||||||
gift_bag_id: rowData?.gift_bag_id ?? "",
|
gift_bag_id: propRowData.value.id ?? "",
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ onMounted(() => {
|
|||||||
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<!-- 首充好礼的礼物列表 -->
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<div ref="contentRef" :class="['flex', deviceDetection() ? 'flex-wrap' : '']">
|
<div ref="contentRef" :class="['flex', deviceDetection() ? 'flex-wrap' : '']">
|
||||||
<PureTableBar title="" :class="[isShow && !deviceDetection() ? '!w-[60vw]' : 'w-full']" :columns="tableLabel"
|
<PureTableBar title="" :class="[isShow && !deviceDetection() ? '!w-[60vw]' : 'w-full']" :columns="tableLabel"
|
||||||
|
|||||||
@@ -57,5 +57,9 @@ defineExpose({ getRef });
|
|||||||
<el-form-item label="所得金币文字" prop="diamond">
|
<el-form-item label="所得金币文字" prop="diamond">
|
||||||
<el-input v-model="newFormInline.diamond" clearable placeholder="请输入所得金币文字" />
|
<el-input v-model="newFormInline.diamond" clearable placeholder="请输入所得金币文字" />
|
||||||
</el-form-item>
|
</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>
|
</el-form>
|
||||||
</template>
|
</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 editForm from "./form.vue";
|
||||||
import { message } from "@/utils/message";
|
import { message } from "@/utils/message";
|
||||||
import recordList from "./record.vue"
|
import recordList from "./record.vue"
|
||||||
|
import giftPackView from './giftPack/index.vue';
|
||||||
import {
|
import {
|
||||||
getGoodGiftInfo,
|
getGoodGiftInfo,
|
||||||
setGoodGiftConfig
|
setGoodGiftConfig
|
||||||
@@ -16,6 +17,7 @@ export function useData() {
|
|||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
const tableLabel = ref([
|
const tableLabel = ref([
|
||||||
@@ -54,6 +56,11 @@ export function useData() {
|
|||||||
label: "所得金币文字",
|
label: "所得金币文字",
|
||||||
prop: "diamond"
|
prop: "diamond"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: "操作",
|
||||||
|
fixed: "right",
|
||||||
|
slot: "operation"
|
||||||
|
}
|
||||||
]);
|
]);
|
||||||
const onSearch = async () => {
|
const onSearch = async () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
@@ -91,7 +98,8 @@ export function useData() {
|
|||||||
counter: rowData?.counter ?? "",
|
counter: rowData?.counter ?? "",
|
||||||
money: rowData?.money ?? "",
|
money: rowData?.money ?? "",
|
||||||
money_str: rowData?.money_str ?? "",
|
money_str: rowData?.money_str ?? "",
|
||||||
diamond: rowData?.diamond ?? ""
|
diamond: rowData?.diamond ?? "",
|
||||||
|
activity_end_time: rowData?.activity_end_time ?? "",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
width: "40%",
|
width: "40%",
|
||||||
@@ -130,6 +138,18 @@ export function useData() {
|
|||||||
contentRenderer: () => h(recordList, { ref: formRef, formInline: null }),
|
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 {
|
return {
|
||||||
onSearch,
|
onSearch,
|
||||||
isShow,
|
isShow,
|
||||||
@@ -140,6 +160,7 @@ export function useData() {
|
|||||||
handleCurrentChange,
|
handleCurrentChange,
|
||||||
loading,
|
loading,
|
||||||
setConfig,
|
setConfig,
|
||||||
DistributionRecord
|
DistributionRecord,
|
||||||
|
openGiftPark
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ const {
|
|||||||
handleSizeChange,
|
handleSizeChange,
|
||||||
handleCurrentChange,
|
handleCurrentChange,
|
||||||
DistributionRecord,
|
DistributionRecord,
|
||||||
|
openGiftPark,
|
||||||
loading,
|
loading,
|
||||||
} = useData();
|
} = useData();
|
||||||
defineOptions({
|
defineOptions({
|
||||||
@@ -44,6 +45,11 @@ onMounted(() => {
|
|||||||
background: 'var(--el-fill-color-light)',
|
background: 'var(--el-fill-color-light)',
|
||||||
color: 'var(--el-text-color-primary)'
|
color: 'var(--el-text-color-primary)'
|
||||||
}" @page-current-change="handleCurrentChange" @page-size-change="handleSizeChange">
|
}" @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>
|
</pure-table>
|
||||||
</template>
|
</template>
|
||||||
</PureTableBar>
|
</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,
|
addData,
|
||||||
editData,
|
editData,
|
||||||
deleteData,
|
deleteData,
|
||||||
getDataInfo
|
getDataInfo,
|
||||||
|
apiPassWord
|
||||||
} from "@/api/modules/admin";
|
} from "@/api/modules/admin";
|
||||||
|
import passwordForm from './password.vue';
|
||||||
import { addDialog } from "@/components/ReDialog";
|
import { addDialog } from "@/components/ReDialog";
|
||||||
export function useData() {
|
export function useData() {
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
@@ -18,6 +20,7 @@ export function useData() {
|
|||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
const indexMethod = (index: number) => {
|
const indexMethod = (index: number) => {
|
||||||
@@ -142,6 +145,42 @@ export function useData() {
|
|||||||
onSearch();
|
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 {
|
return {
|
||||||
onSearch,
|
onSearch,
|
||||||
isShow,
|
isShow,
|
||||||
@@ -152,6 +191,7 @@ export function useData() {
|
|||||||
handleCurrentChange,
|
handleCurrentChange,
|
||||||
loading,
|
loading,
|
||||||
openDialog,
|
openDialog,
|
||||||
handleDelete
|
handleDelete,
|
||||||
|
settingPassWord
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ const {
|
|||||||
handleCurrentChange,
|
handleCurrentChange,
|
||||||
openDialog,
|
openDialog,
|
||||||
loading,
|
loading,
|
||||||
|
settingPassWord,
|
||||||
handleDelete
|
handleDelete
|
||||||
} = useData();
|
} = useData();
|
||||||
defineOptions({
|
defineOptions({
|
||||||
@@ -44,6 +45,9 @@ onMounted(() => {
|
|||||||
color: 'var(--el-text-color-primary)'
|
color: 'var(--el-text-color-primary)'
|
||||||
}" @page-size-change="handleSizeChange" @page-current-change="handleCurrentChange">
|
}" @page-size-change="handleSizeChange" @page-current-change="handleCurrentChange">
|
||||||
<template #operation="{ row }">
|
<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 link type="primary" :size="size" @click="openDialog('编辑', row)">
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</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({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
@@ -136,7 +137,7 @@ export function useData() {
|
|||||||
onSearch(searchForm.value);
|
onSearch(searchForm.value);
|
||||||
};
|
};
|
||||||
const getType = async () => {
|
const getType = async () => {
|
||||||
const { code, data } = await queryBoxTypeList(4)
|
const { code, data } = await queryBoxTypeList({ activities_id: 4 })
|
||||||
// console.log(code, data)
|
// console.log(code, data)
|
||||||
typeList.value = code ? data.map(ele => {
|
typeList.value = code ? data.map(ele => {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ export function useData() {
|
|||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
const searchForm = ref({
|
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>
|
||||||
56
src/views/BlindBox/turntable/form.vue
Normal file
56
src/views/BlindBox/turntable/form.vue
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, onMounted } from "vue";
|
||||||
|
import { queryGiftByTypeList } from '@/api/modules/blindBox'
|
||||||
|
const ruleFormRef = ref();
|
||||||
|
const typeList = ref([])
|
||||||
|
const formRules = ref({
|
||||||
|
gift_id: [{ required: true, message: "请选择礼物", trigger: "change" }],
|
||||||
|
quantity: [{ required: true, message: "请输入每期数量", trigger: "blur" }],
|
||||||
|
weight: [{ required: true, message: "请输入起止数量", trigger: "blur" }],
|
||||||
|
is_world_show: [{ required: true, message: "请选择状态", trigger: "change" }],
|
||||||
|
});
|
||||||
|
const props = defineProps(["formInline"]);
|
||||||
|
const newFormInline = ref(
|
||||||
|
props.formInline
|
||||||
|
? props.formInline
|
||||||
|
: {
|
||||||
|
gift_id: "",
|
||||||
|
quantity: 1,
|
||||||
|
weight: 1
|
||||||
|
}
|
||||||
|
);
|
||||||
|
function getRef() {
|
||||||
|
return ruleFormRef.value;
|
||||||
|
}
|
||||||
|
const getList = async () => {
|
||||||
|
const { data, code } = await queryGiftByTypeList({ type: 2, label: 7 })
|
||||||
|
typeList.value = code ? data : []
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
defineExpose({ getRef });
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<el-form ref="ruleFormRef" :model="newFormInline" :rules="formRules" label-width="150px">
|
||||||
|
<el-form-item label="选择礼物" prop="gift_id">
|
||||||
|
<el-select 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-form-item>
|
||||||
|
<el-form-item label="每期数量" prop="quantity">
|
||||||
|
<el-input-number v-model="newFormInline.quantity" :precision="2" :step="0.01" :max="9999.99"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="参与开奖起止数量" prop="weight">
|
||||||
|
<el-input-number v-model="newFormInline.weight"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="参与榜单显示" prop="is_world_show">
|
||||||
|
<el-radio-group v-model="newFormInline.is_world_show">
|
||||||
|
<el-radio :label="1">显示</el-radio>
|
||||||
|
<el-radio :label="0">隐藏</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
307
src/views/BlindBox/turntable/hook.tsx
Normal file
307
src/views/BlindBox/turntable/hook.tsx
Normal file
@@ -0,0 +1,307 @@
|
|||||||
|
import { ref, h } from "vue";
|
||||||
|
import {
|
||||||
|
queryBoxTypeList,
|
||||||
|
queryBlindBoxList,
|
||||||
|
resetBlindBoxRule,
|
||||||
|
removeBlindBoxData,
|
||||||
|
addBlindBoxData,
|
||||||
|
editBlindBoxData,
|
||||||
|
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";
|
||||||
|
import { message } from "@/utils/message";
|
||||||
|
export function useData() {
|
||||||
|
const formRef = ref();
|
||||||
|
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 searchForm = ref({
|
||||||
|
gift_id: "",
|
||||||
|
gift_name: "",
|
||||||
|
});
|
||||||
|
const activeName = ref(0)
|
||||||
|
const typeList = ref([])
|
||||||
|
const statisticsList = ref([
|
||||||
|
{ label: "每期总次数", prop: "total_count" },
|
||||||
|
{ label: "每期总礼物价值(收入)", prop: "total_price" },
|
||||||
|
{
|
||||||
|
label: "每期总抽奖花费(支出)", prop: "total_cost"
|
||||||
|
},
|
||||||
|
{ label: "每期统计(收入/支出)", prop: "profit_loss_ratio", tip: "%" },
|
||||||
|
// { label: "今日抽奖人数", prop: "today_count_user" },
|
||||||
|
// { label: "今日抽奖次数", prop: "today_total_count" },
|
||||||
|
// { label: "今日抽奖收入", prop: "today_total_price" },
|
||||||
|
])
|
||||||
|
const statisticsData = ref({})
|
||||||
|
const searchLabel = ref([
|
||||||
|
{ label: "礼物ID", prop: "gift_id", type: "input" },
|
||||||
|
{ label: "礼物名称", prop: "gift_name", type: "input" }
|
||||||
|
]);
|
||||||
|
const tableLabel = ref([
|
||||||
|
{
|
||||||
|
label: "礼物ID",
|
||||||
|
prop: "gift_id"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "礼物名称",
|
||||||
|
prop: "gift_name"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "封面图",
|
||||||
|
prop: "base_image",
|
||||||
|
cellRenderer: ({ row }) => (
|
||||||
|
<el-image
|
||||||
|
fit="cover"
|
||||||
|
preview-teleported={true}
|
||||||
|
src={row.base_image}
|
||||||
|
preview-src-list={Array.of(row.base_image)}
|
||||||
|
class="w-[50px] h-[50px] align-middle"
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "价格",
|
||||||
|
prop: "gift_price"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "每期数量",
|
||||||
|
prop: "quantity"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "未开数量",
|
||||||
|
prop: "remaining_number"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "多少次后可参与开奖",
|
||||||
|
prop: "weight"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "公屏",
|
||||||
|
prop: "is_public_screen",
|
||||||
|
cellRenderer: ({ row }) => (
|
||||||
|
<el-tag type={row.is_public_screen === 1 ? 'success' : 'error'}>{row.is_public_screen === 1 ? '是' : '否'}</el-tag>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
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: "createtime"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "操作",
|
||||||
|
fixed: "right",
|
||||||
|
width: 210,
|
||||||
|
slot: "operation"
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
const onSearch = async (formData) => {
|
||||||
|
loading.value = true;
|
||||||
|
searchForm.value = { ...formData }
|
||||||
|
const { data, code } = await queryBlindBoxList({
|
||||||
|
...formData,
|
||||||
|
gift_bag_id: activeName.value,
|
||||||
|
page: pagination.value.currentPage,
|
||||||
|
page_limit: pagination.value.pageSize,
|
||||||
|
|
||||||
|
});
|
||||||
|
if (code) {
|
||||||
|
tableList.value = data.lists.map(ele => {
|
||||||
|
return {
|
||||||
|
...ele, ...data.total
|
||||||
|
}
|
||||||
|
});
|
||||||
|
statisticsData.value = data.total_data
|
||||||
|
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 getType = async () => {
|
||||||
|
const { code, data } = await queryBoxTypeList({ activities_id: 5 })
|
||||||
|
typeList.value = code ? data.map(ele => {
|
||||||
|
return {
|
||||||
|
label: ele.name,
|
||||||
|
value: ele.id
|
||||||
|
}
|
||||||
|
}) : []
|
||||||
|
if (code) handleClick(data[0].id)
|
||||||
|
}
|
||||||
|
const handleClick = (id) => {
|
||||||
|
activeName.value = id
|
||||||
|
onSearch(searchForm.value);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
const resetSetting = async () => {
|
||||||
|
const { data, code } = await resetBlindBoxRule({
|
||||||
|
gift_bag_id: activeName.value
|
||||||
|
})
|
||||||
|
if (code) {
|
||||||
|
message(`重置成功`, {
|
||||||
|
type: "success"
|
||||||
|
});
|
||||||
|
handleClick(activeName.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
const handleDelete = async rowData => {
|
||||||
|
const { code } = await removeBlindBoxData({ id: rowData.id });
|
||||||
|
if (code) {
|
||||||
|
message(`您删除了这条数据`, {
|
||||||
|
type: "success"
|
||||||
|
});
|
||||||
|
onSearch(searchForm.value);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const openDialog = async (title = "新增", rowData: any) => {
|
||||||
|
addDialog({
|
||||||
|
title: `${title}盲盒礼物`,
|
||||||
|
props: {
|
||||||
|
formInline: {
|
||||||
|
gift_id: rowData?.gift_id ?? "",
|
||||||
|
quantity: rowData?.quantity ?? 1,
|
||||||
|
weight: rowData?.weight ?? 1,
|
||||||
|
is_world_show: rowData?.is_world_show ?? ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
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 addBlindBoxData({
|
||||||
|
...form,
|
||||||
|
gift_bag_id: activeName.value,
|
||||||
|
});
|
||||||
|
if (code) {
|
||||||
|
message("新增成功", { type: "success" });
|
||||||
|
onSearch(searchForm.value);
|
||||||
|
done();
|
||||||
|
} else {
|
||||||
|
message("新增失败", { type: "error" });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const updateData = async form => {
|
||||||
|
const { code, msg } = await editBlindBoxData({
|
||||||
|
...form,
|
||||||
|
gift_bag_id: activeName.value,
|
||||||
|
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 setting = async () => {
|
||||||
|
const { data, code } = await getBlindBoxRule({ gift_bag_id: activeName.value })
|
||||||
|
addDialog({
|
||||||
|
title: `设置盲盒规则`,
|
||||||
|
props: {
|
||||||
|
formInline: {
|
||||||
|
...data
|
||||||
|
}
|
||||||
|
},
|
||||||
|
width: "40%",
|
||||||
|
closeOnClickModal: false,
|
||||||
|
contentRenderer: () => h(settingRuleView, { ref: formRef, formInline: null }),
|
||||||
|
beforeSure: (done, { options }) => {
|
||||||
|
const FormRef = formRef.value.getRef();
|
||||||
|
const curData = options.props.formInline;
|
||||||
|
const saveData = async form => {
|
||||||
|
const { code } = await settingBlindBoxRule({ ...form });
|
||||||
|
if (code) {
|
||||||
|
message("设置成功", { type: "success" });
|
||||||
|
onSearch(searchForm.value);
|
||||||
|
done();
|
||||||
|
} else {
|
||||||
|
message("设置失败", { type: "error" });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
FormRef.validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
// console.log("curData", curData);
|
||||||
|
saveData(curData)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 开奖记录
|
||||||
|
const openLotteryRecord = () => {
|
||||||
|
addDialog({
|
||||||
|
title: `盲盒转盘开奖记录`,
|
||||||
|
fullscreen: true,
|
||||||
|
hideFooter: true,
|
||||||
|
closeOnClickModal: false,
|
||||||
|
contentRenderer: () => h(TurntableView, { ref: formRef, formInline: null })
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
searchForm,
|
||||||
|
searchLabel,
|
||||||
|
onSearch,
|
||||||
|
isShow,
|
||||||
|
tableList,
|
||||||
|
tableLabel,
|
||||||
|
pagination,
|
||||||
|
handleSizeChange,
|
||||||
|
handleCurrentChange,
|
||||||
|
loading,
|
||||||
|
getType,
|
||||||
|
activeName,
|
||||||
|
typeList,
|
||||||
|
statisticsList,
|
||||||
|
statisticsData,
|
||||||
|
handleClick,
|
||||||
|
openDialog,
|
||||||
|
resetSetting,
|
||||||
|
handleDelete,
|
||||||
|
setting,
|
||||||
|
openLotteryRecord
|
||||||
|
};
|
||||||
|
}
|
||||||
113
src/views/BlindBox/turntable/index.vue
Normal file
113
src/views/BlindBox/turntable/index.vue
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { onMounted } from "vue";
|
||||||
|
import { useData } from "./hook.tsx";
|
||||||
|
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,
|
||||||
|
getType,
|
||||||
|
typeList,
|
||||||
|
activeName,
|
||||||
|
statisticsList,
|
||||||
|
statisticsData,
|
||||||
|
handleClick,
|
||||||
|
openDialog,
|
||||||
|
resetSetting,
|
||||||
|
handleDelete,
|
||||||
|
openLotteryRecord,
|
||||||
|
setting
|
||||||
|
} = useData();
|
||||||
|
onMounted(() => {
|
||||||
|
getType()
|
||||||
|
});
|
||||||
|
defineOptions({
|
||||||
|
name: "boxList"
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="main">
|
||||||
|
<!-- {{ activeName }} -->
|
||||||
|
<div v-if="typeList.length" class="content">
|
||||||
|
<el-button v-for="ele in typeList" :key="ele.value" :label="ele.label" :name="ele.value"
|
||||||
|
:type="activeName === ele.value ? 'primary' : ''" @click="handleClick(ele.value)">{{ ele.label }}</el-button>
|
||||||
|
</div>
|
||||||
|
<SearchForm class="pb-2" :LabelList="searchLabel" :formData="searchForm" @handleSearch="onSearch" />
|
||||||
|
<div class="content-flex">
|
||||||
|
<div class="box" v-for="(ele, index) in statisticsList">
|
||||||
|
<el-statistic :precision="2" decimal-separator="." :value="statisticsData[ele.prop]" :suffix="ele.tip || ''"
|
||||||
|
:title="ele.label"></el-statistic>
|
||||||
|
<span></span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<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="openLotteryRecord">开奖记录</el-button>
|
||||||
|
<el-popconfirm :title="`是否重置当前盲盒转盘的规则数量`" @confirm="resetSetting(row)">
|
||||||
|
<template #reference>
|
||||||
|
|
||||||
|
<el-button type="primary">
|
||||||
|
重置数量
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-popconfirm>
|
||||||
|
|
||||||
|
<el-button type="primary" @click="setting(row)">
|
||||||
|
设置规则
|
||||||
|
</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.gift_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">
|
||||||
|
.content {
|
||||||
|
width: 100%;
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-flex {
|
||||||
|
width: 100%;
|
||||||
|
display: inline-flex;
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 20px;
|
||||||
|
text-align: center;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between
|
||||||
|
}
|
||||||
|
</style>
|
||||||
57
src/views/BlindBox/turntable/settingRule.vue
Normal file
57
src/views/BlindBox/turntable/settingRule.vue
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, onMounted } from "vue";
|
||||||
|
import RichText from '@/components/RichText/index.vue';
|
||||||
|
import { queryGiftList } from '@/api/modules/blindBox'
|
||||||
|
const ruleFormRef = ref();
|
||||||
|
const typeList = ref([])
|
||||||
|
const formRules = ref({
|
||||||
|
gift_id: [{ required: true, message: "请选择礼物", trigger: "change" }],
|
||||||
|
introd: [{ required: true, message: "请输入玩法介绍", trigger: "blur" }],
|
||||||
|
description: [{ required: true, message: "请输入说明", trigger: "blur" }]
|
||||||
|
});
|
||||||
|
const props = defineProps(["formInline"]);
|
||||||
|
const newFormInline = ref(
|
||||||
|
props.formInline
|
||||||
|
? props.formInline
|
||||||
|
: {
|
||||||
|
gift_id: "",
|
||||||
|
description: "",
|
||||||
|
introd: ""
|
||||||
|
}
|
||||||
|
);
|
||||||
|
function getRef() {
|
||||||
|
return ruleFormRef.value;
|
||||||
|
}
|
||||||
|
const getList = async () => {
|
||||||
|
const { data, code } = await queryGiftList()
|
||||||
|
typeList.value = code ? data : []
|
||||||
|
}
|
||||||
|
function chanageEditorValue(val) {
|
||||||
|
newFormInline.value.introd = val
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
defineExpose({ getRef });
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<el-form ref="ruleFormRef" :model="newFormInline" :rules="formRules" label-width="120px">
|
||||||
|
<el-form-item label="绑定礼物ID" prop="gift_id">
|
||||||
|
<el-input placeholder="请输入绑定礼物ID" v-model="newFormInline.gift_id">
|
||||||
|
</el-input>
|
||||||
|
<!-- <el-select 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-form-item>
|
||||||
|
<!-- <el-form-item label="说明" prop="description">
|
||||||
|
<el-input type="textarea" placeholder="请输入说明" v-model="newFormInline.description" maxlength="16" show-word-limit>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item label="玩法介绍" prop="introd">
|
||||||
|
<RichText style="border: 1px solid #ccc;" :echoValue="newFormInline.introd" @changeValue="chanageEditorValue">
|
||||||
|
</RichText>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
@@ -28,6 +28,7 @@ export function useData() {
|
|||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
const tableLabel = ref([
|
const tableLabel = ref([
|
||||||
@@ -60,19 +61,19 @@ export function useData() {
|
|||||||
label: "特效类型",
|
label: "特效类型",
|
||||||
prop: "file_type_str"
|
prop: "file_type_str"
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
label: "特效图",
|
// label: "特效图",
|
||||||
prop: "play_image",
|
// prop: "play_image",
|
||||||
cellRenderer: ({ row }) => (
|
// cellRenderer: ({ row }) => (
|
||||||
<el-image
|
// <el-image
|
||||||
fit="cover"
|
// fit="cover"
|
||||||
preview-teleported={true}
|
// preview-teleported={true}
|
||||||
src={row.play_image}
|
// src={row.play_image}
|
||||||
preview-src-list={Array.of(row.play_image)}
|
// preview-src-list={Array.of(row.play_image)}
|
||||||
class="w-[40px] h-[40px] align-middle"
|
// class="w-[40px] h-[40px] align-middle"
|
||||||
/>
|
// />
|
||||||
)
|
// )
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
label: "是否显示",
|
label: "是否显示",
|
||||||
prop: "show_status",
|
prop: "show_status",
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -43,14 +43,15 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
const statisticsList = ref([
|
const statisticsList = ref([
|
||||||
{ label: "总收入(¥)", prop: "total_money" },
|
// { label: "总收入(¥)", prop: "total_money" },
|
||||||
{ label: "未支付(¥)", prop: "unpaid_money" },
|
{ label: "未支付(¥)", prop: "unpaid_money" },
|
||||||
{
|
{
|
||||||
label: "已支付(¥)", prop: "paid_money"
|
label: "总收入(¥)", prop: "paid_money"
|
||||||
},
|
},
|
||||||
{ label: "微信支付(¥)", prop: "wx_money" },
|
{ label: "微信支付(¥)", prop: "wx_money" },
|
||||||
{ label: "支付宝支付(¥)", prop: "ali_money" },
|
{ label: "支付宝支付(¥)", prop: "ali_money" },
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
@@ -54,6 +55,10 @@ export function useData() {
|
|||||||
label: "数量(金币/钻石)",
|
label: "数量(金币/钻石)",
|
||||||
prop: "change_value"
|
prop: "change_value"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: "备注",
|
||||||
|
prop: "remarks",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: "支付时间",
|
label: "支付时间",
|
||||||
prop: "createtime",
|
prop: "createtime",
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ function handleBgSuccess(list) {
|
|||||||
}
|
}
|
||||||
const getTypeList = async () => {
|
const getTypeList = async () => {
|
||||||
const { data, code } = await queryCharmPropList()
|
const { data, code } = await queryCharmPropList()
|
||||||
typeList.value = code ? data.data : []
|
typeList.value = code ? [{ id: 0, title: '无' }, ...data.data] : []
|
||||||
console.log(typeList.value)
|
console.log(typeList.value)
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -13,18 +13,11 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
const statisticsList = ref([
|
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 totalData = ref(null)
|
const totalData = ref(null)
|
||||||
const searchForm = ref({
|
const searchForm = ref({
|
||||||
@@ -53,7 +46,8 @@ export function useData() {
|
|||||||
{ label: "开始时间", prop: "start_time", type: "date" },
|
{ label: "开始时间", prop: "start_time", type: "date" },
|
||||||
{ label: "结束时间", prop: "end_time", type: "date" },
|
{ label: "结束时间", prop: "end_time", type: "date" },
|
||||||
]);
|
]);
|
||||||
const tableLabel = ref([
|
const tableLabel = ref([])
|
||||||
|
const tableLabelS = ref([
|
||||||
{
|
{
|
||||||
label: "送礼人ID-昵称",
|
label: "送礼人ID-昵称",
|
||||||
prop: "send_user"
|
prop: "send_user"
|
||||||
@@ -82,18 +76,6 @@ export function useData() {
|
|||||||
label: "礼物总价(金币)",
|
label: "礼物总价(金币)",
|
||||||
prop: "total_price"
|
prop: "total_price"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: "平台收益(30%)钻石",
|
|
||||||
prop: "app_earning"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "接收人收益(60%)钻石",
|
|
||||||
prop: "gift_user_earning"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "房主收益(10%)钻石",
|
|
||||||
prop: "room_owner_earning"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: "来源",
|
label: "来源",
|
||||||
prop: "type",
|
prop: "type",
|
||||||
@@ -116,6 +98,41 @@ export function useData() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
if (code) {
|
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 => {
|
tableList.value = data.lists.map(ele => {
|
||||||
return {
|
return {
|
||||||
...ele,
|
...ele,
|
||||||
@@ -124,9 +141,11 @@ export function useData() {
|
|||||||
gift_user_earning: parseFloat(ele.gift_user_earning),
|
gift_user_earning: parseFloat(ele.gift_user_earning),
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
totalData.value = data.total;
|
totalData.value = data.total;
|
||||||
pagination.value.total = data.count;
|
pagination.value.total = data.count;
|
||||||
pagination.value.currentPage = data.page;
|
pagination.value.currentPage = parseFloat(data.page);
|
||||||
}
|
}
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
};
|
};
|
||||||
@@ -136,7 +155,7 @@ export function useData() {
|
|||||||
};
|
};
|
||||||
const handleCurrentChange = (val: number) => {
|
const handleCurrentChange = (val: number) => {
|
||||||
pagination.value.currentPage = val;
|
pagination.value.currentPage = val;
|
||||||
console.log(searchForm.value, 'yzy')
|
// console.log(searchForm.value, 'yzy')
|
||||||
onSearch(searchForm.value);
|
onSearch(searchForm.value);
|
||||||
};
|
};
|
||||||
const exportFormRef = ref(null)
|
const exportFormRef = ref(null)
|
||||||
@@ -158,6 +177,11 @@ export function useData() {
|
|||||||
const exportData = async (formData) => {
|
const exportData = async (formData) => {
|
||||||
const { data, code } = await queryGiftGiveList({
|
const { data, code } = await queryGiftGiveList({
|
||||||
...formData,
|
...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: 1,
|
||||||
page_limit: 20000
|
page_limit: 20000
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted } from "vue";
|
import { onBeforeMount } from "vue";
|
||||||
import { useData } from "./hook";
|
import { useData } from "./hook";
|
||||||
import SearchForm from "@/components/SearchForm/index.vue";
|
import SearchForm from "@/components/SearchForm/index.vue";
|
||||||
import { PureTableBar } from "@/components/RePureTableBar";
|
import { PureTableBar } from "@/components/RePureTableBar";
|
||||||
@@ -19,7 +19,7 @@ const {
|
|||||||
statisticsList,
|
statisticsList,
|
||||||
loading
|
loading
|
||||||
} = useData();
|
} = useData();
|
||||||
onMounted(() => {
|
onBeforeMount(() => {
|
||||||
onSearch(searchForm.value);
|
onSearch(searchForm.value);
|
||||||
});
|
});
|
||||||
defineOptions({
|
defineOptions({
|
||||||
@@ -37,10 +37,9 @@ defineOptions({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div ref="contentRef" :class="['flex', deviceDetection() ? 'flex-wrap' : '']">
|
<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">
|
:columns="tableLabel" @refresh="onSearch">
|
||||||
<template #buttons>
|
<template #buttons>
|
||||||
<!-- <div style="display: inline-flex;align-items: center;" class="mr-10">总计:{{ total_price }}</div> -->
|
|
||||||
<el-button type="primary" @click="exportExcel">
|
<el-button type="primary" @click="exportExcel">
|
||||||
导出
|
导出
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -18,12 +18,11 @@ onMounted(() => {
|
|||||||
<template>
|
<template>
|
||||||
<div style="margin-top: 24px;">
|
<div style="margin-top: 24px;">
|
||||||
<h2>{{ detailData.title }}</h2>
|
<h2>{{ detailData.title }}</h2>
|
||||||
<div class="text-indent content">
|
<div class="text-indent content" v-html="detailData.content">
|
||||||
{{ detailData.content }}
|
|
||||||
</div>
|
</div>
|
||||||
<div style="display: inline-flex;justify-content: center; width: 100%;">
|
<!-- <div style="display: inline-flex;justify-content: center; width: 100%;">
|
||||||
<el-image class="w-[300px] h-[300px]" :src="detailData.img"></el-image>
|
<el-image class="w-[300px] h-[300px]" :src="detailData.img"></el-image>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@@ -31,8 +30,7 @@ onMounted(() => {
|
|||||||
margin: 24px 0;
|
margin: 24px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-indent {
|
// .text-indent {
|
||||||
text-indent: 2em;
|
// text-indent: 2em;
|
||||||
line-height: 36px;
|
// line-height: 36px;
|
||||||
}
|
// }</style>
|
||||||
</style>
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
import uploadImage from '@/components/UploadImage/index.vue';
|
import uploadImage from '@/components/UploadImage/index.vue';
|
||||||
|
import RichText from '@/components/RichText/index.vue';
|
||||||
import {
|
import {
|
||||||
queryClassifyList
|
queryClassifyList
|
||||||
} from "@/api/modules/adolescent";
|
} from "@/api/modules/adolescent";
|
||||||
@@ -46,6 +47,9 @@ const getTypeList = async () => {
|
|||||||
})
|
})
|
||||||
typeList.value = code ? data.lists : []
|
typeList.value = code ? data.lists : []
|
||||||
}
|
}
|
||||||
|
function chanageEditorValue(val) {
|
||||||
|
newFormInline.value.content = val
|
||||||
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getTypeList()
|
getTypeList()
|
||||||
})
|
})
|
||||||
@@ -69,7 +73,7 @@ defineExpose({ getRef });
|
|||||||
<el-radio :label="2">外链</el-radio>
|
<el-radio :label="2">外链</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="封面图片" prop="img" v-if="newFormInline.from === 1">
|
<el-form-item label="封面图片" prop="img">
|
||||||
<uploadImage @handleSuccess="handleFileSuccess" :limit="1" :echoUrl="newFormInline.img" />
|
<uploadImage @handleSuccess="handleFileSuccess" :limit="1" :echoUrl="newFormInline.img" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="url链接地址" prop="url" v-if="newFormInline.from === 2">
|
<el-form-item label="url链接地址" prop="url" v-if="newFormInline.from === 2">
|
||||||
@@ -88,7 +92,9 @@ defineExpose({ getRef });
|
|||||||
<el-input type="textarea" v-model="newFormInline.introduced" clearable placeholder="请输入简介" />
|
<el-input type="textarea" v-model="newFormInline.introduced" clearable placeholder="请输入简介" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="内容" prop="content">
|
<el-form-item label="内容" prop="content">
|
||||||
<el-input type="textarea" v-model="newFormInline.content" clearable placeholder="请输入内容" />
|
<RichText style="border: 1px solid #ccc;" :echoValue="newFormInline.content" @changeValue="chanageEditorValue">
|
||||||
|
</RichText>
|
||||||
|
<!-- <el-input type="textarea" v-model="newFormInline.content" clearable placeholder="请输入内容" /> -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
@@ -117,7 +118,7 @@ export function useData() {
|
|||||||
id: Number(rowData?.id || 0) ?? "",
|
id: Number(rowData?.id || 0) ?? "",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
width: "40%",
|
width: "60%",
|
||||||
hideFooter: true,
|
hideFooter: true,
|
||||||
closeOnClickModal: false,
|
closeOnClickModal: false,
|
||||||
contentRenderer: () => h(detailView, { ref: formRef, formInline: null })
|
contentRenderer: () => h(detailView, { ref: formRef, formInline: null })
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
|
import RichText from '@/components/RichText/index.vue';
|
||||||
const ruleFormRef = ref();
|
const ruleFormRef = ref();
|
||||||
const formRules = ref({
|
const formRules = ref({
|
||||||
version: [{ required: true, message: "版本号为必填项", trigger: "blur" }],
|
version: [{ required: true, message: "版本号为必填项", trigger: "blur" }],
|
||||||
@@ -31,7 +32,9 @@ const newFormInline = ref(
|
|||||||
function getRef() {
|
function getRef() {
|
||||||
return ruleFormRef.value;
|
return ruleFormRef.value;
|
||||||
}
|
}
|
||||||
|
function chanageEditorValue(val) {
|
||||||
|
newFormInline.value.content = val
|
||||||
|
}
|
||||||
defineExpose({ getRef });
|
defineExpose({ getRef });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -53,7 +56,9 @@ defineExpose({ getRef });
|
|||||||
<el-input v-model="newFormInline.downloadurl" clearable placeholder="请输入下载链接" />
|
<el-input v-model="newFormInline.downloadurl" clearable placeholder="请输入下载链接" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="更新内容" prop="content">
|
<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>
|
||||||
<el-form-item label="强制更新" prop="enforce">
|
<el-form-item label="强制更新" prop="enforce">
|
||||||
<el-radio-group v-model="newFormInline.enforce">
|
<el-radio-group v-model="newFormInline.enforce">
|
||||||
@@ -63,8 +68,9 @@ defineExpose({ getRef });
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态" prop="status">
|
<el-form-item label="状态" prop="status">
|
||||||
<el-radio-group v-model="newFormInline.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-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
@@ -70,16 +71,7 @@ export function useData() {
|
|||||||
label: "启用状态",
|
label: "启用状态",
|
||||||
prop: "status",
|
prop: "status",
|
||||||
cellRenderer: ({ row, props }) => (
|
cellRenderer: ({ row, props }) => (
|
||||||
<el-switch
|
<el-tag type={row.status === 0 ? 'info' : row.status === 1 ? 'success' : 'danger'}>{row.status === 0 ? '待发布' : row.status === 1 ? '已发布' : '禁用'}</el-tag>
|
||||||
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>
|
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -143,7 +135,7 @@ export function useData() {
|
|||||||
const openDialog = (title = "新增", rowData: any) => {
|
const openDialog = (title = "新增", rowData: any) => {
|
||||||
// console.log(rowData, '编辑');
|
// console.log(rowData, '编辑');
|
||||||
addDialog({
|
addDialog({
|
||||||
title: `${title}广告`,
|
title: `${title}版本`,
|
||||||
props: {
|
props: {
|
||||||
formInline: {
|
formInline: {
|
||||||
version: rowData?.newversion ?? "",
|
version: rowData?.newversion ?? "",
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ export function useData() {
|
|||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
const searchForm = ref({
|
const searchForm = ref({
|
||||||
@@ -88,12 +89,12 @@ export function useData() {
|
|||||||
searchForm.value = { ...formData }
|
searchForm.value = { ...formData }
|
||||||
const { data, code } = await queryList({
|
const { data, code } = await queryList({
|
||||||
...formData,
|
...formData,
|
||||||
pageNum: pagination.value.currentPage,
|
page: pagination.value.currentPage,
|
||||||
pageSize: pagination.value.pageSize
|
page_limit: pagination.value.pageSize
|
||||||
});
|
});
|
||||||
if (code) {
|
if (code) {
|
||||||
tableList.value = data.lists;
|
tableList.value = data.lists;
|
||||||
pagination.value.total = data.totalRow;
|
pagination.value.total = data.count;
|
||||||
pagination.value.currentPage = data.pageNumber;
|
pagination.value.currentPage = data.pageNumber;
|
||||||
}
|
}
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
|
|||||||
@@ -1,22 +1,31 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
|
import SearchForm from "@/components/SearchForm/index.vue";
|
||||||
import { getUserList } from '@/api/modules/message'
|
import { getUserList } from '@/api/modules/message'
|
||||||
const selectUserList = ref([]);
|
const selectUserList = ref([]);
|
||||||
const userList = ref([])
|
const userList = ref([])
|
||||||
function getRef() {
|
function getRef() {
|
||||||
return selectUserList.value;
|
return selectUserList.value;
|
||||||
}
|
}
|
||||||
|
const searchLabel = ref([
|
||||||
|
{ label: "用户ID", prop: "user_code", type: "input" }
|
||||||
|
]);
|
||||||
|
const searchForm = ref({})
|
||||||
const multipleTable = ref(null)
|
const multipleTable = ref(null)
|
||||||
|
const onSearch = (formData) => {
|
||||||
|
userList.value = []
|
||||||
|
selectUserList.value = []
|
||||||
|
getAllUserList(formData)
|
||||||
|
}
|
||||||
const props = defineProps(["userList"]);
|
const props = defineProps(["userList"]);
|
||||||
const getAllUserList = async () => {
|
const getAllUserList = async (form) => {
|
||||||
const { code, data } = await getUserList()
|
const { code, data } = await getUserList({ ...form })
|
||||||
userList.value = code ? data : []
|
userList.value = code ? data : []
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (userList.value.length) {
|
if (userList.value.length) {
|
||||||
userList.value.forEach(ele => {
|
userList.value.forEach(ele => {
|
||||||
const listData = props.userList.map(e => { return Number(e) })
|
const listData = props.userList.map(e => { return Number(e) })
|
||||||
if (listData.includes(ele.id)) {
|
if (listData.includes(ele.id)) {
|
||||||
selectUserList.value.push()
|
|
||||||
multipleTable.value.toggleRowSelection(ele, true)
|
multipleTable.value.toggleRowSelection(ele, true)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -27,12 +36,13 @@ function handleSelectionChange(val) {
|
|||||||
selectUserList.value = val
|
selectUserList.value = val
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getAllUserList()
|
getAllUserList(searchForm.value)
|
||||||
})
|
})
|
||||||
defineExpose({ getRef });
|
defineExpose({ getRef });
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div style="margin-bottom: 20px;">
|
<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"
|
<el-table ref="multipleTable" :data="userList" row-key="id" border style="width: 100%" max-height="550"
|
||||||
@selection-change="handleSelectionChange">
|
@selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55">
|
<el-table-column type="selection" width="55">
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
import { ref } from "vue";
|
import { ref, h } from "vue";
|
||||||
import {
|
import {
|
||||||
queryList
|
queryList
|
||||||
} from "@/api/modules/backpack";
|
} 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() {
|
export function useData() {
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
const tableList = ref([]);
|
const tableList = ref([]);
|
||||||
@@ -10,6 +14,7 @@ export function useData() {
|
|||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
const searchForm = ref({
|
const searchForm = ref({
|
||||||
@@ -93,6 +98,67 @@ export function useData() {
|
|||||||
pagination.value.currentPage = val;
|
pagination.value.currentPage = val;
|
||||||
onSearch(searchForm.value);
|
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 {
|
return {
|
||||||
searchForm,
|
searchForm,
|
||||||
searchLabel,
|
searchLabel,
|
||||||
@@ -103,6 +169,7 @@ export function useData() {
|
|||||||
pagination,
|
pagination,
|
||||||
handleSizeChange,
|
handleSizeChange,
|
||||||
handleCurrentChange,
|
handleCurrentChange,
|
||||||
|
exportExcel,
|
||||||
loading,
|
loading,
|
||||||
detailData
|
detailData
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ const {
|
|||||||
tableList,
|
tableList,
|
||||||
pagination,
|
pagination,
|
||||||
tableLabel,
|
tableLabel,
|
||||||
|
exportExcel,
|
||||||
handleSizeChange,
|
handleSizeChange,
|
||||||
handleCurrentChange,
|
handleCurrentChange,
|
||||||
loading
|
loading
|
||||||
@@ -33,7 +34,12 @@ defineOptions({
|
|||||||
<PureTableBar title="背包列表" :class="[isShow && !deviceDetection() ? '!w-[60vw]' : 'w-full']" :columns="tableLabel"
|
<PureTableBar title="背包列表" :class="[isShow && !deviceDetection() ? '!w-[60vw]' : 'w-full']" :columns="tableLabel"
|
||||||
@refresh="onSearch">
|
@refresh="onSearch">
|
||||||
<template #buttons>
|
<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>
|
||||||
<template v-slot="{ size, dynamicColumns }">
|
<template v-slot="{ size, dynamicColumns }">
|
||||||
<pure-table ref="tableRef" align-whole="center" showOverflowTooltip table-layout="auto" default-expand-all
|
<pure-table ref="tableRef" align-whole="center" showOverflowTooltip table-layout="auto" default-expand-all
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<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"]);
|
const props = defineProps(["userInfo"]);
|
||||||
import {
|
import {
|
||||||
userLogData,
|
userLogData,
|
||||||
@@ -44,7 +50,6 @@ const getLogData = async (type) => {
|
|||||||
}
|
}
|
||||||
const getPhotoAlbum = async () => {
|
const getPhotoAlbum = async () => {
|
||||||
const { data, code } = await userPhotoAlbum({ user_id: userData.value.userId })
|
const { data, code } = await userPhotoAlbum({ user_id: userData.value.userId })
|
||||||
// console.log(data, code, '相册')
|
|
||||||
photoAlbums.value = code ? data : []
|
photoAlbums.value = code ? data : []
|
||||||
}
|
}
|
||||||
const deleteAlbum = async (rowData) => {
|
const deleteAlbum = async (rowData) => {
|
||||||
@@ -102,6 +107,72 @@ const handleCurrentChange = (val: number) => {
|
|||||||
getLogData(activeIndex.value == '1' ? 1 : 2)
|
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>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="viewPage">
|
<div class="viewPage">
|
||||||
@@ -124,9 +195,15 @@ const handleCurrentChange = (val: number) => {
|
|||||||
</div>
|
</div>
|
||||||
<div style="margin-top: 20px;">
|
<div style="margin-top: 20px;">
|
||||||
<el-tabs v-model="activeIndex" @tab-click="handleClick">
|
<el-tabs v-model="activeIndex" @tab-click="handleClick">
|
||||||
|
|
||||||
<el-tab-pane label="金币收支" name="1">
|
<el-tab-pane label="金币收支" name="1">
|
||||||
<pure-table ref="tableRef" align-whole="center" showOverflowTooltip table-layout="auto"
|
<div class="mb-5 flex" style="float: right;align-items: center;">
|
||||||
:adaptiveConfig="{ offsetBottom: 108 }" :data="tableList" :columns="dynamicColumns"
|
<!-- <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"
|
:pagination="{ ...pagination }" @page-size-change="handleSizeChange"
|
||||||
@page-current-change="handleCurrentChange" :header-cell-style="{
|
@page-current-change="handleCurrentChange" :header-cell-style="{
|
||||||
background: 'var(--el-fill-color-light)',
|
background: 'var(--el-fill-color-light)',
|
||||||
@@ -135,8 +212,11 @@ const handleCurrentChange = (val: number) => {
|
|||||||
</pure-table>
|
</pure-table>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="钻石收支" name="2">
|
<el-tab-pane label="钻石收支" name="2">
|
||||||
<pure-table ref="tableRef" align-whole="center" showOverflowTooltip table-layout="auto"
|
<div class="mb-5" style="float: right;">
|
||||||
:adaptiveConfig="{ offsetBottom: 108 }" @page-size-change="handleSizeChange"
|
<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"
|
@page-current-change="handleCurrentChange" :data="tableList" :columns="dynamicColumns"
|
||||||
:pagination="{ ...pagination }" :header-cell-style="{
|
:pagination="{ ...pagination }" :header-cell-style="{
|
||||||
background: 'var(--el-fill-color-light)',
|
background: 'var(--el-fill-color-light)',
|
||||||
@@ -146,28 +226,32 @@ const handleCurrentChange = (val: number) => {
|
|||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="ta的相册" name="3">
|
<el-tab-pane label="ta的相册" name="3">
|
||||||
<!-- {{ photoAlbums }} -->
|
<!-- {{ photoAlbums }} -->
|
||||||
<div v-if="photoAlbums.length > 0" class="albums-container">
|
<template v-if="activeIndex == 3">
|
||||||
<div v-for="(album, index) in photoAlbums" :key="index" class="album-card" @click="openAlbum(album)">
|
<div v-if="photoAlbums.length > 0" class="albums-container">
|
||||||
<img :src="album.image" class="album-cover" alt="Album cover">
|
<div v-for="(album, index) in photoAlbums" :key="index" class="album-card" @click="openAlbum(album)">
|
||||||
<div class="album-info">
|
<img :src="album.image" class="album-cover" alt="Album cover">
|
||||||
<div class="album-title">{{ album.name }}</div>
|
<div class="album-info">
|
||||||
<div class="album-stats">
|
<div class="album-title">{{ album.name }}</div>
|
||||||
<span><i class="fas fa-images"></i> {{ album.img_num }} 张照片</span>
|
<div class="album-stats">
|
||||||
<!-- <el-popconfirm title="确定删除吗?" @confirm="deleteAlbum(album)">
|
<span><i class="fas fa-images"></i> {{ album.img_num }} 张照片</span>
|
||||||
|
<!-- <el-popconfirm title="确定删除吗?" @confirm="deleteAlbum(album)">
|
||||||
<el-button size="small">删除</el-button>
|
<el-button size="small">删除</el-button>
|
||||||
</el-popconfirm> -->
|
</el-popconfirm> -->
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div v-else class="empty-album">
|
||||||
<div v-else class="empty-album">
|
<i class="fas fa-images"></i>
|
||||||
<i class="fas fa-images"></i>
|
<h3>暂无相册</h3>
|
||||||
<h3>暂无相册</h3>
|
<p>该用户还没有创建任何相册</p>
|
||||||
<p>该用户还没有创建任何相册</p>
|
</div>
|
||||||
</div>
|
</template>
|
||||||
|
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
import { h, ref, nextTick } from "vue";
|
import { h, ref, nextTick } from "vue";
|
||||||
import editForm from "./form.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 detailView from './detail.vue';
|
||||||
import banUserView from './banUser.vue';
|
import banUserView from './banUser.vue';
|
||||||
import changePassView from './password.vue';
|
import changePassView from './password.vue';
|
||||||
@@ -17,6 +20,7 @@ import {
|
|||||||
banUserData
|
banUserData
|
||||||
} from "@/api/modules/newuserList";
|
} from "@/api/modules/newuserList";
|
||||||
import { addDialog } from "@/components/ReDialog";
|
import { addDialog } from "@/components/ReDialog";
|
||||||
|
import { object } from "vue-types";
|
||||||
export function useData() {
|
export function useData() {
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const searchFormMore = ref({
|
const searchFormMore = ref({
|
||||||
@@ -34,6 +38,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
@@ -150,10 +155,14 @@ export function useData() {
|
|||||||
const onSearch = async (formData) => {
|
const onSearch = async (formData) => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
searchForm.value = { ...formData }
|
searchForm.value = { ...formData }
|
||||||
|
// console.log(searchForm.value, formData, 111)
|
||||||
|
if (!formData) {
|
||||||
|
resetFieldsSearch()
|
||||||
|
}
|
||||||
const { data, code } = await queryList({
|
const { data, code } = await queryList({
|
||||||
...formData,
|
...formData,
|
||||||
coin1: formData.coin1 ? formData.coin1 : '',
|
// coin1: searchForm.value.coin1 ? searchForm.value.coin1 : '',
|
||||||
coin2: formData.coin2 ? formData.coin2 : '',
|
// coin2: searchForm.value.coin2 ? searchForm.value.coin2 : '',
|
||||||
page: pagination.value.currentPage,
|
page: pagination.value.currentPage,
|
||||||
page_limit: pagination.value.pageSize
|
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 = () => {
|
const resetFieldsSearch = () => {
|
||||||
searchFormMore.value = {
|
searchFormMore.value = {
|
||||||
user_code: '',
|
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) => {
|
const changePassword = async (rowData: any) => {
|
||||||
addDialog({
|
addDialog({
|
||||||
@@ -431,6 +508,7 @@ export function useData() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
searchForm,
|
searchForm,
|
||||||
searchLabel,
|
searchLabel,
|
||||||
@@ -450,6 +528,8 @@ export function useData() {
|
|||||||
changePassword,
|
changePassword,
|
||||||
setUserFund,
|
setUserFund,
|
||||||
onSeniorSearch,
|
onSeniorSearch,
|
||||||
resetFieldsSearch
|
resetFieldsSearch,
|
||||||
|
exportExcel,
|
||||||
|
changeSearchValue
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -23,7 +23,9 @@ const {
|
|||||||
changePassword,
|
changePassword,
|
||||||
setUserFund,
|
setUserFund,
|
||||||
onSeniorSearch,
|
onSeniorSearch,
|
||||||
resetFieldsSearch
|
resetFieldsSearch,
|
||||||
|
exportExcel,
|
||||||
|
changeSearchValue
|
||||||
} = useData();
|
} = useData();
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "newuserList"
|
name: "newuserList"
|
||||||
@@ -46,10 +48,15 @@ onMounted(() => {
|
|||||||
<template>
|
<template>
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<SearchForm class="pb-2" :LabelList="searchLabel" :formData="searchForm" @handleSearch="onSearch"
|
<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' : '']">
|
<div ref="contentRef" :class="['flex', deviceDetection() ? 'flex-wrap' : '']">
|
||||||
<PureTableBar title="会员列表" :class="[isShow && !deviceDetection() ? '!w-[60vw]' : 'w-full']" :columns="tableLabel"
|
<PureTableBar title="会员列表" :class="[isShow && !deviceDetection() ? '!w-[60vw]' : 'w-full']" :columns="tableLabel"
|
||||||
@refresh="onSearch">
|
@refresh="onSearch">
|
||||||
|
<template #buttons>
|
||||||
|
<el-button type="primary" @click="exportExcel">
|
||||||
|
导出
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
<template v-slot="{ size, dynamicColumns }">
|
<template v-slot="{ size, dynamicColumns }">
|
||||||
<pure-table ref="tableRef" align-whole="center" showOverflowTooltip table-layout="auto" :loading="loading"
|
<pure-table ref="tableRef" align-whole="center" showOverflowTooltip table-layout="auto" :loading="loading"
|
||||||
:size="size" adaptive :adaptiveConfig="{ offsetBottom: 108 }" :data="tableList" :columns="dynamicColumns"
|
:size="size" adaptive :adaptiveConfig="{ offsetBottom: 108 }" :data="tableList" :columns="dynamicColumns"
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ export function useData() {
|
|||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
const tableLabel = ref([
|
const tableLabel = ref([
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ export function useData() {
|
|||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
const searchForm = ref({
|
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>
|
||||||
56
src/views/paradise/paradiseList/form.vue
Normal file
56
src/views/paradise/paradiseList/form.vue
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, onMounted } from "vue";
|
||||||
|
import { queryGiftByTypeList } from '@/api/modules/blindBox'
|
||||||
|
const ruleFormRef = ref();
|
||||||
|
const typeList = ref([])
|
||||||
|
const formRules = ref({
|
||||||
|
gift_id: [{ required: true, message: "请选择礼物", trigger: "change" }],
|
||||||
|
quantity: [{ required: true, message: "请输入每期数量", trigger: "blur" }],
|
||||||
|
weight: [{ required: true, message: "请输入起止数量", trigger: "blur" }],
|
||||||
|
is_world_show: [{ required: true, message: "请选择状态", trigger: "change" }],
|
||||||
|
});
|
||||||
|
const props = defineProps(["formInline"]);
|
||||||
|
const newFormInline = ref(
|
||||||
|
props.formInline
|
||||||
|
? props.formInline
|
||||||
|
: {
|
||||||
|
gift_id: "",
|
||||||
|
quantity: 1,
|
||||||
|
weight: 1
|
||||||
|
}
|
||||||
|
);
|
||||||
|
function getRef() {
|
||||||
|
return ruleFormRef.value;
|
||||||
|
}
|
||||||
|
const getList = async () => {
|
||||||
|
const { data, code } = await queryGiftByTypeList({ type: 2, label: 6 })
|
||||||
|
typeList.value = code ? data : []
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
defineExpose({ getRef });
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<el-form ref="ruleFormRef" :model="newFormInline" :rules="formRules" label-width="150px">
|
||||||
|
<el-form-item label="选择礼物" prop="gift_id">
|
||||||
|
<el-select 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-form-item>
|
||||||
|
<el-form-item label="每期数量" prop="quantity">
|
||||||
|
<el-input-number v-model="newFormInline.quantity"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="参与开奖起止数量" prop="weight">
|
||||||
|
<el-input-number v-model="newFormInline.weight"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="参与榜单显示" prop="is_world_show">
|
||||||
|
<el-radio-group v-model="newFormInline.is_world_show">
|
||||||
|
<el-radio :label="1">显示</el-radio>
|
||||||
|
<el-radio :label="0">隐藏</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
295
src/views/paradise/paradiseList/hook.tsx
Normal file
295
src/views/paradise/paradiseList/hook.tsx
Normal file
@@ -0,0 +1,295 @@
|
|||||||
|
import { ref, h } from "vue";
|
||||||
|
import {
|
||||||
|
queryBlindBoxList,
|
||||||
|
resetBlindBoxRule,
|
||||||
|
removeBlindBoxData,
|
||||||
|
addBlindBoxData,
|
||||||
|
editBlindBoxData,
|
||||||
|
getXunLeRule,
|
||||||
|
settingXunLeRule
|
||||||
|
} from "@/api/modules/blindBox";
|
||||||
|
import editForm from "./form.vue";
|
||||||
|
import settingRuleView from './settingRule.vue'
|
||||||
|
import { addDialog } from "@/components/ReDialog";
|
||||||
|
import { message } from "@/utils/message";
|
||||||
|
export function useData() {
|
||||||
|
const formRef = ref();
|
||||||
|
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 searchForm = ref({
|
||||||
|
gift_id: "",
|
||||||
|
gift_name: "",
|
||||||
|
});
|
||||||
|
const activeName = ref(13)
|
||||||
|
const typeList = ref([])
|
||||||
|
const statisticsList = ref([
|
||||||
|
{ label: "每期总次数", prop: "total_count" },
|
||||||
|
{ label: "每期总礼物价值(收入)", prop: "total_price" },
|
||||||
|
{
|
||||||
|
label: "每期总抽奖花费(支出)", prop: "total_cost"
|
||||||
|
},
|
||||||
|
{ label: "每期统计(收入/支出)", prop: "profit_loss_ratio", tip: "%" }
|
||||||
|
])
|
||||||
|
const statisticsData = ref({})
|
||||||
|
const searchLabel = ref([
|
||||||
|
{ label: "礼物ID", prop: "gift_id", type: "input" },
|
||||||
|
{ label: "礼物名称", prop: "gift_name", type: "input" }
|
||||||
|
]);
|
||||||
|
const tableLabel = ref([
|
||||||
|
{
|
||||||
|
label: "礼物ID",
|
||||||
|
prop: "gift_id"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "礼物名称",
|
||||||
|
prop: "gift_name"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "封面图",
|
||||||
|
prop: "base_image",
|
||||||
|
cellRenderer: ({ row }) => (
|
||||||
|
<el-image
|
||||||
|
fit="cover"
|
||||||
|
preview-teleported={true}
|
||||||
|
src={row.base_image}
|
||||||
|
preview-src-list={Array.of(row.base_image)}
|
||||||
|
class="w-[50px] h-[50px] align-middle"
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "价格",
|
||||||
|
prop: "gift_price"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "每期数量",
|
||||||
|
prop: "quantity"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "未开数量",
|
||||||
|
prop: "remaining_number"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "多少次后可参与开奖",
|
||||||
|
prop: "weight"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "公屏",
|
||||||
|
prop: "is_public_screen",
|
||||||
|
cellRenderer: ({ row }) => (
|
||||||
|
<el-tag type={row.is_public_screen === 1 ? 'success' : 'error'}>{row.is_public_screen === 1 ? '显示' : '隐藏'}</el-tag>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
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: "is_world_show",
|
||||||
|
cellRenderer: ({ row }) => (
|
||||||
|
<el-tag type={row.is_world_show === 1 ? 'success' : 'error'}>{row.is_world_show === 1 ? '显示' : '隐藏'}</el-tag>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "添加时间",
|
||||||
|
prop: "createtime"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "操作",
|
||||||
|
fixed: "right",
|
||||||
|
width: 210,
|
||||||
|
slot: "operation"
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
const onSearch = async (formData) => {
|
||||||
|
loading.value = true;
|
||||||
|
searchForm.value = { ...formData }
|
||||||
|
const { data, code } = await queryBlindBoxList({
|
||||||
|
...formData,
|
||||||
|
gift_bag_id: activeName.value,
|
||||||
|
page: pagination.value.currentPage,
|
||||||
|
page_limit: pagination.value.pageSize,
|
||||||
|
|
||||||
|
});
|
||||||
|
if (code) {
|
||||||
|
tableList.value = data.lists.map(ele => {
|
||||||
|
return {
|
||||||
|
...ele, ...data.total
|
||||||
|
}
|
||||||
|
});
|
||||||
|
statisticsData.value = data.total_data
|
||||||
|
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 resetSetting = async () => {
|
||||||
|
const { data, code } = await resetBlindBoxRule({
|
||||||
|
gift_bag_id: activeName.value
|
||||||
|
})
|
||||||
|
if (code) {
|
||||||
|
message(`重置成功`, {
|
||||||
|
type: "success"
|
||||||
|
});
|
||||||
|
onSearch(searchForm.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
const handleDelete = async rowData => {
|
||||||
|
const { code } = await removeBlindBoxData({ id: rowData.id });
|
||||||
|
if (code) {
|
||||||
|
message(`您删除了这条数据`, {
|
||||||
|
type: "success"
|
||||||
|
});
|
||||||
|
onSearch(searchForm.value);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const openDialog = async (title = "新增", rowData: any) => {
|
||||||
|
addDialog({
|
||||||
|
title: `${title}盲盒礼物`,
|
||||||
|
props: {
|
||||||
|
formInline: {
|
||||||
|
gift_id: rowData?.gift_id ?? "",
|
||||||
|
quantity: rowData?.quantity ?? 1,
|
||||||
|
weight: rowData?.weight ?? 1,
|
||||||
|
is_world_show: rowData?.is_world_show ?? 1,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
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 addBlindBoxData({
|
||||||
|
...form,
|
||||||
|
gift_bag_id: activeName.value,
|
||||||
|
});
|
||||||
|
if (code) {
|
||||||
|
message("新增成功", { type: "success" });
|
||||||
|
onSearch(searchForm.value);
|
||||||
|
done();
|
||||||
|
} else {
|
||||||
|
message("新增失败", { type: "error" });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const updateData = async form => {
|
||||||
|
const { code, msg } = await editBlindBoxData({
|
||||||
|
...form,
|
||||||
|
gift_bag_id: activeName.value,
|
||||||
|
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 addGiftData = async () => {
|
||||||
|
|
||||||
|
}
|
||||||
|
const setting = async () => {
|
||||||
|
const { data, code } = await getXunLeRule({ gift_bag_id: activeName.value })
|
||||||
|
addDialog({
|
||||||
|
title: `设置巡乐会规则`,
|
||||||
|
props: {
|
||||||
|
formInline: {
|
||||||
|
inlet_bag_id: +data.inlet_bag_id,
|
||||||
|
introd: data.introd,
|
||||||
|
waiting_start_num: data.open_condition.waiting_start_num,
|
||||||
|
start_num: data.open_condition.start_num,
|
||||||
|
selected_gift_id: +data.locking_condition.selected_gift_id,
|
||||||
|
locking_gift_id: +data.locking_condition.locking_gift_id,
|
||||||
|
give_homeowner_gift_id: +data.locking_condition.give_homeowner_gift_id,
|
||||||
|
end_time: data.locking_time.end_time,
|
||||||
|
tow_no_locking_time: data.locking_time.tow_no_locking_time,
|
||||||
|
next_time: data.locking_time.next_time,
|
||||||
|
price: data.xlh_box_price
|
||||||
|
}
|
||||||
|
},
|
||||||
|
width: "60%",
|
||||||
|
closeOnClickModal: false,
|
||||||
|
contentRenderer: () => h(settingRuleView, { ref: formRef, formInline: null }),
|
||||||
|
beforeSure: (done, { options }) => {
|
||||||
|
const FormRef = formRef.value.getRef();
|
||||||
|
const curData = options.props.formInline;
|
||||||
|
const saveData = async form => {
|
||||||
|
const { code } = await settingXunLeRule({ ...form });
|
||||||
|
if (code) {
|
||||||
|
message("设置成功", { type: "success" });
|
||||||
|
onSearch(searchForm.value);
|
||||||
|
done();
|
||||||
|
} else {
|
||||||
|
message("设置失败", { type: "error" });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
FormRef.validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
// console.log("curData", curData);
|
||||||
|
saveData(curData)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
searchForm,
|
||||||
|
searchLabel,
|
||||||
|
onSearch,
|
||||||
|
isShow,
|
||||||
|
tableList,
|
||||||
|
tableLabel,
|
||||||
|
pagination,
|
||||||
|
handleSizeChange,
|
||||||
|
handleCurrentChange,
|
||||||
|
loading,
|
||||||
|
activeName,
|
||||||
|
typeList,
|
||||||
|
statisticsList,
|
||||||
|
statisticsData,
|
||||||
|
openDialog,
|
||||||
|
resetSetting,
|
||||||
|
handleDelete,
|
||||||
|
addGiftData,
|
||||||
|
setting
|
||||||
|
};
|
||||||
|
}
|
||||||
103
src/views/paradise/paradiseList/index.vue
Normal file
103
src/views/paradise/paradiseList/index.vue
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { onMounted } from "vue";
|
||||||
|
import { useData } from "./hook.tsx";
|
||||||
|
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,
|
||||||
|
statisticsList,
|
||||||
|
statisticsData,
|
||||||
|
openDialog,
|
||||||
|
resetSetting,
|
||||||
|
handleDelete,
|
||||||
|
setting
|
||||||
|
} = useData();
|
||||||
|
onMounted(() => {
|
||||||
|
onSearch(searchForm.value);
|
||||||
|
});
|
||||||
|
defineOptions({
|
||||||
|
name: "boxList"
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="main">
|
||||||
|
<SearchForm class="pb-2" :LabelList="searchLabel" :formData="searchForm" @handleSearch="onSearch" />
|
||||||
|
<div class="content-flex">
|
||||||
|
<div class="box" v-for="(ele, index) in statisticsList">
|
||||||
|
<el-statistic :precision="2" decimal-separator="." :value="statisticsData[ele.prop]" :suffix="ele.tip || ''"
|
||||||
|
:title="ele.label"></el-statistic>
|
||||||
|
<span></span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<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>
|
||||||
|
<el-popconfirm :title="`是否重置当前巡乐会的规则数量吗?`" @confirm="resetSetting">
|
||||||
|
<template #reference>
|
||||||
|
<el-button type="primary">
|
||||||
|
重置数量
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-popconfirm>
|
||||||
|
<el-button type="primary" @click="setting">
|
||||||
|
设置规则
|
||||||
|
</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.gift_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">
|
||||||
|
.content {
|
||||||
|
width: 100%;
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-flex {
|
||||||
|
width: 100%;
|
||||||
|
display: inline-flex;
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 20px;
|
||||||
|
text-align: center;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between
|
||||||
|
}
|
||||||
|
</style>
|
||||||
150
src/views/paradise/paradiseList/settingRule.vue
Normal file
150
src/views/paradise/paradiseList/settingRule.vue
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, onMounted } from "vue";
|
||||||
|
import RichText from '@/components/RichText/index.vue';
|
||||||
|
import { queryGiftByTypeList, queryBoxTypeList } from '@/api/modules/blindBox'
|
||||||
|
const ruleFormRef = ref();
|
||||||
|
const typeList = ref([]);
|
||||||
|
const boxTypeList = ref([]);
|
||||||
|
const formRules = ref({
|
||||||
|
gift_id: [{ required: true, message: "请选择礼物", trigger: "change" }],
|
||||||
|
introd: [{ required: true, message: "请输入玩法介绍", trigger: "blur" }],
|
||||||
|
description: [{ required: true, message: "请输入说明", trigger: "blur" }]
|
||||||
|
});
|
||||||
|
const props = defineProps(["formInline"]);
|
||||||
|
const newFormInline = ref(
|
||||||
|
props.formInline
|
||||||
|
? props.formInline
|
||||||
|
: {
|
||||||
|
introd: "",
|
||||||
|
inlet_bag_id: "",
|
||||||
|
waiting_start_num: "",
|
||||||
|
start_num: "",
|
||||||
|
selected_gift_id: "",
|
||||||
|
locking_gift_id: "",
|
||||||
|
give_homeowner_gift_id: "",
|
||||||
|
end_time: "",
|
||||||
|
tow_no_locking_time: "",
|
||||||
|
next_time: "",
|
||||||
|
price: ""
|
||||||
|
}
|
||||||
|
);
|
||||||
|
function getRef() {
|
||||||
|
return ruleFormRef.value;
|
||||||
|
}
|
||||||
|
const getList = async () => {
|
||||||
|
const { data, code } = await queryGiftByTypeList({ type: 2, label: 6 })
|
||||||
|
typeList.value = code ? data : []
|
||||||
|
}
|
||||||
|
const getTypeList = async () => {
|
||||||
|
const { data, code } = await queryBoxTypeList({ activities_id: 5 })
|
||||||
|
boxTypeList.value = code ? data : []
|
||||||
|
}
|
||||||
|
function chanageEditorValue(val) {
|
||||||
|
newFormInline.value.introd = val
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
getList()
|
||||||
|
getTypeList()
|
||||||
|
})
|
||||||
|
defineExpose({ getRef });
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<el-form ref="ruleFormRef" :model="newFormInline" :rules="formRules" label-width="150px">
|
||||||
|
<el-form-item label="巡乐会入口" prop="inlet_bag_id">
|
||||||
|
<el-select v-model="newFormInline.inlet_bag_id" placeholder="请选择礼物">
|
||||||
|
<el-option v-for="item in boxTypeList" :key="item.id" :label="item.name" :value="item.id">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="巡乐会开启条件">
|
||||||
|
<div class="flex">
|
||||||
|
<div>等待开始</div>
|
||||||
|
<div class="ml-2 mr-2"><el-input placeholder="请输入" v-model="newFormInline.waiting_start_num">
|
||||||
|
</el-input></div>
|
||||||
|
<div>次,</div>
|
||||||
|
<div>正式开始</div>
|
||||||
|
<div class="ml-2 mr-2"><el-input placeholder="请输入" v-model="newFormInline.start_num">
|
||||||
|
</el-input></div>
|
||||||
|
<div>次。</div>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="巡乐会锁定礼物条件">
|
||||||
|
<div class="rule-text">
|
||||||
|
<span class="text-part">抽出礼物
|
||||||
|
</span>
|
||||||
|
<el-select class="input-number" style="min-width: 220px;" v-model="newFormInline.selected_gift_id"
|
||||||
|
placeholder="请选择礼物">
|
||||||
|
<el-option v-for="item in typeList" :key="item.gid" :label="item.gift_name" :value="item.gid">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
<span class="text-part">锁定礼物
|
||||||
|
</span>
|
||||||
|
<el-input class="input-number" style="min-width: 220px;" placeholder="请输入礼物ID"
|
||||||
|
v-model="newFormInline.locking_gift_id">
|
||||||
|
</el-input>
|
||||||
|
<!-- <el-select class="input-number" style="min-width: 220px;" v-model="newFormInline.locking_gift_id"
|
||||||
|
placeholder="请选择礼物">
|
||||||
|
<el-option v-for="item in typeList" :key="item.gid" :label="item.gift_name" :value="item.gid">
|
||||||
|
</el-option>
|
||||||
|
</el-select> -->
|
||||||
|
<span class="text-part">赠送房主礼物
|
||||||
|
</span>
|
||||||
|
<el-input class="input-number" style="min-width: 220px;" placeholder="请输入礼物ID"
|
||||||
|
v-model="newFormInline.give_homeowner_gift_id">
|
||||||
|
</el-input>
|
||||||
|
<!-- <el-select class="input-number" style="min-width: 220px;" v-model="newFormInline.give_homeowner_gift_id"
|
||||||
|
placeholder="请选择礼物">
|
||||||
|
<el-option v-for="item in typeList" :key="item.gid" :label="item.gift_name" :value="item.gid">
|
||||||
|
</el-option>
|
||||||
|
</el-select> -->
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="巡乐会锁定时间">
|
||||||
|
<div class="rule-text">
|
||||||
|
<span class="text-part">巡乐会正式开始后</span>
|
||||||
|
<el-input-number class="input-number" v-model="newFormInline.end_time" :min="0" label="时长分钟"></el-input-number>
|
||||||
|
<span class="text-part">(时长分钟)没有人锁定话,就结束掉;首次锁定后,在
|
||||||
|
</span>
|
||||||
|
<el-input-number class="input-number" v-model="newFormInline.tow_no_locking_time" :min="0"
|
||||||
|
label="时长分钟"></el-input-number>
|
||||||
|
<span class="text-part">(时长分钟)内,没有人在锁定,锁定礼物直接掉落到首次锁定用户的背包;如果有二次锁定,则每次减少
|
||||||
|
</span>
|
||||||
|
<el-input-number class="input-number" style="margin-top: 10px;" v-model="newFormInline.next_time" :min="0"
|
||||||
|
label="时长分钟"></el-input-number>
|
||||||
|
<span class="text-part">(时长分钟)重新等待再次锁定。
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="价格设置" prop="price">
|
||||||
|
<div class="rule-text">
|
||||||
|
<span class="text-part">单次抽奖</span>
|
||||||
|
<el-input-number class="input-number" v-model="newFormInline.price" :min="0" label=""></el-input-number>
|
||||||
|
<span class="text-part">金币。</span>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="玩法介绍" prop="introd">
|
||||||
|
<RichText style="border: 1px solid #ccc;" :echoValue="newFormInline.introd" @changeValue="chanageEditorValue">
|
||||||
|
</RichText>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.rule-text {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
// line-height: 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rule-text .text-part {
|
||||||
|
white-space: nowrap;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-number {
|
||||||
|
margin: 0 8px;
|
||||||
|
width: 120px !important;
|
||||||
|
// margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -16,6 +16,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
background: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ export function useData() {
|
|||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
background: true
|
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>
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user