yangsai@163.com 6 months ago
parent b84b7da911
commit 405696f25f
  1. 22
      application/controllers/Admin/Gene.php
  2. 39
      application/controllers/Admin/Squirrel.php
  3. 7
      application/controllers/Admin/Strains.php
  4. 48
      application/controllers/Admin/User.php
  5. 32
      application/controllers/Api/Squirrel.php
  6. 116
      application/views/admin/cage/index.phtml
  7. 7
      application/views/admin/gene/index.phtml
  8. 162
      application/views/admin/squirrel/edit.phtml
  9. 156
      application/views/admin/squirrel/index.phtml
  10. 9
      application/views/admin/strains/index.phtml
  11. 79
      application/views/admin/user/index.phtml
  12. 498
      application/views/admin/user/userset.phtml
  13. 8729
      public/layui/css/layuinew.css
  14. 2
      public/layui/layuinew.js

@ -0,0 +1,22 @@
<?php
class Admin_GeneController extends Ctrl_Admin{
public function indexAction(){
}
public function getlistAction(){
$GeneModel = new GeneModel();
$p = $_REQUEST;
$page = $p['page'];
$limit = $p['limit'];
$offset = ($page-1)*$limit;
$sql = "select * from {$GeneModel->table} ";
$count = $GeneModel->query($sql);
$sql = "select * from {$GeneModel->table} order by id desc limit {$offset},{$limit} ";
$data = $GeneModel->query($sql);
$return['code'] = 0;
$return['count'] = count($count);
$return['data'] = $data;
$return['msg'] = "成功";
echo json_encode($return);die;
}
}

@ -9,9 +9,9 @@ class Admin_SquirrelController extends Ctrl_Admin{
$page = $p['page'];
$limit = $p['limit'];
$offset = ($page-1)*$limit;
$sql = "select * from {$SquirrelModel->table} where is_delete=0";
$sql = "select * from {$SquirrelModel->table}";
$count = $SquirrelModel->query($sql);
$sql = "select * from {$SquirrelModel->table} where is_delete=0 order by id desc limit {$offset},{$limit} ";
$sql = "select * from {$SquirrelModel->table} order by id desc limit {$offset},{$limit} ";
$data = $SquirrelModel->query($sql);
foreach($data as $key => &$val){
$val['sex'] = $val['sex']==1?'公':'母';
@ -22,4 +22,39 @@ class Admin_SquirrelController extends Ctrl_Admin{
$return['msg'] = "成功";
echo json_encode($return);die;
}
public function editAction(){
$SquirrelModel = new SquirrelModel();
$data['id'] = empty($_POST['id'])||!isset($_POST['id'])?Tool_Fnc::apiMsg('系统错误', '500'):Tool_Fnc::safe_string($_POST['id']);
$field = empty($_POST['field'])||!isset($_POST['field'])?Tool_Fnc::apiMsg('系统错误', '500'):Tool_Fnc::safe_string($_POST['field']);
$status = empty($_POST['status'])||!isset($_POST['status'])?0:Tool_Fnc::safe_string($_POST['status']);
$data[$field] = $status;
if(!$SquirrelModel->update($data)) Tool_Fnc::ajaxMsg('变更失败', '500');
Tool_Fnc::ajaxMsg('变更成功', '1');
}
public function editinfoAction(){
$SquirrelSetModel = new SquirrelSetModel();
$SquirrelModel = new SquirrelModel();
$data['id'] = empty($_POST['id'])||!isset($_POST['id'])?Tool_Fnc::apiMsg('系统错误', '500'):Tool_Fnc::safe_string($_POST['id']);
$data['uid'] = empty($_POST['uid'])||!isset($_POST['uid'])?Tool_Fnc::apiMsg('系统错误', '500'):Tool_Fnc::safe_string($_POST['uid']);
$data['sex'] =empty($_POST['sex'])||!isset($_POST['sex'])?Tool_Fnc::apiMsg('请选择性别', '500'):Tool_Fnc::safe_string($_POST['sex']);
$data['birthday'] =empty($_POST['birthday'])||!isset($_POST['birthday'])?Tool_Fnc::apiMsg('请填写生日', '500'):Tool_Fnc::safe_string($_POST['birthday']);
$data['father'] = empty($_POST['father'])||!isset($_POST['father'])?0:Tool_Fnc::safe_string($_POST['father']);
$data['mother'] = empty($_POST['mother'])||!isset($_POST['father'])?0:Tool_Fnc::safe_string($_POST['mother']);
$data['strains_id'] =empty($_POST['strains_id'])||!isset($_POST['strains_id'])?Tool_Fnc::apiMsg('请选择品系', '500'):Tool_Fnc::safe_string($_POST['strains_id']);
$data['gene'] =empty($_POST['gene'])||!isset($_POST['gene'])?Tool_Fnc::apiMsg('请填写基因', '500'):Tool_Fnc::safe_string($_POST['gene']);
$data['hair_color'] =empty($_POST['hair_color'])||!isset($_POST['hair_color'])?Tool_Fnc::apiMsg('请选择毛色', '500'):Tool_Fnc::safe_string($_POST['hair_color']);
$data['remark'] = empty($_POST['remark'])||!isset($_POST['remark'])?'':Tool_Fnc::safe_string($_POST['remark']);
//获取当前用户仓鼠的配置
$params['user_id'] = $data['uid'];
$squirrelSet = $SquirrelSetModel->getsetinfo($params);
//根据生日获取各个提醒时间
$data['weaning_time'] = date("Y-m-d",strtotime("+{$squirrelSet['weaning_time']} day",strtotime($data['birthday'])));
$data['nursing_time'] = date("Y-m-d",strtotime("+{$squirrelSet['nursing_time']} day",strtotime($data['birthday'])));
$data['grow_time'] =$data['sex']==1? date("Y-m-d",strtotime("+{$squirrelSet['male_grow_time']} days",strtotime($data['birthday']))):date("Y-m-d",strtotime("+{$squirrelSet['female_grow_time']} days",strtotime($data['birthday'])));
$data['infertility_time'] = date("Y-m-d",strtotime("+{$squirrelSet['infertility_time']} month",strtotime($data['birthday'])));
$data['dose_time'] = date("Y-m-d",strtotime("+{$squirrelSet['dose_time']} day",strtotime($data['birthday'])));
$ret = $SquirrelModel->update($data);
if(!$ret) Tool_Fnc::ajaxMsg('信息未变更', '500');
Tool_Fnc::ajaxMsg('信息更新成功', '1');
}
}

@ -9,9 +9,9 @@ class Admin_StrainsController extends Ctrl_Admin{
$page = $p['page'];
$limit = $p['limit'];
$offset = ($page-1)*$limit;
$sql = "select * from {$StrainsModel->table} where is_delete=0";
$sql = "select * from {$StrainsModel->table} ";
$count = $StrainsModel->query($sql);
$sql = "select * from {$StrainsModel->table} where is_delete=0 order by id desc limit {$offset},{$limit} ";
$sql = "select * from {$StrainsModel->table} order by id desc limit {$offset},{$limit} ";
$data = $StrainsModel->query($sql);
$return['code'] = 0;
$return['count'] = count($count);
@ -19,4 +19,5 @@ class Admin_StrainsController extends Ctrl_Admin{
$return['msg'] = "成功";
echo json_encode($return);die;
}
}
}

@ -38,11 +38,14 @@ class Admin_UserController extends Ctrl_Admin{
foreach($data as $key => &$val){
$params['user_id'] = $val['id'];
//笼位设置
$val['cageSet'] = empty($CageSetModel->getsetinfo($params))?1:0;
$val['cageSet'] = empty($CageSetModel->getsetinfo($params))?[]:$CageSetModel->getsetinfo($params);
$val['cageisSet'] = empty($val['cageSet'])?0:1;
//鼠设置
$val['squirrelSet'] = empty($SquirrelSetModel->getsetinfo($params))?1:0;
$val['squirrelSet'] = empty($SquirrelSetModel->getsetinfo($params))?[]:$SquirrelSetModel->getsetinfo($params);
$val['squirrelisSet'] = empty($val['squirrelSet'])?0:1;
//excel导出设置
$val['excelSet'] = empty($ExcelSetModel->getsetinfo($params))?1:0;
$val['excelSet'] = empty($ExcelSetModel->getsetinfo($params))?[]:$ExcelSetModel->getsetinfo($params);
$val['excelisSet'] = empty($val['excelSet'])?0:1;
}
$return['code'] = 0;
$return['count'] = count($count);
@ -56,4 +59,43 @@ class Admin_UserController extends Ctrl_Admin{
public function remindlistAction(){
}
public function editAction(){
$CageSetModel = new CageSetModel();
$SquirrelSetModel = new SquirrelSetModel();
$ExcelSetModel = new ExcelSetModel();
$UserModel = new UserModel();
$data['id'] = empty($_POST['id'])||!isset($_POST['id'])?Tool_Fnc::apiMsg('系统错误', '500'):Tool_Fnc::safe_string($_POST['id']);
$field = empty($_POST['field'])||!isset($_POST['field'])?Tool_Fnc::apiMsg('系统错误', '500'):Tool_Fnc::safe_string($_POST['field']);
$status = empty($_POST['status'])||!isset($_POST['status'])?0:Tool_Fnc::safe_string($_POST['status']);
$data[$field] = $status;
if($field=='status' && $status==1){
//查询默认设置
$cage = $CageSetModel->field("*")->where("c_user_id=0")->fRow();
unset($cage['id']);
$cage['c_user_id'] = $data['id'];
$CageSetModel->insert($cage);
$squirrel = $SquirrelSetModel->field("*")->where("user_id=0")->fRow();
unset($squirrel['id']);
$squirrel['user_id'] = $data['id'];
$SquirrelSetModel->insert($squirrel);
$excel = $ExcelSetModel->field("*")->where("user_id=0")->fRow();
unset($excel['id']);
$excel['user_id'] = $data['id'];
$ExcelSetModel->insert($excel);
}
if(!$UserModel->update($data)) Tool_Fnc::ajaxMsg('变更失败', '500');
Tool_Fnc::ajaxMsg('变更成功', '1');
}
public function userseteditAction(){
$table = $_POST['table'];
$id = $_POST['id'];
if($table=='ExcelSetModel'){
$array = array('number'=>'on','sex'=>'on','birthday'=>'on','strains_id'=>'on','gene'=>'on','cage_num'=>'on','content'=>'on','hair_color'=>'on','fenlong'=>'on','fanzhi'=>'on','breeding_tag'=>'on','see_bole_tag'=>'on','give_medicine'=>'on','father'=>'on','mother'=>'on','remark'=>'on');
print_r($_POST['now_squirrel']);
print_r($array);
print_r(array_merge(array_diff($array,$_POST['now_squirrel']),array_diff($_POST['now_squirrel'],$array)));die;
}
}
}

@ -115,6 +115,22 @@ class Api_SquirrelController extends Ctrl_Api{
$data['grow_time'] =$data['sex']==1? date("Y-m-d",strtotime("+{$squirrelSet['male_grow_time']} days",strtotime($data['birthday']))):date("Y-m-d",strtotime("+{$squirrelSet['female_grow_time']} days",strtotime($data['birthday'])));
$data['infertility_time'] = date("Y-m-d",strtotime("+{$squirrelSet['infertility_time']} month",strtotime($data['birthday'])));
$data['dose_time'] = date("Y-m-d",strtotime("+{$squirrelSet['dose_time']} day",strtotime($data['birthday'])));
//查询笼位类型
$cageinfo = $this->CageModel->field("type")->where("id={$data['cage']}")->fRow();
if($cageinfo==2){
if($data['sex']==1){
if((int)$this->Squirrelmodel->field("count(*) num")->where("sex=1 and cage={$data['cage']}")->fList()['num']==1) Tool_Fnc::apiMsg('该笼公鼠已上限', '500');
}if($data['sex']==1){
if((int)$this->Squirrelmodel->field("count(*) num")->where("sex=2 and cage={$data['cage']}")->fList()['num']==2) Tool_Fnc::apiMsg('该笼母鼠已上限', '500');
}
}else{
//查询笼位是否有不同性别鼠
if($data['sex']==1){
if(!empty($this->Squirrelmodel->field("*")->where("sex=2 and cage={$data['cage']}")->fRow())) Tool_Fnc::apiMsg('该笼只能添加母鼠', '500');
}if($data['sex']==1){
if(!empty($this->Squirrelmodel->field("*")->where("sex=1 and cage={$data['cage']}")->fRow())) Tool_Fnc::apiMsg('该笼只能添加公鼠', '500');
}
}
$ret = $this->Squirrelmodel->insert($data);
if(!$ret) Tool_Fnc::apiMsg('小鼠建档失败', '500');
//添加品系
@ -165,6 +181,22 @@ class Api_SquirrelController extends Ctrl_Api{
$data['hair_color'] =empty($this->POST['hair_color'])||!isset($this->POST['hair_color'])?Tool_Fnc::apiMsg('请选择毛色', '500'):Tool_Fnc::safe_string($this->POST['hair_color']);
$data['remark'] = empty($this->POST['remark'])||!isset($this->POST['remark'])?'':Tool_Fnc::safe_string($this->POST['remark']);
$data['created'] = date('Y-m-d H:i:s',time());
$squirrelinfo = $this->Squirrelmodel->field("*")->where("id={$data['id']}")->fRow();
$cageinfo = $this->CageModel->field("type")->where("id={$squirrelinfo['cage']}")->fRow();
if($cageinfo==2){
if($data['sex']==1){
if((int)$this->Squirrelmodel->field("count(*) num")->where("sex=1 and cage={$data['cage']}")->fList()['num']==1) Tool_Fnc::apiMsg('该笼公鼠已上限', '500');
}if($data['sex']==1){
if((int)$this->Squirrelmodel->field("count(*) num")->where("sex=2 and cage={$data['cage']}")->fList()['num']==2) Tool_Fnc::apiMsg('该笼母鼠已上限', '500');
}
}else{
//查询笼位是否有不同性别鼠
if($data['sex']==1){
if(!empty($this->Squirrelmodel->field("*")->where("sex=2 and cage={$data['cage']}")->fRow())) Tool_Fnc::apiMsg('该笼只能添加母鼠', '500');
}if($data['sex']==1){
if(!empty($this->Squirrelmodel->field("*")->where("sex=1 and cage={$data['cage']}")->fRow())) Tool_Fnc::apiMsg('该笼只能添加公鼠', '500');
}
}
//获取当前用户仓鼠的配置
$params['user_id'] = $data['uid'];
$squirrelSet = $this->SquirrelSetModel->getsetinfo($params);

@ -6,7 +6,7 @@
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="/public/layui/css/layui.css" media="all">
<link rel="stylesheet" href="/public/layui/css/layuinew.css" media="all">
<link rel="stylesheet" href="/public/style/edit.css" media="all">
<!-- 注意:如果你直接复制所有代码到本地,上述css路径需要改成你本地的 -->
</head>
@ -18,6 +18,12 @@
}
#toolbar-container { border-bottom: 1px solid #ccc; }
#editor-container { height: 400px; }
.layui-input-group {
position: relative;
display: table;
box-sizing: border-box;
width: 100%;
}
</style>
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
<ul class="layui-tab-title">
@ -37,7 +43,7 @@
</script>
<script type="text/html" id="tool">
<!-- 这里的 checked 的状态只是演示 -->
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
<a class="layui-btn layui-btn-default layui-btn-xs" lay-event="edit">编辑</a>
</script>
<script>
const { createEditor, createToolbar } = window.wangEditor
@ -116,6 +122,112 @@
});
});
}
if(obj.event === 'edit'){
// iframe 层
layer.open({
type: 1,
area: '450px',
resize: false,
shadeClose: true,
title: '编辑笼位',
content: `
<div class="layui-form" lay-filter="filter-test-layer" style="margin: 16px;">
<div class="demo-login-container">
<div class="layui-form-item">
<div class="layui-input-group">
<input type="hidden" name="id" value="`+data.id+`">
<input type="hidden" name="uid" value="`+data.c_user_id+`">
<div class="layui-input-split layui-input-prefix">
笼号
</div>
<input type="text" name="number" value="`+data.number+`" lay-verify="required" disabled placeholder="编 号" lay-reqtext="请填写编号" autocomplete="off" class="layui-input" >
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-group">
<div class="layui-input-split layui-input-prefix">
品系
</div>
<input type="text" name="mother" value="`+data.strains+`" lay-verify="required" lay-reqtext="请填写母亲" autocomplete="off" class="layui-input" lay-affix="eye">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-group">
<div class="layui-input-split layui-input-prefix">
负责人
</div>
<select name="sex">
<option value="">请选择</option>
<option value="1" `+(data.sex=="公"?"selected":"")+`></option>
<option value="2" `+(data.sex=="母"?"selected":"")+`></option>
</select>
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-group">
<div class="layui-input-split layui-input-prefix">
实验室
</div>
<input type="text" name="hair_color" value="`+data.group+`" lay-verify="required" lay-reqtext="请填写毛色" autocomplete="off" class="layui-input" lay-affix="eye">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-group">
<div class="layui-input-split layui-input-prefix">
笼位类型
</div>
<select name="sex">
<option value="">请选择</option>
<option value="1" `+(data.type=="库存笼"?"selected":"")+`>库存笼</option>
<option value="2" `+(data.type=="繁殖笼"?"selected":"")+`>繁殖笼</option>
</select>
</div>
</div>
<div class="layui-form-item">
<button class="layui-btn layui-btn-fluid" lay-submit lay-filter="demo-login">确认</button>
</div>
</div>
</div>
`,
success: function(){
var laydate = layui.laydate;
// 渲染
laydate.render({
elem: '#ID-laydate-demo'
});
// 对弹层中的表单进行初始化渲染
form.render();
// 表单提交事件
form.on('submit(demo-login)', function(data){
var field = data.field; // 获取表单字段值
$.post('/admin_squirrel/editinfo',field,function(obj){
if(obj.status != 1){
return layer.msg(obj.msg);
}else{
//示范一个公告层
layer.open({
type: 1
,title: false //不显示标题栏
,closeBtn: false
,area: '300px;'
,shade: 0.8
,id: 'LAY_layuipro' //设定一个id,防止重复弹出
,btn: '返回列表'
,btnAlign: 'c'
,moveType: 1 //拖拽模式,0或者1
,content: '<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: bold;font-size: 20px;text-align: center;">修改成功</div>'
,yes: function(){
history.go(0)
}
});
}
});
return false; // 阻止默认 form 跳转
});
}
});
}
});
$('.site-demo-layedit').on('click', function(){

@ -66,7 +66,7 @@
table.render({
elem: '#classClass'
,url: '/admin_remind/getlist'
,url: '/admin_gene/getlist'
,toolbar: '#toolbarDemo'
,cellMinWidth: 80 //全局定义常规单元格的最小宽度,layui 2.2.1 新增
,defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义,去除该参数即可
@ -77,9 +77,8 @@
,page: true
,cols: [[
{field:'id', width:80, title: '序号'}
,{field:'user_id',width:180, title: '用户'}
,{field:'content',title: '待办'}
,{field:'status', width:180, title: '状态'}
,{field:'title',width:180, title: '基因'}
,{field:'is_delete',title: '添加用户'}
,{field:'created',width:180, title: '添加时间'}
,{toolbar: '#tool',width:200, title: '操作'}
]]

@ -0,0 +1,162 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Demo</title>
<!-- 请勿在项目正式环境中引用该 layui.css 地址 -->
<link href="//unpkg.com/layui@2.9.10/dist/css/layui.css" rel="stylesheet">
</head>
<body>
<div class="layui-btn-container">
<button type="button" class="layui-btn layui-btn-primary" lay-on="test-page">普通页面层</button>
<button type="button" class="layui-btn layui-btn-primary" lay-on="test-page-wrap">捕获层</button>
<button type="button" class="layui-btn layui-btn-primary" lay-on="test-page-title">剔除默认标题栏</button>
<button type="button" class="layui-btn layui-btn-primary" lay-on="test-page-move">绑定弹层的拖拽元素</button>
<button type="button" class="layui-btn layui-btn-primary" lay-on="test-page-custom">
<span class="layui-badge-dot"></span> 弹出任意自定义内容
</button>
</div>
<div id="ID-test-layer-wrapper" style="display: none;">
<div style="padding:16px;">
弹出已经存在于页面中的一段元素<br>
通常是放置在 <body> 根节点下
</div>
</div>
<!-- 请勿在项目正式环境中引用该 layui.js 地址 -->
<script src="//unpkg.com/layui@2.9.10/dist/layui.js"></script>
<script>
layui.use(function(){
var $ = layui.$;
var layer = layui.layer;
var util = layui.util;
var form = layui.form;
// 事件
util.on('lay-on', {
'test-page': function(){
layer.open({
type: 1,
// area: ['420px', '240px'], // 宽高
content: '<div style="padding: 16px;">任意 HTML 内容</div>'
});
},
'test-page-wrap': function(){
layer.open({
type: 1,
shade: false, // 不显示遮罩
content: $('#ID-test-layer-wrapper'), // 捕获的元素
end: function(){
// layer.msg('关闭后的回调', {icon:6});
}
});
},
'test-page-title': function(){
layer.open({
type: 1,
area: ['420px', '240px'], // 宽高
title: false, // 不显示标题栏
closeBtn: 0,
shadeClose: true, // 点击遮罩关闭层
content: '<div style="padding: 16px;">任意 HTML 内容。可点击遮罩区域关闭。</div>'
});
},
'test-page-move': function(){
layer.open({
type: 1,
area: ['420px', '240px'], // 宽高
title: false,
content: ['<div style="padding: 11px;">',
'任意 HTML 内容',
'<div style="padding: 16px 0;">',
'<button class="layui-btn" id="ID-test-layer-move">拖拽此处移动弹层</button>',
'</div>',
'</div>'].join(''),
move: '#ID-test-layer-move'
});
},
'test-page-custom': function(){
layer.open({
type: 1,
area: '350px',
resize: false,
shadeClose: true,
title: 'demo : layer + form',
content: `
<div class="layui-form" lay-filter="filter-test-layer" style="margin: 16px;">
<div class="demo-login-container">
<div class="layui-form-item">
<div class="layui-input-wrap">
<div class="layui-input-prefix">
<i class="layui-icon layui-icon-username"></i>
</div>
<input type="text" name="username" value="" lay-verify="required" placeholder="用户名" lay-reqtext="请填写用户名" autocomplete="off" class="layui-input" lay-affix="clear">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-wrap">
<div class="layui-input-prefix">
<i class="layui-icon layui-icon-password"></i>
</div>
<input type="password" name="password" value="" lay-verify="required" placeholder="密 码" lay-reqtext="请填写密码" autocomplete="off" class="layui-input" lay-affix="eye">
</div>
</div>
<div class="layui-form-item">
<div class="layui-row">
<div class="layui-col-xs7">
<div class="layui-input-wrap">
<div class="layui-input-prefix">
<i class="layui-icon layui-icon-vercode"></i>
</div>
<input type="text" name="captcha" value="" lay-verify="required" placeholder="验证码" lay-reqtext="请填写验证码" autocomplete="off" class="layui-input" lay-affix="clear">
</div>
</div>
<div class="layui-col-xs5">
<div style="margin-left: 10px;">
<img src="https://www.oschina.net/action/user/captcha" onclick="this.src='https://www.oschina.net/action/user/captcha?t='+ new Date().getTime();">
</div>
</div>
</div>
</div>
<div class="layui-form-item">
<input type="checkbox" name="remember" lay-skin="primary" title="记住密码">
<a href="#forget" style="float: right; margin-top: 7px;">忘记密码?</a>
</div>
<div class="layui-form-item">
<button class="layui-btn layui-btn-fluid" lay-submit lay-filter="demo-login">登录</button>
</div>
<div class="layui-form-item demo-login-other">
<label>社交账号登录</label>
<span style="padding: 0 21px 0 6px;">
<a href="javascript:;"><i class="layui-icon layui-icon-login-qq" style="color: #3492ed;"></i></a>
<a href="javascript:;"><i class="layui-icon layui-icon-login-wechat" style="color: #4daf29;"></i></a>
<a href="javascript:;"><i class="layui-icon layui-icon-login-weibo" style="color: #cf1900;"></i></a>
</span>
<a href="#reg">注册帐号</a></span>
</div>
</div>
</div>
`,
success: function(){
// 对弹层中的表单进行初始化渲染
form.render();
// 表单提交事件
form.on('submit(demo-login)', function(data){
var field = data.field; // 获取表单字段值
// 显示填写结果,仅作演示用
layer.alert(JSON.stringify(field), {
title: '当前填写的字段值'
});
// 此处可执行 Ajax 等操作
// …
return false; // 阻止默认 form 跳转
});
}
});
}
})
});
</script>
</body>
</html>

@ -6,7 +6,7 @@
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="/public/layui/css/layui.css" media="all">
<link rel="stylesheet" href="/public/layui/css/layuinew.css" media="all">
<link rel="stylesheet" href="/public/style/edit.css" media="all">
<!-- 注意:如果你直接复制所有代码到本地,上述css路径需要改成你本地的 -->
</head>
@ -18,6 +18,12 @@
}
#toolbar-container { border-bottom: 1px solid #ccc; }
#editor-container { height: 400px; }
.layui-input-group {
position: relative;
display: table;
box-sizing: border-box;
width: 100%;
}
</style>
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
<ul class="layui-tab-title">
@ -31,12 +37,16 @@
<script src="/public/layui/layui.js" charset="utf-8"></script>
<script src="/public/style/edit.js" charset="utf-8"></script>
<!-- 注意:如果你直接复制所有代码到本地,上述 JS 路径需要改成你本地的 -->
<script type="text/html" id="imgshow">
<!-- 这里的 checked 的状态只是演示 -->
<img src="/{{d.img}}">
<script type="text/html" id="isde">
{{# if(d.is_delete==0){}}
<span class="layui-badge layui-bg-gray">正常</span>
{{# }else{}}
<span class="layui-badge">已删除</span>
{{# }}}
</script>
<script type="text/html" id="tool">
<!-- 这里的 checked 的状态只是演示 -->
<a class="layui-btn layui-btn-default layui-btn-xs" lay-event="edit">编辑</a>
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<script>
@ -79,6 +89,7 @@
{field:'id', width:80, title: '序号'}
,{field:'number',width:180, title: '小鼠编号'}
,{field:'sex', title: '性别'}
,{field:'c_user_id', title: '添加人'}
,{field:'birthday', title: '生日'}
,{field:'hair_color', title: '毛色'}
,{field:'father', title: '父亲'}
@ -86,6 +97,7 @@
,{field:'weaning_time', title: '断奶时间'}
,{field:'nursing_time', title: '护理时间'}
,{field:'created',width:180, title: '添加时间'}
,{toolbar: '#isde',width:180, title: '是否删除'}
,{toolbar: '#tool',width:200, title: '操作'}
]]
});
@ -94,7 +106,7 @@
var data = obj.data;
if(obj.event === 'del'){
layer.confirm('确定要删除数据嘛', function(index){
$.post('/admin_index/delete',{tablename:'company',id:data.id},function(obj){
$.post('/admin_index/delete',{field:'is_delete',id:data.id,status:1},function(obj){
if(obj.status != 1){
return layer.msg(obj.msg);
}else{
@ -118,6 +130,140 @@
});
});
}
if(obj.event === 'edit'){
// iframe 层
layer.open({
type: 1,
area: '450px',
resize: false,
shadeClose: true,
title: '编辑小鼠',
content: `
<div class="layui-form" lay-filter="filter-test-layer" style="margin: 16px;">
<div class="demo-login-container">
<div class="layui-form-item">
<div class="layui-input-group">
<input type="hidden" name="id" value="`+data.id+`">
<input type="hidden" name="uid" value="`+data.c_user_id+`">
<div class="layui-input-split layui-input-prefix">
编号
</div>
<input type="text" name="number" value="`+data.number+`" lay-verify="required" disabled placeholder="编 号" lay-reqtext="请填写编号" autocomplete="off" class="layui-input" >
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-group">
<div class="layui-input-split layui-input-prefix">
性别
</div>
<select name="sex">
<option value="">请选择</option>
<option value="1" `+(data.sex=="公"?"selected":"")+`></option>
<option value="2" `+(data.sex=="母"?"selected":"")+`></option>
</select>
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-group">
<div class="layui-input-split layui-input-prefix">
生日
</div>
<input type="text" name="birthday" class="layui-input" value="`+data.birthday+`" id="ID-laydate-demo" placeholder="yyyy-MM-dd">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-group">
<div class="layui-input-split layui-input-prefix">
毛色
</div>
<input type="text" name="hair_color" value="`+data.hair_color+`" lay-verify="required" lay-reqtext="请填写毛色" autocomplete="off" class="layui-input" lay-affix="eye">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-group">
<div class="layui-input-split layui-input-prefix">
父亲
</div>
<input type="text" name="father" value="`+data.father+`" lay-verify="required" lay-reqtext="请填写父亲" autocomplete="off" class="layui-input" lay-affix="eye">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-group">
<div class="layui-input-split layui-input-prefix">
母亲
</div>
<input type="text" name="mother" value="`+data.mother+`" lay-verify="required" lay-reqtext="请填写母亲" autocomplete="off" class="layui-input" lay-affix="eye">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-group">
<div class="layui-input-split layui-input-prefix">
品系
</div>
<input type="text" name="strains_id" value="`+data.strains_id+`" lay-verify="required" lay-reqtext="请填写品系" autocomplete="off" class="layui-input" lay-affix="eye">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-group">
<div class="layui-input-split layui-input-prefix">
基因
</div>
<input type="text" name="gene" value="`+data.gene+`" lay-verify="required" lay-reqtext="请填写基因" autocomplete="off" class="layui-input" lay-affix="eye">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-group">
<div class="layui-input-split layui-input-prefix">
备注
</div>
<input type="text" name="remark" value="`+data.remark+`" lay-verify="required" lay-reqtext="请填写备注" autocomplete="off" class="layui-input" lay-affix="eye">
</div>
</div>
<div class="layui-form-item">
<button class="layui-btn layui-btn-fluid" lay-submit lay-filter="demo-login">确认</button>
</div>
</div>
</div>
`,
success: function(){
var laydate = layui.laydate;
// 渲染
laydate.render({
elem: '#ID-laydate-demo'
});
// 对弹层中的表单进行初始化渲染
form.render();
// 表单提交事件
form.on('submit(demo-login)', function(data){
var field = data.field; // 获取表单字段值
$.post('/admin_squirrel/editinfo',field,function(obj){
if(obj.status != 1){
return layer.msg(obj.msg);
}else{
//示范一个公告层
layer.open({
type: 1
,title: false //不显示标题栏
,closeBtn: false
,area: '300px;'
,shade: 0.8
,id: 'LAY_layuipro' //设定一个id,防止重复弹出
,btn: '返回列表'
,btnAlign: 'c'
,moveType: 1 //拖拽模式,0或者1
,content: '<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: bold;font-size: 20px;text-align: center;">修改成功</div>'
,yes: function(){
history.go(0)
}
});
}
});
return false; // 阻止默认 form 跳转
});
}
});
}
});
$('.site-demo-layedit').on('click', function(){

@ -21,7 +21,7 @@
</style>
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
<ul class="layui-tab-title">
<li class="layui-this">待办信息</li>
<li class="layui-this">品系管理</li>
</ul>
<div class="layui-tab-content" style="height: 100px;">
<div class="layui-tab-item layui-show"><table class="layui-hide" id="classClass" style="padding:25px;" lay-filter="classClass"></table></div>
@ -66,7 +66,7 @@
table.render({
elem: '#classClass'
,url: '/admin_remind/getlist'
,url: '/admin_strains/getlist'
,toolbar: '#toolbarDemo'
,cellMinWidth: 80 //全局定义常规单元格的最小宽度,layui 2.2.1 新增
,defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义,去除该参数即可
@ -77,9 +77,8 @@
,page: true
,cols: [[
{field:'id', width:80, title: '序号'}
,{field:'user_id',width:180, title: '用户'}
,{field:'content',title: '待办'}
,{field:'status', width:180, title: '状态'}
,{field:'title',width:180, title: '品系'}
,{field:'is_delete',title: '添加用户 '}
,{field:'created',width:180, title: '添加时间'}
,{toolbar: '#tool',width:200, title: '操作'}
]]

@ -31,13 +31,30 @@
<script src="/public/layui/layui.js" charset="utf-8"></script>
<script src="/public/style/edit.js" charset="utf-8"></script>
<!-- 注意:如果你直接复制所有代码到本地,上述 JS 路径需要改成你本地的 -->
<script type="text/html" id="imgshow">
<!-- 这里的 checked 的状态只是演示 -->
<img src="/{{d.img}}">
<script type="text/html" id="isde">
{{# if(d.is_delete==0){}}
<span class="layui-badge layui-bg-gray">正常</span>
{{# }else{}}
<span class="layui-badge">已删除</span>
{{# }}}
</script>
<script type="text/html" id="sta">
{{# if(d.status==0){}}
<span class="layui-badge layui-bg-blue">待通过</span>
{{# }else{}}
<span class="layui-badge layui-bg-gray">正常</span>
{{# }}}
</script>
<script type="text/html" id="tool">
<!-- 这里的 checked 的状态只是演示 -->
{{# if(d.status==0){}}
<a class="layui-btn layui-btn-default layui-btn-xs" lay-event="agree">通过</a>
{{# }}}
{{# if(d.is_delete==0){}}
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
{{# }else{}}
<a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="huifu">恢复</a>
{{# }}}
</script>
<script>
const { createEditor, createToolbar } = window.wangEditor
@ -84,8 +101,8 @@
,{field:'group', title: '课题组'}
,{field:'teacher', title: '导师'}
,{field:'phone', title: '手机号'}
,{field:'status', title: '审核状态'}
,{field:'is_delete', title: '是否删除'}
,{toolbar:'#sta', title: '审核状态'}
,{toolbar:'#isde', title: '是否删除'}
,{field:'created',width:180, title: '添加时间'}
,{toolbar: '#tool',width:200, title: '操作'}
]]
@ -95,7 +112,7 @@
var data = obj.data;
if(obj.event === 'del'){
layer.confirm('确定要删除数据嘛', function(index){
$.post('/admin_index/delete',{tablename:'company',id:data.id},function(obj){
$.post('/admin_user/edit',{field:'is_delete',id:data.id,status:1},function(obj){
if(obj.status != 1){
return layer.msg(obj.msg);
}else{
@ -119,6 +136,56 @@
});
});
}
if(obj.event === 'huifu'){
layer.confirm('确定要恢复此用户吗?', function(index){
$.post('/admin_user/edit',{field:'is_delete',id:data.id,status:0},function(obj){
if(obj.status != 1){
return layer.msg(obj.msg);
}else{
//示范一个公告层
layer.open({
type: 1
,title: false //不显示标题栏
,closeBtn: false
,area: '300px;'
,shade: 0.8
,id: 'LAY_layuipro' //设定一个id,防止重复弹出
,btn: '返回列表'
,btnAlign: 'c'
,moveType: 1 //拖拽模式,0或者1
,content: '<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: bold;font-size: 20px;text-align: center;">已恢复</div>'
,yes: function(){
history.go(0)
}
});
}
});
});
}
if(obj.event === 'agree'){
$.post('/admin_user/edit',{field:'status',id:data.id,status:1},function(obj){
if(obj.status != 1){
return layer.msg(obj.msg);
}else{
//示范一个公告层
layer.open({
type: 1
,title: false //不显示标题栏
,closeBtn: false
,area: '300px;'
,shade: 0.8
,id: 'LAY_layuipro' //设定一个id,防止重复弹出
,btn: '返回列表'
,btnAlign: 'c'
,moveType: 1 //拖拽模式,0或者1
,content: '<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: bold;font-size: 20px;text-align: center;">审核通过</div>'
,yes: function(){
history.go(0)
}
});
}
});
}
});
$('.site-demo-layedit').on('click', function(){

@ -6,7 +6,7 @@
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="/public/layui/css/layui.css" media="all">
<link rel="stylesheet" href="/public/layui/css/layuinew.css" media="all">
<link rel="stylesheet" href="/public/style/edit.css" media="all">
<!-- 注意:如果你直接复制所有代码到本地,上述css路径需要改成你本地的 -->
</head>
@ -18,6 +18,15 @@
}
#toolbar-container { border-bottom: 1px solid #ccc; }
#editor-container { height: 400px; }
.layui-input-group {
position: relative;
display: table;
box-sizing: border-box;
width: 100%;
}
.layui-form-item .layui-form-checkbox[lay-skin="primary"] {
margin-top: unset !important;
}
</style>
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
<ul class="layui-tab-title">
@ -31,25 +40,37 @@
<script src="/public/layui/layui.js" charset="utf-8"></script>
<script src="/public/style/edit.js" charset="utf-8"></script>
<!-- 注意:如果你直接复制所有代码到本地,上述 JS 路径需要改成你本地的 -->
<script type="text/html" id="imgshow">
<!-- 这里的 checked 的状态只是演示 -->
<img src="/{{d.img}}">
<script type="text/html" id="cage">
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="cage">编辑查看</a>
</script>
<script type="text/html" id="squirrel">
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="squirrel">编辑查看</a>
</script>
<script type="text/html" id="excel">
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="excel">编辑查看</a>
</script>
<script type="text/html" id="isde">
{{# if(d.is_delete==0){}}
<span class="layui-badge layui-bg-gray">正常</span>
{{# }else{}}
<span class="layui-badge">已删除</span>
{{# }}}
</script>
<script type="text/html" id="sta">
{{# if(d.status==0){}}
<span class="layui-badge layui-bg-blue">待通过</span>
{{# }else{}}
<span class="layui-badge layui-bg-gray">正常</span>
{{# }}}
</script>
<script type="text/html" id="tool">
<!-- 这里的 checked 的状态只是演示 -->
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="default">重置设置</a>
</script>
<script>
const { createEditor, createToolbar } = window.wangEditor
const editorConfig = {
placeholder: '请编辑公司介绍',
onChange(editor) {
const html = editor.getHtml()
console.log('editor content', html)
// 也可以同步到 <textarea>
}
}
const toolbarConfig = {}
@ -63,10 +84,10 @@
,upload = layui.upload
,element = layui.element
,$ = layui.jquery;
form.render('checkbox');
table.render({
elem: '#classClass'
,url: '/admin_user/getlist'
,url: '/admin_user/usersetlist'
,toolbar: '#toolbarDemo'
,cellMinWidth: 80 //全局定义常规单元格的最小宽度,layui 2.2.1 新增
,defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义,去除该参数即可
@ -79,12 +100,10 @@
{field:'id', width:80, title: '序号'}
,{field:'username',width:180, title: '用户名'}
,{field:'realname', title: '真实姓名'}
,{field:'cageSet', title: '笼位设置'}
,{field:'squirrelSet', title: '鼠设置'}
,{field:'excelSet', title: 'EXCEL'}
,{toolbar: '#cage' ,title: '笼位设置'}
,{toolbar: '#squirrel',title: '鼠设置'}
,{toolbar: '#excel', title: 'EXCEL'}
,{field:'phone', title: '手机号'}
,{field:'status', title: '审核状态'}
,{field:'is_delete', title: '是否删除'}
,{field:'created',width:180, title: '添加时间'}
,{toolbar: '#tool',width:200, title: '操作'}
]]
@ -118,6 +137,443 @@
});
});
}
if(obj.event === 'cage'){
// iframe 层
layer.open({
type: 1,
area: '450px',
resize: false,
shadeClose: true,
title: '笼位设置',
content: `
<div class="layui-form" lay-filter="filter-test-layer" style="margin: 16px;">
<div class="demo-login-container">
<div class="layui-form-item">
<div class="layui-input-group">
<input type="hidden" name="id" value="`+data.cageSet.id+`" >
<input type="hidden" name="table" value="CageSetModel" >
<div class="layui-input-split layui-input-prefix">
每列笼位数显示数量
</div>
<input type="text" name="line_num" value="`+data.cageSet.line_num+`" lay-verify="required" placeholder="编 号" lay-reqtext="请填写编号" autocomplete="off" class="layui-input" >
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-group">
<div class="layui-input-split layui-input-prefix">
每笼最多放成年鼠数量
</div>
<input type="text" name="big_num_max" value="`+data.cageSet.big_num_max+`" lay-verify="required" lay-reqtext="请填写毛色" autocomplete="off" class="layui-input" lay-affix="eye">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-group">
<div class="layui-input-split layui-input-prefix">
每笼最多放幼崽数量
</div>
<input type="text" name="small_num_max" value="`+data.cageSet.small_num_max+`" lay-verify="required" lay-reqtext="请填写父亲" autocomplete="off" class="layui-input" lay-affix="eye">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-group">
<div class="layui-input-split layui-input-prefix">
有幼崽的鼠笼最多放成年鼠数量
</div>
<input type="text" name="big_small_num" value="`+data.cageSet.big_small_num+`" lay-verify="required" lay-reqtext="请填写母亲" autocomplete="off" class="layui-input" lay-affix="eye">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-group">
<div class="layui-input-split layui-input-prefix">
分笼提醒
</div>
<select name="split_remind">
<option value="">请选择</option>
<option value="true" `+(data.cageSet.split_remind==true?"selected":"")+`></option>
<option value="false" `+(data.cageSet.split_remind==false?"selected":"")+`></option>
</select>
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-group">
<div class="layui-input-split layui-input-prefix">
超期分笼提醒
</div>
<select name="timeout_split_remind">
<option value="">请选择</option>
<option value="true" `+(data.cageSet.timeout_split_remind==true?"selected":"")+`></option>
<option value="false" `+(data.cageSet.timeout_split_remind==false?"selected":"")+`></option>
</select>
</div>
</div>
<div class="layui-form-item">
<button class="layui-btn layui-btn-fluid" lay-submit lay-filter="demo-login">确认</button>
</div>
</div>
</div>
`,
success: function(){
var laydate = layui.laydate;
// 渲染
laydate.render({
elem: '#ID-laydate-demo'
});
// 对弹层中的表单进行初始化渲染
form.render();
// 表单提交事件
form.on('submit(demo-login)', function(data){
var field = data.field; // 获取表单字段值
$.post('/admin_user/usersetedit',field,function(obj){
if(obj.status != 1){
return layer.msg(obj.msg);
}else{
//示范一个公告层
layer.open({
type: 1
,title: false //不显示标题栏
,closeBtn: false
,area: '300px;'
,shade: 0.8
,id: 'LAY_layuipro' //设定一个id,防止重复弹出
,btn: '返回列表'
,btnAlign: 'c'
,moveType: 1 //拖拽模式,0或者1
,content: '<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: bold;font-size: 20px;text-align: center;">修改成功</div>'
,yes: function(){
history.go(0)
}
});
}
});
return false; // 阻止默认 form 跳转
});
}
});
}
if(obj.event === 'squirrel'){
// iframe 层
layer.open({
type: 1,
area: '450px',
resize: false,
shadeClose: true,
title: '鼠设置',
content: `
<div class="layui-form" lay-filter="filter-test-layer" style="margin: 16px;">
<div class="demo-login-container">
<div class="layui-form-item">
<div class="layui-input-group">
<input type="hidden" name="id" value="`+data.squirrelSet.id+`" >
<input type="hidden" name="table" value="SquirrelSetModel" >
<div class="layui-input-split layui-input-prefix">
断奶时间(天)
</div>
<input type="text" name="weaning_time" value="`+data.squirrelSet.weaning_time+`" lay-verify="required" placeholder="编 号" lay-reqtext="请填写编号" autocomplete="off" class="layui-input" >
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-group">
<div class="layui-input-split layui-input-prefix">
断奶后护理时间(天)
</div>
<input type="text" name="nursing_time" value="`+data.squirrelSet.nursing_time+`" lay-verify="required" placeholder="编 号" lay-reqtext="请填写编号" autocomplete="off" class="layui-input" >
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-group">
<div class="layui-input-split layui-input-prefix">
雄鼠性成熟时间(天)
</div>
<input type="text" name="male_grow_time" value="`+data.squirrelSet.male_grow_time+`" lay-verify="required" placeholder="编 号" lay-reqtext="请填写编号" autocomplete="off" class="layui-input" >
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-group">
<div class="layui-input-split layui-input-prefix">
雌鼠性成熟时间(天)
</div>
<input type="text" name="female_grow_time" value="`+data.squirrelSet.female_grow_time+`" lay-verify="required" placeholder="编 号" lay-reqtext="请填写编号" autocomplete="off" class="layui-input" >
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-group">
<div class="layui-input-split layui-input-prefix">
不育鼠时间(月)
</div>
<input type="text" name="infertility_time" value="`+data.squirrelSet.infertility_time+`" lay-verify="required" placeholder="编 号" lay-reqtext="请填写编号" autocomplete="off" class="layui-input" >
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-group">
<div class="layui-input-split layui-input-prefix">
给药后持续几天显示给药标识
</div>
<input type="text" name="dose_time" value="`+data.squirrelSet.dose_time+`" lay-verify="required" placeholder="编 号" lay-reqtext="请填写编号" autocomplete="off" class="layui-input" >
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-group">
<div class="layui-input-split layui-input-prefix">
记住几个近期给药的颜色
</div>
<input type="text" name="color_time" value="`+data.squirrelSet.color_time+`" lay-verify="required" placeholder="编 号" lay-reqtext="请填写编号" autocomplete="off" class="layui-input" >
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-group">
<div class="layui-input-split layui-input-prefix">
配繁标识
</div>
<select name="breeding_tag">
<option value="">请选择</option>
<option value="true" `+(data.squirrelSet.breeding_tag==true?"selected":"")+`></option>
<option value="false" `+(data.squirrelSet.breeding_tag==false?"selected":"")+`></option>
</select>
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-group">
<div class="layui-input-split layui-input-prefix">
见栓标识
</div>
<select name="see_bole_tag">
<option value="">请选择</option>
<option value="true" `+(data.squirrelSet.see_bole_tag==true?"selected":"")+`></option>
<option value="false" `+(data.squirrelSet.see_bole_tag==false?"selected":"")+`></option>
</select>
</div>
</div>
<div class="layui-form-item">
<button class="layui-btn layui-btn-fluid" lay-submit lay-filter="demo-login">确认</button>
</div>
</div>
</div>
`,
success: function(){
var laydate = layui.laydate;
// 渲染
laydate.render({
elem: '#ID-laydate-demo'
});
// 对弹层中的表单进行初始化渲染
form.render();
// 表单提交事件
form.on('submit(demo-login)', function(data){
var field = data.field; // 获取表单字段值
$.post('/admin_user/usersetedit',field,function(obj){
if(obj.status != 1){
return layer.msg(obj.msg);
}else{
//示范一个公告层
layer.open({
type: 1
,title: false //不显示标题栏
,closeBtn: false
,area: '300px;'
,shade: 0.8
,id: 'LAY_layuipro' //设定一个id,防止重复弹出
,btn: '返回列表'
,btnAlign: 'c'
,moveType: 1 //拖拽模式,0或者1
,content: '<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: bold;font-size: 20px;text-align: center;">修改成功</div>'
,yes: function(){
history.go(0)
}
});
}
});
return false; // 阻止默认 form 跳转
});
}
});
}
if(obj.event === 'excel'){
form.render("checkbox");
var now = '';
// iframe 层
layer.open({
type: 1,
area: '450px',
resize: false,
shadeClose: true,
title: 'EXCEL设置',
content: `
<div class="layui-form" lay-filter="filter-test-layer" style="margin: 16px;">
<div class="demo-login-container">
<input type="hidden" name="id" value="`+data.excelSet.id+`" >
<input type="hidden" name="table" value="ExcelSetModel" >
<div class="layui-form-item">
<div class="layui-input-group">
<input type="txt" value="现存鼠" lay-verify="required" disabled autocomplete="off" class="layui-input" style="text-align: center;" >
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-group layui-row layui-col-space1">
<div class="layui-col-md3">
<input type="checkbox" name="now_squirrel[number]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.now_squirrel.number+`">编号
</div>
<div class="layui-col-md3">
<input type="checkbox" name="now_squirrel[sex]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.now_squirrel.sex+`">性别
</div>
<div class="layui-col-md3">
<input type="checkbox" name="now_squirrel[birthday]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.now_squirrel.birthday+`">出生
</div>
<div class="layui-col-md3">
<input type="checkbox" name="now_squirrel[strains_id]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.now_squirrel.strains_id+`">品系
</div>
</div>
<div class="layui-input-group layui-row layui-col-space1">
<div class="layui-col-md3">
<input type="checkbox" name="now_squirrel[gene]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.now_squirrel.gene+`">基因
</div>
<div class="layui-col-md3">
<input type="checkbox" name="now_squirrel[cage_num]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.now_squirrel.cage_num+`">笼号
</div>
<div class="layui-col-md3">
<input type="checkbox" name="now_squirrel[content]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.now_squirrel.content+`">描述
</div>
<div class="layui-col-md3">
<input type="checkbox" name="now_squirrel[hair_color]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.now_squirrel.hair_color+`">毛色
</div>
</div>
<div class="layui-input-group layui-row layui-col-space1">
<div class="layui-col-md3">
<input type="checkbox" name="now_squirrel[fenlong]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.now_squirrel.fenlong+`">分笼
</div>
<div class="layui-col-md3">
<input type="checkbox" name="now_squirrel[fanzhi]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.now_squirrel.fanzhi+`">配繁
</div>
<div class="layui-col-md3">
<input type="checkbox" name="now_squirrel[breeding_tag]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.now_squirrel.breeding_tag+`">体重
</div>
<div class="layui-col-md3">
<input type="checkbox" name="now_squirrel[see_bole_tag]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.now_squirrel.see_bole_tag+`">见栓
</div>
</div>
<div class="layui-input-group layui-row layui-col-space1">
<div class="layui-col-md3">
<input type="checkbox" name="now_squirrel[give_medicine]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.now_squirrel.give_medicine+`">给药
</div>
<div class="layui-col-md3">
<input type="checkbox" name="now_squirrel[father]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.now_squirrel.father+`">父亲
</div>
<div class="layui-col-md3">
<input type="checkbox" name="now_squirrel[mother]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.now_squirrel.mother+`">母亲
</div>
<div class="layui-col-md3">
<input type="checkbox" name="now_squirrel[remark]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.now_squirrel.remark+`">备注
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-group">
<input type="txt" value="处理鼠" lay-verify="required" disabled autocomplete="off" class="layui-input" style="text-align: center;" >
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-group layui-row layui-col-space1">
<div class="layui-col-md3">
<input type="checkbox" name="handle_squirrel[number]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.handle_squirrel.number+`">编号
</div>
<div class="layui-col-md3">
<input type="checkbox" name="handle_squirrel[sex]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.handle_squirrel.sex+`">性别
</div>
<div class="layui-col-md3">
<input type="checkbox" name="handle_squirrel[birthday]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.handle_squirrel.birthday+`">出生
</div>
<div class="layui-col-md3">
<input type="checkbox" name="handle_squirrel[strains_id]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.handle_squirrel.strains_id+`">品系
</div>
</div>
<div class="layui-input-group layui-row layui-col-space1">
<div class="layui-col-md3">
<input type="checkbox" name="handle_squirrel[gene]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.handle_squirrel.gene+`">基因
</div>
<div class="layui-col-md3">
<input type="checkbox" name="handle_squirrel[cage_num]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.handle_squirrel.cage_num+`">笼号
</div>
<div class="layui-col-md3">
<input type="checkbox" name="handle_squirrel[content]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.handle_squirrel.content+`">描述
</div>
<div class="layui-col-md3">
<input type="checkbox" name="handle_squirrel[hair_color]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.handle_squirrel.hair_color+`">毛色
</div>
</div>
<div class="layui-input-group layui-row layui-col-space1">
<div class="layui-col-md3">
<input type="checkbox" name="handle_squirrel[fenlong]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.handle_squirrel.fenlong+`">分笼
</div>
<div class="layui-col-md3">
<input type="checkbox" name="handle_squirrel[fanzhi]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.handle_squirrel.fanzhi+`">配繁
</div>
<div class="layui-col-md3">
<input type="checkbox" name="handle_squirrel[breeding_tag]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.handle_squirrel.breeding_tag+`">体重
</div>
<div class="layui-col-md3">
<input type="checkbox" name="handle_squirrel[see_bole_tag]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.handle_squirrel.see_bole_tag+`">见栓
</div>
</div>
<div class="layui-input-group layui-row layui-col-space1">
<div class="layui-col-md3">
<input type="checkbox" name="handle_squirrel[give_medicine]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.handle_squirrel.give_medicine+`">给药
</div>
<div class="layui-col-md3">
<input type="checkbox" name="handle_squirrel[father]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.handle_squirrel.father+`">父亲
</div>
<div class="layui-col-md3">
<input type="checkbox" name="handle_squirrel[mother]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.handle_squirrel.mother+`">母亲
</div>
<div class="layui-col-md3">
<input type="checkbox" name="handle_squirrel[remark]" lay-skin="primary" style="margin-top:unset;" checked="`+data.excelSet.handle_squirrel.remark+`">备注
</div>
</div>
</div>
<div class="layui-form-item">
<button class="layui-btn layui-btn-fluid" lay-submit lay-filter="demo-login">确认</button>
</div>
</div>
</div>
`,
success: function(){
// 对弹层中的表单进行初始化渲染
// 表单提交事件
form.render("checkbox");
form.on('submit(demo-login)', function(data){
var field = data.field; // 获取表单字段值
$.post('/admin_user/usersetedit',field,function(obj){
if(obj.status != 1){
return layer.msg(obj.msg);
}else{
//示范一个公告层
layer.open({
type: 1
,title: false //不显示标题栏
,closeBtn: false
,area: '300px;'
,shade: 0.8
,id: 'LAY_layuipro' //设定一个id,防止重复弹出
,btn: '返回列表'
,btnAlign: 'c'
,moveType: 1 //拖拽模式,0或者1
,content: '<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: bold;font-size: 20px;text-align: center;">修改成功</div>'
,yes: function(){
history.go(0)
}
});
}
});
return false; // 阻止默认 form 跳转
});
}
});
}
});
$('.site-demo-layedit').on('click', function(){
@ -191,6 +647,8 @@
}
}
});
form.render('checkbox');
// function deletet(tablename,id){
// $.post('/admin_index/delete',{tablename:tablename,id:id},function(obj){
// if(obj.status != 1){

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save