| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243 |
- <!DOCTYPE HTML>
- <html xmlns:th="http://www.thymeleaf.org"
- xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
- layout:decorate="~{admin/common/common}">
- <head>
- <title>内容列表</title>
- <style>
- /* .conditionLabel {
- display: inline-block;
- } */
- .inline-block {
- display: inline-block;
- line-height: 40px;
- }
- </style>
- </head>
- <body layout:fragment="content">
- <nav class="breadcrumb">
- <i class="Hui-iconfont"></i>
- 首页
- <span class="c-gray en">></span>系统管理
- <span class="c-gray en">></span>用户管理
- <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
- href="javascript:location.replace(location.href);" title="刷新">
- <i class="Hui-iconfont"></i>
- </a>
- </nav>
- <form id="myForm" th:action="@{/admin/user/list}" th:method="get">
- <div class="page-container">
- <div class="text-c">
- <th:block th:if="${user_type==0}">
- <div class="inline-block">
- <label class="conditionLabel">用户类型:</label>
- <span class="select-box" style="width:200px;line-height: 10px;">
- <select th:id="user_type" class="select" th:name="user_type">
- <option value="">--请选择用户类型--</option>
- <option th:selected="${searchCondition.user_type==0}" value="0">政府用户</option>
- <option th:selected="${searchCondition.user_type==3}" value="3">企业用户</option>
- </select>
- </span>
- </div>
- <div class="inline-block">
- <label class="conditionLabel">所属板块:</label>
- <span class="select-box" style="width:200px;line-height: 10px;">
- <select th:id="street_id" class="select" th:name="street_id">
- <option value="">--请选择所属板块--</option>
- <option th:if="${item.is_start}" th:each="item : ${streetList}" th:value="${item.id}"
- th:text="${item.name}" th:selected="${searchCondition.street_id==item.id}">
- </select>
- </span>
- </div>
- </th:block>
- <th:block th:if="${user_type==2||user_type==4}">
- <div class="inline-block">
- <label class="conditionLabel">用户类型:</label>
- <span class="select-box" style="width:200px;line-height: 10px;">
- <select th:id="user_type" class="select" th:name="user_type">
- <option value="">--请选择用户类型--</option>
- <option th:selected="${searchCondition.user_type==0}" value="0"
- th:if="${user_type==2}">政府用户</option>
- <option th:selected="${searchCondition.user_type==4}" value="4">街道用户</option>
- <option th:selected="${searchCondition.user_type==1}" value="1"
- th:if="${user_type==2}">园区用户</option>
- <option th:selected="${searchCondition.user_type==3}" value="3">企业用户</option>
- </select>
- </span>
- </div>
- <div class="inline-block" th:if="${user_type==2}">
- <label class="conditionLabel">所属板块:</label>
- <span class="select-box" style="width:200px;line-height: 10px;">
- <select th:id="street_id" class="select" th:name="street_id">
- <option value="">--请选择所属板块--</option>
- <option th:if="${item.is_start}" th:each="item : ${streetList}" th:value="${item.id}"
- th:text="${item.name}" th:selected="${searchCondition.street_id==item.id}">
- </select>
- </span>
- </div>
- <div class="inline-block" th:if="${user_type==2}">
- <label class="conditionLabel">角色:</label>
- <span class="select-box" style="width:200px;line-height: 10px;">
- <select th:id="role_id" class="select" th:name="role_id">
- <option value="">--请选择角色--</option>
- <option th:unless="${item.user_type==3}" th:each="item : ${roles}" th:value="${item.id}"
- th:text="${item.name}" th:selected="${searchCondition.role_id==item.id}">
- </select>
- </span>
- </div>
- </th:block>
- <div class="inline-block">
- <label th:unless="${user_type==2}" class="conditionLabel">角色:</label>
- <span th:unless="${user_type==2}" class="select-box" style="width:200px;line-height: 10px;">
- <select th:id="role_id" class="select" th:name="role_id">
- <option value="">--请选择角色--</option>
- <option th:each="item : ${roles}" th:value="${item.id}" th:text="${item.name}" th:selected="${searchCondition.role_id==item.id}">
- </select>
- </span>
- </div>
- <div class="inline-block">
- <label class="conditionLabel">单位名称:</label>
- <input type="text" class="input-text" style="width:200px" placeholder="请输入单位名称" name="company_name"
- th:value="${searchCondition.company_name}"/>
- </div>
- <div class="inline-block">
- <label class="conditionLabel">用户:</label>
- <input type="text" class="input-text" style="width:200px" placeholder="请输入姓名,账号,联系方式" name="keyword"
- th:value="${keyword}"/>
- </div>
- <button type="submit" class="btn btn-primary">
- 搜索
- </button>
- </div>
- <div class="cl pd-5 bg-1 bk-gray mt-20">
- <span class="l">
- <a onClick="user_start('/admin/user/startBatch')" class="btn btn-primary radius"><i
- class="Hui-iconfont"></i> 启用</a>
- <a onClick="user_stop('/admin/user/stopBatch')" class="btn btn-default radius"><i class="Hui-iconfont"></i> 禁用</a>
- <a onClick="user_del('/admin/user/deleteBatch')" class="btn btn-danger radius"><i class="Hui-iconfont"></i> 删除</a>
- <a th:onclick="'javascript:user_dialog(\'新增\',\'/admin/user/add\',\'800\',\'500\');'"
- class="btn btn-primary radius"><i class="Hui-iconfont"></i> 新增</a>
- </span>
- <span class="r">共有数据:<strong th:text="${pageInfo.total}" id="total">54</strong> 条</span>
- </div>
- <table class="table table-border table-bordered table-bg table-hover">
- <thead>
- <tr class="text-c">
- <th width="25"><input type="checkbox" name="" value=""/></th>
- <th>账号</th>
- <th>姓名</th>
- <th>联系方式</th>
- <th>创建日期</th>
- <th th:if="${user_type==2||user_type==4}">用户类型</th>
- <th>角色</th>
- <th>单位名称</th>
- <th>所属板块</th>
- <th>管理员</th>
- <th>状态</th>
- <th width="150">操作</th>
- </tr>
- </thead>
- <tbody>
- <tr class="text-c" th:each="model,iterStat:${pageInfo.list}" th:object="${model}">
- <td>
- <input type="checkbox" th:value="*{id}" th:id="${iterStat.index+1}" name="id"/>
- </td>
- <td th:text="*{nick_name}"></td>
- <td th:text="*{user_name}"></td>
- <td th:text="*{phone}"></td>
- <td th:text="*{create_time}"></td>
- <td th:if="${user_type==2||user_type==4}">
- <span th:if="*{user_type==0}">政府用户</span>
- <span th:if="*{user_type==4}">街道用户</span>
- <span th:if="*{user_type==1}">园区用户</span>
- <span th:if="*{user_type==3}">企业用户</span>
- </td>
- <td th:text="*{role_names}"></td>
- <td th:text="*{super_department_name}"></td>
- <!--<td th:if="${user_type==2}" th:text="*{super_department_name}"></td>
- <td th:unless="${user_type==2}" th:text="*{department_name}"></td>-->
- <td th:text="*{street_name}"></td>
- <td><span th:if="*{is_admin}">是</span><span th:unless="*{is_admin}">否</span></td>
- <td class="td-status">
- <span class="label radius" th:unless="*{is_start}">禁用</span>
- <span class="label radius label-success" th:if="*{is_start}">启用</span>
- </td>
- <td class="td-manage">
- <a title="编辑"
- th:onclick="'javascript:user_dialog(\'编辑\',\'/admin/user/edit/'+*{id}+'\',\'800\',\'500\');'"
- class="ml-5" style="text-decoration:none">编辑</a>
- <a title="详情"
- th:onclick="'javascript:user_dialog(\'详情\',\'/admin/user/check/'+*{id}+'\',\'800\',\'500\');'"
- class="ml-5" style="text-decoration:none">详情</a>
- <a title="重置密码" th:onclick="'javascript:user_reset(\'/admin/user/resetPassword/'+*{id}+'\');'"
- class="ml-5" style="text-decoration:none">重置密码</a>
- </td>
- </tr>
- </tbody>
- </table>
- <div th:replace="admin/common/page :: page"></div>
- </div>
- </form>
- <script type="text/javascript" th:src="@{/js/common/page.js}"></script>
- <script type="text/javascript" th:src="@{/js/sys/user/user_list.js}"></script>
- <script th:inline="javascript">
- var user_type = [[${searchCondition.user_type}]];
- var street_id = [[${searchCondition.street_id}]];
- var role_id = [[${searchCondition.role_id}]];
- $(function () {
- if (user_type != null || street_id != null){
- roleList(user_type, street_id);
- }
- });
- $("#user_type").change(function(){
- var user_type = $("#user_type").val();
- var street_id = $("#street_id").val();
- roleList(user_type, street_id);
- });
- $("#street_id").change(function(){
- var street_id = $("#street_id").val();
- var user_type = $("#user_type").val();
- roleList(user_type, street_id);
- });
- function roleList(user_type, street_id) {
- $.ajax({
- url: pagePath + "/admin/user/role",
- type: "get",
- data: {
- 'user_type': user_type,
- 'street_id': street_id
- },
- dataType: "json",
- success: function (result) {
- if (result.success) {
- var roles = result.obj;
- $("#role_id").empty();
- $("#role_id").append(new Option("--请选择角色--", ""));
- for (var i = 0; i< roles.length; i++){
- var opt = new Option(roles[i].name, roles[i].id);
- $("#role_id").append(opt);
- }
- if (role_id != null){
- $("#role_id").find("option[value="+role_id+"]").attr("selected",true);
- }
- } else {
- errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- }
- </script>
- </body>
- </html>
|