|
@@ -1,51 +1,37 @@
|
|
<template>
|
|
<template>
|
|
- <div class="login-container">
|
|
|
|
- <div class="login-content-out">
|
|
|
|
- <div class="login-content">
|
|
|
|
- <div class="login-content-main">
|
|
|
|
- <div class="login-icon-group">
|
|
|
|
- <div class="login-icon-group-title">
|
|
|
|
- <img :src="logoMini" />
|
|
|
|
- <div class="login-icon-group-title-text font25">{{ getThemeConfig.globalViceTitle }}</div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <div v-if="!isScan">
|
|
|
|
- <el-tabs v-model="tabsActiveName">
|
|
|
|
- <el-tab-pane :label="$t('message.label.one1')" name="account">
|
|
|
|
- <Account />
|
|
|
|
- </el-tab-pane>
|
|
|
|
- <!-- <el-tab-pane :label="$t('message.label.two2')" name="mobile">
|
|
|
|
- <Mobile />
|
|
|
|
- </el-tab-pane> -->
|
|
|
|
- </el-tabs>
|
|
|
|
- </div>
|
|
|
|
- <!-- <Scan v-if="isScan" /> -->
|
|
|
|
- <!-- <div class="login-content-main-sacn" @click="isScan = !isScan">
|
|
|
|
- <i class="iconfont" :class="isScan ? 'icon-diannao1' : 'icon-barcode-qr'"></i>
|
|
|
|
- <div class="login-content-main-sacn-delta"></div>
|
|
|
|
- </div> -->
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <div class="login-footer">
|
|
|
|
- <!-- <amis :json="amisjson" /> -->
|
|
|
|
- <div class="login-footer-content mt15">
|
|
|
|
- <div class="login-footer-content-warp">
|
|
|
|
- <div>Copyright © 2021-2023 SAGOO All Rights Reserved.</div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <div class="login-container flex-row">
|
|
|
|
+ <el-switch
|
|
|
|
+ class="switch"
|
|
|
|
+ v-model="getThemeConfig.isIsDark"
|
|
|
|
+ size="large"
|
|
|
|
+ inline-prompt
|
|
|
|
+ @change="onAddDarkChange"
|
|
|
|
+ :active-icon="Moon"
|
|
|
|
+ :inactive-icon="Sunny"
|
|
|
|
+ ></el-switch>
|
|
|
|
+ <div class="part left">
|
|
|
|
+ <div class="flex logo"><img class="logoimg" src="/@/assets/logo.png" />{{ sysinfo.systemName }}</div>
|
|
|
|
+ <img class="img" src="/@/assets/login-box-bg.svg" />
|
|
|
|
+ </div>
|
|
|
|
+ <div class="part">
|
|
|
|
+ <!-- <img :src="logoMini" />
|
|
|
|
+ <div class="login-icongroup-title-text font25">{{ getThemeConfig.globalViceTitle }}</div> -->
|
|
|
|
+ <div class="title">登录</div>
|
|
|
|
+ <Account />
|
|
|
|
+ </div>
|
|
|
|
+ <!-- <amis :json="amisjson" /> -->
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
import { toRefs, reactive, computed, defineComponent } from 'vue';
|
|
import { toRefs, reactive, computed, defineComponent } from 'vue';
|
|
import Account from '/@/views/login/component/account.vue';
|
|
import Account from '/@/views/login/component/account.vue';
|
|
-import Mobile from '/@/views/login/component/mobile.vue';
|
|
|
|
-import Scan from '/@/views/login/component/scan.vue';
|
|
|
|
import { useStore } from '/@/store/index';
|
|
import { useStore } from '/@/store/index';
|
|
import logoMini from '/@/assets/logo.png';
|
|
import logoMini from '/@/assets/logo.png';
|
|
-import amis from '/@/components/amis/index.vue';
|
|
|
|
|
|
+import { Sunny, Moon } from '@element-plus/icons-vue';
|
|
|
|
+// import amis from '/@/components/amis/index.vue';
|
|
|
|
+
|
|
|
|
+const store = useStore();
|
|
|
|
|
|
// 定义接口来定义对象的类型
|
|
// 定义接口来定义对象的类型
|
|
interface LoginState {
|
|
interface LoginState {
|
|
@@ -55,9 +41,19 @@ interface LoginState {
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
name: 'loginIndex',
|
|
name: 'loginIndex',
|
|
- components: { Account, Mobile, Scan, amis },
|
|
|
|
|
|
+ components: {
|
|
|
|
+ Account,
|
|
|
|
+ // amis,
|
|
|
|
+ },
|
|
data: function () {
|
|
data: function () {
|
|
return {
|
|
return {
|
|
|
|
+ Sunny,
|
|
|
|
+ Moon,
|
|
|
|
+ sysinfo: {
|
|
|
|
+ buildVersion: '',
|
|
|
|
+ systemName: '',
|
|
|
|
+ systemCopyright: '',
|
|
|
|
+ },
|
|
amisjson: {
|
|
amisjson: {
|
|
type: 'page',
|
|
type: 'page',
|
|
title: '表单页面',
|
|
title: '表单页面',
|
|
@@ -81,6 +77,9 @@ export default defineComponent({
|
|
},
|
|
},
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
+ created() {
|
|
|
|
+ this.sysinfo = JSON.parse(localStorage.sysinfo || '{}');
|
|
|
|
+ },
|
|
setup() {
|
|
setup() {
|
|
const store = useStore();
|
|
const store = useStore();
|
|
const state = reactive<LoginState>({
|
|
const state = reactive<LoginState>({
|
|
@@ -91,7 +90,16 @@ export default defineComponent({
|
|
const getThemeConfig = computed(() => {
|
|
const getThemeConfig = computed(() => {
|
|
return store.state.themeConfig.themeConfig;
|
|
return store.state.themeConfig.themeConfig;
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ // 4、界面显示 --> 深色模式
|
|
|
|
+ const onAddDarkChange = () => {
|
|
|
|
+ const body = document.documentElement as HTMLElement;
|
|
|
|
+ if (getThemeConfig.value.isIsDark) body.setAttribute('data-theme', 'dark');
|
|
|
|
+ else body.setAttribute('data-theme', '');
|
|
|
|
+ };
|
|
|
|
+
|
|
return {
|
|
return {
|
|
|
|
+ onAddDarkChange,
|
|
logoMini,
|
|
logoMini,
|
|
getThemeConfig,
|
|
getThemeConfig,
|
|
...toRefs(state),
|
|
...toRefs(state),
|
|
@@ -101,13 +109,67 @@ export default defineComponent({
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
|
|
+html[data-theme='dark'] {
|
|
|
|
+ .login-container {
|
|
|
|
+ background: #293146;
|
|
|
|
+ }
|
|
|
|
+ .left {
|
|
|
|
+ background-image: url(/@/assets/login-bg-dark.svg);
|
|
|
|
+ }
|
|
|
|
+ .title{
|
|
|
|
+ color: #aaa;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+.flex {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+}
|
|
|
|
+.switch {
|
|
|
|
+ position: fixed;
|
|
|
|
+ right: 20px;
|
|
|
|
+ top: 20px;
|
|
|
|
+}
|
|
.login-container {
|
|
.login-container {
|
|
- width: 100%;
|
|
|
|
- height: 100%;
|
|
|
|
|
|
+ width: 100vw;
|
|
|
|
+ height: 100vh;
|
|
position: relative;
|
|
position: relative;
|
|
- background-image: url('/@/assets/bg.jpeg');
|
|
|
|
- background-size: cover;
|
|
|
|
- background-position: center;
|
|
|
|
|
|
+ background: #fff;
|
|
|
|
+ .title {
|
|
|
|
+ font-size: 30px;
|
|
|
|
+ color: #333;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ letter-spacing: 20px;
|
|
|
|
+ }
|
|
|
|
+ .logo {
|
|
|
|
+ font-size: 30px;
|
|
|
|
+ color: #fff;
|
|
|
|
+ .logoimg {
|
|
|
|
+ height: 50px;
|
|
|
|
+ display: block;
|
|
|
|
+ margin-right: 12px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .img {
|
|
|
|
+ width: 50%;
|
|
|
|
+ display: block;
|
|
|
|
+ margin: 15vh 0;
|
|
|
|
+ }
|
|
|
|
+ .part {
|
|
|
|
+ flex: 1;
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-flow: column nowrap;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+ }
|
|
|
|
+ .left {
|
|
|
|
+ height: 100vh;
|
|
|
|
+ background-image: url(/@/assets/login-bg.svg);
|
|
|
|
+ background-repeat: no-repeat;
|
|
|
|
+ background-size: auto 100%;
|
|
|
|
+ background-position: right center;
|
|
|
|
+ align-items: flex-start;
|
|
|
|
+ padding-left: 8%;
|
|
|
|
+ }
|
|
.login-icon-group {
|
|
.login-icon-group {
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 100%;
|
|
height: 100%;
|
|
@@ -143,7 +205,7 @@ export default defineComponent({
|
|
width: 500px;
|
|
width: 500px;
|
|
padding: 20px;
|
|
padding: 20px;
|
|
margin-left: calc(50% - 500px);
|
|
margin-left: calc(50% - 500px);
|
|
- background-color: rgba(255,255,255,0.8);
|
|
|
|
|
|
+ background-color: rgba(255, 255, 255, 0.8);
|
|
border: 5px solid var(--el-color-primary-light-8);
|
|
border: 5px solid var(--el-color-primary-light-8);
|
|
border-radius: 5px;
|
|
border-radius: 5px;
|
|
overflow: hidden;
|
|
overflow: hidden;
|