CarouselTabl.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <div style="width: 98%;height: 98%;overflow: hidden;padding: 1%;">
  3. <div class="title" style="vertical-align: top; height: 10%;font-size: 24px;color: white;font-weight:600;">{{ title }}</div>
  4. <div v-show="showChart" style="width:100%;height: 87%;display: flex;justify-content: center;">
  5. <dv-scroll-board :key="scrollBoardKey" :config="configData" style="width:100%;height:100%;font-size: 12px" />
  6. </div>
  7. <div v-show="!showChart" :class="$style.nullShow">暂无数据</div>
  8. </div>
  9. </template>
  10. <script>
  11. export default {
  12. props: {
  13. value: {
  14. type: Object
  15. },
  16. title: {
  17. type: String,
  18. default: ''
  19. }
  20. },
  21. data () {
  22. return {
  23. scrollBoardKey: 0,
  24. configData: {},
  25. showChart: false
  26. }
  27. },
  28. watch: {
  29. value: {
  30. handler (newVal, oldVal) {
  31. if (newVal.data.length > 0) {
  32. this.configData = { ...newVal }
  33. this.scrollBoardKey++
  34. this.showChart = true
  35. } else {
  36. this.shoshowChartw = false
  37. }
  38. },
  39. deep: true
  40. // immediate: true
  41. }
  42. },
  43. mounted () {
  44. const this_ = this
  45. if (this_.value[0] == 999) {
  46. this.showChart = false
  47. return
  48. }
  49. }
  50. }
  51. </script>
  52. <style lang="scss" module>
  53. .nullShow{
  54. display: flex;
  55. align-items: center;
  56. justify-content: center;
  57. font-size: 18px;
  58. height: 85%;
  59. }
  60. </style>