Initial commit

This commit is contained in:
易焱
2021-04-18 18:51:51 +08:00
commit ec705f2fa8
3240 changed files with 623103 additions and 0 deletions
+145
View File
@@ -0,0 +1,145 @@
<include file="Update:top"/>
<div class="Refresh Refresh_w">
<form action="__SELF__" method="post" onsubmit="return checkForm()">
<div class="Refresh_top clearer">
<div class="Refresh_left fl clearer">
<div class="Refresh_left_icon fl iconfont">&#xe617;</div>
<div class="Refresh_left_txt fl">
<dd>刷新网页</dd>
<dt>请至少选择一个刷新的项目!</dt>
</div>
</div>
<button class="Refresh_right fr click_Refresh">一键刷新</button>
</div>
<div class="Refresh_bottom">
<div class="Refresh_bottom_list">
<div class="bottom_list_title clearer">
<div class="list_title_checkbox fl">
<label class="radio_jibie fl">
<input type="checkbox" value="1" checked onclick="checkAll(this,'checkGroup1')"/>
</label>
</div>
<div class="list_title_icon fl">
<span class="iconfont">&#xe650;</span>所有缓存刷新
</div>
<div class="list_title_txt fl">
<!--共<span>{:count($cacheInc)}</span>项,已选中<span>0</span>项-->
</div>
</div>
<div class="bottom_list_content clearer">
<foreach name="updateInc" key="k" item="v">
<?php
if($v["group"]==1){
?>
<label class="list_content_li fl {$v.color} on">
<input type="checkbox" name="taskName[]" class="checkGroup checkGroup1" value="{$k}" {$v[num]?'':'disabled'} checked/>
<div class="content_li_txt">
<dd class="iconfont">{$v.icon}</dd>
<dt>{$v.name}</dt>
<div class="li_txt_bottom">{$v.num}条</div>
</div>
</label>
<?php
}
?>
</foreach>
</div>
</div>
<div class="Refresh_bottom_list">
<div class="bottom_list_title clearer">
<div class="list_title_checkbox fl">
<label class="radio_jibie fl">
<input type="checkbox" value="1" checked onclick="checkAll(this,'checkGroup2')"/>
</label>
</div>
<div class="list_title_icon fl">
<span class="iconfont">&#xe604;</span>首页/栏目/单页刷新
</div>
<div class="list_title_txt fl">
<!--共<span>{:count($homeCatInc)}</span>项,已选中<span>0</span>项-->
</div>
</div>
<div class="bottom_list_content clearer">
<foreach name="updateInc" key="k" item="v">
<?php
if($v["group"]==2){
?>
<label class="list_content_li fl {$v.color} on">
<input type="checkbox" name="taskName[]" class="checkGroup checkGroup2" value="{$k}" {$v[num]?'':'disabled'} checked/>
<div class="content_li_txt">
<dd class="iconfont">{$v.icon}</dd>
<dt>{$v.name}</dt>
<div class="li_txt_bottom">{$v.num}条</div>
</div>
</label>
<?php
}
?>
</foreach>
</div>
</div>
<div class="Refresh_bottom_list">
<div class="bottom_list_title clearer">
<div class="list_title_checkbox fl">
<label class="radio_jibie fl">
<input type="checkbox" value="1" checked onclick="checkAll(this,'checkGroup3')"/>
</label>
</div>
<div class="list_title_icon fl">
<span class="iconfont">&#xe60b;</span>所有内容页刷新
</div>
<div class="list_title_txt fl">
<!--共<span>{:count($detailInc)}</span>项,已选中<span>0</span>项-->
</div>
</div>
<div class="bottom_list_content clearer">
<foreach name="updateInc" key="k" item="v">
<?php
if($v["group"]==3){
?>
<label class="list_content_li fl {$v.color} on">
<input type="checkbox" name="taskName[]" class="checkGroup checkGroup3" value="{$k}" {$v[num]?'':'disabled'} checked/>
<div class="content_li_txt">
<dd class="iconfont">{$v.icon}</dd>
<dt>{$v.name}</dt>
<div class="li_txt_bottom">{$v.num}条</div>
</div>
</label>
<?php
}
?>
</foreach>
</div>
</div>
</div>
</form>
</div>
<include file="Inc:foot" noiframeauto="true"/>
<script src="/Public/Admin/js/vue.js"></script>
<script>
function checkAll(obj,group){
var y=$(obj).val();
if(y==0){
$.uniform.update($("."+group).prop("checked", true));
y=1;
}else if(y==1){
$.uniform.update($("."+group).prop("checked", false));
y=0;
}
$(obj).val(y);
}
//
function checkForm(){
var check=false;
$(".checkGroup:checked").each(function(){
check=true;
})
if(!check){
layer.alert("请选择要刷新的任务");
return false;
}else{
return true;
}
}
</script>
@@ -0,0 +1,236 @@
<include file="Update:top"/>
<div class="Refresh Refreshing" id="app">
<div class="Refresh_top clearer">
<div class="Refresh_left fl clearer">
<div class="Refresh_left_icon fl">
<div class="fensug">
<div class="wavenum">
<b id="denfenjs">{{percent}}%</b>
</div>
<div class="waven">
<div class="wave" :style="'height:'+percent+'%'"></div>
</div>
</div>
</div>
<div class="Refresh_left_txt fl">
<dd>{{bigTitle}}</dd>
<dt>{{bigTitleDetail}}</dt>
</div>
</div>
<div class="Refreshing_right fr">已用时:{{timeStr}}</div>
<div class="Refreshing_schedule" :style="'width:'+percent+'%;'"></div>
</div>
<div class="Refresh_bottom">
<div class="Refresh_bottom_list">
<div class="bottom_list_title clearer">
<div class="list_title_icon fl">
<span class="iconfont">&#xe650;</span>缓存刷新
</div>
</div>
<div class="bottom_list_content clearer">
<template v-for="(item,index) in taskInc">
<label :class="'list_content_li fl '+item.className " v-if="item.group==1">
<div class="content_li_txt">
<dd class="iconfont" v-html="item.icon"></dd>
<dt>{{item.name}}</dt>
<div class="li_txt_bottom li_txt_bottom1"><span :style="'width:'+item.selfPerent+'%'">{{item.selfPerent}}%</span></div>
<div class="li_txt_bottom li_txt_bottom2">{{item.num}}条</div>
</div>
</label>
</template>
</div>
</div>
<div class="Refresh_bottom_list">
<div class="bottom_list_title clearer">
<div class="list_title_icon fl">
<span class="iconfont">&#xe604;</span>首页/栏目/单页刷新
</div>
</div>
<div class="bottom_list_content clearer">
<template v-for="(item,index) in taskInc">
<label :class="'list_content_li fl '+item.className " v-if="item.group==2">
<div class="content_li_txt">
<dd class="iconfont" v-html="item.icon"></dd>
<dt>{{item.name}}</dt>
<div class="li_txt_bottom li_txt_bottom1"><span :style="'width:'+item.selfPerent+'%'">{{item.selfPerent}}%</span></div>
<div class="li_txt_bottom li_txt_bottom2">{{item.num}}条</div>
</div>
</label>
</template>
</div>
</div>
<div class="Refresh_bottom_list">
<div class="bottom_list_title clearer">
<div class="list_title_icon fl">
<span class="iconfont">&#xe60b;</span>内容页刷新
</div>
</div>
<div class="bottom_list_content clearer">
<template v-for="(item,index) in taskInc">
<label :class="'list_content_li fl '+item.className " v-if="item.group==3">
<div class="content_li_txt">
<dd class="iconfont" v-html="item.icon"></dd>
<dt>{{item.name}}</dt>
<div class="li_txt_bottom li_txt_bottom1"><span :style="'width:'+item.selfPerent+'%'">{{item.selfPerent}}%</span></div>
<div class="li_txt_bottom li_txt_bottom2">{{item.num}}条</div>
</div>
</label>
</template>
</div>
</div>
</div>
</div>
<include file="Inc:foot" noiframeauto="true"/>
<script src="/Public/Admin/js/vue.js"></script>
<script>
var app = new Vue({
el: '#app',
data: {
allNum:0,
bigTitle:"数据正在更新中",
bigTitleDetail:"受页面数量大小等因素需要一定的时间才能操作完成,请耐心等候...",
timeFun:null,
timeStr:"00:00:00",
percent:1,//任务进度,一开始给个1好看一些
task_index:1,//对应后台的task_index,
taskInc:{$data},
},
methods:{
foundTask:function(){
var isFound=false;
for(var k in this.taskInc){
if(this.taskInc[k]["task_index"]==this.task_index){
isFound=true;
this.sendTask(k,1,0);
}
}
//防止有未勾选的任务组
if(!isFound){
this.task_index++;
this.foundTask();
}
},
sendTask:function(k,i,ids_key){
var taskUrl="index.php?m=Admin&c=Update&a="+this.taskInc[k]["taskName"]+"&i="+i;
//如果刷新首页,列表页,内容页,自定义列表页,自定义内容页,需要访问Home下的控制器。
if(this.taskInc[k]["taskName"]=="updateHome"||this.taskInc[k]["taskName"]=="updatePage"||this.taskInc[k]["taskName"]=="updatePages"||this.taskInc[k]["taskName"]=="updateCat"||this.taskInc[k]["taskName"]=="updateDetai"){
var taskUrl="index.php?m=Home&c=Update&a="+this.taskInc[k]["taskName"]+"&i="+i;
}
var ids=this.taskInc[k]["ids"];
if(ids){
taskUrl=taskUrl+"&id="+ids[ids_key];
}
//如果当前
this.taskInc[k]["className"]="Finishing";
//如果是刷新内容页需要传递num和table字段
if(this.taskInc[k]["taskName"]=="updateDetai"){
taskUrl=taskUrl+"&table_name="+this.taskInc[k]["table"]+"&count="+this.taskInc[k]["num"];
}
var obj=this;
$.ajax({
url:taskUrl,
type:"get",
async:true,
dataType:'json',
success:function(result){
var status=result.status;
var data=result.info;
if(status){
//更新进度
obj.taskInc[k]["alreadyNum"]=obj.taskInc[k]["alreadyNum"]+data.num;
obj.updatePercent();
//这个任务执行完成了
if(data.complete==1){
//判断是不是栏目和自定义列表,需要刷新多个栏目的
if(obj.taskInc[k]["ids"]){
ids_key++;
if(obj.taskInc[k]["ids"][ids_key]){
//当前栏目刷新完成了,刷新下一个栏目
obj.sendTask(k,1,ids_key);
}else{
//这条任务刷新完成了,刷新下一个任务
obj.task_index++;//下一条任务
//obj.sendTask(k+1,1,0);
obj.foundTask();
}
}else{
//这条任务刷新完成了,刷新下一个任务
obj.task_index++;//下一条任务
//obj.sendTask(k+1,1,0);
obj.foundTask();
}
}else{
//未完成继续
i++;
obj.sendTask(k,i,ids_key);
}
}else{
layer.alert(data);
}
},
error:function(xhr,textStatus){
alert("程序出错"+xhr);
}
})
},
//更新进度条的
updatePercent:function(){
var allNum=0;
var alreadyNum=0;
for(var k in this.taskInc){
//当前进度
this.taskInc[k]["selfPerent"]=Math.ceil(this.taskInc[k]["alreadyNum"]/this.taskInc[k]["num"]*100);
//当前显示样式
if(this.taskInc[k]["selfPerent"]==100){
this.taskInc[k]["className"]="Finished";
//当这个任务完成后,将下个任务设置为开始状态。因为有的任务执行ajax请求时间长,ICON一直是灰色的状态
var nextK=parseInt(k)+1;
if(this.percent<100){
//this.taskInc[nextK]["className"]="Finishing";
}
}else if(this.taskInc[k]["selfPerent"]==0){
this.taskInc[k]["className"]="ReadFinishing";
}else{
this.taskInc[k]["className"]="Finishing";
}
//总体进度
allNum=allNum+Math.ceil(this.taskInc[k]["num"]);
this.allNum=allNum;
alreadyNum=alreadyNum+Math.ceil(this.taskInc[k]["alreadyNum"]);
}
var percent=alreadyNum/allNum*100;
this.percent=Math.ceil(percent);
//刷新完成
if(percent==100){
this.bigTitle="所有数据已更新完成!";
this.bigTitleDetail="总计用时:"+this.timeStr+",更新了"+this.allNum+"个页面。";
clearInterval(this.timeFun);
}
}
},
mounted:function(){
//开始执行任务
//this.sendTask(0,1,0);
this.task_index=this.taskInc[0].task_index;
this.foundTask();
//计时器
var count=0;
var obj=this;
this.timeFun=setInterval(function() {
var h = parseInt(count / 1000 / 60 / 60);
var m = parseInt(count / 1000 / 60) % 60;
var s = parseInt(count / 1000) % 60;
var ms = parseInt(count / 10) % 100;
h = h < 10 ? '0' + h : h;
m = m < 10 ? '0' + m : m;
s = s < 10 ? '0' + s : s;
ms = ms < 10 ? '0' + ms : ms;
obj.timeStr = h + ':' + m + ':' + s ;
count += 10;
}, 10)
},
});
</script>
+120
View File
@@ -0,0 +1,120 @@
<include file="Inc:head"/>
<link rel="stylesheet" href="/Public/skin/css/iconfont.css" />
<style>
body.on{ overflow:hidden;}
.clearer:after{content: "";display: block;height: 0;clear: both;visibility: hidden;}
.clearer{zoom: 1;}/* 触发 hasLayout */
.Refresh{ position:fixed; width:920px; height:658px; background:#fff; z-index:1000; left:50%; top:50%; transform:translateX(-50%) translateY(-50%); box-shadow:0px 0px 20px rgba(0,0,0,.3); border:0px solid #28b779;}
.Refresh .Refresh_top{ padding:20px 48px; background:#f5f5f5; position:relative;}
.Refresh .Refresh_top .Refresh_close{ position:absolute; right:1%; top:10%; font-size:20px; color:#666;
display:inline-block; width: 16px;
height: 16px;
margin-left: 10px;
font-size: 12px;
background-position: 0 -40px;
cursor: pointer;
}
.Refresh .Refresh_top .Refresh_left{ width:60%;}
.Refresh .Refresh_top .Refresh_left .Refresh_left_icon{ width:81px; height:81px; border-radius:100%; text-align:center; line-height:81px; background: linear-gradient(to top,#29b777, #45b44b); color:#fff; font-size:40px;}
.Refresh .Refresh_top .Refresh_left .Refresh_left_txt{ text-align:left; margin-left:18px; padding:13px 0px;}
.Refresh .Refresh_top .Refresh_left .Refresh_left_txt dd{ font-size:30px; color:#333333; font-weight:lighter; margin:0px;}
.Refresh .Refresh_top .Refresh_left .Refresh_left_txt dt{ font-size:13px; color:#868986; font-weight:normal; margin-top:15px;}
.Refresh .Refresh_top .Refresh_right{ display:inline-block; line-height:46px; background:#31d16c; color:#fff; font-size:22px; width:156px; border:0px; border-radius:100px; text-align:center; box-shadow:0px 0px 10px rgba(49,209,108,1); margin:17px 0px;}
.Refresh .Refresh_bottom .Refresh_bottom_list .bottom_list_title{ height:50px; border-bottom:1px solid #ececec; padding:0px 48px;}
.Refresh .Refresh_bottom .Refresh_bottom_list .bottom_list_title .list_title_checkbox label{ margin-bottom:0px; line-height:47px;}
.Refresh .Refresh_bottom .Refresh_bottom_list .bottom_list_title .list_title_icon{ line-height:50px; margin-right:20px; font-size:16px;}
.Refresh .Refresh_bottom .Refresh_bottom_list .bottom_list_title .list_title_icon span{ font-size:20px; color:#ff7751; display:inline-block; position:relative;margin-right:9px;}
.Refresh .Refresh_bottom .Refresh_bottom_list .bottom_list_title .list_title_txt{ line-height:50px;}
.Refresh .Refresh_bottom .Refresh_bottom_list .bottom_list_title .list_title_txt span{ color:#ff7751;}
.Refresh .Refresh_bottom .Refresh_bottom_list .bottom_list_content{ padding:14px 50px; padding-right:0px; padding-bottom:4px;}
.Refresh .Refresh_bottom .Refresh_bottom_list .bottom_list_content .list_content_li{ text-align:center; position:relative; margin-right:44px; margin-bottom:0px;}
.Refresh .Refresh_bottom .Refresh_bottom_list .bottom_list_content .list_content_li:last-child{ margin-right:0px;}
.Refresh .Refresh_bottom .Refresh_bottom_list .bottom_list_content .list_content_li #uniform-undefined{ position:absolute; right:0%; top:32%;}
.Refresh .Refresh_bottom .Refresh_bottom_list:nth-child(1) .bottom_list_content .list_content_li:last-child #uniform-undefined{ right:5%;}
.Refresh .Refresh_bottom .Refresh_bottom_list:nth-child(2) .bottom_list_content .list_content_li:last-child #uniform-undefined{ right:10%;}
.Refresh .Refresh_bottom .Refresh_bottom_list .bottom_list_content .list_content_li .content_li_txt dd{ width:48px; height:48px; text-align:center; line-height:48px; color:#fff; font-size:24px; background:#f74d4d; border-radius:100px; margin:0 auto;}
.Refresh .Refresh_bottom .Refresh_bottom_list .bottom_list_content .list_content_li .content_li_txt dt{ font-weight:normal; font-size:12px; color:#666666; margin-top:10px; margin-bottom:5px;}
.Refresh .Refresh_bottom .Refresh_bottom_list .bottom_list_content .list_content_li .content_li_txt .li_txt_bottom{ height:18px; line-height:18px; text-align:center; background:#c7c7c7; border-radius:20px; font-size:12px; color:#fff; width:68px; margin:0 auto; position:relative; overflow: hidden;}
.Refresh .Refresh_bottom .Refresh_bottom_list .bottom_list_content .list_content_li.on .content_li_txt .li_txt_bottom{ background:#55c9ff;}
.Refresh .Refresh_bottom .Refresh_bottom_list .bottom_list_content .list_content_li.color1 .content_li_txt dd{ background:#f74d4d;}
.Refresh .Refresh_bottom .Refresh_bottom_list .bottom_list_content .list_content_li.color2 .content_li_txt dd{ background:#28b779;}
.Refresh .Refresh_bottom .Refresh_bottom_list .bottom_list_content .list_content_li.color3 .content_li_txt dd{ background:#2295c9;}
.Refresh .Refresh_bottom .Refresh_bottom_list .bottom_list_content .list_content_li.color4 .content_li_txt dd{ background:#2255a4;}
.Refresh .Refresh_bottom .Refresh_bottom_list .bottom_list_content .list_content_li.color5 .content_li_txt dd{ background:#31d16c;}
.Refresh .Refresh_bottom .Refresh_bottom_list .bottom_list_content .list_content_li.color6 .content_li_txt dd{ background:#ffb848;}
.Refreshing .Refresh_top{ position:relative;}
.Refreshing .Refreshing_right{ font-size:15px; color:#666666; line-height:81px;}
.Refreshing .Refresh_top .Refreshing_schedule{ position:absolute; bottom:0; width:100%; height:4px; background:#15db54; left:0;}
.Refreshing .Refresh_bottom .Refresh_bottom_list .bottom_list_content .list_content_li{ position: relative; overflow: hidden;}
.Refreshing .Refresh_bottom .Refresh_bottom_list .bottom_list_content .list_content_li .content_li_txt dd{ background:#c7c7c7; position: relative;}
.Refreshing .Refresh_bottom .Refresh_bottom_list .bottom_list_content .list_content_li.Finished .content_li_txt dd{ background:#31d16c;}
.Refreshing .Refresh_bottom .Refresh_bottom_list .bottom_list_content .list_content_li.Finished .content_li_txt .li_txt_bottom span{ background:#31d16c; left: 0;}
.Refreshing .Refresh_bottom .Refresh_bottom_list .bottom_list_content .list_content_li.Finishing .content_li_txt dd{ background:#008aff;}
.Refreshing .Refresh_bottom .Refresh_bottom_list .bottom_list_content .list_content_li.Finishing:before{ content: ""; display: inline-block;position:absolute; width:50%; height:100%; background:#C92225; left:0; top:0;
animation:mymove 1.5s infinite; z-index: 50;
background: linear-gradient(to left,#008aff, rgba(255,255,255,.1));
}
@keyframes mymove{
from {left:-50px; opacity:1;}
to {left:80px; opacity:0;}
}
.Refreshing .Refresh_bottom .Refresh_bottom_list .bottom_list_content .list_content_li .content_li_txt .li_txt_bottom span{ position:absolute; width:75%; left:0; height:100%; display:inline-block; background:#008aff; border-radius:200px 0px 0px 200px;}
.Refresh .Refresh_bottom .Refresh_bottom_list .bottom_list_content .list_content_li .content_li_txt .li_txt_bottom1{ display: none;}
.Refresh .Refresh_bottom .Refresh_bottom_list .bottom_list_content .list_content_li.Finishing .content_li_txt .li_txt_bottom1{ display: block;}
.Refresh .Refresh_bottom .Refresh_bottom_list .bottom_list_content .list_content_li.Finished .content_li_txt .li_txt_bottom1{ display: block;}
.Refresh .Refresh_bottom .Refresh_bottom_list .bottom_list_content .list_content_li.Finishing .content_li_txt .li_txt_bottom2{ display: none;}
.Refresh .Refresh_bottom .Refresh_bottom_list .bottom_list_content .list_content_li.Finished .content_li_txt .li_txt_bottom2{ display: none;}
.fensug{overflow:hidden; position:relative}
.fensug .wavenum{width:81px;height:81px;overflow:hidden;-webkit-border-radius:50%;border-radius:50%;text-align:center;display:table-cell;vertical-align:middle; position:absolute; left:0; top:0; z-index:5; display:flex; align-items:center; justify-content:center;flex-direction:column; margin:0 auto;}
.fensug .wavenum b{ color:#fff; font-size:23px; text-align:center; display:block; position:relative; z-index:2;}
.waven{ width:81px; height:81px; webkit-border-radius:25em;
-moz-border-radius:25em;
border-radius:25em;background:#ff9800; overflow:hidden; position:relative}
.wave {width:408px;height: 80%; position:absolute; left:0px; bottom:0; background: url(/Public/Admin/img/wave.png) no-repeat;animation: move_wave 1s linear infinite; -webkit-animation: move_wave 1s linear infinite;}
@-webkit-keyframes move_wave {
0% {
-webkit-transform: translateX(0)
}
50% {
-webkit-transform: translateX(-25%)
}
100% {
-webkit-transform: translateX(-50%)
}
}
@keyframes move_wave {
0% {
transform: translateX(0)
}
50% {
transform: translateX(-25%)
}
100% {
transform: translateX(-50%)
}
}
</style>