feat:设备巡检
This commit is contained in:
parent
afea429dd1
commit
0b939dd618
@ -11,6 +11,7 @@ export default defineAppConfig({
|
||||
|
||||
// 跳转页面
|
||||
'pages/weatherStation/index', // 气象站
|
||||
'pages/inspection/index', // 气象站(巡检)
|
||||
'pages/msgDetail/index', // 消息详情
|
||||
'pages/soilMoisture/index', // 土壤墒情
|
||||
'pages/envMonitor/index', // 棚内环境监测
|
||||
|
@ -1,9 +1,93 @@
|
||||
import { View } from "@tarojs/components"
|
||||
import { useState } from "react"
|
||||
import Taro from "@tarojs/taro"
|
||||
|
||||
const EquipMent = () => {
|
||||
return (
|
||||
<View>Equ</View>
|
||||
)
|
||||
const [selectedMenuId, setSelectedMenuId] = useState('all')
|
||||
const topMenus = [
|
||||
{
|
||||
id: '1',
|
||||
title: '基地1'
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
title: '基地2'
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
title: '基地3'
|
||||
},
|
||||
]
|
||||
|
||||
const dataList = [
|
||||
{
|
||||
id: '1',
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
},
|
||||
]
|
||||
return (
|
||||
<View className="p-1 h-full">
|
||||
<View className="h-full flex flex-col">
|
||||
<View className="flex px-2 py-1">
|
||||
{
|
||||
topMenus.map(item => {
|
||||
return (
|
||||
<View
|
||||
className={`p-1 px-3 ${selectedMenuId === item.id ? 'border-b-4 border-lime-800' : ''}`}
|
||||
key={item.id}
|
||||
style={{ color: 'white' }}
|
||||
onClick={() => setSelectedMenuId(item.id)}
|
||||
>{ item.title }</View>
|
||||
)
|
||||
})
|
||||
}
|
||||
</View>
|
||||
<View className="h-full flex flex-col space-y-3 p-2 rounded-sm">
|
||||
{
|
||||
dataList.map(item => {
|
||||
return (
|
||||
<View
|
||||
className="px-4 py-2 rounded-md shadow-xl flex space-x-4 bg-white border border-slate-200 items-center"
|
||||
// onClick={() => {
|
||||
// Taro.navigateTo({ url: '/pages/weatherStation/index?id=' + item.id })
|
||||
// }}
|
||||
>
|
||||
{/* <View className="w-12 h-12 relative top-1">
|
||||
<Image src={img} className="w-12 h-12"></Image>
|
||||
</View> */}
|
||||
<View className="w-full flex flex-col justify-between items-start pb-1">
|
||||
<View className="text-lg pb-1">气象站</View>
|
||||
<View className="w-full flex items-center space-x-8">
|
||||
<View className="flex items-center space-x-2">
|
||||
<View>已巡检</View>
|
||||
<View style={{ color: 'green' }}>3</View>
|
||||
</View>
|
||||
<View className="flex items-center space-x-2">
|
||||
<View>未巡检</View>
|
||||
<View style={{ color: 'red' }}>3</View>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
<View
|
||||
className="rounded-xl w-20 bg-green-500 text-center py-1"
|
||||
style={{ color: 'white' }}
|
||||
onClick={() => {
|
||||
Taro.navigateTo({ url: '/pages/inspection/index?id=' + item.id})
|
||||
}}
|
||||
>去巡检</View>
|
||||
</View>
|
||||
)
|
||||
})
|
||||
}
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
export default EquipMent;
|
3
src/pages/inspection/index.config.ts
Normal file
3
src/pages/inspection/index.config.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: '气象站'
|
||||
})
|
92
src/pages/inspection/index.tsx
Normal file
92
src/pages/inspection/index.tsx
Normal file
@ -0,0 +1,92 @@
|
||||
import { View, Image } from "@tarojs/components"
|
||||
import { useState } from "react"
|
||||
import Taro from "@tarojs/taro"
|
||||
import PageWrapper from "../../components/customized/pageWrapper"
|
||||
|
||||
const EquipMent = () => {
|
||||
const [selectedMenuId, setSelectedMenuId] = useState('all')
|
||||
const topMenus = [
|
||||
{
|
||||
id: '1',
|
||||
title: '已巡检'
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
title: '未巡检'
|
||||
}
|
||||
]
|
||||
|
||||
const dataList = [
|
||||
{
|
||||
id: '1',
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
},
|
||||
]
|
||||
return (
|
||||
<PageWrapper title="气象站">
|
||||
<View className="p-1 h-full">
|
||||
<View className="h-full flex flex-col">
|
||||
<View className="flex px-2 py-1">
|
||||
{
|
||||
topMenus.map(item => {
|
||||
return (
|
||||
<View
|
||||
className={`p-1 px-3 ${selectedMenuId === item.id ? 'border-b-4 border-lime-800' : ''}`}
|
||||
key={item.id}
|
||||
style={{ color: 'white' }}
|
||||
onClick={() => setSelectedMenuId(item.id)}
|
||||
>{ item.title }</View>
|
||||
)
|
||||
})
|
||||
}
|
||||
</View>
|
||||
<View className="grid grid-cols-2 gap-2 p-2 rounded-sm">
|
||||
{
|
||||
dataList.map(item => {
|
||||
return (
|
||||
<View
|
||||
className="py-2 pt-0 rounded-md shadow-xl bg-white relative"
|
||||
>
|
||||
<Image src={'https://picx.zhimg.com/70/v2-76efadc2e5b562f6f727521aedbb31ef_1440w.image?source=172ae18b&biz_tag=Post'} className="w-full h-[6rem] rounded-md"></Image>
|
||||
<View className="text-lg px-4 text-bold">设备1</View>
|
||||
<View className="text-sm px-4" style={{ color: '#00000090' }}>上次巡检 2023-1-11</View>
|
||||
<View className="w-full px-4 flex justify-between items-start py-2 space-x-1">
|
||||
<View
|
||||
className="rounded-xl w-20 bg-green-500 text-center py-1"
|
||||
style={{ color: 'white' }}
|
||||
onClick={() => {
|
||||
Taro.navigateTo({ url: '/pages/weatherStation/index?id=' + item.id})
|
||||
}}
|
||||
>巡检日志</View>
|
||||
<View
|
||||
className="rounded-xl w-20 bg-green-500 text-center py-1"
|
||||
style={{ color: 'white' }}
|
||||
onClick={() => {
|
||||
Taro.navigateTo({ url: '/pages/weatherStation/index?id=' + item.id})
|
||||
}}
|
||||
>去巡检</View>
|
||||
</View>
|
||||
<View
|
||||
className="absolute left-0 top-0 text-white p-1 text-sm px-2"
|
||||
style={{ backgroundColor: '#0FC87C', color: 'white', borderRadius: '.3rem 0 .3rem 0' }}
|
||||
>
|
||||
{ '在线' }
|
||||
</View>
|
||||
</View>
|
||||
)
|
||||
})
|
||||
}
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
</PageWrapper>
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
export default EquipMent;
|
Loading…
Reference in New Issue
Block a user