diff --git a/src/pages/cabinetManage/parameterInfosp.vue b/src/pages/cabinetManage/parameterInfosp.vue
index ede0389..65deb94 100644
--- a/src/pages/cabinetManage/parameterInfosp.vue
+++ b/src/pages/cabinetManage/parameterInfosp.vue
@@ -3,7 +3,7 @@ import { ref, reactive } from "vue"
import sel_label from "./components/label.vue"
import sel_labelTwo from "./components/labelTwo.vue"
// import sel_input from '@/components/SelInput/index.vue'
-import { updateDateConfig } from "@/api/cabinet"
+import { queryCabinetList, updateDateConfig } from "@/api/cabinet"
import { useRoute } from "vue-router"
import { showNotify, showToast } from 'vant'
import { useStore } from "@/store"
@@ -22,6 +22,10 @@ const Temperature = reactive({
name: '整机控温',
id: 1
},
+ {
+ name: '左右控温',
+ id: 2
+ },
{
name: '无控温',
id: 3
@@ -46,7 +50,12 @@ const light = reactive({
]
})
-
+let cabinetsData = reactive({})
+const params = {
+ page_no: 1,
+ page_size: 10,
+ keyWorld: ''
+}
const formTest = reactive
({
type: 2,
@@ -73,39 +82,45 @@ const formValue = reactive({
const form = reactive({
})
+const queryList = async () => {
+ const res = await queryCabinetList(params)
+ // res.data.cabinets.forEach((item: any) => {
+ // cabinetsData.push(item)
+ // })
+ cabinetsData = res.data.cabinets[0].params;
+ // console.log(cabinetsData,'柜机参数')
+
+ formValue.light_config = cabinetsData.light_config
+ Object.assign(formValue, cabinetsData)
+
+ if (Object.keys(cabinetsData).length) {
+ formValue.defrost_config = cabinetsData.defrost_config
+ formValue.fan_config = cabinetsData.fan_config
+ formValue.temp_out = cabinetsData.temp_out
+ formValue.heat_config = cabinetsData.heat_config
+ formValue.light_config = cabinetsData.light_config
+ formValue.type = cabinetsData.type;
+ formValue.all_temperature = cabinetsData.all_temperature
+ if (cabinetsData.temperature.length == 0) {
+ // formValue.type = 0
+ } else if (cabinetsData.temperature.length == 1) {
+ // formValue.type = 1
+ formValue.all_temperature = cabinetsData.all_temperature
+ } else {
+ // formValue.type = 2
+ formValue.left_temperature = cabinetsData.temperature[0] ? cabinetsData.temperature[0] : 0
+ formValue.right_temperature = cabinetsData.temperature[1] ? cabinetsData.temperature[1] : 0
+ }
-console.log(cabinetStore.cabinetConfig, '柜体参数配置1', cabinetStore.cabinetConfig.type)
-
-formValue.light_config = cabinetStore.cabinetConfig.light_config
-Object.assign(formValue, cabinetStore.cabinetConfig)
-
-if (Object.keys(cabinetStore.cabinetConfig).length) {
- formValue.defrost_config = cabinetStore.cabinetConfig.defrost_config
- formValue.fan_config = cabinetStore.cabinetConfig.fan_config
- formValue.temp_out = cabinetStore.cabinetConfig.temp_out
- formValue.heat_config = cabinetStore.cabinetConfig.heat_config
- formValue.light_config = cabinetStore.cabinetConfig.light_config
- formValue.type = cabinetStore.cabinetConfig.type;
- formValue.all_temperature = cabinetStore.cabinetConfig.all_temperature
- if (cabinetStore.cabinetConfig.temperature.length == 0) {
- // formValue.type = 0
- } else if (cabinetStore.cabinetConfig.temperature.length == 1) {
- // formValue.type = 1
- formValue.all_temperature = cabinetStore.cabinetConfig.all_temperature
- } else {
- // formValue.type = 2
- formValue.left_temperature = cabinetStore.cabinetConfig.temperature[0] ? cabinetStore.cabinetConfig.temperature[0] : 0
- formValue.right_temperature = cabinetStore.cabinetConfig.temperature[1] ? cabinetStore.cabinetConfig.temperature[1] : 0
}
}
-
-console.log(formValue, '回显参数29', cabinetStore.cabinetConfig)
+queryList()
const saveForm = async () => {
- console.log(formValue.type, '......')
+ console.log(formValue, '......')
if (formValue.type == 1) {
// delete formValue.left_temperature
// delete formValue.right_temperature
@@ -137,7 +152,11 @@ const saveForm = async () => {
form.light_config = formValue.light_config;
form.filterExpire = formValue.filterExpire;
form.defrosWarning = formValue.defrosWarning;
+ // const data = { id, json: form }
+ // let id = 'ed94d085-a0b8-413e-a79b-8abff1cd08e3';
+ let id = 'a0c0fa54-bdeb-42f7-bd9d-1fdffed58eea';
const data = { id, json: form }
+ // console.log(data,'ppp')
const res = await updateDateConfig(data)
if (res.code == 200) {
showNotify({ message: '保存成功!', type: 'success' })
@@ -158,7 +177,7 @@ const changelightConfig = async (val: any) => {
-
-
+