define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { Table.api.init({ extend: { index_url: 'auth/userrecentreadcount/index/ids/' + Config.id }, searchFormVisible: false, search: false, commonSearch: false, }); var table = $("#table"); // 初始化表格 table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'id', columns: [ [ {checkbox: true, visible: false}, {field: 'updatetime', title: __('时间'), operate: false}, {field: 'bookname', title: __('小说'), operate: false}, {field: 'chapter_name', title: __('章节'), operate: false,formatter: Controller.api.formatter.formateChapter} ] ] }); Table.api.bindevent(table); }, api: { bindevent: function () { Form.api.bindevent($("form[role=form]")); }, formatter: { formateChapter: function (value, row, index) { console.log(row); var SiteUrl = $("#hiddenSiteUrl").val(); var html = ''; html += row.chapter_name; html += ''; return html; } } } }; return Controller; }); var clipboard = new Clipboard('.btn-copy'); clipboard.on('success', function (e) { e.clearSelection(); Toastr.success('复制成功'); }); clipboard.on('error', function (e) { e.clearSelection(); Toastr.error("复制失败"); });