update
This commit is contained in:
@ -70,6 +70,7 @@
|
||||
|
||||
<!-- 表格行工具栏 -->
|
||||
<script type="text/html" id="table-bar">
|
||||
<button class="pear-btn pear-btn-xs tool-btn" lay-event="research">重查</button>
|
||||
<button class="pear-btn pear-btn-xs tool-btn" lay-event="edit">编辑</button>
|
||||
<button class="pear-btn pear-btn-xs tool-btn" lay-event="delete">删除</button>
|
||||
</script>
|
||||
@ -83,6 +84,7 @@
|
||||
// 相关常量
|
||||
const PRIMARY_KEY = "id";
|
||||
|
||||
const RESEARCH_API = '/admin/api/keywords/monitor/research' // 重查关键词
|
||||
const DELETE_API = '/admin/api/keywords/monitor/delete' // 删除监控词
|
||||
const INDEX_API = '/admin/api/keywords/monitor'; // 表格数据
|
||||
const VIEW_API = "/admin/api/keywords/monitor/view"; // 编辑按钮 - 查看
|
||||
@ -147,9 +149,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
// if (!count) {
|
||||
render();
|
||||
// }
|
||||
|
||||
// 编辑或删除行事件
|
||||
table.on("tool(data-table)", function (obj) {
|
||||
@ -190,6 +190,10 @@
|
||||
*/
|
||||
});
|
||||
}
|
||||
|
||||
if (obj.event === 'research') {
|
||||
research(obj)
|
||||
}
|
||||
});
|
||||
|
||||
// 表格顶部工具栏事件
|
||||
@ -259,6 +263,31 @@
|
||||
});
|
||||
}
|
||||
|
||||
let research = function (obj) {
|
||||
layer.confirm("确定重查?", {
|
||||
icon: 3,
|
||||
title: "提示"
|
||||
}, function (index) {
|
||||
layer.close(index);
|
||||
let loading = layer.load();
|
||||
layui.$.ajax({
|
||||
url: RESEARCH_API,
|
||||
type: "POST",
|
||||
dateType: "json",
|
||||
data: {
|
||||
id: obj.data.id
|
||||
},
|
||||
success: function (res) {
|
||||
layer.close(loading);
|
||||
if (res.code) {
|
||||
return layui.popup.failure(res.msg);
|
||||
}
|
||||
return layui.popup.success("操作成功", refreshTable);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
// 删除一行
|
||||
let remove = function (obj) {
|
||||
return doRemove(obj.data[PRIMARY_KEY]);
|
||||
|
@ -21,6 +21,7 @@
|
||||
<label class="layui-form-label">监控平台</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="checkbox" name="platform[]" value="1" title="百度PC">
|
||||
<input type="checkbox" name="platform[]" value="2" title="百度WAP">
|
||||
{{-- <input type="checkbox" name="arr[1]" title="选项2" checked>--}}
|
||||
{{-- <input type="checkbox" name="arr[2]" title="选项3">--}}
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user