联调app
This commit is contained in:
@@ -3,7 +3,12 @@
|
||||
<!-- 暂态 -->
|
||||
<view class="transientBox">
|
||||
<view class="statistics pd20">
|
||||
<view class="box" v-for="item in list" @click="filterValue = item.key">
|
||||
<view
|
||||
class="box"
|
||||
:class="{ boxClick: filterValue == item.key }"
|
||||
v-for="item in list"
|
||||
@click="filterValue = item.key"
|
||||
>
|
||||
<!-- <text class="num">{{ item.value }}</text> -->
|
||||
<text class="num">{{
|
||||
store &&
|
||||
@@ -37,7 +42,11 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- 卡片 -->
|
||||
<view
|
||||
<scroll-view
|
||||
scroll-y="true"
|
||||
@refresherrefresh="refresherrefresh"
|
||||
:refresher-triggered="triggered"
|
||||
refresher-enabled="true"
|
||||
class="event-list"
|
||||
v-if="curSub == 0"
|
||||
:style="{ height: 'calc(100vh - ' + (navHeight + height) + 'px)', overflow: 'auto' }"
|
||||
@@ -45,7 +54,7 @@
|
||||
<!-- 循环渲染事件项 -->
|
||||
<uni-card
|
||||
class="event-item"
|
||||
:class="judgment(item.showName)"
|
||||
:class="judgment(item.showName).type"
|
||||
v-for="(item, index) in (store.data || []).filter((k) =>
|
||||
filterValue == '' ? k : k.showName == filterValue,
|
||||
)"
|
||||
@@ -57,22 +66,10 @@
|
||||
<view class="event-icon">
|
||||
<!-- 动态图标:根据类型切换 -->
|
||||
<uni-icons
|
||||
:custom-prefix="judgment(item.showName) == 'interrupt' ? 'custom-icon' : 'iconfont'"
|
||||
:type="
|
||||
judgment(item.showName) == 'sag'
|
||||
? 'icon-xiajiang'
|
||||
: judgment(item.showName) == 'swell'
|
||||
? 'icon-shangsheng'
|
||||
: 'minus'
|
||||
"
|
||||
:color="
|
||||
judgment(item.showName) == 'sag'
|
||||
? '#2563eb '
|
||||
: judgment(item.showName) == 'swell'
|
||||
? '#e6a23c'
|
||||
: '#909399'
|
||||
"
|
||||
:size="judgment(item.showName) == 'interrupt' ? '50' : '25'"
|
||||
:custom-prefix="'iconfont'"
|
||||
:type="judgment(item.showName).icon"
|
||||
:color="judgment(item.showName).color"
|
||||
:size="judgment(item.showName).size"
|
||||
></uni-icons>
|
||||
<!-- 0未读 1已读 -->
|
||||
<view class="badge1" v-if="item.status == 0"> </view>
|
||||
@@ -80,7 +77,9 @@
|
||||
<view class="event-info">
|
||||
<view class="event-title">
|
||||
<text class="event-id">{{ item.equipmentName }}</text>
|
||||
<text class="event-tag" :class="`${judgment(item.showName)}-tag`">{{ item.showName }}</text>
|
||||
<text class="event-tag" :class="`${judgment(item.showName).type}-tag`">{{
|
||||
item.showName
|
||||
}}</text>
|
||||
</view>
|
||||
<view class="event-desc">
|
||||
<text>工程名称:{{ item.engineeringName }}</text>
|
||||
@@ -88,7 +87,7 @@
|
||||
<text>监测点名称:{{ item.lineName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="event-action"> 🔍 </view>
|
||||
<view class="event-action"> <uni-icons type="search" size="25" color="#376cf3"></uni-icons> </view>
|
||||
</view>
|
||||
<!-- 详情区域 -->
|
||||
<view class="event-detail">
|
||||
@@ -104,17 +103,19 @@
|
||||
:status="store.status"
|
||||
></uni-load-more>
|
||||
<Cn-empty v-else style="top: 20%"></Cn-empty>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- ITIC 列表 -->
|
||||
<ITIC
|
||||
v-if="subsectionList[curSub] == 'ITIC'"
|
||||
:store="store"
|
||||
:filterValue="filterValue"
|
||||
:style="{ height: 'calc(100vh - ' + (navHeight + height) + 'px)', overflow: 'auto' }"
|
||||
></ITIC>
|
||||
<!-- F47 列表 -->
|
||||
<F47
|
||||
v-if="subsectionList[curSub] == 'F47'"
|
||||
:store="store"
|
||||
:filterValue="filterValue"
|
||||
:style="{ height: 'calc(100vh - ' + (navHeight + height) + 'px)', overflow: 'auto' }"
|
||||
></F47>
|
||||
</view>
|
||||
@@ -124,6 +125,7 @@ import list from '@/common/js/list'
|
||||
import { queryUserPushConfig } from '@/common/api/mine'
|
||||
import ITIC from './comp/ITIC.vue'
|
||||
import F47 from './comp/F47.vue'
|
||||
|
||||
export default {
|
||||
components: { ITIC, F47 },
|
||||
props: {
|
||||
@@ -151,12 +153,14 @@ export default {
|
||||
subsectionList: [], //'列表', 'ITIC', 'F47'
|
||||
status: 'noMore', //more加载前 loading加载中 noMore加载后
|
||||
sort: 0,
|
||||
triggered: true,
|
||||
// config: {},
|
||||
array: ['发生时间', '暂降深度', '持续时间'],
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.getConfig()
|
||||
uni.createSelectorQuery()
|
||||
.select('.transientBox')
|
||||
.boundingClientRect((rect) => {
|
||||
@@ -185,7 +189,6 @@ export default {
|
||||
this.store.params.startTime = this.$util.getMonthFirstAndLastDay(this.selectValue.date).firstDay
|
||||
this.store.params.endTime = this.$util.getMonthFirstAndLastDay(this.selectValue.date).lastDay
|
||||
this.store.loadedCallback = () => {
|
||||
this.getConfig()
|
||||
this.filterValue = ''
|
||||
this.loading = false
|
||||
}
|
||||
@@ -194,25 +197,56 @@ export default {
|
||||
getConfig() {
|
||||
queryUserPushConfig().then((res) => {
|
||||
// this.config = res.data
|
||||
|
||||
this.subsectionList = [
|
||||
let list = [
|
||||
'列表',
|
||||
res.data.iticFunction == 1 ? 'ITIC' : '',
|
||||
res.data.f47Function == 1 ? 'F47' : '',
|
||||
].filter((item) => item)
|
||||
this.curSub = !list[this.curSub] ? 0 : this.curSub
|
||||
this.subsectionList = JSON.parse(JSON.stringify(list))
|
||||
})
|
||||
},
|
||||
|
||||
judgment(val) {
|
||||
judgment(val, key) {
|
||||
switch (val) {
|
||||
case '电压暂降':
|
||||
return 'sag'
|
||||
return {
|
||||
type: 'sag',
|
||||
icon: 'icon-a-svg4',
|
||||
color: '#2563eb',
|
||||
size: '25',
|
||||
}
|
||||
case '电压暂升':
|
||||
return 'swell'
|
||||
return {
|
||||
type: 'swell',
|
||||
icon: 'icon-a-svg5',
|
||||
color: '#e6a23c',
|
||||
size: '25',
|
||||
}
|
||||
case '电压中断':
|
||||
return 'interrupt'
|
||||
return {
|
||||
type: 'interrupt',
|
||||
icon: 'icon-zhongduan2',
|
||||
color: '#6b7280',
|
||||
size: '35',
|
||||
}
|
||||
case '瞬态':
|
||||
return {
|
||||
type: 'transient',
|
||||
icon: 'icon-shuntaishijian',
|
||||
color: '#8b5cf6',
|
||||
size: '40',
|
||||
}
|
||||
case '未知':
|
||||
return {
|
||||
type: 'unknown',
|
||||
icon: 'icon-wenhao',
|
||||
color: '#6b7280',
|
||||
size: '45',
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 点击查看详情
|
||||
jump(item) {
|
||||
let str = JSON.stringify(item).replace(/%/g, '百分比')
|
||||
@@ -227,6 +261,14 @@ export default {
|
||||
sectionChange(e) {
|
||||
this.curSub = e.currentIndex
|
||||
},
|
||||
// 下拉
|
||||
refresherrefresh() {
|
||||
this.triggered = true
|
||||
uni.startPullDownRefresh()
|
||||
setTimeout(() => {
|
||||
this.triggered = false
|
||||
}, 500)
|
||||
},
|
||||
},
|
||||
onShow() {
|
||||
this.curSub = 0
|
||||
@@ -248,4 +290,8 @@ export default {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './index.scss';
|
||||
/deep/ .uni-scroll-view-refresher {
|
||||
display: none;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user