No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

attribute_index.htm 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. {include file="public/layout" /}
  2. <body class="bodystyle">
  3. <div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
  4. <div id="append_parent"></div>
  5. <div id="ajaxwaitid"></div>
  6. <div class="page">
  7. <div class="fixed-bar">
  8. <div class="item-title">
  9. <a class="back_xin" href="{:url('Channeltype/index')}" title="返回"><i class="iconfont e-fanhui"></i></a>
  10. <div class="subject">
  11. <h3>留言模型</h3>
  12. <h5></h5>
  13. </div>
  14. <ul class="tab-base nc-row">
  15. {eq name="'Channeltype@edit'|is_check_access" value="1"}
  16. <li><a href="{:url('Channeltype/edit', ['id'=>8])}" {eq name='$Request.action' value='edit'}class="current"{/eq}><span>模型编辑</span></a></li>
  17. {/eq}
  18. {eq name="'Channeltype@edit'|is_check_access" value="1"}
  19. <li><a href="{:url('Field/attribute_index')}" {eq name='$Request.action' value='attribute_index'}class="current"{/eq}><span>字段管理</span></a></li>
  20. {/eq}
  21. </ul>
  22. </div>
  23. </div>
  24. <div class="flexigrid">
  25. <div class="mDiv pt0">
  26. <div class="ftitle">
  27. {eq name="$Think.const.CONTROLLER_NAME.'@attribute_add'|is_check_access" value="1"}
  28. <div class="fbutton">
  29. <a href="javascript:void(0);" onclick="attribute_add(this);" data-href="{:url('Field/attribute_add', array('typeid'=>$Request.param.typeid))}">
  30. <div class="add">
  31. <span><i class="layui-icon layui-icon-addition"></i>新增字段</span>
  32. </div>
  33. </a>
  34. </div>
  35. <script type="text/javascript">
  36. function attribute_add(obj)
  37. {
  38. var count = "{$arctypeCount|default='0'}";
  39. count = parseInt(count);
  40. if (0 == count) {
  41. layer.alert('请先建立留言栏目,并关联留言模型后再操作!', {icon: 5, title:false});
  42. } else {
  43. openFullframe(obj, '新增字段', '100%', '100%');
  44. }
  45. }
  46. </script>
  47. {/eq}
  48. </div>
  49. <form class="navbar-form form-inline" id="searchForm" action="{:url('Field/attribute_index')}" method="get" onsubmit="layer_loading('正在处理');">
  50. {$searchform.hidden|default=''}
  51. <div class="sDiv">
  52. <div class="sDiv2">
  53. {gt name='$typeidNum' value='1'}
  54. <select name="typeid" class="select" style="margin:0px 5px;">
  55. <option value="">--全部栏目--</option>
  56. {$select_html|default=''}
  57. </select>
  58. {/gt}
  59. </div>
  60. <div class="sDiv2">
  61. <input type="text" size="30" name="keywords" value="{$Request.param.keywords}" class="qsbox" placeholder="字段搜索...">
  62. <input type="submit" class="btn" value="搜索">
  63. <i class="iconfont e-sousuo"></i>
  64. </div>
  65. </div>
  66. </form>
  67. </div>
  68. <div class="hDiv">
  69. <div class="hDivBox">
  70. <table cellspacing="0" cellpadding="0" style="width: 100%">
  71. <thead>
  72. <tr>
  73. {eq name='$main_lang' value='$admin_lang'}
  74. <th class="sign w40" axis="col0">
  75. <div class="tc">选择</div>
  76. </th>
  77. {/eq}
  78. <th abbr="article_title" axis="col3" class="w40">
  79. <div class="tc">ID</div>
  80. </th>
  81. <th abbr="article_title" axis="col3" class="">
  82. <div style="text-align: left; padding-left: 10px;" class="">字段名称</div>
  83. </th>
  84. <th abbr="article_time" axis="col6" class="w100">
  85. <div class="tc">字段类型</div>
  86. </th>
  87. <th abbr="article_time" axis="col6" class="w100">
  88. <div class="tc">所属栏目</div>
  89. </th>
  90. <th abbr="article_title" axis="col3" class="w100">
  91. <div class="tc">后台列表显示</div>
  92. </th>
  93. <th axis="col1" class="w180">
  94. <div class="tc">操作</div>
  95. </th>
  96. </tr>
  97. </thead>
  98. </table>
  99. </div>
  100. </div>
  101. <div class="bDiv" style="height: auto;">
  102. <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
  103. <table>
  104. <tbody>
  105. {empty name="list"}
  106. <tr>
  107. <td class="no-data" align="center" axis="col0" colspan="50">
  108. <div class="no_row">
  109. <div class="no_pic"><img src="__SKIN__/images/null-data.png"></div>
  110. </div>
  111. </td>
  112. </tr>
  113. {else/}
  114. {volist name="list" id="vo" key="k"}
  115. <tr>
  116. {eq name='$main_lang' value='$admin_lang'}
  117. <td class="sign">
  118. <div class="tc w40">
  119. <input type="checkbox" autocomplete="off" name="ids[]" value="{$vo.attr_id}">
  120. </div>
  121. </td>
  122. {/eq}
  123. <td class="sort">
  124. <div class="tc w40">
  125. {$vo.attr_id}
  126. </div>
  127. </td>
  128. <td style="width: 100%">
  129. <div style="text-align: left; padding-left: 10px;">
  130. {eq name="$Think.const.CONTROLLER_NAME.'@attribute_edit'|is_check_access" value="1"}
  131. <a href="javascript:void(0);" data-href="{:url('Field/attribute_edit',array('id'=>$vo['attr_id']))}" onclick="openFullframe(this, '编辑字段', '100%', '100%');">{$vo.attr_name}</a>
  132. {else /}
  133. {$vo.attr_name}
  134. {/eq}
  135. </div>
  136. </td>
  137. <td align="center" class="">
  138. <div class="w100 tc">
  139. {$attrInputTypeArr[$vo['attr_input_type']]|default=''}
  140. </div>
  141. </td>
  142. <td class="">
  143. <div class="w100 tc">{$vo.typename|default='<i class="red">数据出错!</i>'}</div>
  144. </td>
  145. <td>
  146. <div class="tc w100">
  147. {if condition="$vo['is_showlist'] eq 1"}
  148. <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>
  149. {else /}
  150. <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>
  151. {/if}
  152. </div>
  153. </td>
  154. <td>
  155. <div class="w180 tc">
  156. {eq name="$Think.const.CONTROLLER_NAME.'@attribute_edit'|is_check_access" value="1"}
  157. <a href="javascript:void(0);" data-href="{:url('Field/attribute_edit',array('id'=>$vo['attr_id']))}" onclick="openFullframe(this, '编辑字段', '100%', '100%');" class="btn blue">编辑</a>
  158. <i></i>
  159. {/eq}
  160. {eq name="$Think.const.CONTROLLER_NAME.'@attribute_del'|is_check_access" value="1"}
  161. {eq name='$main_lang' value='$admin_lang'}
  162. <a class="btn red" href="javascript:void(0);" data-url="{:url('Field/attribute_del')}" data-id="{$vo.attr_id}" {eq name="$global['web_recycle_switch']" value='1'} data-deltype="del" {else /} data-deltype="pseudo" {/eq} onClick="delfun(this);">删除</a>
  163. <i></i>
  164. {/eq}
  165. {/eq}
  166. <a class="btn blue" href="javascript:void(0);" onclick="copyToClipBoard('{$vo.fieldname}', '{$vo.attr_id}', {$vo.attr_input_type|default='0'})">标签调用</a>
  167. </div>
  168. </td>
  169. </tr>
  170. {/volist}
  171. {/empty}
  172. </tbody>
  173. </table>
  174. </div>
  175. <div class="iDiv" style="display: none;"></div>
  176. </div>
  177. <div class="tDiv">
  178. <div class="tDiv2">
  179. {eq name='$main_lang' value='$admin_lang'}
  180. <div class="fbutton checkboxall">
  181. <input type="checkbox" autocomplete="off" onclick="javascript:$('input[name*=ids]').prop('checked',this.checked);">
  182. </div>
  183. {eq name="$Think.const.CONTROLLER_NAME.'@attribute_del'|is_check_access" value="1"}
  184. <div class="fbutton">
  185. <a onclick="batch_del(this, 'ids');" data-url="{:url('Field/attribute_del')}" {eq name="$global['web_recycle_switch']" value='1'} data-deltype="del" {else /} data-deltype="pseudo" {/eq} class="layui-btn layui-btn-primary">批量删除</a>
  186. </div>
  187. {/eq}
  188. {/eq}
  189. {include file="public/page" /}
  190. </div>
  191. <div style="clear:both"></div>
  192. </div>
  193. </div>
  194. </div>
  195. <script type="text/javascript">
  196. $(document).ready(function(){
  197. // 表格行点击选中切换
  198. $('#flexigrid > table>tbody >tr').click(function(){
  199. $(this).toggleClass('trSelected');
  200. });
  201. $('#searchForm select[name=typeid]').change(function(){
  202. $('#searchForm').submit();
  203. });
  204. });
  205. /**
  206. * 代码调用js
  207. * @param id id
  208. * @param limit 条数
  209. */
  210. function copyToClipBoard(fieldname, attr_id, attr_input_type) {
  211. if (0 == attr_input_type) { // 单行文本
  212. var liststr = "<input type='text' id='"+fieldname+"' name='{$"+"field."+fieldname+"}'>";
  213. var contentdiv = '<div class="dialog_content" style="margin: 0px; padding: 0px;"><dl style="padding:10px 30px;line-height:30px;"><dd>字段名称:</dd>';
  214. contentdiv += '<dd><input type="text" style=" width:400px;margin-bottom:10px;" value="{$'+'field.itemname_'+attr_id+'}"></dd>';
  215. contentdiv += '<dd>表单调用代码:</dd>';
  216. contentdiv += '<dd><input type="text" style="width:400px;" value="' + liststr + '" /></dd>';
  217. height = '250px';
  218. }
  219. else if (1 == attr_input_type) { // 下拉框
  220. 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>";
  221. var contentdiv = '<div class="dialog_content" style="margin: 0px; padding: 0px;"><dl style="padding:10px 30px;line-height:30px;"><dd>字段名称:</dd>';
  222. contentdiv += '<dd><input type="text" style=" width:400px;margin-bottom:10px;" value="{$'+'field.itemname_'+attr_id+'}"></dd>';
  223. contentdiv += '<dd>表单调用代码:</dd>';
  224. contentdiv += '<dd><textarea rows="4" cols="60" style="width:400px;height:110px;">' + liststr + '</textarea></dd>';
  225. height = '330px';
  226. }
  227. else if (2 == attr_input_type) { // 多行文本
  228. var liststr = "<textarea id='"+fieldname+"' name='{$"+"field."+fieldname+"}'></textarea>";
  229. var contentdiv = '<div class="dialog_content" style="margin: 0px; padding: 0px;"><dl style="padding:10px 30px;line-height:30px;"><dd>字段名称:</dd>';
  230. contentdiv += '<dd><input type="text" style=" width:400px;margin-bottom:10px;" value="{$'+'field.itemname_'+attr_id+'}"></dd>';
  231. contentdiv += '<dd>表单调用代码:</dd>';
  232. contentdiv += '<dd><input type="text" style="width:400px;" value="' + liststr + '" /></dd>';
  233. height = '300px';
  234. }
  235. else if (3 == attr_input_type) { // 单选框
  236. 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"+"}";
  237. var contentdiv = '<div class="dialog_content" style="margin: 0px; padding: 0px;"><dl style="padding:10px 30px;line-height:30px;"><dd>字段名称:</dd>';
  238. contentdiv += '<dd><input type="text" style=" width:400px;margin-bottom:10px;" value="{$'+'field.itemname_'+attr_id+'}"></dd>';
  239. contentdiv += '<dd>表单调用代码:</dd>';
  240. contentdiv += '<dd><textarea rows="4" cols="60" style="width:400px;height:80px;">' + liststr + '</textarea></dd>';
  241. height = '300px';
  242. }
  243. else if (4 == attr_input_type) { // 多选框
  244. 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"+"}";
  245. var contentdiv = '<div class="dialog_content" style="margin: 0px; padding: 0px;"><dl style="padding:10px 30px;line-height:30px;"><dd>字段名称:</dd>';
  246. contentdiv += '<dd><input type="text" style=" width:400px;margin-bottom:10px;" value="{$'+'field.itemname_'+attr_id+'}"></dd>';
  247. contentdiv += '<dd>表单调用代码:</dd>';
  248. contentdiv += '<dd><textarea rows="4" cols="60" style="width:400px;height:80px;">' + liststr + '</textarea></dd>';
  249. height = '300px';
  250. }
  251. else if (5 == attr_input_type) { // 上传图片
  252. var liststr = "<input type='file' name='{$"+"field."+fieldname+"}' value=''>";
  253. var contentdiv = '<div class="dialog_content" style="margin: 0px; padding: 0px;"><dl style="padding:10px 30px;line-height:30px;"><dd>字段名称:</dd>';
  254. contentdiv += '<dd><input type="text" style=" width:400px;margin-bottom:10px;" value="{$'+'field.itemname_'+attr_id+'}"></dd>';
  255. contentdiv += '<dd>表单调用代码:</dd>';
  256. contentdiv += '<dd><input type="text" style="width:400px;" value="' + liststr + '" /></dd>';
  257. 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&origin_eycms=1','单张图类型教程说明'"+')">详细说明</a>。</dd>'
  258. height = '300px';
  259. } else if (8 == attr_input_type) { // 上传附件
  260. var liststr = "<input type='file' name='{$"+"field."+fieldname+"}' value=''>";
  261. var contentdiv = '<div class="dialog_content" style="margin: 0px; padding: 0px;"><dl style="padding:10px 30px;line-height:30px;"><dd>字段名称:</dd>';
  262. contentdiv += '<dd><input type="text" style=" width:400px;margin-bottom:10px;" value="{$'+'field.itemname_'+attr_id+'}"></dd>';
  263. contentdiv += '<dd>表单调用代码:</dd>';
  264. contentdiv += '<dd><input type="text" style="width:400px;" value="' + liststr + '" /></dd>';
  265. contentdiv += '<dd style="border-top: dotted 1px #E7E7E7; color:red; ">特别注意:请在前台模板的留言标签里追加 {$'+'field.formhidden} 到 &lt;form &gt;表单里。</dd>'
  266. height = '300px';
  267. }else if (9 == attr_input_type) { // 区域联动
  268. var liststr = "<!--一级-->\n<select {$"+"field.first_id_"+attr_id+"}>\r\n <option value=''>请选择</option>\r\n {eyou:volist name='$"+"field.options_"+attr_id+"' id='vo'}\r\n <option value='{$"+"vo.id}'>{$"+"vo.name}</option>\r\n {/eyou:volist"+"}\r\n</select>\n"+
  269. "<!--二级-->\n<select {$"+"field.second_id_"+attr_id+"}></select>\n" +
  270. "<!--三级-->\n<select {$"+"field.third_id_"+attr_id+"}></select>\n" +
  271. "{$"+"field.hidden_"+attr_id+"}";
  272. var contentdiv = '<div class="dialog_content" style="margin: 0px; padding: 0px;"><dl style="padding:10px 30px;line-height:30px;"><dd>字段名称:</dd>';
  273. contentdiv += '<dd><input type="text" style=" width:400px;margin-bottom:10px;" value="{$'+'field.itemname_'+attr_id+'}"></dd>';
  274. contentdiv += '<dd>表单调用代码:</dd>';
  275. contentdiv += '<dd><textarea rows="4" cols="60" style="width:400px;height:180px;">' + liststr + '</textarea></dd>';
  276. contentdiv += '<dd style="border-top: dotted 1px #E7E7E7; color:red; ">特别注意:请在前台模板的留言标签里追加 {$'+'field.hidden_'+attr_id+'} 到 &lt;form &gt;表单里。</dd>';
  277. height = '460px';
  278. }else if (10 == attr_input_type) { // 时间
  279. var liststr = "<input type=\"text\" name='{$"+"field."+fieldname+"}' id='{$"+"field."+fieldname+"}' placeholder='{$"+"field.itemname_"+attr_id+"}' autocomplete=\"off\">\n\n" +
  280. "{"+"eyou:static file='/public/plugins/laydate-v5.3.1/laydate.js' /}\n" +
  281. "<script type='text/javascript'>\n" +
  282. " laydate.render({\n" +
  283. " elem: '#{$"+"field."+fieldname+"}'\n" +
  284. " ,type: 'datetime'\n" +
  285. " });\n" +
  286. "<"+"/script>";
  287. var contentdiv = '<div class="dialog_content" style="margin: 0px; padding: 0px;"><dl style="padding:10px 30px;line-height:30px;"><dd>字段名称:</dd>';
  288. contentdiv += '<dd><input type="text" style=" width:400px;margin-bottom:10px;" value="{$'+'field.itemname_'+attr_id+'}"></dd>';
  289. contentdiv += '<dd>表单调用代码:</dd>';
  290. contentdiv += '<dd><textarea rows="4" cols="60" style="width:400px;height:180px;">' + liststr + '</textarea></dd>';
  291. contentdiv += '<dd style="border-top: dotted 1px #E7E7E7; color:red; ">特别注意:在弹窗表单里,可能遇到日期插件无法使用,请自行更换其他日期插件处理,谢谢。</dd>';
  292. height = '470px';
  293. }
  294. else {
  295. var contentdiv = '<div class="dialog_content" style="margin: 0px; padding: 0px;"><dl style="padding:10px 30px;line-height:30px;"><dd>字段名称:</dd>'
  296. contentdiv += '<dd><input type="text" style=" width:400px;margin-bottom:10px;" value="{$'+'field.itemname_'+attr_id+'}"></dd>'
  297. contentdiv += '<dd>字段名称:</dd>'
  298. contentdiv += '<dd><input type="text" style=" width:400px;margin-bottom:10px;" value="{$'+'field.'+fieldname+'}"></dd>'
  299. height = '250px';
  300. }
  301. contentdiv += '<dd style="border-top: dotted 1px #E7E7E7; color: #F60;">请将相应标签复制并粘贴到对应模板文件中!</dd></dl></div>'
  302. layer.open({
  303. shade: layer_shade,
  304. title: '标签调用',
  305. type: 1,
  306. skin: 'layui-layer-demo',
  307. area: ['480px', height], //宽高
  308. content: contentdiv
  309. });
  310. }
  311. </script>
  312. {include file="public/footer" /}