ef580da3c75ef9c64bb058b9d71e3e8df767ffd0.svn-base 1.2 KB

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