修改发布问题
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
><checkbox value="true" :checked="checkedAll" />全选
|
||||
</checkbox-group></view
|
||||
> -->
|
||||
已选择 {{ checkedTotal }} 条事件
|
||||
已选择 {{ checkedTotal }} 条事件(最多{{ maxSelectCount }}条)
|
||||
</view>
|
||||
<view class="nav-menu nav-menu-btn" @click="selectDevice">申请报告 </view>
|
||||
<!-- <view style="width: 180rpx">
|
||||
@@ -61,15 +61,19 @@
|
||||
}}</text>
|
||||
</view>
|
||||
<view class="event-desc">
|
||||
<text>工程:{{ item.engineeringName }}</text>
|
||||
<text>工程:</text>
|
||||
<text>项目:{{ item.projectName }}</text>
|
||||
<text>设备:{{ item.equipmentName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="event-action" @click="handleWrapperClick(item, !item.wavePath)">
|
||||
<!-- 选择 -->
|
||||
<checkbox-group @change="changeChild($event, item)"
|
||||
><checkbox value="true" :disabled="!item.wavePath" :checked="item.checked" />
|
||||
<checkbox-group @change.stop="changeChild($event, item)"
|
||||
><checkbox
|
||||
value="true"
|
||||
:disabled="!item.wavePath || (checkedTotal >= maxSelectCount && !item.checked)"
|
||||
:checked="item.checked"
|
||||
/>
|
||||
</checkbox-group>
|
||||
</view>
|
||||
</view>
|
||||
@@ -126,6 +130,7 @@ export default {
|
||||
height: 0,
|
||||
checkedAll: false,
|
||||
checkedTotal: 0,
|
||||
maxSelectCount: 5,
|
||||
sort: 0,
|
||||
array: ['发生时间', '暂降幅值', '持续时间'],
|
||||
}
|
||||
@@ -201,7 +206,18 @@ export default {
|
||||
}
|
||||
},
|
||||
changeChild(e, item) {
|
||||
item.checked = !item.checked
|
||||
const willCheck = e.detail.value.length > 0
|
||||
if (willCheck && !item.checked) {
|
||||
const selectedCount = this.store.data.filter((i) => i.checked).length
|
||||
if (selectedCount >= this.maxSelectCount) {
|
||||
uni.showToast({
|
||||
title: `最多只能选择${this.maxSelectCount}条事件`,
|
||||
icon: 'none',
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
item.checked = willCheck
|
||||
this.checkedAll = this.store.data.every((item) => item.checked === true)
|
||||
this.checkedTotal = this.store.data.filter((item) => item.checked === true).length
|
||||
},
|
||||
@@ -266,8 +282,14 @@ export default {
|
||||
title: '请选择事件!',
|
||||
icon: 'none',
|
||||
})
|
||||
} else {
|
||||
uni.showLoading({
|
||||
}
|
||||
if (this.checkedTotal > this.maxSelectCount) {
|
||||
return uni.showToast({
|
||||
title: `最多只能选择${this.maxSelectCount}条事件`,
|
||||
icon: 'none',
|
||||
})
|
||||
}
|
||||
uni.showLoading({
|
||||
title: '申请中,请稍等...',
|
||||
mask: true,
|
||||
})
|
||||
@@ -287,7 +309,6 @@ export default {
|
||||
title: '申请报告,成功!',
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
isAllLineIdSame(data) {
|
||||
// 获取第一个元素的lineId作为基准
|
||||
|
||||
Reference in New Issue
Block a user