feat:更新列表
This commit is contained in:
@ -1,33 +1,29 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="titleBox">
|
||||
<PageTitle title="积分列表">
|
||||
<!-- <el-button type="primary" @click="addEdit('add', '')">
|
||||
<el-icon style="vertical-align: middle"><CirclePlus /></el-icon>
|
||||
<span style="vertical-align: middle">新增</span>
|
||||
</el-button> -->
|
||||
<PageTitle title="在线用户监控">
|
||||
</PageTitle>
|
||||
</div>
|
||||
<!-- 搜索 -->
|
||||
<div ref="searchBox">
|
||||
<!-- <Search :searchArr="searchConfiger" @submit="onSearch" :key="pageData.keyCount"></Search> -->
|
||||
</div>
|
||||
<!-- <div ref="searchBox">
|
||||
<Search :searchArr="searchConfiger" @submit="onSearch" :key="pageData.keyCount"></Search>
|
||||
</div> -->
|
||||
<!-- 表格 -->
|
||||
<div class="tabBox">
|
||||
<MyTable :tableData="pageData.tableData" :tableColumn="pageData.tableColumn" :tableHeight="pageData.tableHeight"
|
||||
:key="pageData.keyCount" :tableConfiger="pageData.tableConfiger" :controlsWidth="pageData.controlsWidth">
|
||||
|
||||
|
||||
|
||||
<template #sex="{ row }">
|
||||
<dict-tag :options="D_BZ_XB" :value="row.sex" :tag="false" />
|
||||
</template>
|
||||
<!-- 操作 -->
|
||||
<template #controls="{ row }">
|
||||
<el-link type="primary" @click="addEdit('edit', row)">详情</el-link>
|
||||
</template>
|
||||
</MyTable>
|
||||
<Pages @changeNo="changeNo" @changeSize="changeSize" :tableHeight="pageData.tableHeight" :pageConfiger="{
|
||||
<!-- <Pages @changeNo="changeNo" @changeSize="changeSize" :tableHeight="pageData.tableHeight" :pageConfiger="{
|
||||
...pageData.pageConfiger,
|
||||
total: pageData.total
|
||||
}"></Pages>
|
||||
}"></Pages> -->
|
||||
</div>
|
||||
<!-- 编辑详情 -->
|
||||
<!-- <EditAddForm v-if="show" ref="detailDiloag" :dic="{ JQLB,JQLX,JQXL,JQZL,D_BZ_JQLY,D_BZ_JQFL,JQLB_DP,D_BZ_JQBQ,D_GS_SSYJ }"
|
||||
@ -46,30 +42,28 @@ import { socketCurrentUser } from "@/api/dataWatch/onlineUser.js"
|
||||
import { reactive, ref, onMounted, getCurrentInstance, nextTick } from "vue";
|
||||
// import { jflylxTypes } from "./dict.js"
|
||||
const { proxy } = getCurrentInstance();
|
||||
// const { D_GS_JFLX, } = proxy.$dict("D_GS_JFLX",); //获取字典数据
|
||||
const { D_BZ_XB, } = proxy.$dict("D_BZ_XB",); //获取字典数据
|
||||
|
||||
const detailDiloag = ref();
|
||||
const show = ref(false)
|
||||
const jflxArr = [{ label: '优秀信息员', value: '01' }, { label: '优秀研判员', value: '02' }] // jflx
|
||||
const userTypeArr = [
|
||||
{ label: '系统用户', value: '00' },
|
||||
{ label: '注册用户', value: '01' }
|
||||
]
|
||||
const searchConfiger = ref([
|
||||
{
|
||||
label: "姓名",
|
||||
prop: "xm",
|
||||
placeholder: "请输入姓名",
|
||||
label: "用户昵称",
|
||||
prop: "userName",
|
||||
placeholder: "请输入用户昵称",
|
||||
showType: "input"
|
||||
},
|
||||
// {
|
||||
// label: "身份证号",
|
||||
// prop: "sfzh",
|
||||
// placeholder: "请输入身份证号",
|
||||
// showType: "input"
|
||||
// },
|
||||
|
||||
{
|
||||
label: "积分类型",
|
||||
prop: "jflx",
|
||||
placeholder: "请选择积分类型",
|
||||
label: "用户类型",
|
||||
prop: "userType",
|
||||
placeholder: "请选择用户类型",
|
||||
showType: "select",
|
||||
options: jflxArr
|
||||
options: userTypeArr
|
||||
},
|
||||
|
||||
]);
|
||||
@ -90,15 +84,15 @@ const pageData = reactive({
|
||||
}, //分页
|
||||
controlsWidth: 160, //操作栏宽度
|
||||
tableColumn: [
|
||||
{ label: "姓名", prop: "xm" },
|
||||
// { label: "身份证号", prop: "sfzh" },
|
||||
{ label: "积分类型", prop: "jflx", showSolt: true },
|
||||
{ label: "积分来源类型", prop: "jflylx", showSolt: true },
|
||||
{ label: "积分", prop: "jf" },
|
||||
{ label: "积分获得时间", prop: "hdsj" },
|
||||
{ label: "所属部门", prop: "ssbm" },
|
||||
{ label: "所属市公安局", prop: "sssgaj" },
|
||||
{ label: "所属县公安局", prop: "ssxgaj" },
|
||||
{ label: "用户昵称", prop: "userName" },
|
||||
{ label: "登录账号", prop: "loginName" },
|
||||
{ label: "用户类型", prop: "userType_cname" },
|
||||
{ label: "性别", prop: "sex", showSolt: true },
|
||||
{ label: "移动电话", prop: "mobile" },
|
||||
{ label: "邮箱", prop: "email" },
|
||||
{ label: "管理部门", prop: "managerOrgName" },
|
||||
{ label: "岗位名称", prop: "positionName" },
|
||||
{ label: "行业号码", prop: "inDustRialId" },
|
||||
{ label: "备注", prop: "bz", showOverflowTooltip: true },
|
||||
]
|
||||
});
|
||||
@ -123,18 +117,26 @@ const changeSize = (val) => {
|
||||
getList()
|
||||
}
|
||||
|
||||
const getUserTypeName = (val) => {
|
||||
const userTypeObj = userTypeArr.find(item => item.value === val)
|
||||
return userTypeObj ? userTypeObj.label : ''
|
||||
}
|
||||
|
||||
|
||||
const getList = () => {
|
||||
pageData.tableConfiger.loading = true;
|
||||
const params = {
|
||||
pageCurrent: pageData.pageConfiger.pageCurrent,
|
||||
pageSize: pageData.pageConfiger.pageSize,
|
||||
...listQuery.value
|
||||
}
|
||||
|
||||
socketCurrentUser(params).then(res => {
|
||||
console.log(res);
|
||||
pageData.tableData = res.records || [];
|
||||
pageData.total = res.total;
|
||||
// socketCurrentUser 返回的是数组格式,不是分页对象
|
||||
pageData.tableData = Array.isArray(res) ? res : [];
|
||||
pageData.tableData = pageData.tableData.map(item => {
|
||||
item.userType_cname = getUserTypeName(item.userType);
|
||||
return item;
|
||||
})
|
||||
pageData.total = Array.isArray(res) ? res.length : 0;
|
||||
|
||||
}).finally(() => {
|
||||
pageData.tableConfiger.loading = false;
|
||||
|
||||
Reference in New Issue
Block a user