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
|
@@ -1,125 +1,125 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
name: 'ReportTable',
|
|
3
|
-
functional: true,
|
|
4
|
-
render (h, content) {
|
|
5
|
-
if (!content.props.tableData) {
|
|
6
|
-
console.log('没有报表数据')
|
|
7
|
-
return
|
|
8
|
-
}
|
|
9
|
-
console.log('content=>', content)
|
|
10
|
-
const html = reportCompute(h, content.props.tableData)
|
|
11
|
-
console.log('html=>', html)
|
|
12
|
-
// 报表整体高度和宽度
|
|
13
|
-
const reportClass = `h-${html.h} w-${html.w}`
|
|
14
|
-
const report = (
|
|
15
|
-
<div id='ReportTableHome'>
|
|
16
|
-
<div id='reportTable' class={reportClass}>
|
|
17
|
-
{html.el}
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
)
|
|
21
|
-
return report
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* class类生成
|
|
26
|
-
* @param w 宽
|
|
27
|
-
* @param h 高
|
|
28
|
-
* @param l left
|
|
29
|
-
* @param t top
|
|
30
|
-
* @returns {string}
|
|
31
|
-
*/
|
|
32
|
-
function generClass ({ w = 1, h = 1, l, t }) {
|
|
33
|
-
return `w-${w} h-${h} l-${l} t-${t}`
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* 判断是否是个Number数据
|
|
37
|
-
* @param value
|
|
38
|
-
* @returns {boolean}
|
|
39
|
-
*/
|
|
40
|
-
function typeNumber (value) {
|
|
41
|
-
return Object.prototype.toString.call(value) === '[object Number]'
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* 判断是否是个object数据
|
|
45
|
-
* @param value
|
|
46
|
-
* @returns {boolean}
|
|
47
|
-
*/
|
|
48
|
-
function typeObject (value) {
|
|
49
|
-
return Object.prototype.toString.call(value) === '[object Object]'
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* 判断是否是个Array数据
|
|
53
|
-
* @param value
|
|
54
|
-
* @returns {boolean}
|
|
55
|
-
*/
|
|
56
|
-
function typeArray (value) {
|
|
57
|
-
return Object.prototype.toString.call(value) === '[object Array]'
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* 一行数据转换html函数
|
|
61
|
-
* @param h vue的h
|
|
62
|
-
* @param row 一行json数据
|
|
63
|
-
* @param left 起始left距离
|
|
64
|
-
* @param top 起始top距离
|
|
65
|
-
* @returns {{el: Array, h: number}}
|
|
66
|
-
*/
|
|
67
|
-
function rowCompute (h, row, left, top) {
|
|
68
|
-
if (typeObject(row)) {
|
|
69
|
-
const el = []
|
|
70
|
-
const keys = Object.keys(row).filter((res) => res != 'span')
|
|
71
|
-
let heigth = 0
|
|
72
|
-
for (const key of keys.values()) {
|
|
73
|
-
const value = row[key]['value'] ? row[key]['value'] : row[key]
|
|
74
|
-
const style = { l: left, t: top + heigth }
|
|
75
|
-
style.w = row[key]['span'] ? row[key]['span'] : 1
|
|
76
|
-
const nextL = left + style.w
|
|
77
|
-
const nextT = top + heigth
|
|
78
|
-
const divObject = rowCompute(h, value, nextL, nextT)
|
|
79
|
-
el.push(divObject.el)
|
|
80
|
-
style.h = divObject.h ? divObject.h : 1
|
|
81
|
-
heigth += style.h
|
|
82
|
-
const attrs = { class: generClass(style) + ' title' }
|
|
83
|
-
const div = <div {...attrs}>{key == 'value' ? value : key}</div>
|
|
84
|
-
el.push(div)
|
|
85
|
-
}
|
|
86
|
-
return { h: heigth, el: el }
|
|
87
|
-
} else if (typeArray(row)) {
|
|
88
|
-
const el = []
|
|
89
|
-
for (const [i, value] of row.entries()) {
|
|
90
|
-
const style = { l: (left + i), t: top, w: 1, h: 1 }
|
|
91
|
-
const extraClass = typeNumber(value) ? 'bold' : 'title'
|
|
92
|
-
const attrs = { class: generClass(style) + ` ${extraClass}` }
|
|
93
|
-
const div = <div {...attrs}>{value}</div>
|
|
94
|
-
el.push(div)
|
|
95
|
-
}
|
|
96
|
-
return { h: 1, el: el }
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* 完整报表数据转换html函数
|
|
101
|
-
* @param h vue的h
|
|
102
|
-
* @param jsonArr json数组
|
|
103
|
-
* @returns {{el: Array, h: number}}
|
|
104
|
-
*/
|
|
105
|
-
function reportCompute (h, jsonArr) {
|
|
106
|
-
const html = []
|
|
107
|
-
let heigth = 0
|
|
108
|
-
let width = 0
|
|
109
|
-
for (const [index, row] of jsonArr.entries()) {
|
|
110
|
-
const rowHtml = rowCompute(h, row, 0, index)
|
|
111
|
-
// 取第一行的宽度作为整个报表的宽度
|
|
112
|
-
if (index == 0) {
|
|
113
|
-
const reg = /w-\d\s/
|
|
114
|
-
for (const vNode of rowHtml.el) {
|
|
115
|
-
if (!vNode.data || !vNode.data.class) continue
|
|
116
|
-
const c = vNode.data.class
|
|
117
|
-
const w = c.match(reg)[0].split('-')[1]
|
|
118
|
-
width += (w - 0)
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
heigth += rowHtml.h
|
|
122
|
-
html.push(rowHtml.el)
|
|
123
|
-
}
|
|
124
|
-
return { el: html, h: heigth, w: width }
|
|
125
|
-
}
|
|
1
|
+
export default {
|
|
2
|
+
name: 'ReportTable',
|
|
3
|
+
functional: true,
|
|
4
|
+
render (h, content) {
|
|
5
|
+
if (!content.props.tableData) {
|
|
6
|
+
console.log('没有报表数据')
|
|
7
|
+
return
|
|
8
|
+
}
|
|
9
|
+
console.log('content=>', content)
|
|
10
|
+
const html = reportCompute(h, content.props.tableData)
|
|
11
|
+
console.log('html=>', html)
|
|
12
|
+
// 报表整体高度和宽度
|
|
13
|
+
const reportClass = `h-${html.h} w-${html.w}`
|
|
14
|
+
const report = (
|
|
15
|
+
<div id='ReportTableHome'>
|
|
16
|
+
<div id='reportTable' class={reportClass}>
|
|
17
|
+
{html.el}
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
)
|
|
21
|
+
return report
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* class类生成
|
|
26
|
+
* @param w 宽
|
|
27
|
+
* @param h 高
|
|
28
|
+
* @param l left
|
|
29
|
+
* @param t top
|
|
30
|
+
* @returns {string}
|
|
31
|
+
*/
|
|
32
|
+
function generClass ({ w = 1, h = 1, l, t }) {
|
|
33
|
+
return `w-${w} h-${h} l-${l} t-${t}`
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* 判断是否是个Number数据
|
|
37
|
+
* @param value
|
|
38
|
+
* @returns {boolean}
|
|
39
|
+
*/
|
|
40
|
+
function typeNumber (value) {
|
|
41
|
+
return Object.prototype.toString.call(value) === '[object Number]'
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 判断是否是个object数据
|
|
45
|
+
* @param value
|
|
46
|
+
* @returns {boolean}
|
|
47
|
+
*/
|
|
48
|
+
function typeObject (value) {
|
|
49
|
+
return Object.prototype.toString.call(value) === '[object Object]'
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* 判断是否是个Array数据
|
|
53
|
+
* @param value
|
|
54
|
+
* @returns {boolean}
|
|
55
|
+
*/
|
|
56
|
+
function typeArray (value) {
|
|
57
|
+
return Object.prototype.toString.call(value) === '[object Array]'
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* 一行数据转换html函数
|
|
61
|
+
* @param h vue的h
|
|
62
|
+
* @param row 一行json数据
|
|
63
|
+
* @param left 起始left距离
|
|
64
|
+
* @param top 起始top距离
|
|
65
|
+
* @returns {{el: Array, h: number}}
|
|
66
|
+
*/
|
|
67
|
+
function rowCompute (h, row, left, top) {
|
|
68
|
+
if (typeObject(row)) {
|
|
69
|
+
const el = []
|
|
70
|
+
const keys = Object.keys(row).filter((res) => res != 'span')
|
|
71
|
+
let heigth = 0
|
|
72
|
+
for (const key of keys.values()) {
|
|
73
|
+
const value = row[key]['value'] ? row[key]['value'] : row[key]
|
|
74
|
+
const style = { l: left, t: top + heigth }
|
|
75
|
+
style.w = row[key]['span'] ? row[key]['span'] : 1
|
|
76
|
+
const nextL = left + style.w
|
|
77
|
+
const nextT = top + heigth
|
|
78
|
+
const divObject = rowCompute(h, value, nextL, nextT)
|
|
79
|
+
el.push(divObject.el)
|
|
80
|
+
style.h = divObject.h ? divObject.h : 1
|
|
81
|
+
heigth += style.h
|
|
82
|
+
const attrs = { class: generClass(style) + ' title' }
|
|
83
|
+
const div = <div {...attrs}>{key == 'value' ? value : key}</div>
|
|
84
|
+
el.push(div)
|
|
85
|
+
}
|
|
86
|
+
return { h: heigth, el: el }
|
|
87
|
+
} else if (typeArray(row)) {
|
|
88
|
+
const el = []
|
|
89
|
+
for (const [i, value] of row.entries()) {
|
|
90
|
+
const style = { l: (left + i), t: top, w: 1, h: 1 }
|
|
91
|
+
const extraClass = typeNumber(value) ? 'bold' : 'title'
|
|
92
|
+
const attrs = { class: generClass(style) + ` ${extraClass}` }
|
|
93
|
+
const div = <div {...attrs}>{value}</div>
|
|
94
|
+
el.push(div)
|
|
95
|
+
}
|
|
96
|
+
return { h: 1, el: el }
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* 完整报表数据转换html函数
|
|
101
|
+
* @param h vue的h
|
|
102
|
+
* @param jsonArr json数组
|
|
103
|
+
* @returns {{el: Array, h: number}}
|
|
104
|
+
*/
|
|
105
|
+
function reportCompute (h, jsonArr) {
|
|
106
|
+
const html = []
|
|
107
|
+
let heigth = 0
|
|
108
|
+
let width = 0
|
|
109
|
+
for (const [index, row] of jsonArr.entries()) {
|
|
110
|
+
const rowHtml = rowCompute(h, row, 0, index)
|
|
111
|
+
// 取第一行的宽度作为整个报表的宽度
|
|
112
|
+
if (index == 0) {
|
|
113
|
+
const reg = /w-\d\s/
|
|
114
|
+
for (const vNode of rowHtml.el) {
|
|
115
|
+
if (!vNode.data || !vNode.data.class) continue
|
|
116
|
+
const c = vNode.data.class
|
|
117
|
+
const w = c.match(reg)[0].split('-')[1]
|
|
118
|
+
width += (w - 0)
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
heigth += rowHtml.h
|
|
122
|
+
html.push(rowHtml.el)
|
|
123
|
+
}
|
|
124
|
+
return { el: html, h: heigth, w: width }
|
|
125
|
+
}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script>
|
|
6
|
-
import { post } from '
|
|
7
|
-
import ReportTable from '
|
|
6
|
+
import { post } from '@vue2-client/services/api/restTools'
|
|
7
|
+
import ReportTable from '@vue2-client/pages/report/ReportTable'
|
|
8
8
|
export default {
|
|
9
9
|
name: 'ReportTableHome',
|
|
10
10
|
components: { ReportTable },
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
<script>
|
|
19
19
|
import { mapState } from 'vuex'
|
|
20
|
-
import { getResourceFunction } from '
|
|
20
|
+
import { getResourceFunction } from '@vue2-client/base-client/plugins/GetLoginInfoService'
|
|
21
21
|
|
|
22
22
|
export default {
|
|
23
23
|
name: 'resourceManageMain',
|