formbuilder.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. <!DOCTYPE html>
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  6. <meta http-equiv="Pragma" content="no-cache" />
  7. <meta http-equiv="Cache-Control" content="no-cache" />
  8. <meta http-equiv="Expires" content="0" />
  9. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  10. <title>表单构建器改版</title>
  11. <link href="../../AFrontEnd/css/animate.css" rel="stylesheet" />
  12. <link href="../../AFrontEnd/css/fontawesome/css/font-awesome.css" rel="stylesheet" />
  13. <link href="../../AFrontEnd/css/bootstrap.css" rel="stylesheet" />
  14. <link href="../../AFrontEnd/css/style.min.css" rel="stylesheet" />
  15. <link href="../../AFrontEnd/plugins/codemirror/codemirror.css" rel="stylesheet" />
  16. <link href="../../AFrontEnd/plugins/codemirror/ambiance.css" rel="stylesheet" />
  17. <link href="css/summernote.css" rel="stylesheet" />
  18. <link href="css/summernote-bs3.css?v=121" rel="stylesheet" />
  19. <script>document.write("<link href='../../AFrontEnd/css/special.css?time=" + new Date().getTime() + "' rel='stylesheet'>");</script>
  20. <script>document.write("<link href='css/formbuilder.css?time=" + new Date().getTime() + "' rel='stylesheet'>");</script>
  21. </head>
  22. <body>
  23. <div class="fb-left">
  24. <div class="sp-tab" id="sptabLeftCode">
  25. <ul class="sp-tab-menu">
  26. <li class="sp-tab-current sp-text-left" style="width:50%;">&nbsp;<i class="fa fa-th-list"></i>&nbsp;主表字段</li>
  27. <li class="sp-text-right" style="width: 50%;"><i class="fa fa-list-ul"></i>&nbsp;子表字段&nbsp;</li>
  28. </ul>
  29. <div class="sp-tab-box">
  30. <div class="sp-tab-current">
  31. <div class="sp-page" id="controlDivPart">
  32. </div>
  33. </div>
  34. <div class="sp-tab-hide" id="controlDivPartSubTable">
  35. <!--<span data-type="" data-code="" data-showtype="" id="spandown_" class="" data-class="" data-style="" data-theme="" data-required="" data-format=""></span>-->
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. <div class="fb-center">
  41. <div class="sp-list-type-gray">
  42. <span class="sp-list-type-title sp-list-type-active" id="btnStartDesign_tab" onclick="btnStartDesign(this)" data-href="#formBuilderTextareaPart"><i class="fa fa-table"></i>&nbsp;表单设计</span>
  43. <span class="sp-list-type-title" onclick="btnViewCode(this)" data-href="#formBuilderCodePart"><i class="fa fa-clipboard"></i>&nbsp;表单源码</span>
  44. <!--<span class="sp-list-type-title" onclick="btnViewDesign(this)" data-href="#formBuilderDesignPart"><i class="fa fa-arrows-alt"></i>&nbsp;表单预览</span>-->
  45. <span class="sp-list-type-right">
  46. <span onclick="btnGoBack()" class="sp-btn-gray-outline sp-btn-sm"><i class="fa fa-reply-all"></i>&nbsp;返回</span>
  47. <span onclick="btn_spbldClear()" class="sp-btn-gray-outline sp-btn-sm"><i class="fa fa-trash"></i>&nbsp;清空表单</span>
  48. <span onclick="btnViewDesign(this)" data-href="#formBuilderDesignPart" class="sp-btn-gray-outline sp-btn-sm"><i class="fa fa-arrows-alt"></i>&nbsp;预览</span>
  49. <span class="sp-btn-blue-outline sp-btn-sm" id="btnSaveHtmlFileSpan" onclick="btnSaveHtmlFile()" style="display:none;"><i class="fa fa-check"></i>&nbsp;保存表单</span>
  50. </span>
  51. </div>
  52. <div class="sp-page sp-mt-10 sp-form-builder" id="formBuilderTextareaPart">
  53. <textarea id="formBuilderTextarea"></textarea>
  54. </div>
  55. <div class="sp-page sp-mt-10 sp-form-builder" style="display:none;" id="formBuilderCodePart">
  56. </div>
  57. </div>
  58. <div class="fb-right">
  59. <div class="sp-page-title"><i class="fa fa-cog"></i>&nbsp;整体设置</div>
  60. <div class="sp-line-gray"></div>
  61. <span class="sp-lh-24 sp-color-gray">表单主题色调</span>
  62. <div class="sp-lh-26" style="width:80%; margin-left:2%;">
  63. <span class="sp-checkbox-tabs" id="chb_selectRedTheme">红色</span>
  64. </div>
  65. <div class="sp-lh-26" style="width:80%; margin-left:2%;">
  66. <span class="sp-checkbox-tabs" id="chb_selectRedTheme_noneOutLine">无外层边框</span>
  67. </div>
  68. <div class="sp-line-gray"></div>
  69. <!--start--常用文本区域设置-->
  70. <span class="sp-lh-24 sp-color-gray fb-textbox-part">必填设置</span>
  71. <div class="sp-lh-24 sp-checkbox-blue fb-textbox-part"><label><input type="checkbox" id="fucbtnRequire" />这个是必填项</label></div>
  72. <span class="sp-lh-24 sp-color-gray fb-textbox-part sp-mt-10">填写设置</span>
  73. <div class="sp-lh-22 sp-checkbox-blue fb-textbox-part"><label><input type="checkbox" />限制字数</label></div>
  74. <div class="sp-lh-26 fb-textbox-part">
  75. <div class="sp-page" style="width:80%; margin-left:16%;">
  76. </div>
  77. </div>
  78. <div class="sp-lh-22 sp-checkbox-blue fb-textbox-part sp-mt-10"><label><input type="checkbox" id="funbtnuseRegular" />使用正则校验</label></div>
  79. <div class="sp-lh-26 fb-textbox-part" id="regularSelectPart" style="display:none;">
  80. <div class="sp-page" style="width:80%; margin-left:16%;">
  81. <select class="sp-select">
  82. <option value="0">--请选择--</option>
  83. <option value="sp-phone">手机号</option>
  84. <option value="sp-tel">座机号</option>
  85. <option value="sp-card">身份证号</option>
  86. <option value="sp-email">邮箱</option>
  87. <option value="sp-postcode">邮编</option>
  88. <option value="sp-fax">传真</option>
  89. <option value="sp-num">数字</option>
  90. <option value="sp-decimal">数字和小数</option>
  91. <option value="sp-url">网址</option>
  92. <option value="sp-ip">ip地址</option>
  93. <option value="sp-chinese">中文</option>
  94. </select>
  95. </div>
  96. </div>
  97. <!--end--常用文本区域设置-->
  98. <!--start--单选多选区域设置-->
  99. <!--d单选按钮区域-->
  100. <span class="sp-lh-24 sp-color-gray fb-radio-part">皮肤设置</span>
  101. <div class="sp-lh-26 sp-checkbox-blue fb-radio-part">
  102. <label><input type="checkbox" id="chb_selectRadioStyle" />选择皮肤类型</label>
  103. </div>
  104. <div class="sp-lh-26 fb-radio-part" id="selectRadioStylePart" style="width:80%; margin-left:16%; display:none;">
  105. <select class="sp-select">
  106. <option value="sp-radio-none">无皮肤</option>
  107. <option value="sp-radio-default">灰色</option>
  108. <option value="sp-radio-blue">蓝色</option>
  109. <option value="sp-radio-orange">橙色</option>
  110. </select>
  111. </div>
  112. <!--d多选按钮区域-->
  113. <span class="sp-lh-24 sp-color-gray fb-checkbox-part">皮肤设置</span>
  114. <div class="sp-lh-26 sp-checkbox-blue fb-checkbox-part">
  115. <label><input type="checkbox" id="chb_selectCheckboxStyle" />选择皮肤类型</label>
  116. </div>
  117. <div class="sp-lh-26 fb-checkbox-part" id="selectCheckboxStylePart" style="width:80%; margin-left:16%; display:none;">
  118. <select class="sp-select">
  119. <option value="sp-checkbox-none">无皮肤</option>
  120. <option value="sp-checkbox-gray">灰色</option>
  121. <option value="sp-checkbox-blue">蓝色</option>
  122. <option value="sp-checkbox-orange">橙色</option>
  123. </select>
  124. </div>
  125. <!--end--单选多选区域设置-->
  126. <!--start--日期控件设置区域-->
  127. <span class="sp-lh-22 sp-color-gray fb-dateset-part">必填设置</span>
  128. <div class="sp-lh-22 sp-checkbox-blue fb-dateset-part"><label><input type="checkbox" id="btnDateSetRequire" />这个是必填项</label></div>
  129. <div class="sp-lh-22 sp-color-gray fb-dateset-part">日期格式:</div>
  130. <div class="sp-page sp-radio-blue fb-dateset-part" style="width:90%; margin-left:10px;" id="fbdatesetspanpart">
  131. <span class="sp-checkbox-tabs" data-value="yyyy-MM-dd">年-月-日</span>
  132. <span class="sp-checkbox-tabs" data-value="yyyy-MM">年-月</span>
  133. <span class="sp-checkbox-tabs" data-value="MM-dd">月-日</span>
  134. <span class="sp-checkbox-tabs" data-value="yyyy">仅年</span>
  135. <span class="sp-checkbox-tabs" data-value="MM">仅月</span>
  136. <span class="sp-checkbox-tabs" data-value="dd">仅日</span>
  137. <span class="sp-checkbox-tabs" data-value="yyyy-MM-dd HH:mm:ss">年-月-日 时:分:秒</span>
  138. <span class="sp-checkbox-tabs" data-value="yyyy-MM-dd HH:mm">年-月-日 时:分</span>
  139. <span class="sp-checkbox-tabs" data-value="HH:mm:ss">时:分:秒</span>
  140. <span class="sp-checkbox-tabs" data-value="HH:mm">时:分</span>
  141. </div>
  142. <!--end--日期控件设置区域-->
  143. <!--start--日期控件设置区域-->
  144. <span class="sp-lh-30 sp-color-gray fb-upload-img">设置宽度、高度</span>
  145. <div class="sp-lh-30 fb-upload-img">
  146. <div class="sp-page-col" style="width: 25%; margin-left: 5%;">宽度</div>
  147. <div class="sp-page-col" style="width:40%;">
  148. <input type="number" id="fbUploadImgWidth" class="fb-upload-img-input" />
  149. </div>
  150. <div class="sp-page-col sp-color-gray" style="width: 5%; margin-left: 5%;">px</div>
  151. </div>
  152. <div class="sp-lh-30 fb-upload-img">
  153. <div class="sp-page-col" style="width:25%; margin-left:5%;">高度</div>
  154. <div class="sp-page-col" style="width:40%;">
  155. <input type="number" id="fbUploadImgHeight" class="fb-upload-img-input" />
  156. </div>
  157. <div class="sp-page-col sp-color-gray" style="width: 5%; margin-left: 5%;">px</div>
  158. </div>
  159. <!--end--日期控件设置区域-->
  160. <!--start--补充样式设置区域、删除选中控件-->
  161. <div class="sp-page fb-setStyle-part">
  162. <span class="sp-lh-24 sp-color-gray sp-mt-10">样式补充</span>
  163. <div class="sp-page">
  164. <textarea rows="5" class="sp-textarea" id="trea_setClassBuChong"></textarea>
  165. <span class="sp-btn-blue sp-btn-md sp-btn-radius sp-pull-right" id="btn_trea_setClassBuChong_submit">确定</span>
  166. </div>
  167. <div class="sp-page sp-lh-24 sp-color-gray sp-mt-10">
  168. <div class="sp-page-col">删除组件</div>
  169. <div class="sp-page-col sp-ml-20">
  170. <span class="sp-btn-red-outline sp-btn-md sp-btn-radius" id="btn_delControl"><i class="fa fa-close"></i> 删除</span>
  171. </div>
  172. </div>
  173. </div>
  174. <!--end--补充样式设置区域、删除选中控件-->
  175. </div>
  176. <div class="sp-layer" data-title="表单预览--表单布局效果" id="formBuilderDesignPart" style="width:1050px; height:550px;">
  177. <div class="sp-layer-body" style="">
  178. <iframe name="iframeViewPart" id="iframeViewPart" src="formbuilder_view.html" style="width:100%;height: 500px;" frameborder="0"></iframe>
  179. </div>
  180. </div>
  181. <div class="sp-page">
  182. <div class="sp-page-col" style="calc(100vw - 160px)">意见说明</div>
  183. <div class="sp-page-col" style="width:80px;">
  184. <span class="sp-lh-20">姓名</span>
  185. <span class="sp-lh-20">2022-10-11</span>
  186. </div>
  187. <div class="sp-page-col" style="width:80px;">
  188. <span class="sp-btn-red-outline sp-btn-radius">删除</span>
  189. <span class="sp-btn-blue-outline sp-btn-radius">修改</span>
  190. </div>
  191. </div>
  192. <script src="../../AFrontEnd/js/jquery/jquery-1.8.3.min.js"></script>
  193. <script src="../../AFrontEnd/js/jquery/jquery-2.1.4.min.js"></script>
  194. <script src="../../AFrontEnd/js/bootstrap/bootstrap.js"></script>
  195. <script src="../../AFrontEnd/js/jquery/jquery-ui-1.10.4.min.js"></script>
  196. <!--<script src="../../AFrontEnd/plugins/laydate-1/laydate.js"></script>-->
  197. <script src="../../AFrontEnd/js/laydate/laydate.js"></script>
  198. <script>document.write('<scri' + 'pt src="../../AFrontEnd/js/special/special.js?time=' + new Date().getTime() + '" type="text/javascript"></s' + 'cript>');;</script>
  199. <script src="../../AFrontEnd/plugins/spvld/spvld.js"></script><!--原生的验证插件-->
  200. <!--用于查看表单源码的插件-->
  201. <script src="../../AFrontEnd/plugins/codemirror/codemirror.js?v=2023052311"></script>
  202. <script src="../../AFrontEnd/plugins/codemirror/mode/javascript/javascript.js?v=2023052311"></script>
  203. <!--美化表单源码中的代码格式-->
  204. <script src="../../AFrontEnd/plugins/beautifyhtml/beautifyhtml.js"></script>
  205. <!--表格编辑设计基础插件-->
  206. <script src="tinymce/tinymce.js" type="text/javascript"></script>
  207. <script src="../../apiurljs.js"></script>
  208. <script src="../../js/sm4.js"></script>
  209. <script>document.write('<scri' + 'pt src="js/formbuilder.js?time=' + new Date().getTime() + '" type="text/javascript"></s' + 'cript>');;</script>
  210. <script type="text/javascript">
  211. ////设置表单设置的区域
  212. function setFbTinymce() {
  213. tinymce.init({
  214. language: 'zh_CN',
  215. name: '#formBuilderTextarea',
  216. selector: '#formBuilderTextarea',
  217. height: 400,
  218. // plugins: "table",
  219. plugins: [
  220. 'advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker',
  221. 'searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking',
  222. 'save table contextmenu directionality emoticons template paste textcolor'
  223. ],
  224. content_css: [
  225. '../../AFrontEnd/css/fontawesome/css/font-awesome.css',
  226. '../../AFrontEnd/css/special.css',
  227. 'css/iframebuilder.css?v=20230522'
  228. ],
  229. toolbar: 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media fullpage | forecolor backcolor emoticons',
  230. table_default_attributes: { class: 'sp-fb-grid' },
  231. table_default_styles: {
  232. 'width': '100%'
  233. },
  234. table_responsive_width: true
  235. }).then(function (editors) {
  236. getData(); ///整体加载数据
  237. //setup_draggable();///拖拽方法设置
  238. });
  239. };
  240. setFbTinymce();////调用tinymce插件,加载网格数据方法
  241. sp.radio();///美化单选
  242. sp.checkbox();///美化多选
  243. ////spvld.getValidate(); ///表单正则验证插件
  244. ////测试开发单项选择器
  245. //setTimeout(function () {
  246. // sp.layer("#layer_popcheckbox_showcode");
  247. // $("#layer_popcheckbox_showcode").find(".spfb-layer-popcheckbox-all").click(function () {
  248. // if ($(this).hasClass("hasClick")) {
  249. // $(this).removeClass("hasClick").removeClass("sp-checkbox-tabs-active");
  250. // $("#layer_popcheckbox_showcode .spfb-layer-popcheckbox-part").find(".sp-checkbox-tabs").removeClass("sp-checkbox-tabs-active");
  251. // } else {
  252. // $(this).addClass("hasClick").addClass("sp-checkbox-tabs-active");
  253. // $("#layer_popcheckbox_showcode .spfb-layer-popcheckbox-part").find(".sp-checkbox-tabs").addClass("sp-checkbox-tabs-active");
  254. // }
  255. // })
  256. //}, 1000);
  257. </script>
  258. </body>
  259. </html>