代码调试
This commit is contained in:
parent
d013e08327
commit
8b5cb61e34
|
|
@ -1,8 +1,9 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="">
|
<html lang="">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<title>评价模板配置</title>
|
<title>评价模板配置</title>
|
||||||
<link rel="stylesheet" href="../../../layui/css/layui.css"/>
|
<link rel="stylesheet" href="../../../layui/css/layui.css" />
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.widget-toolbar a {
|
.widget-toolbar a {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
|
@ -26,31 +27,30 @@
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.layui-input, .layui-textarea {
|
.layui-input,
|
||||||
|
.layui-textarea {
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 7px;
|
padding: 7px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="layui-container" style="width: 100%;height: 100%;padding: 10px">
|
<div class="layui-container" style="width: 100%;height: 100%;padding: 10px">
|
||||||
<form id="baseForm" class="layui-form" method="POST" onsubmit="return false;">
|
<form id="baseForm" class="layui-form" method="POST" onsubmit="return false;">
|
||||||
<div class="layui-inline" style="width: 100%;display: flex;flex-direction: row">
|
<div class="layui-inline" style="width: 100%;display: flex;flex-direction: row">
|
||||||
<input type="text" name="name" id="name" placeholder="请输入模板名称" class="layui-input"
|
<input type="text" name="name" id="name" placeholder="请输入模板名称" class="layui-input" style="width: 15%"
|
||||||
style="width: 15%" autocomplete="off"
|
autocomplete="off" maxlength="30">
|
||||||
maxlength="30">
|
|
||||||
<input id="createUser" type="text" name="createUser" placeholder="请输入创建人" autocomplete="off"
|
<input id="createUser" type="text" name="createUser" placeholder="请输入创建人" autocomplete="off"
|
||||||
class="layui-input" style="margin-left: 10px;width: 15%"/>
|
class="layui-input" style="margin-left: 10px;width: 15%" />
|
||||||
<button id='searchBtn' class="layui-btn layui-btn-warm" title="过滤" type="button"
|
<button id='searchBtn' class="layui-btn layui-btn-warm" title="过滤" type="button"
|
||||||
style="margin-left: 10px;"
|
style="margin-left: 10px;" onclick="search(1)">
|
||||||
onclick="search(1)">
|
|
||||||
搜索
|
搜索
|
||||||
</button>
|
</button>
|
||||||
<button class="layui-btn" title="重置" type="button" onclick="search(2)">重置</button>
|
<button class="layui-btn" title="重置" type="button" onclick="search(2)">重置</button>
|
||||||
|
|
||||||
<button class="layui-btn " title="新增" type="button"
|
<button class="layui-btn " title="新增" type="button" onclick="add()">
|
||||||
onclick="add()">
|
|
||||||
新增模板
|
新增模板
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -58,13 +58,13 @@
|
||||||
<div id="tree-table-box">
|
<div id="tree-table-box">
|
||||||
<table id="baseTable" class="layui-table" lay-filter="test"></table>
|
<table id="baseTable" class="layui-table" lay-filter="test"></table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script src="../../../js/publicJs.js"></script>
|
<script src="../../../js/publicJs.js"></script>
|
||||||
<script type="text/javascript" src="../../../js/libs/jquery-2.1.1.min.js"></script>
|
<script type="text/javascript" src="../../../js/libs/jquery-2.1.1.min.js"></script>
|
||||||
<script type="text/javascript" src="../../../js/jq.js"></script>
|
<script type="text/javascript" src="../../../js/jq.js"></script>
|
||||||
<script type="text/javascript" src="../../../js/my/permission.js"></script>
|
<script type="text/javascript" src="../../../js/my/permission.js"></script>
|
||||||
<script src="../../../layui/layui.js"></script>
|
<script src="../../../layui/layui.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
let layer, laydate, table;
|
let layer, laydate, table;
|
||||||
let obj = {};
|
let obj = {};
|
||||||
$(function () {
|
$(function () {
|
||||||
|
|
@ -107,10 +107,17 @@
|
||||||
{
|
{
|
||||||
field: 'number', width: 80, title: '序号', align: 'center', type: 'numbers'
|
field: 'number', width: 80, title: '序号', align: 'center', type: 'numbers'
|
||||||
}
|
}
|
||||||
, {field: 'name', align: 'center', title: '模板名称'}
|
, { field: 'name', align: 'center', title: '模板名称' }
|
||||||
, {field: 'createUser', align: 'center', title: '创建人'}
|
, { field: 'createUser', align: 'center', title: '创建人' }
|
||||||
, {field: 'createTime', align: 'center', title: '创建时间'}
|
, { field: 'createTime', align: 'center', title: '创建时间' }
|
||||||
, {field: 'version', align: 'center', title: '版本'},
|
, { field: 'version', align: 'center', title: '版本' },
|
||||||
|
, {
|
||||||
|
field: 'isEnable', align: 'center', title: '启用状态',
|
||||||
|
templet: function (d) {
|
||||||
|
// 根据 isUse 字段的值决定开关的状态
|
||||||
|
return '<input type="checkbox" lay-filter="switchTest" lay-skin="switch" lay-text="启用|禁用" ' + (d.isEnable == '0' ? 'checked' : '') + '>';
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
fixed: 'right', width: 180, title: '操作', align: 'center', templet: d => {
|
fixed: 'right', width: 180, title: '操作', align: 'center', templet: d => {
|
||||||
let text = "";
|
let text = "";
|
||||||
|
|
@ -121,7 +128,7 @@
|
||||||
text +=
|
text +=
|
||||||
'<a lay-event="edit" style="color: #009688;cursor: pointer;font-size: 15px;margin-left: 10px"' +
|
'<a lay-event="edit" style="color: #009688;cursor: pointer;font-size: 15px;margin-left: 10px"' +
|
||||||
' id="edit">编辑</a>';
|
' id="edit">编辑</a>';
|
||||||
if (d.isUse == '0'){
|
if (d.isUse == '0') {
|
||||||
text +=
|
text +=
|
||||||
'<a lay-event="del" style="color: #009688;cursor: pointer;font-size: 15px;margin-left: 10px"' +
|
'<a lay-event="del" style="color: #009688;cursor: pointer;font-size: 15px;margin-left: 10px"' +
|
||||||
' id="del">删除</a>';
|
' id="del">删除</a>';
|
||||||
|
|
@ -155,7 +162,16 @@
|
||||||
"data": result, //解析数据列表
|
"data": result, //解析数据列表
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
toolbar: "#toolbar"
|
toolbar: "#toolbar",
|
||||||
|
// 监听开关事件
|
||||||
|
done: function () {
|
||||||
|
layui.form.on('switch(switchTest)', function (obj) {
|
||||||
|
var status = obj.elem.checked ? '开' : '关';
|
||||||
|
// 这里可以添加你更新启用状态的逻辑,向服务器发送修改请求
|
||||||
|
// console.log('状态更新为:' + status);
|
||||||
|
alert('状态更新为:' + status)
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
//监听工具条
|
//监听工具条
|
||||||
table.on('tool(test)', function (obj) {
|
table.on('tool(test)', function (obj) {
|
||||||
|
|
@ -178,7 +194,7 @@
|
||||||
content: url,
|
content: url,
|
||||||
maxmin: false,
|
maxmin: false,
|
||||||
area: ['90%', '95%'],
|
area: ['90%', '95%'],
|
||||||
success: function (layero, index) {}
|
success: function (layero, index) { }
|
||||||
};
|
};
|
||||||
|
|
||||||
if (title === '查看模板') {
|
if (title === '查看模板') {
|
||||||
|
|
@ -219,14 +235,14 @@
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: ctxPath + '/setTemplate/deleteTemplateById',
|
url: ctxPath + '/setTemplate/deleteTemplateById',
|
||||||
data: {id: data.id},
|
data: { id: data.id },
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
layer.close(index);
|
layer.close(index);
|
||||||
if (data.res === 1) {
|
if (data.res === 1) {
|
||||||
layer.msg(data.resMsg, {icon: 1, time: 2000});
|
layer.msg(data.resMsg, { icon: 1, time: 2000 });
|
||||||
search(1);
|
search(1);
|
||||||
} else {
|
} else {
|
||||||
layer.msg(data.resMsg, {icon: 2, time: 2000});
|
layer.msg(data.resMsg, { icon: 2, time: 2000 });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -234,6 +250,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
Loading…
Reference in New Issue