提交 da9a7c66 编写于 作者: doc_wei's avatar doc_wei

feat: 新增章节管理

上级 a02262cf
......@@ -74,7 +74,6 @@ layui.config({
// 初始化加载
function init() {
console.log(pageMation);
var html;
if (pageMation.type == 'create' || pageMation.type == 'edit') {
html = pageHtml['createOrEdit'];
......
var objectKey = "";
var objectId = "";
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui', 'form'], function (exports) {
winui.renderColor();
var $ = layui.$,
form = layui.form,
table = layui.table;
objectKey = GetUrlParam("objectKey");
objectId = GetUrlParam("objectId");
if (isNull(objectKey) || isNull(objectId)) {
winui.window.msg("请传入适用对象信息", {icon: 2, time: 2000});
return false;
}
table.render({
id: 'messageTable',
elem: '#messageTable',
method: 'post',
url: sysMainMation.schoolBasePath + 'queryChapterList',
where: getTableParams(),
even: true,
page: true,
limits: getLimits(),
limit: getLimit(),
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' },
{ field: 'section', title: '章节', align: 'center', width: 100, templet: function (d) {
return '' + d.section + '';
}},
{ field: 'name', title: '名称', align: 'left', width: 300, templet: function (d) {
return '<a lay-event="details" class="notice-title-click">' + d.name + '</a>';
}},
{ field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], align: 'left', width: 120 },
{ field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 },
{ field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', width: 120 },
{ field: 'lastUpdateTime', title: systemLanguage["com.skyeye.lastUpdateTime"][languageType], align: 'center', width: 150 },
{ title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 257, toolbar: '#tableBar' }
]],
done: function(json) {
matchingLanguage();
initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入名称", function () {
table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()});
});
}
});
table.on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'edit') { //编辑
edit(data);
} else if (layEvent === 'details') { //详情
details(data);
} else if (layEvent === 'del') { //删除
del(data);
}
});
// 新增
$("body").on("click", "#addBean", function() {
parent._openNewWindows({
url: systemCommonUtil.getUrl('FP2023082800010&objectId=' + objectId + '&objectKey=' + objectKey, null),
title: systemLanguage["com.skyeye.addPageTitle"][languageType],
pageId: "chapterAdd",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadTable();
}});
});
// 编辑
function edit(data) {
parent._openNewWindows({
url: systemCommonUtil.getUrl('FP2023082800011&objectId=' + objectId + '&objectKey=' + objectKey + '&id=' + data.id, null),
title: systemLanguage["com.skyeye.editPageTitle"][languageType],
pageId: "chapterEdit",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadTable();
}});
}
// 详情
function details(data) {
parent._openNewWindows({
url: systemCommonUtil.getUrl('FP2023082800012&objectId=' + objectId + '&objectKey=' + objectKey + '&id=' + data.id, null),
title: systemLanguage["com.skyeye.detailsPageTitle"][languageType],
pageId: "chapterDetails",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
}});
}
// 删除
function del(data, obj) {
layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function (index) {
layer.close(index);
AjaxPostUtil.request({url: sysMainMation.schoolBasePath + "deleteChapterById", params: {id: data.id}, type: 'json', method: 'DELETE', callback: function (json) {
winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
loadTable();
}});
});
}
form.render();
$("body").on("click", "#reloadTable", function() {
loadTable();
});
function loadTable() {
table.reloadData("messageTable", {where: getTableParams()});
}
function getTableParams() {
return $.extend(true, {objectKey: objectKey, objectId: objectId}, initTableSearchUtil.getSearchValue("messageTable"));
}
exports('chapterList', {});
});
\ No newline at end of file
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui', 'form'], function (exports) {
winui.renderColor();
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
form = layui.form;
var objectId = GetUrlParam("objectId");
var objectKey = GetUrlParam("objectKey");
tabPageUtil.init({
id: 'tab',
prefixData: [{
title: '详情',
pageUrl: systemCommonUtil.getUrl('FP2023082800004&id=' + objectId, null)
}],
suffixData: [{
title: '章节',
pageUrl: systemCommonUtil.getUrl('../../tpl/chapter/chapterList.html', null)
}],
element: layui.element,
object: {
objectId: objectId,
objectKey: objectKey,
}
});
form.render();
});
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div class="winui-toolbar">
<div class="winui-tool">
<button id="reloadTable" class="winui-toolbtn search-table-btn-right"><i class="fa fa-refresh" aria-hidden="true"></i><language showName="com.skyeye.refreshDataBtn"></language></button>
<button id="addBean" class="winui-toolbtn search-table-btn-right" auth="add"><i class="fa fa-plus" aria-hidden="true"></i><language showName="com.skyeye.addBtn"></language></button>
</div>
</div>
<div style="margin:auto 10px;">
<table id="messageTable" lay-filter="messageTable"></table>
<script type="text/html" id="tableBar">
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="edit"><language showName="com.skyeye.editBtn"></language></a>
<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="delet"><language showName="com.skyeye.deleteBtn"></language></a>
</script>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/chapter/'}).use('chapterList');
</script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div class="body-box">
<div class="layui-col-xs12" style="height: 100%" id="tab">
</div>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/subject/'}).use('subjectManage');
</script>
</body>
</html>
\ No newline at end of file
......@@ -810,7 +810,7 @@ var tabPageUtil = {
setPageUrl: function (mation) {
var objectType = tabPageUtil.config.objectType;
var url = mation.pageUrl + "?objectId=" + tabPageUtil.config.object.objectId + "&objectKey=" + tabPageUtil.config.object.objectKey
var url = mation.pageUrl + (mation.pageUrl.indexOf("?") == -1 ? "?" : "&") + "objectId=" + tabPageUtil.config.object.objectId + "&objectKey=" + tabPageUtil.config.object.objectKey
+ "&objectType=" + objectType;
$("#manageTab").find(".layui-tab-content").find('.layui-show').find('iframe').attr('src', url);
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册