后台党务管理

This commit is contained in:
彭桃 2023-01-30 17:45:55 +08:00
parent 298aa92a7d
commit 9e88a441d7
34 changed files with 3936 additions and 0 deletions

View File

@ -0,0 +1,174 @@
<?php
namespace app\admin\controller\nk\party;
use app\admin\BaseController;
use think\exception\ValidateException;
use think\facade\Db;
use think\facade\View;
/**
* 党务文章
*
* @icon fa fa-circle-o
*/
class Article extends BaseController
{
public function __construct()
{
$this->adminInfo = get_login_admin();
$this->url=[
'/admin/nk.party.article/index',
'/admin/nk.party.article/add',
'/admin/nk.party.article/edit',
'/admin/nk.party.article/del',
'/admin/nk.party.article/read',
];
}
public function index()
{
if (request()->isAjax()) {
$params= get_params();
$where['status']=1;
if (isset($params['keywords'])){
$where[]=['title','like','%'.$params['keywords'].'%'];
}
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){
$where['village'] = $user_address['village_id'];
}elseif ($user_address['auth_range'] == 2){
$where['township'] = $user_address['street_id'];
}elseif ($user_address['auth_range'] == 3){
$where['county'] = $user_address['area_id'];
}else{
$where['village'] = $user_address['village_id'];
}
}else{
$where['village'] = '';
}
}
$total = Db::table('fa_szxc_party_article')
->where($where)
->count();
$list = Db::table('fa_szxc_party_article')
->withAttr('nickname',function ($value,$data){
return Db::table('fa_szxc_information_usermsg')->where('user_id',$data['user_id'])->value('name');
})
->withAttr('area',function ($value,$data){
return Db::table('fa_geo_area')->where('area_code',$data['county'])->value('area_name');
})
->withAttr('street',function ($value,$data){
return Db::table('fa_geo_street')->where('street_code',$data['township'])->value('street_name');
})
->withAttr('village',function ($value,$data){
return Db::table('fa_geo_village')->where('village_id',$data['village'])->value('village_name');
})
->where($where)
->page($params['page'])
->limit($params['limit'])
->order('id desc')
->field('id,title,user_id,county,township,village,image,view_time')
->select();
$result = ['total' => $total, 'data' => $list];
return table_assign(0, '', $result);
}
else{
return view('nk/party/article/index',['url'=>$this->url]);
}
}
public function add(){
if (request()->isAjax()) {
$param= get_params();
// 检验完整性
try {
validate(\app\admin\validate\nk\ArticleValidate::class)->check($param);
} catch (ValidateException $e) {
// 验证失败 输出错误信息
return to_assign(1, $e->getError());
}
$adds=Db::table('fa_szxc_information_useraddress')->where('admin_id',$this->adminInfo['id'])->find();
$param['view_time']=date('Y-m-d H:i:s');
$param['county']=$adds['area_id'];
$param['township']=$adds['street_id'];
$param['village']=$adds['village_id'];
$param['user_id']=$adds['user_id'];
$res=Db::table('fa_szxc_party_article')->strict(false)->field(true)->insertGetId($param);
if ($res){
return to_assign(0,'操作成功',['aid'=>$res]);
}
return to_assign(1, '操作失败,原因:'.$res);
}else{
View::assign('editor', get_system_config('other','editor'));
return view();
}
}
public function edit(){
$param= get_params();
if (request()->isAjax()) {
try {
validate(\app\admin\validate\nk\ArticleValidate::class)->check($param);
} catch (ValidateException $e) {
// 验证失败 输出错误信息
return to_assign(1, $e->getError());
}
$res=Db::table('fa_szxc_party_article')->where('id',$param['id'])->strict(false)->field(true)->update($param);
if ($res){
return to_assign();
}else{
return to_assign(1, '操作失败,原因:'.$res);
}
}else{
$id = isset($param['id']) ? $param['id'] : 0;
$detail = Db::table('fa_szxc_party_article')->where('id',$id)->find();
View::assign('editor', get_system_config('other','editor'));
if (!empty($detail)) {
View::assign('detail', $detail);
return view();
}
else{
throw new \think\exception\HttpException(404, '找不到页面');
}
}
}
/**
* 查看信息
*/
public function read()
{
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$detail = Db::table('fa_szxc_party_article')->where('id',$id)->find();
if (!empty($detail)) {
View::assign('detail', $detail);
return view();
}
else{
throw new \think\exception\HttpException(404, '找不到页面');
}
}
/**
* 删除
*/
public function del()
{
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$type = isset($param['type']) ? $param['type'] : 0;
$res = Db::table('fa_szxc_party_article')->where('id',$id)->update(['status'=>$type]);
if ($res){
return to_assign();
}else{
return to_assign(1, '操作失败,原因:'.$res);
}
}
}

View File

@ -0,0 +1,172 @@
<?php
namespace app\admin\controller\nk\party;
use app\admin\BaseController;
use think\facade\Db;
use think\facade\View;
/**
* 党支部信息
*
* @icon fa fa-circle-o
*/
class Branch extends BaseController
{
/**
* 构造函数
*/
public function __construct()
{
$this->adminInfo = get_login_admin();
$this->url=[
'/admin/nk.party.branch/index',
'/admin/nk.party.branch/add',
'/admin/nk.party.branch/edit',
'/admin/nk.party.branch/del',
'/admin/nk.party.branch/read',
];
// 获取用户信息
$this->users = Db::table('fa_szxc_information_usermsg')->where('status',1)->field('user_id,name')->select();
}
/**
* 数据列表
*/
public function index()
{
if (request()->isAjax()) {
$params= get_params();
$where['status']=1;
if (isset($params['keywords'])){
$where[]=['title','like','%'.$params['keywords'].'%'];
}
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){
$where['village'] = $user_address['village_id'];
}elseif ($user_address['auth_range'] == 2){
$where['township'] = $user_address['street_id'];
}elseif ($user_address['auth_range'] == 3){
$where['county'] = $user_address['area_id'];
}else{
$where['village'] = $user_address['village_id'];
}
}else{
$where['village'] = '';
}
}
$total = Db::table('fa_szxc_party_branch')
->where($where)
->count();
$list = Db::table('fa_szxc_party_branch')
->withAttr('nickname',function ($value,$data){
return Db::table('fa_szxc_information_usermsg')->where('user_id',$data['user_id'])->value('name');
})
->withAttr('nickname2',function ($value,$data){
return Db::table('fa_szxc_information_usermsg')->where('user_id',$data['two_user_id'])->value('name');
})
->withAttr('area',function ($value,$data){
return Db::table('fa_geo_area')->where('area_code',$data['county'])->value('area_name');
})
->withAttr('street',function ($value,$data){
return Db::table('fa_geo_street')->where('street_code',$data['township'])->value('street_name');
})
->withAttr('village',function ($value,$data){
return Db::table('fa_geo_village')->where('village_id',$data['village'])->value('village_name');
})
->where($where)
->page($params['page'])
->limit($params['limit'])
->order('id desc')
->select();
$result = ['total' => $total, 'data' => $list];
return table_assign(0, '', $result);
}
else{
return view('nk/party/branch/index',['url'=>$this->url]);
}
}
public function add(){
if (request()->isAjax()) {
$param= get_params();
$adds=Db::table('fa_szxc_information_useraddress')->where('admin_id',$this->adminInfo['id'])->find();
$param['county']=$adds['area_id'];
$param['township']=$adds['street_id'];
$param['village']=$adds['village_id'];
$res=Db::table('fa_szxc_party_branch')->strict(false)->field(true)->insertGetId($param);
if ($res){
return to_assign(0,'操作成功',['aid'=>$res]);
}
return to_assign(1, '操作失败,原因:'.$res);
}else{
View::assign('editor', get_system_config('other','editor'));
View::assign('users', $this->users);
return view();
}
}
public function edit(){
$param= get_params();
if (request()->isAjax()) {
$res=Db::table('fa_szxc_party_branch')->where('id',$param['id'])->strict(false)->field(true)->update($param);
if ($res){
return to_assign();
}else{
return to_assign(1, '操作失败,原因:'.$res);
}
}else{
$id = isset($param['id']) ? $param['id'] : 0;
$detail = Db::table('fa_szxc_party_branch')->where('id',$id)->find();
View::assign('editor', get_system_config('other','editor'));
if (!empty($detail)) {
View::assign('detail', $detail);
View::assign('users', $this->users);
return view();
}
else{
throw new \think\exception\HttpException(404, '找不到页面');
}
}
}
/**
* 查看信息
*/
public function read()
{
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$detail = Db::table('fa_szxc_party_branch')->where('id',$id)->find();
if (!empty($detail)) {
View::assign('detail', $detail);
View::assign('users', $this->users);
return view();
}
else{
throw new \think\exception\HttpException(404, '找不到页面');
}
}
/**
* 删除
*/
public function del()
{
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$type = isset($param['type']) ? $param['type'] : 0;
$res = Db::table('fa_szxc_party_branch')->where('id',$id)->update(['status'=>$type]);
if ($res){
return to_assign();
}else{
return to_assign(1, '操作失败,原因:'.$res);
}
}
}

View File

@ -0,0 +1,101 @@
<?php
namespace app\admin\controller\party;
use app\common\controller\Backend;
use think\facade\Db;
/**
* 党费清单列管理
*
* @icon fa fa-circle-o
*/
class BranchPayList extends Backend
{
/**
* BranchPayList模型对象
* @var \app\admin\model\party\BranchPayList
*/
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = new \app\admin\model\party\BranchPayList;
}
/**
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
*/
/**
* 查看
*/
public function index()
{
//设置过滤方法
$this->request->filter(['strip_tags']);
if ($this->request->isAjax()) {
// dump();die;
//如果发送的来源是Selectpage则转发到Selectpage
if ($this->request->request('keyField')) {
return $this->selectpage();
}
[$where, $sort, $order, $offset, $limit] = $this->buildparams();
//权限组信息
$getGroups = $this->auth->getGroups();
if($getGroups[0]['pid'] != 0){ //不是超级管理员
$userInfo = $this->auth->getUserinfo();
$admin_id = $userInfo['id'];
$www['admin_id'] = $admin_id;
$user_address = Db::name('szxc_information_useraddress')->where($www)->find();
if ($user_address){
if($user_address['auth_range'] == 1){
$where['village'] = $user_address['village_id'];
}elseif ($user_address['auth_range'] == 2){
$where['township'] = $user_address['street_id'];
}elseif ($user_address['auth_range'] == 3){
$where['county'] = $user_address['area_id'];
}elseif ($user_address['auth_range'] == 4){
}else{
$where['village'] = $user_address['village_id'];
}
}else{
$where['village'] = '';
}
}
$total = $this->model
->with(['usermsg','area','street','village'])
->where($where)
->order($sort, $order)
->count();
$list = $this->model
->with(['usermsg','area','street','village'])
->where($where)
->order($sort, $order)
->limit($offset, $limit)
->select();
$list = $list->toArray();
if ($list){
foreach ($list as $k=>$v){
$list[$k]['branch_id'] = Db::name('szxc_party_branch')->where('id',$v['branch_id'])->value('name');
}
}
$result = ['total' => $total, 'rows' => $list];
return json($result);
}
return $this->view->fetch();
}
}

View File

@ -0,0 +1,103 @@
<?php
namespace app\admin\controller\party;
use app\common\controller\Backend;
use think\facade\Db;
/**
* 党费缴纳列管理
*
* @icon fa fa-circle-o
*/
class BranchPayUser extends Backend
{
/**
* BranchPayUser模型对象
* @var \app\admin\model\party\BranchPayUser
*/
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = new \app\admin\model\party\BranchPayUser;
}
/**
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
*/
/**
* 查看
*/
public function index()
{
//设置过滤方法
$this->request->filter(['strip_tags']);
if ($this->request->isAjax()) {
// dump();die;
//如果发送的来源是Selectpage则转发到Selectpage
if ($this->request->request('keyField')) {
return $this->selectpage();
}
[$where, $sort, $order, $offset, $limit] = $this->buildparams();
//权限组信息
$getGroups = $this->auth->getGroups();
if($getGroups[0]['pid'] != 0){ //不是超级管理员
$userInfo = $this->auth->getUserinfo();
$admin_id = $userInfo['id'];
$www['admin_id'] = $admin_id;
$user_address = Db::name('szxc_information_useraddress')->where($www)->find();
if ($user_address){
if($user_address['auth_range'] == 1){
$where['village'] = $user_address['village_id'];
}elseif ($user_address['auth_range'] == 2){
$where['township'] = $user_address['street_id'];
}elseif ($user_address['auth_range'] == 3){
$where['county'] = $user_address['area_id'];
}elseif ($user_address['auth_range'] == 4){
}else{
$where['village'] = $user_address['village_id'];
}
}else{
$where['village'] = '';
}
}
$total = $this->model
->with(['usermsg','area','street','village'])
->where($where)
->order($sort, $order)
->count();
$list = $this->model
->with(['usermsg','area','street','village'])
->where($where)
->order($sort, $order)
->limit($offset, $limit)
->select();
$list = $list->toArray();
if ($list){
foreach ($list as $k=>$v){
$list[$k]['branch_id'] = Db::name('szxc_party_branch')->where('id',$v['branch_id'])->value('name');
}
}
$result = ['total' => $total, 'rows' => $list];
return json($result);
}
return $this->view->fetch();
}
}

View File

@ -0,0 +1,211 @@
<?php
namespace app\admin\controller\nk\party;
use app\admin\BaseController;
use think\facade\Db;
use think\facade\View;
/**
* 党员维护
*
* @icon fa fa-circle-o
*/
class Info extends BaseController
{
/**
* 构造函数
*/
public function __construct()
{
$this->adminInfo = get_login_admin();
$this->url=[
'/admin/nk.party.info/index',
'/admin/nk.party.info/add',
'/admin/nk.party.info/edit',
'/admin/nk.party.info/del',
'/admin/nk.party.info/read',
];
// 获取用户信息
$this->users = Db::table('fa_szxc_information_usermsg')->where('status',1)->field('user_id,name')->select();
$this->party_branch = Db::table('fa_szxc_party_branch')->where('status',1)->field('id,name')->select();
}
/**
* 数据列表
*/
public function index()
{
if (request()->isAjax()) {
$params= get_params();
$where['status']=1;
if (isset($params['keywords'])){
$where[]=['title','like','%'.$params['keywords'].'%'];
}
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){
$where['village'] = $user_address['village_id'];
}elseif ($user_address['auth_range'] == 2){
$where['township'] = $user_address['street_id'];
}elseif ($user_address['auth_range'] == 3){
$where['county'] = $user_address['area_id'];
}else{
$where['village'] = $user_address['village_id'];
}
}else{
$where['village'] = '';
}
}
$total = Db::table('fa_szxc_party_info')
->where($where)
->count();
$list = Db::table('fa_szxc_party_info')
->withAttr('name',function ($value,$data){
return Db::table('fa_szxc_information_usermsg')->where('user_id',$data['user_id'])->value('name');
})
->withAttr('nation',function ($value,$data){
return Db::table('fa_szxc_information_usermsg')->where('user_id',$data['user_id'])->value('nation');
})
->withAttr('political_outlook',function ($value,$data){
return Db::table('fa_szxc_information_usermsg')->where('user_id',$data['user_id'])->value('political_outlook');
})
->withAttr('phone',function ($value,$data){
return Db::table('fa_szxc_information_usermsg')->where('user_id',$data['user_id'])->value('phone');
})
->withAttr('marital_status',function ($value,$data){
return Db::table('fa_szxc_information_usermsg')->where('user_id',$data['user_id'])->value('marital_status');
})
->withAttr('idcard',function ($value,$data){
return Db::table('fa_szxc_information_usermsg')->where('user_id',$data['user_id'])->value('idcard');
})
->withAttr('sex',function ($value,$data){
$sex = Db::table('fa_szxc_information_usermsg')->where('user_id',$data['user_id'])->value('gender');
if($sex == 1){
return '男';
}elseif ($sex == 2){
return '女';
}else{
return '';
}
})
->withAttr('age',function ($value,$data){
return Db::table('fa_szxc_information_usermsg')->where('user_id',$data['user_id'])->value('age');
})
->withAttr('area',function ($value,$data){
return Db::table('fa_geo_area')->where('area_code',$data['county'])->value('area_name');
})
->withAttr('street',function ($value,$data){
return Db::table('fa_geo_street')->where('street_code',$data['township'])->value('street_name');
})
->withAttr('village',function ($value,$data){
return Db::table('fa_geo_village')->where('village_id',$data['village'])->value('village_name');
})
->withAttr('party_branch',function ($value,$data){
return Db::table('fa_szxc_party_branch')->where('id',$data['party_branch'])->value('name');
})
->withAttr('status',function ($value,$data){
if($value == 1){
return '正常';
}else{
return '禁用';
}
})
->where($where)
->page($params['page'])
->limit($params['limit'])
->order('id desc')
->select();
$result = ['total' => $total, 'data' => $list];
return table_assign(0, '', $result);
}
else{
return view('nk/party/info/index',['url'=>$this->url]);
}
}
public function add(){
if (request()->isAjax()) {
$param= get_params();
$adds=Db::table('fa_szxc_information_useraddress')->where('admin_id',$this->adminInfo['id'])->find();
$param['county']=$adds['area_id'];
$param['township']=$adds['street_id'];
$param['village']=$adds['village_id'];
$res=Db::table('fa_szxc_party_info')->strict(false)->field(true)->insertGetId($param);
if ($res){
return to_assign(0,'操作成功',['aid'=>$res]);
}
return to_assign(1, '操作失败,原因:'.$res);
}else{
View::assign('editor', get_system_config('other','editor'));
View::assign('users', $this->users);
View::assign('party_branch', $this->party_branch);
return view();
}
}
public function edit(){
$param= get_params();
if (request()->isAjax()) {
$res=Db::table('fa_szxc_party_info')->where('id',$param['id'])->strict(false)->field(true)->update($param);
if ($res){
return to_assign();
}else{
return to_assign(1, '操作失败,原因:'.$res);
}
}else{
$id = isset($param['id']) ? $param['id'] : 0;
$detail = Db::table('fa_szxc_party_info')->where('id',$id)->find();
View::assign('editor', get_system_config('other','editor'));
if (!empty($detail)) {
View::assign('detail', $detail);
View::assign('users', $this->users);
View::assign('party_branch', $this->party_branch);
return view();
}
else{
throw new \think\exception\HttpException(404, '找不到页面');
}
}
}
/**
* 查看信息
*/
public function read()
{
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$detail = Db::table('fa_szxc_party_info')->where('id',$id)->find();
if (!empty($detail)) {
View::assign('detail', $detail);
View::assign('users', $this->users);
View::assign('party_branch', $this->party_branch);
return view();
}
else{
throw new \think\exception\HttpException(404, '找不到页面');
}
}
/**
* 删除
*/
public function del()
{
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$type = isset($param['type']) ? $param['type'] : 0;
$res = Db::table('fa_szxc_party_info')->where('id',$id)->update(['status'=>$type]);
if ($res){
return to_assign();
}else{
return to_assign(1, '操作失败,原因:'.$res);
}
}
}

View File

@ -0,0 +1,175 @@
<?php
namespace app\admin\controller\nk\party;
use app\admin\BaseController;
use think\facade\Db;
use think\facade\View;
/**
* 党务文章投票
*
* @icon fa fa-circle-o
*/
class Vote extends BaseController
{
/**
* 构造函数
*/
public function __construct()
{
$this->adminInfo = get_login_admin();
$this->url=[
'/admin/nk.party.vote/index',
'/admin/nk.party.vote/add',
'/admin/nk.party.vote/edit',
'/admin/nk.party.vote/del',
'/admin/nk.party.vote/read',
];
// 获取用户信息
$this->users = Db::table('fa_szxc_information_usermsg')->where('status',1)->field('user_id,name')->select();
}
/**
* 数据列表
*/
public function index()
{
if (request()->isAjax()) {
$params= get_params();
$where['status']=1;
if (isset($params['keywords'])){
$where[]=['title','like','%'.$params['keywords'].'%'];
}
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){
$where['village'] = $user_address['village_id'];
}elseif ($user_address['auth_range'] == 2){
$where['township'] = $user_address['street_id'];
}elseif ($user_address['auth_range'] == 3){
$where['county'] = $user_address['area_id'];
}else{
$where['village'] = $user_address['village_id'];
}
}else{
$where['village'] = '';
}
}
$total = Db::table('fa_szxc_party_vote')
->where($where)
->count();
$list = Db::table('fa_szxc_party_vote')
->withAttr('name',function ($value,$data){
return Db::table('fa_szxc_information_usermsg')->where('user_id',$data['user_id'])->value('name');
})
->withAttr('area',function ($value,$data){
return Db::table('fa_geo_area')->where('area_code',$data['county'])->value('area_name');
})
->withAttr('street',function ($value,$data){
return Db::table('fa_geo_street')->where('street_code',$data['township'])->value('street_name');
})
->withAttr('village',function ($value,$data){
return Db::table('fa_geo_village')->where('village_id',$data['village'])->value('village_name');
})
->withAttr('status',function ($value,$data){
if($value == 1){
return '正常';
}else{
return '禁用';
}
})
->where($where)
->page($params['page'])
->limit($params['limit'])
->order('id desc')
->select();
$result = ['total' => $total, 'data' => $list];
return table_assign(0, '', $result);
}
else{
return view('nk/party/vote/index',['url'=>$this->url]);
}
}
public function add(){
if (request()->isAjax()) {
$param= get_params();
$adds=Db::table('fa_szxc_information_useraddress')->where('admin_id',$this->adminInfo['id'])->find();
$param['county']=$adds['area_id'];
$param['township']=$adds['street_id'];
$param['village']=$adds['village_id'];
$res=Db::table('fa_szxc_party_vote')->strict(false)->field(true)->insertGetId($param);
if ($res){
return to_assign(0,'操作成功',['aid'=>$res]);
}
return to_assign(1, '操作失败,原因:'.$res);
}else{
View::assign('editor', get_system_config('other','editor'));
View::assign('users', $this->users);
return view();
}
}
public function edit(){
$param= get_params();
if (request()->isAjax()) {
$res=Db::table('fa_szxc_party_vote')->where('id',$param['id'])->strict(false)->field(true)->update($param);
if ($res){
return to_assign();
}else{
return to_assign(1, '操作失败,原因:'.$res);
}
}else{
$id = isset($param['id']) ? $param['id'] : 0;
$detail = Db::table('fa_szxc_party_vote')->where('id',$id)->find();
View::assign('editor', get_system_config('other','editor'));
if (!empty($detail)) {
View::assign('detail', $detail);
View::assign('users', $this->users);
return view();
}
else{
throw new \think\exception\HttpException(404, '找不到页面');
}
}
}
/**
* 查看信息
*/
public function read()
{
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$detail = Db::table('fa_szxc_party_vote')->where('id',$id)->find();
if (!empty($detail)) {
View::assign('detail', $detail);
View::assign('users', $this->users);
return view();
}
else{
throw new \think\exception\HttpException(404, '找不到页面');
}
}
/**
* 删除
*/
public function del()
{
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$type = isset($param['type']) ? $param['type'] : 0;
$res = Db::table('fa_szxc_party_vote')->where('id',$id)->update(['status'=>$type]);
if ($res){
return to_assign();
}else{
return to_assign(1, '操作失败,原因:'.$res);
}
}
}

View File

@ -0,0 +1,173 @@
<?php
namespace app\admin\controller\nk\party;
use app\admin\BaseController;
use think\facade\Db;
use think\facade\View;
/**
* 党务文章投票评论
*
* @icon fa fa-circle-o
*/
class VoteComment extends BaseController
{
/**
* 构造函数
*/
public function __construct()
{
$this->adminInfo = get_login_admin();
$this->url=[
'/admin/nk.party.votecomment/index',
'/admin/nk.party.votecomment/add',
'/admin/nk.party.votecomment/edit',
'/admin/nk.party.votecomment/del',
'/admin/nk.party.votecomment/read',
];
// 获取用户信息
$this->users = Db::table('fa_szxc_information_usermsg')->where('status',1)->field('user_id,name')->select();
$this->party_vote = Db::table('fa_szxc_party_vote')->where('status',1)->field('id,title')->select();
}
/**
* 数据列表
*/
public function index()
{
if (request()->isAjax()) {
$params= get_params();
$where=[];
if (isset($params['keywords'])){
$where[]=['title','like','%'.$params['keywords'].'%'];
}
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){
$where['village'] = $user_address['village_id'];
}elseif ($user_address['auth_range'] == 2){
$where['township'] = $user_address['street_id'];
}elseif ($user_address['auth_range'] == 3){
$where['county'] = $user_address['area_id'];
}else{
$where['village'] = $user_address['village_id'];
}
}else{
$where['village'] = '';
}
}
$total = Db::table('fa_szxc_party_vote_comment')
->where($where)
->count();
$list = Db::table('fa_szxc_party_vote_comment')
->withAttr('name',function ($value,$data){
return Db::table('fa_szxc_information_usermsg')->where('user_id',$data['user_id'])->value('name');
})
->withAttr('title',function ($value,$data){
return Db::table('fa_szxc_party_vote')->where('id',$data['vote_id'])->value('title');
})
->withAttr('status',function ($value,$data){
if($value == 1){
return '通过';
}else{
return '不通过';
}
})
->where($where)
->page($params['page'])
->limit($params['limit'])
->order('id desc')
->select();
$result = ['total' => $total, 'data' => $list];
return table_assign(0, '', $result);
}
else{
return view('nk/party/votecomment/index',['url'=>$this->url]);
}
}
public function add(){
if (request()->isAjax()) {
$param= get_params();
$adds=Db::table('fa_szxc_information_useraddress')->where('admin_id',$this->adminInfo['id'])->find();
$param['add_time']= date('Y-m-d H:i:s');
$param['county']=$adds['area_id'];
$param['township']=$adds['street_id'];
$param['village']=$adds['village_id'];
$res=Db::table('fa_szxc_party_vote_comment')->strict(false)->field(true)->insertGetId($param);
if ($res){
return to_assign(0,'操作成功',['aid'=>$res]);
}
return to_assign(1, '操作失败,原因:'.$res);
}else{
View::assign('editor', get_system_config('other','editor'));
View::assign('users', $this->users);
View::assign('party_vote', $this->party_vote);
return view();
}
}
public function edit(){
$param= get_params();
if (request()->isAjax()) {
$res=Db::table('fa_szxc_party_vote_comment')->where('id',$param['id'])->strict(false)->field(true)->update($param);
if ($res){
return to_assign();
}else{
return to_assign(1, '操作失败,原因:'.$res);
}
}else{
$id = isset($param['id']) ? $param['id'] : 0;
$detail = Db::table('fa_szxc_party_vote_comment')->where('id',$id)->find();
View::assign('editor', get_system_config('other','editor'));
if (!empty($detail)) {
View::assign('detail', $detail);
View::assign('users', $this->users);
View::assign('party_vote', $this->party_vote);
return view();
}
else{
throw new \think\exception\HttpException(404, '找不到页面');
}
}
}
/**
* 查看信息
*/
public function read()
{
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$detail = Db::table('fa_szxc_party_vote_comment')->where('id',$id)->find();
if (!empty($detail)) {
View::assign('detail', $detail);
View::assign('users', $this->users);
View::assign('party_vote', $this->party_vote);
return view();
}
else{
throw new \think\exception\HttpException(404, '找不到页面');
}
}
/**
* 删除
*/
public function del()
{
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$type = isset($param['type']) ? $param['type'] : 0;
$res = Db::table('fa_szxc_party_vote_comment')->where('id',$id)->update(['status'=>$type]);
if ($res){
return to_assign();
}else{
return to_assign(1, '操作失败,原因:'.$res);
}
}
}

View File

@ -181,6 +181,63 @@
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
<div class="layui-col-md6">
<select name="city" lay-verify="required" lay-search="">
<option value="">带搜索的选择框</option>
<option value="1">layer</option>
<option value="2">form</option>
<option value="3">layim</option>
<option value="4">element</option>
<option value="5">laytpl</option>
<option value="6">upload</option>
<option value="7">laydate</option>
<option value="8">laypage</option>
<option value="9">flow</option>
<option value="10">util</option>
<option value="11">code</option>
<option value="12">tree</option>
<option value="13">layedit</option>
<option value="14">nav</option>
<option value="15">tab</option>
<option value="16">table</option>
<option value="17">select</option>
<option value="18">checkbox</option>
<option value="19">switch</option>
<option value="20">radio</option>
</select>
<div class="layui-form-select layui-form-selected">
<div class="layui-select-title">
<input type="text" placeholder="带搜索的选择框" value="" class="layui-input">
<i class="layui-edge"></i>
</div>
<dl class="layui-anim layui-anim-upbit" style="">
<dd lay-value="" class="layui-select-tips layui-this">带搜索的选择框</dd>
<dd lay-value="1" class="">layer</dd>
<dd lay-value="2" class="">form</dd>
<dd lay-value="3" class="">layim</dd>
<dd lay-value="4" class="">element</dd>
<dd lay-value="5" class="">laytpl</dd>
<dd lay-value="6" class="">upload</dd>
<dd lay-value="7" class="">laydate</dd>
<dd lay-value="8" class="">laypage</dd>
<dd lay-value="9" class="">flow</dd>
<dd lay-value="10" class="">util</dd>
<dd lay-value="11" class="">code</dd>
<dd lay-value="12" class="">tree</dd>
<dd lay-value="13" class="">layedit</dd>
<dd lay-value="14" class="">nav</dd>
<dd lay-value="15" class="">tab</dd>
<dd lay-value="16" class="">table</dd>
<dd lay-value="17" class="">select</dd>
<dd lay-value="18" class="">checkbox</dd>
<dd lay-value="19" class="">switch</dd>
<dd lay-value="20" class="">radio</dd>
</dl>
</div>
</div>
</form>
{/block}
<!-- /主体 -->

View File

@ -0,0 +1,102 @@
{extend name="common/base"/}
{block name="style"}
<style type="text/css">
.editormd-code-toolbar select {display: inline-block}
.editormd li {list-style: inherit;}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
<h3 class="pb-3">新建文章</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">文章标题<font>*</font></td>
<td colspan="7"><input type="text" name="title" lay-verify="required" lay-reqText="请输入文章标题"
autocomplete="off" placeholder="请输入文章标题" class="layui-input"></td>
</tr>
<tr>
<td class="layui-td-gray" style="vertical-align:top;">文章摘要</td>
<td colspan="3">
<textarea name="describe" placeholder="请输入摘要不能超过200个字" class="layui-textarea"></textarea>
</td>
<td class="layui-td-gray" style="vertical-align:top;">缩略图</td>
<td>
<div class="layui-upload">
<button type="button" class="layui-btn layui-btn-sm" id="upload_btn_thumb">上传缩略图(尺寸:640x360)</button>
<div class="layui-upload-list" id="upload_box_thumb" style="width: 120px; height:66px; overflow: hidden;">
<img src="" onerror="javascript:this.src='{__GOUGU__}/gougu/images/nonepic600x360.jpg';this.onerror=null;" width="100" style="max-width: 100%; height:66px;"/>
<input type="hidden" name="image" value="">
</div>
</div>
</td>
</tr>
<tr>
<td colspan="6" class="layui-td-gray" style="text-align:left">文章内容</td>
</tr>
<tr>
<td colspan="6">
<textarea class="layui-textarea" id="container_content"></textarea>
</td>
</tr>
</table>
<div class="pt-3">
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const editorType = '{$editor}';
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
function gouguInit() {
var form = layui.form, tool = layui.tool,tagspicker = layui.tagpicker;
//上传缩略图
var upload_thumb = layui.upload.render({
elem: '#upload_btn_thumb',
url: '/admin/api/upload',
done: function (res) {
//如果上传失败
if (res.code == 1) {
return layer.msg('上传失败');
}
//上传成功
$('#upload_box_thumb input').attr('value', res.data.filepath);
$('#upload_box_thumb img').attr('src', res.data.filepath);
}
});
var editor = layui.tinymce;
var edit = editor.render({
selector: "#container_content",
height: 500
});
//监听提交
form.on('submit(webform)', function (data) {
data.field.content = tinyMCE.editors['container_content'].getContent();
if (data.field.content == '') {
layer.msg('请先完善文章内容');
return false;
}
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
tool.tabRefresh(71);
tool.sideClose(1000);
}
}
tool.post('/admin/nk.party.article/add', data.field, callback);
return false;
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,119 @@
{extend name="common/base"/}
{block name="style"}
<style type="text/css">
.editormd-code-toolbar select {
display: inline-block
}
.editormd li {
list-style: inherit;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
<h3 class="pb-3">编辑文章表</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">文章标题<font>*</font></td>
<td colspan="7"><input type="text" name="title" lay-verify="required" lay-reqText="请输入文章标题"
autocomplete="off" placeholder="请输入文章标题" class="layui-input"
value="{$detail.title}"></td>
</tr>
<tr>
<td class="layui-td-gray" style="vertical-align:top;">摘要</td>
<td colspan="3">
<textarea name="describe" placeholder="请输入摘要不能超过200个字"
class="layui-textarea">{$detail.describe}</textarea>
</td>
<td class="layui-td-gray" style="vertical-align:top;">缩略图</td>
<td>
<div class="layui-upload">
<button type="button" class="layui-btn layui-btn-sm" id="upload_btn_thumb">
上传缩略图(尺寸:640x360)
</button>
<div class="layui-upload-list" id="upload_box_thumb"
style="width: 120px; height:66px; overflow: hidden;">
<img src="{$detail.image}"
onerror="javascript:this.src='{__GOUGU__}/gougu/images/nonepic600x360.jpg';this.onerror=null;"
style="max-width: 100%; height:66px;"/>
<input type="hidden" name="image" value="{$detail.image}">
</div>
</div>
</td>
</tr>
<tr>
<td colspan="6" class="layui-td-gray" style="text-align:left">文章内容</td>
</tr>
<tr>
<td colspan="6">
<textarea placeholder="请输入内容" class="layui-textarea"
id="container_content">{$detail.content}</textarea>
</td>
</tr>
</table>
<div class="pt-3">
<input type="hidden" name="id" value="{$detail.id}"/>
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const editorType = '{$editor}';
var moduleInit;
if (editorType == 1) {
moduleInit = ['tool', 'tagpicker', 'tinymce'];
} else {
moduleInit = ['tool', 'tagpicker', 'editormd'];
}
function gouguInit() {
var form = layui.form, tool = layui.tool, tagpicker = layui.tagpicker;
//上传缩略图
var upload_thumb = layui.upload.render({
elem: '#upload_btn_thumb',
url: '/admin/api/upload',
done: function (res) {
//如果上传失败
if (res.code == 1) {
layer.msg('上传失败');
return false;
}
//上传成功
$('#upload_box_thumb input').attr('value', res.data.filepath);
$('#upload_box_thumb img').attr('src', res.data.filepath);
}
});
var editor = layui.tinymce;
var edit = editor.render({
selector: "#container_content",
height: 500
});
//监听提交
form.on('submit(webform)', function (data) {
data.field.content = tinyMCE.editors['container_content'].getContent();
if (data.field.content == '') {
layer.msg('请先完善文章内容');
return false;
}
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
tool.sideClose(1000);
}
}
tool.post("/admin/nk.party.article/edit", data.field, callback);
return false;
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,145 @@
{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<div class="p-3">
<form class="layui-form gg-form-bar border-t border-x">
<div class="layui-input-inline" style="width:300px;">
<input type="text" name="keywords" placeholder="请输入标题" class="layui-input" autocomplete="off" />
</div>
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">提交搜索</button>
</form>
<table class="layui-hide" id="article" lay-filter="article"></table>
</div>
<script type="text/html" id="status">
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="is_home">
<i class="layui-icon {{# if(d.is_home == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加内容">+ 添加内容</span>
</div>
</script>
<script type="text/html" id="barDemo">
<div class="layui-btn-group"><a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a><a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a></div>
</script>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool'];
function gouguInit() {
var table = layui.table,tool = layui.tool, form = layui.form;
layui.pageTable = table.render({
elem: '#article',
title: '党务文章列表',
toolbar: '#toolbarDemo',
url: '{$url[0]}',
page: true,
limit: 20,
cellMinWidth: 300,
cols: [
[
{
fixed: 'left',
field: 'id',
title: '编号',
align: 'center',
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: '文章标题',
},{
field: 'nickname',
title: '用户',
align: 'center',
},{
field: 'view_time',
title: '发布时间',
align: 'center',
},{
fixed: 'right',
field: 'right',
title: '操作',
toolbar: '#barDemo',
align: 'center'
}
]
]
});
//监听表头工具栏事件
table.on('toolbar(article)', function(obj){
if (obj.event === 'add') {
tool.side('{$url[1]}');
return false;
}
});
//监听表格行工具事件
table.on('tool(article)', function(obj) {
var data = obj.data;
if (obj.event === 'read') {
tool.side('{$url[4]}?id='+obj.data.id);
}
else if (obj.event === 'edit') {
tool.side('{$url[2]}?id='+obj.data.id);
}
else if (obj.event === 'del') {
layer.confirm('确定要删除该记录吗?', {
icon: 3,
title: '提示'
}, function(index) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
obj.del();
}
}
tool.delete('{$url[3]}', { id: data.id }, callback);
layer.close(index);
});
}
return false;
});
//监听搜索提交
form.on('submit(searchform)', function(data) {
layui.pageTable.reload({
where: {
keywords: data.field.keywords,
cate_id: data.field.cate_id
},
page: {
curr: 1
}
});
return false;
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,39 @@
{extend name="common/base"/}
{block name="style"}
<style>
.content-article img{max-width:88%!important; height:auto!important; margin:6px 0!important; border-radius:4px;}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<div class="layui-form p-4">
<h3 class="pb-3">文章详情</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">文章标题</td>
<td colspan="3">{$detail.title}</td>
</tr>
<tr>
<td class="layui-td-gray">创建时间</td>
<td>{$detail.view_time}</td>
<td class="layui-td-gray">状态</td>
<td>
{eq name="$detail.status" value="1"}正常{/eq}
{eq name="$detail.status" value="0"}下架{/eq}
</td>
</tr>
<tr>
<td class="layui-td-gray">文章摘要</td>
<td colspan="3">{$detail.describe}</td>
</tr>
<tr>
<td class="layui-td-gray">文章内容</td>
<td colspan="5" class="content-article">
{$detail.content|raw}
</td>
</tr>
</table>
</div>
{/block}
<!-- /主体 -->

View File

@ -0,0 +1,113 @@
{extend name="common/base"/}
{block name="style"}
<style type="text/css">
.editormd-code-toolbar select {
display: inline-block
}
.editormd li {
list-style: inherit;
}
.layui-td-gray{
width: 110px;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
<h3 class="pb-3">添加</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">党支部名称<font>*</font></td>
<td colspan="7"><input type="text" name="name" lay-verify="required" lay-reqText="请输入党支部名称"
autocomplete="off" placeholder="请输入党支部名称" class="layui-input"></td>
</tr>
<tr>
<td class="layui-td-gray">党支部书记<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="user_id" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='users' id='vo'}
<option value="{$vo.user_id}" >{$vo.name}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">书记电话号码<font>*</font></td>
<td colspan="7">
<input type="text" name="phone" lay-verify="required|phone" lay-reqText="请输入书记电话号码"
autocomplete="off" placeholder="请输入书记电话号码" class="layui-input">
</td>
</tr>
<tr>
<td class="layui-td-gray">党支部副书记<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="two_user_id" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='users' id='vo'}
<option value="{$vo.user_id}" >{$vo.name}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">副书记电话号码<font>*</font></td>
<td colspan="7">
<input type="text" name="two_phone" lay-verify="required|phone" lay-reqText="请输入副书记电话号码"
autocomplete="off" placeholder="请输入副书记电话号码" class="layui-input" lay-type="phone">
</td>
</tr>
<tr>
<td class="layui-td-gray">单位<font>*</font></td>
<td colspan="7">
<input type="text" name="company" lay-verify="required" lay-reqText="请输入单位"
autocomplete="off" placeholder="请输入单位" class="layui-input">
</td>
</tr>
</table>
<div class="pt-3">
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const editorType = '{$editor}';
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
function gouguInit() {
var form = layui.form, tool = layui.tool, tagspicker = layui.tagpicker;
//监听提交
form.on('submit(webform)', function (data) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
setTimeout(function () {
parent.location.reload();
}, 1000);
}
}
tool.post('/admin/nk.party.branch/add', data.field, callback);
return false;
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,129 @@
{extend name="common/base"/}
{block name="style"}
<style type="text/css">
.editormd-code-toolbar select {
display: inline-block
}
.editormd li {
list-style: inherit;
}
.layui-td-gray{
width: 110px;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
<h3 class="pb-3">编辑</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">党支部名称<font>*</font></td>
<td colspan="7"><input type="text" name="name" lay-verify="required" lay-reqText="请输入党支部名称"
autocomplete="off" placeholder="请输入党支部名称" class="layui-input" value="{$detail.name}"></td>
</tr>
<tr>
<td class="layui-td-gray">党支部书记<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="user_id" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='users' id='vo'}
<option value="{$vo.user_id}" {if $detail.user_id==$vo.user_id} selected {/if}>{$vo.name}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">书记电话号码<font>*</font></td>
<td colspan="7">
<input type="text" name="phone" lay-verify="required|phone" lay-reqText="请输入书记电话号码"
autocomplete="off" placeholder="请输入书记电话号码" class="layui-input" value="{$detail.phone}">
</td>
</tr>
<tr>
<td class="layui-td-gray">党支部副书记<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="two_user_id" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='users' id='vo'}
<option value="{$vo.user_id}" {if $detail.two_user_id==$vo.user_id} selected {/if}>{$vo.name}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">副书记电话号码<font>*</font></td>
<td colspan="7">
<input type="text" name="two_phone" lay-verify="required|phone" lay-reqText="请输入副书记电话号码"
autocomplete="off" placeholder="请输入副书记电话号码" class="layui-input" value="{$detail.two_phone}" >
</td>
</tr>
<tr>
<td class="layui-td-gray">单位<font>*</font></td>
<td colspan="7">
<input type="text" name="company" lay-verify="required" lay-reqText="请输入单位"
autocomplete="off" placeholder="请输入单位" class="layui-input" value="{$detail.company}">
</td>
</tr>
</table>
<div class="pt-3">
<input type="hidden" name="id" value="{$detail.id}"/>
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
function gouguInit() {
var form = layui.form, tool = layui.tool, tagpicker = layui.tagpicker;
//上传缩略图
var upload_thumb = layui.upload.render({
elem: '#upload_btn_thumb',
url: '/admin/api/upload',
done: function (res) {
//如果上传失败
if (res.code == 1) {
layer.msg('上传失败');
return false;
}
//上传成功
$('#upload_box_thumb input').attr('value', res.data.filepath);
$('#upload_box_thumb img').attr('src', res.data.filepath);
}
});
//监听提交
form.on('submit(webform)', function (data) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
tool.sideClose(1000);
}
}
tool.post("/admin/nk.party.branch/edit", data.field, callback);
return false;
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,164 @@
{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<div class="p-3">
<form class="layui-form gg-form-bar border-t border-x">
<div class="layui-input-inline" style="width:300px;">
<input type="text" name="keywords" placeholder="请输入标题" class="layui-input" autocomplete="off" />
</div>
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">提交搜索</button>
</form>
<table class="layui-hide" id="article" lay-filter="article"></table>
</div>
<script type="text/html" id="status">
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="is_home">
<i class="layui-icon {{# if(d.is_home == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加内容">+ 添加内容</span>
</div>
</script>
<script type="text/html" id="barDemo">
<div class="layui-btn-group"><a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a><a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a></div>
</script>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool'];
function gouguInit() {
var table = layui.table,tool = layui.tool, form = layui.form;
layui.pageTable = table.render({
elem: '#article',
title: '党支部列表',
toolbar: '#toolbarDemo',
url: '{$url[0]}',
page: true,
limit: 20,
cellMinWidth: 300,
cols: [
[
{
fixed: 'left',
field: 'id',
title: '编号',
align: 'center',
width:120,
},{
field: 'area',
title: '区县',
align: 'center',
width:120,
},{
field: 'street',
title: '乡镇',
align: 'center',
width:120,
},{
field: 'village',
title: '街道/村',
align: 'center',
width:120,
},{
field: 'name',
title: '党支部名称',
align: 'center',
width:120,
},{
field: 'nickname',
title: '党支部书记',
align: 'center',
width:120,
},{
field: 'phone',
title: '书记电话',
align: 'center',
width:120,
},{
field: 'nickname2',
title: '党支部副书记',
align: 'center',
width:120,
},{
field: 'two_phone',
title: '副书记电话',
align: 'center',
width:120,
},{
field: 'company',
title: '单位',
align: 'center',
width:120,
},{
fixed: 'right',
field: 'right',
title: '操作',
toolbar: '#barDemo',
align: 'center'
}
]
]
});
//监听表头工具栏事件
table.on('toolbar(article)', function(obj){
if (obj.event === 'add') {
tool.side('{$url[1]}');
return false;
}
});
//监听表格行工具事件
table.on('tool(article)', function(obj) {
var data = obj.data;
if (obj.event === 'read') {
tool.side('{$url[4]}?id='+obj.data.id);
}
else if (obj.event === 'edit') {
tool.side('{$url[2]}?id='+obj.data.id);
}
else if (obj.event === 'del') {
layer.confirm('确定要删除该记录吗?', {
icon: 3,
title: '提示'
}, function(index) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
obj.del();
}
}
tool.delete('{$url[3]}', { id: data.id }, callback);
layer.close(index);
});
}
return false;
});
//监听搜索提交
form.on('submit(searchform)', function(data) {
layui.pageTable.reload({
where: {
keywords: data.field.keywords,
cate_id: data.field.cate_id
},
page: {
curr: 1
}
});
return false;
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,76 @@
{extend name="common/base"/}
{block name="style"}
<style>
.content-article img{max-width:88%!important; height:auto!important; margin:6px 0!important; border-radius:4px;}
.layui-td-gray{
width: 110px;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<div class="layui-form p-4">
<h3 class="pb-3">详情</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">党支部名称<font>*</font></td>
<td colspan="7"><input type="text" name="name" lay-verify="required" lay-reqText="请输入党支部名称"
autocomplete="off" placeholder="请输入党支部名称" class="layui-input" value="{$detail.name}" readonly></td>
</tr>
<tr>
<td class="layui-td-gray">党支部书记<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="user_id" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='users' id='vo'}
<option value="{$vo.user_id}" {if $detail.user_id==$vo.user_id} selected {/if}>{$vo.name}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">书记电话号码<font>*</font></td>
<td colspan="7">
<input type="text" name="phone" lay-verify="required" lay-reqText="请输入书记电话号码"
autocomplete="off" placeholder="请输入书记电话号码" class="layui-input" value="{$detail.phone}" readonly>
</td>
</tr>
<tr>
<td class="layui-td-gray">党支部副书记<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="two_user_id" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='users' id='vo'}
<option value="{$vo.user_id}" {if $detail.two_user_id==$vo.user_id} selected {/if}>{$vo.name}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">副书记电话号码<font>*</font></td>
<td colspan="7">
<input type="text" name="two_phone" lay-verify="required" lay-reqText="请输入副书记电话号码"
autocomplete="off" placeholder="请输入副书记电话号码" class="layui-input" value="{$detail.two_phone}" readonly>
</td>
</tr>
<tr>
<td class="layui-td-gray">单位<font>*</font></td>
<td colspan="7">
<input type="text" name="company" lay-verify="required" lay-reqText="请输入单位"
autocomplete="off" placeholder="请输入单位" class="layui-input" value="{$detail.company}" readonly>
</td>
</tr>
</table>
</div>
{/block}
<!-- /主体 -->

View File

@ -0,0 +1,53 @@
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">党组织:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-party_branch" data-rule="required" data-source="party.branch/index" data-field="name" class="form-control selectpage" name="row[branch_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-start_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[start_time]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-end_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[end_time]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Pay')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-pay" data-rule="required" class="form-control" step="0.01" name="row[pay]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('No_pay')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-no_pay" data-rule="required" class="form-control" step="0.01" name="row[no_pay]" type="number">
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Sort')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-sort" data-rule="required" class="form-control" name="row[sort]" type="number" value="99">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-status" data-rule="required" class="form-control" name="row[status]" type="number" value="1">-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>

View File

@ -0,0 +1,52 @@
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">党组织:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-party_branch" data-rule="required" data-source="party.branch/index" data-field="name" class="form-control selectpage" name="row[branch_id]" type="text" value="{$row.branch_id}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-start_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[start_time]" type="text" value="{$row.start_time}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-end_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[end_time]" type="text" value="{$row.end_time}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Pay')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-pay" data-rule="required" class="form-control" step="0.01" name="row[pay]" type="number" value="{$row.pay}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('No_pay')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-no_pay" data-rule="required" class="form-control" step="0.01" name="row[no_pay]" type="number" value="{$row.no_pay}">
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Sort')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-sort" data-rule="required" class="form-control" name="row[sort]" type="number" value="{$row.sort}">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-status" data-rule="required" class="form-control" name="row[status]" type="number" value="{$row.status}">-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>

View File

@ -0,0 +1,35 @@
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('party/branch_pay_list/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('party/branch_pay_list/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('party/branch_pay_list/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('party/branch_pay_list/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>
<div class="dropdown btn-group {:$auth->check('party/branch_pay_list/multi')?'':'hide'}">
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
<ul class="dropdown-menu text-left" role="menu">
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
</ul>
</div>
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('party/branch_pay_list/edit')}"
data-operate-del="{:$auth->check('party/branch_pay_list/del')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,66 @@
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('区域')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <div class="form-inline" data-toggle="cxselect" data-selects="area,street,village">-->
<!-- &lt;!&ndash; <select class="province form-control" name="row[province_code]" data-url="ajax/getaddress">&ndash;&gt;-->
<!-- &lt;!&ndash; <option value="510000"></option>&ndash;&gt;-->
<!-- &lt;!&ndash; </select>&ndash;&gt;-->
<!-- &lt;!&ndash; <select class="city form-control" name="row[city_code]" data-query-name="province" data-url="ajax/getaddress">&ndash;&gt;-->
<!-- &lt;!&ndash; <option value="510500"></option>&ndash;&gt;-->
<!-- &lt;!&ndash; </select>&ndash;&gt;-->
<!-- <select class="area form-control" name="row[county]" data-query-name="city" data-url="ajax/getaddress">-->
<!-- </select>-->
<!-- <select class="street form-control" name="row[township]" data-query-name="area" data-url="ajax/getaddress"></select>-->
<!-- <select class="village form-control" name="row[village]" data-query-name="street" data-url="ajax/getaddress"></select>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Branch_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-party_branch" data-rule="required" data-source="party.branch/index" data-field="name" class="form-control selectpage" name="row[branch_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Pay_list_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-pay_list_id" data-rule="required" data-source="party.branchpaylist/index" data-field="id" class="form-control selectpage" name="row[pay_list_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" data-source="user.usermsg/index" data-field="name" data-primary-key="user_id" class="form-control selectpage" name="row[user_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-start_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[start_time]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Count')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-count" data-rule="required" class="form-control" name="row[count]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Pay')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-pay" data-rule="required" class="form-control" step="0.01" name="row[pay]" type="number">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>

View File

@ -0,0 +1,71 @@
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('区域')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <div class="form-inline" data-toggle="cxselect" data-selects="area,street,village">-->
<!-- &lt;!&ndash; <select class="province form-control" name="row[province_code]" data-url="ajax/getaddress">&ndash;&gt;-->
<!-- &lt;!&ndash; <option value="510000"></option>&ndash;&gt;-->
<!-- &lt;!&ndash; </select>&ndash;&gt;-->
<!-- &lt;!&ndash; <select class="city form-control" name="row[city_code]" data-query-name="province" data-url="ajax/getaddress">&ndash;&gt;-->
<!-- &lt;!&ndash; <option value="510500"></option>&ndash;&gt;-->
<!-- &lt;!&ndash; </select>&ndash;&gt;-->
<!-- <select class="area form-control" name="row[county]" data-query-name="city" data-url="ajax/getaddress">-->
<!-- <option value="{$row.county|htmlentities}"></option>-->
<!-- </select>-->
<!-- <select class="street form-control" name="row[township]" data-query-name="area" data-url="ajax/getaddress">-->
<!-- <option value="{$row.township|htmlentities}"></option>-->
<!-- </select>-->
<!-- <select class="village form-control" name="row[village]" data-query-name="street" data-url="ajax/getaddress">-->
<!-- <option value="{$row.village|htmlentities}"></option>-->
<!-- </select>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Branch_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-party_branch" data-rule="required" data-source="party.branch/index" data-field="name" class="form-control selectpage" name="row[branch_id]" type="text" value="{$row.branch_id}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Pay_list_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-pay_list_id" data-rule="required" data-source="party.branchpaylist/index" data-field="id" class="form-control selectpage" name="row[pay_list_id]" type="text" value="{$row.pay_list_id}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" data-source="user.usermsg/index" data-field="name" data-primary-key="user_id" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-start_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[start_time]" type="text" value="{$row.start_time}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Count')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-count" data-rule="required" class="form-control" name="row[count]" type="number" value="{$row.count}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Pay')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-pay" data-rule="required" class="form-control" step="0.01" name="row[pay]" type="number" value="{$row.pay}">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>

View File

@ -0,0 +1,35 @@
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('party/branch_pay_user/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('party/branch_pay_user/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('party/branch_pay_user/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('party/branch_pay_user/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>
<div class="dropdown btn-group {:$auth->check('party/branch_pay_user/multi')?'':'hide'}">
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
<ul class="dropdown-menu text-left" role="menu">
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
</ul>
</div>
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('party/branch_pay_user/edit')}"
data-operate-del="{:$auth->check('party/branch_pay_user/del')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,150 @@
{extend name="common/base"/}
{block name="style"}
<style type="text/css">
.editormd-code-toolbar select {
display: inline-block
}
.editormd li {
list-style: inherit;
}
.layui-td-gray{
width: 110px;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
<h3 class="pb-3">添加</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">用户<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="user_id" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='users' id='vo'}
<option value="{$vo.user_id}" >{$vo.name}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">党支部<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="party_branch" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='party_branch' id='vo'}
<option value="{$vo.id}" >{$vo.name}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">所属单位<font>*</font></td>
<td colspan="7">
<input type="text" name="company" lay-verify="required" lay-reqText="请输入所属单位"
autocomplete="off" placeholder="请输入所属单位" class="layui-input">
</td>
</tr>
<tr>
<td class="layui-td-gray">任职部门<font>*</font></td>
<td colspan="7">
<input type="text" name="department" lay-verify="required" lay-reqText="请输入任职部门"
autocomplete="off" placeholder="请输入任职部门" class="layui-input" >
</td>
</tr>
<tr>
<td class="layui-td-gray">担任职务<font>*</font></td>
<td colspan="7">
<input type="text" name="post" lay-verify="required" lay-reqText="请输入担任职务"
autocomplete="off" placeholder="请输入担任职务" class="layui-input">
</td>
</tr>
<tr>
<td class="layui-td-gray">加入组织时间<font>*</font></td>
<td colspan="7">
<input type="text" name="branch_add_time" id="formDate" lay-verify="required"
autocomplete="off" placeholder="请输入时间" class="layui-input" lay-key="1">
</td>
</tr>
<tr>
<td class="layui-td-gray">党籍状态<font>*</font></td>
<td colspan="7">
<select name="status" lay-verify="required">
<option value="" >请选择</option>
<option value="1">党员</option>
<option value="2">预备役</option>
</select>
</td>
</tr>
<tr>
<td class="layui-td-gray">介绍人<font>*</font></td>
<td colspan="7">
<input type="text" name="referrer" lay-verify="required" lay-reqText="请输入介绍人"
autocomplete="off" placeholder="请输入介绍人" class="layui-input">
</td>
</tr>
<tr>
<td class="layui-td-gray">党费<font>*</font></td>
<td colspan="7">
<input type="text" name="branch_pay" lay-verify="required" lay-reqText="请输入党费"
autocomplete="off" placeholder="请输入党费" class="layui-input">
</td>
</tr>
</table>
<div class="pt-3">
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const editorType = '{$editor}';
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
function gouguInit() {
var form = layui.form, tool = layui.tool,laydate = layui.laydate;
//监听提交
form.on('submit(webform)', function (data) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
setTimeout(function () {
parent.location.reload();
}, 1000);
}
}
tool.post('/admin/nk.party.info/add', data.field, callback);
return false;
});
//日期选择
laydate.render({
elem: '#formDate',
max: 7,
showBottom: false
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,164 @@
{extend name="common/base"/}
{block name="style"}
<style type="text/css">
.editormd-code-toolbar select {
display: inline-block
}
.editormd li {
list-style: inherit;
}
.layui-td-gray{
width: 110px;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
<h3 class="pb-3">编辑</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">用户<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="user_id" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='users' id='vo'}
<option value="{$vo.user_id}" {if $detail.user_id==$vo.user_id} selected {/if}>{$vo.name}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">党支部<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="party_branch" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='party_branch' id='vo'}
<option value="{$vo.id}" {if $detail.party_branch==$vo.id} selected {/if}>{$vo.name}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">所属单位<font>*</font></td>
<td colspan="7">
<input type="text" name="company" lay-verify="required" lay-reqText="请输入所属单位"
autocomplete="off" placeholder="请输入所属单位" class="layui-input" value="{$detail.company}">
</td>
</tr>
<tr>
<td class="layui-td-gray">任职部门<font>*</font></td>
<td colspan="7">
<input type="text" name="department" lay-verify="required" lay-reqText="请输入任职部门"
autocomplete="off" placeholder="请输入任职部门" class="layui-input" value="{$detail.department}">
</td>
</tr>
<tr>
<td class="layui-td-gray">担任职务<font>*</font></td>
<td colspan="7">
<input type="text" name="post" lay-verify="required" lay-reqText="请输入担任职务"
autocomplete="off" placeholder="请输入担任职务" class="layui-input" value="{$detail.post}">
</td>
</tr>
<tr>
<td class="layui-td-gray">加入组织时间<font>*</font></td>
<td colspan="7">
<input type="text" name="branch_add_time" id="formDate" lay-verify="required"
autocomplete="off" placeholder="请输入时间" class="layui-input" lay-key="1" value="{$detail.branch_add_time}">
</td>
</tr>
<tr>
<td class="layui-td-gray">党籍状态<font>*</font></td>
<td colspan="7">
<select name="status" lay-verify="required">
<option value="" >请选择</option>
<option value="1" {if $detail.status==1} selected {/if}>党员</option>
<option value="2" {if $detail.status==2} selected {/if}>预备役</option>
</select>
</td>
</tr>
<tr>
<td class="layui-td-gray">介绍人<font>*</font></td>
<td colspan="7">
<input type="text" name="referrer" lay-verify="required" lay-reqText="请输入介绍人"
autocomplete="off" placeholder="请输入介绍人" class="layui-input" value="{$detail.referrer}">
</td>
</tr>
<tr>
<td class="layui-td-gray">党费<font>*</font></td>
<td colspan="7">
<input type="text" name="branch_pay" lay-verify="required" lay-reqText="请输入党费"
autocomplete="off" placeholder="请输入党费" class="layui-input" value="{$detail.branch_pay}">
</td>
</tr>
</table>
<div class="pt-3">
<input type="hidden" name="id" value="{$detail.id}"/>
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
function gouguInit() {
var form = layui.form, tool = layui.tool, tagpicker = layui.tagpicker,laydate = layui.laydate;
//上传缩略图
var upload_thumb = layui.upload.render({
elem: '#upload_btn_thumb',
url: '/admin/api/upload',
done: function (res) {
//如果上传失败
if (res.code == 1) {
layer.msg('上传失败');
return false;
}
//上传成功
$('#upload_box_thumb input').attr('value', res.data.filepath);
$('#upload_box_thumb img').attr('src', res.data.filepath);
}
});
//监听提交
form.on('submit(webform)', function (data) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
tool.sideClose(1000);
}
}
tool.post("/admin/nk.party.info/edit", data.field, callback);
return false;
});
//日期选择
laydate.render({
elem: '#formDate',
max: 7,
showBottom: false
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,209 @@
{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<div class="p-3">
<form class="layui-form gg-form-bar border-t border-x">
<div class="layui-input-inline" style="width:300px;">
<input type="text" name="keywords" placeholder="请输入标题" class="layui-input" autocomplete="off" />
</div>
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">提交搜索</button>
</form>
<table class="layui-hide" id="article" lay-filter="article"></table>
</div>
<script type="text/html" id="status">
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="is_home">
<i class="layui-icon {{# if(d.is_home == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加内容">+ 添加内容</span>
</div>
</script>
<script type="text/html" id="barDemo">
<div class="layui-btn-group"><a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a><a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a></div>
</script>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool'];
function gouguInit() {
var table = layui.table,tool = layui.tool, form = layui.form;
layui.pageTable = table.render({
elem: '#article',
title: '党员列表',
toolbar: '#toolbarDemo',
url: '{$url[0]}',
page: true,
limit: 20,
cellMinWidth: 300,
cols: [
[
{
fixed: 'left',
field: 'id',
title: '编号',
align: 'center',
width:120,
},{
field: 'name',
title: '用户',
align: 'center',
width:120,
},{
field: 'area',
title: '区县',
align: 'center',
width:120,
},{
field: 'street',
title: '乡镇',
align: 'center',
width:120,
},{
field: 'village',
title: '街道/村',
align: 'center',
width:120,
},{
field: 'nation',
title: '民族',
align: 'center',
width:120,
},{
field: 'political_outlook',
title: '政治面貌',
align: 'center',
width:120,
},{
field: 'phone',
title: '手机号',
align: 'center',
width:120,
},{
field: 'marital_status',
title: '婚姻状况',
align: 'center',
width:120,
},{
field: 'idcard',
title: '身份证号',
align: 'center',
width:150,
},{
field: 'sex',
title: '性别',
align: 'center',
width:100,
},{
field: 'age',
title: '年龄',
align: 'center',
width:100,
},{
field: 'company',
title: '所属单位',
align: 'center',
width:120,
},{
field: 'department',
title: '任职部门',
align: 'center',
width:120,
},{
field: 'post',
title: '担任职位',
align: 'center',
width:120,
},{
field: 'party_branch',
title: '党支部',
align: 'center',
width:120,
},{
field: 'referrer',
title: '介绍人',
align: 'center',
width:120,
},{
field: 'branch_pay',
title: '党费',
align: 'center',
width:120,
},{
field: 'status',
title: '状态',
align: 'center',
width:100,
},{
fixed: 'right',
field: 'right',
title: '操作',
toolbar: '#barDemo',
align: 'center'
}
]
]
});
//监听表头工具栏事件
table.on('toolbar(article)', function(obj){
if (obj.event === 'add') {
tool.side('{$url[1]}');
return false;
}
});
//监听表格行工具事件
table.on('tool(article)', function(obj) {
var data = obj.data;
if (obj.event === 'read') {
tool.side('{$url[4]}?id='+obj.data.id);
}
else if (obj.event === 'edit') {
tool.side('{$url[2]}?id='+obj.data.id);
}
else if (obj.event === 'del') {
layer.confirm('确定要删除该记录吗?', {
icon: 3,
title: '提示'
}, function(index) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
obj.del();
}
}
tool.delete('{$url[3]}', { id: data.id }, callback);
layer.close(index);
});
}
return false;
});
//监听搜索提交
form.on('submit(searchform)', function(data) {
layui.pageTable.reload({
where: {
keywords: data.field.keywords,
cate_id: data.field.cate_id
},
page: {
curr: 1
}
});
return false;
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,106 @@
{extend name="common/base"/}
{block name="style"}
<style>
.content-article img{max-width:88%!important; height:auto!important; margin:6px 0!important; border-radius:4px;}
.layui-td-gray{
width: 110px;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<div class="layui-form p-4">
<h3 class="pb-3">详情</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">用户<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="user_id" lay-verify="required" lay-search="" disabled>
<option value="" >请选择</option>
{volist name='users' id='vo'}
<option value="{$vo.user_id}" {if $detail.user_id==$vo.user_id} selected {/if}>{$vo.name}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">党支部<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="party_branch" lay-verify="required" lay-search="" disabled>
<option value="" >请选择</option>
{volist name='party_branch' id='vo'}
<option value="{$vo.id}" {if $detail.party_branch==$vo.id} selected {/if}>{$vo.name}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">所属单位<font>*</font></td>
<td colspan="7">
<input type="text" name="company" lay-verify="required" lay-reqText="请输入所属单位"
autocomplete="off" placeholder="请输入所属单位" class="layui-input" value="{$detail.company}" readonly>
</td>
</tr>
<tr>
<td class="layui-td-gray">任职部门<font>*</font></td>
<td colspan="7">
<input type="text" name="department" lay-verify="required" lay-reqText="请输入任职部门"
autocomplete="off" placeholder="请输入任职部门" class="layui-input" value="{$detail.department}" readonly>
</td>
</tr>
<tr>
<td class="layui-td-gray">担任职务<font>*</font></td>
<td colspan="7">
<input type="text" name="post" lay-verify="required" lay-reqText="请输入担任职务"
autocomplete="off" placeholder="请输入担任职务" class="layui-input" value="{$detail.post}" readonly>
</td>
</tr>
<tr>
<td class="layui-td-gray">加入组织时间<font>*</font></td>
<td colspan="7">
<input type="text" name="branch_add_time" id="formDate" lay-verify="required"
autocomplete="off" placeholder="请输入时间" class="layui-input" lay-key="1" value="{$detail.branch_add_time}" readonly>
</td>
</tr>
<tr>
<td class="layui-td-gray">党籍状态<font>*</font></td>
<td colspan="7">
<select name="status" lay-verify="required" disabled>
<option value="" >请选择</option>
<option value="1" {if $detail.status==1} selected {/if}>党员</option>
<option value="2" {if $detail.status==2} selected {/if}>预备役</option>
</select>
</td>
</tr>
<tr>
<td class="layui-td-gray">介绍人<font>*</font></td>
<td colspan="7">
<input type="text" name="referrer" lay-verify="required" lay-reqText="请输入介绍人"
autocomplete="off" placeholder="请输入介绍人" class="layui-input" value="{$detail.referrer}" readonly>
</td>
</tr>
<tr>
<td class="layui-td-gray">党费<font>*</font></td>
<td colspan="7">
<input type="text" name="branch_pay" lay-verify="required" lay-reqText="请输入党费"
autocomplete="off" placeholder="请输入党费" class="layui-input" value="{$detail.branch_pay}" readonly>
</td>
</tr>
</table>
</div>
{/block}
<!-- /主体 -->

View File

@ -0,0 +1,105 @@
{extend name="common/base"/}
{block name="style"}
<style type="text/css">
.editormd-code-toolbar select {
display: inline-block
}
.editormd li {
list-style: inherit;
}
.layui-td-gray{
width: 110px;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
<h3 class="pb-3">添加</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">标题<font>*</font></td>
<td colspan="7">
<input type="text" name="title" lay-verify="required" lay-reqText="请输入标题"
autocomplete="off" placeholder="请输入标题" class="layui-input">
</td>
</tr>
<tr>
<td class="layui-td-gray">文章内容<font>*</font></td>
<td colspan="6">
<textarea class="layui-textarea" id="container_content" name="content"></textarea>
</td>
</tr>
<tr>
<td class="layui-td-gray">发表时间<font>*</font></td>
<td colspan="7">
<input type="text" name="start_time" id="formDate" lay-verify="required"
autocomplete="off" placeholder="请输入时间" class="layui-input" lay-key="1">
</td>
</tr>
<tr>
<td class="layui-td-gray">结束时间<font>*</font></td>
<td colspan="7">
<input type="text" name="end_time" id="formDate" lay-verify="required"
autocomplete="off" placeholder="请输入时间" class="layui-input" lay-key="1">
</td>
</tr>
</table>
<div class="pt-3">
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const editorType = '{$editor}';
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
function gouguInit() {
var form = layui.form, tool = layui.tool,laydate = layui.laydate;
var editor = layui.tinymce;
var edit = editor.render({
selector: "#container_content",
height: 500
});
//监听提交
form.on('submit(webform)', function (data) {
data.field.content = tinyMCE.editors['container_content'].getContent();
if (data.field.content == '') {
layer.msg('请先完善文章内容');
return false;
}
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
setTimeout(function () {
parent.location.reload();
}, 1000);
}
}
tool.post('/admin/nk.party.vote/add', data.field, callback);
return false;
});
//日期选择
laydate.render({
elem: '#formDate',
max: 7,
showBottom: false
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,116 @@
{extend name="common/base"/}
{block name="style"}
<style type="text/css">
.editormd-code-toolbar select {
display: inline-block
}
.editormd li {
list-style: inherit;
}
.layui-td-gray{
width: 110px;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
<h3 class="pb-3">编辑</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">标题<font>*</font></td>
<td colspan="7">
<input type="text" name="title" lay-verify="required" lay-reqText="请输入标题"
autocomplete="off" placeholder="请输入标题" class="layui-input" value="{$detail.title}">
</td>
</tr>
<tr>
<td class="layui-td-gray">文章内容<font>*</font></td>
<td colspan="6">
<textarea class="layui-textarea" id="container_content" name="content">{$detail.content}</textarea>
</td>
</tr>
<tr>
<td class="layui-td-gray">发表时间<font>*</font></td>
<td colspan="7">
<input type="text" name="start_time" id="formDate" lay-verify="required"
autocomplete="off" placeholder="请输入时间" class="layui-input" lay-key="1" value="{$detail.start_time}">
</td>
</tr>
<tr>
<td class="layui-td-gray">结束时间<font>*</font></td>
<td colspan="7">
<input type="text" name="end_time" id="formDate" lay-verify="required"
autocomplete="off" placeholder="请输入时间" class="layui-input" lay-key="1" value="{$detail.end_time}">
</td>
</tr>
</table>
<div class="pt-3">
<input type="hidden" name="id" value="{$detail.id}"/>
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
function gouguInit() {
var form = layui.form, tool = layui.tool, tagpicker = layui.tagpicker,laydate = layui.laydate;
var editor = layui.tinymce;
var edit = editor.render({
selector: "#container_content",
height: 500
});
//上传缩略图
var upload_thumb = layui.upload.render({
elem: '#upload_btn_thumb',
url: '/admin/api/upload',
done: function (res) {
//如果上传失败
if (res.code == 1) {
layer.msg('上传失败');
return false;
}
//上传成功
$('#upload_box_thumb input').attr('value', res.data.filepath);
$('#upload_box_thumb img').attr('src', res.data.filepath);
}
});
//监听提交
form.on('submit(webform)', function (data) {
data.field.content = tinyMCE.editors['container_content'].getContent();
if (data.field.content == '') {
layer.msg('请先完善文章内容');
return false;
}
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
tool.sideClose(1000);
}
}
tool.post("/admin/nk.party.vote/edit", data.field, callback);
return false;
});
//日期选择
laydate.render({
elem: '#formDate',
max: 17,
showBottom: false
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,179 @@
{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<div class="p-3">
<form class="layui-form gg-form-bar border-t border-x">
<div class="layui-input-inline" style="width:300px;">
<input type="text" name="keywords" placeholder="请输入标题" class="layui-input" autocomplete="off" />
</div>
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">提交搜索</button>
</form>
<table class="layui-hide" id="article" lay-filter="article"></table>
</div>
<script type="text/html" id="status">
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="is_home">
<i class="layui-icon {{# if(d.is_home == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加内容">+ 添加内容</span>
</div>
</script>
<script type="text/html" id="barDemo">
<div class="layui-btn-group"><a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a><a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a></div>
</script>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool'];
function gouguInit() {
var table = layui.table,tool = layui.tool, form = layui.form;
layui.pageTable = table.render({
elem: '#article',
title: '党员列表',
toolbar: '#toolbarDemo',
url: '{$url[0]}',
page: true,
limit: 20,
cellMinWidth: 300,
cols: [
[
{
fixed: 'left',
field: 'id',
title: '编号',
align: 'center',
width:80,
},{
field: 'title',
title: '标题',
align: 'center',
width:180,
},{
field: 'name',
title: '用户',
align: 'center',
width:120,
},{
field: 'area',
title: '区县',
align: 'center',
width:120,
},{
field: 'street',
title: '乡镇',
align: 'center',
width:120,
},{
field: 'village',
title: '街道/村',
align: 'center',
width:120,
},{
field: 'view',
title: '浏览',
align: 'center',
width:100,
},{
field: 'start_time',
title: '发表时间',
align: 'center',
width:150,
},{
field: 'end_time',
title: '结束时间',
align: 'center',
width:150,
},{
field: 'agree',
title: '赞同',
align: 'center',
width:150,
},{
field: 'opposition',
title: '反对',
align: 'center',
width:100,
},{
field: 'other',
title: '其他',
align: 'center',
width:100,
},{
field: 'status',
title: '状态',
align: 'center',
width:100,
},{
fixed: 'right',
field: 'right',
title: '操作',
toolbar: '#barDemo',
align: 'center'
}
]
]
});
//监听表头工具栏事件
table.on('toolbar(article)', function(obj){
if (obj.event === 'add') {
tool.side('{$url[1]}');
return false;
}
});
//监听表格行工具事件
table.on('tool(article)', function(obj) {
var data = obj.data;
if (obj.event === 'read') {
tool.side('{$url[4]}?id='+obj.data.id);
}
else if (obj.event === 'edit') {
tool.side('{$url[2]}?id='+obj.data.id);
}
else if (obj.event === 'del') {
layer.confirm('确定要删除该记录吗?', {
icon: 3,
title: '提示'
}, function(index) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
obj.del();
}
}
tool.delete('{$url[3]}', { id: data.id }, callback);
layer.close(index);
});
}
return false;
});
//监听搜索提交
form.on('submit(searchform)', function(data) {
layui.pageTable.reload({
where: {
keywords: data.field.keywords,
cate_id: data.field.cate_id
},
page: {
curr: 1
}
});
return false;
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,67 @@
{extend name="common/base"/}
{block name="style"}
<style>
.content-article img{max-width:88%!important; height:auto!important; margin:6px 0!important; border-radius:4px;}
.layui-td-gray{
width: 110px;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<div class="layui-form p-4">
<h3 class="pb-3">详情</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">标题<font>*</font></td>
<td colspan="7">
<input type="text" name="title" lay-verify="required" lay-reqText="请输入标题"
autocomplete="off" placeholder="请输入标题" class="layui-input" value="{$detail.title}" readonly>
</td>
</tr>
<tr>
<td class="layui-td-gray">文章内容<font>*</font></td>
<td colspan="6">
<textarea class="layui-textarea" id="container_content" name="content" readonly>{$detail.content}</textarea>
</td>
</tr>
<tr>
<td class="layui-td-gray">发表时间<font>*</font></td>
<td colspan="7">
<input type="text" name="start_time" id="formDate" lay-verify="required"
autocomplete="off" placeholder="请输入时间" class="layui-input" lay-key="1" value="{$detail.start_time}" readonly>
</td>
</tr>
<tr>
<td class="layui-td-gray">结束时间<font>*</font></td>
<td colspan="7">
<input type="text" name="end_time" id="formDate" lay-verify="required"
autocomplete="off" placeholder="请输入时间" class="layui-input" lay-key="1" value="{$detail.end_time}" readonly>
</td>
</tr>
</table>
</div>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
function gouguInit() {
var form = layui.form, tool = layui.tool, tagpicker = layui.tagpicker,laydate = layui.laydate;
var editor = layui.tinymce;
var edit = editor.render({
selector: "#container_content",
height: 500
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,114 @@
{extend name="common/base"/}
{block name="style"}
<style type="text/css">
.editormd-code-toolbar select {
display: inline-block
}
.editormd li {
list-style: inherit;
}
.layui-td-gray{
width: 110px;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
<h3 class="pb-3">添加</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">文章id<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="vote_id" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='party_vote' id='vo'}
<option value="{$vo.id}" >{$vo.title}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">用户<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="user_id" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='users' id='vo'}
<option value="{$vo.user_id}" >{$vo.name}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">评论<font>*</font></td>
<td colspan="6">
<textarea class="layui-textarea" id="container_content" name="content"></textarea>
</td>
</tr>
<tr>
<td class="layui-td-gray">后台回复<font>*</font></td>
<td colspan="6">
<textarea class="layui-textarea" id="container_content2" name="reply"></textarea>
</td>
</tr>
<tr>
<td class="layui-td-gray">状态<font>*</font></td>
<td colspan="6">
<input type="radio" name="status" value="1" title="通过" checked>
<input type="radio" name="status" value="0" title="不通过">
</td>
</tr>
</table>
<div class="pt-3">
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const editorType = '{$editor}';
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
function gouguInit() {
var form = layui.form, tool = layui.tool,laydate = layui.laydate;
//监听提交
form.on('submit(webform)', function (data) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
setTimeout(function () {
parent.location.reload();
}, 1000);
}
}
tool.post('/admin/nk.party.votecomment/add', data.field, callback);
return false;
});
//日期选择
laydate.render({
elem: '#formDate',
max: 7,
showBottom: false
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,126 @@
{extend name="common/base"/}
{block name="style"}
<style type="text/css">
.editormd-code-toolbar select {
display: inline-block
}
.editormd li {
list-style: inherit;
}
.layui-td-gray{
width: 110px;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
<h3 class="pb-3">编辑</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">文章id<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="vote_id" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='party_vote' id='vo'}
<option value="{$vo.id}" {if $detail.vote_id==$vo.id} selected {/if}>{$vo.title}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">用户<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="user_id" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='users' id='vo'}
<option value="{$vo.user_id}" {if $detail.user_id==$vo.user_id} selected {/if}>{$vo.name}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">评论<font>*</font></td>
<td colspan="6">
<textarea class="layui-textarea" id="container_content" name="content">{$detail.content}</textarea>
</td>
</tr>
<tr>
<td class="layui-td-gray">后台回复<font>*</font></td>
<td colspan="6">
<textarea class="layui-textarea" id="container_content2" name="reply">{$detail.reply}</textarea>
</td>
</tr>
<tr>
<td class="layui-td-gray">状态<font>*</font></td>
<td colspan="6">
<input type="radio" name="status" value="1" title="通过" {if $detail.status==1} checked {/if}>
<input type="radio" name="status" value="0" title="不通过" {if $detail.status==0} checked {/if}>
</td>
</tr>
</table>
<div class="pt-3">
<input type="hidden" name="id" value="{$detail.id}"/>
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
function gouguInit() {
var form = layui.form, tool = layui.tool, tagpicker = layui.tagpicker,laydate = layui.laydate;
//上传缩略图
var upload_thumb = layui.upload.render({
elem: '#upload_btn_thumb',
url: '/admin/api/upload',
done: function (res) {
//如果上传失败
if (res.code == 1) {
layer.msg('上传失败');
return false;
}
//上传成功
$('#upload_box_thumb input').attr('value', res.data.filepath);
$('#upload_box_thumb img').attr('src', res.data.filepath);
}
});
//监听提交
form.on('submit(webform)', function (data) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
tool.sideClose(1000);
}
}
tool.post("/admin/nk.party.votecomment/edit", data.field, callback);
return false;
});
//日期选择
laydate.render({
elem: '#formDate',
max: 17,
showBottom: false
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,154 @@
{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<div class="p-3">
<form class="layui-form gg-form-bar border-t border-x">
<div class="layui-input-inline" style="width:300px;">
<input type="text" name="keywords" placeholder="请输入标题" class="layui-input" autocomplete="off" />
</div>
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">提交搜索</button>
</form>
<table class="layui-hide" id="article" lay-filter="article"></table>
</div>
<script type="text/html" id="status">
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="is_home">
<i class="layui-icon {{# if(d.is_home == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加内容">+ 添加内容</span>
</div>
</script>
<script type="text/html" id="barDemo">
<div class="layui-btn-group"><a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a><a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a></div>
</script>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool'];
function gouguInit() {
var table = layui.table,tool = layui.tool, form = layui.form;
layui.pageTable = table.render({
elem: '#article',
title: '列表',
toolbar: '#toolbarDemo',
url: '{$url[0]}',
page: true,
limit: 20,
cellMinWidth: 300,
cols: [
[
{
fixed: 'left',
field: 'id',
title: '编号',
align: 'center',
width:80,
},{
field: 'vote_id',
title: '文章ID',
align: 'center',
width:180,
},{
field: 'title',
title: '标题',
align: 'center',
width:180,
},{
field: 'name',
title: '用户',
align: 'center',
width:120,
},{
field: 'content',
title: '评论',
align: 'center',
width:100,
},{
field: 'add_time',
title: '评论时间',
align: 'center',
width:150,
},{
field: 'reply',
title: '后台回复',
align: 'center',
width:150,
},{
field: 'status',
title: '状态',
align: 'center',
width:100,
},{
fixed: 'right',
field: 'right',
title: '操作',
toolbar: '#barDemo',
align: 'center'
}
]
]
});
//监听表头工具栏事件
table.on('toolbar(article)', function(obj){
if (obj.event === 'add') {
tool.side('{$url[1]}');
return false;
}
});
//监听表格行工具事件
table.on('tool(article)', function(obj) {
var data = obj.data;
if (obj.event === 'read') {
tool.side('{$url[4]}?id='+obj.data.id);
}
else if (obj.event === 'edit') {
tool.side('{$url[2]}?id='+obj.data.id);
}
else if (obj.event === 'del') {
layer.confirm('确定要删除该记录吗?', {
icon: 3,
title: '提示'
}, function(index) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
obj.del();
}
}
tool.delete('{$url[3]}', { id: data.id }, callback);
layer.close(index);
});
}
return false;
});
//监听搜索提交
form.on('submit(searchform)', function(data) {
layui.pageTable.reload({
where: {
keywords: data.field.keywords,
cate_id: data.field.cate_id
},
page: {
curr: 1
}
});
return false;
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,81 @@
{extend name="common/base"/}
{block name="style"}
<style>
.content-article img{max-width:88%!important; height:auto!important; margin:6px 0!important; border-radius:4px;}
.layui-td-gray{
width: 110px;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<div class="layui-form p-4">
<h3 class="pb-3">详情</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">文章id<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="vote_id" lay-verify="required" lay-search="" disabled>
<option value="" >请选择</option>
{volist name='party_vote' id='vo'}
<option value="{$vo.id}" {if $detail.vote_id==$vo.id} selected {/if}>{$vo.title}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">用户<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="user_id" lay-verify="required" lay-search="" disabled>
<option value="" >请选择</option>
{volist name='users' id='vo'}
<option value="{$vo.user_id}" {if $detail.user_id==$vo.user_id} selected {/if}>{$vo.name}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">评论<font>*</font></td>
<td colspan="6">
<textarea class="layui-textarea" id="container_content" name="content" readonly>{$detail.content}</textarea>
</td>
</tr>
<tr>
<td class="layui-td-gray">后台回复<font>*</font></td>
<td colspan="6">
<textarea class="layui-textarea" id="container_content2" name="reply" readonly>{$detail.reply}</textarea>
</td>
</tr>
<tr>
<td class="layui-td-gray">状态<font>*</font></td>
<td colspan="6">
<input type="radio" name="status" value="1" title="通过" {if $detail.status==1} checked {/if} disabled>
<input type="radio" name="status" value="0" title="不通过" {if $detail.status==0} checked {/if} disabled>
</td>
</tr>
</table>
</div>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
function gouguInit() {
var form = layui.form, tool = layui.tool, tagpicker = layui.tagpicker,laydate = layui.laydate;
}
</script>
{/block}
<!-- /脚本 -->