桃源记客服系统前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

139 lines
4.4 KiB

<template>
<div class="game-account-container">
<el-card shadow="hover">
<div class="game-account-search mb15">
<el-form :inline="true">
<el-form-item label="account">
<el-input size="default" v-model="tableData.param.account" placeholder="account" class="w-50 m-2" clearable/>
</el-form-item>
<el-form-item label="手机号:">
<el-input size="default" v-model="tableData.param.tel" placeholder="手机号" class="w-50 m-2" clearable/>
</el-form-item>
<el-form-item label="身份证:">
<el-input size="default" v-model="tableData.param.ident" placeholder="身份证" class="w-50 m-2" clearable/>
</el-form-item>
<el-form-item label="名字:">
<el-input size="default" v-model="tableData.param.name" placeholder="名字" class="w-50 m-2" clearable/>
</el-form-item>
<el-form-item>
<el-button size="default" type="primary" class="ml10" @click="accountList">
<el-icon>
<ele-Search />
</el-icon>
查询
</el-button>
</el-form-item>
</el-form>
</div>
<el-table :data="tableData.data" style="width: 100%">
<el-table-column type="index" label="序号" width="60" />
<el-table-column prop="account" label="账号" show-overflow-tooltip></el-table-column>
<el-table-column prop="trueName" label="名字" show-overflow-tooltip></el-table-column>
<el-table-column prop="identityCard" label="身份证" show-overflow-tooltip></el-table-column>
<el-table-column prop="tel" label="手机号" show-overflow-tooltip></el-table-column>
<el-table-column prop="leftPlayTime" label="剩余游戏时间" show-overflow-tooltip></el-table-column>
<el-table-column prop="createTime" label="创建时间" show-overflow-tooltip></el-table-column>
<el-table-column prop="lastLeaveTime" label="上次下线时间" show-overflow-tooltip></el-table-column>
</el-table>
<pagination
v-show="tableData.total>0"
:total="tableData.total"
v-model:page="tableData.param.pageNum"
v-model:limit="tableData.param.pageSize"
@pagination="accountList"
/>
</el-card>
</div>
</template>
<script lang="ts">
import {toRefs, reactive, onMounted, defineComponent, } from 'vue';
//import { ElMessageBox, ElMessage } from 'element-plus';
import EditRole from '/@/views/system/role/component/editRole.vue';
import {ServerList} from "/@/utils/game";
import {gameAccountList, gameOnlineList} from "/@/api/game";
// 定义接口来定义对象的类型
interface TableData {
account:string;
trueName: string;
identityCard: string;
tel:string;
lastLeaveTime:string;
createTime:string
leftPlayTime: string;
}
interface TableDataState {
tableData: {
data: Array<TableData>;
param: {
account: string;
tel:string;
ident:string;
name:string
}
};
}
export default defineComponent({
name: 'apiV1GameAccountList',
components: {EditRole},
setup() {
// const {proxy} = getCurrentInstance() as any;
const state = reactive<TableDataState>({
tableData: {
data: [],
param:{
account:"",
tel:"",
ident:"",
name:""
},
},
});
// 初始化表格数据
// const initTableData = () => {
// roleList()
// };
const accountList = ()=>{
const data: Array<TableData> = [];
gameAccountList(state.tableData.param).then(res=>{
const list = res.data.list??[]
list.map((item:TableData)=>{
data.push({
account:item.account,
trueName:item.trueName,
identityCard: item.identityCard,
tel: item.tel,
leftPlayTime:item.leftPlayTime,
createTime:item.createTime.replace("T"," ").substring(0,item.createTime.indexOf(".")),
lastLeaveTime:item.lastLeaveTime.replace("T"," ").substring(0,item.lastLeaveTime.indexOf(".")),
});
})
state.tableData.data = data;
})
};
// // 分页改变
// const onHandleSizeChange = (val: number) => {
// state.tableData.param.pageSize = val;
// };
// // 分页改变
// const onHandleCurrentChange = (val: number) => {
// state.tableData.param.pageNum = val;
// };
// 页面加载时
onMounted(() => {
// initTableData();
});
return {
accountList,
...toRefs(state),
};
},
});
</script>