attribute_index.htm 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. {include file="public/layout" /}
  2. <body class="bodystyle" style="cursor: default; -moz-user-select: inherit;">
  3. <div id="append_parent"></div>
  4. <div id="ajaxwaitid"></div>
  5. <div class="page">
  6. {include file="field/attribute_bar" /}
  7. <div class="flexigrid">
  8. <div class="mDiv">
  9. <div class="ftitle">
  10. <h3>
  11. 留言模型 - 字段列表
  12. </h3>
  13. <h5>(共{$pager->totalRows}条数据)</h5>
  14. </div>
  15. <div title="刷新数据" class="pReload"><i class="fa fa-refresh"></i></div>
  16. <form id="searchForm" class="navbar-form form-inline" action="{:url('Field/attribute_index')}" method="get" onsubmit="layer_loading('正在处理');">
  17. {$searchform.hidden|default=''}
  18. <div class="sDiv">
  19. <div class="sDiv2">
  20. {gt name='$typeidNum' value='1'}
  21. <select name="typeid" class="select" style="margin:0px 5px;">
  22. <option value="">--全部栏目--</option>
  23. {$select_html|default=''}
  24. </select>
  25. {/gt}
  26. </div>
  27. <div class="sDiv2">
  28. <input type="text" size="30" name="keywords" value="{$Request.param.keywords}" class="qsbox" placeholder="字段搜索...">
  29. <input type="submit" class="btn" value="搜索">
  30. </div>
  31. <!-- <div class="sDiv2">
  32. <input type="button" class="btn" value="重置" onClick="window.location.href='{:url('Field/attribute_index', array("typeid"=>$Request.param.typeid))}';">
  33. </div> -->
  34. </div>
  35. </form>
  36. </div>
  37. <div class="hDiv">
  38. <div class="hDivBox">
  39. <table cellspacing="0" cellpadding="0" style="width: 100%">
  40. <thead>
  41. <tr>
  42. {eq name='$main_lang' value='$admin_lang'}
  43. <th class="sign w40" axis="col0">
  44. <div class="tc">选择</div>
  45. </th>
  46. {/eq}
  47. <th abbr="article_title" axis="col3" class="w40">
  48. <div class="tc">ID</div>
  49. </th>
  50. <th abbr="article_title" axis="col3" class="">
  51. <div style="text-align: left; padding-left: 10px;" class="">字段标题</div>
  52. </th>
  53. <th abbr="article_time" axis="col6" class="w100">
  54. <div class="tc">属性类型</div>
  55. </th>
  56. <th abbr="article_time" axis="col6" class="w100">
  57. <div class="tc">所属栏目</div>
  58. </th>
  59. <th abbr="article_title" axis="col3" class="w100">
  60. <div class="tc">后台列表显示</div>
  61. </th>
  62. <th axis="col1" class="w180">
  63. <div class="tc">操作</div>
  64. </th>
  65. </tr>
  66. </thead>
  67. </table>
  68. </div>
  69. </div>
  70. <div class="bDiv" style="height: auto;">
  71. <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
  72. <table>
  73. <tbody>
  74. {empty name="list"}
  75. <tr>
  76. <td class="no-data" align="center" axis="col0" colspan="50">
  77. <i class="fa fa-exclamation-circle"></i>没有符合条件的记录
  78. </td>
  79. </tr>
  80. {else/}
  81. {volist name="list" id="vo" key="k"}
  82. <tr>
  83. {eq name='$main_lang' value='$admin_lang'}
  84. <td class="sign">
  85. <div class="tc w40">
  86. <input type="checkbox" name="ids[]" value="{$vo.attr_id}">
  87. </div>
  88. </td>
  89. {/eq}
  90. <td class="sort">
  91. <div class="tc w40">
  92. {$vo.attr_id}
  93. </div>
  94. </td>
  95. <td style="width: 100%">
  96. <div style="text-align: left; padding-left: 10px;">
  97. {eq name="$Think.const.CONTROLLER_NAME.'@attribute_edit'|is_check_access" value="1"}
  98. <a href="{:url('Field/attribute_edit',array('id'=>$vo['attr_id']))}">{$vo.attr_name}</a>
  99. {else /}
  100. {$vo.attr_name}
  101. {/eq}
  102. </div>
  103. </td>
  104. <td align="center" class="">
  105. <div class="w100 tc">
  106. {$attrInputTypeArr[$vo['attr_input_type']]|default=''}
  107. </div>
  108. </td>
  109. <td class="">
  110. <div class="w100 tc">{$vo.typename|default='<i class="red">数据出错!</i>'}</div>
  111. </td>
  112. <td>
  113. <div class="tc w100">
  114. {if condition="$vo['is_showlist'] eq 1"}
  115. <span class="yes" {eq name="$Think.const.CONTROLLER_NAME.'@edit'|is_check_access" value="1"}onClick="changeTableVal('guestbook_attribute','attr_id','{$vo.attr_id}','is_showlist',this);"{/eq} ><i class="fa fa-check-circle"></i>是</span>
  116. {else /}
  117. <span class="no" {eq name="$Think.const.CONTROLLER_NAME.'@edit'|is_check_access" value="1"}onClick="changeTableVal('guestbook_attribute','attr_id','{$vo.attr_id}','is_showlist',this);"{/eq} ><i class="fa fa-ban"></i>否</span>
  118. {/if}
  119. </div>
  120. </td>
  121. <td>
  122. <div class="w180 tc">
  123. {eq name="$Think.const.CONTROLLER_NAME.'@attribute_edit'|is_check_access" value="1"}
  124. <a href="{:url('Field/attribute_edit',array('id'=>$vo['attr_id']))}" class="btn blue"><i class="fa fa-pencil-square-o"></i>编辑</a>
  125. {/eq}
  126. {eq name="$Think.const.CONTROLLER_NAME.'@attribute_del'|is_check_access" value="1"}
  127. {eq name='$main_lang' value='$admin_lang'}
  128. <a class="btn red" href="javascript:void(0);" data-url="{:url('Field/attribute_del')}" data-id="{$vo.attr_id}" data-deltype="pseudo" onClick="delfun(this);"><i class="fa fa-trash-o"></i>删除</a>
  129. {/eq}
  130. {/eq}
  131. <a class="btn blue" href="javascript:void(0);" onclick="copyToClipBoard('{$vo.fieldname}', '{$vo.attr_id}', {$vo.attr_input_type|default='0'})">标签调用</a>
  132. </div>
  133. </td>
  134. </tr>
  135. {/volist}
  136. {/empty}
  137. </tbody>
  138. </table>
  139. </div>
  140. <div class="iDiv" style="display: none;"></div>
  141. </div>
  142. <div class="tDiv">
  143. <div class="tDiv2">
  144. {eq name='$main_lang' value='$admin_lang'}
  145. <div class="fbutton checkboxall">
  146. <input type="checkbox" onclick="javascript:$('input[name*=ids]').prop('checked',this.checked);">
  147. </div>
  148. {eq name="$Think.const.CONTROLLER_NAME.'@attribute_del'|is_check_access" value="1"}
  149. <div class="fbutton">
  150. <a onclick="batch_del(this, 'ids');" data-url="{:url('Field/attribute_del')}" data-deltype="pseudo">
  151. <div class="add" title="批量删除">
  152. <span><i class="fa fa-close"></i>批量删除</span>
  153. </div>
  154. </a>
  155. </div>
  156. {/eq}
  157. {eq name="$Think.const.CONTROLLER_NAME.'@attribute_add'|is_check_access" value="1"}
  158. <div class="fbutton">
  159. <a href="javascript:void(0);" onclick="attribute_add(this);" data-href="{:url('Field/attribute_add', array('typeid'=>$Request.param.typeid))}">
  160. <div class="add" title="新增属性">
  161. <span class="red"><i class="fa fa-plus"></i>新增属性</span>
  162. </div>
  163. </a>
  164. </div>
  165. <script type="text/javascript">
  166. function attribute_add(obj)
  167. {
  168. var count = "{$arctypeCount|default='0'}";
  169. count = parseInt(count);
  170. if (0 == count) {
  171. layer.alert('请先建立留言栏目,并关联留言模型后再操作!', {icon: 5, title:false});
  172. } else {
  173. var href = $(obj).data('href');
  174. window.location.href = href;
  175. }
  176. }
  177. </script>
  178. {/eq}
  179. {/eq}
  180. </div>
  181. <div style="clear:both"></div>
  182. </div>
  183. <!--分页位置-->
  184. {$page}
  185. </div>
  186. </div>
  187. <script type="text/javascript">
  188. $(document).ready(function(){
  189. // 表格行点击选中切换
  190. $('#flexigrid > table>tbody >tr').click(function(){
  191. $(this).toggleClass('trSelected');
  192. });
  193. // 点击刷新数据
  194. $('.fa-refresh').click(function(){
  195. location.href = location.href;
  196. });
  197. $('#searchForm select[name=typeid]').change(function(){
  198. $('#searchForm').submit();
  199. });
  200. });
  201. /**
  202. * 代码调用js
  203. * @param id id
  204. * @param limit 条数
  205. */
  206. function copyToClipBoard(fieldname, attr_id, attr_input_type) {
  207. if (0 == attr_input_type) { // 单行文本
  208. var liststr = "<input type='text' id='"+fieldname+"' name='{$"+"field."+fieldname+"}'>";
  209. var contentdiv = '<div class="dialog_content" style="margin: 0px; padding: 0px;"><dl style="padding:10px 30px;line-height:30px;"><dd>属性提示文字:</dd>';
  210. contentdiv += '<dd><input type="text" style=" width:400px;margin-bottom:10px;" value="{$'+'field.itemname_'+attr_id+'}"></dd>';
  211. contentdiv += '<dd>表单调用代码:</dd>';
  212. contentdiv += '<dd><input type="text" style="width:400px;" value="' + liststr + '" /></dd>';
  213. height = '250px';
  214. }
  215. else if (1 == attr_input_type) { // 下拉框
  216. var liststr = "<select name='{$"+"field."+fieldname+"}' id='"+fieldname+"'>\r\n <option value='无'>无</option>\r\n {eyou:volist name='$"+"field.options_"+attr_id+"' id='vo'}\r\n <option value='{$"+"vo.value}'>{$"+"vo.value}</option>\r\n {/eyou:volist"+"}\r\n</select>";
  217. var contentdiv = '<div class="dialog_content" style="margin: 0px; padding: 0px;"><dl style="padding:10px 30px;line-height:30px;"><dd>属性提示文字:</dd>';
  218. contentdiv += '<dd><input type="text" style=" width:400px;margin-bottom:10px;" value="{$'+'field.itemname_'+attr_id+'}"></dd>';
  219. contentdiv += '<dd>表单调用代码:</dd>';
  220. contentdiv += '<dd><textarea rows="4" cols="60" style="width:400px;height:110px;">' + liststr + '</textarea></dd>';
  221. height = '330px';
  222. }
  223. else if (2 == attr_input_type) { // 多行文本
  224. var liststr = "<textarea id='"+fieldname+"' name='{$"+"field."+fieldname+"}'></textarea>";
  225. var contentdiv = '<div class="dialog_content" style="margin: 0px; padding: 0px;"><dl style="padding:10px 30px;line-height:30px;"><dd>属性提示文字:</dd>';
  226. contentdiv += '<dd><input type="text" style=" width:400px;margin-bottom:10px;" value="{$'+'field.itemname_'+attr_id+'}"></dd>';
  227. contentdiv += '<dd>表单调用代码:</dd>';
  228. contentdiv += '<dd><input type="text" style="width:400px;" value="' + liststr + '" /></dd>';
  229. height = '300px';
  230. }
  231. else if (3 == attr_input_type) { // 单选框
  232. var liststr = "{eyou:volist name='$"+"field.options_"+attr_id+"' id='vo'}\r\n <label><input type='radio' id='"+fieldname+"' name='{$"+"field."+fieldname+"}' value='{$"+"vo.value}'>{$"+"vo.value}</label>\r\n{/eyou:volist"+"}";
  233. var contentdiv = '<div class="dialog_content" style="margin: 0px; padding: 0px;"><dl style="padding:10px 30px;line-height:30px;"><dd>属性提示文字:</dd>';
  234. contentdiv += '<dd><input type="text" style=" width:400px;margin-bottom:10px;" value="{$'+'field.itemname_'+attr_id+'}"></dd>';
  235. contentdiv += '<dd>表单调用代码:</dd>';
  236. contentdiv += '<dd><textarea rows="4" cols="60" style="width:400px;height:80px;">' + liststr + '</textarea></dd>';
  237. height = '300px';
  238. }
  239. else if (4 == attr_input_type) { // 多选框
  240. var liststr = "{eyou:volist name='$"+"field.options_"+attr_id+"' id='vo'}\r\n <label><input type='checkbox' name='{$"+"field."+fieldname+"}' value='{$"+"vo.value}'>{$"+"vo.value}</label>\r\n{/eyou:volist"+"}";
  241. var contentdiv = '<div class="dialog_content" style="margin: 0px; padding: 0px;"><dl style="padding:10px 30px;line-height:30px;"><dd>属性提示文字:</dd>';
  242. contentdiv += '<dd><input type="text" style=" width:400px;margin-bottom:10px;" value="{$'+'field.itemname_'+attr_id+'}"></dd>';
  243. contentdiv += '<dd>表单调用代码:</dd>';
  244. contentdiv += '<dd><textarea rows="4" cols="60" style="width:400px;height:80px;">' + liststr + '</textarea></dd>';
  245. height = '300px';
  246. }
  247. else if (5 == attr_input_type) { // 上传图片
  248. var liststr = "<input type='file' name='{$"+"field."+fieldname+"}' value=''>";
  249. var contentdiv = '<div class="dialog_content" style="margin: 0px; padding: 0px;"><dl style="padding:10px 30px;line-height:30px;"><dd>属性提示文字:</dd>';
  250. contentdiv += '<dd><input type="text" style=" width:400px;margin-bottom:10px;" value="{$'+'field.itemname_'+attr_id+'}"></dd>';
  251. contentdiv += '<dd>表单调用代码:</dd>';
  252. contentdiv += '<dd><input type="text" style="width:400px;" value="' + liststr + '" /></dd>';
  253. contentdiv += '<dd style="border-top: dotted 1px #E7E7E7; color:red; ">特别注意:请在前台模板的留言标签里追加 {$'+'field.formhidden} 到 &lt;form &gt;表单里,<a href="JavaScript:void(0);" onclick="click_to_eyou_1575506523('+"'https://www.eyoucms.com/plus/view.php?aid=8378','单张图类型教程说明'"+')">详细说明</a>。</dd>'
  254. height = '300px';
  255. } else if (8 == attr_input_type) { // 上传附件
  256. var liststr = "<input type='file' name='{$"+"field."+fieldname+"}' value=''>";
  257. var contentdiv = '<div class="dialog_content" style="margin: 0px; padding: 0px;"><dl style="padding:10px 30px;line-height:30px;"><dd>属性提示文字:</dd>';
  258. contentdiv += '<dd><input type="text" style=" width:400px;margin-bottom:10px;" value="{$'+'field.itemname_'+attr_id+'}"></dd>';
  259. contentdiv += '<dd>表单调用代码:</dd>';
  260. contentdiv += '<dd><input type="text" style="width:400px;" value="' + liststr + '" /></dd>';
  261. contentdiv += '<dd style="border-top: dotted 1px #E7E7E7; color:red; ">特别注意:请在前台模板的留言标签里追加 {$'+'field.formhidden} 到 &lt;form &gt;表单里。</dd>'
  262. height = '300px';
  263. }
  264. else {
  265. var contentdiv = '<div class="dialog_content" style="margin: 0px; padding: 0px;"><dl style="padding:10px 30px;line-height:30px;"><dd>属性提示文字:</dd>'
  266. contentdiv += '<dd><input type="text" style=" width:400px;margin-bottom:10px;" value="{$'+'field.itemname_'+attr_id+'}"></dd>'
  267. contentdiv += '<dd>字段名称:</dd>'
  268. contentdiv += '<dd><input type="text" style=" width:400px;margin-bottom:10px;" value="{$'+'field.'+fieldname+'}"></dd>'
  269. height = '250px';
  270. }
  271. contentdiv += '<dd style="border-top: dotted 1px #E7E7E7; color: #F60;">请将相应标签复制并粘贴到对应模板文件中!</dd></dl></div>'
  272. layer.open({
  273. title: '标签调用',
  274. type: 1,
  275. skin: 'layui-layer-demo',
  276. area: ['480px', height], //宽高
  277. content: contentdiv
  278. });
  279. }
  280. </script>
  281. {include file="public/footer" /}