VerifyParameters.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <script setup lang="ts">
  2. import { onMounted, ref } from 'vue';
  3. import { useRequest } from '@/hooks/request';
  4. import { postParameterVerification } from '@/api';
  5. import type { EquipmentInformationForm, ParameterVerification, UseGuideStepItemProps } from '@/types';
  6. const props = defineProps<UseGuideStepItemProps<EquipmentInformationForm>>();
  7. const parameterVerificationList = ref<ParameterVerification[]>([]);
  8. const { handleRequest } = useRequest();
  9. const colorShow = (value: number | string) => {
  10. if (value) {
  11. return 'color:#666666';
  12. } else {
  13. return 'color:#F56C6C';
  14. }
  15. };
  16. onMounted(() => {
  17. handleRequest(async () => {
  18. parameterVerificationList.value = await postParameterVerification(props.form.devId);
  19. });
  20. });
  21. </script>
  22. <template>
  23. <div>
  24. <div v-for="item in parameterVerificationList" :key="item.id" class="margin-bottom">
  25. <AFlex align="center" class="host-parameters-header">
  26. <div class="host-parameters-header-left"></div>
  27. <div class="host-parameters-header-right">{{ item.deviceParamGroupName }}</div>
  28. </AFlex>
  29. <AFlex class="host-parameters" wrap="wrap">
  30. <div v-for="ite in item.valueVos" :key="ite.valueId" class="host-parameters-div">
  31. <span :style="colorShow(ite.value)">{{ ite.paramName }}:</span>
  32. <span style="margin-left: 10px">{{ ite.value }}</span>
  33. <span v-if="ite.value">{{ ite.unit }}</span>
  34. </div>
  35. </AFlex>
  36. </div>
  37. </div>
  38. </template>
  39. <style lang="scss" scoped>
  40. .margin-bottom {
  41. margin-bottom: 24px;
  42. }
  43. .host-parameters-header {
  44. height: 56px;
  45. background: #f5f6f7;
  46. border: 1px solid #e4e7ed;
  47. border-radius: 8px 8px 0 0;
  48. }
  49. .host-parameters {
  50. padding: 24px;
  51. padding-bottom: 8px;
  52. border: 1px solid #e4e7ed;
  53. border-top: none;
  54. border-radius: 0 0 8px 8px;
  55. }
  56. .host-parameters-header-left {
  57. width: 2px;
  58. height: 16px;
  59. margin-right: 10px;
  60. margin-left: 24px;
  61. background: #32bac0;
  62. }
  63. .host-parameters-header-right {
  64. font-size: 16px;
  65. font-style: normal;
  66. font-weight: 500;
  67. line-height: 24px;
  68. color: #000;
  69. text-align: left;
  70. }
  71. .host-parameters-div {
  72. width: 347px;
  73. margin-bottom: 16px;
  74. font-size: 14px;
  75. font-style: normal;
  76. font-weight: 400;
  77. line-height: 24px;
  78. color: #333;
  79. text-align: left;
  80. }
  81. </style>