更新文档
This commit is contained in:
@@ -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 => {
|
||||||
@@ -106,3 +107,9 @@ export const grantSubsidyBybatch = data => {
|
|||||||
data
|
data
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
// 隐藏或者展示工会
|
||||||
|
export const changeStatus = data => {
|
||||||
|
return http.request<Result>("post", "/adminapi/Guild/guild_show_status_edit", {
|
||||||
|
data
|
||||||
|
});
|
||||||
|
};
|
||||||
@@ -19,12 +19,7 @@ export function useData() {
|
|||||||
});
|
});
|
||||||
const statisticsList = ref([
|
const statisticsList = ref([
|
||||||
{ label: "礼物总数量", prop: "gift_num" },
|
{ label: "礼物总数量", prop: "gift_num" },
|
||||||
{ label: "礼物总价", prop: "total_price" },
|
{ 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)
|
||||||
@@ -83,18 +78,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",
|
||||||
@@ -117,6 +100,37 @@ 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 = [...statisticsList.value, ...objStatistics]
|
||||||
|
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,
|
||||||
@@ -125,6 +139,8 @@ 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 = data.page;
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ import {
|
|||||||
addUnionData,
|
addUnionData,
|
||||||
editUnionData,
|
editUnionData,
|
||||||
dissolveUnionData,
|
dissolveUnionData,
|
||||||
guildUnionData
|
guildUnionData,
|
||||||
|
changeStatus
|
||||||
} from "@/api/modules/union";
|
} from "@/api/modules/union";
|
||||||
import { addDialog } from "@/components/ReDialog";
|
import { addDialog } from "@/components/ReDialog";
|
||||||
export function useData() {
|
export function useData() {
|
||||||
@@ -87,6 +88,13 @@ export function useData() {
|
|||||||
<el-tag type={row.status_str === '正常' ? 'success' : 'error'}>{row.status_str}</el-tag>
|
<el-tag type={row.status_str === '正常' ? 'success' : 'error'}>{row.status_str}</el-tag>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: "显示状态",
|
||||||
|
prop: "is_show",
|
||||||
|
cellRenderer: ({ row }) => (
|
||||||
|
<div>{row.status_str === '正常' ? row.is_show_str : '-'}</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: "创建时间",
|
label: "创建时间",
|
||||||
prop: "createtime"
|
prop: "createtime"
|
||||||
@@ -259,6 +267,16 @@ export function useData() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// 更改工会状态 隐藏 显示
|
||||||
|
const changeShowStatus = async (rowData) => {
|
||||||
|
const { data, code, msg } = await changeStatus({ id: rowData.id })
|
||||||
|
if (code) {
|
||||||
|
message("操作成功", { type: "success" });
|
||||||
|
onSearch(searchForm.value);
|
||||||
|
} else {
|
||||||
|
message(msg, { type: "error" });
|
||||||
|
}
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
searchForm,
|
searchForm,
|
||||||
searchLabel,
|
searchLabel,
|
||||||
@@ -274,6 +292,7 @@ export function useData() {
|
|||||||
openDialog,
|
openDialog,
|
||||||
viewMember,
|
viewMember,
|
||||||
viewRoomList,
|
viewRoomList,
|
||||||
|
changeShowStatus,
|
||||||
mergeData
|
mergeData
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ const {
|
|||||||
openDialog,
|
openDialog,
|
||||||
viewMember,
|
viewMember,
|
||||||
viewRoomList,
|
viewRoomList,
|
||||||
mergeData
|
mergeData,
|
||||||
|
changeShowStatus
|
||||||
} = useData();
|
} = useData();
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "unionList"
|
name: "unionList"
|
||||||
@@ -63,6 +64,12 @@ onMounted(() => {
|
|||||||
<el-button link type="primary" :size="size" @click="openDialog('编辑', row)">
|
<el-button link type="primary" :size="size" @click="openDialog('编辑', row)">
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-popconfirm v-if="row.status_str === '正常'" :title="`是否【${row.is_show ? '隐藏' : '显示'}】当前公会`"
|
||||||
|
@confirm="changeShowStatus(row)">
|
||||||
|
<template #reference>
|
||||||
|
<el-button link type="primary" :size="size"> {{ row.is_show ? '隐藏' : '显示' }} </el-button>
|
||||||
|
</template>
|
||||||
|
</el-popconfirm>
|
||||||
<el-popconfirm v-if="row.status_str === '正常'" :title="`是否确认解散名称为【${row.guild_name}】的公会`"
|
<el-popconfirm v-if="row.status_str === '正常'" :title="`是否确认解散名称为【${row.guild_name}】的公会`"
|
||||||
@confirm="handleDelete(row)">
|
@confirm="handleDelete(row)">
|
||||||
<template #reference>
|
<template #reference>
|
||||||
|
|||||||
Reference in New Issue
Block a user