1
This commit is contained in:
30
public/static/addons/alisms/js/config.js
Normal file
30
public/static/addons/alisms/js/config.js
Normal file
@ -0,0 +1,30 @@
|
||||
define(["jquery", "admin", "vue"], function ($, admin, Vue) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
|
||||
/**
|
||||
* 添加模板
|
||||
*/
|
||||
$('.add-template').on('click', function () {
|
||||
var dataKey = document.querySelectorAll("tr[data-key]"),
|
||||
key = 0;
|
||||
if (dataKey.length > 0) key = parseInt($(dataKey[dataKey.length - 1]).attr('data-key')) + 1;
|
||||
var html = ' <tr data-key="' + key + '">\n' +
|
||||
' <td><input type="text" name="name[' + key + ']" lay-verify="required" autocomplete="off" class="layui-input" value=""></td>\n' +
|
||||
' <td><input type="text" name="value[' + key + ']" lay-verify="required" autocomplete="off" class="layui-input" value=""></td>\n' +
|
||||
' <td><input type="text" name="remark[' + key + ']" lay-verify="required" autocomplete="off" class="layui-input" value=""></td>\n' +
|
||||
' <td><span class="layui-btn layui-btn-danger layui-btn-sm" delete-template="">删除</span></td>\n' +
|
||||
' </tr>';
|
||||
$('.template-list').append(html);
|
||||
});
|
||||
|
||||
$('body').on('click', '[delete-template]', function () {
|
||||
$(this).parent().parent().remove();
|
||||
});
|
||||
|
||||
admin.listen();
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
37
public/static/addons/alisms/js/record.js
Normal file
37
public/static/addons/alisms/js/record.js
Normal file
@ -0,0 +1,37 @@
|
||||
define(["jquery", "admin",], function ($, admin) {
|
||||
|
||||
var init = {
|
||||
table_elem: 'currentTable',
|
||||
table_render_id: 'currentTableRenderId',
|
||||
index_url: '/addons/alisms/record/index',
|
||||
delete_url: '/addons/alisms/record/del',
|
||||
};
|
||||
|
||||
var Controller = {
|
||||
|
||||
index: function () {
|
||||
admin.table.render({
|
||||
elem: '#' + init.table_elem,
|
||||
id: init.table_render_id,
|
||||
url: init.index_url,
|
||||
init: init,
|
||||
toolbar: ['refresh', 'delete'],
|
||||
cols: [[
|
||||
{type: "checkbox"},
|
||||
{field: 'id', width: 80, title: 'ID', sort: true, align: "center"},
|
||||
{field: 'phone', minWidth: 80, title: '发送手机', align: "center"},
|
||||
{field: 'content', minWidth: 80, title: '短信内容', align: "center"},
|
||||
{field: 'template', minWidth: 80, title: '短信模板', align: "center"},
|
||||
{field: 'result', minWidth: 80, title: '返回结果', align: "center"},
|
||||
{field: 'create_time', minWidth: 80, title: '发送时间', align: "center", search: 'range'},
|
||||
{
|
||||
width: 250, align: 'center', title: '操作', init: init, templet: admin.table.tool, operat: ['delete']
|
||||
}
|
||||
]],
|
||||
});
|
||||
|
||||
admin.listen();
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
Reference in New Issue
Block a user