上传修改
This commit is contained in:
parent
813cfd5cfd
commit
ce9f0e7248
|
@ -0,0 +1,92 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Request;
|
||||
use app\common\controller\Backend;
|
||||
|
||||
/**
|
||||
* 附件管理
|
||||
*/
|
||||
class Buiattach extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* @var \app\common\model\Attachment
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
protected $searchFields = 'id,filename,url';
|
||||
protected $noNeedRight = ['classify'];
|
||||
|
||||
public function _initialize(){
|
||||
parent::_initialize();
|
||||
$request = Request::instance();
|
||||
$module_url = explode("/",$request->url());
|
||||
$this->model = model('Attachment');
|
||||
$this->view->assign("mimetypeList", \app\common\model\Attachment::getMimetypeList());
|
||||
$this->view->assign("categoryList", \app\common\model\Attachment::getCategoryList());
|
||||
$this->assignconfig("categoryList", \app\common\model\Attachment::getCategoryList());
|
||||
$module_url = isset($module_url[1]) ? $module_url[1] : $request->module();
|
||||
$this->view->assign("domain", sprintf("%s/%s", $request->domain(),$module_url));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看
|
||||
*/
|
||||
public function index(){
|
||||
//设置过滤方法
|
||||
$this->request->filter(['strip_tags', 'trim']);
|
||||
$multiple = $this->request->request('multiple',0);
|
||||
|
||||
if ($this->request->isAjax()) {
|
||||
$mimetypeQuery = [];
|
||||
$filter = $this->request->request('filter');
|
||||
$filterArr = (array)json_decode($filter, true);
|
||||
if (isset($filterArr['category']) && $filterArr['category'] == 'unclassed') {
|
||||
$filterArr['category'] = ',unclassed';
|
||||
$this->request->get(['filter' => json_encode(array_diff_key($filterArr, ['category' => '']))]);
|
||||
}
|
||||
if (isset($filterArr['mimetype']) && preg_match("/[]\,|\*]/", $filterArr['mimetype'])) {
|
||||
$mimetype = $filterArr['mimetype'];
|
||||
$filterArr = array_diff_key($filterArr, ['mimetype' => '']);
|
||||
$mimetypeQuery = function ($query) use ($mimetype) {
|
||||
$mimetypeArr = explode(',', $mimetype);
|
||||
foreach ($mimetypeArr as $index => $item) {
|
||||
if (stripos($item, "/*") !== false) {
|
||||
$query->whereOr('mimetype', 'like', str_replace("/*", "/", $item) . '%');
|
||||
} else {
|
||||
$query->whereOr('mimetype', 'like', '%' . $item . '%');
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
$this->request->get(['filter' => json_encode($filterArr)]);
|
||||
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
||||
$list = $this->model->where('mimetype', 'like','image/%')
|
||||
->where($where)
|
||||
->whereRaw("`filename` NOT REGEXP '^[0-9A-Fa-f]{32}'")
|
||||
->order($sort, $order)
|
||||
->paginate($limit);
|
||||
$cdnurl = preg_replace("/\/(\w+)\.php$/i", '', $this->request->root());
|
||||
foreach ($list as $k => &$v) {
|
||||
$v['fullurl'] = ($v['storage'] == 'local' ? $cdnurl : $this->view->config['upload']['cdnurl']) . $v['url'];
|
||||
}
|
||||
unset($v);
|
||||
$result = array("total" => $list->total(), "rows" => $list->items(),"multiple"=>$multiple);
|
||||
return json($result);
|
||||
}
|
||||
$this->view->assign("multiple",$multiple);
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分类
|
||||
*/
|
||||
public function category(){
|
||||
$getCategoryList = \app\common\model\Attachment::getCategoryList();
|
||||
unset($getCategoryList['unclassed']);
|
||||
$this->view->assign("categoryListJson", json_encode($getCategoryList,JSON_UNESCAPED_UNICODE ));
|
||||
return $this->view->fetch();
|
||||
}
|
||||
}
|
|
@ -137,13 +137,67 @@ class Index extends Backend
|
|||
return $this->selectpage();
|
||||
}
|
||||
|
||||
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
||||
list($where, $sort, $order, $offset, $limit, $page, $alias, $bind, $excludearray) = $this->buildparams(null, null, ["check_full"]);
|
||||
|
||||
if (isset($excludearray['check_full']['value']) && $excludearray['check_full']['value']) {
|
||||
$check_full = $excludearray['check_full']['value'];
|
||||
|
||||
|
||||
switch ($check_full) {
|
||||
case 'true': //查完善
|
||||
$expireWhere = [
|
||||
function ($query) {
|
||||
$query->where(function ($query){
|
||||
$query->where("shop.address_city","<>", '')
|
||||
->where("shop.province","<>", '')
|
||||
->where("shop.city","<>", '')
|
||||
->where("shop.district","<>", '')
|
||||
->where("shop.longitude","<>", '')
|
||||
->where("shop.latitude","<>", '')
|
||||
->where("shop.name","<>", '')
|
||||
->where("shop.image","<>", '')
|
||||
->where("shop.images","<>", '')
|
||||
->where("shop.content","<>", '')
|
||||
->where("shop.tel","<>", '')
|
||||
->where("shop.logo","<>", '');
|
||||
});
|
||||
}
|
||||
];
|
||||
break;
|
||||
case 'false': //查未完善
|
||||
$expireWhere = [
|
||||
function ($query) {
|
||||
$query->where(function ($query){
|
||||
$query->where("shop.address_city", '')
|
||||
->whereOr("shop.province", '')
|
||||
->whereOr("shop.city", '')
|
||||
->whereOr("shop.district", '')
|
||||
->whereOr("shop.longitude", '')
|
||||
->whereOr("shop.latitude", '')
|
||||
->whereOr("shop.name", '')
|
||||
->whereOr("shop.image", '')
|
||||
->whereOr("shop.images", '')
|
||||
->whereOr("shop.content", '')
|
||||
->whereOr("shop.tel", '')
|
||||
->whereOr("shop.logo", '');
|
||||
});
|
||||
|
||||
}
|
||||
];
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
} else {
|
||||
$expireWhere = [[]];
|
||||
}
|
||||
|
||||
|
||||
|
||||
$total = $this->model
|
||||
->with(['shop',"user"])
|
||||
->where($where)
|
||||
->where(...$expireWhere)
|
||||
->where(array('is_main'=>1))
|
||||
->order($sort, $order)
|
||||
->count();
|
||||
|
@ -151,6 +205,7 @@ class Index extends Backend
|
|||
$list = $this->model
|
||||
->with(['shop',"user"])
|
||||
->where($where)
|
||||
->where(...$expireWhere)
|
||||
->where(array('is_main'=>1))
|
||||
// ->field(['password', 'salt', 'token'], true)
|
||||
->order($sort, $order)
|
||||
|
|
|
@ -0,0 +1,77 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\controller\school;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
|
||||
/**
|
||||
* 系统事件消息配置消息项
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class MessageConfigItem extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* MessageConfigItem模型对象
|
||||
* @var \app\admin\model\school\MessageConfigItem
|
||||
*/
|
||||
protected $model = null;
|
||||
protected $qSwitch = true;
|
||||
protected $qFields = ["event","name"];
|
||||
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
$this->model = new \app\admin\model\school\MessageConfigItem;
|
||||
parent::_initialize();
|
||||
|
||||
$this->view->assign("wechatWapList", $this->model->getWechatWapList());
|
||||
$this->view->assign("messageList", $this->model->getMessageList());
|
||||
$this->view->assign("selfmailList", $this->model->getSelfmailList());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
|
||||
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
|
||||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* 查看
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//当前是否为关联查询
|
||||
$this->relationSearch = true;
|
||||
//设置过滤方法
|
||||
$this->request->filter(['strip_tags', 'trim']);
|
||||
if ($this->request->isAjax()) {
|
||||
//如果发送的来源是Selectpage,则转发到Selectpage
|
||||
if ($this->request->request('keyField')) {
|
||||
return $this->selectpage();
|
||||
}
|
||||
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
||||
|
||||
$list = $this->model
|
||||
->with(['config'])
|
||||
->where($where)
|
||||
->order($sort, $order)
|
||||
->paginate($limit);
|
||||
|
||||
foreach ($list as $row) {
|
||||
|
||||
$row->getRelation('config')->visible(['name','logo_image']);
|
||||
}
|
||||
|
||||
$result = array("total" => $list->total(), "rows" => $list->items());
|
||||
|
||||
return json($result);
|
||||
}
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
}
|
|
@ -25,6 +25,9 @@ class Cate extends Backend
|
|||
$this->model = new \app\admin\model\school\classes\Cate;
|
||||
$this->view->assign("statusList", $this->model->getStatusList());
|
||||
$this->view->assign("hotList", $this->model->getHotList());
|
||||
|
||||
|
||||
// var_dump(request()->post("category"));die;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Id' => 'ID',
|
||||
'Admin_id' => '管理员ID',
|
||||
'User_id' => '会员ID',
|
||||
'Url' => '物理路径',
|
||||
'Imagewidth' => '宽度',
|
||||
'Imageheight' => '高度',
|
||||
'Imagetype' => '图片类型',
|
||||
'Imageframes' => '图片帧数',
|
||||
'Preview' => '预览',
|
||||
'Filename' => '文件名',
|
||||
'Filesize' => '文件大小',
|
||||
'Mimetype' => 'Mime类型',
|
||||
'Image' => '图片',
|
||||
'Audio' => '音频',
|
||||
'Video' => '视频',
|
||||
'Text' => '文档',
|
||||
'Application' => '应用',
|
||||
'Zip' => '压缩包',
|
||||
'Extparam' => '透传数据',
|
||||
'Createtime' => '创建日期',
|
||||
'Uploadtime' => '上传时间',
|
||||
'Storage' => '存储引擎',
|
||||
'Category1' => '分类一',
|
||||
'Category2' => '分类二',
|
||||
'Custom' => '自定义',
|
||||
'Unclassed' => '未归类',
|
||||
'Category' => '类别',
|
||||
'Classify' => '归类',
|
||||
'Filter Type' => '类型筛选',
|
||||
'Upload to third' => '上传到第三方',
|
||||
'Upload to local' => '上传到本地',
|
||||
'Upload to third by chunk' => '上传到第三方(分片模式)',
|
||||
'Upload to local by chunk' => '上传到本地(分片模式)',
|
||||
'Please enter a new name' => '请输入新的类别名称',
|
||||
'Please select category' => '请选择一个类别',
|
||||
'Category not found' => '指定的类别未找到',
|
||||
'Upload from editor' => '从编辑器上传'
|
||||
];
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
return [
|
||||
'Name' => '事件名',
|
||||
'Event' => '事件标识',
|
||||
'Event' => '事件标识(英文+下划线)',
|
||||
'Logo_image' => '事件消息logo',
|
||||
'Status' => '事件类型',
|
||||
'Status 1' => '系统推送',
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Event' => '事件标识(英文+下划线)',
|
||||
'Event_two' => '消息标识(英文+下划线)',
|
||||
'Name' => '消息备注',
|
||||
'Wechat_wap' => '微信公众号消息',
|
||||
'Wechat_wap 1' => '开启',
|
||||
'Wechat_wap 2' => '关闭',
|
||||
'Message' => '短信消息',
|
||||
'Message 1' => '开启',
|
||||
'Message 2' => '关闭',
|
||||
'Selfmail' => '站内行消息',
|
||||
'Selfmail 1' => '开启',
|
||||
'Selfmail 2' => '关闭',
|
||||
'Message_id' => '短信模板id',
|
||||
'Wechat_wap_id' => '公众号模板消息id',
|
||||
'Selfmail_title' => '站内信标题',
|
||||
'Selfmail_template_text' => '站内信模板',
|
||||
'Configjson' => '可用的模板字段变量',
|
||||
'Thirdjson' => '额外第三方参数',
|
||||
'Weigh' => '权重',
|
||||
'Createtime' => '创建时间',
|
||||
'Updatetime' => '修改时间',
|
||||
'Deletetime' => '删除时间',
|
||||
'Config.name' => '事件名',
|
||||
'Config.logo_image' => '事件消息logo'
|
||||
];
|
|
@ -0,0 +1,91 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\model\school;
|
||||
|
||||
use think\Model;
|
||||
use traits\model\SoftDelete;
|
||||
|
||||
class MessageConfigItem extends Model
|
||||
{
|
||||
|
||||
use SoftDelete;
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'school_message_config_item';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = 'deletetime';
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'wechat_wap_text',
|
||||
'message_text',
|
||||
'selfmail_text'
|
||||
];
|
||||
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::afterInsert(function ($row) {
|
||||
if (!$row['weigh']) {
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function getWechatWapList()
|
||||
{
|
||||
return ['1' => __('Wechat_wap 1'), '2' => __('Wechat_wap 2')];
|
||||
}
|
||||
|
||||
public function getMessageList()
|
||||
{
|
||||
return ['1' => __('Message 1'), '2' => __('Message 2')];
|
||||
}
|
||||
|
||||
public function getSelfmailList()
|
||||
{
|
||||
return ['1' => __('Selfmail 1'), '2' => __('Selfmail 2')];
|
||||
}
|
||||
|
||||
|
||||
public function getWechatWapTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['wechat_wap']) ? $data['wechat_wap'] : '');
|
||||
$list = $this->getWechatWapList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getMessageTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['message']) ? $data['message'] : '');
|
||||
$list = $this->getMessageList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getSelfmailTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['selfmail']) ? $data['selfmail'] : '');
|
||||
$list = $this->getSelfmailList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function config()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\school\message\Config', 'event', 'event', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\validate\school;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class MessageConfigItem extends Validate
|
||||
{
|
||||
/**
|
||||
* 验证规则
|
||||
*/
|
||||
protected $rule = [
|
||||
];
|
||||
/**
|
||||
* 提示消息
|
||||
*/
|
||||
protected $message = [
|
||||
];
|
||||
/**
|
||||
* 验证场景
|
||||
*/
|
||||
protected $scene = [
|
||||
'add' => [],
|
||||
'edit' => [],
|
||||
];
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="box">
|
||||
<div class="panel-body">
|
||||
<form id="second-form" role="form" data-toggle="validator" method="POST" action="{:url('general.config/edit')}">
|
||||
{:token()}
|
||||
<div class="form-group row">
|
||||
<div class="col-xs-12">
|
||||
<dl class="fieldlist" data-name="row[attachmentcategory]">
|
||||
<dd><ins>分类名</ins><ins>分类值</ins></dd>
|
||||
<dd>
|
||||
<a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> 追加</a>
|
||||
</dd>
|
||||
<textarea name="row[attachmentcategory]" class="form-control hide" cols="30" rows="5">{$categoryListJson}</textarea>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="control-label col-xs-12"></label>
|
||||
<div class="col-xs-12">
|
||||
<button id="submit" type="submit" class="btn btn-success btn-embossed">{:__('OK')}</button>
|
||||
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
<style type="text/css">
|
||||
.pull-left{width:100%}
|
||||
.no-padding{padding:3px !important;}
|
||||
.col-sm-3{padding:4px;}
|
||||
.thumbnail .caption{padding:0px;}
|
||||
.category-add{margin-top:30px;}
|
||||
.pagination-detail{display:none}
|
||||
.row-flex{margin-left: 15px;margin-right:5px;margin-top:2px;}
|
||||
.fixed-table-toolbar .pull-left {margin-bottom: 0px;margin-top: 0px;}
|
||||
.mask {position: absolute;opacity: 0;top: 0;border-radius: 10px;cursor: pointer;}
|
||||
.attach_select_image{margin: 0px;height: 151px;width: 100%;margin-top: 9px;position: relative;padding-right:10px}
|
||||
@media (max-width: 804px) {.pull-right{display:none}}
|
||||
@media (max-width: 777px) {.col-xs-6{width:33.333%}}
|
||||
@media (max-width: 600px) {.col-xs-6{width:50%}}
|
||||
@media (max-width: 578px) {#addCategory{display:none}}
|
||||
@media (max-width: 500px) {.col-xs-10{padding:0px;}}
|
||||
@media (max-width: 456px) {#moveImage{display:none}}
|
||||
@media (max-width: 350px) {#delImage{display:none}}
|
||||
</style>
|
||||
<div class="panel panel-default panel-intro">
|
||||
<div class="panel-body">
|
||||
<div id="myTabContent" class="tab-content">
|
||||
<div class="tab-pane fade active in" id="one">
|
||||
<div class="widget-body no-padding col-sm-2 col-md-2 col-xs-2">
|
||||
<div class="list-group filter-type" style="margin-top:-3px;">
|
||||
<a href="javascript:;" data-value="" style="margin-bottom:15px;" class="list-group-item active">全部</a>
|
||||
{foreach name="categoryList" id="item"}
|
||||
<a href="javascript:;" style="margin-bottom:15px;" data-value="{$key}" class="list-group-item">{$item}</a>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fixed-table-toolbar col-sm-10 col-md-10 col-xs-10" >
|
||||
<div class="bs-bars pull-left toolbar" id="toolbar">
|
||||
<a href="javascript:;" class="btn btn-primary btn-refresh" style="margin-left:20px" title="刷新"><i class="fa fa-refresh"></i> </a>
|
||||
<button class="btn btn-default dropdown-toggle" type="button" id="moveImage" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">移动至 <span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" aria-labelledby="moveImage">
|
||||
{foreach name="categoryList" id="item"}
|
||||
<li><a href="javascript:;" data-value="{$key}">{$item}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
<button class="btn btn-success" id="addCategory" style="position:relative;right:0px;top:-0px;">分类管理</button>
|
||||
<button class="btn btn-danger" id="delImage" style="position:relative;right:0px;top:-0px;">删除图片</button>
|
||||
<input type="hidden" name="multiple" id="multiple" value="{$multiple}">
|
||||
<button type="button" id="faupload-images" class="btn btn-info faupload" data-multiple="true" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" style="position:relative;right:0px;top:-0px;">
|
||||
<i class="fa fa-upload"></i> 上传图片
|
||||
</button>
|
||||
|
||||
<div class="input-group pull-right" style="width:180px;margin-right:9px">
|
||||
<input class="form-control" name="filename" id="filename" type="text" placeholder="请输入文件名搜索">
|
||||
<span class="input-group-addon"><i class="glyphicon glyphicon-search" style="cursor:pointer"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="table" class="table table-striped table-bordered table-hover table-nowrap" data-search="false" data-show-toggle="false" data-show-columns="false" data-show-export="false" data-common-search="false" width="100%">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script id="itemtpl" type="text/html">
|
||||
<div class="col-lg-2 col-md-2 col-sm-3 col-xs-6" style="flex-direction:inherit">
|
||||
<div class="thumbnail" title="<%=item.filesize%><%=item.filename%>">
|
||||
<img class="picture" src="<%=item.fullurl%>" data-src="<%=item.url%>" onerror="this.src='{$domain}/ajax/icon?suffix=FAIL';this.onerror=null;" style="width:150px;height:150px;object-fit: cover;" alt="<%=item.title%>">
|
||||
<input type="checkbox" value="<%=item.id%>" name="checkbox" style="display:none">
|
||||
<div class="caption">
|
||||
<h4><%=item.filename?item.filename.substring(0,8):'无'%></h4>
|
||||
</div>
|
||||
<div class="mask" name="mask" data-id="<%=item.id%>" data-select="0">
|
||||
<img src="/assets/img/attach_select.png" class="attach_select_image">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
|
@ -183,8 +183,8 @@
|
|||
<div class="input-group">
|
||||
<input id="c-front_idcard_image" data-rule="required" class="form-control" size="50" name="shop[front_idcard_image]" type="text">
|
||||
<div class="input-group-addon no-border no-padding">
|
||||
<span><button type="button" id="faupload-front_idcard_image" class="btn btn-danger faupload" data-input-id="c-front_idcard_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-front_idcard_image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-front_idcard_image" class="btn btn-primary fachoose" data-input-id="c-front_idcard_image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||
<span><button type="button" id="faupload-front_idcard_image" class="btn btn-danger faupload" data-params='{"category":"cert"}' data-input-id="c-front_idcard_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-front_idcard_image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-front_idcard_image" class="btn btn-primary fachoose" data-params='{"category":"cert"}' data-input-id="c-front_idcard_image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||
</div>
|
||||
<span class="msg-box n-right" for="c-front_idcard_image"></span>
|
||||
</div>
|
||||
|
@ -197,8 +197,8 @@
|
|||
<div class="input-group">
|
||||
<input id="c-reverse_idcard_image" data-rule="required" class="form-control" size="50" name="shop[reverse_idcard_image]" type="text">
|
||||
<div class="input-group-addon no-border no-padding">
|
||||
<span><button type="button" id="faupload-reverse_idcard_image" class="btn btn-danger faupload" data-input-id="c-reverse_idcard_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-reverse_idcard_image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-reverse_idcard_image" class="btn btn-primary fachoose" data-input-id="c-reverse_idcard_image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||
<span><button type="button" id="faupload-reverse_idcard_image" class="btn btn-danger faupload" data-params='{"category":"cert"}' data-input-id="c-reverse_idcard_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-reverse_idcard_image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-reverse_idcard_image" class="btn btn-primary fachoose" data-params='{"category":"cert"}' data-input-id="c-reverse_idcard_image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||
</div>
|
||||
<span class="msg-box n-right" for="c-reverse_idcard_image"></span>
|
||||
</div>
|
||||
|
@ -233,8 +233,8 @@
|
|||
<div class="input-group">
|
||||
<input id="c-yyzz_images" class="form-control" size="50" name="shop[yyzz_images]" type="text" value="" placeholder="请输入{:__('Yyzz_images')}">
|
||||
<div class="input-group-addon no-border no-padding">
|
||||
<span><button type="button" id="plupload-yyzz_images" class="btn btn-danger plupload" data-input-id="c-yyzz_images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-yyzz_images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-yyzz_images" class="btn btn-primary fachoose" data-input-id="c-yyzz_images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||
<span><button type="button" id="plupload-yyzz_images" data-params='{"category":"cert"}' class="btn btn-danger plupload" data-input-id="c-yyzz_images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-yyzz_images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-yyzz_images" data-params='{"category":"cert"}' class="btn btn-primary fachoose" data-input-id="c-yyzz_images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||
</div>
|
||||
<span class="msg-box n-right" for="c-yyzz_images"></span>
|
||||
</div>
|
||||
|
|
|
@ -199,8 +199,8 @@
|
|||
<div class="input-group">
|
||||
<input id="c-front_idcard_image" data-rule="required" class="form-control" size="50" name="shop[front_idcard_image]" type="text" value="{$shop.front_idcard_image|htmlentities}">
|
||||
<div class="input-group-addon no-border no-padding">
|
||||
<span><button type="button" id="faupload-front_idcard_image" class="btn btn-danger faupload" data-input-id="c-front_idcard_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-front_idcard_image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-front_idcard_image" class="btn btn-primary fachoose" data-input-id="c-front_idcard_image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||
<span><button type="button" id="faupload-front_idcard_image" data-params='{"category":"cert"}' class="btn btn-danger faupload" data-input-id="c-front_idcard_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-front_idcard_image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-front_idcard_image" data-params='{"category":"cert"}' class="btn btn-primary fachoose" data-input-id="c-front_idcard_image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||
</div>
|
||||
<span class="msg-box n-right" for="c-front_idcard_image"></span>
|
||||
</div>
|
||||
|
@ -213,8 +213,8 @@
|
|||
<div class="input-group">
|
||||
<input id="c-reverse_idcard_image" data-rule="required" class="form-control" size="50" name="shop[reverse_idcard_image]" type="text" value="{$shop.reverse_idcard_image|htmlentities}">
|
||||
<div class="input-group-addon no-border no-padding">
|
||||
<span><button type="button" id="faupload-reverse_idcard_image" class="btn btn-danger faupload" data-input-id="c-reverse_idcard_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-reverse_idcard_image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-reverse_idcard_image" class="btn btn-primary fachoose" data-input-id="c-reverse_idcard_image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||
<span><button type="button" id="faupload-reverse_idcard_image" data-params='{"category":"cert"}' class="btn btn-danger faupload" data-input-id="c-reverse_idcard_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-reverse_idcard_image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-reverse_idcard_image" data-params='{"category":"cert"}' class="btn btn-primary fachoose" data-input-id="c-reverse_idcard_image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||
</div>
|
||||
<span class="msg-box n-right" for="c-reverse_idcard_image"></span>
|
||||
</div>
|
||||
|
@ -250,8 +250,8 @@
|
|||
<div class="input-group">
|
||||
<input id="c-yyzz_images" class="form-control" size="50" name="shop[yyzz_images]" type="text" value="{$shop.yyzz_images}" placeholder="请输入{:__('Yyzz_images')}">
|
||||
<div class="input-group-addon no-border no-padding">
|
||||
<span><button type="button" id="plupload-yyzz_images" class="btn btn-danger plupload" data-input-id="c-yyzz_images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-yyzz_images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-yyzz_images" class="btn btn-primary fachoose" data-input-id="c-yyzz_images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||
<span><button type="button" id="plupload-yyzz_images" data-params='{"category":"cert"}' class="btn btn-danger plupload" data-input-id="c-yyzz_images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-yyzz_images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-yyzz_images" data-params='{"category":"cert"}' class="btn btn-primary fachoose" data-input-id="c-yyzz_images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||
</div>
|
||||
<span class="msg-box n-right" for="c-yyzz_images"></span>
|
||||
</div>
|
||||
|
|
|
@ -38,82 +38,82 @@
|
|||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Wechat_wap')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-wechat_wap" data-rule="required" class="form-control selectpicker" name="row[wechat_wap]">
|
||||
{foreach name="wechatWapList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<!-- <div class="form-group">-->
|
||||
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Wechat_wap')}:</label>-->
|
||||
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||
<!-- -->
|
||||
<!-- <select id="c-wechat_wap" data-rule="required" class="form-control selectpicker" name="row[wechat_wap]">-->
|
||||
<!-- {foreach name="wechatWapList" item="vo"}-->
|
||||
<!-- <option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>-->
|
||||
<!-- {/foreach}-->
|
||||
<!-- </select>-->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Message')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-message" data-rule="required" class="form-control selectpicker" name="row[message]">
|
||||
{foreach name="messageList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="form-group">-->
|
||||
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Message')}:</label>-->
|
||||
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||
<!-- -->
|
||||
<!-- <select id="c-message" data-rule="required" class="form-control selectpicker" name="row[message]">-->
|
||||
<!-- {foreach name="messageList" item="vo"}-->
|
||||
<!-- <option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>-->
|
||||
<!-- {/foreach}-->
|
||||
<!-- </select>-->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Selfmail')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-selfmail" data-rule="required" class="form-control selectpicker" name="row[selfmail]">
|
||||
{foreach name="selfmailList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="form-group">-->
|
||||
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Selfmail')}:</label>-->
|
||||
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||
<!-- -->
|
||||
<!-- <select id="c-selfmail" data-rule="required" class="form-control selectpicker" name="row[selfmail]">-->
|
||||
<!-- {foreach name="selfmailList" item="vo"}-->
|
||||
<!-- <option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>-->
|
||||
<!-- {/foreach}-->
|
||||
<!-- </select>-->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Message_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-message_id" class="form-control" name="row[message_id]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Wechat_wap_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-wechat_wap_id" class="form-control" name="row[wechat_wap_id]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Selfmail_title')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-selfmail_title" class="form-control" name="row[selfmail_title]" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Selfmail_template_text')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<textarea id="c-selfmail_template_text" class="form-control " rows="5" name="row[selfmail_template_text]" cols="50"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Configjson')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<dl class="fieldlist" data-name="row[configjson]">
|
||||
<dd>
|
||||
<ins>{:__('Key')}</ins>
|
||||
<ins>{:__('Value')}</ins>
|
||||
</dd>
|
||||
<dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
|
||||
<textarea name="row[configjson]" class="form-control hide" cols="30" rows="5"></textarea>
|
||||
</dl>
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="form-group">-->
|
||||
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Message_id')}:</label>-->
|
||||
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||
<!-- <input id="c-message_id" class="form-control" name="row[message_id]" type="text" value="">-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="form-group">-->
|
||||
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Wechat_wap_id')}:</label>-->
|
||||
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||
<!-- <input id="c-wechat_wap_id" class="form-control" name="row[wechat_wap_id]" type="text" value="">-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="form-group">-->
|
||||
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Selfmail_title')}:</label>-->
|
||||
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||
<!-- <input id="c-selfmail_title" class="form-control" name="row[selfmail_title]" type="text">-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="form-group">-->
|
||||
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Selfmail_template_text')}:</label>-->
|
||||
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||
<!-- <textarea id="c-selfmail_template_text" class="form-control " rows="5" name="row[selfmail_template_text]" cols="50"></textarea>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="form-group">-->
|
||||
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Configjson')}:</label>-->
|
||||
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||
<!-- -->
|
||||
<!-- <dl class="fieldlist" data-name="row[configjson]">-->
|
||||
<!-- <dd>-->
|
||||
<!-- <ins>{:__('Key')}</ins>-->
|
||||
<!-- <ins>{:__('Value')}</ins>-->
|
||||
<!-- </dd>-->
|
||||
<!-- <dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>-->
|
||||
<!-- <textarea name="row[configjson]" class="form-control hide" cols="30" rows="5"></textarea>-->
|
||||
<!-- </dl>-->
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
|
|
@ -38,88 +38,88 @@
|
|||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Wechat_wap')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-wechat_wap" data-rule="required" class="form-control selectpicker" name="row[wechat_wap]">
|
||||
{foreach name="wechatWapList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="$row.wechat_wap"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<!-- <div class="form-group">-->
|
||||
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Wechat_wap')}:</label>-->
|
||||
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||
<!-- -->
|
||||
<!-- <select id="c-wechat_wap" data-rule="required" class="form-control selectpicker" name="row[wechat_wap]">-->
|
||||
<!-- {foreach name="wechatWapList" item="vo"}-->
|
||||
<!-- <option value="{$key}" {in name="key" value="$row.wechat_wap"}selected{/in}>{$vo}</option>-->
|
||||
<!-- {/foreach}-->
|
||||
<!-- </select>-->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Message')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-message" data-rule="required" class="form-control selectpicker" name="row[message]">
|
||||
{foreach name="messageList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="$row.message"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="form-group">-->
|
||||
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Message')}:</label>-->
|
||||
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||
<!-- -->
|
||||
<!-- <select id="c-message" data-rule="required" class="form-control selectpicker" name="row[message]">-->
|
||||
<!-- {foreach name="messageList" item="vo"}-->
|
||||
<!-- <option value="{$key}" {in name="key" value="$row.message"}selected{/in}>{$vo}</option>-->
|
||||
<!-- {/foreach}-->
|
||||
<!-- </select>-->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Selfmail')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-selfmail" data-rule="required" class="form-control selectpicker" name="row[selfmail]">
|
||||
{foreach name="selfmailList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="$row.selfmail"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="form-group">-->
|
||||
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Selfmail')}:</label>-->
|
||||
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||
<!-- -->
|
||||
<!-- <select id="c-selfmail" data-rule="required" class="form-control selectpicker" name="row[selfmail]">-->
|
||||
<!-- {foreach name="selfmailList" item="vo"}-->
|
||||
<!-- <option value="{$key}" {in name="key" value="$row.selfmail"}selected{/in}>{$vo}</option>-->
|
||||
<!-- {/foreach}-->
|
||||
<!-- </select>-->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Message_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-message_id" class="form-control" name="row[message_id]" type="text" value="{$row.message_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Wechat_wap_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-wechat_wap_id" class="form-control" name="row[wechat_wap_id]" type="text" value="{$row.wechat_wap_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Selfmail_title')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-selfmail_title" class="form-control" name="row[selfmail_title]" type="text" value="{$row.selfmail_title|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Selfmail_template_text')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<textarea id="c-selfmail_template_text" class="form-control " rows="5" name="row[selfmail_template_text]" cols="50">{$row.selfmail_template_text|htmlentities}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Configjson')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<dl class="fieldlist" data-name="row[configjson]">
|
||||
<dd>
|
||||
<ins>{:__('Key')}</ins>
|
||||
<ins>{:__('Value')}</ins>
|
||||
</dd>
|
||||
<dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
|
||||
<textarea name="row[configjson]" class="form-control hide" cols="30" rows="5">{$row.configjson|htmlentities}</textarea>
|
||||
</dl>
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="form-group">-->
|
||||
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Message_id')}:</label>-->
|
||||
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||
<!-- <input id="c-message_id" class="form-control" name="row[message_id]" type="text" value="{$row.message_id|htmlentities}">-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="form-group">-->
|
||||
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Wechat_wap_id')}:</label>-->
|
||||
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||
<!-- <input id="c-wechat_wap_id" class="form-control" name="row[wechat_wap_id]" type="text" value="{$row.wechat_wap_id|htmlentities}">-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="form-group">-->
|
||||
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Selfmail_title')}:</label>-->
|
||||
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||
<!-- <input id="c-selfmail_title" class="form-control" name="row[selfmail_title]" type="text" value="{$row.selfmail_title|htmlentities}">-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="form-group">-->
|
||||
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Selfmail_template_text')}:</label>-->
|
||||
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||
<!-- <textarea id="c-selfmail_template_text" class="form-control " rows="5" name="row[selfmail_template_text]" cols="50">{$row.selfmail_template_text|htmlentities}</textarea>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="form-group">-->
|
||||
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Configjson')}:</label>-->
|
||||
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||
<!-- -->
|
||||
<!-- <dl class="fieldlist" data-name="row[configjson]">-->
|
||||
<!-- <dd>-->
|
||||
<!-- <ins>{:__('Key')}</ins>-->
|
||||
<!-- <ins>{:__('Value')}</ins>-->
|
||||
<!-- </dd>-->
|
||||
<!-- <dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>-->
|
||||
<!-- <textarea name="row[configjson]" class="form-control hide" cols="30" rows="5">{$row.configjson|htmlentities}</textarea>-->
|
||||
<!-- </dl>-->
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-weigh" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="form-group">-->
|
||||
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>-->
|
||||
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||
<!-- <input id="c-weigh" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<div class="form-group layer-footer">
|
||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
|
|
@ -0,0 +1,127 @@
|
|||
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Event')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-event" data-rule="required" class="form-control" name="row[event]" type="text" value="{$q_event}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Event_two')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-event_two" data-rule="required" class="form-control" name="row[event_two]" type="text" value="{$q_event}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$q_name}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Wechat_wap')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-wechat_wap" data-rule="required" class="form-control selectpicker" name="row[wechat_wap]">
|
||||
{foreach name="wechatWapList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Message')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-message" data-rule="required" class="form-control selectpicker" name="row[message]">
|
||||
{foreach name="messageList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Selfmail')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-selfmail" data-rule="required" class="form-control selectpicker" name="row[selfmail]">
|
||||
{foreach name="selfmailList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Message_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-message_id" class="form-control" name="row[message_id]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Wechat_wap_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-wechat_wap_id" class="form-control" name="row[wechat_wap_id]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Selfmail_title')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-selfmail_title" class="form-control" name="row[selfmail_title]" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Selfmail_template_text')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<textarea id="c-selfmail_template_text" class="form-control " rows="5" name="row[selfmail_template_text]" cols="50"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Configjson')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<dl class="fieldlist" data-name="row[configjson]">
|
||||
<dd>
|
||||
<ins>{:__('Key')}</ins>
|
||||
<ins>{:__('Value')}</ins>
|
||||
</dd>
|
||||
<dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
|
||||
<textarea name="row[configjson]" class="form-control hide" cols="30" rows="5"></textarea>
|
||||
</dl>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Thirdjson')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<dl class="fieldlist" data-name="row[thirdjson]">
|
||||
<dd>
|
||||
<ins>{:__('Key')}</ins>
|
||||
<ins>{:__('Value')}</ins>
|
||||
</dd>
|
||||
<dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
|
||||
<textarea name="row[thirdjson]" class="form-control hide" cols="30" rows="5"></textarea>
|
||||
</dl>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-weigh" class="form-control" name="row[weigh]" type="number" value="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group layer-footer">
|
||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
|
@ -0,0 +1,127 @@
|
|||
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Event')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-event" data-rule="required" class="form-control" name="row[event]" type="text" value="{$row.event|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Event_two')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-event_two" data-rule="required" class="form-control" name="row[event_two]" type="text" value="{$row.event_two|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Wechat_wap')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-wechat_wap" data-rule="required" class="form-control selectpicker" name="row[wechat_wap]">
|
||||
{foreach name="wechatWapList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="$row.wechat_wap"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Message')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-message" data-rule="required" class="form-control selectpicker" name="row[message]">
|
||||
{foreach name="messageList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="$row.message"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Selfmail')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-selfmail" data-rule="required" class="form-control selectpicker" name="row[selfmail]">
|
||||
{foreach name="selfmailList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="$row.selfmail"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Message_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-message_id" class="form-control" name="row[message_id]" type="text" value="{$row.message_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Wechat_wap_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-wechat_wap_id" class="form-control" name="row[wechat_wap_id]" type="text" value="{$row.wechat_wap_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Selfmail_title')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-selfmail_title" class="form-control" name="row[selfmail_title]" type="text" value="{$row.selfmail_title|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Selfmail_template_text')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<textarea id="c-selfmail_template_text" class="form-control " rows="5" name="row[selfmail_template_text]" cols="50">{$row.selfmail_template_text|htmlentities}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Configjson')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<dl class="fieldlist" data-name="row[configjson]">
|
||||
<dd>
|
||||
<ins>{:__('Key')}</ins>
|
||||
<ins>{:__('Value')}</ins>
|
||||
</dd>
|
||||
<dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
|
||||
<textarea name="row[configjson]" class="form-control hide" cols="30" rows="5">{$row.configjson|htmlentities}</textarea>
|
||||
</dl>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Thirdjson')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<dl class="fieldlist" data-name="row[thirdjson]">
|
||||
<dd>
|
||||
<ins>{:__('Key')}</ins>
|
||||
<ins>{:__('Value')}</ins>
|
||||
</dd>
|
||||
<dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
|
||||
<textarea name="row[thirdjson]" class="form-control hide" cols="30" rows="5">{$row.thirdjson|htmlentities}</textarea>
|
||||
</dl>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-weigh" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group layer-footer">
|
||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
|
@ -0,0 +1,29 @@
|
|||
<div class="panel panel-default panel-intro">
|
||||
{:build_heading()}
|
||||
|
||||
<div class="panel-body">
|
||||
<div id="myTabContent" class="tab-content">
|
||||
<div class="tab-pane fade active in" id="one">
|
||||
<div class="widget-body no-padding">
|
||||
<div id="toolbar" class="toolbar">
|
||||
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
||||
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('school/message_config_item/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
||||
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('school/message_config_item/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
||||
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('school/message_config_item/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="btn btn-success btn-recyclebin btn-dialog {:$auth->check('school/message_config_item/recyclebin')?'':'hide'}" href="school/message_config_item/recyclebin" title="{:__('Recycle bin')}"><i class="fa fa-recycle"></i> {:__('Recycle bin')}</a>
|
||||
</div>
|
||||
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||
data-operate-edit="{:$auth->check('school/message_config_item/edit')}"
|
||||
data-operate-del="{:$auth->check('school/message_config_item/del')}"
|
||||
width="100%">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,25 @@
|
|||
<div class="panel panel-default panel-intro">
|
||||
{:build_heading()}
|
||||
|
||||
<div class="panel-body">
|
||||
<div id="myTabContent" class="tab-content">
|
||||
<div class="tab-pane fade active in" id="one">
|
||||
<div class="widget-body no-padding">
|
||||
<div id="toolbar" class="toolbar">
|
||||
{:build_toolbar('refresh')}
|
||||
<a class="btn btn-info btn-multi btn-disabled disabled {:$auth->check('school/message_config_item/restore')?'':'hide'}" href="javascript:;" data-url="school/message_config_item/restore" data-action="restore"><i class="fa fa-rotate-left"></i> {:__('Restore')}</a>
|
||||
<a class="btn btn-danger btn-multi btn-disabled disabled {:$auth->check('school/message_config_item/destroy')?'':'hide'}" href="javascript:;" data-url="school/message_config_item/destroy" data-action="destroy"><i class="fa fa-times"></i> {:__('Destroy')}</a>
|
||||
<a class="btn btn-success btn-restoreall {:$auth->check('school/message_config_item/restore')?'':'hide'}" href="javascript:;" data-url="school/message_config_item/restore" title="{:__('Restore all')}"><i class="fa fa-rotate-left"></i> {:__('Restore all')}</a>
|
||||
<a class="btn btn-danger btn-destroyall {:$auth->check('school/message_config_item/destroy')?'':'hide'}" href="javascript:;" data-url="school/message_config_item/destroy" title="{:__('Destroy all')}"><i class="fa fa-times"></i> {:__('Destroy all')}</a>
|
||||
</div>
|
||||
<table id="table" class="table table-striped table-bordered table-hover"
|
||||
data-operate-restore="{:$auth->check('school/message_config_item/restore')}"
|
||||
data-operate-destroy="{:$auth->check('school/message_config_item/destroy')}"
|
||||
width="100%">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -80,15 +80,19 @@ class Common extends Api
|
|||
}
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
* 用户上传文件
|
||||
* @ApiMethod (POST)
|
||||
* @ApiParams (name="file", type="File", required=true, description="文件流")
|
||||
* @ApiParams (name="category", type="string", required=true, description="分类标识:category1=非机密类1,category2=非机密类2,cert=证件机密类,code=二维码类,user=用户普通上传")
|
||||
*
|
||||
*/
|
||||
public function upload()
|
||||
{
|
||||
Config::set('default_return_type', 'json');
|
||||
//必须设定cdnurl为空,否则cdnurl函数计算错误
|
||||
Config::set('upload.cdnurl', '');
|
||||
$category = $this->request->post("category",'user');
|
||||
// var_dump($category);die;
|
||||
$chunkid = $this->request->post("chunkid");
|
||||
if ($chunkid) {
|
||||
if (!Config::get('upload.chunking')) {
|
||||
|
@ -98,6 +102,7 @@ class Common extends Api
|
|||
$chunkindex = $this->request->post("chunkindex/d");
|
||||
$chunkcount = $this->request->post("chunkcount/d");
|
||||
$filename = $this->request->post("filename");
|
||||
|
||||
$method = $this->request->method(true);
|
||||
if ($action == 'merge') {
|
||||
$attachment = null;
|
||||
|
@ -123,8 +128,10 @@ class Common extends Api
|
|||
//默认普通上传文件
|
||||
$file = $this->request->file('file');
|
||||
try {
|
||||
|
||||
$upload = new Upload($file);
|
||||
$upload->chunk($chunkid, $chunkindex, $chunkcount);
|
||||
|
||||
} catch (UploadException $e) {
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
|
@ -135,12 +142,15 @@ class Common extends Api
|
|||
//默认普通上传文件
|
||||
$file = $this->request->file('file');
|
||||
try {
|
||||
$upload = new Upload($file);
|
||||
|
||||
$upload = new Upload($file,$category);
|
||||
$attachment = $upload->upload();
|
||||
|
||||
// $attachment = $upload->upload();
|
||||
} catch (UploadException $e) {
|
||||
$this->error($e->getMessage());
|
||||
$this->error($e->getMessage().$e->getFile().$e->getLine());
|
||||
} catch (\Exception $e) {
|
||||
$this->error($e->getMessage());
|
||||
$this->error($e->getMessage().$e->getFile().$e->getLine());
|
||||
}
|
||||
|
||||
$this->success(__('Uploaded successful'), ['url' => $attachment->url, 'fullurl' => cdnurl($attachment->url, true)]);
|
||||
|
|
|
@ -11,6 +11,7 @@ class Base extends Api
|
|||
{
|
||||
|
||||
protected $classes_lib_ids = [];
|
||||
protected $shop_id = 0;
|
||||
|
||||
/**
|
||||
* 初始化操作
|
||||
|
@ -29,16 +30,16 @@ class Base extends Api
|
|||
$user = $this->auth->getUser();//登录用户
|
||||
if($user)$user_id = $user['id'];
|
||||
if(!$user_id)$this->error("请登录后再访问该接口!",['errcode'=>30002], 401);
|
||||
$shop_id = 0;
|
||||
|
||||
try{
|
||||
$shop_id = ClassesLib::checkOptionAuth(0,$user_id,"user");
|
||||
$this->shop_id = ClassesLib::checkOptionAuth(0,$user_id,"user");
|
||||
}catch (\Exception $e){
|
||||
$this->error($e->getMessage(),['errcode'=>30003]);
|
||||
}
|
||||
$this->classes_lib_ids = (new ClassesLib)->getClassesAuthIds($user_id);
|
||||
|
||||
//如果没有任何可管理的classes_lib_id 则返回错误
|
||||
if(!$this->classes_lib_ids && !$shop_id)$this->error("您没有员工权限访问该接口!",['errcode'=>30003]);
|
||||
if(!$this->classes_lib_ids && !$this->shop_id)$this->error("您没有员工权限访问该接口!",['errcode'=>30003]);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,212 @@
|
|||
<?php
|
||||
|
||||
namespace app\api\controller\school\worker;
|
||||
|
||||
use app\admin\model\school\classes\VirtualHead;
|
||||
|
||||
use app\common\exception\UploadException;
|
||||
use app\common\library\Upload;
|
||||
use app\common\library\Virtual;
|
||||
use app\common\model\Area;
|
||||
use app\common\model\school\classes\ClassesLib;
|
||||
use app\common\model\Version;
|
||||
use fast\Random;
|
||||
use think\captcha\Captcha;
|
||||
use think\Config;
|
||||
use think\Hook;
|
||||
|
||||
/**
|
||||
* 员工端公共接口
|
||||
*/
|
||||
class Common extends Base
|
||||
{
|
||||
protected $noNeedLogin = ['init'];
|
||||
protected $noNeedRight = '*';
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
|
||||
if (isset($_SERVER['HTTP_ORIGIN'])) {
|
||||
header('Access-Control-Expose-Headers: __token__');//跨域让客户端获取到
|
||||
}
|
||||
//跨域检测
|
||||
check_cors_request();
|
||||
|
||||
if (!isset($_COOKIE['PHPSESSID'])) {
|
||||
Config::set('session.id', $this->request->server("HTTP_SID"));
|
||||
}
|
||||
parent::_initialize();
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载初始化
|
||||
*
|
||||
* @ApiParams (name="version", type="string", required=true, description="版本号")
|
||||
* @ApiParams (name="lng", type="string", required=true, description="经度")
|
||||
* @ApiParams (name="lat", type="string", required=true, description="纬度")
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
if ($version = $this->request->request('version')) {
|
||||
$lng = $this->request->request('lng');
|
||||
$lat = $this->request->request('lat');
|
||||
|
||||
//配置信息
|
||||
$upload = Config::get('upload');
|
||||
//如果非服务端中转模式需要修改为中转
|
||||
if ($upload['storage'] != 'local' && isset($upload['uploadmode']) && $upload['uploadmode'] != 'server') {
|
||||
//临时修改上传模式为服务端中转
|
||||
set_addon_config($upload['storage'], ["uploadmode" => "server"], false);
|
||||
|
||||
$upload = \app\common\model\Config::upload();
|
||||
// 上传信息配置后
|
||||
Hook::listen("upload_config_init", $upload);
|
||||
|
||||
$upload = Config::set('upload', array_merge(Config::get('upload'), $upload));
|
||||
}
|
||||
|
||||
$upload['cdnurl'] = $upload['cdnurl'] ? $upload['cdnurl'] : cdnurl('', true);
|
||||
$upload['uploadurl'] = preg_match("/^((?:[a-z]+:)?\/\/)(.*)/i", $upload['uploadurl']) ? $upload['uploadurl'] : url($upload['storage'] == 'local' ? '/api/common/upload' : $upload['uploadurl'], '', false, true);
|
||||
|
||||
$content = [
|
||||
'citydata' => Area::getCityFromLngLat($lng, $lat),
|
||||
'versiondata' => Version::check($version),
|
||||
'uploaddata' => $upload,
|
||||
'coverdata' => Config::get("cover"),
|
||||
];
|
||||
$this->success('', $content);
|
||||
} else {
|
||||
$this->error(__('Invalid parameters'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 员工端上传文件
|
||||
* @ApiMethod (POST)
|
||||
* @ApiParams (name="file", type="File", required=true, description="文件流")
|
||||
* @ApiParams (name="category", type="string", required=true, description="分类标识:category1=非机密类1,category2=非机密类2,cert=证件机密类,code=二维码类,user=用户普通上传")
|
||||
*
|
||||
*/
|
||||
public function upload()
|
||||
{
|
||||
Config::set('default_return_type', 'json');
|
||||
$file = $this->request->file('file');
|
||||
$category = $this->request->post("category",'user');
|
||||
if (empty($file)) {
|
||||
$this->error(__('No file upload or server upload limit exceeded'));
|
||||
}
|
||||
|
||||
//判断是否已经存在附件
|
||||
$sha1 = $file->hash();
|
||||
$extparam = $this->request->post();
|
||||
|
||||
$upload = Config::get('upload');
|
||||
|
||||
preg_match('/(\d+)(\w+)/', $upload['maxsize'], $matches);
|
||||
$type = strtolower($matches[2]);
|
||||
$typeDict = ['b' => 0, 'k' => 1, 'kb' => 1, 'm' => 2, 'mb' => 2, 'gb' => 3, 'g' => 3];
|
||||
$size = (int)$upload['maxsize'] * pow(1024, isset($typeDict[$type]) ? $typeDict[$type] : 0);
|
||||
$fileInfo = $file->getInfo();
|
||||
$suffix = strtolower(pathinfo($fileInfo['name'], PATHINFO_EXTENSION));
|
||||
$suffix = $suffix && preg_match("/^[a-zA-Z0-9]+$/", $suffix) ? $suffix : 'file';
|
||||
$fileInfo['suffix'] = $suffix;
|
||||
|
||||
$mimetypeArr = explode(',', strtolower($upload['mimetype']));
|
||||
$typeArr = explode('/', $fileInfo['type']);
|
||||
|
||||
//禁止上传PHP和HTML文件
|
||||
if (in_array($fileInfo['type'], ['text/x-php', 'text/html']) || in_array($suffix, ['php', 'html', 'htm', 'phar', 'phtml']) || preg_match("/^php(.*)/i", $fileInfo['suffix'])) {
|
||||
$this->error(__('Uploaded file format is limited'));
|
||||
}
|
||||
|
||||
//Mimetype值不正确
|
||||
if (stripos($fileInfo['type'], '/') === false) {
|
||||
$this->error(__('Uploaded file format is limited'));
|
||||
}
|
||||
|
||||
//验证文件后缀
|
||||
if ($upload['mimetype'] !== '*' &&
|
||||
(
|
||||
!in_array($suffix, $mimetypeArr)
|
||||
|| (stripos($typeArr[0] . '/', $upload['mimetype']) !== false && (!in_array($fileInfo['type'], $mimetypeArr) && !in_array($typeArr[0] . '/*', $mimetypeArr)))
|
||||
)
|
||||
) {
|
||||
$this->error(__('Uploaded file format is limited'));
|
||||
}
|
||||
//验证是否为图片文件
|
||||
$imagewidth = $imageheight = 0;
|
||||
if (in_array($fileInfo['type'], ['image/gif', 'image/jpg', 'image/jpeg', 'image/bmp', 'image/png', 'image/webp']) || in_array($suffix, ['gif', 'jpg', 'jpeg', 'bmp', 'png', 'webp'])) {
|
||||
$imgInfo = getimagesize($fileInfo['tmp_name']);
|
||||
if (!$imgInfo || !isset($imgInfo[0]) || !isset($imgInfo[1])) {
|
||||
$this->error(__('Uploaded file is not a valid image'));
|
||||
}
|
||||
$imagewidth = isset($imgInfo[0]) ? $imgInfo[0] : $imagewidth;
|
||||
$imageheight = isset($imgInfo[1]) ? $imgInfo[1] : $imageheight;
|
||||
}
|
||||
$replaceArr = [
|
||||
'{year}' => date("Y"),
|
||||
'{mon}' => date("m"),
|
||||
'{day}' => date("d"),
|
||||
'{hour}' => date("H"),
|
||||
'{min}' => date("i"),
|
||||
'{sec}' => date("s"),
|
||||
'{random}' => Random::alnum(16),
|
||||
'{random32}' => Random::alnum(32),
|
||||
'{filename}' => $suffix ? substr($fileInfo['name'], 0, strripos($fileInfo['name'], '.')) : $fileInfo['name'],
|
||||
'{suffix}' => $suffix,
|
||||
'{.suffix}' => $suffix ? '.' . $suffix : '',
|
||||
'{filemd5}' => md5_file($fileInfo['tmp_name']),
|
||||
];
|
||||
$savekey = $upload['savekey'];
|
||||
$savekey = str_replace(array_keys($replaceArr), array_values($replaceArr), $savekey);
|
||||
|
||||
$uploadDir = substr($savekey, 0, strripos($savekey, '/') + 1);
|
||||
$fileName = substr($savekey, strripos($savekey, '/') + 1);
|
||||
//
|
||||
$splInfo = $file->validate(['size' => $size])->move(ROOT_PATH . '/public' . $uploadDir, $fileName);
|
||||
|
||||
$category = array_key_exists($category, config('site.attachmentcategory') ?? []) ? $category : 'user';
|
||||
|
||||
if ($splInfo) {
|
||||
$user_id = 0;
|
||||
$user = $this->auth->getUser();//登录用户
|
||||
if($user)$user_id = $user['id'];
|
||||
|
||||
|
||||
$params = array(
|
||||
'category' => $category,
|
||||
'shop_id' => (int)$this->shop_id,
|
||||
'user_id' => $user_id,
|
||||
'filesize' => $fileInfo['size'],
|
||||
'imagewidth' => $imagewidth,
|
||||
'imageheight' => $imageheight,
|
||||
'imagetype' => $suffix,
|
||||
'imageframes' => 0,
|
||||
'mimetype' => $fileInfo['type'],
|
||||
'url' => $uploadDir . $splInfo->getSaveName(),
|
||||
'uploadtime' => time(),
|
||||
'storage' => 'local',
|
||||
'sha1' => $sha1,
|
||||
'extparam' => json_encode($extparam),
|
||||
);
|
||||
$attachment = model("ManystoreAttachment");
|
||||
$attachment->data(array_filter($params));
|
||||
$attachment->save();
|
||||
\think\Hook::listen("upload_after", $attachment);
|
||||
// $this->success(__('Upload successful'), null, [
|
||||
// 'url' => $uploadDir . $splInfo->getSaveName()
|
||||
// ]);
|
||||
|
||||
$this->success(__('Uploaded successful'), ['url' => $attachment->url, 'fullurl' => cdnurl($attachment->url, true)]);
|
||||
|
||||
|
||||
} else {
|
||||
// 上传失败获取错误信息
|
||||
$this->error($file->getError());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -9,6 +9,7 @@ use FilesystemIterator;
|
|||
use think\Config;
|
||||
use think\File;
|
||||
use think\Hook;
|
||||
use think\Log;
|
||||
|
||||
/**
|
||||
* 文件上传类
|
||||
|
@ -29,13 +30,16 @@ class Upload
|
|||
protected $file = null;
|
||||
protected $fileInfo = null;
|
||||
|
||||
public function __construct($file = null)
|
||||
protected $category_name = "";
|
||||
|
||||
public function __construct($file = null,$category_name = '')
|
||||
{
|
||||
$this->config = Config::get('upload');
|
||||
$this->chunkDir = RUNTIME_PATH . 'chunks';
|
||||
if ($file) {
|
||||
$this->setFile($file);
|
||||
}
|
||||
$this->category_name = $category_name;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -396,13 +400,17 @@ class Upload
|
|||
}
|
||||
$this->file = $file;
|
||||
$category = request()->post('category');
|
||||
$category = array_key_exists($category, config('site.attachmentcategory') ?? []) ? $category : '';
|
||||
if($category)$this->category_name = $category;
|
||||
|
||||
// throw new UploadException("测试错误!{$category}");
|
||||
$this->category_name = array_key_exists($this->category_name, config('site.attachmentcategory') ?? []) ? $this->category_name : '';
|
||||
|
||||
$auth = Auth::instance();
|
||||
$params = array(
|
||||
'admin_id' => (int)session('admin.id'),
|
||||
'user_id' => (int)$auth->id,
|
||||
'filename' => mb_substr(htmlspecialchars(strip_tags($this->fileInfo['name'])), 0, 100),
|
||||
'category' => $category,
|
||||
'category' => $this->category_name,
|
||||
'filesize' => $this->fileInfo['size'],
|
||||
'imagewidth' => $this->fileInfo['imagewidth'],
|
||||
'imageheight' => $this->fileInfo['imageheight'],
|
||||
|
|
|
@ -120,8 +120,12 @@ class Ajax extends ManystoreBase
|
|||
$fileName = substr($savekey, strripos($savekey, '/') + 1);
|
||||
//
|
||||
$splInfo = $file->validate(['size' => $size])->move(ROOT_PATH . '/public' . $uploadDir, $fileName);
|
||||
$category = request()->post('category');
|
||||
$category = array_key_exists($category, config('site.attachmentcategory') ?? []) ? $category : '';
|
||||
|
||||
if ($splInfo) {
|
||||
$params = array(
|
||||
'category' => $category,
|
||||
'shop_id' => (int)SHOP_ID,
|
||||
'user_id' => 0,
|
||||
'filesize' => $fileInfo['size'],
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
namespace app\manystore\controller\general;
|
||||
|
||||
use app\common\controller\ManystoreBase;
|
||||
use app\common\model\ManystoreAttachment;
|
||||
|
||||
/**
|
||||
* 附件管理
|
||||
|
@ -23,6 +24,8 @@ class Attachment extends ManystoreBase
|
|||
parent::_initialize();
|
||||
$this->model = model('ManystoreAttachment');
|
||||
$this->view->assign("mimetypeList", \app\common\model\ManystoreAttachment::getMimetypeList());
|
||||
$this->view->assign("categoryList", \app\common\model\Attachment::getCategoryList());
|
||||
$this->assignconfig("categoryList", \app\common\model\Attachment::getCategoryList());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -36,6 +39,11 @@ class Attachment extends ManystoreBase
|
|||
$mimetypeQuery = [];
|
||||
$filter = $this->request->request('filter');
|
||||
$filterArr = (array)json_decode($filter, true);
|
||||
if (isset($filterArr['category']) && $filterArr['category'] == 'unclassed') {
|
||||
$filterArr['category'] = ',unclassed';
|
||||
$this->request->get(['filter' => json_encode(array_diff_key($filterArr, ['category' => '']))]);
|
||||
}
|
||||
|
||||
if (isset($filterArr['mimetype']) && preg_match("/[]\,|\*]/", $filterArr['mimetype'])) {
|
||||
$this->request->get(['filter' => json_encode(array_diff_key($filterArr, ['mimetype' => '']))]);
|
||||
$mimetypeQuery = function ($query) use ($filterArr) {
|
||||
|
@ -125,4 +133,37 @@ class Attachment extends ManystoreBase
|
|||
$this->error(__('Parameter %s can not be empty', 'ids'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 归类
|
||||
*/
|
||||
public function classify()
|
||||
{
|
||||
if (!$this->auth->check('general/attachment/edit')) {
|
||||
\think\Hook::listen('admin_nopermission', $this);
|
||||
$this->error(__('You have no permission'), '');
|
||||
}
|
||||
if (!$this->request->isPost()) {
|
||||
$this->error(__("Invalid parameters"));
|
||||
}
|
||||
$category = $this->request->post('category', '');
|
||||
$ids = $this->request->post('ids');
|
||||
if (!$ids) {
|
||||
$this->error(__('Parameter %s can not be empty', 'ids'));
|
||||
}
|
||||
$categoryList = \app\common\model\Attachment::getCategoryList();
|
||||
if ($category && !isset($categoryList[$category])) {
|
||||
$this->error(__('Category not found'));
|
||||
}
|
||||
|
||||
// if(!defined('SHOP_ID')){
|
||||
// define('SHOP_ID', $this->auth->shop_id);
|
||||
// }
|
||||
|
||||
$category = $category == 'unclassed' ? '' : $category;
|
||||
ManystoreAttachment::where('id', 'in', $ids)->update(['category' => $category]);
|
||||
$this->success();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -23,9 +23,19 @@ return [
|
|||
'Createtime' => '创建日期',
|
||||
'Uploadtime' => '上传时间',
|
||||
'Storage' => '存储引擎',
|
||||
'Category1' => '分类一',
|
||||
'Category2' => '分类二',
|
||||
'Custom' => '自定义',
|
||||
'Unclassed' => '未归类',
|
||||
'Category' => '类别',
|
||||
'Classify' => '归类',
|
||||
'Filter Type' => '类型筛选',
|
||||
'Upload to third' => '上传到第三方',
|
||||
'Upload to local' => '上传到本地',
|
||||
'Upload to third by chunk' => '上传到第三方(分片模式)',
|
||||
'Upload to local by chunk' => '上传到本地(分片模式)',
|
||||
'Please enter a new name' => '请输入新的类别名称',
|
||||
'Please select category' => '请选择一个类别',
|
||||
'Category not found' => '指定的类别未找到',
|
||||
'Upload from editor' => '从编辑器上传'
|
||||
];
|
||||
|
|
|
@ -34,8 +34,15 @@ class ManystoreLog extends Model
|
|||
$shop_id = 0;
|
||||
$store_id = 0;
|
||||
$username = __('Unknown');
|
||||
if(!defined('SHOP_ID')){
|
||||
define('SHOP_ID', 0);
|
||||
}
|
||||
if(!defined('STORE_ID')){
|
||||
define('STORE_ID',0 );
|
||||
}
|
||||
|
||||
if($auth->isLogin()){
|
||||
$shop_id = SHOP_ID;
|
||||
$shop_id = SHOP_ID ;
|
||||
$store_id = STORE_ID;
|
||||
$username = $auth->username;
|
||||
}
|
||||
|
|
|
@ -2,11 +2,20 @@
|
|||
|
||||
<div class="panel-heading">
|
||||
{:build_heading(null,FALSE)}
|
||||
<ul class="nav nav-tabs" data-field="mimetype">
|
||||
<ul class="nav nav-tabs" data-field="category">
|
||||
<li class="active"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
|
||||
{foreach name="mimetypeList" item="vo"}
|
||||
{foreach name="categoryList" item="vo"}
|
||||
<li><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
|
||||
{/foreach}
|
||||
<li class="pull-right dropdown filter-type">
|
||||
<a href="javascript:" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-filter"></i> {:__('Filter Type')}</a>
|
||||
<ul class="dropdown-menu text-left" role="menu">
|
||||
<li class="active"><a href="javascript:" data-value="">{:__('All')}</a></li>
|
||||
{foreach name="mimetypeList" id="item"}
|
||||
<li><a href="javascript:" data-value="{$key}">{$item}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
@ -16,6 +25,7 @@
|
|||
<div class="widget-body no-padding">
|
||||
<div id="toolbar" class="toolbar">
|
||||
{:build_toolbar('refresh,add,edit,del')}
|
||||
<a class="btn btn-info btn-classify dropdown-toggle btn-disabled disabled {:$auth->check('general/attachment/edit')?'':'hide'}"><i class="fa fa-arrow-right"></i> {:__('Classify')}</a>
|
||||
</div>
|
||||
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||
data-operate-edit="{:$auth->check('general/attachment/edit')}"
|
||||
|
@ -28,3 +38,17 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script id="typetpl" type="text/html">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<select name="category" class="form-control">
|
||||
<option value="">{:__('Please select category')}</option>
|
||||
{foreach name="categoryList" id="item"}
|
||||
<option value="{$key}">{$item}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
|
|
@ -1,22 +1,33 @@
|
|||
{if !$Think.get.mimetype}
|
||||
|
||||
<style>
|
||||
#one .commonsearch-table{
|
||||
padding-top:15px!important;
|
||||
}
|
||||
</style>
|
||||
{/if}
|
||||
|
||||
<div class="panel panel-default panel-intro">
|
||||
{if !$Think.get.mimetype}
|
||||
|
||||
<div class="panel-heading">
|
||||
{:build_heading(null,FALSE)}
|
||||
<ul class="nav nav-tabs" data-field="mimetype">
|
||||
<ul class="nav nav-tabs" data-field="category">
|
||||
<li class="active"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
|
||||
{foreach name="mimetypeList" item="vo"}
|
||||
{foreach name="categoryList" item="vo"}
|
||||
<li><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
|
||||
{/foreach}
|
||||
{if stripos(request()->get('mimetype'),'image/')===false}
|
||||
<li class="pull-right dropdown filter-type">
|
||||
<a href="javascript:" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-filter"></i> {:__('Filter Type')}</a>
|
||||
<ul class="dropdown-menu text-left" role="menu">
|
||||
<li class="active"><a href="javascript:" data-value="">{:__('All')}</a></li>
|
||||
{foreach name="mimetypeList" id="item"}
|
||||
<li><a href="javascript:" data-value="{$key}">{$item}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</li>
|
||||
{/if}
|
||||
</ul>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
<div class="panel-body no-padding">
|
||||
<div id="myTabContent" class="tab-content">
|
||||
|
|
|
@ -302,12 +302,12 @@
|
|||
class="form-control" size="50"
|
||||
name="shop[yyzz_images]" type="text" value="{$shop_info.yyzz_images}">
|
||||
<div class="input-group-addon no-border no-padding">
|
||||
<span><button type="button" id="plupload-yyzz_images"
|
||||
<span><button type="button" id="plupload-yyzz_images" data-params='{"category":"cert"}'
|
||||
class="btn btn-danger plupload" data-input-id="c-yyzz_images"
|
||||
data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp"
|
||||
data-multiple="true" data-preview-id="p-yyzz_images"><i
|
||||
class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-yyzz_images"
|
||||
<span><button type="button" id="fachoose-yyzz_images" data-params='{"category":"cert"}'
|
||||
class="btn btn-primary fachoose" data-input-id="c-yyzz_images"
|
||||
data-mimetype="image/*" data-multiple="true"><i
|
||||
class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||
|
@ -439,12 +439,12 @@
|
|||
<div class="input-group">
|
||||
<input id="c-front_idcard_image" class="form-control" size="50" name="shop[front_idcard_image]" type="text" value="{$shop_info.front_idcard_image}">
|
||||
<div class="input-group-addon no-border no-padding">
|
||||
<span><button type="button" id="plupload-front_idcard_image"
|
||||
<span><button type="button" id="plupload-front_idcard_image" data-params='{"category":"cert"}'
|
||||
class="btn btn-danger plupload cropper" data-input-id="c-front_idcard_image"
|
||||
data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp"
|
||||
data-multiple="false" data-preview-id="p-front_idcard_image"><i
|
||||
class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-front_idcard_image"
|
||||
<span><button type="button" id="fachoose-front_idcard_image" data-params='{"category":"cert"}'
|
||||
class="btn btn-primary fachoose"
|
||||
data-input-id="c-front_idcard_image" data-mimetype="image/*"
|
||||
data-multiple="false"><i
|
||||
|
@ -467,12 +467,12 @@
|
|||
<div class="input-group">
|
||||
<input id="c-reverse_idcard_image" class="form-control" size="50" name="shop[reverse_idcard_image]" type="text" value="{$shop_info.reverse_idcard_image}">
|
||||
<div class="input-group-addon no-border no-padding">
|
||||
<span><button type="button" id="plupload-reverse_idcard_image"
|
||||
<span><button type="button" id="plupload-reverse_idcard_image" data-params='{"category":"cert"}'
|
||||
class="btn btn-danger plupload cropper" data-input-id="c-reverse_idcard_image"
|
||||
data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp"
|
||||
data-multiple="false" data-preview-id="p-reverse_idcard_image"><i
|
||||
class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-reverse_idcard_image"
|
||||
<span><button type="button" id="fachoose-reverse_idcard_image" data-params='{"category":"cert"}'
|
||||
class="btn btn-primary fachoose"
|
||||
data-input-id="c-reverse_idcard_image" data-mimetype="image/*"
|
||||
data-multiple="false"><i
|
||||
|
|
|
@ -115,8 +115,13 @@ class Common
|
|||
'type'=>$mime_type
|
||||
];
|
||||
$file = (new File($file_path))->isTest(true)->setUploadInfo($temp);
|
||||
|
||||
$category = $_POST["category"];
|
||||
$_POST["category"] = 'code';
|
||||
$upload = new Upload($file);
|
||||
return $upload->upload();
|
||||
$res = $upload->upload();
|
||||
$_POST["category"] = $category;
|
||||
return $res;
|
||||
}
|
||||
|
||||
public $temp_url = 'uploads/qrcode';//临时,目录
|
||||
|
|
|
@ -0,0 +1,267 @@
|
|||
define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefined, Backend, Form, Table) {
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'buiattach/index',
|
||||
table: 'attachment'
|
||||
},
|
||||
});
|
||||
var table = $("#table");
|
||||
Template.helper("Moment", Moment);
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
formatshowingRows:false,
|
||||
paginationDetail:false,
|
||||
sortName: 'id',
|
||||
templateView: true,
|
||||
columns: [
|
||||
[
|
||||
{field: 'state', checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'category', title: __('Category'), operate: 'in', formatter: Table.api.formatter.label, searchList: Config.categoryList},
|
||||
{field: 'preview', title: __('Preview'), formatter: Controller.api.formatter.thumb, operate: false},
|
||||
{field: 'url', title: __('Url'), formatter: Controller.api.formatter.url, visible: false},
|
||||
{field: 'filename', title: __('Filename'), sortable: true, formatter: Controller.api.formatter.filename, operate: 'like'},
|
||||
{field: 'filesize', title: __('Filesize'), operate: 'BETWEEN', sortable: true, formatter: function (value, row, index) {
|
||||
var size = parseFloat(value);
|
||||
var i = Math.floor(Math.log(size) / Math.log(1024));
|
||||
return (size / Math.pow(1024, i)).toFixed(i < 2 ? 0 : 2) * 1 + ' ' + ['B', 'KB', 'MB', 'GB', 'TB'][i];
|
||||
}}
|
||||
]
|
||||
],
|
||||
//禁用默认搜索
|
||||
search: false,
|
||||
//启用普通表单搜索
|
||||
commonSearch: false,
|
||||
//可以控制是否默认显示搜索单表,false则隐藏,默认为false
|
||||
searchFormVisible: false,
|
||||
//分页大小
|
||||
pageSize: 12
|
||||
|
||||
});
|
||||
|
||||
//判断浏览器大小
|
||||
function screen() {
|
||||
var width = top.document.documentElement.clientWidth;
|
||||
if (width > 1200) {
|
||||
return 3; //大屏幕
|
||||
} else if (width > 992) {
|
||||
return 2; //中屏幕
|
||||
} else if (width > 768) {
|
||||
return 1; //小屏幕
|
||||
} else {
|
||||
return 0; //超小屏幕
|
||||
}
|
||||
}
|
||||
|
||||
// 绑定过滤事件
|
||||
$('.filter-type a', table.closest(".panel-intro")).on('click', function (e) {
|
||||
$(this).parent().find("a").removeClass("active");
|
||||
$(this).addClass("active");
|
||||
var value = $(this).data("value") || '';
|
||||
var query = {};
|
||||
if(value.length > 0){
|
||||
query = {
|
||||
op: JSON.stringify({"category":"IN"}),
|
||||
filter:JSON.stringify({"category":value})
|
||||
};
|
||||
}
|
||||
table.bootstrapTable('refresh',{silent:true,query:query});
|
||||
});
|
||||
|
||||
//附件归类
|
||||
$(document).on('click', '.btn-classify', function () {
|
||||
var ids = Table.api.selectedids(table);
|
||||
Layer.open({
|
||||
title: __('Classify'),
|
||||
content: Template("typetpl",{}),
|
||||
yes: function (index, layero) {
|
||||
var category = $("select[name='category']", layero).val();
|
||||
Fast.api.ajax({url: "general/attachment/classify",type: "post",
|
||||
data:{category:category,ids:ids.join(',')},
|
||||
}, function () {
|
||||
table.bootstrapTable('refresh', {});
|
||||
Layer.close(index);
|
||||
});
|
||||
},
|
||||
success: function (layero, index) {}
|
||||
});
|
||||
});
|
||||
|
||||
//图片删除事件
|
||||
$(document).on("click","#delImage",function(){
|
||||
var chk_value = [];
|
||||
var category = $(this).data("value");
|
||||
$('input[name="checkbox"]:checked').each(function(){
|
||||
chk_value.push($(this).val());
|
||||
});
|
||||
if(chk_value.length < 1){
|
||||
Toastr.error("请先选中图片在删除");
|
||||
return false;
|
||||
}
|
||||
var image_id = chk_value.join(",");
|
||||
Layer.confirm(__('Are you sure you want to delete this item?'), {icon: 3,title: '提示'}, function (index) {
|
||||
Backend.api.ajax({
|
||||
url: "general/attachment/del",
|
||||
data: {ids:image_id}
|
||||
}, function () {
|
||||
table.bootstrapTable('refresh', {});
|
||||
Layer.close(index);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
//移动至
|
||||
$(document).on("click", ".dropdown-menu li a", function () {
|
||||
var chk_value = [];
|
||||
var category = $(this).data("value");
|
||||
$('input[name="checkbox"]:checked').each(function(){
|
||||
chk_value.push($(this).val());
|
||||
});
|
||||
|
||||
if(chk_value.length < 1){
|
||||
Toastr.error("请选择需要移动至的图片");
|
||||
return false;
|
||||
}
|
||||
Fast.api.ajax({
|
||||
url: "general/attachment/classify",
|
||||
type: "post",
|
||||
data: {category: category, ids: chk_value.join(',')},
|
||||
}, function () {
|
||||
table.bootstrapTable('refresh', {});
|
||||
Layer.close(index);
|
||||
});
|
||||
});
|
||||
|
||||
//图片点击事件
|
||||
$(document).on("click", ".mask", function () {
|
||||
var multiple = $("input[name='multiple']").val() || '0';
|
||||
var select_value = $(this).data("select") || '0';
|
||||
if(multiple == "0" && select_value == "0"){
|
||||
$(".thumbnail").each(function(){
|
||||
$(this).find(".mask").css({"opacity":"0"});
|
||||
$(this).find(".mask").data("select","0");
|
||||
$(this).find("input[type='checkbox']").prop('checked',false);
|
||||
});
|
||||
}
|
||||
if(select_value == "0"){
|
||||
$(this).css({"opacity":"1"});
|
||||
$(this).data("select","1");
|
||||
$(this).parent().find("input[type='checkbox']").prop('checked',true);
|
||||
}
|
||||
if(select_value == "1"){
|
||||
$(this).css({"opacity":"0"});
|
||||
$(this).data("select","0");
|
||||
$(this).parent().find("input[type='checkbox']").prop('checked',false);
|
||||
}
|
||||
});
|
||||
|
||||
//搜索事件
|
||||
$(document).on("click",".glyphicon-search",function(){
|
||||
var filename = $("#filename").val();
|
||||
var query = {op: JSON.stringify({"filename":"LIKE"}),filter:JSON.stringify({"filename":filename})};
|
||||
table.bootstrapTable('refresh',{silent:true,query:query});
|
||||
});
|
||||
//添加分类事件
|
||||
$(document).on("click","#addCategory",function(){
|
||||
//控制窗体大小
|
||||
var area = ['50%', '70%']; //大屏幕
|
||||
//越小屏幕占用空间越大
|
||||
if(screen() == 2){
|
||||
area = ['80%', '90%'];
|
||||
}else if(screen() == 1){
|
||||
area = ['80%', '90%'];
|
||||
}else if(screen() == 0){
|
||||
area = ['80%', '90%'];
|
||||
}
|
||||
Layer.open({
|
||||
title: __('分类管理'),
|
||||
type : 2,
|
||||
content: "category",
|
||||
area: area,
|
||||
yes: function (index, layero) {},
|
||||
success: function (layero, index) {}
|
||||
});
|
||||
});
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
Controller.api.selectInit();
|
||||
require(['upload'], function (Upload) {
|
||||
Upload.api.upload($("#toolbar .faupload"), function () {
|
||||
table.bootstrapTable('refresh', {});
|
||||
});
|
||||
});
|
||||
},
|
||||
category:function(){
|
||||
$(document).on("click","#submit",function(){
|
||||
var category = $("textarea[name='row[attachmentcategory]']").val();
|
||||
var token = $("input[name='__token__").val();
|
||||
Backend.api.ajax({
|
||||
url: "general/config/edit",
|
||||
data: {'row[attachmentcategory]':category,'__token__':token}
|
||||
}, function (res) {
|
||||
Layer.close();
|
||||
window.parent.location.reload();
|
||||
});
|
||||
return false;
|
||||
});
|
||||
Form.api.bindevent($("form[role=form]"), function (data, ret) {});
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
},
|
||||
formatter: {
|
||||
thumb: function (value, row, index) {
|
||||
var html = '';
|
||||
if (row.mimetype.indexOf("image") > -1) {
|
||||
html = '<a href="' + row.fullurl + '" target="_blank"><img src="' + row.fullurl + row.thumb_style + '" alt="" style="max-height:60px;max-width:120px"></a>';
|
||||
} else {
|
||||
html = '<a href="' + row.fullurl + '" target="_blank"><img src="' + Fast.api.fixurl("ajax/icon") + "?suffix=" + row.imagetype + '" alt="" style="max-height:90px;max-width:120px"></a>';
|
||||
}
|
||||
return '<div style="width:120px;margin:0 auto;text-align:center;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;">' + html + '</div>';
|
||||
},
|
||||
url: function (value, row, index) {
|
||||
return '<a href="' + row.fullurl + '" target="_blank" class="label bg-green">' + row.url + '</a>';
|
||||
},
|
||||
filename: function (value, row, index) {
|
||||
return '<div style="width:150px;margin:0 auto;text-align:center;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;">' + Table.api.formatter.search.call(this, value, row, index) + '</div>';
|
||||
},
|
||||
mimetype: function (value, row, index) {
|
||||
return '<div style="width:80px;margin:0 auto;text-align:center;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;">' + Table.api.formatter.search.call(this, value, row, index) + '</div>';
|
||||
},
|
||||
},
|
||||
selectInit:function(){
|
||||
//追加控制
|
||||
$(document).on("click", ".btn-append,.append", function (e, row) {
|
||||
var container = $(this).closest(".fieldlist");
|
||||
var tagName = container.data("tag") || (container.is("table") ? "tr" : "dd");
|
||||
var index = container.data("index");
|
||||
var name = container.data("name");
|
||||
var template = container.data("template");
|
||||
var data = container.data();
|
||||
index = index ? parseInt(index) : 0;
|
||||
container.data("index", index + 1);
|
||||
row = row ? row : {};
|
||||
var vars = {index: index, name: name, data: data, row: row};
|
||||
var html = template ? Template(template, vars) : Template.render(Form.config.fieldlisttpl, vars);
|
||||
$(html).attr("fieldlist-item", true).insertBefore($(tagName + ":last", container));
|
||||
$(this).trigger("fa.event.appendfieldlist", $(this).closest(tagName).prev());
|
||||
});
|
||||
//移除控制
|
||||
$(document).on("click", ".btn-remove", function () {
|
||||
var container = $(this).closest(".fieldlist");
|
||||
var tagName = container.data("tag") || (container.is("table") ? "tr" : "dd");
|
||||
$(this).closest(tagName).remove();
|
||||
refresh(container.data("name"));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
return Controller;
|
||||
});
|
|
@ -5,9 +5,9 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
|
|||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'general/attachment/index',
|
||||
add_url: 'general/attachment/add',
|
||||
edit_url: 'general/attachment/edit',
|
||||
index_url: 'general/attachment/index' + location.search,
|
||||
add_url: 'general/attachment/add' + location.search,
|
||||
edit_url: 'general/attachment/edit' + location.search,
|
||||
del_url: 'general/attachment/del',
|
||||
multi_url: 'general/attachment/multi',
|
||||
table: 'attachment'
|
||||
|
@ -109,7 +109,7 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
|
|||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'general/attachment/select',
|
||||
index_url: 'general/attachment/select' + location.search,
|
||||
}
|
||||
});
|
||||
var urlArr = [];
|
||||
|
|
|
@ -28,13 +28,17 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
|
||||
{field: 'id', title: 'ID'},
|
||||
{field: 'shop.name', title: __('申请姓名|机构名'), operate: 'LIKE'},
|
||||
{field: 'check_full', title: __('是否完善展示信息'), operate:false,formatter:function (value, row, index) {
|
||||
if(row.check_full){
|
||||
return '<span style="color: green">已完善</span>';
|
||||
}else{
|
||||
return '<span style="color: red">未完善</span>';
|
||||
}
|
||||
}},
|
||||
{field: 'check_full', title: __('是否完善展示信息'),
|
||||
searchList: {"false":__('未完善'),"true":__('已完善')}, formatter: Table.api.formatter.normal
|
||||
|
||||
// formatter:function (value, row, index) {
|
||||
// if(row.check_full){
|
||||
// return '<span style="color: green">已完善</span>';
|
||||
// }else{
|
||||
// return '<span style="color: red">未完善</span>';
|
||||
// }
|
||||
// }
|
||||
},
|
||||
|
||||
{field: 'shop.logo', title: __('Logo'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
|
||||
|
|
|
@ -32,16 +32,37 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
{field: 'event', title: __('Event'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'logo_image', title: __('Logo_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
|
||||
{field: 'wechat_wap', title: __('Wechat_wap'), searchList: {"1":__('Wechat_wap 1'),"2":__('Wechat_wap 2')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'message', title: __('Message'), searchList: {"1":__('Message 1'),"2":__('Message 2')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'selfmail', title: __('Selfmail'), searchList: {"1":__('Selfmail 1'),"2":__('Selfmail 2')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'message_id', title: __('Message_id'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'wechat_wap_id', title: __('Wechat_wap_id'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'selfmail_title', title: __('Selfmail_title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
// {field: 'wechat_wap', title: __('Wechat_wap'), searchList: {"1":__('Wechat_wap 1'),"2":__('Wechat_wap 2')}, formatter: Table.api.formatter.normal},
|
||||
// {field: 'message', title: __('Message'), searchList: {"1":__('Message 1'),"2":__('Message 2')}, formatter: Table.api.formatter.normal},
|
||||
// {field: 'selfmail', title: __('Selfmail'), searchList: {"1":__('Selfmail 1'),"2":__('Selfmail 2')}, formatter: Table.api.formatter.normal},
|
||||
// {field: 'message_id', title: __('Message_id'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
// {field: 'wechat_wap_id', title: __('Wechat_wap_id'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
// {field: 'selfmail_title', title: __('Selfmail_title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'weigh', title: __('Weigh'), operate: false},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||
// {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||
|
||||
|
||||
{field: 'operate', title: __('Operate'), table: table , buttons: [
|
||||
{
|
||||
name: 'message_config_item',
|
||||
text: __('设置消息项'),
|
||||
title: __('设置消息项'),
|
||||
classname: 'btn btn-xs btn-warning btn-magic btn-dialog',
|
||||
icon: 'fa fa-list',
|
||||
url: message_config_item_url,
|
||||
callback: function (data) {
|
||||
|
||||
},
|
||||
// visible: function (row) {
|
||||
// return row.status == '2'||row.status == '3';
|
||||
// }
|
||||
},
|
||||
], events: Table.api.events.operate, formatter: Table.api.formatter.operate},
|
||||
|
||||
|
||||
|
||||
]
|
||||
]
|
||||
});
|
||||
|
@ -122,5 +143,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
var message_config_item_url = function (row,dom) {
|
||||
return 'school/message_config_item/index?event='+row.event + "&name=" + row.name;
|
||||
}
|
||||
return Controller;
|
||||
});
|
||||
|
|
|
@ -0,0 +1,127 @@
|
|||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'school/message_config_item/index' + location.search,
|
||||
add_url: 'school/message_config_item/add'+ location.search,
|
||||
edit_url: 'school/message_config_item/edit'+ location.search,
|
||||
del_url: 'school/message_config_item/del',
|
||||
multi_url: 'school/message_config_item/multi',
|
||||
import_url: 'school/message_config_item/import',
|
||||
table: 'school_message_config_item',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'weigh',
|
||||
fixedColumns: true,
|
||||
fixedRightNumber: 1,
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
// {field: 'config.name', title: __('Config.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'config.logo_image', title: __('Config.logo_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'event', title: __('Event'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'event_two', title: __('Event_two'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'wechat_wap', title: __('Wechat_wap'), searchList: {"1":__('Wechat_wap 1'),"2":__('Wechat_wap 2')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'message', title: __('Message'), searchList: {"1":__('Message 1'),"2":__('Message 2')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'selfmail', title: __('Selfmail'), searchList: {"1":__('Selfmail 1'),"2":__('Selfmail 2')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'message_id', title: __('Message_id'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'wechat_wap_id', title: __('Wechat_wap_id'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'selfmail_title', title: __('Selfmail_title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'weigh', title: __('Weigh'), operate: false},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
recyclebin: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
'dragsort_url': ''
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: 'school/message_config_item/recyclebin' + location.search,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'name', title: __('Name'), align: 'left'},
|
||||
{
|
||||
field: 'deletetime',
|
||||
title: __('Deletetime'),
|
||||
operate: 'RANGE',
|
||||
addclass: 'datetimerange',
|
||||
formatter: Table.api.formatter.datetime
|
||||
},
|
||||
{
|
||||
field: 'operate',
|
||||
width: '140px',
|
||||
title: __('Operate'),
|
||||
table: table,
|
||||
events: Table.api.events.operate,
|
||||
buttons: [
|
||||
{
|
||||
name: 'Restore',
|
||||
text: __('Restore'),
|
||||
classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
|
||||
icon: 'fa fa-rotate-left',
|
||||
url: 'school/message_config_item/restore',
|
||||
refresh: true
|
||||
},
|
||||
{
|
||||
name: 'Destroy',
|
||||
text: __('Destroy'),
|
||||
classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
|
||||
icon: 'fa fa-times',
|
||||
url: 'school/message_config_item/destroy',
|
||||
refresh: true
|
||||
}
|
||||
],
|
||||
formatter: Table.api.formatter.operate
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
edit: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
|
@ -24,6 +24,10 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
|
|||
[
|
||||
{field: 'state', checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'category', title: __('Category'), operate: 'in', formatter: Table.api.formatter.label, searchList: Config.categoryList},
|
||||
|
||||
{field: 'user_id', title: __('User_id'), visible: false, addClass: "selectpage", extend: "data-source='user/user/index' data-field='nickname'"},
|
||||
|
||||
{field: 'preview', title: __('Preview'), formatter: Controller.api.formatter.thumb, operate: false},
|
||||
{field: 'url', title: __('Url'), formatter: Controller.api.formatter.url, visible: false},
|
||||
{field: 'filename', title: __('Filename'), formatter: Controller.api.formatter.filename, operate: 'like'},
|
||||
|
@ -58,9 +62,48 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
|
|||
],
|
||||
});
|
||||
|
||||
// 绑定过滤事件
|
||||
$('.filter-type ul li a', table.closest(".panel-intro")).on('click', function (e) {
|
||||
$(this).closest("ul").find("li").removeClass("active");
|
||||
$(this).closest("li").addClass("active");
|
||||
var field = 'mimetype';
|
||||
var value = $(this).data("value") || '';
|
||||
var object = $("[name='" + field + "']", table.closest(".bootstrap-table").find(".commonsearch-table"));
|
||||
if (object.prop('tagName') == "SELECT") {
|
||||
$("option[value='" + value + "']", object).prop("selected", true);
|
||||
} else {
|
||||
object.val(value);
|
||||
}
|
||||
table.trigger("uncheckbox");
|
||||
table.bootstrapTable('refresh', {pageNumber: 1});
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
|
||||
// 附件归类
|
||||
$(document).on('click', '.btn-classify', function () {
|
||||
var ids = Table.api.selectedids(table);
|
||||
Layer.open({
|
||||
title: __('Classify'),
|
||||
content: Template("typetpl", {}),
|
||||
btn: [__('OK')],
|
||||
yes: function (index, layero) {
|
||||
var category = $("select[name='category']", layero).val();
|
||||
Fast.api.ajax({
|
||||
url: "general/attachment/classify",
|
||||
type: "post",
|
||||
data: {category: category, ids: ids.join(',')},
|
||||
}, function () {
|
||||
table.bootstrapTable('refresh', {});
|
||||
Layer.close(index);
|
||||
});
|
||||
},
|
||||
success: function (layero, index) {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
},
|
||||
select: function () {
|
||||
// 初始化表格参数配置
|
||||
|
@ -100,10 +143,15 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
|
|||
showToggle: false,
|
||||
showExport: false,
|
||||
maintainSelected: true,
|
||||
fixedColumns: true,
|
||||
fixedRightNumber: 1,
|
||||
columns: [
|
||||
[
|
||||
{field: 'state', checkbox: multiple, visible: multiple, operate: false},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'category', title: __('Category'), operate: 'in', formatter: Table.api.formatter.label, searchList: Config.categoryList},
|
||||
{field: 'user_id', title: __('User_id'), formatter: Table.api.formatter.search, visible: false},
|
||||
|
||||
{field: 'url', title: __('Preview'), formatter: Controller.api.formatter.thumb, operate: false},
|
||||
{field: 'filename', title: __('Filename'), formatter: Controller.api.formatter.filename, operate: 'like'},
|
||||
{field: 'imagewidth', title: __('Imagewidth'), operate: false},
|
||||
|
@ -128,6 +176,23 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
|
|||
]
|
||||
});
|
||||
|
||||
|
||||
// 绑定过滤事件
|
||||
$('.filter-type ul li a', table.closest(".panel-intro")).on('click', function (e) {
|
||||
$(this).closest("ul").find("li").removeClass("active");
|
||||
$(this).closest("li").addClass("active");
|
||||
var field = 'mimetype';
|
||||
var value = $(this).data("value") || '';
|
||||
var object = $("[name='" + field + "']", table.closest(".bootstrap-table").find(".commonsearch-table"));
|
||||
if (object.prop('tagName') == "SELECT") {
|
||||
$("option[value='" + value + "']", object).prop("selected", true);
|
||||
} else {
|
||||
object.val(value);
|
||||
}
|
||||
table.trigger("uncheckbox");
|
||||
table.bootstrapTable('refresh', {pageNumber: 1});
|
||||
});
|
||||
|
||||
// 选中多个
|
||||
$(document).on("click", ".btn-choose-multi", function () {
|
||||
Fast.api.close({url: urlArr.join(","), multiple: multiple});
|
||||
|
|
Loading…
Reference in New Issue