DiaogProgress.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <div class="divBG">
  3. <div class="showDiv">
  4. <i class="el-icon-loading" style="font-size:32px;"/>
  5. <br/>
  6. <br/>
  7. <el-progress :percentage="percentage" :text-inside="true" :stroke-width="16"></el-progress>
  8. </div>
  9. </div>
  10. </template>
  11. <script>
  12. export default {
  13. name: "DiaogProgress",
  14. components: {},
  15. props: { visible: Boolean },
  16. data() {
  17. return {
  18. percentage: 0
  19. };
  20. },
  21. watch: {},
  22. computed: {
  23. myVisible: {
  24. get() {
  25. return visible;
  26. },
  27. set(val) {
  28. this.$emit("update:visible", val);
  29. }
  30. }
  31. },
  32. methods: {},
  33. mounted() {
  34. const self = this;
  35. self.chartsInterval = window.setInterval(async function() {
  36. self.percentage += 2;
  37. if (self.percentage > 99) {
  38. window.clearInterval(self.chartsInterval);
  39. }
  40. }, 200);
  41. }
  42. };
  43. </script>
  44. <!-- Add "scoped" attribute to limit CSS to this component only -->
  45. <style scoped>
  46. .divBG {
  47. vertical-align: middle;
  48. text-align: center;
  49. background: rgba(128, 128, 128, 0.8);
  50. position: fixed;
  51. left: 0px;
  52. top: 0px;
  53. width: 100%;
  54. height: 100%;
  55. /* display: none; */
  56. z-index: 20;
  57. }
  58. .showDiv {
  59. padding-top: 25%;
  60. height: 200px;
  61. width: 500px;
  62. margin: auto;
  63. }
  64. </style>