EditScheduleRoomModal.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template>
  2. <j-modal
  3. :title="title"
  4. :width="width"
  5. :visible="visible"
  6. switchFullscreen
  7. @ok="handleOk"
  8. :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
  9. @cancel="handleCancel"
  10. cancelText="关闭">
  11. <schedule-room-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></schedule-room-form>
  12. </j-modal>
  13. </template>
  14. <script>
  15. import ScheduleRoomForm from './EditScheduleRoomForm'
  16. export default {
  17. name: 'ScheduleRoomModal',
  18. components: {
  19. ScheduleRoomForm
  20. },
  21. data () {
  22. return {
  23. title:'',
  24. width:1300,
  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. addList(record) {
  37. this.visible = true;
  38. this.$nextTick(() => {
  39. this.$refs.realForm.addList(record);
  40. });
  41. },
  42. edit (record) {
  43. this.visible=true
  44. this.$nextTick(()=>{
  45. this.$refs.realForm.edit(record);
  46. })
  47. },
  48. close () {
  49. this.$emit('close');
  50. this.visible = false;
  51. },
  52. handleOk () {
  53. this.$refs.realForm.submitForm();
  54. },
  55. submitCallback(){
  56. this.$emit('ok');
  57. this.visible = false;
  58. },
  59. handleCancel () {
  60. this.close()
  61. }
  62. }
  63. }
  64. </script>
  65. <style scoped>
  66. /deep/.ant-modal-body {
  67. padding: 12px;
  68. max-height: calc(80vh - 150px);
  69. overflow-y: auto;
  70. &::-webkit-scrollbar {
  71. width: 6px;
  72. /*高宽分别对应横竖滚动条的尺寸*/
  73. height: 1px;
  74. }
  75. &::-webkit-scrollbar-thumb {
  76. background: #e3e3e6;
  77. border-radius: 6px;
  78. }
  79. &::-webkit-scrollbar-track {
  80. background: transparent;
  81. border-radius: 5px;
  82. }
  83. }
  84. </style>