feat: update TitleBar component for platform-specific styling and integrate into login page
This commit is contained in:
@@ -1,23 +1,25 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- macOS: just drag region -->
|
<!-- macOS: just drag region -->
|
||||||
<div v-if="platform === 'darwin'" class="drag-region h-10 shrink-0 border-b border-b-gray-300" style="background: transparent;" />
|
<div v-if="platform === 'darwin'" class="drag-region h-10 shrink-0 border-b" :class="borderColorClass" style="background: transparent;" />
|
||||||
|
|
||||||
<!-- Linux: no custom title bar -->
|
<!-- Linux: no custom title bar -->
|
||||||
<template v-else-if="platform !== 'win32'" />
|
<template v-else-if="platform !== 'win32'" />
|
||||||
|
|
||||||
<!-- Windows: custom controls -->
|
<!-- Windows: custom controls -->
|
||||||
<div v-else class="drag-region flex h-10 shrink-0 items-center justify-end border-b" style="background: transparent;">
|
<div v-else class="drag-region flex h-10 shrink-0 items-center justify-end border-b" :class="borderColorClass" style="background: transparent;">
|
||||||
<div class="no-drag flex h-full">
|
<div class="no-drag flex h-full">
|
||||||
<button
|
<button
|
||||||
@click="handleMinimize"
|
@click="handleMinimize"
|
||||||
class="flex h-full w-11 items-center justify-center text-[#525866] hover:bg-[#999] hover:text-white transition-colors"
|
class="flex h-full w-11 items-center justify-center hover:bg-[#999] hover:text-white transition-colors"
|
||||||
|
:class="iconColorClass"
|
||||||
title="Minimize"
|
title="Minimize"
|
||||||
>
|
>
|
||||||
<Minus class="h-4 w-4" />
|
<Minus class="h-4 w-4" />
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
@click="handleMaximize"
|
@click="handleMaximize"
|
||||||
class="flex h-full w-11 items-center justify-center text-[#525866] hover:bg-[#999] hover:text-white transition-colors"
|
class="flex h-full w-11 items-center justify-center hover:bg-[#999] hover:text-white transition-colors"
|
||||||
|
:class="iconColorClass"
|
||||||
:title="maximized ? 'Restore' : 'Maximize'"
|
:title="maximized ? 'Restore' : 'Maximize'"
|
||||||
>
|
>
|
||||||
<Copy v-if="maximized" class="h-3.5 w-3.5" />
|
<Copy v-if="maximized" class="h-3.5 w-3.5" />
|
||||||
@@ -25,7 +27,8 @@
|
|||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
@click="handleClose"
|
@click="handleClose"
|
||||||
class="flex h-full w-11 items-center justify-center text-[#525866] hover:bg-[#ff0000] hover:text-white transition-colors"
|
class="flex h-full w-11 items-center justify-center hover:bg-[#ff0000] hover:text-white transition-colors"
|
||||||
|
:class="iconColorClass"
|
||||||
title="Close"
|
title="Close"
|
||||||
>
|
>
|
||||||
<X class="h-4 w-4" />
|
<X class="h-4 w-4" />
|
||||||
@@ -35,12 +38,24 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from 'vue'
|
import { ref, onMounted, computed } from 'vue'
|
||||||
import { Minus, Square, Copy, X } from '@lucide/vue'
|
import { Minus, Square, Copy, X } from '@lucide/vue'
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
variant?: 'default' | 'light'
|
||||||
|
}>()
|
||||||
|
|
||||||
const platform = (window as any).api?.platform ?? ''
|
const platform = (window as any).api?.platform ?? ''
|
||||||
const maximized = ref(false)
|
const maximized = ref(false)
|
||||||
|
|
||||||
|
const iconColorClass = computed(() =>
|
||||||
|
props.variant === 'light' ? 'text-white' : 'text-[#525866]'
|
||||||
|
)
|
||||||
|
|
||||||
|
const borderColorClass = computed(() =>
|
||||||
|
props.variant === 'light' ? 'border-b-white/30' : 'border-b-gray-300'
|
||||||
|
)
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
maximized.value = await (window as any).api.windowIsMaximized()
|
maximized.value = await (window as any).api.windowIsMaximized()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="h-screen login-bg flex flex-col">
|
<div class="h-screen login-bg flex flex-col">
|
||||||
<main class="box-border pl-2 pr-2 pb-2 pt-11 flex-auto flex ">
|
<title-bar v-if="platform !== 'linux'" variant="light" />
|
||||||
|
<main class="box-border pl-2 pr-2 pb-2 flex-auto flex" :class="[platform !== 'linux' ? 'pt-2' : 'pt-11']">
|
||||||
<div class="w-209 box-border bg-white rounded-2xl p-8 flex flex-col">
|
<div class="w-209 box-border bg-white rounded-2xl p-8 flex flex-col">
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<img class="w-12 h-12" src="@assets/images/login/blue_logo.png" />
|
<img class="w-12 h-12" src="@assets/images/login/blue_logo.png" />
|
||||||
|
|
||||||
<!-- <span class="ml-auto text-[14px] text-gray-600">没有账号?</span>
|
|
||||||
<button
|
|
||||||
class="bg-sky-50 rounded-[8px] text-[14px] text-sky-600 px-[12px] py-[6px] focus-visible:outline-none cursor-pointer">注册</button> -->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-col items-center justify-center mb-6 box-border pt-10">
|
<div class="flex flex-col items-center justify-center mb-6 box-border pt-10">
|
||||||
@@ -45,14 +42,6 @@
|
|||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<!-- 记住密码|忘记密码 -->
|
|
||||||
<!-- <div class="flex items-center justify-between mb-[24px] mt-[24px]">
|
|
||||||
<div class="flex items-center gap-2 cursor-pointer">
|
|
||||||
<input type="checkbox" v-model="showPwd" class="w-[14px] h-[14px] rounded-[4px]" />
|
|
||||||
<span class="text-[14px] text-gray-600">记住密码</span>
|
|
||||||
</div>
|
|
||||||
<span class="text-[14px] text-sky-600 cursor-pointer">忘记密码?</span>
|
|
||||||
</div> -->
|
|
||||||
|
|
||||||
<!-- 登录按钮 -->
|
<!-- 登录按钮 -->
|
||||||
<button type="button"
|
<button type="button"
|
||||||
@@ -61,19 +50,11 @@
|
|||||||
{{ t('login.loginButton') }}
|
{{ t('login.loginButton') }}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<!-- 同意协议 -->
|
|
||||||
<!-- <div class="flex items-center justify-center gap-2 mt-[24px]">
|
|
||||||
<input type="checkbox" v-model="isAgree" class="w-[14px] h-[14px] rounded-[4px]" />
|
|
||||||
<span class="text-[14px] text-gray-600">我已同意</span>
|
|
||||||
<span class="text-[14px] text-sky-600 cursor-pointer">《使用协议》</span>
|
|
||||||
<span class="text-[14px] text-gray-600">和</span>
|
|
||||||
<span class="text-[14px] text-sky-600 cursor-pointer">《隐私协议》</span>
|
|
||||||
</div> -->
|
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<!-- Copy Right -->
|
<!-- Copy Right -->
|
||||||
<!-- <div class="text-[14px] text-gray-500 text-center mt-auto">
|
<!-- <div class="text-[14px] text-gray-500 text-center mt-auto">
|
||||||
© 2025 贵州智念科技服务有限公司 版权所有
|
© 2026 贵州智念科技服务有限公司 版权所有
|
||||||
</div> -->
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -83,14 +64,16 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive, ref, onMounted } from "vue"
|
import { reactive, ref, onMounted, computed } from "vue"
|
||||||
import { useUserStore } from "../../store/userinfo"
|
import { useUserStore } from "../../store/userinfo"
|
||||||
import { RiUser3Fill, RiKey2Fill } from '@remixicon/vue'
|
import { RiUser3Fill, RiKey2Fill } from '@remixicon/vue'
|
||||||
import { generateUUID } from "../../utils/generateUUID"
|
import { generateUUID } from "../../utils/generateUUID"
|
||||||
import { rule } from '../../utils/validate'
|
import { rule } from '../../utils/validate'
|
||||||
import { useLocale } from '../../composables/useLocale'
|
import { useLocale } from '../../composables/useLocale'
|
||||||
|
import TitleBar from '@components/Layout/TitleBar/index.vue'
|
||||||
|
|
||||||
const { t } = useLocale()
|
const { t } = useLocale()
|
||||||
|
const platform = computed(() => (window as any).api?.platform ?? '')
|
||||||
|
|
||||||
// form 表单数据类型声明
|
// form 表单数据类型声明
|
||||||
interface LoginForm {
|
interface LoginForm {
|
||||||
|
|||||||
Reference in New Issue
Block a user