create.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <!DOCTYPE html>
  2. <!--suppress JSAnnotator -->
  3. <html lang="zh-CN">
  4. <head>
  5. {include file="public/head"}
  6. <title>{$title}</title>
  7. </head>
  8. <body>
  9. <div id="form-add" class="mp-form" v-cloak="">
  10. <form-builder></form-builder>
  11. </div>
  12. <style>
  13. #eb-field-icon input{width: 80%}
  14. </style>
  15. <script>
  16. var _vm ;
  17. var rules = {$rules};
  18. // console.log(rules);
  19. function openicon() {
  20. layer.open({
  21. type: 2,
  22. content: '/admin/system.system_menus/icon.html',
  23. area: ['600px', '600px'],
  24. maxmin: true
  25. });
  26. // $eb.createModalFrame(this.innerText,"/admin/system.system_menus/icon.html");
  27. }
  28. _mpApi = parent._mpApi;
  29. mpFrame.start(function(Vue){
  30. require(['axios','system/util/mpFormBuilder'],function(axios,mpFormBuilder){
  31. Vue.use(mpFormBuilder,_mpApi,rules,{
  32. action:'{$save}'
  33. });
  34. new Vue({
  35. el:"#form-add",
  36. mounted:function(){
  37. window._$setIcon = (icon)=>{
  38. this.$formBuilder.set('icon',icon);
  39. };
  40. $('#eb-field-icon').find('input').after('<button type="button" class="ivu-btn" onclick="openicon()")>选择图标</button>');
  41. }
  42. })
  43. });
  44. });
  45. </script>
  46. </body>