chuweiqiang 1 year ago
parent
commit
dd77f98f7d

+ 1 - 1
application/admin/controller/Ajax.php

@@ -115,7 +115,7 @@ class Ajax extends Backend
                 $this->error($e->getMessage());
             }
 
-            $this->success(__('Uploaded successful'), '', ['url' => $attachment->url, 'fullurl' => cdnurl($attachment->url, true)]);
+            $this->success(__('Uploaded successful'), '', ['url' => cdnurl($attachment->url), 'fullurl' => cdnurl($attachment->url, true)]);
         }
     }
 

+ 42 - 0
application/admin/controller/Test.php

@@ -0,0 +1,42 @@
+<?php
+
+namespace app\admin\controller;
+
+use app\common\controller\Backend;
+
+/**
+ * 测试管理
+ *
+ * @icon fa fa-circle-o
+ */
+class Test extends Backend
+{
+
+    /**
+     * Test模型对象
+     * @var \app\admin\model\Test
+     */
+    protected $model = null;
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        $this->model = new \app\admin\model\Test;
+        $this->view->assign("weekList", $this->model->getWeekList());
+        $this->view->assign("flagList", $this->model->getFlagList());
+        $this->view->assign("genderdataList", $this->model->getGenderdataList());
+        $this->view->assign("hobbydataList", $this->model->getHobbydataList());
+        $this->view->assign("statusList", $this->model->getStatusList());
+        $this->view->assign("stateList", $this->model->getStateList());
+    }
+
+
+
+    /**
+     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+     */
+
+
+}

+ 9 - 0
application/admin/controller/books/Books.php

@@ -35,9 +35,18 @@ class Books extends Backend
     {
         parent::_initialize();
         $this->model = new \app\admin\model\books\Books;
+        $BookLevelModel = new \app\admin\model\books\BooksLevel();
+        $BookArrangementModel = new \app\admin\model\books\BooksArrangement();
+        $BookSpecialityModel = new \app\admin\model\books\BooksSpeciality();
+        $BookSeriesModel = new \app\admin\model\books\BooksSeries();
         $this->view->assign("bookTypeList", $this->model->getBookTypeList());
         $this->view->assign("isNewRecommendList", $this->model->getIsNewRecommendList());
         $this->view->assign("isAwardsList", $this->model->getIsAwardsList());
+        $this->view->assign("bookLevelList", $BookLevelModel->where('is_deleted',1)->where('status',0)->select());
+        $this->view->assign("bookArrangementList", $BookArrangementModel->where('is_deleted',1)->where('status',0)->select());
+        $this->view->assign("bookSpecialityList", $BookSpecialityModel->where('is_deleted',1)->where('status',0)->select());
+        $this->view->assign("bookSeriesList", $BookSeriesModel->where('is_deleted',1)->where('status',0)->select());
+
     }
 
 

+ 59 - 0
application/admin/lang/zh-cn/test.php

@@ -0,0 +1,59 @@
+<?php
+
+return [
+    'Id'                  => 'ID',
+    'User_id'             => '会员ID',
+    'Admin_id'            => '管理员ID',
+    'Category_id'         => '分类ID(单选)',
+    'Category_ids'        => '分类ID(多选)',
+    'Tags'                => '标签',
+    'Week'                => '星期(单选)',
+    'Week monday'         => '星期一',
+    'Week tuesday'        => '星期二',
+    'Week wednesday'      => '星期三',
+    'Flag'                => '标志(多选)',
+    'Flag hot'            => '热门',
+    'Flag index'          => '首页',
+    'Flag recommend'      => '推荐',
+    'Genderdata'          => '性别(单选)',
+    'Genderdata male'     => '男',
+    'Genderdata female'   => '女',
+    'Hobbydata'           => '爱好(多选)',
+    'Hobbydata music'     => '音乐',
+    'Hobbydata reading'   => '读书',
+    'Hobbydata swimming'  => '游泳',
+    'Title'               => '标题',
+    'Content'             => '内容',
+    'Image'               => '图片',
+    'Images'              => '图片组',
+    'Attachfile'          => '附件',
+    'Keywords'            => '关键字',
+    'Description'         => '描述',
+    'City'                => '省市',
+    'Json'                => '配置',
+    'Json key'            => '名称',
+    'Json value'          => '值',
+    'Multiplejson'        => '二维数组',
+    'Multiplejson title'  => '标题',
+    'Multiplejson intro'  => '介绍',
+    'Multiplejson author' => '作者',
+    'Multiplejson age'    => '年龄',
+    'Price'               => '价格',
+    'Views'               => '点击',
+    'Workrange'           => '时间区间',
+    'Startdate'           => '开始日期',
+    'Activitytime'        => '活动时间(datetime)',
+    'Year'                => '年',
+    'Times'               => '时间',
+    'Refreshtime'         => '刷新时间',
+    'Createtime'          => '创建时间',
+    'Updatetime'          => '更新时间',
+    'Deletetime'          => '删除时间',
+    'Weigh'               => '权重',
+    'Switch'              => '开关',
+    'Status'              => '状态',
+    'State'               => '状态值',
+    'State 0'             => '禁用',
+    'State 1'             => '正常',
+    'State 2'             => '推荐'
+];

+ 150 - 0
application/admin/model/Test.php

@@ -0,0 +1,150 @@
+<?php
+
+namespace app\admin\model;
+
+use think\Model;
+use traits\model\SoftDelete;
+
+class Test extends Model
+{
+
+    use SoftDelete;
+
+    
+
+    // 表名
+    protected $name = 'test';
+    
+    // 自动写入时间戳字段
+    protected $autoWriteTimestamp = 'integer';
+
+    // 定义时间戳字段名
+    protected $createTime = 'createtime';
+    protected $updateTime = 'updatetime';
+    protected $deleteTime = 'deletetime';
+
+    // 追加属性
+    protected $append = [
+        'week_text',
+        'flag_text',
+        'genderdata_text',
+        'hobbydata_text',
+        'refreshtime_text',
+        'status_text',
+        'state_text'
+    ];
+    
+
+    protected static function init()
+    {
+        self::afterInsert(function ($row) {
+            $pk = $row->getPk();
+            $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
+        });
+    }
+
+    
+    public function getWeekList()
+    {
+        return ['monday' => __('Week monday'), 'tuesday' => __('Week tuesday'), 'wednesday' => __('Week wednesday')];
+    }
+
+    public function getFlagList()
+    {
+        return ['hot' => __('Flag hot'), 'index' => __('Flag index'), 'recommend' => __('Flag recommend')];
+    }
+
+    public function getGenderdataList()
+    {
+        return ['male' => __('Genderdata male'), 'female' => __('Genderdata female')];
+    }
+
+    public function getHobbydataList()
+    {
+        return ['music' => __('Hobbydata music'), 'reading' => __('Hobbydata reading'), 'swimming' => __('Hobbydata swimming')];
+    }
+
+    public function getStatusList()
+    {
+        return ['normal' => __('Normal'), 'hidden' => __('Hidden')];
+    }
+
+    public function getStateList()
+    {
+        return ['0' => __('State 0'), '1' => __('State 1'), '2' => __('State 2')];
+    }
+
+
+    public function getWeekTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['week']) ? $data['week'] : '');
+        $list = $this->getWeekList();
+        return isset($list[$value]) ? $list[$value] : '';
+    }
+
+
+    public function getFlagTextAttr($value, $data)
+    {
+        $value = $value ?: ($data['flag'] ?? '');
+        $valueArr = explode(',', $value);
+        $list = $this->getFlagList();
+        return implode(',', array_intersect_key($list, array_flip($valueArr)));
+    }
+
+
+    public function getGenderdataTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['genderdata']) ? $data['genderdata'] : '');
+        $list = $this->getGenderdataList();
+        return isset($list[$value]) ? $list[$value] : '';
+    }
+
+
+    public function getHobbydataTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['hobbydata']) ? $data['hobbydata'] : '');
+        $valueArr = explode(',', $value);
+        $list = $this->getHobbydataList();
+        return implode(',', array_intersect_key($list, array_flip($valueArr)));
+    }
+
+
+    public function getRefreshtimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['refreshtime']) ? $data['refreshtime'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+
+    public function getStatusTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+        $list = $this->getStatusList();
+        return isset($list[$value]) ? $list[$value] : '';
+    }
+
+
+    public function getStateTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['state']) ? $data['state'] : '');
+        $list = $this->getStateList();
+        return isset($list[$value]) ? $list[$value] : '';
+    }
+
+    protected function setFlagAttr($value)
+    {
+        return is_array($value) ? implode(',', $value) : $value;
+    }
+
+    protected function setHobbydataAttr($value)
+    {
+        return is_array($value) ? implode(',', $value) : $value;
+    }
+
+    protected function setRefreshtimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+
+}

+ 8 - 8
application/admin/model/books/Books.php

@@ -8,13 +8,13 @@ use think\Model;
 class Books extends Model
 {
 
-    
 
-    
+
+
 
     // 表名
     protected $name = 'books';
-    
+
     // 自动写入时间戳字段
     protected $autoWriteTimestamp = 'integer';
 
@@ -29,22 +29,22 @@ class Books extends Model
         'is_new_recommend_text',
         'is_awards_text'
     ];
-    
 
-    
+
+
     public function getBookTypeList()
     {
-        return ['0' => __('Book_type 0'), '1' => __('Book_type 1')];
+        return ['0' => __('纸质书'), '1' => __('电子书')];
     }
 
     public function getIsNewRecommendList()
     {
-        return ['0' => __('Is_new_recommend 0'), '1' => __('Is_new_recommend 1')];
+        return ['0' => __('是'), '1' => __('否')];
     }
 
     public function getIsAwardsList()
     {
-        return ['0' => __('Is_awards 0'), '1' => __('Is_awards 1')];
+        return ['0' => __('是'), '1' => __('否')];
     }
 
 

+ 27 - 0
application/admin/validate/Test.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace app\admin\validate;
+
+use think\Validate;
+
+class Test extends Validate
+{
+    /**
+     * 验证规则
+     */
+    protected $rule = [
+    ];
+    /**
+     * 提示消息
+     */
+    protected $message = [
+    ];
+    /**
+     * 验证场景
+     */
+    protected $scene = [
+        'add'  => [],
+        'edit' => [],
+    ];
+    
+}

+ 77 - 8
application/admin/view/books/books/add.html

@@ -80,10 +80,63 @@
             <textarea id="c-author_desc" class="form-control " rows="5" name="row[author_desc]" cols="50"></textarea>
         </div>
     </div>
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">教学等级:</label>
+        <div class="col-xs-12 col-sm-8">
+
+            <select  id="c-level_id" class="form-control selectpicker" name="row[level_id]">
+                {foreach name="bookLevelList" item="vo"}
+                <option value="{$vo.id}" {in name="key" value=""}selected{/in}>{$vo.title}</option>
+                {/foreach}
+            </select>
+
+        </div>
+    </div>
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">教学层次:</label>
+        <div class="col-xs-12 col-sm-8">
+
+            <select  id="c-arrangement_id" class="form-control selectpicker" name="row[arrangement_id]">
+                {foreach name="bookArrangementList" item="vo"}
+                <option value="{$vo.id}" {in name="key" value=""}selected{/in}>{$vo.title}</option>
+                {/foreach}
+            </select>
+
+        </div>
+    </div>
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">专业类型:</label>
+        <div class="col-xs-12 col-sm-8">
+
+            <select  id="c-speciality_id" class="form-control selectpicker" name="row[speciality_id]">
+                {foreach name="bookSpecialityList" item="vo"}
+                <option value="{$vo.id}" {in name="key" value=""}selected{/in}>{$vo.title}</option>
+                {/foreach}
+            </select>
+
+        </div>
+    </div>
+
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Book_type')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">系列:</label>
         <div class="col-xs-12 col-sm-8">
-                        
+
+            <select  id="c-series_id" class="form-control selectpicker" name="row[series_id]">
+                {foreach name="bookSeriesList" item="vo"}
+                <option value="{$vo.id}" {in name="key" value=""}selected{/in}>{$vo.title}</option>
+                {/foreach}
+            </select>
+
+        </div>
+    </div>
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">教材类型:</label>
+        <div class="col-xs-12 col-sm-8">
+
             <select  id="c-book_type" class="form-control selectpicker" name="row[book_type]">
                 {foreach name="bookTypeList" item="vo"}
                     <option value="{$key}" {in name="key" value=""}selected{/in}>{$vo}</option>
@@ -93,9 +146,9 @@
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Is_new_recommend')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">是否新书推荐:</label>
         <div class="col-xs-12 col-sm-8">
-                        
+
             <select  id="c-is_new_recommend" class="form-control selectpicker" name="row[is_new_recommend]">
                 {foreach name="isNewRecommendList" item="vo"}
                     <option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
@@ -104,12 +157,28 @@
 
         </div>
     </div>
+<!--    <div class="form-group">-->
+<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Banner')}:</label>-->
+<!--        <div class="col-xs-12 col-sm-8">-->
+<!--            <textarea id="c-banner" class="form-control " rows="5" name="row[banner]" cols="50"></textarea>-->
+<!--        </div>-->
+<!--    </div>-->
+
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Banner')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('Images')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <textarea id="c-banner" class="form-control " rows="5" name="row[banner]" cols="50"></textarea>
+            <div class="input-group">
+                <input id="c-banner" class="form-control" size="50" name="row[banner]" type="text" value="">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-images" class="btn btn-danger faupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-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-images"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-images"></ul>
         </div>
     </div>
+
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Author')}:</label>
         <div class="col-xs-12 col-sm-8">
@@ -117,9 +186,9 @@
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Is_awards')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">是否获奖:</label>
         <div class="col-xs-12 col-sm-8">
-                        
+
             <select  id="c-is_awards" class="form-control selectpicker" name="row[is_awards]">
                 {foreach name="isAwardsList" item="vo"}
                     <option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>

+ 19 - 6
application/admin/view/books/books/edit.html

@@ -81,9 +81,22 @@
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Book_type')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">教学等级:</label>
         <div class="col-xs-12 col-sm-8">
-                        
+
+            <select  id="c-level_id" class="form-control selectpicker" name="row[level_id]">
+                {foreach name="bookLevelList" item="vo"}
+                <option value="{$vo.id}" {in name="key" value="$row.level_id"}selected{/in}>{$vo.title}</option>
+                {/foreach}
+            </select>
+
+        </div>
+    </div>
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">教材类型:</label>
+        <div class="col-xs-12 col-sm-8">
+
             <select  id="c-book_type" class="form-control selectpicker" name="row[book_type]">
                 {foreach name="bookTypeList" item="vo"}
                     <option value="{$key}" {in name="key" value="$row.book_type"}selected{/in}>{$vo}</option>
@@ -93,9 +106,9 @@
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Is_new_recommend')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">是否新书推荐:</label>
         <div class="col-xs-12 col-sm-8">
-                        
+
             <select  id="c-is_new_recommend" class="form-control selectpicker" name="row[is_new_recommend]">
                 {foreach name="isNewRecommendList" item="vo"}
                     <option value="{$key}" {in name="key" value="$row.is_new_recommend"}selected{/in}>{$vo}</option>
@@ -117,9 +130,9 @@
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Is_awards')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">是否获奖:</label>
         <div class="col-xs-12 col-sm-8">
-                        
+
             <select  id="c-is_awards" class="form-control selectpicker" name="row[is_awards]">
                 {foreach name="isAwardsList" item="vo"}
                     <option value="{$key}" {in name="key" value="$row.is_awards"}selected{/in}>{$vo}</option>

+ 289 - 0
application/admin/view/test/add.html

@@ -0,0 +1,289 @@
+<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">{:__('User_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Category_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-category_id" min="0" data-rule="required" data-source="category/selectpage" data-params='{"custom[type]":"test"}' class="form-control selectpage" name="row[category_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Category_ids')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-category_ids" data-rule="required" data-source="category/selectpage" data-params='{"custom[type]":"test"}' data-multiple="true" class="form-control selectpage" name="row[category_ids]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Tags')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-tags" class="form-control" data-role="tagsinput" name="row[tags]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Week')}:</label>
+        <div class="col-xs-12 col-sm-8">
+                        
+            <select  id="c-week" class="form-control selectpicker" name="row[week]">
+                {foreach name="weekList" item="vo"}
+                    <option value="{$key}" {in name="key" value=""}selected{/in}>{$vo}</option>
+                {/foreach}
+            </select>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Flag')}:</label>
+        <div class="col-xs-12 col-sm-8">
+                        
+            <select  id="c-flag" class="form-control selectpicker" multiple="" name="row[flag][]">
+                {foreach name="flagList" item="vo"}
+                    <option value="{$key}" {in name="key" value=""}selected{/in}>{$vo}</option>
+                {/foreach}
+            </select>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Genderdata')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <div class="radio">
+            {foreach name="genderdataList" item="vo"}
+            <label for="row[genderdata]-{$key}"><input id="row[genderdata]-{$key}" name="row[genderdata]" type="radio" value="{$key}" {in name="key" value="male"}checked{/in} /> {$vo}</label> 
+            {/foreach}
+            </div>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Hobbydata')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <div class="checkbox">
+            {foreach name="hobbydataList" item="vo"}
+            <label for="row[hobbydata][]-{$key}"><input id="row[hobbydata][]-{$key}" name="row[hobbydata][]" type="checkbox" value="{$key}" {in name="key" value=""}checked{/in} /> {$vo}</label> 
+            {/foreach}
+            </div>
+
+        </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" class="form-control" name="row[title]" type="text" value="">
+        </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">{:__('Image')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="input-group">
+                <input id="c-image" class="form-control" size="50" name="row[image]" type="text" value="">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-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-image"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-image"></ul>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Images')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="input-group">
+                <input id="c-images" class="form-control" size="50" name="row[images]" type="text" value="">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-images" class="btn btn-danger faupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-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-images"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-images"></ul>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Attachfile')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="input-group">
+                <input id="c-attachfile" class="form-control" size="50" name="row[attachfile]" type="text" value="">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-attachfile" class="btn btn-danger faupload" data-input-id="c-attachfile" data-multiple="false" data-preview-id="p-attachfile"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-attachfile" class="btn btn-primary fachoose" data-input-id="c-attachfile" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
+                </div>
+                <span class="msg-box n-right" for="c-attachfile"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-attachfile"></ul>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Keywords')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-keywords" class="form-control" name="row[keywords]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Description')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-description" class="form-control" name="row[description]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('City')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class='control-relative'><input id="c-city" class="form-control" data-toggle="city-picker" name="row[city]" type="text" value=""></div>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Json')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <dl class="fieldlist" data-name="row[json]">
+                <dd>
+                    <ins>{:__('Json key')}</ins>
+                    <ins>{:__('Json 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[json]" 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">{:__('Multiplejson')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <table class="table fieldlist" data-name="row[multiplejson]" data-template="row[multiplejson]tpl">
+                <tr>
+                    <td>{:__('multiplejson title')}</td>
+<td>{:__('multiplejson intro')}</td>
+<td>{:__('multiplejson author')}</td>
+<td>{:__('multiplejson age')}</td>
+                    <td width="90">{:__('Operate')}</td>
+                </tr>
+                <tr><td colspan="5">
+                <a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a>
+                <textarea name="row[multiplejson]" class="form-control hide" cols="30" rows="5"></textarea>
+                </td></tr>
+            </table>
+            <script type="text/html" id="row[multiplejson]tpl">
+                <tr>
+                    <td><input type="text" name="<%=name%>[<%=index%>][title]" class="form-control" value="<%=row.title%>"/></td>
+<td><input type="text" name="<%=name%>[<%=index%>][intro]" class="form-control" value="<%=row.intro%>"/></td>
+<td><input type="text" name="<%=name%>[<%=index%>][author]" class="form-control" value="<%=row.author%>"/></td>
+<td><input type="text" name="<%=name%>[<%=index%>][age]" class="form-control" value="<%=row.age%>"/></td>
+                    <td width="90">
+                        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
+                        <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
+                    </td>
+                </tr>
+            </script>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-price" min="0" class="form-control" step="0.01" name="row[price]" type="number" value="0.00">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Views')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-views" min="0" class="form-control" name="row[views]" type="number" value="0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Workrange')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-workrange" class="form-control datetimerange" data-locale='{"format":"YYYY-MM-DD HH:mm:ss"}' name="row[workrange]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Startdate')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-startdate" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[startdate]" type="text" value="{:date('Y-m-d')}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Activitytime')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-activitytime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[activitytime]" 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">{:__('Year')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-year" class="form-control datetimepicker" data-date-format="YYYY" data-use-current="true" name="row[year]" type="text" value="{:date('Y')}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Times')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-times" class="form-control datetimepicker" data-date-format="HH:mm:ss" data-use-current="true" name="row[times]" type="text" value="{:date('H:i:s')}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Refreshtime')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-refreshtime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[refreshtime]" 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">{:__('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">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Switch')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <input  id="c-switch" name="row[switch]" type="hidden" value="0">
+            <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-switch" data-yes="1" data-no="0" >
+                <i class="fa fa-toggle-on text-success fa-flip-horizontal text-gray fa-2x"></i>
+            </a>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <div class="radio">
+            {foreach name="statusList" item="vo"}
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="normal"}checked{/in} /> {$vo}</label> 
+            {/foreach}
+            </div>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('State')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <div class="radio">
+            {foreach name="stateList" item="vo"}
+            <label for="row[state]-{$key}"><input id="row[state]-{$key}" name="row[state]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label> 
+            {/foreach}
+            </div>
+
+        </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>

+ 289 - 0
application/admin/view/test/edit.html

@@ -0,0 +1,289 @@
+<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">{:__('User_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Category_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-category_id" min="0" data-rule="required" data-source="category/selectpage" data-params='{"custom[type]":"test"}' class="form-control selectpage" name="row[category_id]" type="text" value="{$row.category_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Category_ids')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-category_ids" data-rule="required" data-source="category/selectpage" data-params='{"custom[type]":"test"}' data-multiple="true" class="form-control selectpage" name="row[category_ids]" type="text" value="{$row.category_ids|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Tags')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-tags" class="form-control" data-role="tagsinput" name="row[tags]" type="text" value="{$row.tags|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Week')}:</label>
+        <div class="col-xs-12 col-sm-8">
+                        
+            <select  id="c-week" class="form-control selectpicker" name="row[week]">
+                {foreach name="weekList" item="vo"}
+                    <option value="{$key}" {in name="key" value="$row.week"}selected{/in}>{$vo}</option>
+                {/foreach}
+            </select>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Flag')}:</label>
+        <div class="col-xs-12 col-sm-8">
+                        
+            <select  id="c-flag" class="form-control selectpicker" multiple="" name="row[flag][]">
+                {foreach name="flagList" item="vo"}
+                    <option value="{$key}" {in name="key" value="$row.flag"}selected{/in}>{$vo}</option>
+                {/foreach}
+            </select>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Genderdata')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <div class="radio">
+            {foreach name="genderdataList" item="vo"}
+            <label for="row[genderdata]-{$key}"><input id="row[genderdata]-{$key}" name="row[genderdata]" type="radio" value="{$key}" {in name="key" value="$row.genderdata"}checked{/in} /> {$vo}</label> 
+            {/foreach}
+            </div>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Hobbydata')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <div class="checkbox">
+            {foreach name="hobbydataList" item="vo"}
+            <label for="row[hobbydata][]-{$key}"><input id="row[hobbydata][]-{$key}" name="row[hobbydata][]" type="checkbox" value="{$key}" {in name="key" value="$row.hobbydata"}checked{/in} /> {$vo}</label> 
+            {/foreach}
+            </div>
+
+        </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" 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">{:__('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">{:__('Image')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="input-group">
+                <input id="c-image" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-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-image"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-image"></ul>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Images')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="input-group">
+                <input id="c-images" class="form-control" size="50" name="row[images]" type="text" value="{$row.images|htmlentities}">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-images" class="btn btn-danger faupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-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-images"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-images"></ul>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Attachfile')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="input-group">
+                <input id="c-attachfile" class="form-control" size="50" name="row[attachfile]" type="text" value="{$row.attachfile|htmlentities}">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-attachfile" class="btn btn-danger faupload" data-input-id="c-attachfile" data-multiple="false" data-preview-id="p-attachfile"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-attachfile" class="btn btn-primary fachoose" data-input-id="c-attachfile" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
+                </div>
+                <span class="msg-box n-right" for="c-attachfile"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-attachfile"></ul>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Keywords')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-keywords" class="form-control" name="row[keywords]" type="text" value="{$row.keywords|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Description')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-description" class="form-control" name="row[description]" type="text" value="{$row.description|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('City')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class='control-relative'><input id="c-city" class="form-control" data-toggle="city-picker" name="row[city]" type="text" value="{$row.city|htmlentities}"></div>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Json')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <dl class="fieldlist" data-name="row[json]">
+                <dd>
+                    <ins>{:__('Json key')}</ins>
+                    <ins>{:__('Json 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[json]" class="form-control hide" cols="30" rows="5">{$row.json|htmlentities}</textarea>
+            </dl>
+
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Multiplejson')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <table class="table fieldlist" data-name="row[multiplejson]" data-template="row[multiplejson]tpl">
+                <tr>
+                    <td>{:__('multiplejson title')}</td>
+<td>{:__('multiplejson intro')}</td>
+<td>{:__('multiplejson author')}</td>
+<td>{:__('multiplejson age')}</td>
+                    <td width="90">{:__('Operate')}</td>
+                </tr>
+                <tr><td colspan="5">
+                <a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a>
+                <textarea name="row[multiplejson]" class="form-control hide" cols="30" rows="5">{$row.multiplejson|htmlentities}</textarea>
+                </td></tr>
+            </table>
+            <script type="text/html" id="row[multiplejson]tpl">
+                <tr>
+                    <td><input type="text" name="<%=name%>[<%=index%>][title]" class="form-control" value="<%=row.title%>"/></td>
+<td><input type="text" name="<%=name%>[<%=index%>][intro]" class="form-control" value="<%=row.intro%>"/></td>
+<td><input type="text" name="<%=name%>[<%=index%>][author]" class="form-control" value="<%=row.author%>"/></td>
+<td><input type="text" name="<%=name%>[<%=index%>][age]" class="form-control" value="<%=row.age%>"/></td>
+                    <td width="90">
+                        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
+                        <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
+                    </td>
+                </tr>
+            </script>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-price" min="0" class="form-control" step="0.01" name="row[price]" type="number" value="{$row.price|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Views')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-views" min="0" class="form-control" name="row[views]" type="number" value="{$row.views|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Workrange')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-workrange" class="form-control datetimerange" data-locale='{"format":"YYYY-MM-DD HH:mm:ss"}' name="row[workrange]" type="text" value="{$row.workrange|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Startdate')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-startdate" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[startdate]" type="text" value="{$row.startdate}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Activitytime')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-activitytime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[activitytime]" type="text" value="{$row.activitytime}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Year')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-year" class="form-control datetimepicker" data-date-format="YYYY" data-use-current="true" name="row[year]" type="text" value="{$row.year}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Times')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-times" class="form-control datetimepicker" data-date-format="HH:mm:ss" data-use-current="true" name="row[times]" type="text" value="{$row.times}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Refreshtime')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-refreshtime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[refreshtime]" type="text" value="{:$row.refreshtime?datetime($row.refreshtime):''}">
+        </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">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Switch')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <input  id="c-switch" name="row[switch]" type="hidden" value="{$row.switch}">
+            <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-switch" data-yes="1" data-no="0" >
+                <i class="fa fa-toggle-on text-success {eq name="$row.switch" value="0"}fa-flip-horizontal text-gray{/eq} fa-2x"></i>
+            </a>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <div class="radio">
+            {foreach name="statusList" item="vo"}
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label> 
+            {/foreach}
+            </div>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('State')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <div class="radio">
+            {foreach name="stateList" item="vo"}
+            <label for="row[state]-{$key}"><input id="row[state]-{$key}" name="row[state]" type="radio" value="{$key}" {in name="key" value="$row.state"}checked{/in} /> {$vo}</label> 
+            {/foreach}
+            </div>
+
+        </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>

+ 46 - 0
application/admin/view/test/index.html

@@ -0,0 +1,46 @@
+<div class="panel panel-default panel-intro">
+    
+    <div class="panel-heading">
+        {:build_heading(null,FALSE)}
+        <ul class="nav nav-tabs" data-field="status">
+            <li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
+            {foreach name="statusList" item="vo"}
+            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
+            {/foreach}
+        </ul>
+    </div>
+
+
+    <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('test/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('test/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('test/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
+                        
+
+                        <div class="dropdown btn-group {:$auth->check('test/multi')?'':'hide'}">
+                            <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
+                            <ul class="dropdown-menu text-left" role="menu">
+                                {foreach name="statusList" item="vo"}
+                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:" data-params="status={$key}">{:__('Set status to ' . $key)}</a></li>
+                                {/foreach}
+                            </ul>
+                        </div>
+
+                        <a class="btn btn-success btn-recyclebin btn-dialog {:$auth->check('test/recyclebin')?'':'hide'}" href="test/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('test/edit')}"
+                           data-operate-del="{:$auth->check('test/del')}"
+                           width="100%">
+                    </table>
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>

+ 25 - 0
application/admin/view/test/recyclebin.html

@@ -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('test/restore')?'':'hide'}" href="javascript:;" data-url="test/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('test/destroy')?'':'hide'}" href="javascript:;" data-url="test/destroy" data-action="destroy"><i class="fa fa-times"></i> {:__('Destroy')}</a>
+                        <a class="btn btn-success btn-restoreall {:$auth->check('test/restore')?'':'hide'}" href="javascript:;" data-url="test/restore" title="{:__('Restore all')}"><i class="fa fa-rotate-left"></i> {:__('Restore all')}</a>
+                        <a class="btn btn-danger btn-destroyall {:$auth->check('test/destroy')?'':'hide'}" href="javascript:;" data-url="test/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('test/restore')}"
+                           data-operate-destroy="{:$auth->check('test/destroy')}"
+                           width="100%">
+                    </table>
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>

+ 1 - 1
application/config.php

@@ -141,7 +141,7 @@ return [
     'view_replace_str'       => [
         '__PUBLIC__' => '',
         '__ROOT__'   => '',
-        '__CDN__'    => '',
+        '__CDN__'    => 'http://jiaocai.com/',
     ],
     // 默认跳转页面对应的模板文件
     'dispatch_success_tmpl'  => APP_PATH . 'common' . DS . 'view' . DS . 'tpl' . DS . 'dispatch_jump.tpl',

+ 1 - 1
application/extra/upload.php

@@ -37,7 +37,7 @@ return [
     /**
      * 完整URL模式
      */
-    'fullmode' => false,
+    'fullmode' => true,
     /**
      * 缩略图样式
      */

+ 3 - 3
public/assets/js/backend/books/books.js

@@ -36,10 +36,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {field: 'pubdate', title: __('Pubdate'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
                         {field: 'edition', title: __('Edition'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
                         {field: 'publisher', title: __('Publisher'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
-                        {field: 'book_type', title: __('Book_type'), searchList: {"0":__('Book_type 0'),"1":__('Book_type 1')}, formatter: Table.api.formatter.normal},
-                        {field: 'is_new_recommend', title: __('Is_new_recommend'), searchList: {"0":__('Is_new_recommend 0'),"1":__('Is_new_recommend 1')}, formatter: Table.api.formatter.normal},
+                        {field: 'book_type', title: __('教材类型'), searchList: {"0":__('纸质书'),"1":__('电子书')}, formatter: Table.api.formatter.normal},
+                        {field: 'is_new_recommend', title: __('是否新书推荐'), searchList: {"0":__('是'),"1":__('否')}, formatter: Table.api.formatter.normal},
                         {field: 'author', title: __('Author'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
-                        {field: 'is_awards', title: __('Is_awards'), searchList: {"0":__('Is_awards 0'),"1":__('Is_awards 1')}, formatter: Table.api.formatter.normal},
+                        {field: 'is_awards', title: __('是否获奖'), searchList: {"0":__('是'),"1":__('否')}, formatter: Table.api.formatter.normal},
                         {field: 'price', title: __('Price'), operate:'BETWEEN'},
                         {field: 'entity_price', title: __('Entity_price'), operate:'BETWEEN'},
                         {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},

+ 143 - 0
public/assets/js/backend/test.js

@@ -0,0 +1,143 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+    var Controller = {
+        index: function () {
+            // 初始化表格参数配置
+            Table.api.init({
+                extend: {
+                    index_url: 'test/index' + location.search,
+                    add_url: 'test/add',
+                    edit_url: 'test/edit',
+                    del_url: 'test/del',
+                    multi_url: 'test/multi',
+                    import_url: 'test/import',
+                    table: 'test',
+                }
+            });
+
+            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: 'user_id', title: __('User_id')},
+                        {field: 'admin_id', title: __('Admin_id')},
+                        {field: 'category_id', title: __('Category_id')},
+                        {field: 'category_ids', title: __('Category_ids'), operate: 'LIKE'},
+                        {field: 'tags', title: __('Tags'), operate: 'LIKE', formatter: Table.api.formatter.flag},
+                        {field: 'week', title: __('Week'), searchList: {"monday":__('Week monday'),"tuesday":__('Week tuesday'),"wednesday":__('Week wednesday')}, formatter: Table.api.formatter.normal},
+                        {field: 'flag', title: __('Flag'), searchList: {"hot":__('Flag hot'),"index":__('Flag index'),"recommend":__('Flag recommend')}, operate:'FIND_IN_SET', formatter: Table.api.formatter.label},
+                        {field: 'genderdata', title: __('Genderdata'), searchList: {"male":__('Genderdata male'),"female":__('Genderdata female')}, formatter: Table.api.formatter.normal},
+                        {field: 'hobbydata', title: __('Hobbydata'), searchList: {"music":__('Hobbydata music'),"reading":__('Hobbydata reading'),"swimming":__('Hobbydata swimming')}, operate:'FIND_IN_SET', formatter: Table.api.formatter.label},
+                        {field: 'title', title: __('Title'), operate: 'LIKE'},
+                        {field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
+                        {field: 'images', title: __('Images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
+                        {field: 'attachfile', title: __('Attachfile'), operate: false, formatter: Table.api.formatter.file},
+                        {field: 'keywords', title: __('Keywords'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+                        {field: 'description', title: __('Description'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+                        {field: 'city', title: __('City'), operate: 'LIKE'},
+                        {field: 'price', title: __('Price'), operate:'BETWEEN'},
+                        {field: 'views', title: __('Views')},
+                        {field: 'workrange', title: __('Workrange'), operate: 'LIKE'},
+                        {field: 'startdate', title: __('Startdate'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
+                        {field: 'activitytime', title: __('Activitytime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
+                        {field: 'year', title: __('Year')},
+                        {field: 'times', title: __('Times')},
+                        {field: 'refreshtime', title: __('Refreshtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {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: 'weigh', title: __('Weigh'), operate: false},
+                        {field: 'switch', title: __('Switch'), searchList: {"1":__('Yes'),"0":__('No')}, table: table, formatter: Table.api.formatter.toggle},
+                        {field: 'status', title: __('Status'), searchList: {"normal":__('Normal'),"hidden":__('Hidden')}, formatter: Table.api.formatter.status},
+                        {field: 'state', title: __('State'), searchList: {"0":__('State 0'),"1":__('State 1'),"2":__('State 2')}, formatter: Table.api.formatter.normal},
+                        {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: 'test/recyclebin' + location.search,
+                pk: 'id',
+                sortName: 'id',
+                columns: [
+                    [
+                        {checkbox: true},
+                        {field: 'id', title: __('Id')},
+                        {field: 'title', title: __('Title'), 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: 'test/restore',
+                                    refresh: true
+                                },
+                                {
+                                    name: 'Destroy',
+                                    text: __('Destroy'),
+                                    classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
+                                    icon: 'fa fa-times',
+                                    url: 'test/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;
+});