新增BT修改标题和关键词
This commit is contained in:
parent
de0670ea88
commit
b714eebaa5
@ -5,7 +5,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class ToolsApplication {
|
||||
public static final String version="1.1.1";
|
||||
public static final String version="1.1.2";
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println("当前版本号:" + version);
|
||||
|
@ -144,7 +144,13 @@ public class AnimationController {
|
||||
if(!StringUtils.isEmpty(enable)){
|
||||
item.setEnable(Integer.parseInt(enable));
|
||||
}
|
||||
itemDao.updateByPrimaryKey(item);
|
||||
int i=itemDao.updateByPrimaryKey(item);
|
||||
if(i>0){
|
||||
json.put("msg","操作成功");
|
||||
}else{
|
||||
json.put("msg","操作失败");
|
||||
}
|
||||
json.put("code",1);
|
||||
return json;
|
||||
}
|
||||
@ResponseBody
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
<div class="layui-layout layui-layout-admin">
|
||||
<div id="header"></div>
|
||||
<div class="layui-body" style="top: 100px; ">
|
||||
<div class="layui-body" style="top: 100px;overflow:auto; ">
|
||||
|
||||
<div id="side"></div>
|
||||
<blockquote class="layui-elem-quote"><span id="ip">番剧订阅器</span></blockquote>
|
||||
@ -169,14 +169,15 @@
|
||||
</script>
|
||||
<script type="text/html" id="listTools">
|
||||
<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>
|
||||
<div><input type="checkbox" name="state" lay-text="启用|关闭" lay-filter="stateCheckbox" lay-skin="switch"
|
||||
value="{{d.id}}" checked></div>
|
||||
{{# } else { }}
|
||||
<div><input type="checkbox" name="state" lay-text="启用|关闭" lay-filter="stateCheckbox" lay-skin="switch" value="{{d.roomid}}"></div>
|
||||
<div><input type="checkbox" name="state" lay-text="启用|关闭" lay-filter="stateCheckbox" lay-skin="switch"
|
||||
value="{{d.id}}"></div>
|
||||
{{# }}}
|
||||
</script>
|
||||
<script>
|
||||
@ -215,15 +216,111 @@
|
||||
, page: true
|
||||
, cols: [[
|
||||
{field: "id", title: "id", width: 80, sort: true, fixed: 'left'}
|
||||
, {field: 'title', title: '标题',edit:'text'}
|
||||
, {field: 'title', title: '标题', edit: 'text'}
|
||||
, {field: 'categories', title: '类型'}
|
||||
, {field: 'author', title: '字幕组'}
|
||||
, {field: 'titlekey', title: '搜索关键词',edit:'text'}
|
||||
, {field: 'enable', title: '状态',templet:'#animState'}
|
||||
, {field: 'titlekey', title: '搜索关键词', edit: 'text'}
|
||||
, {field: 'enable', title: '状态', templet: '#animState'}
|
||||
, {field: "right", toolbar: '#listTools'}
|
||||
]]
|
||||
});
|
||||
})
|
||||
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)
|
||||
let data = {}
|
||||
if (type === 'title') {
|
||||
data = {id: id, title: value}
|
||||
} else {
|
||||
data = {id: id, titleKey: value}
|
||||
}
|
||||
$.post('/anim/rss/edit.do', data, function (json) {
|
||||
layer.msg(json.msg)
|
||||
})
|
||||
})
|
||||
element.on('tabDelete(animType)', function (data) {
|
||||
let name = $(data.elem.prevObject.prevObject[0]).text().replace("ဆ", "")
|
||||
let id = $(data.elem.prevObject.prevObject[0]).attr('lay-id')
|
||||
layer.open({
|
||||
title: "警告"
|
||||
, content: "确认删除 " + name
|
||||
, btn: ['确认', '取消']
|
||||
, yes: function (index) {
|
||||
$.post('/anim/type/del.do', {id: id}, function (data) {
|
||||
let json = JSON.parse(data);
|
||||
layer.msg(json.msg);
|
||||
})
|
||||
layer.close(index)
|
||||
}
|
||||
, btn2: function (index) {
|
||||
layer.close(index)
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
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);
|
||||
$("#team").find("option:contains('" + obj.data.author + "')").attr("selected", true);
|
||||
$('#title').val(obj.data.titlekey);
|
||||
|
||||
form.render("select", 'team');
|
||||
form.render("select", 'type');
|
||||
searchClick();
|
||||
|
||||
} else if (obj.event === 'del') {
|
||||
layer.open({
|
||||
title: "警告!"
|
||||
, content: "删除操作无法回滚,是否确认删除:" + obj.data.title
|
||||
, btn: ['确认', '取消']
|
||||
, yes: function (index) {
|
||||
$.post('/anim/rss/del.do', {id: obj.data.id}, function (data) {
|
||||
let json = JSON.parse(data);
|
||||
layer.msg(json.msg)
|
||||
layer.close(index)
|
||||
})
|
||||
|
||||
},
|
||||
btn2: function (index) {
|
||||
layer.close(index);
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
table.on('tool(rssTools)', function (obj) {
|
||||
let data = obj.data;
|
||||
if (obj.event === 'addRss') {
|
||||
layer.prompt({
|
||||
formType: 2,
|
||||
title: '订阅这个RSS结果,并加入到第' + tabid + '个分类中',
|
||||
value: data.title
|
||||
}, function (value, index, elem) {
|
||||
$.post("/anim/rss/add.do", {
|
||||
title: value
|
||||
, author: data.author
|
||||
, categories: data.categories[0]
|
||||
, titleKey: $('#title').val()
|
||||
, bid: tabid
|
||||
}, function (data) {
|
||||
let json = JSON.parse(data);
|
||||
layer.msg(json.msg)
|
||||
layer.close(index)
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
form.on('switch(stateCheckbox)', function (data) {
|
||||
let flag = data.elem.checked ? 1 : 0;
|
||||
let id = data.value;
|
||||
$.post('/anim/rss/edit.do',{id:id,enable:flag},function (json) {
|
||||
layer.msg(json.msg)
|
||||
})
|
||||
})
|
||||
element.tabChange('animType', '1');
|
||||
|
||||
}
|
||||
@ -245,89 +342,7 @@
|
||||
})
|
||||
form.render()
|
||||
|
||||
element.on('tabDelete(animType)', function (data) {
|
||||
let name = $(data.elem.prevObject.prevObject[0]).text().replace("ဆ", "")
|
||||
let id = $(data.elem.prevObject.prevObject[0]).attr('lay-id')
|
||||
layer.open({
|
||||
title: "警告"
|
||||
, content: "确认删除 " + name
|
||||
, btn: ['确认', '取消']
|
||||
, yes: function (index) {
|
||||
$.post('/anim/type/del.do', {id: id}, function (data) {
|
||||
let json = JSON.parse(data);
|
||||
layer.msg(json.msg);
|
||||
})
|
||||
layer.close(index)
|
||||
}
|
||||
, btn2: function (index) {
|
||||
layer.close(index)
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
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);
|
||||
$("#team").find("option:contains('" + obj.data.author + "')").attr("selected", true);
|
||||
$('#title').val(obj.data.titlekey);
|
||||
|
||||
form.render("select", 'team');
|
||||
form.render("select", 'type');
|
||||
searchClick();
|
||||
|
||||
} else if (obj.event === 'del') {
|
||||
layer.open({
|
||||
title: "警告!"
|
||||
, content: "删除操作无法回滚,是否确认删除:" + obj.data.title
|
||||
, btn: ['确认', '取消']
|
||||
, yes: function (index) {
|
||||
$.post('/anim/rss/del.do', {id: obj.data.id}, function (data) {
|
||||
let json = JSON.parse(data);
|
||||
layer.msg(json.msg)
|
||||
layer.close(index)
|
||||
})
|
||||
|
||||
},
|
||||
btn2: function (index) {
|
||||
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') {
|
||||
layer.prompt({
|
||||
formType: 2,
|
||||
title: '订阅这个RSS结果,并加入到第' + tabid + '个分类中',
|
||||
value: data.title
|
||||
}, function (value, index, elem) {
|
||||
$.post("/anim/rss/add.do", {
|
||||
title: value
|
||||
, author: data.author
|
||||
, categories: data.categories[0]
|
||||
, titleKey: $('#title').val()
|
||||
, bid: tabid
|
||||
}, function (data) {
|
||||
let json = JSON.parse(data);
|
||||
layer.msg(json.msg)
|
||||
layer.close(index)
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
$('#addType').click(function () {
|
||||
layer.prompt({
|
||||
title: '新增分类'
|
||||
@ -353,7 +368,6 @@
|
||||
|
||||
}
|
||||
});
|
||||
$.ajax({cache: false})
|
||||
|
||||
//let js="" ; $('#team option').each(function() { let value=$(this).val(); let text=$(this).text(); js+='{"'+value+'":"'+text+'"},'})
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user