zsysview 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -0,0 +1 @@
1
+ # ZSystem前端
package/core/app.ts ADDED
@@ -0,0 +1,13 @@
1
+ import { createApp } from 'vue'
2
+ import '../css/style.css'
3
+ import app from '../view/app.vue'
4
+
5
+ import ElementPlus from 'element-plus' //导入 ElementPlus 组件库的所有模块和功能
6
+ import 'element-plus/dist/index.css' //导入 ElementPlus 组件库所需的全局 CSS 样式
7
+ import zhCn from 'element-plus/es/locale/lang/zh-cn'
8
+
9
+ const zsysapp=createApp(app)
10
+
11
+ zsysapp.mount('#app')
12
+
13
+ export default zsysapp
package/css/style.css ADDED
@@ -0,0 +1,79 @@
1
+ :root {
2
+ font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
3
+ line-height: 1.5;
4
+ font-weight: 400;
5
+
6
+ color-scheme: light dark;
7
+ color: rgba(255, 255, 255, 0.87);
8
+ background-color: #242424;
9
+
10
+ font-synthesis: none;
11
+ text-rendering: optimizeLegibility;
12
+ -webkit-font-smoothing: antialiased;
13
+ -moz-osx-font-smoothing: grayscale;
14
+ }
15
+
16
+ a {
17
+ font-weight: 500;
18
+ color: #646cff;
19
+ text-decoration: inherit;
20
+ }
21
+ a:hover {
22
+ color: #535bf2;
23
+ }
24
+
25
+ body {
26
+ margin: 0;
27
+ display: flex;
28
+ place-items: center;
29
+ min-width: 320px;
30
+ min-height: 100vh;
31
+ }
32
+
33
+ h1 {
34
+ font-size: 3.2em;
35
+ line-height: 1.1;
36
+ }
37
+
38
+ button {
39
+ border-radius: 8px;
40
+ border: 1px solid transparent;
41
+ padding: 0.6em 1.2em;
42
+ font-size: 1em;
43
+ font-weight: 500;
44
+ font-family: inherit;
45
+ background-color: #1a1a1a;
46
+ cursor: pointer;
47
+ transition: border-color 0.25s;
48
+ }
49
+ button:hover {
50
+ border-color: #646cff;
51
+ }
52
+ button:focus,
53
+ button:focus-visible {
54
+ outline: 4px auto -webkit-focus-ring-color;
55
+ }
56
+
57
+ .card {
58
+ padding: 2em;
59
+ }
60
+
61
+ #app {
62
+ max-width: 1280px;
63
+ margin: 0 auto;
64
+ padding: 2rem;
65
+ text-align: center;
66
+ }
67
+
68
+ @media (prefers-color-scheme: light) {
69
+ :root {
70
+ color: #213547;
71
+ background-color: #ffffff;
72
+ }
73
+ a:hover {
74
+ color: #747bff;
75
+ }
76
+ button {
77
+ background-color: #f9f9f9;
78
+ }
79
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zsysview",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "zsystem view",
5
5
  "author": {
6
6
  "name": "liuhaomiao"
package/view/app.vue ADDED
@@ -0,0 +1,11 @@
1
+ <script setup lang="ts">
2
+ // import HelloWorld from './components/HelloWorld.vue'
3
+ </script>
4
+
5
+ <template>
6
+ <router-view />
7
+ </template>
8
+
9
+ <style scoped>
10
+
11
+ </style>
package/view/login.vue ADDED
@@ -0,0 +1,91 @@
1
+ <template>
2
+ <div class="bg">
3
+ <el-card style="width: 300px;text-align: center;" shadow="always" class="align-center">
4
+ <template #header>
5
+ <div class="card-header" style="">
6
+ <span>岗位行为识别系统</span>
7
+ </div>
8
+ </template>
9
+ <!-- <el-avatar shape="square" size="large" /> -->
10
+ <el-image style="height: 100px" :src="logoUrl" />
11
+ <el-form label-width="auto" label-position="top">
12
+ <el-form-item label="用户名" >
13
+ <el-input size="large" :autofocus="true" v-model="d.u" clearable @keyup.enter.native="ToPasswordInput"/>
14
+ </el-form-item>
15
+ <el-form-item label="密码" >
16
+ <el-input ref="PasswordInput" size="large" v-model="d.p" clearable show-password @keyup.enter.native="login"/>
17
+ </el-form-item>
18
+ <el-form-item>
19
+ <el-button type="primary" size="large" :loading="view.loading" @click="login" style="width: 100%;">登录</el-button>
20
+ </el-form-item>
21
+ </el-form>
22
+ </el-card>
23
+ </div>
24
+ </template>
25
+
26
+ <script setup lang="ts">
27
+ import { reactive} from 'vue'
28
+ import { ZSYSMessage } from '../../utils/zsys_message';
29
+ import {useRoute, useRouter} from "vue-router";
30
+ import { Md5 } from 'ts-md5'
31
+ import { HttpApiV1 as http } from '../../httpapi/http_api_v1';
32
+ import logoUrl from '../../assets/logo_100.png';
33
+
34
+ const r=useRouter()
35
+ const route=useRoute()
36
+ const d=reactive({
37
+ u:'admin',
38
+ p:'123'
39
+ })
40
+
41
+ const view=reactive({
42
+ loading:false
43
+ })
44
+
45
+ const ToPasswordInput=()=>{
46
+ // if (proxy!=null){
47
+ // proxy.$refs.PasswordInput.focus()
48
+ // }
49
+ }
50
+
51
+ // 登录
52
+ const login = () => {
53
+ view.loading=true
54
+ let data={
55
+ u:d.u,
56
+ p:Md5.hashStr(d.p)
57
+ }
58
+
59
+ http.Post(http.url_login,data).then(res=>{
60
+ if(res.IsSuccess){
61
+ ZSYSMessage.ShowSuccess('登录成功')
62
+ r.push((route.query.redirect as string) || '/desktop')
63
+ }else{
64
+ ZSYSMessage.ShowError(res.message)
65
+ }
66
+
67
+ }).catch(()=>{
68
+ console.log('请求失败')
69
+ ZSYSMessage.ShowError('登录服务器失败')
70
+ // ElMessage({type: 'error',message: '登录服务器失败'})
71
+ }).finally(()=>{
72
+ view.loading=false
73
+ })
74
+ }
75
+
76
+
77
+ </script>
78
+
79
+ <style scoped>
80
+ .bg{
81
+ display: flex;
82
+ justify-content: center;
83
+ align-items: center;
84
+ background-image: url("/src/assets/zsys/login/bg.jpg");
85
+ background-size: cover;
86
+ background-position: center;
87
+ width: 100%;
88
+ height: 100%;
89
+ }
90
+
91
+ </style>