index.php 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>竞拍配置</title>
  6. <link href="{__FRAME_PATH}/css/bootstrap.min.css?v=3.4.0" rel="stylesheet">
  7. <link href="{__ADMIN_PATH}/css/layui-admin.css" rel="stylesheet">
  8. <link href="{__FRAME_PATH}/css/style.min.css?v=3.0.0" rel="stylesheet">
  9. <link href="{__FRAME_PATH}css/font-awesome.min.css?v=4.3.0" rel="stylesheet">
  10. <script src="{__PLUG_PATH}vue/dist/vue.min.js"></script>
  11. <link href="{__PLUG_PATH}iview/dist/styles/iview.css" rel="stylesheet">
  12. <script src="{__PLUG_PATH}iview/dist/iview.min.js"></script>
  13. <script src="{__PLUG_PATH}jquery/jquery.min.js"></script>
  14. <script src="{__PLUG_PATH}form-create/province_city.js"></script>
  15. <script src="{__PLUG_PATH}form-create/form-create.min.js"></script>
  16. <link href="{__PLUG_PATH}layui/css/layui.css" rel="stylesheet">
  17. <script src="{__PLUG_PATH}layui/layui.all.js"></script>
  18. <style>
  19. /*弹框样式修改*/
  20. .ivu-modal{top: 20px;}
  21. .ivu-modal .ivu-modal-body{padding: 10px;}
  22. .ivu-modal .ivu-modal-body .ivu-modal-confirm-head{padding:0 0 10px 0;}
  23. .ivu-modal .ivu-modal-body .ivu-modal-confirm-footer{display: none;padding-bottom: 10px;}
  24. .ivu-date-picker {display: inline-block;line-height: normal;width: 280px;}
  25. .ivu-modal-footer{display: none;}
  26. .ivu-poptip-popper{text-align: left;}
  27. .ivu-icon{padding-left: 5px;}
  28. .ivu-btn-long{width: 10%;min-width:100px;margin-left: 18%;}
  29. </style>
  30. </head>
  31. <body class="gray-bg">
  32. <div class="wrapper wrapper-content">
  33. <div class="row">
  34. <div class="col-sm-12">
  35. <div class="ibox float-e-margins">
  36. <div class="ibox-title">
  37. <h5>系统配置</h5>
  38. </div>
  39. <div class="tabs-container ibox-title gray-bg">
  40. <ul class="nav nav-tabs">
  41. <li ><a href=""><i class="fa fa-{$vo.icon}"></i></a></li>
  42. </ul>
  43. <div class="ibox-content">
  44. <div class="p-m m-t-sm" id="configboay">
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. </body>
  52. <script>
  53. formCreate.formSuccess = function(form,$r){
  54. <?=$form->getSuccessScript()?>
  55. $r.btn.loading(false);
  56. };
  57. (function () {
  58. var create = (function () {
  59. var getRule = function () {
  60. var rule = <?=json_encode($form->getRules())?>;
  61. rule.forEach(function (c) {
  62. if ((c.type == 'cascader' || c.type == 'tree') && Object.prototype.toString.call(c.props.data) == '[object String]') {
  63. if (c.props.data.indexOf('js.') === 0) {
  64. c.props.data = window[c.props.data.replace('js.', '')];
  65. }
  66. }
  67. });
  68. return rule;
  69. }, vm = new Vue,name = 'formBuilderExec<?= !$form->getId() ? '' : '_'.$form->getId() ?>';
  70. var _b = false;
  71. window[name] = function create(el, callback) {
  72. if(_b) return ;
  73. _b = true;
  74. if (!el) el = document.getElementById('configboay');
  75. var $f = formCreate.create(getRule(), {
  76. el: el,
  77. form:<?=json_encode($form->getConfig('form'))?>,
  78. row:<?=json_encode($form->getConfig('row'))?>,
  79. submitBtn:<?=$form->isSubmitBtn() ? '{}' : 'false'?>,
  80. resetBtn:<?=$form->isResetBtn() ? 'true' : '{}'?>,
  81. iframeHelper:true,
  82. global:{
  83. upload: {
  84. props:{
  85. onExceededSize: function (file) {
  86. vm.$Message.error(file.name + '超出指定大小限制');
  87. },
  88. onFormatError: function () {
  89. vm.$Message.error(file.name + '格式验证失败');
  90. },
  91. onError: function (error) {
  92. vm.$Message.error(file.name + '上传失败,(' + error + ')');
  93. },
  94. onSuccess: function (res, file) {
  95. if (res.code == 200) {
  96. file.url = res.data.filePath;
  97. } else {
  98. vm.$Message.error(res.msg);
  99. }
  100. },
  101. },
  102. },
  103. },
  104. //表单提交事件
  105. onSubmit: function (formData) {
  106. $f.btn.loading(true);
  107. $.ajax({
  108. url: '<?=$form->getAction()?>',
  109. type: '<?=$form->getMethod()?>',
  110. dataType: 'json',
  111. data: formData,
  112. success: function (res) {
  113. if (res.code == 200) {
  114. vm.$Message.success(res.msg);
  115. $f.btn.loading(false);
  116. formCreate.formSuccess && formCreate.formSuccess(res, $f, formData);
  117. callback && callback(0, res, $f, formData);
  118. //TODO 表单提交成功!
  119. } else {
  120. vm.$Message.error(res.msg || '表单提交失败');
  121. $f.btn.loading(false);
  122. callback && callback(1, res, $f, formData);
  123. //TODO 表单提交失败
  124. }
  125. },
  126. error: function () {
  127. vm.$Message.error('表单提交失败');
  128. $f.btn.loading(false);
  129. }
  130. });
  131. }
  132. });
  133. return $f;
  134. };
  135. return window[name];
  136. }());
  137. window.$f = create();
  138. })();
  139. </script>
  140. </html>