From 7e90d2b6e13279d568f581a92e070c398ae92b25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=B2=E4=B9=88=E4=BA=86?= Date: Mon, 6 Nov 2023 11:01:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/js/list.js | 15 +-- manifest.json | 4 +- pages.json | 8 +- pages/device/APF/report.vue | 177 +++++++++++++++++++++++++++++------ pages/device/list.vue | 85 +++++++++-------- pages/engineering/detail.vue | 6 +- pages/engineering/list.vue | 18 +++- pages/message/feedback.vue | 34 ++++--- pages/message/message.vue | 13 ++- pages/mine/about.vue | 21 ++--- pages/project/detail.vue | 2 +- pages/project/list.vue | 36 +++++-- 12 files changed, 296 insertions(+), 123 deletions(-) diff --git a/common/js/list.js b/common/js/list.js index 1af13d7..51c9407 100644 --- a/common/js/list.js +++ b/common/js/list.js @@ -1,9 +1,6 @@ export default { onPullDownRefresh() { this.store && this.store.reload() - this.store.loadedCallback = () => { - uni.stopPullDownRefresh() - } }, onReachBottom() { if (this.store.status != 'noMore') { @@ -20,7 +17,7 @@ export default { var me = this return { data: [], - status: 'more', + status: 'noMore', empty: false, total: 0, header: { @@ -35,9 +32,8 @@ export default { firstCallBack: null, loadedCallback: null, reload() { - if(this.status == 'loading') return + if (this.status == 'loading') return this.data = [] - this.status = 'loading' this.empty = false this.params.pageNum = 1 this.next() @@ -50,6 +46,7 @@ export default { }, 300) }, next() { + this.status = 'loading' me.$request({ url: url, data: this.params, @@ -68,14 +65,17 @@ export default { this.status = 'noMore' } else if (res.total == resultData.length) { this.status = 'noMore' + } else { + this.status = 'more' } } else { this.data.push(...resultData) if (resultData.length < this.params.pageSize) { this.status = 'noMore' + } else { + this.status = 'more' } } - if (this.params.pageNum == 1) { this.firstCallBack && this.firstCallBack() } @@ -83,6 +83,7 @@ export default { this.params.pageNum++ this.total = res.total this.loading = false + uni.stopPullDownRefresh() }) }, } diff --git a/manifest.json b/manifest.json index d6fe042..0bcd460 100644 --- a/manifest.json +++ b/manifest.json @@ -2,8 +2,8 @@ "name" : "灿能物联", "appid" : "__UNI__88BC25B", "description" : "", - "versionName" : "1.4.2", - "versionCode" : 142, + "versionName" : "1.4.4", + "versionCode" : 144, "transformPx" : false, /* 5+App特有相关 */ "app-plus" : { diff --git a/pages.json b/pages.json index 4b889be..f125ae0 100644 --- a/pages.json +++ b/pages.json @@ -7,7 +7,8 @@ "navigationStyle": "custom", "pullToRefresh": { "support":true, - "style": "circle" + "style": "circle", + "color":"#007aff" } } }, @@ -194,6 +195,11 @@ { "path": "pages/message/message", "style": { + "pullToRefresh": { + "support":true, + "style": "circle", + "color":"#007aff" + }, "app-plus": { "bounce": "none", //关闭窗口回弹效果 diff --git a/pages/device/APF/report.vue b/pages/device/APF/report.vue index b797cfc..1d697f7 100644 --- a/pages/device/APF/report.vue +++ b/pages/device/APF/report.vue @@ -1,21 +1,50 @@ @@ -29,13 +58,31 @@ export default { data() { return { loading: true, - deviceId:'' + type: '', + staticIcon: '', } }, - onLoad(options) { - this.deviceId = options.id - }, - onShow() { + onLoad(o) { + this.type = '3' + this.devId = o.id + switch (this.type) { + case '0': + uni.setNavigationBarTitle({ title: '暂态事件' }) + this.staticIcon = '/static/zantai2.png' + break + case '1': + uni.setNavigationBarTitle({ title: '稳态事件' }) + this.staticIcon = '/static/steady2.png' + break + case '2': + uni.setNavigationBarTitle({ title: '运行事件' }) + this.staticIcon = '/static/run2.png' + break + case '3': + uni.setNavigationBarTitle({ title: '设备告警' }) + this.staticIcon = '/static/device_bad2.png' + break + } this.init() }, onNavigationBarButtonTap(e) { @@ -45,9 +92,10 @@ export default { success: (res) => { if (res.confirm) { updateStatus({ - type: 3, - eventIds:[] + type: this.type, + eventIds: [], }).then(() => { + this.loading = true this.store.reload() }) } @@ -57,21 +105,48 @@ export default { methods: { async init() { let dictData = await this.$util.getDictData('app_event') + console.log(dictData) this.store = this.DataSource('/cs-harmonic-boot/eventUser/queryEventpage') - this.store.params.type = 3 + this.store.params.type = this.type this.store.params.deviceId = this.deviceId - this.store.firstCallBack = (res) => { - // this.store.data.forEach((item) => { - // item.title = dictData.find((item2) => item2.code === item.tag)?.name - // }) - // console.log(this.store.data) + this.store.loadedCallback = () => { + this.store.data.forEach((item) => { + if (this.type === '3') { + item.showName = '告警,告警码:' + item.code + } + if (this.type !== '0') { + item.subTitle = `于${item.startTime}发生${item.showName}` + } else { + item.subTitle = + `于${item.startTime}发生${item.showName}。` + + item.dataSet + .map((item2) => { + return ( + item2.showName + + ':' + + (item2.value == 3.1415926 ? '-' : item2.value) + + (item2.unit || '') + ) + }) + .join(',') + } + }) this.loading = false } this.store.reload() }, jump(item) { - let str = JSON.stringify(item).replace(/%/g, '百分比') - uni.navigateTo({ url: '/pages/message/reportDetail?detail=' + encodeURIComponent(str) }) + if (this.type === '0') { + let str = JSON.stringify(item).replace(/%/g, '百分比') + uni.navigateTo({ url: '/pages/message/messageDetail?detail=' + encodeURIComponent(str) }) + } else { + if (item.status != '1') { + item.status = '1' + updateStatus({ + eventIds: [item.id], + }) + } + } }, }, } @@ -79,6 +154,50 @@ export default { + diff --git a/pages/engineering/detail.vue b/pages/engineering/detail.vue index a5f2e82..4602489 100644 --- a/pages/engineering/detail.vue +++ b/pages/engineering/detail.vue @@ -34,17 +34,17 @@ 设备个数 - {{item.devNum}} + {{ item.devNum }} 创建时间 - {{item.createTime}} + {{ item.createTime }} diff --git a/pages/engineering/list.vue b/pages/engineering/list.vue index dc6317b..7cc405f 100644 --- a/pages/engineering/list.vue +++ b/pages/engineering/list.vue @@ -17,15 +17,20 @@ @clickLeft="back" @clickRight="add" /> - + @@ -40,7 +45,10 @@ - + @@ -52,7 +60,7 @@ export default { mixins: [list], data() { return { - loading: false, + loading: true, userInfo: {}, } }, diff --git a/pages/message/feedback.vue b/pages/message/feedback.vue index b1493c2..b2a6f75 100644 --- a/pages/message/feedback.vue +++ b/pages/message/feedback.vue @@ -3,36 +3,45 @@ {{ item.title }} - + 已解决 - + 待处理 - + 处理中 {{ item.createTime }} - + - + @@ -109,7 +118,6 @@ export default { } } - /deep/ .uni-list-item { background-color: $uni-theme-white !important; } diff --git a/pages/message/message.vue b/pages/message/message.vue index f79ec4a..c369493 100644 --- a/pages/message/message.vue +++ b/pages/message/message.vue @@ -41,7 +41,10 @@ --> - + @@ -79,11 +82,9 @@ export default { this.staticIcon = '/static/device_bad2.png' break } - }, - onShow() { - this.loading = true this.init() }, + onShow() {}, onNavigationBarButtonTap(e) { uni.showModal({ title: '提示', @@ -109,6 +110,9 @@ export default { this.store.params.type = this.type this.store.loadedCallback = () => { this.store.data.forEach((item) => { + if (this.type === '3') { + item.showName = '告警,告警码:' + item.code + } if (this.type !== '0') { item.subTitle = `于${item.startTime}发生${item.showName}` } else { @@ -126,6 +130,7 @@ export default { .join(',') } }) + console.log(this.store.data) this.loading = false } this.store.reload() diff --git a/pages/mine/about.vue b/pages/mine/about.vue index 471f64a..4a6da0a 100644 --- a/pages/mine/about.vue +++ b/pages/mine/about.vue @@ -1,29 +1,28 @@ - \ No newline at end of file + diff --git a/pages/project/detail.vue b/pages/project/detail.vue index 2a15cc1..fff63b8 100644 --- a/pages/project/detail.vue +++ b/pages/project/detail.vue @@ -36,7 +36,7 @@ diff --git a/pages/project/list.vue b/pages/project/list.vue index 59c4bc1..b1c89ce 100644 --- a/pages/project/list.vue +++ b/pages/project/list.vue @@ -6,20 +6,33 @@ :fixed="true" status-bar left-icon="left" - :rightIcon="userInfo.authorities === 'app_vip_user' || userInfo.authorities === 'engineering_user' ? 'plusempty' : ''" + :rightIcon=" + userInfo.authorities === 'app_vip_user' || userInfo.authorities === 'engineering_user' + ? 'plusempty' + : '' + " background-color="#fff" color="#111" title="项目管理" @clickLeft="back" @clickRight="add" /> - + - + 设备个数 @@ -32,7 +45,10 @@ - + @@ -80,13 +96,13 @@ export default { }) }, jump(project) { - console.log(project); + console.log(project) uni.navigateTo({ url: `/pages/project/detail?project=${encodeURIComponent(JSON.stringify(project))}`, }) }, }, - onLoad({engineeringId}) { + onLoad({ engineeringId }) { this.init(engineeringId) }, }