6a201a71de922c0cd07ab2f8c46b5b2de55c4bd8.svn-base 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <#include "/common/utils.ftl">
  2. <template>
  3. <j-modal
  4. :title="title"
  5. :width="1200"
  6. :visible="visible"
  7. :maskClosable="false"
  8. switchFullscreen
  9. @ok="handleOk"
  10. :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
  11. @cancel="handleCancel">
  12. <${Format.humpToShortbar(entityName)}-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"/>
  13. </j-modal>
  14. </template>
  15. <script>
  16. import ${entityName}Form from './${entityName}Form'
  17. export default {
  18. name: '${entityName}Modal',
  19. components: {
  20. ${entityName}Form
  21. },
  22. data() {
  23. return {
  24. title:'',
  25. width:800,
  26. visible: false,
  27. disableSubmit: false
  28. }
  29. },
  30. methods:{
  31. add () {
  32. this.visible=true
  33. this.$nextTick(()=>{
  34. this.$refs.realForm.add();
  35. })
  36. },
  37. edit (record) {
  38. this.visible=true
  39. this.$nextTick(()=>{
  40. this.$refs.realForm.edit(record);
  41. })
  42. },
  43. close () {
  44. this.$emit('close');
  45. this.visible = false;
  46. },
  47. handleOk () {
  48. this.$refs.realForm.handleOk();
  49. },
  50. submitCallback(){
  51. this.$emit('ok');
  52. this.visible = false;
  53. },
  54. handleCancel () {
  55. this.close()
  56. }
  57. }
  58. }
  59. </script>
  60. <style scoped>
  61. </style>