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

cost

@@ -35,19 +35,30 @@ class AdminEquipmentController extends AdminBaseController{ @@ -35,19 +35,30 @@ class AdminEquipmentController extends AdminBaseController{
35 return $this->fetch(); 35 return $this->fetch();
36 } 36 }
37 37
  38 + public function add(){
38 39
  40 + return $this->fetch();
  41 + }
  42 +
  43 + public function addPost(){
  44 +
  45 + }
39 46
40 //批量导入设备信息 47 //批量导入设备信息
  48 + public function batch_add(){
41 49
  50 + return $this->fetch();
  51 + }
42 52
  53 + public function batch_addPost(){
43 54
  55 + }
44 56
45 57
46 58
47 //生成二维码 59 //生成二维码
48 public function createQrCode($value){ 60 public function createQrCode($value){
49 import('phpqrcode.qrlib',VENDOR_PATH,'.php'); 61 import('phpqrcode.qrlib',VENDOR_PATH,'.php');
50 -// $value= "http://www.baidu.com";  
51 $name=date('YmdHis').rand(1000,9999); 62 $name=date('YmdHis').rand(1000,9999);
52 $filename='qrCode/'.$name.'.png'; 63 $filename='qrCode/'.$name.'.png';
53 $filePath = 'upload/'.$filename; // 生成的文件名 64 $filePath = 'upload/'.$filename; // 生成的文件名
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 <ul class="nav nav-tabs"> 5 <ul class="nav nav-tabs">
6 <li class="active"><a href="javascript:;">设备列表</a></li> 6 <li class="active"><a href="javascript:;">设备列表</a></li>
7 </ul> 7 </ul>
8 - <form class="well form-inline margin-top-20" method="post" action="{:url('AdminArticle/index')}"> 8 + <form class="well form-inline margin-top-20" method="post" action="{:url('AdminEquipment/index')}">
9 分类: 9 分类:
10 <select class="form-control" name="category" style="width: 140px;"> 10 <select class="form-control" name="category" style="width: 140px;">
11 <option value='0'>全部</option> 11 <option value='0'>全部</option>
@@ -22,18 +22,18 @@ @@ -22,18 +22,18 @@
22 <input type="text" class="form-control" name="keyword" style="width: 200px;" 22 <input type="text" class="form-control" name="keyword" style="width: 200px;"
23 value="{$keyword|default=''}" placeholder="请输入关键字..."> 23 value="{$keyword|default=''}" placeholder="请输入关键字...">
24 <input type="submit" class="btn btn-primary" value="搜索"/> 24 <input type="submit" class="btn btn-primary" value="搜索"/>
25 - <a class="btn btn-danger" href="{:url('AdminArticle/index')}">清空</a> 25 + <a class="btn btn-danger" href="{:url('AdminEquipment/index')}">清空</a>
26 </form> 26 </form>
27 <form class="js-ajax-form" action="" method="post"> 27 <form class="js-ajax-form" action="" method="post">
28 <div class="table-actions"> 28 <div class="table-actions">
29 - <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"  
30 - data-action="{:url('AdminArticle/publish',array('yes'=>1))}" data-subcheck="true">新增 29 + <button class="btn btn-primary btn-sm js-ajax-submit" type="button"
  30 + onclick="doAdd()">新增
31 </button> 31 </button>
32 <button class="btn btn-primary btn-sm js-ajax-submit" type="submit" 32 <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
33 - data-action="{:url('AdminArticle/publish',array('yes'=>1))}" data-subcheck="true">批量新增 33 + onclick="doAdd()">批量新增
34 </button> 34 </button>
35 <button class="btn btn-primary btn-sm js-ajax-submit" type="submit" 35 <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
36 - data-action="{:url('AdminArticle/publish',array('yes'=>1))}" data-subcheck="true">批量导出 36 + data-action="{:url('AdminEquipment/publish',array('yes'=>1))}" data-subcheck="true">批量导出
37 </button> 37 </button>
38 </div> 38 </div>
39 <table class="table table-hover table-bordered table-list"> 39 <table class="table table-hover table-bordered table-list">
@@ -95,53 +95,39 @@ @@ -95,53 +95,39 @@
95 {$vo.key} 95 {$vo.key}
96 </td> 96 </td>
97 <td> 97 <td>
98 - <a href="{:url('AdminArticle/edit',array('id'=>$vo['id']))}">{:lang('EDIT')}</a>  
99 - <a href="{:url('AdminArticle/delete',array('id'=>$vo['id']))}" class="js-ajax-delete">{:lang('DELETE')}</a> 98 + <a href="{:url('AdminEquipment/edit',array('id'=>$vo['id']))}">{:lang('EDIT')}</a>
  99 + <a href="{:url('AdminEquipment/delete',array('id'=>$vo['id']))}" class="js-ajax-delete">{:lang('DELETE')}</a>
100 </td> 100 </td>
101 </tr> 101 </tr>
102 </foreach> 102 </foreach>
103 </table> 103 </table>
104 - <!--<div class="table-actions">-->  
105 - <!--<notempty name="category">-->  
106 - <!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->  
107 - <!--data-action="{:url('AdminArticle/listOrder')}">{:lang('SORT')}-->  
108 - <!--</button>-->  
109 - <!--</notempty>-->  
110 - <!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->  
111 - <!--data-action="{:url('AdminArticle/publish',array('yes'=>1))}" data-subcheck="true">发布-->  
112 - <!--</button>-->  
113 - <!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->  
114 - <!--data-action="{:url('AdminArticle/publish',array('no'=>1))}" data-subcheck="true">取消发布-->  
115 - <!--</button>-->  
116 - <!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->  
117 - <!--data-action="{:url('AdminArticle/top',array('yes'=>1))}" data-subcheck="true">置顶-->  
118 - <!--</button>-->  
119 - <!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->  
120 - <!--data-action="{:url('AdminArticle/top',array('no'=>1))}" data-subcheck="true">取消置顶-->  
121 - <!--</button>-->  
122 - <!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->  
123 - <!--data-action="{:url('AdminArticle/recommend',array('yes'=>1))}" data-subcheck="true">推荐-->  
124 - <!--</button>-->  
125 - <!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->  
126 - <!--data-action="{:url('AdminArticle/recommend',array('no'=>1))}" data-subcheck="true">取消推荐-->  
127 - <!--</button>-->  
128 - <!--&lt;!&ndash;-->  
129 - <!--<notempty name="category">-->  
130 - <!--<button class="btn btn-primary btn-sm js-articles-move" type="button">批量移动</button>-->  
131 - <!--</notempty>-->  
132 - <!--<button class="btn btn-primary btn-sm js-articles-copy" type="button">批量复制</button>-->  
133 - <!--&ndash;&gt;-->  
134 - <!--<button class="btn btn-danger btn-sm js-ajax-submit" type="submit"-->  
135 - <!--data-action="{:url('AdminArticle/delete')}" data-subcheck="true" data-msg="您确定删除吗?">-->  
136 - <!--{:lang('DELETE')}-->  
137 - <!--</button>-->  
138 - <!--</div>-->  
139 <ul class="pagination">{$page|default=''}</ul> 104 <ul class="pagination">{$page|default=''}</ul>
140 </form> 105 </form>
141 </div> 106 </div>
142 <script src="__STATIC__/js/admin.js"></script> 107 <script src="__STATIC__/js/admin.js"></script>
143 <script> 108 <script>
144 109
  110 + function doAdd() {
  111 + openIframeLayer("{:url('AdminEquipment/add')}", '请选择分类', {
  112 + area: ['700px', '400px'],
  113 + btn: ['确定', '取消'],
  114 + yes: function (index, layero) {
  115 + //do something
  116 + var iframeWin = window[layero.find('iframe')[0]['name']];
  117 + var selectedCategories = iframeWin.confirm();
  118 + if (selectedCategories.selectedCategoriesId.length == 0) {
  119 +
  120 + }
  121 + $('#js-categories-id-input').val(selectedCategories.selectedCategoriesId.join(','));
  122 + $('#js-categories-name-input').val(selectedCategories.selectedCategoriesName.join(' '));
  123 + //console.log(layer.getFrameIndex(index));
  124 + layer.close(index); //如果设定了yes回调,需进行手工关闭
  125 + }
  126 + });
  127 + }
  128 +
  129 +
  130 +
145 function reloadPage(win) { 131 function reloadPage(win) {
146 win.location.reload(); 132 win.location.reload();
147 } 133 }