更新layui
预更新番剧订阅编辑功能
This commit is contained in:
@@ -168,10 +168,17 @@
|
||||
<a class="layui-btn layui-btn-xs" lay-event="addRss">订阅</a>
|
||||
</script>
|
||||
<script type="text/html" id="listTools">
|
||||
<a class="layui-btn layui-btn-xs" lay-event="edit">查看</a>
|
||||
<a class="layui-btn layui-btn-xs" lay-event="show">查看</a>
|
||||
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="animState">
|
||||
{{# if(d.enable==1){}}
|
||||
<div><input type="checkbox" name="state" lay-text="启用|关闭" lay-filter="stateCheckbox" lay-skin="switch" value="{{d.roomid}}" checked></div>
|
||||
{{# } else { }}
|
||||
<div><input type="checkbox" name="state" lay-text="启用|关闭" lay-filter="stateCheckbox" lay-skin="switch" value="{{d.roomid}}"></div>
|
||||
{{# }}}
|
||||
</script>
|
||||
<script>
|
||||
$('#header').load("/html/header.html");
|
||||
$('#footer').load("/html/footer.html");
|
||||
@@ -179,7 +186,7 @@
|
||||
let tabid = -1;
|
||||
$.get("/login/check.do", function (data) {
|
||||
let json = JSON.parse(data);
|
||||
if (json.code != 0) {
|
||||
if (json.code !== 0) {
|
||||
window.location.href = "/"
|
||||
}
|
||||
})
|
||||
@@ -191,12 +198,12 @@
|
||||
, element = layui.element;
|
||||
$.get("/anim/type/list.do", function (data) {
|
||||
let json = JSON.parse(data);
|
||||
if (json.code == 0) {
|
||||
if (json.code === 0) {
|
||||
for (let index = 0; index < json.data.length; index++) {
|
||||
const ret = json.data[index];
|
||||
element.tabAdd('type', {
|
||||
title: ret.title
|
||||
, content: '<table id="passwordlist' + ret.id + '" lay-filter="listTools"></table>'
|
||||
, content: '<table id="passwordlist' + ret.id + '" lay-filter="adminTable"></table>'
|
||||
, id: ret.id
|
||||
})
|
||||
}
|
||||
@@ -227,10 +234,11 @@
|
||||
, page: true
|
||||
, cols: [[
|
||||
{field: "id", title: "id", width: 80, sort: true, fixed: 'left'}
|
||||
, {field: 'title', title: '标题'}
|
||||
, {field: 'title', title: '标题',edit:'text'}
|
||||
, {field: 'categories', title: '类型'}
|
||||
, {field: 'author', title: '字幕组'}
|
||||
, {field: 'titlekey', title: '搜索关键词'}
|
||||
, {field: 'titlekey', title: '搜索关键词',edit:'text'}
|
||||
, {field: 'enable', title: '状态',templet:'#animState'}
|
||||
, {field: "right", toolbar: '#listTools'}
|
||||
]]
|
||||
});
|
||||
@@ -256,8 +264,8 @@
|
||||
|
||||
});
|
||||
|
||||
table.on('tool(listTools)', function (obj) {
|
||||
if (obj.event === 'edit') {
|
||||
table.on('tool(adminTable)', function (obj) {
|
||||
if (obj.event === 'show') {
|
||||
$("#type").find("option:contains('" + obj.data.categories + "')").attr("selected", null);
|
||||
$("#team").find("option:contains('" + obj.data.author + "')").attr("selected", null);
|
||||
$("#type").find("option:contains('" + obj.data.categories + "')").attr("selected", true);
|
||||
@@ -285,8 +293,17 @@
|
||||
layer.close(index);
|
||||
}
|
||||
})
|
||||
}else if(obj.event==='edit'){
|
||||
|
||||
}
|
||||
})
|
||||
table.on('edit(adminTable)',function (obj){
|
||||
let type=obj.field;
|
||||
let value=obj.value;
|
||||
let id=obj.data.id;
|
||||
console.log("id = "+id+" type = "+type+" value = "+value)
|
||||
})
|
||||
|
||||
table.on('tool(rssTools)', function (obj) {
|
||||
let data = obj.data;
|
||||
if (obj.event === 'addRss') {
|
||||
|
||||
Reference in New Issue
Block a user