ScheduleRoomModal.vue 1.7 KB

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