修复拉流代理相关问题
This commit is contained in:
@@ -67,7 +67,7 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="拉流方式(RTSP)" prop="rtpType" v-if="streamProxy.type ==='default'">
|
||||
<el-form-item label="拉流方式(RTSP)" prop="rtpType">
|
||||
<el-select
|
||||
v-model="streamProxy.rtspType"
|
||||
style="width: 100%"
|
||||
@@ -79,10 +79,13 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="无人观看" prop="rtpType" >
|
||||
<el-radio v-model="streamProxy.noneReader" label="0">不做处理</el-radio>
|
||||
<el-radio v-model="streamProxy.noneReader" label="1">停用</el-radio>
|
||||
<el-radio v-model="streamProxy.noneReader" label="2">移除</el-radio>
|
||||
<el-form-item label="无人观看" prop="noneReader" >
|
||||
<el-radio-group v-model="streamProxy.noneReader">
|
||||
<el-radio :label="0">不做处理</el-radio>
|
||||
<el-radio :label="1">停用</el-radio>
|
||||
<el-radio :label="2">移除</el-radio>
|
||||
</el-radio-group>
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item label="其他选项">
|
||||
<div style="float: left;">
|
||||
@@ -94,7 +97,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<div style="float: right;">
|
||||
<el-button type="primary" @click="onSubmit" :loading="locading" >保存</el-button>
|
||||
<el-button type="primary" @click="onSubmit" :loading="saveLoading" >保存</el-button>
|
||||
<el-button @click="close">取消</el-button>
|
||||
</div>
|
||||
|
||||
@@ -114,7 +117,7 @@ import MediaServer from "./service/MediaServer";
|
||||
|
||||
export default {
|
||||
name: "channelEdit",
|
||||
props: [ 'streamProxy', 'closeEdit'],
|
||||
props: [ 'value', 'closeEdit'],
|
||||
components: {
|
||||
CommonChannelEdit,
|
||||
},
|
||||
@@ -126,7 +129,8 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
locading: false,
|
||||
saveLoading: false,
|
||||
streamProxy: this.value,
|
||||
mediaServer: new MediaServer(),
|
||||
mediaServerList:{},
|
||||
ffmpegCmdList:{},
|
||||
@@ -142,7 +146,9 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
onSubmit: function () {
|
||||
this.locading = true;
|
||||
console.log(typeof this.streamProxy.noneReader)
|
||||
this.saveLoading = true;
|
||||
|
||||
this.noneReaderHandler();
|
||||
if (this.streamProxy.id) {
|
||||
this.$axios({
|
||||
@@ -150,17 +156,19 @@ export default {
|
||||
url:`/api/proxy/update`,
|
||||
data: this.streamProxy
|
||||
}).then((res)=> {
|
||||
this.saveLoading = false;
|
||||
if (typeof (res.data.code) != "undefined" && res.data.code === 0) {
|
||||
this.$message.success("保存成功");
|
||||
this.locading = false;
|
||||
this.streamProxy = res.data.data
|
||||
}else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
}).catch((error) =>{
|
||||
this.$message.error(res.data.error);
|
||||
this.$message.error(error);
|
||||
this.saveLoading = false;
|
||||
}).finally(()=>{
|
||||
this.locading = false;
|
||||
console.log("finally==finally")
|
||||
this.saveLoading = false;
|
||||
})
|
||||
}else {
|
||||
this.$axios({
|
||||
@@ -168,17 +176,18 @@ export default {
|
||||
url:`/api/proxy/add`,
|
||||
data: this.streamProxy
|
||||
}).then((res)=> {
|
||||
this.saveLoading = false;
|
||||
if (typeof (res.data.code) != "undefined" && res.data.code === 0) {
|
||||
this.$message.success("保存成功");
|
||||
this.locading = false;
|
||||
this.streamProxy = res.data.data
|
||||
}else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
}).catch((error) =>{
|
||||
this.$message.error(res.data.error);
|
||||
this.saveLoading = false;
|
||||
}).finally(()=>{
|
||||
this.locading = false;
|
||||
this.saveLoading = false;
|
||||
})
|
||||
}
|
||||
|
||||
@@ -205,13 +214,13 @@ export default {
|
||||
},
|
||||
noneReaderHandler: function() {
|
||||
console.log(this.streamProxy)
|
||||
if (this.streamProxy.noneReader === null || this.streamProxy.noneReader === "0" || !this.streamProxy.noneReader) {
|
||||
if (this.streamProxy.noneReader === null || this.streamProxy.noneReader === 0 || !this.streamProxy.noneReader) {
|
||||
this.streamProxy.enableDisableNoneReader = false;
|
||||
this.streamProxy.enableRemoveNoneReader = false;
|
||||
}else if (this.streamProxy.noneReader === "1"){
|
||||
}else if (this.streamProxy.noneReader === 1){
|
||||
this.streamProxy.enableDisableNoneReader = true;
|
||||
this.streamProxy.enableRemoveNoneReader = false;
|
||||
}else if (this.streamProxy.noneReader ==="2"){
|
||||
}else if (this.streamProxy.noneReader ===2){
|
||||
this.streamProxy.enableDisableNoneReader = false;
|
||||
this.streamProxy.enableRemoveNoneReader = true;
|
||||
}
|
||||
|
||||
@@ -80,8 +80,6 @@
|
||||
编辑
|
||||
</el-button>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<el-button size="medium" icon="el-icon-check" type="text" :loading="scope.row.startBtnLoading" v-if="!scope.row.enable" @click="start(scope.row)">启用</el-button>
|
||||
<el-divider v-if="!scope.row.enable" direction="vertical"></el-divider>
|
||||
<el-button size="medium" icon="el-icon-cloudy" type="text" @click="queryCloudRecords(scope.row)">云端录像</el-button>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<el-button size="medium" icon="el-icon-delete" type="text" style="color: #f56c6c" @click="deleteStreamProxy(scope.row)">删除</el-button>
|
||||
@@ -101,7 +99,7 @@
|
||||
</div>
|
||||
<streamProxyEdit ref="streamProxyEdit" ></streamProxyEdit>
|
||||
<onvifEdit ref="onvifEdit" ></onvifEdit>
|
||||
<StreamProxyEdit v-if="streamProxy" :streamProxy="streamProxy" :closeEdit="closeEdit" ></StreamProxyEdit>
|
||||
<StreamProxyEdit v-if="streamProxy" v-model="streamProxy" :closeEdit="closeEdit" ></StreamProxyEdit>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -199,7 +197,7 @@
|
||||
// this.$refs.streamProxyEdit.openDialog(null, this.initData)
|
||||
this.streamProxy = {
|
||||
type: "default",
|
||||
noneReader: "1",
|
||||
noneReader: 1,
|
||||
enable: true,
|
||||
enableAudio: true,
|
||||
mediaServerId: "",
|
||||
@@ -232,6 +230,13 @@
|
||||
|
||||
},
|
||||
edit: function(row){
|
||||
if (row.enableDisableNoneReader) {
|
||||
this.$set(row, "noneReader", 1)
|
||||
}else if (row.enableRemoveNoneReader) {
|
||||
this.$set(row, "noneReader", 2)
|
||||
}else {
|
||||
this.$set(row, "noneReader", 0)
|
||||
}
|
||||
this.streamProxy = row
|
||||
},
|
||||
closeEdit: function(row){
|
||||
@@ -241,11 +246,9 @@
|
||||
let that = this;
|
||||
this.$axios({
|
||||
method: 'get',
|
||||
url:`/api/media/getPlayUrl`,
|
||||
url:`/api/proxy/start`,
|
||||
params: {
|
||||
app: row.app,
|
||||
stream: row.stream,
|
||||
mediaServerId: row.mediaServerId
|
||||
id: row.id,
|
||||
}
|
||||
}).then(function (res) {
|
||||
if (res.data.code === 0) {
|
||||
|
||||
Reference in New Issue
Block a user