Commit 88cc7051 authored by co_dengxiongwen's avatar co_dengxiongwen

候车大厅页面

parent 149d81ce
...@@ -27,12 +27,12 @@ ...@@ -27,12 +27,12 @@
<el-button <el-button
type="primary" type="primary"
size="mini" size="mini"
@click="currentId = item.id" @click="handleType(item.id)"
v-for="item in typeList" v-for="item in typeList"
:key="item.id" :key="item.id"
:class="[ :class="[
item.id == currentId ? 'isActive' : '', item.id == currentId ? 'isActive' : '',
item.icon, item.icon
]" ]"
> >
<!-- <img :src="item.src" alt="" /> --> <!-- <img :src="item.src" alt="" /> -->
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
:picker-options="{ :picker-options="{
start: '00:00', start: '00:00',
step: '00:15', step: '00:15',
end: '24:00', end: '24:00'
}" }"
> >
</el-time-select> </el-time-select>
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
start: '00:00', start: '00:00',
step: '00:15', step: '00:15',
end: '24:00', end: '24:00',
minTime: formData.startTime, minTime: formData.startTime
}" }"
> >
</el-time-select> </el-time-select>
...@@ -79,13 +79,13 @@ ...@@ -79,13 +79,13 @@
:class="[isOpen == 1 ? 'on' : '']" :class="[isOpen == 1 ? 'on' : '']"
@click="setSendTime(1)" @click="setSendTime(1)"
> >
</div> </div>
<div <div
:class="[isOpen == 2 ? 'on' : '']" :class="[isOpen == 2 ? 'on' : '']"
@click="setSendTime(2)" @click="setSendTime(2)"
> >
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
...@@ -175,9 +175,9 @@ export default { ...@@ -175,9 +175,9 @@ export default {
typeList: [ typeList: [
{ {
id: 1, id: 1,
name: '自然通风', name: '供暖',
src: require('../../home/image/fan_icon.png'), src: require('../../home/image/nan_fan_icon.png'),
icon: 'iconfont icon-feng' icon: 'el-icon-sunny'
}, },
{ {
id: 2, id: 2,
...@@ -187,9 +187,9 @@ export default { ...@@ -187,9 +187,9 @@ export default {
}, },
{ {
id: 3, id: 3,
name: '供暖', name: '自然通风',
src: require('../../home/image/nan_fan_icon.png'), src: require('../../home/image/fan_icon.png'),
icon: 'el-icon-sunny' icon: 'iconfont icon-feng'
} }
], ],
currentId: null, currentId: null,
...@@ -198,8 +198,7 @@ export default { ...@@ -198,8 +198,7 @@ export default {
tableColums: tableColumsOne, tableColums: tableColumsOne,
isSaving: 1, //节能 isSaving: 1, //节能
isOpen: 1, //定时开关 isOpen: 1, //定时开关
formData: { formData: {},
},
tabList: [ tabList: [
{ {
value: '01', value: '01',
...@@ -242,6 +241,7 @@ export default { ...@@ -242,6 +241,7 @@ export default {
}, },
mounted() { mounted() {
this.getDataList() this.getDataList()
this.getAllHcdt()
}, },
methods: { methods: {
// 获取数据列表 // 获取数据列表
...@@ -268,6 +268,33 @@ export default { ...@@ -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() { cancelhandle() {
this.$nextTick(() => { this.$nextTick(() => {
this.hallModalVisible = false this.hallModalVisible = false
...@@ -276,19 +303,45 @@ export default { ...@@ -276,19 +303,45 @@ export default {
handleBtnClick() { handleBtnClick() {
this.hallModalVisible = true 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() {}, statusHandle() {},
// 人工节能 // 人工节能
handleSwitch(state) { handleSwitch(state) {
this.isSaving = state this.isSaving = state
this.$http({ this.$http({
url: this.$http.adornUrl('/equipment/changeType'), url: this.$http.adornUrl('/equipment/changeType'),
method: 'post', method: 'get',
data: { params: this.$http.adornParams({
type: state type: state
} })
}).then((data) => { }).then((data) => {
if (data && data.code === 0) { 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 { ...@@ -300,14 +353,18 @@ export default {
url: this.$http.adornUrl('/equipment/timedTask'), url: this.$http.adornUrl('/equipment/timedTask'),
method: 'post', method: 'post',
params: this.$http.adornParams({ params: this.$http.adornParams({
id: '', taskId: this.formData.taskId ? this.formData.taskId : '',
startTime: this.formData.startTime, startTime: this.formData.startTime,
endTime: this.formData.endTime, endTime: this.formData.endTime,
status: type status: type
}) })
}).then((data) => { }).then((data) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message.success('开启定时任务成功') 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