|
|
@ -4,14 +4,22 @@ |
|
|
|
<div class="body"> |
|
|
|
<div class="left"> |
|
|
|
<div class="title">路测广播列表</div> |
|
|
|
<CheckboxGroup class="checkbox-group" :value="[]" :options="options" /> |
|
|
|
<CheckboxGroup class="checkbox-group" v-model="checkList" :options="musicList" id="otherConfig" |
|
|
|
label="deviceName"> |
|
|
|
<template #[otherConfig]="{ data }"> |
|
|
|
<span style="color: #6EE5FE;"> |
|
|
|
{{ data.deviceName }}(当前设备) |
|
|
|
</span> |
|
|
|
</template> |
|
|
|
</CheckboxGroup> |
|
|
|
</div> |
|
|
|
<div class="right"> |
|
|
|
<div class="top-content"> |
|
|
|
<Video class="item-video" /> |
|
|
|
<Video class="item-video" :pileNum="pileNum" /> |
|
|
|
|
|
|
|
<label>发布内容: </label> |
|
|
|
<ElInput type="textarea" :autosize="{ minRows: 3, maxRows: 3 }" :maxlength="150" showWordLimit /> |
|
|
|
<ElInput type="textarea" v-model="releaseMessage" :autosize="{ minRows: 3, maxRows: 3 }" :maxlength="150" |
|
|
|
showWordLimit placeholder="请输入发布内容" /> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="footer"> |
|
|
@ -25,8 +33,6 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!-- <Form class="form" ref="FormConfigRef" :formList="formList" column="1" style="flex: 1;" labelWidth="120px" /> --> |
|
|
|
|
|
|
|
</div> |
|
|
|
</Dialog> |
|
|
|
</template> |
|
|
@ -38,11 +44,9 @@ import Form from '@screen/components/FormConfig'; |
|
|
|
import Video from "@screen/components/Video" |
|
|
|
import CheckboxGroup from "@screen/components/FormConfig/components/ElCheckboxGroup.vue" |
|
|
|
|
|
|
|
import { delay } from "@screen/utils/common.js" |
|
|
|
import request from "@/utils/request"; |
|
|
|
import { getDeviceList } from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js"; |
|
|
|
|
|
|
|
import { Message } from "element-ui"; |
|
|
|
// import { axiosIns } from "@screen/utils/axios/auth.js"; |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'BroadcastReleases', |
|
|
@ -59,15 +63,17 @@ export default { |
|
|
|
}, |
|
|
|
props: { |
|
|
|
visible: Boolean, |
|
|
|
deviceId: String |
|
|
|
deviceId: String, |
|
|
|
pileNum: String, |
|
|
|
currentId: [String, Number], |
|
|
|
otherConfig: Object |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
submitting: false, |
|
|
|
options: Array.from({ length: 24 }).map((_, index) => ({ |
|
|
|
key: index, |
|
|
|
label: "阿发" |
|
|
|
})) |
|
|
|
checkList: [], |
|
|
|
releaseMessage: null, |
|
|
|
musicList: [] |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
@ -80,44 +86,44 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
modelVisible: { |
|
|
|
immediate: true, |
|
|
|
handler(bool) { |
|
|
|
if (!bool) return; |
|
|
|
|
|
|
|
this.reDisplay(); |
|
|
|
} |
|
|
|
} |
|
|
|
created() { |
|
|
|
getDeviceList(5) |
|
|
|
.then(data => { |
|
|
|
if (Array.isArray(data)) this.musicList = data; |
|
|
|
}) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
reDisplay() { |
|
|
|
}, |
|
|
|
handleSubmit() { |
|
|
|
const result = {}, formData = this.$refs.FormConfigRef?.formData; |
|
|
|
|
|
|
|
let functionId = 51; |
|
|
|
|
|
|
|
result.mode = formData.controlType === 'manual' ? "00" : "01"; |
|
|
|
|
|
|
|
delete result.controlType; |
|
|
|
|
|
|
|
if (result.mode === '01') { |
|
|
|
if (!formData.displayTime?.length) return Message.error(`时间不能为空!`); |
|
|
|
result.startDisplayTime = formData.displayTime[0]; |
|
|
|
result.endDisplayTime = formData.displayTime[1]; |
|
|
|
delete result.displayTime; |
|
|
|
} else { |
|
|
|
if (!formData.onWorkStatus || !formData.inWorkStatus) return Message.error(`工作状态不能为空!`); |
|
|
|
|
|
|
|
result.onWorkStatus = formData.onWorkStatus |
|
|
|
result.inWorkStatus = formData.inWorkStatus |
|
|
|
} |
|
|
|
if (!this.releaseMessage?.trim()) return Message.error("发布内容不能为空!"); |
|
|
|
if (!this.checkList.length) return Message.error("请至少选择一个广播设备!"); |
|
|
|
|
|
|
|
this.submitting = true; |
|
|
|
|
|
|
|
// this.submitting = false; |
|
|
|
// return; |
|
|
|
request({ |
|
|
|
url: `/broadcast/broadcastFunctionCall`, |
|
|
|
method: "post", |
|
|
|
data: { |
|
|
|
"name": "task-3", |
|
|
|
"outVol": "6", |
|
|
|
"priority": "1", |
|
|
|
"text": this.releaseMessage.trim(), |
|
|
|
"repeatTimes": "3", |
|
|
|
"termList": this.checkList.map(str => JSON.parse(str)), |
|
|
|
"functionType": "startPaTts" |
|
|
|
} |
|
|
|
}) |
|
|
|
.then(data => { |
|
|
|
console.log(data); |
|
|
|
if (data.code == '200') { |
|
|
|
Message.success("广播发布成功!"); |
|
|
|
this.modelVisible = false; |
|
|
|
} else { |
|
|
|
Message.error("广播发布失败!"); |
|
|
|
} |
|
|
|
}) |
|
|
|
.finally(() => { |
|
|
|
this.submitting = false; |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
@ -126,7 +132,7 @@ export default { |
|
|
|
<style lang='scss' scoped> |
|
|
|
.BroadcastReleases { |
|
|
|
// width: 450px; |
|
|
|
height: 397px; |
|
|
|
height: 420px; |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
gap: 15px; |
|
|
@ -168,7 +174,6 @@ export default { |
|
|
|
|
|
|
|
.item-video { |
|
|
|
width: 545px; |
|
|
|
height: 216px; |
|
|
|
} |
|
|
|
|
|
|
|
label { |
|
|
|