Merge remote-tracking branch 'origin/feature-yaojie' into feature-guji
# Conflicts: # src/layout/components/Navbar.vue # src/router/index.ts # src/utils/validate.ts
This commit is contained in:
commit
f166717873
1
auto-imports.d.ts
vendored
1
auto-imports.d.ts
vendored
@ -3,4 +3,5 @@ export {}
|
|||||||
declare global {
|
declare global {
|
||||||
const ElMessage: typeof import('element-plus/es')['ElMessage']
|
const ElMessage: typeof import('element-plus/es')['ElMessage']
|
||||||
const ElMessageBox: typeof import('element-plus/es')['ElMessageBox']
|
const ElMessageBox: typeof import('element-plus/es')['ElMessageBox']
|
||||||
|
const ElNotification: typeof import('element-plus/es')['ElNotification']
|
||||||
}
|
}
|
||||||
|
4
components.d.ts
vendored
4
components.d.ts
vendored
@ -27,14 +27,18 @@ declare module '@vue/runtime-core' {
|
|||||||
ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
|
ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
|
||||||
ElIcon: typeof import('element-plus/es')['ElIcon']
|
ElIcon: typeof import('element-plus/es')['ElIcon']
|
||||||
ElInput: typeof import('element-plus/es')['ElInput']
|
ElInput: typeof import('element-plus/es')['ElInput']
|
||||||
|
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
|
||||||
ElMenu: typeof import('element-plus/es')['ElMenu']
|
ElMenu: typeof import('element-plus/es')['ElMenu']
|
||||||
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
|
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
|
||||||
ElOption: typeof import('element-plus/es')['ElOption']
|
ElOption: typeof import('element-plus/es')['ElOption']
|
||||||
ElPagination: typeof import('element-plus/es')['ElPagination']
|
ElPagination: typeof import('element-plus/es')['ElPagination']
|
||||||
ElProgress: typeof import('element-plus/es')['ElProgress']
|
ElProgress: typeof import('element-plus/es')['ElProgress']
|
||||||
|
ElRadio: typeof import('element-plus/es')['ElRadio']
|
||||||
|
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
|
||||||
ElRow: typeof import('element-plus/es')['ElRow']
|
ElRow: typeof import('element-plus/es')['ElRow']
|
||||||
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
|
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
|
||||||
ElSelect: typeof import('element-plus/es')['ElSelect']
|
ElSelect: typeof import('element-plus/es')['ElSelect']
|
||||||
|
ElSlider: typeof import('element-plus/es')['ElSlider']
|
||||||
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
|
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
|
||||||
ElSwitch: typeof import('element-plus/es')['ElSwitch']
|
ElSwitch: typeof import('element-plus/es')['ElSwitch']
|
||||||
ElTable: typeof import('element-plus/es')['ElTable']
|
ElTable: typeof import('element-plus/es')['ElTable']
|
||||||
|
@ -89,8 +89,8 @@ export default defineComponent({
|
|||||||
async logout() {
|
async logout() {
|
||||||
console.log('5989569898')
|
console.log('5989569898')
|
||||||
// store.user().login()
|
// store.user().login()
|
||||||
|
// await store.user().logout();
|
||||||
await store.user().logout();
|
await store.user().logout();
|
||||||
console.log('hhhh')
|
|
||||||
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
|
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,10 +5,11 @@ import NProgress from 'nprogress'; // progress bar
|
|||||||
import 'nprogress/nprogress.css'; // progress bar style
|
import 'nprogress/nprogress.css'; // progress bar style
|
||||||
import { getToken } from '@/utils/auth'; // get token from cookie
|
import { getToken } from '@/utils/auth'; // get token from cookie
|
||||||
import getPageTitle from '@/utils/get-page-title';
|
import getPageTitle from '@/utils/get-page-title';
|
||||||
|
import {ElMessage} from "element-plus";
|
||||||
|
|
||||||
NProgress.configure({ showSpinner: false }); // NProgress Configuration
|
NProgress.configure({ showSpinner: false }); // NProgress Configuration
|
||||||
|
|
||||||
const whiteList = ['/login', '/auth-redirect']; // no redirect whitelist
|
const whiteList = ['/login', '/auth-redirect', '/register']; // no redirect whitelist
|
||||||
|
|
||||||
//每次路由变动,都会调用这个路由守卫
|
//每次路由变动,都会调用这个路由守卫
|
||||||
router.beforeEach(async (to, from, next) => {
|
router.beforeEach(async (to, from, next) => {
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
import { markRaw } from 'vue';
|
// import { markRaw } from 'vue';
|
||||||
import { createRouter, createWebHistory } from 'vue-router'; // createWebHashHistory, createWebHistory
|
import { createRouter, createWebHistory } from 'vue-router'; // createWebHashHistory, createWebHistory
|
||||||
import type { Router, RouteRecordRaw, RouteComponent } from 'vue-router';
|
import type { Router, RouteRecordRaw, RouteComponent } from 'vue-router';
|
||||||
import { Help as IconHelp } from '@element-plus/icons-vue';
|
// import { Help as IconHelp } from '@element-plus/icons-vue';
|
||||||
|
|
||||||
/* Layout */
|
/* Layout */
|
||||||
const Layout = ():RouteComponent => import('@/layout/index.vue');
|
const Layout = ():RouteComponent => import('@/layout/index.vue');
|
||||||
|
|
||||||
/* Router Modules */
|
/* Router Modules */
|
||||||
import componentsRouter from './modules/components';
|
// import componentsRouter from './modules/components';
|
||||||
import chartsRouter from './modules/charts';
|
// import chartsRouter from './modules/charts';
|
||||||
import nestedRouter from './modules/nested';
|
// import nestedRouter from './modules/nested';
|
||||||
import tableRouter from './modules/table';
|
// import tableRouter from './modules/table';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constantRoutes
|
* constantRoutes
|
||||||
@ -60,35 +60,35 @@ export const constantRoutes:RouteRecordRaw[] = [
|
|||||||
path: 'dashboard',
|
path: 'dashboard',
|
||||||
component: () => import('@/views/dashboard/index.vue'),
|
component: () => import('@/views/dashboard/index.vue'),
|
||||||
name: 'Dashboard',
|
name: 'Dashboard',
|
||||||
meta: { title: '我管理的', icon: 'dashboard', affix: true }
|
meta: { title: '首页', icon: 'dashboard', affix: true }
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/documentation',
|
|
||||||
component: Layout,
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: 'index',
|
|
||||||
component: () => import('@/views/documentation/index.vue'),
|
|
||||||
name: 'Documentation',
|
|
||||||
meta: { title: 'Documentation', icon: 'documentation', affix: true }
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/guide',
|
|
||||||
component: Layout,
|
|
||||||
redirect: '/guide/index',
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: 'index',
|
|
||||||
component: () => import('@/views/guide/index.vue'),
|
|
||||||
name: 'Guide',
|
|
||||||
meta: { title: 'Guide', icon: 'guide', noCache: true }
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// path: '/documentation',
|
||||||
|
// component: Layout,
|
||||||
|
// children: [
|
||||||
|
// {
|
||||||
|
// path: 'index',
|
||||||
|
// component: () => import('@/views/documentation/index.vue'),
|
||||||
|
// name: 'Documentation',
|
||||||
|
// meta: { title: 'Documentation', icon: 'documentation', affix: true }
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// path: '/guide',
|
||||||
|
// component: Layout,
|
||||||
|
// redirect: '/guide/index',
|
||||||
|
// children: [
|
||||||
|
// {
|
||||||
|
// path: 'index',
|
||||||
|
// component: () => import('@/views/guide/index.vue'),
|
||||||
|
// name: 'Guide',
|
||||||
|
// meta: { title: 'Guide', icon: 'guide', noCache: true }
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
path: '/profile',
|
path: '/profile',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
@ -112,288 +112,329 @@ export const constantRoutes:RouteRecordRaw[] = [
|
|||||||
* 注意:hidden、alwaysShow 属性配置移动到了meta中!!!
|
* 注意:hidden、alwaysShow 属性配置移动到了meta中!!!
|
||||||
*/
|
*/
|
||||||
export const asyncRoutes:RouteRecordRaw[] = [
|
export const asyncRoutes:RouteRecordRaw[] = [
|
||||||
|
// {
|
||||||
|
// path: '/permission',
|
||||||
|
// component: Layout,
|
||||||
|
// redirect: '/permission/page',
|
||||||
|
// name: 'Permission',
|
||||||
|
// meta: {
|
||||||
|
// alwaysShow: true, // will always show the root menu
|
||||||
|
// title: 'Permission',
|
||||||
|
// icon: 'lock',
|
||||||
|
// roles: ['admin', 'editor','teacher_user'] // you can set roles in root nav
|
||||||
|
// },
|
||||||
|
// children: [
|
||||||
|
// {
|
||||||
|
// path: 'page',
|
||||||
|
// component: () => import('@/views/permission/page.vue'),
|
||||||
|
// name: 'PagePermission',
|
||||||
|
// meta: {
|
||||||
|
// title: 'Page Permission',
|
||||||
|
// roles: ['admin','teacher_user'] // or you can only set roles in sub nav
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// path: 'directive',
|
||||||
|
// component: () => import('@/views/permission/directive.vue'),
|
||||||
|
// name: 'DirectivePermission',
|
||||||
|
// meta: {
|
||||||
|
// title: 'Directive Permission'
|
||||||
|
// // if do not set roles, means: this page does not require permission
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// path: 'role',
|
||||||
|
// component: () => import('@/views/permission/role.vue'),
|
||||||
|
// name: 'RolePermission',
|
||||||
|
// meta: {
|
||||||
|
// title: 'Role Permission',
|
||||||
|
// roles: ['admin','teacher']
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
// },
|
||||||
|
|
||||||
|
// 个人项目
|
||||||
{
|
{
|
||||||
path: '/permission',
|
path: '/myself',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
redirect: '/permission/page',
|
redirect: '/myself',
|
||||||
name: 'Permission',
|
|
||||||
meta: {
|
meta: {
|
||||||
alwaysShow: true, // will always show the root menu
|
alwaysShow: true, // will always show the root menu
|
||||||
title: 'Permission',
|
title: '个人项目',
|
||||||
icon: 'lock',
|
icon: 'nested',
|
||||||
roles: ['admin', 'editor','teacher_user', 'xiao_lfeng'] // you can set roles in root nav
|
roles: ['admin', 'teacher_user']
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'page',
|
// 我负责的
|
||||||
component: () => import('@/views/permission/page.vue'),
|
path: 'charge',
|
||||||
name: 'PagePermission',
|
component: () => import('@/views/personal/project/charge.vue'),
|
||||||
meta: {
|
name: 'Charge',
|
||||||
title: 'Page Permission',
|
meta: { title: '我负责的', icon: 'user', affix: true }
|
||||||
roles: ['admin','teacher_user'] // or you can only set roles in sub nav
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'directive',
|
// 我管理的
|
||||||
component: () => import('@/views/permission/directive.vue'),
|
path: 'manage',
|
||||||
name: 'DirectivePermission',
|
component: () => import('@/views/personal/project/manage.vue'),
|
||||||
meta: {
|
name: 'Manage',
|
||||||
title: 'Directive Permission'
|
meta: { title: '我管理的', icon: 'user', affix: true }
|
||||||
// if do not set roles, means: this page does not require permission
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'role',
|
// 我参与的
|
||||||
component: () => import('@/views/permission/role.vue'),
|
path: 'participate',
|
||||||
name: 'RolePermission',
|
component: () => import('@/views/personal/project/participate.vue'),
|
||||||
meta: {
|
name: 'Participate',
|
||||||
title: 'Role Permission',
|
meta: { title: '我参与的', icon: 'user', affix: true }
|
||||||
roles: ['admin','teacher']
|
},
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
|
||||||
path: '/icon',
|
// {
|
||||||
component: Layout,
|
// path: '/icon',
|
||||||
children: [
|
// component: Layout,
|
||||||
{
|
// children: [
|
||||||
path: 'index',
|
// {
|
||||||
component: () => import('@/views/icons/index.vue'),
|
// path: 'index',
|
||||||
name: 'Icons',
|
// component: () => import('@/views/icons/index.vue'),
|
||||||
meta: { title: 'Icons', icon: 'icon', noCache: true }
|
// name: 'Icons',
|
||||||
}
|
// meta: { title: 'Icons', icon: 'icon', noCache: true }
|
||||||
]
|
// }
|
||||||
},
|
// ]
|
||||||
|
// },
|
||||||
|
|
||||||
// /** when your routing map is too long, you can split it into small modules **/
|
// /** when your routing map is too long, you can split it into small modules **/
|
||||||
componentsRouter,
|
// componentsRouter,
|
||||||
chartsRouter,
|
// chartsRouter,
|
||||||
nestedRouter,
|
// nestedRouter,
|
||||||
tableRouter,
|
// tableRouter,
|
||||||
|
|
||||||
|
// {
|
||||||
|
// path: '/example',
|
||||||
|
// component: Layout,
|
||||||
|
// redirect: '/example/list',
|
||||||
|
// name: 'Example',
|
||||||
|
// meta: {
|
||||||
|
// title: 'Example',
|
||||||
|
// icon: markRaw(IconHelp)
|
||||||
|
// },
|
||||||
|
// children: [
|
||||||
|
// {
|
||||||
|
// path: 'create',
|
||||||
|
// component: () => import('@/views/example/create.vue'),
|
||||||
|
// name: 'CreateArticle',
|
||||||
|
// meta: { title: 'Create Article', icon: 'edit' }
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// path: 'edit/:id(\\d+)',
|
||||||
|
// component: () => import('@/views/example/edit.vue'),
|
||||||
|
// name: 'EditArticle',
|
||||||
|
// meta: { hidden: true, title: 'Edit Article', noCache: true, activeMenu: '/example/list' }
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// path: 'list',
|
||||||
|
// component: () => import('@/views/example/list.vue'),
|
||||||
|
// name: 'ArticleList',
|
||||||
|
// meta: { title: 'Article List', icon: 'list' }
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
// },
|
||||||
|
|
||||||
{
|
{
|
||||||
path: '/example',
|
path: '/daily',
|
||||||
component: Layout,
|
|
||||||
redirect: '/example/list',
|
|
||||||
name: 'Example',
|
|
||||||
meta: {
|
|
||||||
title: 'Example',
|
|
||||||
icon: markRaw(IconHelp)
|
|
||||||
},
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: 'create',
|
|
||||||
component: () => import('@/views/example/create.vue'),
|
|
||||||
name: 'CreateArticle',
|
|
||||||
meta: { title: 'Create Article', icon: 'edit' }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'edit/:id(\\d+)',
|
|
||||||
component: () => import('@/views/example/edit.vue'),
|
|
||||||
name: 'EditArticle',
|
|
||||||
meta: { hidden: true, title: 'Edit Article', noCache: true, activeMenu: '/example/list' }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'list',
|
|
||||||
component: () => import('@/views/example/list.vue'),
|
|
||||||
name: 'ArticleList',
|
|
||||||
meta: { title: 'Article List', icon: 'list' }
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
path: '/tab',
|
|
||||||
component: Layout,
|
component: Layout,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'index',
|
path: 'd',
|
||||||
component: () => import('@/views/tab/index.vue'),
|
component: () => import('@/views/tab/index.vue'),
|
||||||
name: 'Tab',
|
name: 'Tab',
|
||||||
meta: { title: 'Tab', icon: 'tab' }
|
meta: { title: '日报', icon: 'tab' }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
// {
|
||||||
path: '/error',
|
// path: '/error',
|
||||||
component: Layout,
|
// component: Layout,
|
||||||
redirect: 'noRedirect',
|
// redirect: 'noRedirect',
|
||||||
name: 'ErrorPages',
|
// name: 'ErrorPages',
|
||||||
meta: {
|
// meta: {
|
||||||
title: 'Error Pages',
|
// title: 'Error Pages',
|
||||||
icon: '404'
|
// icon: '404'
|
||||||
},
|
// },
|
||||||
children: [
|
// children: [
|
||||||
{
|
// {
|
||||||
path: '401',
|
// path: '401',
|
||||||
component: () => import('@/views/error-page/401.vue'),
|
// component: () => import('@/views/error-page/401.vue'),
|
||||||
name: 'Page401',
|
// name: 'Page401',
|
||||||
meta: { title: '401', noCache: true }
|
// meta: { title: '401', noCache: true }
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path: '404',
|
// path: '404',
|
||||||
component: () => import('@/views/error-page/404.vue'),
|
// component: () => import('@/views/error-page/404.vue'),
|
||||||
name: 'Page404',
|
// name: 'Page404',
|
||||||
meta: { title: '404', noCache: true }
|
// meta: { title: '404', noCache: true }
|
||||||
}
|
// }
|
||||||
]
|
// ]
|
||||||
},
|
// },
|
||||||
|
|
||||||
{
|
{
|
||||||
path: '/error-log',
|
path: '/message',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'log',
|
path: 'ms',
|
||||||
component: () => import('@/views/error-log/index.vue'),
|
component: () => import('@/views/error-log/index.vue'),
|
||||||
name: 'ErrorLog',
|
name: 'ErrorLog',
|
||||||
meta: { title: 'Error Log', icon: 'bug' }
|
meta: { title: '信息', icon: 'bug' }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
// {
|
||||||
path: '/excel',
|
// path: '/excel',
|
||||||
component: Layout,
|
// component: Layout,
|
||||||
redirect: '/excel/export-excel',
|
// redirect: '/excel/export-excel',
|
||||||
name: 'Excel',
|
// name: 'Excel',
|
||||||
meta: {
|
// meta: {
|
||||||
title: 'Excel',
|
// title: 'Excel',
|
||||||
icon: 'excel'
|
// icon: 'excel'
|
||||||
},
|
// },
|
||||||
children: [
|
// children: [
|
||||||
{
|
// {
|
||||||
path: 'export-excel',
|
// path: 'export-excel',
|
||||||
component: () => import('@/views/excel/export-excel.vue'),
|
// component: () => import('@/views/excel/export-excel.vue'),
|
||||||
name: 'ExportExcel',
|
// name: 'ExportExcel',
|
||||||
meta: { title: 'Export Excel' }
|
// meta: { title: 'Export Excel' }
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path: 'export-selected-excel',
|
// path: 'export-selected-excel',
|
||||||
component: () => import('@/views/excel/select-excel.vue'),
|
// component: () => import('@/views/excel/select-excel.vue'),
|
||||||
name: 'SelectExcel',
|
// name: 'SelectExcel',
|
||||||
meta: { title: 'Export Selected' }
|
// meta: { title: 'Export Selected' }
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path: 'export-merge-header',
|
// path: 'export-merge-header',
|
||||||
component: () => import('@/views/excel/merge-header.vue'),
|
// component: () => import('@/views/excel/merge-header.vue'),
|
||||||
name: 'MergeHeader',
|
// name: 'MergeHeader',
|
||||||
meta: { title: 'Merge Header' }
|
// meta: { title: 'Merge Header' }
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path: 'upload-excel',
|
// path: 'upload-excel',
|
||||||
component: () => import('@/views/excel/upload-excel.vue'),
|
// component: () => import('@/views/excel/upload-excel.vue'),
|
||||||
name: 'UploadExcel',
|
// name: 'UploadExcel',
|
||||||
meta: { title: 'Upload Excel' }
|
// meta: { title: 'Upload Excel' }
|
||||||
}
|
// }
|
||||||
]
|
// ]
|
||||||
},
|
// },
|
||||||
|
|
||||||
{
|
// {
|
||||||
path: '/zip',
|
// path: '/zip',
|
||||||
component: Layout,
|
// component: Layout,
|
||||||
redirect: '/zip/download',
|
// redirect: '/zip/download',
|
||||||
name: 'Zip',
|
// name: 'Zip',
|
||||||
meta: { alwaysShow: true, title: 'Zip', icon: 'zip' },
|
// meta: { alwaysShow: true, title: 'Zip', icon: 'zip' },
|
||||||
children: [
|
// children: [
|
||||||
{
|
// {
|
||||||
path: 'download',
|
// path: 'download',
|
||||||
component: () => import('@/views/zip/index.vue'),
|
// component: () => import('@/views/zip/index.vue'),
|
||||||
name: 'ExportZip',
|
// name: 'ExportZip',
|
||||||
meta: { title: 'Export Zip' }
|
// meta: { title: 'Export Zip' }
|
||||||
}
|
// }
|
||||||
]
|
// ]
|
||||||
},
|
// },
|
||||||
|
|
||||||
{
|
// {
|
||||||
path: '/pdf',
|
// path: '/pdf',
|
||||||
component: Layout,
|
// component: Layout,
|
||||||
redirect: '/pdf/index',
|
// redirect: '/pdf/index',
|
||||||
children: [
|
// children: [
|
||||||
{
|
// {
|
||||||
path: 'index',
|
// path: 'index',
|
||||||
component: () => import('@/views/pdf/index.vue'),
|
// component: () => import('@/views/pdf/index.vue'),
|
||||||
name: 'PDF',
|
// name: 'PDF',
|
||||||
meta: { title: 'PDF', icon: 'pdf' }
|
// meta: { title: 'PDF', icon: 'pdf' }
|
||||||
}
|
// }
|
||||||
]
|
// ]
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path: '/pdf/download',
|
// path: '/pdf/download',
|
||||||
component: () => import('@/views/pdf/download.vue'),
|
// component: () => import('@/views/pdf/download.vue'),
|
||||||
meta: { hidden: true }
|
// meta: { hidden: true }
|
||||||
},
|
// },
|
||||||
|
//
|
||||||
|
// {
|
||||||
|
// path: '/theme',
|
||||||
|
// component: Layout,
|
||||||
|
// children: [
|
||||||
|
// {
|
||||||
|
// path: 'index',
|
||||||
|
// component: () => import('@/views/theme/index.vue'),
|
||||||
|
// name: 'Theme',
|
||||||
|
// meta: { title: 'Theme', icon: 'theme' }
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
// },
|
||||||
|
|
||||||
{
|
// {
|
||||||
path: '/theme',
|
// path: '/clipboard',
|
||||||
component: Layout,
|
// component: Layout,
|
||||||
children: [
|
// children: [
|
||||||
{
|
// {
|
||||||
path: 'index',
|
// path: 'index',
|
||||||
component: () => import('@/views/theme/index.vue'),
|
// component: () => import('@/views/clipboard/index.vue'),
|
||||||
name: 'Theme',
|
// name: 'ClipboardDemo',
|
||||||
meta: { title: 'Theme', icon: 'theme' }
|
// meta: { title: 'Clipboard', icon: 'clipboard' }
|
||||||
}
|
// }
|
||||||
]
|
// ]
|
||||||
},
|
// },
|
||||||
|
|
||||||
{
|
// {
|
||||||
path: '/clipboard',
|
// path: '/external-link',
|
||||||
component: Layout,
|
// component: Layout,
|
||||||
children: [
|
// children: [
|
||||||
{
|
// {
|
||||||
path: 'index',
|
// path: 'https://element-plus.midfar.com',
|
||||||
component: () => import('@/views/clipboard/index.vue'),
|
// meta: { title: 'External Link', icon: 'link' },
|
||||||
name: 'ClipboardDemo',
|
// redirect: ''
|
||||||
meta: { title: 'Clipboard', icon: 'clipboard' }
|
// }
|
||||||
}
|
// ]
|
||||||
]
|
// },
|
||||||
},
|
|
||||||
|
|
||||||
{
|
// {
|
||||||
path: '/external-link',
|
// path: '/my-demo',
|
||||||
component: Layout,
|
// component: Layout,
|
||||||
children: [
|
// name: 'MyDemo',
|
||||||
{
|
// meta: {
|
||||||
path: 'https://element-plus.midfar.com',
|
// title: 'MyDemo',
|
||||||
meta: { title: 'External Link', icon: 'link' },
|
// icon: 'component'
|
||||||
redirect: ''
|
// },
|
||||||
}
|
// children: [
|
||||||
]
|
// {
|
||||||
},
|
// path: 'element-demo',
|
||||||
|
// component: () => import('@/views/mydemo/ElementDemo.vue'),
|
||||||
{
|
// name: 'ElementDemo',
|
||||||
path: '/my-demo',
|
// meta: { title: 'ElementDemo', icon: 'skill' }
|
||||||
component: Layout,
|
// },
|
||||||
name: 'MyDemo',
|
// {
|
||||||
meta: {
|
// path: 'store-demo',
|
||||||
title: 'MyDemo',
|
// component: () => import('@/views/mydemo/StoreDemo.vue'),
|
||||||
icon: 'component'
|
// name: 'StoreDemo',
|
||||||
},
|
// meta: { title: 'StoreDemo', icon: 'lock' }
|
||||||
children: [
|
// },
|
||||||
{
|
// {
|
||||||
path: 'element-demo',
|
// path: 'webSocket-demo',
|
||||||
component: () => import('@/views/mydemo/ElementDemo.vue'),
|
// component: () => import('@/views/mydemo/WebSocketDemo.vue'),
|
||||||
name: 'ElementDemo',
|
// name: 'WebSocketDemo',
|
||||||
meta: { title: 'ElementDemo', icon: 'skill' }
|
// meta: { title: 'WebSocketDemo', icon: 'lock' }
|
||||||
},
|
// }
|
||||||
{
|
// ]
|
||||||
path: 'store-demo',
|
// },
|
||||||
component: () => import('@/views/mydemo/StoreDemo.vue'),
|
|
||||||
name: 'StoreDemo',
|
|
||||||
meta: { title: 'StoreDemo', icon: 'lock' }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'webSocket-demo',
|
|
||||||
component: () => import('@/views/mydemo/WebSocketDemo.vue'),
|
|
||||||
name: 'WebSocketDemo',
|
|
||||||
meta: { title: 'WebSocketDemo', icon: 'lock' }
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
|
|
||||||
// 404 page must be placed at the end !!!
|
// 404 page must be placed at the end !!!
|
||||||
{ path: '/:pathMatch(.*)*', redirect: '/404', meta: { hidden: true }}
|
{ path: '/:pathMatch(.*)*', redirect: '/404', meta: { hidden: true }}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
const Layout = () => import('@/layout/index.vue');
|
const Layout = () => import('@/layout/index.vue');
|
||||||
|
|
||||||
|
//侧边栏
|
||||||
const tableRouter = {
|
const tableRouter = {
|
||||||
path: '/table',
|
path: '/table',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
|
@ -4,6 +4,7 @@ import { getToken, setToken, removeToken } from '@/utils/auth';
|
|||||||
import router, { resetRouter } from '@/router';
|
import router, { resetRouter } from '@/router';
|
||||||
import tagsViewStore from './tagsView';
|
import tagsViewStore from './tagsView';
|
||||||
import permissionStore from './permission';
|
import permissionStore from './permission';
|
||||||
|
// import {response} from "express";
|
||||||
|
|
||||||
export interface IUserState {
|
export interface IUserState {
|
||||||
token: string;
|
token: string;
|
||||||
@ -57,12 +58,18 @@ export default defineStore({
|
|||||||
const { data } = response;
|
const { data } = response;
|
||||||
this.token = data.token;
|
this.token = data.token;
|
||||||
setToken(data.token);
|
setToken(data.token);
|
||||||
console.log("token", this.token)
|
// console.log("token", this.token)
|
||||||
|
console.log("response", response)
|
||||||
|
// @ts-ignore
|
||||||
|
ElMessage.success(response.message)
|
||||||
router.push('/')
|
router.push('/')
|
||||||
resolve();
|
resolve();
|
||||||
console.log('2222',response)
|
// console.log('2222',response)
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
console.log('3333',error)
|
//@ts-ignore
|
||||||
|
// ElMessage.error(response.message)
|
||||||
|
console.log("login ERROR:", error)
|
||||||
|
// console.log('3333',error)
|
||||||
reject(error);
|
reject(error);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -77,13 +84,13 @@ export default defineStore({
|
|||||||
if (!data) {
|
if (!data) {
|
||||||
reject('Verification failed, please Login again.');
|
reject('Verification failed, please Login again.');
|
||||||
}
|
}
|
||||||
const { id,username,address,phone,email,age,signature,avatar,nickname,sex,description } = data;
|
const { id,username,address,phone,email,age,signature,avatar,nickname,sex,description,role } = data;
|
||||||
// roles must be a non-empty array
|
// roles must be a non-empty array
|
||||||
// if (!roles || roles.length <= 0) {
|
// if (!roles || roles.length <= 0) {
|
||||||
// reject('getInfo: roles must be a non-null array!');
|
// reject('getInfo: roles must be a non-null array!');
|
||||||
// }
|
// }
|
||||||
this.id = id;
|
this.id = id;
|
||||||
// this.roles = roles;
|
this.roles = role.name;
|
||||||
// this.roles =['admin'];
|
// this.roles =['admin'];
|
||||||
this.username = username;
|
this.username = username;
|
||||||
this.avatar = avatar;
|
this.avatar = avatar;
|
||||||
@ -96,6 +103,7 @@ export default defineStore({
|
|||||||
this.signature = signature;
|
this.signature = signature;
|
||||||
this.nickname = nickname;
|
this.nickname = nickname;
|
||||||
resolve(data);
|
resolve(data);
|
||||||
|
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
reject(error);
|
reject(error);
|
||||||
});
|
});
|
||||||
@ -109,9 +117,27 @@ export default defineStore({
|
|||||||
apiLogout(this.token).then(() => {
|
apiLogout(this.token).then(() => {
|
||||||
this.token = '';
|
this.token = '';
|
||||||
this.roles = [];
|
this.roles = [];
|
||||||
console.log('退出',this.token)
|
// console.log('退出',this.token)
|
||||||
removeToken();
|
removeToken();
|
||||||
resetRouter();
|
resetRouter();
|
||||||
|
ElMessage.success("退出成功")
|
||||||
|
// reset visited views and cached views
|
||||||
|
// to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2485
|
||||||
|
tagsViewStore().delAllViews();
|
||||||
|
resolve();
|
||||||
|
}).catch(error => {
|
||||||
|
reject(error);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
},
|
||||||
|
logoutBug():Promise<void> {
|
||||||
|
console.log("token",this.token)
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
apiLogout(this.token).then(() => {
|
||||||
|
this.token = '';
|
||||||
|
this.roles = [];
|
||||||
|
resetRouter();
|
||||||
// reset visited views and cached views
|
// reset visited views and cached views
|
||||||
// to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2485
|
// to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2485
|
||||||
tagsViewStore().delAllViews();
|
tagsViewStore().delAllViews();
|
||||||
@ -119,8 +145,30 @@ export default defineStore({
|
|||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
reject(error);
|
reject(error);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
logoutTest(): void {
|
||||||
|
removeToken();
|
||||||
|
console.log("removeTokenTestSuccess");
|
||||||
|
// console.log("token",this.token)
|
||||||
|
// return new Promise((resolve, reject) => {
|
||||||
|
// apiLogout(this.token).then(() => {
|
||||||
|
// this.token = '';
|
||||||
|
// this.roles = [];
|
||||||
|
// console.log('退出',this.token)
|
||||||
|
// // removeToken();
|
||||||
|
// resetRouter();
|
||||||
|
// // reset visited views and cached views
|
||||||
|
// // to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2485
|
||||||
|
// tagsViewStore().delAllViews();
|
||||||
|
// resolve();
|
||||||
|
// }).catch(error => {
|
||||||
|
// reject(error);
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// });
|
||||||
|
},
|
||||||
|
|
||||||
// remove token
|
// remove token
|
||||||
resetToken() {
|
resetToken() {
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import store from '@/store';
|
import store from '@/store';
|
||||||
|
import {useRouter} from 'vue-router'
|
||||||
import {getToken, removeToken} from '@/utils/auth';
|
import {getToken, removeToken} from '@/utils/auth';
|
||||||
|
import {resetRouter} from "@/router";
|
||||||
|
|
||||||
const BaseURL ='https://nbxt.oa.x-lf.cn'
|
const BaseURL ='https://nbxt.oa.x-lf.cn'
|
||||||
|
const router = useRouter();
|
||||||
// create an axios instance
|
// create an axios instance
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
baseURL: BaseURL, // url = base url + request url
|
baseURL: BaseURL, // url = base url + request url
|
||||||
@ -47,31 +50,42 @@ service.interceptors.response.use(
|
|||||||
response => {
|
response => {
|
||||||
const res = response.data;
|
const res = response.data;
|
||||||
// console.log("removeToken:",removeToken())
|
// console.log("removeToken:",removeToken())
|
||||||
console.log('999999',response)
|
console.log('999999',res)
|
||||||
// if the custom code is not 20000, it is judged as an error.
|
if (res.code === 40103) {
|
||||||
if (res.code !== 20000 && res.code !== 200) {
|
store.user().logoutTest();
|
||||||
ElMessage({
|
console.log("返回登录成功")
|
||||||
message: res.message || 'Error',
|
|
||||||
type: 'error',
|
|
||||||
duration: 5 * 1000
|
|
||||||
});
|
|
||||||
|
|
||||||
// 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
|
|
||||||
if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
|
|
||||||
// to re-login
|
|
||||||
ElMessageBox.confirm('You have been logged out, you can cancel to stay on this page, or log in again', 'Confirm logout', {
|
|
||||||
confirmButtonText: 'Re-Login',
|
|
||||||
cancelButtonText: 'Cancel',
|
|
||||||
type: 'warning'
|
|
||||||
}).then(() => {
|
|
||||||
store.user().resetToken();
|
|
||||||
location.reload();
|
location.reload();
|
||||||
});
|
|
||||||
|
// resetRouter()
|
||||||
|
// router.push("/login")
|
||||||
|
} else if (res.code !== 200) {
|
||||||
|
ElMessage.error(res.message)
|
||||||
}
|
}
|
||||||
return Promise.reject(new Error(res.message || 'Error'));
|
// if the custom code is not 20000, it is judged as an error.
|
||||||
} else {
|
// if (res.code !== 20000 && res.code !== 200) {
|
||||||
|
// ElMessage({
|
||||||
|
// message: res.message || 'Error',
|
||||||
|
// type: 'error',
|
||||||
|
// duration: 5 * 1000
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
|
||||||
|
// if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
|
||||||
|
// // to re-login
|
||||||
|
// ElMessageBox.confirm('You have been logged out, you can cancel to stay on this page, or log in again', 'Confirm logout', {
|
||||||
|
// confirmButtonText: 'Re-Login',
|
||||||
|
// cancelButtonText: 'Cancel',
|
||||||
|
// type: 'warning'
|
||||||
|
// }).then(() => {
|
||||||
|
// store.user().resetToken();
|
||||||
|
// location.reload();
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// return Promise.reject(new Error(res.message || 'Error'));
|
||||||
|
// } else {
|
||||||
|
// return res;
|
||||||
|
// }
|
||||||
return res;
|
return res;
|
||||||
}
|
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
console.log('err' + error); // for debug
|
console.log('err' + error); // for debug
|
||||||
|
@ -15,7 +15,7 @@ export function isExternal(path) {
|
|||||||
* @returns {Boolean}
|
* @returns {Boolean}
|
||||||
*/
|
*/
|
||||||
export function validUsername(str) {
|
export function validUsername(str) {
|
||||||
const valid_map = ['admin', 'editor', 'teacher_user', 'xiao_lfeng'];
|
const valid_map = ['admin', 'editor', 'teacher_user', 'teacher_demo', 'demo', 'xiao_lfeng', 'yangna'];
|
||||||
return valid_map.indexOf(str.trim()) >= 0;
|
return valid_map.indexOf(str.trim()) >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
417
src/views/login/Register.vue
Normal file
417
src/views/login/Register.vue
Normal file
@ -0,0 +1,417 @@
|
|||||||
|
<!--<template>-->
|
||||||
|
<!-- <div>-->
|
||||||
|
<!-- <div class="container">-->
|
||||||
|
<!-- <div class="forms-container">-->
|
||||||
|
<!-- <div class="signin-signup">-->
|
||||||
|
<!-- <a-card style="width: 25vw; display: flex; margin-left: 10vw; justify-content: center; background-color: #f9f9f9">-->
|
||||||
|
<!-- <h1 style="display: flex; justify-content: center; font-weight: bold; font-size: large; margin-top:2vh">用户注册</h1>-->
|
||||||
|
<!-- <a-form-->
|
||||||
|
<!-- :label-col="{ span: 6 }"-->
|
||||||
|
<!-- :model="formState"-->
|
||||||
|
<!-- autocomplete="off"-->
|
||||||
|
<!-- name="basic"-->
|
||||||
|
<!-- style="margin-top: 3vh"-->
|
||||||
|
<!-- @finish="onFinish"-->
|
||||||
|
<!-- @finishFailed="onFinishFailed"-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- <a-form-item-->
|
||||||
|
<!-- :rules="[{ required: true, message: '请输入您的用户名!' }]"-->
|
||||||
|
<!-- label="用户名"-->
|
||||||
|
<!-- name="username"-->
|
||||||
|
<!-- style="margin-top: 20px;"-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- <a-input v-model:value="formState.username" class="h-10 w-64 border-gray-300 rounded-md" type="text"/>-->
|
||||||
|
<!-- </a-form-item>-->
|
||||||
|
<!-- <a-form-item-->
|
||||||
|
<!-- :rules="[{ required: true, message: '请输入您的密码!' }]"-->
|
||||||
|
<!-- label="用户密码"-->
|
||||||
|
<!-- name="password"-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- <a-input v-model:value="formState.password" class="h-10 w-64 border-gray-300 rounded-md" type="password" />-->
|
||||||
|
<!-- </a-form-item>-->
|
||||||
|
<!-- <a-form-item-->
|
||||||
|
<!-- :rules="[{ required: true, message: '请输入家庭地址!' }]"-->
|
||||||
|
<!-- label="家庭地址"-->
|
||||||
|
<!-- name="address"-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- <a-input v-model:value="formState.address" class="h-10 w-64 border-gray-300 rounded-md" type="text" />-->
|
||||||
|
<!-- </a-form-item>-->
|
||||||
|
<!-- <a-form-item-->
|
||||||
|
<!-- :rules="[{ required: true, message: '请输入手机号码!' }]"-->
|
||||||
|
<!-- label="手机号"-->
|
||||||
|
<!-- name="phone"-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- <a-input v-model:value="formState.phone" class="h-10 w-64 border-gray-300 rounded-md" type="text" />-->
|
||||||
|
<!-- </a-form-item>-->
|
||||||
|
<!-- <a-form-item-->
|
||||||
|
<!-- :rules="[{ required: true, message: '请输入邮箱!' }]"-->
|
||||||
|
<!-- label="邮箱"-->
|
||||||
|
<!-- name="email"-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- <a-input v-model:value="formState.email" class="h-10 w-64 border-gray-300 rounded-md" type="email" />-->
|
||||||
|
<!-- </a-form-item>-->
|
||||||
|
<!-- <a-form-item-->
|
||||||
|
<!-- :rules="[{ required: true, message: '请输入年龄!' }]"-->
|
||||||
|
<!-- label="年龄"-->
|
||||||
|
<!-- name="age"-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- <a-input-number v-model:value="formState.age" class="h-10 w-64 border-gray-300 rounded-md" />-->
|
||||||
|
<!-- </a-form-item>-->
|
||||||
|
<!-- <a-form-item-->
|
||||||
|
<!-- :rules="[{ required: true, message: '请输入性别!' }]"-->
|
||||||
|
<!-- label="性别"-->
|
||||||
|
<!-- name="sex"-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- <a-radio-group v-model:value="formState.sex">-->
|
||||||
|
<!-- <a-radio :value="0">保密</a-radio>-->
|
||||||
|
<!-- <a-radio :value="1">男</a-radio>-->
|
||||||
|
<!-- <a-radio :value="2">女</a-radio>-->
|
||||||
|
<!-- </a-radio-group>-->
|
||||||
|
<!-- </a-form-item>-->
|
||||||
|
<!-- <a-form-item :wrapper-col="{ offset: 6, span: 16 }" style="margin-top: 4vh">-->
|
||||||
|
<!-- <a-button html-type="submit" style="background-color: dodgerblue; color: white;width: 10vw" type="primary" @click="registerUser">立即注册</a-button>-->
|
||||||
|
<!-- </a-form-item>-->
|
||||||
|
<!-- </a-form>-->
|
||||||
|
<!-- </a-card>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
|
||||||
|
<!-- <div class="panels-container">-->
|
||||||
|
<!-- <div class="panel left-panel">-->
|
||||||
|
<!-- <div class="content">-->
|
||||||
|
<!-- <h3>加入我们</h3>-->
|
||||||
|
<!-- <p>-->
|
||||||
|
<!-- 加入我们,成为团队的一份子。-->
|
||||||
|
<!-- </p>-->
|
||||||
|
<!-- <button id="sign-up-btn" class="btn transparent" @click="$router.push('/login')">-->
|
||||||
|
<!-- 去登录-->
|
||||||
|
<!-- </button>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- <!– <img src="log.svg" class="image" alt="" />–>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
|
||||||
|
|
||||||
|
<!--</template>-->
|
||||||
|
<template>
|
||||||
|
注册
|
||||||
|
</template>
|
||||||
|
<!--<script setup>-->
|
||||||
|
<!--import {reactive} from 'vue';-->
|
||||||
|
<!--import requests from '@/js/request.js'-->
|
||||||
|
<!--// import {message} from "ant-design-vue";-->
|
||||||
|
<!--import {useRouter} from "vue-router";-->
|
||||||
|
|
||||||
|
<!--const router = useRouter()-->
|
||||||
|
|
||||||
|
<!--message.config({-->
|
||||||
|
<!-- background: true-->
|
||||||
|
<!--})-->
|
||||||
|
|
||||||
|
<!--const formState = reactive({-->
|
||||||
|
<!-- username: '',-->
|
||||||
|
<!-- password: '',-->
|
||||||
|
<!-- address:'',-->
|
||||||
|
<!-- phone:'',-->
|
||||||
|
<!-- email:'',-->
|
||||||
|
<!-- sex:'',-->
|
||||||
|
<!-- age:0,-->
|
||||||
|
<!--});-->
|
||||||
|
<!--const onFinish = values => {-->
|
||||||
|
<!-- console.log('Success:', values);-->
|
||||||
|
<!--};-->
|
||||||
|
<!--const onFinishFailed = errorInfo => {-->
|
||||||
|
<!-- console.log('Failed:', errorInfo);-->
|
||||||
|
<!--};-->
|
||||||
|
|
||||||
|
<!--function registerUser() {-->
|
||||||
|
|
||||||
|
<!-- formState.sex = parseInt(formState.sex)-->
|
||||||
|
<!-- console.log("registerData:",formState)-->
|
||||||
|
<!-- requests.register(formState).then((res) => {-->
|
||||||
|
<!-- console.log("registerData:",formState)-->
|
||||||
|
<!-- console.log("registerResult:",res)-->
|
||||||
|
<!-- if (res.data.code === 200) {-->
|
||||||
|
<!-- //注册成功,提示+跳转页面-->
|
||||||
|
<!-- console.log('注册成功')-->
|
||||||
|
<!-- message.success('注册成功')-->
|
||||||
|
<!-- router.push("/login")-->
|
||||||
|
<!-- } else {-->
|
||||||
|
<!-- //注册失败,消息提示-->
|
||||||
|
<!-- console.log('注册失败')-->
|
||||||
|
<!-- }-->
|
||||||
|
<!-- console.log(res)-->
|
||||||
|
<!-- })-->
|
||||||
|
<!--}-->
|
||||||
|
|
||||||
|
<!--</script>-->
|
||||||
|
<style>
|
||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
body,
|
||||||
|
input {
|
||||||
|
font-family: "Poppins", sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.signin-signup {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
left: 75%;
|
||||||
|
width: 50%;
|
||||||
|
transition: 1s 0.7s ease-in-out;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
z-index: 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
width: 150px;
|
||||||
|
background-color: #5995fd;
|
||||||
|
border: none;
|
||||||
|
outline: none;
|
||||||
|
height: 49px;
|
||||||
|
border-radius: 49px;
|
||||||
|
color: #fff;
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-weight: 600;
|
||||||
|
margin: 10px 0;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: 0.5s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn:hover {
|
||||||
|
background-color: #4d84e2;
|
||||||
|
}
|
||||||
|
.panels-container {
|
||||||
|
position: absolute;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
|
}
|
||||||
|
|
||||||
|
.container:before {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
height: 2000px;
|
||||||
|
width: 2000px;
|
||||||
|
top: -10%;
|
||||||
|
right: 48%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
background-image: linear-gradient(-45deg, #4481eb 0%, #04befe 100%);
|
||||||
|
transition: 1.8s ease-in-out;
|
||||||
|
border-radius: 50%;
|
||||||
|
z-index: 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image {
|
||||||
|
width: 100%;
|
||||||
|
transition: transform 1.1s ease-in-out;
|
||||||
|
transition-delay: 0.4s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-end;
|
||||||
|
justify-content: space-around;
|
||||||
|
text-align: center;
|
||||||
|
z-index: 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.left-panel {
|
||||||
|
pointer-events: all;
|
||||||
|
padding: 3rem 17% 2rem 12%;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.panel .content {
|
||||||
|
color: #fff;
|
||||||
|
transition: transform 0.9s ease-in-out;
|
||||||
|
transition-delay: 0.6s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel h3 {
|
||||||
|
font-weight: 600;
|
||||||
|
line-height: 1;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel p {
|
||||||
|
font-size: 0.95rem;
|
||||||
|
padding: 0.7rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn.transparent {
|
||||||
|
margin: 0;
|
||||||
|
background: none;
|
||||||
|
border: 2px solid #fff;
|
||||||
|
width: 130px;
|
||||||
|
height: 41px;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right-panel .image,
|
||||||
|
.right-panel .content {
|
||||||
|
transform: translateX(800px);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ANIMATION */
|
||||||
|
|
||||||
|
.container.sign-up-mode .left-panel .image,
|
||||||
|
.container.sign-up-mode .left-panel .content {
|
||||||
|
transform: translateX(-800px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.container.sign-up-mode .signin-signup {
|
||||||
|
left: 25%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container.sign-up-mode form.sign-in-form {
|
||||||
|
opacity: 0;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container.sign-up-mode .right-panel .image,
|
||||||
|
.container.sign-up-mode .right-panel .content {
|
||||||
|
transform: translateX(0%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.container.sign-up-mode .left-panel {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@media (max-width: 870px) {
|
||||||
|
.container {
|
||||||
|
min-height: 800px;
|
||||||
|
height: 100vh;
|
||||||
|
}
|
||||||
|
.signin-signup {
|
||||||
|
width: 100%;
|
||||||
|
top: 95%;
|
||||||
|
transform: translate(-50%, -100%);
|
||||||
|
transition: 1s 0.8s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.signin-signup,
|
||||||
|
.container.sign-up-mode .signin-signup {
|
||||||
|
left: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panels-container {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
grid-template-rows: 1fr 2fr 1fr;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel {
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-around;
|
||||||
|
align-items: center;
|
||||||
|
padding: 2.5rem 8%;
|
||||||
|
grid-column: 1 / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.left-panel {
|
||||||
|
grid-row: 1 / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image {
|
||||||
|
width: 200px;
|
||||||
|
transition: transform 0.9s ease-in-out;
|
||||||
|
transition-delay: 0.6s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel .content {
|
||||||
|
padding-right: 15%;
|
||||||
|
transition: transform 0.9s ease-in-out;
|
||||||
|
transition-delay: 0.8s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel h3 {
|
||||||
|
font-size: 1.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel p {
|
||||||
|
font-size: 0.7rem;
|
||||||
|
padding: 0.5rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn.transparent {
|
||||||
|
width: 110px;
|
||||||
|
height: 35px;
|
||||||
|
font-size: 0.7rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container:before {
|
||||||
|
width: 1500px;
|
||||||
|
height: 1500px;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
left: 30%;
|
||||||
|
bottom: 68%;
|
||||||
|
right: initial;
|
||||||
|
top: initial;
|
||||||
|
transition: 2s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.container.sign-up-mode .left-panel .image,
|
||||||
|
.container.sign-up-mode .left-panel .content {
|
||||||
|
transform: translateY(-300px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.container.sign-up-mode .right-panel .image,
|
||||||
|
.container.sign-up-mode .right-panel .content {
|
||||||
|
transform: translateY(0px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.right-panel .image,
|
||||||
|
.right-panel .content {
|
||||||
|
transform: translateY(300px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.container.sign-up-mode .signin-signup {
|
||||||
|
top: 5%;
|
||||||
|
transform: translate(-50%, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 570px) {
|
||||||
|
form {
|
||||||
|
padding: 0 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.panel .content {
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
}
|
||||||
|
.container {
|
||||||
|
padding: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container:before {
|
||||||
|
bottom: 72%;
|
||||||
|
left: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,4 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div>
|
||||||
|
<div class="container">
|
||||||
|
<div class="forms-container">
|
||||||
|
<div class="signin-signup">
|
||||||
|
<a-card class="sign-in-form" style="width: 25vw;margin-left: 10vw; display: flex; justify-content: center; align-items: center; background-color: #f9f9f9" >
|
||||||
<div class="login-container">
|
<div class="login-container">
|
||||||
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" autocomplete="on"
|
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" autocomplete="on"
|
||||||
label-position="left">
|
label-position="left">
|
||||||
@ -7,7 +12,7 @@
|
|||||||
<h3 class="title">Login Form</h3>
|
<h3 class="title">Login Form</h3>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-form-item prop="username">
|
<el-form-item prop="username" style="margin-bottom: 20px; margin-top: 20px; background-color: #C5C5C53C ">
|
||||||
<span class="svg-container">
|
<span class="svg-container">
|
||||||
<svg-icon icon-class="user" />
|
<svg-icon icon-class="user" />
|
||||||
</span>
|
</span>
|
||||||
@ -16,7 +21,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-tooltip v-model="capsTooltip" content="Caps lock is On" placement="right" manual>
|
<el-tooltip v-model="capsTooltip" content="Caps lock is On" placement="right" manual>
|
||||||
<el-form-item prop="password">
|
<el-form-item prop="password" style="margin-bottom: 20px; background-color: rgba(197,197,197,0.24)">
|
||||||
<span class="svg-container">
|
<span class="svg-container">
|
||||||
<svg-icon icon-class="password" />
|
<svg-icon icon-class="password" />
|
||||||
</span>
|
</span>
|
||||||
@ -32,15 +37,15 @@
|
|||||||
<el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;" @click.prevent="handleLogin">
|
<el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;" @click.prevent="handleLogin">
|
||||||
Login</el-button>
|
Login</el-button>
|
||||||
|
|
||||||
<div style="position:relative">
|
<div style="position:relative; margin-top: 20px">
|
||||||
<div class="tips">
|
<!-- <div class="tips">-->
|
||||||
<span>Username : admin</span>
|
<!-- <span>Username : admin</span>-->
|
||||||
<span>Password : any</span>
|
<!-- <span>Password : any</span>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
<div class="tips">
|
<!-- <div class="tips">-->
|
||||||
<span style="margin-right:18px;">Username : editor</span>
|
<!-- <span style="margin-right:18px;">Username : editor</span>-->
|
||||||
<span>Password : any</span>
|
<!-- <span>Password : any</span>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
|
|
||||||
<el-button class="thirdparty-button" type="primary" @click="showDialog = true">
|
<el-button class="thirdparty-button" type="primary" @click="showDialog = true">
|
||||||
Or connect with
|
Or connect with
|
||||||
@ -56,10 +61,32 @@
|
|||||||
<social-sign />
|
<social-sign />
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</a-card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="panels-container">
|
||||||
|
<div class="panel left-panel">
|
||||||
|
<div class="content">
|
||||||
|
<h3>加入我们</h3>
|
||||||
|
<p>
|
||||||
|
加入我们,成为团队的一份子。
|
||||||
|
</p>
|
||||||
|
<button class="btn transparent" id="sign-up-btn" @click="SendRegister">
|
||||||
|
去注册
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<!-- <img src="log.svg" class="image" alt="" />-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { validUsername } from '@/utils/validate';
|
// import { validUsername } from '@/utils/validate';
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import SocialSign from './components/SocialSignin.vue';
|
import SocialSign from './components/SocialSignin.vue';
|
||||||
import type { FormItemRule } from 'element-plus';
|
import type { FormItemRule } from 'element-plus';
|
||||||
@ -71,11 +98,11 @@ export default defineComponent({
|
|||||||
components: { SocialSign },
|
components: { SocialSign },
|
||||||
data() {
|
data() {
|
||||||
const validateUsername: FormItemRule['validator'] = (_rule, value, callback) => {
|
const validateUsername: FormItemRule['validator'] = (_rule, value, callback) => {
|
||||||
if (!validUsername(value)) {
|
// if (!validUsername(value)) {
|
||||||
callback(new Error('Please enter the correct user name'));
|
// callback(new Error('Please enter the correct user name'));
|
||||||
} else {
|
// } else {
|
||||||
callback();
|
callback();
|
||||||
}
|
// }
|
||||||
};
|
};
|
||||||
const validatePassword: FormItemRule['validator'] = (_rule, value, callback) => {
|
const validatePassword: FormItemRule['validator'] = (_rule, value, callback) => {
|
||||||
if (value.length < 6) {
|
if (value.length < 6) {
|
||||||
@ -166,6 +193,9 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
return acc;
|
return acc;
|
||||||
}, {});
|
}, {});
|
||||||
|
},
|
||||||
|
SendRegister(){
|
||||||
|
this.$router.push("/register")
|
||||||
}
|
}
|
||||||
// afterQRScan() {
|
// afterQRScan() {
|
||||||
// if (e.key === 'x-admin-oauth-code') {
|
// if (e.key === 'x-admin-oauth-code') {
|
||||||
@ -193,7 +223,7 @@ export default defineComponent({
|
|||||||
/* 修复input 背景不协调 和光标变色 */
|
/* 修复input 背景不协调 和光标变色 */
|
||||||
/* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */
|
/* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */
|
||||||
|
|
||||||
$bg: #283443;
|
$bg: #ffffff;
|
||||||
$light_gray: #fff;
|
$light_gray: #fff;
|
||||||
$cursor: #fff;
|
$cursor: #fff;
|
||||||
|
|
||||||
@ -214,12 +244,12 @@ $cursor: #fff;
|
|||||||
background: transparent;
|
background: transparent;
|
||||||
border: 0px;
|
border: 0px;
|
||||||
-webkit-appearance: none;
|
-webkit-appearance: none;
|
||||||
border-radius: 0px;
|
border-radius: 20px;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
input {
|
input {
|
||||||
padding: 12px 5px 12px 15px;
|
padding: 7px 0px 0px 10px;
|
||||||
color: $light_gray;
|
color: $light_gray;
|
||||||
height: 47px;
|
height: 47px;
|
||||||
caret-color: $cursor;
|
caret-color: $cursor;
|
||||||
@ -233,17 +263,17 @@ $cursor: #fff;
|
|||||||
|
|
||||||
.el-form-item {
|
.el-form-item {
|
||||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||||
background: rgba(0, 0, 0, 0.1);
|
background: rgba(213, 23, 23, 0.1);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
color: #454545;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
$bg: #2d3a4b;
|
$bg: rgba(110, 103, 103, 0.02);
|
||||||
$dark_gray: #889aa4;
|
$dark_gray: #889aa4;
|
||||||
$light_gray: #eee;
|
$light_gray: rgb(64, 158, 255);
|
||||||
|
|
||||||
.login-container {
|
.login-container {
|
||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
@ -255,7 +285,7 @@ $light_gray: #eee;
|
|||||||
position: relative;
|
position: relative;
|
||||||
width: 520px;
|
width: 520px;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
padding: 160px 35px 0;
|
padding: 50px 35px 50px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
@ -286,7 +316,7 @@ $light_gray: #eee;
|
|||||||
.title {
|
.title {
|
||||||
font-size: 26px;
|
font-size: 26px;
|
||||||
color: $light_gray;
|
color: $light_gray;
|
||||||
margin: 0px auto 40px auto;
|
margin: 0px auto 0px auto;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
@ -315,3 +345,270 @@ $light_gray: #eee;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
body,
|
||||||
|
input {
|
||||||
|
font-family: "Poppins", sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.signin-signup {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
left: 75%;
|
||||||
|
width: 50%;
|
||||||
|
transition: 1s 0.7s ease-in-out;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
z-index: 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
width: 150px;
|
||||||
|
background-color: #5995fd;
|
||||||
|
border: none;
|
||||||
|
outline: none;
|
||||||
|
height: 49px;
|
||||||
|
border-radius: 49px;
|
||||||
|
color: #fff;
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-weight: 600;
|
||||||
|
margin: 10px 0;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: 0.5s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn:hover {
|
||||||
|
background-color: #4d84e2;
|
||||||
|
}
|
||||||
|
.panels-container {
|
||||||
|
position: absolute;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
|
}
|
||||||
|
|
||||||
|
.container:before {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
height: 1500px;
|
||||||
|
width: 1500px;
|
||||||
|
top: -10%;
|
||||||
|
right: 48%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
background-image: linear-gradient(-45deg, #4481eb 0%, #04befe 100%);
|
||||||
|
transition: 1.8s ease-in-out;
|
||||||
|
border-radius: 50%;
|
||||||
|
z-index: 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image {
|
||||||
|
width: 100%;
|
||||||
|
transition: transform 1.1s ease-in-out;
|
||||||
|
transition-delay: 0.4s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-end;
|
||||||
|
justify-content: space-around;
|
||||||
|
text-align: center;
|
||||||
|
z-index: 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.left-panel {
|
||||||
|
pointer-events: all;
|
||||||
|
padding: 3rem 17% 2rem 12%;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.panel .content {
|
||||||
|
color: #fff;
|
||||||
|
transition: transform 0.9s ease-in-out;
|
||||||
|
transition-delay: 0.6s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel h3 {
|
||||||
|
font-weight: 600;
|
||||||
|
line-height: 1;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel p {
|
||||||
|
font-size: 0.95rem;
|
||||||
|
padding: 0.7rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn.transparent {
|
||||||
|
margin: 0;
|
||||||
|
background: none;
|
||||||
|
border: 2px solid #fff;
|
||||||
|
width: 130px;
|
||||||
|
height: 41px;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right-panel .image,
|
||||||
|
.right-panel .content {
|
||||||
|
transform: translateX(800px);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ANIMATION */
|
||||||
|
|
||||||
|
.container.sign-up-mode .left-panel .image,
|
||||||
|
.container.sign-up-mode .left-panel .content {
|
||||||
|
transform: translateX(-800px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.container.sign-up-mode .signin-signup {
|
||||||
|
left: 25%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container.sign-up-mode form.sign-in-form {
|
||||||
|
opacity: 0;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container.sign-up-mode .right-panel .image,
|
||||||
|
.container.sign-up-mode .right-panel .content {
|
||||||
|
transform: translateX(0%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.container.sign-up-mode .left-panel {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@media (max-width: 870px) {
|
||||||
|
.container {
|
||||||
|
min-height: 800px;
|
||||||
|
height: 100vh;
|
||||||
|
}
|
||||||
|
.signin-signup {
|
||||||
|
width: 100%;
|
||||||
|
top: 95%;
|
||||||
|
transform: translate(-50%, -100%);
|
||||||
|
transition: 1s 0.8s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.signin-signup,
|
||||||
|
.container.sign-up-mode .signin-signup {
|
||||||
|
left: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panels-container {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
grid-template-rows: 1fr 2fr 1fr;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel {
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-around;
|
||||||
|
align-items: center;
|
||||||
|
padding: 2.5rem 8%;
|
||||||
|
grid-column: 1 / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.left-panel {
|
||||||
|
grid-row: 1 / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image {
|
||||||
|
width: 200px;
|
||||||
|
transition: transform 0.9s ease-in-out;
|
||||||
|
transition-delay: 0.6s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel .content {
|
||||||
|
padding-right: 15%;
|
||||||
|
transition: transform 0.9s ease-in-out;
|
||||||
|
transition-delay: 0.8s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel h3 {
|
||||||
|
font-size: 1.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel p {
|
||||||
|
font-size: 0.7rem;
|
||||||
|
padding: 0.5rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn.transparent {
|
||||||
|
width: 110px;
|
||||||
|
height: 35px;
|
||||||
|
font-size: 0.7rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container:before {
|
||||||
|
width: 1500px;
|
||||||
|
height: 1500px;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
left: 30%;
|
||||||
|
bottom: 68%;
|
||||||
|
right: initial;
|
||||||
|
top: initial;
|
||||||
|
transition: 2s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.container.sign-up-mode .left-panel .image,
|
||||||
|
.container.sign-up-mode .left-panel .content {
|
||||||
|
transform: translateY(-300px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.container.sign-up-mode .right-panel .image,
|
||||||
|
.container.sign-up-mode .right-panel .content {
|
||||||
|
transform: translateY(0px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.right-panel .image,
|
||||||
|
.right-panel .content {
|
||||||
|
transform: translateY(300px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.container.sign-up-mode .signin-signup {
|
||||||
|
top: 5%;
|
||||||
|
transform: translate(-50%, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 570px) {
|
||||||
|
form {
|
||||||
|
padding: 0 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.panel .content {
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
}
|
||||||
|
.container {
|
||||||
|
padding: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container:before {
|
||||||
|
bottom: 72%;
|
||||||
|
left: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
3
src/views/personal/project/charge.vue
Normal file
3
src/views/personal/project/charge.vue
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<template>
|
||||||
|
hello
|
||||||
|
</template>
|
124
src/views/personal/project/manage.vue
Normal file
124
src/views/personal/project/manage.vue
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
<template>
|
||||||
|
<div style=" width:100%">
|
||||||
|
<el-card style="max-width: 100vw;margin: 1.5vw;">
|
||||||
|
<template #header><strong >项目1</strong></template>
|
||||||
|
<div style="display:flex;flex-direction:row;justify-content: space-around ">
|
||||||
|
<div>
|
||||||
|
名称
|
||||||
|
<el-input v-model="input" style="width: 240px;margin-left:0.5vw" placeholder="请输入" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
状态
|
||||||
|
<el-input v-model="input" style="width: 240px;margin-left:0.5vw" placeholder="请输入" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<el-button type="primary" style="width:80px">查询</el-button>
|
||||||
|
<el-button style="width:80px">重置</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
<el-card style="max-width: 100vw;height:60vh;margin:1.3vw">
|
||||||
|
<div style="display:flex;flex-direction: row;justify-content: space-between">
|
||||||
|
<el-button
|
||||||
|
text
|
||||||
|
type=''
|
||||||
|
>子系统列表</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
ref="multipleTableRef"
|
||||||
|
:data="tableData"
|
||||||
|
style="max-width: 100vw;"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<!-- <el-table-column type="selection" width="55" />-->
|
||||||
|
<el-table-column label="序号" width="120">
|
||||||
|
<template #default="scope">{{ scope.row.date }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column property="name" label="子系统名称" width="120" />
|
||||||
|
<el-table-column property="address" label="工作量" show-overflow-tooltip />
|
||||||
|
<el-table-column property="address" label="周期" />
|
||||||
|
<el-table-column property="address" label="负责人" />
|
||||||
|
<el-table-column property="address" label="状态" />
|
||||||
|
<el-table-column property="address" label="子系统简介" />
|
||||||
|
<el-table-column property="address" label="截止时间" />
|
||||||
|
<el-table-column property="address" label="操作" >
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
style="color:deepskyblue"
|
||||||
|
>查看详情</el-button
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-pagination
|
||||||
|
larger
|
||||||
|
background
|
||||||
|
layout="prev, pager, next"
|
||||||
|
:total="50"
|
||||||
|
class="mt-4"
|
||||||
|
style="display: flex;flex-direction: row;justify-content: center;margin-top:5vh"
|
||||||
|
/>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { ElTable } from 'element-plus';
|
||||||
|
interface User {
|
||||||
|
date: string
|
||||||
|
name: string
|
||||||
|
address: string
|
||||||
|
}
|
||||||
|
|
||||||
|
const multipleTableRef = ref<InstanceType<typeof ElTable>>();
|
||||||
|
const multipleSelection = ref<User[]>([]);
|
||||||
|
|
||||||
|
const handleSelectionChange = (val: User[]) => {
|
||||||
|
multipleSelection.value = val;
|
||||||
|
};
|
||||||
|
|
||||||
|
const tableData: User[] = [
|
||||||
|
{
|
||||||
|
date: '2016-05-03',
|
||||||
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: '2016-05-02',
|
||||||
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: '2016-05-04',
|
||||||
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: '2016-05-01',
|
||||||
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles'
|
||||||
|
}
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
.my-autocomplete li {
|
||||||
|
line-height: normal;
|
||||||
|
padding: 7px;
|
||||||
|
}
|
||||||
|
.my-autocomplete li .name {
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.my-autocomplete li .addr {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #b4b4b4;
|
||||||
|
}
|
||||||
|
.my-autocomplete li .highlighted .addr {
|
||||||
|
color: #ddd;
|
||||||
|
}
|
||||||
|
</style>
|
3
src/views/personal/project/participate.vue
Normal file
3
src/views/personal/project/participate.vue
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<template>
|
||||||
|
hi
|
||||||
|
</template>
|
Loading…
x
Reference in New Issue
Block a user