febcf192a8a3fc787b1f5d32c233aba95a9a2879.svn-base 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. visible: false,
  26. disableSubmit: false
  27. }
  28. },
  29. methods:{
  30. add () {
  31. this.visible=true
  32. this.$nextTick(()=>{
  33. this.$refs.realForm.add();
  34. })
  35. },
  36. edit (record) {
  37. this.visible=true
  38. this.$nextTick(()=>{
  39. this.$refs.realForm.edit(record);
  40. })
  41. },
  42. close () {
  43. this.$emit('close');
  44. this.visible = false;
  45. },
  46. handleOk () {
  47. this.$refs.realForm.handleOk();
  48. },
  49. submitCallback(){
  50. this.$emit('ok');
  51. this.visible = false;
  52. },
  53. handleCancel () {
  54. this.close()
  55. }
  56. }
  57. }
  58. </script>
  59. <style scoped>
  60. </style>