Commit dfe94a913c6276a0ee06f893a13128cbfa24ce62
Merge branch 'develop' into WMSV2-HH
Showing
6 changed files
with
19 additions
and
11 deletions
src/main/java/com/huaheng/common/utils/file/FileUploadUtils.java
src/main/java/com/huaheng/pc/system/user/controller/ProfileController.java
... | ... | @@ -138,6 +138,7 @@ public class ProfileController extends BaseController |
138 | 138 | if (!file.isEmpty()) |
139 | 139 | { |
140 | 140 | String avatar = FileUploadUtils.upload(file); |
141 | + user.setId(getUser().getId()); | |
141 | 142 | user.setAvatar(avatar); |
142 | 143 | if (userService.updateUserInfo(user) > 0) |
143 | 144 | { |
... | ... |
src/main/resources/application.yml
src/main/resources/static/huaheng/js/huahengUI.js
... | ... | @@ -110,7 +110,11 @@ var table = { |
110 | 110 | clickToSelect: options.clickToSelect, // 是否启用点击选中行 |
111 | 111 | mobileResponsive: options.mobileResponsive, // 是否支持移动端适配 |
112 | 112 | onClickRow: options.onClickRow, // 点击某行触发的事件 |
113 | - onDblClickRow: options.onDblClickRow, // 双击某行触发的事件 | |
113 | + onDblClickRow:function(row){ | |
114 | + if (typeof detail != 'undefined') { | |
115 | + detail(row.id, row.code) | |
116 | + } | |
117 | + }, // 双击某行触发的事件 | |
114 | 118 | onClickCell: options.onClickCell, // 单击某格触发的事件 |
115 | 119 | onDblClickCell: options.onDblClickCell, // 双击某格触发的事件 |
116 | 120 | onEditableSave: options.onEditableSave, // 行内编辑保存的事件 |
... | ... | @@ -139,6 +143,7 @@ var table = { |
139 | 143 | }); |
140 | 144 | return optionsIds.substring(0, optionsIds.length - 1); |
141 | 145 | }, |
146 | + | |
142 | 147 | // 查询条件 |
143 | 148 | queryParams: function(params) { |
144 | 149 | var curParams = { |
... | ... | @@ -901,21 +906,23 @@ var table = { |
901 | 906 | }, |
902 | 907 | // 删除信息 |
903 | 908 | remove: function(id) { |
904 | - $.modal.confirm("确定删除该条" + $.table.options.modalName + "信息吗?", function() { | |
905 | - var url = $.common.isEmpty(id) ? $.table.options.removeUrl : $.table.options.removeUrl.replace("{id}", id); | |
909 | + table.set(); | |
910 | + $.modal.confirm("确定删除该条" + table.options.modalName + "信息吗?", function() { | |
911 | + var url = $.common.isEmpty(id) ? table.options.removeUrl : table.options.removeUrl.replace("{id}", id); | |
906 | 912 | var data = { "ids": id }; |
907 | 913 | $.operate.submit(url, "post", "json", data); |
908 | 914 | }); |
909 | 915 | }, |
910 | 916 | // 批量删除信息 |
911 | 917 | batRemove: function() { |
912 | - var rows = $.common.isEmpty($.table.options.id) ? $.table.selectFirstColumns() : $.table.selectColumns($.table.options.id); | |
918 | + table.set(); | |
919 | + var rows = $.common.isEmpty(table.options.id) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.id); | |
913 | 920 | if (rows.length == 0) { |
914 | 921 | $.modal.alertWarning("请至少选择一条记录"); |
915 | 922 | return; |
916 | 923 | } |
917 | 924 | $.modal.confirm("确认要删除选中的" + rows.length + "条数据吗?", function() { |
918 | - var url = $.table.options.removeUrl; | |
925 | + var url = table.options.removeUrl; | |
919 | 926 | var data = { "ids": rows.join() }; |
920 | 927 | $.operate.submit(url, "post", "json", data); |
921 | 928 | }); |
... | ... | @@ -923,7 +930,7 @@ var table = { |
923 | 930 | // 添加信息 |
924 | 931 | add: function(id) { |
925 | 932 | table.set(); |
926 | - var url = $.common.isEmpty(id) ? table.options.createUrl : $.table.options.createUrl.replace("{id}", id); | |
933 | + var url = $.common.isEmpty(id) ? table.options.createUrl : table.options.createUrl.replace("{id}", id); | |
927 | 934 | $.modal.open("添加" + table.options.modalName, url); |
928 | 935 | }, |
929 | 936 | // 修改信息 |
... | ... |
src/main/resources/templates/system/user/profile/avatar.html
... | ... | @@ -24,12 +24,12 @@ |
24 | 24 | </div> |
25 | 25 | <div th:include="include::footer"></div> |
26 | 26 | <script th:src="@{/ajax/libs/cropbox/cropbox.js}"></script> |
27 | -<script type="text/javascript"> | |
27 | + <script th:inline="javascript"> | |
28 | 28 | $(window).load(function() { |
29 | 29 | var options = { |
30 | 30 | thumbBox: '.thumbBox', |
31 | 31 | spinner: '.spinner', |
32 | - imgSrc: '/wms/img/profile.jpg' | |
32 | + imgSrc: '/wms/profile/' + [[${user.avatar}]] | |
33 | 33 | } |
34 | 34 | var cropper = $('.imageBox').cropbox(options); |
35 | 35 | $('#avatar').on('change', |
... | ... |
src/main/resources/templates/system/user/profile/profile.html
... | ... | @@ -35,7 +35,7 @@ |
35 | 35 | <div class="contact-box"> |
36 | 36 | <div class="col-sm-4"> |
37 | 37 | <div class="text-center"> |
38 | - <img alt="image" class="img-circle m-t-xs img-responsive" th:src="(${user.avatar} == '') ? '../../img/profiles.jpg' : '/profile/' + ${user.avatar}"> | |
38 | + <img alt="image" class="img-circle m-t-xs img-responsive" th:src="(${user.avatar} == '') ? '../../img/profiles.jpg' : '../../profile/' + ${user.avatar}"> | |
39 | 39 | <div class="m-t-xs font-bold">[[${user.loginIp}]]</div> |
40 | 40 | </div> |
41 | 41 | </div> |
... | ... |