联调app
This commit is contained in:
@@ -2,14 +2,14 @@
|
||||
<view>
|
||||
<view class="filterCriteria">
|
||||
<!-- 筛选条件 -->
|
||||
<Cn-filterCriteria @select="select" :showDatetime="false"> </Cn-filterCriteria>
|
||||
<Cn-filterCriteria @select="select" :singleChoice="true" :showDatetime="true"> </Cn-filterCriteria>
|
||||
<view class="choose1">
|
||||
<view>
|
||||
<checkbox-group @change="changeBox"
|
||||
><checkbox value="true" :checked="checkedAll" />全选
|
||||
</checkbox-group></view
|
||||
>
|
||||
<view class="nav-menu nav-menu-btn" @click="selectDevice('transfer')">申请报表 </view>
|
||||
<view class="nav-menu nav-menu-btn" @click="selectDevice">申请报告 </view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="smallLabel mt20">
|
||||
@@ -24,11 +24,15 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- 卡片 -->
|
||||
<view class="event-list" :style="{ height: 'calc(100vh - ' + (navHeight + height) + 'px)', overflow: 'auto' }">
|
||||
<scroll-view
|
||||
scroll-y="true"
|
||||
class="event-list"
|
||||
:style="{ height: 'calc(100vh - ' + (navHeight + height) + 'px)', overflow: 'auto' }"
|
||||
>
|
||||
<!-- 循环渲染事件项 -->
|
||||
<uni-card
|
||||
class="event-item"
|
||||
:class="judgment(item.showName)"
|
||||
:class="judgment(item.showName).type"
|
||||
v-for="(item, index) in store.data"
|
||||
:key="index"
|
||||
@click="clackCard(item)"
|
||||
@@ -39,27 +43,17 @@
|
||||
<!-- 动态图标:根据类型切换 -->
|
||||
<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'"
|
||||
:type="judgment(item.showName).icon"
|
||||
:color="judgment(item.showName).color"
|
||||
:size="judgment(item.showName).size"
|
||||
></uni-icons>
|
||||
</view>
|
||||
<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,11 +82,12 @@
|
||||
:status="store.status"
|
||||
></uni-load-more>
|
||||
<Cn-empty v-else style="top: 20%"></Cn-empty>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import list from '@/common/js/list'
|
||||
import { applicationReport } from '@/common/api/report.js'
|
||||
export default {
|
||||
components: {},
|
||||
props: {
|
||||
@@ -112,20 +107,21 @@ export default {
|
||||
array: ['发生时间', '暂降深度', '持续时间'],
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
mounted() {
|
||||
this.setHeight()
|
||||
},
|
||||
|
||||
methods: {
|
||||
setHeight() {
|
||||
uni.createSelectorQuery()
|
||||
.select('.filterCriteria')
|
||||
.boundingClientRect((rect) => {
|
||||
console.log('🚀 ~ rect:', rect)
|
||||
//
|
||||
// #ifdef H5
|
||||
this.height = rect?.height + 100 || 0
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.height = rect?.height + 100 || 0
|
||||
this.height = rect?.height + 90 || 0
|
||||
// #endif
|
||||
})
|
||||
.exec()
|
||||
@@ -144,8 +140,11 @@ export default {
|
||||
this.store.params.projectId = this.selectValue.projectId
|
||||
this.store.params.deviceId = this.selectValue.deviceId
|
||||
this.store.params.lineId = this.selectValue.lineId
|
||||
this.store.params.startTime = this.selectValue.range[0]
|
||||
this.store.params.endTime = this.selectValue.range[1]
|
||||
this.store.params.target = ['Evt_Sys_DipStr']
|
||||
this.store.params.startTime = this.$util.getMonthFirstAndLastDay(this.selectValue.date).firstDay
|
||||
this.store.params.endTime = this.$util.getMonthFirstAndLastDay(this.selectValue.date).lastDay
|
||||
// this.store.params.startTime = this.selectValue.range[0]
|
||||
// this.store.params.endTime = this.selectValue.range[1]
|
||||
this.store.loadedCallback = () => {
|
||||
this.checkedTotal = 0
|
||||
this.store.data = this.store.data.map((item) => {
|
||||
@@ -184,16 +183,89 @@ export default {
|
||||
this.sort = e.detail.value
|
||||
this.init()
|
||||
},
|
||||
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',
|
||||
}
|
||||
}
|
||||
},
|
||||
// 申请
|
||||
selectDevice() {
|
||||
if (this.checkedTotal == 0) {
|
||||
return uni.showToast({
|
||||
title: '请选择事件!',
|
||||
icon: 'none',
|
||||
})
|
||||
} else {
|
||||
uni.showLoading({
|
||||
title: '申请中,请稍等...',
|
||||
mask: true,
|
||||
})
|
||||
|
||||
let list = this.store.data.filter((item) => item.checked === true)
|
||||
applicationReport({
|
||||
list: list.map((item) => item.id),
|
||||
lineId: list[0].lineId,
|
||||
startTime: this.$util.getMonthFirstAndLastDay(this.selectValue.date).firstDay,
|
||||
endTime: this.$util.getMonthFirstAndLastDay(this.selectValue.date).lastDay,
|
||||
}).then((res) => {
|
||||
this.store.reload()
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
mask: true,
|
||||
title: '申请暂态报告,成功!',
|
||||
duration: 1000,
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
isAllLineIdSame(data) {
|
||||
// 获取第一个元素的lineId作为基准
|
||||
const baseLineId = data[0].lineId
|
||||
|
||||
// 遍历数组,检查每个元素的lineId是否和基准一致
|
||||
for (let item of data) {
|
||||
// 兼容元素可能没有lineId的情况
|
||||
if (!item || item.lineId !== baseLineId) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
},
|
||||
},
|
||||
|
||||
computed: {},
|
||||
@@ -220,9 +292,11 @@ export default {
|
||||
}
|
||||
}
|
||||
.nav-menu {
|
||||
height: 40rpx;
|
||||
padding: 6rpx 20rpx;
|
||||
margin-left: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
line-height: 40rpx;
|
||||
font-size: 24rpx;
|
||||
border-radius: 8rpx;
|
||||
background: #ebeaec;
|
||||
|
||||
Reference in New Issue
Block a user