| | |
| | | </view> |
| | | </view> |
| | | <view class="listHead"> |
| | | <view class="switchBtn"> |
| | | <!-- <view class="switchBtn"> |
| | | <u-checkbox-group> |
| | | <u-checkbox v-model="isReadOnly" @change="chooseRead"></u-checkbox> |
| | | </u-checkbox-group> |
| | | <text>只显示未读</text> |
| | | </view> |
| | | </view> --> |
| | | <view class="switchBtn"> |
| | | <u-switch v-model="checked" size="20" @change="clickSwitch" style="margin-right: 6px"></u-switch> |
| | | <text>仅紧临</text> |
| | |
| | | <view class="noticeList"> |
| | | <view class="listContent" v-if="noticeList.length > 0" > |
| | | <view v-for="(item, index) in noticeList" :key="index" class="itemContent" > |
| | | <view class="content" v-if="item.isRead" > |
| | | <view class="content" v-if="item.isResponse" > |
| | | <text style="color:rgb(17, 204, 33);" @click="toDetail(item)">[已叫应]</text> |
| | | <text @click="toDetail(item)">[{{item.colorContent}}]</text> |
| | | <text @click="toDetail(item)">{{item.title}},{{item.content}}</text> |
| | | <view v-if="item.isRead" style="float: right; width: 80px;margin-top: 3px;"> |
| | | <!-- <view v-if="item.isResponse" style="float: right; width: 80px;margin-top: 3px;"> --> |
| | | <!-- <u-button @click="toDetail(item)"v-if="item.buttonContent == '已叫应'" size="mini" style="margin-bottom: 10px;background-color:rgb(17, 204, 33);color: white;"> |
| | | {{item.buttonContent}} |
| | | </u-button> |
| | |
| | | <u-button @click="toDetail(item)" v-else type="error" size="mini" style="margin-bottom: 10px;"> |
| | | {{item.buttonContent}} |
| | | </u-button> --> |
| | | </view> |
| | | <!-- </view> --> |
| | | </view> |
| | | <view class="contentNoRead" v-else> |
| | | <u-badge :is-dot="true" type="error" style="position: absolute;"></u-badge> |
| | | <text style="color: red;margin-left:10px;" @click="toDetail(item)">[未叫应]</text> |
| | | <text @click="toDetail(item)">[{{item.colorContent}}]</text> |
| | | <text @click="toDetail(item)">{{item.title}},{{item.content}}</text> |
| | | <view style="float: right; width: 80px;margin-top: 3px;"> |
| | | <!-- <view style="float: right; width: 80px;margin-top: 3px;"> --> |
| | | <!-- <u-button @click="toDetail(item)" v-if="item.buttonContent == '已叫应'" size="mini" style="margin-bottom: 10px;background-color:rgb(17, 204, 33);color: white;"> |
| | | {{item.buttonContent}} |
| | | </u-button> |
| | |
| | | <u-button @click="toDetail(item)" v-else type="error" size="mini" style="margin-bottom: 10px;"> |
| | | {{item.buttonContent}} |
| | | </u-button> --> |
| | | </view> |
| | | <!-- </view> --> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getNotice, update } from '../../../api/notice'; |
| | | import { getNotice, update,confirm } from '../../../api/notice'; |
| | | import dia from './dialog.vue'; |
| | | import tabBar from '../tabBarIndex.vue' |
| | | export default { |
| | |
| | | methods: { |
| | | getNoticeList() { |
| | | this.noSpeak = 0; |
| | | this.data.searchParams.readStatus = this.isReadOnly ? 0 : null; |
| | | // this.data.searchParams.readStatus = this.isReadOnly ? 0 : null; |
| | | this.data.searchParams.readStatus = null; |
| | | this.data.searchParams.emergType = this.checked ? 1 : null ; |
| | | this.data.searchParams.warningLevel = this.selectedSaleAnalysis =='all' ? null : this.selectedSaleAnalysis =='red' ? 1 : this.selectedSaleAnalysis =='orange' ? 2: this.selectedSaleAnalysis =='yellow'? 3 : 4; |
| | | getNotice(this.data).then(res => { |
| | |
| | | this.noticeListCopy = this.noticeList; |
| | | if (this.noticeList.length > 0) { |
| | | this.noticeList.forEach((item, index) => { |
| | | if(item.readStatus == 0){ |
| | | if(item.responseStatus == 1){ |
| | | this.noSpeak++; |
| | | } |
| | | this.noticeList[index].isRead = item.readStatus == 1 ? true : false; |
| | | this.noticeList[index].isResponse = item.responseStatus == 2 ? true : false; |
| | | this.noticeList[index].colorContent = item.warningLevel == 1 ? '红色预警': item.warningLevel == 2 ? '橙色预警': item.warningLevel == 3 ? '黄色预警':'蓝色预警'; |
| | | this.noticeList[index].buttonContent = item.responseStatus == 1 ? '待叫应': item.responseStatus == 2 ? '已叫应' : '超时未叫应'; |
| | | }); |
| | |
| | | toDetail(item) { |
| | | console.log("item",item) |
| | | //改为修改叫应状态 |
| | | if (item.readStatus === 0) { |
| | | this.updateReadStatus(item); |
| | | if (item.responseStatus === 1) { |
| | | this.updateResponseStatus(item); |
| | | } |
| | | uni.navigateTo({ |
| | | url: `/pages/tabBar/notice/detail?data=` + encodeURIComponent(JSON.stringify(item)) |
| | | }) |
| | | }, |
| | | updateReadStatus(item) { |
| | | update({id: item.id}).then(res => {}); |
| | | updateResponseStatus(item) { |
| | | confirm({id: item.id}).then(res => {}); |
| | | }, |
| | | openDialog(item){ |
| | | this.$refs.showDialog.id = item.id; |
| | |
| | | .listHead{ |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | justify-content: flex-end; |
| | | } |
| | | } |
| | | |