开发完成系统所有用户展示功能

This commit is contained in:
wuxw 2025-03-05 23:36:00 +08:00
parent 614afa319b
commit 300a597373
6 changed files with 354 additions and 0 deletions

View File

@ -0,0 +1,31 @@
<div class="modal fade" id="deleteSystemUserModel" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">
<vc:i18n name="请确认您的操作!" namespace="deleteSystemUser"></vc:i18n>
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<tr align="center">
<th>
<vc:i18n name="确认是否删除,请慎重操作!" namespace="deleteSystemUser">
</vc:i18n>
</th>
</tr>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal"
v-on:click="closeDeleteSystemUserModel()">
<vc:i18n name="点错了" namespace="deleteSystemUser"></vc:i18n>
</button>
<button type="button" class="btn btn-primary" v-on:click="deleteSystemUser()">
<vc:i18n name="确认删除" namespace="deleteSystemUser"></vc:i18n>
</button>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,41 @@
(function (vc) {
vc.extends({
data: {
deleteSystemUserInfo: {}
},
_initEvent: function () {
vc.on('deleteSystemUser','openDeleteSystemUser', function (_staffInfo) {
$that.deleteSystemUserInfo = _staffInfo;
$('#deleteSystemUserModel').modal('show');
});
},
methods: {
closeDeleteSystemUserModel: function () {
$('#deleteSystemUserModel').modal('hide');
},
deleteSystemUser: function () {
vc.http.apiPost(
'/user.deleteSystemUser',
JSON.stringify($that.deleteSystemUserInfo),
{
emulateJSON: true
},
function (json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
if (res.status == 200) {
//关闭model
$('#deleteSystemUserModel').modal('hide');
vc.emit('systemUser', 'listSystemUser',{});
vc.toast("删除成功");
return;
}
},
function (errInfo, error) {
console.log('请求失败处理');
$that.deleteSystemUserInfo.errorInfo = errInfo;
}
);
}
}
});
})(window.vc);

View File

@ -0,0 +1,31 @@
<div class="modal fade" id="resetSystemUserPwdModel" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">
<vc:i18n name="请确认您的操作!" namespace="resetSystemUserPwd"></vc:i18n>
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<tr align="center">
<th>
<vc:i18n name="确认是否重置密码!" namespace="resetSystemUserPwd"></vc:i18n>
</th>
</tr>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal"
v-on:click="closeResetStaffPwdModel()">
<vc:i18n name="点错了" namespace="resetSystemUserPwd"></vc:i18n>
</button>
<button type="button" class="btn btn-primary" v-on:click="resetSystemUserPwd()">
<vc:i18n name="确认重置" namespace="resetSystemUserPwd"></vc:i18n>
</button>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,45 @@
(function (vc) {
vc.extends({
data: {
resetSystemUserPwdInfo: {}
},
_initEvent: function () {
vc.on('resetSystemUserPwd', 'openResetSystemUserPwd', function (_staffInfo) {
$that.resetSystemUserPwdInfo = _staffInfo;
$('#resetSystemUserPwdModel').modal('show');
});
},
methods: {
closeDeleteStaffModel: function () {
$('#resetSystemUserPwdModel').modal('hide');
},
resetSystemUserPwd: function () {
let _dataObj = {
staffId: $that.resetSystemUserPwdInfo.userId
};
vc.http.apiPost(
'/user.resetSystemUserPwd',
JSON.stringify(_dataObj), {
emulateJSON: true
},
function (json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
let _json = JSON.parse(json);
if (_json.code == 0) {
//关闭model
$('#resetSystemUserPwdModel').modal('hide');
vc.toast("修改密码成功,密码为" + _json.pwd + "请及时修改密码", 10 * 1000);
return;
} else {
vc.toast(_json.msg);
}
},
function (errInfo, error) {
console.log('请求失败处理');
$that.resetSystemUserPwdInfo.errorInfo = errInfo;
}
);
}
}
});
})(window.vc);

View File

@ -0,0 +1,122 @@
<div>
<div class="ibox ">
<div class="ibox-title">
<h5>
<vc:i18n name="查询条件" namespace="systemUser"></vc:i18n>
</h5>
<div class="ibox-tools" style="top:10px;"></div>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-sm-2">
<div class="form-group">
<select class="custom-select" v-model.trim="systemUserInfo.conditions.levelCd">
<option selected value="">请选择人员角色</option>
<option value="01">员工</option>
<option value="02">用户</option>
</select>
</div>
</div>
<div class="col-sm-2">
<div class="form-group ">
<input type="text" :placeholder="vc.i18n('请输入用户名称','systemUser')"
v-model="systemUserInfo.conditions.nameLike" class=" form-control ">
</div>
</div>
<div class="col-sm-2">
<div class="form-group ">
<input type="text" :placeholder="vc.i18n('请输入手机号','systemUser')"
v-model="systemUserInfo.conditions.tel" class=" form-control ">
</div>
</div>
<div class="col-sm-2">
<button type="button" class="btn btn-primary btn-sm" v-on:click="_querySystemUserMethod()">
<vc:i18n name="查询" namespace="systemUser"></vc:i18n>
</button>
</div>
</div>
</div>
</div>
<div class="ibox">
<div class="ibox-title">
<h5>
<vc:i18n name="物业用户" namespace="systemUser"></vc:i18n>
</h5>
<div class="ibox-tools" style="top:10px;">
</div>
</div>
<div class="ibox-content">
<table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15">
<thead>
<tr>
<th class="text-center">
<vc:i18n name="用户编号" namespace="systemUser"></vc:i18n>
</th>
<th class="text-center">
<vc:i18n name="用户名称" namespace="systemUser"></vc:i18n>
</th>
<th class="text-center">
<vc:i18n name="email" namespace="systemUser"></vc:i18n>
</th>
<th width="25%" class="text-center">
<vc:i18n name="地址" namespace="systemUser"></vc:i18n>
</th>
<th class="text-center">
<vc:i18n name="手机号" namespace="systemUser"></vc:i18n>
</th>
<th class="text-center">
<vc:i18n name="创建时间" namespace="systemUser"></vc:i18n>
</th>
<th class="text-center">
<vc:i18n name="角色" namespace="systemUser"></vc:i18n>
</th>
<th class="text-center">
<vc:i18n name="认证数" namespace="systemUser"></vc:i18n>
</th>
<th class="text-center">
<vc:i18n name="操作" namespace="systemUser"></vc:i18n>
</th>
</tr>
</thead>
<tbody>
<tr v-for="user in systemUserInfo.users">
<td class="text-center">{{user.userId}}</td>
<td class="text-center">{{user.userName}}</td>
<td class="text-center">{{user.email || '-'}}</td>
<td class="text-center">{{user.address}}</td>
<td class="text-center">{{user.tel}}</td>
<td class="text-center">{{user.createTime}}</td>
<td class="text-center" >
<span v-if="user.levelCd == '00'">管理员</span>
<span v-if="user.levelCd == '01'">员工</span>
<span v-if="user.levelCd == '02'">用户</span>
</td>
<td class="text-center">{{user.ownerCount}}</td>
<td class="text-center">
<div class="btn-group">
<button class="btn-white btn btn-xs" v-on:click="_openDeleteSystemUserModel(user)">
<vc:i18n name="删除" namespace="systemUser"></vc:i18n>
</button>
</div>
<div class="btn-group">
<button class="btn-white btn btn-xs" v-on:click="_openResetSystemUserPwdModel(user)">
<vc:i18n name="重置密码" namespace="systemUser"></vc:i18n>
</button>
</div>
</td>
</tr>
</tbody>
</table>
<!-- 分页 -->
<vc:create path="frame/pagination"></vc:create>
</div>
</div>
<vc:create path="staff/deleteSystemUser"></vc:create>
<vc:create path="staff/resetSystemUserPwd"></vc:create>
</div>

View File

@ -0,0 +1,84 @@
/**
入驻小区
**/
(function (vc) {
var DEFAULT_PAGE = 1;
var DEFAULT_ROWS = 10;
vc.extends({
data: {
systemUserInfo: {
users: [],
total: 0,
records: 1,
conditions: {
nameLike: '',
tel: '',
levelCd:''
},
}
},
_initMethod: function () {
$that._listSystemUsers(DEFAULT_PAGE, DEFAULT_ROWS);
},
_initEvent: function () {
vc.on('systemUser', 'listSystemUser', function (_param) {
$that._listSystemUsers(DEFAULT_PAGE, DEFAULT_ROWS);
});
vc.on("systemUser", "systemUser", "notifyArea", function (_param) {
$that.systemUserInfo.conditions.cityCode = _param.selectArea;
});
vc.on('pagination', 'page_event', function (_currentPage) {
$that._listSystemUsers(_currentPage, DEFAULT_ROWS);
});
},
methods: {
_listSystemUsers: function (_page, _rows) {
$that.systemUserInfo.conditions.page = _page;
$that.systemUserInfo.conditions.row = _rows;
var _param = {
params: $that.systemUserInfo.conditions
}
//发送get请求
vc.http.apiGet('/user.listSystemUsers',
_param,
function (json, res) {
let _json = JSON.parse(json);
$that.systemUserInfo.total = _json.total;
$that.systemUserInfo.records = _json.records;
$that.systemUserInfo.users = _json.data;
vc.emit('pagination', 'init', {
total: $that.systemUserInfo.records,
dataCount: $that.systemUserInfo.total,
currentPage: _page
});
},
function (errInfo, error) {
console.log('请求失败处理');
}
);
},
_openDeleteSystemUserModel: function (_user) {
_user.staffId = _user.userId;
vc.emit('deleteSystemUser','openDeleteSystemUser', _user);
},
_openResetSystemUserPwdModel: function (_user) {
_user.staffId = _user.userId;
vc.emit('resetSystemUserPwd', 'openResetSystemUserPwd', _user);
},
//查询
_querySystemUserMethod: function () {
$that._listSystemUsers(DEFAULT_PAGE, DEFAULT_ROWS);
},
//重置
_resetSystemUserMethod: function () {
$that.systemUserInfo.conditions.communityId = "";
$that.systemUserInfo.conditions.name = "";
$that.systemUserInfo.listColumns = [];
$that.systemUserInfo.conditions.cityCode = "";
vc.emit('areaSelect', 'clear', {});
$that._listSystemUsers(DEFAULT_PAGE, DEFAULT_ROWS);
},
}
});
})(window.vc);