Compare commits

..

No commits in common. "ba5afc2fa37c8338261093f4b49bc1edbb4909d0" and "12c50de24bb8bc1a7d41b247a8f2646e6c276b11" have entirely different histories.

6 changed files with 907 additions and 950 deletions

File diff suppressed because it is too large Load Diff

View File

@ -53,7 +53,7 @@ class Config extends Controller
{
$this->title = '系统参数配置';
$this->super = AdminService::isSuper();
$this->version = ModuleService::getVersion();
$this->version = ModuleService::instance()->getVersion();
$this->fetch();
}

View File

@ -34,7 +34,7 @@ class Module extends Controller
public function index()
{
$this->title = '系统模块管理';
$this->modules = ModuleService::change();
$this->modules = ModuleService::instance()->change();
$this->fetch();
}
@ -45,7 +45,7 @@ class Module extends Controller
public function install()
{
$data = $this->_vali(['name.require' => '模块名称不能为空!']);
[$state, $message] = ModuleService::install($data['name']);
[$state, $message] = ModuleService::instance()->install($data['name']);
$state ? $this->success($message) : $this->error($message);
}
@ -56,8 +56,8 @@ class Module extends Controller
public function change()
{
$data = $this->_vali(['name.require' => '模块名称不能为空!']);
$online = ModuleService::online();
$locals = ModuleService::getModules();
$online = ModuleService::instance()->online();
$locals = ModuleService::instance()->getModules();
if (isset($online[$data['name']])) {
$this->module = $online[$data['name']];
$this->current = $locals[$data['name']] ?? [];

View File

@ -45,7 +45,7 @@ class Queue extends Controller
SystemQueue::mQuery()->layTable(function () {
$this->title = '系统任务管理';
$this->iswin = ProcessService::instance()->iswin();
if ($this->super = AdminService::isSuper()) {
if ($this->super = AdminService::instance()->isSuper()) {
$process = ProcessService::instance();
if ($process->iswin() || empty($_SERVER['USER'])) {
$this->command = $process->think('xadmin:queue start');

View File

@ -44,7 +44,7 @@ class Update extends Controller
public function get()
{
$filename = decode(input('encode', '0'));
if (!ModuleService::checkAllowDownload($filename)) {
if (!ModuleService::instance()->checkAllowDownload($filename)) {
$this->error('下载的文件不在认证规则中!');
}
if (file_exists($realname = $this->app->getRootPath() . $filename)) {
@ -61,7 +61,7 @@ class Update extends Controller
*/
public function node()
{
$this->success('获取文件列表成功!', ModuleService::getChanges(
$this->success('获取文件列表成功!', ModuleService::instance()->getChanges(
json_decode($this->request->post('rules', '[]', ''), true),
json_decode($this->request->post('ignore', '[]', ''), true)
));
@ -72,6 +72,6 @@ class Update extends Controller
*/
public function version()
{
$this->success('获取模块信息成功!', ModuleService::getModules());
$this->success('获取模块信息成功!', ModuleService::instance()->getModules());
}
}

View File

@ -1,78 +1,37 @@
<div class="image-dialog" id="ImageDialog">
<div class="image-dialog-head">
<div class="pull-left flex">
<input class="layui-input margin-right-5" v-model="keys" style="height:30px;line-height:30px" placeholder="请输入搜索关键词">
<a class="layui-btn layui-btn-sm layui-btn-normal" @click="search"> </a>
</div>
<div class="pull-right">
<a data-file="one" data-type="jpg,png" class="layui-btn layui-btn-sm">上传图片</a>
</div>
</div>
<div class="image-dialog-body">
<div class="image-dialog-body upload-image-mdbox flex flex-wrap flex-align-start">
<div class="image-dialog-item" v-for="x in items">
<div class="uploadimage" :style="x.style"></div>
<p class="image-dialog-item-name layui-elip" v-text="x.name"></p>
</div>
</div>
<div class="image-dialog-foot">
<div id="ImageDialogPage" class="image-dialog-page"></div>
</div>
</div>
<style>
.image-dialog-head {
clear: both;
height: 30px;
padding: 10px 12px;
padding: 10px 15px;
}
.image-dialog-body {
height: 470px;
height: 500px;
background: #efefef;
padding-top: 12px;
padding-left: 12px;
display: flex;
flex-wrap: wrap;
align-content: flex-start;
padding-top: 15px;
padding-left: 15px;
}
.image-dialog-item {
position: relative;
margin-right: 12px;
margin-bottom: 12px;
}
.image-dialog-item-name {
left: 0;
right: 0;
bottom: 0;
color: #fff;
padding: 3px 10px;
position: absolute;
text-align: center;
line-height: 1.5em;
white-space: nowrap;
background: rgba(0, 0, 0, 0.6);
margin-right: 15px;
margin-bottom: 15px;
}
.image-dialog-item .uploadimage {
margin: 0;
width: 145px;
height: 145px;
}
.image-dialog-foot {
padding: 0 12px;
}
.image-dialog-page {
height: 50px;
text-align: center;
}
.image-dialog-page .layui-laypage a,
.image-dialog-page .layui-laypage span {
margin-bottom: 0;
margin: 0
}
</style>
@ -82,37 +41,21 @@
el: '#ImageDialog',
data: {
page: 1,
keys: '',
limit: 15,
items: [],
items: []
},
created: function () {
this.loadPage();
},
methods: {
addPage: function (count) {
var that = this;
layui.laypage.render({
curr: this.page, count: count, limit: that.limit,
layout: ['count', 'prev', 'page', 'next', 'refresh'],
elem: 'ImageDialogPage', jump: function (obj, first) {
if (!first) that.loadPage(that.page = obj.curr);
},
});
},
search: function () {
this.page = 1;
this.loadPage();
},
loadPage: function () {
var that = this;
this.params = {page: this.page, limit: this.limit, output: 'layui.table', name: this.keys || ''};
this.params = {page: this.page, output: 'layui.table'};
$.form.load('{:url("image")}', this.params, 'get', function (ret) {
that.addPage(ret.count);
that.items = ret.data;
that.items = that.items.concat(ret.data);
that.items.forEach(function (item) {
item.style = 'background-image:url(' + item.xurl + ')';
});
console.log(that.items)
return false;
});
}