代码格式修改
This commit is contained in:
@@ -7,12 +7,12 @@
|
||||
<div class="digital-avatar" :class="{ speaking: isAISpeaking, thinking: isAIThinking }">
|
||||
<div class="avatar-face">
|
||||
<div class="avatar-eyes">
|
||||
<div class="eye left-eye" :class="{ blink: isBlinking }"></div>
|
||||
<div class="eye right-eye" :class="{ blink: isBlinking }"></div>
|
||||
<div class="eye left-eye" :class="{ blink: isBlinking }" />
|
||||
<div class="eye right-eye" :class="{ blink: isBlinking }" />
|
||||
</div>
|
||||
<div class="avatar-mouth" :class="{ talking: isAISpeaking }"></div>
|
||||
<div class="avatar-mouth" :class="{ talking: isAISpeaking }" />
|
||||
</div>
|
||||
<div class="avatar-glow"></div>
|
||||
<div class="avatar-glow" />
|
||||
</div>
|
||||
<div class="nav-title">智水AI辅导员</div>
|
||||
</div>
|
||||
@@ -20,7 +20,7 @@
|
||||
</div>
|
||||
|
||||
<!-- 消息列表 -->
|
||||
<div class="message-list" ref="messageList" @scroll="onScroll">
|
||||
<div ref="messageList" class="message-list" @scroll="onScroll">
|
||||
<!-- 加载历史记录提示 -->
|
||||
<div v-if="isLoadingHistory" class="loading-history">
|
||||
<div class="loading-text">加载历史记录中...</div>
|
||||
@@ -51,7 +51,7 @@
|
||||
<div class="content-text">{{ message.content }}</div>
|
||||
</div>
|
||||
<div class="avatar">
|
||||
<img v-if="message.avatar" :src="message.avatar" alt="用户头像" @error="handleImageError($event, 'user')" />
|
||||
<img v-if="message.avatar" :src="message.avatar" alt="用户头像" @error="handleImageError($event, 'user')">
|
||||
<div v-else class="avatar-text user-avatar">U</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -59,7 +59,7 @@
|
||||
<!-- AI消息 -->
|
||||
<div v-else class="ai-message">
|
||||
<div class="avatar">
|
||||
<img v-if="message.avatar" :src="message.avatar" alt="AI头像" @error="handleImageError($event, 'ai')" />
|
||||
<img v-if="message.avatar" :src="message.avatar" alt="AI头像" @error="handleImageError($event, 'ai')">
|
||||
<div v-else class="avatar-text ai-avatar">AI</div>
|
||||
</div>
|
||||
<div class="message-content">
|
||||
@@ -67,23 +67,25 @@
|
||||
<div class="ai-prompt">智水AI辅导员</div>
|
||||
|
||||
<!-- 消息内容 -->
|
||||
<div class="content-text" v-html="renderMarkdown(message.content)"></div>
|
||||
<div class="content-text" v-html="renderMarkdown(message.content)" />
|
||||
|
||||
<!-- 引用来源 -->
|
||||
<div v-if="message.retrieverResources && message.retrieverResources.length > 0" class="reference-sources">
|
||||
<div class="reference-title">引用来源:</div>
|
||||
<div
|
||||
v-for="(group, groupIndex) in (message.groupedReferences || getGroupedReferences(message.retrieverResources))"
|
||||
:key="groupIndex" class="reference-group">
|
||||
:key="groupIndex" class="reference-group"
|
||||
>
|
||||
<div class="reference-doc"
|
||||
:class="{ expanded: showSingleReference[`${message.messageId}-${group.docName}`] }"
|
||||
@click="toggleSingleReference(message.messageId, group.docName)">
|
||||
:class="{ expanded: showSingleReference[`${message.messageId}-${group.docName}`] }"
|
||||
@click="toggleSingleReference(message.messageId, group.docName)"
|
||||
>
|
||||
{{ group.docName }} ({{ group.items.length }})
|
||||
</div>
|
||||
<div v-if="showSingleReference[`${message.messageId}-${group.docName}`]" class="reference-details">
|
||||
<div v-for="(item, itemIndex) in group.items" :key="itemIndex" class="reference-segment">
|
||||
<div class="segment-content">{{ item.content }}</div>
|
||||
<div v-if="itemIndex < group.items.length - 1" class="segment-divider"></div>
|
||||
<div v-if="itemIndex < group.items.length - 1" class="segment-divider" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -94,21 +96,25 @@
|
||||
<div class="ai-text">AI回答也可能会犯错。请核查重要信息。</div>
|
||||
<div class="action-icons">
|
||||
<div class="action-icon"
|
||||
:class="{ active: (message.feedback && message.feedback.rating === 'like') || message.feedback === 'like' }"
|
||||
@click="handleThumbUp(message)">
|
||||
:class="{ active: (message.feedback && message.feedback.rating === 'like') || message.feedback === 'like' }"
|
||||
@click="handleThumbUp(message)"
|
||||
>
|
||||
<svg class="action-svg" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M7 22H4C3.46957 22 2.96086 21.7893 2.58579 21.4142C2.21071 21.0391 2 20.5304 2 20V13C2 12.4696 2.21071 11.9609 2.58579 11.5858C2.96086 11.2107 3.46957 11 4 11H7M14 9V5C14 4.20435 13.6839 3.44129 13.1213 2.87868C12.5587 2.31607 11.7956 2 11 2L7 11V22H18.28C18.7623 22.0055 19.2304 21.8364 19.5979 21.524C19.9654 21.2116 20.2077 20.7769 20.28 20.3L21.66 11.3C21.7035 11.0134 21.6842 10.7207 21.6033 10.4423C21.5225 10.1638 21.3821 9.90629 21.1919 9.68751C21.0016 9.46873 20.7661 9.29393 20.5016 9.17522C20.2371 9.0565 19.9499 8.99672 19.66 9H14Z"
|
||||
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
||||
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="action-icon"
|
||||
:class="{ active: (message.feedback && message.feedback.rating === 'dislike') || message.feedback === 'dislike' }"
|
||||
@click="handleThumbDown(message)">
|
||||
:class="{ active: (message.feedback && message.feedback.rating === 'dislike') || message.feedback === 'dislike' }"
|
||||
@click="handleThumbDown(message)"
|
||||
>
|
||||
<svg class="action-svg" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M17 2H20C20.5304 2 21.0391 2.21071 21.4142 2.58579C21.7893 2.96086 22 3.46957 22 4V11C22 11.5304 21.7893 12.0391 21.4142 12.4142C21.0391 12.7893 20.5304 13 20 13H17M10 15V19C10 19.7956 10.3161 20.5587 10.8787 21.1213C11.4413 21.6839 12.2044 22 13 22L17 13V2H5.72C5.23767 1.99448 4.76962 2.16361 4.40213 2.47596C4.03464 2.78831 3.79227 3.22305 3.72 3.7L2.34 12.7C2.29649 12.9866 2.31583 13.2793 2.39672 13.5577C2.47761 13.8362 2.61793 14.0937 2.80817 14.3125C2.9984 14.5313 3.23394 14.7061 3.49843 14.8248C3.76291 14.9435 4.05011 15.0033 4.34 15H10Z"
|
||||
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
||||
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
@@ -122,8 +128,9 @@
|
||||
<div class="input-area">
|
||||
<div class="input-container">
|
||||
<input v-model="inputMessage" type="text" placeholder="请输入您的问题..." class="message-input"
|
||||
@keyup.enter="sendMessage" :disabled="sending" />
|
||||
<button class="send-button" @click="sendMessage" :disabled="!inputMessage.trim() || sending">
|
||||
:disabled="sending" @keyup.enter="sendMessage"
|
||||
>
|
||||
<button class="send-button" :disabled="!inputMessage.trim() || sending" @click="sendMessage">
|
||||
{{ sending ? '发送中...' : '发送' }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import iframeToggle from "./IframeToggle/index"
|
||||
import iframeToggle from './IframeToggle/index'
|
||||
|
||||
export default {
|
||||
name: 'AppMain',
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
<transition-group name="fade-transform" mode="out-in">
|
||||
<inner-link
|
||||
v-for="(item, index) in iframeViews"
|
||||
:key="item.path"
|
||||
:iframeId="'iframe' + index"
|
||||
v-show="$route.path === item.path"
|
||||
:key="item.path"
|
||||
:iframe-id="'iframe' + index"
|
||||
:src="item.meta.link"
|
||||
></inner-link>
|
||||
/>
|
||||
</transition-group>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import InnerLink from "../InnerLink/index"
|
||||
import InnerLink from '../InnerLink/index'
|
||||
|
||||
export default {
|
||||
components: { InnerLink },
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<div :style="'height:' + height" v-loading="loading" element-loading-text="正在加载页面,请稍候!">
|
||||
<div v-loading="loading" :style="'height:' + height" element-loading-text="正在加载页面,请稍候!">
|
||||
<iframe
|
||||
:id="iframeId"
|
||||
style="width: 100%; height: 100%"
|
||||
:src="src"
|
||||
frameborder="no"
|
||||
></iframe>
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -14,7 +14,7 @@ export default {
|
||||
props: {
|
||||
src: {
|
||||
type: String,
|
||||
default: "/"
|
||||
default: '/'
|
||||
},
|
||||
iframeId: {
|
||||
type: String
|
||||
@@ -23,25 +23,25 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
height: document.documentElement.clientHeight - 94.5 + "px;"
|
||||
};
|
||||
height: document.documentElement.clientHeight - 94.5 + 'px;'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
var _this = this;
|
||||
const iframeId = ("#" + this.iframeId).replace(/\//g, "\\/");
|
||||
const iframe = document.querySelector(iframeId);
|
||||
var _this = this
|
||||
const iframeId = ('#' + this.iframeId).replace(/\//g, '\\/')
|
||||
const iframe = document.querySelector(iframeId)
|
||||
// iframe页面loading控制
|
||||
if (iframe.attachEvent) {
|
||||
this.loading = true;
|
||||
iframe.attachEvent("onload", function () {
|
||||
_this.loading = false;
|
||||
});
|
||||
this.loading = true
|
||||
iframe.attachEvent('onload', function () {
|
||||
_this.loading = false
|
||||
})
|
||||
} else {
|
||||
this.loading = true;
|
||||
this.loading = true
|
||||
iframe.onload = function () {
|
||||
_this.loading = false;
|
||||
};
|
||||
_this.loading = false
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<div class="navbar">
|
||||
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
|
||||
|
||||
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/>
|
||||
<top-nav id="topmenu-container" class="topmenu-container" v-if="topNav" />
|
||||
<breadcrumb v-if="!topNav" id="breadcrumb-container" class="breadcrumb-container" />
|
||||
<top-nav v-if="topNav" id="topmenu-container" class="topmenu-container" />
|
||||
|
||||
<div class="right-menu">
|
||||
<template v-if="device!=='mobile'">
|
||||
@@ -44,7 +44,7 @@ import Search from '@/components/HeaderSearch'
|
||||
import Screenfull from '@/components/Screenfull'
|
||||
import SizeSelect from '@/components/SizeSelect'
|
||||
import TopNav from '@/components/TopNav'
|
||||
import settings from "@/settings"
|
||||
import settings from '@/settings'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
@@ -90,18 +90,18 @@ export default {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$store.dispatch('LogOut').then(() => {
|
||||
sessionStorage.clear();
|
||||
sessionStorage.clear()
|
||||
if (!settings.casEnable) {
|
||||
let host = window.location.host;
|
||||
let protocol = window.location.protocol;
|
||||
let host = window.location.host
|
||||
let protocol = window.location.protocol
|
||||
//console.log(protocol+"//"+host+'/srs/#/login?redirect=%2Findex')
|
||||
window.location.replace( protocol+"//"+host+'/srs/#/login?redirect=%2Findex' );
|
||||
window.location.replace( protocol+'//'+host+'/srs/#/login?redirect=%2Findex' )
|
||||
}else{
|
||||
//window.location.href=settings.caslogoutUrl;
|
||||
window.location.replace(settings.caslogoutUrl);
|
||||
window.location.replace(settings.caslogoutUrl)
|
||||
}
|
||||
})
|
||||
}).catch(() => {});
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<div v-if="sideTheme === 'theme-dark'" class="setting-drawer-block-checbox-selectIcon" style="display: block;">
|
||||
<i aria-label="图标: check" class="anticon anticon-check">
|
||||
<svg viewBox="64 64 896 896" data-icon="check" width="1em" height="1em" :fill="theme" aria-hidden="true" focusable="false" class="">
|
||||
<path d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"/>
|
||||
<path d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z" />
|
||||
</svg>
|
||||
</i>
|
||||
</div>
|
||||
@@ -22,7 +22,7 @@
|
||||
<div v-if="sideTheme === 'theme-light'" class="setting-drawer-block-checbox-selectIcon" style="display: block;">
|
||||
<i aria-label="图标: check" class="anticon anticon-check">
|
||||
<svg viewBox="64 64 896 896" data-icon="check" width="1em" height="1em" :fill="theme" aria-hidden="true" focusable="false" class="">
|
||||
<path d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"/>
|
||||
<path d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z" />
|
||||
</svg>
|
||||
</i>
|
||||
</div>
|
||||
@@ -35,7 +35,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-divider/>
|
||||
<el-divider />
|
||||
|
||||
<h3 class="drawer-title">系统布局配置</h3>
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
<el-switch v-model="dynamicTitle" class="drawer-switch" />
|
||||
</div>
|
||||
|
||||
<el-divider/>
|
||||
<el-divider />
|
||||
|
||||
<el-button size="small" type="primary" plain icon="el-icon-document-add" @click="saveSetting">保存配置</el-button>
|
||||
<el-button size="small" plain icon="el-icon-refresh" @click="resetSetting">重置配置</el-button>
|
||||
@@ -82,7 +82,7 @@ export default {
|
||||
return {
|
||||
theme: this.$store.state.settings.theme,
|
||||
sideTheme: this.$store.state.settings.sideTheme
|
||||
};
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
visible: {
|
||||
@@ -111,8 +111,8 @@ export default {
|
||||
value: val
|
||||
})
|
||||
if (!val) {
|
||||
this.$store.dispatch('app/toggleSideBarHide', false);
|
||||
this.$store.commit("SET_SIDEBAR_ROUTERS", this.$store.state.permission.defaultRoutes);
|
||||
this.$store.dispatch('app/toggleSideBarHide', false)
|
||||
this.$store.commit('SET_SIDEBAR_ROUTERS', this.$store.state.permission.defaultRoutes)
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -156,19 +156,19 @@ export default {
|
||||
key: 'theme',
|
||||
value: val
|
||||
})
|
||||
this.theme = val;
|
||||
this.theme = val
|
||||
},
|
||||
handleTheme(val) {
|
||||
this.$store.dispatch('settings/changeSetting', {
|
||||
key: 'sideTheme',
|
||||
value: val
|
||||
})
|
||||
this.sideTheme = val;
|
||||
this.sideTheme = val
|
||||
},
|
||||
saveSetting() {
|
||||
this.$modal.loading("正在保存到本地,请稍候...");
|
||||
this.$modal.loading('正在保存到本地,请稍候...')
|
||||
this.$cache.local.set(
|
||||
"layout-setting",
|
||||
'layout-setting',
|
||||
`{
|
||||
"topNav":${this.topNav},
|
||||
"tagsView":${this.tagsView},
|
||||
@@ -178,13 +178,13 @@ export default {
|
||||
"sideTheme":"${this.sideTheme}",
|
||||
"theme":"${this.theme}"
|
||||
}`
|
||||
);
|
||||
)
|
||||
setTimeout(this.$modal.closeLoading(), 1000)
|
||||
},
|
||||
resetSetting() {
|
||||
this.$modal.loading("正在清除设置缓存并刷新,请稍候...");
|
||||
this.$cache.local.remove("layout-setting")
|
||||
setTimeout("window.location.reload()", 1000)
|
||||
this.$modal.loading('正在清除设置缓存并刷新,请稍候...')
|
||||
this.$cache.local.remove('layout-setting')
|
||||
setTimeout('window.location.reload()', 1000)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ export default {
|
||||
const vnodes = []
|
||||
|
||||
if (icon) {
|
||||
if(icon != "#"){
|
||||
if(icon != '#'){
|
||||
vnodes.push(<svg-icon icon-class={icon}/>)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
<div class="sidebar-logo-container" :class="{'collapse':collapse}" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
|
||||
<transition name="sidebarLogoFade">
|
||||
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
|
||||
<img v-if="logo" :src="logo" class="sidebar-logo" />
|
||||
<img v-if="logo" :src="logo" class="sidebar-logo">
|
||||
<h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
|
||||
</router-link>
|
||||
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
|
||||
<img v-if="logo" :src="logo" class="sidebar-logo" />
|
||||
<img v-if="logo" :src="logo" class="sidebar-logo">
|
||||
<h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
|
||||
</router-link>
|
||||
</transition>
|
||||
@@ -25,19 +25,19 @@ export default {
|
||||
required: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
variables() {
|
||||
return variables;
|
||||
},
|
||||
sideTheme() {
|
||||
return this.$store.state.settings.sideTheme
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '综合服务平台',
|
||||
logo: logoImg
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
variables() {
|
||||
return variables
|
||||
},
|
||||
sideTheme() {
|
||||
return this.$store.state.settings.sideTheme
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -57,7 +57,7 @@ export default {
|
||||
methods: {
|
||||
hasOneShowingChild(children = [], parent) {
|
||||
if (!children) {
|
||||
children = [];
|
||||
children = []
|
||||
}
|
||||
const showingChildren = children.filter(item => {
|
||||
if (item.hidden) {
|
||||
@@ -90,7 +90,7 @@ export default {
|
||||
return this.basePath
|
||||
}
|
||||
if (routeQuery) {
|
||||
let query = JSON.parse(routeQuery);
|
||||
let query = JSON.parse(routeQuery)
|
||||
return { path: path.resolve(this.basePath, routePath), query: query }
|
||||
}
|
||||
return path.resolve(this.basePath, routePath)
|
||||
|
||||
@@ -1,57 +1,57 @@
|
||||
<template>
|
||||
<div :class="{'has-logo':showLogo}" :style="{ backgroundColor: settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
|
||||
<logo v-if="showLogo" :collapse="isCollapse" />
|
||||
<el-scrollbar :class="settings.sideTheme" wrap-class="scrollbar-wrapper">
|
||||
<el-menu
|
||||
:default-active="activeMenu"
|
||||
:collapse="isCollapse"
|
||||
:background-color="settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground"
|
||||
:text-color="settings.sideTheme === 'theme-dark' ? variables.menuColor : variables.menuLightColor"
|
||||
:unique-opened="true"
|
||||
:active-text-color="settings.theme"
|
||||
:collapse-transition="false"
|
||||
mode="vertical"
|
||||
>
|
||||
<sidebar-item
|
||||
v-for="(route, index) in sidebarRouters"
|
||||
:key="route.path + index"
|
||||
:item="route"
|
||||
:base-path="route.path"
|
||||
/>
|
||||
</el-menu>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
<div :class="{'has-logo':showLogo}" :style="{ backgroundColor: settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
|
||||
<logo v-if="showLogo" :collapse="isCollapse" />
|
||||
<el-scrollbar :class="settings.sideTheme" wrap-class="scrollbar-wrapper">
|
||||
<el-menu
|
||||
:default-active="activeMenu"
|
||||
:collapse="isCollapse"
|
||||
:background-color="settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground"
|
||||
:text-color="settings.sideTheme === 'theme-dark' ? variables.menuColor : variables.menuLightColor"
|
||||
:unique-opened="true"
|
||||
:active-text-color="settings.theme"
|
||||
:collapse-transition="false"
|
||||
mode="vertical"
|
||||
>
|
||||
<sidebar-item
|
||||
v-for="(route, index) in sidebarRouters"
|
||||
:key="route.path + index"
|
||||
:item="route"
|
||||
:base-path="route.path"
|
||||
/>
|
||||
</el-menu>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters, mapState } from "vuex";
|
||||
import Logo from "./Logo";
|
||||
import SidebarItem from "./SidebarItem";
|
||||
import variables from "@/assets/styles/variables.scss";
|
||||
import { mapGetters, mapState } from 'vuex'
|
||||
import Logo from './Logo'
|
||||
import SidebarItem from './SidebarItem'
|
||||
import variables from '@/assets/styles/variables.scss'
|
||||
|
||||
export default {
|
||||
components: { SidebarItem, Logo },
|
||||
computed: {
|
||||
...mapState(["settings"]),
|
||||
...mapGetters(["sidebarRouters", "sidebar"]),
|
||||
...mapState(['settings']),
|
||||
...mapGetters(['sidebarRouters', 'sidebar']),
|
||||
activeMenu() {
|
||||
const route = this.$route;
|
||||
const { meta, path } = route;
|
||||
const route = this.$route
|
||||
const { meta, path } = route
|
||||
// if set path, the sidebar will highlight the path you set
|
||||
if (meta.activeMenu) {
|
||||
return meta.activeMenu;
|
||||
return meta.activeMenu
|
||||
}
|
||||
return path;
|
||||
return path
|
||||
},
|
||||
showLogo() {
|
||||
return this.$store.state.settings.sidebarLogo;
|
||||
return this.$store.state.settings.sidebarLogo
|
||||
},
|
||||
variables() {
|
||||
return variables;
|
||||
return variables
|
||||
},
|
||||
isCollapse() {
|
||||
return !this.sidebar.opened;
|
||||
return !this.sidebar.opened
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
</router-link>
|
||||
</scroll-pane>
|
||||
<ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu">
|
||||
<li @click="refreshSelectedTag(selectedTag)"><i class="el-icon-refresh-right"></i> 刷新页面</li>
|
||||
<li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)"><i class="el-icon-close"></i> 关闭当前</li>
|
||||
<li @click="closeOthersTags"><i class="el-icon-circle-close"></i> 关闭其他</li>
|
||||
<li v-if="!isFirstView()" @click="closeLeftTags"><i class="el-icon-back"></i> 关闭左侧</li>
|
||||
<li v-if="!isLastView()" @click="closeRightTags"><i class="el-icon-right"></i> 关闭右侧</li>
|
||||
<li @click="closeAllTags(selectedTag)"><i class="el-icon-circle-close"></i> 全部关闭</li>
|
||||
<li @click="refreshSelectedTag(selectedTag)"><i class="el-icon-refresh-right" /> 刷新页面</li>
|
||||
<li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)"><i class="el-icon-close" /> 关闭当前</li>
|
||||
<li @click="closeOthersTags"><i class="el-icon-circle-close" /> 关闭其他</li>
|
||||
<li v-if="!isFirstView()" @click="closeLeftTags"><i class="el-icon-back" /> 关闭左侧</li>
|
||||
<li v-if="!isLastView()" @click="closeRightTags"><i class="el-icon-right" /> 关闭右侧</li>
|
||||
<li @click="closeAllTags(selectedTag)"><i class="el-icon-circle-close" /> 全部关闭</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
@@ -51,7 +51,7 @@ export default {
|
||||
return this.$store.state.permission.routes
|
||||
},
|
||||
theme() {
|
||||
return this.$store.state.settings.theme;
|
||||
return this.$store.state.settings.theme
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -68,7 +68,7 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.closeAllTags();
|
||||
this.closeAllTags()
|
||||
this.initTags()
|
||||
this.addTags()
|
||||
},
|
||||
@@ -77,11 +77,11 @@ export default {
|
||||
return route.path === this.$route.path
|
||||
},
|
||||
activeStyle(tag) {
|
||||
if (!this.isActive(tag)) return {};
|
||||
if (!this.isActive(tag)) return {}
|
||||
return {
|
||||
"background-color": this.theme,
|
||||
"border-color": this.theme
|
||||
};
|
||||
'background-color': this.theme,
|
||||
'border-color': this.theme
|
||||
}
|
||||
},
|
||||
isAffix(tag) {
|
||||
return tag.meta && tag.meta.affix
|
||||
@@ -156,7 +156,7 @@ export default {
|
||||
})
|
||||
},
|
||||
refreshSelectedTag(view) {
|
||||
this.$tab.refreshPage(view);
|
||||
this.$tab.refreshPage(view)
|
||||
if (this.$route.meta.link) {
|
||||
this.$store.dispatch('tagsView/delIframeView', this.$route)
|
||||
}
|
||||
@@ -183,7 +183,7 @@ export default {
|
||||
})
|
||||
},
|
||||
closeOthersTags() {
|
||||
this.$router.push(this.selectedTag.fullPath).catch(()=>{});
|
||||
this.$router.push(this.selectedTag.fullPath).catch(()=>{})
|
||||
this.$tab.closeOtherPage(this.selectedTag).then(() => {
|
||||
this.moveToCurrentTag()
|
||||
})
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<!-- 触发按钮,控制弹窗显示隐藏 -->
|
||||
<div class="ai-hover" @click="toggleAI">
|
||||
<AiIcon v-if="!showAI" :size="48" color="white" />
|
||||
<i v-else class="el-icon-close" style="font-size: 20px;"></i>
|
||||
<i v-else class="el-icon-close" style="font-size: 20px;" />
|
||||
</div>
|
||||
<!-- 聊天弹窗,通过 v-if 控制显隐 -->
|
||||
<transition name="chat-popup">
|
||||
|
||||
Reference in New Issue
Block a user