Skip to content

Commit

Permalink
优化document
Browse files Browse the repository at this point in the history
  • Loading branch information
weichaoduo committed Jul 6, 2021
1 parent f7b9389 commit d04fe17
Show file tree
Hide file tree
Showing 8 changed files with 298 additions and 9 deletions.
1 change: 0 additions & 1 deletion app/ctrl/BaseCtrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,6 @@ public function loadPlugin()
$plugins[] = $tmp;
}
}

if ($plugins) {
foreach ($plugins as $plugin) {
$pluginName = $plugin['name'];
Expand Down
13 changes: 13 additions & 0 deletions app/ctrl/admin/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,19 @@ public function pageIndex()
$this->render('twig/admin/system/system_basic_setting.twig', $data);
}

/**
* @throws \Exception
*/
public function pageCompanySetting()
{
$data = [];
$data['title'] = 'System';
$data['nav_links_active'] = 'system';
$data['sub_nav_active'] = 'setting';
$data['left_nav_active'] = 'company_setting';
$this->render('twig/admin/system/system_company.twig', $data);
}

/**
* @throws \Exception
*/
Expand Down
1 change: 1 addition & 0 deletions app/view/twig/admin/common_system_left_nav.twig
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<div class="admin-menu-links">
<div class="admin_left_header aui-nav-heading {% if (sub_nav_active == 'setting') %} <?= 'active' ?>{% endif %}"><strong>设置</strong></div>
<ul class="aui-nav" resolved="">
<li class=" {% if (left_nav_active == 'company_setting') %} <?= 'active' ?>{% endif %}"><a href="/admin/system/company_setting" id="company_setting">公司设置</a>
<li class=" {% if (left_nav_active == 'setting') %} <?= 'active' ?>{% endif %}"><a href="/admin/system" id="general_configuration">基本配置</a>
</li>
<li class=" {% if (left_nav_active == 'datetime_setting') %} <?= 'active' ?>{% endif %}"><a href="/admin/system/datetime_setting" id="find_more_admin_tools">时间设置</a>
Expand Down
248 changes: 248 additions & 0 deletions app/view/twig/admin/system/system_company.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
<!DOCTYPE html>
<html class="" lang="en">
<head >

{% include 'twig/common/header/include.twig' %}
<script src="/dev/js/admin/setting.js?v=<?=_version?>" type="text/javascript" charset="utf-8"></script>
<script src="/dev/lib/handlebars-v4.0.10.js" type="text/javascript" charset="utf-8"></script>
<link href="/dev/lib/bootstrap-colorpicker/dist/css/bootstrap-colorpicker.min.css" rel="stylesheet">
<!-- Fine Uploader jQuery JS file-->
<link href="/dev/lib/fine-uploader/fine-uploader.css" rel="stylesheet">
<link href="/dev/lib/fine-uploader/fine-uploader-gallery.css" rel="stylesheet">
<script src="/dev/lib/e-smart-zoom-jquery.min.js"></script>
<script src="/dev/lib/fine-uploader/jquery.fine-uploader.js"></script>
</head>
<body class="" data-group="" data-page="projects:issues:index" data-project="xphp">
{% include 'twig/common/body/script.twig' %}
<script src="/dev/lib/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.min.js"></script>

<section class="has-sidebar page-layout max-sidebar">
{% include 'twig/common/body/page-left.twig' %}

<div class="page-layout page-content-body system-page">
{% include 'twig/common/body/header-content.twig' %}

<script>
var findFileURL = "";
</script>
<div class="page-with-sidebar">
{% include 'twig/admin/common-page-nav-admin.twig' %}


<div class="content-wrapper page-with-layout-nav page-with-sub-nav">
<div class="alert-wrapper">

<div class="flash-container flash-container-page">
</div>

</div>
<div class="container-fluid ">

<div class="content" id="content-body">

{% include 'twig/admin/common_system_left_nav.twig' %}
<div class="row has-side-margin-left">
<div class="col-lg-12">
<div class="top-area">
<ul class="nav-links">
<li class="active">
<a href="#">公司设置</a>
</li>
</ul>
<div class="nav-controls">
<div class="btn-group" role="group">

</div>
</div>
</div>
<div class="content-list">
<form class="form-horizontal" action="/admin/system/company_save" method="post">
<div id="form_id" class="prepend-top-default">
<div class="form-group">
<label class="control-label" for="company">公司名称
<i class="required">*</i>
</label>
<div class="col-sm-6">
<input placeholder="公司名称,最多12字符" class="form-control" type="text" name="company" id="company" >
<p id="tip-company" class="gl-field-error hide"></p>
</div>
</div>

<div class="form-group">
<label class="control-label" for="company_logo">
<span>公司logo</span>
</label>
<div class="col-sm-2">
<input type="hidden" name="company_logo" id="company_logo" value=""/>
<div id="fine-uploader-gallery"></div>
</div>
<div class="col-sm-6">
<div class="help-block">图片大小被限制为200KB.</div>
</div>
</div>
<div class="form-group">
<label class="control-label" for="company_linkman">联系人
<i class="required">*</i>
</label>
<div class="col-sm-6">
<input class="form-control" type="text" name="company_linkman" id="company_linkman" >
<p id="tip-company_linkman" class="gl-field-error hide"></p>
</div>
</div>
<div class="form-group">
<label class="control-label" for="company_phone">联系电话
<i class="required">*</i>
</label>
<div class="col-sm-6">
<input class="form-control" type="text" name="company_phone" id="company_phone" >
<p id="tip-company_phone" class="gl-field-error hide"></p>
</div>
</div>
</div>
<div class="form-actions text-right">
<input type="button" name="commit" value="保存修改" class="btn btn-save js-key-enter">
<a class="btn btn-cancel" href="/admin/main" style="float: none">取消</a>
</div>
</form>
</div>
</div>
</div>

</div>

</div>
</div>
</div>

</div>
</section>

<script type="text/template" id="qq-template-gallery">
<div class="qq-uploader-selector qq-uploader qq-gallery" qq-drop-area-text="">
<div class="qq-total-progress-bar-container-selector qq-total-progress-bar-container">
<div role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" class="qq-total-progress-bar-selector qq-progress-bar qq-total-progress-bar"></div>
</div>
<div class="qq-upload-drop-area-selector qq-upload-drop-area" qq-hide-dropzone>
<span class="qq-upload-drop-area-text-selector"></span>
</div>
<div class="qq-upload-button-selector qq-upload-button">
<div>点击上传</div>
</div>
<span class="qq-drop-processing-selector qq-drop-processing">
<span>Processing dropped files...</span>
<span class="qq-drop-processing-spinner-selector qq-drop-processing-spinner"></span>
</span>
<ul class="qq-upload-list-selector qq-upload-list" role="region" aria-live="polite" aria-relevant="additions removals">
<li>
<span role="status" class="qq-upload-status-text-selector qq-upload-status-text"></span>
<div class="qq-progress-bar-container-selector qq-progress-bar-container">
<div role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" class="qq-progress-bar-selector qq-progress-bar"></div>
</div>
<span class="qq-upload-spinner-selector qq-upload-spinner"></span>
<div class="qq-thumbnail-wrapper">
<a href="javascript:;" class="qq-file-link qq-upload-file-url">
<img class="qq-thumbnail-selector" qq-max-size="198" qq-server-scale>
</a>
</div>
<button type="button" class="qq-upload-cancel-selector qq-upload-cancel">X</button>
<button type="button" class="qq-upload-retry-selector qq-upload-retry">
<span class="qq-btn qq-retry-icon" aria-label="Retry"></span>
重试
</button>
<div class="qq-file-info">
<div class="qq-file-name">
<span class="qq-upload-file-selector qq-upload-file"></span>
<span class="qq-edit-filename-icon-selector qq-edit-filename-icon" aria-label="Edit filename"></span>
</div>
<input class="qq-edit-filename-selector qq-edit-filename" tabindex="0" type="text">
<span class="qq-upload-size-selector qq-upload-size"></span>
<button type="button" class="qq-btn qq-upload-delete-selector qq-upload-delete">
<span class="qq-btn qq-delete-icon" aria-label="Delete"></span>
</button>
<button type="button" class="qq-btn qq-upload-pause-selector qq-upload-pause">
<span class="qq-btn qq-pause-icon" aria-label="Pause"></span>
</button>
<button type="button" class="qq-btn qq-upload-continue-selector qq-upload-continue">
<span class="qq-btn qq-continue-icon" aria-label="Continue"></span>
</button>
</div>
</li>
</ul>
<dialog class="qq-alert-dialog-selector">
<div class="qq-dialog-message-selector"></div>
<div class="qq-dialog-buttons">
<button type="button" class="qq-cancel-button-selector">Close</button>
</div>
</dialog>
<dialog class="qq-confirm-dialog-selector">
<div class="qq-dialog-message-selector"></div>
<div class="qq-dialog-buttons">
<button type="button" class="qq-cancel-button-selector"></button>
<button type="button" class="qq-ok-button-selector"></button>
</div>
</dialog>
<dialog class="qq-prompt-dialog-selector">
<div class="qq-dialog-message-selector"></div>
<input type="text">
<div class="qq-dialog-buttons">
<button type="button" class="qq-cancel-button-selector">取消</button>
<button type="button" class="qq-ok-button-selector">好的</button>
</div>
</dialog>
</div>
</script>


<script>
$(function () {
$('#fine-uploader-gallery').fineUploader({
template: 'qq-template-gallery',
multiple: false,
request: {
endpoint: '/admin/upload/img' + '?_csrftoken=' + encodeURIComponent(document.getElementById('csrf_token').value)
},
deleteFile: {
enabled: false
},
retry: {
enableAuto: true
},
validation: {
allowedExtensions: [
'jpeg', 'jpg', 'png'
],
sizeLimit: 1024 * 200
},
callbacks: {
onComplete: function (id, fileName, responseJSON) { // console.log(responseJSON);
if (responseJSON.error == '') {
$('#company_logo').val(responseJSON.relate_path);
}
}
}
});
});
</script>

<script>
$(function() {
//fetchSetting('/admin/system/setting_fetch','basic','settings_form_tpl', 'form_id');
});
</script>


</body>
</html>
10 changes: 10 additions & 0 deletions plugin/document/KodSdk.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ public function createUser($dataArr, $accessToken)
return [true, $bodyArr['data']];
}

/**
* @param $userName
* @param $accessToken
* @return array
*/
public function getUser($userName, $accessToken)
{
$url = sprintf($this->rootUrl . "?systemMember/getByName&name={$userName}&accessToken=".$accessToken);
Expand All @@ -101,6 +106,11 @@ public function getUser($userName, $accessToken)
return [true, $bodyArr['data']];
}

/**
* @param $userId
* @param $accessToken
* @return array
*/
public function deleteUser($userId, $accessToken)
{
$url = sprintf($this->rootUrl . '?systemMember/doAction&accessToken='.$accessToken);
Expand Down
2 changes: 1 addition & 1 deletion plugin/document/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function pageIndex()
}
if(empty($actUserArr) ){
if(count($kodUsers)>15){
echo '文档模块获取用户信息失败,请联系管理员';
echo '已经超过了创建的限额,无法继续使用';
return;
}
$dataArr = [];
Expand Down
30 changes: 24 additions & 6 deletions plugin/document/kod/data/system/backup/last/system_member.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"1": {
"name": "admin",
"path": "admin",
"password": "3642e90a171134dc385113f845707a3a",
"password": "333c5253ccb85fdb290cce37bb57cb7e",
"userID": "1",
"role": "1",
"config": {
Expand All @@ -14,13 +14,13 @@
},
"createTime": 1589187576,
"status": 1,
"lastLogin": 1618904324
"lastLogin": 1625476398
},
"100": {
"userID": "100",
"name": "project92",
"nickName": "project92",
"password": "2e941280dccb0c5a2526bd7995f7dc19",
"password": "333c5253ccb85fdb290cce37bb57cb7e",
"role": "2",
"config": {
"sizeMax": 5,
Expand All @@ -38,7 +38,7 @@
"userID": "101",
"name": "project1",
"nickName": "project1",
"password": "cdc4c5cc90e916bee8a68a49213bcc46",
"password": "333c5253ccb85fdb290cce37bb57cb7e",
"role": "2",
"config": {
"sizeMax": 5,
Expand All @@ -56,7 +56,7 @@
"userID": "102",
"name": "project3",
"nickName": "project3",
"password": "32f15966adc040fd0ad442d4c4d5b22b",
"password": "333c5253ccb85fdb290cce37bb57cb7e",
"role": "2",
"config": {
"sizeMax": 5,
Expand All @@ -74,7 +74,7 @@
"userID": "103",
"name": "project36",
"nickName": "project36",
"password": "772cd77852207e51167d8ab45a9fb1b5",
"password": "333c5253ccb85fdb290cce37bb57cb7e",
"role": "2",
"config": {
"sizeMax": 5,
Expand All @@ -87,5 +87,23 @@
"status": 1,
"lastLogin": 1618904326,
"createTime": 1618904325
},
"104": {
"userID": "104",
"name": "project91",
"nickName": "project91",
"password": "5946efebafeebac79a19cbbc9a5e5b0d",
"role": "2",
"config": {
"sizeMax": 5,
"sizeUse": 1048576
},
"groupInfo": {
"1": "write"
},
"path": "project91",
"status": 1,
"lastLogin": 1625476399,
"createTime": 1625476399
}
}
Loading

0 comments on commit d04fe17

Please sign in to comment.