This commit is contained in:
77
2024-05-20 01:18:49 +08:00
parent e2bc571d8c
commit 0f39d07b48
4 changed files with 78 additions and 47 deletions

View File

@@ -56,3 +56,11 @@ export function exportDkCustomer(query) {
params: query params: query
}) })
} }
export function loginOut(id) {
return request({
url: '/dk/dkCustomer/loginOut',
method: 'post',
data: {id:id}
})
}

View File

@@ -76,3 +76,11 @@ export function authTenantList() {
method: 'get' method: 'get'
}) })
} }
export function getTenantCurrent() {
return request({
url: '/auth/tenant/get',
method: 'get'
})
}

View File

@@ -19,6 +19,15 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="用户编号" prop="userCode">
<el-input
v-model="queryParams.userCode"
placeholder="请输入用户编号"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -26,24 +35,13 @@
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['dk:dkCustomer:export']"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="dkCustomerList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="dkCustomerList" @selection-change="handleSelectionChange">
<el-table-column label="手机" align="center" prop="phoneNumber"/> <el-table-column label="手机" align="center" prop="phoneNumber"/>
<el-table-column label="用户名称" align="center" prop="nickName"/> <el-table-column label="用户名称" align="center" prop="nickName"/>
<el-table-column label="用户编号" align="center" prop="userCode"/>
<el-table-column label="真实名称" align="center" prop="realName"/> <el-table-column label="真实名称" align="center" prop="realName"/>
<el-table-column label="是否实名" align="center" prop="realNameAuth"> <el-table-column label="是否实名" align="center" prop="realNameAuth">
<template v-slot="scope"> <template v-slot="scope">
@@ -93,29 +91,27 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="最后登陆IP" align="center" prop="lastLoginIp"/> <el-table-column label="最后登陆IP" align="center" prop="lastLoginIp"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150" fixed="right">
<template v-slot="scope"> <template v-slot="scope">
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit"
@click="handleUpdateAccount(scope.row)" @click="handleUpdateAccount(scope.row)"
>修改余额 >修改余额
</el-button> </el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-document"
@click="handleInfo(scope.row)" @click="handleInfo(scope.row)"
>详情 >详情
</el-button> </el-button>
<el-button <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)">
size="mini" <el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
type="text" <el-dropdown-menu slot="dropdown">
icon="el-icon-key" <el-dropdown-item command="handleUpdatePwd" icon="el-icon-key">重置密码</el-dropdown-item>
@click="handleUpdatePwd(scope.row)" <el-dropdown-item command="handleLogoOut" icon="el-icon-close"><span style="color: red">强制APP下线</span></el-dropdown-item>
>重置密码 </el-dropdown-menu>
</el-button> </el-dropdown>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -133,12 +129,8 @@
</template> </template>
<script> <script>
import { import { listDkCustomer, loginOut, resetCustomerPwd, updateDkCustomer } from '@/api/dk/dkCustomer'
listDkCustomer, import { stopStatusList, yesOrNoList } from '@/constant/statusMap'
updateDkCustomer,
exportDkCustomer, resetCustomerPwd
} from '@/api/dk/dkCustomer'
import { yesOrNoList, stopStatusList } from '@/constant/statusMap'
import InfoDialog from './info' import InfoDialog from './info'
import UpdateAmountDialog from './update-amount' import UpdateAmountDialog from './update-amount'
import { updateAllowSignature } from '@/api/dk/dkCustomerInfo' import { updateAllowSignature } from '@/api/dk/dkCustomerInfo'
@@ -173,6 +165,7 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
userCode: undefined,
phoneNumber: undefined, phoneNumber: undefined,
nickName: undefined nickName: undefined
} }
@@ -258,6 +251,22 @@ export default {
this.loading = false this.loading = false
}) })
}, },
handleLogoOut(row){
this.$confirm('是否要强制T该用户下线?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.loading = true;
return loginOut(row.id);
}).then(() => {
this.loading = false;
this.getList();
this.msgSuccess("操作成功");
}).catch(() => {
this.loading = false;
});
},
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
@@ -274,22 +283,18 @@ export default {
this.single = selection.length !== 1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 导出按钮操作 */ handleCommand(command, row) {
handleExport() { switch (command) {
const queryParams = this.queryParams case "handleUpdatePwd":
this.$confirm('是否确认导出所有客户数据项?', '警告', { this.handleUpdatePwd(row);
confirmButtonText: '确定', break;
cancelButtonText: '取消', case "handleLogoOut":
type: 'warning' this.handleLogoOut(row);
}).then(() => { break;
this.exportLoading = true default:
return exportDkCustomer(queryParams) break;
}).then(response => { }
this.download(response.msg) },
this.exportLoading = false
}).catch(() => {
})
}
} }
} }
</script> </script>

View File

@@ -204,7 +204,7 @@
</el-row> </el-row>
<!-- 添加或修改用户配置对话框 --> <!-- 添加或修改用户配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
@@ -233,7 +233,9 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item v-if="form.userId == undefined" label="用户名称" prop="userName"> <el-form-item v-if="form.userId == undefined" label="用户名称" prop="userName">
<el-input v-model="form.userName" placeholder="请输入用户名称" maxlength="30" /> <el-input v-model="form.userName" placeholder="请输入用户名称" maxlength="30" >
<template slot="prepend">{{form.prefix+'-'}}</template>
</el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@@ -346,6 +348,7 @@ import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUs
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { getTenantCurrent } from '@/api/login'
export default { export default {
name: "User", name: "User",
@@ -562,7 +565,14 @@ export default {
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset();
getUser().then(response => { getTenantCurrent().then(res => {
if(!res.data){
this.$modal.msgWarning("未检测到平台");
return;
}
this.form.prefix = res.data.prefix
return getUser()
}).then(response => {
this.postOptions = response.data.posts; this.postOptions = response.data.posts;
this.roleOptions = response.data.roles; this.roleOptions = response.data.roles;
this.open = true; this.open = true;