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.

attribute_index.htm 21KB

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