diff --git a/app/rongyu/controller/Jiaoshi.php b/app/rongyu/controller/Jiaoshi.php index 5fbf7759..cbc75b1b 100644 --- a/app/rongyu/controller/Jiaoshi.php +++ b/app/rongyu/controller/Jiaoshi.php @@ -23,10 +23,10 @@ class Jiaoshi extends BaseController $list['dataurl'] = 'jiaoshi/data'; // 模板赋值 - $this->assign('list',$list); + $this->view->assign('list',$list); // 渲染模板 - return $this->fetch(); + return $this->view->fetch(); } /** @@ -90,9 +90,9 @@ class Jiaoshi extends BaseController ); // 模板赋值 - $this->assign('list',$list); + $this->view->assign('list',$list); // 渲染 - return $this->fetch('create'); + return $this->view->fetch('create'); } /** @@ -157,13 +157,13 @@ class Jiaoshi extends BaseController 'webtitle'=>'编辑荣誉册', 'butname'=>'修改', 'formpost'=>'PUT', - 'url'=>'/jiaoshi/update/'.$id, + 'url'=>'/rongyu/jiaoshi/update/'.$id, ); // 模板赋值 - $this->assign('list',$list); + $this->view->assign('list',$list); // 渲染 - return $this->fetch('create'); + return $this->view->fetch('create'); } /** diff --git a/app/rongyu/controller/JsRongyuInfo.php b/app/rongyu/controller/JsRongyuInfo.php index 4a749d24..564acefa 100644 --- a/app/rongyu/controller/JsRongyuInfo.php +++ b/app/rongyu/controller/JsRongyuInfo.php @@ -25,12 +25,13 @@ class JsRongyuInfo extends BaseController // 设置要给模板赋值的信息 $list['webtitle'] = '荣誉列表'; $list['dataurl'] = 'jsryinfo/data'; + $list['status'] = 'jsryinfo/status'; // 模板赋值 - $this->assign('list',$list); + $this->view->assign('list',$list); // 渲染模板 - return $this->fetch(); + return $this->view->fetch(); } /** @@ -45,12 +46,14 @@ class JsRongyuInfo extends BaseController // 设置要给模板赋值的信息 $list['webtitle'] = $ry->where('id',$rongyuce)->value('title') . ' 荣誉'; $list['rongyuce'] = $rongyuce; + $list['dataurl'] = '/rongyu/jsryinfo/data'; + $list['status'] = '/rongyu/jsryinfo/status'; // 模板赋值 - $this->assign('list',$list); + $this->view->assign('list',$list); // 渲染模板 - return $this->fetch(); + return $this->view->fetch(); } @@ -114,14 +117,16 @@ class JsRongyuInfo extends BaseController 'webtitle'=>'添加荣誉', 'butname'=>'添加', 'formpost'=>'POST', - 'url'=>'save', + 'url'=>'/rongyu/jsryinfo/save', 'rongyuce'=>$rongyuce ); + dump($list); + // 模板赋值 - $this->assign('list',$list); + $this->view->assign('list',$list); // 渲染 - return $this->fetch('create'); + return $this->view->fetch('create'); } /**留备用 @@ -205,13 +210,13 @@ class JsRongyuInfo extends BaseController 'webtitle'=>'批量上传教师荣誉册图片', 'butname'=>'批传', 'formpost'=>'POST', - 'url'=>'/jsryinfoaddall/'.$rongyuce, + 'url'=>'saveall/'.$rongyuce, ); // 模板赋值 - $this->assign('list',$list); + $this->view->assign('list',$list); // 渲染 - return $this->fetch(); + return $this->view->fetch(); } // 保存批传 @@ -224,7 +229,7 @@ class JsRongyuInfo extends BaseController // 获取表单上传文件 $file = request()->file('file'); // 上传文件并返回结果 - $data = upload($list,$file); + $data = saveFileInfo($file,$list,false); if($data['val'] != 1) { @@ -244,25 +249,25 @@ class JsRongyuInfo extends BaseController - /** - * 上传荣誉图片并保存 - * - * @param \think\Request $request - * @return \think\Response - */ - public function upload() - { - // 获取文件信息 - $list['text'] = $this->request->post('text'); - $list['serurl'] = $this->request->post('serurl'); + // /** + // * 上传荣誉图片并保存 + // * + // * @param \think\Request $request + // * @return \think\Response + // */ + // public function upload() + // { + // // 获取文件信息 + // $list['text'] = $this->request->post('text'); + // $list['serurl'] = $this->request->post('serurl'); - // 获取表单上传文件 - $file = request()->file('file'); - // 上传文件并返回结果 - $data = upload($list,$file); + // // 获取表单上传文件 + // $file = request()->file('file'); + // // 上传文件并返回结果 + // $data = upload($list,$file); - return json($data); - } + // return json($data); + // } /** * 荣誉册中荣誉信息列表 @@ -310,14 +315,14 @@ class JsRongyuInfo extends BaseController 'webtitle'=>'编辑荣誉', 'butname'=>'修改', 'formpost'=>'PUT', - 'url'=>'/jsryinfo/update/'.$id, + 'url'=>'/rongyu/jsryinfo/update/'.$id, 'rongyuce'=>$id ); // 模板赋值 - $this->assign('list',$list); + $this->view->assign('list',$list); // 渲染 - return $this->fetch('create'); + return $this->view->fetch('create'); } /** diff --git a/app/rongyu/route/rongyu.php b/app/rongyu/route/rongyu.php index 49423b7a..9fc5b9d2 100644 --- a/app/rongyu/route/rongyu.php +++ b/app/rongyu/route/rongyu.php @@ -56,19 +56,25 @@ Route::group('jiaoshi', function () { Route::rule('update/','Jiaoshi/update','put'); # 更新信息 Route::rule('delete/','Jiaoshi/delete','delete'); # 删除信息 Route::rule('status','Jiaoshi/setStatus','post'); # 删除信息 + }); // 教师荣誉信息 Route::group('jsryinfo', function () { - Route::rule('','jsryinfo/index','get'); # 信息列表 - Route::rule('data','jsryinfo/ajaxdata','post'); # 获取数据 - Route::rule('create','jsryinfo/create','get'); # 添加信息 - Route::rule('save','jsryinfo/save','post'); # 保存信息 - // Route::rule('read/','jsryinfo/read','get'); # 读取信息 - Route::rule('edit/','jsryinfo/edit','get'); # 修改信息 - Route::rule('update/','jsryinfo/update','put'); # 更新信息 - Route::rule('delete/','jsryinfo/delete','delete'); # 删除信息 - Route::rule('status','jsryinfo/setStatus','post'); # 删除信息 + Route::rule('','JsRongyuInfo/index','get'); # 信息列表 + Route::rule('data','JsRongyuInfo/ajaxdata','post'); # 获取数据 + Route::rule('create/','JsRongyuInfo/create','get'); # 添加信息 + Route::rule('save','JsRongyuInfo/save','post'); # 保存信息 + // Route::rule('read/','JsRongyuInfo/read','get'); # 读取信息 + Route::rule('edit/','JsRongyuInfo/edit','get'); # 修改信息 + Route::rule('update/','JsRongyuInfo/update','put'); # 更新信息 + Route::rule('delete/','JsRongyuInfo/delete','delete'); # 删除信息 + Route::rule('status','JsRongyuInfo/setStatus','post'); # 删除信息 + Route::rule('createall/','JsRongyuInfo/createAll','get'); # 批量导入 + Route::rule('saveall','JsRongyuInfo/saveAll','post'); # 批量保存 + Route::rule('list/','JsRongyuInfo/rongyuList','get'); # 批量保存 + + }); \ No newline at end of file diff --git a/app/rongyu/view/jiaoshi/index.html b/app/rongyu/view/jiaoshi/index.html index 5eabd667..8f0fc341 100644 --- a/app/rongyu/view/jiaoshi/index.html +++ b/app/rongyu/view/jiaoshi/index.html @@ -68,7 +68,7 @@ {field: 'title', title: '荣誉名称',sort: true, minWidth:240}, {field: 'fzschool', title: '颁奖单位',sort: true,templet:function(d){ var str=''; - if(d.fz_school) + if(d.fzSchool) { str = d.fzSchool.jiancheng; } @@ -84,7 +84,7 @@ }}, {field: "category",title: '级别',templet:function(d){ var str=''; - if(d.fz_school) + if(d.fzSchool) { str = d.fzSchool.dwJibie.title; } @@ -108,7 +108,7 @@ cjgl.delAll(checkStatus,'jiaoshi/delete','mytable'); break; case 'add': - cjgl.add('添加荣誉册','jiaoshi/create','600','400'); + cjgl.add('添加荣誉册','jiaoshi/create','600','300'); break; }; }); @@ -120,16 +120,16 @@ var tr = obj.tr; //获得当前行 tr 的DOM对象 switch(layEvent){ case 'detail':// 查看 - parent.x_admin_add_to_tab(obj.data.title + ' 列表','rylist/'+obj.data.id,true); + parent.xadmin.add_tab(obj.data.title + ' 列表','/rongyu/jsryinfo/list/'+obj.data.id,true); break; case 'del':// 删除 cjgl.del(obj,"jiaoshi/delete"); break; case 'edit':// 编辑 - cjgl.add('编辑荣誉册','jiaoshi/edit/'+obj.data.id,'600','400'); + cjgl.add('编辑荣誉册','jiaoshi/edit/'+obj.data.id,'600','300'); break; case 'more':// 状态 - cjgl.add('批传','jsryinfoaddall/'+obj.data.id,'300','200'); + cjgl.add('批传','/rongyu/jsryinfocreateall/'+obj.data.id,'300','200'); break; }; }); diff --git a/app/rongyu/view/js_rongyu_info/create.html b/app/rongyu/view/js_rongyu_info/create.html index c084b8c4..3f01a4d8 100644 --- a/app/rongyu/view/js_rongyu_info/create.html +++ b/app/rongyu/view/js_rongyu_info/create.html @@ -29,7 +29,7 @@
{eq name="$list.set.formpost" value="PUT" } {if strlen($list.data.pic)>0} - + {else /} {/if} @@ -201,7 +201,7 @@ //执行实例 var uploadInst = upload.render({ elem: '#upload' //绑定元素 - ,url: "{:url('upload')}" //上传接口 + ,url: "/rongyu/danwei/upload" //上传接口 ,done: function(res){ if(res.val == 1){ $('#pic').val(res.url); @@ -210,7 +210,7 @@ } ,data: { text: '教师荣誉' - ,serurl:'rongyu_teacher\\' + ,serurl:'rongyu_teacher' } ,acceptMime:'.jpg,.jpeg,.png' diff --git a/app/rongyu/view/js_rongyu_info/create_all.html b/app/rongyu/view/js_rongyu_info/create_all.html index 7307687b..0075e5e0 100644 --- a/app/rongyu/view/js_rongyu_info/create_all.html +++ b/app/rongyu/view/js_rongyu_info/create_all.html @@ -17,13 +17,13 @@ layui.use('upload', function(){ //执行实例 var uploadInst = upload.render({ elem: '#upload' //绑定元素 - ,url: "{$list.set.url}" //上传接口 + ,url: "/rongyu/danwei/saveall" //上传接口 ,done: function(res){ layer.msg(res.msg); } ,data: { text: '教师荣誉' - ,serurl:'rongyu_teacher\\' + ,serurl:'rongyu_teacher' } ,multiple:true diff --git a/app/rongyu/view/js_rongyu_info/index.html b/app/rongyu/view/js_rongyu_info/index.html index 688e47fc..f51944c7 100644 --- a/app/rongyu/view/js_rongyu_info/index.html +++ b/app/rongyu/view/js_rongyu_info/index.html @@ -72,9 +72,9 @@ {type:'checkbox', fixed: 'left'}, {title: '荣誉册',minWidth:180,templet:function(d){ var str=''; - if(d.ry_tuce) + if(d.ryTuce) { - str = d.ry_tuce.title; + str = d.ryTuce.title; } return str; }}, @@ -82,13 +82,13 @@ {field: 'title', title: '荣誉名称',minWidth:180,sort: true}, {title: '获奖人',minWidth:100,templet:function(d){ var str=''; - if(d.hj_jsry) + if(d.hjJsry) { - for (var k = 0, length = d.hj_jsry.length; k < length; k++) { + for (var k = 0, length = d.hjJsry.length; k < length; k++) { if(k == 0){ - str = d.hj_jsry[k].teacher.xingming; + str = d.hjJsry[k].teacher.xingming; }else{ - str =str+'、'+d.hj_jsry[k].teacher.xingming; + str =str+'、'+d.hjJsry[k].teacher.xingming; } } } @@ -96,17 +96,17 @@ }}, {field: "jiangxiang",title: '奖项',minWidth:100,sort: true,templet:function(d){ var str=''; - if(d.jx_category) + if(d.jxCategory) { - str = d.jx_category.title; + str = d.jxCategory.title; } return str; }}, {title: '颁奖单位项',minWidth:260,sort: true,templet:function(d){ var str=''; - if(d.ry_tuce) + if(d.ryTuce) { - str = d.ry_tuce.fz_school.title; + str = d.ryTuce.fzSchool.title; } return str; }}, @@ -124,10 +124,10 @@ switch(obj.event){ case 'dels': var checkStatus = table.checkStatus('mytable'); //idmytable 即为基础参数 id 对应的值 - cjgl.delAll(checkStatus,'/jsryinfo','mytable'); + cjgl.delAll(checkStatus,'jsryinfo/delete','mytable'); break; case 'add': - cjgl.add('添加荣誉','/jsryinfo/create','','',true); + cjgl.add('添加荣誉','jsryinfo/create','','',true); break; }; }); @@ -139,10 +139,10 @@ var tr = obj.tr; //获得当前行 tr 的DOM对象 switch(layEvent){ case 'del':// 删除 - cjgl.del(obj,"/jsryinfo"); + cjgl.del(obj,"jsryinfo/delete"); break; case 'edit':// 编辑 - cjgl.add('编辑荣誉','/jsryinfo/'+obj.data.id+'/edit','','',true); + cjgl.add('编辑荣誉','jsryinfo/edit/'+obj.data.id,'','',true); break; }; }); diff --git a/app/rongyu/view/js_rongyu_info/rongyu_list.html b/app/rongyu/view/js_rongyu_info/rongyu_list.html index 9f4258cb..92fea71d 100644 --- a/app/rongyu/view/js_rongyu_info/rongyu_list.html +++ b/app/rongyu/view/js_rongyu_info/rongyu_list.html @@ -1,5 +1,5 @@ -{extend name="common@list" /} +{extend name=".././view/list.html" /} {block name="jsset"} {/block} @@ -75,13 +75,13 @@ {field: 'bianhao', title: '获奖编号', minWidth:140,sort: true}, {title: '获奖人', minWidth:120,templet:function(d){ var str=''; - if(d.hj_jsry) + if(d.hjJsry) { - for (var k = 0, length = d.hj_jsry.length; k < length; k++) { + for (var k = 0, length = d.hjJsry.length; k < length; k++) { if(k == 0){ - str = d.hj_jsry[k].teacher.xingming; + str = d.hjJsry[k].teacher.xingming; }else{ - str =str+'、'+d.hj_jsry[k].teacher.xingming; + str =str+'、'+d.hjJsry[k].teacher.xingming; } } } @@ -89,13 +89,15 @@ }}, {title: '参与人', minWidth:120,templet:function(d){ var str=''; - if(d.cy_jsry) + if(d.cyJsry) { - for (var k = 0, length = d.cy_jsry.length; k < length; k++) { - if(k == 0){ - str = d.cy_jsry[k].teacher.xingming; - }else{ - str =str+'、'+d.cy_jsry[k].teacher.xingming; + for (var k = 0; k < d.cyJsry.length; k++) { + if(d.cyJsry[k].teacher){ + if(k == 0){ + str = d.cyJsry[k].teacher.xingming; + }else{ + str =str+'、'+d.cyJsry[k].teacher.xingming; + } } } } @@ -103,17 +105,17 @@ }}, {field: "subject",title: '所属学科',minWidth:120,sort: true,templet:function(d){ var str=''; - if(d.ry_subject) + if(d.rySubject) { - str = d.ry_subject.title; + str = d.rySubject.title; } return str; }}, {field: "jiangxiang",title: '奖项', minWidth:120,sort: true,templet:function(d){ var str=''; - if(d.jx_category) + if(d.jxCategory) { - str = d.jx_category.title; + str = d.jxCategory.title; } return str; }}, @@ -134,13 +136,13 @@ switch(obj.event){ case 'dels': var checkStatus = table.checkStatus('mytable'); //idmytable 即为基础参数 id 对应的值 - cjgl.delAll(checkStatus,'/jsryinfo','mytable'); + cjgl.delAll(checkStatus,'/rongyu/jsryinfo/delete','mytable'); break; case 'add': - cjgl.add('添加荣誉','/jsryinfoadd/'+"{$list.rongyuce}",'','',true); + cjgl.add('添加荣誉','/rongyu/jsryinfo/create/'+"{$list.rongyuce}",'','',true); break; case 'download': - cjgl.add('下载荣誉信息','/ryout/'+"{$list.rongyuce}",'300','200',false); + cjgl.add('下载荣誉信息','/rongyu/jsryinfo/ryout/'+"{$list.rongyuce}",'300','200',false); break; }; }); @@ -152,10 +154,10 @@ var tr = obj.tr; //获得当前行 tr 的DOM对象 switch(layEvent){ case 'del':// 删除 - cjgl.del(obj,"/jsryinfo"); + cjgl.del(obj,"/rongyu/jsryinfo/delete"); break; case 'edit':// 编辑 - cjgl.add('编辑荣誉','/jsryinfo/'+obj.data.id+'/edit','','',true); + cjgl.add('编辑荣誉','/rongyu/jsryinfo/edit/'+obj.data.id,'','',true); break; }; }); diff --git a/view/list.html b/view/list.html index a782fce9..4a0fdc79 100644 --- a/view/list.html +++ b/view/list.html @@ -96,7 +96,12 @@ //监听指定开关 lForm.on('switch(status)', function(data){ - cjgl.status(data,"{:url('status')}"); + var status = "{$list.status ? $list.status : ''}"; + if(typeof status == "undefined" || status == null || status == "") + { + status = "{:url('status')}"; + } + cjgl.status(data,status); }); });