| | |
| | | <div class="settingBody"> |
| | | <div class="settingItem"> |
| | | <div class="label">总算力:</div> |
| | | <div class="data">2通道</div> |
| | | <div class="label">总算力:</div> |
| | | <div class="data">2通道</div> |
| | | <div class="data">{{ total }}通道</div> |
| | | <div class="label">实时算力:</div> |
| | | <div class="data">{{ realTime.total }}通道</div> |
| | | </div> |
| | | |
| | | <div class="settingItem"> |
| | | <div class="label">轮询时间:</div> |
| | | <el-input-number |
| | | class="time" |
| | | v-model="time" |
| | | v-model="formdata.poll_period" |
| | | :controls="false" |
| | | :min="0" |
| | | :max="60 * 24 * 1" |
| | | ></el-input-number |
| | | >分钟 |
| | | </div> |
| | |
| | | <div class="settingItem"> |
| | | <div class="label">轮询开关:</div> |
| | | <el-switch |
| | | v-model="pollingSwitch" |
| | | v-model="formdata.enable" |
| | | active-color="#D4E3FA" |
| | | inactive-color="#E9EBEE" |
| | | :width="56" |
| | |
| | | </div> |
| | | |
| | | <div class="settingItem"> |
| | | <div class="label">轮询时间:</div> |
| | | <div class="label">轮询算力:</div> |
| | | <el-input-number |
| | | v-model="time" |
| | | v-model="formdata.pollChannelCount" |
| | | controls-position="right" |
| | | :max="limit" |
| | | :min="0" |
| | | @change="changePoll" |
| | | ></el-input-number |
| | | >分钟 |
| | | </div> |
| | | |
| | | <div class="settingItem"> |
| | | <div class="label">轮询时间:</div> |
| | | <div class="label">数据栈算力:</div> |
| | | <el-input-number |
| | | v-model="time" |
| | | v-model="stack.total" |
| | | controls-position="right" |
| | | :max="limit" |
| | | :min="0" |
| | | @change="changeStack" |
| | | ></el-input-number |
| | | >分钟 |
| | | </div> |
| | | |
| | | <div class="btns"> |
| | | <div class="cancel button" @click="close()">取消</div> |
| | | <div class="submit button" @click="close()">保存</div> |
| | | <div class="submit button" @click="save()">保存</div> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getPollConfig, |
| | | deviceStatisticRunInfo, |
| | | savePollConfig, |
| | | } from "@/api/clusterManage"; |
| | | export default { |
| | | props: { |
| | | id: {}, |
| | | }, |
| | | data() { |
| | | return { |
| | | time: 0, |
| | | pollingSwitch: false, |
| | | realTime: {}, |
| | | total: "", |
| | | polling: {}, |
| | | stack: {}, |
| | | formdata: { |
| | | deviceId: "", |
| | | delay: 10, |
| | | enable: true, |
| | | pollChannelCount: 0, |
| | | poll_period: 0, |
| | | videoChannelCount: 0, |
| | | }, |
| | | stackChannel: 0, |
| | | limit: 100, |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getFormData(); |
| | | this.chooseDevice(); |
| | | }, |
| | | |
| | | methods: { |
| | | async getFormData() { |
| | | const res = await getPollConfig({ deviceId: this.id }); |
| | | this.formdata.deviceId = this.id; |
| | | this.formdata.enable = res.data.enable; |
| | | this.formdata.poll_period = res.data.poll_period; |
| | | this.formdata.pollChannelCount = res.data.pollChannelCount; |
| | | this.$set(this.formdata, "pollChannelCount", res.data.pollChannelCount); |
| | | this.$forceUpdate(); |
| | | }, |
| | | async chooseDevice() { |
| | | const res1 = await deviceStatisticRunInfo({ deviceId: [this.id] }); |
| | | if (res1 && res1.success) { |
| | | this.total = res1.data.channelTotal; |
| | | this.realTime = { |
| | | total: res1.data.realValidCount, |
| | | valid: res1.data.realTotal, |
| | | invalid: res1.data.realInvalidCount, |
| | | run: res1.data.realRunningCount, |
| | | noDeal: |
| | | res1.data.realTotal - |
| | | res1.data.realRunningCount - |
| | | res1.data.realInvalidCount, |
| | | }; |
| | | this.polling = { |
| | | valid: res1.data.pollTotal, |
| | | total: res1.data.pollChannelCount, |
| | | invalid: res1.data.pollInvalidCount, |
| | | run: res1.data.pollRunningCount, |
| | | noDeal: |
| | | res1.data.pollTotal - |
| | | res1.data.pollRunningCount - |
| | | res1.data.pollInvalidCount, |
| | | }; |
| | | |
| | | this.stack = { |
| | | total: res1.data.stackChannelCount, |
| | | valid: res1.data.stackTotal, |
| | | invalid: res1.data.stackInvalidCount, |
| | | run: res1.data.stackRunningCount, |
| | | noDeal: |
| | | res1.data.stackTotal - |
| | | res1.data.stackInvalidCount - |
| | | res1.data.stackRunningCount, |
| | | }; |
| | | |
| | | this.limit = this.total - this.realTime.total; |
| | | |
| | | this.$forceUpdate(); |
| | | } |
| | | }, |
| | | close() { |
| | | this.$emit("close"); |
| | | }, |
| | | //监听轮询算力 |
| | | changePoll(newVal, oldVal) { |
| | | if (newVal > oldVal) { |
| | | this.stack.total--; |
| | | } |
| | | if (newVal < oldVal) { |
| | | this.stack.total++; |
| | | } |
| | | this.$forceUpdate(); |
| | | }, |
| | | //监听数据栈算力 |
| | | changeStack(newVal, oldVal) { |
| | | if (newVal > oldVal) { |
| | | this.formdata.pollChannelCount--; |
| | | } |
| | | if (newVal < oldVal) { |
| | | this.formdata.pollChannelCount++; |
| | | } |
| | | }, |
| | | async save() { |
| | | this.formdata.videoChannelCount = this.stack.total; |
| | | const res = await savePollConfig(this.formdata); |
| | | if (res && res.success) { |
| | | this.$notify({ |
| | | type: "success", |
| | | message: "保存成功", |
| | | }); |
| | | } |
| | | this.close(); |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | width: 64px; |
| | | height: 32px; |
| | | border-radius: 0; |
| | | padding: 0 0; |
| | | } |
| | | |
| | | .el-input-number__decrease { |