From a029f7ba801719ba8850c8fb0a49594602e97585 Mon Sep 17 00:00:00 2001 From: win7 Date: Thu, 5 Dec 2019 15:03:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=B3=BB=E7=BB=9F=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/BaseController.php | 1 + app/chengji/controller/Index.php | 3 + app/chengji/route/chengji.php | 61 +-- app/common.php | 354 ++++++++++++++++++ app/common/view/create.html | 72 ++++ app/common/view/createhref.html | 40 ++ app/index/controller/Index.php | 6 +- app/index/view/index/index.html | 4 +- app/middleware/Auth.php | 2 - app/system/controller/Fields.php | 5 +- app/system/controller/SystemBase.php | 6 +- app/system/route/system.php | 22 +- app/system/view/fields/index.html | 4 +- .../{system_base => systembase}/edit.html | 8 +- database/seeds/Rule.php | 4 +- public/list.html | 137 +++++++ public/static/x-admin2.2/js/cjgl.js | 248 ++++++++++++ public/static/x-admin2.2/js/cookie.js | 38 ++ public/static/x-admin2.2/js/md5.min.js | 2 + view/list.html | 6 +- 20 files changed, 964 insertions(+), 59 deletions(-) create mode 100644 app/common/view/create.html create mode 100644 app/common/view/createhref.html rename app/system/view/{system_base => systembase}/edit.html (96%) create mode 100644 public/list.html create mode 100644 public/static/x-admin2.2/js/cjgl.js create mode 100644 public/static/x-admin2.2/js/cookie.js create mode 100644 public/static/x-admin2.2/js/md5.min.js diff --git a/app/BaseController.php b/app/BaseController.php index 4d8eccad..3db11d72 100644 --- a/app/BaseController.php +++ b/app/BaseController.php @@ -54,6 +54,7 @@ abstract class BaseController { $this->app = $app; $this->request = $this->app->request; + $this->view = $this->app->view; // 控制器初始化 $this->initialize(); diff --git a/app/chengji/controller/Index.php b/app/chengji/controller/Index.php index 34e920c2..5562623d 100644 --- a/app/chengji/controller/Index.php +++ b/app/chengji/controller/Index.php @@ -24,6 +24,9 @@ class Index extends BaseController 'url'=>'/chengji/malu', ); + dump('aa'); + halt('aa'); + // 模板赋值 $this->assign('list',$list); diff --git a/app/chengji/route/chengji.php b/app/chengji/route/chengji.php index b4f1bbce..105c7025 100644 --- a/app/chengji/route/chengji.php +++ b/app/chengji/route/chengji.php @@ -12,46 +12,47 @@ use think\facade\Route; //系统设置路由 -Route::resource('/','chengji/Index'); +// Route::resource('/','index/index'); +Route::get('/','index/index'); -// 扫码录入成绩 -Route::get('chengji/malu','chengji/Index/malu'); -Route::put('chengji/malu','chengji/Index/malusave'); -Route::post('chengji/read','chengji/Index/read'); -// 表格录入成绩 -Route::get('chengji/biaolu','chengji/Index/biaolu'); -Route::post('chengji/biaolu','chengji/Index/saveAll'); -// 已录成绩统计 -Route::get('cjtongji/:kaoshi/yilucnt','chengji/Tongji/yiluCnt'); # 年级成绩统计列表 +// // 扫码录入成绩 +// Route::get('chengji/malu','chengji/Index/malu'); +// Route::put('chengji/malu','chengji/Index/malusave'); +// Route::post('chengji/read','chengji/Index/read'); +// // 表格录入成绩 +// Route::get('chengji/biaolu','chengji/Index/biaolu'); +// Route::post('chengji/biaolu','chengji/Index/saveAll'); +// // 已录成绩统计 +// Route::get('cjtongji/:kaoshi/yilucnt','chengji/Tongji/yiluCnt'); # 年级成绩统计列表 -// 获取学生成绩列表 -Route::get('chengji/:kaoshi/stuChengjilist','chengji/Index/index'); -// Route::delete('chengji/:kaoshi/cj','chengji/Index/delete'); # 删除考试成绩 -Route::get('readcjadd/:kaohao','chengji/Index/readAdd'); # 查看录入成绩人信息 -// 下载学生成绩 -Route::get('chengji/:kaoshi/dwChengji','chengji/Index/dwChengji'); -Route::post('chengji/dwChengji','chengji/Index/dwchengjixls'); -// 批量删除学生成绩 -Route::get('deletecjs/:kaoshi','chengji/Index/deletecjs'); -Route::post('deletecjmore','chengji/Index/deletecjmore'); +// // 获取学生成绩列表 +// Route::get('chengji/:kaoshi/stuChengjilist','chengji/Index/index'); +// // Route::delete('chengji/:kaoshi/cj','chengji/Index/delete'); # 删除考试成绩 +// Route::get('readcjadd/:kaohao','chengji/Index/readAdd'); # 查看录入成绩人信息 +// // 下载学生成绩 +// Route::get('chengji/:kaoshi/dwChengji','chengji/Index/dwChengji'); +// Route::post('chengji/dwChengji','chengji/Index/dwchengjixls'); +// // 批量删除学生成绩 +// Route::get('deletecjs/:kaoshi','chengji/Index/deletecjs'); +// Route::post('deletecjmore','chengji/Index/deletecjmore'); -// 班级成绩统计表格 -Route::get('bjtongji/:kaoshi/biaoge','chengji/Bjtongji/Biaoge'); # 班级成绩统计列表 -// 下载班级成绩统计表格 -Route::get('bjtongji/:kaoshi/dwBanji','chengji/Bjtongji/dwBanji'); -Route::post('bjtongji/dwBanji','chengji/Bjtongji/dwBanjixls'); +// // 班级成绩统计表格 +// Route::get('bjtongji/:kaoshi/biaoge','chengji/Bjtongji/Biaoge'); # 班级成绩统计列表 +// // 下载班级成绩统计表格 +// Route::get('bjtongji/:kaoshi/dwBanji','chengji/Bjtongji/dwBanji'); +// Route::post('bjtongji/dwBanji','chengji/Bjtongji/dwBanjixls'); -// 年级成绩统计表格 -Route::get('njtongji/:kaoshi/biaoge','chengji/Njtongji/Biaoge'); # 年级成绩统计列表 -// 下载年级成绩统计表格 -Route::get('njtongji/:kaoshi/dwNianji','chengji/Njtongji/dwNianji'); -Route::post('njtongji/dwNanji','chengji/Njtongji/dwNianjixls'); +// // 年级成绩统计表格 +// Route::get('njtongji/:kaoshi/biaoge','chengji/Njtongji/Biaoge'); # 年级成绩统计列表 +// // 下载年级成绩统计表格 +// Route::get('njtongji/:kaoshi/dwNianji','chengji/Njtongji/dwNianji'); +// Route::post('njtongji/dwNanji','chengji/Njtongji/dwNianjixls'); diff --git a/app/common.php b/app/common.php index 57cb6d83..b54b3d64 100644 --- a/app/common.php +++ b/app/common.php @@ -1,2 +1,356 @@ +// +---------------------------------------------------------------------- + // 应用公共文件 + +// 获取类别列表 +function getCategory($id = '0') +{ + + $category = new \app\system\model\Category; + + // 根据父级id查询类别列表 + $list = $category + ->where('pid',$id) + ->where('status',1) + ->field('id,title') + ->select(); + + // 返回类别列表 + return $list; +} + + +// 获取类别名称 +function getCategoryTitle($id) +{ + $category = new \app\system\model\Category; + // 根据id查询类别名 + $value = $category + ->where('id',$id) + ->vlaue('title'); + // 返回类别名 + return $value; +} + + +function nianjiList($riqi=0) +{ + // 定义学年时间节点日期为每年的8月10日 + // $yd = '8-10'; + $time = new think\helper\Time(); + if($riqi == 0) + { + $jiedian = strtotime(date('Y').'-8-1'); + $thisday = $time->today(); + }else{ + $jiedian = strtotime(date('Y',$riqi).'-8-1'); + $thisday = $riqi; + } + + + if($thisday[0]<=$jiedian) + { + $str = 1; + }else{ + $str = 0; + } + + $nian = date('Y') - $str; + + $njlist = array(); + + $njlist[$nian]='一年级'; + $njlist[$nian-1]='二年级'; + $njlist[$nian-2]='三年级'; + $njlist[$nian-3]='四年级'; + $njlist[$nian-4]='五年级'; + $njlist[$nian-5]='六年级'; + + return $njlist; +} + + +// 班级列表 +function banjinamelist() +{ + $bjarr = array( + '1'=>'一班', + '2'=>'二班', + '3'=>'三班', + '4'=>'四班', + '5'=>'五班', + '6'=>'六班', + '7'=>'七班', + '8'=>'八班', + '9'=>'九班', + '10'=>'十班', + '11'=>'十一班', + '12'=>'十二班', + '13'=>'十三班', + '14'=>'十四班', + '15'=>'十五班', + '16'=>'十六班', + '17'=>'十七班', + '18'=>'十八班', + '19'=>'十九班', + '20'=>'二十班', + '21'=>'二十一班', + '22'=>'二十二班', + '23'=>'二十三班', + '24'=>'二十四班', + '25'=>'二十五班', + ); + + return $bjarr; +} + + + + +/** +* $date是时间戳 +* $type为1的时候是虚岁,2的时候是周岁 +*/ +function getAgeByBirth($date = 0,$type = 1){ + $nowYear = date("Y",time()); + $nowMonth = date("m",time()); + $nowDay = date("d",time()); + $birthYear = date("Y",$date); + $birthMonth = date("m",$date); + $birthDay = date("d",$date); + if($type == 1){ + $age = $nowYear - ($birthYear - 1); + }elseif($type == 2){ + if($nowMonth<$birthMonth){ + $age = $nowYear - $birthYear - 1; + }elseif($nowMonth==$birthMonth){ + if($nowDay<$birthDay){ + $age = $nowYear - $birthYear - 1; + }else{ + $age = $nowYear - $birthYear; + } + }else{ + $age = $nowYear - $birthYear; + } + } + return $age; +} + + +// EXCEL表格列名 +function excelLieming() +{ + $liemingarr = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','AA','AB','AC','AD','AE','AF']; + return $liemingarr; +} + + + +// 单位列表 +function schlist($low='班级',$high='其它级',$xueduan=array()) +{ + // 实例化单位模型 + $sch = new \app\system\model\School; + // 实例化类别数据模型 + $cat = new \app\system\model\Category; + // 获取获取级别列表 + $catlist = $cat->where('pid',102) + ->where('status',1) + ->column('title,id'); + + // 获取学段列表 + if(count($xueduan)>0){ + $xdlist = $cat->where('pid',103) + ->where('status',1) + ->where('title','in',$xueduan) + ->column('id'); + }else{ + $xdlist = $cat->where('pid',103) + ->where('status',1) + ->column('id'); + } + + + // 查询学校 + $schlist = $sch->where('jibie','between',[$catlist[$low],$catlist[$high]]) + ->where('status',1) + ->where('xueduan','in',$xdlist) + ->order(['paixu']) + ->column('id,title,jiancheng'); + + return $schlist; +} + + +// 整理教师名 +function teacherNames($list = array()) +{ + if(count($list) == 0 ) + { + return ''; + } + + + $names = ''; + foreach ($list as $key => $value) { + if($key == 0) + { + $names = $value['teacher']['xingming']; + }else{ + $names = $names . '、'. $value['teacher']['xingming']; + } + } + + return $names; +} + + + +/** +* 上传文件,并返回文件存储地址 +* +* @access public +* @param array $list 文件信息 +* @param mixed $list['serurl'] 文件要存到哪儿 +* @param mixed $list[''] 文件要存到哪儿 +* @param mixed $file 文件 +* @param array $isSave 是否将文件信息保存到数据库 +* @return array 返回类型 数组 +* @return msg string 提示 +* @return val string 结果 +* @return url string 如果保存到数据库,返回完整路径,否则保存部分路径。 +*/ +function upload($list,$file,$isSave=false) +{ + // 声明默认目录 + $myrul = '..\public\uploads\\'; + + // 实例化文件数据模型 + $field = new \app\system\model\Fields; + + + // 移动到框架应用根目录/uploads/ 目录下 + $info = $file->move($myrul.$list['serurl']); + + + // 如果上传成功 + if(!$info){ + // 上传失败获取错误信息 + $data = array('msg'=>$file->getError(),'val'=>false,'url'=>null); + return $data; + } + + + // 成功上传后 获取上传信息 + $list['category'] = $info->getExtension(); + $list['url'] = $list['serurl'].$info->getSaveName(); + $list['newname'] = $info->getFilename(); + $list['hash'] = $info->hash('sha1'); + $list['userid'] = session('userid'); + $list['oldname'] = $info->getInfo('name'); + $list['fieldsize'] = $info->getInfo('size'); + // $list['bianjitime'] = Null; + + + // 如果需要保存文件 + if($isSave == true){ + + //将文件信息保存 + $data = $field->create($list); + + if($data){ + $data = array( + 'msg'=>'上传成功' + ,'val'=>true + ,'url'=>$myrul.$list['serurl'].$info->getSaveName() + ); + }else{ + $data = array( + 'msg'=>'保存文件信息失败' + ,'val'=>false + ); + } + }else{ + $data = array( + 'msg'=>'上传成功' + ,'val'=>true + ,'url'=>$info->getSaveName() + ); + } + + + + // 返回信息 + return $data; +} + + + +/** + * 数组重新排序 + * $array 要排序的数组 + * $field 排序字段 + * $sort 排序方式 SORT_DESC 降序;SORT_ASC 升序 + * */ +function arraySequence($data, $field = 'id', $sort = 'desc') { + // 排序方式 + $sort == 'desc' ? $sort = SORT_DESC : $sort = SORT_ASC; + // 获取参考列 + $column = array_column($data, $field); + // 排序 + array_multisort($column, $sort, $data); + + return $data; +} + + + + +/** + * 根据键值,用数组2的值替换数组1的值 + * $cover 覆盖数组,存储新值的数组 + * $covered 被覆盖数组,被更改值的数组 + * 返回 新arr1 + * */ +function array_cover( $cover = array(), $covered = array() ) +{ + foreach ($cover as $key => $value) { + if(isset($covered[$key]) == true) + { + $covered[$key] = $cover[$key]; + } + } + return $covered; +} + + +/** + * 根据考试ID值,判断考试是否已经结束 + * $kaoshiid 考试ID + * 返回 $data + * */ +function enddate($kaoshiid) +{ + $ks = new app\kaoshi\model\Kaoshi; + $enddate = $ks->where('id',$kaoshiid)->value('enddate'); + + $thistime = time(); + if($enddate + + + + + {$list.set.webtitle} + + + + {load href="__XADMIN__/css/font.css" /} + {load href="__XADMIN__/css/xadmin.css" /} + {load href="__XADMIN__/js/jquery.min.js" /} + {load href="__XADMIN__/lib/layui/layui.js" /} + {load href="__XADMIN__/js/xadmin.js" /} + {load href="__XADMIN__/js/cookie.js" /} + + + {block name="jscss"}{/block} + + +
+ {block name="form"}{/block} +
+ + {block name="myjs"}{/block} + + \ No newline at end of file diff --git a/app/common/view/createhref.html b/app/common/view/createhref.html new file mode 100644 index 00000000..f1c24a7f --- /dev/null +++ b/app/common/view/createhref.html @@ -0,0 +1,40 @@ + + + + + + {$list.set.webtitle} + + + + {load href="__XADMIN__/css/font.css" /} + {load href="__XADMIN__/css/xadmin.css" /} + {load href="__XADMIN__/js/jquery.min.js" /} + {load href="__XADMIN__/lib/layui/layui.js" /} + {load href="__XADMIN__/js/xadmin.js" /} + {load href="__XADMIN__/js/cookie.js" /} + + + {block name="jscss"}{/block} + + +
+ {block name="form"}{/block} +
+ + {block name="myjs"}{/block} + + \ No newline at end of file diff --git a/app/index/controller/Index.php b/app/index/controller/Index.php index 59a99ab3..21d8bb38 100644 --- a/app/index/controller/Index.php +++ b/app/index/controller/Index.php @@ -80,11 +80,11 @@ class Index extends BaseController ->order(['paixu']) ->select()->toArray(); - $view = app('view'); + // $view = app('view'); // 模版赋值 - $view->assign('list',$list); + $this->view->assign('list',$list); // 渲染输出 - return $view->fetch(); + return $this->view->fetch(); } diff --git a/app/index/view/index/index.html b/app/index/view/index/index.html index b15169d1..eeaa1487 100644 --- a/app/index/view/index/index.html +++ b/app/index/view/index/index.html @@ -91,9 +91,9 @@ {volist name="$value.authCid" id="vo"}
  • - + - {$vo['title']}{php}echo(url($vo['url'])){/php} + {$vo['title']}
  • {/volist} diff --git a/app/middleware/Auth.php b/app/middleware/Auth.php index 5668f7d7..85f1c441 100644 --- a/app/middleware/Auth.php +++ b/app/middleware/Auth.php @@ -72,13 +72,11 @@ class Auth $auth = new AuthHandle; - // 验证方法 if( $auth->check($url, session('userid')) == false && $except == false && $admin == false ){// 第一个参数是规则名称,第二个参数是用户UID $this->error('哎哟~ 因为权限不足'); } - return $next($request); } } diff --git a/app/system/controller/Fields.php b/app/system/controller/Fields.php index 9ca8bdce..d242c949 100644 --- a/app/system/controller/Fields.php +++ b/app/system/controller/Fields.php @@ -18,12 +18,13 @@ class Fields extends BaseController { // 设置要给模板赋值的信息 $list['webtitle'] = '文件列表'; + $list['dataurl'] = '/system/file/data'; // 模板赋值 - $this->assign('list',$list); + $this->view->assign('list',$list); // 渲染模板 - return $this->fetch(); + return $this->view->fetch(); } // 获取单位列表数据 diff --git a/app/system/controller/SystemBase.php b/app/system/controller/SystemBase.php index 825d6327..6f6bee79 100644 --- a/app/system/controller/SystemBase.php +++ b/app/system/controller/SystemBase.php @@ -22,15 +22,15 @@ class SystemBase extends BaseController 'webtitle'=>'设置系统信息', 'butname'=>'设置', 'formpost'=>'PUT', - 'url'=>'/sysbase/'.$list['data']['id'], + 'url'=>'system/id/'.$list['data']['id'], ); // 模板赋值 - $this->assign('list',$list); + $this->view->assign('list',$list); // 渲染模板 - return $this->fetch(); + return $this->view->fetch(); } diff --git a/app/system/route/system.php b/app/system/route/system.php index d9ec8d0e..d0904d4f 100644 --- a/app/system/route/system.php +++ b/app/system/route/system.php @@ -12,7 +12,21 @@ use think\facade\Route; //系统设置路由 -Route::resource('sysbase','system/SystemBase'); -Route::resource('category','system/Category'); -Route::resource('school','system/School'); -Route::resource('fields','system/Fields'); +// Route::get('/','systembase/edit'); +// Route::group('sys', function () { +// Route::get('/', 'systembase/edit'); +// // Route::rule(':name', 'blog/read'); +// })->ext('html')->pattern(['id' => '\d+', 'name' => '\w+']); +// Route::resource('sysbase','system/SystemBase'); +// Route::resource('category','system/Category'); +// Route::resource('school','system/School'); +// Route::resource('fields','system/Fields'); + +// systembase +Route::rule('/','systembase/edit','get'); +Route::rule('/','systembase/update','put'); + +// fields +Route::rule('file','fields/index','get'); +Route::rule('file/data','fields/ajaxdata','post'); + diff --git a/app/system/view/fields/index.html b/app/system/view/fields/index.html index f73739cc..7787cc11 100644 --- a/app/system/view/fields/index.html +++ b/app/system/view/fields/index.html @@ -1,5 +1,5 @@ -{extend name="common@list" /} +{extend name="list.html" /} {block name="jsset"} {/block} @@ -8,7 +8,7 @@ 系统管理 文件管理 文件列表 - + {$list['dataurl']} {/block} {block name="search"}
    diff --git a/app/system/view/system_base/edit.html b/app/system/view/systembase/edit.html similarity index 96% rename from app/system/view/system_base/edit.html rename to app/system/view/systembase/edit.html index 744aa21f..431cb694 100644 --- a/app/system/view/system_base/edit.html +++ b/app/system/view/systembase/edit.html @@ -87,15 +87,11 @@ dataType:'json', success:function(result){ // 弹出提示 - parent.layer.msg(result.msg, - { - icon:1, - time:2000 - }); + layer.msg(result.msg); }, error:function(xhr,status,error) { layer.msg('数据处理错误',{ - icon: 1, + icon: 2, time: 2000 //2秒关闭(如果不配置,默认是3秒) }); } diff --git a/database/seeds/Rule.php b/database/seeds/Rule.php index f8a6a18c..ebc754d6 100644 --- a/database/seeds/Rule.php +++ b/database/seeds/Rule.php @@ -53,8 +53,8 @@ class Rule extends Seeder // 系统设置 ['id'=>701,'title'=>'类别管理','name'=>'system/Category/index','paixu'=>1,'ismenu' =>1,'pid' =>7,'url'=>'/category',], ['id'=>702,'title'=>'单位管理','name'=>'system/School/index','paixu'=>2,'ismenu' =>1,'pid' =>7,'url'=>'/school',], - ['id'=>703,'title'=>'文件管理','name'=>'system/Fields/index','paixu'=>3,'ismenu' =>1,'pid' =>7,'url'=>'/fields',], - ['id'=>704,'title'=>'系统设置','name'=>'system/SystemBase/edit','paixu'=>10,'ismenu' =>1,'pid' =>7,'url'=>'/sysbase/1/edit',], + ['id'=>703,'title'=>'文件管理','name'=>'system/Fields/index','paixu'=>3,'ismenu' =>1,'pid' =>7,'url'=>'/system/file',], + ['id'=>704,'title'=>'系统设置','name'=>'system/SystemBase/edit','paixu'=>10,'ismenu' =>1,'pid' =>7,'url'=>'/sysbase/',], diff --git a/public/list.html b/public/list.html new file mode 100644 index 00000000..cae9f213 --- /dev/null +++ b/public/list.html @@ -0,0 +1,137 @@ + + + + + {$list.webtitle} + + + + {load href="__XADMIN__/css/font.css" /} + {load href="__XADMIN__/css/xadmin.css" /} + {load href="__XADMIN__/js/jquery.min.js" /} + {load href="__XADMIN__/lib/layui/layui.js" /} + {load href="__XADMIN__/js/xadmin.js" /} + {load href="__XADMIN__/js/cookie.js" /} + {load href="__XADMIN__/js/md5.min.js" /} + {block name="jsset"}{/block} + + + + +
    + {block name="nav"}{/block} + + +
    +
    +
    +
    +

    筛选

    +
    +
    + +
    +
    +
    +
    + {block name="table"}{/block} +
    + + + + {block name="myjs"}{/block} + + + \ No newline at end of file diff --git a/public/static/x-admin2.2/js/cjgl.js b/public/static/x-admin2.2/js/cjgl.js new file mode 100644 index 00000000..e8966c21 --- /dev/null +++ b/public/static/x-admin2.2/js/cjgl.js @@ -0,0 +1,248 @@ +/** + 扩展cjgl模块 + **/ + +layui.define(['table'],function(exports){ //提示:模块也可以依赖其它模块,如:layui.define('layer', callback); + var table = layui.table; + var obj = { + // 新建弹窗 + add: function(title,url,width,height,max=false){ + x_admin_show(title,url,width,height,max); + }, + del:function(obj,url){ + layer.confirm('确认要删除吗?',function(index){ + $.ajax({ + url:url+'/m', + type:'DELETE', + data:{ + ids:obj.data.id + }, + success:function(result){ + if(result.val == 1) + { + obj.del(); + layer.msg('已删除!'); + }else{ + layer.msg('数据处理错误!',function(){}); + } + }, + error:function(result){ + layer.msg('数据扔半道啦。',function(){}); + }, + }); + }); + }, + delAll:function(obj,url,tableid){ + //判断是否选择数据 + if(obj.data.length==0){ + parent.layer.msg('请先选择要删除的数据行!',function(){}); + return ; + } + + layer.confirm('确认要删除吗?',function(index){ + // 捉一下所有被选中的数据 + var ids = ""; + for(var i=0;i
    请选择
    '); + // 声明变量 + var mydl = srcInput.next().children('dl'); + + // 获取数据 + $.post( + "/srcteacher", + { + "str":val, + }, + function(data,status){ + + if($.isEmptyObject(data)) + { + return true; + } + + for (var i = data.length - 1; i >= 0; i--) { + mydl.append('
    '+data[i].xingming+' '+data[i].js_danwei.jiancheng+' '+data[i].shengri+'
    '); + } + + } + ); + + + }, + // 添加教师 + addTeacher:function(myobj){ + var myId = $(myobj).attr('id') + ,teachername = $(myobj).attr('teachername') + ,addname = $(myobj).attr('addname') + ,myTitle = $(myobj).text() + ,myList = $(myobj).parent().parent() + ,myBut = $(myList).parent().parent(); + + if(myId){ + $(myBut).append('
    '+teachername+'
    '); + } + + $(myList).prev().val(''); + $(myList).remove(); + }, + // 删除教师 + delTeacher:function(myobj){ + $(myobj).parent().remove(); + } + }; + + //输出test接口 + exports('cjgl', obj); +}); \ No newline at end of file diff --git a/public/static/x-admin2.2/js/cookie.js b/public/static/x-admin2.2/js/cookie.js new file mode 100644 index 00000000..79b05ac7 --- /dev/null +++ b/public/static/x-admin2.2/js/cookie.js @@ -0,0 +1,38 @@ +function setCookie(name, value, expires, path, domain, secure) { + if(typeof is_remember!="undefined") + return false; + var today = new Date(); + today.setTime( today.getTime() ); + var expires_date = new Date( today.getTime() + (expires) ); + document.cookie= name + "=" + escape(value) + + ((expires) ? "; expires=" + expires_date.toGMTString() : "") + + ((path) ? "; path=" + path : "") + + ((domain) ? "; domain=" + domain : "") + + ((secure) ? "; secure" : ""); +} +function getCookie(name) { + var dc = document.cookie; + var prefix = name + "="; + var begin = dc.indexOf("; " + prefix); + if (begin == -1) { + begin = dc.indexOf(prefix); + if (begin != 0) return null; + } else { + begin += 2; + } + var end = document.cookie.indexOf(";", begin); + if (end == -1) { + end = dc.length; + } + return unescape(dc.substring(begin + prefix.length, end)); +} +function deleteCookie(name, path, domain) { + if (getCookie(name)) { + document.cookie = name + "=" + + ((path) ? "; path=" + path : "") + + ((domain) ? "; domain=" + domain : "") + + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; + } +} + + diff --git a/public/static/x-admin2.2/js/md5.min.js b/public/static/x-admin2.2/js/md5.min.js new file mode 100644 index 00000000..7d8a3f53 --- /dev/null +++ b/public/static/x-admin2.2/js/md5.min.js @@ -0,0 +1,2 @@ +!function(n){"use strict";function t(n,t){var r=(65535&n)+(65535&t);return(n>>16)+(t>>16)+(r>>16)<<16|65535&r}function r(n,t){return n<>>32-t}function e(n,e,o,u,c,f){return t(r(t(t(e,n),t(u,f)),c),o)}function o(n,t,r,o,u,c,f){return e(t&r|~t&o,n,t,u,c,f)}function u(n,t,r,o,u,c,f){return e(t&o|r&~o,n,t,u,c,f)}function c(n,t,r,o,u,c,f){return e(t^r^o,n,t,u,c,f)}function f(n,t,r,o,u,c,f){return e(r^(t|~o),n,t,u,c,f)}function i(n,r){n[r>>5]|=128<>>9<<4)]=r;var e,i,a,d,h,l=1732584193,g=-271733879,v=-1732584194,m=271733878;for(e=0;e>5]>>>t%32&255);return r}function d(n){var t,r=[];for(r[(n.length>>2)-1]=void 0,t=0;t>5]|=(255&n.charCodeAt(t/8))<16&&(o=i(o,8*n.length)),r=0;r<16;r+=1)u[r]=909522486^o[r],c[r]=1549556828^o[r];return e=i(u.concat(d(t)),512+8*t.length),a(i(c.concat(e),640))}function g(n){var t,r,e="";for(r=0;r>>4&15)+"0123456789abcdef".charAt(15&t);return e}function v(n){return unescape(encodeURIComponent(n))}function m(n){return h(v(n))}function p(n){return g(m(n))}function s(n,t){return l(v(n),v(t))}function C(n,t){return g(s(n,t))}function A(n,t,r){return t?r?s(t,n):C(t,n):r?m(n):p(n)}"function"==typeof define&&define.amd?define(function(){return A}):"object"==typeof module&&module.exports?module.exports=A:n.md5=A}(this); +//# sourceMappingURL=md5.min.js.map \ No newline at end of file diff --git a/view/list.html b/view/list.html index cae9f213..b5b8f669 100644 --- a/view/list.html +++ b/view/list.html @@ -51,7 +51,7 @@