Skip to content

Commit

Permalink
docs(test): add test
Browse files Browse the repository at this point in the history
  • Loading branch information
梵音 authored and 梵音 committed May 5, 2022
1 parent b142795 commit bfe5d26
Show file tree
Hide file tree
Showing 10 changed files with 300 additions and 21 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<link rel="stylesheet" href="//at.alicdn.com/t/font_3289955_zcjv91nt0w.css" />
<link rel="stylesheet" href="//at.alicdn.com/t/font_3289955_3r7vim9xrwi.css" />
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@500&display=swap" rel="stylesheet" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title></title>
<title>通行扫码</title>
</head>

<body>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Icon/src/Icon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @Autor: YDKD
* @Date: 2022-03-28 15:08:36
* @LastEditors: YDKD
* @LastEditTime: 2022-04-12 15:53:27
* @LastEditTime: 2022-05-05 18:07:54
-->
<template>
<ElIcon :class="prefixCls" :size="size" :color="color">
Expand Down Expand Up @@ -32,7 +32,7 @@ const props = defineProps({
})

const iconfontSize = computed(() => {
return props.size > 16 ? '2.4rem' : '20px'
return props.size + 'px'
})
</script>

Expand Down
11 changes: 9 additions & 2 deletions src/permission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @Autor: YDKD
* @Date: 2022-03-20 08:41:57
* @LastEditors: YDKD
* @LastEditTime: 2022-03-30 15:14:29
* @LastEditTime: 2022-05-05 22:09:26
*/
import { getRoutes } from './api/getApi'
import { useNProgress, useTitle, useCache } from './hooks'
Expand All @@ -20,7 +20,14 @@ const permissionStore = usePermissionStoreWithOut()

const { storageCache } = useCache()

const whiteRouteList = ['/login', '/register', '/reset-pass', '/test']
const whiteRouteList = [
'/login',
'/register',
'/reset-pass',
'/test-1',
'/test-2',
'/test-3'
]

router.beforeEach(async (to, from, next) => {
start()
Expand Down
21 changes: 21 additions & 0 deletions src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,27 @@ const routes: RouteRecordRaw[] = [
title: '登录'
}
},
{
path: '/test-1',
component: () => import('@/views/test/index.vue'),
meta: {
title: '通行扫码'
}
},
{
path: '/test-2',
component: () => import('@/views/test/a.vue'),
meta: {
title: '通行扫码'
}
},
{
path: '/test-3',
component: () => import('@/views/test/b.vue'),
meta: {
title: '通行扫码'
}
},
{
path: '/register',
component: () => import('@/views/register/index.vue'),
Expand Down
60 changes: 60 additions & 0 deletions src/views/test/a.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<template>
<div :class="prefix">
<div class="content">
<div class="label">姓名:张欣悦</div>
<div class="label">学号:1841013310</div>
<div class="label">学院:艺术与科技学院</div>
<div class="label">辅导员:刘婷婷</div>
<div class="icon">
<icon-src-icon
icon="icon-gougou1"
type="iconfont"
:size="120"
></icon-src-icon>
</div>
<div class="txt">通行</div>
<div class="tips">注意:请在请假时间范围内扫码</div>
</div>
</div>
</template>

<script lang="ts" setup>
import { useDesign } from '@/hooks'
const prefix = useDesign('prefix', 'tong-xing')
</script>

<style lang="less" scoped>
@prefix-cls: ~'@{namespace}-tong-xing';
.@{prefix-cls} {
width: 100%;
height: 100%;
background-color: #2ba667;
display: flex;
justify-content: center;
align-items: center;
color: #444444bb;
font-size: 18px;
.content {
background-color: #fff;
border-radius: 15px;
padding: 3% 10%;
margin-bottom: 20%;
.label {
margin-left: 20%;
}
.icon {
text-align: center;
margin: 2.5rem 0;
}
.txt {
color: #2ba667;
font-size: 3rem;
font-weight: 700;
text-align: center;
margin: 3rem 0;
}
}
}
</style>
60 changes: 60 additions & 0 deletions src/views/test/b.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<template>
<div :class="prefix">
<div class="content">
<div class="label">姓名:张婷菡</div>
<div class="label">学号:184101221</div>
<div class="label">学院:艺术与科技学院</div>
<div class="label">辅导员:刘婷婷</div>
<div class="icon">
<icon-src-icon
icon="icon-gougou1"
type="iconfont"
:size="120"
></icon-src-icon>
</div>
<div class="txt">通行</div>
<div class="tips">注意:请在请假时间范围内扫码</div>
</div>
</div>
</template>

<script lang="ts" setup>
import { useDesign } from '@/hooks'
const prefix = useDesign('prefix', 'tong-xing')
</script>

<style lang="less" scoped>
@prefix-cls: ~'@{namespace}-tong-xing';
.@{prefix-cls} {
width: 100%;
height: 100%;
background-color: #2ba667;
display: flex;
justify-content: center;
align-items: center;
color: #444444bb;
font-size: 18px;
.content {
background-color: #fff;
border-radius: 15px;
padding: 3% 10%;
margin-bottom: 20%;
.label {
margin-left: 20%;
}
.icon {
text-align: center;
margin: 2.5rem 0;
}
.txt {
color: #2ba667;
font-size: 3rem;
font-weight: 700;
text-align: center;
margin: 3rem 0;
}
}
}
</style>
60 changes: 60 additions & 0 deletions src/views/test/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<template>
<div :class="prefix">
<div class="content">
<div class="label">姓名:魏畅</div>
<div class="label">学号:1841013421</div>
<div class="label">学院:艺术与科技学院</div>
<div class="label">辅导员:刘婷婷</div>
<div class="icon">
<icon-src-icon
icon="icon-gougou1"
type="iconfont"
:size="120"
></icon-src-icon>
</div>
<div class="txt">通行</div>
<div class="tips">注意:请在请假时间范围内扫码</div>
</div>
</div>
</template>

<script lang="ts" setup>
import { useDesign } from '@/hooks'
const prefix = useDesign('prefix', 'tong-xing')
</script>

<style lang="less" scoped>
@prefix-cls: ~'@{namespace}-tong-xing';
.@{prefix-cls} {
width: 100%;
height: 100%;
background-color: #2ba667;
display: flex;
justify-content: center;
align-items: center;
color: #444444bb;
font-size: 18px;
.content {
background-color: #fff;
border-radius: 15px;
padding: 3% 10%;
margin-bottom: 20%;
.label {
margin-left: 20%;
}
.icon {
text-align: center;
margin: 2.5rem 0;
}
.txt {
color: #2ba667;
font-size: 3rem;
font-weight: 700;
text-align: center;
margin: 3rem 0;
}
}
}
</style>
84 changes: 84 additions & 0 deletions test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
* {
margin: 0;
padding: 0;
}

body {
height: 100vh;
}

.tong-xing {
width: 100%;
height: 100%;
background-color: #2ba667;
display: flex;
justify-content: center;
align-items: center;
color: #444444bb;
font-size: 18px;
}

.content {
background-color: #fff;
border-radius: 15px;
padding: 3% 5%;
margin-bottom: 20%;
width: 300px;
}

.label {
margin-left: 20%;
padding: 2px 0;
}

.icon {
text-align: center;
}

.txt {
color: #2ba667;
font-size: 4rem;
font-weight: 700;
text-align: center;
margin-bottom: 3rem;
margin-top: 2rem;
}

.tips {
font-size: 16px;
text-align: center;
}
</style>
<title>通行扫码</title>
</head>

<body>
<div class="tong-xing">
<div class="content">
<div class="label">姓名:魏畅</div>
<div class="label">学号:1941010517</div>
<div class="label">学院:艺术与科技学院</div>
<div class="label">辅导员:刘婷婷</div>
<div class="icon">
<svg t="1651756369921" class="icon" viewBox="0 0 1500 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
p-id="1380" width="180" height="180">
<path
d="M2.476482 537.450909 177.781392 341.35512C177.781392 341.35512 214.130463 328.753957 244.406708 347.49788L569.027929 605.966305C569.027929 605.966305 611.294369 629.197749 647.466245 599.823545L1256.544491 16.261378C1256.544491 16.261378 1295.414456-14.417926 1326.949967 11.063659L1491.386917 176.445649C1491.386917 176.445649 1509.828899 203.588141 1487.134237 227.950326L678.652563 1006.190722C678.652563 1006.190722 639.309605 1045.956113 578.950849 1003.355602L11.926881 568.164707C11.926881 568.164707-3.94979 552.015392 2.476482 537.450909Z"
fill="#2ba667" p-id="1381"></path>
</svg>
</div>
<div class="txt">通行</div>
<div class="tips">注意:请在请假时间范围内扫码</div>
</div>
</div>
</body>

</html>
14 changes: 0 additions & 14 deletions types/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,17 @@ declare module 'vue' {
ElAside: typeof import('element-plus/es')['ElAside']
ElAvatar: typeof import('element-plus/es')['ElAvatar']
ElButton: typeof import('element-plus/es')['ElButton']
ElCard: typeof import('element-plus/es')['ElCard']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCol: typeof import('element-plus/es')['ElCol']
ElContainer: typeof import('element-plus/es')['ElContainer']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
ElDropdown: typeof import('element-plus/es')['ElDropdown']
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
ElForm: typeof import('element-plus/es')['ElForm']
'ElForm\u02DD': typeof import('element-plus/es')['ElForm\u02DD']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElHeader: typeof import('element-plus/es')['ElHeader']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElInput: typeof import('element-plus/es')['ElInput']
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
ElMain: typeof import('element-plus/es')['ElMain']
ElNumberInput: typeof import('element-plus/es')['ElNumberInput']
ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElRow: typeof import('element-plus/es')['ElRow']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElSkeleton: typeof import('element-plus/es')['ElSkeleton']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
FossBg: typeof import('./../src/components/foss-bg/index.vue')['default']
HeaderSrcHeader: typeof import('./../src/components/Header/src/Header.vue')['default']
IconSrcIcon: typeof import('./../src/components/Icon/src/Icon.vue')['default']
Expand Down
Loading

0 comments on commit bfe5d26

Please sign in to comment.