|
@@ -27,7 +27,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
{checkbox: true},
|
|
|
{field: 'id', title: __('Id')},
|
|
|
{field: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
|
- {field: 'status', title: __('Status'), searchList: {"30":__('Status 30')}, formatter: Table.api.formatter.status},
|
|
|
+ {field: 'status', title: __('Status'), searchList: Controller.api.parseConfigJson('statusList'), formatter: Table.api.formatter.status},
|
|
|
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
|
|
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
|
|
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
|
@@ -125,6 +125,19 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
Controller.api.bindevent();
|
|
|
},
|
|
|
api: {
|
|
|
+ // 解析Config中的JSON字符串的辅助函数
|
|
|
+ parseConfigJson: function(configKey, defaultValue) {
|
|
|
+ var configValue = Config[configKey] || defaultValue || {};
|
|
|
+ // 如果是字符串,尝试解析JSON
|
|
|
+ if (typeof configValue === 'string') {
|
|
|
+ try {
|
|
|
+ return JSON.parse(configValue);
|
|
|
+ } catch (e) {
|
|
|
+ return defaultValue || {};
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return configValue;
|
|
|
+ },
|
|
|
bindevent: function () {
|
|
|
|
|
|
Form.api.bindevent($("form[role=form]"));
|