泵闸数量、提示音、动态样式

master
xy 2 years ago
parent 5f974f59ba
commit e6626ea354

Binary file not shown.

@ -95,10 +95,18 @@ import dataV from '@jiaminghi/data-view';
Vue.use(dataV);
import noticeAudio from "@/assets/notice.mp3";
import noticeAudioNew from "@/assets/notice1.mp3";
let audio = new Audio();
audio.src = noticeAudio;
Vue.prototype.$audioPlay = () => {
audio.play()
Vue.prototype.$audioPlay = (type = 1) => {
if (audio) {
if (type === 1) {
audio.src = noticeAudio;
} else {
audio.src = noticeAudioNew;
}
audio.play()
}
}
import VueMatomo from 'vue-matomo'

@ -15,7 +15,7 @@
</div>
<div class="type-item">
<div class="type-item__operate type-item__operate-doing"></div>
<div class="type-item__label">进行中</div>
<div class="type-item__label">未执行</div>
</div>
<div class="type-item">
<div class="type-item__operate" style="background: #dcdcdc;"></div>
@ -55,6 +55,8 @@
</div>
<div class="list-item__time">
执行时间{{ timeFormat(item.start_time) }}{{ timeFormat(item.end_time,'HH:mm') }}
<br>
发布时间{{ timeFormat(item.created_at) }}
</div>
<div class="list-item__last">预计时长 {{ $moment(item.end_time).diff($moment(item.start_time),'hours', true).toFixed(2) }}小时</div>
<div class="list-item__operate">
@ -80,7 +82,7 @@
</template>
<script>
import {deepCopy} from "@/utils";
import { deepCopy } from "@/utils";
export default {
inject: ["transfers", "nowTime", "auths"],
@ -231,6 +233,7 @@ export default {
if (newVal && newVal instanceof Array) {
this.scrollList = deepCopy(newVal).map(i => {
i._isPlay = false
i._isFirst = true
return i
})
@ -418,7 +421,7 @@ $list-height: calc(#{$container-height} - 5.33rem);
}
&__time {
flex-basis: 19%;
text-align: center;
text-align: left;
}
&__last {
flex-basis: 9%;

@ -15,7 +15,7 @@
</div>
<div class="type-item">
<div class="type-item__operate type-item__operate-doing"></div>
<div class="type-item__label">进行中</div>
<div class="type-item__label">未执行</div>
</div>
<div class="type-item">
<div class="type-item__operate" style="background: #dcdcdc;"></div>
@ -55,6 +55,8 @@
</div>
<div class="list-item__time">
运行时间{{ timeFormat(item.start_time) }}{{ timeFormat(item.end_time,'HH:mm') }}
<br>
发布时间{{ timeFormat(item.created_at,'HH:mm') }}
</div>
<div class="list-item__last">预计时长 {{ $moment(item.end_time).diff($moment(item.start_time),'hours', true).toFixed(2) }}小时</div>
<div class="list-item__operate">
@ -190,7 +192,7 @@ export default {
//1 2 3 4
const diffMins = this.$moment(item.start_time).diff(this.time,"minutes");
if (diffMins <= 5 && diffMins >= 0) {
if (!item._isPlay) {
if (!item._isPlay && !item._isFirst) {
item._isPlay = true
this.$audioPlay()
}
@ -200,12 +202,13 @@ export default {
return 2
}
if (diffMins < 0) {
if (!item._isPlay) {
if (!item._isPlay && !item._isFirst) {
item._isPlay = true
this.$audioPlay()
}
return 4
}
item._isFirst = false
return 1
}
},
@ -250,6 +253,7 @@ export default {
if (newVal && newVal instanceof Array) {
this.scrollList = deepCopy(newVal).map(i => {
i._isPlay = false
i._isFirst = true
return i
})
@ -437,7 +441,7 @@ $list-height: calc(#{$container-height} - 5.33rem);
}
&__time {
flex-basis: 19%;
text-align: center;
text-align: left;
}
&__last {
flex-basis: 9%;

@ -212,6 +212,7 @@ export default {
},false)
).data);
if (res.length > 0) {
this.$audioPlay(2)
this.transfers1.push(...res)
}
this.forwardRefreshTime = this.$moment()

@ -35,6 +35,7 @@
<div class="select-item">
<div class="select-item__title">选择范围</div>
<el-checkbox-group size="small" v-model="select.area">
<el-checkbox-button v-model="isSelectAllArea" @change="e => select.area = e ? areas.map(i => i.value) : []"></el-checkbox-button>
<el-checkbox-button v-for="item in areas" :label="item.value">{{
item.key
}}</el-checkbox-button>
@ -44,6 +45,7 @@
<div class="select-item">
<div class="select-item__title">选择泵闸</div>
<el-checkbox-group size="small" v-model="select.type">
<el-checkbox-button v-model="isSelectAllType" @change="e => select.type = e ? types.map(i => i.value) : []"></el-checkbox-button>
<el-checkbox-button v-for="item in types" :label="item.value">{{
item.key
}}</el-checkbox-button>
@ -133,6 +135,8 @@ export default {
props: {},
data() {
return {
isSelectAllType: false,
isSelectAllArea: false,
equipmentInfos: { shuniu: [], waiwei: [], zhazhan: [] },
templateLoading: false,
templates: [],
@ -565,13 +569,48 @@ export default {
);
},
},
{
title: "机组数量",
key: "bengzhashuliang",
width: 200,
align: "center",
render: (h, { row, index }) => this.$createElement('CheckboxGroup',{
class: "equip-number",
ref: `bengzhashuliang${index}`,
on: {
["on-change"]:e => {
this.$nextTick(() => {
this.data[index].bengzhashuliang = this.$refs[`bengzhashuliang${index}`].$children.reduce((pre, cur) => (pre + (cur.currentValue ? 1 : 0)),0)
})
}
}
}, [
Array.from({ length: Number(row.equipment.bengzhashuliang || 0)},
(_,i) => this.$createElement("Checkbox",{ props: { label: i } }))
])
},
{
title: "类别",
key: "yinpaishui",
width: 100,
width: 160,
align: "center",
render: (h, { row }) =>
h("span", this.abilities.find((i) => i.value === row.leibie)?.key),
render: (h, { row, index }) =>
h("Select", {
props: {
value: this.data[index].leibie,
size: "small"
},
on: {
['on-change']:e => {
this.data[index].leibie = e
}
}
},
this.abilities.map(i => h("Option",{
props: {
value: i.value
}
},i.key))),
},
{
title: "开启时间",
@ -586,6 +625,7 @@ export default {
size: "small",
transfer: true,
format: "HH:mm",
steps: [1,5]
},
on: {
["on-change"]: (e) => {
@ -676,6 +716,7 @@ export default {
size: "small",
transfer: true,
format: "HH:mm",
steps: [1,5]
},
on: {
["on-change"]: (e) => (this.data[index].end_time = e),
@ -799,6 +840,7 @@ export default {
end_time: "",
content: "",
level: 1,
kaiqishuliang: 0,
leibie: this.ability,
situations: i.id_equip_situation_relations_equipment_id_relation
})) || [];
@ -870,6 +912,7 @@ export default {
end_time: i.end_time,
content: i.content,
level: i.level,
kaiqishuliang: i.kaiqishuliang,
}))
),
}).then((_) => {
@ -905,6 +948,7 @@ export default {
end_time: "",
content: "",
level: 1,
kaiqishuliang: 0,
leibie: this.ability,
situations: i.id_equip_situation_relations_equipment_id_relation
})) || [];
@ -1139,6 +1183,7 @@ export default {
end_time: "",
content: "",
level: 1,
kaiqishuliang: 0,
leibie: this.ability,
situations: i.id_equip_situation_relations_equipment_id_relation
})) || [];
@ -1175,6 +1220,7 @@ export default {
end_time: "",
content: "",
level: 1,
kaiqishuliang: 0,
leibie: this.ability,
situations: i.id_equip_situation_relations_equipment_id_relation
})) || [];
@ -1187,6 +1233,7 @@ export default {
end_time: "",
content: "",
level: 1,
kaiqishuliang: 0,
leibie: this.ability,
situations: i.id_equip_situation_relations_equipment_id_relation
})) || [];
@ -1213,6 +1260,12 @@ export default {
</script>
<style scoped lang="scss">
::v-deep .equip-number .ivu-checkbox-inner {
border-radius: 100%;
}
::v-deep .equip-number .ivu-checkbox ~ span {
display: none;
}
.flex-center {
display: flex;
align-items: center;

@ -13,7 +13,7 @@
<template>
<div class="weather-container">
<Card class="weather-container__card" v-for="(item,key) in weatherKv" :style="{ 'background': item.color || '#fff','color': '#fff','border-radius': '14px' }">
<Card class="weather-container__card" :class="'card'+(index+1)" v-for="(item,key,index) in weatherKv" :style="{ 'background': item.color || '#fff','color': '#fff','border-radius': '14px' }">
<template #title>
<div style="display: flex;align-items: center;">
<div style="padding: 0 14px 0 10px;" v-html="item.icon"></div>
@ -251,12 +251,24 @@ export default {
.weather {
&-container {
display: flex;
justify-content: space-between;
display: grid;
grid-gap: 14px;
grid-template-areas:
"weather weather weather weather"
"card2 card3 card4 card5";
@for $index from 1 through 5 {
.card#{$index} {
@if $index == 1{
grid-area: weather;
} @else {
grid-area: card#{$index};
}
}
}
&__card {
flex: 0;
flex-basis: 19%;
//flex: 0;
//flex-basis: 19%;
.text {
max-height: 140px;

@ -518,7 +518,6 @@ export default {
pickNoDistribute () {
this.$refs['xyTable'].getListData()?.forEach(item => {
console.log(item)
if (item.status === 1) {
this.$refs['xyTable'].toggleRowSelection(item)
}
@ -798,12 +797,12 @@ export default {
linkOb.customFn = (row) => {
if (i.edit_input === "file") {
return (
<a
download={row[link_with_name]?.original_name}
href={row[link_with_name]?.url}
<img
style="height: 40px;"
alt={row[link_with_name]?.original_name}
src={row[link_with_name]?.url}
>
{row[link_with_name]?.original_name}
</a>
</img>
);
} else {
return (
@ -823,7 +822,7 @@ export default {
return (
<div style="display: flex;flex-direction: column;">
{row[link_with_name]?.map((o) => (
<a>{o?.original_name || o?.name}</a>
<img alt={o.original_name} src={o?.url}></img>
))}
</div>
);

Loading…
Cancel
Save