| | |
| | | <template> |
| | | <div class="s-basic-setting"> |
| | | <!-- GB28181设置 --> |
| | | <el-form :model="gb28181" :rules="rules" label-width="140px" 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 class="s-basic-setting" @contextmenu.prevent="toOpenMenuList"> |
| | | <el-menu |
| | | :default-openeds="openeds" |
| | | background-color="#fff" |
| | | text-color="#303133" |
| | | active-text-color="#409EFF" |
| | | style="height: 100%;" |
| | | class="menu-css" |
| | | @open="menuOpen" |
| | | @close="menuClose" |
| | | > |
| | | <el-submenu index="0"> |
| | | <template slot="title"> |
| | | <b class="tree-font">国际ID</b> |
| | | </template> |
| | | <el-menu-item-group class="item-group"> |
| | | <!-- 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> |
| | | <div style="text-align: left;margin-bottom: 16px;"> |
| | | <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="所在地"> |
| | | <el-select |
| | | v-model="locationCity.province" |
| | | @change="changeProvince" |
| | | size="small" |
| | | placeholder="请选择省份" |
| | | :disabled="gb28181.idType === 0" |
| | | > |
| | | <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="国际服务器端口" 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="国标ID"> |
| | | <el-input |
| | | v-model="gb28181.PublicId" |
| | | placeholder="请输入" |
| | | size="small" |
| | | :disabled="gb28181.idType === 1" |
| | | ></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="国标端口" 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="开启鉴权"> |
| | | <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 label="鉴权密码" v-show="gb28181.IsAuth"> |
| | | <el-input |
| | | v-model="gb28181.Password" |
| | | placeholder="请输入" |
| | | size="small" |
| | | ></el-input> |
| | | </el-form-item> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="submitGB28281" size="small">保存</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-form> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="submitGB28281" size="small" |
| | | >保存</el-button |
| | | > |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-menu-item-group> |
| | | </el-submenu> |
| | | <el-submenu index="1"> |
| | | <template slot="title"> |
| | | <b class="tree-font">接入平台列表</b> |
| | | </template> |
| | | <el-menu-item-group class="item-group"> |
| | | <div> |
| | | <el-table |
| | | :data="tableList" |
| | | border |
| | | fit |
| | | highlight-current-row |
| | | style="width: 100%; color:#000" |
| | | :header-cell-style="{ background: '#f8f8f8', color: '#222222', height:'30px' }" |
| | | > |
| | | <el-table-column |
| | | type="index" |
| | | label="序号" |
| | | align="center" |
| | | width="50" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="name" |
| | | label="名称" |
| | | align="center" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="id" |
| | | label="ID" |
| | | align="center" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="ip" |
| | | label="IP" |
| | | align="center" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="status" |
| | | label="状态" |
| | | align="center" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="mark" |
| | | label="备注" |
| | | align="center" |
| | | ></el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </el-menu-item-group> |
| | | </el-submenu> |
| | | <el-submenu index="2"> |
| | | <template slot="title"> |
| | | <b class="tree-font">国际摄像机</b> |
| | | </template> |
| | | <el-menu-item-group class="item-group"> |
| | | <div> |
| | | <div> |
| | | <el-button type="primary" size="small">刷新</el-button> |
| | | </div> |
| | | </div> |
| | | </el-menu-item-group> |
| | | </el-submenu> |
| | | </el-menu> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | saveGB28181Config, |
| | | getGb28181AreaList, |
| | | newGb28181ID |
| | | } from "./api"; |
| | | } from './api' |
| | | |
| | | import { isPort, isIPv4 } from "@/scripts/validate"; |
| | | |
| | | import { isPort, isIPv4 } from '@/scripts/validate' |
| | | import bus from '@/plugin/bus' |
| | | export default { |
| | | name: "Gb28181Setting", |
| | | |
| | | name: 'Gb28181Setting', |
| | | directives: { |
| | | focus: { |
| | | inserted: function (el) { |
| | | inserted: function(el) { |
| | | el.querySelector('input').focus() |
| | | } |
| | | } |
| | | }, |
| | | |
| | | data() { |
| | | return { |
| | | openeds: ['0'], |
| | | gb28181: {}, |
| | | |
| | | tableList: [], |
| | | idType: 1, |
| | | rules: { |
| | | ip: [ |
| | | { |
| | | required: true, |
| | | message: "请输入IP地址", |
| | | trigger: "change" |
| | | message: '请输入IP地址', |
| | | trigger: 'change' |
| | | }, |
| | | { validator: isIPv4, trigger: "change" } |
| | | { validator: isIPv4, trigger: 'change' } |
| | | ], |
| | | ServerIp: [ |
| | | { |
| | | required: true, |
| | | message: "请输入IP地址", |
| | | trigger: "change" |
| | | message: '请输入IP地址', |
| | | trigger: 'change' |
| | | }, |
| | | { validator: isIPv4, trigger: "change" } |
| | | { validator: isIPv4, trigger: 'change' } |
| | | ], |
| | | ServerPort: [ |
| | | { |
| | | required: true, |
| | | message: "请输入端口", |
| | | trigger: "change" |
| | | message: '请输入端口', |
| | | trigger: 'change' |
| | | }, |
| | | { validator: isPort, trigger: "change" } |
| | | { validator: isPort, trigger: 'change' } |
| | | ], |
| | | GbServerPort: [ |
| | | { |
| | | required: true, |
| | | message: "请输入端口", |
| | | trigger: "change" |
| | | message: '请输入端口', |
| | | trigger: 'change' |
| | | }, |
| | | { validator: isPort, trigger: "change" } |
| | | { validator: isPort, trigger: 'change' } |
| | | ] |
| | | }, |
| | | locationCity: { |
| | |
| | | provinceOptions: [], |
| | | cityOptions: [], |
| | | countyOptions: [] |
| | | }, |
| | | }; |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.$nextTick(() => { |
| | | this.initGB28181Conf(); |
| | | }); |
| | | |
| | | //this.$nextTick(()=>{ |
| | | this.initGB28181Conf() |
| | | //}) |
| | | }, |
| | | methods: { |
| | | initGB28181Conf() { |
| | | getGB28181Config().then(rsp => { |
| | | if (rsp && rsp.success) { |
| | | this.gb28181 = rsp.data; |
| | | this.gb28181.idType = 0; |
| | | 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; |
| | | this.locationCity.provinceOptions = rsp.data |
| | | } |
| | | }) |
| | | }, |
| | | submitGB28281() { |
| | | this.$refs["gb28181"].validate(valid => { |
| | | this.$refs['gb28181'].validate(valid => { |
| | | if (valid) { |
| | | saveGB28181Config(this.gb28181).then(rsp => { |
| | | if (rsp && rsp.success) { |
| | | this.$notify({ |
| | | type: "success", |
| | | message: "GB28181设置保存成功" |
| | | }); |
| | | type: 'success', |
| | | message: 'GB28181设置保存成功' |
| | | }) |
| | | } |
| | | }); |
| | | }) |
| | | } else { |
| | | console.log("error submit!!"); |
| | | return false; |
| | | console.log('error submit!!') |
| | | return false |
| | | } |
| | | }); |
| | | }) |
| | | }, |
| | | changeProvince() { |
| | | let pid = this.locationCity.province; |
| | | 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(); |
| | | this.locationCity.cityOptions = rsp.data |
| | | this.locationCity.city = this.locationCity.cityOptions[0].id |
| | | this.changeCity() |
| | | } |
| | | }) |
| | | }, |
| | | changeCity() { |
| | | let pid = this.locationCity.city; |
| | | 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; |
| | | this.locationCity.countyOptions = rsp.data |
| | | this.locationCity.county = this.locationCity.countyOptions[0].id |
| | | } |
| | | }) |
| | | }, |
| | | newGBID() { |
| | | let cCode = this.locationCity.county + ""; |
| | | let cCode = this.locationCity.county + '' |
| | | newGb28181ID({ code: cCode }).then(rsp => { |
| | | if (rsp && rsp.success) { |
| | | this.gb28181.PublicId = rsp.data; |
| | | this.gb28181.PublicId = rsp.data |
| | | } |
| | | }) |
| | | }, |
| | | menuOpen(){ |
| | | |
| | | }, |
| | | menuClose(){ |
| | | |
| | | }, |
| | | toOpenMenuList(e){ |
| | | debugger |
| | | let t = e.clientY - this.$el.offsetTop+30; |
| | | let l = e.clientX-this.$el.offsetLeft; |
| | | |
| | | window.parent.postMessage({source:location.href.split('/')[location.href.split('/').length-1], trigger: 'contextmenu', menuT:t, menuL:l},"*"); |
| | | return false; |
| | | } |
| | | } |
| | | }; |
| | | } |
| | | </script> |
| | | <style lang="scss"> |
| | | .s-basic-setting { |
| | | width: 100%; |
| | | height: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | .item-group { |
| | | padding: 0 15px; |
| | | margin-bottom: 15px; |
| | | } |
| | | .el-form { |
| | | width: 1000px; |
| | | margin-top: 30px; |
| | | // margin-left: -80px; |
| | | .el-form-item { |
| | | text-align: left; |
| | | margin-bottom: 16px; |
| | | &:last-of-type { |
| | | width: 490px; |
| | | } |
| | | .el-button { |
| | | float: right; |
| | | } |
| | | |
| | | .el-select { |
| | | margin-right: 10px; |
| | | } |
| | | .el-form-item__content { |
| | | text-align: left; |
| | | input { |
| | |
| | | .el-form-item__label { |
| | | text-align: left; |
| | | } |
| | | &.el-form-item.is-required:not(.is-no-asterisk) |
| | | > .el-form-item__label:before { |
| | | margin-left: -9px; |
| | | } |
| | | } |
| | | } |
| | | .alarmSetting { |