Commit f6e0140303d2f20e8338c4a8559cbdbbb4fc54a7
1 parent
5e56a2bf
feat: 新增事件订阅输入框
Showing
1 changed file
with
33 additions
and
39 deletions
web_src/src/components/dialog/deviceEdit.vue
| 1 | 1 | <template> |
| 2 | 2 | <div id="deviceEdit" v-loading="isLoging"> |
| 3 | - <el-dialog | |
| 4 | - title="设备编辑" | |
| 5 | - width="40%" | |
| 6 | - top="2rem" | |
| 7 | - :close-on-click-modal="false" | |
| 8 | - :visible.sync="showDialog" | |
| 9 | - :destroy-on-close="true" | |
| 10 | - @close="close()" | |
| 11 | - > | |
| 3 | + <el-dialog title="设备编辑" width="40%" top="2rem" :close-on-click-modal="false" :visible.sync="showDialog" | |
| 4 | + :destroy-on-close="true" @close="close()"> | |
| 12 | 5 | <div id="shared" style="margin-top: 1rem;margin-right: 100px;"> |
| 13 | - <el-form ref="form" :rules="rules" :model="form" label-width="200px" > | |
| 6 | + <el-form ref="form" :rules="rules" :model="form" label-width="200px"> | |
| 14 | 7 | <el-form-item label="设备编号" prop="deviceId"> |
| 15 | 8 | <el-input v-if="isEdit" v-model="form.deviceId" disabled></el-input> |
| 16 | 9 | <el-input v-if="!isEdit" v-model="form.deviceId" clearable></el-input> |
| ... | ... | @@ -26,40 +19,40 @@ |
| 26 | 19 | <el-input type="sdpIp" v-model="form.sdpIp" clearable></el-input> |
| 27 | 20 | </el-form-item> |
| 28 | 21 | <el-form-item label="流媒体ID" prop="mediaServerId"> |
| 29 | - <el-select v-model="form.mediaServerId" style="float: left; width: 100%" > | |
| 22 | + <el-select v-model="form.mediaServerId" style="float: left; width: 100%"> | |
| 30 | 23 | <el-option key="auto" label="自动负载最小" value="auto"></el-option> |
| 31 | - <el-option | |
| 32 | - v-for="item in mediaServerList" | |
| 33 | - :key="item.id" | |
| 34 | - :label="item.id" | |
| 35 | - :value="item.id"> | |
| 24 | + <el-option v-for="item in mediaServerList" :key="item.id" :label="item.id" :value="item.id"> | |
| 36 | 25 | </el-option> |
| 37 | 26 | </el-select> |
| 38 | 27 | </el-form-item> |
| 39 | 28 | |
| 40 | - <el-form-item label="字符集" prop="charset" > | |
| 41 | - <el-select v-model="form.charset" style="float: left; width: 100%" > | |
| 42 | - <el-option key="GB2312" label="GB2312" value="gb2312"></el-option> | |
| 29 | + <el-form-item label="字符集" prop="charset"> | |
| 30 | + <el-select v-model="form.charset" style="float: left; width: 100%"> | |
| 31 | + <el-option key="GB2312" label="GB2312" value="gb2312"></el-option> | |
| 43 | 32 | <el-option key="UTF-8" label="UTF-8" value="utf-8"></el-option> |
| 44 | 33 | </el-select> |
| 45 | 34 | </el-form-item> |
| 46 | 35 | <el-form-item label="语音发送通道" prop="name"> |
| 47 | 36 | <el-input v-model="form.audioChannelForReceive" clearable></el-input> |
| 48 | 37 | </el-form-item> |
| 49 | - <el-form-item label="地理坐标系" prop="geoCoordSys" > | |
| 50 | - <el-select v-model="form.geoCoordSys" style="float: left; width: 100%" > | |
| 38 | + <el-form-item label="地理坐标系" prop="geoCoordSys"> | |
| 39 | + <el-select v-model="form.geoCoordSys" style="float: left; width: 100%"> | |
| 51 | 40 | <el-option key="WGS84" label="WGS84" value="WGS84"></el-option> |
| 52 | 41 | <el-option key="GCJ02" label="GCJ02" value="GCJ02"></el-option> |
| 53 | 42 | </el-select> |
| 54 | 43 | </el-form-item> |
| 55 | - <el-form-item v-if="this.isEdit" label="目录订阅" title="0为取消订阅" prop="subscribeCycleForCatalog" > | |
| 56 | - <el-input v-model="form.subscribeCycleForCatalog" clearable ></el-input> | |
| 44 | + <el-form-item v-if="this.isEdit" label="目录订阅" title="0为取消订阅" prop="subscribeCycleForCatalog"> | |
| 45 | + <el-input v-model="form.subscribeCycleForCatalog" clearable></el-input> | |
| 57 | 46 | </el-form-item> |
| 58 | - <el-form-item v-if="this.isEdit" label="移动位置订阅" title="0为取消订阅" prop="subscribeCycleForCatalog" > | |
| 59 | - <el-input v-model="form.subscribeCycleForMobilePosition" clearable ></el-input> | |
| 47 | + <el-form-item v-if="this.isEdit" label="报警订阅" title="0为取消订阅" prop="subscribeCycleForAlarm"> | |
| 48 | + <el-input v-model="form.subscribeCycleForAlarm" clearable></el-input> | |
| 60 | 49 | </el-form-item> |
| 61 | - <el-form-item v-if="form.subscribeCycleForMobilePosition > 0" label="移动位置报送间隔" prop="subscribeCycleForCatalog" > | |
| 62 | - <el-input v-model="form.mobilePositionSubmissionInterval" clearable ></el-input> | |
| 50 | + <el-form-item v-if="this.isEdit" label="移动位置订阅" title="0为取消订阅" prop="subscribeCycleForCatalog"> | |
| 51 | + <el-input v-model="form.subscribeCycleForMobilePosition" clearable></el-input> | |
| 52 | + </el-form-item> | |
| 53 | + <el-form-item v-if="form.subscribeCycleForMobilePosition > 0" label="移动位置报送间隔" | |
| 54 | + prop="subscribeCycleForCatalog"> | |
| 55 | + <el-input v-model="form.mobilePositionSubmissionInterval" clearable></el-input> | |
| 63 | 56 | </el-form-item> |
| 64 | 57 | <el-form-item label="其他选项"> |
| 65 | 58 | <el-checkbox label="SSRC校验" v-model="form.ssrcCheck" style="float: left"></el-checkbox> |
| ... | ... | @@ -68,7 +61,7 @@ |
| 68 | 61 | </el-form-item> |
| 69 | 62 | <el-form-item> |
| 70 | 63 | <div style="float: right;"> |
| 71 | - <el-button type="primary" @click="onSubmit" >确认</el-button> | |
| 64 | + <el-button type="primary" @click="onSubmit">确认</el-button> | |
| 72 | 65 | <el-button @click="close">取消</el-button> |
| 73 | 66 | </div> |
| 74 | 67 | |
| ... | ... | @@ -80,20 +73,20 @@ |
| 80 | 73 | </template> |
| 81 | 74 | |
| 82 | 75 | <script> |
| 83 | -import MediaServer from '../service/MediaServer' | |
| 76 | +import MediaServer from '../service/MediaServer'; | |
| 84 | 77 | export default { |
| 85 | 78 | name: "deviceEdit", |
| 86 | 79 | props: {}, |
| 87 | 80 | computed: {}, |
| 88 | - created() {}, | |
| 81 | + created() { }, | |
| 89 | 82 | data() { |
| 90 | 83 | return { |
| 91 | 84 | listChangeCallback: null, |
| 92 | 85 | showDialog: false, |
| 93 | 86 | isLoging: false, |
| 94 | - hostNames:[], | |
| 87 | + hostNames: [], | |
| 95 | 88 | mediaServerList: [], // 滅体节点列表 |
| 96 | - mediaServerObj : new MediaServer(), | |
| 89 | + mediaServerObj: new MediaServer(), | |
| 97 | 90 | form: {}, |
| 98 | 91 | isEdit: false, |
| 99 | 92 | rules: { |
| ... | ... | @@ -116,27 +109,28 @@ export default { |
| 116 | 109 | } |
| 117 | 110 | this.getMediaServerList(); |
| 118 | 111 | }, |
| 119 | - getMediaServerList: function (){ | |
| 112 | + getMediaServerList: function () { | |
| 120 | 113 | let that = this; |
| 121 | - that.mediaServerObj.getOnlineMediaServerList((data)=>{ | |
| 114 | + that.mediaServerObj.getOnlineMediaServerList((data) => { | |
| 122 | 115 | that.mediaServerList = data.data; |
| 123 | 116 | }) |
| 124 | 117 | }, |
| 125 | 118 | onSubmit: function () { |
| 126 | 119 | console.log("onSubmit"); |
| 127 | 120 | console.log(this.form); |
| 128 | - this.form.subscribeCycleForCatalog = this.form.subscribeCycleForCatalog||0 | |
| 129 | - this.form.subscribeCycleForMobilePosition = this.form.subscribeCycleForMobilePosition||0 | |
| 130 | - this.form.mobilePositionSubmissionInterval = this.form.mobilePositionSubmissionInterval||0 | |
| 121 | + this.form.subscribeCycleForCatalog = this.form.subscribeCycleForCatalog || 0 | |
| 122 | + this.form.subscribeCycleForMobilePosition = this.form.subscribeCycleForMobilePosition || 0 | |
| 123 | + this.form.mobilePositionSubmissionInterval = this.form.mobilePositionSubmissionInterval || 0 | |
| 124 | + this.form.subscribeCycleForAlarm = this.form.subscribeCycleForAlarm || 0 | |
| 131 | 125 | this.$axios({ |
| 132 | 126 | method: 'post', |
| 133 | - url:`/api/device/query/device/${this.isEdit?'update':'add'}/`, | |
| 127 | + url: `/api/device/query/device/${this.isEdit ? 'update' : 'add'}/`, | |
| 134 | 128 | params: this.form |
| 135 | 129 | }).then((res) => { |
| 136 | 130 | console.log(res.data) |
| 137 | 131 | if (res.data.code === 0) { |
| 138 | 132 | this.listChangeCallback() |
| 139 | - }else { | |
| 133 | + } else { | |
| 140 | 134 | this.$message({ |
| 141 | 135 | showClose: true, |
| 142 | 136 | message: res.data.msg, | ... | ... |