联调
This commit is contained in:
@@ -11,7 +11,7 @@ const appStore = useAppStore()
|
||||
|
||||
const show = ref(true)
|
||||
|
||||
const title = computed(() => appStore.getTitle)
|
||||
const title = computed(() => appStore.getAppInfo.instanceName)
|
||||
|
||||
const layout = computed(() => appStore.getLayout)
|
||||
|
||||
|
||||
19
src/layout/components/RoleSelect/index.vue
Normal file
19
src/layout/components/RoleSelect/index.vue
Normal file
@@ -0,0 +1,19 @@
|
||||
<template>
|
||||
<el-select v-model="roleId" filterable @change="handleChangeRole" style="width: 150px">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</template>
|
||||
|
||||
<script setup name="RoleSelect">
|
||||
const options = ref([
|
||||
{ value: 1, label: '超级管理员' },
|
||||
{ value: 2, label: '销售' }
|
||||
])
|
||||
const roleId = ref(1)
|
||||
|
||||
function handleChangeRole() {
|
||||
console.log('修改角色')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts" name="Setting" setup>
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { useClipboard, useCssVar } from '@vueuse/core'
|
||||
|
||||
// import { ElMessage } from 'element-plus'
|
||||
// import { useClipboard, useCssVar } from '@vueuse/core'
|
||||
import { useCssVar } from '@vueuse/core'
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
import { useDesign } from '@/hooks/web/useDesign'
|
||||
|
||||
@@ -10,8 +10,8 @@ import { colorIsDark, hexToRGB, lighten } from '@/utils/color'
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import { ThemeSwitch } from '@/layout/components/ThemeSwitch'
|
||||
import ColorRadioPicker from './components/ColorRadioPicker.vue'
|
||||
import InterfaceDisplay from './components/InterfaceDisplay.vue'
|
||||
import LayoutRadioPicker from './components/LayoutRadioPicker.vue'
|
||||
// import InterfaceDisplay from './components/InterfaceDisplay.vue'
|
||||
// import LayoutRadioPicker from './components/LayoutRadioPicker.vue'
|
||||
|
||||
const { t } = useI18n()
|
||||
const appStore = useAppStore()
|
||||
@@ -106,85 +106,85 @@ watch(
|
||||
)
|
||||
|
||||
// 拷贝
|
||||
const copyConfig = async () => {
|
||||
const { copy, copied, isSupported } = useClipboard({
|
||||
source: `
|
||||
// 面包屑
|
||||
breadcrumb: ${appStore.getBreadcrumb},
|
||||
// 面包屑图标
|
||||
breadcrumbIcon: ${appStore.getBreadcrumbIcon},
|
||||
// 折叠图标
|
||||
hamburger: ${appStore.getHamburger},
|
||||
// 全屏图标
|
||||
screenfull: ${appStore.getScreenfull},
|
||||
// 尺寸图标
|
||||
size: ${appStore.getSize},
|
||||
// 多语言图标
|
||||
locale: ${appStore.getLocale},
|
||||
// 消息图标
|
||||
message: ${appStore.getMessage},
|
||||
// 标签页
|
||||
tagsView: ${appStore.getTagsView},
|
||||
// 标签页图标
|
||||
getTagsViewIcon: ${appStore.getTagsViewIcon},
|
||||
// logo
|
||||
logo: ${appStore.getLogo},
|
||||
// 菜单手风琴
|
||||
uniqueOpened: ${appStore.getUniqueOpened},
|
||||
// 固定header
|
||||
fixedHeader: ${appStore.getFixedHeader},
|
||||
// 页脚
|
||||
footer: ${appStore.getFooter},
|
||||
// 灰色模式
|
||||
greyMode: ${appStore.getGreyMode},
|
||||
// layout布局
|
||||
layout: '${appStore.getLayout}',
|
||||
// 暗黑模式
|
||||
isDark: ${appStore.getIsDark},
|
||||
// 组件尺寸
|
||||
currentSize: '${appStore.getCurrentSize}',
|
||||
// 主题相关
|
||||
theme: {
|
||||
// 主题色
|
||||
elColorPrimary: '${appStore.getTheme.elColorPrimary}',
|
||||
// 左侧菜单边框颜色
|
||||
leftMenuBorderColor: '${appStore.getTheme.leftMenuBorderColor}',
|
||||
// 左侧菜单背景颜色
|
||||
leftMenuBgColor: '${appStore.getTheme.leftMenuBgColor}',
|
||||
// 左侧菜单浅色背景颜色
|
||||
leftMenuBgLightColor: '${appStore.getTheme.leftMenuBgLightColor}',
|
||||
// 左侧菜单选中背景颜色
|
||||
leftMenuBgActiveColor: '${appStore.getTheme.leftMenuBgActiveColor}',
|
||||
// 左侧菜单收起选中背景颜色
|
||||
leftMenuCollapseBgActiveColor: '${appStore.getTheme.leftMenuCollapseBgActiveColor}',
|
||||
// 左侧菜单字体颜色
|
||||
leftMenuTextColor: '${appStore.getTheme.leftMenuTextColor}',
|
||||
// 左侧菜单选中字体颜色
|
||||
leftMenuTextActiveColor: '${appStore.getTheme.leftMenuTextActiveColor}',
|
||||
// logo字体颜色
|
||||
logoTitleTextColor: '${appStore.getTheme.logoTitleTextColor}',
|
||||
// logo边框颜色
|
||||
logoBorderColor: '${appStore.getTheme.logoBorderColor}',
|
||||
// 头部背景颜色
|
||||
topHeaderBgColor: '${appStore.getTheme.topHeaderBgColor}',
|
||||
// 头部字体颜色
|
||||
topHeaderTextColor: '${appStore.getTheme.topHeaderTextColor}',
|
||||
// 头部悬停颜色
|
||||
topHeaderHoverColor: '${appStore.getTheme.topHeaderHoverColor}',
|
||||
// 头部边框颜色
|
||||
topToolBorderColor: '${appStore.getTheme.topToolBorderColor}'
|
||||
}
|
||||
`
|
||||
})
|
||||
if (!isSupported) {
|
||||
ElMessage.error(t('setting.copyFailed'))
|
||||
} else {
|
||||
await copy()
|
||||
if (unref(copied)) {
|
||||
ElMessage.success(t('setting.copySuccess'))
|
||||
}
|
||||
}
|
||||
}
|
||||
// const copyConfig = async () => {
|
||||
// const { copy, copied, isSupported } = useClipboard({
|
||||
// source: `
|
||||
// // 面包屑
|
||||
// breadcrumb: ${appStore.getBreadcrumb},
|
||||
// // 面包屑图标
|
||||
// breadcrumbIcon: ${appStore.getBreadcrumbIcon},
|
||||
// // 折叠图标
|
||||
// hamburger: ${appStore.getHamburger},
|
||||
// // 全屏图标
|
||||
// screenfull: ${appStore.getScreenfull},
|
||||
// // 尺寸图标
|
||||
// size: ${appStore.getSize},
|
||||
// // 多语言图标
|
||||
// locale: ${appStore.getLocale},
|
||||
// // 消息图标
|
||||
// message: ${appStore.getMessage},
|
||||
// // 标签页
|
||||
// tagsView: ${appStore.getTagsView},
|
||||
// // 标签页图标
|
||||
// getTagsViewIcon: ${appStore.getTagsViewIcon},
|
||||
// // logo
|
||||
// logo: ${appStore.getLogo},
|
||||
// // 菜单手风琴
|
||||
// uniqueOpened: ${appStore.getUniqueOpened},
|
||||
// // 固定header
|
||||
// fixedHeader: ${appStore.getFixedHeader},
|
||||
// // 页脚
|
||||
// footer: ${appStore.getFooter},
|
||||
// // 灰色模式
|
||||
// greyMode: ${appStore.getGreyMode},
|
||||
// // layout布局
|
||||
// layout: '${appStore.getLayout}',
|
||||
// // 暗黑模式
|
||||
// isDark: ${appStore.getIsDark},
|
||||
// // 组件尺寸
|
||||
// currentSize: '${appStore.getCurrentSize}',
|
||||
// // 主题相关
|
||||
// theme: {
|
||||
// // 主题色
|
||||
// elColorPrimary: '${appStore.getTheme.elColorPrimary}',
|
||||
// // 左侧菜单边框颜色
|
||||
// leftMenuBorderColor: '${appStore.getTheme.leftMenuBorderColor}',
|
||||
// // 左侧菜单背景颜色
|
||||
// leftMenuBgColor: '${appStore.getTheme.leftMenuBgColor}',
|
||||
// // 左侧菜单浅色背景颜色
|
||||
// leftMenuBgLightColor: '${appStore.getTheme.leftMenuBgLightColor}',
|
||||
// // 左侧菜单选中背景颜色
|
||||
// leftMenuBgActiveColor: '${appStore.getTheme.leftMenuBgActiveColor}',
|
||||
// // 左侧菜单收起选中背景颜色
|
||||
// leftMenuCollapseBgActiveColor: '${appStore.getTheme.leftMenuCollapseBgActiveColor}',
|
||||
// // 左侧菜单字体颜色
|
||||
// leftMenuTextColor: '${appStore.getTheme.leftMenuTextColor}',
|
||||
// // 左侧菜单选中字体颜色
|
||||
// leftMenuTextActiveColor: '${appStore.getTheme.leftMenuTextActiveColor}',
|
||||
// // logo字体颜色
|
||||
// logoTitleTextColor: '${appStore.getTheme.logoTitleTextColor}',
|
||||
// // logo边框颜色
|
||||
// logoBorderColor: '${appStore.getTheme.logoBorderColor}',
|
||||
// // 头部背景颜色
|
||||
// topHeaderBgColor: '${appStore.getTheme.topHeaderBgColor}',
|
||||
// // 头部字体颜色
|
||||
// topHeaderTextColor: '${appStore.getTheme.topHeaderTextColor}',
|
||||
// // 头部悬停颜色
|
||||
// topHeaderHoverColor: '${appStore.getTheme.topHeaderHoverColor}',
|
||||
// // 头部边框颜色
|
||||
// topToolBorderColor: '${appStore.getTheme.topToolBorderColor}'
|
||||
// }
|
||||
// `
|
||||
// })
|
||||
// if (!isSupported) {
|
||||
// ElMessage.error(t('setting.copyFailed'))
|
||||
// } else {
|
||||
// await copy()
|
||||
// if (unref(copied)) {
|
||||
// ElMessage.success(t('setting.copySuccess'))
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// 清空缓存
|
||||
const clear = () => {
|
||||
@@ -216,8 +216,8 @@ const clear = () => {
|
||||
<ThemeSwitch />
|
||||
|
||||
<!-- 布局 -->
|
||||
<ElDivider>{{ t('setting.layout') }}</ElDivider>
|
||||
<LayoutRadioPicker />
|
||||
<!-- <ElDivider>{{ t('setting.layout') }}</ElDivider> -->
|
||||
<!-- <LayoutRadioPicker /> -->
|
||||
|
||||
<!-- 系统主题 -->
|
||||
<ElDivider>{{ t('setting.systemTheme') }}</ElDivider>
|
||||
@@ -274,13 +274,13 @@ const clear = () => {
|
||||
</div>
|
||||
|
||||
<!-- 界面显示 -->
|
||||
<ElDivider>{{ t('setting.interfaceDisplay') }}</ElDivider>
|
||||
<InterfaceDisplay />
|
||||
<!-- <ElDivider>{{ t('setting.interfaceDisplay') }}</ElDivider>
|
||||
<InterfaceDisplay /> -->
|
||||
|
||||
<ElDivider />
|
||||
<div>
|
||||
<!-- <div>
|
||||
<ElButton class="w-full" type="primary" @click="copyConfig">{{ t('setting.copy') }}</ElButton>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="mt-5px">
|
||||
<ElButton class="w-full" type="danger" @click="clear">
|
||||
{{ t('setting.clearAndReset') }}
|
||||
|
||||
@@ -11,7 +11,7 @@ const { setWatermark } = useWatermark()
|
||||
const prefixCls = getPrefixCls('interface-display')
|
||||
const appStore = useAppStore()
|
||||
|
||||
const water = ref()
|
||||
const water = ref('安徽莳松科技有限公司')
|
||||
|
||||
// 面包屑
|
||||
const breadcrumb = ref(appStore.getBreadcrumb)
|
||||
@@ -124,6 +124,7 @@ const fixedMenuChange = (show: boolean) => {
|
||||
const setWater = () => {
|
||||
setWatermark(water.value)
|
||||
}
|
||||
setWater()
|
||||
|
||||
const layout = computed(() => appStore.getLayout)
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import { Screenfull } from '@/layout/components/Screenfull'
|
||||
import { Breadcrumb } from '@/layout/components/Breadcrumb'
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import { useDesign } from '@/hooks/web/useDesign'
|
||||
import RoleSelect from './RoleSelect/index.vue'
|
||||
|
||||
const { getPrefixCls, variables } = useDesign()
|
||||
|
||||
@@ -50,6 +51,7 @@ export default defineComponent({
|
||||
</div>
|
||||
) : undefined}
|
||||
<div class="h-full flex items-center">
|
||||
<RoleSelect />
|
||||
{screenfull.value ? (
|
||||
<Screenfull class="hover-trigger" color="var(--top-header-text-color)"></Screenfull>
|
||||
) : undefined}
|
||||
|
||||
@@ -6,6 +6,7 @@ import { useDesign } from '@/hooks/web/useDesign'
|
||||
import avatarImg from '@/assets/imgs/avatar.gif'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { useTagsViewStore } from '@/store/modules/tagsView'
|
||||
import { getTenantId, getAppId } from '@/utils/auth'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
@@ -34,18 +35,17 @@ const loginOut = () => {
|
||||
type: 'warning'
|
||||
})
|
||||
.then(async () => {
|
||||
const tenantId = getTenantId()
|
||||
const appId = getAppId()
|
||||
await userStore.loginOut()
|
||||
tagsViewStore.delAllViews()
|
||||
replace('/login?redirect=/index')
|
||||
replace(`/login?tenantId=${tenantId}&appId=${appId}`)
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
const toProfile = async () => {
|
||||
push('/user/profile')
|
||||
}
|
||||
const toDocument = () => {
|
||||
window.open('https://doc.iocoder.cn/')
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -68,10 +68,6 @@ const toDocument = () => {
|
||||
<Icon icon="ep:tools" />
|
||||
<div @click="toProfile">{{ t('common.profile') }}</div>
|
||||
</ElDropdownItem>
|
||||
<ElDropdownItem>
|
||||
<Icon icon="ep:menu" />
|
||||
<div @click="toDocument">{{ t('common.document') }}</div>
|
||||
</ElDropdownItem>
|
||||
<ElDropdownItem divided @click="loginOut">
|
||||
<Icon icon="ep:switch-button" />
|
||||
<div>{{ t('common.loginOut') }}</div>
|
||||
|
||||
Reference in New Issue
Block a user