From 7c7a23224ec0cd2cc926f396c859182f7ef05cc0 Mon Sep 17 00:00:00 2001 From: caill <815519168@qq.com> Date: Thu, 8 Aug 2024 14:34:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=BC=E5=8F=AB=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/manage/call-manage.vue | 186 +--------------------- pages/manage/call-manage_back.vue | 246 ++++++++++++++++++++++++++++++ 2 files changed, 252 insertions(+), 180 deletions(-) create mode 100644 pages/manage/call-manage_back.vue diff --git a/pages/manage/call-manage.vue b/pages/manage/call-manage.vue index 352b88a..dcdbd36 100644 --- a/pages/manage/call-manage.vue +++ b/pages/manage/call-manage.vue @@ -1,70 +1,27 @@ @@ -78,151 +35,20 @@ data() { return { title: '', - areaArr: [], - pointArr: [], - pkId: '', disabled: false, - code: '', - sCode: '', - nCode: '', - show: false, - distanceToTop: -300, - distanceToLeft: -300, - windowHeight: '', - popHeight: '', - filteredData: [], - filterNo: '', - popup: false + sCode: 'QFQ_2', + nCode: 'QFQ_4' }; }, onLoad (options) { this.title = options.title - uni.getSystemInfo({ - success: (info) => { - this.windowHeight = info.windowHeight - } - }) - }, - onReady () { - const query = uni.createSelectorQuery().in(this) - query - .select('.pop_point_content') - .boundingClientRect(data => { - this.popHeight = data.height - }).exec() - }, - created () { - this.initArea() }, methods: { - matchData (no) { - this.filterNo = no - let query = '' - switch (no) { - case 1: - query = this.sCode.toLowerCase() - break - case 2: - query = this.nCode.toLowerCase() - break - default: - break - } - if (!query) { - this.filteredData = [] - return - } - this.filteredData = this.pointArr.filter(item => { - return item.device_code.toLowerCase().includes(query) - }) - }, - async initArea () { - let res = await queryArea() - this.areaArr = [...res.data] - if (this.areaArr.length > 0) { - this.pkId = this.areaArr[0].region_code - this.initPonit() - } - }, - getPonit (e) { - this.pkId = this.pkId === e.region_code ? '' : e.region_code - if (this.pkId) { - this.initPonit() - } - }, - async initPonit () { - let res = await queryPointByArea(this.pkId) - this.pointArr = [...res.data] - }, - setcode (el,index) { - const query = uni.createSelectorQuery().in(this) - query - .select(`#site_item_box_${index}`) - .boundingClientRect(data => { - if (data) { - this.distanceToTop = data.top + (data.height / 2) - 9 - this.distanceToLeft = data.left - console.log(this.popHeight) - if ((this.windowHeight - this.distanceToTop) < (this.popHeight + 20)) { - this.popup = true - } else { - this.popup = false - } - } - }).exec() - this.show = true - this.code = el.device_code - }, - colsePop () { - this.show = !this.show - if (!this.show) { - this.distanceToTop = -300 - this.distanceToLeft = -300 - } - }, - popCode (code) { - switch (code) { - case 1: - this.sCode = this.code - break - case 2: - this.nCode = this.code - break - default: - break - } - this.colsePop() - }, - /** 清空点位选择 */ - cancle () { - this.sCode = '' - this.nCode = '' - this.disabled = false - }, async _callTask (type) { this.disabled = true - if (this.sCode === '' || this.nCode === '') { - this.disabled = false - return - } - if (this.sCode === this.nCode) { - uni.showToast({ - // title: '任务起点终点不能相同', - title: this.$t('call.toast'), - icon: 'none' - }) - this.disabled = false - return - } try { let res = await callTask(this.sCode, this.nCode, type) - this.cancle() - clearInterval(this.timer) - this.timer = null - setTimeout(() => { - this.refresh() - this.cancle() - }, 2000) + this.disabled = false uni.showToast({ title: res.desc, icon: 'none' diff --git a/pages/manage/call-manage_back.vue b/pages/manage/call-manage_back.vue new file mode 100644 index 0000000..352b88a --- /dev/null +++ b/pages/manage/call-manage_back.vue @@ -0,0 +1,246 @@ + + + + +