1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <!DOCTYPE html>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
- <meta http-equiv="Pragma" content="no-cache" />
- <meta http-equiv="Cache-Control" content="no-cache" />
- <meta http-equiv="Expires" content="0" />
- <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
- <title>设计预览</title>
- <link href="../../AFrontEnd/css/animate.css" rel="stylesheet" />
- <link href="../../AFrontEnd/css/fontawesome/css/font-awesome.css" rel="stylesheet" />
- <link href="../../AFrontEnd/css/bootstrap.css" rel="stylesheet" />
- <link href="../../AFrontEnd/css/style.css" rel="stylesheet" />
- <script>document.write("<link href='../../AFrontEnd/css/special.css?time=" + new Date().getTime() + "' rel='stylesheet'>");</script>
- <script>document.write("<link href='css/formbuilder.css?time=" + new Date().getTime() + "' rel='stylesheet'>");</script>
- </head>
- <body class="sp-bg-white">
- <div class="sp-page" id="disignHtmlViewPart"></div>
- <script src="../../AFrontEnd/js/jquery/jquery-1.8.3.min.js"></script>
- <script src="../../AFrontEnd/js/laydate/laydate.js"></script>
- <script>document.write('<scri' + 'pt src="../../AFrontEnd/js/special/special.js?time=' + new Date().getTime() + '" type="text/javascript"></s' + 'cript>');;</script>
- <script src="../../AFrontEnd/plugins/spvld/spvld.js"></script>
- <script>document.write('<scri' + 'pt src="js/spbld.js?time=' + new Date().getTime() + '" type="text/javascript"></s' + 'cript>');;</script>
- <script type="text/javascript">
- window.addEventListener('message', function (event) {
- //通过origin属性判断消息来源地址
- if (event.data.name == "formBuilderHtml") {
- //jzsetLat(event.data.arg);
- if (event.data.arg!=0) {
- $("#disignHtmlViewPart").html(event.data.arg);
- sp.radio();///单选
- sp.checkbox();///多选
- spvld.getValidate();///开始正则校验组件
- spbld.laydate();////操作日期控件组件
- spbld.subtable();///操作子表按钮组件
- $("input[type='file']").attr("disabled", "disabled");///file上传控件先禁用,防止预览时乱上传文件
- //sp.uploadimg("http://103.233.7.57:8080/GoldFile/image/upload");////图片上传组件,先注释防止乱上传文件
- //sp.uploadfile("http://103.233.7.57:8080/GoldFile/stream/upload");///附件上传组件,先注释防止乱上传文件
- } else {
- var tip = "<div class='sp-table-tip' style='margin-top:-10px;'>您好,暂无表单设计</div>";
- $("#disignHtmlViewPart").html(tip);
- }
- }
- //alert(event.data.name); // 弹出"I was there!"
- //alert(event.source); // 对a.com、index.html中window对象的引用
- // 但由于同源策略,这里event.source不可以访问window对象
- }, false);
- //子表提交按钮事件,模拟
- function fbSubTableSubmitData(obj) {
- ///预览模拟
- var $currentTr = $(obj).closest("tr");
- setTimeout(function () {
- $(obj).hide();
- $currentTr.find('.fb-edit-data').css('display', 'inline-block');
- $currentTr.find('input').attr('disabled', 'disabled');
- $currentTr.find('select').attr('disabled', 'disabled');
- $currentTr.find('textarea').attr('disabled', 'disabled');
- //显示当前子表添加行按钮
- }, 100);
- $(obj).closest('table').find('.fb-add-data').removeAttr('disabled');
- $(obj).closest('table').find('.fb-edit-data').removeAttr('disabled');
- $(obj).closest('table').find('.fb-delete-data').removeAttr('disabled');
- }
- //子表删除按钮,模拟
- function fbSubTableDelData(obj) {
- // 先查找并隐藏当前点击行
- if ($(obj).closest('tr').index() == 0) {
- alert("您好,为了保证预览效果,第一行禁止删除");
- } else {
- if (confirm("您好,删除后不可恢复,您确认要删除吗")) {
- $(obj).closest('tr').hide();
- }
- else {
- return;
- }
- }
- //模拟移除当前行
- ///$(obj).closest('tr').remove();
- };
-
- </script>
- </body>
- </html>
|