[update] 修改一般检索页面样式,添加OA单点登录
This commit is contained in:
@@ -20,6 +20,8 @@ const checkOnlyUser = (params) => getAction('/sys/user/checkOnlyUser', params)
|
||||
const changePassword = (params) => postAction('/sys/user/changePassword', params)
|
||||
// 单点登录获取用户信息
|
||||
const getSSOUserInfo = (params) => postAction('/iam/loginByOauth2', params)
|
||||
// OA单点登录
|
||||
const getTodoSSOUserInfo = (params) => postAction('/oa/login', params)
|
||||
// 上传手写章
|
||||
const uploadHandStamp = (params) => postAction('/sys/user/uploadHandStamp', params)
|
||||
|
||||
@@ -223,6 +225,7 @@ export {
|
||||
|
||||
getEnterpriseLevelMapList,
|
||||
getSSOUserInfo,
|
||||
getTodoSSOUserInfo,
|
||||
uploadHandStamp,
|
||||
|
||||
addAsmsInterface,
|
||||
|
||||
+13
-2
@@ -5,7 +5,7 @@ import NProgress from 'nprogress' // progress bar
|
||||
import 'nprogress/nprogress.css' // progress bar style
|
||||
import { ACCESS_TOKEN, OAUTH2_LOGIN_PAGE_PATH, UI_CACHE_DB_DICT_DATA, USER_INFO, USER_NAME } from '@/store/mutation-types'
|
||||
import { generateIndexRouter, isOAuth2AppEnv, findFirstRoute, welcome } from '@/utils/util'
|
||||
import { getSSOUserInfo } from './api/api'
|
||||
import { getSSOUserInfo, getTodoSSOUserInfo } from './api/api'
|
||||
import { isCanLookDetail } from './api/enterpriseStandardLibraryApi'
|
||||
import { updatePageHeight } from './components/tools/setting'
|
||||
|
||||
@@ -16,7 +16,18 @@ whiteList.push(OAUTH2_LOGIN_PAGE_PATH)
|
||||
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
// 单点登录
|
||||
if (to.query.code) {
|
||||
if (to.query.ticket) {
|
||||
const { result } = await getTodoSSOUserInfo({ ticket: to.query.ticket })
|
||||
const userInfo = result.userInfo
|
||||
Vue.ls.set(ACCESS_TOKEN, result.token, 7 * 24 * 60 * 60 * 1000)
|
||||
Vue.ls.set(USER_NAME, userInfo.username, 7 * 24 * 60 * 60 * 1000)
|
||||
Vue.ls.set(USER_INFO, userInfo, 7 * 24 * 60 * 60 * 1000)
|
||||
Vue.ls.set(UI_CACHE_DB_DICT_DATA, result.sysAllDictItems, 7 * 24 * 60 * 60 * 1000)
|
||||
store.commit('SET_TOKEN', result.token)
|
||||
store.commit('SET_INFO', userInfo)
|
||||
store.commit('SET_NAME', { username: userInfo.username, realname: userInfo.realname, welcome: welcome() })
|
||||
store.commit('SET_AVATAR', userInfo.avatar)
|
||||
} else if (to.query.code) {
|
||||
const { result } = await getSSOUserInfo({ code: to.query.code })
|
||||
const userInfo = result.userInfo
|
||||
Vue.ls.set(ACCESS_TOKEN, result.token, 7 * 24 * 60 * 60 * 1000)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<a-spin :spinning="loading || selectOptionLoading">
|
||||
<a-card :bordered="false">
|
||||
<a-card :bordered="false" :bodyStyle="{height: cardHeight}">
|
||||
<!-- 搜索框部分 -->
|
||||
<div class="top-search-div">
|
||||
<div class="top-search-div-content">
|
||||
@@ -82,12 +82,12 @@
|
||||
<!-- 全文检索 -->
|
||||
<div v-html="item.content" class="result-content-wrapper"></div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div v-if="item.resourceType !== '4'" class="result-content-wrapper">
|
||||
{{ item.content }}
|
||||
</div>
|
||||
<div v-else v-html="item.content" class="result-content-wrapper"></div>
|
||||
</template>
|
||||
<!--<template v-else>-->
|
||||
<!-- <div v-if="item.resourceType !== '4'" class="result-content-wrapper">-->
|
||||
<!-- {{ item.content }}-->
|
||||
<!-- </div>-->
|
||||
<!-- <div v-else v-html="item.content" class="result-content-wrapper"></div>-->
|
||||
<!--</template>-->
|
||||
</div>
|
||||
</div>
|
||||
<a-pagination
|
||||
@@ -121,10 +121,17 @@ import {
|
||||
generalSearchFullTextSearch
|
||||
} from '@/api/dashboard'
|
||||
import { isHasPermission } from '@/utils/hasPermission'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'GeneralSearch',
|
||||
components: { SearchHistoryModal },
|
||||
computed: {
|
||||
...mapGetters(['defaultHeight']),
|
||||
cardHeight () {
|
||||
return `calc(100vh - ${this.defaultHeight['user-info-height']} - ${this.defaultHeight['breadcrumb-height']}`
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
selectOptionLoading: false, // 其他筛选条件部分的loading
|
||||
@@ -467,7 +474,7 @@ export default {
|
||||
@import '~@assets/less/common.less';
|
||||
/deep/ .ant-card-body {
|
||||
padding: 0;
|
||||
height: calc(100vh - 45px - 59px - 12px);
|
||||
//height: calc(100vh - 45px - 59px - 12px);
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
@@ -485,7 +492,7 @@ export default {
|
||||
// 头部搜索区域
|
||||
.top-search-div {
|
||||
width: 100%;
|
||||
min-height: 124px;
|
||||
min-height: 98px;
|
||||
background-image: url("../../../assets/image/searchPageBack.png");
|
||||
background-size: 100% 100%;
|
||||
background-repeat: no-repeat;
|
||||
@@ -514,12 +521,12 @@ export default {
|
||||
// 筛选区域
|
||||
.filter-area-div {
|
||||
padding: 10px 20px;
|
||||
box-sizing: border-box;
|
||||
//box-sizing: border-box;
|
||||
max-height: 300px;
|
||||
overflow-y: auto;
|
||||
.filter-row {
|
||||
height: auto;
|
||||
line-height: 44px;
|
||||
line-height: 38px;
|
||||
display: flex;
|
||||
}
|
||||
.label-col {
|
||||
@@ -536,8 +543,8 @@ export default {
|
||||
flex-wrap: wrap;
|
||||
.option-div {
|
||||
width: auto;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
height: 26px;
|
||||
line-height: 26px;
|
||||
padding: 0 12px;
|
||||
cursor: pointer;
|
||||
margin: 6px 4px;
|
||||
@@ -571,7 +578,7 @@ export default {
|
||||
.result-wrapper {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 24px;
|
||||
padding: 16px 24px 0;
|
||||
}
|
||||
|
||||
// 高亮样式
|
||||
@@ -592,6 +599,9 @@ export default {
|
||||
.result-title-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
p {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.result-title {
|
||||
color: #1D2129;
|
||||
font-size: 18px;
|
||||
@@ -634,11 +644,19 @@ export default {
|
||||
}
|
||||
}
|
||||
.result-content-wrapper {
|
||||
width: 100%;
|
||||
max-height: 40px;
|
||||
font-size: 14px;
|
||||
font-family: PingFang SC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #1D2129;
|
||||
line-height: 20px;
|
||||
margin-top: 10px;
|
||||
//display: -webkit-box; /* 将元素作为块级元素进行布局 */
|
||||
//-webkit-box-orient: vertical; /* 垂直方向对齐 */
|
||||
//-webkit-line-clamp: 2; /* 最多显示两行文本 */
|
||||
overflow: hidden; /* 控制溢出内容不被显示 */
|
||||
text-overflow: ellipsis; /* 当内容溢出时显示省略号 */
|
||||
.result-field-span {
|
||||
margin-right: 12px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user