正在显示
17 个修改的文件
包含
497 行增加
和
12 行删除
@@ -4,16 +4,7 @@ | @@ -4,16 +4,7 @@ | ||
4 | <bookmark url="file://$PROJECT_DIR$/application/admin/view/video/add.html" line="25" /> | 4 | <bookmark url="file://$PROJECT_DIR$/application/admin/view/video/add.html" line="25" /> |
5 | </component> | 5 | </component> |
6 | <component name="ChangeListManager"> | 6 | <component name="ChangeListManager"> |
7 | - <list default="true" id="e93f11c2-a7d9-4d35-8b1c-8dd18e7f5fef" name="Default" comment=""> | ||
8 | - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" /> | ||
9 | - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/application/admin/controller/Video.php" afterPath="$PROJECT_DIR$/application/admin/controller/Video.php" /> | ||
10 | - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/application/admin/lang/zh-cn/video.php" afterPath="$PROJECT_DIR$/application/admin/lang/zh-cn/video.php" /> | ||
11 | - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/application/admin/model/Video.php" afterPath="$PROJECT_DIR$/application/admin/model/Video.php" /> | ||
12 | - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/application/admin/view/video/add.html" afterPath="$PROJECT_DIR$/application/admin/view/video/add.html" /> | ||
13 | - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/application/admin/view/video/edit.html" afterPath="$PROJECT_DIR$/application/admin/view/video/edit.html" /> | ||
14 | - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/application/api/controller/User.php" afterPath="$PROJECT_DIR$/application/api/controller/User.php" /> | ||
15 | - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/public/assets/js/backend/video.js" afterPath="$PROJECT_DIR$/public/assets/js/backend/video.js" /> | ||
16 | - </list> | 7 | + <list default="true" id="e93f11c2-a7d9-4d35-8b1c-8dd18e7f5fef" name="Default" comment="" /> |
17 | <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> | 8 | <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> |
18 | <option name="TRACKING_ENABLED" value="true" /> | 9 | <option name="TRACKING_ENABLED" value="true" /> |
19 | <option name="SHOW_DIALOG" value="false" /> | 10 | <option name="SHOW_DIALOG" value="false" /> |
@@ -344,7 +335,7 @@ | @@ -344,7 +335,7 @@ | ||
344 | <workItem from="1578886287019" duration="125000" /> | 335 | <workItem from="1578886287019" duration="125000" /> |
345 | <workItem from="1578887472055" duration="2928000" /> | 336 | <workItem from="1578887472055" duration="2928000" /> |
346 | <workItem from="1583368540533" duration="14325000" /> | 337 | <workItem from="1583368540533" duration="14325000" /> |
347 | - <workItem from="1583392420452" duration="3591000" /> | 338 | + <workItem from="1583392420452" duration="3816000" /> |
348 | </task> | 339 | </task> |
349 | <task id="LOCAL-00001" summary="调试"> | 340 | <task id="LOCAL-00001" summary="调试"> |
350 | <created>1574145133364</created> | 341 | <created>1574145133364</created> |
@@ -371,7 +362,7 @@ | @@ -371,7 +362,7 @@ | ||
371 | <servers /> | 362 | <servers /> |
372 | </component> | 363 | </component> |
373 | <component name="TimeTrackingManager"> | 364 | <component name="TimeTrackingManager"> |
374 | - <option name="totallyTimeSpent" value="477314000" /> | 365 | + <option name="totallyTimeSpent" value="477539000" /> |
375 | </component> | 366 | </component> |
376 | <component name="TodoView"> | 367 | <component name="TodoView"> |
377 | <todo-panel id="selected-file"> | 368 | <todo-panel id="selected-file"> |
application/admin/controller/Cover.php
0 → 100644
1 | +<?php | ||
2 | + | ||
3 | +namespace app\admin\controller; | ||
4 | + | ||
5 | +use app\common\controller\Backend; | ||
6 | + | ||
7 | +/** | ||
8 | + * 全屏封面视频 | ||
9 | + * | ||
10 | + * @icon fa fa-circle-o | ||
11 | + */ | ||
12 | +class Cover extends Backend | ||
13 | +{ | ||
14 | + | ||
15 | + /** | ||
16 | + * Cover模型对象 | ||
17 | + * @var \app\admin\model\Cover | ||
18 | + */ | ||
19 | + protected $model = null; | ||
20 | + | ||
21 | + public function _initialize() | ||
22 | + { | ||
23 | + parent::_initialize(); | ||
24 | + $this->model = new \app\admin\model\Cover; | ||
25 | + | ||
26 | + } | ||
27 | + | ||
28 | + /** | ||
29 | + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 | ||
30 | + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 | ||
31 | + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 | ||
32 | + */ | ||
33 | + | ||
34 | + | ||
35 | +} |
application/admin/controller/Words.php
0 → 100644
1 | +<?php | ||
2 | + | ||
3 | +namespace app\admin\controller; | ||
4 | + | ||
5 | +use app\common\controller\Backend; | ||
6 | + | ||
7 | +/** | ||
8 | + * 全部关键字管理 | ||
9 | + * | ||
10 | + * @icon fa fa-circle-o | ||
11 | + */ | ||
12 | +class Words extends Backend | ||
13 | +{ | ||
14 | + | ||
15 | + /** | ||
16 | + * Words模型对象 | ||
17 | + * @var \app\admin\model\Words | ||
18 | + */ | ||
19 | + protected $model = null; | ||
20 | + | ||
21 | + public function _initialize() | ||
22 | + { | ||
23 | + parent::_initialize(); | ||
24 | + $this->model = new \app\admin\model\Words; | ||
25 | + | ||
26 | + } | ||
27 | + | ||
28 | + /** | ||
29 | + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 | ||
30 | + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 | ||
31 | + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 | ||
32 | + */ | ||
33 | + | ||
34 | + | ||
35 | +} |
application/admin/lang/zh-cn/cover.php
0 → 100644
application/admin/lang/zh-cn/words.php
0 → 100644
application/admin/model/Cover.php
0 → 100644
1 | +<?php | ||
2 | + | ||
3 | +namespace app\admin\model; | ||
4 | + | ||
5 | +use think\Model; | ||
6 | + | ||
7 | + | ||
8 | +class Cover extends Model | ||
9 | +{ | ||
10 | + | ||
11 | + | ||
12 | + | ||
13 | + | ||
14 | + | ||
15 | + // 表名 | ||
16 | + protected $name = 'cover'; | ||
17 | + | ||
18 | + // 自动写入时间戳字段 | ||
19 | + protected $autoWriteTimestamp = 'int'; | ||
20 | + | ||
21 | + // 定义时间戳字段名 | ||
22 | + protected $createTime = 'createtime'; | ||
23 | + protected $updateTime = 'updatetime'; | ||
24 | + protected $deleteTime = false; | ||
25 | + | ||
26 | + // 追加属性 | ||
27 | + protected $append = [ | ||
28 | + | ||
29 | + ]; | ||
30 | + | ||
31 | + | ||
32 | + | ||
33 | + | ||
34 | + | ||
35 | + | ||
36 | + | ||
37 | + | ||
38 | + | ||
39 | + | ||
40 | +} |
application/admin/model/Words.php
0 → 100644
1 | +<?php | ||
2 | + | ||
3 | +namespace app\admin\model; | ||
4 | + | ||
5 | +use think\Model; | ||
6 | + | ||
7 | + | ||
8 | +class Words extends Model | ||
9 | +{ | ||
10 | + | ||
11 | + | ||
12 | + | ||
13 | + | ||
14 | + | ||
15 | + // 表名 | ||
16 | + protected $name = 'words'; | ||
17 | + | ||
18 | + // 自动写入时间戳字段 | ||
19 | + protected $autoWriteTimestamp = 'int'; | ||
20 | + | ||
21 | + // 定义时间戳字段名 | ||
22 | + protected $createTime = 'createtime'; | ||
23 | + protected $updateTime = 'updatetime'; | ||
24 | + protected $deleteTime = false; | ||
25 | + | ||
26 | + // 追加属性 | ||
27 | + protected $append = [ | ||
28 | + | ||
29 | + ]; | ||
30 | + | ||
31 | + | ||
32 | + | ||
33 | + | ||
34 | + | ||
35 | + | ||
36 | + | ||
37 | + | ||
38 | + | ||
39 | + | ||
40 | +} |
application/admin/validate/Cover.php
0 → 100644
1 | +<?php | ||
2 | + | ||
3 | +namespace app\admin\validate; | ||
4 | + | ||
5 | +use think\Validate; | ||
6 | + | ||
7 | +class Cover extends Validate | ||
8 | +{ | ||
9 | + /** | ||
10 | + * 验证规则 | ||
11 | + */ | ||
12 | + protected $rule = [ | ||
13 | + ]; | ||
14 | + /** | ||
15 | + * 提示消息 | ||
16 | + */ | ||
17 | + protected $message = [ | ||
18 | + ]; | ||
19 | + /** | ||
20 | + * 验证场景 | ||
21 | + */ | ||
22 | + protected $scene = [ | ||
23 | + 'add' => [], | ||
24 | + 'edit' => [], | ||
25 | + ]; | ||
26 | + | ||
27 | +} |
application/admin/validate/Words.php
0 → 100644
1 | +<?php | ||
2 | + | ||
3 | +namespace app\admin\validate; | ||
4 | + | ||
5 | +use think\Validate; | ||
6 | + | ||
7 | +class Words extends Validate | ||
8 | +{ | ||
9 | + /** | ||
10 | + * 验证规则 | ||
11 | + */ | ||
12 | + protected $rule = [ | ||
13 | + ]; | ||
14 | + /** | ||
15 | + * 提示消息 | ||
16 | + */ | ||
17 | + protected $message = [ | ||
18 | + ]; | ||
19 | + /** | ||
20 | + * 验证场景 | ||
21 | + */ | ||
22 | + protected $scene = [ | ||
23 | + 'add' => [], | ||
24 | + 'edit' => [], | ||
25 | + ]; | ||
26 | + | ||
27 | +} |
application/admin/view/cover/add.html
0 → 100644
1 | +<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action=""> | ||
2 | + | ||
3 | + <div class="form-group"> | ||
4 | + <label class="control-label col-xs-12 col-sm-2">{:__('Thumbnail')}:</label> | ||
5 | + <div class="col-xs-12 col-sm-8"> | ||
6 | + <div class="input-group"> | ||
7 | + <input id="c-thumbnail" data-rule="required" class="form-control" size="35" name="row[thumbnail]" type="text" placeholder="请上传封面视频或GIF"> | ||
8 | + <div class="input-group-addon no-border no-padding"> | ||
9 | + <span><button type="button" id="plupload-thumbnail" class="btn btn-danger plupload" data-input-id="c-thumbnail" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-thumbnail"><i class="fa fa-upload"></i> {:__('Upload')}</button></span> | ||
10 | + <span><button type="button" id="fachoose-thumbnail" class="btn btn-primary fachoose" data-input-id="c-thumbnail" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span> | ||
11 | + </div> | ||
12 | + <span class="msg-box n-right"></span> | ||
13 | + </div> | ||
14 | + <ul class="row list-inline plupload-preview" id="p-thumbnail"></ul> | ||
15 | + </div> | ||
16 | + </div> | ||
17 | + <div class="form-group layer-footer"> | ||
18 | + <label class="control-label col-xs-12 col-sm-2"></label> | ||
19 | + <div class="col-xs-12 col-sm-8"> | ||
20 | + <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button> | ||
21 | + <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button> | ||
22 | + </div> | ||
23 | + </div> | ||
24 | +</form> |
application/admin/view/cover/edit.html
0 → 100644
1 | +<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action=""> | ||
2 | + | ||
3 | + <div class="form-group"> | ||
4 | + <label class="control-label col-xs-12 col-sm-2">{:__('Thumbnail')}:</label> | ||
5 | + <div class="col-xs-12 col-sm-8"> | ||
6 | + <div class="input-group"> | ||
7 | + <input id="c-thumbnail" data-rule="required" class="form-control" size="35" name="row[thumbnail]" type="text" value="{$row.thumbnail}" placeholder="请上传封面视频或GIF"> | ||
8 | + <div class="input-group-addon no-border no-padding"> | ||
9 | + <span><button type="button" id="plupload-thumbnail" class="btn btn-danger plupload" data-input-id="c-thumbnail" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-thumbnail"><i class="fa fa-upload"></i> {:__('Upload')}</button></span> | ||
10 | + <span><button type="button" id="fachoose-thumbnail" class="btn btn-primary fachoose" data-input-id="c-thumbnail" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span> | ||
11 | + </div> | ||
12 | + <span class="msg-box n-right"></span> | ||
13 | + </div> | ||
14 | + <ul class="row list-inline plupload-preview" id="p-thumbnail"></ul> | ||
15 | + </div> | ||
16 | + </div> | ||
17 | + <div class="form-group layer-footer"> | ||
18 | + <label class="control-label col-xs-12 col-sm-2"></label> | ||
19 | + <div class="col-xs-12 col-sm-8"> | ||
20 | + <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button> | ||
21 | + <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button> | ||
22 | + </div> | ||
23 | + </div> | ||
24 | +</form> |
application/admin/view/cover/index.html
0 → 100644
1 | +<div class="panel panel-default panel-intro"> | ||
2 | + {:build_heading()} | ||
3 | + | ||
4 | + <div class="panel-body"> | ||
5 | + <div id="myTabContent" class="tab-content"> | ||
6 | + <div class="tab-pane fade active in" id="one"> | ||
7 | + <div class="widget-body no-padding"> | ||
8 | + <div id="toolbar" class="toolbar"> | ||
9 | + <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a> | ||
10 | + <!--<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('cover/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>--> | ||
11 | + <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('cover/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a> | ||
12 | + <!--<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('cover/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>--> | ||
13 | + <!--<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('cover/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>--> | ||
14 | + | ||
15 | + <div class="dropdown btn-group {:$auth->check('cover/multi')?'':'hide'}"> | ||
16 | + <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a> | ||
17 | + <ul class="dropdown-menu text-left" role="menu"> | ||
18 | + <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li> | ||
19 | + <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li> | ||
20 | + </ul> | ||
21 | + </div> | ||
22 | + | ||
23 | + | ||
24 | + </div> | ||
25 | + <table id="table" class="table table-striped table-bordered table-hover table-nowrap" | ||
26 | + data-operate-edit="{:$auth->check('cover/edit')}" | ||
27 | + data-operate-del="{:$auth->check('cover/del')}" | ||
28 | + width="100%"> | ||
29 | + </table> | ||
30 | + </div> | ||
31 | + </div> | ||
32 | + | ||
33 | + </div> | ||
34 | + </div> | ||
35 | +</div> |
application/admin/view/words/add.html
0 → 100644
1 | +<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action=""> | ||
2 | + | ||
3 | + <div class="form-group"> | ||
4 | + <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label> | ||
5 | + <div class="col-xs-12 col-sm-8"> | ||
6 | + <input id="c-name" class="form-control" name="row[name]" type="text"> | ||
7 | + </div> | ||
8 | + </div> | ||
9 | + <div class="form-group"> | ||
10 | + <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label> | ||
11 | + <div class="col-xs-12 col-sm-8"> | ||
12 | + {:build_radios('row[type]', ['1'=>__('地名关键词'), '2'=>__('内容关键词'),'3'=>__('价格关键词')])} | ||
13 | + </div> | ||
14 | + </div> | ||
15 | + <div class="form-group layer-footer"> | ||
16 | + <label class="control-label col-xs-12 col-sm-2"></label> | ||
17 | + <div class="col-xs-12 col-sm-8"> | ||
18 | + <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button> | ||
19 | + <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button> | ||
20 | + </div> | ||
21 | + </div> | ||
22 | +</form> |
application/admin/view/words/edit.html
0 → 100644
1 | +<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action=""> | ||
2 | + | ||
3 | + <div class="form-group"> | ||
4 | + <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label> | ||
5 | + <div class="col-xs-12 col-sm-8"> | ||
6 | + <input id="c-name" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}"> | ||
7 | + </div> | ||
8 | + </div> | ||
9 | + <div class="form-group"> | ||
10 | + <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label> | ||
11 | + <div class="col-xs-12 col-sm-8"> | ||
12 | + {:build_radios('row[type]', ['1'=>__('地名关键词'), '2'=>__('内容关键词'),'3'=>__('价格关键词')],$row['type'])} | ||
13 | + </div> | ||
14 | + </div> | ||
15 | + <div class="form-group layer-footer"> | ||
16 | + <label class="control-label col-xs-12 col-sm-2"></label> | ||
17 | + <div class="col-xs-12 col-sm-8"> | ||
18 | + <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button> | ||
19 | + <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button> | ||
20 | + </div> | ||
21 | + </div> | ||
22 | +</form> |
application/admin/view/words/index.html
0 → 100644
1 | +<div class="panel panel-default panel-intro"> | ||
2 | + {:build_heading()} | ||
3 | + | ||
4 | + <div class="panel-body"> | ||
5 | + <div id="myTabContent" class="tab-content"> | ||
6 | + <div class="tab-pane fade active in" id="one"> | ||
7 | + <div class="widget-body no-padding"> | ||
8 | + <div id="toolbar" class="toolbar"> | ||
9 | + <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a> | ||
10 | + <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('words/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a> | ||
11 | + <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('words/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a> | ||
12 | + <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('words/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a> | ||
13 | + <!--<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('words/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>--> | ||
14 | + | ||
15 | + <div class="dropdown btn-group {:$auth->check('words/multi')?'':'hide'}"> | ||
16 | + <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a> | ||
17 | + <ul class="dropdown-menu text-left" role="menu"> | ||
18 | + <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li> | ||
19 | + <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li> | ||
20 | + </ul> | ||
21 | + </div> | ||
22 | + | ||
23 | + | ||
24 | + </div> | ||
25 | + <table id="table" class="table table-striped table-bordered table-hover table-nowrap" | ||
26 | + data-operate-edit="{:$auth->check('words/edit')}" | ||
27 | + data-operate-del="{:$auth->check('words/del')}" | ||
28 | + width="100%"> | ||
29 | + </table> | ||
30 | + </div> | ||
31 | + </div> | ||
32 | + | ||
33 | + </div> | ||
34 | + </div> | ||
35 | +</div> |
public/assets/js/backend/cover.js
0 → 100644
1 | +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { | ||
2 | + | ||
3 | + var Controller = { | ||
4 | + index: function () { | ||
5 | + // 初始化表格参数配置 | ||
6 | + Table.api.init({ | ||
7 | + extend: { | ||
8 | + index_url: 'cover/index' + location.search, | ||
9 | + add_url: 'cover/add', | ||
10 | + edit_url: 'cover/edit', | ||
11 | + del_url: 'cover/del', | ||
12 | + multi_url: 'cover/multi', | ||
13 | + table: 'cover', | ||
14 | + } | ||
15 | + }); | ||
16 | + | ||
17 | + var table = $("#table"); | ||
18 | + | ||
19 | + // 初始化表格 | ||
20 | + table.bootstrapTable({ | ||
21 | + url: $.fn.bootstrapTable.defaults.extend.index_url, | ||
22 | + pk: 'id', | ||
23 | + sortName: 'id', | ||
24 | + columns: [ | ||
25 | + [ | ||
26 | + {checkbox: true}, | ||
27 | + {field: 'id', title: __('Id')}, | ||
28 | + {field: 'thumbnail', title: __('Thumbnail'),operate:false, events: Table.api.events.image,formatter: Table.api.formatter.image}, | ||
29 | + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime}, | ||
30 | + {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime}, | ||
31 | + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: function (value, row, index) { | ||
32 | + var that = $.extend({}, this); | ||
33 | + var table = $(that.table).clone(true); | ||
34 | + $(table).data("operate-del", null); | ||
35 | + that.table = table; | ||
36 | + return Table.api.formatter.operate.call(that, value, row, index); | ||
37 | + }} | ||
38 | + ] | ||
39 | + ] | ||
40 | + }); | ||
41 | + | ||
42 | + // 为表格绑定事件 | ||
43 | + Table.api.bindevent(table); | ||
44 | + }, | ||
45 | + add: function () { | ||
46 | + Controller.api.bindevent(); | ||
47 | + }, | ||
48 | + edit: function () { | ||
49 | + Controller.api.bindevent(); | ||
50 | + }, | ||
51 | + api: { | ||
52 | + bindevent: function () { | ||
53 | + Form.api.bindevent($("form[role=form]")); | ||
54 | + } | ||
55 | + } | ||
56 | + }; | ||
57 | + return Controller; | ||
58 | +}); |
public/assets/js/backend/words.js
0 → 100644
1 | +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { | ||
2 | + | ||
3 | + var Controller = { | ||
4 | + index: function () { | ||
5 | + // 初始化表格参数配置 | ||
6 | + Table.api.init({ | ||
7 | + extend: { | ||
8 | + index_url: 'words/index' + location.search, | ||
9 | + add_url: 'words/add', | ||
10 | + edit_url: 'words/edit', | ||
11 | + del_url: 'words/del', | ||
12 | + multi_url: 'words/multi', | ||
13 | + table: 'words', | ||
14 | + } | ||
15 | + }); | ||
16 | + | ||
17 | + var table = $("#table"); | ||
18 | + | ||
19 | + // 初始化表格 | ||
20 | + table.bootstrapTable({ | ||
21 | + url: $.fn.bootstrapTable.defaults.extend.index_url, | ||
22 | + pk: 'id', | ||
23 | + sortName: 'id', | ||
24 | + columns: [ | ||
25 | + [ | ||
26 | + {checkbox: true}, | ||
27 | + {field: 'id', title: __('Id')}, | ||
28 | + {field: 'name', title: __('Name')}, | ||
29 | + {field: 'type', title: __('Type'),formatter: Table.api.formatter.status,searchList:{'1': '地名关键词','2':'内容关键词','3':'价格关键词'}}, | ||
30 | + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime}, | ||
31 | + {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime}, | ||
32 | + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} | ||
33 | + ] | ||
34 | + ] | ||
35 | + }); | ||
36 | + | ||
37 | + // 为表格绑定事件 | ||
38 | + Table.api.bindevent(table); | ||
39 | + }, | ||
40 | + add: function () { | ||
41 | + Controller.api.bindevent(); | ||
42 | + }, | ||
43 | + edit: function () { | ||
44 | + Controller.api.bindevent(); | ||
45 | + }, | ||
46 | + api: { | ||
47 | + bindevent: function () { | ||
48 | + Form.api.bindevent($("form[role=form]")); | ||
49 | + } | ||
50 | + } | ||
51 | + }; | ||
52 | + return Controller; | ||
53 | +}); |
-
请 注册 或 登录 后发表评论