-
-
![]()
-
{{ item.lable }}
+
+
+
-
-
-
-
+
+
+
+
+ 预警数据统计
+
+
+
+
+
+
+
+
![]()
+
{{ item.lable }}
+
+
+
+
+
+
@@ -149,6 +156,7 @@
RangePicker,
Button,
message,
+ Empty,
} from 'ant-design-vue'
import type { FormInstance } from 'ant-design-vue'
const RadioButton = Radio.Button
@@ -256,12 +264,14 @@
// 获取基地数据
const getBase = async () => {
const res = await getGriculturalDeviceBasic({ device_type: 2 })
+ if (res.length == 0) return
baseDate.value = res
if (!formState.base_id) formState.base_id = res?.[0]?.id ?? undefined
getPoint()
}
// 获取监控点数据
const getPoint = async () => {
+ if (baseDate.value.length == 0) return
const res = await getaGriculturalDevicePoint({
device_type: 2,
agricultural_basic: formState.base_id,
diff --git a/src/views/main/water-quality/components/FormDrawer.vue b/src/views/main/water-quality/components/FormDrawer.vue
index 97ee2a7d..f8358128 100644
--- a/src/views/main/water-quality/components/FormDrawer.vue
+++ b/src/views/main/water-quality/components/FormDrawer.vue
@@ -45,20 +45,20 @@
import { editDeviceWarningRules } from '/@/api/sys/user'
const emits = defineEmits(['success', 'register'])
const enumName = {
+ chlorine: '氯',
conductivity: '电导率',
- humidity: '湿度',
+ oxygen: '氧气',
+ ph: 'PH',
temperature: '温度',
- k: '氮',
- n: '磷',
- p: '钾',
+ turbidity: '浊度',
}
const enumCompany = {
temperature: '℃',
conductivity: 'us/cm',
- humidity: '%',
- k: 'mg/kg',
- n: 'mg/kg',
- p: 'mg/kg',
+ turbidity: 'NTU',
+ chlorine: 'mg/L',
+ oxygen: 'mg/L',
+ ph: '',
}
const enumName1 = {
1: 'Ⅰ级预警',
@@ -79,7 +79,7 @@
setDrawerProps({ confirmLoading: false })
const res = await getDeviceWarningRules({})
- roulsDate.value = res.find((e) => e.slug === 'device_warning_rule_soil')
+ roulsDate.value = res.find((e) => e.slug === 'device_warning_rule_waterquality')
})
const handleSubmit = async () => {
diff --git a/src/views/main/water-quality/index.vue b/src/views/main/water-quality/index.vue
index d822450c..ca942910 100644
--- a/src/views/main/water-quality/index.vue
+++ b/src/views/main/water-quality/index.vue
@@ -76,45 +76,52 @@
-
-
- 预警数据统计
-
-
-
-
-
-
-
-
![]()
-
{{ item.lable }}
+
+
+
-
-
-
-
+
+
+
+
+ 预警数据统计
+
+
+
+
+
+
+
+
![]()
+
{{ item.lable }}
+
+
+
+
+
+
@@ -149,6 +156,7 @@
RangePicker,
Button,
message,
+ Empty,
} from 'ant-design-vue'
import type { FormInstance } from 'ant-design-vue'
const RadioButton = Radio.Button
@@ -167,7 +175,7 @@
// 预警数量
const earlyNums = ref
({})
// 选中
- const activeKey = ref('conductivity')
+ const activeKey = ref('chlorine')
interface EarlyWarningItem {
icon: String
title: String
@@ -211,6 +219,12 @@
return name1 + '-' + name2
})
const tagMenus = [
+ {
+ lable: '氯',
+ value: 'chlorine',
+ icon: icon1,
+ icon1: uicon1,
+ },
{
lable: '电导率',
value: 'conductivity',
@@ -218,8 +232,14 @@
icon1: uicon1,
},
{
- lable: '湿度',
- value: 'humidity',
+ lable: '氧气',
+ value: 'oxygen',
+ icon: icon1,
+ icon1: uicon1,
+ },
+ {
+ lable: 'PH',
+ value: 'ph',
icon: icon1,
icon1: uicon1,
},
@@ -230,20 +250,8 @@
icon1: uicon1,
},
{
- lable: '氮',
- value: 'k',
- icon: icon1,
- icon1: uicon1,
- },
- {
- lable: '磷',
- value: 'n',
- icon: icon1,
- icon1: uicon1,
- },
- {
- lable: '钾',
- value: 'p',
+ lable: '浊度',
+ value: 'turbidity',
icon: icon1,
icon1: uicon1,
},
@@ -254,15 +262,17 @@
}
// 获取基地数据
const getBase = async () => {
- const res = await getGriculturalDeviceBasic({ device_type: 2 })
+ const res = await getGriculturalDeviceBasic({ device_type: 3 })
+ if (res.length == 0) return
baseDate.value = res
if (!formState.base_id) formState.base_id = res?.[0]?.id ?? undefined
getPoint()
}
// 获取监控点数据
const getPoint = async () => {
+ if (baseDate.value.length == 0) return
const res = await getaGriculturalDevicePoint({
- device_type: 2,
+ device_type: 3,
agricultural_basic: formState.base_id,
})
pointDate.value = formatDataByObject(res)