diff --git a/extend/base/admin/service/curd/templates/js/_common.code b/extend/base/admin/service/curd/templates/js/_common.code index cf96015..0d35c1c 100644 --- a/extend/base/admin/service/curd/templates/js/_common.code +++ b/extend/base/admin/service/curd/templates/js/_common.code @@ -1,10 +1,10 @@ var init = { - table_elem: '#currentTable', - table_render_id: 'currentTableRenderId', - index_url: '{{controllerUrl}}/index', - add_url: '{{controllerUrl}}/add', - edit_url: '{{controllerUrl}}/edit', - delete_url: '{{controllerUrl}}/delete', - export_url: '{{controllerUrl}}/export', - modify_url: '{{controllerUrl}}/modify', + tableElem: '#currentTable', + tableRenderId: 'currentTableRenderId', + indexUrl: '{{controllerUrl}}/index', + addUrl: '{{controllerUrl}}/add', + editUrl: '{{controllerUrl}}/edit', + deleteUrl: '{{controllerUrl}}/delete', + exportUrl: '{{controllerUrl}}/export', + modifyUrl: '{{controllerUrl}}/modify', }; \ No newline at end of file diff --git a/extend/base/admin/view/debug/log/index.js b/extend/base/admin/view/debug/log/index.js index dad2182..e4dac83 100644 --- a/extend/base/admin/view/debug/log/index.js +++ b/extend/base/admin/view/debug/log/index.js @@ -1,13 +1,13 @@ $(function () { var init = { - table_elem: '#currentTable', - table_render_id: 'currentTableRenderId', - index_url: 'debug.log/index', - add_url: 'debug.log/add', - edit_url: 'debug.log/edit', - delete_url: 'debug.log/delete', - export_url: 'debug.log/export', - modify_url: 'debug.log/modify', + tableElem: '#currentTable', + tableRenderId: 'currentTableRenderId', + indexUrl: 'debug.log/index', + addUrl: 'debug.log/add', + editUrl: 'debug.log/edit', + deleteUrl: 'debug.log/delete', + exportUrl: 'debug.log/export', + modifyUrl: 'debug.log/modify', }; var uidList = []; diff --git a/extend/base/admin/view/mall/cate/_common.js b/extend/base/admin/view/mall/cate/_common.js index 3a1e97f..16f5fb4 100644 --- a/extend/base/admin/view/mall/cate/_common.js +++ b/extend/base/admin/view/mall/cate/_common.js @@ -1,10 +1,10 @@ var init = { - table_elem: '#currentTable', - table_render_id: 'currentTableRenderId', - index_url: 'mall.cate/index', - add_url: 'mall.cate/add', - edit_url: 'mall.cate/edit', - delete_url: 'mall.cate/delete', - export_url: 'mall.cate/export', - modify_url: 'mall.cate/modify', + tableElem: '#currentTable', + tableRenderId: 'currentTableRenderId', + indexUrl: 'mall.cate/index', + addUrl: 'mall.cate/add', + editUrl: 'mall.cate/edit', + deleteUrl: 'mall.cate/delete', + exportUrl: 'mall.cate/export', + modifyUrl: 'mall.cate/modify', }; \ No newline at end of file diff --git a/extend/base/admin/view/mall/goods/_common.js b/extend/base/admin/view/mall/goods/_common.js index f9b5ffd..bb3f07c 100644 --- a/extend/base/admin/view/mall/goods/_common.js +++ b/extend/base/admin/view/mall/goods/_common.js @@ -1,12 +1,12 @@ var init = { - table_elem: '#currentTable', - table_render_id: 'currentTableRenderId', - index_url: 'mall.goods/index', - add_url: 'mall.goods/add', - edit_url: 'mall.goods/edit', - delete_url: 'mall.goods/delete', - export_url: 'mall.goods/export', - modify_url: 'mall.goods/modify', + tableElem: '#currentTable', + tableRenderId: 'currentTableRenderId', + indexUrl: 'mall.goods/index', + addUrl: 'mall.goods/add', + editUrl: 'mall.goods/edit', + deleteUrl: 'mall.goods/delete', + exportUrl: 'mall.goods/export', + modifyUrl: 'mall.goods/modify', stock_url: 'mall.goods/stock', read_url: 'mall.goods/read', formFullScreen: true, diff --git a/extend/base/admin/view/mall/tag/_common.js b/extend/base/admin/view/mall/tag/_common.js index 5b8a8dd..a0c1e19 100644 --- a/extend/base/admin/view/mall/tag/_common.js +++ b/extend/base/admin/view/mall/tag/_common.js @@ -1,10 +1,10 @@ var init = { - table_elem: '#currentTable', - table_render_id: 'currentTableRenderId', - index_url: 'mall.tag/index', - add_url: 'mall.tag/add', - edit_url: 'mall.tag/edit', - delete_url: 'mall.tag/delete', - export_url: 'mall.tag/export', - modify_url: 'mall.tag/modify', + tableElem: '#currentTable', + tableRenderId: 'currentTableRenderId', + indexUrl: 'mall.tag/index', + addUrl: 'mall.tag/add', + editUrl: 'mall.tag/edit', + deleteUrl: 'mall.tag/delete', + exportUrl: 'mall.tag/export', + modifyUrl: 'mall.tag/modify', }; diff --git a/extend/base/admin/view/system/admin/_common.js b/extend/base/admin/view/system/admin/_common.js index 67498f3..fbc1aa4 100644 --- a/extend/base/admin/view/system/admin/_common.js +++ b/extend/base/admin/view/system/admin/_common.js @@ -1,11 +1,11 @@ var init = { - table_elem: '#currentTable', - table_render_id: 'currentTableRenderId', - index_url: 'system.admin/index', - add_url: 'system.admin/add', - edit_url: 'system.admin/edit', - delete_url: 'system.admin/delete', - modify_url: 'system.admin/modify', - export_url: 'system.admin/export', + tableElem: '#currentTable', + tableRenderId: 'currentTableRenderId', + indexUrl: 'system.admin/index', + addUrl: 'system.admin/add', + editUrl: 'system.admin/edit', + deleteUrl: 'system.admin/delete', + modifyUrl: 'system.admin/modify', + exportUrl: 'system.admin/export', password_url: 'system.admin/password', }; diff --git a/extend/base/admin/view/system/auth/_common.js b/extend/base/admin/view/system/auth/_common.js index c5b1921..55f0a81 100644 --- a/extend/base/admin/view/system/auth/_common.js +++ b/extend/base/admin/view/system/auth/_common.js @@ -1,11 +1,11 @@ var init = { - table_elem: '#currentTable', - table_render_id: 'currentTableRenderId', - index_url: 'system.auth/index', - add_url: 'system.auth/add', - edit_url: 'system.auth/edit', - delete_url: 'system.auth/delete', - export_url: 'system.auth/export', - modify_url: 'system.auth/modify', + tableElem: '#currentTable', + tableRenderId: 'currentTableRenderId', + indexUrl: 'system.auth/index', + addUrl: 'system.auth/add', + editUrl: 'system.auth/edit', + deleteUrl: 'system.auth/delete', + exportUrl: 'system.auth/export', + modifyUrl: 'system.auth/modify', authorize_url: 'system.auth/authorize', }; \ No newline at end of file diff --git a/extend/base/admin/view/system/menu/_common.js b/extend/base/admin/view/system/menu/_common.js index 14a2182..d1685fb 100644 --- a/extend/base/admin/view/system/menu/_common.js +++ b/extend/base/admin/view/system/menu/_common.js @@ -4,11 +4,11 @@ iconPickerFa = layui.iconPickerFa, autocomplete = layui.autocomplete; var init = { -table_elem: '#currentTable', -table_render_id: 'currentTableRenderId', -index_url: 'system.menu/index', -add_url: 'system.menu/add', -delete_url: 'system.menu/delete', -edit_url: 'system.menu/edit', -modify_url: 'system.menu/modify', +tableElem: '#currentTable', +tableRenderId: 'currentTableRenderId', +indexUrl: 'system.menu/index', +addUrl: 'system.menu/add', +deleteUrl: 'system.menu/delete', +editUrl: 'system.menu/edit', +modifyUrl: 'system.menu/modify', }; diff --git a/extend/base/admin/view/system/menu/index.js b/extend/base/admin/view/system/menu/index.js index dd40f39..79b6e6e 100644 --- a/extend/base/admin/view/system/menu/index.js +++ b/extend/base/admin/view/system/menu/index.js @@ -8,9 +8,9 @@ $(function () { homdPid: 99999999, treeIdName: 'id', treePidName: 'pid', - url: ua.url(init.index_url), - elem: init.table_elem, - id: init.table_render_id, + url: ua.url(init.indexUrl), + elem: init.tableElem, + id: init.tableRenderId, toolbar: '#toolbar', page: false, skin: 'line', @@ -46,7 +46,7 @@ $(function () { operat: [ [{ text: '添加下级', - url: init.add_url, + url: init.addUrl, method: 'open', auth: 'add', class: 'layui-btn layui-btn-xs layui-btn-normal', @@ -61,7 +61,7 @@ $(function () { }, { text: '编辑', - url: init.edit_url, + url: init.editUrl, method: 'open', auth: 'edit', class: 'layui-btn layui-btn-xs layui-btn-success', @@ -72,7 +72,7 @@ $(function () { method: 'none', auth: 'delete', class: 'layui-btn layui-btn-xs layui-btn-danger', - extend: 'data-treetable-delete-item="1" data-url="' + init.delete_url + '"', + extend: 'data-treetable-delete-item="1" data-url="' + init.deleteUrl + '"', data: ['id', 'title'], _if(data) { @@ -127,7 +127,7 @@ $(function () { $('body').on('click', '[data-treetable-delete]', function () { var tableId = $(this).attr('data-treetable-delete'), url = $(this).attr('data-url'); - tableId = tableId || init.table_render_id; + tableId = tableId || init.tableRenderId; url = url != undefined ? ua.url(url) : window.location.href; var checkStatus = table.checkStatus(tableId), data = checkStatus.data; @@ -154,9 +154,9 @@ $(function () { return false; }); - ua.table.listenSwitch({ filter: 'status', url: init.modify_url }); + ua.table.listenSwitch({ filter: 'status', url: init.modifyUrl }); - ua.table.listenEdit(init, 'currentTable', init.table_render_id, false); + ua.table.listenEdit(init, 'currentTable', init.tableRenderId, false); ua.listen(); }); \ No newline at end of file diff --git a/extend/base/admin/view/system/node/_common.js b/extend/base/admin/view/system/node/_common.js index 5e66d62..0227692 100644 --- a/extend/base/admin/view/system/node/_common.js +++ b/extend/base/admin/view/system/node/_common.js @@ -1,9 +1,9 @@ var init = { - table_elem: '#currentTable', - table_render_id: 'currentTableRenderId', - index_url: 'system.node/index', - add_url: 'system.node/add', - edit_url: 'system.node/edit', - delete_url: 'system.node/delete', - modify_url: 'system.node/modify', + tableElem: '#currentTable', + tableRenderId: 'currentTableRenderId', + indexUrl: 'system.node/index', + addUrl: 'system.node/add', + editUrl: 'system.node/edit', + deleteUrl: 'system.node/delete', + modifyUrl: 'system.node/modify', }; \ No newline at end of file diff --git a/extend/base/admin/view/system/node/index.js b/extend/base/admin/view/system/node/index.js index 8a6ea9e..04b11bc 100644 --- a/extend/base/admin/view/system/node/index.js +++ b/extend/base/admin/view/system/node/index.js @@ -13,7 +13,7 @@ $(function () { auth: 'refresh', class: 'layui-btn layui-btn-success layui-btn-sm', icon: 'fa fa-hourglass', - extend: 'data-table="' + init.table_render_id + '"', + extend: 'data-table="' + init.tableRenderId + '"', }, { text: '强制更新节点', title: '该操作会覆盖已存在的节点信息。
确定强制更新节点?', @@ -22,7 +22,7 @@ $(function () { auth: 'refresh', class: 'layui-btn layui-btn-sm layui-btn-normal', icon: 'fa fa-hourglass', - extend: 'data-table="' + init.table_render_id + '"', + extend: 'data-table="' + init.tableRenderId + '"', }, { text: '清除失效节点', @@ -32,7 +32,7 @@ $(function () { auth: 'clear', class: 'layui-btn layui-btn-sm layui-btn-danger', icon: 'fa fa-trash-o', - extend: 'data-table="' + init.table_render_id + '"', + extend: 'data-table="' + init.tableRenderId + '"', } ]], cols: [[ diff --git a/extend/base/admin/view/system/quick/_common.js b/extend/base/admin/view/system/quick/_common.js index 4bc0656..737cc23 100644 --- a/extend/base/admin/view/system/quick/_common.js +++ b/extend/base/admin/view/system/quick/_common.js @@ -2,12 +2,12 @@ var iconPickerFa = layui.iconPickerFa, autocomplete = layui.autocomplete; var init = { - table_elem: '#currentTable', - table_render_id: 'currentTableRenderId', - index_url: 'system.quick/index', - add_url: 'system.quick/add', - edit_url: 'system.quick/edit', - delete_url: 'system.quick/delete', - export_url: 'system.quick/export', - modify_url: 'system.quick/modify', + tableElem: '#currentTable', + tableRenderId: 'currentTableRenderId', + indexUrl: 'system.quick/index', + addUrl: 'system.quick/add', + editUrl: 'system.quick/edit', + deleteUrl: 'system.quick/delete', + exportUrl: 'system.quick/export', + modifyUrl: 'system.quick/modify', }; \ No newline at end of file diff --git a/extend/base/admin/view/system/uploadfile/_common.js b/extend/base/admin/view/system/uploadfile/_common.js index 80babf8..e897bcb 100644 --- a/extend/base/admin/view/system/uploadfile/_common.js +++ b/extend/base/admin/view/system/uploadfile/_common.js @@ -1,10 +1,10 @@ var init = { - table_elem: '#currentTable', - table_render_id: 'currentTableRenderId', - index_url: 'system.uploadfile/index', - add_url: 'system.uploadfile/add', - edit_url: 'system.uploadfile/edit', - delete_url: 'system.uploadfile/delete', - modify_url: 'system.uploadfile/modify', - export_url: 'system.uploadfile/export', + tableElem: '#currentTable', + tableRenderId: 'currentTableRenderId', + indexUrl: 'system.uploadfile/index', + addUrl: 'system.uploadfile/add', + editUrl: 'system.uploadfile/edit', + deleteUrl: 'system.uploadfile/delete', + modifyUrl: 'system.uploadfile/modify', + exportUrl: 'system.uploadfile/export', }; diff --git a/public/static/plugs/ulthon-admin/ulthon-admin.js b/public/static/plugs/ulthon-admin/ulthon-admin.js index 7919eae..12e8e0e 100644 --- a/public/static/plugs/ulthon-admin/ulthon-admin.js +++ b/public/static/plugs/ulthon-admin/ulthon-admin.js @@ -30,10 +30,11 @@ }); var init = { - table_elem: '#currentTable', - table_render_id: 'currentTableRenderId', - upload_url: 'ajax/upload', - upload_exts: '', + tableElem: '#currentTable', + tableRenderId: 'currentTableRenderId', + uploadUrl: 'ajax/upload', + uploadExts: '', + extGroup:{} }; var table; @@ -78,12 +79,15 @@ } } - init.upload_exts += allExtGroup.join('|'); - + extGroup['office'] = [].concat(extGroup['word'], extGroup['excel'], extGroup['ppt'], extGroup['pdf']); extGroup['media'] = [].concat(extGroup['image'], extGroup['music'], extGroup['video']); + init.uploadExts += allExtGroup.join('|'); + init.extGroup = extGroup; + var admin = { + init: init, config: { shade: [0.02, '#000'], }, @@ -256,11 +260,11 @@ render: function (options) { options.init = options.init || init; options.modifyReload = admin.parame(options.modifyReload, true); - options.elem = options.elem || options.init.table_elem; - options.id = options.id || options.init.table_render_id; + options.elem = options.elem || options.init.tableElem; + options.id = options.id || options.init.tableRenderId; options.scrollPos = options.scrollPos || 'fixed'; options.layFilter = options.id + '_LayFilter'; - options.url = options.url || admin.url(options.init.index_url); + options.url = options.url || admin.url(options.init.indexUrl); options.headers = admin.headers(); options.page = admin.parame(options.page, true); options.search = admin.parame(options.search, true); @@ -437,15 +441,15 @@ toolbarHtml += ' \n'; } else if (v === 'add') { if (admin.checkAuth('add', elem)) { - toolbarHtml += '\n'; + toolbarHtml += '\n'; } } else if (v === 'delete') { if (admin.checkAuth('delete', elem)) { - toolbarHtml += '\n'; + toolbarHtml += '\n'; } } else if (v === 'export') { if (admin.checkAuth('export', elem)) { - toolbarHtml += '\n'; + toolbarHtml += '\n'; } } else if (v === 'selectConfirm') { toolbarHtml += '\n'; @@ -633,14 +637,14 @@ return options; }, renderSwitch: function (cols, tableInit, tableId, modifyReload) { - tableInit.modify_url = tableInit.modify_url || false; + tableInit.modifyUrl = tableInit.modifyUrl || false; cols = cols[0] || {}; - tableId = tableId || init.table_render_id; + tableId = tableId || init.tableRenderId; if (cols.length > 0) { $.each(cols, function (i, v) { v.filter = v.filter || false; - if (v.filter !== false && tableInit.modify_url !== false) { - admin.table.listenSwitch({ filter: v.filter, url: tableInit.modify_url, tableId: tableId, modifyReload: modifyReload }); + if (v.filter !== false && tableInit.modifyUrl !== false) { + admin.table.listenSwitch({ filter: v.filter, url: tableInit.modifyUrl, tableId: tableId, modifyReload: modifyReload }); } }); } @@ -926,7 +930,7 @@ tool: function (data) { var option = data.LAY_COL; option.operat = option.operat || ['edit', 'delete']; - var elem = option.init.table_elem || init.table_elem; + var elem = option.init.tableElem || init.tableElem; var html = ''; $.each(option.operat, function (i, item) { if (typeof item === 'string') { @@ -940,7 +944,7 @@ text: '编辑', title: '编辑信息', auth: 'edit', - url: option.init.edit_url, + url: option.init.editUrl, extend: option.init.formFullScreen == 'true' ? ' data-full="true"' : '' }; operat.url = admin.table.toolSpliceUrl(operat.url, operat.field, data); @@ -957,7 +961,7 @@ text: '删除', title: '确定删除?', auth: 'delete', - url: option.init.delete_url, + url: option.init.deleteUrl, extend: "" }; operat.url = admin.table.toolSpliceUrl(operat.url, operat.field, data); @@ -1114,7 +1118,7 @@ switch: function (data) { var option = data.LAY_COL; - if (!admin.checkAuth('modify', option.init.table_elem)) { + if (!admin.checkAuth('modify', option.init.tableElem)) { return admin.table.list(data); } @@ -1230,7 +1234,7 @@ option.filter = option.filter || ''; option.url = option.url || ''; option.field = option.field || option.filter || ''; - option.tableId = option.tableId || init.table_render_id; + option.tableId = option.tableId || init.tableRenderId; option.modifyReload = option.modifyReload || false; form.on('switch(' + option.filter + ')', function (obj) { var checked = obj.elem.checked ? 1 : 0; @@ -1298,9 +1302,9 @@ }); }, listenEdit: function (tableInit, layFilter, tableId, modifyReload) { - tableInit.modify_url = tableInit.modify_url || false; - tableId = tableId || init.table_render_id; - if (tableInit.modify_url !== false) { + tableInit.modifyUrl = tableInit.modifyUrl || false; + tableId = tableId || init.tableRenderId; + if (tableInit.modifyUrl !== false) { table.on('edit(' + layFilter + ')', function (obj) { var value = obj.value, data = obj.data, @@ -1312,7 +1316,7 @@ value: value, }; admin.request.post({ - url: tableInit.modify_url, + url: tableInit.modifyUrl, prefix: true, data: _data, }, function (res) { @@ -1547,7 +1551,7 @@ tableId = $(this).attr('data-table'); if (checkbox === 'true') { - tableId = tableId || init.table_render_id; + tableId = tableId || init.tableRenderId; var checkStatus = table.checkStatus(tableId), data = checkStatus.data; if (data.length <= 0) { @@ -1658,7 +1662,7 @@ $('body').on('click', '[data-table-refresh]', function () { var tableId = $(this).attr('data-table-refresh'); if (tableId === undefined || tableId === '' || tableId == null) { - tableId = init.table_render_id; + tableId = init.tableRenderId; } table.reloadData(tableId); }); @@ -1667,7 +1671,7 @@ $('body').on('click', '[data-table-reset]', function () { var tableId = $(this).attr('data-table-reset'); if (tableId === undefined || tableId === '' || tableId == null) { - tableId = init.table_render_id; + tableId = init.tableRenderId; } var where = { filter: '{}', @@ -1702,7 +1706,7 @@ var postData = {}; if (checkbox === 'true') { - tableId = tableId || init.table_render_id; + tableId = tableId || init.tableRenderId; var checkStatus = table.checkStatus(tableId), data = checkStatus.data; if (data.length <= 0) { @@ -1725,7 +1729,7 @@ }, function (res) { admin.msg.success(res.msg, function () { if (endMethod == 'reload-table') { - tableId = tableId || init.table_render_id; + tableId = tableId || init.tableRenderId; table.reloadData(tableId); } else if (endMethod == 'refresh-page') { location.reload(); @@ -1742,7 +1746,7 @@ $('body').on('click', '[data-table-delete]', function () { var tableId = $(this).attr('data-table-delete'), url = $(this).attr('data-url'); - tableId = tableId || init.table_render_id; + tableId = tableId || init.tableRenderId; url = url !== undefined ? admin.url(url) : window.location.href; var checkStatus = table.checkStatus(tableId), data = checkStatus.data; @@ -1800,7 +1804,7 @@ option.refreshTable = option.refreshTable || false; option.refreshFrame = option.refreshFrame || false; if (option.refreshTable === true) { - option.refreshTable = init.table_render_id; + option.refreshTable = init.tableRenderId; } var index = parent.layer.getFrameIndex(window.name); parent.layer.close(index); @@ -2016,7 +2020,7 @@ var elemFilenameField = "input[name='" + uploadFilenameField + "']"; } if (uploadExts == '*') { - uploadExts = init.upload_exts; + uploadExts = init.uploadExts; } else if (uploadExts.charAt(0) == '*') { var extGroupName = uploadExts.slice(1); if (extGroup[extGroupName]) { @@ -2027,7 +2031,7 @@ // 监听上传事件 upload.render({ elem: this, - url: admin.url(init.upload_url), + url: admin.url(init.uploadUrl), exts: uploadExts, accept: uploadAccept,//指定允许上传时校验的文件类型 acceptMime: uploadAcceptMime,//规定打开文件选择框时,筛选出的文件类型