vue2-client 1.2.41 → 1.2.44
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/CHANGELOG.md +12 -1
- package/package.json +1 -1
- package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +555 -0
- package/src/base-client/components/common/XAddForm/XAddForm.vue +2 -1
- package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +316 -315
- package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +1 -1
- package/src/components/menu/SideMenu.vue +1 -1
- package/src/config/default/setting.config.js +3 -1
- package/src/layouts/SinglePageView.vue +10 -1
- package/src/layouts/header/AdminHeader.vue +1 -1
- package/src/layouts/tabs/TabsView.vue +56 -40
- package/src/pages/exception/403.vue +21 -25
- package/src/pages/exception/404.vue +21 -25
- package/src/pages/exception/500.vue +21 -25
- package/src/pages/login/Login.vue +194 -201
- package/src/pages/system/ticket/index.vue +1 -1
- package/src/store/modules/account.js +2 -2
- package/src/theme/default/style.less +14 -0
- package/vue.config.js +143 -143
|
@@ -1,201 +1,194 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<common-layout>
|
|
3
|
-
<div class="top">
|
|
4
|
-
<div class="header">
|
|
5
|
-
<img alt="logo" class="logo" src="
|
|
6
|
-
<span class="title">{{ systemName }}</span>
|
|
7
|
-
</div>
|
|
8
|
-
<div class="desc">{{ systemDesc }}</div>
|
|
9
|
-
</div>
|
|
10
|
-
<div class="login">
|
|
11
|
-
<a-form @submit="onSubmit" :form="form">
|
|
12
|
-
<a-tabs size="large" :tabBarStyle="{textAlign: 'center'}" style="padding: 0 2px;">
|
|
13
|
-
<a-tab-pane tab="账户密码登录" key="1">
|
|
14
|
-
<a-alert
|
|
15
|
-
type="error"
|
|
16
|
-
:closable="true"
|
|
17
|
-
v-show="error"
|
|
18
|
-
:message="error"
|
|
19
|
-
showIcon
|
|
20
|
-
style="margin-bottom: 24px;" />
|
|
21
|
-
<a-form-item>
|
|
22
|
-
<a-input
|
|
23
|
-
autocomplete="autocomplete"
|
|
24
|
-
size="large"
|
|
25
|
-
placeholder="admin"
|
|
26
|
-
v-decorator="['name', {rules: [{ required: true, message: '请输入账户名', whitespace: true}]}]"
|
|
27
|
-
>
|
|
28
|
-
<a-icon slot="prefix" type="user" />
|
|
29
|
-
</a-input>
|
|
30
|
-
</a-form-item>
|
|
31
|
-
<a-form-item>
|
|
32
|
-
<a-input
|
|
33
|
-
size="large"
|
|
34
|
-
placeholder="888888"
|
|
35
|
-
autocomplete="autocomplete"
|
|
36
|
-
type="password"
|
|
37
|
-
v-decorator="['password', {rules: [{ required: true, message: '请输入密码', whitespace: true}]}]"
|
|
38
|
-
>
|
|
39
|
-
<a-icon slot="prefix" type="lock" />
|
|
40
|
-
</a-input>
|
|
41
|
-
</a-form-item>
|
|
42
|
-
</a-tab-pane>
|
|
43
|
-
</a-tabs>
|
|
44
|
-
<div>
|
|
45
|
-
<a-checkbox :checked="true" >自动登录</a-checkbox>
|
|
46
|
-
</div>
|
|
47
|
-
<a-form-item>
|
|
48
|
-
<a-button :loading="logging" style="width: 100%;margin-top: 24px" size="large" htmlType="submit" type="primary">登录</a-button>
|
|
49
|
-
</a-form-item>
|
|
50
|
-
</a-form>
|
|
51
|
-
</div>
|
|
52
|
-
</common-layout>
|
|
53
|
-
</template>
|
|
54
|
-
|
|
55
|
-
<script>
|
|
56
|
-
import CommonLayout from '@vue2-client/layouts/CommonLayout'
|
|
57
|
-
import { getRoutesConfig, login } from '@vue2-client/services/user'
|
|
58
|
-
import { setAuthorization } from '@vue2-client/utils/request'
|
|
59
|
-
import { loadRoutes, funcToRouter } from '@vue2-client/utils/routerUtil'
|
|
60
|
-
import { mapMutations } from 'vuex'
|
|
61
|
-
import JSEncrypt from 'jsencrypt'
|
|
62
|
-
import { ACCESS_TOKEN } from '@vue2-client/store/mutation-types'
|
|
63
|
-
import Vue from 'vue'
|
|
64
|
-
import { positions } from '@vue2-client/mock/common'
|
|
65
|
-
import { timeFix } from '@vue2-client/utils/util'
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
&:hover {
|
|
196
|
-
color: @primary-color;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<common-layout>
|
|
3
|
+
<div class="top">
|
|
4
|
+
<div class="header">
|
|
5
|
+
<img alt="logo" class="logo" src="@vue2-client/assets/img/logo.png" />
|
|
6
|
+
<span class="title">{{ systemName }}</span>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="desc">{{ systemDesc }}</div>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="login">
|
|
11
|
+
<a-form @submit="onSubmit" :form="form">
|
|
12
|
+
<a-tabs size="large" :tabBarStyle="{textAlign: 'center'}" style="padding: 0 2px;">
|
|
13
|
+
<a-tab-pane tab="账户密码登录" key="1">
|
|
14
|
+
<a-alert
|
|
15
|
+
type="error"
|
|
16
|
+
:closable="true"
|
|
17
|
+
v-show="error"
|
|
18
|
+
:message="error"
|
|
19
|
+
showIcon
|
|
20
|
+
style="margin-bottom: 24px;" />
|
|
21
|
+
<a-form-item>
|
|
22
|
+
<a-input
|
|
23
|
+
autocomplete="autocomplete"
|
|
24
|
+
size="large"
|
|
25
|
+
placeholder="admin"
|
|
26
|
+
v-decorator="['name', {rules: [{ required: true, message: '请输入账户名', whitespace: true}]}]"
|
|
27
|
+
>
|
|
28
|
+
<a-icon slot="prefix" type="user" />
|
|
29
|
+
</a-input>
|
|
30
|
+
</a-form-item>
|
|
31
|
+
<a-form-item>
|
|
32
|
+
<a-input
|
|
33
|
+
size="large"
|
|
34
|
+
placeholder="888888"
|
|
35
|
+
autocomplete="autocomplete"
|
|
36
|
+
type="password"
|
|
37
|
+
v-decorator="['password', {rules: [{ required: true, message: '请输入密码', whitespace: true}]}]"
|
|
38
|
+
>
|
|
39
|
+
<a-icon slot="prefix" type="lock" />
|
|
40
|
+
</a-input>
|
|
41
|
+
</a-form-item>
|
|
42
|
+
</a-tab-pane>
|
|
43
|
+
</a-tabs>
|
|
44
|
+
<div>
|
|
45
|
+
<a-checkbox :checked="true" >自动登录</a-checkbox>
|
|
46
|
+
</div>
|
|
47
|
+
<a-form-item>
|
|
48
|
+
<a-button :loading="logging" style="width: 100%;margin-top: 24px" size="large" htmlType="submit" type="primary">登录</a-button>
|
|
49
|
+
</a-form-item>
|
|
50
|
+
</a-form>
|
|
51
|
+
</div>
|
|
52
|
+
</common-layout>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<script>
|
|
56
|
+
import CommonLayout from '@vue2-client/layouts/CommonLayout'
|
|
57
|
+
import { getRoutesConfig, login } from '@vue2-client/services/user'
|
|
58
|
+
import { setAuthorization } from '@vue2-client/utils/request'
|
|
59
|
+
import { loadRoutes, funcToRouter } from '@vue2-client/utils/routerUtil'
|
|
60
|
+
import { mapMutations, mapState } from 'vuex'
|
|
61
|
+
import JSEncrypt from 'jsencrypt'
|
|
62
|
+
import { ACCESS_TOKEN } from '@vue2-client/store/mutation-types'
|
|
63
|
+
import Vue from 'vue'
|
|
64
|
+
import { positions } from '@vue2-client/mock/common'
|
|
65
|
+
import { timeFix } from '@vue2-client/utils/util'
|
|
66
|
+
|
|
67
|
+
export default {
|
|
68
|
+
name: 'Login',
|
|
69
|
+
components: { CommonLayout },
|
|
70
|
+
data () {
|
|
71
|
+
return {
|
|
72
|
+
logging: false,
|
|
73
|
+
error: '',
|
|
74
|
+
form: this.$form.createForm(this)
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
computed: {
|
|
78
|
+
...mapState('setting', ['systemName', 'systemDesc', 'homePage', 'ticketPage'])
|
|
79
|
+
},
|
|
80
|
+
methods: {
|
|
81
|
+
...mapMutations('account', ['setUser', 'setPermissions', 'setRoles']),
|
|
82
|
+
onSubmit (e) {
|
|
83
|
+
e.preventDefault()
|
|
84
|
+
this.form.validateFields((err) => {
|
|
85
|
+
if (!err) {
|
|
86
|
+
this.logging = true
|
|
87
|
+
const name = this.form.getFieldValue('name')
|
|
88
|
+
const password = this.form.getFieldValue('password')
|
|
89
|
+
login(name, password).then(this.afterLogin)
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
},
|
|
93
|
+
afterLogin (res) {
|
|
94
|
+
const name = this.form.getFieldValue('name')
|
|
95
|
+
const password = this.form.getFieldValue('password')
|
|
96
|
+
this.logging = false
|
|
97
|
+
const loginRes = res.states
|
|
98
|
+
if (loginRes === '登录成功') {
|
|
99
|
+
const encrypt = new JSEncrypt()
|
|
100
|
+
encrypt.setPublicKey('MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqPvovSfXcwBbW8cKMCgwqNpsYuzF8RPAPFb7LGsnVo44JhM/xxzDyzoYtdfNmtbIuKVi9PzIsyp6rg+09gbuI6UGwBZ5DWBDBMqv5MPdOF5dCQkB2Bbr5yPfURPENypUz+pBFBg41d+BC+rwRiXELwKy7Y9caD/MtJyHydj8OUwIDAQAB')
|
|
101
|
+
const data = encrypt.encrypt(JSON.stringify({ username: name, password: password }))
|
|
102
|
+
localStorage.setItem(ACCESS_TOKEN, data)
|
|
103
|
+
// 获取路由配置
|
|
104
|
+
getRoutesConfig(data).then(result => {
|
|
105
|
+
Vue.$login.login(result).then(() => {
|
|
106
|
+
const user = Object.assign({
|
|
107
|
+
username: result.ename,
|
|
108
|
+
name: result.name,
|
|
109
|
+
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/jZUIxmJycoymBprLOUbT.png',
|
|
110
|
+
address: '西安市',
|
|
111
|
+
position: positions[0]
|
|
112
|
+
}, result)
|
|
113
|
+
this.setUser(user)
|
|
114
|
+
this.setPermissions([{ id: 'queryForm', operation: ['add', 'edit'] }])
|
|
115
|
+
this.setRoles([{ id: 'admin', operation: ['add', 'edit', 'delete'] }])
|
|
116
|
+
let timestamp = new Date().getTime()// 当前的时间戳
|
|
117
|
+
timestamp = timestamp + 60 * 60 * 1000
|
|
118
|
+
// 格式化时间获取年月日, 登陆过期时间
|
|
119
|
+
const dateAfter = new Date(timestamp)
|
|
120
|
+
setAuthorization({ token: data, expireAt: dateAfter })
|
|
121
|
+
loadRoutes(funcToRouter(user.functions))
|
|
122
|
+
if (result.deps === '用户工单登记') {
|
|
123
|
+
this.$router.push(this.ticketPage).catch(() => {})
|
|
124
|
+
} else {
|
|
125
|
+
this.$router.push(this.homePage).catch(() => {})
|
|
126
|
+
}
|
|
127
|
+
this.$message.success(timeFix().CN + ',欢迎回来', 3)
|
|
128
|
+
})
|
|
129
|
+
})
|
|
130
|
+
} else {
|
|
131
|
+
this.error = loginRes
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
</script>
|
|
137
|
+
|
|
138
|
+
<style lang="less" scoped>
|
|
139
|
+
.common-layout{
|
|
140
|
+
.top {
|
|
141
|
+
text-align: center;
|
|
142
|
+
.header {
|
|
143
|
+
height: 44px;
|
|
144
|
+
line-height: 44px;
|
|
145
|
+
a {
|
|
146
|
+
text-decoration: none;
|
|
147
|
+
}
|
|
148
|
+
.logo {
|
|
149
|
+
height: 44px;
|
|
150
|
+
vertical-align: top;
|
|
151
|
+
margin-right: 16px;
|
|
152
|
+
}
|
|
153
|
+
.title {
|
|
154
|
+
font-size: 33px;
|
|
155
|
+
color: @title-color;
|
|
156
|
+
font-family: 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
|
157
|
+
font-weight: 600;
|
|
158
|
+
position: relative;
|
|
159
|
+
top: 2px;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
.desc {
|
|
163
|
+
font-size: 14px;
|
|
164
|
+
color: @text-color-second;
|
|
165
|
+
margin-top: 12px;
|
|
166
|
+
margin-bottom: 40px;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
.login{
|
|
170
|
+
width: 368px;
|
|
171
|
+
margin: 0 auto;
|
|
172
|
+
@media screen and (max-width: 576px) {
|
|
173
|
+
width: 95%;
|
|
174
|
+
}
|
|
175
|
+
@media screen and (max-width: 320px) {
|
|
176
|
+
.captcha-button{
|
|
177
|
+
font-size: 14px;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
.icon {
|
|
181
|
+
font-size: 24px;
|
|
182
|
+
color: @text-color-second;
|
|
183
|
+
margin-left: 16px;
|
|
184
|
+
vertical-align: middle;
|
|
185
|
+
cursor: pointer;
|
|
186
|
+
transition: color 0.3s;
|
|
187
|
+
|
|
188
|
+
&:hover {
|
|
189
|
+
color: @primary-color;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
</style>
|
|
@@ -239,7 +239,7 @@
|
|
|
239
239
|
|
|
240
240
|
<script>
|
|
241
241
|
import { TicketDetailsViewApi, post } from '@vue2-client/services/api'
|
|
242
|
-
import { logout } from '
|
|
242
|
+
import { logout } from '@vue2-client/services/user'
|
|
243
243
|
import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
|
|
244
244
|
import Vue from 'vue'
|
|
245
245
|
|
|
@@ -76,8 +76,8 @@ export default {
|
|
|
76
76
|
},
|
|
77
77
|
setSingle (state, page) {
|
|
78
78
|
if (page.path && page.delete) {
|
|
79
|
-
// 删除
|
|
80
|
-
|
|
79
|
+
// 删除
|
|
80
|
+
state.single = state.single.filter(item => item.fullPath !== page.path)
|
|
81
81
|
} else if (state.single.filter(item => item.meta.singlePage === page.meta.singlePage).length === 0) {
|
|
82
82
|
// 添加
|
|
83
83
|
state.single.push(page)
|
|
@@ -31,3 +31,17 @@
|
|
|
31
31
|
color: @disabled-color;
|
|
32
32
|
pointer-events: none;
|
|
33
33
|
}
|
|
34
|
+
|
|
35
|
+
::-webkit-scrollbar{
|
|
36
|
+
width: 5px;
|
|
37
|
+
height: 5px;
|
|
38
|
+
}
|
|
39
|
+
::-webkit-scrollbar-thumb {
|
|
40
|
+
border-radius: 3px;
|
|
41
|
+
background: @primary-3;
|
|
42
|
+
}
|
|
43
|
+
::-webkit-scrollbar-track {
|
|
44
|
+
-webkit-box-shadow: inset 0 0 1px rgba(0,0,0,0);
|
|
45
|
+
border-radius: 3px;
|
|
46
|
+
background: @primary-1;
|
|
47
|
+
}
|