Files
fast_response/superadmin/public/assets/js/backend/firmfollowuptemplate.js
Your Name dce091da91 t
2025-03-27 07:52:44 +00:00

97 lines
4.8 KiB
JavaScript
Executable File

define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'firmfollowuptemplate/index' + location.search,
add_url: 'firmfollowuptemplate/add',
edit_url: 'firmfollowuptemplate/edit',
del_url: 'firmfollowuptemplate/del',
multi_url: 'firmfollowuptemplate/multi',
import_url: 'firmfollowuptemplate/import',
table: 'firmfollowuptemplate',
}
});
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: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'main_points', title: __('Main_points'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'ai_text', title: __('Ai_text'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
// {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
{field: 'firmbigcategory.name', title: __('Firmbigcategory.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,
buttons: [
{
name: 'addSendTime',
text: __('添加发送时间'),
title: __('添加发送时间'),
classname: 'btn btn-xs btn-primary btn-dialog',
icon: 'fa fa-magic',
url: 'firmfollowuptemplatetimelist/add',
callback: function (data) {
Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
},
visible: function (row) {
//返回true时按钮显示,返回false隐藏
return true;
}
},
{
name: 'selectSendTime',
text: __('查看发送时间'),
title: __('查看发送时间'),
classname: 'btn btn-xs btn-danger btn-dialog',
icon: 'fa fa-list',
url: 'firmfollowuptemplatetimelist/index/firmfollowuptemplate_id/{id}',
callback: function (data) {
Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
},
visible: function (row) {
//返回true时按钮显示,返回false隐藏
return true;
}
},
]
}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
$('.shi_li_huashu').on('click',function () {
let txt = $('#c-main_points').val();
$.post('ai/talk_skill',{txt:txt},function (res) {
$('#c-ai_text').val(res.data);
},'json');
});
Controller.api.bindevent();
},
edit: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
}
}
};
return Controller;
});