更新
This commit is contained in:
@@ -64,3 +64,16 @@ export const queryCharmPropList = () => {
|
||||
"/adminapi/Level/wealth_level_rights_list"
|
||||
);
|
||||
};
|
||||
// 歌手
|
||||
export const querySingerList = (params) => {
|
||||
return http.request<Result>(
|
||||
"get",
|
||||
"/adminapi/SingerSong/singerLevelList",
|
||||
{ params }
|
||||
);
|
||||
};
|
||||
export const editSingerData = data => {
|
||||
return http.request<Result>("post", "/adminapi/SingerSong/singerLevelEdit", {
|
||||
data
|
||||
});
|
||||
}
|
||||
@@ -91,3 +91,23 @@ export const unbanUserByIp = data => {
|
||||
data
|
||||
});
|
||||
}
|
||||
// 歌手认证列表
|
||||
export const querySingerUser = params => {
|
||||
return http.request<Result>(
|
||||
"get",
|
||||
"/adminapi/SingerSong/singerList",
|
||||
{ params }
|
||||
);
|
||||
};
|
||||
// 编辑歌手
|
||||
export const editSingerUser = data => {
|
||||
return http.request<Result>("post", "/adminapi/SingerSong/singerEdit", {
|
||||
data
|
||||
});
|
||||
}
|
||||
// 查看歌手歌曲列表
|
||||
export const querySingerSongList = data => {
|
||||
return http.request<Result>("post", "/adminapi/SingerSong/singerSongList", {
|
||||
data
|
||||
});
|
||||
}
|
||||
@@ -295,3 +295,11 @@ export const getRedEnvelopeDetail = params => {
|
||||
{ params }
|
||||
);
|
||||
};
|
||||
// 查看房间点歌信息
|
||||
export const getSingeSongList = params => {
|
||||
return http.request<Result>(
|
||||
"get",
|
||||
"/adminapi/SingerSong/songList",
|
||||
{ params }
|
||||
);
|
||||
};
|
||||
58
src/views/Level/singerLevel/form.vue
Normal file
58
src/views/Level/singerLevel/form.vue
Normal file
@@ -0,0 +1,58 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import uploadImage from '@/components/UploadImage/index.vue';
|
||||
|
||||
const ruleFormRef = ref();
|
||||
const formRules = ref({
|
||||
level: [{ required: true, message: "请输入等级", trigger: "blur" }],
|
||||
change_value: [{ required: true, message: "请输入升级所需经验值", trigger: "blur" }],
|
||||
image: [{ required: true, message: "请上传等级图标", trigger: "change" }],
|
||||
rights_icon: [{ 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
|
||||
: {
|
||||
level: "",
|
||||
name: "",
|
||||
image: "",
|
||||
change_value: "",
|
||||
rights_icon: "",
|
||||
}
|
||||
);
|
||||
function getRef() {
|
||||
return ruleFormRef.value;
|
||||
}
|
||||
function handleFileSuccess(list) {
|
||||
newFormInline.value.image = list.join(',')
|
||||
}
|
||||
function handleIconSuccess(list) {
|
||||
newFormInline.value.rights_icon = list.join(',')
|
||||
}
|
||||
function handleBgSuccess(list) {
|
||||
newFormInline.value.bg_image = list.join(',')
|
||||
}
|
||||
defineExpose({ getRef });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-form ref="ruleFormRef" :model="newFormInline" :rules="formRules" label-width="120px">
|
||||
<el-form-item label="等级/段位" prop="level">
|
||||
<el-input v-model="newFormInline.level" clearable placeholder="请输入等级" />
|
||||
</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="handleFileSuccess" :limit="1" :echoUrl="newFormInline.image" />
|
||||
</el-form-item>
|
||||
<el-form-item label="升级所需经验值" prop="change_value">
|
||||
<el-input-number v-model="newFormInline.change_value" controls-position="right"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="等级特权图标" prop="rights_icon">
|
||||
<uploadImage @handleSuccess="handleIconSuccess" :limit="1" :echoUrl="newFormInline.rights_icon" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
181
src/views/Level/singerLevel/hook.tsx
Normal file
181
src/views/Level/singerLevel/hook.tsx
Normal file
@@ -0,0 +1,181 @@
|
||||
import { ref, h } from "vue";
|
||||
import editForm from "./form.vue";
|
||||
import { message } from "@/utils/message";
|
||||
import {
|
||||
querySingerList,
|
||||
editSingerData
|
||||
// addCharmData,
|
||||
// editCharmData,
|
||||
// deleteCharmData
|
||||
} from "@/api/modules/level";
|
||||
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({
|
||||
name: ""
|
||||
});
|
||||
const searchLabel = ref([
|
||||
{ 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: "level"
|
||||
},
|
||||
{
|
||||
label: "等级名称",
|
||||
prop: "name"
|
||||
},
|
||||
{
|
||||
label: "所需经验值",
|
||||
prop: "change_value"
|
||||
},
|
||||
{
|
||||
label: "特权图标",
|
||||
prop: "privilege",
|
||||
cellRenderer: ({ row }) => (
|
||||
<el-image
|
||||
fit="cover"
|
||||
preview-teleported={true}
|
||||
src={row.rights_icon}
|
||||
preview-src-list={Array.of(row.rights_icon)}
|
||||
class="w-[24px] h-[24px] rounded-full align-middle"
|
||||
/>
|
||||
),
|
||||
},
|
||||
// {
|
||||
// label: "状态",
|
||||
// prop: "status",
|
||||
// cellRenderer: ({ row }) => (
|
||||
// <el-tag type={row.status === 1 ? 'success' : 'error'}>{row.status === 1 ? '显示' : '隐藏'}</el-tag>
|
||||
// )
|
||||
// },
|
||||
{
|
||||
label: "发布时间",
|
||||
prop: "createtime"
|
||||
},
|
||||
{
|
||||
label: "操作",
|
||||
fixed: "right",
|
||||
width: 210,
|
||||
slot: "operation"
|
||||
}
|
||||
]);
|
||||
const onSearch = async (formData) => {
|
||||
loading.value = true;
|
||||
const { data, code } = await querySingerList({
|
||||
...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 handleDelete = async rowData => {
|
||||
// const { code } = await deleteCharmData({ id: rowData.id });
|
||||
// if (code) {
|
||||
// message(`您删除了等级名称为${rowData.name}的这条数据`, {
|
||||
// type: "success"
|
||||
// });
|
||||
// onSearch(searchForm.value);
|
||||
// }
|
||||
};
|
||||
// 新增
|
||||
const openDialog = (title = "新增", rowData: any) => {
|
||||
addDialog({
|
||||
title: `${title}歌手等级`,
|
||||
props: {
|
||||
formInline: {
|
||||
level: rowData?.level ?? "",
|
||||
name: rowData?.name ?? "",
|
||||
image: rowData?.image ?? "",
|
||||
change_value: rowData?.change_value ?? "",
|
||||
rights_icon: rowData?.rights_icon ?? ""
|
||||
}
|
||||
},
|
||||
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 => {
|
||||
// 新增不传id
|
||||
const { code, msg } = await editSingerData(form);
|
||||
if (code) {
|
||||
message("新增成功", { type: "success" });
|
||||
onSearch(searchForm.value);
|
||||
done();
|
||||
} else {
|
||||
message(msg, { type: "error" });
|
||||
}
|
||||
};
|
||||
const updateData = async form => {
|
||||
const { code, msg } = await editSingerData({
|
||||
...form,
|
||||
id: rowData.id
|
||||
});
|
||||
if (code) {
|
||||
message("修改成功", { type: "success" });
|
||||
onSearch(searchForm.value);
|
||||
done();
|
||||
} else {
|
||||
message(msg, { type: "error" });
|
||||
}
|
||||
};
|
||||
FormRef.validate(valid => {
|
||||
if (valid) {
|
||||
// 表单规则校验通过
|
||||
if (title === "新增") {
|
||||
// 实际开发先调用新增接口,再进行下面操作
|
||||
saveData(curData);
|
||||
} else {
|
||||
// 实际开发先调用修改接口,再进行下面操作
|
||||
updateData(curData);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
return {
|
||||
searchForm,
|
||||
searchLabel,
|
||||
onSearch,
|
||||
isShow,
|
||||
tableList,
|
||||
tableLabel,
|
||||
pagination,
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
loading,
|
||||
handleDelete,
|
||||
openDialog
|
||||
};
|
||||
}
|
||||
66
src/views/Level/singerLevel/index.vue
Normal file
66
src/views/Level/singerLevel/index.vue
Normal file
@@ -0,0 +1,66 @@
|
||||
<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,
|
||||
handleDelete,
|
||||
loading,
|
||||
openDialog
|
||||
} = useData();
|
||||
defineOptions({
|
||||
name: "charmGrade"
|
||||
});
|
||||
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" :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="`是否确认删除这条数据`" @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>
|
||||
36
src/views/newuser/singerUser/form.vue
Normal file
36
src/views/newuser/singerUser/form.vue
Normal file
@@ -0,0 +1,36 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
const ruleFormRef = ref();
|
||||
const formRules = ref({
|
||||
status: [{ required: true, message: "请选择状态", trigger: "change" }],
|
||||
// remark: [{ required: true, message: "请输入备注", trigger: "blur" }]
|
||||
});
|
||||
const props = defineProps(["formInline"]);
|
||||
const newFormInline = ref(
|
||||
props.formInline
|
||||
? props.formInline
|
||||
: {
|
||||
status: "",
|
||||
remark: ""
|
||||
}
|
||||
);
|
||||
|
||||
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="status">
|
||||
<el-radio-group v-model="newFormInline.status">
|
||||
<el-radio label="通过" :value="1" />
|
||||
<el-radio label="拒绝" :value="2" />
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="newFormInline.remark" type="textarea" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
162
src/views/newuser/singerUser/hook.tsx
Normal file
162
src/views/newuser/singerUser/hook.tsx
Normal file
@@ -0,0 +1,162 @@
|
||||
import { ref, h } from "vue";
|
||||
import editForm from "./form.vue";
|
||||
import {
|
||||
querySingerUser,
|
||||
editSingerUser
|
||||
// banUserByIpData,
|
||||
// unbanUserByIp
|
||||
} from "@/api/modules/newuserList";
|
||||
import { message } from "@/utils/message";
|
||||
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 searchForm = ref({
|
||||
start_time: "",
|
||||
end_time: "",
|
||||
search: "",
|
||||
status: ""
|
||||
});
|
||||
const searchLabel = ref([
|
||||
{ label: "昵称/用户ID", prop: "search", type: "input" },
|
||||
{
|
||||
label: "认证状态", prop: "status", type: "select", optionList: [
|
||||
{ label: "全部", value: "" },
|
||||
{ label: "已通过", value: 1 },
|
||||
{ label: "待审核", value: 0 },
|
||||
{ label: "已拒绝", value: 2 }
|
||||
]
|
||||
},
|
||||
{ label: "开始时间", prop: "start_time", type: "date" },
|
||||
{ label: "结束时间", prop: "end_time", type: "date" }
|
||||
]);
|
||||
const tableLabel = ref([
|
||||
{
|
||||
label: "Id",
|
||||
prop: "id"
|
||||
},
|
||||
{
|
||||
label: "用户ID",
|
||||
prop: "user_code"
|
||||
},
|
||||
{
|
||||
label: "用户昵称",
|
||||
prop: "nickname"
|
||||
},
|
||||
{
|
||||
label: "手机号",
|
||||
prop: "mobile"
|
||||
},
|
||||
{
|
||||
label: "性别",
|
||||
prop: "sex"
|
||||
},
|
||||
{
|
||||
label: "歌手试音地址",
|
||||
prop: "song"
|
||||
},
|
||||
{
|
||||
label: "状态",
|
||||
prop: "status",
|
||||
cellRenderer: ({ row }) => (
|
||||
<el-tag type={row.status === 1 ? 'success' : row.status === 0 ? 'info' : 'error'} >{row.status === 1 ? '已通过' : row.status === 0 ? '待审核' : '已拒绝'}</el-tag>
|
||||
)
|
||||
},
|
||||
{
|
||||
label: "备注",
|
||||
prop: "remark"
|
||||
},
|
||||
{
|
||||
label: "提交时间",
|
||||
prop: "createtime"
|
||||
},
|
||||
{
|
||||
label: "操作",
|
||||
fixed: "right",
|
||||
slot: "operation"
|
||||
}
|
||||
]);
|
||||
const detailData = ref(null)
|
||||
const onSearch = async (formData) => {
|
||||
loading.value = true;
|
||||
searchForm.value = { ...formData }
|
||||
const { data, code } = await querySingerUser({
|
||||
...formData,
|
||||
page: pagination.value.currentPage,
|
||||
page_limit: pagination.value.pageSize,
|
||||
|
||||
});
|
||||
if (code) {
|
||||
detailData.value = data;
|
||||
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 = (title = "新增", rowData: any) => {
|
||||
addDialog({
|
||||
title: `${title}歌手认证信息`,
|
||||
props: {
|
||||
formInline: {
|
||||
status: '',
|
||||
remark: ''
|
||||
}
|
||||
},
|
||||
width: "40%",
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(editForm, { ref: formRef, formInline: null }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const FormRef = formRef.value.getRef();
|
||||
const curData = options.props.formInline;
|
||||
delete curData.higherMenuOptions;
|
||||
const saveData = async form => {
|
||||
const { code, msg } = await editSingerUser({ ...form, id: rowData.id });
|
||||
if (code) {
|
||||
message("新增成功", { type: "success" });
|
||||
onSearch(searchForm.value);
|
||||
done();
|
||||
} else {
|
||||
message(msg, { type: "error" });
|
||||
}
|
||||
};
|
||||
FormRef.validate(valid => {
|
||||
if (valid) {
|
||||
saveData(curData);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
return {
|
||||
searchForm,
|
||||
searchLabel,
|
||||
onSearch,
|
||||
isShow,
|
||||
tableList,
|
||||
tableLabel,
|
||||
pagination,
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
loading,
|
||||
openDialog,
|
||||
detailData
|
||||
};
|
||||
}
|
||||
53
src/views/newuser/singerUser/index.vue
Normal file
53
src/views/newuser/singerUser/index.vue
Normal file
@@ -0,0 +1,53 @@
|
||||
<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,
|
||||
openDialog,
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
loading
|
||||
} = useData();
|
||||
onMounted(() => {
|
||||
onSearch(searchForm.value);
|
||||
});
|
||||
defineOptions({
|
||||
name: "backpackList"
|
||||
});
|
||||
</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 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" @click="openDialog('审核', row)"
|
||||
:size="size">审核</el-button>
|
||||
<el-button v-if="row.status === 1" link type="primary" :size="size">查看歌曲列表</el-button>
|
||||
</template>
|
||||
</pure-table>
|
||||
</template>
|
||||
</PureTableBar>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped lang="scss"></style>
|
||||
@@ -2,6 +2,7 @@
|
||||
import { ref, h, onMounted } from "vue";
|
||||
import { utils, writeFile } from "xlsx";
|
||||
import { message } from "@/utils/message";
|
||||
import singView from './sing.vue';
|
||||
import {
|
||||
getRoomDetail,
|
||||
getRoomWaterFlow,
|
||||
@@ -157,7 +158,12 @@ const handleClick = (tab) => {
|
||||
pagination.value.currentPage = 1
|
||||
flowTableList.value = []
|
||||
activeIndex.value = name
|
||||
if (['1', '2'].includes(name)) {
|
||||
getFlowData(activeIndex.value == '1' ? 1 : 2)
|
||||
} else {
|
||||
console.log('点歌记录')
|
||||
}
|
||||
|
||||
}
|
||||
const handleSizeChange = (val: number) => {
|
||||
pagination.value.pageSize = val;
|
||||
@@ -264,6 +270,9 @@ const exportExcal = async () => {
|
||||
}" @page-current-change="handleCurrentChange" @page-size-change="handleSizeChange">
|
||||
</pure-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="点歌记录" name="3">
|
||||
<singView :id="dataBytable.room_id"></singView>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
168
src/views/room/roomList/sing.tsx
Normal file
168
src/views/room/roomList/sing.tsx
Normal file
@@ -0,0 +1,168 @@
|
||||
import { ref } from "vue";
|
||||
import {
|
||||
getSingeSongList
|
||||
} from "@/api/modules/room";
|
||||
export function useData() {
|
||||
|
||||
const loading = ref(true);
|
||||
const tableList = ref([]);
|
||||
const isShow = ref(false);
|
||||
const tagValue = ref(1)
|
||||
const RoomId = ref(0)
|
||||
//1-今天,2-本周,3-本月,4-昨天
|
||||
const tagList = ref([
|
||||
{ value: 1, label: '今天' },
|
||||
{ value: 4, label: '昨天' },
|
||||
{ value: 2, label: '本周' },
|
||||
{ value: 3, label: '本月' }
|
||||
])
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
const tableLabel = ref([
|
||||
{
|
||||
label: "老板",
|
||||
prop: "boss_nickname"
|
||||
},
|
||||
{
|
||||
label: "歌曲名称",
|
||||
prop: "song_name"
|
||||
},
|
||||
{
|
||||
label: "演唱者",
|
||||
prop: "singer_nickname"
|
||||
},
|
||||
{
|
||||
label: "礼物名称",
|
||||
prop: "gift_name"
|
||||
},
|
||||
{
|
||||
label: "礼物数量",
|
||||
prop: "gift_num"
|
||||
},
|
||||
{
|
||||
label: "礼物金币",
|
||||
prop: "gift_price"
|
||||
},
|
||||
{
|
||||
label: "点歌时间",
|
||||
prop: "createtime"
|
||||
},
|
||||
{
|
||||
label: "状态",
|
||||
prop: "status",
|
||||
cellRenderer: ({ row }) => (
|
||||
<el-tag type={row.status === 0 ? 'info' : row.status === 1 ? 'success' : ''}>{row.status === 0 ? '待演唱' : row.status === 1 ? '正在演唱' : '已演唱'}</el-tag>
|
||||
),
|
||||
}
|
||||
]);
|
||||
const onSearch = async () => {
|
||||
loading.value = true;
|
||||
const { data, code } = await getSingeSongList({
|
||||
type: tagValue.value,
|
||||
room_id: RoomId.value,
|
||||
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();
|
||||
};
|
||||
const handleCurrentChange = (val: number) => {
|
||||
pagination.value.currentPage = val;
|
||||
onSearch();
|
||||
};
|
||||
const changeType = (value) => {
|
||||
console.log(value)
|
||||
tagValue.value = value
|
||||
pagination.value.currentPage = 1
|
||||
tableList.value = []
|
||||
onSearch()
|
||||
}
|
||||
// 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 {
|
||||
onSearch,
|
||||
isShow,
|
||||
tableList,
|
||||
tableLabel,
|
||||
pagination,
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
loading,
|
||||
tagList,
|
||||
tagValue,
|
||||
RoomId,
|
||||
changeType
|
||||
};
|
||||
}
|
||||
48
src/views/room/roomList/sing.vue
Normal file
48
src/views/room/roomList/sing.vue
Normal file
@@ -0,0 +1,48 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted } from "vue";
|
||||
import { useData } from "./sing";
|
||||
const {
|
||||
tagList,
|
||||
onSearch,
|
||||
tableList,
|
||||
pagination,
|
||||
tableLabel,
|
||||
RoomId,
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
changeType,
|
||||
tagValue,
|
||||
} = useData();
|
||||
defineOptions({
|
||||
name: "sing"
|
||||
});
|
||||
const props = defineProps(["id"]);
|
||||
console.log(props, '参数')
|
||||
RoomId.value = props.id
|
||||
onMounted(() => {
|
||||
onSearch();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<template>
|
||||
<div class="main">
|
||||
<div class="flex align-middle justify-between">
|
||||
<div>
|
||||
<el-tag class="mr-2" v-for="item in tagList" :key="item.value" style="cursor: pointer;"
|
||||
@click="changeType(item.value)" :type="tagValue === item.value ? '' : 'info'">{{
|
||||
item.label }}</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
<div ref="contentRef" style="margin-top: 20px;">
|
||||
<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="tableLabel"
|
||||
: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>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped lang="scss"></style>
|
||||
Reference in New Issue
Block a user