123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'video/index' + location.search,
- add_url: 'video/add',
- edit_url: 'video/edit',
- del_url: 'video/del',
- multi_url: 'video/multi',
- import_url: 'video/import',
- table: 'video',
- }
- });
- var table = $("#table");
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'id',
- fixedColumns: true,
- fixedRightNumber: 1,
- columns: [
- [
- {checkbox: true},
- {field: 'id', title: __('Id')},
- // {field: 'video_type_id', title: __('Video_type_id')},
- // {field: 'type.type', title: __('Type.type')},
- {field: 'type.name', title: __('Type.name'), operate: 'LIKE'},
- // {field: 'cate_id', title: __('Cate_id')},
- {field: 'cate.name', title: __('Cate.name'),operate:'LIKE'},
- // {field: 'childcate_id', title: __('Childcate_id')},
- {field: 'childcate.name', title: __('Childcate.name'), operate: 'LIKE'},
- {field: 'title', title: __('Title'), operate: 'LIKE'},
- {field: 'search_title', title: __('Search_title'), operate: 'LIKE'},
- {field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
- {field: 'desc', title: __('Desc'), operate: 'LIKE'},
- {field: 'videofile', title: __('Videofile'), operate: false, formatter: Table.api.formatter.file},
- {field: 'is_pay', title: __('Is_pay'), searchList: {"0":__('Is_pay 0'),"1":__('Is_pay 1')}, formatter: Table.api.formatter.normal},
- {field: 'weigh', title: __('Weigh'), operate: false},
- {field: 'good_number', title: __('good_number'), operate: false},
- {field: 'collect_number', title: __('collect_number'), operate: false},
- {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: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1')}, formatter: Table.api.formatter.status},
- // {field: 'transcode_status', title: __('转码状态'), searchList: {"0":__('待转码'),"1":__('转码中'),"2":__('转码完成'),"3":__('转码失败')}, formatter: Table.api.formatter.status},
- // {field: 'task_id', title: __('转码任务ID'), operate: false},
- // {field: 'file_url', title: __('文件银河转码后地址'), operate: false},
- {field: 'inject_status', title: __('注入状态'), searchList: {"0":__('待注入'),"1":__('注入中'),"2":__('注入成功'),"3":__('注入失败')}, formatter: Table.api.formatter.status},
- {field: 'operate', title: __('Operate'), table: table,
- buttons:[
- {
- name:'tongbu',
- text:'同步到旧版',
- title:'同步到旧版',
- icon:'fa fa-exclamation-circle',
- classname:'btn btn-xs btn-info btn-ajax',
- url:'video/tongbu/id/{ids}?dialog=1',
- target:'_self',
- }
- ],
- events: Table.api.events.operate, formatter: Table.api.formatter.operate}
- ]
- ]
- });
- // 为表格绑定事件
- Table.api.bindevent(table);
- },
- tongbu: function () {
- Controller.api.bindevent();
- },
- add: function () {
- Controller.api.bindevent();
- },
- edit: function () {
- Controller.api.bindevent();
- },
- api: {
- bindevent: function () {
- Form.api.bindevent($("form[role=form]"));
- }
- }
- };
- return Controller;
- });
- $("#c-childcate_id").data("params", function (obj) {
- return {
- custom: {cate_id: $("#c-cate_id").val()}
- };
- });
- $(document).on("change","#c-cate_id",function(){
- $("#c-childcate_id").selectPageClear();
- })
|