Files
wvp-platform/web/src/views/jtDevice/channel/edit.vue

90 lines
2.6 KiB
Vue
Raw Normal View History

2025-05-11 08:01:45 +08:00
<template>
2025-05-14 18:01:12 +08:00
<div id="channelEdit" style="width: 100%; height: 100%">
2025-05-11 08:01:45 +08:00
<div class="page-header">
<div class="page-title">
2025-05-14 18:01:12 +08:00
<el-page-header content="编辑推流信息" @back="close" />
2025-05-11 08:01:45 +08:00
</div>
</div>
2025-05-14 18:01:12 +08:00
<el-tabs tab-position="left" style="padding: 1rem; height: calc(100% - 24px)">
<el-tab-pane label="部标通道编辑" style="background-color: #FFFFFF;">
<el-form ref="form" :rules="rules" :model="jtChannel" label-width="60px" style="width: 40rem; margin: 0 auto">
2025-05-11 08:01:45 +08:00
<el-form-item label="编号" prop="channelId">
2025-05-14 18:01:12 +08:00
<el-input v-model="jtChannel.channelId" clearable />
2025-05-11 08:01:45 +08:00
</el-form-item>
<el-form-item label="名称" prop="name">
2025-05-14 18:01:12 +08:00
<el-input v-model="jtChannel.name" clearable />
2025-05-11 08:01:45 +08:00
</el-form-item>
2025-05-14 18:01:12 +08:00
<el-form-item style="text-align: right">
2025-05-11 08:01:45 +08:00
<el-button type="primary" @click="onSubmit">保存</el-button>
<el-button @click="close">取消</el-button>
</el-form-item>
</el-form>
2025-05-14 18:01:12 +08:00
2025-05-11 08:01:45 +08:00
</el-tab-pane>
2025-05-14 18:01:12 +08:00
<el-tab-pane :disabled="!jtChannel.id" label="国标通道配置">
<CommonChannelEdit ref="commonChannelEdit" :data-form="jtChannel" :cancel="close" />
2025-05-11 08:01:45 +08:00
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
2025-05-14 18:01:12 +08:00
import CommonChannelEdit from '../../common/CommonChannelEdit'
2025-05-11 08:01:45 +08:00
export default {
2025-05-14 18:01:12 +08:00
name: 'ChannelEdit',
2025-05-11 08:01:45 +08:00
components: {
CommonChannelEdit
},
2025-05-14 18:01:12 +08:00
props: ['jtChannel', 'closeEdit'],
2025-05-11 08:01:45 +08:00
data() {
return {
version: 3,
rules: {
2025-05-14 18:01:12 +08:00
deviceId: [{ required: true, message: '请输入设备编号', trigger: 'blur' }]
2025-05-11 08:01:45 +08:00
},
isLoading: false,
2025-05-14 18:01:12 +08:00
loadSnap: {}
}
2025-05-11 08:01:45 +08:00
},
mounted() {},
methods: {
2025-05-14 18:01:12 +08:00
onSubmit: function() {
2025-05-11 08:01:45 +08:00
console.log(this.jtChannel)
2025-05-14 18:01:12 +08:00
const isEdit = typeof (this.jtChannel.id) !== 'undefined'
if (isEdit) {
this.$store.dispatch('jtDevice/updateChannel')
.then(data => {
this.$message({
showClose: true,
message: '保存成功',
type: 'success'
})
this.jtChannel = data
})
.catch(function(error) {
console.log(error)
})
} else {
this.$store.dispatch('jtDevice/addChannel')
.then(data => {
this.$message({
showClose: true,
message: '保存成功',
type: 'success'
})
this.jtChannel = data
})
.catch(function(error) {
console.log(error)
})
}
2025-05-11 08:01:45 +08:00
},
2025-05-14 18:01:12 +08:00
close: function() {
2025-05-11 08:01:45 +08:00
this.closeEdit()
2025-05-14 18:01:12 +08:00
}
2025-05-11 08:01:45 +08:00
}
2025-05-14 18:01:12 +08:00
}
2025-05-11 08:01:45 +08:00
</script>