diff --git a/public/assets/js/backend/cover.js b/public/assets/js/backend/cover.js
deleted file mode 100644
index 5108b9ae..00000000
--- a/public/assets/js/backend/cover.js
+++ /dev/null
@@ -1,53 +0,0 @@
-define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefined, Backend, Form, Table) {
-
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'cover/index',
- add_url: 'cover/add',
- edit_url: 'cover/edit',
- del_url: 'cover/del',
- multi_url: 'cover/multi',
- }
- });
-
- var table = $("#table");
-
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- sortName: 'weigh',
- columns: [
- [
- {field: 'state', checkbox: true, },
- {field: 'id', title: __('Id')},
- {field: 'class', title: __('Class')},
- {field: 'design', title: __('Design')},
- {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
diff --git a/public/assets/js/backend/editor.js b/public/assets/js/backend/editor.js
deleted file mode 100644
index fd431227..00000000
--- a/public/assets/js/backend/editor.js
+++ /dev/null
@@ -1,57 +0,0 @@
-define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefined, Backend, Form, Table) {
-
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'editor/index',
- add_url: 'editor/add',
- edit_url: 'editor/edit',
- del_url: 'editor/del',
- multi_url: 'editor/multi',
- }
- });
-
- var table = $("#table");
-
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- sortName: 'id',
- columns: [
- [
- {field: 'state', checkbox: true, },
-{field: 'id', title: __('Id')},
-{field: 'name', title: __('Name')},
-{field: 'wxid', title: __('Wxid')},
-{field: 'qrcode', title: __('Qrcode')},
-{field: 'createtime', title: __('Createtime'), formatter: Table.api.formatter.datetime},
-{field: 'friends', title: __('Friends')},
-{field: 'city', title: __('City')},
-{field: 'avatar', title: __('Avatar')},
-{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
diff --git a/public/assets/js/backend/general/attachment.js b/public/assets/js/backend/general/attachment.js
index 3d3ca5db..51ec4fa1 100644
--- a/public/assets/js/backend/general/attachment.js
+++ b/public/assets/js/backend/general/attachment.js
@@ -1,4 +1,4 @@
-define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefined, Backend, Form, Table) {
+define(['jquery', 'bootstrap', 'backend', 'form', 'table', 'config'], function ($, undefined, Backend, Form, Table, Config) {
var Controller = {
index: function () {
@@ -24,14 +24,14 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
[
{field: 'state', checkbox: true, },
{field: 'id', title: __('Id')},
- {field: 'url', title: __('Url'), formatter: Table.api.formatter.url},
+ {field: 'url', title: __('Preview'), formatter: Controller.api.formatter.thumb},
+ {field: 'url', title: __('Url'), formatter: Controller.api.formatter.url},
{field: 'imagewidth', title: __('Imagewidth')},
{field: 'imageheight', title: __('Imageheight')},
{field: 'imagetype', title: __('Imagetype')},
{field: 'imageframes', title: __('Imageframes')},
{field: 'filesize', title: __('Filesize')},
{field: 'mimetype', title: __('Mimetype')},
- {field: 'extparam', title: __('Extparam')},
{field: 'createtime', title: __('Createtime'), formatter: Table.api.formatter.datetime},
{field: 'operate', title: __('Operate'), events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
@@ -51,6 +51,19 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
+ },
+ formatter: {
+ thumb: function (value, row, index) {
+ console.log(row);
+ if (row.mimetype.indexOf("image") > -1) {
+ return '
';
+ } else {
+ return '无';
+ }
+ },
+ url: function (value, row, index) {
+ return '' + value + '';
+ },
}
}
diff --git a/public/assets/js/backend/help.js b/public/assets/js/backend/help.js
deleted file mode 100644
index d025b904..00000000
--- a/public/assets/js/backend/help.js
+++ /dev/null
@@ -1,61 +0,0 @@
-define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefined, Backend, Form, Table) {
-
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'help/index',
- add_url: 'help/add',
- edit_url: 'help/edit',
- del_url: 'help/del',
- multi_url: 'help/multi',
- }
- });
-
- var table = $("#table");
-
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- sortName: 'weigh',
- columns: [
- [
- {field: 'state', checkbox: true, },
- {field: 'id', title: __('Id')},
- {field: 'category_id', title: __('Category_id')},
- {field: 'title', title: __('Title')},
- {field: 'keywords', title: __('Keywords')},
- {field: 'description', title: __('Description')},
- {field: 'intro', title: __('Intro')},
- {field: 'image', title: __('Image'), formatter: Table.api.formatter.image},
- {field: 'flag', title: __('Flag')},
- {field: 'outlink', title: __('Outlink')},
- {field: 'views', title: __('Views')},
- {field: 'createtime', title: __('Createtime'), 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
diff --git a/public/assets/js/backend/item.js b/public/assets/js/backend/item.js
deleted file mode 100644
index 8f94e4ec..00000000
--- a/public/assets/js/backend/item.js
+++ /dev/null
@@ -1,60 +0,0 @@
-define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefined, Backend, Form, Table) {
-
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'item/index',
- add_url: 'item/add',
- edit_url: 'item/edit',
- del_url: 'item/del',
- multi_url: 'item/multi',
- }
- });
-
- var table = $("#table");
-
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- sortName: 'id',
- columns: [
- [
- {field: 'state', checkbox: true, },
- {field: 'id', title: __('Id')},
- {field: 'user_id', title: __('User_id')},
- {field: 'book_id', title: __('Book_id')},
- {field: 'origin_id', title: __('Origin_id')},
- {field: 'type', title: __('Type')},
- {field: 'year', title: __('Year')},
- {field: 'month', title: __('Month')},
- {field: 'recycles', title: __('Recycles')},
- {field: 'content', title: __('Content')},
- {field: 'deletetime', title: __('Deletetime'), formatter: Table.api.formatter.datetime},
- {field: 'createtime', title: __('Createtime'), formatter: Table.api.formatter.datetime},
- {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
diff --git a/public/assets/js/backend/order.js b/public/assets/js/backend/order.js
deleted file mode 100644
index a28853a1..00000000
--- a/public/assets/js/backend/order.js
+++ /dev/null
@@ -1,111 +0,0 @@
-define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefined, Backend, Form, Table) {
-
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'order/index',
- add_url: 'order/add',
- edit_url: 'order/edit',
- del_url: 'order/del',
- multi_url: 'order/multi',
- }
- });
-
- var table = $("#table");
-
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- sortName: 'id',
- columns: [
- [
- {field: 'state', checkbox: true, },
- {field: 'id', title: __('Id')},
- {field: 'user_id', title: __('User_id')},
- {field: 'book_id', title: __('Book_id')},
- {field: 'title', title: __('Title')},
- {field: 'author', title: __('Author')},
- {field: 'amount', title: __('Amount')},
- {field: 'saleamount', title: __('Saleamount')},
- {field: 'nums', title: __('Nums')},
- {field: 'payamount', title: __('Payamount')},
- {field: 'paytime', title: __('Paytime'), formatter: Table.api.formatter.datetime},
- {field: 'paytype', title: __('Paytype')},
- {field: 'createtime', title: __('Createtime'), formatter: Table.api.formatter.datetime},
- {field: 'status', title: __('Status'), formatter: Controller.api.formatter.status},
- {field: 'operate', title: __('Operate'), events: Table.api.events.operate, formatter: Table.api.formatter.operate}
- ]
- ]
- });
-
- // 为表格绑定事件
- Table.api.bindevent(table);
-
- $(document).on('click', '.btn-filter-paid', function () {
- table.bootstrapTable('refresh', {query: {filter: JSON.stringify({status: 'paid'}), op: JSON.stringify({status: '='})}});
- });
-
- },
- add: function () {
- Controller.api.bindevent();
- },
- edit: function () {
- Controller.api.bindevent();
- },
- volume: function () {
- Controller.api.bindevent();
-
- require(['angular', 'angular-app', 'angular-ui-select', 'ngcontrol/volume'], function (angular, app, printapp) {
- angular.bootstrap(document, ["ui.select", "App"]);
- });
- },
- print: function () {
- require(['frontend-ebook'], function (Ebook) {
- window.imageLoaded = Ebook.imageLoaded;
- $(".ebook_container").on("load", "img", function () {
- $(this).parent().removeClass('img_loading');
- });
- require(['angular', 'angular-app', 'ngcontrol/preface', 'ngcontrol/preview'], function (angular, app) {
- angular.bootstrap(document, ["App"]);
- });
- });
- },
- api: {
- bindevent: function () {
- Form.api.bindevent($("form[role=form]"));
-
- $(document).bind("change", "input[name='row[status]']", function(){
- $("#expressdom").toggleClass("hidden", ['created', 'paid', 'printing', 'deleted'].indexOf($("input[name='row[status]']:checked").val())>-1);
- });
- },
- formatter: {
- icon: function (value, row, index) {
- //渲染fontawesome图标
- return ' ' + value;
- },
- status: function (value, row, index) {
- //渲染状态
- var html = '';
- if (value == 'created') {
- html = ' ' + __('Created') + '';
- } else if (value == 'paid') {
- html = ' ' + __('Paid,Print Now') + '';
- } else if (value == 'printing') {
- html = ' ' + __('Printing') + '';
- } else if (value == 'delivered') {
- html = ' ' + __('Delivered') + '';
- } else if (value == 'finished') {
- html = ' ' + __('Finished') + '';
- } else if (value == 'deleted') {
- html = ' ' + __('Deleted') + '';
- }
- return html;
- },
- }
- }
-
- };
- return Controller;
-});
\ No newline at end of file