Commit 7a526d85 authored by 胡占生's avatar 胡占生 🇨🇳
Browse files

fix: 风险台账,风险评估,风险审批,任务管理 页面模块新增初始化

parent 26cfc50d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
    <title>第三官网分公司App</title>
    <title>融通物管安全管理平台</title>
    <link rel="stylesheet" href="//at.alicdn.com/t/font_1623819_3g3arzgtlmk.css">
  </head>
  <body>
+187 −15
Original line number Diff line number Diff line
<!--
 * 严肃声明:
 * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
 * 本系统已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
 * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
 * Copyright (c) 2020 陈尼克 all rights reserved.
 * 版权所有,侵权必究!
 *
-->
<template>
  <div id="app">
    <transition>
      <!-- :style="{ height: showTab ?appHeight:'100%' }"   之前是给id为app-content 设置的内联样式  id="app-content" -->
      <div>
          <transition :name="transitionName">
              <keep-alive :include="cachePage">
                  <router-view class="router-view" />
              </keep-alive>
          </transition>
      </div>
      <tab-bar v-if="showTab"></tab-bar>
  </div>
</template>

<script>
import tabBar from "@/components/TabBar";

export default {
  components: {
      tabBar,
  },
  data() {
      return {
      cachePage: [],
          appHeight: "",
          tabH: "",
          rempx: 0,
          headH: "",
          screenH: "",
          transitionName: "slide-left",
          cachePage: [
          'riskAdd'
          ],
          // 不需要展示底部tabbar的页面
          noTab:["login", "login2", "choose-people","scan",'success','fail','warn','center','reset-pas-two','riskTaskList'],
           // cachePage预先定义的缓存页面
          otherCache: [],
           // 专门处理列表缓存的页面,这些页面缓存逻辑与其他缓存不一样去详情返回列表缓存,但是进入列表必须刷新,如何有需要缓存的列表请放到这里来。
          listCache:['insert-danger','confirme-danger','change-danger','review-danger','stand-book','major-danger','delay-approval',
          'my-delay','risk-account','risk-confirme','my-delay'],
          // 'report-return', 'risk-return', 风险和隐患的上报退回不需要缓存
      };
  },

  mounted() {
      // 这个配合列表路由使用缓存初始缓存页面
      this.otherCache=[...this.cachePage];
      let tabH =
          document
              .getElementsByTagName("html")[0]
              .style.fontSize.split("px")[0] * 1.33333;
      let sH = document.documentElement.clientHeight;
      this.headH =
          document
              .getElementsByTagName("html")[0]
              .style.fontSize.split("px")[0] * 1.5;
      +"px";
      this.appHeight = sH - tabH + "px";
      this.tabH = tabH + "px";
      this.screenH = sH + "px";
  },
  computed: {
      showTab() {
          return !this.noTab.includes(
              this.$route.name
          );
      },
  },
  methods:{
      // 处理缓存的方法
      handleCache(roterFromName, roterToName, markRoterName){
          if(roterToName == markRoterName){
              // 从定义缓存列表中移除
              if(this.cachePage.findIndex(item => item == roterFromName) != -1){
                  this.cachePage.splice(this.cachePage.findIndex(item => item == roterFromName), 1)
              }
          }else{
              // 判断有无路由 加入缓存
              if(this.cachePage.findIndex(item => item == roterFromName) == -1){
                  this.cachePage.push(roterFromName)
              }
          }
      }
  },
  watch: {
      $route(to, from) {
          // 列表操作去除缓存,刷新列表页
          if(from.name == 'confirme-danger' || to.name=='confirme-danger'){  // 隐患整改页面缓存处理
              this.handleCache('confirme-danger', to.name, 'affirm-danger')
          }else if(from.name == 'change-danger' || to.name=='change-danger'){  // 隐患整改页面缓存处理
              this.handleCache('change-danger', to.name, 'change-info')
          }else if(from.name == 'review-danger' || to.name=='review-danger'){  // 隐患复查页面缓存处理
              this.handleCache('review-danger', to.name, 'review-add')
          }else if(from.name == 'major-danger' || to.name=='major-danger'){  // 企业审批页面缓存处理
              this.handleCache('major-danger', to.name, 'major-survey')
          }else if(from.name == 'risk-confirme' || to.name=='risk-confirme'){  // 风险确认页面缓存处理
              this.handleCache('risk-confirme', to.name, 'risk-affirm')
          }


          // 列表页面动态添加缓存
          if(from.name=='save-workbench'){
              // 如何使从工作台进入列表页面在cachePage里添加页面
              if((!this.cachePage.includes(to.name))&&this.listCache.includes(to.name)){
                  this.cachePage.push(to.name)
              }
          }
          if(to.name=='save-workbench'){
              // 如何回到工作台默认恢复预定义缓存页面
             this.cachePage=[...this.otherCache];
          }

          // 有主级到次级
          if (to.meta.index > from.meta.index) {
              this.transitionName = "slide-left"; // 向左滑动
          } else if (to.meta.index < from.meta.index) {
              // 由次级到主级
              this.transitionName = "slide-right";
          } else {
              this.transitionName = ""; //同级无过渡效果
          }
      },
  },
};
</script>


<style lang="less">
body{
background-color: #f0f1f5;
@@ -26,22 +141,79 @@ body{
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  // text-align: center;
  color: #2c3e50;
  // box-sizing: border-box;
  // overflow: hidden;
  // position: relative;
  // overflow: hidden;
  // height: 100vh;
  // background-color: #f0f1f5;
  // z-index:999999999999
}
#app-content {
  box-sizing: border-box;
  overflow: hidden;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  overflow: hidden;
  // padding-bottom: 1.3333rem;
  height: 100%; // 此处新增height 为了解决ios适配问题
}

.router-view {
  // width: 100%;
  // height: 100%;
  // position: absolute;
  // top: 0;
  // bottom: 0;
  // margin: 0 auto;
  // -webkit-overflow-scrolling: touch;
  // background-color: #f0f1f5;
  // overflow: auto;



  width: 100%;
  height: auto;
  -webkit-overflow-scrolling: touch;
  background-color: #f0f1f5;
  overflow: auto;
  position: absolute;
  top: 0;
  bottom: 0;
  margin: 0 auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 50px;
  box-sizing: border-box;
}

.slide-right-enter-active,
.slide-right-leave-active,
.slide-left-enter-active,
.slide-left-leave-active {
  height: 100%;
  will-change: transform;
  transition: all 500ms;
  position: absolute;
  backface-visibility: hidden;
}
.slide-right-enter {
  opacity: 0;
  transform: translate3d(-100%, 0, 0);
}
.slide-right-leave-active {
  opacity: 0;
  transform: translate3d(100%, 0, 0);
}
.slide-left-enter {
  opacity: 0;
  transform: translate3d(100%, 0, 0);
}
input{
  border: none;
  outline: none;
  -webkit-appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
.slide-left-leave-active {
  opacity: 0;
  transform: translate3d(-100%, 0, 0);
}
</style>
+18 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="70px" height="70px" xmlns="http://www.w3.org/2000/svg">
  <defs>
    <filter x="319px" y="625px" width="70px" height="70px" filterUnits="userSpaceOnUse" id="filter2">
      <feOffset dx="5" dy="5" in="SourceAlpha" result="shadowOffsetInner" />
      <feGaussianBlur stdDeviation="5" in="shadowOffsetInner" result="shadowGaussian" />
      <feComposite in2="shadowGaussian" operator="atop" in="SourceAlpha" result="shadowComposite" />
      <feColorMatrix type="matrix" values="0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.313725490196078 0  " in="shadowComposite" />
    </filter>
    <g id="widget3">
      <path d="M 38.96484375 28.5481770833333  C 39.3771701388889 28.1358506944444  39.5833333333333 27.6475694444444  39.5833333333333 27.0833333333333  L 39.5833333333333 22.9166666666667  C 39.5833333333333 22.3524305555556  39.3771701388889 21.8641493055556  38.96484375 21.4518229166667  C 38.5525173611111 21.0394965277778  38.0642361111111 20.8333333333333  37.5 20.8333333333333  L 29.1666666666667 20.8333333333333  L 29.1666666666667 12.5  C 29.1666666666667 11.9357638888889  28.9605034722222 11.4474826388889  28.5481770833333 11.03515625  C 28.1358506944444 10.6228298611111  27.6475694444444 10.4166666666667  27.0833333333333 10.4166666666667  L 22.9166666666667 10.4166666666667  C 22.3524305555556 10.4166666666667  21.8641493055556 10.6228298611111  21.4518229166667 11.03515625  C 21.0394965277778 11.4474826388889  20.8333333333333 11.9357638888889  20.8333333333333 12.5  L 20.8333333333333 20.8333333333333  L 12.5 20.8333333333333  C 11.9357638888889 20.8333333333333  11.4474826388889 21.0394965277778  11.03515625 21.4518229166667  C 10.6228298611111 21.8641493055556  10.4166666666667 22.3524305555556  10.4166666666667 22.9166666666667  L 10.4166666666667 27.0833333333333  C 10.4166666666667 27.6475694444444  10.6228298611111 28.1358506944444  11.03515625 28.5481770833333  C 11.4474826388889 28.9605034722222  11.9357638888889 29.1666666666667  12.5 29.1666666666667  L 20.8333333333333 29.1666666666667  L 20.8333333333333 37.5  C 20.8333333333333 38.0642361111111  21.0394965277778 38.5525173611111  21.4518229166667 38.96484375  C 21.8641493055556 39.3771701388889  22.3524305555556 39.5833333333333  22.9166666666667 39.5833333333333  L 27.0833333333333 39.5833333333333  C 27.6475694444444 39.5833333333333  28.1358506944444 39.3771701388889  28.5481770833333 38.96484375  C 28.9605034722222 38.5525173611111  29.1666666666667 38.0642361111111  29.1666666666667 37.5  L 29.1666666666667 29.1666666666667  L 37.5 29.1666666666667  C 38.0642361111111 29.1666666666667  38.5525173611111 28.9605034722222  38.96484375 28.5481770833333  Z M 46.6471354166667 12.451171875  C 48.8823784722222 16.2814670138889  50 20.4644097222222  50 25  C 50 29.5355902777778  48.8823784722222 33.7185329861111  46.6471354166667 37.548828125  C 44.4118923611111 41.3791232638889  41.3791232638889 44.4118923611111  37.548828125 46.6471354166667  C 33.7185329861111 48.8823784722222  29.5355902777778 50  25 50  C 20.4644097222222 50  16.2814670138889 48.8823784722222  12.451171875 46.6471354166667  C 8.62087673611111 44.4118923611111  5.58810763888889 41.3791232638889  3.35286458333333 37.548828125  C 1.11762152777778 33.7185329861111  0 29.5355902777778  0 25  C 0 20.4644097222222  1.11762152777778 16.2814670138889  3.35286458333333 12.451171875  C 5.58810763888889 8.62087673611111  8.62087673611111 5.58810763888888  12.451171875 3.35286458333333  C 16.2814670138889 1.11762152777777  20.4644097222222 0  25 0  C 29.5355902777778 0  33.7185329861111 1.11762152777777  37.548828125 3.35286458333333  C 41.3791232638889 5.58810763888888  44.4118923611111 8.62087673611111  46.6471354166667 12.451171875  Z " fill-rule="nonzero" fill="#333333" stroke="none" fill-opacity="0.898039215686275" transform="matrix(1 0 0 1 324 630 )" />
    </g>
  </defs>
  <g transform="matrix(1 0 0 1 -319 -625 )">
    <use xlink:href="#widget3" filter="url(#filter2)" />
    <use xlink:href="#widget3" />
  </g>
</svg>
 No newline at end of file
+426 B
Loading image diff...
+443 B
Loading image diff...
Loading