Commit 88cc7051 authored by co_dengxiongwen's avatar co_dengxiongwen

候车大厅页面

parent 149d81ce
......@@ -27,12 +27,12 @@
<el-button
type="primary"
size="mini"
@click="currentId = item.id"
@click="handleType(item.id)"
v-for="item in typeList"
:key="item.id"
:class="[
item.id == currentId ? 'isActive' : '',
item.icon,
item.icon
]"
>
<!-- <img :src="item.src" alt="" /> -->
......@@ -56,7 +56,7 @@
:picker-options="{
start: '00:00',
step: '00:15',
end: '24:00',
end: '24:00'
}"
>
</el-time-select>
......@@ -68,7 +68,7 @@
start: '00:00',
step: '00:15',
end: '24:00',
minTime: formData.startTime,
minTime: formData.startTime
}"
>
</el-time-select>
......@@ -79,13 +79,13 @@
:class="[isOpen == 1 ? 'on' : '']"
@click="setSendTime(1)"
>
</div>
<div
:class="[isOpen == 2 ? 'on' : '']"
@click="setSendTime(2)"
>
</div>
</div>
</el-form-item>
......@@ -175,9 +175,9 @@ export default {
typeList: [
{
id: 1,
name: '自然通风',
src: require('../../home/image/fan_icon.png'),
icon: 'iconfont icon-feng'
name: '供暖',
src: require('../../home/image/nan_fan_icon.png'),
icon: 'el-icon-sunny'
},
{
id: 2,
......@@ -187,9 +187,9 @@ export default {
},
{
id: 3,
name: '供暖',
src: require('../../home/image/nan_fan_icon.png'),
icon: 'el-icon-sunny'
name: '自然通风',
src: require('../../home/image/fan_icon.png'),
icon: 'iconfont icon-feng'
}
],
currentId: null,
......@@ -198,8 +198,7 @@ export default {
tableColums: tableColumsOne,
isSaving: 1, //节能
isOpen: 1, //定时开关
formData: {
},
formData: {},
tabList: [
{
value: '01',
......@@ -242,6 +241,7 @@ export default {
},
mounted() {
this.getDataList()
this.getAllHcdt()
},
methods: {
// 获取数据列表
......@@ -268,6 +268,33 @@ export default {
}
})
},
getAllHcdt() {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/equipment/getAllHcdt'),
method: 'get'
}).then((data) => {
if (data && data.code === 0) {
// console.log('首页:', data)
this.isSaving = data.sysSystemParams.type
if (data.sysSystemParams.sun === 1) {
this.currentId = 1
} else if (data.sysSystemParams.fan === 1) {
this.currentId = 2
} else if (data.sysSystemParams.nan === 1) {
this.currentId = 3
} else {
this.currentId = null
}
if (data.timedTask) {
this.formData.taskId = data.timedTask.id
this.formData.startTime = data.timedTask.startTime
this.formData.endTime = data.timedTask.endTime
this.isOpen = data.timedTask.status
}
}
})
},
cancelhandle() {
this.$nextTick(() => {
this.hallModalVisible = false
......@@ -276,19 +303,45 @@ export default {
handleBtnClick() {
this.hallModalVisible = true
},
handleType(id) {
console.log('id:', id)
this.$http({
url: this.$http.adornUrl('/equipment/checkModel'),
method: 'post',
params: this.$http.adornParams({
type: id
})
}).then((data) => {
if (data && data.code === 0) {
if (id === 1) {
this.$message.success('供暖模式开启成功')
} else if (id === 2) {
this.$message.success('机械通风模式开启成功')
} else if (id === 3) {
this.$message.success('自然通风模式开启成功')
}
this.currentId = id
}
})
},
statusHandle() {},
// 人工节能
handleSwitch(state) {
this.isSaving = state
this.$http({
url: this.$http.adornUrl('/equipment/changeType'),
method: 'post',
data: {
method: 'get',
params: this.$http.adornParams({
type: state
}
})
}).then((data) => {
if (data && data.code === 0) {
console.log(data)
if (state === 1) {
this.$message.success('切换人工模式成功')
} else if (state === 2) {
this.$message.success('切换节能模式成功')
}
this.getAllHcdt()
}
})
},
......@@ -300,14 +353,18 @@ export default {
url: this.$http.adornUrl('/equipment/timedTask'),
method: 'post',
params: this.$http.adornParams({
id: '',
taskId: this.formData.taskId ? this.formData.taskId : '',
startTime: this.formData.startTime,
endTime: this.formData.endTime,
status: type
})
}).then((data) => {
if (data && data.code === 0) {
if (type === 1) {
this.$message.success('开启定时任务成功')
} else {
this.$message.success('关闭定时任务成功')
}
}
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment