$(function () { $('a[data-admin="False"]').hide(); var bsa = new BootstrapAdmin({ url: Settings.url, bootstrapTable: null, validateForm: null, modal: null, dataEntity: new DataEntity({ map: { Title: "sysName", Footer: "sysFoot" } }) }); $('button[data-method]').on('click', function (e) { var $this = $(this); switch ($this.attr('data-method')) { case 'footer': var data = bsa.dataEntity.get(); $.bc({ url: Settings.url, data: { name: '网站页脚', code: data.Footer, category: Settings.title }, title: Settings.title, callback: function (result) { if (result) $('#websiteFooter').text(data.Footer); } }); break; case 'title': var data = bsa.dataEntity.get(); $.bc({ url: Settings.url, data: { name: '网站标题', code: data.Title, category: Settings.title }, title: Settings.title, callback: function (result) { if (result) $('#websiteTitle').text(data.Title); } }); break; case 'css': var cssDefine = $('#dictCssDefine').val(); $.bc({ url: Settings.url, data: { name: '使用样式', code: cssDefine, category: '当前样式' }, title: '网站样式', callback: function (result) { if (result) { window.setTimeout(function () { window.location.reload(true); }, 1000); } } }); break; } }); var $sortable = $('#sortable'); var listCacheUrl = function (options) { options = $.extend({ clear: false }, options); $sortable.html(''); $.bc({ url: Settings.url, method: 'GET', swal: false, callback: function (result) { if (result && $.isArray(result)) { $.each(result, function (index, item) { listCache($.extend({ item: item, url: item.Url }, options)); }); } } }); } var listCache = function (options) { options = $.extend({ clear: false, key: '' }, options); if (options.key != '') { options.url = $.format(options.url, options.key); } if (options.clear) { options.url += '&clear=clear'; } $.bc({ url: options.url, swal: false, callback: function (result) { if (result && options.key == '') { result = $.parseJSON(result); if ($.isArray(result)) { var html = '