mirror of
https://github.com/getrebuild/rebuild.git
synced 2025-02-24 14:25:05 +08:00
picklist fixed
This commit is contained in:
parent
9e3b70a4e6
commit
427fdf7e20
3 changed files with 17 additions and 8 deletions
|
@ -307,13 +307,13 @@ create table /*!32312 if not exists*/ `attachment_folder` (
|
|||
-- Init data
|
||||
|
||||
-- User
|
||||
INSERT INTO `user` (`USER_ID`, `LOGIN_NAME`, `PASSWORD`, `FULL_NAME`, `DEPT_ID`, `ROLE_ID`, `IS_DISABLED`, `CREATED_ON`, `CREATED_BY`, `MODIFIED_ON`, `MODIFIED_BY`, `QUOCK_CODE`)
|
||||
INSERT INTO `user` (`USER_ID`, `LOGIN_NAME`, `PASSWORD`, `FULL_NAME`, `DEPT_ID`, `ROLE_ID`, `IS_DISABLED`, `CREATED_ON`, `CREATED_BY`, `MODIFIED_ON`, `MODIFIED_BY`, `QUICK_CODE`)
|
||||
VALUES
|
||||
('001-0000000000000000', 'system', 'system', '系统用户', '002-0000000000000001', '003-0000000000000001', 'T', CURRENT_TIMESTAMP, '001-0000000000000000', CURRENT_TIMESTAMP, '001-0000000000000000', 'XTYH'),
|
||||
('001-0000000000000001', 'admin', '8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918', '超级管理员', '002-0000000000000001', '003-0000000000000001', 'F', CURRENT_TIMESTAMP, '001-0000000000000000', CURRENT_TIMESTAMP, '001-0000000000000000', 'CJGLY');
|
||||
-- Department
|
||||
INSERT INTO `department` (`DEPT_ID`, `NAME`, `CREATED_ON`, `CREATED_BY`, `MODIFIED_ON`, `MODIFIED_BY`, `QUOCK_CODE`)
|
||||
INSERT INTO `department` (`DEPT_ID`, `NAME`, `CREATED_ON`, `CREATED_BY`, `MODIFIED_ON`, `MODIFIED_BY`, `QUICK_CODE`)
|
||||
VALUES ('002-0000000000000001', '总部', CURRENT_TIMESTAMP, '001-0000000000000000', CURRENT_TIMESTAMP, '001-0000000000000000', 'ZB');
|
||||
-- Role
|
||||
INSERT INTO `role` (`ROLE_ID`, `NAME`, `CREATED_ON`, `CREATED_BY`, `MODIFIED_ON`, `MODIFIED_BY`, `QUOCK_CODE`)
|
||||
INSERT INTO `role` (`ROLE_ID`, `NAME`, `CREATED_ON`, `CREATED_BY`, `MODIFIED_ON`, `MODIFIED_BY`, `QUICK_CODE`)
|
||||
VALUES ('003-0000000000000001', '管理员', CURRENT_TIMESTAMP, '001-0000000000000000', CURRENT_TIMESTAMP, '001-0000000000000000', 'GLY');
|
||||
|
|
|
@ -58,9 +58,9 @@ public class PickListControll extends BaseControll {
|
|||
|
||||
@RequestMapping("picklist-sets")
|
||||
public void picklistSet(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
||||
JSONObject config = (JSONObject) ServletUtils.getRequestJson(request);
|
||||
String entity = getParameterNotNull(request, "entity");
|
||||
String field = getParameterNotNull(request, "field");
|
||||
JSONObject config = (JSONObject) ServletUtils.getRequestJson(request);
|
||||
|
||||
Field field2field = MetadataHelper.getField(entity, field);
|
||||
Application.getBean(PickListService.class).updateBatch(field2field, config);
|
||||
|
|
|
@ -45,8 +45,7 @@
|
|||
<script type="text/babel">
|
||||
let default_item
|
||||
$(document).ready(function(){
|
||||
const entity = $urlp('entity'), field = $urlp('field')
|
||||
const query = 'entity=' + entity + '&field=' + field
|
||||
const query = 'entity=' + $urlp('entity') + '&field=' + $urlp('field')
|
||||
|
||||
$.get(rb.baseUrl + '/admin/field/picklist-gets?isAll=true&' + query, function(res){
|
||||
$(res.data).each(function(){
|
||||
|
@ -63,7 +62,7 @@ $(document).ready(function(){
|
|||
|
||||
$('.J_confirm').click(function(){
|
||||
let text = $val('.J_text');
|
||||
if (!!!text){ rb.highbar('请输入选项文本'); return }
|
||||
if (!!!text){ rb.highbar('请输入选项文本'); return false }
|
||||
let id = $('.J_text').attr('attr-id')
|
||||
$('.J_text').val('').attr('attr-id', '')
|
||||
$('.J_confirm').text('添加')
|
||||
|
@ -102,7 +101,10 @@ $(document).ready(function(){
|
|||
})
|
||||
render_unset_after = function(item, data){
|
||||
let del = $('<a href="javascript:;" class="action">[删除]</a>').appendTo(item.find('.dd-handle'))
|
||||
|
||||
del.click(()=>{
|
||||
item.remove()
|
||||
return false
|
||||
})
|
||||
}
|
||||
render_item_after = function(item, data){
|
||||
let edit = $('<a href="javascript:;">[修改]</a>').appendTo(item.find('.dd3-action'))
|
||||
|
@ -117,6 +119,13 @@ render_item_after = function(item, data){
|
|||
default0.parent().parent().addClass('active')
|
||||
default_item = data[0]
|
||||
})
|
||||
|
||||
// 新增加的还未保存
|
||||
if (data[0].substr(0, 4) != '012-'){
|
||||
item.find('.dd3-action>a:eq(0)').off('click').click(()=>{
|
||||
item.remove()
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
|
Loading…
Reference in a new issue