-
-
-
温度
-
{{ sensor.data.temperature }}
+
+
+ 设备编号
+ {{ sensor.device_code }}
-
-
pH值
-
{{ sensor.data.ph }}
+
+ 安装位置
+ {{ sensor.install_location || '暂无数据' }}
-
- 溶解氧
- {{ sensor.data.oxygen }}
+
+
+
+
+
{{ formatValue(sensor.data?.temp, '°C') }}
+
温度
+
+
+
{{ formatValue(sensor.data?.humi, '%') }}
+
湿度
+
+
+
{{ formatValue(sensor.data?.light_adc) }}
+
光照强度
+
+
+
{{ formatValue(sensor.data?.soil_adc) }}
+
土壤湿度
+
-
-
-
- 温度
- {{ sensor.data.temperature }}
+
+
+
+
\ No newline at end of file
diff --git a/src/views/about/needToKnow/index.vue b/src/views/about/needToKnow/index.vue
new file mode 100644
index 0000000..e456a9b
--- /dev/null
+++ b/src/views/about/needToKnow/index.vue
@@ -0,0 +1,515 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 查询
+ 重置
+
+
+
+
+
+
+
+ 新增
+
+
+
+
+
+
+
+
+ {{ categoryOptions.find(item => item.value === row.category)?.label || '-' }}
+
+
+
+
+ {{ getPlainText(row.content) }}
+
+
+
+
+ {{ row.sort_order }}
+
+
+
+
+
+ {{ row.status === 1 ? '启用' : '禁用' }}
+
+
+
+
+
+ {{ formatDateTime(row.created_at) }}
+
+
+
+
+
+ {{ formatDateTime(row.updated_at) }}
+
+
+
+
+
+ 编辑
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 启用
+ 禁用
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/projects/index.vue b/src/views/about/projects/index.vue
similarity index 100%
rename from src/views/projects/index.vue
rename to src/views/about/projects/index.vue
diff --git a/src/views/activity/study/index.vue b/src/views/activity/study/index.vue
index 27df4ba..a364198 100644
--- a/src/views/activity/study/index.vue
+++ b/src/views/activity/study/index.vue
@@ -1,8 +1,9 @@
@@ -629,6 +739,10 @@ onUnmounted(() => {
趋势统计
+
@@ -791,18 +905,18 @@ onUnmounted(() => {
}
.charts-container {
- display: flex;
+ display: grid;
+ grid-template-columns: repeat(3, 1fr);
gap: 20px;
+ margin-top: 20px;
margin-bottom: 20px;
.chart-item {
- flex: 1;
-
.chart-title {
font-size: 16px;
font-weight: 500;
color: v.$text-primary;
- margin-bottom: 8px;
+ margin-bottom: 16px;
}
.chart-content {
diff --git a/src/views/monitor/species/index.vue b/src/views/monitor/species/index.vue
index 2fec4cc..5ff9a00 100644
--- a/src/views/monitor/species/index.vue
+++ b/src/views/monitor/species/index.vue
@@ -93,115 +93,6 @@ const rules = {
]
}
-// 添加统计信息的响应式数据
-const statistics = ref({
- categories: {},
- protection_levels: {}
-})
-
-// 图表实例
-const protectionChartRef = ref(null)
-let protectionChart = null
-
-// 基础URL
-const baseUrl = computed(() => import.meta.env.VITE_API_BASE_URL || '')
-
-// 获取完整的图片URL
-const getFullImageUrl = (url) => {
- if (!url) return ''
- if (url.startsWith('http')) return url
- if (url.startsWith('data:')) return url
- if (url.startsWith('blob:')) return url
-
- // 移除URL开头的斜杠,避免重复
- const cleanUrl = url.startsWith('/') ? url.slice(1) : url
- // 确保不会重复添加 uploads 路径
- if (cleanUrl.startsWith('uploads/')) {
- return `${baseUrl.value}/${cleanUrl}`
- }
- return `${baseUrl.value}/uploads/${cleanUrl}`
-}
-
-// 初始化图表
-const initCharts = () => {
- if (protectionChartRef.value) {
- protectionChart = echarts.init(protectionChartRef.value)
- }
-}
-
-// 更新图表数据
-const updateCharts = () => {
- // 保护等级图表数据
- const protectionData = Object.entries(statistics.value.protection_levels)
- .filter(([_, count]) => count > 0)
- .map(([level, count]) => ({
- name: protectionLevelOptions.find(item => item.value === level)?.label || level,
- value: count
- }))
- .sort((a, b) => b.value - a.value)
-
- // 设置保护等级图表
- protectionChart?.setOption({
- title: {
- text: '保护等级统计',
- left: 'center'
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'shadow'
- },
- formatter: '{b}: {c}种'
- },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '10%',
- containLabel: true
- },
- xAxis: {
- type: 'category',
- data: protectionData.map(item => item.name),
- axisLabel: {
- interval: 0,
- rotate: 30
- }
- },
- yAxis: {
- type: 'value',
- name: '物种数量',
- minInterval: 1
- },
- series: [
- {
- name: '物种数量',
- type: 'bar',
- barWidth: '40%',
- data: protectionData.map(item => ({
- value: item.value,
- itemStyle: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- { offset: 0, color: '#83bff6' },
- { offset: 0.5, color: '#409EFF' },
- { offset: 1, color: '#2c76c5' }
- ])
- }
- })),
- label: {
- show: true,
- position: 'top',
- formatter: '{c}种'
- }
- }
- ]
- })
-}
-
-// 监听窗口大小变化
-const handleResize = () => {
- protectionChart?.resize()
-}
-
// 获取列表数据
const getList = async () => {
loading.value = true
@@ -401,8 +292,6 @@ const getStatistics = async () => {
try {
const res = await getSpeciesStatistics()
statistics.value = res.data
- // 更新图表数据
- updateCharts()
} catch (error) {
console.error('获取统计信息失败:', error)
}
@@ -443,32 +332,37 @@ const handleSortChange = ({ prop, order }) => {
}
}
+// 基础URL
+const baseUrl = computed(() => import.meta.env.VITE_API_BASE_URL || '')
+
+// 获取完整的图片URL
+const getFullImageUrl = (url) => {
+ if (!url) return ''
+ if (url.startsWith('http')) return url
+ if (url.startsWith('data:')) return url
+ if (url.startsWith('blob:')) return url
+
+ // 移除URL开头的斜杠,避免重复
+ const cleanUrl = url.startsWith('/') ? url.slice(1) : url
+ // 确保不会重复添加 uploads 路径
+ if (cleanUrl.startsWith('uploads/')) {
+ return `${baseUrl.value}/${cleanUrl}`
+ }
+ return `${baseUrl.value}/uploads/${cleanUrl}`
+}
+
onMounted(() => {
getList()
- // 初始化图表
- initCharts()
getStatistics()
- window.addEventListener('resize', handleResize)
})
onUnmounted(() => {
- // 销毁图表实例
- protectionChart?.dispose()
- window.removeEventListener('resize', handleResize)
+ // 不再需要清理图表实例
})
-
-
-
-
-
-
-
-
-
@@ -732,30 +626,6 @@ onUnmounted(() => {
padding: 10px 20px;
}
- .statistics-container {
- margin-bottom: 20px;
-
- .card-header {
- font-weight: bold;
- }
-
- .statistics-content {
- .statistics-item {
- display: flex;
- align-items: center;
- margin-bottom: 10px;
-
- span {
- margin-right: 10px;
- }
-
- &:last-child {
- margin-bottom: 0;
- }
- }
- }
- }
-
.species-image {
width: 60px;
height: 60px;