diff --git a/app/admin/controller/Login.php b/app/admin/controller/Login.php index 683af7e..1ef2ed7 100644 --- a/app/admin/controller/Login.php +++ b/app/admin/controller/Login.php @@ -50,6 +50,8 @@ class Login 'login_num' => $admin['login_num'] + 1, ]; Db::name('admin')->where(['id' => $admin['id']])->update($data); + $group_access=Db::name('admin_group_access')->where(['uid' => $admin['id']])->find(); + $admin['group_access']=$group_access['group_id']; $session_admin = get_config('app.session_admin'); Session::set($session_admin, $admin); $token = make_token(); diff --git a/app/admin/controller/nk/Accommodation.php b/app/admin/controller/nk/Accommodation.php new file mode 100644 index 0000000..a4ae12e --- /dev/null +++ b/app/admin/controller/nk/Accommodation.php @@ -0,0 +1,86 @@ +adminInfo = get_login_admin(); + $this->category_id=308; + $this->url=[ + '/admin/nk.accommodation/index?category_id='.$this->category_id, + '/admin/nk.accommodation/add', + '/admin/nk.accommodation/edit', + '/admin/nk.accommodation/del', + '/admin/nk.accommodation/read', + ]; + } + /** + * 查看 + */ + public function index() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->index($params); + } + return view('nk/article/index',['url'=>$this->url]); + } + /** + * 添加 + */ + public function add() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->add($params); + }else{ + View::assign('editor', get_system_config('other','editor')); + View::assign('url', $this->url); + return view('nk/article/add'); + } + } + /** + * 修改 + */ + public function edit() + { + $params= get_params(); + (new Article())->edit($params); + return view('nk/article/edit',['url'=>$this->url]); + } + /** + * 查看信息 + */ + public function read() + { + $params = get_params(); + (new Article())->read($params); + + return view('nk/article/read',['url'=>$this->url]); + + } + /** + * 修改 + */ + public function del() + { + $params= get_params(); + (new Article())->del($params); + } +} \ No newline at end of file diff --git a/app/admin/controller/nk/Announce.php b/app/admin/controller/nk/Announce.php new file mode 100644 index 0000000..7087527 --- /dev/null +++ b/app/admin/controller/nk/Announce.php @@ -0,0 +1,86 @@ +adminInfo = get_login_admin(); + $this->category_id=302; + $this->url=[ + '/admin/nk.announce/index?category_id='.$this->category_id, + '/admin/nk.announce/add', + '/admin/nk.announce/edit', + '/admin/nk.announce/del', + '/admin/nk.announce/read', + ]; + } + /** + * 查看 + */ + public function index() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->index($params); + } + return view('nk/article/index',['url'=>$this->url]); + } + /** + * 添加 + */ + public function add() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->add($params); + }else{ + View::assign('editor', get_system_config('other','editor')); + View::assign('url', $this->url); + return view('nk/article/add'); + } + } + /** + * 修改 + */ + public function edit() + { + $params= get_params(); + (new Article())->edit($params); + return view('nk/article/edit',['url'=>$this->url]); + } + /** + * 查看信息 + */ + public function read() + { + $params = get_params(); + (new Article())->read($params); + + return view('nk/article/read',['url'=>$this->url]); + + } + /** + * 修改 + */ + public function del() + { + $params= get_params(); + (new Article())->del($params); + } +} \ No newline at end of file diff --git a/app/admin/controller/nk/Article.php b/app/admin/controller/nk/Article.php index 1fd9f6a..da428d4 100644 --- a/app/admin/controller/nk/Article.php +++ b/app/admin/controller/nk/Article.php @@ -23,9 +23,7 @@ class Article extends BaseController public function index($params) { - $where=[ - 'status'=>1 - ]; + $where['status']=1; if (isset($params['keywords'])){ $where[]=['title','like','%'.$params['keywords'].'%']; } @@ -49,7 +47,7 @@ class Article extends BaseController $category_id =$params['category_id']; if($category_id){ - $map[] = ['category_id','in',$category_id]; + $map[] = ['category_id','=',$category_id]; }else{ $map = []; } @@ -75,6 +73,7 @@ class Article extends BaseController ->where($map) ->page($params['page']) ->limit($params['limit']) + ->order('id desc') ->field('id,title,user_id,county,township,village,image,view_time') ->select(); @@ -86,7 +85,7 @@ class Article extends BaseController public function add($param){ // 检验完整性 try { - validate(\app\admin\validate\party\Article::class)->check($param); + validate(\app\admin\validate\nk\ArticleValidate::class)->check($param); } catch (ValidateException $e) { // 验证失败 输出错误信息 return to_assign(1, $e->getError()); @@ -106,7 +105,7 @@ class Article extends BaseController public function edit($param){ if (request()->isAjax()) { try { - validate(\app\admin\validate\party\Article::class)->check($param); + validate(\app\admin\validate\nk\ArticleValidate::class)->check($param); } catch (ValidateException $e) { // 验证失败 输出错误信息 return to_assign(1, $e->getError()); diff --git a/app/admin/controller/nk/Classroom.php b/app/admin/controller/nk/Classroom.php new file mode 100644 index 0000000..0a9db1a --- /dev/null +++ b/app/admin/controller/nk/Classroom.php @@ -0,0 +1,86 @@ +adminInfo = get_login_admin(); + $this->category_id=298; + $this->url=[ + '/admin/nk.classroom/index?category_id='.$this->category_id, + '/admin/nk.classroom/add', + '/admin/nk.classroom/edit', + '/admin/nk.classroom/del', + '/admin/nk.classroom/read', + ]; + } + /** + * 查看 + */ + public function index() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->index($params); + } + return view('nk/article/index',['url'=>$this->url]); + } + /** + * 添加 + */ + public function add() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->add($params); + }else{ + View::assign('editor', get_system_config('other','editor')); + View::assign('url', $this->url); + return view('nk/article/add'); + } + } + /** + * 修改 + */ + public function edit() + { + $params= get_params(); + (new Article())->edit($params); + return view('nk/article/edit',['url'=>$this->url]); + } + /** + * 查看信息 + */ + public function read() + { + $params = get_params(); + (new Article())->read($params); + + return view('nk/article/read',['url'=>$this->url]); + + } + /** + * 修改 + */ + public function del() + { + $params= get_params(); + (new Article())->del($params); + } +} \ No newline at end of file diff --git a/app/admin/controller/nk/Education.php b/app/admin/controller/nk/Education.php new file mode 100644 index 0000000..ab8935b --- /dev/null +++ b/app/admin/controller/nk/Education.php @@ -0,0 +1,86 @@ +adminInfo = get_login_admin(); + $this->category_id=299; + $this->url=[ + '/admin/nk.education/index?category_id='.$this->category_id, + '/admin/nk.education/add', + '/admin/nk.education/edit', + '/admin/nk.education/del', + '/admin/nk.education/read', + ]; + } + /** + * 查看 + */ + public function index() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->index($params); + } + return view('nk/article/index',['url'=>$this->url]); + } + /** + * 添加 + */ + public function add() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->add($params); + }else{ + View::assign('editor', get_system_config('other','editor')); + View::assign('url', $this->url); + return view('nk/article/add'); + } + } + /** + * 修改 + */ + public function edit() + { + $params= get_params(); + (new Article())->edit($params); + return view('nk/article/edit',['url'=>$this->url]); + } + /** + * 查看信息 + */ + public function read() + { + $params = get_params(); + (new Article())->read($params); + + return view('nk/article/read',['url'=>$this->url]); + + } + /** + * 修改 + */ + public function del() + { + $params= get_params(); + (new Article())->del($params); + } +} \ No newline at end of file diff --git a/app/admin/controller/nk/Eliminate.php b/app/admin/controller/nk/Eliminate.php new file mode 100644 index 0000000..9eea390 --- /dev/null +++ b/app/admin/controller/nk/Eliminate.php @@ -0,0 +1,86 @@ +adminInfo = get_login_admin(); + $this->category_id=149; + $this->url=[ + '/admin/nk.eliminate/index?category_id='.$this->category_id, + '/admin/nk.eliminate/add', + '/admin/nk.eliminate/edit', + '/admin/nk.eliminate/del', + '/admin/nk.eliminate/read', + ]; + } + /** + * 查看 + */ + public function index() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->index($params); + } + return view('nk/article/index',['url'=>$this->url]); + } + /** + * 添加 + */ + public function add() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->add($params); + }else{ + View::assign('editor', get_system_config('other','editor')); + View::assign('url', $this->url); + return view('nk/article/add'); + } + } + /** + * 修改 + */ + public function edit() + { + $params= get_params(); + (new Article())->edit($params); + return view('nk/article/edit',['url'=>$this->url]); + } + /** + * 查看信息 + */ + public function read() + { + $params = get_params(); + (new Article())->read($params); + + return view('nk/article/read',['url'=>$this->url]); + + } + /** + * 修改 + */ + public function del() + { + $params= get_params(); + (new Article())->del($params); + } +} \ No newline at end of file diff --git a/app/admin/controller/nk/Farming.php b/app/admin/controller/nk/Farming.php new file mode 100644 index 0000000..6dc61da --- /dev/null +++ b/app/admin/controller/nk/Farming.php @@ -0,0 +1,86 @@ +adminInfo = get_login_admin(); + $this->category_id=311; + $this->url=[ + '/admin/nk.farming/index?category_id='.$this->category_id, + '/admin/nk.farming/add', + '/admin/nk.farming/edit', + '/admin/nk.farming/del', + '/admin/nk.farming/read', + ]; + } + /** + * 查看 + */ + public function index() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->index($params); + } + return view('nk/article/index',['url'=>$this->url]); + } + /** + * 添加 + */ + public function add() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->add($params); + }else{ + View::assign('editor', get_system_config('other','editor')); + View::assign('url', $this->url); + return view('nk/article/add'); + } + } + /** + * 修改 + */ + public function edit() + { + $params= get_params(); + (new Article())->edit($params); + return view('nk/article/edit',['url'=>$this->url]); + } + /** + * 查看信息 + */ + public function read() + { + $params = get_params(); + (new Article())->read($params); + + return view('nk/article/read',['url'=>$this->url]); + + } + /** + * 修改 + */ + public function del() + { + $params= get_params(); + (new Article())->del($params); + } +} \ No newline at end of file diff --git a/app/admin/controller/nk/Feedback.php b/app/admin/controller/nk/Feedback.php new file mode 100644 index 0000000..fcefec5 --- /dev/null +++ b/app/admin/controller/nk/Feedback.php @@ -0,0 +1,86 @@ +adminInfo = get_login_admin(); + $this->category_id=165; + $this->url=[ + '/admin/nk.feedback/index?category_id='.$this->category_id, + '/admin/nk.feedback/add', + '/admin/nk.feedback/edit', + '/admin/nk.feedback/del', + '/admin/nk.feedback/read', + ]; + } + /** + * 查看 + */ + public function index() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->index($params); + } + return view('nk/article/index',['url'=>$this->url]); + } + /** + * 添加 + */ + public function add() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->add($params); + }else{ + View::assign('editor', get_system_config('other','editor')); + View::assign('url', $this->url); + return view('nk/article/add'); + } + } + /** + * 修改 + */ + public function edit() + { + $params= get_params(); + (new Article())->edit($params); + return view('nk/article/edit',['url'=>$this->url]); + } + /** + * 查看信息 + */ + public function read() + { + $params = get_params(); + (new Article())->read($params); + + return view('nk/article/read',['url'=>$this->url]); + + } + /** + * 修改 + */ + public function del() + { + $params= get_params(); + (new Article())->del($params); + } +} \ No newline at end of file diff --git a/app/admin/controller/nk/Fishing.php b/app/admin/controller/nk/Fishing.php new file mode 100644 index 0000000..cc5481f --- /dev/null +++ b/app/admin/controller/nk/Fishing.php @@ -0,0 +1,86 @@ +adminInfo = get_login_admin(); + $this->category_id=310; + $this->url=[ + '/admin/nk.fishing/index?category_id='.$this->category_id, + '/admin/nk.fishing/add', + '/admin/nk.fishing/edit', + '/admin/nk.fishing/del', + '/admin/nk.fishing/read', + ]; + } + /** + * 查看 + */ + public function index() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->index($params); + } + return view('nk/article/index',['url'=>$this->url]); + } + /** + * 添加 + */ + public function add() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->add($params); + }else{ + View::assign('editor', get_system_config('other','editor')); + View::assign('url', $this->url); + return view('nk/article/add'); + } + } + /** + * 修改 + */ + public function edit() + { + $params= get_params(); + (new Article())->edit($params); + return view('nk/article/edit',['url'=>$this->url]); + } + /** + * 查看信息 + */ + public function read() + { + $params = get_params(); + (new Article())->read($params); + + return view('nk/article/read',['url'=>$this->url]); + + } + /** + * 修改 + */ + public function del() + { + $params= get_params(); + (new Article())->del($params); + } +} \ No newline at end of file diff --git a/app/admin/controller/nk/Food.php b/app/admin/controller/nk/Food.php new file mode 100644 index 0000000..6f8425e --- /dev/null +++ b/app/admin/controller/nk/Food.php @@ -0,0 +1,86 @@ +adminInfo = get_login_admin(); + $this->category_id=307; + $this->url=[ + '/admin/nk.food/index?category_id='.$this->category_id, + '/admin/nk.food/add', + '/admin/nk.food/edit', + '/admin/nk.food/del', + '/admin/nk.food/read', + ]; + } + /** + * 查看 + */ + public function index() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->index($params); + } + return view('nk/article/index',['url'=>$this->url]); + } + /** + * 添加 + */ + public function add() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->add($params); + }else{ + View::assign('editor', get_system_config('other','editor')); + View::assign('url', $this->url); + return view('nk/article/add'); + } + } + /** + * 修改 + */ + public function edit() + { + $params= get_params(); + (new Article())->edit($params); + return view('nk/article/edit',['url'=>$this->url]); + } + /** + * 查看信息 + */ + public function read() + { + $params = get_params(); + (new Article())->read($params); + + return view('nk/article/read',['url'=>$this->url]); + + } + /** + * 修改 + */ + public function del() + { + $params= get_params(); + (new Article())->del($params); + } +} \ No newline at end of file diff --git a/app/admin/controller/nk/Government.php b/app/admin/controller/nk/Government.php new file mode 100644 index 0000000..196eb04 --- /dev/null +++ b/app/admin/controller/nk/Government.php @@ -0,0 +1,86 @@ +adminInfo = get_login_admin(); + $this->category_id=301; + $this->url=[ + '/admin/nk.government/index?category_id='.$this->category_id, + '/admin/nk.government/add', + '/admin/nk.government/edit', + '/admin/nk.government/del', + '/admin/nk.government/read', + ]; + } + /** + * 查看 + */ + public function index() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->index($params); + } + return view('nk/article/index',['url'=>$this->url]); + } + /** + * 添加 + */ + public function add() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->add($params); + }else{ + View::assign('editor', get_system_config('other','editor')); + View::assign('url', $this->url); + return view('nk/article/add'); + } + } + /** + * 修改 + */ + public function edit() + { + $params= get_params(); + (new Article())->edit($params); + return view('nk/article/edit',['url'=>$this->url]); + } + /** + * 查看信息 + */ + public function read() + { + $params = get_params(); + (new Article())->read($params); + + return view('nk/article/read',['url'=>$this->url]); + + } + /** + * 修改 + */ + public function del() + { + $params= get_params(); + (new Article())->del($params); + } +} \ No newline at end of file diff --git a/app/admin/controller/nk/Heresy.php b/app/admin/controller/nk/Heresy.php new file mode 100644 index 0000000..eb189c3 --- /dev/null +++ b/app/admin/controller/nk/Heresy.php @@ -0,0 +1,86 @@ +adminInfo = get_login_admin(); + $this->category_id=148; + $this->url=[ + '/admin/nk.heresy/index?category_id='.$this->category_id, + '/admin/nk.heresy/add', + '/admin/nk.heresy/edit', + '/admin/nk.heresy/del', + '/admin/nk.heresy/read', + ]; + } + /** + * 查看 + */ + public function index() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->index($params); + } + return view('nk/article/index',['url'=>$this->url]); + } + /** + * 添加 + */ + public function add() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->add($params); + }else{ + View::assign('editor', get_system_config('other','editor')); + View::assign('url', $this->url); + return view('nk/article/add'); + } + } + /** + * 修改 + */ + public function edit() + { + $params= get_params(); + (new Article())->edit($params); + return view('nk/article/edit',['url'=>$this->url]); + } + /** + * 查看信息 + */ + public function read() + { + $params = get_params(); + (new Article())->read($params); + + return view('nk/article/read',['url'=>$this->url]); + + } + /** + * 修改 + */ + public function del() + { + $params= get_params(); + (new Article())->del($params); + } +} \ No newline at end of file diff --git a/app/admin/controller/nk/Industry.php b/app/admin/controller/nk/Industry.php new file mode 100644 index 0000000..e3ade0b --- /dev/null +++ b/app/admin/controller/nk/Industry.php @@ -0,0 +1,86 @@ +adminInfo = get_login_admin(); + $this->category_id=312; + $this->url=[ + '/admin/nk.industry/index?category_id='.$this->category_id, + '/admin/nk.industry/add', + '/admin/nk.industry/edit', + '/admin/nk.industry/del', + '/admin/nk.industry/read', + ]; + } + /** + * 查看 + */ + public function index() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->index($params); + } + return view('nk/article/index',['url'=>$this->url]); + } + /** + * 添加 + */ + public function add() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->add($params); + }else{ + View::assign('editor', get_system_config('other','editor')); + View::assign('url', $this->url); + return view('nk/article/add'); + } + } + /** + * 修改 + */ + public function edit() + { + $params= get_params(); + (new Article())->edit($params); + return view('nk/article/edit',['url'=>$this->url]); + } + /** + * 查看信息 + */ + public function read() + { + $params = get_params(); + (new Article())->read($params); + + return view('nk/article/read',['url'=>$this->url]); + + } + /** + * 修改 + */ + public function del() + { + $params= get_params(); + (new Article())->del($params); + } +} \ No newline at end of file diff --git a/app/admin/controller/nk/Mediation.php b/app/admin/controller/nk/Mediation.php new file mode 100644 index 0000000..b0802e9 --- /dev/null +++ b/app/admin/controller/nk/Mediation.php @@ -0,0 +1,86 @@ +adminInfo = get_login_admin(); + $this->category_id=147; + $this->url=[ + '/admin/nk.mediation/index?category_id='.$this->category_id, + '/admin/nk.mediation/add', + '/admin/nk.mediation/edit', + '/admin/nk.mediation/del', + '/admin/nk.mediation/read', + ]; + } + /** + * 查看 + */ + public function index() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->index($params); + } + return view('nk/article/index',['url'=>$this->url]); + } + /** + * 添加 + */ + public function add() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->add($params); + }else{ + View::assign('editor', get_system_config('other','editor')); + View::assign('url', $this->url); + return view('nk/article/add'); + } + } + /** + * 修改 + */ + public function edit() + { + $params= get_params(); + (new Article())->edit($params); + return view('nk/article/edit',['url'=>$this->url]); + } + /** + * 查看信息 + */ + public function read() + { + $params = get_params(); + (new Article())->read($params); + + return view('nk/article/read',['url'=>$this->url]); + + } + /** + * 修改 + */ + public function del() + { + $params= get_params(); + (new Article())->del($params); + } +} \ No newline at end of file diff --git a/app/admin/controller/nk/People.php b/app/admin/controller/nk/People.php new file mode 100644 index 0000000..1a477d6 --- /dev/null +++ b/app/admin/controller/nk/People.php @@ -0,0 +1,86 @@ +adminInfo = get_login_admin(); + $this->category_id=152; + $this->url=[ + '/admin/nk.people/index?category_id='.$this->category_id, + '/admin/nk.people/add', + '/admin/nk.people/edit', + '/admin/nk.people/del', + '/admin/nk.people/read', + ]; + } + /** + * 查看 + */ + public function index() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->index($params); + } + return view('nk/article/index',['url'=>$this->url]); + } + /** + * 添加 + */ + public function add() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->add($params); + }else{ + View::assign('editor', get_system_config('other','editor')); + View::assign('url', $this->url); + return view('nk/article/add'); + } + } + /** + * 修改 + */ + public function edit() + { + $params= get_params(); + (new Article())->edit($params); + return view('nk/article/edit',['url'=>$this->url]); + } + /** + * 查看信息 + */ + public function read() + { + $params = get_params(); + (new Article())->read($params); + + return view('nk/article/read',['url'=>$this->url]); + + } + /** + * 修改 + */ + public function del() + { + $params= get_params(); + (new Article())->del($params); + } +} \ No newline at end of file diff --git a/app/admin/controller/nk/Profile.php b/app/admin/controller/nk/Profile.php new file mode 100644 index 0000000..9eb4668 --- /dev/null +++ b/app/admin/controller/nk/Profile.php @@ -0,0 +1,86 @@ +adminInfo = get_login_admin(); + $this->category_id=296; + $this->url=[ + '/admin/nk.profile/index?category_id='.$this->category_id, + '/admin/nk.profile/add', + '/admin/nk.profile/edit', + '/admin/nk.profile/del', + '/admin/nk.profile/read', + ]; + } + /** + * 查看 + */ + public function index() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->index($params); + } + return view('nk/article/index',['url'=>$this->url]); + } + /** + * 添加 + */ + public function add() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->add($params); + }else{ + View::assign('editor', get_system_config('other','editor')); + View::assign('url', $this->url); + return view('nk/article/add'); + } + } + /** + * 修改 + */ + public function edit() + { + $params= get_params(); + (new Article())->edit($params); + return view('nk/article/edit',['url'=>$this->url]); + } + /** + * 查看信息 + */ + public function read() + { + $params = get_params(); + (new Article())->read($params); + + return view('nk/article/read',['url'=>$this->url]); + + } + /** + * 修改 + */ + public function del() + { + $params= get_params(); + (new Article())->del($params); + } +} \ No newline at end of file diff --git a/app/admin/controller/nk/Recruit.php b/app/admin/controller/nk/Recruit.php new file mode 100644 index 0000000..def9ec2 --- /dev/null +++ b/app/admin/controller/nk/Recruit.php @@ -0,0 +1,86 @@ +adminInfo = get_login_admin(); + $this->category_id=316; + $this->url=[ + '/admin/nk.recruit/index?category_id='.$this->category_id, + '/admin/nk.recruit/add', + '/admin/nk.recruit/edit', + '/admin/nk.recruit/del', + '/admin/nk.recruit/read', + ]; + } + /** + * 查看 + */ + public function index() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->index($params); + } + return view('nk/article/index',['url'=>$this->url]); + } + /** + * 添加 + */ + public function add() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->add($params); + }else{ + View::assign('editor', get_system_config('other','editor')); + View::assign('url', $this->url); + return view('nk/article/add'); + } + } + /** + * 修改 + */ + public function edit() + { + $params= get_params(); + (new Article())->edit($params); + return view('nk/article/edit',['url'=>$this->url]); + } + /** + * 查看信息 + */ + public function read() + { + $params = get_params(); + (new Article())->read($params); + + return view('nk/article/read',['url'=>$this->url]); + + } + /** + * 修改 + */ + public function del() + { + $params= get_params(); + (new Article())->del($params); + } +} \ No newline at end of file diff --git a/app/admin/controller/nk/Regulation.php b/app/admin/controller/nk/Regulation.php new file mode 100644 index 0000000..dc363b7 --- /dev/null +++ b/app/admin/controller/nk/Regulation.php @@ -0,0 +1,86 @@ +adminInfo = get_login_admin(); + $this->category_id=163; + $this->url=[ + '/admin/nk.regulation/index?category_id='.$this->category_id, + '/admin/nk.regulation/add', + '/admin/nk.regulation/edit', + '/admin/nk.regulation/del', + '/admin/nk.regulation/read', + ]; + } + /** + * 查看 + */ + public function index() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->index($params); + } + return view('nk/article/index',['url'=>$this->url]); + } + /** + * 添加 + */ + public function add() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->add($params); + }else{ + View::assign('editor', get_system_config('other','editor')); + View::assign('url', $this->url); + return view('nk/article/add'); + } + } + /** + * 修改 + */ + public function edit() + { + $params= get_params(); + (new Article())->edit($params); + return view('nk/article/edit',['url'=>$this->url]); + } + /** + * 查看信息 + */ + public function read() + { + $params = get_params(); + (new Article())->read($params); + + return view('nk/article/read',['url'=>$this->url]); + + } + /** + * 修改 + */ + public function del() + { + $params= get_params(); + (new Article())->del($params); + } +} \ No newline at end of file diff --git a/app/admin/controller/nk/System.php b/app/admin/controller/nk/System.php new file mode 100644 index 0000000..4196e30 --- /dev/null +++ b/app/admin/controller/nk/System.php @@ -0,0 +1,86 @@ +adminInfo = get_login_admin(); + $this->category_id=297; + $this->url=[ + '/admin/nk.system/index?category_id='.$this->category_id, + '/admin/nk.system/add', + '/admin/nk.system/edit', + '/admin/nk.system/del', + '/admin/nk.system/read', + ]; + } + /** + * 查看 + */ + public function index() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->index($params); + } + return view('nk/article/index',['url'=>$this->url]); + } + /** + * 添加 + */ + public function add() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->add($params); + }else{ + View::assign('editor', get_system_config('other','editor')); + View::assign('url', $this->url); + return view('nk/article/add'); + } + } + /** + * 修改 + */ + public function edit() + { + $params= get_params(); + (new Article())->edit($params); + return view('nk/article/edit',['url'=>$this->url]); + } + /** + * 查看信息 + */ + public function read() + { + $params = get_params(); + (new Article())->read($params); + + return view('nk/article/read',['url'=>$this->url]); + + } + /** + * 修改 + */ + public function del() + { + $params= get_params(); + (new Article())->del($params); + } +} \ No newline at end of file diff --git a/app/admin/controller/nk/SzxcNotice.php b/app/admin/controller/nk/SzxcNotice.php new file mode 100644 index 0000000..762c403 --- /dev/null +++ b/app/admin/controller/nk/SzxcNotice.php @@ -0,0 +1,86 @@ +adminInfo = get_login_admin(); + $this->category_id=164; + $this->url=[ + '/admin/nk.szxc_notice/index?category_id='.$this->category_id, + '/admin/nk.szxc_notice/add', + '/admin/nk.szxc_notice/edit', + '/admin/nk.szxc_notice/del', + '/admin/nk.szxc_notice/read', + ]; + } + /** + * 查看 + */ + public function index() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->index($params); + } + return view('nk/article/index',['url'=>$this->url]); + } + /** + * 添加 + */ + public function add() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->add($params); + }else{ + View::assign('editor', get_system_config('other','editor')); + View::assign('url', $this->url); + return view('nk/article/add'); + } + } + /** + * 修改 + */ + public function edit() + { + $params= get_params(); + (new Article())->edit($params); + return view('nk/article/edit',['url'=>$this->url]); + } + /** + * 查看信息 + */ + public function read() + { + $params = get_params(); + (new Article())->read($params); + + return view('nk/article/read',['url'=>$this->url]); + + } + /** + * 修改 + */ + public function del() + { + $params= get_params(); + (new Article())->del($params); + } +} \ No newline at end of file diff --git a/app/admin/controller/nk/Travel.php b/app/admin/controller/nk/Travel.php new file mode 100644 index 0000000..1c51040 --- /dev/null +++ b/app/admin/controller/nk/Travel.php @@ -0,0 +1,86 @@ +adminInfo = get_login_admin(); + $this->category_id=309; + $this->url=[ + '/admin/nk.travel/index?category_id='.$this->category_id, + '/admin/nk.travel/add', + '/admin/nk.travel/edit', + '/admin/nk.travel/del', + '/admin/nk.travel/read', + ]; + } + /** + * 查看 + */ + public function index() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->index($params); + } + return view('nk/article/index',['url'=>$this->url]); + } + /** + * 添加 + */ + public function add() + { + if (request()->isAjax()) { + $params= get_params(); + $params['category_id']=$this->category_id; + (new Article())->add($params); + }else{ + View::assign('editor', get_system_config('other','editor')); + View::assign('url', $this->url); + return view('nk/article/add'); + } + } + /** + * 修改 + */ + public function edit() + { + $params= get_params(); + (new Article())->edit($params); + return view('nk/article/edit',['url'=>$this->url]); + } + /** + * 查看信息 + */ + public function read() + { + $params = get_params(); + (new Article())->read($params); + + return view('nk/article/read',['url'=>$this->url]); + + } + /** + * 修改 + */ + public function del() + { + $params= get_params(); + (new Article())->del($params); + } +} \ No newline at end of file diff --git a/app/admin/controller/nk/User.php b/app/admin/controller/nk/User.php new file mode 100644 index 0000000..bb2387c --- /dev/null +++ b/app/admin/controller/nk/User.php @@ -0,0 +1,766 @@ +adminInfo = get_login_admin(); + $this->category_id = 305; + $this->url = [ + '/admin/nk.user/index?category_id=' . $this->category_id, + '/admin/nk.user/add', + '/admin/nk.user/edit', + '/admin/nk.user/del', + '/admin/nk.user/read', + '/admin/nk.user/auths', + '/admin/nk.user/postedit', + ]; + } + /** + * 查看 + */ + public function index() + { + if (request()->isAjax()) { + $mmm = []; + $post = get_params(); + if (!empty($post['keywords'])) { + $mmm[] = ['m.name', 'LIKE', '%' . $post['keywords'] . '%']; + } + if (!empty($post['phone'])) { + + $mmm[] = ['m.phone', 'LIKE', '%' . $post['phone'] . '%']; + } + + //权限组信息 + if ($this->adminInfo['position_id'] != 1) { + $find = Db::table('fa_szxc_information_useraddress')->where('user_id', $this->adminInfo['id'])->find(); + if ($find) { + if ($find['auth_range'] == 1) { + $mmm['village_id'] = $find['village_id']; + } elseif ($find['auth_range'] == 2) { + $mmm['street_id'] = $find['street_id']; + } elseif ($find['auth_range'] == 3) { + $mmm['area_id'] = $find['area_id']; + } + } + } + if ($post) { + if (isset($post['area_id']) && !empty($post['area_id'])) { + $mmm['area_id'] = $post['area_id']; + } + if (isset($post['street_id']) && !empty($post['street_id'])) { + $mmm['street_id'] = $post['street_id']; + } + if (isset($post['village_id']) && !empty($post['village_id'])) { + $mmm['village_id'] = $post['village_id']; + } + if (isset($post['brigade_id']) && !empty($post['brigade_id'])) { + $mmm['brigade_id'] = $post['brigade_id']; + } + } + //权限组信息 + $total = Db::table('fa_szxc_information_usermsg') + ->alias('m') + ->where($mmm) + ->count(); + $list = Db::table('fa_szxc_information_usermsg') + ->alias('m') + ->where($mmm) + ->join(['fa_user' => 'u'], 'm.user_id=u.id') + ->join(['fa_user_group' => 'g'], 'g.id=u.group_id') + ->field('u.id,m.name,m.phone,u.avatar,u.group_id,u.status,m.gender,m.age,g.name group_name,m.householder_id') + ->withAttr('count', function ($value, $data) { + if ($data['householder_id'] != 0) { + $count = Db::table('fa_szxc_information_usermsg')->where('householder_id', $data['householder_id'])->count(); + } else { + $count = '未绑定户主无法查询'; + } + return $count; + }) + ->withAttr('gender', function ($value, $data) { + if ($value == 1) { + return '男'; + } elseif ($value == 2) { + return '女'; + } + }) + ->order('id DESC') + ->page($post['page']) + ->limit($post['limit']) + ->select(); + + $result = ['total' => $total, 'data' => $list]; + return table_assign(0, '', $result); + } + //权限组信息 + if ($this->adminInfo['position_id'] != 1) { //不是超级管理员 + $www['admin_id'] = $this->adminInfo['id']; + $user_address = Db::table('fa_szxc_information_useraddress')->where($www)->find(); + if ($user_address) { + if ($user_address['auth_range'] == 1) { + $select = Db::table('fa_geo_area')->where('city_code', '510500')->where('area_code', $user_address['area_id'])->select(); + } elseif ($user_address['auth_range'] == 2) { + $select = Db::table('fa_geo_area')->where('city_code', '510500')->where('area_code', $user_address['area_id'])->select(); + } elseif ($user_address['auth_range'] == 3) { + $select = Db::table('fa_geo_area')->where('city_code', '510500')->where('area_code', $user_address['area_id'])->select(); + } elseif ($user_address['auth_range'] == 4) { + $select = Db::table('fa_geo_area')->where('city_code', '510500')->select(); + } else { + $select = Db::table('fa_geo_area')->where('city_code', '510500')->select(); + } + View::assign('row', $user_address); + } else { + $user_address['area_id'] = ''; + $user_address['street_id'] = ''; + $user_address['village_code'] = ''; + $user_address['auth_range'] = '1'; + $select = Db::table('fa_geo_area')->where('city_code', '510500')->select(); + View::assign('row', $user_address); + } + + $is_admin = 0; + } else { + $user_address['area_id'] = ''; + $user_address['street_id'] = ''; + $user_address['village_code'] = ''; + $user_address['auth_range'] = ''; + $select = Db::table('fa_geo_area')->where('city_code', '510500')->select(); + View::assign('row', $user_address); + $is_admin = 1; + } + View::assign('arealist', $select); + View::assign('is_admin', $is_admin); + View::assign('url', $this->url); + return view(); + } + /** + * 添加 + */ + public function add() + { + if (request()->isAjax()) { + $params = get_params(); + $params['category_id'] = $this->category_id; + (new Article())->add($params); + } else { + View::assign('editor', get_system_config('other', 'editor')); + View::assign('url', $this->url); + return view('nk/article/add'); + } + } + /** + * 修改 + */ + public function edit() + { + $params = get_params(); + $find = Db::table('fa_szxc_information_usermsg') + ->where('user_id', $params['id'])->find(); + //获取所有分类 + $www2[] = ['type', 'in', ['Nation', 'Education', 'Occupation', 'Zzmm', 'Family', 'Nature_of_land', 'Blood_type', 'Drug_allergy', 'Exposure_history', 'History_of_disease', 'Whether_disabled', 'Cfpfss', 'Fuel_type', 'Drinking_water', 'Toilet_msg', 'Poultry_corral', 'Insurance_type', 'House', 'Car', 'Grade', 'Insurance', 'Medical_insurance_type', 'FamilyHistory', 'Marriage']]; + $all_category = Db::table('fa_category')->where($www2)->field('id,type,name,pid')->select(); + //种植信息 + $planting = Db::table('fa_szxc_information_planting')->where('user_id', $params['id']) + ->find(); + $strlen = strlen($planting['breed_msg']); + if ($strlen != 0 || $strlen > 10) { + $planting['breed_msg'] = json_decode($planting['breed_msg'], true); + } + $strlen1 = strlen($planting['crops_msg']); + if ($strlen1 != 0 || $strlen1 > 10) { + $planting['crops_msg'] = json_decode($planting['crops_msg'], true); + } + $strlen2 = strlen($planting['tools_msg']); + if ($strlen2 != 0 || $strlen2 > 10) { + $planting['tools_msg'] = json_decode($planting['tools_msg'], true); + } + //保险信息 + $insurancearr = Db::table('fa_szxc_information_insurance')->where('user_id', $params['id'])->find(); + //健康信息 + $healthyarr = Db::table('fa_szxc_information_healthy')->where('user_id', $params['id'])->find(); + if ($planting == null) { + $planting = [ + "tools_msg" => "", + "crops_msg" => "", + "land_area" => "", + "is_wz" => '', + "nature_of_land" => "", + ]; + } + if ($insurancearr == null) { + $insurancearr = [ + "endowment_insurance_status" => "", + "is_subsidy" => "", + "insurance_reason" => "", + "medical_insurance_type" => "", + "whether_disabled" => "", + "disability_num" => "", + "disability_type" => "", + "disability_level" => "", + "insurance_type" => "", + "ny_insurance" => "", + "sy_insurance" => "", + ]; + } + if ($healthyarr == null) { + $healthyarr = [ + "medical_insurance_type" => "", + "insurance_type" => "", + "blood_type" => "", + "drug_allergy" => "", + "exposure_history" => "", + "history_of_disease" => "", + "history_of_surgery" => "", + "family_history" => "", + "familial_diseases" => "", + "genetic_history" => "", + "genetic_name" => "", + "whether_disabled" => "", + "cfpfss" => "", + "fuel_type" => "", + "drinking_water" => "", + "toilet_msg" => "", + "poultry_corral" => "", + ]; + } + View::assign('user_id', $params['id']); + View::assign('healthyarr', $healthyarr); + View::assign('insurancearr', $insurancearr); + View::assign('planting', $planting); + View::assign('all_category', $all_category); + View::assign('user', $find); + View::assign('url', $this->url); + View::assign('editor', get_system_config('other', 'editor')); + + return view(); + } + /** + * 提交修改 + */ + public function postedit() + { + $params = get_params(); + halt($params); + if ($params['type'] == 1) { + unset($params['type']); + $res = Db::table('fa_szxc_information_usermsg')->where('user_id', $params['user_id'])->update($params); + if ($res) { + return to_assign(0, '操作成功'); + } else { + return to_assign(1, '操作失败'); + } + } + if ($params['type'] == 2) { + halt($params); + unset($params['type']); + $find = Db::table('fa_szxc_information_insurance')->where('user_id', $params['user_id'])->find(); + if ($find) { + $res = Db::table('fa_szxc_information_insurance')->where('id', $find['id'])->update($params); + } else { + $res = Db::table('fa_szxc_information_insurance')->where('user_id', $params['user_id'])->insert($params); + } + if ($res) { + return to_assign(0, '操作成功'); + } else { + return to_assign(1, '操作失败'); + } + } + if ($params['type'] == 3) { + unset($params['type']); + $find = Db::table('fa_szxc_information_insurance')->where('user_id', $params['user_id'])->find(); + if ($find) { + $res = Db::table('fa_szxc_information_insurance')->where('id', $find['id'])->update($params); + } else { + $res = Db::table('fa_szxc_information_insurance')->where('user_id', $params['user_id'])->insert($params); + } + if ($res) { + return to_assign(0, '操作成功'); + } else { + return to_assign(1, '操作失败'); + } + } + if ($params['type'] == 4) { + unset($params['type']); + $find = Db::table('fa_szxc_information_healthy')->where('user_id', $params['user_id'])->find(); + if ($find) { + $res = Db::table('fa_szxc_information_healthy')->where('id', $find['id'])->update($params); + } else { + $res = Db::table('fa_szxc_information_healthy')->where('user_id', $params['user_id'])->insert($params); + } + if ($res) { + return to_assign(0, '操作成功'); + } else { + return to_assign(1, '操作失败'); + } + } + } + /** + * 查看信息 + */ + public function read() + { + $params = get_params(); + $find = Db::table('fa_szxc_information_usermsg') + ->withAttr('gender', function ($value, $data) { + if ($value == 1) { + return '男'; + } + return '女'; + })->withAttr('education', function ($value, $data) { + return Db::table('fa_category')->where('id', $value)->value('name'); + })->withAttr('nation', function ($value, $data) { + return Db::table('fa_category')->where('id', $value)->value('name'); + })->withAttr('political_outlook', function ($value, $data) { + return Db::table('fa_category')->where('id', $value)->value('name'); + })->withAttr('house_msg', function ($value, $data) { + return Db::table('fa_category')->where('id', $value)->value('name'); + })->withAttr('car_msg', function ($value, $data) { + return Db::table('fa_category')->where('id', $value)->value('name'); + })->withAttr('marital_status', function ($value, $data) { + return Db::table('fa_category')->where('id', $value)->value('name'); + }) + ->where('user_id', $params['id'])->find(); + //家庭信息 + if ($find == null || $find['householder_id'] == 0) { + $family = []; + } else { + if ($find['householder_id'] == $find['user_id']) { + $family['name'] = '本人'; + } else { + $family['name'] = Db::table('fa_szxc_information_usermsg')->where('user_id', $find['householder_id'])->value('name'); + $family['relation'] = Db::table('fa_category')->where('id', $find['family_relation'])->value('name'); + } + $family['list'] = Db::table('fa_szxc_information_usermsg')->where('householder_id', $find['householder_id'])->where('user_id', '<>', $find['householder_id'])->field('user_id,name,age,gender,phone')->select(); + } + //种植信息 + if ($find || $find['householder_id'] == $params['id']) { + $Planting['is'] = 1; + $Planting['list'] = []; + $finds = Db::table('fa_szxc_information_planting')->where('user_id', $params['id']) + ->withAttr('crops_msg', function ($value, $data) { + return json_decode($value, true); + }) + ->withAttr('breed_msg', function ($value, $data) { + return json_decode($value, true); + }) + ->withAttr('tools_msg', function ($value, $data) { + return json_decode($value, true); + }) + ->withAttr('nature_of_land', function ($value, $data) { + return Db::table('fa_category')->where('id', $value)->value('name'); + }) + ->withAttr('is_wz', function ($value, $data) { + return $value == 0 ? '否' : '是'; + }) + ->find(); + if ($find) { + $Planting['list'] = $finds; + } + } else { + $Planting['is'] = 0; + } + $insurancearr = Db::table('fa_szxc_information_insurance') + ->withAttr('endowment_insurance_status', function ($value, $data) { + return Db::table('fa_category')->where('id', $value)->value('name'); + })->withAttr('insurance_type', function ($value, $data) { + return Db::table('fa_category')->where('id', $value)->value('name'); + })->withAttr('whether_disabled', function ($value, $data) { + return Db::table('fa_category')->where('id', $value)->value('name'); + })->withAttr('disability_level', function ($value, $data) { + return Db::table('fa_category')->where('id', $value)->value('name'); + })->withAttr('ny_insurance', function ($value, $data) { + return Db::table('fa_category')->where('id', $value)->value('name'); + })->withAttr('sy_insurance', function ($value, $data) { + return Db::table('fa_category')->where('id', $value)->value('name'); + }) + ->where('user_id', $params['id'])->find(); + $healthyarr = Db::table('fa_szxc_information_healthy') + ->withAttr('blood_type', function ($value, $data) { + return Db::table('fa_category')->where('id', $value)->value('name'); + })->withAttr('drug_allergy', function ($value, $data) { + return Db::table('fa_category')->where('id', $value)->value('name'); + })->withAttr('exposure_history', function ($value, $data) { + return Db::table('fa_category')->where('id', $value)->value('name'); + })->withAttr('history_of_disease', function ($value, $data) { + return Db::table('fa_category')->where('id', $value)->value('name'); + })->withAttr('history_of_surgery', function ($value, $data) { + return Db::table('fa_category')->where('id', $value)->value('name'); + })->withAttr('family_history', function ($value, $data) { + return Db::table('fa_category')->where('id', $value)->value('name'); + })->withAttr('familial_diseases', function ($value, $data) { + return Db::table('fa_category')->where('id', $value)->value('name'); + })->withAttr('genetic_history', function ($value, $data) { + return Db::table('fa_category')->where('id', $value)->value('name'); + })->withAttr('cfpfss', function ($value, $data) { + return Db::table('fa_category')->where('id', $value)->value('name'); + })->withAttr('fuel_type', function ($value, $data) { + return Db::table('fa_category')->where('id', $value)->value('name'); + })->withAttr('drinking_water', function ($value, $data) { + return Db::table('fa_category')->where('id', $value)->value('name'); + })->withAttr('toilet_msg', function ($value, $data) { + return Db::table('fa_category')->where('id', $value)->value('name'); + })->withAttr('poultry_corral', function ($value, $data) { + return Db::table('fa_category')->where('id', $value)->value('name'); + })->withAttr('genetic_name', function ($value, $data) { + return Db::table('fa_category')->where('id', $value)->value('name'); + }) + ->where('user_id', $params['id'])->find(); + + View::assign('id', $params['id']); + View::assign('read', $find); + View::assign('family', $family); + View::assign('planting', $Planting); + View::assign('insurancearr', $insurancearr); + View::assign('healthyarr', $healthyarr); + return view(); + } + + public function auths() + { + $params = get_params(); + if (request()->isPost()) { + $admin = Db::name('Admin')->where('user_id', $params['id'])->find(); + $user = Db::table('fa_user')->where('id', $params['id'])->find(); + + if ($params['village_id'] != '') { + $village = Db::table('fa_geo_village')->where('village_code', $params['village_id'])->find(); + } + // 组装地址名 + if ($params['area_id'] != '') { + $area_name = Db::table('fa_geo_area')->where('area_code', $params['area_id'])->value('area_name'); + } + if ($params['street_id'] != '') { + $street_name = Db::table('fa_geo_street')->where('street_code', $params['street_id'])->value('street_name'); + } + if ($params['brigade_id'] != '') { + $brigade_name = Db::table('fa_geo_brigade')->where('id', $params['brigade_id'])->value('brigade_name'); + } + $address_name = $area_name . $street_name . $village['village_name'] . $brigade_name; + + if ($admin) { + Db::startTrans(); + try { + if ($params['groupdata'] == 0) { + Db::name('admin_group_access')->where('uid', $admin['id'])->delete(); + Db::name('Admin')->where('id', $admin['id'])->update(['status' => 0]); + } else { + $is_have_admin = Db::name('admin_group_access')->where('uid', $admin['id'])->find(); + if ($is_have_admin) { + Db::name('admin_group_access')->where('uid', $admin['id'])->update(['group_id' => $params['groupdata']]); + } else { + $group_access2 = ['uid' => $admin['id'], 'group_id' => $params['groupdata']]; + //写入权限组 + Db::name('admin_group_access')->insert($group_access2); + } + Db::name('Admin')->where('id', $admin['id'])->update(['status' => 1]); + } + $useraddress = [ + 'area_id' => $params['area_id'], + 'street_id' => $params['street_id'], + 'village_code' => $params['village_id'], + 'brigade_id' => $params['brigade_id'], + 'auth_range' => $params['auth_range'], + 'village_id' => $params['village_id'] != '' ? $village['village_id'] : 0, + 'admin_id' => $admin['id'], + ]; + Db::table('fa_szxc_information_useraddress')->where('user_id', $params['id'])->update($useraddress); + // 修改user表 + $ddd['is_admin'] = 1; + $ddd['group_id'] = $params['group_id']; + Db::table('fa_user')->where('id', $params['id'])->update($ddd); + + // 修改商城关系表 + $nk_user['n_user_id'] = $params['id']; + $is_nk_user = Db::connect('shop')->name('nk_user')->where($nk_user)->find(); + if ($is_nk_user) { + $nk_data['group_id'] = $params['group_id']; + Db::connect('shop')->name('nk_user')->where($nk_user)->update($nk_data); + } + + // 修改用户详细地址 + $u_msg['address_name'] = $address_name; + $u_msg['area_id'] = $params['area_id']; + $u_msg['street_id'] = $params['street_id']; + $u_msg['village_id'] = $params['village_id'] != '' ? $village['village_id'] : 0; + $u_msg['brigade_id'] = $params['brigade_id']; + Db::table('fa_szxc_information_usermsg')->where('user_id', $params['id'])->update($u_msg); + // 提交事务 + Db::commit(); + } catch (\Exception $e) { + // 回滚事务 + Db::rollback(); + return to_assign(1, '操作失败,原因:' . $e->getMessage()); + } + return to_assign(0, '操作成功'); + } else { + $salt = set_salt(20); + $data = [ + 'user_id' => $params['id'], + 'username' => $user['username'], + 'nickname' => $user['nickname'], + 'thumb' => 'https://lihai001.oss-cn-chengdu.aliyuncs.com/uploads/20230104/32a639be4ee32349705e947fbbd1e114.png', + 'mobile' => 13688888886, + 'did' => 1, + 'position_id' => 3, + 'salt' => $salt, + 'pwd' => set_password(123456, $salt), + 'email' => '', + ]; + Db::startTrans(); + try { + $w['user_id'] = $params['id']; + $is_have = Db::table('fa_szxc_information_useraddress')->where($w)->find(); + // 创建管理员账号 + $admin_id = Db::name('Admin')->insertGetId($data); + // 写入权限组 + Db::name('AdminGroupAccess')->strict(false)->field(true)->insert([ + 'uid' => $admin_id, + 'group_id' => $params['group_id'], + ]); + add_log('add', $this->adminInfo['id'], $params); + // Db::table('fa_auth_group_access')->insert($group_access); + // 修改user表 + $ddd['is_admin'] = 1; + $ddd['group_id'] = $params['group_id']; + Db::table('fa_user')->where('id', $params['id'])->update($ddd); + + // 修改商城关系表 + $nk_user['n_user_id'] = $params['id']; + $is_nk_user = Db::connect('shop')->name('nk_user')->where($nk_user)->find(); + if ($is_nk_user) { + $nk_data['group_id'] = $params['group_id']; + Db::connect('shop')->name('nk_user')->where($nk_user)->update($nk_data); + } + + if ($is_have) { + $useraddress = [ + 'user_id' => $params['id'], + 'admin_id' => $admin_id, + 'area_id' => $params['area_id'], + 'street_id' => $params['street_id'], + 'village_code' => $params['village_id'], + 'village_id' => $village['village_id'], + 'brigade_id' => $params['brigade_id'], + 'auth_range' => $params['auth_range'], + ]; + Db::table('fa_szxc_information_useraddress')->where($w)->update($useraddress); + } else { + $useraddress = [ + 'user_id' => $params['id'], + 'admin_id' => $admin_id->id, + 'area_id' => $params['area_id'], + 'street_id' => $params['street_id'], + 'village_code' => $params['village_id'], + 'village_id' => $village['village_id'], + 'brigade_id' => $params['brigade_id'], + 'auth_range' => $params['auth_range'], + 'createtime' => date('Y-m-d H:i:s') + ]; + Db::table('fa_szxc_information_useraddress')->insert($useraddress); + } + + // 修改用户详细地址 + $u_msg['address_name'] = $address_name; + $u_msg['area_id'] = $params['area_id']; + $u_msg['street_id'] = $params['street_id']; + $u_msg['village_id'] = $params['village_id'] != '' ? $village['village_id'] : 0; + $u_msg['brigade_id'] = $params['brigade_id']; + Db::table('fa_szxc_information_usermsg')->where('user_id', $params['id'])->update($u_msg); + + // 提交事务 + Db::commit(); + } catch (\Exception $e) { + // 回滚事务 + Db::rollback(); + return to_assign(1, '操作失败,原因:' . $e->getMessage()); + } + return to_assign(0, '操作成功'); + } + } + + $user = Db::table('fa_user')->where('id', $params['id'])->field('id,nickname,group_id')->find(); + + // $geo_brigade = Db::table('fa_geo_brigade')->select(); + + $useraddress = [ + 'area_id' => 0, + 'street_id' => 0, + 'village_id' => 0, + 'village_code' => 0, + 'brigade_id' => 0, + 'admin_group' => 0, + 'auth_range' => 1, + ]; + $address = Db::table('fa_szxc_information_useraddress')->where('user_id', $params['id'])->find(); + if ($address) { + $useraddress['area_id'] = $address['area_id']; + $useraddress['street_id'] = $address['street_id']; + $useraddress['village_id'] = $address['village_id']; + $useraddress['brigade_id'] = $address['brigade_id']; + $useraddress['village_code'] = $address['village_code']; + $useraddress['auth_range'] = $address['auth_range']; + $admin = Db::name('admin_group_access')->where('uid', $address['admin_id'])->find(); + if ($admin) { + $useraddress['admin_group'] = $admin['group_id']; + } + } + //权限组信息 + $groupwhere[] = ['id', 'in', 2, 4]; + if ($this->adminInfo['position_id'] != 1) { //不是超级管理员 + // $www['admin_id'] = $this->adminInfo['id']; + // $user_address = Db::table('fa_szxc_information_useraddress')->where($www)->find(); + // if ($user_address) { + if ($this->adminInfo['group_access'] == 2) { + $auth_range = [['name' => '村级', 'value' => '1']]; + $groupwhere[] = ['id', 'in', 2]; + } + if ($this->adminInfo['group_access'] == 4) { + $auth_range = [['name' => '村级', 'value' => '1'], ['name' => '乡镇', 'value' => '2']]; + } + // if ($user_address['auth_range'] == 3) { + // $auth_range = [['name' => '村级', 'value' => '1'], ['name' => '乡镇', 'value' => '2'], ['name' => '区县', 'value' => '3']]; + // } + // if ($user_address['auth_range'] == 4) { + // $auth_range = [['name' => '村级', 'value' => '1'], ['name' => '乡镇', 'value' => '2'], ['name' => '区县', 'value' => '3'], ['name' => '市级', 'value' => '4']]; + // } + // } + } else { + $auth_range = [['name' => '村级', 'value' => '1'], ['name' => '乡镇', 'value' => '2'], ['name' => '区县', 'value' => '3'], ['name' => '市级', 'value' => '4']]; + } + $street = Db::table('fa_geo_area')->where(['switch' => 1, 'city_code' => '510500']) + ->field('area_id id,area_code code,area_name name') + ->select(); + $brigade = Db::table('fa_geo_brigade') + ->limit(30) + ->select(); + //后端权限 + $groupdata = Db::name('admin_group') + ->where($groupwhere) + ->limit(30) + ->select(); + $groupdata[] = ['id' => 0, 'title' => '无后台权限']; + //前端权限 + $user_group = Db::table('fa_user_group') + ->limit(30) + ->select(); + View::assign('id', $params['id']); + View::assign('user_group', $user_group); + View::assign('groupdata', $groupdata); + View::assign('street', $street); + View::assign('brigade', $brigade); + View::assign('auth_range', $auth_range); + View::assign('user', $user); + View::assign('address', $useraddress); + View::assign('url', $this->url); + View::assign('editor', get_system_config('other', 'editor')); + + return view(); + } + public function tongji() + { + $post = get_params(); + $where = []; + //权限组信息 + $find = Db::table('fa_szxc_information_useraddress')->where('user_id', $this->adminInfo['user_id'])->find(); + if ($find) { + if ($find['auth_range'] == 1) { + $where['village_id'] = $find['village_id']; + } elseif ($find['auth_range'] == 2) { + $where['street_id'] = $find['street_id']; + } elseif ($find['auth_range'] == 3) { + $where['area_id'] = $find['area_id']; + } + } + + if ($post['village_id'] != '') { + $where['village_id'] = $post['village_id']; + } + if ($post['brigade_id'] != '') { + $where['brigade_id'] = $post['brigade_id']; + } + if ($post['street_id'] != '') { + $where['street_id'] = $post['street_id']; + } + $where['area_id'] = $post['area_id']; + // 大于60岁人数 + $old_num = Db::table('fa_szxc_information_usermsg')->where($where)->whereAge('>=', 60)->count(); + // 儿童人数 + $children_num = Db::table('fa_szxc_information_usermsg')->where($where)->whereAge('<', 15)->count(); + // 未婚男 + $unmarried_man_num = Db::table('fa_szxc_information_usermsg')->where($where)->where([['gender', '=', 1], ['marital_status', '=', 169]])->count(); + // 未婚女 + $unmarried_woman_num = Db::table('fa_szxc_information_usermsg')->where($where)->where([['gender', '=', 2], ['marital_status', '=', 169]])->count(); + + $land_area_num = Db::table('fa_szxc_information_useraddress') + ->alias('u') + ->where($where) + ->join(['fa_szxc_information_planting'=>'p'], 'u.user_id = p.user_id')->sum('p.land_area'); + + $sum_218 = Db::table('fa_szxc_information_useraddress') + ->alias('u') + ->where($where) + ->join(['fa_szxc_information_planting'=>'p'], 'u.user_id = p.user_id and p.nature_of_land=218')->sum('p.land_area'); + $sum_217 = Db::table('fa_szxc_information_useraddress') + ->alias('u') + ->where($where) + ->join(['fa_szxc_information_planting'=>'p'], 'u.user_id = p.user_id and p.nature_of_land=217')->sum('p.land_area'); + $sum_216 = Db::table('fa_szxc_information_useraddress') + ->alias('u') + ->where($where) + ->join(['fa_szxc_information_planting'=>'p'], 'u.user_id = p.user_id and p.nature_of_land=216')->sum('p.land_area'); + $sum_215 = Db::table('fa_szxc_information_useraddress') + ->alias('u') + ->where($where) + ->join(['fa_szxc_information_planting'=>'p'], 'u.user_id = p.user_id and p.nature_of_land=215')->sum('p.land_area'); + $sum_214 = Db::table('fa_szxc_information_useraddress') + ->alias('u') + ->where($where) + ->join(['fa_szxc_information_planting'=>'p'], 'u.user_id = p.user_id and p.nature_of_land=214')->sum('p.land_area'); + $sum_70 = Db::table('fa_szxc_information_useraddress') + ->alias('u') + ->where($where) + ->join(['fa_szxc_information_planting'=>'p'], 'u.user_id = p.user_id and p.nature_of_land=70')->sum('p.land_area'); + $sum_69 = Db::table('fa_szxc_information_useraddress') + ->alias('u') + ->where($where) + ->join(['fa_szxc_information_planting'=>'p'], 'u.user_id = p.user_id and p.nature_of_land=69')->sum('p.land_area'); + $result = [ + 'old_num' => $old_num, + 'children_num' => $children_num, + 'unmarried_man_num' => $unmarried_man_num, + 'unmarried_woman_num' => $unmarried_woman_num, + 'land_area_num' => $land_area_num, + 'sum_218' => $sum_218, + 'sum_217' => $sum_217, + 'sum_216' => $sum_216, + 'sum_215' => $sum_215, + 'sum_214' => $sum_214, + 'sum_70' => $sum_70, + 'sum_69' => $sum_69, + + ]; + $result = ['total' => 0, 'data' => $result]; + return table_assign(0, '', $result); + } + /** + * 修改 + */ + public function del() + { + $params = get_params(); + (new Article())->del($params); + } +} diff --git a/app/admin/validate/nk/ArticleValidate.php b/app/admin/validate/nk/ArticleValidate.php new file mode 100644 index 0000000..c13f934 --- /dev/null +++ b/app/admin/validate/nk/ArticleValidate.php @@ -0,0 +1,26 @@ + 'require', + 'title' => 'require', + // 'thumb' => 'require', + 'content' => 'require', +]; + + protected $message = [ + // 'cate_id.require' => '所属分类不能为空', + 'title.require' => '文章标题不能为空', + // 'thumb.require' => '缩略图不能为空', + 'content.require' => '文章内容不能为空', +]; +} \ No newline at end of file diff --git a/app/admin/view/nk/article/index.html b/app/admin/view/nk/article/index.html index a79a04f..65b9c11 100644 --- a/app/admin/view/nk/article/index.html +++ b/app/admin/view/nk/article/index.html @@ -5,7 +5,7 @@
- +
@@ -21,7 +21,7 @@ @@ -53,7 +53,22 @@ field: 'id', title: '编号', align: 'center', - width: 80 + width:120, + },{ + field: 'area', + title: '区县', + align: 'center', + width:120, + },{ + field: 'street', + title: '乡镇', + align: 'center', + width:120, + },{ + field: 'village', + title: '街道/村', + align: 'center', + width:120, },{ field: 'title', title: '文章标题', @@ -61,33 +76,15 @@ field: 'nickname', title: '用户', align: 'center', - width: 90 - },{ - field: 'area', - title: '区县', - align: 'center', - width: 90 - },{ - field: 'street', - title: '乡镇', - align: 'center', - width: 90 - },{ - field: 'village', - title: '街道/村', - align: 'center', - width: 90 },{ field: 'view_time', title: '发布时间', align: 'center', - width: 160 },{ fixed: 'right', field: 'right', title: '操作', toolbar: '#barDemo', - width: 136, align: 'center' } ] diff --git a/app/admin/view/nk/user/add.html b/app/admin/view/nk/user/add.html new file mode 100644 index 0000000..b2ce05d --- /dev/null +++ b/app/admin/view/nk/user/add.html @@ -0,0 +1,102 @@ +{extend name="common/base"/} +{block name="style"} + +{/block} + +{block name="body"} +
+

新建文章

+ + + + + + + + + + + + + + + + + + +
文章标题*
文章摘要 + + 缩略图 +
+ +
+ + +
+
+
文章内容
+ +
+
+ + +
+
+{/block} + + + +{block name="script"} + +{/block} + \ No newline at end of file diff --git a/app/admin/view/nk/user/auths.html b/app/admin/view/nk/user/auths.html new file mode 100644 index 0000000..f72951e --- /dev/null +++ b/app/admin/view/nk/user/auths.html @@ -0,0 +1,217 @@ +{extend name="common/base"/} +{block name="style"} + +{/block} + +{block name="body"} +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ {if {:session('gougu_admin')['group_access']==1} + + {else /} + {volist name='street' id='vo'} + {if $address.area_id==$vo.code} + + {/if} + {/volist} + {/if} +
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + +
+ +{/block} + + + +{block name="script"} + + +{/block} + \ No newline at end of file diff --git a/app/admin/view/nk/user/edit.html b/app/admin/view/nk/user/edit.html new file mode 100644 index 0000000..bb68706 --- /dev/null +++ b/app/admin/view/nk/user/edit.html @@ -0,0 +1,566 @@ +{extend name="common/base"/} +{block name="style"} + +{/block} + +{block name="body"} +
+

用户信息

+
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ + +
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ + {volist name="planting.crops_msg" id="vo"} +
+
+ 农作物名称 +
+
+ 数量 +
+
+ 面积 +
+
+ {/volist} + + + +
+
+ + +
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ + +
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ + +
+
+
+
+ 5 +
+
+
+ {/block} + + + + {block name="script"} + + {/block} + \ No newline at end of file diff --git a/app/admin/view/nk/user/index.html b/app/admin/view/nk/user/index.html new file mode 100644 index 0000000..d87b2b2 --- /dev/null +++ b/app/admin/view/nk/user/index.html @@ -0,0 +1,403 @@ +{extend name="common/base"/} + +{block name="body"} + +
+
+
+ +
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+ +
+
+
+ +
+
+ +
+ +
+ +
+
+ + + + + + +{/block} + + + +{block name="script"} + + +{/block} + \ No newline at end of file diff --git a/app/admin/view/nk/user/read.html b/app/admin/view/nk/user/read.html new file mode 100644 index 0000000..23971bd --- /dev/null +++ b/app/admin/view/nk/user/read.html @@ -0,0 +1,265 @@ +{extend name="common/base"/} +{block name="style"} + +{/block} + +{block name="body"} +
+

用户信息

+
+
    +
  • 个人信息
  • +
  • 家庭信息
  • + {if $planting.is==1 } +
  • 种植信息
  • + {/if} +
  • 保险信息
  • +
  • 健康信息
  • +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
姓名{$read.name|default='无'}民族 + {$read.nation|default='无'} +
婚姻情况 + {$read.marital_status|default='无'} + 政治面貌 + {$read.political_outlook|default='无'} +
手机号码{$read.phone|default='无'}身份证号 + {$read.idcard|default='无'} +
性别 + {$read.gender|default='无'} + 年龄 + {$read.age|default='无'} +
文化程度{$read.education|default='无'}职业 + {$read.occupation|default='无'} +
房屋情况 + {$read.house_msg|default='无'} + 车辆情况 + {$read.car_msg|default='无'} +
+
+
+ + + + + + + + +
户主{$family.name|default='无'}关系 + {$family.relation|default='无'} +
+

其他家庭成员

+ {volist name="family.list" id="vo"} + + + + + + + + + + + + + + {/volist} +
姓名 + {$vo.name|default='无'}    更多详情 点击此跳转 + 年龄 + {$vo.age|default='无'} +
性别{$vo.gender==1?'男':'女'}手机号码 + {$vo.phone|default='无'} +
+
+ {if $planting.is==1 } + +
+ + + + + + + + + + + + + +
土地外租{$planting.list.is_wz|default='无'}
土地性质{$planting.list.nature_of_land|default='无'}
土地面积{$planting3.list.land_area|default='无'}
+

农作物信息

+ + {notempty name="planting.list.breed_msg"} + {volist name='planting.list.crops_msg' id='vo' } + + + + + + + + + {/volist} + {/notempty} +
农作物{$vo.name}数量{$vo.num}面积{$vo.mianji}
+

养殖信息

+ + {notempty name="planting.list.breed_msg"} + {volist name='planting.list.breed_msg' id='vo' } + + + + + + + + + {/volist} + {/notempty} + +
养殖物{$vo.name}数量{$vo.num}面积{$vo.mianji}
+

农具信息

+ + {notempty name="planting.list.tools_msg"} + {volist name='planting.list.tools_msg' id='vo' } + + + + + + + {/volist} + {/notempty} + +
农具{$vo.name}数量{$vo.num}
+
+ {/if} +
+ + + + + + + + + + + + + + + + + + + + + + + +
养老保险状态{$insurancearr.endowment_insurance_status|default='无'}参保类型{$insurancearr.insurance_type|default='无'}
是否残疾{$insurancearr.whether_disabled|default='无'}残疾证号{$insurancearr.disability_num|default='无'}
残疾等级{$insurancearr.disability_level|default='无'}农业保险{$insurancearr.ny_insurance|default='无'}
商业保险{$insurancearr.sy_insurance|default='无'}
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
血型{$healthyarr.blood_type|default='无'}药物过敏史{$healthyarr.drug_allergy|default='无'}
暴露史{$healthyarr.exposure_history|default='无'}疾病史{$healthyarr.history_of_disease|default='无'}
手术史{$healthyarr.history_of_surgery|default='无'}家族史{$healthyarr.family_history|default='无'}
家族疾病{$healthyarr.familial_diseases|default='无'}遗传病史{$healthyarr.genetic_history|default='无'}
遗传病史{$healthyarr.genetic_name|default='无'}厨房排风设施{$healthyarr.cfpfss|default='无'}
燃料类型{$healthyarr.fuel_type|default='无'}饮水情况{$healthyarr.drinking_water|default='无'}
厕所情况{$healthyarr.toilet_msg|default='无'}禽畜栏{$healthyarr.poultry_corral|default='无'}
+
+
6
+
+
+
+{/block} + \ No newline at end of file diff --git a/public/static/assets/js/xm-select.js b/public/static/assets/js/xm-select.js new file mode 100644 index 0000000..bf44849 --- /dev/null +++ b/public/static/assets/js/xm-select.js @@ -0,0 +1,8 @@ +/*! + * @Title: xm-select + * @Version: 1.2.4 + * @Description:基于layui的多选解决方案 + * @Site: https://gitee.com/maplemei/xm-select + * @Author: maplemei + * @License:Apache License 2.0 + */!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="./",n(n.s=214)}({1:function(e,t,n){"use strict";function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:100,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=this,r=!1;return function(){for(var i=arguments.length,a=new Array(i),l=0;l>>0;for(t&&(n=t),o=new Array(a),r=0;r>>0;if("function"!=typeof e)throw new TypeError(e+" is not a function");for(arguments.length>1&&(n=t),o=0;o>>0;if("function"!=typeof e)throw new TypeError;for(var o=[],r=arguments[1],i=0;i>>0,r=arguments[1],i=0;i .xm-tips {\n color: #999999;\n padding: 0 10px;\n position: absolute;\n display: flex;\n height: 100%;\n align-items: center;\n}\nxm-select > .xm-icon {\n display: inline-block;\n overflow: hidden;\n position: absolute;\n width: 0;\n height: 0;\n right: 10px;\n top: 50%;\n margin-top: -3px;\n cursor: pointer;\n border: 6px dashed transparent;\n border-top-color: #C2C2C2;\n border-top-style: solid;\n transition: all 0.3s;\n -webkit-transition: all 0.3s;\n}\nxm-select > .xm-icon-expand {\n margin-top: -9px;\n transform: rotate(180deg);\n}\nxm-select > .xm-label.single-row {\n position: absolute;\n top: 0;\n bottom: 0px;\n left: 0px;\n right: 30px;\n overflow: auto hidden;\n}\nxm-select > .xm-label.single-row .scroll {\n overflow-y: hidden;\n}\nxm-select > .xm-label.single-row .label-content {\n flex-wrap: nowrap;\n white-space: nowrap;\n}\nxm-select > .xm-label.auto-row .label-content {\n flex-wrap: wrap;\n padding-right: 30px !important;\n}\nxm-select > .xm-label.auto-row .xm-label-block > span {\n white-space: unset;\n height: 100%;\n}\nxm-select > .xm-label .scroll .label-content {\n display: flex;\n padding: 3px 10px;\n}\nxm-select > .xm-label .xm-label-block {\n display: flex;\n position: relative;\n padding: 0px 5px;\n margin: 2px 5px 2px 0;\n border-radius: 3px;\n align-items: baseline;\n color: #FFF;\n}\nxm-select > .xm-label .xm-label-block > span {\n display: flex;\n color: #FFF;\n white-space: nowrap;\n}\nxm-select > .xm-label .xm-label-block > i {\n color: #FFF;\n margin-left: 8px;\n font-size: 12px;\n cursor: pointer;\n display: flex;\n}\nxm-select > .xm-label .xm-label-block.disabled {\n background-color: #C2C2C2 !important;\n cursor: no-drop !important;\n}\nxm-select > .xm-label .xm-label-block.disabled > i {\n cursor: no-drop !important;\n}\nxm-select > .xm-body {\n position: absolute;\n left: 0;\n top: 42px;\n padding: 5px 0;\n z-index: 999;\n width: 100%;\n min-width: fit-content;\n border: 1px solid #E6E6E6;\n background-color: #fff;\n border-radius: 2px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);\n animation-name: xm-upbit;\n animation-duration: 0.3s;\n animation-fill-mode: both;\n}\nxm-select > .xm-body .scroll-body {\n overflow-x: hidden;\n overflow-y: auto;\n}\nxm-select > .xm-body .scroll-body::-webkit-scrollbar {\n width: 8px;\n}\nxm-select > .xm-body .scroll-body::-webkit-scrollbar-track {\n -webkit-border-radius: 2em;\n -moz-border-radius: 2em;\n -ms-border-radius: 2em;\n border-radius: 2em;\n background-color: #FFF;\n}\nxm-select > .xm-body .scroll-body::-webkit-scrollbar-thumb {\n -webkit-border-radius: 2em;\n -moz-border-radius: 2em;\n -ms-border-radius: 2em;\n border-radius: 2em;\n background-color: #C2C2C2;\n}\nxm-select > .xm-body.up {\n top: auto;\n bottom: 42px;\n}\nxm-select > .xm-body.relative {\n position: relative;\n display: block !important;\n top: 0;\n box-shadow: none;\n border: none;\n animation-name: none;\n animation-duration: 0;\n min-width: 100%;\n}\nxm-select > .xm-body .xm-group {\n cursor: default;\n}\nxm-select > .xm-body .xm-group-item {\n display: inline-block;\n cursor: pointer;\n padding: 0 10px;\n color: #999;\n font-size: 12px;\n}\nxm-select > .xm-body .xm-option {\n display: flex;\n align-items: center;\n position: relative;\n padding: 0 10px;\n cursor: pointer;\n}\nxm-select > .xm-body .xm-option-icon {\n color: transparent;\n display: flex;\n border: 1px solid #E6E6E6;\n border-radius: 3px;\n justify-content: center;\n align-items: center;\n}\nxm-select > .xm-body .xm-option-icon.xm-custom-icon {\n color: unset;\n border: unset;\n}\nxm-select > .xm-body .xm-option-icon-hidden {\n margin-right: -10px;\n}\nxm-select > .xm-body .xm-option-icon.xm-icon-danx {\n border-radius: 100%;\n}\nxm-select > .xm-body .xm-option-content {\n display: flex;\n position: relative;\n padding-left: 15px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n color: #666;\n width: calc(100% - 20px);\n}\nxm-select > .xm-body .xm-option.hide-icon .xm-option-content {\n padding-left: 0;\n}\nxm-select > .xm-body .xm-option.selected.hide-icon .xm-option-content {\n color: #FFF !important;\n}\nxm-select > .xm-body .xm-option .loader {\n width: 0.8em;\n height: 0.8em;\n margin-right: 6px;\n color: #C2C2C2;\n}\nxm-select > .xm-body .xm-select-empty {\n text-align: center;\n color: #999;\n}\nxm-select > .xm-body .disabled {\n cursor: no-drop;\n}\nxm-select > .xm-body .disabled:hover {\n background-color: #FFF;\n}\nxm-select > .xm-body .disabled .xm-option-icon {\n border-color: #C2C2C2 !important;\n}\nxm-select > .xm-body .disabled .xm-option-content {\n color: #C2C2C2 !important;\n}\nxm-select > .xm-body .disabled.selected > .xm-option-icon {\n color: #C2C2C2 !important;\n}\nxm-select > .xm-body .xm-search {\n background-color: #FFF !important;\n position: relative;\n padding: 0 10px;\n margin-bottom: 5px;\n cursor: pointer;\n}\nxm-select > .xm-body .xm-search > i {\n position: absolute;\n color: #666;\n}\nxm-select > .xm-body .xm-search-input {\n border: none;\n border-bottom: 1px solid #E6E6E6;\n padding-left: 27px;\n cursor: text;\n}\nxm-select > .xm-body .xm-paging {\n padding: 0 10px;\n display: flex;\n margin-top: 5px;\n}\nxm-select > .xm-body .xm-paging > span:first-child {\n border-radius: 2px 0 0 2px;\n}\nxm-select > .xm-body .xm-paging > span:last-child {\n border-radius: 0 2px 2px 0;\n}\nxm-select > .xm-body .xm-paging > span {\n display: flex;\n flex: auto;\n justify-content: center;\n vertical-align: middle;\n margin: 0 -1px 0 0;\n background-color: #fff;\n color: #333;\n font-size: 12px;\n border: 1px solid #e2e2e2;\n flex-wrap: nowrap;\n width: 100%;\n overflow: hidden;\n min-width: 50px;\n}\nxm-select > .xm-body .xm-toolbar {\n padding: 0 10px;\n display: flex;\n margin: -3px 0;\n cursor: default;\n}\nxm-select > .xm-body .xm-toolbar .toolbar-tag {\n cursor: pointer;\n display: flex;\n margin-right: 20px;\n color: #666;\n align-items: baseline;\n}\nxm-select > .xm-body .xm-toolbar .toolbar-tag:hover {\n opacity: 0.8;\n}\nxm-select > .xm-body .xm-toolbar .toolbar-tag:active {\n opacity: 1;\n}\nxm-select > .xm-body .xm-toolbar .toolbar-tag > i {\n margin-right: 2px;\n font-size: 14px;\n}\nxm-select > .xm-body .xm-toolbar .toolbar-tag:last-child {\n margin-right: 0;\n}\nxm-select > .xm-body .xm-body-custom {\n line-height: initial;\n cursor: default;\n}\nxm-select > .xm-body .xm-body-custom * {\n box-sizing: initial;\n}\nxm-select > .xm-body .xm-tree {\n position: relative;\n}\nxm-select > .xm-body .xm-tree-icon {\n display: inline-block;\n margin-right: 3px;\n cursor: pointer;\n border: 6px dashed transparent;\n border-left-color: #C2C2C2;\n border-left-style: solid;\n transition: all 0.3s;\n -webkit-transition: all 0.3s;\n z-index: 2;\n visibility: hidden;\n}\nxm-select > .xm-body .xm-tree-icon.expand {\n margin-top: 3px;\n margin-right: 5px;\n margin-left: -2px;\n transform: rotate(90deg);\n}\nxm-select > .xm-body .xm-tree-icon.xm-visible {\n visibility: visible;\n}\nxm-select > .xm-body .xm-tree .left-line {\n position: absolute;\n left: 13px;\n width: 0;\n z-index: 1;\n border-left: 1px dotted #c0c4cc !important;\n}\nxm-select > .xm-body .xm-tree .top-line {\n position: absolute;\n left: 13px;\n height: 0;\n z-index: 1;\n border-top: 1px dotted #c0c4cc !important;\n}\nxm-select > .xm-body .xm-tree .xm-tree-icon + .top-line {\n margin-left: 1px;\n}\nxm-select > .xm-body .scroll-body > .xm-tree > .xm-option > .top-line,\nxm-select > .xm-body .scroll-body > .xm-option > .top-line {\n width: 0 !important;\n}\nxm-select > .xm-body .xm-cascader-box {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n padding: 5px 0;\n border: 1px solid #E6E6E6;\n background-color: #fff;\n border-radius: 2px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);\n margin: -1px;\n}\nxm-select > .xm-body .xm-cascader-box::before {\n content: ' ';\n position: absolute;\n width: 0;\n height: 0;\n border: 6px solid transparent;\n border-right-color: #E6E6E6;\n top: 10px;\n left: -12px;\n}\nxm-select > .xm-body .xm-cascader-box::after {\n content: ' ';\n position: absolute;\n width: 0;\n height: 0;\n border: 6px solid transparent;\n border-right-color: #fff;\n top: 10px;\n left: -11px;\n}\nxm-select > .xm-body .xm-cascader-scroll {\n height: 100%;\n overflow-x: hidden;\n overflow-y: auto;\n}\nxm-select > .xm-body.cascader {\n width: unset;\n min-width: unset;\n}\nxm-select > .xm-body.cascader .xm-option-content {\n padding-left: 8px;\n}\nxm-select > .xm-body.cascader .disabled .xm-right-arrow {\n color: #C2C2C2 !important;\n}\nxm-select > .xm-body.cascader .hide-icon.disabled .xm-right-arrow {\n color: #999 !important;\n}\nxm-select .xm-input {\n cursor: pointer;\n border-radius: 2px;\n border-width: 1px;\n border-style: solid;\n border-color: #E6E6E6;\n display: block;\n width: 100%;\n box-sizing: border-box;\n background-color: #FFF;\n line-height: 1.3;\n padding-left: 10px;\n outline: 0;\n user-select: text;\n -ms-user-select: text;\n -moz-user-select: text;\n -webkit-user-select: text;\n}\nxm-select .dis {\n display: none;\n}\nxm-select .loading {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(255, 255, 255, 0.6);\n display: flex;\n align-items: center;\n justify-content: center;\n}\nxm-select .loader {\n border: 0.2em dotted currentcolor;\n border-radius: 50%;\n -webkit-animation: 1s loader linear infinite;\n animation: 1s loader linear infinite;\n display: inline-block;\n width: 1em;\n height: 1em;\n color: inherit;\n vertical-align: middle;\n pointer-events: none;\n}\nxm-select .xm-select-default {\n position: absolute;\n width: 100%;\n height: 100%;\n border: none;\n visibility: hidden;\n}\nxm-select .xm-select-disabled {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n cursor: no-drop;\n z-index: 2;\n opacity: 0.3;\n background-color: #FFF;\n}\nxm-select .item--divided {\n border-top: 1px solid #ebeef5;\n width: calc(100% - 20px);\n cursor: initial;\n}\nxm-select .xm-right-arrow {\n position: absolute;\n color: #666;\n right: 5px;\n top: -1px;\n font-weight: 700;\n transform: scale(0.6, 1);\n}\nxm-select .xm-right-arrow::after {\n content: '>';\n}\nxm-select[size='large'] {\n min-height: 40px;\n line-height: 40px;\n}\nxm-select[size='large'] .xm-input {\n height: 40px;\n}\nxm-select[size='large'] .xm-label .scroll .label-content {\n line-height: 34px;\n}\nxm-select[size='large'] .xm-label .xm-label-block {\n height: 30px;\n line-height: 30px;\n}\nxm-select[size='large'] .xm-body .xm-option .xm-option-icon {\n height: 20px;\n width: 20px;\n font-size: 20px;\n}\nxm-select[size='large'] .xm-paging > span {\n height: 34px;\n line-height: 34px;\n}\nxm-select[size='large'] .xm-tree .left-line {\n height: 100%;\n bottom: 20px;\n}\nxm-select[size='large'] .xm-tree .left-line-group {\n height: calc(100% - 40px);\n}\nxm-select[size='large'] .xm-tree .xm-tree-icon.xm-hidden + .top-line {\n top: 19px;\n}\nxm-select[size='large'] .item--divided {\n margin: 10px;\n}\nxm-select {\n min-height: 36px;\n line-height: 36px;\n}\nxm-select .xm-input {\n height: 36px;\n}\nxm-select .xm-label .scroll .label-content {\n line-height: 30px;\n}\nxm-select .xm-label .xm-label-block {\n height: 26px;\n line-height: 26px;\n}\nxm-select .xm-body .xm-option .xm-option-icon {\n height: 18px;\n width: 18px;\n font-size: 18px;\n}\nxm-select .xm-paging > span {\n height: 30px;\n line-height: 30px;\n}\nxm-select .xm-tree .left-line {\n height: 100%;\n bottom: 18px;\n}\nxm-select .xm-tree .left-line-group {\n height: calc(100% - 36px);\n}\nxm-select .xm-tree .xm-tree-icon.xm-hidden + .top-line {\n top: 17px;\n}\nxm-select .item--divided {\n margin: 9px;\n}\nxm-select[size='small'] {\n min-height: 32px;\n line-height: 32px;\n}\nxm-select[size='small'] .xm-input {\n height: 32px;\n}\nxm-select[size='small'] .xm-label .scroll .label-content {\n line-height: 26px;\n}\nxm-select[size='small'] .xm-label .xm-label-block {\n height: 22px;\n line-height: 22px;\n}\nxm-select[size='small'] .xm-body .xm-option .xm-option-icon {\n height: 16px;\n width: 16px;\n font-size: 16px;\n}\nxm-select[size='small'] .xm-paging > span {\n height: 26px;\n line-height: 26px;\n}\nxm-select[size='small'] .xm-tree .left-line {\n height: 100%;\n bottom: 16px;\n}\nxm-select[size='small'] .xm-tree .left-line-group {\n height: calc(100% - 32px);\n}\nxm-select[size='small'] .xm-tree .xm-tree-icon.xm-hidden + .top-line {\n top: 15px;\n}\nxm-select[size='small'] .item--divided {\n margin: 8px;\n}\nxm-select[size='mini'] {\n min-height: 28px;\n line-height: 28px;\n}\nxm-select[size='mini'] .xm-input {\n height: 28px;\n}\nxm-select[size='mini'] .xm-label .scroll .label-content {\n line-height: 22px;\n}\nxm-select[size='mini'] .xm-label .xm-label-block {\n height: 18px;\n line-height: 18px;\n}\nxm-select[size='mini'] .xm-body .xm-option .xm-option-icon {\n height: 14px;\n width: 14px;\n font-size: 14px;\n}\nxm-select[size='mini'] .xm-paging > span {\n height: 22px;\n line-height: 22px;\n}\nxm-select[size='mini'] .xm-tree .left-line {\n height: 100%;\n bottom: 14px;\n}\nxm-select[size='mini'] .xm-tree .left-line-group {\n height: calc(100% - 28px);\n}\nxm-select[size='mini'] .xm-tree .xm-tree-icon.xm-hidden + .top-line {\n top: 13px;\n}\nxm-select[size='mini'] .item--divided {\n margin: 7px;\n}\n.layui-form-pane xm-select {\n margin: -1px -1px -1px 0;\n}\n",""]),e.exports=t},221:function(e,t){(function(t){e.exports=t}).call(this,{})},27:function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",o=e[3];if(!o)return n;if(t&&"function"==typeof btoa){var r=function(e){var t=btoa(unescape(encodeURIComponent(JSON.stringify(e)))),n="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(t);return"/*# ".concat(n," */")}(o),i=o.sources.map((function(e){return"/*# sourceURL=".concat(o.sourceRoot||"").concat(e," */")}));return[n].concat(i).concat([r]).join("\n")}return[n].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,o){"string"==typeof e&&(e=[[null,e,""]]);var r={};if(o)for(var i=0;i=0&&p.splice(t,1)}function y(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var o=function(){0;return n.nc}();o&&(e.attrs.nonce=o)}return x(t,e.attrs),m(e,t),t}function x(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function v(e,t){var n,o,r,i;if(t.transform&&e.css){if(!(i="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=i}if(t.singleton){var a=u++;n=c||(c=y(t)),o=w.bind(null,n,a,!1),r=w.bind(null,n,a,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",x(t,e.attrs),m(e,t),t}(t),o=O.bind(null,n,t),r=function(){b(n),n.href&&URL.revokeObjectURL(n.href)}):(n=y(t),o=k.bind(null,n),r=function(){b(n)});return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else r()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=a()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=h(e,t);return d(n,t),function(e){for(var o=[],r=0;r3)for(n=[n],o=3;o1&&E(r,t,n),t=O(n,r,r,e.__k,null,r.__e,t),"function"==typeof e.type&&(e.__d=t)))}function A(e,t,n,r,i,a,l,s,c){var u,p,f,h,m,b,v,g,_,w,O,C=t.type;if(void 0!==t.constructor)return null;(u=o.__b)&&u(t);try{e:if("function"==typeof C){if(g=t.props,_=(u=C.contextType)&&r[u.__c],w=u?_?_.props.value:u.__:r,n.__c?v=(p=t.__c=n.__c).__=p.__E:("prototype"in C&&C.prototype.render?t.__c=p=new C(g,w):(t.__c=p=new x(g,w),p.constructor=C,p.render=M),_&&_.sub(p),p.props=g,p.state||(p.state={}),p.context=w,p.__n=r,f=p.__d=!0,p.__h=[]),null==p.__s&&(p.__s=p.state),null!=C.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=d({},p.__s)),d(p.__s,C.getDerivedStateFromProps(g,p.__s))),h=p.props,m=p.state,f)null==C.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==C.getDerivedStateFromProps&&g!==h&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(g,w),!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(g,p.__s,w)||t.__v===n.__v){p.props=g,p.state=p.__s,t.__v!==n.__v&&(p.__d=!1),p.__v=t,t.__e=n.__e,t.__k=n.__k,p.__h.length&&l.push(p),E(t,s,e);break e}null!=p.componentWillUpdate&&p.componentWillUpdate(g,p.__s,w),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(h,m,b)}))}p.context=w,p.props=g,p.state=p.__s,(u=o.__r)&&u(t),p.__d=!1,p.__v=t,p.__P=e,u=p.render(p.props,p.state,p.context),p.state=p.__s,null!=p.getChildContext&&(r=d(d({},r),p.getChildContext())),f||null==p.getSnapshotBeforeUpdate||(b=p.getSnapshotBeforeUpdate(h,m)),O=null!=u&&u.type==y&&null==u.key?u.props.children:u,k(e,Array.isArray(O)?O:[O],t,n,r,i,a,l,s,c),p.base=t.__e,p.__h.length&&l.push(p),v&&(p.__E=p.__=null),p.__e=!1}else null==a&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=P(n.__e,t,n,r,i,a,l,c);(u=o.diffed)&&u(t)}catch(e){t.__v=null,o.__e(e,t,n)}return t.__e}function R(e,t){o.__c&&o.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){o.__e(e,t.__v)}}))}function P(e,t,n,o,r,i,a,l){var s,c,f,d,h,m=n.props,b=t.props;if(r="svg"===t.type||r,null!=i)for(s=0;se.length)&&(t=e.length);for(var n=0,o=new Array(t);nr?n-r:r,a=this.labelRef.scrollLeft+e.deltaY;a<0&&(a=0),a>i&&(a=i),this.labelRef.scrollLeft=a}}},{key:"blur",value:function(){var e=this.base.querySelector(".label-search-input");e&&e.blur()}},{key:"labelDrag",value:function(e,t){for(var n=t.type,o=t.target;;){if(!o||"I"===o.tagName)return;if("DIV"===o.tagName&&"fixed"!==o.style.position)break;o=o.parentNode}if(console.log(t),"mousedown"===n){var r=o.cloneNode(!0),i=t.pageX,a=t.pageY,l=t.offsetX,s=t.offsetY;console.log(i,a,l,s),r.style.position="fixed",r.style.left=i-l+"px",r.style.top=a-s+"px",o.appendChild(r),console.log(r),r.onmousemove=function(e){r.style.left=e.pageX-l+"px",r.style.top=e.pageY-s+"px"},r.mouseup=function(){r.parentNode.removeChild(r),r.onmousemove=null,r.mouseup=null,r.mouseleave=null},r.mouseleave=function(){console.log("mouseleave")}}else if("mouseup"===n)for(var c=o.childNodes,u=0;ue.length)&&(t=e.length);for(var n=0,o=new Array(t);n0&&void 0!==arguments[0]||this.size;var e=this.state.pageIndex;e<=1||(this.changePageIndex(e-1),this.props.pageRemote&&this.postData(e-1,!0))}},{key:"pageNextClick",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.size,t=this.state.pageIndex;t>=e||(this.changePageIndex(t+1),this.props.pageRemote&&this.postData(t+1,!0))}},{key:"changePageIndex",value:function(e){this.setState({pageIndex:e})}},{key:"labelSearch",value:function(e){"input"==e.type?this.searchInput(e):this.handleComposition(e)}},{key:"searchInput",value:function(e){var t=this,n=e.target.value;n!==this.__value&&(this.searchCid&&clearTimeout(this.searchCid),this.inputOver&&(this.__value=n,this.searchCid=setTimeout((function(){t.callback=!0,t.setState({filterValue:t.__value,remote:!0,pageIndex:1})}),this.props.delay)))}},{key:"focus",value:function(){this.searchInputRef&&this.searchInputRef.focus()}},{key:"blur",value:function(){this.searchInputRef&&this.searchInputRef.blur()}},{key:"handleComposition",value:function(e){var t=e.type;"compositionstart"===t?(this.inputOver=!1,this.searchCid&&clearTimeout(this.searchCid)):"compositionend"===t&&(this.inputOver=!0,this.searchInput(e))}},{key:"postData",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.pageIndex,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(this.state.remote||n)&&(this.callback=!1,this.setState({loading:!0,remote:!1}),this.blur(),this.props.remoteMethod(this.state.filterValue,(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;setTimeout((function(){e.focus(),e.callback=!0,e.setState({loading:!1,totalSize:n}),e.props.onReset(t,"data")}),10)}),this.props.show,t))}},{key:"keydown",value:function(e,t){var n=this,o=t.keyCode;if("div"===e&&(27===o||9===o?this.props.onReset(!1,"close"):37===o?this.pagePrevClick():39===o&&this.pageNextClick()),this.props.enableKeyboard){var r=this.props.prop,i=r.value,a=r.optgroup,l=r.disabled,s=this.tempData.filter((function(e){return!e[a]&&!e[l]})),c=s.length-1;if(-1===c)return;var u=s.findIndex((function(e){return e[i]===n.state.val}));if(38===o){u<=0?u=c:u>0&&(u-=1);var p=s[u][i];this.setState({val:p}),this.viewTo(p)}else if(40===o){-1===u||u===c?u=0:uM&&(T=M),M>0&&T<=0&&(T=1),!x){var z=(T-1)*e.pageSize,L=z+e.pageSize;S=S.slice(z,L)}var V={cursor:"no-drop",color:"#d2d2d2"},F={},U={};T<=1&&(F=V),T==M&&(U=V),this.state.pageIndex!==T&&this.changePageIndex(T),this.size=M,D=m("div",{class:"xm-paging"},m("span",{style:F,onClick:this.pagePrevClick.bind(this,M)},e.languageProp.paging.prev),m("span",null,this.state.pageIndex," / ",M),m("span",{style:U,onClick:this.pageNextClick.bind(this,M)},e.languageProp.paging.next))}else e.showCount>0&&(S=S.slice(0,e.showCount));var N,B,K=[],H={__tmp:!0};H[j]=!0,S.forEach((function(e){var t=I[e.__group__index];delete e.__group__index,N&&!t&&(t=H),t!=N&&(N=t,t&&K.push(N)),K.push(e)})),S=K,t&&null!=(t=y(this.state.filterValue,Object(c.b)([],S)))&&(B=S).splice.apply(B,[0,0].concat(J((Object(c.d)(t)?t:[t]).map((function(e){return Z(Z({},e),{},{__node:{}})})))));var q=Object(c.b)([],S);this.tempData=q;var Y=m("div",{class:"xm-toolbar"},e.toolbar.list.map((function(t){var o,r=e.languageProp.toolbar[t];o="ALL"===t?{icon:"xm-iconfont xm-icon-quanxuan",name:r,method:function(e){var t=i.optgroup,o=i.disabled,r=e.filter((function(e){return!e[t]})).filter((function(e){return!e[o]})),a=u.filter((function(e){return e[i.disabled]})),l=[];l=s?a.length?a:r.slice(0,1):v>0?a.length>=v?a:Object(c.f)(r.slice(0,v-a.length),a,i):Object(c.f)(r,u,i),n.props.onReset(l,"sels")}}:"CLEAR"===t?{icon:"xm-iconfont xm-icon-qingkong",name:r,method:function(e){n.props.onReset(u.filter((function(e){return e[i.disabled]})),"sels")}}:"REVERSE"===t?{icon:"xm-iconfont xm-icon-fanxuan",name:r,method:function(e){var t=i.optgroup,o=i.disabled,r=e.filter((function(e){return!e[t]})).filter((function(e){return!e[o]})),a=[];u.forEach((function(e){var t=r.findIndex((function(t){return t[k]===e[k]}));-1==t?a.push(e):r.splice(t,1)}));var l=a.filter((function(e){return e[i.disabled]})),p=[];p=s?l.length?l:r.slice(0,1):v>0?l.length>=v?l:Object(c.f)(r.slice(0,v-l.length),l,i):Object(c.f)(r,a,i),n.props.onReset(p,"sels")}}:t;var a=function(e){"mouseenter"===e.type&&(e.target.style.color=l.color),"mouseleave"===e.type&&(e.target.style.color="")};return m("div",{class:"toolbar-tag",style:{},onClick:function(){Object(c.e)(o.method)&&o.method(q),n.focus()},onMouseEnter:a,onMouseLeave:a},e.toolbar.showIcon&&m("i",{class:o.icon}),m("span",null,o.name))})).filter((function(e){return e}))),Q="hidden"!=e.model.icon;return(S=S.map((function(t){return t[j]?t.__tmp?m("div",{class:"item--divided"}):m("div",{class:"xm-group"},m("div",{class:"xm-group-item",onClick:n.groupClick.bind(n,t)},t[w])):function(t){var r=!!u.find((function(e){return e[k]==t[k]})),i=r?{color:l.color,border:"none"}:{borderColor:l.color},c={};g&&t[k]===n.state.val&&(c.backgroundColor=l.hover),!Q&&r&&(c.backgroundColor=l.color,t[O]&&(c.backgroundColor="#C2C2C2"));var p,f,d=["xm-option",t[O]?" disabled":"",r?" selected":"",Q?"show-icon":"hide-icon"].join(" "),h=["xm-option-icon",(p=e.iconfont.select,f=e.iconfont.unselect,(p?!r&&f?f+" xm-custom-icon":p:0)||"xm-iconfont "+(s?"xm-icon-danx":"xm-icon-duox"))].join(" "),b=function(e){"mouseenter"===e.type?t[O]||(g?n.setState({val:t[k]}):e.target.style.backgroundColor=l.hover):"mouseleave"===e.type&&(t[O]||g||(e.target.style.backgroundColor=""))};return m("div",{class:d,style:c,value:t[k],onClick:n.optionClick.bind(n,t,r,t[O]),onMouseEnter:b,onMouseLeave:b},Q&&m("i",{class:h,style:i}),m("div",{class:"xm-option-content",dangerouslySetInnerHTML:{__html:a({data:o,item:t,arr:u,name:t[w],value:t[k]})}}))}(t)}))).length?_&&this.state.val==ne&&this.keydown("div",{keyCode:40}):(!e.pageEmptyShow&&(D=""),S.push(m("div",{class:"xm-select-empty"},p))),m("div",{onClick:this.blockClick,tabindex:"1",style:"outline: none;"},m("div",null,e.toolbar.show&&Y,P,m("div",{class:"scroll-body",style:{maxHeight:e.height}},S),e.paging&&D),this.state.loading&&m("div",{class:"loading"},m("span",{class:"loader"})))}},{key:"componentDidMount",value:function(){var e=this.base.querySelector(".xm-search-input");e&&(e.addEventListener("compositionstart",this.handleComposition.bind(this)),e.addEventListener("compositionupdate",this.handleComposition.bind(this)),e.addEventListener("compositionend",this.handleComposition.bind(this)),e.addEventListener("input",this.searchInput.bind(this)),this.searchInputRef=e),this.base.addEventListener("keydown",this.keydown.bind(this,"div"))}},{key:"componentDidUpdate",value:function(){if(this.callback){this.callback=!1;var e=this.props.filterDone;Object(c.e)(e)&&e(this.state.filterValue,this.tempData||[])}}}])&&G(t.prototype,n),o&&G(t,o),i}(x);function re(e){return(re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ie(e,t){for(var n=0;n0||p.lazy&&!1!==e.__node.loading)?"xm-visible":"xm-hidden"].join(" "),j=[];p.showFolderIcon&&(j.push(m("i",{class:C,type:"expand"})),p.showLine&&(o&&j.push(m("i",{class:"left-line",style:{left:t-p.indent+3+"px"}})),j.push(m("i",{class:"top-line",style:{left:t-p.indent+3+"px",width:p.indent+(0===o?10:-2)+"px"}}))));var S=function(t){"mouseenter"===t.type?e[g]||(y?n.setState({val:e[v]}):t.target.style.backgroundColor=a.hover):"mouseleave"===t.type&&(e[g]||y||(t.target.style.backgroundColor=""))};return m("div",{class:w,style:h,value:e[v],onClick:n.optionClick.bind(n,e,r,e[g],"line"),onMouseEnter:S,onMouseLeave:S},j,e.__node.loading&&m("span",{class:"loader"}),k&&m("i",{class:O,style:d,onClick:n.optionClick.bind(n,e,r,e[g],"checkbox")}),m("div",{class:"xm-option-content",dangerouslySetInnerHTML:{__html:s({data:u,item:e,arr:i,name:e[x],value:e[v]})}}))};f&&(d?this.postData():this.filterData(u,this.state.filterValue));var C=Object(c.b)([],u),j=Object(c.b)([],i);this.tempData=C;var S=u.map((function(e){return function e(t,o){if(!t.__node.hidn){var r=t[_];if(o+=p.indent,r){var i=-1!==n.state.expandedKeys.findIndex((function(e){return t[v]===e}));return 0===r.length&&(i=!1),m("div",{class:"xm-tree"},p.showFolderIcon&&p.showLine&&i&&r.length>0&&m("i",{class:"left-line left-line-group",style:{left:o+3+"px"}}),O(t,o,0===r.length&&(!p.lazy||p.lazy&&!1===t.__node.loading)?0:i),i&&m("div",{class:"xm-tree-box"},r.map((function(t){return e(t,o)}))))}return O(t,o,0)}}(e,10-p.indent)})).filter((function(e){return e}));function E(e,t){t.forEach((function(t){t[w]?(p.strict||"hidden"===b.parent||e.push(t),E(e,t[_])):e.push(t)}))}var A=m("div",{class:"xm-toolbar"},e.toolbar.list.map((function(t){var r,s=e.languageProp.toolbar[t];r="ALL"===t?{icon:"xm-iconfont xm-icon-quanxuan",name:s,method:function(e){var t=[];E(t,e),t=t.filter((function(e){return!e[g]&&!e.__node.hidn})),n.props.onReset(l?t.slice(0,1):Object(c.f)(t,i,o),"treeData")}}:"CLEAR"===t?{icon:"xm-iconfont xm-icon-qingkong",name:s,method:function(e){n.props.onReset(i.filter((function(e){return e[o.disabled]})),"treeData")}}:"REVERSE"===t?{icon:"xm-iconfont xm-icon-fanxuan",name:s,method:function(e){var t=[];E(t,e),t=t.filter((function(e){return!e[g]&&!e.__node.hidn}));var r=[];i.forEach((function(e){var n=t.findIndex((function(t){return t[v]===e[v]}));-1==n?r.push(e):t.splice(n,1)})),n.props.onReset(l?r.slice(0,1):Object(c.f)(t,r,o),"treeData")}}:t;var u=function(e){"mouseenter"===e.type&&(e.target.style.color=a.color),"mouseleave"===e.type&&(e.target.style.color="")};return m("div",{class:"toolbar-tag",onClick:function(){Object(c.e)(r.method)&&r.method(C,j)},onMouseEnter:u,onMouseLeave:u},e.toolbar.showIcon&&m("i",{class:r.icon}),m("span",null,r.name))})).filter((function(e){return e}))),R=m("div",{class:f?"xm-search":"xm-search dis"},m("i",{class:"xm-iconfont xm-icon-sousuo"}),m("input",{class:"xm-input xm-search-input",placeholder:h}));return S.length||S.push(m("div",{class:"xm-select-empty"},r)),m("div",{onClick:this.blockClick,class:"xm-body-tree"},e.toolbar.show&&A,R,m("div",{class:"scroll-body",style:{maxHeight:e.height}},S),this.state.loading&&m("div",{class:"loading"},m("span",{class:"loader"})))}},{key:"componentDidMount",value:function(){var e=this.base.querySelector(".xm-search-input");e&&(e.addEventListener("compositionstart",this.handleComposition.bind(this)),e.addEventListener("compositionupdate",this.handleComposition.bind(this)),e.addEventListener("compositionend",this.handleComposition.bind(this)),e.addEventListener("input",this.searchInput.bind(this)),this.searchInputRef=e)}},{key:"componentDidUpdate",value:function(){if(this.callback){this.callback=!1;var e=this.props.filterDone;Object(c.e)(e)&&e(this.state.filterValue,this.tempData||[])}}}])&&fe(t.prototype,n),o&&fe(t,o),i}(x);function ve(e){return(ve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ge(e,t){for(var n=0;n0,O={backgroundColor:"transparent"},C=["xm-option",g?" disabled":"",v?" selected":"",y?"show-icon":"hide-icon"].join(" "),j=k&&"hidden"===e.iconfont.parent?"xm-option-icon-hidden":["xm-option-icon",(_?e.iconfont.half?e.iconfont.half+" xm-custom-icon":0:k&&e.iconfont.parent?e.iconfont.parent+" xm-custom-icon":v?e.iconfont.select?e.iconfont.select:0:e.iconfont.unselect?e.iconfont.unselect+" xm-custom-icon":0)||"xm-iconfont "+(l?"xm-icon-danx":u.strict&&_?"xm-icon-banxuan":"xm-icon-duox")].join(" ");t[f]===n.state.val&&(O.backgroundColor=a.hover),!y&&v&&(O.backgroundColor=a.color,g&&(O.backgroundColor="#C2C2C2"));var S={},E={};x&&(S.color=a.color,S.fontWeight=700,E.color=a.color);var A=function(e){"mouseenter"===e.type?t[d]||n.setState({val:t[f]}):"mouseleave"===e.type&&n.setState({val:""})};return m("div",{class:C,style:O,value:t[f],onClick:n.optionClick.bind(n,t,v,g,"line",r),onMouseEnter:A,onMouseLeave:A},y&&m("i",{class:j,style:w,onClick:n.optionClick.bind(n,t,v,g,"checkbox",r)}),m("div",{class:"xm-option-content",style:S,dangerouslySetInnerHTML:{__html:s({data:c,item:t,arr:i,name:t[p],value:t[f]})}}),t[b]&&m("div",{class:"xm-right-arrow",style:E}))}(o,0,v,_)},g=c.map((function(e){return v(e,2,0)})).concat(x).filter((function(e){return e}));return g.length||g.push(m("div",{class:"xm-select-empty"},r)),m("div",{onClick:this.blockClick,class:"xm-body-cascader scroll-body",style:{width:u.indent+"px",maxHeight:e.height}},g)}},{key:"componentDidMount",value:function(){this.props.onReset("cascader","class")}}])&&ge(t.prototype,n),o&&ge(t,o),i}(x);function je(){return(je=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,o=new Array(t);n1&&(n=n.slice(0,1),(l.show&&l.strict||s.show&&s.strict)&&this.clearAndReset(o,n,!1)),this.setState({sels:n,dataObj:c,flatData:u})}return this.setState({data:o}),n}},{key:"upDate",value:function(e,t){var n=this.state.dataObj,o=this.props,r=o.prop,i=o.tree,a=o.cascader,l=r.value,s=r.disabled,u=r.children;e.map((function(e){return n["object"===Ie(e)?e[l]:e]})).filter((function(e){return e})).forEach((function(e){if(e[s]=!t,i.show&&i.strict||a.show&&a.strict){if(t)for(var n=e;n;)n[s]=!1,n=n.__node.parent;!function e(n){n[s]=!t;var o=n[u];o&&Object(c.d)(o)&&o.forEach((function(t){return e(t)}))}(e)}})),this.setState({dataObj:n})}},{key:"exchangeValue",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state.dataObj,o=this.props,r=o.prop,i=o.tree,a=o.cascader,l=(o.data,r.children),s=r.value,u=e.map((function(e){return"object"===Ie(e)?Re(Re({},e),{},{__node:{}}):n[e]})).filter((function(e){return e})),p=Se(u);if(i.show&&i.strict||a.show&&a.strict){var f=function e(t,n){var o=n[l];o&&Object(c.d)(o)&&o.forEach((function(n){-1===u.findIndex((function(e){return e[s]===n[s]}))&&t.push(n),e(t,n)}))},d={};d[l]=u,f(p,d),p=p.filter((function(e){return!0!==e[t.props.prop.optgroup]}))}return p}},{key:"value",value:function(e,t,n,o){var r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];!1!==t&&!0!==t&&(t=this.state.show);var i=this.props,a=i.prop,l=i.tree,s=i.cascader,c=this.exchangeValue(e);if(!this.checkMax(c,c,!0)){if(l.show&&l.strict||s.show&&s.strict){var u=this.state.data;this.clearAndReset(u,c,!1),c=this.init({data:u,prop:a},!0)}this.resetSelectValue(c,o||c,r,n),this.setState({show:t})}}},{key:"clearAndReset",value:function(e,t,n){var o=this,r=this.props.prop,i=r.selected,a=r.disabled,l=r.children,s=r.value;e.forEach((function(e){e[i]=-1!=t.findIndex((function(t){return t[s]===e[s]}))||n;var r=e[l];if(r&&Object(c.d)(r)&&r.length>0){o.clearAndReset(r,t,e[i]);var u=r.length,p=r.filter((function(e){return!0===e[i]||!0===e.__node.selected})).length;e.__node.selected=p===u,e.__node.half=p>0&&p0,e.__node.disabled=r.filter((function(e){return!0===e[a]||!0===e.__node.disabled})).length===u}}))}},{key:"load",value:function(e,t,n,o){var r=this,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5?arguments[5]:void 0,l=this.props,s=l.prop,u=l.tree,p=l.cascader,f=s.children,d=s.optgroup,h=s.value,m=s.selected,b=s.disabled;e.forEach((function(e){e.__node={parent:o,level:i,loading:e.__node&&e.__node.loading},a&&(delete e[m],a.find((function(t){return t===e[h]}))&&(e[m]=!0)),t[e[h]]=e,n.push(e);var l=e[f];if(l&&Object(c.d)(l)){var s=l.length;if(s>0){r.load(l,t,n,e,i+1,a),e[d]=!0,(u.show&&u.strict||p.show&&p.strict)&&(!0===e[m]&&(delete e[m],l.forEach((function(e){return e[m]=!0}))),!0===e[b]&&(delete e[b],l.forEach((function(e){return e[b]=!0}))));var y=l.filter((function(e){return!0===e[m]||!0===e.__node.selected})).length;e.__node.selected=y===s,e.__node.half=y>0&&y0,e.__node.disabled=l.filter((function(e){return!0===e[b]||!0===e.__node.disabled})).length===s}}}))}},{key:"resetSelectValue",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=this.props.on;if(Object(c.e)(r)&&this.prepare&&o){var i=r({arr:e,change:t,isAdd:n});if(Object(c.d)(i))return this.value(i,null,!1)}this.setState({sels:e})}},{key:"updateBorderColor",value:function(e){this.setState({tmpColor:e})}},{key:"treeHandler",value:function(e,t,n,o,r){var i=this,a=this.props.prop,l=a.value,s=(a.selected,a.disabled),c=a.children,u=a.optgroup,p=t[c];if(p.filter((function(e){return!(e[s]||e.__node.disabled)})).forEach((function(t){if(t[u])i.treeHandler(e,t,n,o,r);else{var a=e.findIndex((function(e){return e[l]==t[l]}));"del"===o?-1!=a&&(e.splice(a,1),n.push(t)):"half"!==o&&"add"!==o||-1==a&&(e.push(t),n.push(t))}})),r){var f=p.length,d=p.filter((function(t){return-1!==e.findIndex((function(e){return e[l]===t[l]}))||!0===t.__node.selected})).length;t.__node.selected=d===f,t.__node.half=d>0&&dl;if(l>0&&s)return this.updateBorderColor(a.maxColor),i&&Object(c.e)(i)&&i(t,e),!0}},{key:"itemClick",value:function(e,t,n,o){var r=this.props,i=(r.theme,r.prop),a=r.radio,l=r.repeat,s=r.clickClose,c=(r.max,r.maxMethod,r.tree),u=r.cascader,p=r.data,f=Se(this.state.sels),d=i.value,h=(i.selected,i.disabled,i.children),m=i.optgroup;if(!n){if(e[m]&&(c.show&&c.strict||u.show&&u.strict)){e[h];var b,y=[],x=!0;if(e.__node.selected?(b="del",x=!1):e.__node.half?(b="half",this.treeHandler(f,e,y,b),0===y.length&&(b="del",x=!1)):b="add","half"!=b&&this.treeHandler(f,e,y,b),this.checkMax(y,f))return;f=Se(this.state.sels),y=[],this.treeHandler(f,e,y,b,!0),this.resetSelectValue(f,y,x),this.setState({data:this.state.data})}else if(!t||l&&!o){if(this.checkMax(e,f))return;f=a?[e]:[].concat(Se(f),[e]),this.clearAndReset(p,f,t),this.resetSelectValue(f,[e],!t)}else{var v=f.findIndex((function(t){return t[d]==e[d]}));-1!=v&&(f.splice(v,1),this.resetSelectValue(f,[e],!t))}var g=e.__node.parent;if(g){for(;g;){var _=g[h],w=_.length,k=_.filter((function(e){return-1!==f.findIndex((function(t){return t[d]===e[d]}))||!0===e.__node.selected})).length;g.__node.selected=k===w,g.__node.half=k>0&&k0,g=g.__node.parent}this.setState({data:this.state.data})}s&&!o&&this.onClick()}}},{key:"onClick",value:function(e){var t=this;if("relative"!==this.props.model.type)if(this.props.disabled)!1!==this.state.show&&this.setState({show:!1});else{var n=!this.state.show;if(n){if(this.props.show&&0==this.props.show())return;Object.keys(Xe).filter((function(e){return e!=t.props.el})).forEach((function(e){return Xe[e].closed()}))}else{if(this.props.hide&&0==this.props.hide())return;this.bodyView.scroll&&this.bodyView.scroll(0,0)}this.setState({show:n}),e&&e.stopPropagation()}}},{key:"onReset",value:function(e,t){var n=this;if("data"===t){var o=e.filter((function(e){return!0===e[n.props.prop.selected]}));this.resetSelectValue(Object(c.f)(o,this.state.sels,this.props.prop),o,!0);var r=[];this.load(e,{},r),this.setState({data:e,flatData:r})}else"sels"===t?this.resetSelectValue(e,e,!0):"append"===t?this.append(e):"delete"===t?this.del(e):"auto"===t?this.auto(e):"treeData"===t?this.value(e,null,!0,!1,!1):"close"===t?this.onClick():"class"===t?this.setState({bodyClass:e}):"labelSearchBlur"===t?this.labelRef.blur(e):"labelSearch"===t&&this.generalRef.labelSearch(e)}},{key:"append",value:function(e){var t=this.exchangeValue(e);this.value(Object(c.f)(t,this.state.sels,this.props.prop),this.props.show,!0,t)}},{key:"del",value:function(e){var t=this.props.prop.value,n=this.state.sels,o=this.exchangeValue(e);o.forEach((function(e){var o=n.findIndex((function(n){return n[t]===e[t]}));-1!=o&&n.splice(o,1)})),this.value(n,this.props.show,!0,o,!1)}},{key:"auto",value:function(e){var t=this,n=this.props.prop.value;e.filter((function(e){return-1!=t.state.sels.findIndex((function(t){return t[n]===e[n]}))})).length==e.length?this.del(e):this.append(e)}},{key:"changeExpandedKeys",value:function(e){var t=this.props,n=t.tree,o=t.prop,r=this.state,i=r.dataObj,a=r.flatData;n.show&&this.treeRef.init({dataObj:i,flatData:a,prop:o,tree:{expandedKeys:e}})}},{key:"calcPosition",value:function(){if(this.state.show&&"fixed"===this.props.model.type){var e=this.base.getBoundingClientRect();return Date.now()-this.state.time>10&&this.setState({time:Date.now()}),{position:"fixed",left:e.x,top:e.y+e.height+4,width:e.width}}return{}}},{key:"componentWillReceiveProps",value:function(e){this.init(e,e.updateData)}},{key:"componentWillMount",value:function(){this.init(this.props,!0)}},{key:"render",value:function(e,t){var n=this,o=e.theme,r=e.prop,i=(e.radio,e.repeat,e.clickClose,e.on,e.max,e.maxMethod,e.content),a=e.disabled,l=e.tree,s=e.submitConversion,u={borderColor:o.color},p=t.data,f=t.dataObj,d=t.flatData,h=t.sels,b=t.show,y=t.tmpColor,x=t.bodyClass;a&&(b=!1);var v={style:Re(Re({},e.style),b?u:{}),onClick:this.onClick.bind(this),ua:Object(c.a)(),size:e.size,tabindex:1};y&&(v.style.borderColor=y,setTimeout((function(){v.style.borderColor="",n.updateBorderColor("")}),300)),r.value;var g=Re(Re({},e),{},{data:p,sels:h,ck:this.itemClick.bind(this),title:h.map((function(e){return e[r.name]})).join(","),onReset:this.onReset.bind(this)}),_=Re(Re({},e),{},{data:p,dataObj:f,flatData:d,sels:h,ck:this.itemClick.bind(this),show:b,onReset:this.onReset.bind(this)}),w=i?m(ue,_):l.show?m(xe,je({},_,{ref:function(e){return n.treeRef=e}})):e.cascader.show?m(Ce,_):m(oe,je({},_,{ref:function(e){return n.generalRef=e}})),k=this.calcPosition();return m("xm-select",v,m("input",{class:"xm-select-default","lay-verify":e.layVerify,"lay-verType":e.layVerType,"lay-reqText":e.layReqText,name:e.name,value:s(h,r)}),m("i",{class:b?"xm-icon xm-icon-expand":"xm-icon"}),0===h.length&&m("div",{class:"xm-tips"},e.tips),m(H,je({},g,{ref:function(e){return n.labelRef=e}})),m("div",{class:["xm-body",x,e.model.type,b?"":"dis"].join(" "),style:k,ref:function(e){return n.bodyView=e}},w),a&&m("div",{class:"xm-select-disabled"}))}},{key:"componentDidMount",value:function(){var e=this;this.prepare=!0,this.base.addEventListener("keydown",(function(t){13===t.keyCode&&e.onClick(t)})),this.input=this.base.querySelector(".xm-select-default");var t=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;t&&new t((function(t){t.forEach((function(t){"attributes"==t.type&&"class"===t.attributeName&&-1!==e.input.className.indexOf("layui-form-danger")&&(e.input.className="xm-select-default",e.base.style.borderColor=e.props.theme.maxColor,e.base.scrollIntoView&&e.base.scrollIntoView({behavior:"smooth"}))}))})).observe(this.input,{attributes:!0});for(var n=this.base;n;){if("FORM"===n.tagName){var o=n.querySelector('button[type="reset"]');o&&o.addEventListener("click",(function(t){e.init(e.props,!0)}));break}n=n.parentElement}var r=this.props.done;r&&r()}},{key:"componentDidUpdate",value:function(){var e=this.props,t=e.direction,n=e.model;if("relative"!==n.type&&"fixed"!==n.type){var o=this.base.getBoundingClientRect();if("auto"===t){this.bodyView.style.display="block",this.bodyView.style.visibility="hidden";var r=this.bodyView.getBoundingClientRect().height;this.bodyView.style.display="",this.bodyView.style.visibility="";var i=o.y||o.top||0,a=document.documentElement.clientHeight-i-o.height-20;t=a>r||i0&&void 0!==arguments[0]?arguments[0]:"zn",t=Ne[e]||Ue;return{language:e,languageProp:t,data:[],content:"",name:"select",layVerify:"",layVerType:"",layReqText:"",size:"medium",disabled:!1,initValue:null,create:null,tips:t.tips,empty:t.empty,delay:500,searchTips:t.searchTips,filterable:!1,filterMethod:function(e,t,n,o){return!e||-1!=t[o.name].indexOf(e)},remoteSearch:!1,remoteMethod:function(e,t){t([])},direction:"auto",style:{},height:"200px",autoRow:!1,paging:!1,pageSize:10,pageEmptyShow:!0,pageRemote:!1,radio:!1,repeat:!1,clickClose:!1,max:0,maxMethod:function(e,t){},showCount:0,enableKeyboard:!0,enableHoverFirst:!0,selectedKeyCode:13,toolbar:{show:!1,showIcon:!0,list:["ALL","CLEAR"]},tree:{show:!1,showFolderIcon:!0,showLine:!0,indent:20,expandedKeys:[],strict:!0,lazy:!1,load:null,simple:!1,nodeType:"__node_type",clickExpand:!0,clickCheck:!0},cascader:{show:!1,indent:100,strict:!0},prop:{name:"name",value:"value",selected:"selected",disabled:"disabled",children:"children",optgroup:"optgroup",click:"click"},theme:{color:"#009688",maxColor:"#e54d42",hover:"#f2f2f2"},model:{label:{type:"block",text:{left:"",right:"",separator:", "},block:{showCount:0,showIcon:!0,template:null},count:{template:function(e,t){return"已选中 ".concat(t.length," 项, 共 ").concat(e.length," 项")}}},icon:"show",type:"absolute"},iconfont:{select:"",unselect:"",half:"",parent:""},show:function(){},hide:function(){},template:function(e){e.item,e.sels;var t=e.name;return e.value,t},on:function(e){e.arr,e.item,e.selected},submitConversion:function(e,t){return e.map((function(e){return e[t.value]})).join(",")},done:function(){}}}(e.language),this.update(e)}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=!!e.data;this.options=Object(c.b)(this.options,e),this.options.__render_success=!1;var n=this.options.dom;if(n){var o=this.options.data||[];if("function"==typeof o&&(o=o(),this.options.data=o),Object(c.d)(o))return T(m(Fe,qe({},this.options,{__update:Date.now(),updateData:t})),n),this.options.__render_success=!0,this;Object(c.k)("data数据必须为数组类型, 不能是".concat("undefined"==typeof data?"undefined":Ye(data),"类型"))}else Object(c.k)("没有找到渲染对象: ".concat(e.el,", 请检查"))}},{key:"reset",value:function(){var e=this.options.el;return this.init($e[e]),et[e].init(this.options,!0),this}},{key:"opened",value:function(){var e=et[this.options.el];return!e.state.show&&e.onClick(),this}},{key:"closed",value:function(){var e=et[this.options.el];return e.state.show&&e.onClick(),this}},{key:"getValue",value:function(e){var t=this,n=this.options,o=n.tree,r=n.prop,i=n.data,a=et[this.options.el].state.sels,l=a;o.show&&o.strict&&o.simple&&(l=[],Object(c.j)(i,a,l,r));var s=Object(c.c)(l,r.children,["__node"]);return"name"===e?s.map((function(e){return e[t.options.prop.name]})):"nameStr"===e?s.map((function(e){return e[t.options.prop.name]})).join(","):"value"===e?s.map((function(e){return e[t.options.prop.value]})):"valueStr"===e?s.map((function(e){return e[t.options.prop.value]})).join(","):s}},{key:"setValue",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Object(c.d)(e))return et[this.options.el].value(this.options.radio?e.slice(0,1):e,t,n),this;Object(c.k)("请传入数组结构...")}},{key:"append",value:function(e){if(Object(c.d)(e))return et[this.options.el].append(e),this;Object(c.k)("请传入数组结构...")}},{key:"delete",value:function(e){if(Object(c.d)(e))return et[this.options.el].del(e),this;Object(c.k)("请传入数组结构...")}},{key:"warning",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e||this.options.theme.maxColor;return!0===t?et[this.options.el].base.style.borderColor=n:et[this.options.el].updateBorderColor(n),this}},{key:"getTreeValue",value:function(e,t){var n=this.options,o=n.tree,r=n.cascader,i=n.prop,a=i.value;if(!o.show&&!r.show)return this.getValue(e);for(var l=et[this.options.el].state.sels,s=[],u=o.nodeType,p=function(e,t){s.find((function(t){return t[a]===e[a]}))||((e=Ke({},e))[u]=t,s.push(e))},f=0;fe.length)&&(t=e.length);for(var n=0,o=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"pid",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"children",r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,i={};return safety(e).filter((function(e){var a=e[n],l=e[t],s=i[a],c=i[l];return s&&(e[o]=s[o]),i[a]=e,c||(c=Je({},o,[]),i[l]=c),c.push(e),n==r}))}}}}); \ No newline at end of file