|
@@ -7,8 +7,16 @@
|
|
|
<article>
|
|
|
<div class="my-business">
|
|
|
<div class="business-title">我的业务线</div>
|
|
|
- <div class="business-name my-business-name" @click="enter({ code: bizId, name: bizName })">
|
|
|
- {{ bizName }}
|
|
|
+ <div class="my-business-list">
|
|
|
+ <div
|
|
|
+ v-for="(item, index) in myBusiness"
|
|
|
+ :key="'my'+item.code"
|
|
|
+ class="business-name"
|
|
|
+ :class="'business-item' + (index % 4)"
|
|
|
+ @click="enter(item,'my')"
|
|
|
+ >
|
|
|
+ {{ item.name }}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="all-business">
|
|
@@ -16,10 +24,10 @@
|
|
|
<div class="all-business-list">
|
|
|
<div
|
|
|
v-for="(item, index) in bizSelectList"
|
|
|
- :key="item.code"
|
|
|
+ :key="'all'+item.code"
|
|
|
class="business-name"
|
|
|
- :class="'business-item' + (index % 4)"
|
|
|
- @click="enter(item)"
|
|
|
+ :class="['business-item' + (index % 4), item.isSecret?'disable':'']"
|
|
|
+ @click="enter(item,'all')"
|
|
|
>
|
|
|
{{ item.name }}
|
|
|
</div>
|
|
@@ -39,12 +47,13 @@
|
|
|
import { mapGetters } from 'vuex'
|
|
|
import { needIdList } from '@/router/needIdList'
|
|
|
import { EncryptId } from '@/utils/crypto-js.js'
|
|
|
-import { settingGetBizList, settingUserSetBiz } from '@/api/projectIndex'
|
|
|
+import { settingGetBizList, settingUserSetBiz, getPersonBizList } from '@/api/projectIndex'
|
|
|
let fromRoute = null
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- bizSelectList: [] // 业务线选择列表
|
|
|
+ bizSelectList: [], // 业务线选择列表
|
|
|
+ myBusiness: []
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -56,17 +65,31 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
this.settingGetBizList()
|
|
|
+ this.getPersonBizList()
|
|
|
},
|
|
|
methods: {
|
|
|
async settingGetBizList() {
|
|
|
const res = await settingGetBizList({})
|
|
|
if (res.code === 200) this.bizSelectList = res.data || []
|
|
|
},
|
|
|
+ async getPersonBizList() {
|
|
|
+ const res = await getPersonBizList()
|
|
|
+ if (res.code === 200 && res.data) this.myBusiness = res.data || []
|
|
|
+ },
|
|
|
// 设置成员登录业务线
|
|
|
async settingUserSetBiz(bizId) {
|
|
|
await settingUserSetBiz({ bizId: bizId })
|
|
|
},
|
|
|
- enter(biz) {
|
|
|
+ enter(biz, type) {
|
|
|
+ if (biz.isSecret === 1 && type === 'all') {
|
|
|
+ this.$message({
|
|
|
+ message: '无权限',
|
|
|
+ type: 'warning',
|
|
|
+ duration: 1000,
|
|
|
+ offset: 150
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
this.$store.dispatch('global/setBizId', biz.code)
|
|
|
this.$store.dispatch('global/setBizName', biz.name)
|
|
|
this.settingUserSetBiz(biz.code)
|
|
@@ -137,6 +160,12 @@ export default {
|
|
|
padding: 64px 46px 0 46px;
|
|
|
color: #666666;
|
|
|
font-size: 18px;
|
|
|
+ .my-business-list {
|
|
|
+ padding: 27px 32px;
|
|
|
+ display: grid;
|
|
|
+ grid-template-columns: repeat(4, 25%);
|
|
|
+ grid-gap: 50px 0;
|
|
|
+ }
|
|
|
}
|
|
|
.all-business {
|
|
|
width: 100%;
|
|
@@ -223,4 +252,13 @@ export default {
|
|
|
color: #333333;
|
|
|
}
|
|
|
}
|
|
|
+.disable {
|
|
|
+ color: #999999;
|
|
|
+ border-color: #999999;
|
|
|
+ box-shadow: 0px 6px 12px rgba(153, 153, 153, 0.2);
|
|
|
+}
|
|
|
+.disable:hover {
|
|
|
+ color: #999999;
|
|
|
+ background-color: #ffffff;
|
|
|
+}
|
|
|
</style>
|