vue2-client 1.1.0 → 1.2.0
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/.eslintrc.js +81 -81
- package/README.md +4 -2
- package/babel.config.js +14 -14
- package/docs/index.md +29 -29
- package/{src/index.js → index.js} +8 -8
- package/jest.config.js +3 -3
- package/package.json +1 -1
- package/public/index.html +27 -27
- package/src/App.vue +93 -93
- package/src/base-client/all.js +26 -26
- package/src/base-client/components/common/CreateQuery/CreateQuery.vue +4 -4
- package/src/base-client/components/common/CreateQuery/index.md +42 -42
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +2 -2
- package/src/base-client/components/common/XForm/XFormItem.vue +1 -1
- package/src/base-client/components/common/XForm/index.md +3 -3
- package/src/base-client/components/common/XFormCol/index.md +35 -35
- package/src/base-client/components/common/XFormTable/XFormTable.vue +6 -6
- package/src/base-client/components/common/XFormTable/index.md +89 -89
- package/src/base-client/components/common/XTable/XTable.vue +3 -3
- package/src/base-client/components/common/XTable/index.md +3 -3
- package/src/base-client/components/common/XTreeOne/XTreeOne.vue +105 -105
- package/src/base-client/components/iot/CustomerDetailsView/CustomerDetailsView.vue +3 -3
- 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 +5 -5
- package/src/base-client/components/iot/DeviceBrandDetailsView/DeviceBrandDetailsView.vue +3 -3
- package/src/base-client/components/iot/DeviceDetailsView/DeviceDetailsView.vue +3 -3
- package/src/base-client/components/iot/DeviceDetailsView/index.md +43 -43
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsCount.vue +1 -1
- 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 +4 -4
- 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 +3 -3
- package/src/base-client/components/iot/InstructDetailsView/InstructDetailsView.vue +5 -5
- package/src/base-client/components/iot/InstructDetailsView/index.md +45 -45
- package/src/base-client/components/iot/LogDetailsView/LogDetailsView.vue +3 -3
- package/src/base-client/components/iot/LogDetailsView/index.md +43 -43
- package/src/base-client/components/iot/MeterDetailsView/MeterDetailsView.vue +3 -3
- package/src/base-client/components/iot/MeterDetailsView/index.md +43 -43
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsCount.vue +1 -1
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsException.vue +3 -3
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsHandPlan.vue +3 -3
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsInstruct.vue +4 -4
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsMain.vue +3 -3
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsSellGas.vue +3 -3
- package/src/base-client/components/iot/WebmeterAnalysisView/WebmeterAnalysisView.vue +4 -4
- package/src/base-client/components/iot/WebmeterAnalysisView/index.md +48 -48
- package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +4 -4
- package/src/base-client/components/system/DictionaryDetailsView/index.md +41 -41
- package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +3 -3
- package/src/base-client/components/ticket/EmployeeDetailsView/EmployeeDetailsView.vue +5 -5
- package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +5 -5
- package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +3 -3
- package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +6 -6
- package/src/base-client/plugins/AppData.js +3 -3
- package/src/base-client/plugins/GetLoginInfoService.js +2 -2
- package/src/base-client/plugins/index.js +4 -4
- package/src/bootstrap.js +4 -4
- 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/config/default/setting.config.js +33 -33
- package/src/layouts/CommonLayout.vue +42 -42
- package/src/layouts/ComponentLayoutOne.vue +47 -47
- 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 +1 -1
- package/src/layouts/tabs/TabsHead.vue +190 -190
- package/src/layouts/tabs/TabsView.vue +355 -355
- package/src/main.js +2 -2
- package/src/mock/common/reportData.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/user/routes.js +61 -61
- package/src/mock/workplace/index.js +15 -15
- package/src/pages/exception/403.vue +2 -2
- package/src/pages/exception/404.vue +2 -2
- package/src/pages/exception/500.vue +2 -2
- package/src/pages/login/Login.vue +8 -8
- package/src/pages/report/ReportTable.js +125 -125
- package/src/pages/report/ReportTableHome.vue +2 -2
- package/src/pages/resourceManage/resourceManageMain.vue +1 -1
- 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 +13 -13
- package/src/router/guards.js +104 -104
- package/src/router/index.js +2 -2
- package/src/services/api/common.js +1 -1
- package/src/services/api/restTools.js +1 -1
- package/src/services/dataSource.js +12 -12
- package/src/services/user.js +34 -34
- package/src/store/index.js +5 -5
- package/src/store/modules/setting.js +114 -114
- package/src/theme/index.less +5 -5
- package/src/theme/reportTable.less +58 -58
- package/src/utils/i18n.js +80 -80
- package/src/utils/indexedDB.js +1 -1
- package/src/utils/request.js +1 -1
- package/src/utils/routerUtil.js +3 -3
- package/tests/unit/ReportTable.spec.js +2 -2
- package/vue.config.js +1 -0
- package/webpack.config.js +1 -1
- package/src/router/config.js +0 -23
package/src/main.js
CHANGED
|
@@ -2,8 +2,8 @@ import Vue from 'vue'
|
|
|
2
2
|
import App from './App.vue'
|
|
3
3
|
import Router from 'vue-router'
|
|
4
4
|
import Vuex from 'vuex'
|
|
5
|
-
import '
|
|
6
|
-
import { routerOptions, modules, i18n, message, bootstrap } from '
|
|
5
|
+
import '@vue2-client/mock'
|
|
6
|
+
import { routerOptions, modules, i18n, message, bootstrap } from '../index'
|
|
7
7
|
|
|
8
8
|
Vue.use(Router)
|
|
9
9
|
Vue.use(Vuex)
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
const reportData = [
|
|
2
|
-
{ '气费': { 'span': 8 } },
|
|
3
|
-
['付款方式', '用户类型', '用气性质', '笔数', '气量', '应收金额', '实收金额', '滞纳金'],
|
|
4
|
-
{
|
|
5
|
-
'刷卡': {
|
|
6
|
-
'非民用': {
|
|
7
|
-
'公服用气': [3, 2777, 6998.04, 7000, 0],
|
|
8
|
-
'商业用气': [17, 28720, 83811.50, 83806.70, 0]
|
|
9
|
-
},
|
|
10
|
-
'民用': {
|
|
11
|
-
'居民用气': [255, 19310, 44219.70, 44345.50, 0]
|
|
12
|
-
},
|
|
13
|
-
'合计': { 'span': 2, 'value': [275, 50807, 135029.24, 135152.20, 0] }
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
]
|
|
17
|
-
|
|
18
|
-
export {
|
|
19
|
-
reportData
|
|
20
|
-
}
|
|
1
|
+
const reportData = [
|
|
2
|
+
{ '气费': { 'span': 8 } },
|
|
3
|
+
['付款方式', '用户类型', '用气性质', '笔数', '气量', '应收金额', '实收金额', '滞纳金'],
|
|
4
|
+
{
|
|
5
|
+
'刷卡': {
|
|
6
|
+
'非民用': {
|
|
7
|
+
'公服用气': [3, 2777, 6998.04, 7000, 0],
|
|
8
|
+
'商业用气': [17, 28720, 83811.50, 83806.70, 0]
|
|
9
|
+
},
|
|
10
|
+
'民用': {
|
|
11
|
+
'居民用气': [255, 19310, 44219.70, 44345.50, 0]
|
|
12
|
+
},
|
|
13
|
+
'合计': { 'span': 2, 'value': [275, 50807, 135029.24, 135152.20, 0] }
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
reportData
|
|
20
|
+
}
|
package/src/mock/goods/index.js
CHANGED
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
import Mock from 'mockjs'
|
|
2
|
-
import '
|
|
3
|
-
import { parseUrlParams } from '
|
|
4
|
-
|
|
5
|
-
const current = new Date().getTime()
|
|
6
|
-
|
|
7
|
-
const goodsList = Mock.mock({
|
|
8
|
-
'list|100': [{
|
|
9
|
-
'id|+1': 0,
|
|
10
|
-
'name': '@GOODS',
|
|
11
|
-
'orderId': `${current}-@integer(1,100)`,
|
|
12
|
-
'status|1-4': 1,
|
|
13
|
-
'send': '@BOOLEAN',
|
|
14
|
-
'sendTime': '@DATETIME',
|
|
15
|
-
'orderDate': '@DATE',
|
|
16
|
-
'auditTime': '@TIME'
|
|
17
|
-
}]
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
Mock.mock(RegExp(`${process.env.VUE_APP_API_BASE_URL}/goods` + '.*'), 'get', ({ url }) => {
|
|
21
|
-
const params = parseUrlParams(decodeURI(url))
|
|
22
|
-
let { page, pageSize } = params
|
|
23
|
-
// eslint-disable-next-line no-eval
|
|
24
|
-
page = eval(page) - 1 || 0
|
|
25
|
-
// eslint-disable-next-line no-eval
|
|
26
|
-
pageSize = eval(pageSize) || 10
|
|
27
|
-
delete params.page
|
|
28
|
-
delete params.pageSize
|
|
29
|
-
let result = goodsList.list.filter(item => {
|
|
30
|
-
for (const [key, value] of Object.entries(params)) {
|
|
31
|
-
if (item[key] != value) {
|
|
32
|
-
return false
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return true
|
|
36
|
-
})
|
|
37
|
-
const total = result.length
|
|
38
|
-
if ((page) * pageSize > total) {
|
|
39
|
-
result = []
|
|
40
|
-
} else {
|
|
41
|
-
result = result.slice(page * pageSize, (page + 1) * pageSize)
|
|
42
|
-
}
|
|
43
|
-
return {
|
|
44
|
-
code: 0,
|
|
45
|
-
message: 'success',
|
|
46
|
-
data: {
|
|
47
|
-
page: page + 1,
|
|
48
|
-
pageSize,
|
|
49
|
-
total,
|
|
50
|
-
list: result
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
const columnsConfig = [
|
|
56
|
-
{
|
|
57
|
-
title: '商品名称',
|
|
58
|
-
dataIndex: 'name',
|
|
59
|
-
searchAble: true
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
title: '订单号',
|
|
63
|
-
dataIndex: 'orderId'
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
searchAble: true,
|
|
67
|
-
dataIndex: 'status',
|
|
68
|
-
dataType: 'select',
|
|
69
|
-
slots: { title: 'statusTitle' },
|
|
70
|
-
scopedSlots: { customRender: 'status' },
|
|
71
|
-
search: {
|
|
72
|
-
selectOptions: [
|
|
73
|
-
{ title: '已下单', value: 1 },
|
|
74
|
-
{ title: '已付款', value: 2 },
|
|
75
|
-
{ title: '已审核', value: 3 }
|
|
76
|
-
// {title: '已发货', value: 4}
|
|
77
|
-
]
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
title: '发货',
|
|
82
|
-
searchAble: true,
|
|
83
|
-
dataIndex: 'send',
|
|
84
|
-
dataType: 'boolean',
|
|
85
|
-
scopedSlots: { customRender: 'send' }
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
title: '发货时间',
|
|
89
|
-
dataIndex: 'sendTime',
|
|
90
|
-
dataType: 'datetime'
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
title: '下单日期',
|
|
94
|
-
searchAble: true,
|
|
95
|
-
dataIndex: 'orderDate',
|
|
96
|
-
dataType: 'date',
|
|
97
|
-
visible: false
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
title: '审核时间',
|
|
101
|
-
dataIndex: 'auditTime',
|
|
102
|
-
dataType: 'time'
|
|
103
|
-
}
|
|
104
|
-
]
|
|
105
|
-
|
|
106
|
-
Mock.mock(`${process.env.VUE_APP_API_BASE_URL}/columns`, 'get', () => {
|
|
107
|
-
return columnsConfig
|
|
108
|
-
})
|
|
1
|
+
import Mock from 'mockjs'
|
|
2
|
+
import '@vue2-client/mock/extend'
|
|
3
|
+
import { parseUrlParams } from '@vue2-client/utils/request'
|
|
4
|
+
|
|
5
|
+
const current = new Date().getTime()
|
|
6
|
+
|
|
7
|
+
const goodsList = Mock.mock({
|
|
8
|
+
'list|100': [{
|
|
9
|
+
'id|+1': 0,
|
|
10
|
+
'name': '@GOODS',
|
|
11
|
+
'orderId': `${current}-@integer(1,100)`,
|
|
12
|
+
'status|1-4': 1,
|
|
13
|
+
'send': '@BOOLEAN',
|
|
14
|
+
'sendTime': '@DATETIME',
|
|
15
|
+
'orderDate': '@DATE',
|
|
16
|
+
'auditTime': '@TIME'
|
|
17
|
+
}]
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
Mock.mock(RegExp(`${process.env.VUE_APP_API_BASE_URL}/goods` + '.*'), 'get', ({ url }) => {
|
|
21
|
+
const params = parseUrlParams(decodeURI(url))
|
|
22
|
+
let { page, pageSize } = params
|
|
23
|
+
// eslint-disable-next-line no-eval
|
|
24
|
+
page = eval(page) - 1 || 0
|
|
25
|
+
// eslint-disable-next-line no-eval
|
|
26
|
+
pageSize = eval(pageSize) || 10
|
|
27
|
+
delete params.page
|
|
28
|
+
delete params.pageSize
|
|
29
|
+
let result = goodsList.list.filter(item => {
|
|
30
|
+
for (const [key, value] of Object.entries(params)) {
|
|
31
|
+
if (item[key] != value) {
|
|
32
|
+
return false
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return true
|
|
36
|
+
})
|
|
37
|
+
const total = result.length
|
|
38
|
+
if ((page) * pageSize > total) {
|
|
39
|
+
result = []
|
|
40
|
+
} else {
|
|
41
|
+
result = result.slice(page * pageSize, (page + 1) * pageSize)
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
code: 0,
|
|
45
|
+
message: 'success',
|
|
46
|
+
data: {
|
|
47
|
+
page: page + 1,
|
|
48
|
+
pageSize,
|
|
49
|
+
total,
|
|
50
|
+
list: result
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
const columnsConfig = [
|
|
56
|
+
{
|
|
57
|
+
title: '商品名称',
|
|
58
|
+
dataIndex: 'name',
|
|
59
|
+
searchAble: true
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
title: '订单号',
|
|
63
|
+
dataIndex: 'orderId'
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
searchAble: true,
|
|
67
|
+
dataIndex: 'status',
|
|
68
|
+
dataType: 'select',
|
|
69
|
+
slots: { title: 'statusTitle' },
|
|
70
|
+
scopedSlots: { customRender: 'status' },
|
|
71
|
+
search: {
|
|
72
|
+
selectOptions: [
|
|
73
|
+
{ title: '已下单', value: 1 },
|
|
74
|
+
{ title: '已付款', value: 2 },
|
|
75
|
+
{ title: '已审核', value: 3 }
|
|
76
|
+
// {title: '已发货', value: 4}
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
title: '发货',
|
|
82
|
+
searchAble: true,
|
|
83
|
+
dataIndex: 'send',
|
|
84
|
+
dataType: 'boolean',
|
|
85
|
+
scopedSlots: { customRender: 'send' }
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
title: '发货时间',
|
|
89
|
+
dataIndex: 'sendTime',
|
|
90
|
+
dataType: 'datetime'
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
title: '下单日期',
|
|
94
|
+
searchAble: true,
|
|
95
|
+
dataIndex: 'orderDate',
|
|
96
|
+
dataType: 'date',
|
|
97
|
+
visible: false
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
title: '审核时间',
|
|
101
|
+
dataIndex: 'auditTime',
|
|
102
|
+
dataType: 'time'
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
|
|
106
|
+
Mock.mock(`${process.env.VUE_APP_API_BASE_URL}/columns`, 'get', () => {
|
|
107
|
+
return columnsConfig
|
|
108
|
+
})
|
package/src/mock/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import Mock from 'mockjs'
|
|
2
|
-
import '
|
|
3
|
-
import '
|
|
4
|
-
import '
|
|
5
|
-
import '
|
|
6
|
-
import '
|
|
7
|
-
import '
|
|
8
|
-
|
|
9
|
-
// 设置全局延时
|
|
10
|
-
Mock.setup({
|
|
11
|
-
timeout: '200-400'
|
|
12
|
-
})
|
|
1
|
+
import Mock from 'mockjs'
|
|
2
|
+
import '@vue2-client/mock/user/current'
|
|
3
|
+
import '@vue2-client/mock/project'
|
|
4
|
+
import '@vue2-client/mock/user/login'
|
|
5
|
+
import '@vue2-client/mock/workplace'
|
|
6
|
+
import '@vue2-client/mock/user/routes'
|
|
7
|
+
import '@vue2-client/mock/goods'
|
|
8
|
+
|
|
9
|
+
// 设置全局延时
|
|
10
|
+
Mock.setup({
|
|
11
|
+
timeout: '200-400'
|
|
12
|
+
})
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import Mock from 'mockjs'
|
|
2
|
-
import '
|
|
3
|
-
|
|
4
|
-
const projectArr = Mock.mock({
|
|
5
|
-
'list|6': [
|
|
6
|
-
{
|
|
7
|
-
logo: '@LOGO',
|
|
8
|
-
desc: '@SAYING'
|
|
9
|
-
}
|
|
10
|
-
]
|
|
11
|
-
}).list
|
|
12
|
-
|
|
13
|
-
Mock.mock('/project', 'get', () => {
|
|
14
|
-
return projectArr
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
export { projectArr }
|
|
1
|
+
import Mock from 'mockjs'
|
|
2
|
+
import '@vue2-client/mock/extend'
|
|
3
|
+
|
|
4
|
+
const projectArr = Mock.mock({
|
|
5
|
+
'list|6': [
|
|
6
|
+
{
|
|
7
|
+
logo: '@LOGO',
|
|
8
|
+
desc: '@SAYING'
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}).list
|
|
12
|
+
|
|
13
|
+
Mock.mock('/project', 'get', () => {
|
|
14
|
+
return projectArr
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
export { projectArr }
|
package/src/mock/user/current.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import Mock from 'mockjs'
|
|
2
|
-
import '
|
|
3
|
-
|
|
4
|
-
const welcome = Mock.mock({
|
|
5
|
-
timeFix: '@TIMEFIX',
|
|
6
|
-
message: '@WELCOME'
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
Mock.mock('/user/welcome', 'get', () => {
|
|
10
|
-
return welcome
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
export { welcome }
|
|
1
|
+
import Mock from 'mockjs'
|
|
2
|
+
import '@vue2-client/mock/extend'
|
|
3
|
+
|
|
4
|
+
const welcome = Mock.mock({
|
|
5
|
+
timeFix: '@TIMEFIX',
|
|
6
|
+
message: '@WELCOME'
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
Mock.mock('/user/welcome', 'get', () => {
|
|
10
|
+
return welcome
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
export { welcome }
|
package/src/mock/user/login.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
// import Mock from 'mockjs'
|
|
2
|
-
// import '
|
|
3
|
-
|
|
4
|
-
// const user = Mock.mock({
|
|
5
|
-
// name: '@ADMIN',
|
|
6
|
-
// avatar: '@AVATAR',
|
|
7
|
-
// address: '@CITY',
|
|
8
|
-
// position: '@POSITION'
|
|
9
|
-
// })
|
|
10
|
-
// Mock.mock(`${process.env.VUE_APP_API_BASE_URL}/login`, 'post', ({body}) => {
|
|
11
|
-
// let result = {data: {}}
|
|
12
|
-
// const {name, password} = JSON.parse(body)
|
|
13
|
-
//
|
|
14
|
-
// let success = false
|
|
15
|
-
//
|
|
16
|
-
// if (name === 'admin' && password === '888888') {
|
|
17
|
-
// success = true
|
|
18
|
-
// result.data.permissions = [{id: 'queryForm', operation: ['add', 'edit']}]
|
|
19
|
-
// result.data.roles = [{id: 'admin', operation: ['add', 'edit', 'delete']}]
|
|
20
|
-
// } else if (name === 'test' || password === '888888') {
|
|
21
|
-
// success = true
|
|
22
|
-
// result.data.permissions = [{id: 'queryForm', operation: ['add', 'edit']}]
|
|
23
|
-
// result.data.roles = [{id: 'test', operation: ['add', 'edit', 'delete']}]
|
|
24
|
-
// } else {
|
|
25
|
-
// success = false
|
|
26
|
-
// }
|
|
27
|
-
//
|
|
28
|
-
// if (success) {
|
|
29
|
-
// result.code = 0
|
|
30
|
-
// result.message = Mock.mock('@TIMEFIX').CN + ',欢迎回来'
|
|
31
|
-
// result.data.user = user
|
|
32
|
-
// result.data.token = 'Authorization:' + Math.random()
|
|
33
|
-
// result.data.expireAt = new Date(new Date().getTime() + 30 * 60 * 1000)
|
|
34
|
-
// } else {
|
|
35
|
-
// result.code = -1
|
|
36
|
-
// result.message = '账户名或密码错误(admin/888888 or test/888888)'
|
|
37
|
-
// }
|
|
38
|
-
// return result
|
|
39
|
-
// })
|
|
1
|
+
// import Mock from 'mockjs'
|
|
2
|
+
// import '@vue2-client/mock/extend'
|
|
3
|
+
|
|
4
|
+
// const user = Mock.mock({
|
|
5
|
+
// name: '@ADMIN',
|
|
6
|
+
// avatar: '@AVATAR',
|
|
7
|
+
// address: '@CITY',
|
|
8
|
+
// position: '@POSITION'
|
|
9
|
+
// })
|
|
10
|
+
// Mock.mock(`${process.env.VUE_APP_API_BASE_URL}/login`, 'post', ({body}) => {
|
|
11
|
+
// let result = {data: {}}
|
|
12
|
+
// const {name, password} = JSON.parse(body)
|
|
13
|
+
//
|
|
14
|
+
// let success = false
|
|
15
|
+
//
|
|
16
|
+
// if (name === 'admin' && password === '888888') {
|
|
17
|
+
// success = true
|
|
18
|
+
// result.data.permissions = [{id: 'queryForm', operation: ['add', 'edit']}]
|
|
19
|
+
// result.data.roles = [{id: 'admin', operation: ['add', 'edit', 'delete']}]
|
|
20
|
+
// } else if (name === 'test' || password === '888888') {
|
|
21
|
+
// success = true
|
|
22
|
+
// result.data.permissions = [{id: 'queryForm', operation: ['add', 'edit']}]
|
|
23
|
+
// result.data.roles = [{id: 'test', operation: ['add', 'edit', 'delete']}]
|
|
24
|
+
// } else {
|
|
25
|
+
// success = false
|
|
26
|
+
// }
|
|
27
|
+
//
|
|
28
|
+
// if (success) {
|
|
29
|
+
// result.code = 0
|
|
30
|
+
// result.message = Mock.mock('@TIMEFIX').CN + ',欢迎回来'
|
|
31
|
+
// result.data.user = user
|
|
32
|
+
// result.data.token = 'Authorization:' + Math.random()
|
|
33
|
+
// result.data.expireAt = new Date(new Date().getTime() + 30 * 60 * 1000)
|
|
34
|
+
// } else {
|
|
35
|
+
// result.code = -1
|
|
36
|
+
// result.message = '账户名或密码错误(admin/888888 or test/888888)'
|
|
37
|
+
// }
|
|
38
|
+
// return result
|
|
39
|
+
// })
|
package/src/mock/user/routes.js
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
import Mock from 'mockjs'
|
|
2
|
-
|
|
3
|
-
const router = [{
|
|
4
|
-
router: 'root',
|
|
5
|
-
children: [
|
|
6
|
-
{
|
|
7
|
-
router: 'dashboard',
|
|
8
|
-
icon: 'dashboard',
|
|
9
|
-
name: '仪表盘',
|
|
10
|
-
children: [
|
|
11
|
-
{
|
|
12
|
-
router: 'workplace',
|
|
13
|
-
name: '工作台'
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
router: 'analysis',
|
|
17
|
-
name: '分析页'
|
|
18
|
-
}
|
|
19
|
-
]
|
|
20
|
-
},
|
|
21
|
-
// {
|
|
22
|
-
// router: 'webmeter',
|
|
23
|
-
// children: ['userFilesManage', 'gasAnalysisManage', 'handAnalysisManage', 'exceptionManage']
|
|
24
|
-
// },
|
|
25
|
-
// {
|
|
26
|
-
// router: 'iot',
|
|
27
|
-
// children: ['iotDeviceType', 'iotDeviceBrand', 'iotDevice', 'iotSetDeviceParams', 'instructManage', 'reportedDataQuery', 'deviceException', 'deviceManage']
|
|
28
|
-
// },
|
|
29
|
-
// {
|
|
30
|
-
// router: 'dataAnalyze',
|
|
31
|
-
// children: ['DataAnalysisView']
|
|
32
|
-
// },
|
|
33
|
-
// {
|
|
34
|
-
// router: 'system',
|
|
35
|
-
// children: ['dictionaryManage', 'queryParamsManage', 'customerManage', 'safeguardSearchLog', 'runtime', 'createQuery']
|
|
36
|
-
// },
|
|
37
|
-
{
|
|
38
|
-
router: 'antdv',
|
|
39
|
-
path: 'antdv',
|
|
40
|
-
name: 'Ant Design Vue',
|
|
41
|
-
icon: 'ant-design',
|
|
42
|
-
link: 'https://www.antdv.com/docs/vue/introduce-cn/'
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
router: 'document',
|
|
46
|
-
path: 'document',
|
|
47
|
-
name: '使用文档',
|
|
48
|
-
icon: 'file-word',
|
|
49
|
-
link: 'https://iczer.gitee.io/vue-antd-admin-docs/'
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
}]
|
|
53
|
-
|
|
54
|
-
Mock.mock(`${process.env.VUE_APP_API_BASE_URL}/routes`, 'get', () => {
|
|
55
|
-
const result = {}
|
|
56
|
-
result.code = 0
|
|
57
|
-
result.data = router
|
|
58
|
-
return result
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
export { router }
|
|
1
|
+
import Mock from 'mockjs'
|
|
2
|
+
|
|
3
|
+
const router = [{
|
|
4
|
+
router: 'root',
|
|
5
|
+
children: [
|
|
6
|
+
{
|
|
7
|
+
router: 'dashboard',
|
|
8
|
+
icon: 'dashboard',
|
|
9
|
+
name: '仪表盘',
|
|
10
|
+
children: [
|
|
11
|
+
{
|
|
12
|
+
router: 'workplace',
|
|
13
|
+
name: '工作台'
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
router: 'analysis',
|
|
17
|
+
name: '分析页'
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
// {
|
|
22
|
+
// router: 'webmeter',
|
|
23
|
+
// children: ['userFilesManage', 'gasAnalysisManage', 'handAnalysisManage', 'exceptionManage']
|
|
24
|
+
// },
|
|
25
|
+
// {
|
|
26
|
+
// router: 'iot',
|
|
27
|
+
// children: ['iotDeviceType', 'iotDeviceBrand', 'iotDevice', 'iotSetDeviceParams', 'instructManage', 'reportedDataQuery', 'deviceException', 'deviceManage']
|
|
28
|
+
// },
|
|
29
|
+
// {
|
|
30
|
+
// router: 'dataAnalyze',
|
|
31
|
+
// children: ['DataAnalysisView']
|
|
32
|
+
// },
|
|
33
|
+
// {
|
|
34
|
+
// router: 'system',
|
|
35
|
+
// children: ['dictionaryManage', 'queryParamsManage', 'customerManage', 'safeguardSearchLog', 'runtime', 'createQuery']
|
|
36
|
+
// },
|
|
37
|
+
{
|
|
38
|
+
router: 'antdv',
|
|
39
|
+
path: 'antdv',
|
|
40
|
+
name: 'Ant Design Vue',
|
|
41
|
+
icon: 'ant-design',
|
|
42
|
+
link: 'https://www.antdv.com/docs/vue/introduce-cn/'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
router: 'document',
|
|
46
|
+
path: 'document',
|
|
47
|
+
name: '使用文档',
|
|
48
|
+
icon: 'file-word',
|
|
49
|
+
link: 'https://iczer.gitee.io/vue-antd-admin-docs/'
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}]
|
|
53
|
+
|
|
54
|
+
Mock.mock(`${process.env.VUE_APP_API_BASE_URL}/routes`, 'get', () => {
|
|
55
|
+
const result = {}
|
|
56
|
+
result.code = 0
|
|
57
|
+
result.data = router
|
|
58
|
+
return result
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
export { router }
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import Mock from 'mockjs'
|
|
2
|
-
import { activities, templates } from '../common/activityData'
|
|
3
|
-
import { teams } from '
|
|
4
|
-
|
|
5
|
-
activities.forEach(item => {
|
|
6
|
-
item.template = templates[item.activity.type](item.user, item.activity)
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
Mock.mock('/work/activity', 'get', () => {
|
|
10
|
-
return activities
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
Mock.mock('/work/team', 'get', () => {
|
|
14
|
-
return teams
|
|
15
|
-
})
|
|
1
|
+
import Mock from 'mockjs'
|
|
2
|
+
import { activities, templates } from '../common/activityData'
|
|
3
|
+
import { teams } from '@vue2-client/mock/common'
|
|
4
|
+
|
|
5
|
+
activities.forEach(item => {
|
|
6
|
+
item.template = templates[item.activity.type](item.user, item.activity)
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
Mock.mock('/work/activity', 'get', () => {
|
|
10
|
+
return activities
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
Mock.mock('/work/team', 'get', () => {
|
|
14
|
+
return teams
|
|
15
|
+
})
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script>
|
|
6
|
-
import ExceptionPage from '
|
|
6
|
+
import ExceptionPage from '@vue2-client/components/exception/ExceptionPage'
|
|
7
7
|
import { mapState } from 'vuex'
|
|
8
|
-
const { homePage } = require('
|
|
8
|
+
const { homePage } = require('@vue2-client/config')
|
|
9
9
|
export default {
|
|
10
10
|
name: 'Exp403',
|
|
11
11
|
components: { ExceptionPage },
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script>
|
|
6
|
-
import ExceptionPage from '
|
|
6
|
+
import ExceptionPage from '@vue2-client/components/exception/ExceptionPage'
|
|
7
7
|
import { mapState } from 'vuex'
|
|
8
|
-
const { homePage } = require('
|
|
8
|
+
const { homePage } = require('@vue2-client/config')
|
|
9
9
|
export default {
|
|
10
10
|
name: 'Exp404',
|
|
11
11
|
components: { ExceptionPage },
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script>
|
|
6
|
-
import ExceptionPage from '
|
|
6
|
+
import ExceptionPage from '@vue2-client/components/exception/ExceptionPage'
|
|
7
7
|
import { mapState } from 'vuex'
|
|
8
|
-
const { homePage } = require('
|
|
8
|
+
const { homePage } = require('@vue2-client/config')
|
|
9
9
|
export default {
|
|
10
10
|
name: 'Exp500',
|
|
11
11
|
components: { ExceptionPage },
|
|
@@ -53,18 +53,18 @@
|
|
|
53
53
|
</template>
|
|
54
54
|
|
|
55
55
|
<script>
|
|
56
|
-
import CommonLayout from '
|
|
57
|
-
import { getRoutesConfig, login } from '
|
|
58
|
-
import { setAuthorization } from '
|
|
59
|
-
import { loadRoutes, funcToRouter } from '
|
|
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
60
|
import { mapMutations } from 'vuex'
|
|
61
61
|
import JSEncrypt from 'jsencrypt'
|
|
62
|
-
import { ACCESS_TOKEN } from '
|
|
62
|
+
import { ACCESS_TOKEN } from '@vue2-client/store/mutation-types'
|
|
63
63
|
import Vue from 'vue'
|
|
64
64
|
import Mock from 'mockjs'
|
|
65
|
-
import { positions } from '
|
|
66
|
-
const { homePage } = require('
|
|
67
|
-
// import { router } from '
|
|
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
68
|
|
|
69
69
|
export default {
|
|
70
70
|
name: 'Login',
|