信呼OA版本v2.3.8

This commit is contained in:
雨中磐石
2022-08-14 16:47:40 +08:00
parent 4640677d27
commit e3fcd913e3
1405 changed files with 133635 additions and 73 deletions

View File

@@ -0,0 +1,70 @@
<?php if(!defined('HOST'))die('not access');?>
<script >
$(document).ready(function(){
var c={
init:function(){
$.get(js.getajaxurl('getset','{mode}','{dir}'), function(s){
var a=js.decode(s);
get('txcloud_secretid_{rand}').value=a.secretid;
get('txcloud_secretkey_{rand}').value=a.secretkey;
get('txcloud_rlroupid_{rand}').value=a.rlroupid;
});
},
save:function(o){
var d={};
d.secretid = get('txcloud_secretid_{rand}').value;
d.secretkey = get('txcloud_secretkey_{rand}').value;
d.rlroupid = get('txcloud_rlroupid_{rand}').value;
js.msg('wait','保存中...');
js.ajax(js.getajaxurl('setsave','{mode}','{dir}'), d, function(s){
js.msg('success','保存成功');
},'post');
}
};
js.initbtn(c);
c.init();
});
</script>
<div align="left">
<div style="padding:10px;">
<table cellspacing="0" width="650" border="0" cellpadding="0">
<tr>
<td align="right"><font color=red>*</font> API密钥SecretId</td>
<td class="tdinput"><input id="txcloud_secretid_{rand}" onblur="this.value=strreplace(this.value)" class="form-control"></td>
</tr>
<tr>
<td align="right"><font color=red>*</font> API密钥SecretKey</td>
<td class="tdinput"><input id="txcloud_secretkey_{rand}" onblur="this.value=strreplace(this.value)" class="form-control">
<font id="showddd_{rand}" color="#888888">请到<a href="https://console.cloud.tencent.com/cam/capi" target="_blank">[腾讯云管理后台]</a>下获取。</font>
</td>
</tr>
<tr>
<td colspan="2"><div class="inputtitle">产品应用设置</div></td>
</tr>
<tr>
<td align="right">使用人脸人员库ID</td>
<td class="tdinput"><input onblur="this.value=strreplace(this.value)" id="txcloud_rlroupid_{rand}" class="form-control"></td>
</tr>
<tr>
<td align="right"></td>
<td style="padding:15px 0px" colspan="3" align="left"><button click="save" class="btn btn-success" type="button"><i class="icon-save"></i>&nbsp;保存</button>
</span>
</td>
</tr>
</table>
</div>
</div>

View File

@@ -0,0 +1,16 @@
<?php if(!defined('HOST'))die('not access');?>
<script >
$(document).ready(function(){
var c = {
};
js.initbtn(c);
});
</script>
<div id="view_{rand}"><h1>文件上传到腾讯云的对象存储中</h1><br>查看这个<a target="_blank" href="<?=URLY?>view_txcos.html">帮助</a>去配置。</div>

View File

@@ -0,0 +1,100 @@
<?php if(!defined('HOST'))die('not access');?>
<script >
$(document).ready(function(){
var a = $('#view_{rand}').bootstable({
tablename:'wxtx_renlian',celleditor:true,fanye:true,statuschange:true,
url:publicstore('{mode}','{dir}'),storebeforeaction:'beforeuserdshow',storeafteraction:'aftereuserdshow',
columns:[{
text:'姓名',dataIndex:'personname',sortable:true
},{
text:'人员库ID',dataIndex:'personid'
},{
text:'人脸图片数',dataIndex:'imgshu'
},{
text:'启用',dataIndex:'status',type:'checkbox',editor:true,sortable:true
},{
text:'关联OA用户ID',dataIndex:'uid',editor:true,type:'number'
},{
text:'关联OA用户姓名',dataIndex:'name'
},{
text:'关联OA用户部门',dataIndex:'deptallname'
}],
itemclick:function(){
get('delbtn{rand}').disabled=false;
},
beforeload:function(){
get('delbtn{rand}').disabled=true;
}
});
var c = {
search:function(){
var s=get('key_{rand}').value;
a.setparams({key:s},true);
},
getlist:function(){
js.msg('wait','获取中...');
js.ajax(js.getajaxurl('reloaduser','{mode}', '{dir}'),{}, function(d){
if(d.success){
js.msg('success', d.data);
a.reload();
}else{
js.msg('msg', d.msg);
}
},'get,json');
},
delaluser:function(){
a.del({url:js.getajaxurl('delrenlian','{mode}','{dir}')});
},
adduser:function(){
var h = $.bootsform({
title:'用户人脸',height:400,width:500,
tablename:'wxtx_renlian',isedit:0,
url:js.getajaxurl('createurenlian','{mode}','{dir}'),
submitfields:'uid,personname',
items:[{
name:'uid',type:'hidden'
},{
labelText:'对应用户',type:'changeuser',changeuser:{
type:'user',idname:'uid',title:'选择uid'
},name:'personname',clearbool:true,required:true
},{
labelText:'人脸图片地址',name:'imgurl',blankText:'系统目录下图片不能超过1M60x60像素以上'
}],
success:function(){
a.reload();
}
});
}
};
js.initbtn(c);
});
</script>
<table width="100%">
<tr>
<td style="padding-right:10px"><button class="btn btn-primary" click="adduser" type="button"><i class="icon-plus"></i> 创建人员</button></td>
<td style="padding-right:10px"><button class="btn btn-default" click="getlist" type="button">获取人脸用户库上人员</button></td>
<td>
<div class="input-group" style="width:250px;">
<input class="form-control" id="key_{rand}" placeholder="姓名/关联用户部门">
<span class="input-group-btn">
<button class="btn btn-default" click="search" type="button"><i class="icon-search"></i></button>
</span>
</div>
</td>
<td width="90%" style="padding-left:10px">
</td>
<td align="right" nowrap>
<button class="btn btn-danger" disabled id="delbtn{rand}" click="delaluser" type="button">删除</button>
</td>
</tr>
</table>
<div class="blank10"></div>
<div id="view_{rand}"></div>

View File

@@ -0,0 +1,81 @@
<?php
class txcloudClassAction extends Action
{
public function setsaveAjax()
{
$secretid = $this->post('secretid');
$secretkey = $this->post('secretkey');
if(!contain($secretid,'****'))
$this->option->setval('txcloud_secretid@-6', $this->jm->encrypt($secretid));
if(!contain($secretkey,'****'))
$this->option->setval('txcloud_secretkey@-6', $this->jm->encrypt($secretkey));
$this->option->setval('txcloud_rlroupid@-6', $this->post('rlroupid'));
$this->backmsg();
}
public function getsetAjax()
{
$arr= array();
$arr['secretid'] = $this->option->getval('txcloud_secretid');
$arr['secretkey'] = $this->option->getval('txcloud_secretkey');
$arr['rlroupid'] = $this->option->getval('txcloud_rlroupid');
if(!isempt($arr['secretid'])){
$secretid = $this->jm->uncrypt($arr['secretid']);
$arr['secretid'] = substr($secretid,0,5).'******'.substr($secretid,-5);
}
if(!isempt($arr['secretkey'])){
$secretkey = $this->jm->uncrypt($arr['secretkey']);
$arr['secretkey'] = substr($secretkey,0,5).'******'.substr($secretkey,-5);
}
echo json_encode($arr);
}
//获取
public function reloaduserAjax()
{
return m('txcloud:renlian')->GetPersonList();
}
//删除
public function delrenlianAjax()
{
return m('txcloud:renlian')->deleteRenlian((int)$this->post('id','0'));
}
public function beforeuserdshow($table)
{
$where = '';
$key = $this->post('key');
if(!isempt($key))$where=" and (a.`personname` like '%$key%' or b.`deptallname` like '%$key%')";
return array(
'where' => $where,
'fields'=> 'a.*,b.name,b.deptallname',
'table' => '`[Q]'.$table.'` a left join `[Q]admin` b on a.uid=b.id'
);
}
public function aftereuserdshow($table, $rows)
{
foreach($rows as $k=>$rs){
if($rs['uid']>0 && $rs['personname']!=$rs['name']){
$rows[$k]['name'].='<font color=red>,关联的姓名不一样</font>';
}
if(!isempt($rs['faceids']))$rows[$k]['imgshu'] = count(explode(',', $rs['faceids']));
}
return array(
'rows' => $rows
);
}
//创建用户
public function createurenlianAjax()
{
return m('txcloud:renlian')->createUser(array(
'id' => (int)$this->post('id'),
'uid' => (int)$this->post('uid'),
'personname' => $this->post('personname'),
'imgurl' => $this->post('imgurl'),
));
}
}