| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- <template>
- <view class="work-container">
- <view style="margin-top: 10px">
- <uni-card v-for="item in alertList" :title="item.deviceName" :extra="item.createTime">
- <view style="position: relative">
- <view>上报人:{{item.userName}}</view>
- <view>上报内容:{{item.desc}}</view>
- <view v-if="item.status == 3">状态:已处理</view>
- <view v-if="item.status != 3">状态:未处理</view>
- <view v-if="item.status == 3" style="width: 50px;position: absolute;right:-10px;bottom:0px"><u-button @click="watchResult(item)" type="primary" :plain="true" size="mini" text="查看结果"></u-button>
- </view>
- <!-- <view v-if="item.status != 3" style="width: 50px;position: absolute;right:-10px;bottom:0px"><u-button @click="handle(item)" type="error" :plain="true" size="mini" text="处理"></u-button>-->
- <!-- </view>-->
- </view>
- </uni-card>
- <uni-load-more @clickLoadMore="getMore" :contentText="contenText" :status="loadStatus"></uni-load-more>
- <u-modal :show="showErrDlg" title="处理结果" @confirm="close" >
- <view class="slot-content">
- <u--textarea style="width:500rpx" autoheight v-model="chooseItem.result" disabled="" ></u--textarea>
- </view>
- </u-modal>
- </view>
- </view>
- </template>
- <script>
- import {errorList} from '@/api/device/device';
- import UText from "../../uni_modules/uview-ui/components/u-text/u-text";
- export default {
- components: {UText},
- data() {
- return {
- show:true,
- alertList:[],
- search:{
- deptName:""
- },
- alertLevel:['提醒通知','轻微问题','严重警告'],
- pageNum:1,
- pageSize:10,
- chooseItem: {},
- contenText:{contentdown: "点击加载更多",contentrefresh: "正在加载...",contentnomore: "没有更多数据了"},
- loadStatus:"more",
- showErrDlg:false,
- }
- },
- onLoad(){
- this.getAlertList();
- },
- methods: {
- getMore(){
- this.pageNum ++;
- this.getAlertList();
- },
- open(item) {
- this.chooseItem = item;
- this.showErrDlg = true;
- },
- close() {
- this.chooseItem = {};
- this.showErrDlg = false;
- },
- confirm(text){
- if(!text){
- uni.showToast({
- icon:"error",
- title:"请输入内容"
- })
- return;
- }
- let item = this.chooseItem;
- item.remark = text;
- this.close();
- handleAlert(item).then(res=>{
- if(res.code == 200){
- item.status = 3;
- }
- })
- },
- searchDept(){
- this.getDeptList();
- },
- watchResult(item){
- this.open(item);
- },
- handle(item){
- this.open(item);
- },
- getAlertList(){
- this.loadStatus = "loading"
- errorList(this.pageNum,this.pageSize).then(res=>{
- if(res.total == this.alertList.length){
- uni.showToast({
- icon:"none",
- title:"没有更多了"
- })
- this.loadStatus = "noMore"
- return;
- }
- this.loadStatus = "more"
- this.alertList = this.alertList.concat(res.rows);
- });
- }
- }
- }
- </script>
- <style lang="scss">
- /* #ifndef APP-NVUE */
- .u-collapse-content{
- display: flex;
- flex-direction: column;
- }
- page {
- display: flex;
- flex-direction: column;
- box-sizing: border-box;
- background-color: #fff;
- min-height: 100%;
- height: auto;
- }
- view {
- font-size: 14px;
- line-height: inherit;
- }
- /* #endif */
- .text {
- text-align: center;
- font-size: 26rpx;
- margin-top: 10rpx;
- }
- .grid-item-box {
- flex: 1;
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- flex-direction: column;
- align-items: center;
- justify-content: center;
- padding: 15px 0;
- }
- .uni-margin-wrap {
- width: 690rpx;
- width: 100%;
- ;
- }
- .swiper {
- height: 300rpx;
- }
- .swiper-box {
- height: 150px;
- }
- .swiper-item {
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- flex-direction: column;
- justify-content: center;
- align-items: center;
- color: #fff;
- height: 300rpx;
- line-height: 300rpx;
- }
- @media screen and (min-width: 500px) {
- .uni-swiper-dot-box {
- width: 400px;
- /* #ifndef APP-NVUE */
- margin: 0 auto;
- /* #endif */
- margin-top: 8px;
- }
- .image {
- width: 100%;
- }
- }
- </style>
|