|
|
|
@ -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<any>({
|
|
|
|
|
type: 2,
|
|
|
|
@ -73,39 +82,45 @@ const formValue = reactive<any>({
|
|
|
|
|
const form = reactive<any>({
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
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) {
|
|
|
|
|
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 (cabinetStore.cabinetConfig.temperature.length == 1) {
|
|
|
|
|
} else if (cabinetsData.temperature.length == 1) {
|
|
|
|
|
// formValue.type = 1
|
|
|
|
|
formValue.all_temperature = cabinetStore.cabinetConfig.all_temperature
|
|
|
|
|
formValue.all_temperature = cabinetsData.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
|
|
|
|
|
formValue.left_temperature = cabinetsData.temperature[0] ? cabinetsData.temperature[0] : 0
|
|
|
|
|
formValue.right_temperature = cabinetsData.temperature[1] ? cabinetsData.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) => {
|
|
|
|
|
<div class="select-type">
|
|
|
|
|
<sel_label :label="Temperature" :value="formValue.type" @update:modelValue="changeType"></sel_label>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <div class="wd-seting" v-if="formValue.type == 2">
|
|
|
|
|
<div class="wd-seting" v-if="formValue.type == 2">
|
|
|
|
|
<div class="wd-seting-item">
|
|
|
|
|
<div class="lable">左区温控设值</div>
|
|
|
|
|
<vxe-input v-model="formValue.left_temperature" type="number" min="-30" max="40"></vxe-input>
|
|
|
|
@ -174,8 +193,8 @@ const changelightConfig = async (val: any) => {
|
|
|
|
|
<vxe-input v-model="formValue.temp_out" type="number" min="5"></vxe-input>
|
|
|
|
|
<div class="menu">℃</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div> -->
|
|
|
|
|
<!-- <div class="wd-seting">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="wd-seting" v-if="formValue.type == 1">
|
|
|
|
|
<div class="wd-seting-item">
|
|
|
|
|
<div class="lable">整机温控定值</div>
|
|
|
|
|
<vxe-input v-model="formValue.all_temperature" type="number" min="-30" max="40"></vxe-input>
|
|
|
|
@ -186,7 +205,7 @@ const changelightConfig = async (val: any) => {
|
|
|
|
|
<vxe-input v-model="formValue.temp_out" type="number" min="5"></vxe-input>
|
|
|
|
|
<div class="menu">℃</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div> -->
|
|
|
|
|
</div>
|
|
|
|
|
<div class="select-type">
|
|
|
|
|
<sel_labelTwo :label="light" @change="changelightConfig" :value="formValue.light_config"></sel_labelTwo>
|
|
|
|
|
</div>
|
|
|
|
|