xy 2 years ago
parent 223363388f
commit bbbe403277

@ -49,7 +49,6 @@ function createAdminWindow() {
adminWindow.webContents.once('dom-ready', () => {
adminWindow.show()
mainWindow.hide()
if (process.env.NODE_ENV === 'development' || openDevTools) adminWindow.webContents.openDevTools(true)
})
adminWindow.on('maximize', () => {

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg viewBox="0 0 1024 1024" width="200" height="200"><path d="M583.744 53.312c78.4 0 140.544 0 189.12 6.528 50.048 6.784 90.496 20.928 122.432 52.864 32 31.936 46.08 72.384 52.864 122.432 6.528 48.64 6.528 110.72 6.528 189.12v175.488c0 78.4 0 140.544-6.528 189.12-6.72 50.048-20.928 90.496-52.864 122.432-31.936 32-72.384 46.08-122.432 52.864-48.64 6.528-110.72 6.528-189.12 6.528H514.944c-78.4 0-140.544 0-189.12-6.528-50.048-6.72-90.56-20.928-122.432-52.864-27.2-27.136-41.472-60.48-49.28-100.608H112a42.688 42.688 0 0 1 0-85.376h33.472a3264.448 3264.448 0 0 1-1.472-125.568v-45.056h-32a42.688 42.688 0 1 1 0-85.376h32V424.32c0-47.68 0-89.344 1.472-125.568H112a42.688 42.688 0 0 1 0-85.376h42.112c7.808-40.128 22.08-73.472 49.28-100.608 31.872-31.936 72.384-46.08 122.432-52.864C374.4 53.312 436.48 53.312 514.944 53.312H583.68zM560 266.688a117.312 117.312 0 1 0 0 234.624 117.312 117.312 0 0 0 0-234.624z m120.64 310.976a233.024 233.024 0 0 0-241.28 0c-13.248 7.616-43.328 24.96-59.136 40.832-10.048 10.048-20.672 24.32-22.592 42.368-2.048 19.392 6.4 37.184 21.824 52.224 23.36 22.784 54.592 44.224 96.96 44.224h167.168c42.432 0 73.6-21.44 96.96-44.16 15.424-15.104 23.872-32.896 21.824-52.288-1.92-18.112-12.544-32.32-22.528-42.368-15.872-15.872-45.952-33.28-59.2-40.832z" fill="#333333" p-id="1705"></path></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1715416686946" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3356" width="200" height="200"><path d="M263.3 843.6h497.4c22.9 0 41.5 18.6 41.5 41.5s-18.6 41.5-41.5 41.5H263.3c-22.9 0-41.4-18.6-41.4-41.5s18.5-41.5 41.4-41.5zM138.9 97.5H885c22.9 0 41.5 18.6 41.5 41.4v580.3c0 22.9-18.6 41.5-41.5 41.5H138.9c-22.9 0-41.4-18.6-41.4-41.5V138.9c0-22.8 18.6-41.4 41.4-41.4zM470.6 576v60.3h82.9v-60.2c8.5-5.8 17.4-12.8 26.4-20.5l49.3 49.3 58.7-58.7-49.4-49.2c7.7-9 14.6-18 20.5-26.4h60.2v-82.9H659c-6.4-9.1-13.3-18-20.5-26.4l49.3-49.3-58.6-58.7-49.3 49.4c-8.5-7.2-17.3-14.1-26.4-20.5v-60.3h-82.9v60.3c-8.5 5.8-17.4 12.8-26.4 20.5l-49.3-49.3-58.7 58.6 49.3 49.3c-7.2 8.5-14.1 17.3-20.4 26.4h-60.3v82.9H365c5.8 8.5 12.8 17.4 20.5 26.4l-49.3 49.3 58.6 58.7 49.3-49.4c9.1 7.6 18 14.6 26.5 20.4z" fill="#131415" p-id="3357"></path></svg>

After

Width:  |  Height:  |  Size: 1013 B

@ -0,0 +1,2 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2333" width="200" height="200"><path d="M593.26464 860.16l2.37568 0.12288c12.4928 1.37216 21.2992 13.312 18.08384 25.4976l-1.24928 4.38272C599.32672 932.08576 559.3088 962.56 512 962.56l-4.87424-0.1024c-46.77632-2.08896-85.58592-33.97632-96.8704-76.67712l-0.45056-2.27328c-1.76128-12.12416 8.00768-23.3472 20.93056-23.3472h162.52928zM512 61.44a30.72 30.72 0 0 1 30.72 30.72v32.23552c157.45024 15.83104 276.48 154.29632 276.48 314.368V655.36l0.12288 3.072A40.96 40.96 0 0 0 860.16 696.32h7.31136l3.4816 0.1024c25.3952 1.59744 47.84128 20.33664 50.3808 45.81376l0.22528 3.2768A51.2 51.2 0 0 1 870.42048 798.72H156.52864l-3.4816-0.1024c-25.3952-1.59744-47.84128-20.33664-50.3808-45.81376l-0.22528-3.2768A51.2 51.2 0 0 1 153.6 696.32H163.84l3.072-0.1024A40.96 40.96 0 0 0 204.8 655.36V430.08c0-159.29344 121.2416-290.26304 276.48-305.68448V92.16A30.72 30.72 0 0 1 512 61.44z" fill="#131415" p-id="2334"></path></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -4,30 +4,36 @@
<Logo :collapse="isCollapse" />
<sidebar-item v-for="route in routes_list" :key="route.name" :item="route" :base-path="route.path"
:collapse="isCollapse"></sidebar-item>
<sidebar-item :collapse="isCollapse" :item="{
onlyShowfirst: true,
name: '后台管理'
}"></sidebar-item>
<el-menu-item @click="toAdmin">
<svg-icon icon-class="adminManage"></svg-icon>
<span>后台管理</span>
</el-menu-item>
</el-menu>
</scroll-bar>
</template>
<script setup>
import { ipcRenderer } from "electron";
import { computed, defineComponent } from "vue";
import SidebarItem from "./SidebarItem";
import ScrollBar from "@/components/ScrollBar";
import Logo from "./logo";
import { useAppStore } from "@/store/app"
import { usePermissionStore } from "@/store/permission"
import { constantRouterMap } from "@/router"
defineComponent({
name: 'Sidebar'
})
const { sidebarStatus } = useAppStore()
const { routers } = usePermissionStore()
const routes_list = computed(() => routers)
const routes_list = computed(() => constantRouterMap)
const isCollapse = computed(() => !sidebarStatus.opened)
const toAdmin = () => {
ipcRenderer.invoke("create-admin-window")
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.title {

@ -24,7 +24,7 @@ export default {
},
data() {
return {
title: "logo名称",
title: "江苏省宿迁环境监测中心",
};
}
};
@ -79,4 +79,4 @@ export default {
margin-left: 0px !important;
}
}
</style>
</style>

@ -14,25 +14,7 @@ export function usePermission() {
if (to.path === '/login') {
next({ path: '/' })
} else {
const hasRoles = roles && roles.length > 0;
if (hasRoles) {
next()
} else {
try {
const roles = await getUserInfo()
next({ ...to, replace: true })
} catch (error) {
await logOut()
console.error(error)
await ipcRenderer.invoke("toggle-main-window-resizable",false)
await ipcRenderer.invoke("main-window-resize",{
width: 320,
height: 504
})
next('/login')
}
}
next()
}
} else {
if (whiteList.includes(to.path)) {

@ -8,12 +8,36 @@ export const constantRouterMap = [{
component: Layout,
redirect: '/dashboard',
name: '主页',
hidden: false,
hidden: true,
children: [{
path: 'dashboard',
name: '总览',
component: () => import('@/components/LandingPage')
}]
},{
path: '/addressBook',
component: Layout,
meta: { title: '通讯录', icon: 'addressBook', roles: ['admin'] },
children: [
{
path: 'index',
name: 'Form',
component: () => import('@/views/addressBook/index'),
meta: { title: '通讯录', icon: 'addressBook' }
}
]
},{
path: '/notice',
component: Layout,
meta: { title: '通知', icon: 'notice', roles: ['admin'] },
children: [
{
path: 'index',
name: 'Form',
component: () => import('@/views/notice/index'),
meta: { title: '通知', icon: 'notice' }
}
]
}, {
path: '/login',
component: () => import('@/views/login'),

@ -5,7 +5,7 @@ import { login, getInfo, logout } from "@/api/login"
const store = () => ({
token: JSON.parse(localStorage.getItem('token')),
name: JSON.parse(localStorage.getItem('name')),
roles: JSON.parse(localStorage.getItem('roles')),
roles: [],
info: {},
})

@ -0,0 +1,11 @@
<template>
<div>
</div>
</template>
<script setup>
import {} from 'vue'
</script>
<style scoped lang="scss">
</style>

@ -45,18 +45,18 @@
</span>
</el-form-item>
<el-checkbox size="large" style="margin-top: 18px;zoom: 1.3;" v-model="isRemember"></el-checkbox>
<el-checkbox size="large" style="margin-top: 12px;" v-model="isRemember"></el-checkbox>
<el-button
:loading="loading"
type="primary"
round
style="
margin-top: 35px;
font-size: 18px;
letter-spacing: 3px;
margin-top: 24px;
font-size: 15px;
letter-spacing: 4px;
border-radius: 50px;
height: 50px;
height: 38px;
width: 100%;
background-color: #3d7af6;
filter: drop-shadow(0px 4px 9px rgba(72, 93, 237, 0.63));
@ -144,7 +144,6 @@ const handleLogin = () => {
userStore.login(loginForm.value).then(res => {
loading.value = false;
//ipcRenderer.invoke("create-admin-window")
ipcRenderer.invoke("toggle-main-window-resizable",true)
ipcRenderer.invoke("main-window-resize",{
width: 1200,
@ -173,7 +172,7 @@ const handleLogin = () => {
$bg: #283443;
$light_gray: #fff;
$cursor: #fff;
$cursor: #4c79ee;
@supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
.login-container .el-input input {
@ -186,9 +185,6 @@ $cursor: #fff;
width: 100vw;
height: 100vh;
.el-input {
display: inline-block;
height: 47px;
width: 70%;
input {
background: transparent;
@ -197,7 +193,7 @@ $cursor: #fff;
border-radius: 0px;
padding: 12px 5px 12px 15px;
color: #666;
height: 47px;
height: 100%;
caret-color: $cursor;
&:-webkit-autofill {
@ -207,14 +203,6 @@ $cursor: #fff;
}
}
.el-form-item {
color: #0003;
font-size: 16px;
line-height: 24px;
border-radius: 6px;
background-color: #ffffff;
border: 1px solid #d9d9d9;
}
}
</style>
@ -224,17 +212,10 @@ $bg: #2d3a4b;
$dark_gray: #889aa4;
$light_gray: #eee;
.login-container-w {
min-height: 100%;
width: 100%;
background-color: #ffffff;
overflow: hidden;
}
.login-container {
min-height: 100%;
width: 100%;
background: url("../../assets/imgs/login-bkg.png") no-repeat;
background: url("~@/assets/imgs/login-bkg.png") no-repeat;
background-size: cover;
overflow: hidden;
display: flex;
@ -243,8 +224,10 @@ $light_gray: #eee;
.form-container {
padding: 20px;
padding: 20px 20px 24px 20px;
background: #fff;
border-radius: 10px;
box-shadow: 0 2px 16px 0 rgba(0,0,0,.2);
}
.tips {
@ -279,7 +262,15 @@ $light_gray: #eee;
user-select: none;
}
}
.form-item + .form-item {
margin-top: 22px;
::v-deep .el-form-item__content {
display: flex;
line-height: 34px;
align-items: center;
position: relative;
border-bottom: 1px #aaa6 solid;
}
.form-item {
margin-bottom: 10px;
}
</style>

@ -0,0 +1,11 @@
<template>
<div>
</div>
</template>
<script setup>
import {} from 'vue'
</script>
<style scoped lang="scss">
</style>
Loading…
Cancel
Save