作者 董瑞恩
1 个管道 的构建 通过 耗费 5 秒

interface

@@ -84,6 +84,10 @@ class AdminEquipmentController extends AdminBaseController{ @@ -84,6 +84,10 @@ class AdminEquipmentController extends AdminBaseController{
84 } 84 }
85 85
86 public function edit(){ 86 public function edit(){
  87 + $id=$this->request->param('id');
  88 + $data=Db::name('equipment')->where('id',$id)->find();
  89 +
  90 + $this->assign('data',$data);
87 return $this->fetch(); 91 return $this->fetch();
88 } 92 }
89 93
@@ -29,8 +29,7 @@ @@ -29,8 +29,7 @@
29 <body> 29 <body>
30 <div class="wrap js-check-wrap"> 30 <div class="wrap js-check-wrap">
31 <ul class="nav nav-tabs"> 31 <ul class="nav nav-tabs">
32 - <li><a href="{:url('AdminTestInfo/index')}">检测报告</a></li>  
33 - <li class="active"><a href="{:url('AdminTestInfo/add')}">添加报告</a></li> 32 + <li class="active"><a>添加设备信息</a></li>
34 </ul> 33 </ul>
35 <!--js-ajax-form margin-top-20--> 34 <!--js-ajax-form margin-top-20-->
36 <form action="{:url('AdminTestInfo/addPost')}" method="post" class="form-horizontal js-ajax-form margin-top-20"> 35 <form action="{:url('AdminTestInfo/addPost')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
  1 +<include file="public@header"/>
  2 +<style type="text/css">
  3 + .pic-list li {
  4 + margin-bottom: 5px;
  5 + }
  6 +</style>
  7 +<script type="text/html" id="photos-item-tpl">
  8 + <li id="saved-image{id}">
  9 + <input id="photo-{id}" type="hidden" name="photo_urls[]" value="{filepath}">
  10 + <input class="form-control" id="photo-{id}-name" type="text" name="photo_names[]" value="{name}"
  11 + style="width: 200px;" title="图片名称">
  12 + <img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"
  13 + onclick="imagePreviewDialog(this.src);">
  14 + <a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>
  15 + <a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>
  16 + </li>
  17 +</script>
  18 +<script type="text/html" id="files-item-tpl">
  19 + <li id="saved-file{id}">
  20 + <input id="file-{id}" type="hidden" name="file_urls[]" value="{filepath}">
  21 + <input class="form-control" id="file-{id}-name" type="text" name="file_names[]" value="{name}"
  22 + style="width: 200px;" title="文件名称">
  23 + <a id="file-{id}-preview" href="{preview_url}" target="_blank">下载</a>
  24 + <a href="javascript:uploadOne('图片上传','#file-{id}','file');">替换</a>
  25 + <a href="javascript:(function(){$('#saved-file{id}').remove();})();">移除</a>
  26 + </li>
  27 +</script>
  28 +</head>
  29 +<body>
  30 +<div class="wrap js-check-wrap">
  31 + <ul class="nav nav-tabs">
  32 + <li class="active"><a>添加设备信息</a></li>
  33 + </ul>
  34 + <!--js-ajax-form margin-top-20-->
  35 + <form action="{:url('AdminTestInfo/addPost')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
  36 + <div class="row">
  37 + <div class="col-md-2"></div>
  38 + <div class="col-md-8">
  39 + <table class="table table-bordered">
  40 + <tr>
  41 + <th width="80">设备锁编号<span class="form-required">*</span></th>
  42 + <td>
  43 + <input class="form-control" type="text" name="serial_number"
  44 + id="serial_number" required value="" placeholder="请输入设备锁编号"/>
  45 + </td>
  46 + <th width="80">设备MAC地址<span class="form-required">*</span></th>
  47 + <td><input class="form-control" type="text" name="mac_address" id="mac_address" value=""
  48 + placeholder="请输入设备MAC地址" required></td>
  49 + </tr>
  50 + <tr>
  51 + <th width="80">设备锁名称<span class="form-required">*</span></th>
  52 + <td>
  53 + <input class="form-control" type="text" name="name" id="name" value=""
  54 + placeholder="请输入设备锁名称" required>
  55 + </td>
  56 + <th width="80">所属医院</th>
  57 + <td>
  58 + <input class="form-control" type="text" name="hospital" id="hospital" value=""
  59 + placeholder="请输入所属医院">
  60 + </td>
  61 + </tr>
  62 + <tr>
  63 + <th width="80">备注<span class="form-required">*</span></th>
  64 + <td>
  65 + <input class="form-control" type="text" name="note" id="note"
  66 + placeholder="请填写备注" required>
  67 + </td>
  68 + <th width="80">导入时间<span class="form-required">*</span></th>
  69 + <td>
  70 + <input class="form-control" name="create_time" id="create_time"
  71 + value="{:date('Y-m-d H:i:s',time())}" required>
  72 + </td>
  73 + </tr>
  74 +
  75 + </table>
  76 + </div>
  77 + </div>
  78 + </form>
  79 +</div>
  80 +<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
  81 +
  82 +<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
  83 +<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
  84 +<script type="text/javascript">
  85 + function confirm() {
  86 + var serial_number = $('#serial_number').val();
  87 + var mac_address = $('#mac_address').val();
  88 + var name = $('#name').val();
  89 + var hospital = $('#hospital').val();
  90 + var note = $('#note').val();
  91 + var create_time = $('#create_time').val();
  92 +
  93 + return {
  94 + serial_number:serial_number,
  95 + mac_address :mac_address,
  96 + name :name,
  97 + hospital :hospital,
  98 + note :note,
  99 + create_time :create_time
  100 + };
  101 + }
  102 +</script>
  103 +</body>
  104 +</html>