Compare commits

..

3 Commits

8 changed files with 973 additions and 1013 deletions

View File

@ -23,6 +23,8 @@ const infrastructure = {}
const mapTestNum = {} const mapTestNum = {}
// //
const footerDataList = {} const footerDataList = {}
// 西--
const xhaHasPermissionUser = {}
// qingdao // qingdao
if (newLocation !== 'baotou' && newLocation !== 'xihaian') { if (newLocation !== 'baotou' && newLocation !== 'xihaian') {
whoShow.itShowQingDao = true whoShow.itShowQingDao = true
@ -521,4 +523,6 @@ else if (newLocation === 'xihaian') {
}, },
], ],
} }
xhaHasPermissionUser.list = ['xihaian01', 'xihaian02', 'xihaian03', 'xihaian04', 'admin']
} }

View File

@ -236,6 +236,14 @@ export function selectResourceListByDept(params) {
params, params,
}) })
} }
// 西--
export function selectResourceListByDeptName(params) {
return request({
url: '/resourcecar/selectResourceListByDeptName',
method: 'get',
params,
})
}
// //
export function queryApplicationRelByResourceId(params) { export function queryApplicationRelByResourceId(params) {
return request({ return request({

View File

@ -10,7 +10,7 @@
<a-dropdown> <a-dropdown>
<span class="ant-dropdown-link"> <span class="ant-dropdown-link">
<a-avatar :src="avatar" /> <a-avatar :src="avatar" />
{{ username }} {{ realName }}
<DownOutlined /> <DownOutlined />
</span> </span>
<template v-slot:overlay> <template v-slot:overlay>
@ -23,47 +23,49 @@
</template> </template>
<script> <script>
import { recordRoute } from '@/config' import { recordRoute } from '@/config'
import { DownOutlined } from '@ant-design/icons-vue' import { DownOutlined } from '@ant-design/icons-vue'
import user from '@/assets/home/user.png' import user from '@/assets/home/user.png'
import { useStore } from 'vuex' import { useStore } from 'vuex'
import { computed } from 'vue' import { computed, onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router' import { useRoute, useRouter } from 'vue-router'
export default { export default {
name: 'VabAvatar', name: 'VabAvatar',
components: { DownOutlined }, components: { DownOutlined },
setup() { setup() {
const store = useStore() const store = useStore()
const router = useRouter() const router = useRouter()
const route = useRoute() const route = useRoute()
const logout = async () => { const logout = async () => {
await store.dispatch('user/logout') await store.dispatch('user/logout')
window.sessionStorage.setItem('visits', JSON.stringify([])) window.sessionStorage.setItem('visits', JSON.stringify([]))
if (recordRoute) { if (recordRoute) {
const fullPath = route.fullPath const fullPath = route.fullPath
router.push(`/login?redirect=${fullPath}`) router.push(`/login?redirect=${fullPath}`)
} else { } else {
router.push('/login') router.push('/login')
}
} }
return { }
avatar: user, return {
username: computed(() => store.getters['user/username']), avatar: user,
logout, // username: computed(() => store.getters['user/username']),
} realName: computed(() => store.getters['user/realName']),
}, logout,
} }
},
}
</script> </script>
<style lang="less"> <style lang="less">
.vab-avatar { .vab-avatar {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
.ant-dropdown-link {
display: block; .ant-dropdown-link {
// min-height: 64px; display: block;
cursor: pointer; // min-height: 64px;
} cursor: pointer;
} }
}
</style> </style>

View File

@ -14,6 +14,7 @@ import { message, notification } from 'ant-design-vue'
const state = () => ({ const state = () => ({
accessToken: getAccessToken(), accessToken: getAccessToken(),
username: '', username: '',
realName: '',
userId: '', userId: '',
avatar: '', avatar: '',
role: 0, // role: 0, //
@ -21,6 +22,7 @@ const state = () => ({
const getters = { const getters = {
accessToken: (state) => state.accessToken, accessToken: (state) => state.accessToken,
username: (state) => state.username, username: (state) => state.username,
realName: (state) => state.realName,
avatar: (state) => state.avatar, avatar: (state) => state.avatar,
role: (state) => state.role, role: (state) => state.role,
userId: (state) => state.userId, userId: (state) => state.userId,
@ -45,6 +47,15 @@ const mutations = {
setUsername(state, username) { setUsername(state, username) {
state.username = username state.username = username
}, },
/**
* @author chuzhixin 1204505056@qq.com
* @description 设置真实用户名
* @param {*} state
* @param {*} username
*/
setRealname(state, realName) {
state.realName = realName
},
// //
setRole(state, role) { setRole(state, role) {
state.role = role state.role = role
@ -75,6 +86,7 @@ const actions = {
}) })
commit('setAvatar', 'https://i.gtimg.cn/club/item/face/img/2/15922_100.gif') commit('setAvatar', 'https://i.gtimg.cn/club/item/face/img/2/15922_100.gif')
commit('setUsername', 'admin(未开启登录拦截)') commit('setUsername', 'admin(未开启登录拦截)')
commit('setRealname', 'admin(未开启登录拦截)')
}, },
/** /**
* @author chuzhixin 1204505056@qq.com * @author chuzhixin 1204505056@qq.com
@ -120,7 +132,8 @@ const actions = {
return false return false
} }
// debugger // debugger
commit('setUsername', data.data.realName) commit('setUsername', data.data.username)
commit('setRealname', data.data.realName)
commit('setRole', data.data.roleIdList.length) commit('setRole', data.data.roleIdList.length)
commit('setUserId', data.data.id) commit('setUserId', data.data.id)
// TODO // TODO

View File

@ -450,7 +450,7 @@ import DetailsPageResource from '@/views/home/components/DetailsPageResource.vue
import infrastructurePage from '@/views/home/infrastructurePage.vue' import infrastructurePage from '@/views/home/infrastructurePage.vue'
import detailsPageInfrastructureTree from '@/views/home/detailsPageInfrastructureTree.vue' import detailsPageInfrastructureTree from '@/views/home/detailsPageInfrastructureTree.vue'
import { DETAIL_PAGE_CONTENT_DEFAULT_TAB } from '@/global/GlobalConfig.js' import { DETAIL_PAGE_CONTENT_DEFAULT_TAB } from '@/global/GlobalConfig.js'
import { useStore } from 'vuex'
import { message } from 'ant-design-vue' import { message } from 'ant-design-vue'
import { import {
titleNameArray, titleNameArray,
@ -521,6 +521,13 @@ export default defineComponent({
orderType: 'DESC', // ASC DESC orderType: 'DESC', // ASC DESC
} }
const store = useStore()
//
const user = ref({
username: store.getters['user/username'],
realName: store.getters['user/realName'],
})
const searchResultListDom = ref(null) const searchResultListDom = ref(null)
// //
@ -1268,8 +1275,10 @@ export default defineComponent({
} }
const changeCards = (name) => { const changeCards = (name) => {
// 西- // 西-
if(whoShow1.value.itShowXiHaiAn && name !== '基础设施') { if(whoShow1.value.itShowXiHaiAn) {
return message.warn('正在建设中!') if(name !== '基础设施' && !xhaHasPermissionUser.list.includes(user.value.username)) {
return message.warn('暂无权限')
}
} }
resourceList.data = [] resourceList.data = []
videoList.data = [] videoList.data = []

View File

@ -4,7 +4,7 @@
props.showView === 'algorithm-details' ? '' : '', props.showView === 'algorithm-details' ? '' : '',
]"> ]">
<div class="name" @click="goToHome"> <div class="name" @click="goToHome">
<div class="name-bg" v-if="!whoShow1.itShowXiHaiAn"></div> <div class="name-bg" v-if="!itShowXiHaiAn"></div>
<div class="name-bg-xihaian" v-else></div> <div class="name-bg-xihaian" v-else></div>
<div class="name-content"> <div class="name-content">
<p>城市云脑通用能力服务平台</p> <p>城市云脑通用能力服务平台</p>
@ -57,10 +57,10 @@
<i class="img"></i> <i class="img"></i>
<a-tooltip placement="bottom"> <a-tooltip placement="bottom">
<template #title> <template #title>
<span>{{ user.username }}</span> <span>{{ user.realName }}</span>
</template> </template>
<span class="name" @click="jumpPage({ name: '个人中心', key: 'personalCenter' })"> <span class="name" @click="jumpPage({ name: '个人中心', key: 'personalCenter' })">
{{ user.username }} {{ user.realName }}
</span> </span>
</a-tooltip> </a-tooltip>
<span @click="logout" class="out">退出</span> <span @click="logout" class="out">退出</span>
@ -102,34 +102,29 @@ const store = useStore()
const router = useRouter() const router = useRouter()
const route = useRoute() const route = useRoute()
const whoShow1 = ref(whoShow) const itShowXiHaiAn = ref(whoShow.itShowXiHaiAn)
//
const user = ref({ const user = ref({
username: store.getters['user/username'], username: store.getters['user/username'],
realName: store.getters['user/realName'],
}) })
// user.username.value = store.getters(['user/username'])
const select = ref(router.currentRoute.value.name) const select = ref(router.currentRoute.value.name)
const mynoticeFlag = ref(false) const mynoticeFlag = ref(false)
const mynoticeData = ref([]) const mynoticeData = ref([])
console.log('navListManagement------------>', navListManagement)
// eslint-disable-next-line no-undef
const navList = ref(navListManagement.navList) const navList = ref(navListManagement.navList)
console.log('navList------------>', navList) console.log('navList------------>', navList)
const props = defineProps({ const props = defineProps({
showView: { type: String, default: '' }, showView: { type: String, default: '' },
}) })
// //
// getUser().then((res) => {
// user.value = res.data.data
// // console.log('user===============>', user.value)
// })
// 退 // 退
const logout = async () => { const logout = async () => {
await store.dispatch('user/logout') await store.dispatch('user/logout')
window.sessionStorage.setItem('visits', JSON.stringify([])) window.sessionStorage.setItem('visits', JSON.stringify([]))
// 西 // 西
if (!whoShow1.itShowXiHaiAn) { if (!itShowXiHaiAn.value) {
if (recordRoute) { if (recordRoute) {
const fullPath = route.fullPath const fullPath = route.fullPath
router.push(`/login?redirect=${fullPath}`) router.push(`/login?redirect=${fullPath}`)
@ -147,10 +142,10 @@ const goToHome = () => {
// //
const jumpPage = (item) => { const jumpPage = (item) => {
// 西 // 西
if (whoShow1.itShowXiHaiAn) { if (itShowXiHaiAn.value) {
let _arr = ['共享门户', '能力云图', '能力统计', '需求中心', '赋能案例'] let _arr = ['共享门户', '能力云图', '能力统计', '需求中心', '赋能案例']
if (_arr.includes(item.name)) { if (_arr.includes(item.name) && !xhaHasPermissionUser.list.includes(user.value.username)) {
return message.warn('正在建设中!') return message.warn('暂无权限')
} }
} }
select.value = item.key select.value = item.key

File diff suppressed because it is too large Load Diff

View File

@ -21,25 +21,27 @@ export default defineComponent({
components: {}, components: {},
setup() { setup() {
const itShowXiHaiAn = whoShow.itShowXiHaiAn; const itShowXiHaiAn = whoShow.itShowXiHaiAn;
const car = {
title: '申购车',
img: require('@/assets/personalCenter/demand.png'),
imgActive: require('@/assets/personalCenter/demandactive.png'),
key: 'PurchaseVehicle',
}
const apply = {
title: '我的申请',
img: require('@/assets/personalCenter/apply.png'),
imgActive: require('@/assets/personalCenter/applyactive.png'),
key: 'apply',
}
let menuList = [ let menuList = [
car,
{ {
title: '申购车',
img: require('@/assets/personalCenter/demand.png'),
imgActive: require('@/assets/personalCenter/demandactive.png'),
key: 'PurchaseVehicle',
},
{
title: '我的发布', title: '我的发布',
img: require('@/assets/personalCenter/push.png'), img: require('@/assets/personalCenter/push.png'),
imgActive: require('@/assets/personalCenter/pushactive.png'), imgActive: require('@/assets/personalCenter/pushactive.png'),
key: 'push', key: 'push',
}, },
{ apply,
title: '我的申请',
img: require('@/assets/personalCenter/apply.png'),
imgActive: require('@/assets/personalCenter/applyactive.png'),
key: 'apply',
},
{ {
title: '我的收藏', title: '我的收藏',
img: require('@/assets/personalCenter/collect.png'), img: require('@/assets/personalCenter/collect.png'),
@ -66,9 +68,8 @@ export default defineComponent({
}, },
] ]
// 西 // 西
if(itShowXiHaiAn) { if (itShowXiHaiAn) {
let _newArr = JSON.parse(JSON.stringify(menuList)) menuList = [car, apply]
menuList = _newArr.splice(0, 1)
} }
const selectedKeys = ref(['apply']) const selectedKeys = ref(['apply'])
@ -82,9 +83,9 @@ export default defineComponent({
} }
onMounted(() => { onMounted(() => {
if(menuList[1]) { if (menuList[1]) {
handleClick(menuList[1]) handleClick(menuList[1])
}else { } else {
handleClick(menuList[0]) handleClick(menuList[0])
} }
}) })