ItdmWeituoYijuModal.Style#Drawer.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <a-drawer
  3. :title="title"
  4. :width="width"
  5. placement="right"
  6. :closable="false"
  7. @close="close"
  8. destroyOnClose
  9. :visible="visible">
  10. <itdm-weituo-yiju-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></itdm-weituo-yiju-form>
  11. <div class="drawer-footer">
  12. <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
  13. <a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
  14. </div>
  15. </a-drawer>
  16. </template>
  17. <script>
  18. import ItdmWeituoYijuForm from './ItdmWeituoYijuForm'
  19. export default {
  20. name: 'ItdmWeituoYijuModal',
  21. components: {
  22. ItdmWeituoYijuForm
  23. },
  24. data () {
  25. return {
  26. title:"操作",
  27. width:800,
  28. visible: false,
  29. disableSubmit: false
  30. }
  31. },
  32. methods: {
  33. add () {
  34. this.visible=true
  35. this.$nextTick(()=>{
  36. this.$refs.realForm.add();
  37. })
  38. },
  39. edit (record) {
  40. this.visible=true
  41. this.$nextTick(()=>{
  42. this.$refs.realForm.edit(record);
  43. });
  44. },
  45. close () {
  46. this.$emit('close');
  47. this.visible = false;
  48. },
  49. submitCallback(){
  50. this.$emit('ok');
  51. this.visible = false;
  52. },
  53. handleOk () {
  54. this.$refs.realForm.submitForm();
  55. },
  56. handleCancel () {
  57. this.close()
  58. }
  59. }
  60. }
  61. </script>
  62. <style lang="less" scoped>
  63. /** Button按钮间距 */
  64. .ant-btn {
  65. margin-left: 30px;
  66. margin-bottom: 30px;
  67. float: right;
  68. }
  69. .drawer-footer{
  70. position: absolute;
  71. bottom: -8px;
  72. width: 100%;
  73. border-top: 1px solid #e8e8e8;
  74. padding: 10px 16px;
  75. text-align: right;
  76. left: 0;
  77. background: #fff;
  78. border-radius: 0 0 2px 2px;
  79. }
  80. </style>