修改系统模块管理

This commit is contained in:
Anyon 2020-08-17 16:29:19 +08:00
parent 1bf63fa7d3
commit ef63ee2eed
8 changed files with 35 additions and 33 deletions

View File

@ -56,13 +56,13 @@ class Module extends Controller
{ {
$data = $this->_vali(['name.require' => '模块名称不能为空!']); $data = $this->_vali(['name.require' => '模块名称不能为空!']);
$modules = ModuleService::instance()->online(); $modules = ModuleService::instance()->online();
$locals = ModuleService::instance()->getModules();
if (isset($modules[$data['name']])) { if (isset($modules[$data['name']])) {
$this->module = $modules[$data['name']]; $this->module = $modules[$data['name']];
foreach ($this->module['change'] as $key => &$change) { $this->current = $locals[$data['name']] ?? [];
$change = [ $pattern = "|^(\d{4})\.(\d{2})\.(\d{2})\.(\d+)$|";
'version' => preg_replace("|^(\d{4})\.(\d{2})\.(\d{2})\.(\d+)$|", '$1年$2月$3日 第$4次更新', $key), foreach ($this->module['change'] as $version => &$change) {
'content' => $change, $change = ['content' => $change, 'version' => preg_replace($pattern, '于 $1年$2月$3日 第$4次更新', $version)];
];
} }
$this->fetch(); $this->fetch();
} else { } else {

View File

@ -1 +1 @@
* 少更新修复部分BUG * 少更新修复部分BUG

View File

@ -1,29 +1,31 @@
<form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off"> <form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">
<div class="layui-card-body padding-left-40"> <div class="layui-card-body padding-left-40">
<table class="layui-table"> <div class="layui-textarea font-s14 layui-bg-gray padding-top-20 padding-left-20">
<tr> <div class="layui-row margin-bottom-15">
<td class="font-w7">模块名称</td> <div class="layui-col-xs6">模块名称:<b class="color-green">{$module.name}</b></div>
<td class="color-blue">{$module.name}</td> <div class="layui-col-xs6">开发作者:<b class="color-green">{$module.author}</b></div>
</tr> </div>
<tr> <div class="layui-row margin-bottom-15">
<td class="font-w7">最新版本</td> <div class="layui-col-xs6">最新版本:<b class="color-green">{$module.version}</b></div>
<td class="color-blue">{$module.version}</td> <div class="layui-col-xs6">{if isset($current.version)}已安装版本:<b class="color-green">{$current.version}</b>{/if}</div>
</tr> </div>
<tr> <div class="layui-form-item">模块描述:{$module.content}</div>
<td class="font-w7">模块描述</td> </div>
<td class="color-blue">{$module.content}</td>
</tr>
</table>
<ul class="layui-timeline margin-top-30 margin-bottom-30" style="max-height:400px;overflow:auto"> <ul class="layui-timeline margin-top-30 margin-bottom-30" style="max-height:400px;overflow:auto">
{foreach $module.change as $change} {foreach $module.change as $version=>$change}
<li class="layui-timeline-item"> <li class="layui-timeline-item">
{if isset($current.version) and $current.version eq $version}
<i class="layui-icon layui-timeline-axis">&#xe63f;</i> <i class="layui-icon layui-timeline-axis">&#xe63f;</i>
{else}
<i class="layui-icon layui-timeline-axis">&#xe756;</i>
{/if}
<div class="layui-timeline-content layui-text"> <div class="layui-timeline-content layui-text">
<h3 class="layui-timeline-title">{$change.version|default=''}</h3> <h3 class="layui-timeline-title">版本号 {$version}{$change.version|default=''}</h3>
{$change.content|default=''|raw} {$change.content|default=''|raw}
</div> </div>
</li> </li>
{/foreach} {/foreach}
<li class="layui-timeline-item"></li>
</ul> </ul>
</div> </div>
</form> </form>

8
composer.lock generated
View File

@ -937,12 +937,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git", "url": "https://github.com/zoujingli/ThinkLibrary.git",
"reference": "822d461c4f23e5ab3cd3489cd740a7171706e367" "reference": "747278ffb2b1a450bc8e6724ffbff105bb9f5f47"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/822d461c4f23e5ab3cd3489cd740a7171706e367", "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/747278ffb2b1a450bc8e6724ffbff105bb9f5f47",
"reference": "822d461c4f23e5ab3cd3489cd740a7171706e367", "reference": "747278ffb2b1a450bc8e6724ffbff105bb9f5f47",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
@ -987,7 +987,7 @@
], ],
"description": "ThinkPHP v6.0 Development Library", "description": "ThinkPHP v6.0 Development Library",
"homepage": "http://thinkadmin.top", "homepage": "http://thinkadmin.top",
"time": "2020-08-17T07:02:36+00:00" "time": "2020-08-17T07:32:11+00:00"
}, },
{ {
"name": "zoujingli/wechat-developer", "name": "zoujingli/wechat-developer",

View File

@ -283,6 +283,7 @@ return array(
'think\\admin\\extend\\HttpExtend' => $vendorDir . '/zoujingli/think-library/src/extend/HttpExtend.php', 'think\\admin\\extend\\HttpExtend' => $vendorDir . '/zoujingli/think-library/src/extend/HttpExtend.php',
'think\\admin\\extend\\JsonRpcClient' => $vendorDir . '/zoujingli/think-library/src/extend/JsonRpcClient.php', 'think\\admin\\extend\\JsonRpcClient' => $vendorDir . '/zoujingli/think-library/src/extend/JsonRpcClient.php',
'think\\admin\\extend\\JsonRpcServer' => $vendorDir . '/zoujingli/think-library/src/extend/JsonRpcServer.php', 'think\\admin\\extend\\JsonRpcServer' => $vendorDir . '/zoujingli/think-library/src/extend/JsonRpcServer.php',
'think\\admin\\extend\\Parsedown' => $vendorDir . '/zoujingli/think-library/src/extend/Parsedown.php',
'think\\admin\\helper\\DeleteHelper' => $vendorDir . '/zoujingli/think-library/src/helper/DeleteHelper.php', 'think\\admin\\helper\\DeleteHelper' => $vendorDir . '/zoujingli/think-library/src/helper/DeleteHelper.php',
'think\\admin\\helper\\FormHelper' => $vendorDir . '/zoujingli/think-library/src/helper/FormHelper.php', 'think\\admin\\helper\\FormHelper' => $vendorDir . '/zoujingli/think-library/src/helper/FormHelper.php',
'think\\admin\\helper\\PageHelper' => $vendorDir . '/zoujingli/think-library/src/helper/PageHelper.php', 'think\\admin\\helper\\PageHelper' => $vendorDir . '/zoujingli/think-library/src/helper/PageHelper.php',
@ -298,7 +299,6 @@ return array(
'think\\admin\\service\\CaptchaService' => $vendorDir . '/zoujingli/think-library/src/service/CaptchaService.php', 'think\\admin\\service\\CaptchaService' => $vendorDir . '/zoujingli/think-library/src/service/CaptchaService.php',
'think\\admin\\service\\ExpressService' => $vendorDir . '/zoujingli/think-library/src/service/ExpressService.php', 'think\\admin\\service\\ExpressService' => $vendorDir . '/zoujingli/think-library/src/service/ExpressService.php',
'think\\admin\\service\\InstallService' => $vendorDir . '/zoujingli/think-library/src/service/InstallService.php', 'think\\admin\\service\\InstallService' => $vendorDir . '/zoujingli/think-library/src/service/InstallService.php',
'think\\admin\\service\\MarkdownService' => $vendorDir . '/zoujingli/think-library/src/service/MarkdownService.php',
'think\\admin\\service\\MenuService' => $vendorDir . '/zoujingli/think-library/src/service/MenuService.php', 'think\\admin\\service\\MenuService' => $vendorDir . '/zoujingli/think-library/src/service/MenuService.php',
'think\\admin\\service\\MessageService' => $vendorDir . '/zoujingli/think-library/src/service/MessageService.php', 'think\\admin\\service\\MessageService' => $vendorDir . '/zoujingli/think-library/src/service/MessageService.php',
'think\\admin\\service\\ModuleService' => $vendorDir . '/zoujingli/think-library/src/service/ModuleService.php', 'think\\admin\\service\\ModuleService' => $vendorDir . '/zoujingli/think-library/src/service/ModuleService.php',

View File

@ -416,6 +416,7 @@ class ComposerStaticInitb911c14a0826c73d9f097343fd33a252
'think\\admin\\extend\\HttpExtend' => __DIR__ . '/..' . '/zoujingli/think-library/src/extend/HttpExtend.php', 'think\\admin\\extend\\HttpExtend' => __DIR__ . '/..' . '/zoujingli/think-library/src/extend/HttpExtend.php',
'think\\admin\\extend\\JsonRpcClient' => __DIR__ . '/..' . '/zoujingli/think-library/src/extend/JsonRpcClient.php', 'think\\admin\\extend\\JsonRpcClient' => __DIR__ . '/..' . '/zoujingli/think-library/src/extend/JsonRpcClient.php',
'think\\admin\\extend\\JsonRpcServer' => __DIR__ . '/..' . '/zoujingli/think-library/src/extend/JsonRpcServer.php', 'think\\admin\\extend\\JsonRpcServer' => __DIR__ . '/..' . '/zoujingli/think-library/src/extend/JsonRpcServer.php',
'think\\admin\\extend\\Parsedown' => __DIR__ . '/..' . '/zoujingli/think-library/src/extend/Parsedown.php',
'think\\admin\\helper\\DeleteHelper' => __DIR__ . '/..' . '/zoujingli/think-library/src/helper/DeleteHelper.php', 'think\\admin\\helper\\DeleteHelper' => __DIR__ . '/..' . '/zoujingli/think-library/src/helper/DeleteHelper.php',
'think\\admin\\helper\\FormHelper' => __DIR__ . '/..' . '/zoujingli/think-library/src/helper/FormHelper.php', 'think\\admin\\helper\\FormHelper' => __DIR__ . '/..' . '/zoujingli/think-library/src/helper/FormHelper.php',
'think\\admin\\helper\\PageHelper' => __DIR__ . '/..' . '/zoujingli/think-library/src/helper/PageHelper.php', 'think\\admin\\helper\\PageHelper' => __DIR__ . '/..' . '/zoujingli/think-library/src/helper/PageHelper.php',
@ -431,7 +432,6 @@ class ComposerStaticInitb911c14a0826c73d9f097343fd33a252
'think\\admin\\service\\CaptchaService' => __DIR__ . '/..' . '/zoujingli/think-library/src/service/CaptchaService.php', 'think\\admin\\service\\CaptchaService' => __DIR__ . '/..' . '/zoujingli/think-library/src/service/CaptchaService.php',
'think\\admin\\service\\ExpressService' => __DIR__ . '/..' . '/zoujingli/think-library/src/service/ExpressService.php', 'think\\admin\\service\\ExpressService' => __DIR__ . '/..' . '/zoujingli/think-library/src/service/ExpressService.php',
'think\\admin\\service\\InstallService' => __DIR__ . '/..' . '/zoujingli/think-library/src/service/InstallService.php', 'think\\admin\\service\\InstallService' => __DIR__ . '/..' . '/zoujingli/think-library/src/service/InstallService.php',
'think\\admin\\service\\MarkdownService' => __DIR__ . '/..' . '/zoujingli/think-library/src/service/MarkdownService.php',
'think\\admin\\service\\MenuService' => __DIR__ . '/..' . '/zoujingli/think-library/src/service/MenuService.php', 'think\\admin\\service\\MenuService' => __DIR__ . '/..' . '/zoujingli/think-library/src/service/MenuService.php',
'think\\admin\\service\\MessageService' => __DIR__ . '/..' . '/zoujingli/think-library/src/service/MessageService.php', 'think\\admin\\service\\MessageService' => __DIR__ . '/..' . '/zoujingli/think-library/src/service/MessageService.php',
'think\\admin\\service\\ModuleService' => __DIR__ . '/..' . '/zoujingli/think-library/src/service/ModuleService.php', 'think\\admin\\service\\ModuleService' => __DIR__ . '/..' . '/zoujingli/think-library/src/service/ModuleService.php',

View File

@ -963,12 +963,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git", "url": "https://github.com/zoujingli/ThinkLibrary.git",
"reference": "822d461c4f23e5ab3cd3489cd740a7171706e367" "reference": "747278ffb2b1a450bc8e6724ffbff105bb9f5f47"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/822d461c4f23e5ab3cd3489cd740a7171706e367", "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/747278ffb2b1a450bc8e6724ffbff105bb9f5f47",
"reference": "822d461c4f23e5ab3cd3489cd740a7171706e367", "reference": "747278ffb2b1a450bc8e6724ffbff105bb9f5f47",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
@ -985,7 +985,7 @@
"ext-mbstring": "*", "ext-mbstring": "*",
"topthink/framework": "^6.0" "topthink/framework": "^6.0"
}, },
"time": "2020-08-17T07:02:36+00:00", "time": "2020-08-17T07:32:11+00:00",
"type": "library", "type": "library",
"extra": { "extra": {
"think": { "think": {

2
vendor/services.php vendored
View File

@ -1,5 +1,5 @@
<?php <?php
// This file is automatically generated at:2020-08-17 15:04:49 // This file is automatically generated at:2020-08-17 16:07:46
declare (strict_types = 1); declare (strict_types = 1);
return array ( return array (
0 => 'think\\admin\\Library', 0 => 'think\\admin\\Library',