cuiyalong 3 жил өмнө
parent
commit
3a402b33ac

+ 10 - 2
src/components/common/Tips.vue

@@ -7,6 +7,7 @@
 
 
 <script>
 <script>
 import { Button } from 'element-ui'
 import { Button } from 'element-ui'
+import { tryCallHooks } from '@jianyu/easy-inject-qiankun'
 export default {
 export default {
   components: {
   components: {
     [Button.name]: Button
     [Button.name]: Button
@@ -16,8 +17,15 @@ export default {
   },
   },
   methods: {
   methods: {
     openCustomer () {
     openCustomer () {
-      // eslint-disable-next-line
-      $('.help-slide-zx.open-customer').trigger('click')
+      tryCallHooks({
+        fn: () => {
+          this.$BRACE.$emit('open-customer')
+        },
+        spareFn: () => {
+          // eslint-disable-next-line
+          $('.help-slide-zx.open-customer').trigger('click')
+        }
+      })
     }
     }
   }
   }
 }
 }

+ 7 - 3
src/components/work-desktop/Transfer.vue

@@ -16,6 +16,10 @@ export default {
   name: 'work-transfer',
   name: 'work-transfer',
   computed: {},
   computed: {},
   props: {
   props: {
+    maxCount: {
+      type: Number,
+      default: 8
+    },
     submitKey: {
     submitKey: {
       type: String,
       type: String,
       default: 'label'
       default: 'label'
@@ -61,7 +65,7 @@ export default {
       // console.log(rightData)
       // console.log(rightData)
       const data = []
       const data = []
       allData.forEach((v, i) => {
       allData.forEach((v, i) => {
-        if (rightData.length >= 8) {
+        if (rightData.length >= this.maxCount) {
           data.push({
           data.push({
             ...v,
             ...v,
             key: i,
             key: i,
@@ -97,7 +101,7 @@ export default {
       const totalArr = this.checked.concat(val)
       const totalArr = this.checked.concat(val)
       const totalLen = rightdLen + leftLen
       const totalLen = rightdLen + leftLen
       // console.log(totalLen, totalArr)
       // console.log(totalLen, totalArr)
-      if (totalLen >= 8) {
+      if (totalLen >= this.maxCount) {
         this.transferData.forEach((v, i) => {
         this.transferData.forEach((v, i) => {
           // console.log(totalArr.indexOf(i) === -1)
           // console.log(totalArr.indexOf(i) === -1)
           if (totalArr.indexOf(i) === -1) {
           if (totalArr.indexOf(i) === -1) {
@@ -113,7 +117,7 @@ export default {
       }
       }
     },
     },
     onChange (val) {
     onChange (val) {
-      if (val.length < 8) {
+      if (val.length < this.maxCount) {
         this.transferData.forEach((v, i) => {
         this.transferData.forEach((v, i) => {
           v.disabled = false
           v.disabled = false
         })
         })

+ 19 - 17
src/store/workspace/ent-follow.js

@@ -36,23 +36,25 @@ export default {
         const { data = {}, error_code: code } = await getEntFollowList(payload)
         const { data = {}, error_code: code } = await getEntFollowList(payload)
         if (code === 0 && data) {
         if (code === 0 && data) {
           const { list: rList = [] } = data
           const { list: rList = [] } = data
-          const list = rList.map(v => {
-            // const visited = this.pathVisited(
-            //   this.createPathItem(
-            //     '/article/content/*.html',
-            //     `id=${v.s_entId}`
-            //   )
-            // )
-            return {
-              ...v,
-              // visited,
-              _id: v.s_entId,
-              title: v.s_entname,
-              unread: false,
-              time: v.l_lastpushtime ? v.l_lastpushtime * 1000 : 0
-            }
-          })
-          commit('changeList', list)
+          if (Array.isArray(rList)) {
+            const list = rList.map(v => {
+              // const visited = this.pathVisited(
+              //   this.createPathItem(
+              //     '/article/content/*.html',
+              //     `id=${v.s_entId}`
+              //   )
+              // )
+              return {
+                ...v,
+                // visited,
+                _id: v.s_entId,
+                title: v.s_entname,
+                unread: false,
+                time: v.l_lastpushtime ? v.l_lastpushtime * 1000 : 0
+              }
+            })
+            commit('changeList', list)
+          }
         }
         }
         commit('changeLoading', false)
         commit('changeLoading', false)
         commit('changeLoaded', true)
         commit('changeLoaded', true)

+ 5 - 1
src/store/workspace/message.js

@@ -67,8 +67,12 @@ export default {
         commit('changeLoaded', false)
         commit('changeLoaded', false)
         const { data = {}, status } = await getMessageCenterList(payload)
         const { data = {}, status } = await getMessageCenterList(payload)
         const { list = [], last } = data
         const { list = [], last } = data
+        const lastArr = []
+        if (last && Object.keys(last).length) {
+          lastArr.push(last)
+        }
         if (status === 1) {
         if (status === 1) {
-          const result = [].concat(last, list).filter(v => v)
+          const result = [].concat(lastArr, list).filter(v => v)
           if (Array.isArray(result)) {
           if (Array.isArray(result)) {
             result.forEach(v => {
             result.forEach(v => {
               v.messageType = messageTypeText(v.msg_type)
               v.messageType = messageTypeText(v.msg_type)

+ 19 - 17
src/store/workspace/project-follow.js

@@ -36,23 +36,25 @@ export default {
         const { data = {}, error_code: code } = await getFollowProjectList(payload)
         const { data = {}, error_code: code } = await getFollowProjectList(payload)
         if (code === 0 && data) {
         if (code === 0 && data) {
           const { List = [] } = data
           const { List = [] } = data
-          const list = List.map(v => {
-            // const visited = this.pathVisited(
-            //   this.createPathItem(
-            //     '/article/content/*.html',
-            //     `id=${v.sid}`
-            //   )
-            // )
-            return {
-              ...v,
-              // visited,
-              _id: v.sid,
-              title: v.title,
-              unread: false,
-              time: v.l_lastpushtime ? v.l_lastpushtime * 1000 : 0
-            }
-          })
-          commit('changeList', list)
+          if (Array.isArray(List)) {
+            const list = List.map(v => {
+              // const visited = this.pathVisited(
+              //   this.createPathItem(
+              //     '/article/content/*.html',
+              //     `id=${v.sid}`
+              //   )
+              // )
+              return {
+                ...v,
+                // visited,
+                _id: v.sid,
+                title: v.title,
+                unread: false,
+                time: v.l_lastpushtime ? v.l_lastpushtime * 1000 : 0
+              }
+            })
+            commit('changeList', list)
+          }
         }
         }
         commit('changeLoading', false)
         commit('changeLoading', false)
         commit('changeLoaded', true)
         commit('changeLoaded', true)

+ 4 - 2
src/views/portrayal/UnitPortrayal.vue

@@ -709,10 +709,12 @@ export default {
           } else {
           } else {
             // 关注操作返回
             // 关注操作返回
             this.follow.followed = true
             this.follow.followed = true
-            this.$toast(res.error_msg || '关注成功,可前往“客户监控”中查看')
+            this.$toast('关注成功,请前往“客户监控”中查看')
           }
           }
         } else {
         } else {
-          this.$toast(res.error_msg)
+          if (res.error_msg) {
+            this.$toast(res.error_msg)
+          }
         }
         }
       }).finally(() => {
       }).finally(() => {
         this.follow.loading = false
         this.follow.loading = false

+ 13 - 5
src/views/portrayal/components/EntFollowStar.vue

@@ -1,11 +1,12 @@
 <template>
 <template>
-  <div class="ent-follow-container" @click="setFollow()">
-    <span :class="follow.classActive"></span>
-    <span class="follow_text">{{ follow.text }}</span>
+  <div class="ent-follow-container" v-show="followCheck.isShow">
+    <div class="ent-follow" @click="setFollow()">
+      <span :class="follow.classActive"></span>
+      <span class="follow_text">{{ follow.text }}</span>
+    </div>
     <!-- 关注分组选择dialog -->
     <!-- 关注分组选择dialog -->
     <el-dialog
     <el-dialog
       custom-class="sub-dialog"
       custom-class="sub-dialog"
-      append-to-body
       :visible.sync="follow.dialog"
       :visible.sync="follow.dialog"
       :close-on-click-modal="false"
       :close-on-click-modal="false"
       :show-close="false"
       :show-close="false"
@@ -44,6 +45,10 @@ export default {
   },
   },
   data () {
   data () {
     return {
     return {
+      followCheck: {
+        followed: false,
+        isShow: true
+      },
       follow: {
       follow: {
         classActive: 'icon_heart_gray',
         classActive: 'icon_heart_gray',
         text: '关注',
         text: '关注',
@@ -61,6 +66,9 @@ export default {
     getFollow () {
     getFollow () {
       getfollowCheck({ entId: this.id }).then(res => {
       getfollowCheck({ entId: this.id }).then(res => {
         if (res.error_code === 0) {
         if (res.error_code === 0) {
+          if (res.data) {
+            Object.assign(this.followCheck, res.data)
+          }
           if (res.data.followed) {
           if (res.data.followed) {
             this.follow.classActive = 'icon_heart_red'
             this.follow.classActive = 'icon_heart_red'
             this.follow.text = '已关注'
             this.follow.text = '已关注'
@@ -128,7 +136,7 @@ export default {
     padding: 0;
     padding: 0;
   }
   }
 }
 }
-.ent-follow-container {
+.ent-follow {
   display: flex;
   display: flex;
   align-items: center;
   align-items: center;
   cursor: pointer;
   cursor: pointer;

+ 17 - 1
src/views/workspace/components/BusinessProfile.vue

@@ -23,6 +23,7 @@
 import { mapActions, mapGetters } from 'vuex'
 import { mapActions, mapGetters } from 'vuex'
 import { Icon } from 'element-ui'
 import { Icon } from 'element-ui'
 import WorkspaceCard from '../ui/WorkspaceCard'
 import WorkspaceCard from '../ui/WorkspaceCard'
+import { tryCallHooks } from '@jianyu/easy-inject-qiankun'
 
 
 export default {
 export default {
   name: 'BusinessProfile',
   name: 'BusinessProfile',
@@ -48,7 +49,22 @@ export default {
       'getEntInfo'
       'getEntInfo'
     ]),
     ]),
     seeMore () {
     seeMore () {
-      window.open('/entpc/newBus/board?m1=3&m2=0')
+      tryCallHooks({
+        fn: () => {
+          console.log(this.$BRACE)
+          this.$BRACE.methods.open({
+            route: {
+              link: '/newBus/board?m1=3&m2=0',
+              appName: 'entpc',
+              appType: 'qiankun'
+            }
+          })
+        },
+        spareFn: () => {
+          console.log('err')
+          // window.open('/entpc/newBus/board?m1=3&m2=0')
+        }
+      })
     }
     }
   }
   }
 }
 }

+ 7 - 5
src/views/workspace/components/CommonUse.vue

@@ -2,7 +2,7 @@
   <WorkspaceCard class="work-common" title="常用功能">
   <WorkspaceCard class="work-common" title="常用功能">
     <span slot="header-right" class="header-right-set" @click="changeDialogState(true)"><i class="icon-set"></i> 设置</span>
     <span slot="header-right" class="header-right-set" @click="changeDialogState(true)"><i class="icon-set"></i> 设置</span>
     <div class="common-lists">
     <div class="common-lists">
-      <div class="list-item" v-for="item in commonList" :key="item.id" @click="openLink(item.url)">
+      <div class="list-item" v-for="item in commonList" :key="item.id" @click="openLink(item)">
         <div class="icon-box" v-if="item.icon && item.icon.indexOf('icon-') === 0">
         <div class="icon-box" v-if="item.icon && item.icon.indexOf('icon-') === 0">
           <JyIcon :name="item.icon" classPrefix=""></JyIcon>
           <JyIcon :name="item.icon" classPrefix=""></JyIcon>
         </div>
         </div>
@@ -30,7 +30,7 @@
       <SelectorCard @onCancel="changeDialogState(false)" @onConfirm="confirmSaveFn" confirmText="确定">
       <SelectorCard @onCancel="changeDialogState(false)" @onConfirm="confirmSaveFn" confirmText="确定">
         <div slot="header">常用功能设置</div>
         <div slot="header">常用功能设置</div>
         <div class="transfer-content">
         <div class="transfer-content">
-          <Transfer submitKey="id" :left="allFunctions" :right="commonList" @onSave="onTransferSave"></Transfer>
+          <Transfer :maxCount="maxCount" submitKey="id" :left="allFunctions" :right="commonList" @onSave="onTransferSave"></Transfer>
         </div>
         </div>
         <p class="more-tips">最多可选择 <em style="color:#2CB7CA;">{{ maxCount }}</em> 个常用功能</p>
         <p class="more-tips">最多可选择 <em style="color:#2CB7CA;">{{ maxCount }}</em> 个常用功能</p>
       </SelectorCard>
       </SelectorCard>
@@ -83,11 +83,13 @@ export default {
     onTransferSave (data) {
     onTransferSave (data) {
       this.transferSave(data)
       this.transferSave(data)
     },
     },
-    openLink (url) {
+    openLink (item) {
+      const { url } = item
       tryCallHooks({
       tryCallHooks({
-        fn: (url) => {
+        fn: () => {
           this.$BRACE.methods.open({
           this.$BRACE.methods.open({
             route: {
             route: {
+              ...item,
               link: url
               link: url
             }
             }
           })
           })
@@ -95,7 +97,7 @@ export default {
         spareFn: (url) => {
         spareFn: (url) => {
           window.open(url)
           window.open(url)
         }
         }
-      }, url)
+      })
     },
     },
     confirmSaveFn () {
     confirmSaveFn () {
       try {
       try {

+ 1 - 1
src/views/workspace/components/MessageTips.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <WorkspaceCard class="message-card" v-show="messageList.length">
+  <WorkspaceCard class="message-card" v-if="messageList.length">
     <div slot="header-title">
     <div slot="header-title">
       <span>我的消息</span>
       <span>我的消息</span>
       <span class="sub-text">(<span class="highlight-text">{{ unReadCount }} </span> 条未读)</span>
       <span class="sub-text">(<span class="highlight-text">{{ unReadCount }} </span> 条未读)</span>