This commit is contained in:
toom1996
2025-07-18 15:23:34 +08:00
parent 95b480b346
commit 7d619fb503
7 changed files with 276 additions and 22 deletions

View File

@ -63,9 +63,9 @@
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
<i class="layui-icon layui-icon-add-1"></i>新增
</button>
{{-- <button class="pear-btn pear-btn-danger pear-btn-md" lay-event="batchRemove">--}}
{{-- <i class="layui-icon layui-icon-delete"></i>删除--}}
{{-- </button>--}}
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="import">
<i class="layui-icon layui-icon-file"></i>导入
</button>
</script>
<!-- 表格行工具栏 -->
@ -97,6 +97,7 @@
const VIEW_API = "/admin/news/view";
const INSERT_API = "/admin/api/news/insert";
const INSERT_URL = "/admin/news/insert";
const IMPORT_URL = "/admin/news/import";
const DELETE_API = "/admin/api/news/delete";
// 字段 创建时间 created_at
@ -191,8 +192,8 @@
add();
} else if (obj.event === "refresh") {
refreshTable();
} else if (obj.event === "batchRemove") {
batchRemove(obj);
} else if (obj.event === "import") {
importNews(obj);
}
});
@ -237,6 +238,17 @@
});
}
// 导入数据
let importNews = function () {
layer.open({
type: 2,
title: "导入",
shade: 0.1,
area: [common.isModile() ? "100%" : "98%", common.isModile() ? "100%" : "95%"],
content: IMPORT_URL
});
}
// 表格编辑数据
let edit = function (obj) {
let value = obj.data['id'];