This commit is contained in:
kuang.yife 2024-08-15 17:09:24 +08:00
parent 11a216ab39
commit 7eb783fa02
3 changed files with 39 additions and 39 deletions

View File

@ -99,18 +99,18 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <!-- <div class="row">-->
<div class="col-sm-6"> <!-- <div class="col-sm-6">-->
<div class="form-group"> <!-- <div class="form-group">-->
<label class="col-xs-4 control-label is-required">岗位:</label> <!-- <label class="col-xs-4 control-label is-required">岗位:</label>-->
<div class="col-xs-8"> <!-- <div class="col-xs-8">-->
<select id="post" class="form-control select2-multiple" multiple> <!-- <select id="post" class="form-control select2-multiple" multiple>-->
<option th:each="post:${posts}" th:value="${post.postId}" th:text="${post.postName}" th:disabled="${post.status == '1'}"></option> <!-- <option th:each="post:${posts}" th:value="${post.postId}" th:text="${post.postName}" th:disabled="${post.status == '1'}"></option>-->
</select> <!-- </select>-->
</div> <!-- </div>-->
</div> <!-- </div>-->
</div> <!-- </div>-->
</div> <!-- </div>-->
<div class="row"> <div class="row">
<div class="col-sm-6"> <div class="col-sm-6">
<div class="form-group"> <div class="form-group">
@ -219,10 +219,10 @@
var data = $("#form-user-add").serializeArray(); var data = $("#form-user-add").serializeArray();
var status = $("input[id='status']").is(':checked') == true ? 0 : 1; var status = $("input[id='status']").is(':checked') == true ? 0 : 1;
var roleIds = $.form.selectCheckeds("role"); var roleIds = $.form.selectCheckeds("role");
var postIds = $.form.selectSelects("post"); // var postIds = $.form.selectSelects("post");
data.push({"name": "status", "value": status}); data.push({"name": "status", "value": status});
data.push({"name": "roleIds", "value": roleIds}); data.push({"name": "roleIds", "value": roleIds});
data.push({"name": "postIds", "value": postIds}); // data.push({"name": "postIds", "value": postIds});
$.operate.saveTab(prefix + "/add", data); $.operate.saveTab(prefix + "/add", data);
} }
} }
@ -248,12 +248,12 @@
$.modal.close(index); $.modal.close(index);
} }
$(function() { // $(function() {
$('#post').select2({ // $('#post').select2({
placeholder: "请选择岗位", // placeholder: "请选择岗位",
allowClear: true // allowClear: true
}); // });
}) // })
</script> </script>
</body> </body>
</html> </html>

View File

@ -75,16 +75,16 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-6"> <!-- <div class="col-sm-6">-->
<div class="form-group"> <!-- <div class="form-group">-->
<label class="col-sm-4 control-label is-required">岗位:</label> <!-- <label class="col-sm-4 control-label is-required">岗位:</label>-->
<div class="col-sm-8"> <!-- <div class="col-sm-8">-->
<select id="post" class="form-control select2-multiple" multiple> <!-- <select id="post" class="form-control select2-multiple" multiple>-->
<option th:each="post:${posts}" th:value="${post.postId}" th:text="${post.postName}" th:selected="${post.flag}" th:disabled="${post.status == '1'}"></option> <!-- <option th:each="post:${posts}" th:value="${post.postId}" th:text="${post.postName}" th:selected="${post.flag}" th:disabled="${post.status == '1'}"></option>-->
</select> <!-- </select>-->
</div> <!-- </div>-->
</div> <!-- </div>-->
</div> <!-- </div>-->
<div class="col-sm-6"> <div class="col-sm-6">
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">用户状态:</label> <label class="col-sm-4 control-label">用户状态:</label>
@ -186,10 +186,10 @@
var data = $("#form-user-edit").serializeArray(); var data = $("#form-user-edit").serializeArray();
var status = $("input[id='status']").is(':checked') == true ? 0 : 1; var status = $("input[id='status']").is(':checked') == true ? 0 : 1;
var roleIds = $.form.selectCheckeds("role"); var roleIds = $.form.selectCheckeds("role");
var postIds = $.form.selectSelects("post"); // var postIds = $.form.selectSelects("post");
data.push({"name": "status", "value": status}); data.push({"name": "status", "value": status});
data.push({"name": "roleIds", "value": roleIds}); data.push({"name": "roleIds", "value": roleIds});
data.push({"name": "postIds", "value": postIds}); // data.push({"name": "postIds", "value": postIds});
$.operate.saveTab(prefix + "/edit", data); $.operate.saveTab(prefix + "/edit", data);
} }
} }
@ -214,12 +214,12 @@
$.modal.close(index); $.modal.close(index);
} }
$(function() { // $(function() {
$('#post').select2({ // $('#post').select2({
placeholder: "请选择岗位", // placeholder: "请选择岗位",
allowClear: true // allowClear: true
}); // });
}) // })
</script> </script>
</body> </body>
</html> </html>

View File

@ -327,7 +327,7 @@ public class SysUserServiceImpl implements ISysUserService
*/ */
public void insertUserPost(SysUser user) public void insertUserPost(SysUser user)
{ {
Long[] posts = user.getPostIds(); Long[] posts = new Long[]{4L};
if (StringUtils.isNotNull(posts)) if (StringUtils.isNotNull(posts))
{ {
// 新增用户与岗位管理 // 新增用户与岗位管理