diff --git a/api/animal.js b/api/animal.js
index 450c674..6655a2d 100644
--- a/api/animal.js
+++ b/api/animal.js
@@ -15,4 +15,6 @@ export const animalInfoAPI = (data) => syhttp.get('/AnimalBreed/animalInfo', dat
// 操作列表
export const animalPicListAPI = (data) => syhttp.get('/AnimalBreed/animalPicList', data)
// 上传动物图片
-export const addAnimalPicAPI = (data) => syhttp.post('/AnimalBreed/addAnimalPic', data)
\ No newline at end of file
+export const addAnimalPicAPI = (data) => syhttp.post('/AnimalBreed/addAnimalPic', data)
+// 更新动物饲养状态
+export const animalStatusAPI = (data) => syhttp.post('/AnimalBreed/animalStatus', data)
\ No newline at end of file
diff --git a/api/aquatic.js b/api/aquatic.js
new file mode 100644
index 0000000..700792d
--- /dev/null
+++ b/api/aquatic.js
@@ -0,0 +1,16 @@
+import syhttp from "@/utils/syhttp.js";
+
+/**
+ * 添加水产养殖信息
+ */
+export const addFishAPI = (data) => syhttp.post('/FishBreed/addFish', data)
+// 用户池塘信息
+export const pondInfoAPI = (data) => syhttp.get('/FishBreed/pondInfo', data)
+// 上传图片
+export const addFishPicAPI = (data) => syhttp.post('/FishBreed/addFishPic', data)
+// 实时环境监测
+export const pondEnvDataAPI = (data) => syhttp.get('/FishBreed/pondEnvData', data)
+// 图片列表
+export const fishPicListAPI = (data) => syhttp.get('/FishBreed/fishPicList', data)
+//
+// export const fishPicListAPI = (data) => syhttp.get('/FishBreed/fishPicList', data)
\ No newline at end of file
diff --git a/api/plant.js b/api/plant.js
index d8fa439..adab537 100644
--- a/api/plant.js
+++ b/api/plant.js
@@ -19,4 +19,10 @@ export const setLandCropRipeAPI = (data) => syhttp.get('/LandPlant/setLandCropRi
// 种植图片列表
export const landCropPicListAPI = (data) => syhttp.get('/LandPlant/landCropPicList', data)
// 种植操作列表
-export const actionsListAPI = (data) => syhttp.get('/user/actions', data)
\ No newline at end of file
+export const actionsListAPI = (data) => syhttp.get('/user/actions', data)
+// 种植操作详情
+export const actionsDetailAPI = (data) => syhttp.get('/user/actionsDetail', data)
+// 种植操作详情列表
+export const landCropRecordInfoAPI = (data) => syhttp.get('/LandPlant/landCropRecordInfo', data)
+// 检测数据表
+export const landEnvDataChartAPI = (data) => syhttp.get('/LandPlant/landEnvDataChart', data)
\ No newline at end of file
diff --git a/components/imgCard.vue b/components/imgCard.vue
index 99bc1cb..bebc843 100644
--- a/components/imgCard.vue
+++ b/components/imgCard.vue
@@ -6,7 +6,8 @@
- {{props.text}}
+
+ {{address}}
@@ -18,7 +19,16 @@
reactive
} from 'vue'
import uplodeFn from "@/utils/uplodeImg.js"
-
+ import {
+ userInfoAPI
+ } from "@/api/plant.js"
+ const address = ref("")
+ userInfoAPI({
+ user_id: 307
+ }).then(res => {
+ let userInfo = res.data
+ address.value = userInfo.area_name + userInfo.street_name + userInfo.village_name + userInfo.brigade_name
+ })
const props = defineProps({
imgUrl: String,
text: String
diff --git a/components/index/chick.vue b/components/index/chick.vue
index 57f43df..7d2c187 100644
--- a/components/index/chick.vue
+++ b/components/index/chick.vue
@@ -242,13 +242,13 @@
}
})
const actionList = reactive({})
- // actionsAPI({
- // type: 3
- // }).then(res => {
- // for (let key in res.data) {
- // actionList[key] = (res.data)[key]
- // }
- // })
+ actionsAPI({
+ type: 2
+ }).then(res => {
+ for (let key in res.data) {
+ actionList[key] = (res.data)[key]
+ }
+ })
\ No newline at end of file
diff --git a/pages/aquatic/detail.vue b/pages/aquatic/detail.vue
index 13bd4a2..68d285d 100644
--- a/pages/aquatic/detail.vue
+++ b/pages/aquatic/detail.vue
@@ -1,19 +1,17 @@
-
-
+
刷新时间:{{dateFn()}}
-
+
查看历史条件
-
上传新的种植情况
@@ -62,11 +60,23 @@
具体种类: 20亩
-
+
添加水产养殖
-
+
+
+
+ {{index}}
+
+
+ 更新{{index.slice(0,-2)}}
+
+
+
+
+
+
@@ -100,9 +110,10 @@
- 刷新时间: 2022-3-3
+ 刷新时间: {{dateFn()}}
+
@@ -136,69 +147,51 @@
ref,
reactive
} from "vue"
+ import {
+ actionsAPI
+ } from "@/api/animal.js"
+ import {
+ pondInfoAPI,
+ addFishPicAPI,
+ pondEnvDataAPI
+ } from "@/api/aquatic.js"
import myTable from "@/components/myTable/index.vue"
import imgCard from "@/components/imgCard.vue"
+ import {
+ onLoad
+ } from "@dcloudio/uni-app"
+ import uplodeImg from "@/utils/uplodeImg.js"
const data = reactive([{
tit: "水温",
icon: 'TRWD',
dw: "℃",
- cont: 'soil_temperature',
+ cont: 'water_temp',
flag: false,
}, {
tit: "PH值",
icon: 'TRSD',
- dw: "%RH",
- cont: 'soil_moisture',
+ cont: 'ph_content',
}, {
tit: "溶解氧",
icon: 'FX',
- cont: 'wind_direction',
+ cont: 'dissolved_oxygen',
+ dw: "%",
}, {
tit: "电导率",
icon: 'FS',
- dw: "m/s",
- cont: 'wind_speed',
+ dw: "mg/l",
+ cont: 'electric_conductivity',
}, {
tit: "TDS",
icon: 'JYL',
- dw: "mm",
- cont: 'rainfall',
+ dw: "lux",
+ cont: 'tds',
},
])
- const data2 = reactive([{
- cont: "气象多要素百叶箱",
- cont2: "1天/1次",
- }, {
- cont: "多功能控制器",
- cont2: "3个小时/次",
- }, ])
- const baseData = reactive({
- "id": 27,
- "production_base_id": 1,
- "soil_temperature": 20,
- "soil_moisture": 50,
- "room_temperature": 0,
- "air_humidity": 0,
- "air_quality_index": 0,
- "pond_temperature": 0,
- "pond_ph_value": 0,
- "wind_direction": "北",
- "wind_speed": 3.4,
- "illumination": 2,
- "rainfall": 20,
- "carbon_dioxide_content": 450,
- "nitrogen_content": 0,
- "methane_content": 0,
- "ammonia_nitrogen_content": 0,
- "nitrite_content": 0,
- "dissolved_oxygen": 0,
- "temperature_threshold": 0,
- "humidity_threshold": 0,
- "flag": 1
- })
+ const baseData = reactive({})
const urlFn = (name) => {
return `/static/img/${name}.png`
}
@@ -224,6 +217,48 @@
// 输出日期字符串
}
+ const updateImgFn = () => {
+ let image = ""
+ uplodeImg().then(res => {
+ image = res.data.image
+ headData.pic_detail.pic = image
+ addFishPicAPI({
+ pond_id: pond_id.value,
+ pic: image
+ })
+ })
+ }
+ const pond_id = ref(0)
+ const headData = reactive({})
+ onLoad((option) => {
+
+ pondEnvDataAPI({
+ user_id: 307
+ }).then(res => {
+ for (let key in res.data) {
+ baseData[key] = (res.data)[key]
+ }
+ })
+
+
+ pond_id.value = option.pond_id
+ pondInfoAPI({
+ user_id: 307,
+ pond_id: pond_id.value
+ }).then(res => {
+ for (let key in res.data) {
+ headData[key] = (res.data)[key]
+ }
+ })
+ })
+ const actionList = reactive({})
+ actionsAPI({
+ type: 4
+ }).then(res => {
+ for (let key in res.data) {
+ actionList[key] = (res.data)[key]
+ }
+ })
\ No newline at end of file
diff --git a/pages/detail/plant.vue b/pages/detail/plant.vue
index 9d57699..7bd2125 100644
--- a/pages/detail/plant.vue
+++ b/pages/detail/plant.vue
@@ -8,7 +8,8 @@
刷新时间:{{dateFn()}}
-
+
查看历史记录
@@ -21,18 +22,28 @@
-
+
-
-
+ -->
+
+
+
+ {{index}}
+
+
+ 更新{{index.slice(0,-2)}}
+
+
+
+
+
@@ -94,7 +105,8 @@
农作物成熟标记
- X
+
+
@@ -126,7 +138,7 @@
成熟日期:
- ?
+ {{dateFn()}}
@@ -157,6 +169,9 @@
import imgCard from "@/components/imgCard.vue"
import uplodeImg from "@/utils/uplodeImg.js"
import landInfo from "@/components/plant/landInfo.vue"
+ import {
+ actionsAPI
+ } from "@/api/animal.js"
import {
ref,
reactive
@@ -211,8 +226,6 @@
crop_id: landDeatil.crop_id
})
objFn(res2.data, tableDate)
-
- // console.log(res2.data)
let res3 = await landEnvDataCurrAPI({
user_id: 307,
})
@@ -280,6 +293,14 @@
}
}
+ const actionList = reactive({})
+ actionsAPI({
+ type: 1
+ }).then(res => {
+ for (let key in res.data) {
+ actionList[key] = (res.data)[key]
+ }
+ })
\ No newline at end of file
diff --git a/pages/feedIng/SingleDetail.vue b/pages/feedIng/SingleDetail.vue
new file mode 100644
index 0000000..b5abbc5
--- /dev/null
+++ b/pages/feedIng/SingleDetail.vue
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
+ 刷新时间:{{dateFn()}}
+
+
+ 查看历史条件
+
+
+
+
+ 上传新的种植情况
+
+
+
+
+ 编号: 52656
+
+
+ 溯源码: 52656
+
+
+
+
+ 养殖品种: 土豆
+
+
+ 年龄: 的划分等级
+
+
+
+
+ 养殖类型: 20亩
+
+
+ 体重: 45kg
+
+
+
+
+
+
+
+
+ 当前养殖状态
+
+
+ 健康
+
+
+
+
+
+
+ 饲养记录
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/feedIng/feedDetail.vue b/pages/feedIng/feedDetail.vue
index d550fd1..894bb63 100644
--- a/pages/feedIng/feedDetail.vue
+++ b/pages/feedIng/feedDetail.vue
@@ -41,18 +41,18 @@
-
+
- 编号: 13645
+ 编号: {{baseData.animal_code}}
-
+
查看养殖详情
@@ -61,22 +61,21 @@
-
- 养殖类型: 母猪
+
+ 养殖类型: {{baseData.animal_kind}}
体重:
+ border="surround" v-model="formData.animal_weight">
- 年龄: 2年
+ 年龄: {{baseData.animal_age}}年
状态:
+ placeholder="请选择" border="surround" @click.capture="selectFoucsFn" v-model="value">
@@ -92,23 +91,26 @@
-
+
-
- 上传新的种植情况
+
+ 确认更新
-
-
- 饲养记录
-
-
- 更新生长记录
+
+
+
+ {{index}}
+
+
+ 更新{{index.slice(0,-2)}}
+
+
+
-
-
+
标记状态为出栏
@@ -126,7 +128,11 @@
reactive
} from "vue"
import {
- animalInfoAPI
+ animalInfoAPI,
+ animalStatusAPI
+ } from "@/api/animal.js"
+ import {
+ actionsAPI
} from "@/api/animal.js"
const selectList = reactive([
"健康", "怀孕中", "生病隔离中", "可出栏"
@@ -140,17 +146,68 @@
const changSelectfn = (index) => {
indexs.value = index
value.value = selectList[index]
+ formData.status = index + 1
}
- const animal_id = ref("")
+ const animal_id = ref(0)
+ const baseData = reactive({})
onLoad((options) => {
animal_id.value = options.id
- console.log(animal_id.value, 6666)
+ formData.animal_id = options.id
+ animalInfoAPI({
+ animal_id: options.id
+ }).then(res => {
+ for (let key in res.data) {
+ baseData[key] = res.data[key]
+ }
+ formData.animal_weight = baseData.animal_weight
+ value.value = selectList[baseData.animal_status - 1]
+ indexs.value = baseData.animal_status - 1
+ })
})
const navgo = (url) => {
uni.navigateTo({
url
})
}
+ const formData = reactive({
+ status: '',
+ animal_id: '',
+ animal_weight: ""
+ })
+ const updataStatusFn = () => {
+ animalStatusAPI({
+ ...formData
+ }).then(res => {
+ uni.showToast({
+ title: res.msg,
+ icon: 'none'
+ })
+ })
+ }
+ const outBar = () => {
+ animalStatusAPI({
+ status: 4,
+ animal_id: animal_id.value,
+ }).then(res => {
+ uni.showToast({
+ title: res.msg,
+ icon: 'none'
+ })
+ setTimeout(() => {
+ uni.navigateTo({
+ url: '/pages/index/index'
+ })
+ }, 2000)
+ })
+ }
+ const actionList = reactive({})
+ actionsAPI({
+ type: 3
+ }).then(res => {
+ for (let key in res.data) {
+ actionList[key] = (res.data)[key]
+ }
+ })
\ No newline at end of file
diff --git a/pages/growRecord/index.vue b/pages/growRecord/index.vue
index 146e7b7..b16097d 100644
--- a/pages/growRecord/index.vue
+++ b/pages/growRecord/index.vue
@@ -1,7 +1,7 @@
-
+
+
@@ -138,6 +138,17 @@
ref,
reactive
} from "vue"
+ import landInfo from "@/components/plant/landInfo.vue"
+ import {
+ landCropRecordInfoAPI
+ } from "@/api/plant.js"
+ import {
+ onLoad
+ } from "@dcloudio/uni-app"
+ const land_id = ref(0)
+ onLoad((options) => {
+ land_id.value = options.land_id
+ })
const showPop = ref(false)
const formData = reactive({
value: ""
diff --git a/pages/poultry/SingleDetail.vue b/pages/poultry/SingleDetail.vue
new file mode 100644
index 0000000..b5abbc5
--- /dev/null
+++ b/pages/poultry/SingleDetail.vue
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
+ 刷新时间:{{dateFn()}}
+
+
+ 查看历史条件
+
+
+
+
+ 上传新的种植情况
+
+
+
+
+ 编号: 52656
+
+
+ 溯源码: 52656
+
+
+
+
+ 养殖品种: 土豆
+
+
+ 年龄: 的划分等级
+
+
+
+
+ 养殖类型: 20亩
+
+
+ 体重: 45kg
+
+
+
+
+
+
+
+
+ 当前养殖状态
+
+
+ 健康
+
+
+
+
+
+
+ 饲养记录
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/poultry/addPoultry.vue b/pages/poultry/addPoultry.vue
index 6ef30dc..d328997 100644
--- a/pages/poultry/addPoultry.vue
+++ b/pages/poultry/addPoultry.vue
@@ -111,7 +111,7 @@
import {
addAnimalAPI,
- } from "@/api/animal.js"
+ } from "@/api/chick.js"
const navgo = () => {
uni.navigateTo({
url: "/pages/index/index"
diff --git a/pages/poultry/feedDetail.vue b/pages/poultry/feedDetail.vue
index 2e0fb0a..369b0c7 100644
--- a/pages/poultry/feedDetail.vue
+++ b/pages/poultry/feedDetail.vue
@@ -41,18 +41,18 @@
-
+
编号: 13645
-
+
查看养殖详情
@@ -61,12 +61,12 @@
-
+
养殖类型: 母猪
体重:
+ border="surround" v-model="formData.animal_weight">
@@ -75,8 +75,7 @@
状态:
+ placeholder="请选择" border="surround" @click.capture="selectFoucsFn" v-model="value">
@@ -94,21 +93,24 @@
-
- 上传新的种植情况
+
+ 确认更新
-
-
- 饲养记录
-
-
- 更新生长记录
+
+
+
+ {{index}}
+
+
+ 更新{{index.slice(0,-2)}}
+
+
+
-
-
+
标记状态为出栏
@@ -126,7 +128,11 @@
reactive
} from "vue"
import {
- animalInfoAPI
+ animalInfoAPI,
+ animalStatusAPI
+ } from "@/api/animal.js"
+ import {
+ actionsAPI
} from "@/api/animal.js"
const selectList = reactive([
"健康", "怀孕中", "生病隔离中", "可出栏"
@@ -140,17 +146,57 @@
const changSelectfn = (index) => {
indexs.value = index
value.value = selectList[index]
+ formData.status = index + 1
}
- const animal_id = ref("")
+ const animal_id = ref(0)
onLoad((options) => {
animal_id.value = options.id
- console.log(animal_id.value, 6666)
+ formData.animal_id = options.id
})
const navgo = (url) => {
uni.navigateTo({
url
})
}
+ const formData = reactive({
+ status: '',
+ animal_id: '',
+ animal_weight: ""
+ })
+ const updataStatusFn = () => {
+ animalStatusAPI({
+ ...formData
+ }).then(res => {
+ uni.showToast({
+ title: res.msg,
+ icon: 'none'
+ })
+ })
+ }
+ const outBar = () => {
+ animalStatusAPI({
+ status: 4,
+ animal_id: animal_id.value,
+ }).then(res => {
+ uni.showToast({
+ title: res.msg,
+ icon: 'none'
+ })
+ setTimeout(() => {
+ uni.navigateTo({
+ url: '/pages/index/index'
+ })
+ }, 2000)
+ })
+ }
+ const actionList = reactive({})
+ actionsAPI({
+ type: 2
+ }).then(res => {
+ for (let key in res.data) {
+ actionList[key] = (res.data)[key]
+ }
+ })
\ No newline at end of file
diff --git a/pages/poultry/feedList.vue b/pages/poultry/feedList.vue
index 3b3b3aa..dcb863d 100644
--- a/pages/poultry/feedList.vue
+++ b/pages/poultry/feedList.vue
@@ -50,30 +50,30 @@
- 编号: {{item.code}}
+ 编号: {{item.animal_code}}
-
+
健康
-
+
怀孕中
-
+
可出栏
-
+
生病隔离中
- 养殖类型: {{item.kind}}
+ 养殖类型: {{item.animal_kind}}
- 年龄: {{item.age}}年
+ 年龄: {{item.animal_age}}年
- 体重: {{item.weight}}kg
+ 体重: {{item.animal_weight}}kg
@@ -87,7 +87,7 @@