index.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <div>
  3. <!-- 此处 特殊需求 title 不显示的 自己额外用icon 实现关闭事件-->
  4. <el-dialog
  5. title="上传图片"
  6. :visible.sync="visible"
  7. width="950px"
  8. :append-to-body="true"
  9. :modal-append-to-body="true"
  10. :before-close="handleClose"
  11. >
  12. <el-button
  13. class="selfDialogClose"
  14. type="text"
  15. icon="el-icon-close"
  16. circle
  17. @click="handleClose"
  18. size="medium"
  19. ></el-button>
  20. <upload-picture v-if="visible" :multiple="multiple" :modelName="modelName" @getImage="getImage"></upload-picture>
  21. </el-dialog>
  22. </div>
  23. </template>
  24. <script>
  25. // +----------------------------------------------------------------------
  26. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  27. // +----------------------------------------------------------------------
  28. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  29. // +----------------------------------------------------------------------
  30. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  31. // +----------------------------------------------------------------------
  32. // | Author: CRMEB Team <admin@crmeb.com>
  33. // +----------------------------------------------------------------------
  34. export default {
  35. name: 'UploadFroms',
  36. data() {
  37. return {
  38. visible: false,
  39. callback: function () {},
  40. multiple: false,
  41. modelName: '',
  42. ISmodal: false,
  43. booleanVal: true,
  44. };
  45. },
  46. watch: {
  47. // show() {
  48. // this.visible = this.show
  49. // }
  50. },
  51. methods: {
  52. handleClose() {
  53. this.visible = false;
  54. },
  55. getImage(img) {
  56. this.callback(img);
  57. this.visible = false;
  58. },
  59. },
  60. };
  61. </script>
  62. <style scoped>
  63. /* 统一组件中的特殊组件 */
  64. ::v-deep .el-dialog__header {
  65. display: none !important;
  66. }
  67. ::v-deep .el-dialog__body {
  68. padding: 2px 20px 0 20px !important;
  69. }
  70. .selfDialogClose {
  71. display: inline-block;
  72. position: absolute;
  73. right: 0;
  74. top: 3px;
  75. pointer-events: auto;
  76. z-index: 999;
  77. font-size: 20px;
  78. color: #363f4d;
  79. }
  80. </style>