|
|
@@ -306,7 +306,10 @@
|
|
|
type="success"
|
|
|
@click="storageProgram"
|
|
|
>存储</el-button>
|
|
|
- <el-button type="primary">发送</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="sendingFun('setdiscontent0')"
|
|
|
+ >发送</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</el-tab-pane>
|
|
|
@@ -378,7 +381,70 @@
|
|
|
type="success"
|
|
|
@click="storageSoundPeriod"
|
|
|
>存储</el-button>
|
|
|
- <el-button type="primary">发送</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="sendingFun('setperiodtime0')"
|
|
|
+ >发送</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane
|
|
|
+ label="语音"
|
|
|
+ name="voice"
|
|
|
+ >
|
|
|
+ <el-form
|
|
|
+ :model="soundPeriodData"
|
|
|
+ label-width="auto"
|
|
|
+ >
|
|
|
+ <el-form-item label="无车">
|
|
|
+ <el-input
|
|
|
+ v-model="voiceData.num0"
|
|
|
+ style="width: 240px;"
|
|
|
+ maxlength="30"
|
|
|
+ show-word-limit
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="正常">
|
|
|
+ <el-input
|
|
|
+ v-model="voiceData.num1"
|
|
|
+ style="width: 240px;"
|
|
|
+ maxlength="30"
|
|
|
+ show-word-limit
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="超速">
|
|
|
+ <el-input
|
|
|
+ v-model="voiceData.num2"
|
|
|
+ style="width: 240px;"
|
|
|
+ maxlength="30"
|
|
|
+ show-word-limit
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="对向">
|
|
|
+ <el-input
|
|
|
+ v-model="voiceData.num3"
|
|
|
+ style="width: 240px;"
|
|
|
+ maxlength="30"
|
|
|
+ show-word-limit
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="双向">
|
|
|
+ <el-input
|
|
|
+ v-model="voiceData.num4"
|
|
|
+ style="width: 240px;"
|
|
|
+ maxlength="30"
|
|
|
+ show-word-limit
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ @click="storageVoice"
|
|
|
+ >存储</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="sendingFun('audionumset0')"
|
|
|
+ >发送</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</el-tab-pane>
|
|
|
@@ -400,11 +466,12 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
-import { addScreens, delScreens, getProjectList, getScreensList, updateScreens } from '@/api/screens'
|
|
|
+import { addScreens, delScreens, getProjectList, getScreensList, sending, updateScreens } from '@/api/screens'
|
|
|
import { ref, onMounted } from 'vue'
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
import { createProgram, updateProgram } from '@/api/program'
|
|
|
-import {createSoundPeriod, updateSoundPeriod} from "@/api/soundPeriod";
|
|
|
+import { createSoundPeriod, updateSoundPeriod } from '@/api/soundPeriod'
|
|
|
+import { createVoice, updateVoice } from '@/api/voice'
|
|
|
|
|
|
const page = ref(1)
|
|
|
const total = ref(0)
|
|
|
@@ -550,6 +617,7 @@ const openSet = (val) => {
|
|
|
showSettingDialog.value = true
|
|
|
deviceSn.value = val.sn
|
|
|
programData.value = val.Program
|
|
|
+ voiceData.value = val.Voice
|
|
|
if (val.soundPeriodId === 0) {
|
|
|
isWarning.value = true
|
|
|
soundPeriodData.value = soundPeriodForm.value
|
|
|
@@ -783,6 +851,65 @@ const storageSoundPeriod = async() => {
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+// 语言
|
|
|
+
|
|
|
+const voiceData = ref()
|
|
|
+
|
|
|
+const storageVoice = async() => {
|
|
|
+ if (voiceData.value.ID === 0) {
|
|
|
+ console.log('create')
|
|
|
+ await createVoice({
|
|
|
+ deviceSn: deviceSn.value,
|
|
|
+ voice: voiceData.value,
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ ElMessage.success('存储成功')
|
|
|
+ }
|
|
|
+ getTableData()
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ console.log('update')
|
|
|
+ await updateVoice({
|
|
|
+ deviceSn: deviceSn.value,
|
|
|
+ voice: voiceData.value,
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ ElMessage.success('存储成功')
|
|
|
+ }
|
|
|
+ getTableData()
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const sendingFun = async(val) => {
|
|
|
+ let json = ''
|
|
|
+ if (val === 'setdiscontent0') {
|
|
|
+ json = JSON.stringify({
|
|
|
+ setdiscontent0: programData.value
|
|
|
+ })
|
|
|
+ } else if (val === 'setperiodtime0') {
|
|
|
+ json = JSON.stringify({
|
|
|
+ setperiodtime0: soundPeriodData.value
|
|
|
+ })
|
|
|
+ } else if (val === 'audionumset0') {
|
|
|
+ json = JSON.stringify({
|
|
|
+ audionumset0: voiceData.value
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ await sending({
|
|
|
+ sn: deviceSn.value,
|
|
|
+ json: json,
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ ElMessage.success('发送成功')
|
|
|
+ }
|
|
|
+ getTableData()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
</script>
|
|
|
<style>
|
|
|
.el-table .success-row {
|