|
|
@@ -0,0 +1,166 @@
|
|
|
+<template>
|
|
|
+ <div class="ma-content-block">
|
|
|
+ <sa-table
|
|
|
+ ref="crudRef"
|
|
|
+ :options="options"
|
|
|
+ :columns="columns"
|
|
|
+ :searchForm="searchForm"
|
|
|
+ >
|
|
|
+ <!-- 搜索区 tableSearch -->
|
|
|
+ <template #tableSearch>
|
|
|
+ <a-col :sm="8" :xs="24">
|
|
|
+ <a-form-item label="游戏" field="game_id">
|
|
|
+ <a-select
|
|
|
+ v-model="searchForm.game_id"
|
|
|
+ placeholder="请选择游戏"
|
|
|
+ allow-clear
|
|
|
+ >
|
|
|
+ <a-option
|
|
|
+ v-for="item in allGameOptions"
|
|
|
+ :key="item.id"
|
|
|
+ :value="item.id"
|
|
|
+ >
|
|
|
+ [{{ item.id }}] {{ item.name }}
|
|
|
+ </a-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :sm="8" :xs="24">
|
|
|
+ <a-form-item label="用户名" field="user_name">
|
|
|
+ <a-input
|
|
|
+ v-model="searchForm.user_name"
|
|
|
+ placeholder="请输入用户名"
|
|
|
+ allow-clear
|
|
|
+ />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :sm="8" :xs="24">
|
|
|
+ <a-form-item label="用户UID" field="uid">
|
|
|
+ <a-input
|
|
|
+ v-model="searchForm.uid"
|
|
|
+ placeholder="请输入用户UID"
|
|
|
+ allow-clear
|
|
|
+ />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :sm="8" :xs="24">
|
|
|
+ <a-form-item label="角色ID" field="role_id">
|
|
|
+ <a-input
|
|
|
+ v-model="searchForm.role_id"
|
|
|
+ placeholder="请输入角色ID"
|
|
|
+ allow-clear
|
|
|
+ />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :sm="8" :xs="24">
|
|
|
+ <a-form-item label="角色名" field="role_name">
|
|
|
+ <a-input
|
|
|
+ v-model="searchForm.role_name"
|
|
|
+ placeholder="请输入角色名"
|
|
|
+ allow-clear
|
|
|
+ />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <!-- Table 自定义渲染 -->
|
|
|
+ <template #game_id="{ record }">
|
|
|
+ <span>[{{ record.game_id }}] {{ record.game_name }}</span>
|
|
|
+ </template>
|
|
|
+ <template #media_id="{ record }">
|
|
|
+ <span>[{{ record.media_id }}] {{ record.media_name }}</span>
|
|
|
+ </template>
|
|
|
+ <template #agent_id="{ record }">
|
|
|
+ <span>[{{ record.agent_id }}] {{ record.agent_name }}</span>
|
|
|
+ </template>
|
|
|
+ <template #site_id="{ record }">
|
|
|
+ <span>[{{ record.site_id }}] {{ record.site_name }}</span>
|
|
|
+ </template>
|
|
|
+ </sa-table>
|
|
|
+
|
|
|
+ <!-- 编辑表单 -->
|
|
|
+ <edit-form ref="editRef" @success="refresh" />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { onMounted, ref, reactive } from "vue";
|
|
|
+import { Message } from "@arco-design/web-vue";
|
|
|
+import EditForm from "./edit.vue";
|
|
|
+import api from "../../api/customer/roleData";
|
|
|
+import commonApi from "../../api/common";
|
|
|
+
|
|
|
+// 引用定义
|
|
|
+const crudRef = ref();
|
|
|
+const editRef = ref();
|
|
|
+const viewRef = ref();
|
|
|
+const allGameOptions = ref([]);
|
|
|
+
|
|
|
+// 搜索表单
|
|
|
+const searchForm = ref({
|
|
|
+ game_id: "",
|
|
|
+ user_name: "",
|
|
|
+ uid: "",
|
|
|
+ role_id: "",
|
|
|
+ role_name: "",
|
|
|
+});
|
|
|
+
|
|
|
+// SaTable 基础配置
|
|
|
+const options = reactive({
|
|
|
+ api: api.getPageList,
|
|
|
+ rowSelection: { showCheckedAll: true },
|
|
|
+
|
|
|
+ edit: {
|
|
|
+ show: true,
|
|
|
+ auth: ["/v1/customer/RoleData/update"],
|
|
|
+ func: async (record) => {
|
|
|
+ editRef.value?.open("edit");
|
|
|
+ editRef.value?.setFormData(record);
|
|
|
+ },
|
|
|
+ },
|
|
|
+});
|
|
|
+
|
|
|
+// SaTable 列配置
|
|
|
+const columns = reactive([
|
|
|
+ {
|
|
|
+ title: "游戏",
|
|
|
+ dataIndex: "game_id",
|
|
|
+ width: 180,
|
|
|
+ },
|
|
|
+ { title: "用户名", dataIndex: "user_name", width: 180 },
|
|
|
+ { title: "用户UID", dataIndex: "uid", width: 180 },
|
|
|
+ { title: "服务器名", dataIndex: "server_name", width: 180 },
|
|
|
+ { title: "角色ID", dataIndex: "role_id", width: 180 },
|
|
|
+ { title: "角色名", dataIndex: "role_name", width: 180 },
|
|
|
+ { title: "累计充值", dataIndex: "total_recharge", width: 180 },
|
|
|
+ { title: "媒体ID", dataIndex: "media_id", width: 180 },
|
|
|
+ { title: "渠道ID", dataIndex: "agent_id", width: 180 },
|
|
|
+ { title: "广告位ID", dataIndex: "site_id", width: 180 },
|
|
|
+ { title: "注册IP地址", dataIndex: "ip", width: 180 },
|
|
|
+ { title: "账号最后登录时间", dataIndex: "login_time", width: 220 },
|
|
|
+ { title: "角色最后充值时间", dataIndex: "last_recharge_time", width: 220 },
|
|
|
+ { title: "角色创建时间", dataIndex: "create_time", width: 180 },
|
|
|
+]);
|
|
|
+
|
|
|
+// 页面数据初始化
|
|
|
+const initPage = async () => {
|
|
|
+ await getGameOptions();
|
|
|
+};
|
|
|
+
|
|
|
+// 获取子游戏options
|
|
|
+const getGameOptions = async () => {
|
|
|
+ const res = await commonApi.getGameOptionsApiNoAuth();
|
|
|
+ allGameOptions.value = res.data;
|
|
|
+};
|
|
|
+
|
|
|
+// SaTable 数据请求
|
|
|
+const refresh = async () => {
|
|
|
+ crudRef.value?.refresh();
|
|
|
+};
|
|
|
+
|
|
|
+// 页面加载完成执行
|
|
|
+onMounted(async () => {
|
|
|
+ initPage();
|
|
|
+ refresh();
|
|
|
+});
|
|
|
+</script>
|