12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form','vue', 'component', 'ELEMENT'], function ($, undefined, Backend, Table, Form, Vue, component, ELEMENT) {
- var id = '';
- $(document).on("click", ".layui-layer-btn0", function () {
- window.location.reload();
- });
- var Controller = {
- index: function () {
- $(document).on('click','.layer-open',function () {
- Fast.api.open($(this).attr('href'), $(this).data('title')?$(this).data('title'):'配置公共信息', {});
- return false;
- });
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'gdtaccount/index',
- add_url: 'gdtaccount/add',
- del_url: 'gdtaccount/del',
- table: 'gdt_account',
- }
- });
- var table = $("#table");
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'id',
- search:false,
- commonSearch: false,
- columns: [
- [
- {checkbox: true},
- {field: 'id', title: __('Id')},
- {field: 'account_id', title: __('投放账号ID')},
- {field: 'updatetime', title: __('绑定时间'), operate:false, addclass:'datetimerange', formatter: Table.api.formatter.datetime},
- {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
- ]
- ]
- });
- $(function () {
- $(document).on('click', ".layui-layer-close", function () {
- //刷新页面
- table.bootstrapTable('refresh');
- });
- });
- // 为表格绑定事件
- Table.api.bindevent(table);
- },
- add: function () {
- Controller.api.bindevent();
- },
- edit: function () {
- Controller.api.bindevent();
- },
- callbacktime: function () {
- Controller.api.bindevent();
- },
- api: {
- bindevent: function () {
- Form.api.bindevent($("form[role=form]"));
- },
- }
- };
- return Controller;
- });
|