44b51e107c4ce235f0533596358218a51debb878_0.file.index.html.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  1. <?php
  2. /* Smarty version 3.1.30, created on 2018-05-07 00:09:42
  3. from "D:\phpStudy\WWW\workorder\application\views\templates\appauth\index.html" */
  4. /* @var Smarty_Internal_Template $_smarty_tpl */
  5. if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  6. 'version' => '3.1.30',
  7. 'unifunc' => 'content_5aef28c6056616_99715988',
  8. 'has_nocache_code' => false,
  9. 'file_dependency' =>
  10. array (
  11. '44b51e107c4ce235f0533596358218a51debb878' =>
  12. array (
  13. 0 => 'D:\\phpStudy\\WWW\\workorder\\application\\views\\templates\\appauth\\index.html',
  14. 1 => 1524911967,
  15. 2 => 'file',
  16. ),
  17. ),
  18. 'includes' =>
  19. array (
  20. ),
  21. ),false)) {
  22. function content_5aef28c6056616_99715988 (Smarty_Internal_Template $_smarty_tpl) {
  23. if (!is_callable('smarty_modifier_date_format')) require_once 'D:\\phpStudy\\WWW\\workorder\\application\\libraries\\smarty\\plugins\\modifier.date_format.php';
  24. ?>
  25. <!DOCTYPE html>
  26. <html lang="zh-CN">
  27. <head>
  28. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  29. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  30. <meta name="robots" content="noindex,nofollow">
  31. <title><?php echo $_smarty_tpl->tpl_vars['sys_name']->value;?>
  32. </title>
  33. <base href="<?php echo base_url();?>
  34. "/>
  35. <link href="static/css/bootstrap.min.css" rel="stylesheet">
  36. <link href="static/css/bootstrap-table.min.css" rel="stylesheet">
  37. <link href="static/js/skins/all.css" rel="stylesheet">
  38. <link href="static/css/select2.min.css" rel="stylesheet">
  39. <link rel="stylesheet" href="static/css/style.css">
  40. <?php echo '<script'; ?>
  41. language="javascript" type="text/javascript"> var SITE_URL = "/";<?php echo '</script'; ?>
  42. >
  43. <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  44. <!--[if lt IE 9]>
  45. <?php echo '<script'; ?>
  46. src="http://cdn.bootcss.com/html5shiv/3.7.0/html5shiv.js"><?php echo '</script'; ?>
  47. >
  48. <?php echo '<script'; ?>
  49. src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"><?php echo '</script'; ?>
  50. >
  51. <![endif]-->
  52. </head>
  53. <body style="background: #fff;">
  54. <div style="padding:10px;">
  55. <div class="panel panel-default grid">
  56. <div class="panel-body">
  57. <form class="form-inline" role="form" method="get">
  58. <input type="hidden" name="page_size" value="<?php echo $_smarty_tpl->tpl_vars['page_size']->value;?>
  59. ">
  60. <div class="pull-left">
  61. <div class="btn-group">
  62. <button type="button" class="add" id="add_appauth">
  63. 增加应用授权
  64. </button>
  65. <span class="btn_line"></span>
  66. <button type="button" class="disable" id="disable_appauth" disabled>
  67. 批量禁用
  68. </button>
  69. <button type="button" class="enable" id="enable_appauth" disabled>
  70. 批量启用
  71. </button>
  72. <span class="btn_line"></span>
  73. <button type="button" class="refresh" onclick="window.location.reload();">
  74. 刷新
  75. </button>
  76. </div>
  77. </div>
  78. <div class="pull-right">
  79. <div class="form-group">
  80. <select class="form-control" name="status">
  81. <option value="">所有状态</option>
  82. <?php
  83. $_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['appauth_status']->value, 'val', false, 'k');
  84. if ($_from !== null) {
  85. foreach ($_from as $_smarty_tpl->tpl_vars['k']->value => $_smarty_tpl->tpl_vars['val']->value) {
  86. ?>
  87. <option value="<?php echo $_smarty_tpl->tpl_vars['k']->value;?>
  88. " <?php if ($_smarty_tpl->tpl_vars['status']->value == $_smarty_tpl->tpl_vars['k']->value) {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['val']->value;?>
  89. </option>
  90. <?php
  91. }
  92. }
  93. $_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl);
  94. ?>
  95. </select>
  96. </div>
  97. <div class="form-group">
  98. <input class="form-control keyword" name="keyword" id="keyword" placeholder="筛选" type="text" value="<?php echo $_smarty_tpl->tpl_vars['keyword']->value;?>
  99. ">
  100. <button type="submit" class="search">
  101. <i class="glyphicon glyphicon-search"></i>
  102. </button>
  103. </div>
  104. </div>
  105. </form>
  106. </div>
  107. <table id="data_table" data-toggle="table" data-search="true" class="table<?php if ($_smarty_tpl->tpl_vars['count']->value) {?> table-hover<?php }?> table-bordered">
  108. <thead>
  109. <tr>
  110. <th class="text-center" style="width: 40px;"><input name="check_all" class="check_all" value="true" type="checkbox"></th>
  111. <!--<th></th>-->
  112. <th class="text-center">应用名称</th>
  113. <th class="text-center">APPID</th>
  114. <th class="text-center">状态</th>
  115. <th class="text-center">创建时间</th>
  116. <th class="text-center" style="width: 230px">操作</th>
  117. </tr>
  118. </thead>
  119. <tbody>
  120. <?php
  121. $_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['appauth_list']->value, 'val', false, 'k');
  122. if ($_from !== null) {
  123. foreach ($_from as $_smarty_tpl->tpl_vars['k']->value => $_smarty_tpl->tpl_vars['val']->value) {
  124. ?>
  125. <tr>
  126. <td class="text-center"><input name="ids[]" value="<?php echo $_smarty_tpl->tpl_vars['val']->value['app_id'];?>
  127. " type="checkbox"></td>
  128. <td><?php echo $_smarty_tpl->tpl_vars['val']->value['app_name'];?>
  129. </td>
  130. <td><?php echo $_smarty_tpl->tpl_vars['val']->value['app_id'];?>
  131. </td>
  132. <td class="text-center"><span class="status<?php echo $_smarty_tpl->tpl_vars['val']->value['status'];?>
  133. "><?php echo $_smarty_tpl->tpl_vars['appauth_status']->value[$_smarty_tpl->tpl_vars['val']->value['status']];?>
  134. </span></td>
  135. <td class="text-center"><?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['val']->value['create_time']->toDateTime(),'%Y-%m-%d %H:%M:%S');?>
  136. </td>
  137. <td>
  138. <a href="javascript:;" data-id="<?php echo $_smarty_tpl->tpl_vars['val']->value['app_id'];?>
  139. " class="view_info">
  140. 查看详情
  141. </a>
  142. <?php if ($_smarty_tpl->tpl_vars['val']->value['status'] == "10") {?>
  143. <a href="javascript:;" data-id="<?php echo $_smarty_tpl->tpl_vars['val']->value['app_id'];?>
  144. " class="stop_use">
  145. 禁用
  146. </a>
  147. <?php }?>
  148. <?php if ($_smarty_tpl->tpl_vars['val']->value['status'] == "40") {?>
  149. <a href="javascript:;" data-id="<?php echo $_smarty_tpl->tpl_vars['val']->value['app_id'];?>
  150. " class="restore">
  151. 启用
  152. </a>
  153. <?php }?>
  154. <a href="javascript:;" data-id="<?php echo $_smarty_tpl->tpl_vars['val']->value['app_id'];?>
  155. " class="delete">
  156. 删除
  157. </a>
  158. </td>
  159. </tr>
  160. <?php
  161. }
  162. }
  163. $_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl);
  164. ?>
  165. <?php if (!$_smarty_tpl->tpl_vars['count']->value) {?>
  166. <tr>
  167. <td colspan="6" class="empty_table"><img src="static/images/empty_table.png"><p>暂无符合条件的数据!</p></td>
  168. </tr>
  169. <?php }?>
  170. </tbody>
  171. </table>
  172. <div class="panel-footer clearfix">
  173. <div class="form-inline">
  174. <div class="pull-right">
  175. <div class="form-group count">总共<?php echo $_smarty_tpl->tpl_vars['count']->value;?>
  176. 条记录</div>
  177. <div class="form-group">
  178. <?php echo $_smarty_tpl->tpl_vars['page']->value;?>
  179. </div>
  180. <div class="form-group">
  181. <label for="page_size" class="form-control-static control-label">每页</label>
  182. <select class="form-control" id="page_size" name="page_size">
  183. <option value="10" <?php if ($_smarty_tpl->tpl_vars['page_size']->value == 10) {?>selected<?php }?>>10</option>
  184. <option value="20" <?php if ($_smarty_tpl->tpl_vars['page_size']->value == 20) {?>selected<?php }?>>20</option>
  185. <option value="50" <?php if ($_smarty_tpl->tpl_vars['page_size']->value == 50) {?>selected<?php }?>>50</option>
  186. <option value="100" <?php if ($_smarty_tpl->tpl_vars['page_size']->value == 100) {?>selected<?php }?>>100</option>
  187. </select>
  188. </div>
  189. </div>
  190. </div>
  191. </div>
  192. </div>
  193. </div>
  194. <?php echo '<script'; ?>
  195. type="text/javascript" charset="utf-8" src="static/js/jquery.js"><?php echo '</script'; ?>
  196. >
  197. <?php echo '<script'; ?>
  198. type="text/javascript" charset="utf-8" src="static/js/bootstrap.min.js"><?php echo '</script'; ?>
  199. >
  200. <?php echo '<script'; ?>
  201. type="text/javascript" charset="utf-8" src="static/js/bootstrap-table.min.js"><?php echo '</script'; ?>
  202. >
  203. <?php echo '<script'; ?>
  204. type="text/javascript" charset="utf-8" src="static/js/bootstrap-table-zh-CN.min.js"><?php echo '</script'; ?>
  205. >
  206. <?php echo '<script'; ?>
  207. type="text/javascript" charset="utf-8" src="static/js/icheck.min.js"><?php echo '</script'; ?>
  208. >
  209. <?php echo '<script'; ?>
  210. type="text/javascript" charset="utf-8" src="static/js/select2.full.min.js"><?php echo '</script'; ?>
  211. >
  212. <?php echo '<script'; ?>
  213. type="text/javascript" charset="utf-8" src="static/js/layer/layer.js"><?php echo '</script'; ?>
  214. >
  215. <?php echo '<script'; ?>
  216. language="javascript" type="text/javascript">
  217. var disabled_btn = "";
  218. $(".panel-body button:disabled").each(function () {
  219. disabled_btn +="#"+$(this).attr("id")+",";
  220. })
  221. disabled_btn = disabled_btn.substr(0,disabled_btn.length-1);
  222. $(function(){
  223. $("table").show();
  224. $('input').iCheck({
  225. cursor : true,
  226. checkboxClass : 'icheckbox_square-blue'
  227. });
  228. $("select").select2({minimumResultsForSearch: -1});
  229. layer.config({
  230. extend: 'myskin/style.css', //加载新皮肤
  231. });
  232. $("#keyword").on('input',function () {
  233. $('#data_table').bootstrapTable('resetSearch', $(this).val());
  234. $('input').iCheck({
  235. cursor : true,
  236. checkboxClass : 'icheckbox_square-blue'
  237. });
  238. });
  239. $("#add_appauth").click(function () {
  240. parent.$('#mainFrameTabs').bTabsAdd("tab21","新增应用授权","appauth/add");
  241. })
  242. $(".bootstrap-table").on('click',".delete",function () {
  243. var id = $(this).data("id");
  244. layer.confirm("确定要删除该应用授权吗?删除后该应用将不能与系统通讯!", {skin: 'layer-ext-myskin',icon: 3, title:'提示'}, function(index){
  245. if(id != "" && id != undefined) {
  246. $.post(
  247. "appauth/delete/" + id,
  248. function (data) {
  249. layer.msg(data.msg, {icon: data.icon,time: 3000}, function () {
  250. window.location.reload();
  251. })
  252. }
  253. )
  254. }else{
  255. layer.alert("参数错误,请刷新后重试!",{skin: 'layer-ext-myskin',icon: 5, title:'错误提示'});
  256. }
  257. layer.close(index);
  258. })
  259. })
  260. $(".bootstrap-table").on('click',".stop_use",function () {
  261. var id = $(this).data("id");
  262. layer.confirm("确定要停用该应用授权吗?停用后该应用将不能与系统通讯!", {skin: 'layer-ext-myskin',icon: 3, title:'提示'}, function(index){
  263. if(id != "" && id != undefined) {
  264. $.post(
  265. "appauth/stopuse/" + id,
  266. function (data) {
  267. layer.msg(data.msg, {icon: data.icon,time: 3000}, function () {
  268. window.location.reload();
  269. })
  270. }
  271. )
  272. }else{
  273. layer.alert("参数错误,请刷新后重试!",{skin: 'layer-ext-myskin',icon: 5, title:'错误提示'});
  274. }
  275. layer.close(index);
  276. })
  277. })
  278. $(".bootstrap-table").on('click',".restore",function () {
  279. var id = $(this).data("id");
  280. if(id != "" && id != undefined) {
  281. $.post(
  282. "appauth/restore/" + id,
  283. function (data) {
  284. layer.msg(data.msg, {icon: data.icon,time: 3000}, function () {
  285. window.location.reload();
  286. })
  287. }
  288. )
  289. }else{
  290. layer.alert("参数错误,请刷新后重试!",{skin: 'layer-ext-myskin',icon: 5, title:'错误提示'});
  291. }
  292. })
  293. $(".bootstrap-table").on('click',".view_info",function() {
  294. var id = $(this).data("id");
  295. if (id != "" && id != undefined) {
  296. layer.open({
  297. type: 2,
  298. title: "应用授权详情",
  299. offset: 'auto',
  300. shade: [0.3],
  301. area: ['800px', '400px'],
  302. anim: 0,
  303. shadeClose: false,
  304. content: 'appauth/view/' + id,
  305. end: function () {
  306. window.location.reload();
  307. }
  308. });
  309. } else {
  310. layer.alert("参数错误,请刷新后重试!", {skin: 'layer-ext-myskin',icon: 5, title:'错误提示'});
  311. }
  312. })
  313. $(".bootstrap-table").on('ifChecked','.check_all',function () {
  314. $("input:checkbox").not(':disabled').iCheck('check');
  315. }).on('ifUnchecked','.check_all',function () {
  316. $("input:checkbox").not(':disabled').iCheck('uncheck');
  317. });
  318. $(".bootstrap-table").on('ifChanged','input:checkbox',function(){
  319. var ids ="";
  320. $("input:checkbox").each(function () {
  321. if($(this).not(":disabled").prop("checked")){
  322. ids += $(this).val()+",";
  323. }
  324. });
  325. if(ids != "" && ids != undefined){
  326. $(disabled_btn).removeAttr("disabled");
  327. }else{
  328. $(disabled_btn).attr("disabled","disabled");
  329. }
  330. })
  331. $("#disable_appauth").click(function () {
  332. var ids = "";
  333. $("input:checkbox").each(function () {
  334. if($(this).not(":disabled").prop("checked")){
  335. ids += $(this).val()+",";
  336. }
  337. })
  338. if(ids == ""){
  339. layer.alert("请选择要停用的应用授权!",{skin: 'layer-ext-myskin',icon: 3, title:'提示'});
  340. }else{
  341. layer.confirm('确定要禁用选择的应用授权吗?', {skin: 'layer-ext-myskin',icon: 3, title:'提示'}, function(index){
  342. $.post(
  343. "appauth/disableall",{'ids':ids},
  344. function (data) {
  345. layer.msg(data.msg, {icon: data.icon,time: 3000}, function () {
  346. window.location.reload();
  347. })
  348. }
  349. )
  350. layer.close(index);
  351. })
  352. }
  353. })
  354. $("#enable_appauth").click(function () {
  355. var ids = "";
  356. $("input:checkbox").each(function () {
  357. if($(this).not(":disabled").prop("checked")){
  358. ids += $(this).val()+",";
  359. }
  360. })
  361. if(ids == ""){
  362. layer.alert("请选择要启用的应用授权!",{skin: 'layer-ext-myskin',icon: 3, title:'提示'});
  363. }else{
  364. layer.confirm('确定要启用选择的应用授权吗?', {skin: 'layer-ext-myskin',icon: 3, title:'提示'}, function(index){
  365. $.post(
  366. "appauth/enableall",{'ids':ids},
  367. function (data) {
  368. layer.msg(data.msg, {icon: data.icon,time: 3000}, function () {
  369. window.location.reload();
  370. })
  371. }
  372. )
  373. layer.close(index);
  374. })
  375. }
  376. })
  377. $("#page_size").change(function () {
  378. var page_size = $(this).val();
  379. window.location.href = "appauth/index?page_size="+page_size;
  380. })
  381. $(".form-inline select").on("change",function(e) {
  382. if($(this).attr("id") != "page_size") {
  383. $(".form-inline").submit();
  384. }
  385. })
  386. })
  387. <?php echo '</script'; ?>
  388. >
  389. </body>
  390. </html><?php }
  391. }