init commit
This commit is contained in:
158
public/assets/js/backend/wdsxh/demand.js
Normal file
158
public/assets/js/backend/wdsxh/demand.js
Normal file
@@ -0,0 +1,158 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'wdsxh/demand/index' + location.search,
|
||||
del_url: 'wdsxh/demand/del',
|
||||
table: 'wdsxh_demand',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{
|
||||
field: 'wechat.nickname',
|
||||
title: __('Wdsxh_user_id'),
|
||||
formatter: function (value, row, index) {
|
||||
if (row.is_anonymity == 1) {
|
||||
return '***'; // 这里是一个简单的示例,实际情况下需要根据需求进行处理
|
||||
// return '用户匿名提交'; // 显示提示信息
|
||||
} else if (row.is_anonymity == 2) {
|
||||
return value; // 其他状态保持原样显示
|
||||
}
|
||||
}
|
||||
},
|
||||
{field: 'title', title: __('Title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'is_anonymity', title: __('Is_anonymity'), searchList: {"1":__('Is_anonymity 1'),"2":__('Is_anonymity 2')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'processing_time', title: __('Processing_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,buttons:[
|
||||
{
|
||||
text:'反馈详情',
|
||||
name: 'details',
|
||||
title: '订单详情',
|
||||
classname: 'btn btn-xs btn-primary btn-dialog bg-aqua',
|
||||
icon: 'fa',
|
||||
url: 'wdsxh/demand/details',
|
||||
extend:'data-area=["95%","95%"]',
|
||||
},
|
||||
{
|
||||
name: 'processing',
|
||||
text: __('处理'),
|
||||
title: __('处理'),
|
||||
classname: 'btn btn-xs btn-info btn-magic btn-ajax bg-olive',
|
||||
icon: 'fa',
|
||||
url: 'wdsxh/demand/processing',
|
||||
confirm: '确认处理?',
|
||||
visible:function (row){
|
||||
if(row.status == 2){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
},
|
||||
success: function (data, ret) {
|
||||
$("#table").bootstrapTable('refresh',{});
|
||||
},
|
||||
error: function (data, ret) {
|
||||
Toastr.error(ret.msg);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
]}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
recyclebin: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
'dragsort_url': ''
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: 'wdsxh/demand/recyclebin' + location.search,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'title', title: __('Title'), align: 'left'},
|
||||
{
|
||||
field: 'deletetime',
|
||||
title: __('Deletetime'),
|
||||
operate: 'RANGE',
|
||||
addclass: 'datetimerange',
|
||||
formatter: Table.api.formatter.datetime
|
||||
},
|
||||
{
|
||||
field: 'operate',
|
||||
width: '140px',
|
||||
title: __('Operate'),
|
||||
table: table,
|
||||
events: Table.api.events.operate,
|
||||
buttons: [
|
||||
{
|
||||
name: 'Restore',
|
||||
text: __('Restore'),
|
||||
classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
|
||||
icon: 'fa fa-rotate-left',
|
||||
url: 'wdsxh/demand/restore',
|
||||
refresh: true
|
||||
},
|
||||
{
|
||||
name: 'Destroy',
|
||||
text: __('Destroy'),
|
||||
classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
|
||||
icon: 'fa fa-times',
|
||||
url: 'wdsxh/demand/destroy',
|
||||
refresh: true
|
||||
}
|
||||
],
|
||||
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;
|
||||
});
|
||||
Reference in New Issue
Block a user