sth
This commit is contained in:
parent
382d410bea
commit
d7046959aa
134
application/admin/controller/Message.php
Normal file
134
application/admin/controller/Message.php
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
use think\Db;
|
||||
use think\exception\DbException;
|
||||
use think\response\Json;
|
||||
|
||||
/**
|
||||
* 消息
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class Message extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* Message模型对象
|
||||
* @var \app\admin\model\Message
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = new \app\admin\model\Message;
|
||||
$this->view->assign("typeList", $this->model->getTypeList());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
|
||||
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
|
||||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查看
|
||||
*
|
||||
* @return string|Json
|
||||
* @throws \think\Exception
|
||||
* @throws DbException
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//设置过滤方法
|
||||
$this->request->filter(['strip_tags', 'trim']);
|
||||
if (false === $this->request->isAjax()) {
|
||||
return $this->view->fetch();
|
||||
}
|
||||
//如果发送的来源是 Selectpage,则转发到 Selectpage
|
||||
if ($this->request->request('keyField')) {
|
||||
return $this->selectpage();
|
||||
}
|
||||
[$where, $sort, $order, $offset, $limit] = $this->buildparams();
|
||||
$list = $this->model
|
||||
->where($where)
|
||||
->where('type',1)
|
||||
->auth($this->auth)
|
||||
->order($sort, $order)
|
||||
->paginate($limit);
|
||||
$result = ['total' => $list->total(), 'rows' => $list->items()];
|
||||
|
||||
$update = [];
|
||||
foreach ($list as $item){
|
||||
$readUids = explode(',',$item->read_uid);
|
||||
if(!in_array($this->auth->id,$readUids)){
|
||||
$readUids[] = $this->auth->id;
|
||||
$update[] = [
|
||||
'id' => $item->id,
|
||||
'read_uid' => implode(',',$readUids)
|
||||
];
|
||||
}
|
||||
}
|
||||
if($update){
|
||||
$this->batchUpdateByIdSimple('fa_message',$update);
|
||||
}
|
||||
return json($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通用批量更新方法(自动识别主键和字段,无循环)
|
||||
*
|
||||
* @param string $table 表名
|
||||
* @param array $data 数据数组,格式如 [['id' => 1, 'field1' => 'v1'], ['id' => 2, 'field1' => 'v2']]
|
||||
* @param string $idField 主键字段名,默认 'id'
|
||||
* @return int 更新影响行数
|
||||
*/
|
||||
protected function batchUpdateByIdSimple(string $table, array $data, string $idField = 'id'): int
|
||||
{
|
||||
if (empty($data)) return 0;
|
||||
|
||||
$ids = array_column($data, $idField);
|
||||
$fields = array_keys(array_diff_key($data[0], [$idField => '']));
|
||||
|
||||
$sqlParts = [];
|
||||
foreach ($fields as $field) {
|
||||
$case = "CASE {$idField}";
|
||||
foreach ($data as $row) {
|
||||
$id = intval($row[$idField]);
|
||||
$val = addslashes($row[$field]);
|
||||
$case .= " WHEN {$id} THEN '{$val}'";
|
||||
}
|
||||
$case .= " END";
|
||||
$sqlParts[] = "{$field} = {$case}";
|
||||
}
|
||||
|
||||
$sql = sprintf(
|
||||
"UPDATE %s SET %s WHERE %s IN (%s)",
|
||||
$table,
|
||||
implode(", ", $sqlParts),
|
||||
$idField,
|
||||
implode(',', array_map('intval', $ids))
|
||||
);
|
||||
|
||||
return Db::execute($sql);
|
||||
}
|
||||
|
||||
|
||||
public function getNoreadCount()
|
||||
{
|
||||
return $this->model
|
||||
->where('type',1)
|
||||
->auth($this->auth)
|
||||
->whereRaw("FIND_IN_SET(?, read_uid) = 0 OR read_uid IS NULL OR read_uid = ''", [$this->auth->id])
|
||||
->count();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace app\admin\controller\orders;
|
||||
|
||||
use app\admin\model\Message;
|
||||
use app\admin\model\Order;
|
||||
use app\common\controller\Backend;
|
||||
use think\Db;
|
||||
|
|
@ -143,6 +144,13 @@ class Auditorder extends Backend
|
|||
$hookParams['remark'] = $params['audit_remark'];
|
||||
Hook::listen('order_change',$hookParams);
|
||||
|
||||
//未通过审核,通知派单员,重新配置
|
||||
Message::create([
|
||||
'to_id' => $row->dispatch_admin_id,
|
||||
'type' => 1,
|
||||
'title' => '订单'.$row->order_no.'财务审核未通过,请重新配置',
|
||||
'content' => '订单编号:'.$row->order_no.',审核说明:'.$params['audit_remark'].',审核人:'.$this->auth->nickname
|
||||
]);
|
||||
Db::commit();
|
||||
} catch (ValidateException|PDOException|Exception $e) {
|
||||
Db::rollback();
|
||||
|
|
|
|||
15
application/admin/lang/zh-cn/message.php
Normal file
15
application/admin/lang/zh-cn/message.php
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'To_id' => '接收人',
|
||||
'Area_id' => '接收地址',
|
||||
'Type' => '类型',
|
||||
'Type 1' => '系统消息',
|
||||
'Type 2' => '师傅消息',
|
||||
'Title' => '标题',
|
||||
'Read_uid' => '已读用户',
|
||||
'Content' => '内容',
|
||||
'Uri' => '带参相对地址',
|
||||
'Create_time' => '创建时间',
|
||||
'Update_time' => '更新时间'
|
||||
];
|
||||
86
application/admin/model/Message.php
Normal file
86
application/admin/model/Message.php
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use app\admin\library\Auth;
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Message extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'message';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'datetime';
|
||||
|
||||
protected $dateFormat = 'Y-m-d H:i:s';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'create_time';
|
||||
protected $updateTime = 'update_time';
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'type_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getTypeList()
|
||||
{
|
||||
return ['1' => __('Type 1'), '2' => __('Type 2')];
|
||||
}
|
||||
|
||||
|
||||
public function getTypeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ?: ($data['type'] ?? '');
|
||||
$list = $this->getTypeList();
|
||||
return $list[$value] ?? '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 管理员权限
|
||||
* @param $query
|
||||
* @param Auth $auth
|
||||
* @param string $auth_admin_id
|
||||
* @return mixed
|
||||
*/
|
||||
public function scopeAuth($query, Auth $auth, string $admin_id_field='to_id'){
|
||||
|
||||
if(!$auth->isSuperAdmin()){
|
||||
$query->where($admin_id_field,$auth->id);
|
||||
}
|
||||
return $query;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 地域权限
|
||||
* @param $query
|
||||
* @param Auth $auth
|
||||
* @param string $area_id_field
|
||||
* @return mixed
|
||||
*/
|
||||
public function scopeAreaauth($query,Auth $auth,string $area_id_field='area_id'){
|
||||
if(!$auth->isSuperAdmin()){
|
||||
$areaIds = array_unique(array_filter(explode(',',trim($auth->area_ids))));
|
||||
if(!in_array('*',$areaIds)){
|
||||
$query->whereIn($area_id_field,$areaIds);
|
||||
}
|
||||
}
|
||||
return $query;
|
||||
}
|
||||
|
||||
}
|
||||
27
application/admin/validate/Message.php
Normal file
27
application/admin/validate/Message.php
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class Message extends Validate
|
||||
{
|
||||
/**
|
||||
* 验证规则
|
||||
*/
|
||||
protected $rule = [
|
||||
];
|
||||
/**
|
||||
* 提示消息
|
||||
*/
|
||||
protected $message = [
|
||||
];
|
||||
/**
|
||||
* 验证场景
|
||||
*/
|
||||
protected $scene = [
|
||||
'add' => [],
|
||||
'edit' => [],
|
||||
];
|
||||
|
||||
}
|
||||
|
|
@ -25,7 +25,10 @@
|
|||
<ul class="nav navbar-nav">
|
||||
|
||||
<li class="hidden-xs">
|
||||
<a href="__PUBLIC__" target="_blank"><i class="fa fa-home" style="font-size:14px;"></i> {:__('Home')}</a>
|
||||
<!-- <a href="__PUBLIC__" target="_blank"><i class="fa fa-home" style="font-size:14px;"></i> {:__('Home')}</a>-->
|
||||
<a href="message/index" class="addtabsit my-message">
|
||||
新消息(<span class="my-message-count text-danger text-bold">0</span>)
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<!-- 清除缓存 -->
|
||||
|
|
@ -83,14 +86,23 @@
|
|||
</li>
|
||||
<li class="user-body">
|
||||
<div class="visible-xs">
|
||||
<div class="pull-left">
|
||||
<!-- <div class="pull-left">
|
||||
<a href="__PUBLIC__" target="_blank"><i class="fa fa-home" style="font-size:14px;"></i> {:__('Home')}</a>
|
||||
</div>-->
|
||||
|
||||
<div class="pull-left">
|
||||
<a href="message/index" class="addtabsit my-message">
|
||||
新消息(<span class="my-message-count text-danger text-bold">0</span>)
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="pull-right">
|
||||
<a href="javascript:;" data-type="all" class="wipecache"><i class="fa fa-trash fa-fw"></i> {:__('Wipe all cache')}</a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
<!-- Menu Footer-->
|
||||
<li class="user-footer">
|
||||
<div class="pull-left">
|
||||
|
|
|
|||
69
application/admin/view/message/add.html
Normal file
69
application/admin/view/message/add.html
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
<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">{:__('To_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-to_id" data-rule="required" data-source="to/index" class="form-control selectpage" name="row[to_id]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Area_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-area_id" data-rule="required" data-source="area/index" class="form-control selectpage" name="row[area_id]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
|
||||
{foreach name="typeList" 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">{:__('Title')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Read_uid')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<textarea id="c-read_uid" class="form-control " rows="5" name="row[read_uid]" cols="50"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Uri')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-uri" class="form-control" name="row[uri]" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-create_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:date('Y-m-d H:i:s')}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-update_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:date('Y-m-d H:i:s')}">
|
||||
</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>
|
||||
69
application/admin/view/message/edit.html
Normal file
69
application/admin/view/message/edit.html
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
<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">{:__('To_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-to_id" data-rule="required" data-source="to/index" class="form-control selectpage" name="row[to_id]" type="text" value="{$row.to_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Area_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-area_id" data-rule="required" data-source="area/index" class="form-control selectpage" name="row[area_id]" type="text" value="{$row.area_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
|
||||
{foreach name="typeList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="$row.type"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Read_uid')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<textarea id="c-read_uid" class="form-control " rows="5" name="row[read_uid]" cols="50">{$row.read_uid|htmlentities}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Uri')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-uri" class="form-control" name="row[uri]" type="text" value="{$row.uri|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-create_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{$row.create_time}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-update_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{$row.update_time}">
|
||||
</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>
|
||||
26
application/admin/view/message/index.html
Normal file
26
application/admin/view/message/index.html
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<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('message/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('message/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('message/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||
|
||||
-->
|
||||
</div>
|
||||
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||
data-operate-edit="{:$auth->check('message/edit')}"
|
||||
data-operate-del="{:$auth->check('message/del')}"
|
||||
width="100%">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -12,9 +12,9 @@ define([], function () {
|
|||
var zoom_id = $(that).data("zoom-id") ? $(that).data("zoom-id") : "";
|
||||
var lat = lat_id ? $("#" + lat_id).val() : '';
|
||||
var lng = lng_id ? $("#" + lng_id).val() : '';
|
||||
var city_code = $("#c-city").val();
|
||||
var city_code = $("#area_id").val();
|
||||
var zoom = zoom_id ? $("#" + zoom_id).val() : '';
|
||||
var url = "/addons/address/index/select?a=1";
|
||||
var url = "/addons/address/index/select?1=1";
|
||||
url += (lat && lng) ? 'lat=' + lat + '&lng=' + lng +
|
||||
(input_id ? "&address=" + $("#" + input_id).val() : "")
|
||||
+(zoom ? "&zoom=" + zoom : "") : ''
|
||||
|
|
|
|||
62
public/assets/js/backend/message.js
Normal file
62
public/assets/js/backend/message.js
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'message/index' + location.search,
|
||||
//add_url: 'message/add',
|
||||
//edit_url: 'message/edit',
|
||||
//del_url: 'message/del',
|
||||
multi_url: 'message/multi',
|
||||
import_url: 'message/import',
|
||||
table: 'message',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
fixedColumns: true,
|
||||
fixedRightNumber: 1,
|
||||
commonSearch:false,
|
||||
search:false,
|
||||
columns: [
|
||||
[
|
||||
// {checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
//{field: 'to_id', title: __('To_id')},
|
||||
//{field: 'area_id', title: __('Area_id')},
|
||||
{field: 'type', title: __('Type'), searchList: {"1":__('Type 1'),"2":__('Type 2')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'title', title: __('Title'), operate: false, table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'content', title: __('Content'), operate: false, table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
// {field: 'uri', title: __('Uri'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||
// {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||
// {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, 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;
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user