gasInspectDialog.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <div class="gasInspectDialog">
  3. <div class="info-xj-title">
  4. <span>当前巡检进度</span>
  5. <span style="margin-left: 10px">{{ inspectJd || '' }}</span>
  6. </div>
  7. <div class="info-xj-content">
  8. <div class="xj-content-item" v-for="(item, index) in inspectList" :key="index">
  9. <div class="content-item-title">{{ item.label }}</div>
  10. <div class="content-item-val">{{ item.val }}</div>
  11. </div>
  12. </div>
  13. </div>
  14. </template>
  15. <script setup lang="ts">
  16. import { ref, reactive,onMounted, watch, onUnmounted, } from 'vue';
  17. import {queryNowGasSta} from '../deviceMonitor/components/device/device.api';
  18. import { message,} from 'ant-design-vue';
  19. let props = defineProps({
  20. gasSearch: {
  21. type: Object,
  22. default: () => {
  23. return {}
  24. }
  25. }
  26. })
  27. const inspectJd = ref<any>('');
  28. const inspectList = reactive<any[]>([
  29. { label: '第一次巡检已检数', val: 0 },
  30. { label: '第一次巡检未检数', val: 0 },
  31. { label: '第二次巡检已检数', val: 0 },
  32. { label: '第二次巡检未检数', val: 0 },
  33. ]);
  34. async function getGasSta(param){
  35. if (!param.insType) {
  36. message.warning('请选择巡检类型!');
  37. } else if (!param.class) {
  38. message.warning('请选择巡检班次!');
  39. } else {
  40. let res = await queryNowGasSta({ insType: param.insType, class: param.class });
  41. console.log(res, '巡检弹窗信息');
  42. if (res) {
  43. inspectJd.value = res.comRate || 0;
  44. inspectList[0].val = res.finishNum1 || 0;
  45. inspectList[1].val = res.missNum1 || 0;
  46. inspectList[2].val = res.finishNum2 || 0;
  47. inspectList[3].val = res.missNum2 || 0;
  48. }
  49. }
  50. }
  51. watch(()=>props.gasSearch,(newG,oldG)=>{
  52. console.log(newG,'nreG--------')
  53. getGasSta(newG)
  54. },{immediate:true,deep:true})
  55. onMounted(() => { });
  56. </script>
  57. <style lang="less" scoped>
  58. .gasInspectDialog {
  59. width: 100%;
  60. height: 100%;
  61. .info-xj-title {
  62. width: 230px;
  63. height: 36px;
  64. line-height: 36px;
  65. padding-left: 50px;
  66. margin: 10px 0px;
  67. color: #fff;
  68. background: url('@/assets/images/inspect-title.png') no-repeat center;
  69. background-size: 100% 100%;
  70. }
  71. .info-xj-content {
  72. display: flex;
  73. flex-wrap: wrap;
  74. height: calc(100% - 56px);
  75. padding: 10px 0px;
  76. box-sizing: border-box;
  77. .xj-content-item {
  78. display: flex;
  79. flex-direction: column;
  80. justify-content: space-around;
  81. align-items: center;
  82. width: 126px;
  83. height: 67px;
  84. margin: 7px;
  85. color: #fff;
  86. padding-bottom: 5px;
  87. background: url('@/assets/images/inspect-item.png') no-repeat center;
  88. .content-item-val {
  89. font-family: 'douyuFont';
  90. color: #74e9fe;
  91. }
  92. }
  93. }
  94. }
  95. </style>