coys il y a 1 an
Parent
commit
df604e89e6

+ 1 - 1
src/App.vue

@@ -1,6 +1,6 @@
 <template>
   <div id="app">
-    <watercom></watercom>
+    <watercom ref="watercom"></watercom>
     <router-view />
   </div>
 </template>

+ 32 - 26
src/components/layouts/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div ref="layouts" :class="{'app-container': !$route.meta.hideTabBar} ">
+  <div ref="layouts" :class="{ 'app-container': !$route.meta.hideTabBar }">
     <div class="layout-content">
       <keep-alive :include="include">
         <router-view v-if="$route.meta.keepAlive"></router-view>
@@ -7,14 +7,14 @@
       <router-view v-if="!$route.meta.keepAlive"></router-view>
     </div>
     <div v-if="!$route.meta.hideTabBar" class="layout-footer">
-        <TabBar :data="tabTars" @change="handleChange" />
+      <TabBar :data="tabTars" @change="handleChange" />
     </div>
   </div>
 </template>
 
 <script>
 import TabBar from '@/components/TabBar'
-import {userInfo} from "@/api/public";
+import { userInfo } from '@/api/public'
 export default {
   data() {
     return {
@@ -56,41 +56,47 @@ export default {
     TabBar
   },
   created() {
-    this.getUserInfo();
+    this.getUserInfo()
   },
   watch: {
     $route(to, from) {
-
       //如果 要 to(进入) 的页面是需要 keepAlive 缓存的,把 name push 进 include数组
       if (to.meta.keepAlive) {
-        !this.include.includes(to.name) && this.include.push(to.name);
-        console.log(this.include,'缓存列表')
+        !this.include.includes(to.name) && this.include.push(to.name)
+        console.log(this.include, '缓存列表')
       }
-     /**
-     * 如果要form(离开)的页面是keepAlive缓存的,
-     * 再根据deep来判断是前进还是后退
-     */
-     //后退
-      console.log(from.meta.keepAlive , to.meta.deep , from.meta.deep,'ppppppppp')
+      /**
+       * 如果要form(离开)的页面是keepAlive缓存的,
+       * 再根据deep来判断是前进还是后退
+       */
+      //后退
+      console.log(from.meta.keepAlive, to.meta.deep, from.meta.deep, 'ppppppppp')
       if (from.meta.keepAlive && to.meta.deep < from.meta.deep) {
-        let index = this.include.indexOf(from.name);
-        index !== -1 && this.include.splice(index, 1);
-        console.log(this.include,'缓存列表2')
+        let index = this.include.indexOf(from.name)
+        index !== -1 && this.include.splice(index, 1)
+        console.log(this.include, '缓存列表2')
       }
-      console.log(this.include,'缓存列表3')
+      console.log(this.include, '缓存列表3')
     }
   },
   methods: {
-    getUserInfo(){
-      userInfo().then(info=>{
-        console.log(info,'info')
-        this.$store.commit('SET_USER_NAME',info.user.name);
-        this.$store.commit('SET_USER_ROLELIST',info.roleList);
-        this.$store.commit('SET_USER_ID',info.user.id);
-        this.$store.commit('SET_USER_ORGID',info.user.orgId);
-        this.$store.commit('SET_USER_ORGNAME',info.user.orgName);
-        this.$store.commit('SET_USER_ORGTYPE',info.user.orgType);
+    getUserInfo() {
+      userInfo().then(info => {
+        console.log(info, 'info')
+        this.$store.commit('SET_USER_NAME', info.user.name)
+        this.$store.commit('SET_USER_ROLELIST', info.roleList)
+        this.$store.commit('SET_USER_ID', info.user.id)
+        this.$store.commit('SET_USER_ORGID', info.user.orgId)
+        this.$store.commit('SET_USER_ORGNAME', info.user.orgName)
+        this.$store.commit('SET_USER_ORGTYPE', info.user.orgType)
+        //登陆之后手动触发一次水印数据刷新
+        
+
+          this.$parent.$refs.watercom.getWater(1)
+          
+       
       })
+
       this.$store.dispatch('getOrgTree')
     },
     handleChange(v) {

+ 5 - 12
src/components/waterCom.vue

@@ -25,21 +25,14 @@ export default {
   mounted() {
     this.getWater()
   },
-  watch:{
-    'sessionStorage.SET_USER_NAME'(val){
-        
-        if(val){
-            console.log(val);
-            this.getWater()
-        }
-    }
-  },
+ 
 
   methods: {
-    getWater() {
+    getWater(type=0) {
       let orgName=JSON.parse(sessionStorage.getItem('SET_USER_ORGNAME'))
       let userName=JSON.parse(sessionStorage.getItem('SET_USER_NAME'))
-      console.log(this.$store.getters,'this.$store.getters');
+      console.log(userName,'userName');
+      console.log(orgName,'orgName');
       const canvas = document.getElementById('canvas') //获取canvas
       // canvas.width = 800 //设置画布宽度
       canvas.height = 200 //设置画布高度
@@ -53,7 +46,7 @@ export default {
       ctx.rotate(-0.3) //设置文字旋转角度
       ctx.fillText(`${userName||''}${orgName||''}${this.date}`, -10, 120) //设置显示文字内容
       const img = canvas.toDataURL('image/png') //参数默认为 image/png,可以是其他image/jpeg等,该方法返回值是一个url,是base64组成的图片的源数据、可以直接赋值给图片的src属性
-      const style = `background-image:url(${img});width:300px;z-index:111;display:none;` //定义样式
+      const style = `background-image:url(${img});width:300px;z-index:111;display:${type==1? 'block':'none'};` //定义样式
       water.setAttribute('style', style) //给要添加水印的元素设置样式
     }
   }

+ 1 - 18
src/main.js

@@ -34,24 +34,7 @@ import '@vant/touch-emulator'
 import './components/index.js'
 import watercom from '@/components/waterCom.vue'
 Vue.component('watercom', watercom)
-/*实时获取 sessionStorage 的值*/
-Vue.prototype.resetSetItem = function (key, newVal) {
-  //注意categoryNum为要监听的属性,实际开发中请自行修改
-  if (key === 'userName') {
-    // 创建一个StorageEvent事件
-    var newStorageEvent = document.createEvent('StorageEvent')
-    const storage = {
-      setItem: function (k, val) {
-        sessionStorage.setItem(k, val)
-        // 初始化创建的事件
-        newStorageEvent.initStorageEvent('setItem', false, false, k, null, val, null, null)
-        // 派发对象
-        window.dispatchEvent(newStorageEvent)
-      }
-    }
-    return storage.setItem(key, newVal)
-  }
-}
+
 Vue.use(Vant)
 // Vue.use(watercom);
 Vue.use(VueEasytable)

+ 12 - 5
src/views/menu/resumptionEvaluate/evaluate.vue

@@ -21,7 +21,7 @@
       </div>
       <van-form @submit="onSubmit" ref="form" v-if="addOrInfo == 'add'">
         <van-cell
-          :title="item.code + '.' + item.content"
+          :title="item.code + '.' + 'item.content评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容content评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容'"
           v-for="item in formData.coreEvaluateContentList"
           :key="item.id"
         >
@@ -181,10 +181,17 @@ export default {
   }
 }
 </script>
+<style  >
+
+</style>
 <style lang="scss" scoped>
+
 .evaluate {
-  
-  height: 100%;
+  .van-form{
+    height: calc(100vh - 300px);  
+    overflow: scroll;
+    padding-bottom: 130px;
+  }
   font-size: 30px;
   .bgcwirte{
     background: #fff;
@@ -220,8 +227,8 @@ export default {
   width: 100%;
 }
 .cell-btutton {
-  position: absolute;
-  bottom: 0%;
+  position: fixed;
+  bottom: 0% ;
   width: 100%;
 }
 .cardBigBox {

+ 1 - 1
src/views/menu/resumptionEvaluate/index.vue

@@ -200,7 +200,7 @@ export default {
 
     //判断评价按钮是否展示
     evaluateTure(item) {
-      // return true
+      return true
       if (item.status == 0) {
         return true
       }

+ 11 - 9
src/views/menu/training/components/selectData.vue

@@ -172,15 +172,17 @@ export default {
       
     },
     tagHandler(i) {
-      const filePath = `${process.env.NODE_ENV === 'development' ? '/dev' : window.origin}${i.url}`
-      const tempLink = document.createElement('a')
-      tempLink.style.display = 'none'
-      tempLink.href = filePath
-      tempLink.setAttribute('download', i.name)
-      tempLink.setAttribute('target', '_blank')
-      document.body.appendChild(tempLink)
-      tempLink.click()
-      document.body.removeChild(tempLink)
+     
+      this.openFilePreview(i)
+      // const filePath = `${process.env.NODE_ENV === 'development' ? '/dev' : window.origin}${i.url}`
+      // const tempLink = document.createElement('a')
+      // tempLink.style.display = 'none'
+      // tempLink.href = filePath
+      // tempLink.setAttribute('download', i.name)
+      // tempLink.setAttribute('target', '_blank')
+      // document.body.appendChild(tempLink)
+      // tempLink.click()
+      // document.body.removeChild(tempLink)
     },
     clickHandler() {
       console.log('哈哈哈哈')

+ 1 - 0
src/views/menu/training/index.vue

@@ -273,6 +273,7 @@ export default {
     },
     //判断是否展示登记按钮
     isSign(list) {
+      
       let falg = false
       let timefalg = false
       //value1 当前登陆用户ID