index.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <template>
  2. <div class="dialogSlot-aa"
  3. :class="dialogClass">
  4. <el-dialog v-model="innerVisibleShow"
  5. @closeDlg="closeDlg"
  6. destroy-on-close
  7. show-close
  8. close-on-press-escape
  9. :width="dialogWidth"
  10. :close-on-click-modal="false">
  11. <template v-slot:title>
  12. <span class="dialogTitle">{{title}}</span>
  13. </template>
  14. <slot></slot>
  15. <div class="del-btn"
  16. v-if="btnShow">
  17. <el-button size="mini"
  18. type="primary"
  19. @click="searchSure"
  20. style="color: #ffffff">确定</el-button>
  21. <el-button size="mini"
  22. style="color: #5075FC"
  23. @click="searchReset">取消</el-button>
  24. </div>
  25. </el-dialog>
  26. </div>
  27. </template>
  28. <script>
  29. export default {
  30. name: "",
  31. data() {
  32. return {
  33. // show: false,
  34. };
  35. },
  36. props: {
  37. content: String,
  38. innerVisible: {
  39. type: Boolean,
  40. },
  41. btnShow: {
  42. type: Boolean,
  43. default: false,
  44. },
  45. title: {
  46. type: String,
  47. default: "",
  48. },
  49. closeDlg: {
  50. type: Function,
  51. },
  52. dialogWidth: {
  53. type: String,
  54. default: "50%",
  55. },
  56. dialogClass: {
  57. type: String,
  58. default: "",
  59. },
  60. },
  61. // watch: {
  62. // 'innerVisible': function(newVal) {
  63. // this.show = newVal
  64. // }
  65. // },
  66. mounted() {},
  67. computed: {
  68. innerVisibleShow: {
  69. get: function () {
  70. return this.innerVisible;
  71. },
  72. set: function () {
  73. return this.$emit("DialogClose");
  74. },
  75. },
  76. },
  77. methods: {
  78. async searchSure() {
  79. this.$emit("searchSureClick"); // 此方法名字歧义 不建议使用 但是旧代码再用 还不能删除
  80. this.$emit("sureClick");
  81. },
  82. searchReset() {
  83. this.$emit("DialogFalse"); // 此方法名字歧义 不建议使用 但是旧代码再用 还不能删除
  84. this.$emit("cancelClick");
  85. },
  86. },
  87. };
  88. </script>
  89. <style lang="less" >
  90. .dialogSlot-aa {
  91. .dialogTitle:before {
  92. content: "";
  93. display: inline-block;
  94. width: 3px;
  95. height: 14px;
  96. background: #5075fc;
  97. margin-right: 8px;
  98. }
  99. .el-dialog {
  100. margin-top: 3%;
  101. }
  102. .el-dialog__body {
  103. height: 100%;
  104. background: #ffffff;
  105. }
  106. }
  107. .del-btn {
  108. //position: absolute;
  109. //left: 165px;
  110. //bottom: 20px;
  111. text-align: center;
  112. margin-top: 20px;
  113. }
  114. </style>