信呼OA版本v2.3.8
This commit is contained in:
174
webmain/we/ying/tpl_ying.html
Normal file
174
webmain/we/ying/tpl_ying.html
Normal file
@@ -0,0 +1,174 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
|
||||
<title><?=$da['title']?></title>
|
||||
<link rel="stylesheet" type="text/css" href="mode/weui/weui.min.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="web/res/fontawesome/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="webmain/css/rui.css">
|
||||
<link rel="shortcut icon" href="<?=$arr['face']?>" />
|
||||
<script type="text/javascript" src="js/jquery.js"></script>
|
||||
<script type="text/javascript" src="js/js.js"></script>
|
||||
<script type="text/javascript" src="js/jswx.js"></script>
|
||||
<script type="text/javascript" src="js/base64-min.js"></script>
|
||||
<script type="text/javascript" src="js/jsmain.js"></script>
|
||||
<script type="text/javascript" src="webmain/we/ying/ying.js?<?=time()?>"></script>
|
||||
<style>
|
||||
<?php
|
||||
$maincolor = getconfig('apptheme','#1389D3');
|
||||
$maincolora= c('image')->colorTorgb($maincolor);
|
||||
$maincolors= ''.$maincolora[0].','.$maincolora[1].','.$maincolora[2].'';
|
||||
echo 'body{--main-color:'.$maincolor.'}';
|
||||
?>
|
||||
body,html{background-color:#f1f1f1;overflow:hidden}
|
||||
.weui_tab{position:fixed;bottom:0px;width:100%;height:50px}
|
||||
.weui_navbar_item{font-size:16px;}
|
||||
.weui_navbar_item span{position:absolute;left:3px;top:3px}
|
||||
.weui_navbar_item:active{background-color:#f5f5f5}
|
||||
.weui_navbar_item_disabled{color:#aaaaaa}
|
||||
|
||||
.contline{padding-top:10px;color:#999999;font-size:14px;text-align:center;}
|
||||
.contlist{margin:15px;padding:8px 10px;position:relative; background:white}
|
||||
.contlist:active,.active{ background-color:#f1f1f1}
|
||||
.contlist .title{font-size:16px}
|
||||
.contlist .dt{font-size:12px;color:#aaaaaa;}
|
||||
.contlist .xq{color:<?=$maincolor?>;font-size:14px;padding-top:7px}
|
||||
.contlist .xq span{float:right}
|
||||
.contlist .cont{font-size:14px;padding:10px 0px}
|
||||
.contlist .imgs{height:130px;overflow:hidden;margin:5px 0px}
|
||||
.contlist .zt{font-size:10px;position:absolute;top:2px;right:1px;padding:1px 3px;background-color:red;color:white}
|
||||
.contlist .face{font-size:14px;padding:5px 0px;overflow:hidden;}
|
||||
.contlist .face img{border-radius:15px;height:24px;width:24px;margin-right:5px}
|
||||
.contlist .opt{font-size:10px;position:absolute;bottom:1px;right:1px;padding:1px 3px;color:#aaaaaa}
|
||||
|
||||
.showblank{color:#aaaaaa;font-size:14px;padding-bottom:15px;text-align:center}
|
||||
.showblanks{padding:10px;color:#aaaaaa;font-size:12px;text-align:center}
|
||||
.notrecord{text-align:center;font-size:20px;padding-top:50px;color:#aaaaaa}
|
||||
.r-border:after{border-radius:5px}
|
||||
</style>
|
||||
<script>
|
||||
var json = <?=json_encode($arr)?>;
|
||||
ismobile = 1,openfrom='<?=$openfrom?>';
|
||||
var agentlx=0,xhauthkey = '<?=$xhauthkey?>',maincolor='<?=$maincolor?>';
|
||||
function yingyonginit(){
|
||||
yy.loadshow();
|
||||
}
|
||||
function initbody(){
|
||||
adminid = '<?=$da['adminid']?>';
|
||||
admintoken = '<?=$xhrock->admintoken?>';
|
||||
yy.init();
|
||||
yingyonginit();
|
||||
}
|
||||
function initApp(){
|
||||
js.setapptitle(json.name);
|
||||
js.location=function(dz){
|
||||
if(js.appwin('',dz))return;
|
||||
location.href = dz;
|
||||
}
|
||||
var nowlist = 'yingyong_mode_'+json.num+'';
|
||||
js.setoption('nowListener', nowlist);
|
||||
api.addEventListener({
|
||||
name: nowlist
|
||||
}, function(ret, err) {
|
||||
if(ret){
|
||||
var lx = ret.value.opttype;
|
||||
if(lx=='reload')yy.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
function callPhone(o1){
|
||||
if(typeof(o1)!='string')o1 = $(o1).text();
|
||||
if(appobj1('callPhone', o1)){
|
||||
return false;
|
||||
}else if(apicloud){
|
||||
api.call({type:'tel_prompt',number:o1});
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
<?php if(isset($arr['leixing'])){ ?>
|
||||
try{sessionStorage.removeItem(''+json.num+'_event');}catch(e){}
|
||||
yy.clad=function(){
|
||||
js.location('?a=lum&m=input&d=flow&num='+json.leixing+'&show=we');
|
||||
}
|
||||
yy.typechange=function(o1){
|
||||
var val = o1.value;
|
||||
yy.search({'typeid':val});
|
||||
}
|
||||
yy.onshowdata=function(da){
|
||||
if(get('typeid') && da.typearr){
|
||||
js.setselectdata(get('typeid'), da.typearr, 'id');
|
||||
}
|
||||
}
|
||||
<?php } ?>
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
<?php if($showheader==1){?>
|
||||
<div>
|
||||
<div class="r-header" style="padding-top:<?=$cenghei?>px" >
|
||||
<div class="r-header-text" onclick="location.reload()" id="header_title"><?=$da['title']?></div>
|
||||
<?php if($rock->get('openfrom')!='reim'){?>
|
||||
<span onclick="js.back()" class="r-position-left r-header-btn"><i class="icon-chevron-left"></i></span>
|
||||
<?php }?>
|
||||
<span onclick="yy.clad()" class="r-position-right r-header-btn"><i class="icon-plus"></i></span>
|
||||
</div>
|
||||
<div class="blank50" id="header_line" style="height:<?=($cenghei+50)?>px"></div>
|
||||
</div>
|
||||
<?php }?>
|
||||
|
||||
|
||||
<?php if($yyurl=='' || isset($searchtool)){?>
|
||||
<div style="z-index:2" id="searsearch_bar" class="weui_search_bar">
|
||||
<?php
|
||||
if($typename){
|
||||
echo '<select id="typeid" onchange="yy.typechange(this)" style="width:100px;border:none;background:white;font-size:14px"><option value="">'.$typename.'</option></select>';
|
||||
}
|
||||
?>
|
||||
<form onclick="yy.seuser()" class="weui_search_outer" onsubmit="yy.sous();return false;">
|
||||
<div class="weui_search_inner">
|
||||
<i class="weui_icon_search"></i>
|
||||
<input type="search" class="weui_search_input" id="s_inp" placeholder="<?=$searchmsg?>" >
|
||||
<a onclick="yy.scle()" class="weui_icon_clear"></a>
|
||||
</div>
|
||||
<label for="s_inp" class="weui_search_text" id="search_text">
|
||||
<i class="weui_icon_search"></i>
|
||||
<span><?=$searchmsg?></span>
|
||||
</label>
|
||||
</form>
|
||||
<a onclick="yy.sqxs()" style="color:<?=$maincolor?>" class="weui_search_cancel">取消</a>
|
||||
</div>
|
||||
<?php }?>
|
||||
|
||||
<div id="mainbody" class="r-touch">
|
||||
<?php if($yyurl!='')include_once($yyurl);?>
|
||||
</div>
|
||||
|
||||
<div style="height:50px;overflow:hidden"></div>
|
||||
<div id="footerdiv" style="z-index:5" class="weui_tab">
|
||||
<div class="weui_navbar weui_tabbar">
|
||||
<?php
|
||||
foreach($arr['menu'] as $k=>$rs){
|
||||
$s='<div temp="taby" tempxu="'.$k.'" onclick="yy.clickmenu('.$k.',this)" class="weui_navbar_item">';
|
||||
if(!isempt($rs['num']))$s.='<span class="badge" id="'.$rs['num'].'_stotal"></span>';
|
||||
$s.='<font>'.$rs['name'].'</font>';
|
||||
if($rs['submenu'])$s.=' <i class="icon-angle-down"></i>';
|
||||
$s.='</div>';
|
||||
echo $s;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if($yyurljs!='')echo '<script type="text/javascript" src="'.$yyurljs.'"></script>'."\n";
|
||||
?>
|
||||
<script type="text/javascript" src="web/res/js/jquery-imgview.js"></script>
|
||||
<script type="text/javascript" src="web/res/js/jquery-rockupload.js"></script>
|
||||
<script type="text/javascript" src="web/res/js/jquery-changeuser.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
433
webmain/we/ying/tpl_ying_daka.html
Normal file
433
webmain/we/ying/tpl_ying_daka.html
Normal file
@@ -0,0 +1,433 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
|
||||
<title><?=$da['title']?></title>
|
||||
<link rel="stylesheet" type="text/css" href="mode/weui/weui.min.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="web/res/fontawesome/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="webmain/css/rui.css">
|
||||
<script type="text/javascript" src="js/jquery.js"></script>
|
||||
<script type="text/javascript" src="js/js.js"></script>
|
||||
<script type="text/javascript" src="js/jswx.js"></script>
|
||||
<script type="text/javascript" src="js/base64-min.js"></script>
|
||||
<script charset="utf-8" src="https://map.qq.com/api/js?v=2.exp&libraries=convertor,geometry&key=<?=$da['qqmapkey']?>"></script>
|
||||
<script type="text/javascript" src="js/dingwei.js"></script>
|
||||
<style>
|
||||
<?php
|
||||
$maincolor = getconfig('apptheme','#1389D3');
|
||||
$maincolora= c('image')->colorTorgb($maincolor);
|
||||
$maincolors= ''.$maincolora[0].','.$maincolora[1].','.$maincolora[2].'';
|
||||
echo 'body{--main-color:'.$maincolor.'}';
|
||||
?>
|
||||
.weui_tabbar_icon{text-align:center;color:#888888;font-size:20px;}
|
||||
.weui_tabbar_item{padding-top:2px;margin-bottom:5px;position:relative}
|
||||
.weui_bar_item_on .weui_tabbar_icon{color:<?=$maincolor?>}
|
||||
</style>
|
||||
<script>
|
||||
var kqrs = <?=json_encode($kqrs);?>,kqors = <?=json_encode($kqors);?>,kqallrs=[],isgzh = <?=$isgzh?>;
|
||||
js.servernow = '<?=$rock->now?>',openfrom='<?=$openfrom?>';
|
||||
|
||||
var label='',accuracy=0,latitude='',longitude='',kqjuli=-1,addbo = true,explain='',dakaci=1;
|
||||
|
||||
function initbody(){
|
||||
js.getsplit();
|
||||
showtimessabc();
|
||||
showkqrswz();
|
||||
initupload();
|
||||
kqallrs.push(kqrs);
|
||||
for(var i in kqors)kqallrs.push(kqors[i]);
|
||||
nowtimetime = js.now('time');
|
||||
addkqinfor(0);
|
||||
}
|
||||
|
||||
|
||||
function addkqinfor(bo){
|
||||
js.ajax('kaoqin','getshang',{},function(ret){
|
||||
var sbarr = ret.sbarr,s='',rs;
|
||||
s='<table width="100%" class="r-border-t">';
|
||||
for(var i=0;i<sbarr.length;i++){
|
||||
rs = sbarr[i];
|
||||
if(i>0)s+='<tr><td colspan="2"><div style="margin:0px 10px" class="r-border-t"></div></td></tr>';
|
||||
s+='<tr><td align="center" nowrap height="60px"><div style="padding:0px 20px"><b>'+rs.name+'</b></div></td><td width="99%"><div style="color:#888888;font-size:14px">'+rs.stime.substr(0,5)+'-'+rs.etime.substr(0,5)+'</div><div>'+rs.state+'</div></td></tr>';
|
||||
}
|
||||
s+='</table>';
|
||||
$('#shangbshow').html(s);
|
||||
|
||||
var dkarr = ret.dkarr;
|
||||
var s = '',i,oi=1;
|
||||
for(i=0;i<dkarr.length;i++){
|
||||
s+=','+dkarr[i].dktime+'';
|
||||
oi++;
|
||||
}
|
||||
if(s!='')s=s.substr(1);
|
||||
$('#todyadak').html(s);
|
||||
dakaci = oi;
|
||||
if(bo==0){
|
||||
$('#dkbtn').html('第'+oi+'次打卡');
|
||||
js.dw.init(isgzh); //定位开始
|
||||
}
|
||||
},'mode', false,false, 'get');
|
||||
}
|
||||
|
||||
function showtimessabc(){
|
||||
var dt = js.serverdt('Y年m月d日(星期W) H:i:s').split(' ');
|
||||
$('#dtstr').html(dt[0]);
|
||||
$('#timess').html(dt[1]);
|
||||
setTimeout('showtimessabc()',1000);
|
||||
}
|
||||
|
||||
//显示考勤位置
|
||||
function showkqrswz(){
|
||||
var s = '';
|
||||
if(kqrs){
|
||||
s+=','+kqrs.name+'';
|
||||
if(kqrs.iswgd=='1')s=',无固定位置';
|
||||
if(kqors && kqrs.iswgd=='0')for(var i=0;i<kqors.length;i++){
|
||||
s+=','+kqors[i].name+'';
|
||||
if(kqors[i].iswgd=='1'){
|
||||
s=',无固定位置';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(s=='')s='没设置考勤位置';
|
||||
if(s!='')s=s.substr(1);
|
||||
$('#weizhi').html(s);
|
||||
}
|
||||
|
||||
js.dw.ondwwait=function(msg){
|
||||
latitude = '';
|
||||
$('#dwshow').html('<img src="images/loadings.gif" height="14px" align="absmiddle"> '+msg+'');
|
||||
return true;
|
||||
}
|
||||
|
||||
js.dw.ondwerr=function(msg){
|
||||
latitude = '';
|
||||
$('#dwshow').html(''+msg+',<a href="javascript:;" onclick="js.dw.start()">[在定位]</a>');
|
||||
}
|
||||
|
||||
//定位成功后回调
|
||||
js.dw.ondwcall = function(res){
|
||||
latitude = res.latitude;
|
||||
longitude = res.longitude;
|
||||
accuracy = res.accuracy;
|
||||
label = res.address;
|
||||
var center = res.center;
|
||||
$('#dwshow').html(''+res.addressinfo+',<a href="javascript:;" onclick="js.dw.start()">[更新]</a>');
|
||||
var i,kqrsa,enddt,juli;
|
||||
|
||||
addbo = true;//可以添加记录
|
||||
for(i=0;i<kqallrs.length;i++){
|
||||
kqrsa = kqallrs[i];
|
||||
enddt = new qq.maps.LatLng(parseFloat(kqrsa.location_x), parseFloat(kqrsa.location_y));
|
||||
juli = parseInt(qq.maps.geometry.spherical.computeDistanceBetween(center, enddt));
|
||||
if(juli<0)juli = 0-juli;
|
||||
if(kqrsa['iswgd']=='1')juli=0; //无固定位置的
|
||||
kqallrs[i]['kqjuli'] = juli;
|
||||
kqjuli = juli;
|
||||
}
|
||||
|
||||
if(!isfenwein()){
|
||||
$('#dkbtnto').addClass('btnwai');
|
||||
$('#dkbtn').html('外出定位');
|
||||
}else{
|
||||
$('#dkbtnto').removeClass('btnwai');
|
||||
$('#dkbtn').html('第'+dakaci+'次打卡');
|
||||
}
|
||||
nowtimetime = js.now('time');
|
||||
}
|
||||
|
||||
//判断有没有在考勤地点上
|
||||
function isfenwein(){
|
||||
var i,kqrsa,slju,sljus,iskqbo=false;
|
||||
for(i=0;i<kqallrs.length;i++){
|
||||
kqrsa = kqallrs[i];
|
||||
slju = parseFloat(kqrsa.precision);
|
||||
sljus = parseFloat(kqrsa.kqjuli);
|
||||
if(sljus<=slju)iskqbo = true;
|
||||
}
|
||||
kqwucha = slju;
|
||||
return iskqbo;
|
||||
}
|
||||
var addkaoqinbool=false,upfileid='';
|
||||
function addkaoqin(o1, lbos){
|
||||
if((js.now('time') - nowtimetime)>60*1000){
|
||||
js.wx.alert('停留页面太久,请刷新页面再试',function(){
|
||||
js.reload();
|
||||
});
|
||||
return;
|
||||
}
|
||||
if(addkaoqinbool){
|
||||
js.wx.alert('已保存过了,请退出页面');
|
||||
return;
|
||||
}
|
||||
if(js.dw.dwbool){js.wx.alert('正在定位,稍后在添加');return;}
|
||||
if(latitude=='' || kqjuli==-1){js.wx.alert('定位没有成功,不能添加');return;}
|
||||
if(!addbo){js.wx.alert('请重新定位后在打卡');return;}
|
||||
|
||||
if(!lbos && ispzs){
|
||||
js.wx.load('<span id="tisssa">处理中</span>...');
|
||||
if(!imagecont){
|
||||
upfaceobj.start();
|
||||
}else{
|
||||
upfaceobj.sendbase64(imagecont,{filename:'打卡图片.png'});
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if(isfenwein()){
|
||||
if(kqrs.ispz=='1' && !ispzs){js.wx.alert('请使用相机拍照才能打卡');return;}
|
||||
adddk('打卡',1);
|
||||
}else{
|
||||
adddk('保存',0);
|
||||
}
|
||||
}
|
||||
|
||||
function adddk(ts, lx){
|
||||
var o1 = get('dkbtn');
|
||||
$(o1).html(''+ts+'中...');
|
||||
var ispz = (kqrs) ? kqrs.ispz : '0';
|
||||
var data = {location_x:latitude,type:lx,location_y:longitude,scale:12,fileid:upfileid,precision:accuracy,label:jm.base64encode(label),sm:jm.base64encode(explain),ispz:ispz};
|
||||
addkaoqinbool = true;
|
||||
js.ajax('weixin','addlocation',data,function(ret){
|
||||
js.wx.unload();
|
||||
js.wx.alert(''+ts+'成功:'+ret.now+'');
|
||||
$(o1).html(''+ts+'成功');
|
||||
addbo = false;
|
||||
addkqinfor(1);
|
||||
if(lx==1)get('notify_sound_audio').play();
|
||||
},'none');
|
||||
}
|
||||
|
||||
function addbeizhu(o1){
|
||||
js.wx.prompt('加备注','请输入备注说明:',function(txt){
|
||||
explain = txt;
|
||||
if(txt){
|
||||
$(o1).html('备注:'+txt+'');
|
||||
}else{
|
||||
$(o1).html('加备注...');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function changetab(lx){
|
||||
var url='?d=we&m=ying&a=location';
|
||||
if(lx==2)url='?m=ying&d=we&num=kqtotal';
|
||||
if(lx==3)url='?m=ying&d=we&num=kqpai';
|
||||
js.location(url);
|
||||
}
|
||||
|
||||
|
||||
function paizhao33(){
|
||||
if(js.jssdkstate!=1){
|
||||
js.wx.alert('非微信下的jssdk无法使用拍照');
|
||||
return;
|
||||
}
|
||||
wx.chooseImage({
|
||||
count: 1,
|
||||
sizeType: ['compressed'],
|
||||
sourceType: ['camera'],
|
||||
defaultCameraMode: "normal",
|
||||
isSaveToAlbum: 0,
|
||||
success: function (res) {
|
||||
var localIds = res.localIds;
|
||||
}
|
||||
});
|
||||
}
|
||||
var imagecont = '';
|
||||
function paizhao(){
|
||||
if(!ispzs){
|
||||
if(apicloud){
|
||||
api.getPicture({
|
||||
sourceType: 'camera',
|
||||
encodingType: 'png',
|
||||
destinationType: 'base64',quality:80,
|
||||
targetWidth:1000,targetHeight:1000
|
||||
}, function(ret, err) {
|
||||
if (ret) {
|
||||
imagecont= ret.base64Data;
|
||||
$('#paizhaoimg').parent().show();
|
||||
get('paizhaoimg').src = imagecont;
|
||||
get('pzbtnicons').className='icon-remove';
|
||||
ispzs = true;
|
||||
}
|
||||
});
|
||||
}else{
|
||||
upfaceobj.click({uptype:'image'});
|
||||
}
|
||||
}else{
|
||||
upfaceobj.clear();
|
||||
imagecont = '';
|
||||
$('#paizhaoimg').parent().hide();
|
||||
get('paizhaoimg').src = 'images/noimg.jpg';
|
||||
get('pzbtnicons').className='icon-camera';
|
||||
ispzs = false;
|
||||
}
|
||||
}
|
||||
|
||||
function showimgs(o1){
|
||||
$.imgview({'url':o1.src,'ismobile':true});
|
||||
}
|
||||
|
||||
var ispzs = false;
|
||||
function initupload(){
|
||||
upfaceobj=$.rockupload({
|
||||
uptype:'image',
|
||||
inputfile:'cameraInput',
|
||||
fileview:'fileview',
|
||||
autoup:false,
|
||||
urlparams:{noasyn:'yes'},
|
||||
onsuccess:function(f,str){
|
||||
var a=js.decode(str);
|
||||
if(imagecont){
|
||||
imagecont= '';
|
||||
upfileid = a.id;
|
||||
addkaoqin(false,true);
|
||||
}
|
||||
},
|
||||
onchange:function(f){
|
||||
$('#paizhaoimg').parent().show();
|
||||
get('paizhaoimg').src = f.imgviewurl;
|
||||
get('pzbtnicons').className='icon-remove';
|
||||
ispzs = true;
|
||||
},
|
||||
onchangebefore:function(f){
|
||||
if(f.lastModified){
|
||||
var btune = js.now('time')-f.lastModified;
|
||||
if(btune>10*1000)return '请使用相机拍照';
|
||||
}
|
||||
},
|
||||
onprogress:function(f,bl){
|
||||
$('#tisssa').html('上传中('+bl+'%)');
|
||||
},
|
||||
allsuccess:function(far, ids){
|
||||
imagecont = '';
|
||||
upfileid = ids;
|
||||
addkaoqin(false,true);
|
||||
}
|
||||
});
|
||||
}
|
||||
function changfile(o1){
|
||||
upfaceobj.change(o1);
|
||||
}
|
||||
|
||||
var yy={
|
||||
iscy:'<?=$iscy?>',
|
||||
clickadd:function(){
|
||||
var str = '应用首页显示';
|
||||
if(this.iscy==1)str='取消应用首页显示';
|
||||
if(apicloud){
|
||||
api.actionSheet({
|
||||
title: '选择菜单',
|
||||
cancelTitle: '取消',
|
||||
buttons: [str,'关闭应用']
|
||||
}, function(ret, err) {
|
||||
var index = ret.buttonIndex;
|
||||
if(index==1)yy.addchangying();
|
||||
if(index==2)js.back();
|
||||
});
|
||||
}else{
|
||||
js.showmenu({
|
||||
data:[{name:str,lx:1}],
|
||||
width:170,
|
||||
onclick:function(d){
|
||||
if(d.lx==1)yy.addchangying();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
addchangying:function(){
|
||||
js.ajax('indexreim','shecyy',{yynum:'kqdaka'},function(ret){
|
||||
yy.iscy = ret.iscy;
|
||||
js.wx.msgok(ret.msg, false, 1);
|
||||
},'mode', false,false, 'get');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.addbtns{ background:#C5E0F7;padding:5px;margin-top:20px;width:100px;height:100px;border-radius:50%}
|
||||
.addbtnss{right:10px;bottom:10px;width:100px;height:100px; background:#4E9CE0;opacity:0.8;z-index:1;border-radius:50%;font-size:16px;color:white;text-align:center;line-height:98px;}
|
||||
.addbtnss:active{opacity:1}
|
||||
|
||||
.btnwai{background:#FCD5BA}
|
||||
.btnwai .addbtnss{background:#ff6600}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
<?php if($showheader==1){?>
|
||||
<div>
|
||||
<div class="r-header" style="padding-top:<?=$cenghei?>px" >
|
||||
<div class="r-header-text" onclick="location.reload()" id="header_title"><?=$da['title']?></div>
|
||||
<span onclick="js.back()" class="r-position-left r-header-btn"><i class="icon-chevron-left"></i></span>
|
||||
<span onclick="yy.clickadd()" class="r-position-right r-header-btn"><i class="icon-plus"></i></span>
|
||||
</div>
|
||||
<div class="blank50" id="header_line" style="height:<?=($cenghei+50)?>px"></div>
|
||||
</div>
|
||||
<?php }?>
|
||||
<div align="center" style="background:white;padding-bottom:10px">
|
||||
<div id="timess" onclick="location.reload()" style="font-size:40px">15:10:00</div>
|
||||
<div id="dtstr" style="font-size:14px"><?=date('Y年m月d日')?>(星期三)</div>
|
||||
<div class="blank5"></div>
|
||||
<div id="dwshow" style="font-size:14px;color:#aaaaaa;padding:0px 10px">等待定位</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div style="display:none;position:fixed;z-index:2;left:1px;top:60px;width:120px;height:80px;overflow:hidden;"><img width="100%" onclick="showimgs(this)" id="paizhaoimg" src="images/noimg.jpg"></div>
|
||||
<div style="display:none">
|
||||
<form name="form_cameraInput">
|
||||
<input type="file" <?php if($rock->iswebbro())echo 'capture="camera"';?> onchange="changfile(this)" accept="image/*" id="cameraInput" /></form>
|
||||
</div>
|
||||
<div style="display:none" id="fileview"></div>
|
||||
|
||||
<div class="r-padding10 r-border-t" style="background:white;padding:15px 10px; background-color:#f5f5f5">考勤范围:<font color="#888888" id="weizhi">没设置考勤位置</font></div>
|
||||
<div id="shangbshow" style="background:white">
|
||||
<table width="100%" class="r-border-t">
|
||||
<tr><td align="center" nowrap height="60px"><div style="padding:0px 20px"><b>上班</b></div></td><td width="99%"><div style="color:#888888;font-size:14px">09:00-12:00</div><div><font color=#888888>加载中</font></div></td></tr>
|
||||
<tr><td colspan="2"><div style="margin:0px 10px" class="r-border-t"></div></td></tr><tr><td align="center" nowrap height="60px"><div style="padding:0px 20px"><b>下班</b></div></td><td width="99%"><div style="color:#888888;font-size:14px">13:00-18:00</div><div><font color=#888888>加载中</font></div></td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="r-border-t"></div>
|
||||
<div align="center">
|
||||
<div id="dkbtnto" class="addbtns">
|
||||
<div class="addbtnss" id="dkbtn" onclick="addkaoqin(this)">第1次打卡</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="r-padding10" align="center"><a id="beshuomdiv" onclick="addbeizhu(this)" href="javascript:;">加备注...</a> <a href="javascript:;" onclick="paizhao()"><i id="pzbtnicons" class="icon-camera"></i></a></div>
|
||||
<div class="r-padding10 r-wrap" align="center" style="font-size:14px;color:#888888;">今日打卡:<span id="todyadak">无</span></div>
|
||||
|
||||
<audio id="notify_sound_audio" hidden="true" style="display:none" src="web/res/sound/dkcg.mp3"></audio>
|
||||
<div style="height:55px; overflow:hidden"></div>
|
||||
<div style="height:55px;overflow:hidden;z-index:2;position:fixed" class="weui_tabbar">
|
||||
<a href="javascript:;" class="weui_tabbar_item weui_bar_item_on">
|
||||
<div class="weui_tabbar_icon">
|
||||
<i class="icon-time"></i>
|
||||
</div>
|
||||
<p class="weui_tabbar_label"><?=$da['title']?></p>
|
||||
</a>
|
||||
<a href="javascript:;" onclick="changetab(1)" class="weui_tabbar_item">
|
||||
<div class="weui_tabbar_icon">
|
||||
<i class="icon-fighter-jet"></i>
|
||||
</div>
|
||||
<p class="weui_tabbar_label">外勤定位</p>
|
||||
</a>
|
||||
<a href="javascript:;" onclick="changetab(2)" class="weui_tabbar_item">
|
||||
<div class="weui_tabbar_icon">
|
||||
<i class="icon-bar-chart"></i>
|
||||
</div>
|
||||
<p class="weui_tabbar_label">考勤统计</p>
|
||||
</a>
|
||||
<a href="javascript:;" onclick="changetab(3)" class="weui_tabbar_item">
|
||||
<div class="weui_tabbar_icon">
|
||||
<i class="icon-list-alt"></i>
|
||||
</div>
|
||||
<p class="weui_tabbar_label">我的排班</p>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="web/res/js/jquery-rockupload.js"></script>
|
||||
<script type="text/javascript" src="web/res/js/jquery-imgview.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
351
webmain/we/ying/tpl_ying_location.html
Normal file
351
webmain/we/ying/tpl_ying_location.html
Normal file
@@ -0,0 +1,351 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
|
||||
<title><?=$da['title']?></title>
|
||||
<link rel="stylesheet" type="text/css" href="mode/weui/weui.min.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="web/res/fontawesome/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="webmain/css/rui.css">
|
||||
<script type="text/javascript" src="js/jquery.js"></script>
|
||||
<script type="text/javascript" src="js/js.js"></script>
|
||||
<script type="text/javascript" src="js/jswx.js"></script>
|
||||
<script type="text/javascript" src="js/base64-min.js"></script>
|
||||
<script type="text/javascript" src="web/res/js/jquery-rockupload.js"></script>
|
||||
<script charset="utf-8" src="https://map.qq.com/api/js?v=2.exp&libraries=convertor,geometry&key=<?=$da['qqmapkey']?>"></script>
|
||||
<script type="text/javascript" src="js/dingwei.js"></script>
|
||||
<style>
|
||||
<?php
|
||||
$maincolor = getconfig('apptheme','#1389D3');
|
||||
$maincolora= c('image')->colorTorgb($maincolor);
|
||||
$maincolors= ''.$maincolora[0].','.$maincolora[1].','.$maincolora[2].'';
|
||||
echo 'body{--main-color:'.$maincolor.'}';
|
||||
?>
|
||||
</style>
|
||||
<script>
|
||||
//考勤信息
|
||||
var kqrs = <?=json_encode($kqrs);?>,kqors = <?=json_encode($kqors);?>,kqallrs=[],isgzh = <?=$isgzh?>;
|
||||
js.servernow = '<?=$rock->now?>',openfrom='<?=$openfrom?>';
|
||||
var infoWin,marker,circle;
|
||||
var label='',accuracy=0,latitude='',longitude='',kqjuli=-1,addbo = true;
|
||||
|
||||
function initbody(){
|
||||
initbodyss();
|
||||
initupload();
|
||||
nowtimetime = js.now('time');
|
||||
}
|
||||
|
||||
function initbodyss(){
|
||||
js.getsplit();
|
||||
js.dw.init(isgzh); //定位开始
|
||||
showtimessabc();
|
||||
|
||||
var lata = js.getoption('latlongedu','24.504332,118.141136,12').split(',');
|
||||
if(!lata[2])lata[2]=12;
|
||||
scale = parseFloat(lata[2]);
|
||||
var center = new qq.maps.LatLng(parseFloat(lata[0]), parseFloat(lata[1]));
|
||||
map = new qq.maps.Map(document.getElementById('container'),{
|
||||
center: center,
|
||||
zoom: scale
|
||||
});
|
||||
|
||||
if(kqrs){
|
||||
kqallrs.push(kqrs);
|
||||
var i,kqrsa,enddt,precision;
|
||||
for(i in kqors)kqallrs.push(kqors[i]);
|
||||
|
||||
for(i=0;i<kqallrs.length;i++){
|
||||
kqrsa = kqallrs[i];
|
||||
enddt = new qq.maps.LatLng(parseFloat(kqrsa.location_x), parseFloat(kqrsa.location_y));
|
||||
new qq.maps.Marker({map: map,position:enddt});
|
||||
precision = parseFloat(kqrsa.precision);
|
||||
if(precision>0){
|
||||
new qq.maps.Circle({
|
||||
map:map,
|
||||
center:enddt,
|
||||
radius:precision,
|
||||
fillColor:new qq.maps.Color(255,0,0, 0.3),
|
||||
strokeColor:new qq.maps.Color(255,0,0, 0.5),
|
||||
strokeWeight:1
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function dingweidak(){
|
||||
js.dw.start();
|
||||
}
|
||||
|
||||
//定位成功后回调
|
||||
js.dw.ondwcall = function(res){
|
||||
latitude = res.latitude;
|
||||
longitude = res.longitude;
|
||||
accuracy = res.accuracy;
|
||||
var center = res.center;
|
||||
addbo = true;
|
||||
scale = map.getZoom();
|
||||
js.setoption('latlongedu',''+latitude+','+longitude+','+scale+'');
|
||||
map.setCenter(res.center);
|
||||
label = res.address;
|
||||
showinfo(center ,accuracy, '定位成功<br>地址:'+res.addressinfo+'');
|
||||
|
||||
var i,kqrsa,enddt,juli;
|
||||
for(i=0;i<kqallrs.length;i++){
|
||||
kqrsa = kqallrs[i];
|
||||
enddt = new qq.maps.LatLng(parseFloat(kqrsa.location_x), parseFloat(kqrsa.location_y));
|
||||
juli = parseInt(qq.maps.geometry.spherical.computeDistanceBetween(center, enddt));
|
||||
if(juli<0)juli = 0-juli;
|
||||
if(kqrsa['iswgd']=='1')juli=0; //无固定位置的
|
||||
kqallrs[i]['kqjuli'] = juli;
|
||||
kqjuli = juli;
|
||||
}
|
||||
nowtimetime = js.now('time');
|
||||
}
|
||||
|
||||
function showtimessabc(){
|
||||
var dt = js.serverdt('H:i:s');
|
||||
$('#timess').html(dt);
|
||||
setTimeout('showtimessabc()',1000);
|
||||
}
|
||||
|
||||
function showinfo(center ,fw, str){
|
||||
if(!infoWin)infoWin = new qq.maps.InfoWindow({
|
||||
map: map
|
||||
});
|
||||
infoWin.open();
|
||||
infoWin.setContent(str);
|
||||
infoWin.setPosition(center);
|
||||
|
||||
if(!marker)marker= new qq.maps.Marker({
|
||||
map: map
|
||||
});
|
||||
marker.setPosition(center);
|
||||
if(!circle)circle=new qq.maps.Circle({
|
||||
map:map,
|
||||
strokeWeight:1
|
||||
});
|
||||
circle.setCenter(center);
|
||||
circle.setRadius(parseFloat(fw));
|
||||
}
|
||||
|
||||
//保存
|
||||
var adddkjlcs = {},upfileid='',imagecont='';
|
||||
function adddkjl(lx,ss,sm, uobo){
|
||||
if(!uobo){
|
||||
adddkjlcs.lx=lx;adddkjlcs.ss=ss;adddkjlcs.sm=sm;
|
||||
js.wx.load('<span id="tisssa">'+ss+'中</span>...');
|
||||
if(!imagecont){
|
||||
upfaceobj.start();
|
||||
}else{
|
||||
upfaceobj.sendbase64(imagecont,{filename:'打卡图片.png'});
|
||||
}
|
||||
return;
|
||||
}else{
|
||||
$('#tisssa').html(''+ss+'中');
|
||||
}
|
||||
if(!sm)sm='';
|
||||
scale = map.getZoom();
|
||||
var ispz = (kqrs) ? kqrs.ispz : '0';
|
||||
js.setoption('latlongedu',''+latitude+','+longitude+','+scale+'');
|
||||
var data = {location_x:latitude,type:lx,location_y:longitude,fileid:upfileid,scale:scale,precision:accuracy,label:jm.base64encode(label),sm:jm.base64encode(sm),ispz:ispz};
|
||||
js.ajax('weixin','addlocation',data,function(ret){
|
||||
js.msg('success',''+ss+'成功:'+ret.now+'');
|
||||
$('#dwdiv').after('<div>刚'+ss+'.'+ret.now.substr(10)+'('+label+')</div>');
|
||||
addbo = false;
|
||||
if(lx==1)get('notify_sound_audio').play();
|
||||
},'none');
|
||||
}
|
||||
function adddkjlok(ids){
|
||||
upfileid= ids;
|
||||
adddkjl(adddkjlcs.lx,adddkjlcs.ss,adddkjlcs.sm,true);
|
||||
}
|
||||
function adddkjlsss(){
|
||||
if((js.now('time') - nowtimetime)>60*1000){
|
||||
js.wx.alert('停留页面太久,请刷新页面再试',function(){
|
||||
js.reload();
|
||||
});
|
||||
return;
|
||||
}
|
||||
if(js.dw.dwbool){js.wx.alert('正在定位,稍后在添加');return;}
|
||||
if(latitude==''){js.wx.alert('定位没有成功,不能添加');return;}
|
||||
if(!addbo){js.wx.alert('已保存过了,请重新定位后在保存');return;}
|
||||
js.wx.prompt('保存定位','请输入说明(选填):',function(text){
|
||||
adddkjl(0,'保存', text);
|
||||
});
|
||||
}
|
||||
|
||||
var dwarr = <?=json_encode($dwarr)?>;
|
||||
function showdw(id){
|
||||
var d = dwarr[id];
|
||||
if(isempt(d.location_x)){js.wx.alert('没有位置信息无法查看');return;}
|
||||
if(js.jssdkstate!=1 || isempt(d.location_x)){
|
||||
var url = '?d=main&m=kaoqin&a=location&id='+d.id+'';
|
||||
js.location(url);
|
||||
}else{
|
||||
wx.openLocation({
|
||||
latitude: parseFloat(d.location_x), // 纬度,浮点数,范围为90 ~ -90
|
||||
longitude: parseFloat(d.location_y), // 经度,浮点数,范围为180 ~ -180。
|
||||
name: '定位地址', // 位置名
|
||||
address: d.label, // 地址详情说明
|
||||
scale: parseFloat(d.scale)
|
||||
});
|
||||
}
|
||||
}
|
||||
function addkaoqin(){
|
||||
if((js.now('time') - nowtimetime)>60*1000){
|
||||
js.wx.alert('停留页面太久,请刷新页面再试',function(){
|
||||
js.reload();
|
||||
});
|
||||
return;
|
||||
}
|
||||
if(!kqrs){js.wx.alert('没有设置定位考勤位置');return;}
|
||||
if(js.dw.dwbool){js.wx.alert('正在定位,稍后在添加');return;}
|
||||
if(latitude=='' || kqjuli==-1){js.wx.alert('定位没有成功,不能添加');return;}
|
||||
|
||||
var i,kqrsa,slju,sljus,iskqbo=false;
|
||||
for(i=0;i<kqallrs.length;i++){
|
||||
kqrsa = kqallrs[i];
|
||||
slju = parseFloat(kqrsa.precision);
|
||||
sljus = parseFloat(kqrsa.kqjuli);
|
||||
if(sljus<=slju)iskqbo = true;
|
||||
}
|
||||
if(!iskqbo){js.wx.alert('当前位置距离考勤点有'+kqjuli+'米,考勤设置误差不能超过'+slju+'米,故不能添加考勤打卡!');return;}
|
||||
|
||||
if(!addbo){js.wx.alert('已打卡过了,请重新定位后在打卡');return;}
|
||||
if(kqrs.ispz=='1' && !ispzs){js.wx.alert('请使用相机拍照才能打卡');return;}
|
||||
adddkjl(1,'打卡');
|
||||
}
|
||||
|
||||
var ispzs = false;
|
||||
function initupload(){
|
||||
upfaceobj=$.rockupload({
|
||||
uptype:'image',
|
||||
inputfile:'cameraInput',
|
||||
fileview:'fileview',
|
||||
autoup:false,
|
||||
urlparams:{noasyn:'yes'},
|
||||
onsuccess:function(f,str){
|
||||
var a=js.decode(str);
|
||||
if(imagecont){
|
||||
imagecont= '';
|
||||
adddkjlok(a.id);
|
||||
}
|
||||
},
|
||||
onchange:function(f){
|
||||
$('#paizhaoimg').parent().show();
|
||||
get('paizhaoimg').src = f.imgviewurl;
|
||||
get('pzbtnicons').className='icon-remove';
|
||||
ispzs = true;
|
||||
},
|
||||
onchangebefore:function(f){
|
||||
if(f.lastModified){
|
||||
var btune = js.now('time')-f.lastModified;
|
||||
if(btune>10*1000)return '请使用相机拍照';
|
||||
}
|
||||
},
|
||||
onprogress:function(f,bl){
|
||||
$('#tisssa').html('上传图中('+bl+'%)');
|
||||
},
|
||||
allsuccess:function(far, ids){
|
||||
imagecont = '';
|
||||
adddkjlok(ids);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function paizhao(){
|
||||
if(!ispzs){
|
||||
if(apicloud){
|
||||
api.getPicture({
|
||||
sourceType: 'camera',
|
||||
encodingType: 'png',
|
||||
destinationType: 'base64',quality:80,
|
||||
targetWidth:1000,targetHeight:1000
|
||||
}, function(ret, err) {
|
||||
if (ret) {
|
||||
imagecont= ret.base64Data;
|
||||
$('#paizhaoimg').parent().show();
|
||||
get('paizhaoimg').src = imagecont;
|
||||
get('pzbtnicons').className='icon-remove';
|
||||
ispzs = true;
|
||||
}
|
||||
});
|
||||
}else{
|
||||
upfaceobj.click({uptype:'image'});
|
||||
}
|
||||
}else{
|
||||
upfaceobj.clear();
|
||||
imagecont = '';
|
||||
$('#paizhaoimg').parent().hide();
|
||||
get('paizhaoimg').src = 'images/noimg.jpg';
|
||||
get('pzbtnicons').className='icon-camera';
|
||||
ispzs = false;
|
||||
}
|
||||
}
|
||||
function changfile(o1){
|
||||
upfaceobj.change(o1);
|
||||
}
|
||||
function showimgs(o1){
|
||||
$.imgview({'url':o1.src,'ismobile':true});
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.addbtnss{position:absolute;right:10px;bottom:10px;width:80px;height:80px; background:rgba(0,0,0,0.5);z-index:1;border-radius:50%;font-size:14px;color:white;text-align:center}
|
||||
.addbtnss:active{background:rgba(0,0,0,0.8)}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
<?php if($showheader==1){?>
|
||||
<div>
|
||||
<div class="r-header" style="padding-top:<?=$cenghei?>px" >
|
||||
<div class="r-header-text" onclick="location.reload()" id="header_title"><?=$da['title']?></div>
|
||||
<span onclick="js.back()" class="r-position-left r-header-btn"><i class="icon-chevron-left"></i></span>
|
||||
</div>
|
||||
<div class="blank50" id="header_line" style="height:<?=($cenghei+50)?>px"></div>
|
||||
</div>
|
||||
<?php }?>
|
||||
|
||||
<div>
|
||||
<div style="width:100%;height:300px;position:relative">
|
||||
<div style="display:none;position:absolute;z-index:2;left:1px;top:1px;width:120px;height:80px;overflow:hidden"><img width="100%" onclick="showimgs(this)" id="paizhaoimg" src="images/noimg.jpg"></div>
|
||||
<div id="container" style="position:absolute;width:100%;height:300px;"></div>
|
||||
<div class="addbtnss" onclick="addkaoqin()"><div style="margin-top:20px">考勤打卡<br><span id="timess"><?=date('H:i:s')?></span></div></div>
|
||||
</div>
|
||||
|
||||
<div style="display:none">
|
||||
<form name="form_cameraInput">
|
||||
<input type="file" <?php if($rock->iswebbro())echo 'capture="camera"';?> onchange="changfile(this)" accept="image/*" id="cameraInput" /></form>
|
||||
</div>
|
||||
<div style="padding:10px">
|
||||
<table width="100%"><tr>
|
||||
<td width="35%"><button type="button" onClick="dingweidak()" class="weui_btn weui_btn_default" name="button"><i class="icon-map-marker"></i> 定位</button></td>
|
||||
<td width="10" nowrap></td>
|
||||
<td><button type="button" onClick="adddkjlsss()" class="weui_btn weui_btn_primary" name="button"><i class="icon-plus"></i> 保存定位</button></td>
|
||||
<td width="10" nowrap></td>
|
||||
<td><button type="button" onClick="paizhao()" class="weui_btn weui_btn_default" name="button"><i id="pzbtnicons" class="icon-camera"></i></button></td>
|
||||
</tr></table>
|
||||
</div>
|
||||
<div style="display:none" id="fileview"></div>
|
||||
<div style="padding:0px 10px;line-height:26px">
|
||||
<div id="dwdiv"><b>今日定位:</b></div>
|
||||
<?php
|
||||
foreach($dwarr as $k=>$rs){
|
||||
$imgs = '<img src="web/images/fileicons/jpg.gif" align="absmiddle">';
|
||||
if(isempt($rs['imgpath']) || !file_exists($rs['imgpath']))$imgs='';
|
||||
echo '<div>'.($k+1).'.'.substr($rs['optdt'],11).'('.$rs['label'].')'.$imgs.',<a href="javascript:;" onclick="showdw('.$k.')">[查看]</a></div>';
|
||||
}
|
||||
if($rows)echo '<div class="blank10"></div><div><b>今日我的外勤:</b></div>';
|
||||
foreach($rows as $k=>$rs){
|
||||
echo '<div>'.($k+1).'.['.$rs['atype'].']'.$rs['address'].','.$rs['reason'].'('.$rs['outtime'].')</div>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<audio id="notify_sound_audio" hidden="true" style="display:none" src="web/res/sound/dkcg.mp3"></audio>
|
||||
<div class="blank10"></div>
|
||||
</div>
|
||||
<script type="text/javascript" src="web/res/js/jquery-imgview.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
476
webmain/we/ying/ying.js
Normal file
476
webmain/we/ying/ying.js
Normal file
@@ -0,0 +1,476 @@
|
||||
/**
|
||||
* 来自:信呼开发团队
|
||||
* 作者:磐石(rainrock)
|
||||
* 网址:http://www.rockoa.com/
|
||||
* 修改时间:2020-03-20
|
||||
* 移动端应用主js文件,请不要去修改
|
||||
*/
|
||||
|
||||
var myScroll=false,yy={
|
||||
sousoukey:'',
|
||||
onshowdata:function(){},
|
||||
loadci:0,
|
||||
searchparams:{},
|
||||
resizehei:function(){
|
||||
var hei= this.getheight();
|
||||
if(agentlx==0){
|
||||
var ob = this.showobj.css({'height':''+hei+'px'});
|
||||
return ob;
|
||||
}
|
||||
},
|
||||
getheight:function(ss){
|
||||
return this.geth(ss);
|
||||
},
|
||||
scrollnew:function(){
|
||||
var top = $(document).scrollTop();
|
||||
if(top>50){
|
||||
if(!get('backtuodiv')){
|
||||
var s = '<div id="backtuodiv" onclick="js.backtop()" style="position:fixed;right:5px;bottom:10px;width:30px;height:30px; background:rgba(0,0,0,0.4);z-index:9;border-radius:50%;font-size:14px;color:white;text-align:center;line-height:30px"><i class="icon-angle-up"></i></div>';
|
||||
$('body').append(s);
|
||||
}
|
||||
}else{
|
||||
$('#backtuodiv').remove();
|
||||
}
|
||||
},
|
||||
loadshow:function(){
|
||||
var url = location.href,arr = json.menu;
|
||||
var urla= url.split('#'),darr = this.getfirstnum(arr);
|
||||
var dkey= darr[0];
|
||||
if(urla[1])dkey = urla[1];
|
||||
this.getdata(dkey,1);
|
||||
if(darr[1]>-1){
|
||||
var tit = arr[darr[1]].name;
|
||||
if(darr[2]>-1)tit = arr[darr[1]].submenu[darr[2]].name;
|
||||
this.showtabstr(darr[1], tit);
|
||||
}
|
||||
},
|
||||
getfirstnum:function(d){
|
||||
var dbh = 'def',bh='',a = d[0],i,len,lens,subs;
|
||||
if(a){
|
||||
bh = a.url;
|
||||
if(a.submenu[0])bh=a.submenu[0].url;
|
||||
}
|
||||
try{
|
||||
var site = sessionStorage.getItem(''+json.num+'_event');
|
||||
if(site)bh = site;
|
||||
}catch(e){}
|
||||
|
||||
if(isempt(bh))bh=dbh;
|
||||
len = d.length;
|
||||
var goi = -1,goj=-1;
|
||||
for(i=0;i<len;i++){
|
||||
subs = d[i].submenu;
|
||||
lens = subs.length;
|
||||
if(goi>-1)break;
|
||||
if(lens>0){
|
||||
for(var j=0;j<lens;j++){
|
||||
if(subs[j].url==bh){
|
||||
goi = i;
|
||||
goj = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(d[i].url==bh){
|
||||
goi = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return [bh,goi,goj];
|
||||
},
|
||||
showtabstr:function(oi, tit){
|
||||
$('[temp="tablx"]').removeClass('active');
|
||||
$('[temp="tablx"]:eq('+oi+')').addClass('active');
|
||||
$('[temp="taby"]').css({'color':'','border-top':''});
|
||||
$('[temp="taby"]:eq('+oi+')').css({'color':maincolor,'border-top':'1px '+maincolor+' solid'});
|
||||
$('[temp="taby"]:eq('+oi+')').find('font').html(tit);
|
||||
this.settitle(tit);
|
||||
},
|
||||
clickmenu:function(oi,o1){
|
||||
if(o1.className.indexOf('disabled')>0)return;
|
||||
var sid='menushoess_'+oi+'';
|
||||
if(get(sid)){
|
||||
$('#'+sid+'').remove();
|
||||
return;
|
||||
}
|
||||
$("div[id^='menushoess']").remove();
|
||||
var a = json.menu[oi],slen=a.submenu.length,i,a1;
|
||||
this.menuname1 = a.name;
|
||||
this.menuname2 = '';
|
||||
if(slen<=0){
|
||||
this.clickmenus(a,oi);
|
||||
}else{
|
||||
if(agentlx==0){
|
||||
var o=$(o1),w=1/json.menu.length*100;
|
||||
var s='<div id="'+sid+'" style="position:fixed;z-index:5;left:'+(o.offset().left)+'px;bottom:50px; background:white;width:'+w+'%" class="menulist r-border-r r-border-l">';
|
||||
for(i=0;i<slen;i++){
|
||||
a1=a.submenu[i];
|
||||
s+='<div onclick="yy.clickmenua('+oi+','+i+')" class="r-border-t" style="color:'+a1.color+';">'+a1.name+'</div>';
|
||||
}
|
||||
s+='</div>';
|
||||
$('body').append(s);
|
||||
}
|
||||
if(agentlx==1){
|
||||
var da = [];
|
||||
for(i=0;i<slen;i++){
|
||||
a1=a.submenu[i];
|
||||
a1.oi = oi;
|
||||
a1.i = i;
|
||||
da.push(a1);
|
||||
}
|
||||
js.showmenu({
|
||||
data:da,
|
||||
width:150,
|
||||
onclick:function(d){
|
||||
yy.clickmenua(d.oi,d.i);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
seuser:function(){
|
||||
$('#searsearch_bar').addClass('weui_search_focusing');
|
||||
$('#s_inp').focus();
|
||||
},
|
||||
sqxs:function(){
|
||||
$('#s_inp').blur();
|
||||
$('#searsearch_bar').removeClass('weui_search_focusing');
|
||||
},
|
||||
scle:function(){
|
||||
$('#s_inp').val('').focus();
|
||||
},
|
||||
sous:function(){
|
||||
var key = $('#s_inp').blur().val();
|
||||
this.keysou(key);
|
||||
},
|
||||
clickmenua:function(i,j){
|
||||
var a = json.menu[i].submenu[j];
|
||||
this.menuname2 = a.name;
|
||||
this.clickmenus(a,i);
|
||||
},
|
||||
onclickmenu:function(a){
|
||||
return true;
|
||||
},
|
||||
|
||||
settitle:function(tit){
|
||||
document.title = tit;
|
||||
$('#header_title').html(tit);
|
||||
js.setapptitle();
|
||||
},
|
||||
|
||||
clickmenus:function(a,oi){
|
||||
$("div[id^='menushoess']").remove();
|
||||
if(!this.onclickmenu(a))return;
|
||||
var tit = this.menuname1;
|
||||
if(this.menuname2!='')tit=this.menuname2;
|
||||
if(a.type==0){
|
||||
this.sqxs();
|
||||
this.sousoukey='';
|
||||
this.clickevent(a);
|
||||
this.showtabstr(oi, tit);
|
||||
}
|
||||
if(a.type==1){
|
||||
var url=a.url,amod=this.num;
|
||||
if(url.substr(0,3)=='add'){
|
||||
if(url!='add')amod=url.replace('add_','');
|
||||
url='index.php?a=lum&m=input&d=flow&num='+amod+'&show=we';
|
||||
}
|
||||
js.location(url);
|
||||
}
|
||||
},
|
||||
clickevent:function(a){
|
||||
this.getdata(a.url, 1);return;
|
||||
if(agentlx==1){
|
||||
js.location('#'+a.url+'');
|
||||
}else{
|
||||
this.getdata(a.url, 1);
|
||||
}
|
||||
},
|
||||
data:[],
|
||||
_showstotal:function(d){
|
||||
var d1,v,s,o1;
|
||||
for(d1 in d){
|
||||
v=d[d1];
|
||||
if(v==0)v='';
|
||||
o1= $('#'+d1+'_stotal');
|
||||
o1.html(v);
|
||||
}
|
||||
},
|
||||
regetdata:function(o,p){
|
||||
var mo = 'mode';
|
||||
if(o){
|
||||
o.innerHTML='<img src="images/loading.gif" align="absmiddle">';
|
||||
mo = 'none';
|
||||
}
|
||||
this.getdata(this.nowevent,p, mo);
|
||||
},
|
||||
|
||||
reload:function(){
|
||||
this.getdata(this.nowevent,this.nowpage);
|
||||
},
|
||||
search:function(cans){
|
||||
if(!cans)cans={};
|
||||
this.searchparams=cans;
|
||||
this.getdata(this.nowevent,1, '', cans);
|
||||
},
|
||||
keysou:function(key){
|
||||
if(this.sousoukey == key)return;
|
||||
this.sousoukey = key;
|
||||
this.regetdata(false,1);
|
||||
},
|
||||
xiang:function(oi){
|
||||
var d = this.data[oi-1];
|
||||
if(d.xiangurl){
|
||||
js.location(d.xiangurl+'&show=we');
|
||||
return;
|
||||
}
|
||||
var ids = d.id,nus=d.modenum,modne=d.modename;
|
||||
if(!ids)return;
|
||||
if(!nus||nus=='undefined')nus = this.num;
|
||||
var url='task.php?a=x&num='+nus+'&mid='+ids+'&show=we';
|
||||
js.location(url);
|
||||
},
|
||||
suboptmenu:{},
|
||||
showmenu:function(oi){
|
||||
var a = this.data[oi-1],ids = a.id,i;
|
||||
var nus=a.modenum;if(!nus||nus=='undefined')nus = this.num;
|
||||
if(a.type=='applybill' && nus){
|
||||
var url='index.php?a=lum&m=input&d=flow&num='+nus+'&show=we';
|
||||
js.location(url);return;
|
||||
}
|
||||
if(!ids)return;
|
||||
this.tempid = ids;
|
||||
this.tempnum = nus;
|
||||
this.temparr = {oi:oi,da:a};
|
||||
var da = [{name:this.bd6('6K!m5oOF'),lx:998,oi:oi}];
|
||||
var subdata = this.suboptmenu[''+nus+'_'+ids+''];
|
||||
if(typeof(subdata)=='object'){
|
||||
for(i=0;i<subdata.length;i++)da.push(subdata[i]);
|
||||
}else{
|
||||
da.push({name:'<img src="images/loadings.gif" align="absmiddle"> '+this.bd6('5Yqg6L296I!c5Y2V5LitLi4u')+'',lx:999});
|
||||
this.loadoptnum(nus,ids);
|
||||
}
|
||||
js.showmenu({
|
||||
data:da,
|
||||
width:150,
|
||||
onclick:function(d){
|
||||
yy.showmenuclick(d);
|
||||
}
|
||||
});
|
||||
this.suboptmenu={};
|
||||
},
|
||||
loadoptnum:function(nus,id){
|
||||
js.ajax('agent','getoptnum',{num:nus,mid:id},function(ret){
|
||||
yy.suboptmenu[''+nus+'_'+id+'']=ret;
|
||||
yy.showmenu(yy.temparr.oi);
|
||||
},'none',false,function(estr){
|
||||
yy.suboptmenu[''+nus+'_'+id+'']=[];
|
||||
yy.showmenu(yy.temparr.oi);
|
||||
});
|
||||
},
|
||||
getupgurl:function(str){
|
||||
if(str.substr(0,4)=='http')return str;
|
||||
var a1 = str.split('|'),lx = a1[0],mk = a1[1],cs=a1[2];
|
||||
var url= '';
|
||||
if(lx=='add')url='?a=lum&m=input&d=flow&num='+mk+'';
|
||||
if(lx=='xiang')url='task.php?a=x&num='+mk+'';
|
||||
if(cs)url+='&'+cs;
|
||||
return url;
|
||||
},
|
||||
showmenuclick:function(d){
|
||||
d.num=this.num;d.mid=this.tempid;
|
||||
d.modenum = this.tempnum;
|
||||
var lx = d.lx;if(!lx)lx=0;
|
||||
if(lx==999)return;
|
||||
if(lx==998){this.xiang(d.oi);return;}
|
||||
if(lx==996){this.xiang(this.temparr.oi);return;}
|
||||
this.changdatsss = d;
|
||||
if(lx==2 || lx==3){
|
||||
var clx='changeuser';if(lx==3)clx='changeusercheck';
|
||||
$('body').chnageuser({
|
||||
'changetype':clx,
|
||||
'titlebool':get('header_title'),
|
||||
'onselect':function(sna,sid){
|
||||
yy.xuanuserok(sna,sid);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if(lx==5){
|
||||
var upg = d.upgcont;
|
||||
if(isempt(upg)){
|
||||
js.msg('msg',this.bd6('5rKh5pyJ6K6!572u5omT5byA55qE5pON5L2c5Zyw5Z2A'));
|
||||
}else{
|
||||
var url = this.getupgurl(upg);
|
||||
js.location(url);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(lx==7){
|
||||
var upg = d.upgcont;
|
||||
if(isempt(upg)){
|
||||
js.msg('msg',this.bd6('5rKh5pyJ6K6!572u6Ieq5a6a5LmJ5pa55rOV'));
|
||||
}else{
|
||||
if(!window[upg]){
|
||||
js.msg('msg',this.bd6('6K6!572u55qE5pa55rOV4oCcezB94oCd5LiN5a2Y5ZyoJw::').replace('{0}',upg));
|
||||
}else{
|
||||
window[upg](this.temparr.da,d);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(lx==1 || lx==9 || lx==10 || lx==13 || lx==15 || lx==16 || lx==17){
|
||||
var bts = (d.issm==1)?'必填':'选填';
|
||||
js.wx.prompt(d.name,'请输入['+d.name+']说明('+bts+'):',function(text){
|
||||
if(!text && d.issm==1){
|
||||
js.msg('msg','没有输入['+d.name+']说明');
|
||||
}else{
|
||||
yy.showmenuclicks(d, text);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if(lx==14){
|
||||
var url='index.php?a=lum&m=input&d=flow&num=remind&mid='+d.djmid+'&def_modenum='+d.modenum+'&def_mid='+d.mid+'&def_explain=basejm_'+jm.base64encode(d.smcont)+'&show=we';
|
||||
js.location(url);
|
||||
return;
|
||||
}
|
||||
if(lx==18){
|
||||
var url='index.php?a=lum&m=input&d=flow&num=receipt&mid='+d.djmid+'&def_modenum='+d.modenum+'&def_mid='+d.mid+'&def_modename=basejm_'+jm.base64encode(d.modename)+'&def_explain=basejm_'+jm.base64encode(d.smcont)+'&show=we';
|
||||
js.location(url);
|
||||
return;
|
||||
}
|
||||
if(lx==11){
|
||||
var url='index.php?a=lum&m=input&d=flow&num='+d.modenum+'&mid='+d.mid+'&show=we';
|
||||
js.location(url);
|
||||
return;
|
||||
}
|
||||
this.showmenuclicks(d,'');
|
||||
},
|
||||
xuanuserok:function(nas,sid){
|
||||
if(!sid)return;
|
||||
var d = this.changdatsss,sm='';
|
||||
d.changename = nas;
|
||||
d.changenameid = sid;
|
||||
this.showmenuclicks(d,sm);
|
||||
},
|
||||
showmenuclicks:function(d, sm){
|
||||
if(!sm)sm='';
|
||||
d.sm = sm;
|
||||
for(var i in d)if(d[i]==null)d[i]='';
|
||||
js.ajax('index','yyoptmenu',d,function(ret){
|
||||
yy.suboptmenu[''+d.modenum+'_'+d.mid+'']=false;
|
||||
yy.getdata(yy.nowevent, 1);
|
||||
});
|
||||
},
|
||||
showdata:function(a){
|
||||
this.overend = true;
|
||||
var s='',i,len=a.rows.length,d,st='',oi;
|
||||
$('#showblank').remove();
|
||||
$('#notrecord').remove();
|
||||
if(typeof(a.stotal)=='object')this._showstotal(a.stotal);
|
||||
if(a.page==1){
|
||||
this.showobj.html('');
|
||||
this.data=[];
|
||||
}
|
||||
for(i=0;i<len;i++){
|
||||
d=a.rows[i];
|
||||
oi=this.data.push(d);
|
||||
if(d.showtype=='line' && d.title){
|
||||
s='<div class="contline">'+d.title+'</div>';
|
||||
}else{
|
||||
if(!d.statuscolor)d.statuscolor='';
|
||||
st='';
|
||||
if(d.ishui==1)st='color:#aaaaaa;';
|
||||
s='<div style="'+st+'" class="r-border contlist">';
|
||||
if(d.title){
|
||||
if(d.face){
|
||||
s+='<div onclick="yy.showmenu('+oi+')" class="face"><img src="'+d.face+'" align="absmiddle">'+d.title+'</div>';
|
||||
}else{
|
||||
s+='<div onclick="yy.showmenu('+oi+')" class="tit">'+d.title+'</div>';
|
||||
}
|
||||
}
|
||||
if(d.optdt)s+='<div class="dt">'+d.optdt+'</div>';
|
||||
if(d.picurl)s+='<div onclick="yy.showmenu('+oi+')" class="imgs"><img src="'+d.picurl+'" width="100%"></div>';
|
||||
if(d.cont)s+='<div onclick="yy.showmenu('+oi+')" class="cont">'+d.cont.replace(/\n/g,'<br>')+'</div>';
|
||||
if(d.id && d.modenum && !d.noshowopt){
|
||||
s+='<div class="xq r-border-t"><font onclick="yy.showmenu('+oi+')">操作<i class="icon-angle-down"></i></font><span onclick="yy.xiang('+oi+')">详情>></span>';
|
||||
s+='</div>';
|
||||
}
|
||||
if(d.xiangurl){
|
||||
s+='<div class="xq r-border-t" onclick="yy.xiang('+oi+')"><font>详情>></font></div>';
|
||||
}
|
||||
if(d.statustext)s+='<div style="background-color:'+d.statuscolor+';opacity:0.7" class="zt">'+d.statustext+'</div>';
|
||||
s+='</div>';
|
||||
}
|
||||
this.showobj.append(s);
|
||||
}
|
||||
var count=a.count;
|
||||
if(count==0)count=len;
|
||||
if(count>0){
|
||||
this.nowpage = a.page;
|
||||
s = '<div class="showblank" id="showblank">共'+count+'条记录';
|
||||
if(a.maxpage>1)s+=',当前'+a.maxpage+'/'+a.page+'页';
|
||||
if(a.page<a.maxpage){
|
||||
s+=', <a id="showblankss" onclick="yy.regetdata(this,'+(a.page+1)+')" href="javascript:;">点击加载</a>';
|
||||
this.overend = false;
|
||||
}
|
||||
s+= '</div>';
|
||||
this.showobj.append(s);
|
||||
if(a.count==0)$('#showblank').html('');
|
||||
}else{
|
||||
this.showobj.html('<div class="notrecord" id="notrecord">暂无记录</div>');
|
||||
}
|
||||
this.onshowdata(a);
|
||||
},
|
||||
scrollEndevent:function(){
|
||||
yy.regetdata(get('showblankss'),yy.nowpage+1);
|
||||
},
|
||||
clad:function(){
|
||||
var str = this.bd6('5bqU55So6aaW6aG15pi!56S6');
|
||||
if(json.iscy==1)str=this.bd6('5Y!W5raI5bqU55So6aaW6aG15pi!56S6');
|
||||
if(apicloud){
|
||||
api.actionSheet({
|
||||
title: this.bd6('6YCJ5oup6I!c5Y2V'),
|
||||
cancelTitle: this.bd6('5Y!W5raI'),
|
||||
buttons: [str,this.bd6('5YWz6Zet5bqU55So')]
|
||||
}, function(ret, err) {
|
||||
var index = ret.buttonIndex;
|
||||
if(index==1)yy.addchangying();
|
||||
if(index==2)js.back();
|
||||
});
|
||||
}else{
|
||||
js.showmenu({
|
||||
data:[{name:str,lx:1}],
|
||||
width:170,
|
||||
onclick:function(d){
|
||||
if(d.lx==1)yy.addchangying();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
addchangying:function(){
|
||||
js.ajax('indexreim','shecyy',{yynum:json.num},function(ret){
|
||||
json.iscy = ret.iscy;
|
||||
js.wx.msgok(ret.msg, false, 1);
|
||||
},'mode', false,false, 'get');
|
||||
},
|
||||
init:function(){
|
||||
for(var i in js.main)this[i]=js.main[i];
|
||||
this.zhuinit();
|
||||
this.num = json.num;
|
||||
this.showobj = $('#mainbody');
|
||||
$('.weui_navbar').click(function(){return false;});
|
||||
$('body').click(function(){
|
||||
$("div[id^='menushoess']").remove();
|
||||
});
|
||||
this.resizehei();
|
||||
$(window).resize(function(){yy.resizehei();});
|
||||
if(agentlx==1){$(window).scroll(function(){yy.scrollnew();});}
|
||||
if(!this.checkyz()){this.clickmenu=this.showdata=function(){};return;}
|
||||
},
|
||||
getdata:function(st,p, mo, cas){
|
||||
this.getdatamain(st,p, mo, cas);
|
||||
}
|
||||
}
|
||||
200
webmain/we/ying/yingAction.php
Normal file
200
webmain/we/ying/yingAction.php
Normal file
@@ -0,0 +1,200 @@
|
||||
<?php
|
||||
/**
|
||||
* 移动端应用控制器页面
|
||||
* 主页:http://www.rockoa.com/
|
||||
* 软件:信呼
|
||||
* 作者:雨中磐石(rainrock)
|
||||
* 日期:2016-10-10
|
||||
*/
|
||||
|
||||
class yingClassAction extends ActionNot{
|
||||
|
||||
public $openfrom = '';
|
||||
|
||||
public function initAction()
|
||||
{
|
||||
$this->mweblogin(0, true);
|
||||
$openfrom = $this->get('openfrom');
|
||||
if(isempt($openfrom))$openfrom = $this->get('cfrom');
|
||||
if(!isempt($openfrom)){
|
||||
$this->rock->setsession('openfrom', $openfrom);
|
||||
}else{
|
||||
$openfrom = $this->rock->session('openfrom');
|
||||
}
|
||||
$this->openfrom = $openfrom;
|
||||
$this->assign('openfrom', $this->openfrom);
|
||||
}
|
||||
|
||||
private function bd6($str)
|
||||
{
|
||||
return $this->jm->base64decode($str);
|
||||
}
|
||||
|
||||
public function defaultAction()
|
||||
{
|
||||
$ybarr = $this->option->authercheck();
|
||||
if(is_string($ybarr))return $ybarr;
|
||||
$authkey = $ybarr['authkey'];
|
||||
$num = $this->get('num');
|
||||
$mnum = $this->get('mnum'); //模块编号
|
||||
$this->assign('xhauthkey', getconfig('authkey', $authkey));
|
||||
if(!isempt($mnum)){
|
||||
$this->showmodenum($mnum);
|
||||
return;
|
||||
}
|
||||
$reim = m('reim');
|
||||
$arr = $reim->getagent(0, "and `num`='$num'");
|
||||
if(!$arr)exit('应用['.$num.']不存在');
|
||||
$rs = $arr[0];
|
||||
$this->title = $rs['name'];
|
||||
$yyurl = ''.P.'/we/ying/yingyong/'.$num.'.html';
|
||||
if(!file_exists($yyurl))$yyurl='';
|
||||
$yyurljs = ''.P.'/we/ying/yingyong/'.$num.'.js';
|
||||
if(!file_exists($yyurljs))$yyurljs='';
|
||||
|
||||
|
||||
$rs['iscy'] = $this->iscy($num);
|
||||
$this->assign('arr', $rs);
|
||||
$this->assign('num', $num);
|
||||
|
||||
|
||||
$this->assign('yyurl', $yyurl);
|
||||
$this->assign('yyurljs', $yyurljs);
|
||||
$this->assign('searchmsg', '输入关键词搜索');
|
||||
$this->assign('typename', '');
|
||||
$gid = $rs['id'];
|
||||
$reim->setallyd('agent', $this->adminid, $gid);
|
||||
|
||||
$clasne = 'ying_'.$num.'Class';
|
||||
$classpath = ''.P.'/we/ying/yingyong/'.$clasne.'.php';
|
||||
if(file_exists($classpath)){
|
||||
include_once($classpath);
|
||||
$yingobj = new $clasne();
|
||||
$yingobj->initYing($this);
|
||||
}
|
||||
if(getconfig('useropt')=='1')m('log')->addlog('打开应用', '应用['.$num.'.'.$this->title.']');
|
||||
}
|
||||
|
||||
//默认根据模块显示
|
||||
private function showmodenum($mnum)
|
||||
{
|
||||
$typename = '';
|
||||
$flow = m('flow')->initflow($mnum);
|
||||
$mrs = $flow->moders;
|
||||
|
||||
if($mrs['status']=='0')exit('模块['.$mnum.','.$mrs['name'].']已停用');
|
||||
$souarr = $flow->flowwesearchdata(0);
|
||||
$searchmsg = arrvalue($souarr, 'searchmsg','输入关键词搜索');
|
||||
$typename = arrvalue($souarr, 'typename');
|
||||
|
||||
$this->title = $mrs['name'];
|
||||
$pnum = $this->get('pnum');
|
||||
$menu = array();
|
||||
$atypearr = m('where')->getmywhere($mrs['id'], $this->adminid, $pnum);
|
||||
if(!$atypearr)exit('请到【流程模块→流程模块条件】建条件,分组编号要为空');
|
||||
if(isempt($pnum)){
|
||||
if($mrs['iscs']>0)$atypearr[] = array('id' => 0,'num' => 'chaos','name' => '抄送给我');
|
||||
if($mrs['isflow']>0)$atypearr[] = array('id' => 0,'num' => 'mychuli','name' => '经我处理');
|
||||
}
|
||||
$isadd = m('view')->isadd($mrs['id'], $this->adminid);
|
||||
if($isadd)$atypearr[] = array('id' => 0,'num' => 'add','type' => 1,'name' => '+新增');
|
||||
foreach($atypearr as $k1=>$rs1){
|
||||
$uar = array('type' => 0,'name' => $rs1['name'],'url' => $rs1['num'].'|'.$mnum.'','num' => '','submenu'=> array());
|
||||
if(arrvalue($rs1,'type')==1){$uar['type']=1;$uar['url']='add_'.$mnum.'';}
|
||||
$menu[] = $uar;
|
||||
if($k1>1)break;
|
||||
}
|
||||
if(count($atypearr)>3){
|
||||
$submenu = array();
|
||||
foreach($atypearr as $k1=>$rs1){
|
||||
$uar = array('type' => 0,'name' => $rs1['name'],'url' => $rs1['num'].'|'.$mnum.'','num' => '','submenu'=> array());
|
||||
if(arrvalue($rs1,'type')==1){$uar['type']=1;$uar['url']='add_'.$mnum.'';}
|
||||
if($k1>1)$submenu[] = $uar;
|
||||
}
|
||||
$menu[2] = array(
|
||||
'name' => '更多>>',
|
||||
'num' => '',
|
||||
'submenu' => $submenu,
|
||||
);
|
||||
}
|
||||
if(!$menu)$menu[] = array(
|
||||
'name' => $mrs['name'],
|
||||
'url' => 'my|'.$mnum.'',
|
||||
'num' => '',
|
||||
'submenu' => array(),
|
||||
);
|
||||
|
||||
$arr = array(
|
||||
'face' => '',
|
||||
'leixing'=>$mnum,
|
||||
'menu' => $menu,
|
||||
'num' => 'base',
|
||||
'name' => $mrs['name'],
|
||||
);
|
||||
$yyurl = '';
|
||||
$yyurljs = '';
|
||||
$this->assign('searchmsg', $searchmsg);
|
||||
$this->assign('yyurl', $yyurl);
|
||||
$this->assign('arr', $arr);
|
||||
$this->assign('yyurljs', $yyurljs);
|
||||
$this->assign('typename', $typename);
|
||||
if(getconfig('useropt')=='1')m('log')->addlog('打开模块应用', '模块['.$mnum.'.'.$this->title.']');
|
||||
}
|
||||
|
||||
|
||||
|
||||
private function iscy($num)
|
||||
{
|
||||
$myyyid= $this->option->getval('yinghomeshow_'.$this->adminid.'');
|
||||
$iscy = 0;
|
||||
if(!isempt($myyyid) && contain(','.$myyyid.',',','.$num.','))$iscy=1;
|
||||
return $iscy;
|
||||
}
|
||||
|
||||
public function locationAction()
|
||||
{
|
||||
$this->title = '考勤定位';
|
||||
$kq = m('kaoqin');
|
||||
$arr = m('waichu')->getoutrows($this->date,$this->adminid);
|
||||
$this->assign('rows', $arr);
|
||||
$dt = $this->rock->date;
|
||||
$dwarr = m('location')->getrows("uid='$this->adminid' and `optdt` like '$dt%'",'*','`id` desc');
|
||||
$this->assign('dwarr', $dwarr);
|
||||
$kqrs = $kq->dwdkrs($this->adminid, $this->date);
|
||||
$isgzh = m('wxgzh:index')->isusegzh();
|
||||
$this->assign('isgzh', $isgzh);
|
||||
$this->assign('kqrs', $kqrs);
|
||||
$dwids = arrvalue($kqrs, 'dwids');
|
||||
$kqors = array();
|
||||
if(!isempt($dwids)){
|
||||
$kqors = m('kqdw')->getrows("id in($dwids) and `id`<>".$kqrs['id']."");
|
||||
}
|
||||
$this->assign('kqors', $kqors);
|
||||
$this->smartydata['qqmapkey'] = getconfig('qqmapkey','55QBZ-JGYLO-BALWX-SZE4H-5SV5K-JCFV7');
|
||||
}
|
||||
|
||||
/**
|
||||
* 最新打卡使用
|
||||
*/
|
||||
public function dakaAction()
|
||||
{
|
||||
$this->title = '考勤打卡';
|
||||
|
||||
$kq = m('kaoqin');
|
||||
$dt = $this->rock->date;
|
||||
$dwarr = m('location')->getrows("uid='$this->adminid' and `optdt` like '$dt%'",'*','`id` desc');
|
||||
$this->assign('dwarr', $dwarr);
|
||||
$kqrs = $kq->dwdkrs($this->adminid, $this->date);
|
||||
$isgzh = m('wxgzh:index')->isusegzh();
|
||||
$this->assign('isgzh', $isgzh);
|
||||
$this->assign('iscy', $this->iscy('kqdaka'));
|
||||
$this->assign('kqrs', $kqrs);
|
||||
$dwids = arrvalue($kqrs, 'dwids');
|
||||
$kqors = array();
|
||||
if(!isempt($dwids)){
|
||||
$kqors = m('kqdw')->getrows("id in($dwids) and `id`<>".$kqrs['id']."");
|
||||
}
|
||||
$this->assign('kqors', $kqors);
|
||||
$this->smartydata['qqmapkey'] = getconfig('qqmapkey','55QBZ-JGYLO-BALWX-SZE4H-5SV5K-JCFV7');
|
||||
}
|
||||
}
|
||||
27
webmain/we/ying/yingyong/calendar.html
Normal file
27
webmain/we/ying/yingyong/calendar.html
Normal file
@@ -0,0 +1,27 @@
|
||||
<script type="text/javascript" src="web/res/mode/calendar/jquery-rockcalendar.js"></script>
|
||||
<script type="text/javascript" src="web/res/mode/calendar/jquery-rocklunar.js"></script>
|
||||
<script type="text/javascript">
|
||||
yingyonginit = function(){
|
||||
monthobj = $('#mainbody').rockcalendar({
|
||||
height:yy.getheight(-2),headerbgcolor:'#dddddd',
|
||||
selbgcolor:'#DEF7F2',
|
||||
changemonth:function(y, m){
|
||||
var dt = ''+y+'年'+xy10(m)+'月';
|
||||
setTimeout(function(){
|
||||
yy.settitle(dt);
|
||||
},10);
|
||||
},
|
||||
align:'center',
|
||||
valign:'center',
|
||||
renderer:function(day, s, s1,s2,col1,col2){
|
||||
var s = '<div><font color='+col1+'>'+s1+'</font><br><div style="font-size:11px;height:16px;overflow:hidden;color:'+col2+'">'+s2+'</div></div>';
|
||||
return s;
|
||||
}
|
||||
});
|
||||
}
|
||||
yy.clickevent=function(d){
|
||||
if(d.url=='nowmonth')monthobj.nowmonth();
|
||||
if(d.url=='prevmonth')monthobj.fanmonth(-1);
|
||||
if(d.url=='nextmonth')monthobj.fanmonth(1);
|
||||
}
|
||||
</script>
|
||||
30
webmain/we/ying/yingyong/daiban.js
Normal file
30
webmain/we/ying/yingyong/daiban.js
Normal file
@@ -0,0 +1,30 @@
|
||||
var soumodeid = 0;
|
||||
yy.onclickmenu=function(d){
|
||||
if(this.nowevent!=d.url)soumodeid=0;
|
||||
return true;
|
||||
}
|
||||
function myyingsinit(){
|
||||
var s = '<select id="modeid" style="width:100px;border:none;background:white;font-size:14px"><option value="0">选择模块</option></select>';
|
||||
$('#searsearch_bar').prepend(s);
|
||||
$('#modeid').change(function(){
|
||||
soumodeid = this.value;
|
||||
yy.search({'modeid':this.value});
|
||||
});
|
||||
}
|
||||
yy.onshowdata=function(da){
|
||||
if(da.modearr){
|
||||
var s = '<option value="0">选择模块</option>',len=da.modearr.length,i,csd,types='';
|
||||
for(i=0;i<len;i++){
|
||||
csd = da.modearr[i];
|
||||
if(types!=csd.type){
|
||||
if(types!='')s+='</optgroup>';
|
||||
s+='<optgroup label="'+csd.type+'">';
|
||||
}
|
||||
s+='<option value="'+csd.id+'">'+csd.name+'</option>';
|
||||
types = csd.type;
|
||||
}
|
||||
$('#modeid').html(s);
|
||||
if(soumodeid>0)get('modeid').value = soumodeid;
|
||||
}
|
||||
}
|
||||
myyingsinit();
|
||||
9
webmain/we/ying/yingyong/flow.html
Normal file
9
webmain/we/ying/yingyong/flow.html
Normal file
@@ -0,0 +1,9 @@
|
||||
<script type="text/javascript">
|
||||
yy.onclickmenu=function(d){
|
||||
if(d.url=='moreapply'){
|
||||
js.location('?d=we&m=flow&a=apply');
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
30
webmain/we/ying/yingyong/flow.js
Normal file
30
webmain/we/ying/yingyong/flow.js
Normal file
@@ -0,0 +1,30 @@
|
||||
yy.onclickmenu=function(d){
|
||||
if(d.url=='moreapply'){
|
||||
js.location('?d=we&m=flow&a=apply');
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
function myyingsinit(){
|
||||
var s = '<select id="modeid" style="width:100px;border:none;background:white;font-size:14px"><option value="0">选择模块</option></select>';
|
||||
$('#searsearch_bar').prepend(s);
|
||||
$('#modeid').change(function(){
|
||||
yy.search({'modeid':this.value});
|
||||
});
|
||||
}
|
||||
yy.onshowdata=function(da){
|
||||
if(da.modearr){
|
||||
var s = '<option value="0">选择模块</option>',len=da.modearr.length,i,csd,types='';
|
||||
for(i=0;i<len;i++){
|
||||
csd = da.modearr[i];
|
||||
if(types!=csd.type){
|
||||
if(types!='')s+='</optgroup>';
|
||||
s+='<optgroup label="'+csd.type+'">';
|
||||
}
|
||||
s+='<option value="'+csd.id+'">'+csd.name+'</option>';
|
||||
types = csd.type;
|
||||
}
|
||||
if(len>0)$('#modeid').html(s);
|
||||
}
|
||||
}
|
||||
myyingsinit();
|
||||
13
webmain/we/ying/yingyong/gong.js
Normal file
13
webmain/we/ying/yingyong/gong.js
Normal file
@@ -0,0 +1,13 @@
|
||||
function myyingsinit(){
|
||||
var s = '<select id="typeid" style="width:100px;border:none;background:white;font-size:14px"><option value="">所有分类</option></select>';
|
||||
$('#searsearch_bar').prepend(s);
|
||||
$('#typeid').change(function(){
|
||||
yy.search({'typeid':this.value});
|
||||
});
|
||||
}
|
||||
yy.onshowdata=function(da){
|
||||
if(da.typearr){
|
||||
js.setselectdata(get('typeid'), da.typearr, 'id');
|
||||
}
|
||||
}
|
||||
myyingsinit();
|
||||
23
webmain/we/ying/yingyong/jiankong.js
Normal file
23
webmain/we/ying/yingyong/jiankong.js
Normal file
@@ -0,0 +1,23 @@
|
||||
function myyingsinit(){
|
||||
var s = '<select id="modeid" style="width:100px;border:none;background:white;font-size:14px"><option value="0">选择模块</option></select>';
|
||||
$('#searsearch_bar').prepend(s);
|
||||
$('#modeid').change(function(){
|
||||
yy.search({'modeid':this.value});
|
||||
});
|
||||
}
|
||||
yy.onshowdata=function(da){
|
||||
if(da.modearr){
|
||||
var s = '<option value="0">选择模块</option>',len=da.modearr.length,i,csd,types='';
|
||||
for(i=0;i<len;i++){
|
||||
csd = da.modearr[i];
|
||||
if(types!=csd.type){
|
||||
if(types!='')s+='</optgroup>';
|
||||
s+='<optgroup label="'+csd.type+'">';
|
||||
}
|
||||
s+='<option value="'+csd.id+'">'+csd.name+'</option>';
|
||||
types = csd.type;
|
||||
}
|
||||
if(len>0)$('#modeid').html(s);
|
||||
}
|
||||
}
|
||||
myyingsinit();
|
||||
56
webmain/we/ying/yingyong/kqbiao.html
Normal file
56
webmain/we/ying/yingyong/kqbiao.html
Normal file
@@ -0,0 +1,56 @@
|
||||
<div id="mainbodyobjdse"></div>
|
||||
<div id="dayabc" style="height:24px;line-height:24px;overflow:hidden;font-size:12px;background-color:#d4e3f7;border-top:1px #dddddd solid;position:absolute;bottom:50px;left:0px;width:100%">空白为休息日</div>
|
||||
<script type="text/javascript" src="web/res/mode/calendar/jquery-rockcalendar.js"></script>
|
||||
<script type="text/javascript" src="web/res/mode/calendar/jquery-rocklunar.js"></script>
|
||||
<script type="text/javascript">
|
||||
yingyonginit = function(){
|
||||
monthobj = $('#mainbodyobjdse').rockcalendar({
|
||||
height:yy.getheight(-25),headerbgcolor:'#dddddd',
|
||||
selbgcolor:'#d4e3f7',
|
||||
overShow:false,
|
||||
bordercolor:'#dddddd',
|
||||
changemonth:function(y, m){
|
||||
var dt = ''+y+'年'+xy10(m)+'月';
|
||||
setTimeout(function(){
|
||||
yy.settitle(dt);
|
||||
},10);
|
||||
getpaibang(''+y+'-'+xy10(m)+'');
|
||||
},
|
||||
align:'left',
|
||||
valign:'top',
|
||||
renderer:function(day, s0, s1,s2,col1,col2){
|
||||
var s = '<div><font color='+col1+'>'+s1+'</font><br><div style="font-size:11px;color:'+col2+'" id="day'+day+'">'+s2+'</div></div>';
|
||||
return s;
|
||||
}
|
||||
});
|
||||
var hei= yy.getheight(-25);
|
||||
yy.showobj.css({'height':''+hei+'px'});
|
||||
}
|
||||
yy.clickevent=function(d){
|
||||
if(d.url=='nowmonth')monthobj.nowmonth();
|
||||
if(d.url=='prevmonth')monthobj.fanmonth(-1);
|
||||
if(d.url=='refenxi')refenxiss();
|
||||
}
|
||||
var monthnow = '';
|
||||
function getpaibang(month){
|
||||
monthnow = month;
|
||||
$.get(js.getajaxurl('getmyanaykq','kaoqin','main', {month:month,uid:js.request('uid')}), function(strss){
|
||||
var d1,s='',da=js.decode(strss);
|
||||
for(d1 in da){
|
||||
s=da[d1];
|
||||
if(s!='')$('#day'+d1+'').html(s);
|
||||
}
|
||||
s='';var toarr = da['total'];
|
||||
for(d1 in toarr)s+=','+d1+':'+toarr[d1]+'';
|
||||
if(s!='')s=s.substr(1);
|
||||
$('#dayabc').html(s);
|
||||
});
|
||||
}
|
||||
function refenxiss(){
|
||||
js.loading('分析中...');
|
||||
$.get(js.getajaxurl('reladanaymy','kaoqin','main', {month:monthnow,uid:js.request('uid')}), function(da){
|
||||
getpaibang(monthnow);
|
||||
js.unloading();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
7
webmain/we/ying/yingyong/kqdkjl.js
Normal file
7
webmain/we/ying/yingyong/kqdkjl.js
Normal file
@@ -0,0 +1,7 @@
|
||||
yy.onclickmenu=function(a){
|
||||
if(a.url=='add_kqdkjl'){
|
||||
js.location('?d=we&m=ying&a=location');
|
||||
return;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
42
webmain/we/ying/yingyong/kqpai.html
Normal file
42
webmain/we/ying/yingyong/kqpai.html
Normal file
@@ -0,0 +1,42 @@
|
||||
<div id="mainbodyobjdse"></div>
|
||||
<div id="dayabc" style="height:24px;line-height:24px;overflow:hidden;font-size:12px;padding:0px 5px; background-color:#d4e3f7;border-top:1px #dddddd solid">空白为休息日</div>
|
||||
<script type="text/javascript" src="web/res/mode/calendar/jquery-rockcalendar.js"></script>
|
||||
<script type="text/javascript" src="web/res/mode/calendar/jquery-rocklunar.js"></script>
|
||||
<script type="text/javascript">
|
||||
yingyonginit = function(){
|
||||
monthobj = $('#mainbodyobjdse').rockcalendar({
|
||||
height:yy.getheight(-25),headerbgcolor:'#dddddd',
|
||||
selbgcolor:'#d4e3f7',
|
||||
overShow:false,
|
||||
bordercolor:'#dddddd',
|
||||
changemonth:function(y, m){
|
||||
var dt = ''+y+'年'+xy10(m)+'月';
|
||||
setTimeout(function(){
|
||||
yy.settitle(dt);
|
||||
},10);
|
||||
getpaibang(''+y+'-'+xy10(m)+'');
|
||||
},
|
||||
align:'center',
|
||||
valign:'center',
|
||||
renderer:function(day, s0, s1,s2,col1,col2){
|
||||
var s = '<div><font color='+col1+'>'+s1+'</font><br><div style="font-size:11px;height:16px;overflow:hidden;color:'+col2+'" id="day'+day+'">'+s2+'</div></div>';
|
||||
return s;
|
||||
}
|
||||
});
|
||||
}
|
||||
yy.clickevent=function(d){
|
||||
if(d.url=='nowmonth')monthobj.nowmonth();
|
||||
if(d.url=='prevmonth')monthobj.fanmonth(-1);
|
||||
if(d.url=='nextmonth')monthobj.fanmonth(1);
|
||||
}
|
||||
function getpaibang(month){
|
||||
js.ajax('kaoqin','getpaib',{'month':month,'uid':js.request('uid')},function(ret){
|
||||
for(var d1 in ret){
|
||||
var s1 = ret[d1];
|
||||
if(s1=='')s1='休息';
|
||||
if(d1!='abc')s1 = '['+s1+']';
|
||||
$('#day'+d1+'').html(s1);
|
||||
}
|
||||
},'mode', false,false, 'get');
|
||||
}
|
||||
</script>
|
||||
5
webmain/we/ying/yingyong/kqtotal.js
Normal file
5
webmain/we/ying/yingyong/kqtotal.js
Normal file
@@ -0,0 +1,5 @@
|
||||
yy.showmenu=function(oi){
|
||||
var a = this.data[oi-1];
|
||||
var url = '?m=ying&d=we&num=kqbiao&uid='+a.uid+'';
|
||||
js.location(url);
|
||||
}
|
||||
13
webmain/we/ying/yingyong/news.js
Normal file
13
webmain/we/ying/yingyong/news.js
Normal file
@@ -0,0 +1,13 @@
|
||||
function myyingsinit(){
|
||||
var s = '<select id="typeid" style="width:100px;border:none;background:white;font-size:14px"><option value="">所有分类</option></select>';
|
||||
$('#searsearch_bar').prepend(s);
|
||||
$('#typeid').change(function(){
|
||||
yy.search({'typeid':this.value});
|
||||
});
|
||||
}
|
||||
yy.onshowdata=function(da){
|
||||
if(da.typearr){
|
||||
js.setselectdata(get('typeid'), da.typearr, 'id');
|
||||
}
|
||||
}
|
||||
myyingsinit();
|
||||
334
webmain/we/ying/yingyong/word.html
Normal file
334
webmain/we/ying/yingyong/word.html
Normal file
@@ -0,0 +1,334 @@
|
||||
<style>
|
||||
.progresscls{height:24px;overflow:hidden;line-height:24px;border:0px #eeeeee solid; position:relative;;width:100%;background-color:#f1f1f1;margin-top:3px}
|
||||
.progressclssse{background-color:#B0D6FC;height:24px;overflow:hidden;width:5%;position:absolute;z-index:0;left:0px;top:0px}
|
||||
.progressclstext{font-size:10px;color:#0556A8;height:24px;overflow:hidden;line-height:24px;text-align:left;position:absolute;z-index:1;left:5px;top:0px}
|
||||
.workheader span{float:left;display:block;padding:0px 10px; border-right:1px #dddddd solid;cursor:pointer;}
|
||||
.workheader span:active{background:#e1e1e1}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var cqids = '<?=$worcarr['ids']?>';
|
||||
yingyonginit = function(){
|
||||
c.init();
|
||||
}
|
||||
yy.regetdata=function(){
|
||||
c.getfile(0,0);
|
||||
}
|
||||
var c = {
|
||||
typeid:0,
|
||||
cqid:0,
|
||||
ismanage:0,
|
||||
isup:0,
|
||||
uptype:'',
|
||||
officebj:'',
|
||||
init:function(){
|
||||
c.getfile(0,0);
|
||||
c.upobj = $.rockupload({
|
||||
'inputfile' : 'wordupfile',
|
||||
onchange:function(a){
|
||||
c.onchange(a);
|
||||
},
|
||||
onprogress:function(a,bl){
|
||||
c.onprogress(a,bl);
|
||||
},
|
||||
onsuccess:function(a,str){
|
||||
c.onsuccess(a,str);
|
||||
},
|
||||
onerror:function(str){
|
||||
js.msg('msg', str);
|
||||
$('#progresstext_heheheh').html('<font color=red>上传失败</font>');
|
||||
}
|
||||
});
|
||||
},
|
||||
onchange:function(a){
|
||||
$('#progresscls_hehehehsss').remove();
|
||||
$('body').append('<div id="progresscls_hehehehsss" style="position:absolute;bottom:50px;" class="progresscls"><div id="progresscls_heheheh" class="progressclssse"></div><div class="progressclstext" id="progresstext_heheheh" >'+a.filename+','+a.filesizecn+'(0%)</div></div>');
|
||||
},
|
||||
onprogress:function(a,per){
|
||||
$('#progresscls_heheheh').css('width',''+per+'%');
|
||||
$('#progresstext_heheheh').html(''+a.filename+','+a.filesizecn+'('+per+'%)');
|
||||
},
|
||||
onsuccess:function(a,str){
|
||||
var f = js.decode(str);
|
||||
$('#progresstext_heheheh').html(''+a.filename+','+a.filesizecn+',上传成功,保存中...');
|
||||
var fileid = f.id;
|
||||
js.ajax('word','savefile',{typeid:c.typeid,sid:fileid,cqid:this.cqid},function(a){
|
||||
$('#progresscls_hehehehsss').remove();
|
||||
js.msg('success',''+a.filename+'上传成功');
|
||||
a.fileid=a.id;
|
||||
a.name = a.filename;
|
||||
$('#wordlisttable').append(c.showlist(a));
|
||||
},'none');
|
||||
},
|
||||
create:function(){
|
||||
js.wx.prompt('新建文件夹','请输入文件夹名称:',function(text){
|
||||
if(!text){js.msg('msg','没有输入文件夹名称');return;}
|
||||
js.ajax('word','createfolder',{name:text,typeid:c.typeid,cqid:c.cqid},function(a){
|
||||
c.createshow(a);
|
||||
});
|
||||
});
|
||||
},
|
||||
createshow:function(a){
|
||||
$('#wordlisttable').append(this.showlist(a));
|
||||
},
|
||||
up:function(){
|
||||
c.upobj.click({'uptype':this.uptype});
|
||||
},
|
||||
|
||||
//切换分区
|
||||
changfenqu:function(fq){
|
||||
yy.sousoukey='';
|
||||
yy.sqxs();
|
||||
$('#workheader span:gt(0)').remove();
|
||||
this.uptype = $(fq.options[fq.selectedIndex]).attr('uptype');
|
||||
this.getfile(0, fq.value);
|
||||
},
|
||||
disabedgl:function(lx){
|
||||
var clas = 'weui_navbar_item_disabled';
|
||||
if(lx){
|
||||
$('div[tempxu=2]').addClass(clas);
|
||||
}else{
|
||||
$('div[tempxu=2]').removeClass(clas);
|
||||
}
|
||||
},
|
||||
disableup:function(lx){
|
||||
var clas = 'weui_navbar_item_disabled';
|
||||
if(lx){
|
||||
$('div[tempxu=0]').addClass(clas);
|
||||
}else{
|
||||
$('div[tempxu=0]').removeClass(clas);
|
||||
}
|
||||
},
|
||||
getfile:function(pid,cid,alx,padg){
|
||||
this.typeid = pid;
|
||||
this.cqid = cid;
|
||||
this.disabedgl(true);
|
||||
this.disableup(true);
|
||||
if(!alx)alx='';
|
||||
this.atype = alx;
|
||||
if(!padg)padg=1;
|
||||
this.page = padg;
|
||||
get('cpselect').value = this.cqid;
|
||||
js.ajax('word','getdata',{typeid:pid,cqid:this.cqid,cqids:cqids,atype:alx,page:padg,key:yy.sousoukey},function(a){
|
||||
c.ismanage = a.ismanage;
|
||||
c.isup = a.isup;
|
||||
c.officebj = a.officebj;
|
||||
if(a.ismanage==1)c.disabedgl(false);//有权限
|
||||
if(a.isup==1)c.disableup(false);//有权限
|
||||
c.data=[];
|
||||
c.showdata(a);
|
||||
},'mode');
|
||||
},
|
||||
reload:function(){
|
||||
this.getfile(this.typeid,this.cqid,this.atype);
|
||||
},
|
||||
nextpage:function(){
|
||||
this.getfile(this.typeid,this.cqid,this.atype,this.page+1);
|
||||
},
|
||||
showdata:function(a){
|
||||
$('#showblank').remove();
|
||||
var rows = a.rows;
|
||||
var i,len=rows.length,s;
|
||||
s='<table id="wordlisttable" style="width:100%; background-color:white">';
|
||||
for(i=0;i<len;i++){
|
||||
s+=c.showlist(rows[i]);
|
||||
}
|
||||
s+='</table>';
|
||||
s+='<div style="margin-top:10px" class="showblank" id="showblank">共'+a.count+'条记录';
|
||||
if(a.maxpage>1)s+=',当前'+a.maxpage+'/'+a.page+'页';
|
||||
if(a.page<a.maxpage){
|
||||
s+=', <a id="showblankss" onclick="c.nextpage(this)" href="javascript:;">点击加载</a>';
|
||||
}
|
||||
s+='</div>';
|
||||
if(a.page<=1){
|
||||
$('#mainbody_show').html(s);
|
||||
}else{
|
||||
$('#mainbody_show').append(s);
|
||||
}
|
||||
},
|
||||
showlist:function(d){
|
||||
if(!d.id)d.id=d.fileid;
|
||||
if(!d.fileext)d.fileext='folder';
|
||||
var oi = this.data.push(d),s1='';
|
||||
var s='';
|
||||
s+='<tr style="height:60px;border-top:1px #f1f1f1 solid" id="'+d.fileext+'_'+d.id+'" onclick="c.clicksse('+oi+',event,this)" >';
|
||||
s1='<div id="filename_'+oi+'">'+d.name+'</div>';
|
||||
if(d.fileid){
|
||||
s1+='<div style="font-size:12px;color:#888888">大小:'+d.filesizecn+'';
|
||||
if(!isempt(d.shate))s1+=',共享给:'+d.shate+'';
|
||||
s1+='</div>';
|
||||
}
|
||||
if(d.fileext=='folder'){
|
||||
s+='<td align="center" width="40"><img src="images/folder.png" height="24" width="24"></td><td>'+s1+'</td>';
|
||||
}else{
|
||||
var slx = d.fileext;
|
||||
if(js.fileall.indexOf(','+slx+',')<0)slx='wz';
|
||||
var fstr = 'web/images/fileicons/'+slx+'.gif';
|
||||
if(d.thumbpath)fstr = d.thumbpath;
|
||||
s+='<td align="center" width="40"><img src="'+fstr+'" height="16" width="16"></td><td>'+s1+'</td>';
|
||||
}
|
||||
s+='</tr>';
|
||||
return s;
|
||||
},
|
||||
chentcolor:function(oi,e,o1){
|
||||
if(this._olodwet)$(this._olodwet).css('background','');
|
||||
$(o1).css('background','#f3f3f3');
|
||||
this._olodwet = o1;
|
||||
},
|
||||
isoffice:function(ext){
|
||||
var strs = ',doc,dot,wps,wpt,docx,dotx,docm,dotm,xls,xlt,et,xlsx,xltx,csv,xlsm,xltm,ppt,pptx,pptm,ppsx,ppsm,pps,potx,potm,dpt,dps,';
|
||||
return strs.indexOf(','+ext+',')>=0;
|
||||
},
|
||||
clicksse:function(oi,e,o1){
|
||||
this.chentcolor(oi,e,o1);
|
||||
var d = this.data[oi-1];
|
||||
this.tempoi = oi;
|
||||
this.tempda = d;
|
||||
var a = [{name:(d.fileext=='folder')?'打开':'下载',lx:0}];
|
||||
if(d.fileext!='folder'){
|
||||
a.push({name:'预览',lx:7});
|
||||
}
|
||||
if(this.ismanage==1){
|
||||
a.push({name:'重命名',lx:1});
|
||||
a.push({name:'删除',lx:4});
|
||||
a.push({name:'共享给...',lx:5});
|
||||
a.push({name:'移动',lx:2});
|
||||
if(this.officebj=='1' && this.isoffice(d.fileext))a.push({name:'编辑',lx:8});
|
||||
}
|
||||
if(d.fileext!='folder'){
|
||||
a.push({name:'转发给...',lx:6});
|
||||
}
|
||||
js.showmenu({data:a,onclick:function(d){c.clickmenuss(d)}});
|
||||
},
|
||||
clickmenuss:function(d){
|
||||
var lx=d.lx;
|
||||
if(lx==0)this.celdblckc(this.tempoi);
|
||||
if(lx==1)this.cmmr();
|
||||
if(lx==2)this.movesss();
|
||||
if(lx==3)this.moveokzh();
|
||||
if(lx==4)this.delfload();
|
||||
if(lx==5)this.fenxiang();
|
||||
if(lx==6)this.zhuanfagei();
|
||||
if(lx==7)this.yulans();
|
||||
if(lx==8)js.fileopt(this.tempda.fileid,2);
|
||||
},
|
||||
celdblckc:function(oi){
|
||||
var d = this.data[oi-1];
|
||||
if(d.fileext=='folder'){
|
||||
var s = '<span onclick="c.clickheadeer('+d.id+', this)">'+d.name+'></span>';
|
||||
$('#workheader').append(s);
|
||||
this.getfile(d.id,d.cid);
|
||||
}else{
|
||||
js.fileopt(d.fileid,1);
|
||||
}
|
||||
},
|
||||
yulans:function(){
|
||||
var d = this.tempda;
|
||||
js.fileopt(d.fileid,0);
|
||||
},
|
||||
clickheadeer:function(pid,o1){
|
||||
var as = $('#workheader span');
|
||||
var rb = false;
|
||||
for(var i=0;i<as.length;i++){
|
||||
if(rb)$(as[i]).remove();
|
||||
if(o1==as[i])rb=true;
|
||||
}
|
||||
|
||||
c.getfile(pid,this.cqid);
|
||||
},
|
||||
cmmr:function(){
|
||||
js.wx.prompt('重命名','请输入新的名称:',function(text){
|
||||
if(!text){js.msg('msg','没有输入新的名称');return;}
|
||||
if(c.tempda.name==text)return;
|
||||
c.data[c.tempoi-1].name=text;
|
||||
$('#filename_'+c.tempoi+'').html(text);
|
||||
c.cmmrssok(text);
|
||||
},this.tempda.name);
|
||||
},
|
||||
cmmrssok:function(txt){
|
||||
var d={id:this.tempda.id,type:this.tempda.fileext,name:jm.base64encode(txt)};
|
||||
js.ajax('word','rename',d,function(a){},'none');
|
||||
},
|
||||
movesss:function(){
|
||||
$.selectdata({
|
||||
title:'选择移动的分区/目录',
|
||||
url:js.apiurl('word','moveget'),
|
||||
checked:false,
|
||||
onselect:function(sda,sna, sid){
|
||||
js.ajax('word','movefile',{'cqid':sda.cqid,'typeid':sda.typeid,'ids':c.tempda.id},function(a){
|
||||
js.msg('success','移动成功');
|
||||
c.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
delfload:function(){
|
||||
js.wx.confirm('确定要删除吗?',function(lx){
|
||||
if(lx=='yes')c.delfloadok();
|
||||
});
|
||||
},
|
||||
delfloadok:function(){
|
||||
var d = this.tempda;
|
||||
this.movedata=false;
|
||||
js.ajax('word','delfile',{type:d.fileext,id:d.id},function(a){
|
||||
$('#'+d.fileext+'_'+d.id+'').remove();
|
||||
js.msg('success','删除成功');
|
||||
});
|
||||
},
|
||||
fenxiang:function(){
|
||||
$('body').chnageuser({
|
||||
'changetype':'changedeptusercheck',
|
||||
'title':'共享给...',
|
||||
'titlebool':get('header_title'),
|
||||
'onselect':function(sna,sid){
|
||||
c.fenxiangok(sna,sid);
|
||||
}
|
||||
});
|
||||
},
|
||||
zhuanfagei:function(){
|
||||
$('body').chnageuser({
|
||||
'changetype':'changeusercheck',
|
||||
'title':'转发给...',
|
||||
'titlebool':get('header_title'),
|
||||
'onselect':function(sna,sid){
|
||||
c.zhuanfageiok(sna,sid);
|
||||
}
|
||||
});
|
||||
},
|
||||
zhuanfageiok:function(sna,sid){
|
||||
var d = this.tempda;
|
||||
var ds = {'tuid':sid,'type':'user','cont':'','fileid':d.fileid};
|
||||
js.ajax('reim','forward', ds, function(){
|
||||
js.msg('success','已转发给【'+sna+'】')
|
||||
});
|
||||
},
|
||||
fenxiangok:function(sna,sid){
|
||||
var d = this.tempda;
|
||||
js.ajax('word','shatefile',{type:d.fileext,ids:d.id,sid:sid,sna:sna},function(a){
|
||||
if(sid==''){
|
||||
js.msg('success','已取消共享');
|
||||
}else{
|
||||
js.msg('success','已共享给【'+sna+'】');
|
||||
}
|
||||
c.reload();
|
||||
});
|
||||
},
|
||||
wfenxx:function(lx){
|
||||
this.getfile(this.typeid,0, lx);
|
||||
}
|
||||
};
|
||||
yy.clickevent=function(d){
|
||||
if(d.url=='create')c.create();
|
||||
if(d.url=='up')c.up();
|
||||
if(d.url=='shate')c.wfenxx('shateall');
|
||||
if(d.url=='fxgw')c.wfenxx('shatewfx');
|
||||
}
|
||||
yy.initScroll=function(){}
|
||||
</script>
|
||||
<div><select id="cpselect" onchange="c.changfenqu(this)" style="width:100%;border:none;height:40px;font-size:16px;padding:5px"><option uptype="" value="0">所有分区</option><?php
|
||||
foreach($worcarr['rows'] as $k=>$rs){
|
||||
echo '<option uptype="'.$rs['uptype'].'" value="'.$rs['id'].'">'.$rs['name'].'</option>';
|
||||
}
|
||||
?></select></div>
|
||||
<div class="workheader" id="workheader" style="line-height:50px; background-color:#ffffff;overflow:hidden;border-top:1px #dddddd solid"><span onclick="c.clickheadeer(0, this)">顶级目录></span></div>
|
||||
<div id="mainbody_show"></div>
|
||||
7
webmain/we/ying/yingyong/wordxie.js
Normal file
7
webmain/we/ying/yingyong/wordxie.js
Normal file
@@ -0,0 +1,7 @@
|
||||
openxieeditfile=function(d,d1){
|
||||
if(!d1.officebj){
|
||||
js.msg('msg','移动端在线编辑需要用“在线编辑服务”,请到“系统设置”下设置');
|
||||
}else{
|
||||
js.fileopt(d.fileid,2);
|
||||
}
|
||||
}
|
||||
11
webmain/we/ying/yingyong/work.js
Normal file
11
webmain/we/ying/yingyong/work.js
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
yy.onshowdata=function(da){
|
||||
if(da.projectarr){
|
||||
var s = '<select id="projcetid" style="width:100px;border:none;background:white;font-size:14px"><option value="">所有项目</option></select>';
|
||||
$('#searsearch_bar').prepend(s);
|
||||
$('#projcetid').change(function(){
|
||||
yy.search({'projcetid':this.value});
|
||||
});
|
||||
js.setselectdata(get('projcetid'), da.projectarr, 'id');
|
||||
}
|
||||
}
|
||||
27
webmain/we/ying/yingyong/ying_wordClass.php
Normal file
27
webmain/we/ying/yingyong/ying_wordClass.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* 移动端应用【word.文档】的接口程序
|
||||
* 主页:http://www.rockoa.com/
|
||||
* 软件:信呼
|
||||
* 作者:雨中磐石(rainrock)
|
||||
* 日期:2017-11-21
|
||||
*/
|
||||
|
||||
class ying_wordClass extends yingClassAction{
|
||||
private $mobj;
|
||||
|
||||
private $searchtool = true; //需要搜索拦
|
||||
|
||||
|
||||
public function initYing($mobj)
|
||||
{
|
||||
$this->mobj = $mobj;
|
||||
|
||||
//获取分区
|
||||
$worcarr = m('worc')->getmywroc();
|
||||
|
||||
$this->mobj->assign('worcarr', $worcarr);
|
||||
$this->mobj->assign('searchtool', $this->searchtool);
|
||||
$this->mobj->assign('searchmsg', '文件名/文件夹');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user