vue2-client 1.18.36 → 1.18.37
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 +90 -90
- package/Components.md +60 -60
- package/docs/index.md +30 -30
- package/index.js +31 -31
- package/jest-transform-stub.js +8 -8
- package/jest.setup.js +7 -7
- package/package.json +1 -1
- package/src/assets/img/querySlotDemo.svg +15 -15
- package/src/base-client/components/common/AmapMarker/AmapPointRendering.vue +120 -120
- package/src/base-client/components/common/CitySelect/index.js +3 -3
- package/src/base-client/components/common/CitySelect/index.md +109 -109
- package/src/base-client/components/common/CreateQuery/CreateQuery.vue +669 -669
- package/src/base-client/components/common/CreateQuery/index.js +3 -3
- package/src/base-client/components/common/CreateQuery/index.md +42 -42
- package/src/base-client/components/common/CreateSimpleFormQuery/index.js +3 -3
- package/src/base-client/components/common/CreateSimpleFormQuery/index.md +42 -42
- package/src/base-client/components/common/FormGroupEdit/index.js +3 -3
- package/src/base-client/components/common/FormGroupEdit/index.md +43 -43
- package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +166 -166
- package/src/base-client/components/common/FormGroupQuery/index.js +3 -3
- package/src/base-client/components/common/FormGroupQuery/index.md +43 -43
- package/src/base-client/components/common/JSONToTree/jsontotree.vue +271 -271
- package/src/base-client/components/common/PersonSetting/PersonSetting.vue +208 -208
- package/src/base-client/components/common/PersonSetting/index.js +3 -3
- package/src/base-client/components/common/Tree/Tree.vue +149 -149
- package/src/base-client/components/common/Tree/index.js +2 -2
- package/src/base-client/components/common/Upload/index.js +3 -3
- package/src/base-client/components/common/XAddNativeForm/index.md +146 -146
- package/src/base-client/components/common/XCard/XCard.vue +64 -64
- package/src/base-client/components/common/XDataDrawer/XDataDrawer.vue +180 -180
- package/src/base-client/components/common/XDataDrawer/index.js +3 -3
- package/src/base-client/components/common/XDataDrawer/index.md +41 -41
- package/src/base-client/components/common/XDescriptions/XDescriptions.vue +174 -174
- package/src/base-client/components/common/XDescriptions/index.js +3 -3
- package/src/base-client/components/common/XDescriptions/index.md +322 -322
- package/src/base-client/components/common/XForm/index.md +178 -178
- package/src/base-client/components/common/XFormTable/demo.vue +125 -125
- package/src/base-client/components/common/XSimpleDescriptions/XSimpleDescriptions.vue +166 -166
- package/src/base-client/components/common/XStepView/XStepView.vue +252 -252
- package/src/base-client/components/common/XStepView/index.js +3 -3
- package/src/base-client/components/common/XStepView/index.md +31 -31
- package/src/base-client/components/common/XTable/XTable.vue +1715 -1715
- package/src/base-client/components/common/XTable/XTableWrapper.vue +759 -756
- package/src/base-client/components/common/XTable/index.md +255 -255
- package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +232 -232
- package/src/base-client/plugins/Config.js +19 -19
- package/src/base-client/plugins/tabs-page-plugin.js +39 -39
- package/src/components/Charts/Bar.vue +62 -62
- package/src/components/Charts/ChartCard.vue +134 -134
- package/src/components/Charts/Liquid.vue +67 -67
- package/src/components/Charts/MiniArea.vue +39 -39
- package/src/components/Charts/MiniBar.vue +39 -39
- package/src/components/Charts/MiniProgress.vue +75 -75
- package/src/components/Charts/MiniSmoothArea.vue +40 -40
- package/src/components/Charts/Radar.vue +68 -68
- package/src/components/Charts/RankList.vue +77 -77
- package/src/components/Charts/TagCloud.vue +113 -113
- package/src/components/Charts/TransferBar.vue +64 -64
- package/src/components/Charts/Trend.vue +82 -82
- package/src/components/Charts/chart.less +12 -12
- package/src/components/Charts/smooth.area.less +13 -13
- package/src/components/NumberInfo/NumberInfo.vue +54 -54
- package/src/components/NumberInfo/index.js +3 -3
- package/src/components/NumberInfo/index.less +54 -54
- package/src/components/NumberInfo/index.md +43 -43
- package/src/components/card/ChartCard.vue +79 -79
- package/src/components/chart/Bar.vue +60 -60
- package/src/components/chart/MiniArea.vue +67 -67
- package/src/components/chart/MiniBar.vue +59 -59
- package/src/components/chart/MiniProgress.vue +57 -57
- package/src/components/chart/Radar.vue +80 -80
- package/src/components/chart/RankingList.vue +60 -60
- package/src/components/chart/Trend.vue +79 -79
- package/src/components/chart/index.less +9 -9
- package/src/components/checkbox/ColorCheckbox.vue +157 -157
- package/src/components/input/IInput.vue +66 -66
- package/src/components/menu/SideMenu.vue +75 -75
- package/src/components/menu/menu.js +273 -273
- package/src/components/tool/AStepItem.vue +60 -60
- package/src/config/CreateQueryConfig.js +325 -325
- package/src/layouts/CommonLayout.vue +56 -56
- package/src/layouts/header/HeaderNotice.vue +177 -177
- package/src/lib.js +1 -1
- package/src/mock/extend/index.js +84 -84
- package/src/mock/goods/index.js +108 -108
- package/src/pages/XTreeOneProExample/index.vue +67 -67
- package/src/pages/dashboard/workplace/WorkPlace.vue +141 -141
- package/src/pages/system/dictionary/index.vue +44 -44
- package/src/pages/system/monitor/loginInfor/index.vue +37 -37
- package/src/pages/system/monitor/operLog/index.vue +37 -37
- package/src/services/api/cas.js +79 -79
- package/src/store/modules/setting.js +119 -119
- package/src/utils/authority-utils.js +85 -85
- package/src/utils/errorCode.js +6 -6
- package//350/277/201/347/247/273/346/227/245/345/277/227.md +15 -15
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import NumberInfo from './NumberInfo'
|
|
2
|
-
|
|
3
|
-
export default NumberInfo
|
|
1
|
+
import NumberInfo from './NumberInfo'
|
|
2
|
+
|
|
3
|
+
export default NumberInfo
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
@import "../index";
|
|
2
|
-
|
|
3
|
-
@numberInfo-prefix-cls: ~"@{ant-pro-prefix}-number-info";
|
|
4
|
-
|
|
5
|
-
.@{numberInfo-prefix-cls} {
|
|
6
|
-
|
|
7
|
-
.ant-pro-number-info-subtitle {
|
|
8
|
-
color: @text-color-secondary;
|
|
9
|
-
font-size: @font-size-base;
|
|
10
|
-
height: 22px;
|
|
11
|
-
line-height: 22px;
|
|
12
|
-
overflow: hidden;
|
|
13
|
-
text-overflow: ellipsis;
|
|
14
|
-
word-break: break-all;
|
|
15
|
-
white-space: nowrap;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.number-info-value {
|
|
19
|
-
margin-top: 4px;
|
|
20
|
-
font-size: 0;
|
|
21
|
-
overflow: hidden;
|
|
22
|
-
text-overflow: ellipsis;
|
|
23
|
-
word-break: break-all;
|
|
24
|
-
white-space: nowrap;
|
|
25
|
-
|
|
26
|
-
& > span {
|
|
27
|
-
color: @heading-color;
|
|
28
|
-
display: inline-block;
|
|
29
|
-
line-height: 32px;
|
|
30
|
-
height: 32px;
|
|
31
|
-
font-size: 24px;
|
|
32
|
-
margin-right: 32px;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.sub-total {
|
|
36
|
-
color: @text-color-secondary;
|
|
37
|
-
font-size: @font-size-lg;
|
|
38
|
-
vertical-align: top;
|
|
39
|
-
margin-right: 0;
|
|
40
|
-
i {
|
|
41
|
-
font-size: 12px;
|
|
42
|
-
transform: scale(0.82);
|
|
43
|
-
margin-left: 4px;
|
|
44
|
-
}
|
|
45
|
-
:global {
|
|
46
|
-
.anticon-caret-up {
|
|
47
|
-
color: @red-6;
|
|
48
|
-
}
|
|
49
|
-
.anticon-caret-down {
|
|
50
|
-
color: @green-6;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
1
|
+
@import "../index";
|
|
2
|
+
|
|
3
|
+
@numberInfo-prefix-cls: ~"@{ant-pro-prefix}-number-info";
|
|
4
|
+
|
|
5
|
+
.@{numberInfo-prefix-cls} {
|
|
6
|
+
|
|
7
|
+
.ant-pro-number-info-subtitle {
|
|
8
|
+
color: @text-color-secondary;
|
|
9
|
+
font-size: @font-size-base;
|
|
10
|
+
height: 22px;
|
|
11
|
+
line-height: 22px;
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
text-overflow: ellipsis;
|
|
14
|
+
word-break: break-all;
|
|
15
|
+
white-space: nowrap;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.number-info-value {
|
|
19
|
+
margin-top: 4px;
|
|
20
|
+
font-size: 0;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
text-overflow: ellipsis;
|
|
23
|
+
word-break: break-all;
|
|
24
|
+
white-space: nowrap;
|
|
25
|
+
|
|
26
|
+
& > span {
|
|
27
|
+
color: @heading-color;
|
|
28
|
+
display: inline-block;
|
|
29
|
+
line-height: 32px;
|
|
30
|
+
height: 32px;
|
|
31
|
+
font-size: 24px;
|
|
32
|
+
margin-right: 32px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.sub-total {
|
|
36
|
+
color: @text-color-secondary;
|
|
37
|
+
font-size: @font-size-lg;
|
|
38
|
+
vertical-align: top;
|
|
39
|
+
margin-right: 0;
|
|
40
|
+
i {
|
|
41
|
+
font-size: 12px;
|
|
42
|
+
transform: scale(0.82);
|
|
43
|
+
margin-left: 4px;
|
|
44
|
+
}
|
|
45
|
+
:global {
|
|
46
|
+
.anticon-caret-up {
|
|
47
|
+
color: @red-6;
|
|
48
|
+
}
|
|
49
|
+
.anticon-caret-down {
|
|
50
|
+
color: @green-6;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
55
|
}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
# NumberInfo 数据文本
|
|
2
|
-
|
|
3
|
-
常用在数据卡片中,用于突出展示某个业务数据。
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
引用方式:
|
|
8
|
-
|
|
9
|
-
```javascript
|
|
10
|
-
import NumberInfo from '@vue2-client/components/NumberInfo'
|
|
11
|
-
|
|
12
|
-
export default {
|
|
13
|
-
components: {
|
|
14
|
-
NumberInfo
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
## 代码演示 [demo](https://pro.loacg.com/test/home)
|
|
22
|
-
|
|
23
|
-
```html
|
|
24
|
-
<number-info
|
|
25
|
-
:sub-title="() => { return 'Visits this week' }"
|
|
26
|
-
:total="12321"
|
|
27
|
-
status="up"
|
|
28
|
-
:sub-total="17.1"></number-info>
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
## API
|
|
34
|
-
|
|
35
|
-
| 参数 | 说明 | 类型 | 默认值 |
|
|
36
|
-
|----------|------------------|------------|---------|
|
|
37
|
-
| title | 标题 | ReactNode\ | string | -
|
|
38
|
-
| subTitle | 子标题 | ReactNode\ | string | -
|
|
39
|
-
| total | 总量 | ReactNode\ | string | -
|
|
40
|
-
| subTotal | 子总量 | ReactNode\ | string | -
|
|
41
|
-
| status | 增加状态 | 'up \ | down' | -
|
|
42
|
-
| theme | 状态样式 | string | 'light' |
|
|
43
|
-
| gap | 设置数字和描述之间的间距(像素) | number | 8 |
|
|
1
|
+
# NumberInfo 数据文本
|
|
2
|
+
|
|
3
|
+
常用在数据卡片中,用于突出展示某个业务数据。
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
引用方式:
|
|
8
|
+
|
|
9
|
+
```javascript
|
|
10
|
+
import NumberInfo from '@vue2-client/components/NumberInfo'
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
components: {
|
|
14
|
+
NumberInfo
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## 代码演示 [demo](https://pro.loacg.com/test/home)
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<number-info
|
|
25
|
+
:sub-title="() => { return 'Visits this week' }"
|
|
26
|
+
:total="12321"
|
|
27
|
+
status="up"
|
|
28
|
+
:sub-total="17.1"></number-info>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## API
|
|
34
|
+
|
|
35
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
36
|
+
|----------|------------------|------------|---------|
|
|
37
|
+
| title | 标题 | ReactNode\ | string | -
|
|
38
|
+
| subTitle | 子标题 | ReactNode\ | string | -
|
|
39
|
+
| total | 总量 | ReactNode\ | string | -
|
|
40
|
+
| subTotal | 子总量 | ReactNode\ | string | -
|
|
41
|
+
| status | 增加状态 | 'up \ | down' | -
|
|
42
|
+
| theme | 状态样式 | string | 'light' |
|
|
43
|
+
| gap | 设置数字和描述之间的间距(像素) | number | 8 |
|
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<a-card :loading="loading" :body-style="{padding: '20px 24px 8px'}" :bordered="false">
|
|
3
|
-
<div class="chart-card-header">
|
|
4
|
-
<div class="meta">
|
|
5
|
-
<span class="chart-card-title">{{ title }}</span>
|
|
6
|
-
<span class="chart-card-action">
|
|
7
|
-
<slot name="action"></slot>
|
|
8
|
-
</span>
|
|
9
|
-
</div>
|
|
10
|
-
<div class="total"><span>{{ total }}</span></div>
|
|
11
|
-
</div>
|
|
12
|
-
<div class="chart-card-content">
|
|
13
|
-
<div class="content-fix">
|
|
14
|
-
<slot></slot>
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
17
|
-
<div class="chart-card-footer">
|
|
18
|
-
<slot name="footer"></slot>
|
|
19
|
-
</div>
|
|
20
|
-
</a-card>
|
|
21
|
-
</template>
|
|
22
|
-
|
|
23
|
-
<script>
|
|
24
|
-
export default {
|
|
25
|
-
name: 'ChartCard',
|
|
26
|
-
// eslint-disable-next-line vue/require-prop-types
|
|
27
|
-
props: ['title', 'total', 'loading']
|
|
28
|
-
}
|
|
29
|
-
</script>
|
|
30
|
-
|
|
31
|
-
<style scoped lang="less">
|
|
32
|
-
.chart-card-header{
|
|
33
|
-
position: relative;
|
|
34
|
-
overflow: hidden;
|
|
35
|
-
width: 100%;
|
|
36
|
-
}
|
|
37
|
-
.chart-card-header .meta{
|
|
38
|
-
position: relative;
|
|
39
|
-
overflow: hidden;
|
|
40
|
-
width: 100%;
|
|
41
|
-
color: @text-color-second;
|
|
42
|
-
font-size: 14px;
|
|
43
|
-
line-height: 22px;
|
|
44
|
-
}
|
|
45
|
-
.chart-card-action{
|
|
46
|
-
cursor: pointer;
|
|
47
|
-
position: absolute;
|
|
48
|
-
top: 0;
|
|
49
|
-
right: 0;
|
|
50
|
-
}
|
|
51
|
-
.total {
|
|
52
|
-
overflow: hidden;
|
|
53
|
-
text-overflow: ellipsis;
|
|
54
|
-
word-break: break-all;
|
|
55
|
-
white-space: nowrap;
|
|
56
|
-
margin-top: 4px;
|
|
57
|
-
margin-bottom: 0;
|
|
58
|
-
font-size: 30px;
|
|
59
|
-
line-height: 38px;
|
|
60
|
-
height: 38px;
|
|
61
|
-
}
|
|
62
|
-
.chart-card-footer{
|
|
63
|
-
border-top: 1px solid @border-color-base;
|
|
64
|
-
padding-top: 9px;
|
|
65
|
-
margin-top: 8px;
|
|
66
|
-
}
|
|
67
|
-
.chart-card-content{
|
|
68
|
-
margin-bottom: 12px;
|
|
69
|
-
position: relative;
|
|
70
|
-
height: 46px;
|
|
71
|
-
width: 100%;
|
|
72
|
-
}
|
|
73
|
-
.chart-card-content .content-fix{
|
|
74
|
-
position: absolute;
|
|
75
|
-
left: 0;
|
|
76
|
-
bottom: 0;
|
|
77
|
-
width: 100%;
|
|
78
|
-
}
|
|
79
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<a-card :loading="loading" :body-style="{padding: '20px 24px 8px'}" :bordered="false">
|
|
3
|
+
<div class="chart-card-header">
|
|
4
|
+
<div class="meta">
|
|
5
|
+
<span class="chart-card-title">{{ title }}</span>
|
|
6
|
+
<span class="chart-card-action">
|
|
7
|
+
<slot name="action"></slot>
|
|
8
|
+
</span>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="total"><span>{{ total }}</span></div>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="chart-card-content">
|
|
13
|
+
<div class="content-fix">
|
|
14
|
+
<slot></slot>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
<div class="chart-card-footer">
|
|
18
|
+
<slot name="footer"></slot>
|
|
19
|
+
</div>
|
|
20
|
+
</a-card>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script>
|
|
24
|
+
export default {
|
|
25
|
+
name: 'ChartCard',
|
|
26
|
+
// eslint-disable-next-line vue/require-prop-types
|
|
27
|
+
props: ['title', 'total', 'loading']
|
|
28
|
+
}
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<style scoped lang="less">
|
|
32
|
+
.chart-card-header{
|
|
33
|
+
position: relative;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
width: 100%;
|
|
36
|
+
}
|
|
37
|
+
.chart-card-header .meta{
|
|
38
|
+
position: relative;
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
width: 100%;
|
|
41
|
+
color: @text-color-second;
|
|
42
|
+
font-size: 14px;
|
|
43
|
+
line-height: 22px;
|
|
44
|
+
}
|
|
45
|
+
.chart-card-action{
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
position: absolute;
|
|
48
|
+
top: 0;
|
|
49
|
+
right: 0;
|
|
50
|
+
}
|
|
51
|
+
.total {
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
text-overflow: ellipsis;
|
|
54
|
+
word-break: break-all;
|
|
55
|
+
white-space: nowrap;
|
|
56
|
+
margin-top: 4px;
|
|
57
|
+
margin-bottom: 0;
|
|
58
|
+
font-size: 30px;
|
|
59
|
+
line-height: 38px;
|
|
60
|
+
height: 38px;
|
|
61
|
+
}
|
|
62
|
+
.chart-card-footer{
|
|
63
|
+
border-top: 1px solid @border-color-base;
|
|
64
|
+
padding-top: 9px;
|
|
65
|
+
margin-top: 8px;
|
|
66
|
+
}
|
|
67
|
+
.chart-card-content{
|
|
68
|
+
margin-bottom: 12px;
|
|
69
|
+
position: relative;
|
|
70
|
+
height: 46px;
|
|
71
|
+
width: 100%;
|
|
72
|
+
}
|
|
73
|
+
.chart-card-content .content-fix{
|
|
74
|
+
position: absolute;
|
|
75
|
+
left: 0;
|
|
76
|
+
bottom: 0;
|
|
77
|
+
width: 100%;
|
|
78
|
+
}
|
|
79
|
+
</style>
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="bar">
|
|
3
|
-
<h4>{{ title }}</h4>
|
|
4
|
-
<div class="chart">
|
|
5
|
-
<v-chart :force-fit="true" height="312" :data="data" :padding="[24, 0, 0, 0]">
|
|
6
|
-
<v-tooltip />
|
|
7
|
-
<v-axis />
|
|
8
|
-
<v-bar position="x*y"/>
|
|
9
|
-
</v-chart>
|
|
10
|
-
</div>
|
|
11
|
-
</div>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script>
|
|
15
|
-
|
|
16
|
-
const data = []
|
|
17
|
-
for (let i = 0; i < 12; i += 1) {
|
|
18
|
-
data.push({
|
|
19
|
-
x: `${i + 1}月`,
|
|
20
|
-
y: Math.floor(Math.random() * 1000) + 200
|
|
21
|
-
})
|
|
22
|
-
}
|
|
23
|
-
const tooltip = [
|
|
24
|
-
'x*y',
|
|
25
|
-
(x, y) => ({
|
|
26
|
-
name: x,
|
|
27
|
-
value: y
|
|
28
|
-
})
|
|
29
|
-
]
|
|
30
|
-
|
|
31
|
-
const scale = [{
|
|
32
|
-
dataKey: 'x',
|
|
33
|
-
min: 2
|
|
34
|
-
}, {
|
|
35
|
-
dataKey: 'y',
|
|
36
|
-
title: '时间',
|
|
37
|
-
min: 1,
|
|
38
|
-
max: 22
|
|
39
|
-
}]
|
|
40
|
-
export default {
|
|
41
|
-
name: 'Bar',
|
|
42
|
-
// eslint-disable-next-line vue/require-prop-types
|
|
43
|
-
props: ['title'],
|
|
44
|
-
data () {
|
|
45
|
-
return {
|
|
46
|
-
data,
|
|
47
|
-
scale,
|
|
48
|
-
tooltip
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
</script>
|
|
53
|
-
|
|
54
|
-
<style scoped lang="less">
|
|
55
|
-
.bar{
|
|
56
|
-
position: relative;
|
|
57
|
-
.chart{
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="bar">
|
|
3
|
+
<h4>{{ title }}</h4>
|
|
4
|
+
<div class="chart">
|
|
5
|
+
<v-chart :force-fit="true" height="312" :data="data" :padding="[24, 0, 0, 0]">
|
|
6
|
+
<v-tooltip />
|
|
7
|
+
<v-axis />
|
|
8
|
+
<v-bar position="x*y"/>
|
|
9
|
+
</v-chart>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
|
|
16
|
+
const data = []
|
|
17
|
+
for (let i = 0; i < 12; i += 1) {
|
|
18
|
+
data.push({
|
|
19
|
+
x: `${i + 1}月`,
|
|
20
|
+
y: Math.floor(Math.random() * 1000) + 200
|
|
21
|
+
})
|
|
22
|
+
}
|
|
23
|
+
const tooltip = [
|
|
24
|
+
'x*y',
|
|
25
|
+
(x, y) => ({
|
|
26
|
+
name: x,
|
|
27
|
+
value: y
|
|
28
|
+
})
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
const scale = [{
|
|
32
|
+
dataKey: 'x',
|
|
33
|
+
min: 2
|
|
34
|
+
}, {
|
|
35
|
+
dataKey: 'y',
|
|
36
|
+
title: '时间',
|
|
37
|
+
min: 1,
|
|
38
|
+
max: 22
|
|
39
|
+
}]
|
|
40
|
+
export default {
|
|
41
|
+
name: 'Bar',
|
|
42
|
+
// eslint-disable-next-line vue/require-prop-types
|
|
43
|
+
props: ['title'],
|
|
44
|
+
data () {
|
|
45
|
+
return {
|
|
46
|
+
data,
|
|
47
|
+
scale,
|
|
48
|
+
tooltip
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
<style scoped lang="less">
|
|
55
|
+
.bar{
|
|
56
|
+
position: relative;
|
|
57
|
+
.chart{
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
</style>
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="mini-chart">
|
|
3
|
-
<div class="chart-content" :style="{height: 46}">
|
|
4
|
-
<v-chart :force-fit="true" :height="height" :data="data" :padding="[36, 5, 18, 5]">
|
|
5
|
-
<v-tooltip />
|
|
6
|
-
<v-smooth-area position="x*y" />
|
|
7
|
-
</v-chart>
|
|
8
|
-
</div>
|
|
9
|
-
</div>
|
|
10
|
-
</template>
|
|
11
|
-
|
|
12
|
-
<script>
|
|
13
|
-
import { format } from 'date-fns'
|
|
14
|
-
|
|
15
|
-
const data = []
|
|
16
|
-
const beginDay = new Date().getTime()
|
|
17
|
-
|
|
18
|
-
const fakeY = [7, 5, 4, 2, 4, 7, 5, 6, 5, 9, 6, 3, 1, 5, 3, 6, 5]
|
|
19
|
-
for (let i = 0; i < fakeY.length; i += 1) {
|
|
20
|
-
data.push({
|
|
21
|
-
x: format(new Date(beginDay + 1000 * 60 * 60 * 24 * i), 'yyyy-MM-dd'),
|
|
22
|
-
y: fakeY[i]
|
|
23
|
-
})
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const tooltip = [
|
|
27
|
-
'x*y',
|
|
28
|
-
(x, y) => ({
|
|
29
|
-
name: x,
|
|
30
|
-
value: y
|
|
31
|
-
})
|
|
32
|
-
]
|
|
33
|
-
|
|
34
|
-
const scale = [{
|
|
35
|
-
dataKey: 'x',
|
|
36
|
-
min: 2
|
|
37
|
-
}, {
|
|
38
|
-
dataKey: 'y',
|
|
39
|
-
title: '时间',
|
|
40
|
-
min: 1,
|
|
41
|
-
max: 22
|
|
42
|
-
}]
|
|
43
|
-
|
|
44
|
-
export default {
|
|
45
|
-
name: 'MiniArea',
|
|
46
|
-
data () {
|
|
47
|
-
return {
|
|
48
|
-
data,
|
|
49
|
-
scale,
|
|
50
|
-
tooltip,
|
|
51
|
-
height: 100
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
</script>
|
|
56
|
-
|
|
57
|
-
<style scoped>
|
|
58
|
-
.mini-chart {
|
|
59
|
-
position: relative;
|
|
60
|
-
width: 100%
|
|
61
|
-
}
|
|
62
|
-
.mini-chart .chart-content{
|
|
63
|
-
position: absolute;
|
|
64
|
-
bottom: -28px;
|
|
65
|
-
width: 100%;
|
|
66
|
-
}
|
|
67
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="mini-chart">
|
|
3
|
+
<div class="chart-content" :style="{height: 46}">
|
|
4
|
+
<v-chart :force-fit="true" :height="height" :data="data" :padding="[36, 5, 18, 5]">
|
|
5
|
+
<v-tooltip />
|
|
6
|
+
<v-smooth-area position="x*y" />
|
|
7
|
+
</v-chart>
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
import { format } from 'date-fns'
|
|
14
|
+
|
|
15
|
+
const data = []
|
|
16
|
+
const beginDay = new Date().getTime()
|
|
17
|
+
|
|
18
|
+
const fakeY = [7, 5, 4, 2, 4, 7, 5, 6, 5, 9, 6, 3, 1, 5, 3, 6, 5]
|
|
19
|
+
for (let i = 0; i < fakeY.length; i += 1) {
|
|
20
|
+
data.push({
|
|
21
|
+
x: format(new Date(beginDay + 1000 * 60 * 60 * 24 * i), 'yyyy-MM-dd'),
|
|
22
|
+
y: fakeY[i]
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const tooltip = [
|
|
27
|
+
'x*y',
|
|
28
|
+
(x, y) => ({
|
|
29
|
+
name: x,
|
|
30
|
+
value: y
|
|
31
|
+
})
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
const scale = [{
|
|
35
|
+
dataKey: 'x',
|
|
36
|
+
min: 2
|
|
37
|
+
}, {
|
|
38
|
+
dataKey: 'y',
|
|
39
|
+
title: '时间',
|
|
40
|
+
min: 1,
|
|
41
|
+
max: 22
|
|
42
|
+
}]
|
|
43
|
+
|
|
44
|
+
export default {
|
|
45
|
+
name: 'MiniArea',
|
|
46
|
+
data () {
|
|
47
|
+
return {
|
|
48
|
+
data,
|
|
49
|
+
scale,
|
|
50
|
+
tooltip,
|
|
51
|
+
height: 100
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
</script>
|
|
56
|
+
|
|
57
|
+
<style scoped>
|
|
58
|
+
.mini-chart {
|
|
59
|
+
position: relative;
|
|
60
|
+
width: 100%
|
|
61
|
+
}
|
|
62
|
+
.mini-chart .chart-content{
|
|
63
|
+
position: absolute;
|
|
64
|
+
bottom: -28px;
|
|
65
|
+
width: 100%;
|
|
66
|
+
}
|
|
67
|
+
</style>
|