2018-06-07 00:45:47 +08:00
|
|
|
|
$(function () {
|
2018-09-02 00:50:13 +08:00
|
|
|
|
$('table').lgbTable({
|
2018-06-07 00:45:47 +08:00
|
|
|
|
url: Dicts.url,
|
2018-09-02 00:50:13 +08:00
|
|
|
|
dataBinder: {
|
2018-06-07 00:45:47 +08:00
|
|
|
|
map: {
|
2018-09-02 00:50:13 +08:00
|
|
|
|
Id: "#dictID",
|
|
|
|
|
Category: "#dictCate",
|
|
|
|
|
Name: "#dictName",
|
|
|
|
|
Code: "#dictCode",
|
|
|
|
|
Define: "#dictDefine"
|
2018-06-07 00:45:47 +08:00
|
|
|
|
}
|
2018-09-02 00:50:13 +08:00
|
|
|
|
},
|
|
|
|
|
smartTable: {
|
|
|
|
|
sortName: 'Category',
|
|
|
|
|
queryParams: function (params) { return $.extend(params, { category: $('#txt_dict_cate').val(), name: $("#txt_dict_name").val(), define: $("#txt_dict_define").val() }); },
|
|
|
|
|
columns: [
|
|
|
|
|
{ title: "字典标签", field: "Category", sortable: true },
|
|
|
|
|
{ title: "字典名称", field: "Name", sortable: true },
|
|
|
|
|
{ title: "字典代码", field: "Code", sortable: true },
|
2018-09-16 02:35:59 +08:00
|
|
|
|
{ title: "字典分类", field: "Define", sortable: true, formatter: function (value) { return value === 0 ? "系统使用" : "自定义"; } }
|
2019-03-07 21:28:51 +08:00
|
|
|
|
],
|
|
|
|
|
exportOptions: {
|
|
|
|
|
fileName: "数据字典",
|
|
|
|
|
ignoreColumn: [0, 1]
|
|
|
|
|
}
|
2018-09-02 00:50:13 +08:00
|
|
|
|
}
|
2018-06-07 00:45:47 +08:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// autocomplete
|
|
|
|
|
$.bc({
|
2018-09-09 13:19:05 +08:00
|
|
|
|
url: "api/Category",
|
2018-06-07 00:45:47 +08:00
|
|
|
|
callback: function (result) {
|
|
|
|
|
$('#txt_dict_cate').typeahead({
|
2018-11-22 16:30:46 +08:00
|
|
|
|
source: result,
|
|
|
|
|
showHintOnFocus: 'all',
|
|
|
|
|
fitToElement: true,
|
|
|
|
|
items: 'all'
|
2018-06-07 00:45:47 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
2016-10-29 16:46:02 +08:00
|
|
|
|
});
|