From f98865ae37cd4fb1589503917eedd7a102210edc Mon Sep 17 00:00:00 2001 From: xiaoz Date: Fri, 29 Apr 2022 17:20:05 +0800 Subject: [PATCH] 20220429 --- templates/admin/click.php | 3 - templates/admin/link_list.php | 26 ++++++- templates/admin/setting/theme.php | 10 +++ templates/admin/setting/theme_config.php | 83 ++++++++++++++++++++ templates/admin/setting/theme_detail.php | 1 + templates/admin/static/embed.js | 97 +++++++++++++++++++++++- templates/baisuTwo/config.json | 3 + templates/baisuTwo/index.php | 13 ++++ templates/baisuTwo/info.json | 10 ++- templates/baisuTwo/js/admin.js | 2 + templates/default/config.json | 5 ++ templates/default/index.php | 21 ++++- templates/default/info.json | 20 +++-- version.txt | 2 +- 14 files changed, 276 insertions(+), 20 deletions(-) create mode 100644 templates/admin/setting/theme_config.php create mode 100644 templates/baisuTwo/config.json create mode 100644 templates/default/config.json diff --git a/templates/admin/click.php b/templates/admin/click.php index 824bff8..4b5ac02 100755 --- a/templates/admin/click.php +++ b/templates/admin/click.php @@ -25,8 +25,6 @@ $admin_stay_time = $transition_page['admin_stay_time']; if ($is_login) { - //header("Refresh:1;url=".$link['url']); - header("Refresh:$admin_stay_time;url=".$link['url']); } else{ @@ -103,6 +101,5 @@ - diff --git a/templates/admin/link_list.php b/templates/admin/link_list.php index 6bce5a1..4e4f4b4 100755 --- a/templates/admin/link_list.php +++ b/templates/admin/link_list.php @@ -4,12 +4,36 @@
+ +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
- + + + + + \ No newline at end of file diff --git a/templates/admin/setting/theme_detail.php b/templates/admin/setting/theme_detail.php index 0f7d6be..9316463 100644 --- a/templates/admin/setting/theme_detail.php +++ b/templates/admin/setting/theme_detail.php @@ -21,6 +21,7 @@

版本:version; ?>

更新时间:update; ?>

作者:author; ?>

+

使用说明:help_url; ?>

主页:homepage; ?>

diff --git a/templates/admin/static/embed.js b/templates/admin/static/embed.js index 6ef125f..a7a1b92 100755 --- a/templates/admin/static/embed.js +++ b/templates/admin/static/embed.js @@ -71,6 +71,7 @@ layui.use(['element','table','layer','form','upload'], function(){ elem: '#link_list' ,height: 520 ,url: 'index.php?c=api&method=link_list' //数据接口 + ,method: 'post' ,page: true //开启分页 ,toolbar: '#linktool' ,cols: [[ //表头 @@ -156,9 +157,41 @@ layui.use(['element','table','layer','form','upload'], function(){ //刷新当前页面 //window.location.reload(); break; - case 'getCheckLength': + case 'readmoredata': var data = checkStatus.data; - layer.msg('选中了:'+ data.length + ' 个'); + fidtext = $("#fid option:selected").text(); + fid = $("#fid").val(); + fid = parseInt(fid); + if( data.length == 0 ) { + layer.msg('未选中任何数据!'); + return false; + } + + if ( isNaN(fid) === true ){ + layer.msg('请先选择分类!',{icon:5}); + } + else{ + + layer.confirm('确认将选中链接的分类修改为【' + fidtext + '】?',{icon: 3, title:'温馨提示!'}, function(index){ + id = []; + for(let i = 0;i < data.length;i++) { + id.push(data[i].id); + } + + $.post("/index.php?c=api&method=batch_modify_category",{id:id,fid:fid},function(data,status){ + if (data.msg === "success") { + layer.msg("修改成功!",{icon:1}); + setTimeout(() => { + window.location.reload(); + }, 2000); + } + else{ + layer.msg(data.err_msg,{icon:5}); + } + }); + }); + } + //console.log(data); break; case 'isAll': layer.msg(checkStatus.isAll ? '全选': '未全选'); @@ -260,6 +293,66 @@ layui.use(['element','table','layer','form','upload'], function(){ return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。 }); + //筛选链接 + form.on('submit(screen_link)', function(data){ + fid = data.field.fid; + if( fid == "" ) { + layer.msg("请先选择分类!",{icon:5}); + return false; + } + //表格重载 + var tableIns = table.render({ + elem: '#link_list' + ,height: 520 + ,url: 'index.php?c=api&method=link_list' //数据接口 + ,method: 'post' + ,page: true //开启分页 + ,toolbar: '#linktool' + ,where:{ + category_id:fid + } + ,cols: [[ //表头 + {type:'checkbox'} //开启复选框 + ,{field: 'id', title: 'ID', width:80, sort: true} + // ,{field: 'fid', title: '分类ID',sort:true, width:90} + ,{field: 'category_name', title: '所属分类',sort:true,width:120} + ,{field: 'url', title: 'URL',width:140,templet:function(d){ + var url = '' + d.url + ''; + return url; + }} + ,{field: 'title', title: '链接标题', width:140} + ,{field: 'add_time', title: '添加时间', width:148, sort: true,templet:function(d){ + var add_time = timestampToTime(d.add_time); + return add_time; + }} + ,{field: 'up_time', title: '修改时间', width:148,sort:true,templet:function(d){ + if(d.up_time == null){ + return ''; + } + else{ + var up_time = timestampToTime(d.up_time); + return up_time; + } + + }} + ,{field: 'weight', title: '权重', width: 75,sort:true} + ,{field: 'property', title: '私有', width: 80, sort: true,templet: function(d){ + if(d.property == 1) { + return ''; + } + else { + return ''; + } + }} + ,{field: 'click', title: '点击数',width:90,sort:true} + ,{fixed: 'right', title:'操作', toolbar: '#link_operate'} + ]] + }); + + //console.log(data.field) //当前容器的全部表单字段,名值对形式:{name: value} + return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。 + }); + //保存站点设置 form.on('submit(set_site)', function(data){ $.post('/index.php?c=api&method=set_site',data.field,function(data,status){ diff --git a/templates/baisuTwo/config.json b/templates/baisuTwo/config.json new file mode 100644 index 0000000..0015cd6 --- /dev/null +++ b/templates/baisuTwo/config.json @@ -0,0 +1,3 @@ +{ + "link_description": "hide" +} \ No newline at end of file diff --git a/templates/baisuTwo/index.php b/templates/baisuTwo/index.php index e2312a6..74a0f0d 100644 --- a/templates/baisuTwo/index.php +++ b/templates/baisuTwo/index.php @@ -18,6 +18,15 @@ + @@ -419,6 +428,10 @@ 私有:
+
diff --git a/templates/baisuTwo/info.json b/templates/baisuTwo/info.json index 5621258..a3b1fe3 100644 --- a/templates/baisuTwo/info.json +++ b/templates/baisuTwo/info.json @@ -2,8 +2,12 @@ "name":"百素主题2", "description":"适用于OneNav的百素主题2", "homepage":"https://gitee.com/baisucode/baisu-two", - "version":"1.0.1", - "update":"2022/04/22", + "version":"1.0.2", + "update":"2022/04/29", "author":"baisu", - "screenshot":"https://img.rss.ink/imgs/2022/03/cba9f1946776a8f0.png" + "help_url":"https://dwz.ovh/gnae4", + "screenshot":"https://img.rss.ink/imgs/2022/03/cba9f1946776a8f0.png", + "config": { + "link_description":"hide" + } } \ No newline at end of file diff --git a/templates/baisuTwo/js/admin.js b/templates/baisuTwo/js/admin.js index 6e5c6e1..a3087cc 100644 --- a/templates/baisuTwo/js/admin.js +++ b/templates/baisuTwo/js/admin.js @@ -203,6 +203,7 @@ layui.use(['dropdown', 'layer', 'form'], function() { "description": data.data.description, "weight": data.data.weight, "property": property, + "fid":parseInt(data.data.fid) }); } else { //获取信息失败 @@ -287,6 +288,7 @@ function editFID(data) { name: data.name, font_icon: data.font_icon, weight: data.weight, + fid:data.fid, property: data.property, description: data.description, }, function(data, status) { diff --git a/templates/default/config.json b/templates/default/config.json new file mode 100644 index 0000000..f8a6c2e --- /dev/null +++ b/templates/default/config.json @@ -0,0 +1,5 @@ +{ + "full_width_mode": "on", + "link_description": "hide", + "favicon": "online" +} \ No newline at end of file diff --git a/templates/default/index.php b/templates/default/index.php index 2c747ab..786c5a0 100755 --- a/templates/default/index.php +++ b/templates/default/index.php @@ -14,6 +14,16 @@ + -
+
">