vue2-client 1.2.0 → 1.2.1
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 +65 -65
- package/babel.config.js +1 -0
- package/docs/notice.md +24 -0
- package/index.js +28 -28
- package/package.json +1 -1
- package/src/App.vue +93 -93
- package/src/base-client/all.js +57 -57
- package/src/base-client/components/common/CreateQuery/CreateQuery.vue +1159 -1159
- package/src/base-client/components/common/CreateQuery/index.md +42 -42
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +540 -540
- package/src/base-client/components/common/CreateSimpleFormQuery/index.md +42 -42
- package/src/base-client/components/common/CustomColumnsDrawer/index.md +46 -46
- package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +150 -150
- package/src/base-client/components/common/FormGroupEdit/index.md +43 -43
- package/src/base-client/components/common/FormGroupQuery/index.md +43 -43
- package/src/base-client/components/common/XAddForm/XAddForm.vue +323 -323
- package/src/base-client/components/common/XAddForm/index.md +60 -60
- package/src/base-client/components/common/XBadge/index.md +39 -39
- package/src/base-client/components/common/XCard/index.md +43 -43
- package/src/base-client/components/common/XForm/XForm.vue +275 -275
- package/src/base-client/components/common/XForm/XFormItem.vue +217 -217
- package/src/base-client/components/common/XForm/index.md +196 -196
- package/src/base-client/components/common/XFormCol/index.md +35 -35
- package/src/base-client/components/common/XFormTable/XFormTable.vue +405 -405
- package/src/base-client/components/common/XFormTable/index.md +89 -89
- package/src/base-client/components/common/XTable/XTable.vue +262 -262
- package/src/base-client/components/common/XTable/index.md +255 -255
- package/src/base-client/components/common/XTreeOne/XTreeOne.vue +105 -105
- package/src/base-client/components/iot/CustomerDetailsView/CustomerDetailsView.vue +226 -226
- package/src/base-client/components/iot/CustomerDetailsView/index.md +41 -41
- package/src/base-client/components/iot/DataAnalysisUser/DataAnalysisUser.vue +127 -127
- package/src/base-client/components/iot/DataAnalysisViewGD/DataAnalysisViewGD.vue +548 -548
- package/src/base-client/components/iot/DeviceBrandDetailsView/DeviceBrandDetailsView.vue +453 -453
- package/src/base-client/components/iot/DeviceDetailsView/DeviceDetailsView.vue +231 -231
- package/src/base-client/components/iot/DeviceDetailsView/index.md +43 -43
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsCount.vue +330 -330
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsException.vue +57 -57
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstruct.vue +122 -122
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstructOperate.vue +122 -122
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsMain.vue +225 -225
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsRead.vue +135 -135
- package/src/base-client/components/iot/DeviceTypeDetailsView/DeviceTypeDetailsView.vue +277 -277
- package/src/base-client/components/iot/InstructDetailsView/InstructDetailsView.vue +472 -472
- package/src/base-client/components/iot/InstructDetailsView/index.md +45 -45
- package/src/base-client/components/iot/LogDetailsView/LogDetailsView.vue +380 -380
- package/src/base-client/components/iot/LogDetailsView/index.md +43 -43
- package/src/base-client/components/iot/MeterDetailsView/MeterDetailsView.vue +360 -360
- package/src/base-client/components/iot/MeterDetailsView/index.md +43 -43
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsCount.vue +335 -335
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsException.vue +185 -185
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsHandPlan.vue +292 -292
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsInstruct.vue +237 -237
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsMain.vue +257 -257
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsSellGas.vue +190 -190
- package/src/base-client/components/iot/WebmeterAnalysisView/WebmeterAnalysisView.vue +723 -723
- package/src/base-client/components/iot/WebmeterAnalysisView/index.md +48 -48
- package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +232 -232
- package/src/base-client/components/system/DictionaryDetailsView/index.md +41 -41
- package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +248 -248
- package/src/base-client/components/ticket/EmployeeDetailsView/EmployeeDetailsView.vue +406 -406
- package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +486 -486
- package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +184 -184
- package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +303 -303
- package/src/base-client/plugins/AppData.js +69 -69
- package/src/base-client/plugins/GetLoginInfoService.js +221 -221
- package/src/base-client/plugins/index.js +21 -21
- package/src/bootstrap.js +27 -27
- package/src/components/Ellipsis/Ellipsis.vue +64 -64
- package/src/components/Ellipsis/index.md +38 -38
- package/src/components/NumberInfo/index.md +43 -43
- package/src/components/STable/README.md +341 -341
- package/src/components/Trend/index.md +45 -45
- package/src/components/cache/AKeepAlive.js +172 -172
- package/src/components/checkbox/index.js +7 -7
- package/src/components/index.js +36 -36
- package/src/components/menu/menu.js +273 -273
- package/src/components/setting/Setting.vue +237 -237
- package/src/components/table/advance/AdvanceTable.vue +275 -275
- package/src/components/transition/PageToggleTransition.vue +97 -97
- package/src/layouts/CommonLayout.vue +42 -42
- package/src/layouts/PageLayout.vue +151 -151
- package/src/layouts/SinglePageView.vue +74 -74
- package/src/layouts/header/AdminHeader.vue +109 -109
- package/src/layouts/header/HeaderAvatar.vue +60 -60
- package/src/layouts/header/HeaderNotice.vue +97 -97
- package/src/layouts/tabs/TabsHead.vue +190 -190
- package/src/layouts/tabs/TabsView.vue +355 -355
- package/src/main.js +20 -20
- package/src/mock/goods/index.js +108 -108
- package/src/mock/index.js +12 -12
- package/src/mock/project/index.js +17 -17
- package/src/mock/user/current.js +13 -13
- package/src/mock/user/login.js +39 -39
- package/src/mock/workplace/index.js +15 -15
- package/src/pages/exception/403.vue +25 -25
- package/src/pages/exception/404.vue +25 -25
- package/src/pages/exception/500.vue +25 -25
- package/src/pages/login/Login.vue +194 -194
- package/src/pages/report/ReportTableHome.vue +28 -28
- package/src/pages/resourceManage/resourceManageMain.vue +55 -55
- package/src/pages/system/applyInstallView/Core.vue +570 -570
- package/src/pages/system/applyInstallView/index.vue +34 -34
- package/src/pages/system/dictionary/index.vue +41 -41
- package/src/pages/system/queryParams/index.vue +41 -41
- package/src/router/async/config.async.js +25 -25
- package/src/router/async/router.map.js +59 -59
- package/src/router/guards.js +104 -104
- package/src/router/index.js +27 -27
- package/src/services/api/common.js +39 -39
- package/src/services/api/restTools.js +23 -23
- package/src/services/dataSource.js +12 -12
- package/src/services/user.js +34 -34
- package/src/store/modules/setting.js +114 -114
- package/src/utils/i18n.js +80 -80
- package/src/utils/indexedDB.js +146 -146
- package/src/utils/request.js +197 -197
- package/src/utils/routerUtil.js +15 -2
- package/tests/unit/ReportTable.spec.js +15 -15
- package/vue.config.js +153 -153
- package/webpack.config.js +12 -12
|
@@ -1,194 +1,194 @@
|
|
|
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">为物联网设备的兼容、监控和统计提供支持</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 Mock from 'mockjs'
|
|
65
|
-
import { positions } from '@vue2-client/mock/common'
|
|
66
|
-
const { homePage } = 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
|
-
methods: {
|
|
85
|
-
...mapMutations('account', ['setUser', 'setPermissions', 'setRoles']),
|
|
86
|
-
onSubmit (e) {
|
|
87
|
-
e.preventDefault()
|
|
88
|
-
this.form.validateFields((err) => {
|
|
89
|
-
if (!err) {
|
|
90
|
-
this.logging = true
|
|
91
|
-
const name = this.form.getFieldValue('name')
|
|
92
|
-
const password = this.form.getFieldValue('password')
|
|
93
|
-
login(name, password).then(this.afterLogin)
|
|
94
|
-
}
|
|
95
|
-
})
|
|
96
|
-
},
|
|
97
|
-
afterLogin (res) {
|
|
98
|
-
const name = this.form.getFieldValue('name')
|
|
99
|
-
const password = this.form.getFieldValue('password')
|
|
100
|
-
this.logging = false
|
|
101
|
-
const loginRes = res.states
|
|
102
|
-
if (loginRes === '登录成功') {
|
|
103
|
-
const encrypt = new JSEncrypt()
|
|
104
|
-
encrypt.setPublicKey('MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqPvovSfXcwBbW8cKMCgwqNpsYuzF8RPAPFb7LGsnVo44JhM/xxzDyzoYtdfNmtbIuKVi9PzIsyp6rg+09gbuI6UGwBZ5DWBDBMqv5MPdOF5dCQkB2Bbr5yPfURPENypUz+pBFBg41d+BC+rwRiXELwKy7Y9caD/MtJyHydj8OUwIDAQAB')
|
|
105
|
-
const data = encrypt.encrypt(JSON.stringify({ username: name, password: password }))
|
|
106
|
-
localStorage.setItem(ACCESS_TOKEN, data)
|
|
107
|
-
// 获取路由配置
|
|
108
|
-
getRoutesConfig(data).then(result => {
|
|
109
|
-
Vue.$login.login(result).then(() => {
|
|
110
|
-
const user = Object.assign({
|
|
111
|
-
username: result.ename,
|
|
112
|
-
name: result.name,
|
|
113
|
-
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/jZUIxmJycoymBprLOUbT.png',
|
|
114
|
-
address: '西安市',
|
|
115
|
-
position: positions[0]
|
|
116
|
-
}, result)
|
|
117
|
-
this.setUser(user)
|
|
118
|
-
this.setPermissions([{ id: 'queryForm', operation: ['add', 'edit'] }])
|
|
119
|
-
this.setRoles([{ id: 'admin', operation: ['add', 'edit', 'delete'] }])
|
|
120
|
-
let timestamp = new Date().getTime()// 当前的时间戳
|
|
121
|
-
timestamp = timestamp + 60 * 60 * 1000
|
|
122
|
-
// 格式化时间获取年月日, 登陆过期时间
|
|
123
|
-
const dateAfter = new Date(timestamp)
|
|
124
|
-
setAuthorization({ token: data, expireAt: dateAfter })
|
|
125
|
-
loadRoutes(funcToRouter(user.functions))
|
|
126
|
-
this.$router.push(homePage).catch(() => {})
|
|
127
|
-
this.$message.success(Mock.mock('@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>
|
|
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">为物联网设备的兼容、监控和统计提供支持</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 Mock from 'mockjs'
|
|
65
|
+
import { positions } from '@vue2-client/mock/common'
|
|
66
|
+
const { homePage } = 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
|
+
methods: {
|
|
85
|
+
...mapMutations('account', ['setUser', 'setPermissions', 'setRoles']),
|
|
86
|
+
onSubmit (e) {
|
|
87
|
+
e.preventDefault()
|
|
88
|
+
this.form.validateFields((err) => {
|
|
89
|
+
if (!err) {
|
|
90
|
+
this.logging = true
|
|
91
|
+
const name = this.form.getFieldValue('name')
|
|
92
|
+
const password = this.form.getFieldValue('password')
|
|
93
|
+
login(name, password).then(this.afterLogin)
|
|
94
|
+
}
|
|
95
|
+
})
|
|
96
|
+
},
|
|
97
|
+
afterLogin (res) {
|
|
98
|
+
const name = this.form.getFieldValue('name')
|
|
99
|
+
const password = this.form.getFieldValue('password')
|
|
100
|
+
this.logging = false
|
|
101
|
+
const loginRes = res.states
|
|
102
|
+
if (loginRes === '登录成功') {
|
|
103
|
+
const encrypt = new JSEncrypt()
|
|
104
|
+
encrypt.setPublicKey('MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqPvovSfXcwBbW8cKMCgwqNpsYuzF8RPAPFb7LGsnVo44JhM/xxzDyzoYtdfNmtbIuKVi9PzIsyp6rg+09gbuI6UGwBZ5DWBDBMqv5MPdOF5dCQkB2Bbr5yPfURPENypUz+pBFBg41d+BC+rwRiXELwKy7Y9caD/MtJyHydj8OUwIDAQAB')
|
|
105
|
+
const data = encrypt.encrypt(JSON.stringify({ username: name, password: password }))
|
|
106
|
+
localStorage.setItem(ACCESS_TOKEN, data)
|
|
107
|
+
// 获取路由配置
|
|
108
|
+
getRoutesConfig(data).then(result => {
|
|
109
|
+
Vue.$login.login(result).then(() => {
|
|
110
|
+
const user = Object.assign({
|
|
111
|
+
username: result.ename,
|
|
112
|
+
name: result.name,
|
|
113
|
+
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/jZUIxmJycoymBprLOUbT.png',
|
|
114
|
+
address: '西安市',
|
|
115
|
+
position: positions[0]
|
|
116
|
+
}, result)
|
|
117
|
+
this.setUser(user)
|
|
118
|
+
this.setPermissions([{ id: 'queryForm', operation: ['add', 'edit'] }])
|
|
119
|
+
this.setRoles([{ id: 'admin', operation: ['add', 'edit', 'delete'] }])
|
|
120
|
+
let timestamp = new Date().getTime()// 当前的时间戳
|
|
121
|
+
timestamp = timestamp + 60 * 60 * 1000
|
|
122
|
+
// 格式化时间获取年月日, 登陆过期时间
|
|
123
|
+
const dateAfter = new Date(timestamp)
|
|
124
|
+
setAuthorization({ token: data, expireAt: dateAfter })
|
|
125
|
+
loadRoutes(funcToRouter(user.functions))
|
|
126
|
+
this.$router.push(homePage).catch(() => {})
|
|
127
|
+
this.$message.success(Mock.mock('@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>
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<report-table :tableData="tableData"></report-table>
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script>
|
|
6
|
-
import { post } from '@vue2-client/services/api/restTools'
|
|
7
|
-
import ReportTable from '@vue2-client/pages/report/ReportTable'
|
|
8
|
-
export default {
|
|
9
|
-
name: 'ReportTableHome',
|
|
10
|
-
components: { ReportTable },
|
|
11
|
-
data () {
|
|
12
|
-
return {
|
|
13
|
-
tableData: null
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
created () {
|
|
17
|
-
},
|
|
18
|
-
mounted () {
|
|
19
|
-
this.getData()
|
|
20
|
-
},
|
|
21
|
-
methods: {
|
|
22
|
-
async getData () {
|
|
23
|
-
this.tableData = await post('webmeterapi/reportTest', {})
|
|
24
|
-
console.log('数据=>', JSON.stringify(this.tableData))
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<report-table :tableData="tableData"></report-table>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
import { post } from '@vue2-client/services/api/restTools'
|
|
7
|
+
import ReportTable from '@vue2-client/pages/report/ReportTable'
|
|
8
|
+
export default {
|
|
9
|
+
name: 'ReportTableHome',
|
|
10
|
+
components: { ReportTable },
|
|
11
|
+
data () {
|
|
12
|
+
return {
|
|
13
|
+
tableData: null
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
created () {
|
|
17
|
+
},
|
|
18
|
+
mounted () {
|
|
19
|
+
this.getData()
|
|
20
|
+
},
|
|
21
|
+
methods: {
|
|
22
|
+
async getData () {
|
|
23
|
+
this.tableData = await post('webmeterapi/reportTest', {})
|
|
24
|
+
console.log('数据=>', JSON.stringify(this.tableData))
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
</script>
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
<!--<template>-->
|
|
2
|
-
<!--<div id="resourceManageMain">-->
|
|
3
|
-
<!--<a-tabs>-->
|
|
4
|
-
<!--<a-tab-pane key="1" force-render>-->
|
|
5
|
-
<!--<span slot="tab"><a-icon type="apartment" />资源管理</span>-->
|
|
6
|
-
<!--Content of Tab Pane 1-->
|
|
7
|
-
<!--</a-tab-pane>-->
|
|
8
|
-
<!--<a-tab-pane key="2" tab="功能管理" force-render>-->
|
|
9
|
-
<!--Content of Tab Pane 2-->
|
|
10
|
-
<!--</a-tab-pane>-->
|
|
11
|
-
<!--<a-tab-pane key="3" tab="部门管理" force-render>-->
|
|
12
|
-
<!--Content of Tab Pane 3-->
|
|
13
|
-
<!--</a-tab-pane>-->
|
|
14
|
-
<!--</a-tabs>-->
|
|
15
|
-
<!--</div>-->
|
|
16
|
-
<!--</template>-->
|
|
17
|
-
|
|
18
|
-
<script>
|
|
19
|
-
import { mapState } from 'vuex'
|
|
20
|
-
import { getResourceFunction } from '@vue2-client/base-client/plugins/GetLoginInfoService'
|
|
21
|
-
|
|
22
|
-
export default {
|
|
23
|
-
name: 'resourceManageMain',
|
|
24
|
-
computed: {
|
|
25
|
-
...mapState('account', ['login'])
|
|
26
|
-
},
|
|
27
|
-
data () {
|
|
28
|
-
return {
|
|
29
|
-
resFun: []
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
created () {
|
|
33
|
-
},
|
|
34
|
-
async mounted () {
|
|
35
|
-
const fun = await getResourceFunction()
|
|
36
|
-
console.log('->', fun)
|
|
37
|
-
this.resFun = this.searchFun(fun, '资源功能')
|
|
38
|
-
},
|
|
39
|
-
methods: {
|
|
40
|
-
searchFun (fun, name) {
|
|
41
|
-
if (fun.length > 0) {
|
|
42
|
-
if (fun[0].name == name) {
|
|
43
|
-
return fun[0].children
|
|
44
|
-
} else {
|
|
45
|
-
return this.searchFun(fun[0].children, name)
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
</script>
|
|
52
|
-
|
|
53
|
-
<style lang="less">
|
|
54
|
-
|
|
55
|
-
</style>
|
|
1
|
+
<!--<template>-->
|
|
2
|
+
<!--<div id="resourceManageMain">-->
|
|
3
|
+
<!--<a-tabs>-->
|
|
4
|
+
<!--<a-tab-pane key="1" force-render>-->
|
|
5
|
+
<!--<span slot="tab"><a-icon type="apartment" />资源管理</span>-->
|
|
6
|
+
<!--Content of Tab Pane 1-->
|
|
7
|
+
<!--</a-tab-pane>-->
|
|
8
|
+
<!--<a-tab-pane key="2" tab="功能管理" force-render>-->
|
|
9
|
+
<!--Content of Tab Pane 2-->
|
|
10
|
+
<!--</a-tab-pane>-->
|
|
11
|
+
<!--<a-tab-pane key="3" tab="部门管理" force-render>-->
|
|
12
|
+
<!--Content of Tab Pane 3-->
|
|
13
|
+
<!--</a-tab-pane>-->
|
|
14
|
+
<!--</a-tabs>-->
|
|
15
|
+
<!--</div>-->
|
|
16
|
+
<!--</template>-->
|
|
17
|
+
|
|
18
|
+
<script>
|
|
19
|
+
import { mapState } from 'vuex'
|
|
20
|
+
import { getResourceFunction } from '@vue2-client/base-client/plugins/GetLoginInfoService'
|
|
21
|
+
|
|
22
|
+
export default {
|
|
23
|
+
name: 'resourceManageMain',
|
|
24
|
+
computed: {
|
|
25
|
+
...mapState('account', ['login'])
|
|
26
|
+
},
|
|
27
|
+
data () {
|
|
28
|
+
return {
|
|
29
|
+
resFun: []
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
created () {
|
|
33
|
+
},
|
|
34
|
+
async mounted () {
|
|
35
|
+
const fun = await getResourceFunction()
|
|
36
|
+
console.log('->', fun)
|
|
37
|
+
this.resFun = this.searchFun(fun, '资源功能')
|
|
38
|
+
},
|
|
39
|
+
methods: {
|
|
40
|
+
searchFun (fun, name) {
|
|
41
|
+
if (fun.length > 0) {
|
|
42
|
+
if (fun[0].name == name) {
|
|
43
|
+
return fun[0].children
|
|
44
|
+
} else {
|
|
45
|
+
return this.searchFun(fun[0].children, name)
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<style lang="less">
|
|
54
|
+
|
|
55
|
+
</style>
|