diff --git a/application/admin/controller/Version.php b/application/admin/controller/Version.php new file mode 100644 index 00000000..13084c5c --- /dev/null +++ b/application/admin/controller/Version.php @@ -0,0 +1,25 @@ +model = model('Version'); + } +} diff --git a/application/admin/lang/zh-cn/version.php b/application/admin/lang/zh-cn/version.php new file mode 100644 index 00000000..8ed2a5c7 --- /dev/null +++ b/application/admin/lang/zh-cn/version.php @@ -0,0 +1,15 @@ + 'ID', + 'oldversion' => '旧版本号', + 'newversion' => '新版本号', + 'packagesize' => '包大小', + 'content' => '升级内容', + 'downloadurl' => '下载地址', + 'enforce' => '强制更新', + 'createtime' => '创建时间', + 'updatetime' => '更新时间', + 'weigh' => '权重', + 'status' => '状态' +]; diff --git a/application/admin/view/version/add.html b/application/admin/view/version/add.html new file mode 100644 index 00000000..6fc15bc9 --- /dev/null +++ b/application/admin/view/version/add.html @@ -0,0 +1,58 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ {:build_radios('row[enforce]', [1=>__('Yes'), 0=>__('No')], 1)} +
+
+
+ +
+ +
+
+
+ +
+ {:build_radios('row[status]', ['normal'=>__('Normal'), 'hidden'=>__('Hidden')])} +
+
+ +
diff --git a/application/admin/view/version/edit.html b/application/admin/view/version/edit.html new file mode 100644 index 00000000..cb295a21 --- /dev/null +++ b/application/admin/view/version/edit.html @@ -0,0 +1,58 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ {:build_radios('row[enforce]', [1=>__('Yes'), 0=>__('No')], $row['enforce'])} +
+
+
+ +
+ +
+
+
+ +
+ {:build_radios('row[status]', ['normal'=>__('Normal'), 'hidden'=>__('Hidden')], $row['status'])} +
+
+ +
diff --git a/application/admin/view/version/index.html b/application/admin/view/version/index.html new file mode 100644 index 00000000..d3eefa4f --- /dev/null +++ b/application/admin/view/version/index.html @@ -0,0 +1,25 @@ +
+ {:build_heading()} + +
+
+
+
+ + +
+
+
+ +
+
+
diff --git a/public/assets/js/backend/version.js b/public/assets/js/backend/version.js new file mode 100644 index 00000000..98aa8dd2 --- /dev/null +++ b/public/assets/js/backend/version.js @@ -0,0 +1,58 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'version/index', + add_url: 'version/add', + edit_url: 'version/edit', + del_url: 'version/del', + multi_url: 'version/multi', + table: 'version', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + sortName: 'weigh', + columns: [ + [ + {field: 'state', checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'oldversion', title: __('Oldversion')}, + {field: 'newversion', title: __('Newversion')}, + {field: 'packagesize', title: __('Packagesize')}, + {field: 'content', title: __('Content')}, + {field: 'downloadurl', title: __('Downloadurl'), formatter: Table.api.formatter.url}, + {field: 'enforce', title: __('Enforce')}, + {field: 'createtime', title: __('Createtime'), formatter: Table.api.formatter.datetime}, + {field: 'updatetime', title: __('Updatetime'), formatter: Table.api.formatter.datetime}, + {field: 'weigh', title: __('Weigh')}, + {field: 'status', title: __('Status'), formatter: Table.api.formatter.status}, + {field: 'operate', title: __('Operate'), events: Table.api.events.operate, formatter: Table.api.formatter.operate} + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + }, + add: function () { + Controller.api.bindevent(); + }, + edit: function () { + Controller.api.bindevent(); + }, + api: { + bindevent: function () { + Form.api.bindevent($("form[role=form]")); + } + } + }; + return Controller; +}); \ No newline at end of file