Watching.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <template>
  2. <div class="watching">
  3. <ul>
  4. <li v-for="l in list" :class="{'yellow':l.WarnNum != 0}">
  5. <span> {{l.Dettime |fmtDate }}</span>
  6. <em>
  7. <i v-if="l.RegionName">{{l.RegionName}}</i>
  8. <i v-if="l.DectectorName">{{l.DectectorName}}</i>
  9. {{l.WarnString}}</em>
  10. </li>
  11. <div class="notips" v-show="!list">
  12. 暂无数据,等待探查信号源
  13. </div>
  14. </ul>
  15. </div>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. list: [],
  22. readyList: [],
  23. }
  24. },
  25. props: ['totalRs'],
  26. methods: {
  27. wordDisplay(word) {
  28. let index = 0;
  29. let that = this;
  30. setTimeout(function () {
  31. if(!word) {
  32. return false
  33. }
  34. that.list.unshift(word[index]);
  35. index = index + 1 ;
  36. }, 300);
  37. }
  38. },
  39. watch: {
  40. totalRs: function (val) {
  41. let that = this;
  42. that.list = [];
  43. that.readyList = [];
  44. // 逐行显示
  45. if(val.RegionDetRs){
  46. console.log(that.list);
  47. that.wordDisplay(val.RegionDetRs);
  48. }
  49. if(val.DetRs){
  50. console.log(that.list);
  51. that.wordDisplay([val.DetRs]);
  52. }
  53. },
  54. },
  55. filters: {
  56. fmtDate: function (value) {
  57. if(!value){
  58. return '---';
  59. }else{
  60. return value.substr(11,8);
  61. }
  62. }
  63. }
  64. }
  65. </script>
  66. <style scoped>
  67. .watching {
  68. width: 100%;
  69. overflow: hidden;
  70. display: block;
  71. margin: 0 auto;
  72. }
  73. .watching ul {
  74. width: 100%;
  75. height: 345px;
  76. overflow: hidden;
  77. display: block;
  78. margin: 0 auto;
  79. }
  80. .watching li {
  81. height: 34px;
  82. line-height: 34px;
  83. padding-left: 20px;
  84. padding-right: 10px;
  85. background: rgba(0, 107, 184, 0.2);
  86. font-size: 14px;
  87. color: #6DC1FF;
  88. text-align: left;
  89. overflow: hidden;
  90. margin-bottom: 5px;
  91. }
  92. .watching li span {
  93. font-family: UnidreamLED;
  94. font-size: 16px;
  95. margin-right: 10px;
  96. }
  97. .watching li.yellow {
  98. color: #FFDD00;
  99. }
  100. </style>