5dbac8f2b3e9619f55a99acaa1c50dee22fe7470.svn-base 1.6 KB

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