付延余
2022-09-07 513be798a677672644770e2b2f7025b6d4d20414
pages/home/home.vue
@@ -2,16 +2,12 @@
   <view class="home">
      <!-- 轮播图 -->
      <view class="home_swipe"><u-swiper :list="list3" indicator indicatorMode="line" circular></u-swiper></view>
      <!-- 图表 -->
      <combined-title title="煤仓库存明细"></combined-title>
      <view class="charts-box">
         <qiun-data-charts type="pie" :opts="opts" :chartData="chartData" v-if="uchartsData.length > 0" />
         <u-empty
                 mode="data"
                 icon="http://cdn.uviewui.com/uview/empty/data.png"
                     v-if="uchartsData.length == 0"
         >
         </u-empty>
         <u-empty mode="data" iconSize="200" textSize="25" width="350" height="350" icon="http://cdn.uviewui.com/uview/empty/data.png" v-if="uchartsData.length == 0"></u-empty>
      </view>
      <!-- 我的申请 -->
      <combined-title title="我的申请" detailsPath="/pages/my-application/my-application" v-if="shenqingMenu"></combined-title>
@@ -29,7 +25,7 @@
                        <text>所属流程:{{ item.processName }}</text>
                     </view>
                     <view class="">
                        <text>审批环节:{{ item.currTaskName }}</text>
                        <text>审批环节:{{ item.currTaskName || '' }}</text>
                     </view>
                  </view>
                  <view class="center-content__two center-margin">
@@ -62,7 +58,7 @@
                        <image src="@/static/home/jindu.png" mode=""></image>
                        <view>查看进度</view>
                     </view>
                     <view @click="theFormDataClick(item.tableId)" v-if="item.status == 1 || item.status == 2">
                     <view @click="theFormDataClick(item.tableId)" v-if="(item.status == 1 || item.status == 2) && item.procDefId == 'WAY_BILL:4:87504'">
                        <image src="@/static/home/biaodan.png" mode=""></image>
                        <view>表单数据</view>
                     </view>
@@ -70,7 +66,7 @@
                        <image src="@/static/home/history.png" mode=""></image>
                        <view>重新申请</view>
                     </view>
                     <view @click="editMyApplication(item)" v-if="item.status == 3">
                     <view @click="editMyApplication(item)" v-if="item.status == 3 && item.procDefId == 'WAY_BILL:4:87504'">
                        <image src="@/static/home/history.png" mode=""></image>
                        <view>编辑</view>
                     </view>
@@ -105,10 +101,10 @@
               <view class="center-container">
                  <view class="center-content__one center-margin">
                     <view class="">
                        <text>任务名称:{{ item.name }}</text>
                        <text>任务名称:{{ item.name || '' }}</text>
                     </view>
                     <view class="">
                        <text>所属流程:{{ item.processName }}</text>
                        <text>所属流程:{{ item.processName || '' }}</text>
                     </view>
                  </view>
                  <view class="center-content__two center-margin">
@@ -162,7 +158,7 @@
                        <text>任务名称:{{ item.name }}</text>
                     </view>
                     <view>
                        <text>所属流程:{{ item.processName }}</text>
                        <text>所属流程:{{ item.processName || '' }}</text>
                     </view>
                  </view>
                  <view class="center-content__two center-margin">
@@ -175,7 +171,7 @@
                  </view>
                  <view class="center-content__three center-margin">
                     <view class="">
                        <text>审批意见:{{ item.comment }}</text>
                        <text>审批意见:{{ item.comment || '' }}</text>
                     </view>
                     <view class="">
                        <text>
@@ -198,7 +194,7 @@
               <view class="bottom-container">
                  <!-- 已办按钮 -->
                  <view class="bottom-content__item">
                     <view @click="theFormDataClick(item.tableId)">
                     <view @click="theFormDataClick(item.tableId)" v-if="item.procDefId == 'WAY_BILL:4:87504'">
                        <image src="@/static/home/biaodan.png" mode=""></image>
                        <view>表单数据</view>
                     </view>
@@ -218,7 +214,7 @@
      <!-- 日计划 -->
      <combined-title title="日发运计划" detailsPath="/pages/jihua/jihua" v-if="rijihuaMenu"></combined-title>
      <view class="card-group">
      <view class="card-group bottomChild" >
         <combination-card class="card" :showTop="false" v-for="(item, index) in fyData.slice(0, 2)" :key="item.id" v-if="rijihuaMenu">
            <template v-slot:top></template>
            <template v-slot:center>
@@ -306,6 +302,20 @@
      <!-- 菜单栏 -->
      <!-- <popup-menu @menuShow="menushow" ref="menuRef"></popup-menu> -->
      <u-gap height="15" bgColor="#eeeeee"></u-gap>
      <view class="utils">
         <view class="utils-container">
            <view class="utils-container-body" @click="redirectLogin">
               <view class="top"><u-icon name="backspace" color="#FF4233" size="70"></u-icon></view>
               <view class="bottom-text"><text>退出</text></view>
            </view>
            <view class="utils-container-body" @click="huanBang">
               <view class="top"><u-icon name="lock-open" color="#1987FF" size="70"></u-icon></view>
               <view class="bottom-text"><text>换绑</text></view>
            </view>
         </view>
      </view>
      <u-gap height="60" bgColor="#eeeeee"></u-gap>
   </view>
</template>
@@ -315,7 +325,7 @@
// import popupMenu from '@/components/common/popup-menu/popup-menu.vue';
import combinedTitle from '@/components/common/combined-title/combined-title.vue';
import combinationCard from '@/components/common/combination-card/combination-card.vue';
import { setAccessToken } from '@/utils/status.js';
import { setAccessToken, redirectLogin } from '@/utils/status.js';
export default {
   name: 'home',
@@ -432,27 +442,31 @@
   // },
   // 点击导航栏菜单后
   onNavigationBarButtonTap(e) {
      console.log('退出导航栏按钮事件',e);
      console.log('退出导航栏按钮事件', e);
      // this.$refs.menuRef.menuClick();
   },
   // 监听左上角的回退事件
   onUnload(event){ //多层级跳转之后,监听左上角返回事件,直接退回到index
      console.log('监听左上角',event);
      uni.request({
        url: `${BaseUrl}/auth/token/logout`,
        method: 'DELETE',
        header: {
          'TENANT-ID': 5,
          Authorization: 'Bearer ' + uni.getStorageSync('access_token'),
          VERSION: 'zzl'
        }
      }).then(res=>{
         console.log('缓存清理成功');
      }).catch(err => {
        uni.showToast({
          title: '缓存清理失败!',
        })
      })
   onUnload(event) {
      //多层级跳转之后,监听左上角返回事件,直接退回到index
      console.log('监听左上角', event);
      uni
         .request({
            url: `${BaseUrl}/auth/token/logout`,
            method: 'DELETE',
            header: {
               'TENANT-ID': 5,
               Authorization: 'Bearer ' + uni.getStorageSync('access_token'),
               VERSION: 'zzl'
            }
         })
         .then(res => {
            console.log('缓存清理成功');
         })
         .catch(err => {
            uni.showToast({
               title: '缓存清理失败!'
            });
         });
   },
   onShow() {
      // 菜单注释(app待用)
@@ -486,7 +500,7 @@
         });
      },
      getServerData() {
         console.log('加载图表',this.uchartsData);
         console.log('加载图表', this.uchartsData);
         //模拟从服务器获取数据时的延时
         setTimeout(() => {
            //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
@@ -783,6 +797,14 @@
         this.deleteApplicationModalShow = true;
         this.procInstId = id;
         console.log(id);
      },
      redirectLogin() {
         redirectLogin();
      },
      huanBang() {
         uni.navigateTo({
            url: '/pages/register/register'
         });
      }
   }
};
@@ -793,7 +815,20 @@
   width: 100%;
   display: flex;
   flex-direction: column;
   padding-bottom: vww(20);
   // 横向菜单栏
   .utils {
      .utils-container {
         display: flex;
         justify-content: space-between;
         width: 66%;
         margin: 0 auto;
         .utils-container-body {
            display: flex;
            align-items: center;
         }
      }
   }
   .home_swipe {
      width: 100%;
@@ -820,8 +855,8 @@
      width: 91%;
      height: vww(330);
      margin: 0 auto;
      .u-empty{
         height:100%;
      .u-empty {
         height: 100%;
      }
   }
@@ -839,6 +874,9 @@
            }
         }
      }
   }
   .bottomChild{
      margin-bottom: vww(20);
   }
   // 卡片中间
@@ -925,7 +963,7 @@
      // width:100%;
      // height:vww(244);
      .slot-content {
      width:vww(330);
         width: vww(330);
         .rejectMesaage {
            display: flex;
            padding: vww(3);
@@ -1062,4 +1100,4 @@
      }
   }
}
</style>
</style>