From 24013a5ea5e541319a5a94908251b8f169a32fb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=9D=BE=E6=A0=91?= Date: Wed, 24 Apr 2019 17:00:10 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8D=A3=E8=AA=89=E5=86=8C=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Index.php | 2 +- application/admin/model/Admin.php | 1 + application/common.php | 1 + application/kaoshi/controller/Index.php | 2 +- .../kaoshi/view/more_action/index.html | 2 - .../kaoshi/view/more_action/index1.html | 134 ---- application/renshi/controller/Index.php | 2 +- application/renshi/controller/Student.php | 2 +- application/rongyu/controller/DwRongyu.php | 72 ++- application/rongyu/controller/JsRongyu.php | 83 ++- .../rongyu/controller/JsRongyuInfo.php | 118 ++-- application/rongyu/model/DwRongyu.php | 1 - application/rongyu/model/JsRongyu.php | 28 +- application/rongyu/model/JsRongyuInfo.php | 32 +- application/rongyu/view/dw_rongyu/create.html | 11 +- .../rongyu/view/dw_rongyu/create_all.html | 43 ++ .../rongyu/view/dw_rongyu/createall.html | 600 ----------------- application/rongyu/view/dw_rongyu/index.html | 30 +- application/rongyu/view/js_rongyu/create.html | 149 ++--- application/rongyu/view/js_rongyu/edit.html | 77 --- application/rongyu/view/js_rongyu/index.html | 357 +++++------ .../rongyu/view/js_rongyu_info/create.html | 438 +++---------- .../view/js_rongyu_info/create_all.html | 43 ++ .../rongyu/view/js_rongyu_info/createall.html | 603 ------------------ .../rongyu/view/js_rongyu_info/edit.html | 363 ----------- .../rongyu/view/js_rongyu_info/index.html | 385 +++++------ .../view/js_rongyu_info/rongyu_list.html | 289 +++++---- application/system/controller/School.php | 2 +- application/system/view/category/index.html | 1 + database/seeds/Rule.php | 2 +- public/static/xadmin/js/cjgl.js | 21 +- route/rongyu.php | 7 +- 32 files changed, 970 insertions(+), 2931 deletions(-) delete mode 100644 application/kaoshi/view/more_action/index1.html create mode 100644 application/rongyu/view/dw_rongyu/create_all.html delete mode 100644 application/rongyu/view/dw_rongyu/createall.html delete mode 100644 application/rongyu/view/js_rongyu/edit.html create mode 100644 application/rongyu/view/js_rongyu_info/create_all.html delete mode 100644 application/rongyu/view/js_rongyu_info/createall.html delete mode 100644 application/rongyu/view/js_rongyu_info/edit.html diff --git a/application/admin/controller/Index.php b/application/admin/controller/Index.php index ea1a66aa..80b2f5a2 100644 --- a/application/admin/controller/Index.php +++ b/application/admin/controller/Index.php @@ -34,7 +34,7 @@ class Index extends Base 'page'=>'1' ,'limit'=>'10' ,'field'=>'id' - ,'order'=>'asc' + ,'order'=>'desc' ,'searchval'=>'' ],'POST'); diff --git a/application/admin/model/Admin.php b/application/admin/model/Admin.php index bf368dbf..91d162e7 100644 --- a/application/admin/model/Admin.php +++ b/application/admin/model/Admin.php @@ -16,6 +16,7 @@ class Admin extends Base // 查询数据 $data = $this ->order([$src['field'] =>$src['order']]) + ->where('id','>',2) ->when(strlen($searchval)>0,function($query) use($searchval){ $query->where('xingming|username','like','%'.$searchval.'%'); }) diff --git a/application/common.php b/application/common.php index e4ba95f7..fd5e19aa 100644 --- a/application/common.php +++ b/application/common.php @@ -160,6 +160,7 @@ function schlist($low='班级',$high='其它级') // 查询学校 $schlist = $sch->where('jibie','between',[$catlist[$low],$catlist[$high]]) + ->where('status',1) // ->cache('schoollist',180) ->order(['paixu']) ->column('id,title,jiancheng'); diff --git a/application/kaoshi/controller/Index.php b/application/kaoshi/controller/Index.php index 08c0f8bc..4ede0a60 100644 --- a/application/kaoshi/controller/Index.php +++ b/application/kaoshi/controller/Index.php @@ -36,7 +36,7 @@ class Index extends Base 'page'=>'1', 'limit'=>'10', 'field'=>'update_time', - 'order'=>'asc', + 'order'=>'desc', 'searchval'=>'' ],'POST'); diff --git a/application/kaoshi/view/more_action/index.html b/application/kaoshi/view/more_action/index.html index 86c4d9a7..4748320b 100644 --- a/application/kaoshi/view/more_action/index.html +++ b/application/kaoshi/view/more_action/index.html @@ -153,8 +153,6 @@ // 弹窗 function addteb(title,url,is_refresh=true) { - - console.log(url); parent.x_admin_add_to_tab(title,url,is_refresh); } diff --git a/application/kaoshi/view/more_action/index1.html b/application/kaoshi/view/more_action/index1.html deleted file mode 100644 index c60f3927..00000000 --- a/application/kaoshi/view/more_action/index1.html +++ /dev/null @@ -1,134 +0,0 @@ -{extend name="common@list" /} -{block name="topnav"} - -{/block} -{block name="bouttons"} - -{/block} -{block name="tables"} -
- - - -
- - - -{/block} -{block name="myjs"} - -{/block} \ No newline at end of file diff --git a/application/renshi/controller/Index.php b/application/renshi/controller/Index.php index 52a3ed2e..41d6a931 100644 --- a/application/renshi/controller/Index.php +++ b/application/renshi/controller/Index.php @@ -41,7 +41,7 @@ class Index extends Base 'page'=>'1', 'limit'=>'10', 'field'=>'update_time', - 'order'=>'asc', + 'order'=>'desc', 'zhiwu'=>array(), 'danwei'=>array(), 'xueli'=>array(), diff --git a/application/renshi/controller/Student.php b/application/renshi/controller/Student.php index 71242b2d..fd6a934f 100644 --- a/application/renshi/controller/Student.php +++ b/application/renshi/controller/Student.php @@ -37,7 +37,7 @@ class Student extends Base 'page'=>'1', 'limit'=>'10', 'field'=>'update_time', - 'order'=>'asc', + 'order'=>'desc', 'school'=>array(), 'ruxuenian'=>array(), 'paixu'=>array(), diff --git a/application/rongyu/controller/DwRongyu.php b/application/rongyu/controller/DwRongyu.php index c2039e13..c498932b 100644 --- a/application/rongyu/controller/DwRongyu.php +++ b/application/rongyu/controller/DwRongyu.php @@ -39,7 +39,7 @@ class DwRongyu extends Base 'page'=>'1', 'limit'=>'10', 'field'=>'update_time', - 'order'=>'asc', + 'order'=>'desc', 'fzschool'=>array(), 'hjschool'=>array(), 'category'=>array(), @@ -141,17 +141,47 @@ class DwRongyu extends Base * @param \think\Request $request * @return \think\Response */ - public function createall() + // 批量添加 + public function createAll() { // 设置页面标题 - $list['title'] = '添加单位荣誉'; + $list['set'] = array( + 'webtitle'=>'批量上传荣誉图片', + 'butname'=>'批传', + 'formpost'=>'POST', + 'url'=>'/dwry/createall', + ); // 模板赋值 $this->assign('list',$list); - // 渲染 return $this->fetch(); - + } + + public function createAllSave() + { + // 获取文件信息 + $list['text'] = $this->request->post('text'); + $list['serurl'] = $this->request->post('serurl'); + + // 获取表单上传文件 + $file = request()->file('file'); + // 上传文件并返回结果 + $data = upload($list,$file); + + if($data['val'] != 1) + { + $data=['msg'=>'添加失败','val'=>0]; + } + + $data = dwry::create([ + 'url'=>$data['url'] + ,'title'=>'批传' + ]); + + $data ? $data=['msg'=>'批传成功','val'=>1] : $data=['msg'=>'数据处理错误','val'=>0]; + + return json($data); } /** @@ -215,7 +245,6 @@ class DwRongyu extends Base 'url'=>'/dwry/'.$id, ); - // 模板赋值 $this->assign('list',$list); // 渲染 @@ -233,14 +262,14 @@ class DwRongyu extends Base public function update($id) { // 获取表单数据 - $list = request()->scene('edit')->only(['title','category','hjschool','fzshijian','fzschool','jiangxiang','teachers'],'put'); + $list = request()->only(['title','category','hjschool','fzshijian','fzschool','jiangxiang','teachers','url'],'put'); $list['id'] = $id; // 实例化验证类 $validate = new \app\rongyu\validate\DwRongyu; // 验证表单数据 - $result = $validate->check($list); + $result = $validate->scene('add')->check($list); $msg = $validate->getError(); // 如果验证不通过则停止保存 @@ -250,25 +279,22 @@ class DwRongyu extends Base // 更新数据 - // $dwry = new dwry(); + $dwry = new dwry(); $data = dwry::update($list); - if(!empty($list['teachers'])) - { + // 删除原来的参与教师 + $data->cyDwry()->where('rongyuid',$id)->delete(true); - $data->cyDwry()->delete(true); - - // 声明参与教师数组 - $canyulist = []; - // 循环组成参与信息 - foreach ($list['teachers'] as $key => $value) { - $canyulist[] = [ - 'teacherid' => $value, - ]; - } - - $data->cyDwry()->saveAll($canyulist); + // 声明参与教师数组 + $canyulist = []; + // 循环组成参与教师 + foreach ($list['teachers'] as $key => $value) { + $canyulist[] = [ + 'teacherid' => $value, + ]; } + // 更新参考教师 + $data->cyDwry()->saveAll($canyulist); // 根据更新结果设置返回提示信息 $data ? $data=['msg'=>'更新成功','val'=>1] : $data=['msg'=>'数据处理错误','val'=>0]; diff --git a/application/rongyu/controller/JsRongyu.php b/application/rongyu/controller/JsRongyu.php index 85d4ed16..914aafe1 100644 --- a/application/rongyu/controller/JsRongyu.php +++ b/application/rongyu/controller/JsRongyu.php @@ -35,54 +35,41 @@ class JsRongyu extends Base */ public function ajaxData() { - // 获取DT的传值 - $getdt = request()->param(); + // 获取参数 + $src = $this->request + ->only([ + 'page'=>'1', + 'limit'=>'10', + 'field'=>'update_time', + 'order'=>'desc', + 'fzschool'=>array(), + 'hjschool'=>array(), + 'category'=>array(), + 'searchval'=>'' + ],'POST'); - //得到排序的方式 - $order = $getdt['order'][0]['dir']; - //得到排序字段的下标 - $order_column = $getdt['order'][0]['column']; - //根据排序字段的下标得到排序字段 - $order_field = $getdt['columns'][$order_column]['name']; - if($order_field=='') - { - $order_field = $getdt['columns'][$order_column]['data']; - } - //得到limit参数 - $limit_start = $getdt['start']; - $limit_length = $getdt['length']; - - //得到搜索的关键词 - $search = [ - 'fzschool'=>$getdt['fzschool'], - 'category'=>$getdt['category'], - 'search'=>$getdt['search']['value'], - 'order'=>$order, - 'order_field'=>$order_field - ]; // 实例化 $jsry = new jsry; - // 获取荣誉总数 - $cnt = $jsry->select()->count(); - - // 查询数据 - $data = $jsry->search($search); - $datacnt = $data->count(); - + // 查询要显示的数据 + $data = $jsry->search($src); + // 获取符合条件记录总数 + $cnt = $data->count(); // 获取当前页数据 + $limit_start = $src['page'] * $src['limit'] - $src['limit']; + $limit_length = $src['limit']; $data = $data->slice($limit_start,$limit_length); - - + // 重组返回内容 $data = [ - 'draw'=> $getdt["draw"] , // ajax请求次数,作为标识符 - 'recordsTotal'=>$cnt, // 获取到的结果数(每页显示数量) - 'recordsFiltered'=>$datacnt, // 符合条件的总数据量 + 'code'=> 0 , // ajax请求次数,作为标识符 + 'msg'=>"", // 获取到的结果数(每页显示数量) + 'count'=>$cnt, // 符合条件的总数据量 'data'=>$data, //获取到的数据结果 ]; + return json($data); } @@ -94,13 +81,17 @@ class JsRongyu extends Base public function create() { // 设置页面标题 - $list['title'] = '添加教师荣誉册'; + $list['set'] = array( + 'webtitle'=>'添加荣誉册', + 'butname'=>'添加', + 'formpost'=>'POST', + 'url'=>'/jsry', + ); // 模板赋值 $this->assign('list',$list); - // 渲染 - return $this->fetch(); + return $this->fetch('create'); } /** @@ -156,14 +147,22 @@ class JsRongyu extends Base public function edit($id) { // 获取荣誉册信息 - $list = jsry::where('id',$id) + $list['data'] = jsry::where('id',$id) ->field('id,title,category,fzshijian,fzschool') ->find(); + // 设置页面标题 + $list['set'] = array( + 'webtitle'=>'编辑荣誉册', + 'butname'=>'修改', + 'formpost'=>'PUT', + 'url'=>'/jsry/'.$id, + ); + // 模板赋值 $this->assign('list',$list); - - return $this->fetch(); + // 渲染 + return $this->fetch('create'); } /** diff --git a/application/rongyu/controller/JsRongyuInfo.php b/application/rongyu/controller/JsRongyuInfo.php index dadf0acd..aaca3124 100644 --- a/application/rongyu/controller/JsRongyuInfo.php +++ b/application/rongyu/controller/JsRongyuInfo.php @@ -23,7 +23,7 @@ class JsRongyuInfo extends Base public function index() { // 设置要给模板赋值的信息 - $list['webtitle'] = '教师列表'; + $list['webtitle'] = '荣誉列表'; // 模板赋值 $this->assign('list',$list); @@ -37,19 +37,17 @@ class JsRongyuInfo extends Base * * @return \think\Response */ - public function rongyuList($id) + public function rongyuList($id,$title) { - // 获取变量 - $list['id'] = $id; - // 设置页面标题 - $list['title'] = '教师荣誉信息'; - // 设置数据总数 - $list['count'] = ryinfo::where('rongyuce',$id)->count(); + // 设置要给模板赋值的信息 + $list['webtitle'] = $title . ' 荣誉'; + $list['rongyuce'] = $id; // 模板赋值 $this->assign('list',$list); - return $this->fetch(''); + // 渲染模板 + return $this->fetch(); } @@ -60,57 +58,42 @@ class JsRongyuInfo extends Base */ public function ajaxData() { - // 获取DT的传值 - $getdt = request()->param(); - - //得到排序的方式 - $order = $getdt['order'][0]['dir']; - //得到排序字段的下标 - $order_column = $getdt['order'][0]['column']; - //根据排序字段的下标得到排序字段 - $order_field = $getdt['columns'][$order_column]['name']; - if($order_field=='') - { - $order_field = $getdt['columns'][$order_column]['data']; - } - //得到limit参数 - $limit_start = $getdt['start']; - $limit_length = $getdt['length']; - - //得到搜索的关键词 - $search = [ - 'hjschool'=>$getdt['hjschool'], - 'fzschool'=>$getdt['fzschool'], - 'category'=>$getdt['category'], - 'rongyuce'=>$getdt['rongyuce'], - 'search'=>$getdt['search']['value'], - 'order'=>$order, - 'order_field'=>$order_field - ]; + // 获取参数 + $src = $this->request + ->only([ + 'page'=>'1', + 'limit'=>'10', + 'field'=>'update_time', + 'order'=>'desc', + 'fzschool'=>array(), + 'hjschool'=>array(), + 'category'=>array(), + 'rongyuce'=>'', + 'searchval'=>'' + ],'POST'); // 实例化 $ryinfo = new ryinfo; - // 获取荣誉总数 - $cnt = $ryinfo->select()->count(); - - // 查询数据 - $data = $ryinfo->search($search); - $datacnt = $data->count(); - + // 查询要显示的数据 + $data = $ryinfo->search($src); + // 获取符合条件记录总数 + $cnt = $data->count(); // 获取当前页数据 + $limit_start = $src['page'] * $src['limit'] - $src['limit']; + $limit_length = $src['limit']; $data = $data->slice($limit_start,$limit_length); - - + // 重组返回内容 $data = [ - 'draw'=> $getdt["draw"] , // ajax请求次数,作为标识符 - 'recordsTotal'=>$cnt, // 获取到的结果数(每页显示数量) - 'recordsFiltered'=>$datacnt, // 符合条件的总数据量 + 'code'=> 0 , // ajax请求次数,作为标识符 + 'msg'=>"", // 获取到的结果数(每页显示数量) + 'count'=>$cnt, // 符合条件的总数据量 'data'=>$data, //获取到的数据结果 ]; + return json($data); } @@ -122,14 +105,17 @@ class JsRongyuInfo extends Base public function create($id = 0) { // 设置页面标题 - $list['title'] = '添加教师荣誉'; - $list['id'] = $id; + $list['set'] = array( + 'webtitle'=>'添加荣誉', + 'butname'=>'添加', + 'formpost'=>'POST', + 'url'=>'/jsryinfo', + ); // 模板赋值 $this->assign('list',$list); - // 渲染 - return $this->fetch(); + return $this->fetch('create'); } /**留备用 @@ -196,18 +182,21 @@ class JsRongyuInfo extends Base * @param \think\Request $request * @return \think\Response */ - public function createall($id) + public function createAll($id) { + // 设置页面标题 - $list['title'] = '添加教师荣誉册'; - $list['rongyuce'] = $id; + $list['set'] = array( + 'webtitle'=>'批量上传教师荣誉册图片', + 'butname'=>'批传', + 'formpost'=>'POST', + 'url'=>'jsryinfoaddall/'.$id, + ); // 模板赋值 $this->assign('list',$list); - // 渲染 return $this->fetch(); - } /** @@ -273,7 +262,7 @@ class JsRongyuInfo extends Base public function edit($id) { // 获取荣誉信息 - $list = ryinfo::where('id',$id) + $list['data'] = ryinfo::where('id',$id) ->field('id,rongyuce,title,bianhao,hjschool,subject,jiangxiang,hjshijian,pic') ->with([ 'hjJsry'=>function($query){ @@ -294,9 +283,18 @@ class JsRongyuInfo extends Base ]) ->find(); - $this->assign('list',$list); + // 设置页面标题 + $list['set'] = array( + 'webtitle'=>'编辑荣誉', + 'butname'=>'修改', + 'formpost'=>'PUT', + 'url'=>'/jsryinfo/'.$id, + ); - return $this->fetch(); + // 模板赋值 + $this->assign('list',$list); + // 渲染 + return $this->fetch('create'); } /** diff --git a/application/rongyu/model/DwRongyu.php b/application/rongyu/model/DwRongyu.php index fc2faacb..b07f4893 100644 --- a/application/rongyu/model/DwRongyu.php +++ b/application/rongyu/model/DwRongyu.php @@ -11,7 +11,6 @@ class DwRongyu extends Base public function search($src) { // 整理变量 - // 获取参数 $hjschool = $src['hjschool']; $fzschool = $src['fzschool']; $category = $src['category']; diff --git a/application/rongyu/model/JsRongyu.php b/application/rongyu/model/JsRongyu.php index 8bdff7db..7533f85f 100644 --- a/application/rongyu/model/JsRongyu.php +++ b/application/rongyu/model/JsRongyu.php @@ -8,25 +8,24 @@ use app\common\model\Base; class JsRongyu extends Base { //搜索教师获奖荣誉 - public function search($search) + public function search($src) { - // 获取参数 - $fzschool = $search['fzschool']; - $category = $search['category']; - $order_field = $search['order_field']; - $order = $search['order']; - $category = $search['category']; - $search = $search['search']; + // 整理参数 + $hjschool = $src['hjschool']; + $fzschool = $src['fzschool']; + $category = $src['category']; + $searchval = $src['searchval']; - $data = $this->order([$order_field =>$order]) - ->when(strlen($fzschool)>0,function($query) use($fzschool){ + $data = $this + ->order([$src['field'] =>$src['order']]) + ->when(count($fzschool)>0,function($query) use($fzschool){ $query->where('fzschool','in',$fzschool); }) - ->when(strlen($category)>0,function($query) use($category){ + ->when(count($category)>0,function($query) use($category){ $query->where('category','in',$category); }) - ->when(strlen($search)>0,function($query) use($search){ - $query->where('title','like',$search); + ->when(strlen($searchval)>0,function($query) use($searchval){ + $query->where('title','like',$searchval); }) ->with( [ @@ -36,9 +35,10 @@ class JsRongyu extends Base 'lxCategory'=>function($query){ $query->field('id,title'); }, + ] ) - ->append(['cnt']) + ->withCount(['ryInfo'=>'count']) ->select(); diff --git a/application/rongyu/model/JsRongyuInfo.php b/application/rongyu/model/JsRongyuInfo.php index ac6642ce..144dc310 100644 --- a/application/rongyu/model/JsRongyuInfo.php +++ b/application/rongyu/model/JsRongyuInfo.php @@ -8,30 +8,28 @@ use app\common\model\Base; class JsRongyuInfo extends Base { //搜索单位获奖荣誉 - public function search($search) + public function search($src) { - // 获取参数 - $hjschool = $search['hjschool']; - $fzschool = $search['fzschool']; - $category = $search['category']; - $rongyuce = $search['rongyuce']; - $order_field = $search['order_field']; - $order = $search['order']; - $category = $search['category']; - $search = $search['search']; + // 整理参数 + $hjschool = $src['hjschool']; + $fzschool = $src['fzschool']; + $category = $src['category']; + $rongyuce = $src['rongyuce']; + $searchval = $src['searchval']; - $data = $this->order([$order_field =>$order]) - ->when(strlen($hjschool)>0,function($query) use($hjschool){ + $data = $this + ->order([$src['field'] =>$src['order']]) + ->when(count($hjschool)>0,function($query) use($hjschool){ $query->where('hjschool','in',$hjschool); }) - ->when(strlen($fzschool)>0,function($query) use($fzschool){ + ->when(count($fzschool)>0,function($query) use($fzschool){ $query->where('rongyuce','in',function($q) use($fzschool){ $q->name('JsRongyu')->where('fzschool','in',$fzschool)->field('id'); }); }) - ->when(strlen($category)>0,function($query) use($category){ + ->when(count($category)>0,function($query) use($category){ $query->where('rongyuce','in',function($q) use($category){ $q->name('JsRongyu')->where('category','in',$category)->field('id'); }); @@ -39,8 +37,8 @@ class JsRongyuInfo extends Base ->when(strlen($rongyuce)>0,function($query) use($rongyuce){ $query->where('rongyuce',$rongyuce); }) - ->when(strlen($search)>0,function($query) use($search){ - $query->where('title|bianhao','like',$search); + ->when(strlen($searchval)>0,function($query) use($searchval){ + $query->where('title|bianhao','like',$searchval); }) ->with( [ @@ -64,7 +62,7 @@ class JsRongyuInfo extends Base }, ] ) - ->append(['hjJsName','cyJsName']) + // ->append(['hjJsName','cyJsName']) ->select(); diff --git a/application/rongyu/view/dw_rongyu/create.html b/application/rongyu/view/dw_rongyu/create.html index 356218ca..305b2f2c 100644 --- a/application/rongyu/view/dw_rongyu/create.html +++ b/application/rongyu/view/dw_rongyu/create.html @@ -27,11 +27,13 @@ {/block} {block name="form"}
- {present name="$list.data.url"} + {eq name="$list.set.formpost" value="PUT" } + {if strlen($list.data.url)>0} {else /} - - {/present} + + {/if} + {/eq}
@@ -74,7 +76,7 @@
{$vo.teacher.xingming}
-
+ {/volist} {/present} @@ -217,7 +219,6 @@ // 搜索教师 $('#cySearch').bind({ keyup:function(){ - // $('#aaa').remove(); var val = $.trim($(this).val()); if(val.length>0){ cjgl.selectOnfocus(this,val); diff --git a/application/rongyu/view/dw_rongyu/create_all.html b/application/rongyu/view/dw_rongyu/create_all.html new file mode 100644 index 00000000..89e053ae --- /dev/null +++ b/application/rongyu/view/dw_rongyu/create_all.html @@ -0,0 +1,43 @@ +{extend name="common@create" /} + +{block name="form"} +
+ +
+{/block} + +{block name="myjs"} + +{/block} + diff --git a/application/rongyu/view/dw_rongyu/createall.html b/application/rongyu/view/dw_rongyu/createall.html deleted file mode 100644 index 63cff83a..00000000 --- a/application/rongyu/view/dw_rongyu/createall.html +++ /dev/null @@ -1,600 +0,0 @@ -{extend name="common@create" /} -{block name="mycss"} -{css href="/static/H-ui.admin_v3.1.3.1/H-ui.admin/lib/webuploader/0.1.5/webuploader.css" /} -{/block} -{block name="formaa"} -
- -
-
-
-
-
-

或将照片拖到这里,单次最多可选300张

-
-
- -
-
-
-{/block} -{block name="yanzheng"} -{js href="/static/H-ui.admin_v3.1.3.1/H-ui.admin/lib/webuploader/0.1.5/webuploader.js"} - -{/block} \ No newline at end of file diff --git a/application/rongyu/view/dw_rongyu/index.html b/application/rongyu/view/dw_rongyu/index.html index 3d3e65f9..7622cb4c 100644 --- a/application/rongyu/view/dw_rongyu/index.html +++ b/application/rongyu/view/dw_rongyu/index.html @@ -21,11 +21,29 @@
- +
- {php} $category = getCategory(101);{/php} + {php} $category = getCategory(112);{/php} {volist name="category" id="vo"} - + + {/volist} +
+
+
+ +
+ {php} $school = schlist('区级','其它级'); {/php} + {volist name="school" id="vo"} + + {/volist} +
+
+
+ +
+ {php} $school = schlist('校级','区级'); {/php} + {volist name="school" id="vo"} + {/volist}
@@ -44,6 +62,9 @@ + @@ -158,6 +179,9 @@ layui.use(['table','laypage','form','cjgl'], function(){ case 'add': cjgl.add('添加单位荣誉','/dwry/create','','',true); break; + case 'more': + cjgl.add('批传','dwry/createall','300','200'); + break; }; }); diff --git a/application/rongyu/view/js_rongyu/create.html b/application/rongyu/view/js_rongyu/create.html index 1a01acf8..fd8c9571 100644 --- a/application/rongyu/view/js_rongyu/create.html +++ b/application/rongyu/view/js_rongyu/create.html @@ -1,77 +1,84 @@ {extend name="common@create" /} -{block name="mycss"} +{block name="jscss"} {/block} -{block name="formaa"} - -
- -
- -
-
-
- -
- - {php}$category = getCategory(114);{/php} - - -
-
-
- -
- - {php} $school = schlist('区级','其它级');{/php} - - -
-
-
- -
- -
-
-
-
- -
-
-
+{block name="form"} +
+
+ +
+ +
+
+
+ +
+ {php} $category = getCategory(112);{/php} + +
+
+
+ +
+ {php} $school = schlist('区级','其它级');{/php} + +
+
+
+ +
+ +
+
+
+ +
+
{/block} -{block name="yanzheng"} - +{/block} - - -{/block} \ No newline at end of file diff --git a/application/rongyu/view/js_rongyu/edit.html b/application/rongyu/view/js_rongyu/edit.html deleted file mode 100644 index 3f2c6b83..00000000 --- a/application/rongyu/view/js_rongyu/edit.html +++ /dev/null @@ -1,77 +0,0 @@ -{extend name="common@create" /} -{block name="mycss"} -{/block} -{block name="formaa"} -
-
- -
- -
-
-
- -
- - {php}$category = getCategory(114);{/php} - - -
-
-
- -
- - {php} $school = schlist('区级','其它级');{/php} - - -
-
-
- -
- -
-
-
-
- -
-
-
-{/block} -{block name="yanzheng"} - -{/block} \ No newline at end of file diff --git a/application/rongyu/view/js_rongyu/index.html b/application/rongyu/view/js_rongyu/index.html index 15af6385..c2e5b66d 100644 --- a/application/rongyu/view/js_rongyu/index.html +++ b/application/rongyu/view/js_rongyu/index.html @@ -1,204 +1,179 @@ + {extend name="common@list" /} -{block name="topnav"} - +{block name="jsset"} + {/block} -{block name="bouttons"} -
- - - - - 批量删除 - - - - - 添加荣誉册 - - - - 共有数据:{$list.count} 条 - -
-
-
筛选荣誉册
-
-
- {php} - $school = schlist('区级','部级'); - {/php} - -
-
- {foreach $school as $key=>$vo } - - {/foreach} -
- -
-
- {php}$category = getCategory(114);{/php} - -
-
- {foreach $category as $key=>$vo } - - {/foreach} -
- -
+{block name="nav"} + + 荣誉管理 + 荣誉册 + +{/block} +{block name="search"} + {/block} -{block name="tables"} - - - - - - - - - - - - - - - -
荣誉册名称颁奖单位荣誉类别荣誉数量颁奖时间状态操作
- - +{block name="table"} +
{/block} {block name="myjs"} - + + + + {/block} \ No newline at end of file diff --git a/application/rongyu/view/js_rongyu_info/create.html b/application/rongyu/view/js_rongyu_info/create.html index ac1bffe2..fd8c9571 100644 --- a/application/rongyu/view/js_rongyu_info/create.html +++ b/application/rongyu/view/js_rongyu_info/create.html @@ -1,366 +1,84 @@ {extend name="common@create" /} -{block name="mycss"} -{css href="/static/H-ui.admin_v3.1.3.1/H-ui.admin/lib/webuploader/0.1.5/webuploader.css" /} +{block name="jscss"} {/block} -{block name="formaa"} -
-
- -
-
-
-
选择文件
- -
-
-
-
-
- - - -
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- - {php} $school = schlist('校级','区级');{/php} - - -
-
-
- -
- - {php} - $subject = new \app\teach\model\Subject; - $sjlist = $subject->where('status',1)->field('id,title')->order(['paixu'])->select(); - {/php} - - -
-
-
- -
- - {php}$jiangxiang = getCategory(113);{/php} - - -
-
-
- -
- -
-
-
-
- -
-
-
+{block name="form"} +
+
+ +
+ +
+
+
+ +
+ {php} $category = getCategory(112);{/php} + +
+
+
+ +
+ {php} $school = schlist('区级','其它级');{/php} + +
+
+
+ +
+ +
+
+
+ +
+
{/block} -{block name="yanzheng"} -{js href="/static/H-ui.admin_v3.1.3.1/H-ui.admin/lib/webuploader/0.1.5/webuploader.js"} - +{/block} - - // 上传文件 - $(function(){ - $('.skin-minimal input').iCheck({ - checkboxClass: 'icheckbox-blue', - radioClass: 'iradio-blue', - increaseArea: '20%' - }); - - $list = $("#fileList"), - $btn = $("#btn-star"), - state = "pending", - uploader; - - var uploader = WebUploader.create({ - auto: false, - swf: '/static/H-ui.admin_v3.1.3.1/H-ui.admin/lib/webuploader/0.1.5/Uploader.swf', - - // 文件接收服务端。 - server: '{:url("upload")}', - - // 选择文件的按钮。可选。 - // 内部根据当前运行是创建,可能是input元素,也可能是flash. - pick: '#filePicker', - - // 不压缩image, 默认如果是jpeg,文件上传前会压缩一把再上传! - resize: false, - //上传时提交自身需要的字段并传递到后台。 - formData: { - rongyuce : $('#rongyuce').val(), - }, - // 只允许选择图片文件。 - accept: { - title: 'Images', - extensions: 'gif,jpg,jpeg,bmp,png', - // mimeTypes: 'application/excel,application/vnd.ms-excel,application/x-excel,application/x-msexcel' - mimeTypes: 'image/*' - }, - - fileNumLimit: 1, // 上传文件数 - fileSizeLimit:2*1024*1024, - }); - uploader.on( 'fileQueued', function( file ) { - var $li = $( - '
' + - '
'+ - '
' + file.name + '
' + - '

等待上传...

'+ - '
' - ), - $img = $li.find('img'); - $list.append( $li ); - - // 创建缩略图 - // 如果为非图片文件,可以不用调用此方法。 - // thumbnailWidth x thumbnailHeight 为 100 x 100 - uploader.makeThumb( file, function( error, src ) { - if ( error ) { - $img.replaceWith('不能预览'); - return; - } - - $img.attr( 'src', src ); - }, thumbnailWidth, thumbnailHeight ); - }); - // 文件上传过程中创建进度条实时显示。 - uploader.on( 'uploadProgress', function( file, percentage ) { - var $li = $( '#'+file.id ), - $percent = $li.find('.progress-box .sr-only'); - - // 避免重复创建 - if ( !$percent.length ) { - $percent = $('
').appendTo( $li ).find('.sr-only'); - } - $li.find(".state").text("上传中"); - $percent.css( 'width', percentage * 100 + '%' ); - }); - - // 文件上传成功,给item添加成功class, 用样式标记上传成功。 - uploader.on( 'uploadSuccess', function( file ) { - $( '#'+file.id ).addClass('upload-state-success').find(".state").text("已上传"); - }); - - uploader.on( 'uploadAccept', function( file, response ) { - $('#pic').val(response.url); - $('#id').val(response.ryid); - $('#form-member-add').attr('action','/jsryinfo/'+response.ryid); - $('#form-member-add').attr('method','PUT'); - mytype = 'PUT'; - }); - - // 文件上传失败,显示上传出错。 - uploader.on( 'uploadError', function( file ) { - $( '#'+file.id ).addClass('upload-state-error').find(".state").text("上传出错"); - }); - - // 完成上传完了,成功或者失败,先删除进度条。 - uploader.on( 'uploadComplete', function( file ) { - $( '#'+file.id ).find('.progress-box').fadeOut(); - }); - uploader.on('all', function (type) { - if (type === 'startUpload') { - state = 'uploading'; - } else if (type === 'stopUpload') { - state = 'paused'; - } else if (type === 'uploadFinished') { - state = 'done'; - } - - if (state === 'uploading') { - $btn.text('暂停上传'); - } else { - $btn.text('开始上传'); - } - }); - - $btn.on('click', function () { - if (state === 'uploading') { - uploader.stop(); - } else { - uploader.upload(); - } - }); - - }); - - - // 获取获奖教师列表 - function hjSelect(obj) - { - $('#hjSelect').empty(); - $('#cySelect').empty(); - var str = ""; - str = $('#hjteacher').val(); - if(str.length<=0) - { - return ""; - } - $.post( - "{:Url::build('renshi/index/srcTeacher')}", - { - "str":str, - }, - function(data,status){ - $('#hjSelect').empty(); - $('#cySelect').empty(); - if($.isEmptyObject(data)) - { - return true; - } - for (var i = data.length - 1; i >= 0; i--) { - var myhtml = ""; - myhtml = ""; - $('#hjSelect').append(myhtml); - } - - } - ); - } - - // 添加参与人 - function addHj(obj,teacherId) - { - $('#hjteacher').val(''); - $('#cyteacher').val(''); - $(obj).attr('class','btn btn-warning radius mr-5 size-MINI'); - $(obj).attr('onclick','delCy(this)'); - var myhtml = ""; - myhtml = ""; - $('#addHj').append(myhtml); - $('#addHj').children("span").last().append(obj); - } - - - // 获取参与教师列表 - function cySelect(obj) - { - $('#hjSelect').empty(); - $('#cySelect').empty(); - var str = ""; - str = $('#cyteacher').val(); - if(str.length<=0) - { - return ""; - } - $.post( - "{:Url::build('renshi/index/srcTeacher')}", - { - "str":str, - }, - function(data,status){ - $('#hjSelect').empty(); - $('#cySelect').empty(); - if($.isEmptyObject(data)) - { - return true; - } - for (var i = data.length - 1; i >= 0; i--) { - var myhtml = ""; - myhtml = ""; - $('#cySelect').append(myhtml); - } - - } - ); - } - - - // 添加参与人 - function addCy(obj,teacherId) - { - $('#hjteacher').val(''); - $('#cyteacher').val(''); - $(obj).attr('class','btn btn-warning radius mr-5 size-MINI'); - $(obj).attr('onclick','delCy(this)'); - var myhtml = ""; - myhtml = ""; - $('#addCy').append(myhtml); - $('#addCy').children("span").last().append(obj); - } - - // 删除参与人 - function delCy(obj) - { - $(obj).parent().remove(); - } - - // 匹配用户名 - $.validator.addMethod("zh",function(value,element){ - var tel = /^[\u4e00-\u9fa5]*$/; - return this.optional(element) || tel.test(value); - }, "请输入中文"); - - - - - -{/block} \ No newline at end of file diff --git a/application/rongyu/view/js_rongyu_info/create_all.html b/application/rongyu/view/js_rongyu_info/create_all.html new file mode 100644 index 00000000..89e053ae --- /dev/null +++ b/application/rongyu/view/js_rongyu_info/create_all.html @@ -0,0 +1,43 @@ +{extend name="common@create" /} + +{block name="form"} +
+ +
+{/block} + +{block name="myjs"} + +{/block} + diff --git a/application/rongyu/view/js_rongyu_info/createall.html b/application/rongyu/view/js_rongyu_info/createall.html deleted file mode 100644 index 3c714976..00000000 --- a/application/rongyu/view/js_rongyu_info/createall.html +++ /dev/null @@ -1,603 +0,0 @@ -{extend name="common@create" /} -{block name="mycss"} -{css href="/static/H-ui.admin_v3.1.3.1/H-ui.admin/lib/webuploader/0.1.5/webuploader.css" /} -{/block} -{block name="formaa"} -
- -
-
-
-
-
-

或将照片拖到这里,单次最多可选300张

-
-
- -
-
-
-{/block} -{block name="yanzheng"} -{js href="/static/H-ui.admin_v3.1.3.1/H-ui.admin/lib/webuploader/0.1.5/webuploader.js"} - -{/block} \ No newline at end of file diff --git a/application/rongyu/view/js_rongyu_info/edit.html b/application/rongyu/view/js_rongyu_info/edit.html deleted file mode 100644 index cab8ff86..00000000 --- a/application/rongyu/view/js_rongyu_info/edit.html +++ /dev/null @@ -1,363 +0,0 @@ -{extend name="common@create" /} -{block name="mycss"} -{css href="/static/H-ui.admin_v3.1.3.1/H-ui.admin/lib/webuploader/0.1.5/webuploader.css" /} -{/block} -{block name="formaa"} -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
- {volist name="list.hj_jsry" id="vo"} - - - - - {/volist} -
-
-
-
-
- -
- -
- {volist name="list.cy_jsry" id="vo"} - - - - - {/volist} -
-
-
-
-
- -
- - {php} $school = schlist('校级','区级');{/php} - - -
-
-
- -
- - {php} - $subject = new \app\teach\model\Subject; - $sjlist = $subject->where('status',1)->field('id,title')->order(['paixu'])->select(); - {/php} - - -
-
-
- -
- - {php}$jiangxiang = getCategory(113);{/php} - - -
-
-
- -
- -
-
-
-
- -
-
-
-{/block} -{block name="yanzheng"} -{js href="/static/H-ui.admin_v3.1.3.1/H-ui.admin/lib/webuploader/0.1.5/webuploader.js"} - -{/block} \ No newline at end of file diff --git a/application/rongyu/view/js_rongyu_info/index.html b/application/rongyu/view/js_rongyu_info/index.html index 4d894aa3..83f07b60 100644 --- a/application/rongyu/view/js_rongyu_info/index.html +++ b/application/rongyu/view/js_rongyu_info/index.html @@ -1,227 +1,184 @@ + {extend name="common@list" /} -{block name="topnav"} - +{block name="jsset"} + {/block} -{block name="bouttons"} -
- - - - - 批量删除 - - - - - - 共有数据:{$list.count} 条 - -
-
-
筛选荣誉册
-
-
- {php} - $school = schlist('校级','区级'); - {/php} - -
-
- {foreach $school as $key=>$vo } - - {/foreach} -
- -
-
- {php} - $school = schlist('区级','部级'); - {/php} - -
-
- {foreach $school as $key=>$vo } - - {/foreach} -
- -
-
- {php}$category = getCategory(114);{/php} - -
-
- {foreach $category as $key=>$vo } - - {/foreach} -
- -
+{block name="nav"} + + 荣誉管理 + 荣誉列表 + +{/block} +{block name="search"} + {/block} -{block name="tables"} - - - - - - - - - - - - - - - - - - -
姓名单位荣誉名称荣誉册编号学科奖项获奖时间状态操作
- - +{block name="table"} +
{/block} {block name="myjs"} - + + + + {/block} \ No newline at end of file diff --git a/application/rongyu/view/js_rongyu_info/rongyu_list.html b/application/rongyu/view/js_rongyu_info/rongyu_list.html index 9a8f2c5a..e2d21a72 100644 --- a/application/rongyu/view/js_rongyu_info/rongyu_list.html +++ b/application/rongyu/view/js_rongyu_info/rongyu_list.html @@ -1,142 +1,167 @@ + {extend name="common@list" /} -{block name="topnav"} - +{block name="jsset"} + {/block} -{block name="bouttons"} -
- - - - - 批量删除 - - - - - 添加教师荣誉信息 - - - - - 下载荣誉信息 - - - - 共有数据:{$list.count} 条 - +{block name="nav"} + + 荣誉管理 + 荣誉册 + 荣誉列表 + +{/block} +{block name="search"} + {/block} -{block name="tables"} - - - - - - - - - - - - - - - - - -
获奖人获奖人单位荣誉名称荣誉册学科奖项获奖时间状态操作
- - +{block name="table"} +
{/block} {block name="myjs"} - + + + + {/block} \ No newline at end of file diff --git a/application/system/controller/School.php b/application/system/controller/School.php index f1ccd847..7235f5e3 100644 --- a/application/system/controller/School.php +++ b/application/system/controller/School.php @@ -31,7 +31,7 @@ class School extends Base ->only([ 'page'=>'1', 'limit'=>'10', - 'field'=>'update_time', + 'field'=>'paixu', 'order'=>'asc', 'xingzhi'=>array(), 'searchval'=>'' diff --git a/application/system/view/category/index.html b/application/system/view/category/index.html index 2168c471..a574224b 100644 --- a/application/system/view/category/index.html +++ b/application/system/view/category/index.html @@ -76,6 +76,7 @@ layui.use(['table','laypage','form','cjgl'], function(){ defaultToolbar:'', cols: [[ //表头 {type:'checkbox', fixed: 'left'}, + {field: 'id', title: 'ID',sort: true}, {field: 'title', title: '名称',sort: true, minWidth:240}, {field: "pid",title: '父级类别',sort: true,templet:function(d){ var str=''; diff --git a/database/seeds/Rule.php b/database/seeds/Rule.php index b5d77f29..d26a51d5 100644 --- a/database/seeds/Rule.php +++ b/database/seeds/Rule.php @@ -182,7 +182,7 @@ class Rule extends Seeder ['title'=>'编辑','name'=>'rongyu/DwRongyu/edit','paixu'=>3,'pid'=>801,], ['title'=>'查看','name'=>'rongyu/DwRongyu/read','paixu'=>4,'pid'=>801,], ['title'=>'状态','name'=>'rongyu/DwRongyu/setStatus','paixu'=>5,'pid'=>801], - // ['title'=>'批量上传','name'=>'rongyu/DwRongyu/createAll','paixu'=>6,'pid'=>801], + ['title'=>'批量上传','name'=>'rongyu/DwRongyu/createAllSave','paixu'=>6,'pid'=>801], // 教师荣誉册管理 ['title'=>'添加','name'=>'rongyu/JsRongyu/create','paixu' =>1,'pid'=>802], ['title'=>'删除','name'=>'rongyu/JsRongyu/delete','paixu'=>2,'pid'=>802], diff --git a/public/static/xadmin/js/cjgl.js b/public/static/xadmin/js/cjgl.js index cc45965c..cf869344 100644 --- a/public/static/xadmin/js/cjgl.js +++ b/public/static/xadmin/js/cjgl.js @@ -188,8 +188,9 @@ layui.define(['table'],function(exports){ //提示:模块也可以依赖其它 { return true; } + for (var i = data.length - 1; i >= 0; i--) { - mydl.append('
'+data[i].xingming+'
'); + mydl.append('
'+data[i].xingming+' '+data[i].js_danwei.jiancheng+' '+data[i].shengri+'
'); } } @@ -197,22 +198,22 @@ layui.define(['table'],function(exports){ //提示:模块也可以依赖其它 }, - // Select失去焦点 - selectOnblur:function(selectID){ - var srcDiv = $('#' + selectID).next(); - $(srcDiv).remove(); - }, + // 添加教师 addTeacher:function(myobj){ var myId = $(myobj).attr('id') - ,myTitle = $(myobj).text(); - var myList = $(myobj).parent().parent() - var myBut = $(myList).parent().parent(); + ,teachername = $(myobj).attr('teachername') + ,myTitle = $(myobj).text() + ,myList = $(myobj).parent().parent() + ,myBut = $(myList).parent().parent(); - $(myBut).append('
'+myTitle+'
'); + if(myId){ + $(myBut).append('
'+teachername+'
'); + } $(myList).prev().val(''); $(myList).remove(); }, + // 删除教师 delTeacher:function(myobj){ $(myobj).parent().remove(); } diff --git a/route/rongyu.php b/route/rongyu.php index aecbd099..828827f2 100644 --- a/route/rongyu.php +++ b/route/rongyu.php @@ -13,10 +13,11 @@ Route::resource('dwry','rongyu/DwRongyu'); Route::resource('jsry','rongyu/JsRongyu'); Route::resource('jsryinfo','rongyu/JsRongyuInfo'); -Route::get('dwry/createall','rongyu/DwRongyu/createall'); +Route::get('dwry/createall','rongyu/DwRongyu/createAll'); +Route::post('dwry/createall','rongyu/DwRongyu/createAllSave'); // 荣誉册中荣誉信息列表 -Route::get('rylist/:id','rongyu/JsRongyuInfo/rongyuList'); +Route::get('rylist/:id/:title','rongyu/JsRongyuInfo/rongyuList'); Route::get('ryout/:id','rongyu/JsRongyuInfo/outXlsx'); Route::get('jsryinfoadd/:id','rongyu/JsRongyuInfo/create'); -Route::get('jsryinfoaddall/:id','rongyu/JsRongyuInfo/createall'); \ No newline at end of file +Route::get('jsryinfoaddall/:id','rongyu/JsRongyuInfo/createAll'); \ No newline at end of file