mes_mobile/pages/equipmentManage/bindingDevice.vue

170 lines
5.1 KiB
Vue
Raw Normal View History

2024-02-19 16:53:38 +08:00
<template>
<!-- 绑定安全生产监控相机 -->
<view>
2024-04-11 18:54:43 +08:00
<view class="page_padding">
2024-02-19 16:53:38 +08:00
<view class="page_content contentboxsty font13">
<view class="content_row">
2024-04-30 16:08:07 +08:00
<view class="name font_bold">串流推流Url</view>
<view class="text">
<input v-model="form.stream_url" placeholder="请输入串流推流Url" disabled/>
2024-02-19 16:53:38 +08:00
</view>
</view>
<view class="content_row">
2024-04-30 16:08:07 +08:00
<view class="name font_bold">AppName</view>
<view class="text">
<input v-model="form.app_name" placeholder="请输入APP名称"/>
2024-02-19 16:53:38 +08:00
</view>
</view>
<view class="content_row noborbot">
<view class="name"></view>
<view class="tip">
不超过256字符支持数字大小写字母短划线-下划线_等号=
</view>
</view>
<view class="content_row">
2024-04-30 16:08:07 +08:00
<view class="name font_bold">StreamName</view>
<view class="text">
<input v-model="form.stream_name" placeholder="请输入StreamName"/>
2024-02-19 16:53:38 +08:00
</view>
</view>
<view class="content_row noborbot">
<view class="name"></view>
<view class="tip">
不超过256字符支持数字大小写字母短划线-下划线_等号=
</view>
</view>
<view class="content_row">
2024-04-30 16:08:07 +08:00
<view class="name font_bold">设备IP</view>
<view class="text">
<input v-model="form.monitor_ip" placeholder="请输入设备IP"/>
2024-02-19 16:53:38 +08:00
</view>
</view>
<view class="content_row">
2024-04-30 16:08:07 +08:00
<view class="name font_bold">端口</view>
<view class="text">
<input v-model="form.monitor_port" placeholder="请输入设备端口"/>
2024-02-19 16:53:38 +08:00
</view>
</view>
<view class="content_row">
2024-04-30 16:08:07 +08:00
<view class="name font_bold">用户名</view>
<view class="text">
<input v-model="form.monitor_account" placeholder="请输入您的用户名"/>
2024-02-19 16:53:38 +08:00
</view>
</view>
<view class="content_row">
2024-04-30 16:08:07 +08:00
<view class="name font_bold">密码</view>
<view class="text">
<input password type="safe-password" v-model="form.monitor_password" placeholder="请输入密码"/>
2024-02-19 16:53:38 +08:00
</view>
</view>
<view class="content_row">
2024-04-30 16:08:07 +08:00
<view class="name font_bold">监控推流权限</view>
<view class="text flex_layout">
<view class="switch" @click="form.stream_type=1">
<view v-if="form.stream_type ==1" class="t-icon t-icon-qiyong1 contenticon"></view>
<view v-else class="t-icon t-icon-jinyong1 contenticon"></view>
<text class="text">Token验证</text>
</view>
<view class="switch" @click="form.stream_type=2">
<view v-if="form.stream_type ==2" class="t-icon t-icon-qiyong1 contenticon"></view>
<view v-else class="t-icon t-icon-jinyong1 contenticon"></view>
<text class="text">禁用</text>
</view>
2024-02-19 16:53:38 +08:00
</view>
</view>
</view>
2024-04-11 18:54:43 +08:00
</view>
<view class="bottom_but flex_layout">
2024-04-30 16:08:07 +08:00
<view class="but_color font13" @click="save">保存</view>
<view class="font13" @click="cancel">取消</view>
2024-02-19 16:53:38 +08:00
</view>
</view>
</template>
<script>
export default {
data() {
return {
2024-04-30 16:08:07 +08:00
form:{
id:'',
stream_url:'',
app_name:'',
stream_name:'',
stream_type:1,
monitor_ip:'',
monitor_port:'',
monitor_account:'',
monitor_password:''
}
2024-02-19 16:53:38 +08:00
}
2024-04-30 16:08:07 +08:00
},
onLoad(option) {
this.form.id = option.id;
this.getVideo(option.id);
},
onReady() {
2024-02-19 16:53:38 +08:00
},
methods: {
2024-04-30 16:08:07 +08:00
getVideo(id){
this.$api.request('/get.video.config',{id:id}).then(res=>{
this.form.stream_url = res.data.stream_url;
if(res.data.app_name && res.data.eq_name){
this.form.app_name = res.data.app_name;
this.form.stream_name = res.data.stream_name;
this.form.stream_type = res.data.stream_type;
this.form.monitor_ip = res.data.monitor_ip;
this.form.monitor_port = res.data.monitor_port;
this.form.monitor_account = res.data.monitor_account;
this.form.monitor_password = res.data.monitor_password;
}
}).catch(err=>{
})
},
save(){
this.$api.postFuncLoading('/bind.video.config',this.form).then(res=>{
this.parentClick();
this.reset();
this.$wf.toast({type:'success',text:'保存成功'});
}).catch(err=>{
})
},
cancel(){
this.reset();
},
reset(){
this.form.app_name = '';
this.form.stream_name = '';
this.form.stream_type = 1;
this.form.monitor_ip = '';
this.form.monitor_port = '';
this.form.monitor_account = '';
this.form.monitor_password = '';
},
parentClick(){
const pages = getCurrentPages();
if (pages.length >= 2) {
const prevPage = pages[pages.length - 2];
prevPage.$vm.getList();
}
}
2024-02-19 16:53:38 +08:00
}
}
</script>
2024-04-30 16:08:07 +08:00
<style scoped lang="scss">
2024-02-19 16:53:38 +08:00
.page_content{padding: 0 12px;}
.content_row{display: flex;border-bottom: 1px solid #2D3A6F;height: 44px;align-items: center;
2024-04-30 16:08:07 +08:00
.name{flex-basis: 96px;}
.text{flex: 1;}
2024-02-19 16:53:38 +08:00
.tip{width: 70%;font-size: 10px;color: #666;}
.flex_layout{
2024-04-30 16:08:07 +08:00
.contenticon{width: 16px;height: 16px;}
2024-02-19 16:53:38 +08:00
.text{padding: 0 20px 0 5px;}
}
2024-04-30 16:08:07 +08:00
}
.switch{display: flex;align-items: center;}
2024-02-19 16:53:38 +08:00
</style>