You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

252 lines
5.8 KiB

2 years ago
<template>
2 years ago
<div style="padding-bottom: 10px;">
2 years ago
<LxHeader
icon="md-apps"
:text="$route.meta.title"
style="margin-bottom: 10px; border: 0px; margin-top: 15px"
text="调度指令"
>
</LxHeader>
2 years ago
<div class="weather panel">
<div class="title">今日信息</div>
<template v-if="weather">
<div class="weather-container">
<Card class="weather-container__card" v-for="(value,key) in weatherObj">
<template #title>
{{ value }}
</template>
<template>
<template v-if="weather[key]&&weather[key].length>15">
<el-tooltip placement="bottom" :content="weather[key]">
<span class="text">{{ weather[key] }}</span>
</el-tooltip>
</template>
<template v-else>
{{ weather[key] }}
</template>
</template>
</Card>
</div>
</template>
<template v-else>
<Card>
<el-empty :image-size="60" description="暂无信息"></el-empty>
</Card>
</template>
</div>
<div class="point panel">
<div class="title">创建调令</div>
<div class="point-container">
<Card class="point-container__card">
<createDispatch></createDispatch>
</Card>
2 years ago
</div>
2 years ago
</div>
2 years ago
2 years ago
<div class="dispatch panel">
<div class="title">已创建调令</div>
2 years ago
2 years ago
<div class="point-container">
<Card class="point-container__card">
<dispatchList></dispatchList>
</Card>
2 years ago
</div>
2 years ago
</div>
2 years ago
</div>
</template>
<script>
2 years ago
import { index, save } from "@/api/system/baseForm";
2 years ago
import { uuid } from "@/utils";
2 years ago
import LxHeader from "@/components/LxHeader/index.vue";
2 years ago
// import step1 from "@/views/order/component/step1.vue";
// import step2 from "@/views/order/component/step2.vue";
// import step3 from "@/views/order/component/step3.vue";
import createDispatch from "@/views/order/component/createDispatch.vue";
import dispatchList from "@/views/order/component/dispatchList.vue";
2 years ago
export default {
components: {
LxHeader,
2 years ago
createDispatch,
dispatchList
2 years ago
},
data() {
return {
currentStep: 0,
2 years ago
2 years ago
data: [],
weather: {},
weatherObj: {
weather: '今日天气',
water: '今日水情',
rain: '降水情况',
prevent: '预警',
early_warning: '防汛等级'
}
2 years ago
}
},
methods: {
2 years ago
// handleNext ({ data, step }) {
// console.log(data,step)
// switch (step) {
// case 1:
// let uid = uuid();
// this.data = data.map(equipmentId => {
// return {
// no: uid,
// equipment_id: equipmentId,
// start_time: '',
// end_time: '',
// content: '',
// level: 1,
// status: 1
// }
// })
// this.currentStep = 1;
// break;
// case 2:
// this.data = data;
// this.currentStep = 2;
// break;
// case 3:
// let promiseAll = this.data.map(i => {
// delete i['equipment_id-span']
// delete i['_index']
// delete i['_rowKey']
// i.start_time = `${this.$moment().format('YYYY-MM-DD')} ${i.start_time}`;
// i.end_time = `${this.$moment().format('YYYY-MM-DD')} ${i.end_time}`;
//
// return save({
// table_name: 'transfers',
// ...i
// },false)
// })
// let loadingInstance = this.$loading({
// lock:true,
// background:"rgba(0,0,0,0.4)",
// text:"正在加载中..."
// })
// Promise.all(promiseAll).then(res => {
// this.data = [];
// loadingInstance.close();
// this.currentStep = 3;
// }).catch(_ => {
// loadingInstance.close();
// })
// break;
// }
// },
//
// handleForward ({ data, step }) {
// switch (step) {
// case 2:
// this.data = data;
// this.currentStep = 0;
// break;
// case 3:
// this.currentStep = 1;
// break;
// }
// },
async getWeather () {
this.weather = (await index({
table_name: 'waters',
filter: [
{
key: 'date',
op: 'eq',
value: this.$moment().format('YYYY-MM-DD')
}
]
},false)).data[0]
2 years ago
}
},
computed: {},
2 years ago
created() {
this.getWeather()
}
2 years ago
}
</script>
<style scoped lang="scss">
::v-deep .ivu-steps .ivu-steps-title,::v-deep .ivu-steps .ivu-steps-head {
background: #0000;
}
2 years ago
.panel {
.title {
font-weight: 600;
font-size: 16px;
padding: 10px 20px;
position: relative;
&::before {
content: '';
width: 12px;
height: 12px;
border-radius: 100%;
transform: translateY(-50%);
background: radial-gradient(50% 50% at 50% 50%,$primaryColor 0,$primaryColor 60%,#0000 60%,#0000 80%,$primaryColor 80%,$primaryColor 100%);
position: absolute;
left: 0;
top: 50%;
}
}
& + & {
margin-top: 20px;
}
}
.weather {
&-container {
display: flex;
justify-content: space-between;
2 years ago
2 years ago
&__card {
flex: 0;
flex-basis: 19%;
.text {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
}
}
}
}
2 years ago
.step {
width: 80%;
margin: 0 auto;
}
2 years ago
.complete {
display: flex;
flex-direction: column;
align-items: center;
padding-bottom: 20px;
&__icon {
color: green;
font-size: 66px;
}
& > p {
font-weight: 600;
color: #333;
font-size: 20px;
padding: 20px 0;
}
}
2 years ago
</style>