<template>
|
<div class="s-basic-setting">
|
<!-- GB28181设置 -->
|
<el-form :model="gb28181" :rules="rules" label-width="130px" class="alarmSetting" ref="gb28181">
|
<!-- <el-form-item label="国际服务器IP" prop="ServerIp">
|
<ip-input :ip="gb28181.ServerIp" @on-blur="gb28181.ServerIp = arguments[0]"></ip-input>
|
</el-form-item>-->
|
|
<div style="text-align: left;margin-bottom: 22px;">
|
<el-radio-group v-model="gb28181.idType">
|
<el-radio :label="0">输入已有ID</el-radio>
|
<el-radio :label="1">生成新的ID</el-radio>
|
</el-radio-group>
|
</div>
|
|
<el-form-item label="所在地">
|
<el-select
|
v-model="locationCity.province"
|
@change="changeProvince"
|
size="small"
|
placeholder="请选择省份"
|
>
|
<el-option
|
v-for="item in locationCity.provinceOptions"
|
:key="item.id"
|
:label="item.name"
|
size="small"
|
:value="item.id"
|
></el-option>
|
</el-select>
|
<el-select
|
class="ml10 mr10"
|
v-model="locationCity.city"
|
:disabled="!locationCity.province"
|
@change="changeCity"
|
size="small"
|
placeholder="请选择城市"
|
>
|
<el-option
|
v-for="item in locationCity.cityOptions"
|
:key="item.id"
|
:label="item.name"
|
:value="item.id"
|
></el-option>
|
</el-select>
|
<el-select
|
v-model="locationCity.county"
|
:disabled="!locationCity.city"
|
size="small"
|
placeholder="请选择区县"
|
>
|
<el-option
|
v-for="item in locationCity.countyOptions"
|
:key="item.id"
|
:label="item.name"
|
:value="item.id"
|
></el-option>
|
</el-select>
|
<el-button
|
type="text"
|
style="position: absolute"
|
v-show="gb28181.idType === 1"
|
@click="newGBID"
|
>生成ID</el-button>
|
</el-form-item>
|
|
<!-- <el-form-item label="国际服务器端口" prop="GbServerPort">
|
<el-input v-model.number="gb28181.ServerPort" placeholder="请输入" size="small"></el-input>
|
</el-form-item>-->
|
|
<el-form-item label="国标ID">
|
<el-input v-model="gb28181.PublicId" placeholder="请输入" size="small"></el-input>
|
</el-form-item>
|
|
<el-form-item label="国标端口" prop="ServerPort">
|
<el-input v-model.number="gb28181.GbServerPort" placeholder="请输入" size="small"></el-input>
|
</el-form-item>
|
|
<el-form-item label="开启鉴权">
|
<el-switch v-model="gb28181.IsAuth"></el-switch>
|
</el-form-item>
|
|
<el-form-item label="鉴权密码" v-show="gb28181.IsAuth">
|
<el-input v-model="gb28181.Password" placeholder="请输入" size="small"></el-input>
|
</el-form-item>
|
|
<el-form-item>
|
<el-button type="primary" @click="submitGB28281" size="small">保存</el-button>
|
</el-form-item>
|
</el-form>
|
</div>
|
</template>
|
|
<script>
|
import {
|
getGB28181Config,
|
saveGB28181Config,
|
getGb28181AreaList,
|
newGb28181ID
|
} from "./api";
|
|
import { isPort, isIPv4 } from "@/scripts/validate";
|
|
export default {
|
name: "Gb28181Setting",
|
directives: {
|
focus: {
|
inserted: function (el) {
|
el.querySelector('input').focus()
|
}
|
}
|
},
|
data() {
|
return {
|
gb28181: {
|
|
},
|
idType: 1,
|
rules: {
|
ip: [
|
{
|
required: true,
|
message: "请输入IP地址",
|
trigger: "change"
|
},
|
{ validator: isIPv4, trigger: "change" }
|
],
|
ServerIp: [
|
{
|
required: true,
|
message: "请输入IP地址",
|
trigger: "change"
|
},
|
{ validator: isIPv4, trigger: "change" }
|
],
|
ServerPort: [
|
{
|
required: true,
|
message: "请输入端口",
|
trigger: "change"
|
},
|
{ validator: isPort, trigger: "change" }
|
],
|
GbServerPort: [
|
{
|
required: true,
|
message: "请输入端口",
|
trigger: "change"
|
},
|
{ validator: isPort, trigger: "change" }
|
]
|
},
|
locationCity: {
|
province: '',
|
city: '',
|
county: '',
|
provinceOptions: [],
|
cityOptions: [],
|
countyOptions: []
|
},
|
};
|
},
|
mounted() {
|
//this.$nextTick(()=>{
|
this.initGB28181Conf();
|
//})
|
},
|
methods: {
|
initGB28181Conf() {
|
getGB28181Config().then(rsp => {
|
if (rsp && rsp.success) {
|
this.gb28181 = rsp.data;
|
//this.gb28181.idType = 0;
|
this.$set(this.gb28181,'idType',0);
|
}
|
});
|
getGb28181AreaList().then(rsp => {
|
if (rsp && rsp.success) {
|
this.locationCity.provinceOptions = rsp.data;
|
}
|
})
|
},
|
submitGB28281() {
|
this.$refs["gb28181"].validate(valid => {
|
if (valid) {
|
saveGB28181Config(this.gb28181).then(rsp => {
|
if (rsp && rsp.success) {
|
this.$notify({
|
type: "success",
|
message: "GB28181设置保存成功"
|
});
|
}
|
});
|
} else {
|
console.log("error submit!!");
|
return false;
|
}
|
});
|
},
|
changeProvince() {
|
let pid = this.locationCity.province;
|
getGb28181AreaList({ parentId: pid }).then(rsp => {
|
if (rsp && rsp.success) {
|
this.locationCity.cityOptions = rsp.data;
|
this.locationCity.city = this.locationCity.cityOptions[0].id;
|
this.changeCity();
|
}
|
})
|
},
|
changeCity() {
|
let pid = this.locationCity.city;
|
getGb28181AreaList({ parentId: pid }).then(rsp => {
|
if (rsp && rsp.success) {
|
this.locationCity.countyOptions = rsp.data;
|
this.locationCity.county = this.locationCity.countyOptions[0].id;
|
}
|
})
|
},
|
newGBID() {
|
let cCode = this.locationCity.county + "";
|
newGb28181ID({ code: cCode }).then(rsp => {
|
if (rsp && rsp.success) {
|
this.gb28181.PublicId = rsp.data;
|
}
|
})
|
}
|
}
|
};
|
</script>
|
<style lang="scss">
|
.s-basic-setting {
|
height: 100%;
|
padding: 0 30px;
|
.el-form {
|
margin-top: 30px;
|
// margin-left: -80px;
|
.el-form-item {
|
text-align: left;
|
.el-button {
|
float: right;
|
}
|
|
.el-form-item__content {
|
text-align: left;
|
input {
|
max-width: 360px;
|
}
|
.el-date-editor.el-input,
|
.el-date-editor.el-input__inner {
|
width: 216px;
|
}
|
.el-checkbox__label {
|
padding-left: 5px;
|
}
|
}
|
|
.el-form-item__label {
|
text-align: left;
|
}
|
}
|
}
|
.alarmSetting {
|
.el-input {
|
width: 100%;
|
// padding-right: 10px;
|
}
|
.el-select {
|
max-width: 113px;
|
}
|
.el-slider {
|
width: calc(100% - 120px);
|
display: inline-block;
|
padding-right: 30px;
|
box-sizing: border-box;
|
vertical-align: middle;
|
}
|
.el-input-number {
|
width: 100px;
|
display: inline-block;
|
.el-input {
|
width: 100%;
|
}
|
}
|
}
|
|
.time-type {
|
height: 25px;
|
width: 413px;
|
line-height: 28px;
|
padding: 3px 23px;
|
font-size: 14px;
|
font-weight: 600;
|
background-color: #e4e6ed;
|
}
|
#e-basic-setting {
|
.el-tabs__header {
|
border: 0px solid #dcdfe6;
|
.el-tabs__item {
|
padding: 5px 50px;
|
height: 50px;
|
font-family: PingFangSC-Regular;
|
font-size: 14px;
|
color: #222222;
|
text-align: center;
|
border: 0px solid transparent;
|
}
|
.el-tabs__item:nth-child(2) {
|
padding-left: 50px;
|
}
|
.el-tabs__item:last-child {
|
padding-right: 50px;
|
}
|
.el-tabs__item.is-active {
|
color: #ff7733;
|
font-weight: bold;
|
// border-right-color: #fff;
|
// border-left-color: #fff;
|
}
|
.el-tabs__item:not(.is-disabled):hover {
|
color: #ff7733;
|
}
|
}
|
.el-tabs__active-bar {
|
background-color: #ff7733;
|
}
|
.xiangqin-label {
|
text-align: left;
|
width: 85px;
|
font-size: 14px;
|
line-height: 30px;
|
}
|
.xiangqing-info {
|
text-align: left;
|
font-size: 14px;
|
line-height: 30px;
|
}
|
}
|
|
#cut_min_duration {
|
.el-slider__bar {
|
background-color: #3d68e1;
|
}
|
.el-slider__button {
|
width: 10px;
|
height: 10px;
|
border: 4px solid #3d68e1;
|
}
|
}
|
|
#cut_max_duration {
|
.el-slider__bar {
|
background-color: #ff9e6e;
|
}
|
.el-slider__button {
|
width: 10px;
|
height: 10px;
|
border: 4px solid #ff9e6e;
|
}
|
}
|
.menu-css,
|
.el-menu {
|
border-right: none;
|
list-style: none;
|
position: relative;
|
margin: 0;
|
padding-left: 0;
|
background-color: #ffffff;
|
.el-submenu__title {
|
height: 35px;
|
line-height: 35px;
|
font-size: 14px;
|
color: #303133;
|
padding: 0 20px;
|
list-style: none;
|
cursor: pointer;
|
position: relative;
|
-webkit-transition: border-color 0.3s, background-color 0.3s, color 0.3s;
|
transition: border-color 0.3s, background-color 0.3s, color 0.3s;
|
-webkit-box-sizing: border-box;
|
box-sizing: border-box;
|
white-space: nowrap;
|
}
|
.tree-font {
|
font-family: PingFangSC-Medium;
|
font-size: 14px;
|
color: #222222;
|
text-align: left;
|
}
|
li {
|
text-align: left;
|
.el-submenu__title {
|
// border-bottom: solid 1px #e6e6e6;
|
padding-left: 10px !important;
|
background-color: #e4e6ed !important;
|
border-radius: 2px;
|
.el-submenu__icon-arrow {
|
position: absolute;
|
top: 50%;
|
right: auto;
|
left: 135px;
|
margin-top: -7px;
|
-webkit-transition: -webkit-transform 0.3s;
|
transition: -webkit-transform 0.3s;
|
transition: transform 0.3s;
|
transition: transform 0.3s, -webkit-transform 0.3s;
|
font-size: 12px;
|
}
|
}
|
}
|
}
|
.save-btn {
|
text-align: right;
|
position: relative;
|
right: 40px;
|
}
|
}
|
</style>
|
<style lang="scss" scoped>
|
.menu-css,
|
.el-menu {
|
border-right: none;
|
list-style: none;
|
position: relative;
|
margin: 0;
|
padding-left: 0;
|
background-color: #ffffff;
|
|
.tree-font {
|
font-family: PingFangSC-Medium;
|
font-size: 14px;
|
color: #222222;
|
text-align: left;
|
}
|
li {
|
text-align: left;
|
.el-submenu__title {
|
.el-submenu__icon-arrow {
|
position: absolute;
|
top: 50%;
|
right: 0;
|
margin-top: -7px;
|
-webkit-transition: -webkit-transform 0.3s;
|
transition: -webkit-transform 0.3s;
|
transition: transform 0.3s;
|
transition: transform 0.3s, -webkit-transform 0.3s;
|
font-size: 12px;
|
}
|
}
|
}
|
}
|
</style>
|