vue2-client 1.2.37-2 → 1.2.40
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 +13 -0
- package/docs/notice.md +22 -22
- package/package.json +1 -1
- package/src/base-client/all.js +61 -61
- package/src/base-client/components/common/AmapMarker/AmapPointRendering.vue +104 -104
- package/src/base-client/components/common/AmapMarker/index.js +3 -3
- package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +149 -149
- package/src/base-client/components/common/ScrollList/SrcollList.vue +113 -113
- package/src/base-client/components/common/ScrollList/index.js +3 -3
- package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +315 -315
- package/src/base-client/components/common/XForm/XForm.vue +275 -275
- package/src/base-client/components/iot/CustomerDetailsView/CustomerDetailsView.vue +225 -225
- package/src/base-client/components/iot/DataAnalysisView/DataAnalysisView.vue +244 -244
- package/src/base-client/components/iot/DeviceBrandDetailsView/DeviceBrandDetailsView.vue +452 -452
- package/src/base-client/components/iot/DeviceDetailsView/DeviceDetailsView.vue +236 -236
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsCount.vue +330 -330
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstructOperate.vue +121 -121
- package/src/base-client/components/iot/DeviceTypeDetailsView/DeviceTypeDetailsView.vue +276 -276
- package/src/base-client/components/iot/InstructDetailsView/InstructDetailsView.vue +469 -469
- package/src/base-client/components/iot/LogDetailsView/LogDetailsView.vue +379 -379
- package/src/base-client/components/iot/MeterDetailsView/MeterDetailsView.vue +359 -359
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsCount.vue +335 -335
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsException.vue +184 -184
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsHandPlan.vue +291 -291
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsInstruct.vue +236 -236
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsMain.vue +256 -256
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsSellGas.vue +189 -189
- package/src/base-client/components/iot/WebmeterAnalysisView/WebmeterAnalysisView.vue +722 -722
- package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +231 -231
- package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +247 -247
- package/src/base-client/components/ticket/EmployeeDetailsView/EmployeeDetailsView.vue +370 -370
- package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +3 -3
- package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +260 -260
- package/src/base-client/plugins/AppData.js +67 -67
- package/src/base-client/plugins/GetLoginInfoService.js +252 -252
- package/src/components/exception/ExceptionPage.vue +70 -70
- package/src/components/setting/Setting.vue +235 -237
- package/src/config/default/setting.config.js +35 -34
- package/src/config/index.js +3 -6
- package/src/layouts/SinglePageView.vue +13 -17
- package/src/layouts/header/HeaderNotice.vue +97 -97
- package/src/layouts/tabs/TabsView.vue +3 -5
- package/src/pages/login/Login.vue +201 -198
- package/src/pages/report/ReportTableHome.vue +28 -28
- package/src/pages/resourceManage/depListManage.vue +23 -23
- package/src/pages/resourceManage/funListManage.vue +23 -23
- package/src/pages/resourceManage/index.js +15 -15
- package/src/pages/resourceManage/orgListManage.vue +98 -98
- package/src/pages/resourceManage/roleListManage.vue +23 -23
- package/src/pages/resourceManage/staffListManage.vue +23 -23
- package/src/pages/system/ticket/index.vue +225 -209
- package/src/pages/system/ticket/submitTicketSuccess.vue +248 -248
- package/src/router/async/router.map.js +2 -3
- package/src/services/api/common.js +47 -47
- package/src/services/api/index.js +39 -39
- package/src/services/user.js +34 -34
- package/src/utils/indexedDB.js +146 -146
- package/src/utils/routerUtil.js +359 -360
- package/vue.config.js +143 -143
- package/src/config/config.js +0 -15
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<a-dropdown :trigger="['click']" v-model="show">
|
|
3
|
-
<div slot="overlay">
|
|
4
|
-
<a-spin :spinning="loading">
|
|
5
|
-
<a-tabs class="dropdown-tabs" :tabBarStyle="{textAlign: 'center'}" :style="{width: '297px'}">
|
|
6
|
-
<a-tab-pane tab="通知" key="1">
|
|
7
|
-
<a-list>
|
|
8
|
-
<a-list-item :key="item.id" class="tab-pane" v-for=" item in exception">
|
|
9
|
-
<a-list-item-meta :title="'设备号'+ item.e_f_device_id" :description="item.e_f_error_msg" @click="read(item)">
|
|
10
|
-
<a-avatar style="background-color: white" slot="avatar" src="https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png"/>
|
|
11
|
-
</a-list-item-meta>
|
|
12
|
-
</a-list-item>
|
|
13
|
-
</a-list>
|
|
14
|
-
</a-tab-pane>
|
|
15
|
-
<a-tab-pane tab="消息" key="2">
|
|
16
|
-
<a-list class="tab-pane"></a-list>
|
|
17
|
-
</a-tab-pane>
|
|
18
|
-
<a-tab-pane tab="待办" key="3">
|
|
19
|
-
<a-list class="tab-pane"></a-list>
|
|
20
|
-
</a-tab-pane>
|
|
21
|
-
</a-tabs>
|
|
22
|
-
</a-spin>
|
|
23
|
-
</div>
|
|
24
|
-
<span @click="fetchNotice" class="header-notice">
|
|
25
|
-
<a-badge class="notice-badge" :count=" exception.length">
|
|
26
|
-
<a-icon :class="['header-notice-icon']" type="bell" />
|
|
27
|
-
</a-badge>
|
|
28
|
-
</span>
|
|
29
|
-
</a-dropdown>
|
|
30
|
-
</template>
|
|
31
|
-
|
|
32
|
-
<script>
|
|
33
|
-
import { post } from '@vue2-client/services/api'
|
|
34
|
-
export default {
|
|
35
|
-
name: 'HeaderNotice',
|
|
36
|
-
data () {
|
|
37
|
-
return {
|
|
38
|
-
loading: false,
|
|
39
|
-
show: false,
|
|
40
|
-
exception: []
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
computed: {
|
|
44
|
-
},
|
|
45
|
-
created () {
|
|
46
|
-
this.refresh()
|
|
47
|
-
},
|
|
48
|
-
methods: {
|
|
49
|
-
read (item) {
|
|
50
|
-
post('/webmeterapi/saveSingleTable', { data: { tablename: 't_iot_device_exception', param: { id: item.e_id, f_is_read: 1 } } }).then(res => {
|
|
51
|
-
this.refresh()
|
|
52
|
-
})
|
|
53
|
-
},
|
|
54
|
-
refresh () {
|
|
55
|
-
post('/webmeterapi/commonQuery', { queryParamsName: 'deviceExceptionQueryParams', conditionParams: { e_f_is_read: 0 }, pageNo: 1, pageSize: 999999 }).then(res => {
|
|
56
|
-
this.exception = res.data
|
|
57
|
-
})
|
|
58
|
-
},
|
|
59
|
-
fetchNotice () {
|
|
60
|
-
if (this.loading) {
|
|
61
|
-
this.loading = false
|
|
62
|
-
return
|
|
63
|
-
}
|
|
64
|
-
this.loadding = true
|
|
65
|
-
setTimeout(() => {
|
|
66
|
-
this.loadding = false
|
|
67
|
-
}, 1000)
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
</script>
|
|
72
|
-
|
|
73
|
-
<style lang="less">
|
|
74
|
-
.header-notice{
|
|
75
|
-
display: inline-block;
|
|
76
|
-
transition: all 0.3s;
|
|
77
|
-
span {
|
|
78
|
-
vertical-align: initial;
|
|
79
|
-
}
|
|
80
|
-
.notice-badge{
|
|
81
|
-
color: inherit;
|
|
82
|
-
.header-notice-icon{
|
|
83
|
-
font-size: 16px;
|
|
84
|
-
padding: 4px;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
.dropdown-tabs{
|
|
89
|
-
background-color: @base-bg-color;
|
|
90
|
-
box-shadow: 0 2px 8px @shadow-color;
|
|
91
|
-
border-radius: 4px;
|
|
92
|
-
.tab-pane{
|
|
93
|
-
padding: 0 24px 12px;
|
|
94
|
-
min-height: 250px;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<a-dropdown :trigger="['click']" v-model="show">
|
|
3
|
+
<div slot="overlay">
|
|
4
|
+
<a-spin :spinning="loading">
|
|
5
|
+
<a-tabs class="dropdown-tabs" :tabBarStyle="{textAlign: 'center'}" :style="{width: '297px'}">
|
|
6
|
+
<a-tab-pane tab="通知" key="1">
|
|
7
|
+
<a-list>
|
|
8
|
+
<a-list-item :key="item.id" class="tab-pane" v-for=" item in exception">
|
|
9
|
+
<a-list-item-meta :title="'设备号'+ item.e_f_device_id" :description="item.e_f_error_msg" @click="read(item)">
|
|
10
|
+
<a-avatar style="background-color: white" slot="avatar" src="https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png"/>
|
|
11
|
+
</a-list-item-meta>
|
|
12
|
+
</a-list-item>
|
|
13
|
+
</a-list>
|
|
14
|
+
</a-tab-pane>
|
|
15
|
+
<a-tab-pane tab="消息" key="2">
|
|
16
|
+
<a-list class="tab-pane"></a-list>
|
|
17
|
+
</a-tab-pane>
|
|
18
|
+
<a-tab-pane tab="待办" key="3">
|
|
19
|
+
<a-list class="tab-pane"></a-list>
|
|
20
|
+
</a-tab-pane>
|
|
21
|
+
</a-tabs>
|
|
22
|
+
</a-spin>
|
|
23
|
+
</div>
|
|
24
|
+
<span @click="fetchNotice" class="header-notice">
|
|
25
|
+
<a-badge class="notice-badge" :count=" exception.length">
|
|
26
|
+
<a-icon :class="['header-notice-icon']" type="bell" />
|
|
27
|
+
</a-badge>
|
|
28
|
+
</span>
|
|
29
|
+
</a-dropdown>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script>
|
|
33
|
+
import { post } from '@vue2-client/services/api'
|
|
34
|
+
export default {
|
|
35
|
+
name: 'HeaderNotice',
|
|
36
|
+
data () {
|
|
37
|
+
return {
|
|
38
|
+
loading: false,
|
|
39
|
+
show: false,
|
|
40
|
+
exception: []
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
computed: {
|
|
44
|
+
},
|
|
45
|
+
created () {
|
|
46
|
+
this.refresh()
|
|
47
|
+
},
|
|
48
|
+
methods: {
|
|
49
|
+
read (item) {
|
|
50
|
+
post('/webmeterapi/saveSingleTable', { data: { tablename: 't_iot_device_exception', param: { id: item.e_id, f_is_read: 1 } } }).then(res => {
|
|
51
|
+
this.refresh()
|
|
52
|
+
})
|
|
53
|
+
},
|
|
54
|
+
refresh () {
|
|
55
|
+
post('/webmeterapi/commonQuery', { queryParamsName: 'deviceExceptionQueryParams', conditionParams: { e_f_is_read: 0 }, pageNo: 1, pageSize: 999999 }).then(res => {
|
|
56
|
+
this.exception = res.data
|
|
57
|
+
})
|
|
58
|
+
},
|
|
59
|
+
fetchNotice () {
|
|
60
|
+
if (this.loading) {
|
|
61
|
+
this.loading = false
|
|
62
|
+
return
|
|
63
|
+
}
|
|
64
|
+
this.loadding = true
|
|
65
|
+
setTimeout(() => {
|
|
66
|
+
this.loadding = false
|
|
67
|
+
}, 1000)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
</script>
|
|
72
|
+
|
|
73
|
+
<style lang="less">
|
|
74
|
+
.header-notice{
|
|
75
|
+
display: inline-block;
|
|
76
|
+
transition: all 0.3s;
|
|
77
|
+
span {
|
|
78
|
+
vertical-align: initial;
|
|
79
|
+
}
|
|
80
|
+
.notice-badge{
|
|
81
|
+
color: inherit;
|
|
82
|
+
.header-notice-icon{
|
|
83
|
+
font-size: 16px;
|
|
84
|
+
padding: 4px;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
.dropdown-tabs{
|
|
89
|
+
background-color: @base-bg-color;
|
|
90
|
+
box-shadow: 0 2px 8px @shadow-color;
|
|
91
|
+
border-radius: 4px;
|
|
92
|
+
.tab-pane{
|
|
93
|
+
padding: 0 24px 12px;
|
|
94
|
+
min-height: 250px;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
</style>
|
|
@@ -17,11 +17,9 @@
|
|
|
17
17
|
</a-keep-alive>
|
|
18
18
|
<router-view ref="tabContent" v-else-if="!refreshing" />
|
|
19
19
|
</page-toggle-transition>
|
|
20
|
-
<
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
</template>
|
|
24
|
-
</div>
|
|
20
|
+
<template v-for="page in single">
|
|
21
|
+
<single-page-view v-show="page.meta.singlePage === $route.meta.singlePage" :single-page-url="page.meta.singlePage" :key="page.meta.singlePage" />
|
|
22
|
+
</template>
|
|
25
23
|
</div>
|
|
26
24
|
</admin-layout>
|
|
27
25
|
</template>
|
|
@@ -1,198 +1,201 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<common-layout>
|
|
3
|
-
<div class="top">
|
|
4
|
-
<div class="header">
|
|
5
|
-
<img alt="logo" class="logo" src="@/assets/img/logo.png" />
|
|
6
|
-
<span class="title">{{ systemName }}</span>
|
|
7
|
-
</div>
|
|
8
|
-
<div class="desc"
|
|
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
|
-
const { homePage, ticketPage } = require('@vue2-client/config')
|
|
67
|
-
// import { router } from '@vue2-client/mock/user/routes'
|
|
68
|
-
|
|
69
|
-
export default {
|
|
70
|
-
name: 'Login',
|
|
71
|
-
components: { CommonLayout },
|
|
72
|
-
data () {
|
|
73
|
-
return {
|
|
74
|
-
logging: false,
|
|
75
|
-
error: '',
|
|
76
|
-
form: this.$form.createForm(this)
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
computed: {
|
|
80
|
-
systemName () {
|
|
81
|
-
return this.$store.state.setting.systemName
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
const
|
|
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
|
-
font-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
@media screen and (max-width:
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<common-layout>
|
|
3
|
+
<div class="top">
|
|
4
|
+
<div class="header">
|
|
5
|
+
<img alt="logo" class="logo" src="@/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 } 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
|
+
const { homePage, ticketPage } = require('@vue2-client/config')
|
|
67
|
+
// import { router } from '@vue2-client/mock/user/routes'
|
|
68
|
+
|
|
69
|
+
export default {
|
|
70
|
+
name: 'Login',
|
|
71
|
+
components: { CommonLayout },
|
|
72
|
+
data () {
|
|
73
|
+
return {
|
|
74
|
+
logging: false,
|
|
75
|
+
error: '',
|
|
76
|
+
form: this.$form.createForm(this)
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
computed: {
|
|
80
|
+
systemName () {
|
|
81
|
+
return this.$store.state.setting.systemName
|
|
82
|
+
},
|
|
83
|
+
systemDesc () {
|
|
84
|
+
return this.$store.state.setting.systemDesc
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
methods: {
|
|
88
|
+
...mapMutations('account', ['setUser', 'setPermissions', 'setRoles']),
|
|
89
|
+
onSubmit (e) {
|
|
90
|
+
e.preventDefault()
|
|
91
|
+
this.form.validateFields((err) => {
|
|
92
|
+
if (!err) {
|
|
93
|
+
this.logging = true
|
|
94
|
+
const name = this.form.getFieldValue('name')
|
|
95
|
+
const password = this.form.getFieldValue('password')
|
|
96
|
+
login(name, password).then(this.afterLogin)
|
|
97
|
+
}
|
|
98
|
+
})
|
|
99
|
+
},
|
|
100
|
+
afterLogin (res) {
|
|
101
|
+
const name = this.form.getFieldValue('name')
|
|
102
|
+
const password = this.form.getFieldValue('password')
|
|
103
|
+
this.logging = false
|
|
104
|
+
const loginRes = res.states
|
|
105
|
+
if (loginRes === '登录成功') {
|
|
106
|
+
const encrypt = new JSEncrypt()
|
|
107
|
+
encrypt.setPublicKey('MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqPvovSfXcwBbW8cKMCgwqNpsYuzF8RPAPFb7LGsnVo44JhM/xxzDyzoYtdfNmtbIuKVi9PzIsyp6rg+09gbuI6UGwBZ5DWBDBMqv5MPdOF5dCQkB2Bbr5yPfURPENypUz+pBFBg41d+BC+rwRiXELwKy7Y9caD/MtJyHydj8OUwIDAQAB')
|
|
108
|
+
const data = encrypt.encrypt(JSON.stringify({ username: name, password: password }))
|
|
109
|
+
localStorage.setItem(ACCESS_TOKEN, data)
|
|
110
|
+
// 获取路由配置
|
|
111
|
+
getRoutesConfig(data).then(result => {
|
|
112
|
+
Vue.$login.login(result).then(() => {
|
|
113
|
+
const user = Object.assign({
|
|
114
|
+
username: result.ename,
|
|
115
|
+
name: result.name,
|
|
116
|
+
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/jZUIxmJycoymBprLOUbT.png',
|
|
117
|
+
address: '西安市',
|
|
118
|
+
position: positions[0]
|
|
119
|
+
}, result)
|
|
120
|
+
this.setUser(user)
|
|
121
|
+
this.setPermissions([{ id: 'queryForm', operation: ['add', 'edit'] }])
|
|
122
|
+
this.setRoles([{ id: 'admin', operation: ['add', 'edit', 'delete'] }])
|
|
123
|
+
let timestamp = new Date().getTime()// 当前的时间戳
|
|
124
|
+
timestamp = timestamp + 60 * 60 * 1000
|
|
125
|
+
// 格式化时间获取年月日, 登陆过期时间
|
|
126
|
+
const dateAfter = new Date(timestamp)
|
|
127
|
+
setAuthorization({ token: data, expireAt: dateAfter })
|
|
128
|
+
loadRoutes(funcToRouter(user.functions))
|
|
129
|
+
if (result.deps === '用户工单登记') {
|
|
130
|
+
this.$router.push(ticketPage).catch(() => {})
|
|
131
|
+
} else {
|
|
132
|
+
this.$router.push(homePage).catch(() => {})
|
|
133
|
+
}
|
|
134
|
+
this.$message.success(timeFix().CN + ',欢迎回来', 3)
|
|
135
|
+
})
|
|
136
|
+
})
|
|
137
|
+
} else {
|
|
138
|
+
this.error = loginRes
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
</script>
|
|
144
|
+
|
|
145
|
+
<style lang="less" scoped>
|
|
146
|
+
.common-layout{
|
|
147
|
+
.top {
|
|
148
|
+
text-align: center;
|
|
149
|
+
.header {
|
|
150
|
+
height: 44px;
|
|
151
|
+
line-height: 44px;
|
|
152
|
+
a {
|
|
153
|
+
text-decoration: none;
|
|
154
|
+
}
|
|
155
|
+
.logo {
|
|
156
|
+
height: 44px;
|
|
157
|
+
vertical-align: top;
|
|
158
|
+
margin-right: 16px;
|
|
159
|
+
}
|
|
160
|
+
.title {
|
|
161
|
+
font-size: 33px;
|
|
162
|
+
color: @title-color;
|
|
163
|
+
font-family: 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
|
164
|
+
font-weight: 600;
|
|
165
|
+
position: relative;
|
|
166
|
+
top: 2px;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
.desc {
|
|
170
|
+
font-size: 14px;
|
|
171
|
+
color: @text-color-second;
|
|
172
|
+
margin-top: 12px;
|
|
173
|
+
margin-bottom: 40px;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
.login{
|
|
177
|
+
width: 368px;
|
|
178
|
+
margin: 0 auto;
|
|
179
|
+
@media screen and (max-width: 576px) {
|
|
180
|
+
width: 95%;
|
|
181
|
+
}
|
|
182
|
+
@media screen and (max-width: 320px) {
|
|
183
|
+
.captcha-button{
|
|
184
|
+
font-size: 14px;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
.icon {
|
|
188
|
+
font-size: 24px;
|
|
189
|
+
color: @text-color-second;
|
|
190
|
+
margin-left: 16px;
|
|
191
|
+
vertical-align: middle;
|
|
192
|
+
cursor: pointer;
|
|
193
|
+
transition: color 0.3s;
|
|
194
|
+
|
|
195
|
+
&:hover {
|
|
196
|
+
color: @primary-color;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
</style>
|