提交 0ca2660b 编写于 作者: S server

develop

上级 a39840e6
......@@ -5,5 +5,5 @@ namespace App\Constant;
class AppConstant
{
const APP = 'cms';
const VERSION = '1.1.0';
const VERSION = '1.2.0';
}
......@@ -46,11 +46,5 @@ return [
'SiteCounter' => [
'enable' => true,
],
// 'Ad' => [
// 'enable' => true,
// 'config' => [
// 'position' => '[{"k":"home","v":"首页右侧"}]',
// ]
// ],
],
];
......@@ -35,7 +35,7 @@ class MemberMessageController extends ModuleBaseController implements MemberLogi
$grid->datetime('created_at', '时间');
$grid->richHtml('content', '内容')->hookRendering(function (AbstractField $field, $item, $index) {
return "<div style='word-break:break-all;'>{$item->content}</div>";
})->listable(true);
})->listable(true)->server(modstart_web_url('member_data/ueditor'));
$grid->type('status', '状态')->type(MemberMessageStatus::class)->width(80);
$grid->repositoryFilter(function (RepositoryFilter $filter) {
$filter->where(['userId' => MemberUser::id()]);
......
ModStart基础包
---
- 增加 NotifierProvider
- 优化邮件显示框架样式
<?php
namespace Module\Vendor\Provider\Notifier;
abstract class AbstractNotifierProvider
{
abstract public function notify($biz, $title, $content, $param = []);
}
<?php
namespace Module\Vendor\Provider\Notifier;
use Illuminate\Support\Facades\Log;
class DefaultNotifierProvider extends AbstractNotifierProvider
{
public function notify($biz, $title, $content, $param = [])
{
Log::info(sprintf('DefaultNotifierProvider - %s - %s - %s', $biz, $title, $content));
}
}
<?php
namespace Module\Vendor\Provider\Notifier;
class NotifierBizWidget
{
private static $list = [];
public static function register($biz, $title)
{
self::$list[] = [
'biz' => $biz,
'title' => $title,
];
}
public static function get()
{
return self::$list;
}
}
<?php
namespace Module\Vendor\Provider\Notifier;
class NotifierProvider
{
public static function get()
{
static $instances = null;
if (null === $instances) {
$drivers = config('NotifierProviders');
if (empty($drivers)) {
$drivers = [
DefaultNotifierProvider::class
];
}
$instances = array_map(function ($driver) {
return app($driver);
}, array_unique($drivers));
}
return $instances;
}
public static function notify($biz, $title, $content, $param = [])
{
foreach (self::get() as $instance) {
$instance->notify($biz, $title, $content, $param);
}
}
}
......@@ -6,14 +6,17 @@
<style type="text/css">
*{padding:0;margin:0;font-family:"Segoe UI","Lucida Grande",Helvetica,Arial,"Microsoft YaHei",FreeSans,Arimo,"Droid Sans","wenquanyi micro hei","Hiragino Sans GB","Hiragino Sans GB W3",sans-serif;color:#666;box-sizing:border-box;}
body{font-size:13px;background:#F8F8F8;margin:20px 0;}
#wrap{margin:0 auto;max-width:800px;padding:10px;}
#head,#content,#foot,#signature{background:#FFF;}
#head{background:#3f3f3f;height:50px;padding:5px 10px;}
#head .logo{line-height:40px;color:#FFF;font-size:20px;text-decoration:none;}
#wrap{margin:0 auto;max-width:800px;padding:10px;border-radius:10px;}
#head,#content,#foot{background:#FFF;border-radius:5px;}
#head{background:#EEE;height:50px;padding:5px 10px;}
#head .logo{line-height:40px;color:#333;font-size:20px;text-decoration:none;}
#content{padding:30px 10px;}
#content p{line-height:2em;}
#signature{padding:10px;color:#999;}
#foot{text-align:center;line-height:50px;border-top:1px solid #EEE;color:#999;}
.ub-email-table {border-collapse: collapse;width:100%;border-radius:5px;}
.ub-email-table td{border: 1px solid #ddd;padding:5px;border-radius:5px;}
.ub-email-table tr:nth-child(even){background-color: #f2f2f2;}
</style>
</head>
<body>
......
......@@ -3,9 +3,9 @@
<img src="{{modstart_web_url('captcha/image')}}?{{time()}}"
data-captcha
onclick="this.src='{{modstart_web_url('captcha/image')}}?'+Math.random();"
style="height:2rem;border:1px solid #DDD;border-radius:3px;width:100%;" />
style="height:2rem;border:1px solid #DDD;border-radius:3px;width:100%;cursor:pointer;" />
</div>
<div class="col-md-6">
<input type="text" name="captcha" placeholder="图片验证" />
<input type="text" class="form-lg" name="captcha" placeholder="图片验证" />
</div>
</div>
{
"name": "Vendor",
"title": "通用功能包",
"version": "1.1.0",
"version": "1.2.0",
"author": "官方",
"description": "提供基础功能",
"config": []
......
此差异已折叠。
......@@ -31,8 +31,9 @@ const MS = {
dialog:Dialog,
util:Util,
api:{
defaultCallback: Base.defaultFormCallback,
post:Base.post
}
},
}
window.api = window.api || {}
......
......@@ -180,3 +180,7 @@ var UploadButton = function (selector, option) {
};
window.api.uploadButton = UploadButton
MS.uploadButton = {
}
......@@ -32,6 +32,7 @@ class DataController extends Controller
case 'init':
case 'upload':
case 'save':
case 'saveRaw':
case 'uploadAndSaveBase64':
case 'uploadDirect':
case 'uploadDirectRaw':
......
......@@ -51,6 +51,7 @@ class FileManager
case 'init':
case 'upload':
case 'save':
case 'saveRaw':
case 'fileEdit':
case 'fileDelete':
case 'uploadAndSaveBase64':
......@@ -189,7 +190,26 @@ class FileManager
if ($retSaveUser['code']) {
return Response::jsonError($ret['msg']);
}
return Response::jsonSuccessData(ArrayUtil::keepKeys($data, ['path', 'category', 'size', 'filename']));
return Response::jsonSuccessData([
'data' => ArrayUtil::keepKeys($data, ['path', 'category', 'size', 'filename']),
'fullPath' => $ret['data']['fullPath'],
]);
}
private static function saveRawExecute(InputPackage $input, $category, $uploadTable, $uploadCategoryTable, $userId, $option)
{
$path = $input->getTrimString('path');
$categoryId = max($input->getInteger('categoryId'), 0);
BizException::throwsIfEmpty('path empty', $path);
$ret = DataManager::storeTempDataByPath($path, $option);
if ($ret['code']) {
return Response::jsonError($ret['msg']);
}
$data = $ret['data']['data'];
return Response::jsonSuccessData([
'data' => ArrayUtil::keepKeys($data, ['path', 'category', 'size', 'filename']),
'fullPath' => $ret['data']['fullPath'],
]);
}
private static function uploadExecute(InputPackage $input, $category, $uploadTable, $uploadCategoryTable, $userId, $option)
......
......@@ -10,4 +10,17 @@ class RichHtml extends AbstractField
protected static $js = [
'asset/common/editor.js',
];
}
\ No newline at end of file
protected function setup()
{
$this->addVariables([
'server' => modstart_admin_url('data/ueditor'),
]);
}
public function server($server)
{
$this->addVariables(['server' => $server]);
return $this;
}
}
......@@ -10,7 +10,7 @@ use ModStart\Support\Manager\WidgetManager;
class ModStart
{
public static $version = '1.1.0';
public static $version = '1.2.0';
public static $script = [];
public static $style = [];
......
......@@ -48,14 +48,24 @@
window.api.uploadButton('#{{$id}}Uploader', {
text: '<a href="javascript:;" class="btn" style="display:inline-block;vertical-align:bottom;"><i class="iconfont icon-upload"></i> {{L("Local Upload")}}</a>',
swf: "@asset('asset/vendor/webuploader/Uploader.swf')",
server: "{{$server}}?action={{$mode=='raw'?'uploadDirectRaw':'uploadDirect'}}",
server: "{{$server}}",
extensions: window.__dataConfig.category.file.extensions.join(','),
sizeLimit: window.__dataConfig.category.file.maxSize,
chunkSize: window.__dataConfig.chunkSize,
showFileQueue: true,
fileNumLimit: 1,
callback: function (file, me) {
setValue(file.fullPath);
MS.api.post("{{$server}}", {
action: "{{$mode=='raw'?'saveRaw':'save'}}",
path: file.path,
name: file.name,
size: file.size,
categoryId: 0
}, function(res){
MS.api.defaultCallback(res,{success:function(res){
setValue(res.data.fullPath);
}});
});
},
finish: function () {
}
......
......@@ -56,14 +56,24 @@
window.api.uploadButton('#{{$id}}Uploader', {
text: '<a href="javascript:;" class="btn" style="display:inline-block;vertical-align:bottom;"><i class="iconfont icon-upload"></i> {{L("Local Upload")}}</a>',
swf: "@asset('asset/vendor/webuploader/Uploader.swf')",
server: "{{$server}}?action={{$mode=='raw'?'uploadDirectRaw':'uploadDirect'}}",
server: "{{$server}}",
extensions: window.__dataConfig.category.image.extensions.join(','),
sizeLimit: window.__dataConfig.category.image.maxSize,
chunkSize: window.__dataConfig.chunkSize,
showFileQueue: true,
fileNumLimit: 1,
callback: function (file, me) {
setValue(file.fullPath);
MS.api.post("{{$server}}", {
action: "{{$mode=='raw'?'saveRaw':'save'}}",
path: file.path,
name: file.name,
size: file.size,
categoryId: 0
}, function(res){
MS.api.defaultCallback(res,{success:function(res){
setValue(res.data.fullPath);
}});
});
},
finish: function () {
}
......
......@@ -15,10 +15,10 @@
<script>
$(function () {
window.api.editor.basic('{{$name}}', {
server: "{{modstart_admin_url('data/ueditor')}}",
server: "{{$server}}",
ready: function () {
// console.log('ready');
}
}, {topOffset: 0});
});
</script>
\ No newline at end of file
</script>
......@@ -55,7 +55,17 @@
showFileQueue: true,
fileNumLimit: 1,
callback: function (file, me) {
setValue(file.fullPath);
MS.api.post("{{$server}}", {
action: "{{$mode=='raw'?'saveRaw':'save'}}",
path: file.path,
name: file.name,
size: file.size,
categoryId: 0
}, function(res){
MS.api.defaultCallback(res,{success:function(res){
setValue(res.data.fullPath);
}});
});
},
finish: function () {
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册