Keine Beschreibung
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

customvar_index.htm 30KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561
  1. {include file="public/layout" /}
  2. <script type="text/javascript" src="__SKIN__/js/clipboard.min.js"></script>
  3. <body class="bodystyle" style="overflow-y: scroll; cursor: default; -moz-user-select: inherit;">
  4. <div id="append_parent"></div>
  5. <div id="ajaxwaitid"></div>
  6. <div class="page min-hg-c-10">
  7. {include file="system/bar" /}
  8. <div class="flexigrid">
  9. <div class="mDiv pt0">
  10. <div class="ftitle">
  11. {eq name="'Links@index'|is_check_access" value="1"}
  12. <div class="sDiv">
  13. <div class="fbutton" style="float: none;">
  14. <a href="javascript:void(0);" data-closereload="1" data-href="{:url('System/config_type', ['newframe'=>1])}" onclick="openFullframe(this, '分组管理');">
  15. <div class="adds">
  16. <span>分组管理</span>
  17. </div>
  18. </a>
  19. </div>
  20. </div>
  21. {/eq}
  22. </div>
  23. <form class="navbar-form form-inline" id="searchForm" action="{:U('System/customvar_index')}" method="get" onsubmit="layer_loading('正在处理');">
  24. {$searchform.hidden|default=''}
  25. <div class="sDiv">
  26. <div class="sDiv2">
  27. <select name="type_id" class="select" style="margin:0px 5px;">
  28. <option value="">--全部--</option>
  29. {volist name="config_type" id="vo"}
  30. <option value="{$vo.id}" {eq name="$Request.param.type_id" value="$vo.id"}selected{/eq}>{$vo.type_name}</option>
  31. {/volist}
  32. </select>
  33. </div>
  34. <div class="sDiv2">
  35. <input type="text" size="30" name="keywords" value="{$Request.param.keywords}" class="qsbox" placeholder="搜索相关数据...">
  36. <input type="submit" class="btn" value="搜索">
  37. <i class="iconfont e-sousuo"></i>
  38. </div>
  39. </div>
  40. </form>
  41. </div>
  42. <div class="hDiv">
  43. <div class="hDivBox">
  44. <table cellspacing="0" cellpadding="0" style="width: 100%">
  45. <thead>
  46. <tr>
  47. <th class="sign w20 none" axis="col0">
  48. <div class="tc"></div>
  49. </th>
  50. <th abbr="article_time" axis="col4" class="w250">
  51. <div class="tl pl10">变量名称</div>
  52. </th>
  53. <th abbr="ac_id" axis="col4" class="w150">
  54. <div class="tc">表单类型</div>
  55. </th>
  56. <th abbr="ac_id" axis="col4">
  57. <div style="padding-left: 15px;">变量值</div>
  58. </th>
  59. <th abbr="ac_id" axis="col4" class="w150">
  60. <div class="tc">分组</div>
  61. </th>
  62. <th axis="col1" class="w150">
  63. <div class="tc">操作</div>
  64. </th>
  65. </tr>
  66. </thead>
  67. </table>
  68. </div>
  69. </div>
  70. <div class="bDiv" style="height: auto; min-height: auto;">
  71. <form id="PostForm">
  72. <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
  73. <table style="width: 100%">
  74. <tbody id="tbody">
  75. {empty name="list"}
  76. <tr>
  77. <td class="no-data" align="center" axis="col0" colspan="50">
  78. <i class="fa fa-exclamation-circle"></i>没有符合条件的数据
  79. </td>
  80. </tr>
  81. {else/}
  82. {foreach name="list" item="vo" key="k" }
  83. <tr class="tr" id="tr_{$k}">
  84. <td class="sign none">
  85. <div class="w20 tc">
  86. <input type="hidden" name="attr_id[]" value="{$vo.attr_id}">
  87. <input type="hidden" name="attr_var_name[]" value="{$vo.attr_var_name}">
  88. </div>
  89. </td>
  90. <td>
  91. <div class="w250 tl">
  92. <span class="pl10">
  93. <span class="span_showhide span_attr_name">{$vo.attr_name}</span>
  94. <input type="text" name="attr_name[]" value="{$vo.attr_name}" class="w200 input_showhide" style="display: none;">
  95. </span>
  96. </div>
  97. </td>
  98. <td>
  99. <div class="w150 tc">
  100. {eq name="$vo.attr_input_type" value="4"}
  101. <span title="不允许更改">开关类型</span>
  102. <input type="hidden" name="attr_input_type[]" value="{$vo.attr_input_type}" class="w200">
  103. {else /}
  104. <span class="span_showhide span_attr_input_type">
  105. {if condition="$vo['attr_input_type'] == 2"}
  106. 多行文本
  107. {elseif condition="$vo['attr_input_type'] == 3" /}
  108. 上传图片
  109. {else /}
  110. 单行文本
  111. {/if}
  112. </span>
  113. <select name="attr_input_type[]" class="input_showhide none" onchange="change_attr_input_type(this);">
  114. <option value="0" {eq name="$vo.attr_input_type" value="0"}selected{/eq}>单行文本</option>
  115. <option value="2" {eq name="$vo.attr_input_type" value="2"}selected{/eq}>多行文本</option>
  116. <option value="3" {eq name="$vo.attr_input_type" value="3"}selected{/eq}>上传图片</option>
  117. <!-- <option value="4" {eq name="$vo.attr_input_type" value="4"}selected{/eq}>开关类型</option> -->
  118. </select>
  119. {/eq}
  120. </div>
  121. </td>
  122. <td style="width: 100%">
  123. <div style="padding-left: 15px;" class="ncap-form-default">
  124. <span class="span_showhide span_attr_value">
  125. {if condition="4 == $vo['attr_input_type']"}
  126. {notempty name='$vo.value'}
  127. 开启
  128. {else /}
  129. 关闭
  130. {/notempty}
  131. {elseif condition="3 == $vo['attr_input_type']"}
  132. <img src="{$vo.value|get_default_pic=###}" height="50">
  133. {else /}
  134. {$vo.value|default=''}
  135. {/if}
  136. </span>
  137. {switch name="$vo['attr_input_type']" }
  138. {case value="1"}
  139. {/case}
  140. {case value="2"}
  141. <textarea rows="5" cols="60" name="attr_value[]" style="height:36px;" class="input_showhide none">{$vo.value|default=''}</textarea>
  142. {/case}
  143. {case value="3"}
  144. <span class="input-file-show input_showhide" style="display: none;">
  145. <span class="show">
  146. <a id="img_a_{$vo['attr_var_name']}" class="nyroModal" rel="gal" href="{$vo.value|default='javascript:void(0);'}" target="_blank">
  147. <i id="img_i_{$vo['attr_var_name']}" class="fa fa-picture-o" {notempty name="$vo.value"}onmouseover="layer_tips=layer.tips('<img src={$vo.value|default=''} class=\'layer_tips_img\'>',this,{tips: [1, '#fff']});"{/notempty} onmouseout="layer.close(layer_tips);"></i>
  148. </a>
  149. </span>
  150. <span class="type-file-box">
  151. <input type="text" id="{$vo['attr_var_name']}" name="attr_value[]" value="{$vo.value|default=''}" class="type-file-text" autocomplete="off">
  152. <input type="button" name="button" id="button1" value="选择上传..." class="type-file-button">
  153. <input class="type-file-file" onClick="GetUploadify(1,'','allimg','{$vo['attr_var_name']}_img_call_back')" size="30" hidefocus="true" nc_type="change_site_logo" title="点击前方预览图可查看大图,点击按钮选择文件并提交表单后上传生效">
  154. </span>
  155. </span>
  156. <script type="text/javascript">
  157. function {$vo['attr_var_name']}_img_call_back(fileurl_tmp)
  158. {
  159. $("#{$vo['attr_var_name']}").val(fileurl_tmp);
  160. $("#img_a_{$vo['attr_var_name']}").attr('href', fileurl_tmp);
  161. $("#img_i_{$vo['attr_var_name']}").attr('onmouseover', "layer_tips=layer.tips('<img src="+fileurl_tmp+" class=\\'layer_tips_img\\'>',this,{tips: [1, '#fff']});");
  162. }
  163. </script>
  164. {/case}
  165. {case value="4"}
  166. <div class="onoff input_showhide" style="display: none;">
  167. <label for="{$vo['attr_var_name']}1" class="cb-enable {if condition='!empty($vo.value)'}selected{/if}">开启</label>
  168. <label for="{$vo['attr_var_name']}0" class="cb-disable {if condition='empty($vo.value)'}selected{/if}">关闭</label>
  169. <input id="{$vo['attr_var_name']}1" onclick="attr_switch(this);" value="1" type="radio" {if condition="!empty($vo.value)"} checked="checked"{/if}>
  170. <input id="{$vo['attr_var_name']}0" onclick="attr_switch(this);" value="0" type="radio" {if condition="empty($vo.value)"} checked="checked"{/if}>
  171. <input type="hidden" name="attr_value[]" value="{$vo.value|default='0'}" class="input-txt">
  172. </div>
  173. {/case}
  174. {default /}
  175. <input type="text" name="attr_value[]" value="{$vo.value|default=''}" class="input_showhide input-txt" style="display: none;">
  176. {/switch}
  177. </div>
  178. </td>
  179. <td>
  180. <div class="w150 tc">
  181. <span class="pl10">
  182. <span class="span_showhide span_attr_type_id">{$vo.type_name}</span>
  183. <select name="attr_type_id[]" class="input_showhide none">
  184. {volist name="config_type" id="type"}
  185. <option value="{$type.id}" {eq name="$vo.type_id" value="$type.id"}selected{/eq}>{$type.type_name}</option>
  186. {/volist}
  187. </select>
  188. </span>
  189. </div>
  190. </td>
  191. <td class="">
  192. <div class="w150 tl">
  193. {eq name="'System@customvar_save'|is_check_access" value="1"}
  194. <a class="btn blue" href="javascript:void(0);" onClick="customvar_edit(this);">编辑</a>
  195. {/eq}
  196. {eq name="'System@customvar_del'|is_check_access" value="1"}
  197. {eq name='$main_lang' value='$admin_lang'}
  198. <a class="btn red" href="javascript:void(0);" data-id="{$vo.id}" onClick="customvar_del(this);" {eq name="$global['web_recycle_switch']" value='1'} data-deltype="del" {else /} data-deltype="pseudo" {/eq}>删除</a>
  199. {/eq}
  200. {/eq}
  201. <a class="btn blue" href="javascript:void(0);" onclick="copyToClipBoard('{$vo.attr_var_name}', '{$vo.attr_var_title}')">标签调用</a>
  202. </div>
  203. </td>
  204. </tr>
  205. {/foreach}
  206. {/empty}
  207. </tbody>
  208. </table>
  209. </div>
  210. </form>
  211. <div class="iDiv" style="display: none;"></div>
  212. </div>
  213. <div class="tDiv">
  214. <div class="tDiv2">
  215. {eq name='$main_lang' value='$admin_lang'}
  216. <div class="fbutton">
  217. <a href="javascript:void(0);" onclick="customvar_add();">
  218. <div class="add" title="新增变量">
  219. <span class="red"><i class="fa fa-plus"></i>新增变量</span>
  220. </div>
  221. </a>
  222. </div>
  223. {/eq}
  224. <div class="fbutton">
  225. <a href="javascript:void(0);" onclick="customvar_save(this);">
  226. <div class="add" title="保存">
  227. <span class=""><i class="fa fa-save"></i>保存</span>
  228. </div>
  229. </a>
  230. </div>
  231. {include file="public/page" /}
  232. </div>
  233. <div style="clear:both"></div>
  234. </div>
  235. <!--分页位置-->
  236. </div>
  237. </div>
  238. <script type="text/javascript">
  239. $('#searchForm select[name=type_id]').change(function(){
  240. $('#searchForm').submit();
  241. });
  242. var config_type_list = {$config_type|json_encode};
  243. var attr_input_type_list = {$attr_input_type|json_encode};
  244. $(document).ready(function(){
  245. // 表格行点击选中切换
  246. $('#flexigrid > table>tbody >tr').click(function(){
  247. $(this).toggleClass('trSelected');
  248. });
  249. // 点击刷新数据
  250. $('.fa-refresh').click(function(){
  251. location.href = location.href;
  252. });
  253. });
  254. function showtext(classname){
  255. var clipboard1 = new Clipboard("."+classname);clipboard1.on("success", function(e) {layer.msg("复制成功");});clipboard1.on("error", function(e) {layer.msg("复制失败!请手动复制", {icon:5});});
  256. }
  257. // tr数,取唯一标识
  258. var tr_id = $('#tbody tr').length;
  259. function customvar_add(){
  260. var html = '';
  261. html += '<tr class="tr" id="tr_'+tr_id+'">';
  262. html += ' <td class="sign none">';
  263. html += ' <div class="w20 tc"> ';
  264. html += ' </div>';
  265. html += ' </td>';
  266. html += ' <td>';
  267. html += ' <div class="w250 tl"> ';
  268. html += ' <span class="pl10">';
  269. html += ' <input type="text" name="attr_name[]" value="" class="w200 input_showhide">';
  270. html += ' </span>';
  271. html += ' </div>';
  272. html += ' </td>';
  273. html += ' <td>';
  274. html += ' <div class="w150 tc">';
  275. html += ' <select name="attr_input_type[]" class="input_showhide" onchange="change_attr_input_type(this);">';
  276. for(var i in attr_input_type_list){
  277. html += ' <option value="'+i+'">'+attr_input_type_list[i]+'</option>';
  278. }
  279. html += ' </select>';
  280. html += ' </div>';
  281. html += ' </td>';
  282. html += ' <td style="width: 100%">';
  283. html += ' <div style="padding-left: 15px;" class="ncap-form-default">';
  284. html += ' <input type="text" name="attr_value[]" value="" class="input_showhide input-txt">';
  285. html += ' </div>';
  286. html += ' </td>';
  287. html += ' <td>';
  288. html += ' <div class="w150 tc">';
  289. html += ' <select name="attr_type_id[]" class="input_showhide">';
  290. for(var i in config_type_list){
  291. html += ' <option value="'+config_type_list[i].id+'">'+config_type_list[i].type_name+'</option>';
  292. }
  293. html += ' </select>';
  294. html += ' </div>';
  295. html += ' </td>';
  296. html += ' <td class="">';
  297. html += ' <div class="w150 tl">';
  298. html += ' <a class="btn grey" href="javascript:void(0);">编辑</a>';
  299. html += ' <a href="javascript:void(0);" class="btn red" onclick="$(\'#tr_'+tr_id+'\').remove();"><i class="fa fa-trash-o"></i>删除</a> ';
  300. html += ' <a class="btn grey" href="javascript:void(0);">标签调用</a>';
  301. html += ' </div>';
  302. html += ' </td>';
  303. html += '</tr>';
  304. if ($('input[name*=attr_name]').length == 0) {
  305. $('#tbody').html(html);
  306. } else {
  307. $('#tbody').append(html);
  308. }
  309. tr_id += 1;
  310. }
  311. function change_attr_input_type(obj)
  312. {
  313. var html = '';
  314. var attr_input_type = $(obj).val();
  315. var trObj = $(obj).parent().parent().parent();
  316. var tr_id = trObj.attr('id');
  317. if (2 == attr_input_type) {
  318. html += '<textarea rows="5" cols="60" name="attr_value[]" style="height:36px;" class="input_showhide"></textarea>';
  319. } else if (3 == attr_input_type) {
  320. html += '<span class="input-file-show input_showhide">';
  321. html += ' <span class="show">';
  322. html += ' <a id="img_a_'+tr_id+'" class="nyroModal" rel="gal" href="javascript:void(0);" target="_blank">';
  323. html += ' <i id="img_i_'+tr_id+'" class="fa fa-picture-o" onmouseover="" onmouseout="layer.close(layer_tips);"></i>';
  324. html += ' </a>';
  325. html += ' </span>';
  326. html += ' <span class="type-file-box">';
  327. html += ' <input type="text" id="web_attr_'+tr_id+'" name="attr_value[]" value="" class="type-file-text" autocomplete="off">';
  328. html += ' <input type="button" name="button" id="button1" value="选择上传..." class="type-file-button">';
  329. html += ' <input class="type-file-file" onClick="GetUploadify(1,\'\',\'allimg\',\''+tr_id+'_img_call_back\')" size="30" hidefocus="true" nc_type="change_site_logo" title="点击前方预览图可查看大图,点击按钮选择文件并提交表单后上传生效">';
  330. html += ' </span>';
  331. html += '</span>';
  332. html += '<script type="text/javascript">';
  333. html += ' function '+tr_id+'_img_call_back(fileurl_tmp)';
  334. html += ' {';
  335. html += ' $("#web_attr_'+tr_id+'").val(fileurl_tmp);';
  336. html += ' $("#img_a_'+tr_id+'").attr("href", fileurl_tmp);';
  337. html += ' $("#img_i_'+tr_id+'").attr("onmouseover", "layer_tips=layer.tips(\'<img src="+fileurl_tmp+" class=\\\\\\\'layer_tips_img\\\\\\\'>\',this,{tips: [1, \'#fff\']});");';
  338. html += ' }';
  339. html += '<\/script>';
  340. } else if (4 == attr_input_type) {
  341. html += '<div class="onoff input_showhide">';
  342. html += ' <label for="'+tr_id+'_1" class="cb-enable">开启</label>';
  343. html += ' <label for="'+tr_id+'_0" class="cb-disable selected">关闭</label>';
  344. html += ' <input id="'+tr_id+'_1" onclick="attr_switch(this);" value="1" type="radio">';
  345. html += ' <input id="'+tr_id+'_0" onclick="attr_switch(this);" value="0" type="radio" checked="checked">';
  346. html += ' <input type="hidden" name="attr_value[]" value="0" class="input-txt">';
  347. html += '</div>';
  348. } else {
  349. html += '<input type="text" name="attr_value[]" value="" class="input_showhide input-txt">';
  350. }
  351. trObj.find('.ncap-form-default').html(html);
  352. }
  353. function attr_switch(obj)
  354. {
  355. var attr_value = $(obj).val();
  356. $(obj).parent().find("input[name='attr_value[]']").val(attr_value);
  357. }
  358. function customvar_edit(obj)
  359. {
  360. var trObj = $(obj).parent().parent().parent();
  361. trObj.find('.input_showhide').show();
  362. trObj.find('.span_showhide').hide();
  363. $(obj).removeAttr('onclick').unbind('click').click(function(){customvar_save_one(this);}).css("color","red").html("保存");
  364. }
  365. //提交保存单条
  366. function customvar_save_one(obj){
  367. var trObj = $(obj).parent().parent().parent();
  368. var attr_id = trObj.find(('input[name*=attr_id]')).val();
  369. var attr_var_name = trObj.find(('input[name*=attr_var_name]')).val();
  370. var attr_name = trObj.find(('input[name*=attr_name]')).val();
  371. var attr_input_type = trObj.find(('select[name*=attr_input_type]')).val();
  372. if (attr_input_type === undefined){ //开关类型
  373. var attr_input_type = trObj.find(('input[name*=attr_input_type]')).val();
  374. }
  375. var attr_value = trObj.find(('[name*=attr_value]')).val();
  376. var attr_type_id = trObj.find(('select[name*=attr_type_id]')).val();
  377. if (attr_name === '') {
  378. layer.alert('变量名称不能为空!', {
  379. shade: layer_shade,
  380. area: ['480px', '190px'],
  381. move: false,
  382. title: '提示',
  383. btnAlign:'r',
  384. closeBtn: 3,
  385. success: function () {
  386. $(".layui-layer-content").css('text-align', 'left');
  387. }
  388. });
  389. return false;
  390. }
  391. layer_loading('正在处理');
  392. $.ajax({
  393. type : 'post',
  394. url : "{:url('System/customvar_save_one')}",
  395. data : {attr_id:attr_id,attr_var_name:attr_var_name,attr_name:attr_name,attr_input_type:attr_input_type,attr_value:attr_value,type_id:attr_type_id,_ajax:1},
  396. dataType : 'json',
  397. success : function(res){
  398. layer.closeAll();
  399. if(res.code == 1){
  400. layer.msg(res.msg, {shade: 0.1, time: 1000}, function(){
  401. // window.location.reload();
  402. });
  403. trObj.find(".span_attr_name").html(attr_name);
  404. trObj.find(".span_attr_input_type").html(attr_input_type_list[attr_input_type]);
  405. trObj.find(".span_attr_value").html(res.data.attr_value); //返回正确的值
  406. trObj.find(".span_attr_type_id").html(config_type_list[attr_type_id].type_name);
  407. trObj.find('.input_showhide').hide();
  408. trObj.find('.span_showhide').show();
  409. $(obj).removeAttr('onclick').unbind('click').click(function(){customvar_edit(this);}).css("color","#3478bc").html("编辑");
  410. }else{
  411. showErrorAlert(res.msg);
  412. }
  413. },
  414. error: function(e){
  415. layer.closeAll();
  416. showErrorAlert(e.responseText);
  417. }
  418. });
  419. }
  420. // 提交保存全部
  421. function customvar_save(obj){
  422. if ($('input[name*=attr_name]').length == 0) {
  423. layer.alert('至少新增一个自定义变量!', {
  424. shade: layer_shade,
  425. area: ['480px', '190px'],
  426. move: false,
  427. title: '提示',
  428. btnAlign:'r',
  429. closeBtn: 3,
  430. success: function () {
  431. $(".layui-layer-content").css('text-align', 'left');
  432. }
  433. });
  434. return false;
  435. } else {
  436. var is_empty = true;
  437. $('input[name*=attr_name]').each(function(index, item){
  438. if ($.trim($(item).val()) != '') {
  439. is_empty = false;
  440. return false;
  441. }
  442. });
  443. if (true == is_empty) {
  444. layer.alert('变量名称不能为空!', {
  445. shade: layer_shade,
  446. area: ['480px', '190px'],
  447. move: false,
  448. title: '提示',
  449. btnAlign:'r',
  450. closeBtn: 3,
  451. success: function () {
  452. $(".layui-layer-content").css('text-align', 'left');
  453. }
  454. });
  455. return false;
  456. }
  457. }
  458. var url = "{:url('System/customvar_save', ['_ajax'=>1])}";
  459. layer_loading('正在处理');
  460. $.ajax({
  461. type : 'post',
  462. url : url,
  463. data : $('#PostForm').serialize(),
  464. dataType : 'json',
  465. success : function(res){
  466. layer.closeAll();
  467. if(res.code == 1){
  468. layer.msg(res.msg, {icon: 6, time: 1000}, function(){
  469. // parent.gourl(res.url);
  470. window.location.href = res.url;
  471. });
  472. }else{
  473. showErrorMsg(res.msg);
  474. }
  475. },
  476. error: function(e){
  477. layer.closeAll();
  478. showErrorAlert(e.responseText);
  479. }
  480. });
  481. }
  482. function customvar_del(obj) {
  483. var deltype = $(obj).attr('data-deltype');
  484. var confirm_title = '确认删除至回收站?';
  485. if ('del' == deltype){
  486. confirm_title = '确认删除?';
  487. }
  488. layer.confirm(confirm_title, {
  489. shade: layer_shade,
  490. area: ['480px', '190px'],
  491. move: false,
  492. title: '提示',
  493. btnAlign:'r',
  494. closeBtn: 3,
  495. btn: ['确定', '取消'] ,//按钮
  496. success: function () {
  497. $(".layui-layer-content").css('text-align', 'left');
  498. }
  499. }, function(){
  500. // 确定
  501. layer_loading('正在处理');
  502. $.ajax({
  503. type : 'post',
  504. url : "{:url('System/customvar_del')}",
  505. data : {del_id:$(obj).attr('data-id'),deltype:deltype,_ajax:1},
  506. dataType : 'json',
  507. success : function(data){
  508. layer.closeAll();
  509. if(data.code == 1){
  510. layer.msg(data.msg, {icon: 6});
  511. window.location.reload();
  512. // $('#dl_'+$(obj).attr('data-attr_var_name')).remove();
  513. }else{
  514. layer.msg(data.msg, {icon: 5,time: 2000});
  515. }
  516. }
  517. });
  518. }, function(index){
  519. layer.close(index);
  520. return false;// 取消
  521. }
  522. );
  523. }
  524. /**
  525. * 代码调用js
  526. * @param id id
  527. * @param limit 条数
  528. */
  529. function copyToClipBoard(attr_var_name, attr_var_title) {
  530. var contentdiv = '<div class="dialog_content" style="margin: 0px; padding: 0px;"><dl style="padding:10px 30px;line-height:30px;"><dd>变量值:</dd>'
  531. contentdiv += '<dd><input type="text" style=" width:400px;margin-bottom:10px;" value="{'+'eyou:global name=\''+attr_var_name+'\' /}"></dd>'
  532. contentdiv += '<dd>变量名称:</dd>'
  533. contentdiv += '<dd><input type="text" style=" width:400px;margin-bottom:10px;" value="{'+'eyou:global name=\''+attr_var_title+'\' /}"></dd>'
  534. height = '250px';
  535. contentdiv += '<dd style="border-top: dotted 1px #E7E7E7; color: #F60;">请将相应标签复制并粘贴到对应模板文件中!</dd></dl></div>'
  536. layer.open({
  537. shade: layer_shade,
  538. title: '标签调用',
  539. type: 1,
  540. skin: 'layui-layer-demo',
  541. area: ['480px', height], //宽高
  542. content: contentdiv
  543. });
  544. }
  545. </script>
  546. {include file="public/footer" /}