Compare commits
250 Commits
V2.3.2-alp
...
V2.9.8-alp
Author | SHA1 | Date | |
---|---|---|---|
751eb2f29b | |||
30a343307e | |||
6630bc1e84 | |||
687ccfaab8 | |||
1082be1251 | |||
e67b4d5403 | |||
1c7e03bff8 | |||
c5ff0cd474 | |||
1e76c1c0ec | |||
731d89fb1a | |||
dd512c05dc | |||
be97afe8a9 | |||
16013c0aa3 | |||
c3211c358e | |||
536ded2964 | |||
32b9757e0f | |||
60247e548c | |||
58d27bc6b1 | |||
e0bd76032a | |||
6139b5d9b7 | |||
c32d396f90 | |||
feada8a462 | |||
9318431c88 | |||
abba9ad931 | |||
2b06940ac7 | |||
026d9139c4 | |||
9b84417f01 | |||
86da84af2e | |||
1ea106fd83 | |||
7491b34711 | |||
a2875684ce | |||
f581aee5c3 | |||
3f5148cea3 | |||
e270fadcd2 | |||
beaef5c59a | |||
b17399416a | |||
5f3fdfc798 | |||
e7c237cbac | |||
3d3de766e3 | |||
330815d90a | |||
4f6fc240d2 | |||
1d0f369509 | |||
ea058a90c3 | |||
934e3f314a | |||
eea32d7e39 | |||
7dd7baebba | |||
4a7fdf0c1c | |||
53991795a0 | |||
dde29fa61a | |||
c82b979432 | |||
e938b66dc0 | |||
71a9be2a13 | |||
f0432e4c42 | |||
65f5b529bf | |||
054854480a | |||
6ce83e1fd8 | |||
8e5f279b6e | |||
22afc8e787 | |||
eb78915c93 | |||
22c88c4ea5 | |||
c98ca00179 | |||
c257ca6d9c | |||
ce4cf0d342 | |||
7df0c0247a | |||
df2369dfe4 | |||
db52e8cdc0 | |||
f8e438b0c4 | |||
1a13bc08c5 | |||
ba90fb2faa | |||
7799ef3dae | |||
33456176f7 | |||
dd37ba167a | |||
fdd1e243a7 | |||
57b6c726eb | |||
be410da013 | |||
d4206f066c | |||
73a5084c0e | |||
9a039b3f10 | |||
5ee1d408b6 | |||
419fa0c3a9 | |||
d2bb06a36c | |||
94824f32d8 | |||
b99410ef94 | |||
4b69668327 | |||
d15bcf34cb | |||
43a04efb62 | |||
81b8bef8e1 | |||
6467bd516f | |||
62c5998938 | |||
247221729f | |||
c48aa8ee84 | |||
b18962855c | |||
ae3345bd95 | |||
dceb761e8c | |||
bd178192f1 | |||
8c47ae03db | |||
cc14ac7670 | |||
b6c8134fa6 | |||
8f87b3cab1 | |||
005ae41e29 | |||
7e9cca32ad | |||
31d94f3cfd | |||
ca5252951f | |||
4036915fa2 | |||
431cd57aa1 | |||
c48c46335d | |||
a200e8ab41 | |||
6876dec1ca | |||
aeb021e5e4 | |||
80e29fdb9e | |||
a6727767e6 | |||
aa78fee05b | |||
b439b17593 | |||
14765c6e79 | |||
f4888ad9cd | |||
8564c23fbc | |||
325f700f08 | |||
07956687ab | |||
3ec7a22f98 | |||
d6382142a1 | |||
d21bcd304d | |||
663cfd24db | |||
3ad05eb1be | |||
bbdf7ea5a9 | |||
cabe75fed8 | |||
431dddf0b5 | |||
8b8fb00988 | |||
9f26ff6280 | |||
5c52f9d6b0 | |||
c1881757a8 | |||
a02654a565 | |||
36f9c6f8ab | |||
0b270cda52 | |||
2ca217a8af | |||
656de3a8dd | |||
915c54072d | |||
a01fcef7e4 | |||
1f1b1cb75d | |||
9b2395adf0 | |||
8d0ca493c9 | |||
6aa2d38b40 | |||
2eeac4f247 | |||
6d90ba617b | |||
8ae4aa7c17 | |||
c89f1d427a | |||
a5366587bc | |||
e777112621 | |||
d6f33bb7dc | |||
ee1d0cddf9 | |||
a7aa6278c8 | |||
e533c55536 | |||
89ea2f81b7 | |||
9562c97730 | |||
7ba058d623 | |||
a22166d868 | |||
fbc32552f0 | |||
8ad8298c6f | |||
5796c92fc6 | |||
3ebbac5de3 | |||
5c80a93f4d | |||
79bae7bea4 | |||
7b9174302e | |||
259f1e4b4c | |||
015f334212 | |||
44dffdc216 | |||
60c5ecfeba | |||
bcb78fec32 | |||
856e43dc09 | |||
b511e3d786 | |||
c281e56d6d | |||
ba35f1b252 | |||
6819fdead9 | |||
6169d2ac90 | |||
786761f1ca | |||
529b0154db | |||
26a5c3cedd | |||
10824d0c88 | |||
c34c493eb4 | |||
1708d58215 | |||
948d6e0672 | |||
0a82102ec6 | |||
1aa5979968 | |||
ff964f6b72 | |||
b2b83d9474 | |||
a1d7d4626d | |||
170facb3fc | |||
5224e80321 | |||
1c4fa02e45 | |||
70164efe70 | |||
7c0992e19f | |||
66c9a542cf | |||
47c2652ab4 | |||
2c78715ff5 | |||
4f078d984b | |||
720fd878b1 | |||
f64ed65d3a | |||
50fa3099a7 | |||
54bc52c1bf | |||
24a0c8a9e8 | |||
7bac2c6760 | |||
0f9b00b525 | |||
5376f01e3c | |||
8d1e0064a7 | |||
6adcd9c6cb | |||
3464c6b254 | |||
bd88a27ddc | |||
bc0bf58baf | |||
46c72a9a68 | |||
1c33d4d7b8 | |||
0d59ebcc04 | |||
c47f6133f4 | |||
f8870f763a | |||
9f00506e73 | |||
e069d52544 | |||
4bd17d0a07 | |||
a1edd0d6f2 | |||
3cba31db56 | |||
c6974cd2e4 | |||
56cc4534d1 | |||
8884121c4c | |||
60bf393fd7 | |||
d497dfa7d7 | |||
37469f7097 | |||
104e636bd7 | |||
0d1b1d9c29 | |||
429e5b9478 | |||
e470b2ed8a | |||
fdf5b76fe0 | |||
93bc3615ea | |||
e98f7caf96 | |||
7a2c0e7e4e | |||
b86fd4d222 | |||
3ee305df19 | |||
26a05978f5 | |||
1ed7740a39 | |||
ec1bb34018 | |||
4ab07bffcc | |||
71ce19e303 | |||
0103850f87 | |||
a88685812d | |||
ae6a779561 | |||
e108afaccf | |||
d7b6afccfe | |||
a92e36067b | |||
2d316d3629 | |||
f0fcefd08a | |||
38cb5e87de | |||
9699837d0e | |||
132a817933 | |||
2408c821e7 |
28
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
28
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: 提交Bug反馈
|
||||||
|
---
|
||||||
|
|
||||||
|
<!-- 请确定这是一个Bug反馈,而不是一个需求反馈或问题求助,否则ISSUE可能被关闭 -->
|
||||||
|
<!-- 请提供可供复现Bug的必要条件,否则ISSUE可能被关闭 -->
|
||||||
|
<!-- 创建Bug反馈前请确定你的DataV是最新版的 -->
|
||||||
|
|
||||||
|
## Bug report
|
||||||
|
|
||||||
|
#### 出现Bug的组件?
|
||||||
|
|
||||||
|
#### 组件配置数据?
|
||||||
|
<!-- (config等props,若无配置请忽略) -->
|
||||||
|
|
||||||
|
#### 控制台错误输出?
|
||||||
|
<!-- (若无错误输出请忽略) -->
|
||||||
|
|
||||||
|
#### 期望情况?
|
||||||
|
|
||||||
|
#### 实际情况?
|
||||||
|
|
||||||
|
#### 其他相关信息
|
||||||
|
|
||||||
|
- DataV版本
|
||||||
|
- 浏览器版本
|
||||||
|
- 其他
|
14
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
14
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: 新特性建议
|
||||||
|
---
|
||||||
|
|
||||||
|
<!-- 创建新特性建议前请确定你的DataV是最新版的 -->
|
||||||
|
|
||||||
|
## Feature request
|
||||||
|
|
||||||
|
#### 这个特性解决了什么问题?
|
||||||
|
|
||||||
|
#### 这个特性的实现形式?
|
||||||
|
|
||||||
|
#### 是否愿意为此特性提交PR?
|
20
.github/ISSUE_TEMPLATE/new_component_request.md
vendored
Normal file
20
.github/ISSUE_TEMPLATE/new_component_request.md
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
name: Component request
|
||||||
|
about: 新组件建议
|
||||||
|
---
|
||||||
|
|
||||||
|
<!-- 创建新组件建议前请确定你的DataV是最新版的 -->
|
||||||
|
<!-- (将[ ]修改为[x]) -->
|
||||||
|
|
||||||
|
## Component request
|
||||||
|
|
||||||
|
#### 新组件的类型?
|
||||||
|
|
||||||
|
* [ ] 边框
|
||||||
|
* [ ] 装饰
|
||||||
|
* [ ] 图表
|
||||||
|
* [ ] 其他
|
||||||
|
|
||||||
|
#### 这个组件的功能描述 (边框及装饰类,请提供样图)?
|
||||||
|
|
||||||
|
#### 是否愿意为此组件提交PR?
|
33
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
33
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<!-- (将[ ]修改为[x]) -->
|
||||||
|
|
||||||
|
**该PR的类型是?** (至少选择一个)
|
||||||
|
|
||||||
|
- [ ] Bug修复
|
||||||
|
- [ ] 新特性
|
||||||
|
- [ ] 新组件
|
||||||
|
|
||||||
|
**该PR是否向下兼容?** (选择任一)
|
||||||
|
|
||||||
|
- [ ] 是
|
||||||
|
- [ ] 否
|
||||||
|
|
||||||
|
如果为否,请描述冲突情况:
|
||||||
|
|
||||||
|
**涉及到的ISSUE:**
|
||||||
|
|
||||||
|
- [ ] 该PR如果涉及到某个ISSUE, 请在PR标题中描述出来 (例如. `fix #xxx[,#xxx]`, "xxx"为ISSUE序号)
|
||||||
|
|
||||||
|
**是否在Chrome浏览器下进行过测试?**
|
||||||
|
|
||||||
|
- [ ] 是
|
||||||
|
- [ ] 否
|
||||||
|
|
||||||
|
如果这是一个**新特性**或**新组件**相关的PR,请提供如下信息
|
||||||
|
|
||||||
|
- [ ] 添加该特性或组件的原因
|
||||||
|
- [ ] 文档应该修改哪些信息
|
||||||
|
- [ ] 测试相关
|
||||||
|
|
||||||
|
提交**新特性**或**新组件**前请先发起一个相关的ISSUE请求
|
||||||
|
|
||||||
|
**其他信息:**
|
6
.gitignore
vendored
6
.gitignore
vendored
@ -1,9 +1,7 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
node_modules
|
node_modules
|
||||||
/lib
|
package-lock.json
|
||||||
/dist
|
/deploy/config.js
|
||||||
/.svn
|
|
||||||
/DataV
|
|
||||||
|
|
||||||
# local env files
|
# local env files
|
||||||
.env.local
|
.env.local
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
src/
|
|
||||||
publish/
|
|
||||||
|
|
||||||
package-lock.json
|
|
||||||
|
|
||||||
prepublish.js
|
|
||||||
publish.js
|
|
250
CHANGELOG.md
250
CHANGELOG.md
@ -1,3 +1,251 @@
|
|||||||
|
# 2.9.8-alpha (2020-08-20)
|
||||||
|
|
||||||
|
### Optmization
|
||||||
|
|
||||||
|
- **scrollRankingBoard:** Add value formatter.
|
||||||
|
|
||||||
|
# 2.9.7-alpha (2020-08-19)
|
||||||
|
|
||||||
|
### Optmization
|
||||||
|
|
||||||
|
- **scrollBoard:** Optimize the update effect of updateRows.
|
||||||
|
|
||||||
|
# 2.9.6-alpha (2020-08-05)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- **scrollBoard:** Carousel is abnormal when carousel is page.
|
||||||
|
- **scrollRankingBoard:** Carousel is abnormal when carousel is page.
|
||||||
|
|
||||||
|
# 2.9.5-alpha (2020-08-05)
|
||||||
|
|
||||||
|
### Optmization
|
||||||
|
|
||||||
|
- **scrollBoard:** Reduce redundant node rendering.
|
||||||
|
- **scrollRankingBoard:** Reduce redundant node rendering.
|
||||||
|
- **scrollBoard:** Add api to update row data.
|
||||||
|
|
||||||
|
# 2.9.4-alpha (2020-07-03)
|
||||||
|
|
||||||
|
### Optmization
|
||||||
|
|
||||||
|
- **scrollBoard:** Optimize key value [(#8)](https://github.com/DataV-Team/DataV-React/issues/8).
|
||||||
|
|
||||||
|
# 2.9.3-alpha (2020-07-02)
|
||||||
|
|
||||||
|
### Perfect
|
||||||
|
|
||||||
|
- **uuid:** Optimization of `-` in uuid will cause abnormal svg animation [(#108)](https://github.com/DataV-Team/DataV/issues/108).
|
||||||
|
|
||||||
|
# 2.9.2-alpha (2020-06-16)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- **scrollBoard:** reset animationIndex when config upate.
|
||||||
|
|
||||||
|
# 2.9.1-alpha (2020-06-16)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- **scrollRankingBoard:** Calculation optimization of negative values [(#101)](https://github.com/DataV-Team/DataV/pull/101).
|
||||||
|
|
||||||
|
### Perfect
|
||||||
|
|
||||||
|
- **digitalFlop:** add number formatter.
|
||||||
|
|
||||||
|
# 2.9.0-alpha (2020-06-10)
|
||||||
|
|
||||||
|
### ScrollBoard
|
||||||
|
|
||||||
|
- **hoverPause:** add `hoverPause` configuration [(#96)](https://github.com/DataV-Team/DataV/pull/96).
|
||||||
|
- **mouseover:** add `mouseover` event [(#96)](https://github.com/DataV-Team/DataV/pull/96).
|
||||||
|
|
||||||
|
# 2.8.4-alpha (2020-05-25)
|
||||||
|
|
||||||
|
### Perfect
|
||||||
|
|
||||||
|
- **uuid:** Use uuid to produce unique id.
|
||||||
|
|
||||||
|
# 2.8.3-alpha (2020-05-06)
|
||||||
|
|
||||||
|
### Perfect
|
||||||
|
|
||||||
|
- **activeRingChart:** add `showOriginValue` configuration.
|
||||||
|
- **capsuleChart:** add `showValue` configuration.
|
||||||
|
|
||||||
|
# 2.8.2-alpha (2020-05-06)
|
||||||
|
|
||||||
|
### Perfect
|
||||||
|
|
||||||
|
- **borderBox8:** add `reverse` configuration.
|
||||||
|
|
||||||
|
# 2.8.1-alpha (2020-05-03)
|
||||||
|
|
||||||
|
### Perfect
|
||||||
|
|
||||||
|
- **digitalFlop:** Use `\n` to start a newline.
|
||||||
|
- **digitalFlop:** `rowGap` configuration.
|
||||||
|
|
||||||
|
# 2.7.4-alpha (2020-04-15)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- **capsuleChart:** Calculate exception when min value is less 5 [(#59)](https://github.com/DataV-Team/DataV/pull/59).
|
||||||
|
|
||||||
|
# 2.7.3-alpha (2020-01-16)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- **activeRingChart:** `parseInt` precision lost.
|
||||||
|
|
||||||
|
# 2.7.2-alpha (2020-01-10)
|
||||||
|
|
||||||
|
### Perfect
|
||||||
|
|
||||||
|
- **ativeRingChart:** Add digitalFlopToFixed configuration.
|
||||||
|
|
||||||
|
# 2.7.1-alpha (2020-01-08)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- **flylineChartEnhanced:** Exception when relative is false.
|
||||||
|
|
||||||
|
# 2.7.0-alpha (2020-01-05)
|
||||||
|
|
||||||
|
### New
|
||||||
|
|
||||||
|
- **flylineChartEnhanced:** Enhanced flylineChart [(#12)](https://github.com/DataV-Team/DataV/issues/12).
|
||||||
|
|
||||||
|
# 2.6.0-alpha (2019-12-25)
|
||||||
|
|
||||||
|
### Perfect
|
||||||
|
|
||||||
|
- **scrollRankingBoard:** Configurable auto-sequencing [(#35)](https://github.com/DataV-Team/DataV/pull/35).
|
||||||
|
- **scrollRankingBoard:** Render name using `v-html` [(#36)](https://github.com/DataV-Team/DataV/pull/36).
|
||||||
|
|
||||||
|
# 2.5.0-alpha (2019-12-06)
|
||||||
|
|
||||||
|
### Feature
|
||||||
|
|
||||||
|
- **borderBox & decoration:** **Configurable** colors.
|
||||||
|
```html
|
||||||
|
<!-- Example -->
|
||||||
|
<dv-border-box-1 :color="['red', 'green']" />
|
||||||
|
<dv-decoration-1 :color="['red', 'green']" />
|
||||||
|
```
|
||||||
|
- **scrollBoard:** Configurable index header [(#33)](https://github.com/DataV-Team/DataV/pull/33).
|
||||||
|
|
||||||
|
### New
|
||||||
|
|
||||||
|
- **borderBox11**
|
||||||
|
- **borderBox12**
|
||||||
|
- **borderBox13**
|
||||||
|
- **decoration11**
|
||||||
|
|
||||||
|
# 2.4.8-alpha (2019-11-12)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- **scrollBoard:** After updating props, the carousel speed is abnormal [(#25)](https://github.com/jiaming743/DataV/issues/16),[(#20)](https://github.com/jiaming743/DataV/issues/25).
|
||||||
|
- **scrollRankingBorad:** After updating props, the carousel speed is abnormal[(#25)](https://github.com/jiaming743/DataV/issues/16),[(#20)](https://github.com/jiaming743/DataV/issues/25).
|
||||||
|
|
||||||
|
# 2.4.7-alpha (2019-10-24)
|
||||||
|
|
||||||
|
### Perfect
|
||||||
|
|
||||||
|
- **charts:** Optimize memory leaks.
|
||||||
|
- **digitalFlop:** Optimize memory leaks.
|
||||||
|
|
||||||
|
# 2.4.6-alpha (2019-10-24)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- **activeRingChart:** Optimize memory leaks [(#16)](https://github.com/jiaming743/DataV/issues/16),[(#20)](https://github.com/jiaming743/DataV/issues/20).
|
||||||
|
|
||||||
|
# 2.4.5-alpha (2019-09-24)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- **activeRingChart:** Calculation exception due to data value being 0 [(#17)](https://github.com/jiaming743/DataV/issues/17).
|
||||||
|
|
||||||
|
# 2.4.4-alpha (2019-09-05)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- **scrollBoard:** Header column width is abnormal when row data is empty.
|
||||||
|
|
||||||
|
# 2.4.3-alpha (2019-09-04)
|
||||||
|
|
||||||
|
### Perfect
|
||||||
|
|
||||||
|
- **scrollRankingBoard:** Add a unit configuration item.
|
||||||
|
|
||||||
|
# 2.4.2-alpha (2019-08-30)
|
||||||
|
|
||||||
|
### Perfect
|
||||||
|
|
||||||
|
- **capsuleChart:** Class name compatibility optimization.
|
||||||
|
|
||||||
|
# 2.4.1-alpha (2019-08-29)
|
||||||
|
|
||||||
|
### Perfect
|
||||||
|
|
||||||
|
- **capsuleChart:** Adaptive display unit.
|
||||||
|
|
||||||
|
# 2.4.0-alpha (2019-08-29)
|
||||||
|
|
||||||
|
### New
|
||||||
|
|
||||||
|
- **borderBox10**
|
||||||
|
- **capsuleChart**
|
||||||
|
|
||||||
|
# 2.3.9-alpha (2019-08-27)
|
||||||
|
|
||||||
|
### Perfect
|
||||||
|
|
||||||
|
- **percentPond:** Compatibility enhancement.
|
||||||
|
|
||||||
|
# 2.3.8-alpha (2019-08-27)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- **percentPond:** Style compatibility and gradient exceptions.
|
||||||
|
|
||||||
|
# 2.3.7-alpha (2019-08-26)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- **borderBox1:** Parent container setting `text-align: center` to cause display exception [(#6)](https://github.com/jiaming743/DataV/issues/6).
|
||||||
|
|
||||||
|
# 2.3.6-alpha (2019-08-24)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- **borderBox1:** Animation exception caused by incompatible syntax and spelling mistake [(#4)](https://github.com/jiaming743/DataV/issues/4)[(#5)](https://github.com/jiaming743/DataV/pull/5).
|
||||||
|
|
||||||
|
### Perfect
|
||||||
|
|
||||||
|
- **svg:** Svg animation compatibility enhancement.
|
||||||
|
|
||||||
|
# 2.3.5-alpha (2019-08-22)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- **activeRingChart:** Color configuration does not take effect [(#3)](https://github.com/jiaming743/DataV/pull/3).
|
||||||
|
|
||||||
|
# 2.3.4-alpha (2019-08-15)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- **package.json:** Import exception caused by incorrect entry path configuration.
|
||||||
|
|
||||||
|
# 2.3.3-alpha (2019-07-22)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- **waterPondLevel:** Potential namespace conflict.
|
||||||
|
- **digitalFlop:** Potential namespace conflict.
|
||||||
|
|
||||||
# 2.3.2-alpha (2019-07-05)
|
# 2.3.2-alpha (2019-07-05)
|
||||||
|
|
||||||
### Perfect
|
### Perfect
|
||||||
@ -6,7 +254,7 @@
|
|||||||
- **Introduced on demand**
|
- **Introduced on demand**
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import borderBox1 from '@jiaminghi/data-view'
|
import { borderBox1 } from '@jiaminghi/data-view'
|
||||||
|
|
||||||
Vue.use(borderBox1)
|
Vue.use(borderBox1)
|
||||||
```
|
```
|
||||||
|
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
|||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2019-present, JiaMing
|
Copyright (c) 2019-present, DataV-Team
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
BIN
QQGroup.png
Normal file
BIN
QQGroup.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
66
README.md
66
README.md
@ -1,30 +1,32 @@
|
|||||||
[中文](./README_CN.md)
|
[ENGLISH](./README_EN.md)
|
||||||
|
|
||||||
<h1 align="center">DataV</h1>
|
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://github.com/jiaming743/datav/blob/master/LICENSE">
|
<img src="./icon.png">
|
||||||
<img src="https://img.shields.io/github/license/jiaming743/datav.svg" alt="LICENSE" />
|
</p>
|
||||||
|
<h1 align="center">DataV</h1>
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://github.com/DataV-Team/datav/blob/master/LICENSE">
|
||||||
|
<img src="https://img.shields.io/github/license/DataV-Team/datav.svg" alt="LICENSE" />
|
||||||
</a>
|
</a>
|
||||||
<a href="https://www.npmjs.com/package/@jiaminghi/datav">
|
<a href="https://www.npmjs.com/package/@jiaminghi/data-view">
|
||||||
<img src="https://img.shields.io/npm/v/@jiaminghi/data-view.svg" alt="LICENSE" />
|
<img src="https://img.shields.io/npm/v/@jiaminghi/data-view.svg" alt="LICENSE" />
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
## What is DataV?
|
## DataV是干什么的?
|
||||||
|
|
||||||
* DataV is a data **visualization** components library based on **Vue**.
|
* DataV是一个基于**Vue**的数据可视化组件库(当然也有[React版本](https://github.com/DataV-Team/DataV-React))
|
||||||
* Provide cool **SVG** borders and decorations.
|
* 提供用于提升页面视觉效果的**SVG**边框和装饰
|
||||||
* Provide common **charts** such as line chart, etc..
|
* 提供常用的**图表**如折线图等
|
||||||
* flying line chart, carousel table and etc.
|
* 飞线图/轮播表等其他组件
|
||||||
|
|
||||||
### Install with npm
|
### npm安装
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ npm install @jiaminghi/data-view
|
$ npm install @jiaminghi/data-view
|
||||||
```
|
```
|
||||||
|
|
||||||
### use
|
### 使用
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
@ -32,9 +34,43 @@ import DataV from '@jiaminghi/data-view'
|
|||||||
|
|
||||||
Vue.use(DataV)
|
Vue.use(DataV)
|
||||||
|
|
||||||
// Introduced on demand
|
// 按需引入
|
||||||
import { borderBox1 } from '@jiaminghi/data-view'
|
import { borderBox1 } from '@jiaminghi/data-view'
|
||||||
Vue.use(borderBox1)
|
Vue.use(borderBox1)
|
||||||
```
|
```
|
||||||
|
|
||||||
Detailed documents and examples can be viewed on the [HomePage](http://datav.jiaminghi.com).
|
详细文档及示例请移步[HomePage](http://datav.jiaminghi.com).
|
||||||
|
|
||||||
|
### UMD版
|
||||||
|
|
||||||
|
`UMD`版可直接使用`script`标签引入,`UMD`版文件位于项目`dist`目录下,引入后将自动把所有组件注册为**Vue全局组件**,引入`DataV`前请确保已引入`Vue`。
|
||||||
|
|
||||||
|
[UMD版使用示例](./umdExample.html)
|
||||||
|
|
||||||
|
### TODO
|
||||||
|
|
||||||
|
* **地图组件**
|
||||||
|
* **TS**重构组件库底层依赖
|
||||||
|
|
||||||
|
### 致谢
|
||||||
|
|
||||||
|
组件库的开发基于个人学习和兴趣,由于技术水平及经验的限制,组件尚有许多不完善之处,如有BUG可及时提交[issue](https://github.com/DataV-Team/DataV/issues/new?template=bug_report.md)或添加反馈群进行反馈,也欢迎提供指正和建议,感谢各位的支持。
|
||||||
|
|
||||||
|
### 反馈
|
||||||
|

|
||||||
|
|
||||||
|
### Demo
|
||||||
|
|
||||||
|
Demo页面使用了全屏组件,请F11全屏后查看。
|
||||||
|
|
||||||
|
* [施工养护综合数据](http://datav.jiaminghi.com/demo/construction-data/index.html)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
* [机电运维管理台](http://datav.jiaminghi.com/demo/manage-desk/index.html)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
* [机电设备电子档案](http://datav.jiaminghi.com/demo/electronic-file/index.html)
|
||||||
|
|
||||||
|

|
||||||
|
40
README_CN.md
40
README_CN.md
@ -1,40 +0,0 @@
|
|||||||
[ENGLISH](./README.md)
|
|
||||||
|
|
||||||
<h1 align="center">DataV</h1>
|
|
||||||
|
|
||||||
<p align="center">
|
|
||||||
<a href="https://github.com/jiaming743/datav/blob/master/LICENSE">
|
|
||||||
<img src="https://img.shields.io/github/license/jiaming743/datav.svg" alt="LICENSE" />
|
|
||||||
</a>
|
|
||||||
<a href="https://www.npmjs.com/package/@jiaminghi/datav">
|
|
||||||
<img src="https://img.shields.io/npm/v/@jiaminghi/data-view.svg" alt="LICENSE" />
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
## DataV是干什么的?
|
|
||||||
|
|
||||||
* DataV是一个基于**Vue**的数据可视化组件库.
|
|
||||||
* 提供用于提升页面视觉效果的**SVG**边框和装饰.
|
|
||||||
* 提供常用的**图表**如折线图等.
|
|
||||||
* 飞线图/轮播表等其他组件.
|
|
||||||
|
|
||||||
### npm安装
|
|
||||||
|
|
||||||
```shell
|
|
||||||
$ npm install @jiaminghi/data-view
|
|
||||||
```
|
|
||||||
|
|
||||||
### 使用
|
|
||||||
|
|
||||||
```js
|
|
||||||
import Vue from 'vue'
|
|
||||||
import DataV from '@jiaminghi/data-view'
|
|
||||||
|
|
||||||
Vue.use(DataV)
|
|
||||||
|
|
||||||
// 按需引入
|
|
||||||
import { borderBox1 } from '@jiaminghi/data-view'
|
|
||||||
Vue.use(borderBox1)
|
|
||||||
```
|
|
||||||
|
|
||||||
详细文档及示例请移步[HomePage](http://datav.jiaminghi.com).
|
|
87
README_EN.md
Normal file
87
README_EN.md
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
[中文](./README.md)
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<img src="./icon.png">
|
||||||
|
</p>
|
||||||
|
<h1 align="center">DataV</h1>
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://github.com/DataV-Team/datav/blob/master/LICENSE">
|
||||||
|
<img src="https://img.shields.io/github/license/DataV-Team/datav.svg" alt="LICENSE" />
|
||||||
|
</a>
|
||||||
|
<a href="https://www.npmjs.com/package/@jiaminghi/data-view">
|
||||||
|
<img src="https://img.shields.io/npm/v/@jiaminghi/data-view.svg" alt="LICENSE" />
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
## What is DataV?
|
||||||
|
|
||||||
|
* DataV is a data **visualization** components library based on **Vue**(Of course there are also [React versions](https://github.com/DataV-Team/DataV-React)).
|
||||||
|
* Provide cool **SVG** borders and decorations.
|
||||||
|
* Provide common **charts** such as line chart, etc..
|
||||||
|
* flying line chart, carousel table and etc.
|
||||||
|
|
||||||
|
### Install with npm
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ npm install @jiaminghi/data-view
|
||||||
|
```
|
||||||
|
|
||||||
|
### use
|
||||||
|
|
||||||
|
```js
|
||||||
|
import Vue from 'vue'
|
||||||
|
import DataV from '@jiaminghi/data-view'
|
||||||
|
|
||||||
|
Vue.use(DataV)
|
||||||
|
|
||||||
|
// Introduced on demand
|
||||||
|
import { borderBox1 } from '@jiaminghi/data-view'
|
||||||
|
Vue.use(borderBox1)
|
||||||
|
```
|
||||||
|
|
||||||
|
Detailed documents and examples can be viewed on the [HomePage](http://datav.jiaminghi.com).
|
||||||
|
|
||||||
|
### UMD version
|
||||||
|
|
||||||
|
The `UMD` version can be directly imported using the `script` tag. The `UMD` version file is located in the project `dist` directory. After import, all components will be automatically registered as **Vue global components**. Be sure to introduce `Vue` before introducing `DataV`.
|
||||||
|
|
||||||
|
[UMD version usage example](./umdExample.html)
|
||||||
|
|
||||||
|
### React version
|
||||||
|
|
||||||
|
The reaction version is already under development, so stay tuned
|
||||||
|
|
||||||
|
### Questionnaire
|
||||||
|
|
||||||
|
React version of the component library and feedback[Questionnaire](https://www.wjx.cn/jq/45326197.aspx)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### TODO
|
||||||
|
|
||||||
|
* **Map Component**
|
||||||
|
* Refactor underlying dependencies using **TS**.
|
||||||
|
|
||||||
|
### Acknowledgement
|
||||||
|
|
||||||
|
The development of the component library is based on personal learning and interest. Due to technical level and experience limitations, there are still many imperfections in the components. If there are errors, you can submit [issue](https://github.com/DataV-team/DataV/issues/new?template=bug_report.md) in time or add feedback groups for feedback. Welcome to provide corrections and suggestions. Thank you for your support.
|
||||||
|
|
||||||
|
### Feedback
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### Demo
|
||||||
|
|
||||||
|
The Demo page uses the full-screen component, please view it after F11 full screen.
|
||||||
|
|
||||||
|
* [Construction Data](http://datav.jiaminghi.com/demo/construction-data/index.html)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
* [Manage-Desk](http://datav.jiaminghi.com/demo/manage-desk/index.html)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
* [Electronic-File](http://datav.jiaminghi.com/demo/electronic-file/index.html)
|
||||||
|
|
||||||
|

|
4
build/entry.js
Normal file
4
build/entry.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
import Vue from 'vue'
|
||||||
|
import datav from '../src/index'
|
||||||
|
|
||||||
|
Vue.use(datav)
|
@ -1,14 +1,17 @@
|
|||||||
const { copyDir, fileForEach, readFile, writeFile, unlinkDirFileByExtname, dirForEach } = require('./plugin/fs')
|
const { copyDir, fileForEach, readFile, writeFile, unlinkDirFileByExtname, dirForEach } = require('@jiaminghi/fs')
|
||||||
const print = require('./plugin/print')
|
const print = require('./plugin/print')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const doExec = require('./plugin/exec')
|
const exec = require('./plugin/exec')
|
||||||
|
|
||||||
const PACKAGE_SRC = './src'
|
const PACKAGE_SRC = './src'
|
||||||
const COMPILE_SRC = './lib'
|
const COMPILE_SRC = './lib'
|
||||||
const COMPONENTS_DIR = '/components'
|
const COMPONENTS_DIR = '/components'
|
||||||
const ENTRANCE = '/index.js'
|
const ENTRANCE = '/index.js'
|
||||||
|
const libName = 'datav'
|
||||||
|
|
||||||
async function start () {
|
async function start () {
|
||||||
|
// Compile for NPM
|
||||||
|
|
||||||
const copyPackage = await copyDir(PACKAGE_SRC, COMPILE_SRC)
|
const copyPackage = await copyDir(PACKAGE_SRC, COMPILE_SRC)
|
||||||
|
|
||||||
if (!copyPackage) {
|
if (!copyPackage) {
|
||||||
@ -63,6 +66,27 @@ async function start () {
|
|||||||
|
|
||||||
print.success('Finish adding components export statement!')
|
print.success('Finish adding components export statement!')
|
||||||
|
|
||||||
|
// Compile for UMD version
|
||||||
|
const rollupCompile = await exec(`rollup -c build/rollup.config.js`)
|
||||||
|
|
||||||
|
if (!rollupCompile) {
|
||||||
|
print.error('Exception in rollupCompile')
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
print.tip('After rollupCompile')
|
||||||
|
|
||||||
|
const terser = await exec(`rollup -c build/rollup.terser.config.js`)
|
||||||
|
|
||||||
|
if (!terser) {
|
||||||
|
print.error('Exception in terser')
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
print.tip('After terser')
|
||||||
|
|
||||||
print.yellow('-------------------------------------')
|
print.yellow('-------------------------------------')
|
||||||
print.success(' DataV Lib Compile Success! ')
|
print.success(' DataV Lib Compile Success! ')
|
||||||
print.yellow('-------------------------------------')
|
print.yellow('-------------------------------------')
|
||||||
@ -122,7 +146,7 @@ async function compileLessToCss () {
|
|||||||
maxBuffer: 1024 ** 5
|
maxBuffer: 1024 ** 5
|
||||||
})
|
})
|
||||||
|
|
||||||
const compile = await doExec(execString)
|
const compile = await exec(execString)
|
||||||
|
|
||||||
if (!compile) {
|
if (!compile) {
|
||||||
print.error(execString + ' Error!')
|
print.error(execString + ' Error!')
|
||||||
@ -180,6 +204,8 @@ async function addComponentsExport () {
|
|||||||
return write
|
return write
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = start
|
async function compileUMDVersion () {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
start()
|
22
build/rollup.config.js
Normal file
22
build/rollup.config.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import resolve from 'rollup-plugin-node-resolve'
|
||||||
|
import vue from 'rollup-plugin-vue'
|
||||||
|
import commonjs from 'rollup-plugin-commonjs'
|
||||||
|
import babel from 'rollup-plugin-babel'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
input: 'build/entry.js',
|
||||||
|
output: {
|
||||||
|
format: 'umd',
|
||||||
|
file: 'dist/datav.map.vue.js',
|
||||||
|
name: 'datav'
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
resolve(),
|
||||||
|
babel({
|
||||||
|
exclude: 'node_modules/**'
|
||||||
|
}),
|
||||||
|
commonjs(),
|
||||||
|
vue(),
|
||||||
|
],
|
||||||
|
external: ['Vue']
|
||||||
|
}
|
24
build/rollup.terser.config.js
Normal file
24
build/rollup.terser.config.js
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import resolve from 'rollup-plugin-node-resolve'
|
||||||
|
import vue from 'rollup-plugin-vue'
|
||||||
|
import commonjs from 'rollup-plugin-commonjs'
|
||||||
|
import babel from 'rollup-plugin-babel'
|
||||||
|
import { terser } from "rollup-plugin-terser"
|
||||||
|
|
||||||
|
export default {
|
||||||
|
input: 'build/entry.js',
|
||||||
|
output: {
|
||||||
|
format: 'umd',
|
||||||
|
file: 'dist/datav.min.vue.js',
|
||||||
|
name: 'datav'
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
resolve(),
|
||||||
|
babel({
|
||||||
|
exclude: 'node_modules/**'
|
||||||
|
}),
|
||||||
|
commonjs(),
|
||||||
|
vue(),
|
||||||
|
terser(),
|
||||||
|
],
|
||||||
|
external: ['Vue']
|
||||||
|
}
|
BIN
demoImg/construction-data.jpg
Normal file
BIN
demoImg/construction-data.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 99 KiB |
BIN
demoImg/electronic-file.jpg
Normal file
BIN
demoImg/electronic-file.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 118 KiB |
BIN
demoImg/manage-desk.jpg
Normal file
BIN
demoImg/manage-desk.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 101 KiB |
81
deploy/index.js
Normal file
81
deploy/index.js
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
const { fileForEach } = require('@jiaminghi/fs')
|
||||||
|
const Client = require('ftp')
|
||||||
|
const print = require('./plugin/print')
|
||||||
|
const { emptyDir, put } = require('./plugin/ftp')
|
||||||
|
const getNodeParams = require('./plugin/nodeParams')
|
||||||
|
|
||||||
|
let config = null
|
||||||
|
|
||||||
|
try {
|
||||||
|
config = require('./config')
|
||||||
|
} catch (err) {
|
||||||
|
void 0
|
||||||
|
}
|
||||||
|
|
||||||
|
const DIST_PATH = './dist/'
|
||||||
|
const FTP_PATH = './datav/'
|
||||||
|
|
||||||
|
const ftp = new Client()
|
||||||
|
|
||||||
|
ftp.on('ready', async foo => {
|
||||||
|
print.tip('FTP connected!')
|
||||||
|
|
||||||
|
const isEmpty = await emptyDir(ftp, FTP_PATH)
|
||||||
|
|
||||||
|
if (!isEmpty) {
|
||||||
|
print.error('Exception in emptyDir!')
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
let status = true
|
||||||
|
|
||||||
|
await fileForEach(DIST_PATH, async src => {
|
||||||
|
const destPath = FTP_PATH + src.split('/').slice(-1)[0]
|
||||||
|
|
||||||
|
print.tip('Upload: ' + destPath)
|
||||||
|
|
||||||
|
if (!await put(ftp, src, destPath)) {
|
||||||
|
status = false
|
||||||
|
|
||||||
|
print.error('Exception in upload ' + destPath)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if (status) {
|
||||||
|
print.yellow('-------------------------------------')
|
||||||
|
print.success(' Automatic Deployment Success! ')
|
||||||
|
print.yellow('-------------------------------------')
|
||||||
|
}
|
||||||
|
|
||||||
|
ftp.destroy()
|
||||||
|
})
|
||||||
|
|
||||||
|
ftp.on('greeting', foo => {
|
||||||
|
print.tip('FTP greeting')
|
||||||
|
})
|
||||||
|
ftp.on('close', foo => {
|
||||||
|
print.tip('FTP close')
|
||||||
|
})
|
||||||
|
ftp.on('end', foo => {
|
||||||
|
print.tip('FTP end')
|
||||||
|
})
|
||||||
|
ftp.on('error', foo => {
|
||||||
|
print.tip('FTP error')
|
||||||
|
})
|
||||||
|
|
||||||
|
const { host, user, pass } = config || getNodeParams()
|
||||||
|
|
||||||
|
if (!host || !user || !pass) {
|
||||||
|
print.error('Upload Dist to FTP Missing Parameters!')
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
print.tip('Start Upload!')
|
||||||
|
|
||||||
|
ftp.connect({
|
||||||
|
host,
|
||||||
|
user,
|
||||||
|
password: pass
|
||||||
|
})
|
99
deploy/plugin/ftp.js
Normal file
99
deploy/plugin/ftp.js
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
async function getList (ftp, src) {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
ftp.list(src, (err, list) => {
|
||||||
|
if (err) {
|
||||||
|
console.error(err)
|
||||||
|
|
||||||
|
resolve(false)
|
||||||
|
} else {
|
||||||
|
resolve(list)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
async function rmDir (ftp, src, recusive = true) {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
ftp.rmdir(src, recusive, err => {
|
||||||
|
if (err) {
|
||||||
|
console.error(err)
|
||||||
|
|
||||||
|
resolve(false)
|
||||||
|
} else {
|
||||||
|
resolve(true)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
async function deleteFile (ftp, src) {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
ftp.delete(src, err => {
|
||||||
|
if (err) {
|
||||||
|
console.error(err)
|
||||||
|
|
||||||
|
resolve(false)
|
||||||
|
} else {
|
||||||
|
resolve(true)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
async function emptyDir (ftp, src, except = []) {
|
||||||
|
const list = await getList(ftp, src)
|
||||||
|
|
||||||
|
for (let i = 0, listNum = list.length; i < listNum; i++) {
|
||||||
|
const { type, name } = list[i]
|
||||||
|
|
||||||
|
if (type === 'd' && (name === '.' || name === '..')) continue
|
||||||
|
if (except.find(n => n === name)) continue
|
||||||
|
|
||||||
|
const fullSrc = `${src}${name}`
|
||||||
|
|
||||||
|
if (type === 'd') {
|
||||||
|
if (!await rmDir(ftp, fullSrc, true)) return false
|
||||||
|
} else {
|
||||||
|
if (!await deleteFile(ftp, fullSrc)) return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
async function put (ftp, src, dest) {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
ftp.put(src, dest, err => {
|
||||||
|
if (err) {
|
||||||
|
console.error(err)
|
||||||
|
|
||||||
|
resolve(false)
|
||||||
|
} else {
|
||||||
|
resolve(true)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
async function mkDir (ftp, src, recusive = true) {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
ftp.mkdir(src, recusive, err => {
|
||||||
|
if (err) {
|
||||||
|
console.error(err)
|
||||||
|
|
||||||
|
resolve(false)
|
||||||
|
} else {
|
||||||
|
resolve(true)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
put,
|
||||||
|
rmDir,
|
||||||
|
mkDir,
|
||||||
|
getList,
|
||||||
|
emptyDir,
|
||||||
|
deleteFile
|
||||||
|
}
|
13
deploy/plugin/nodeParams.js
Normal file
13
deploy/plugin/nodeParams.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
function getNodeParams () {
|
||||||
|
const params = {}
|
||||||
|
|
||||||
|
process.argv.slice(2).forEach(param => {
|
||||||
|
param = param.split('=')
|
||||||
|
|
||||||
|
params[param[0]] = param[1]
|
||||||
|
})
|
||||||
|
|
||||||
|
return params
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = getNodeParams
|
22
deploy/plugin/print.js
Normal file
22
deploy/plugin/print.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
const print = {
|
||||||
|
log (info) {
|
||||||
|
console.log(info)
|
||||||
|
},
|
||||||
|
warn (info) {
|
||||||
|
console.log('\033[31;33m' + info + '\033[0m')
|
||||||
|
},
|
||||||
|
error (info) {
|
||||||
|
console.log('\033[31;40m' + info + '\033[0m')
|
||||||
|
},
|
||||||
|
tip (info) {
|
||||||
|
console.log('\033[40;32m' + info + '\033[0m')
|
||||||
|
},
|
||||||
|
success (info) {
|
||||||
|
console.log('\033[42;30m' + info + '\033[0m')
|
||||||
|
},
|
||||||
|
yellow (info) {
|
||||||
|
console.log('\033[31;33m' + info + '\033[0m')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = print
|
23826
dist/datav.map.vue.js
vendored
Normal file
23826
dist/datav.map.vue.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
dist/datav.min.vue.js
vendored
Normal file
1
dist/datav.min.vue.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
icon.png
Executable file
BIN
icon.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
6
lib/components/activeRingChart/index.js
Normal file
6
lib/components/activeRingChart/index.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import './src/main.css'
|
||||||
|
import ActiveRingChart from './src/main.vue'
|
||||||
|
|
||||||
|
export default function (Vue) {
|
||||||
|
Vue.component(ActiveRingChart.name, ActiveRingChart)
|
||||||
|
}
|
32
lib/components/activeRingChart/src/main.css
Normal file
32
lib/components/activeRingChart/src/main.css
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
.dv-active-ring-chart {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.dv-active-ring-chart .active-ring-chart-container {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.dv-active-ring-chart .active-ring-info {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
left: 0px;
|
||||||
|
top: 0px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.dv-active-ring-chart .active-ring-info .dv-digital-flop {
|
||||||
|
width: 100px;
|
||||||
|
height: 30px;
|
||||||
|
}
|
||||||
|
.dv-active-ring-chart .active-ring-info .active-ring-name {
|
||||||
|
width: 100px;
|
||||||
|
height: 30px;
|
||||||
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
vertical-align: middle;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
294
lib/components/activeRingChart/src/main.vue
Normal file
294
lib/components/activeRingChart/src/main.vue
Normal file
@ -0,0 +1,294 @@
|
|||||||
|
<template>
|
||||||
|
<div class="dv-active-ring-chart">
|
||||||
|
<div class="active-ring-chart-container" ref="active-ring-chart" />
|
||||||
|
<div class="active-ring-info">
|
||||||
|
<dv-digital-flop :config="digitalFlop" />
|
||||||
|
<div class="active-ring-name" :style="fontSize">{{ ringName }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Charts from '@jiaminghi/charts'
|
||||||
|
|
||||||
|
import dvDigitalFlop from '../../digitalFlop/src/main.vue'
|
||||||
|
|
||||||
|
import { deepMerge } from '@jiaminghi/charts/lib/util/index'
|
||||||
|
|
||||||
|
import { deepClone } from '@jiaminghi/c-render/lib/plugin/util'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DvActiveRingChart',
|
||||||
|
components: {
|
||||||
|
dvDigitalFlop
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
config: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
defaultConfig: {
|
||||||
|
/**
|
||||||
|
* @description Ring radius
|
||||||
|
* @type {String|Number}
|
||||||
|
* @default radius = '50%'
|
||||||
|
* @example radius = '50%' | 100
|
||||||
|
*/
|
||||||
|
radius: '50%',
|
||||||
|
/**
|
||||||
|
* @description Active ring radius
|
||||||
|
* @type {String|Number}
|
||||||
|
* @default activeRadius = '55%'
|
||||||
|
* @example activeRadius = '55%' | 110
|
||||||
|
*/
|
||||||
|
activeRadius: '55%',
|
||||||
|
/**
|
||||||
|
* @description Ring data
|
||||||
|
* @type {Array<Object>}
|
||||||
|
* @default data = [{ name: '', value: 0 }]
|
||||||
|
*/
|
||||||
|
data: [{ name: '', value: 0 }],
|
||||||
|
/**
|
||||||
|
* @description Ring line width
|
||||||
|
* @type {Number}
|
||||||
|
* @default lineWidth = 20
|
||||||
|
*/
|
||||||
|
lineWidth: 20,
|
||||||
|
/**
|
||||||
|
* @description Active time gap (ms)
|
||||||
|
* @type {Number}
|
||||||
|
* @default activeTimeGap = 3000
|
||||||
|
*/
|
||||||
|
activeTimeGap: 3000,
|
||||||
|
/**
|
||||||
|
* @description Ring color (hex|rgb|rgba|color keywords)
|
||||||
|
* @type {Array<String>}
|
||||||
|
* @default color = [Charts Default Color]
|
||||||
|
* @example color = ['#000', 'rgb(0, 0, 0)', 'rgba(0, 0, 0, 1)', 'red']
|
||||||
|
*/
|
||||||
|
color: [],
|
||||||
|
/**
|
||||||
|
* @description Digital flop style
|
||||||
|
* @type {Object}
|
||||||
|
*/
|
||||||
|
digitalFlopStyle: {
|
||||||
|
fontSize: 25,
|
||||||
|
fill: '#fff'
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* @description Digital flop toFixed
|
||||||
|
* @type {Number}
|
||||||
|
*/
|
||||||
|
digitalFlopToFixed: 0,
|
||||||
|
/**
|
||||||
|
* @description CRender animationCurve
|
||||||
|
* @type {String}
|
||||||
|
* @default animationCurve = 'easeOutCubic'
|
||||||
|
*/
|
||||||
|
animationCurve: 'easeOutCubic',
|
||||||
|
/**
|
||||||
|
* @description CRender animationFrame
|
||||||
|
* @type {String}
|
||||||
|
* @default animationFrame = 50
|
||||||
|
*/
|
||||||
|
animationFrame: 50,
|
||||||
|
/**
|
||||||
|
* @description showOriginValue
|
||||||
|
* @type {Boolean}
|
||||||
|
* @default showOriginValue = false
|
||||||
|
*/
|
||||||
|
showOriginValue: false
|
||||||
|
},
|
||||||
|
|
||||||
|
mergedConfig: null,
|
||||||
|
|
||||||
|
chart: null,
|
||||||
|
|
||||||
|
activeIndex: 0,
|
||||||
|
|
||||||
|
animationHandler: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
digitalFlop() {
|
||||||
|
const { mergedConfig, activeIndex } = this
|
||||||
|
|
||||||
|
if (!mergedConfig) return {}
|
||||||
|
|
||||||
|
const {
|
||||||
|
digitalFlopStyle,
|
||||||
|
digitalFlopToFixed,
|
||||||
|
data,
|
||||||
|
showOriginValue
|
||||||
|
} = mergedConfig
|
||||||
|
|
||||||
|
const value = data.map(({ value }) => value)
|
||||||
|
|
||||||
|
let displayValue
|
||||||
|
|
||||||
|
if (showOriginValue) {
|
||||||
|
displayValue = value[activeIndex]
|
||||||
|
} else {
|
||||||
|
const sum = value.reduce((all, v) => all + v, 0)
|
||||||
|
|
||||||
|
const percent = parseFloat((value[activeIndex] / sum) * 100) || 0
|
||||||
|
|
||||||
|
displayValue = percent
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
content: showOriginValue ? '{nt}' : '{nt}%',
|
||||||
|
number: [displayValue],
|
||||||
|
style: digitalFlopStyle,
|
||||||
|
toFixed: digitalFlopToFixed
|
||||||
|
}
|
||||||
|
},
|
||||||
|
ringName() {
|
||||||
|
const { mergedConfig, activeIndex } = this
|
||||||
|
|
||||||
|
if (!mergedConfig) return ''
|
||||||
|
|
||||||
|
return mergedConfig.data[activeIndex].name
|
||||||
|
},
|
||||||
|
fontSize() {
|
||||||
|
const { mergedConfig } = this
|
||||||
|
|
||||||
|
if (!mergedConfig) return ''
|
||||||
|
|
||||||
|
return `font-size: ${mergedConfig.digitalFlopStyle.fontSize}px;`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
config() {
|
||||||
|
const { animationHandler, mergeConfig, setRingOption } = this
|
||||||
|
|
||||||
|
clearTimeout(animationHandler)
|
||||||
|
|
||||||
|
this.activeIndex = 0
|
||||||
|
|
||||||
|
mergeConfig()
|
||||||
|
|
||||||
|
setRingOption()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init() {
|
||||||
|
const { initChart, mergeConfig, setRingOption } = this
|
||||||
|
|
||||||
|
initChart()
|
||||||
|
|
||||||
|
mergeConfig()
|
||||||
|
|
||||||
|
setRingOption()
|
||||||
|
},
|
||||||
|
initChart() {
|
||||||
|
const { $refs } = this
|
||||||
|
|
||||||
|
this.chart = new Charts($refs['active-ring-chart'])
|
||||||
|
},
|
||||||
|
mergeConfig() {
|
||||||
|
const { defaultConfig, config } = this
|
||||||
|
|
||||||
|
this.mergedConfig = deepMerge(
|
||||||
|
deepClone(defaultConfig, true),
|
||||||
|
config || {}
|
||||||
|
)
|
||||||
|
},
|
||||||
|
setRingOption() {
|
||||||
|
const { getRingOption, chart, ringAnimation } = this
|
||||||
|
|
||||||
|
const option = getRingOption()
|
||||||
|
|
||||||
|
chart.setOption(option, true)
|
||||||
|
|
||||||
|
ringAnimation()
|
||||||
|
},
|
||||||
|
getRingOption() {
|
||||||
|
const { mergedConfig, getRealRadius } = this
|
||||||
|
|
||||||
|
const radius = getRealRadius()
|
||||||
|
|
||||||
|
mergedConfig.data.forEach(dataItem => {
|
||||||
|
dataItem.radius = radius
|
||||||
|
})
|
||||||
|
|
||||||
|
return {
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
type: 'pie',
|
||||||
|
...mergedConfig,
|
||||||
|
outsideLabel: {
|
||||||
|
show: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
color: mergedConfig.color
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getRealRadius(active = false) {
|
||||||
|
const { mergedConfig, chart } = this
|
||||||
|
|
||||||
|
const { radius, activeRadius, lineWidth } = mergedConfig
|
||||||
|
|
||||||
|
const maxRadius = Math.min(...chart.render.area) / 2
|
||||||
|
|
||||||
|
const halfLineWidth = lineWidth / 2
|
||||||
|
|
||||||
|
let realRadius = active ? activeRadius : radius
|
||||||
|
|
||||||
|
if (typeof realRadius !== 'number')
|
||||||
|
realRadius = (parseInt(realRadius) / 100) * maxRadius
|
||||||
|
|
||||||
|
const insideRadius = realRadius - halfLineWidth
|
||||||
|
const outSideRadius = realRadius + halfLineWidth
|
||||||
|
|
||||||
|
return [insideRadius, outSideRadius]
|
||||||
|
},
|
||||||
|
ringAnimation() {
|
||||||
|
let { activeIndex, getRingOption, chart, getRealRadius } = this
|
||||||
|
|
||||||
|
const radius = getRealRadius()
|
||||||
|
const active = getRealRadius(true)
|
||||||
|
|
||||||
|
const option = getRingOption()
|
||||||
|
|
||||||
|
const { data } = option.series[0]
|
||||||
|
|
||||||
|
data.forEach((dataItem, i) => {
|
||||||
|
if (i === activeIndex) {
|
||||||
|
dataItem.radius = active
|
||||||
|
} else {
|
||||||
|
dataItem.radius = radius
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
chart.setOption(option, true)
|
||||||
|
|
||||||
|
const { activeTimeGap } = option.series[0]
|
||||||
|
|
||||||
|
this.animationHandler = setTimeout(foo => {
|
||||||
|
activeIndex += 1
|
||||||
|
|
||||||
|
if (activeIndex >= data.length) activeIndex = 0
|
||||||
|
|
||||||
|
this.activeIndex = activeIndex
|
||||||
|
|
||||||
|
this.ringAnimation()
|
||||||
|
}, activeTimeGap)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
const { init } = this
|
||||||
|
|
||||||
|
init()
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
const { animationHandler } = this
|
||||||
|
|
||||||
|
clearTimeout(animationHandler)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
6
lib/components/borderBox1/index.js
Normal file
6
lib/components/borderBox1/index.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import './src/main.css'
|
||||||
|
import BorderBox1 from './src/main.vue'
|
||||||
|
|
||||||
|
export default function (Vue) {
|
||||||
|
Vue.component(BorderBox1.name, BorderBox1)
|
||||||
|
}
|
27
lib/components/borderBox1/src/main.css
Normal file
27
lib/components/borderBox1/src/main.css
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
.dv-border-box-1 {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.dv-border-box-1 .border {
|
||||||
|
position: absolute;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.dv-border-box-1 .right-top {
|
||||||
|
right: 0px;
|
||||||
|
transform: rotateY(180deg);
|
||||||
|
}
|
||||||
|
.dv-border-box-1 .left-bottom {
|
||||||
|
bottom: 0px;
|
||||||
|
transform: rotateX(180deg);
|
||||||
|
}
|
||||||
|
.dv-border-box-1 .right-bottom {
|
||||||
|
right: 0px;
|
||||||
|
bottom: 0px;
|
||||||
|
transform: rotateX(180deg) rotateY(180deg);
|
||||||
|
}
|
||||||
|
.dv-border-box-1 .border-box-content {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
116
lib/components/borderBox1/src/main.vue
Normal file
116
lib/components/borderBox1/src/main.vue
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
<template>
|
||||||
|
<div class="dv-border-box-1" :ref="ref">
|
||||||
|
<svg class="border" :width="width" :height="height">
|
||||||
|
<polygon :fill="backgroundColor" :points="`10, 27 10, ${height - 27} 13, ${height - 24} 13, ${height - 21} 24, ${height - 11}
|
||||||
|
38, ${height - 11} 41, ${height - 8} 73, ${height - 8} 75, ${height - 10} 81, ${height - 10}
|
||||||
|
85, ${height - 6} ${width - 85}, ${height - 6} ${width - 81}, ${height - 10} ${width - 75}, ${height - 10}
|
||||||
|
${width - 73}, ${height - 8} ${width - 41}, ${height - 8} ${width - 38}, ${height - 11}
|
||||||
|
${width - 24}, ${height - 11} ${width - 13}, ${height - 21} ${width - 13}, ${height - 24}
|
||||||
|
${width - 10}, ${height - 27} ${width - 10}, 27 ${width - 13}, 25 ${width - 13}, 21
|
||||||
|
${width - 24}, 11 ${width - 38}, 11 ${width - 41}, 8 ${width - 73}, 8 ${width - 75}, 10
|
||||||
|
${width - 81}, 10 ${width - 85}, 6 85, 6 81, 10 75, 10 73, 8 41, 8 38, 11 24, 11 13, 21 13, 24`" />
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<svg
|
||||||
|
width="150px"
|
||||||
|
height="150px"
|
||||||
|
:key="item"
|
||||||
|
v-for="item in border"
|
||||||
|
:class="`${item} border`"
|
||||||
|
>
|
||||||
|
<polygon
|
||||||
|
:fill="mergedColor[0]"
|
||||||
|
points="6,66 6,18 12,12 18,12 24,6 27,6 30,9 36,9 39,6 84,6 81,9 75,9 73.2,7 40.8,7 37.8,10.2 24,10.2 12,21 12,24 9,27 9,51 7.8,54 7.8,63"
|
||||||
|
>
|
||||||
|
<animate
|
||||||
|
attributeName="fill"
|
||||||
|
:values="`${mergedColor[0]};${mergedColor[1]};${mergedColor[0]}`"
|
||||||
|
dur="0.5s"
|
||||||
|
begin="0s"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
/>
|
||||||
|
</polygon>
|
||||||
|
<polygon
|
||||||
|
:fill="mergedColor[1]"
|
||||||
|
points="27.599999999999998,4.8 38.4,4.8 35.4,7.8 30.599999999999998,7.8"
|
||||||
|
>
|
||||||
|
<animate
|
||||||
|
attributeName="fill"
|
||||||
|
:values="`${mergedColor[1]};${mergedColor[0]};${mergedColor[1]}`"
|
||||||
|
dur="0.5s"
|
||||||
|
begin="0s"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
/>
|
||||||
|
</polygon>
|
||||||
|
<polygon
|
||||||
|
:fill="mergedColor[0]"
|
||||||
|
points="9,54 9,63 7.199999999999999,66 7.199999999999999,75 7.8,78 7.8,110 8.4,110 8.4,66 9.6,66 9.6,54"
|
||||||
|
>
|
||||||
|
<animate
|
||||||
|
attributeName="fill"
|
||||||
|
:values="`${mergedColor[0]};${mergedColor[1]};transparent`"
|
||||||
|
dur="1s"
|
||||||
|
begin="0s"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
/>
|
||||||
|
</polygon>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<div class="border-box-content">
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import autoResize from '../../../mixin/autoResize'
|
||||||
|
|
||||||
|
import { deepMerge } from '@jiaminghi/charts/lib/util/index'
|
||||||
|
|
||||||
|
import { deepClone } from '@jiaminghi/c-render/lib/plugin/util'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DvBorderBox1',
|
||||||
|
mixins: [autoResize],
|
||||||
|
props: {
|
||||||
|
color: {
|
||||||
|
type: Array,
|
||||||
|
default: () => ([])
|
||||||
|
},
|
||||||
|
backgroundColor: {
|
||||||
|
type: String,
|
||||||
|
default: 'transparent'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
ref: 'border-box-1',
|
||||||
|
|
||||||
|
border: ['left-top', 'right-top', 'left-bottom', 'right-bottom'],
|
||||||
|
|
||||||
|
defaultColor: ['#4fd2dd', '#235fa7'],
|
||||||
|
|
||||||
|
mergedColor: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
color () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
mergeColor () {
|
||||||
|
const { color, defaultColor } = this
|
||||||
|
|
||||||
|
this.mergedColor = deepMerge(deepClone(defaultColor, true), color || [])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
6
lib/components/borderBox10/index.js
Normal file
6
lib/components/borderBox10/index.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import './src/main.css'
|
||||||
|
import BorderBox10 from './src/main.vue'
|
||||||
|
|
||||||
|
export default function (Vue) {
|
||||||
|
Vue.component(BorderBox10.name, BorderBox10)
|
||||||
|
}
|
28
lib/components/borderBox10/src/main.css
Normal file
28
lib/components/borderBox10/src/main.css
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
.dv-border-box-10 {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
|
.dv-border-box-10 .border {
|
||||||
|
position: absolute;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.dv-border-box-10 .right-top {
|
||||||
|
right: 0px;
|
||||||
|
transform: rotateY(180deg);
|
||||||
|
}
|
||||||
|
.dv-border-box-10 .left-bottom {
|
||||||
|
bottom: 0px;
|
||||||
|
transform: rotateX(180deg);
|
||||||
|
}
|
||||||
|
.dv-border-box-10 .right-bottom {
|
||||||
|
right: 0px;
|
||||||
|
bottom: 0px;
|
||||||
|
transform: rotateX(180deg) rotateY(180deg);
|
||||||
|
}
|
||||||
|
.dv-border-box-10 .border-box-content {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
80
lib/components/borderBox10/src/main.vue
Normal file
80
lib/components/borderBox10/src/main.vue
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
<template>
|
||||||
|
<div class="dv-border-box-10" :ref="ref" :style="`box-shadow: inset 0 0 25px 3px ${mergedColor[0]}`">
|
||||||
|
<svg class="border" :width="width" :height="height">
|
||||||
|
<polygon :fill="backgroundColor" :points="`
|
||||||
|
4, 0 ${width - 4}, 0 ${width}, 4 ${width}, ${height - 4} ${width - 4}, ${height}
|
||||||
|
4, ${height} 0, ${height - 4} 0, 4
|
||||||
|
`" />
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<svg
|
||||||
|
width="150px"
|
||||||
|
height="150px"
|
||||||
|
:key="item"
|
||||||
|
v-for="item in border"
|
||||||
|
:class="`${item} border`"
|
||||||
|
>
|
||||||
|
<polygon
|
||||||
|
:fill="mergedColor[1]"
|
||||||
|
points="40, 0 5, 0 0, 5 0, 16 3, 19 3, 7 7, 3 35, 3"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<div class="border-box-content">
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import autoResize from '../../../mixin/autoResize'
|
||||||
|
|
||||||
|
import { deepMerge } from '@jiaminghi/charts/lib/util/index'
|
||||||
|
|
||||||
|
import { deepClone } from '@jiaminghi/c-render/lib/plugin/util'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DvBorderBox10',
|
||||||
|
mixins: [autoResize],
|
||||||
|
props: {
|
||||||
|
color: {
|
||||||
|
type: Array,
|
||||||
|
default: () => ([])
|
||||||
|
},
|
||||||
|
backgroundColor: {
|
||||||
|
type: String,
|
||||||
|
default: 'transparent'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
ref: 'border-box-10',
|
||||||
|
|
||||||
|
border: ['left-top', 'right-top', 'left-bottom', 'right-bottom'],
|
||||||
|
|
||||||
|
defaultColor: ['#1d48c4', '#d3e1f8'],
|
||||||
|
|
||||||
|
mergedColor: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
color () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
mergeColor () {
|
||||||
|
const { color, defaultColor } = this
|
||||||
|
|
||||||
|
this.mergedColor = deepMerge(deepClone(defaultColor, true), color || [])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
6
lib/components/borderBox11/index.js
Normal file
6
lib/components/borderBox11/index.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import './src/main.css'
|
||||||
|
import BorderBox11 from './src/main.vue'
|
||||||
|
|
||||||
|
export default function (Vue) {
|
||||||
|
Vue.component(BorderBox11.name, BorderBox11)
|
||||||
|
}
|
21
lib/components/borderBox11/src/main.css
Normal file
21
lib/components/borderBox11/src/main.css
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
.dv-border-box-11 {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.dv-border-box-11 .dv-border-svg-container {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
top: 0px;
|
||||||
|
left: 0px;
|
||||||
|
}
|
||||||
|
.dv-border-box-11 .dv-border-svg-container polyline {
|
||||||
|
fill: none;
|
||||||
|
stroke-width: 1;
|
||||||
|
}
|
||||||
|
.dv-border-box-11 .border-box-content {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
280
lib/components/borderBox11/src/main.vue
Normal file
280
lib/components/borderBox11/src/main.vue
Normal file
@ -0,0 +1,280 @@
|
|||||||
|
<template>
|
||||||
|
<div class="dv-border-box-11" :ref="ref">
|
||||||
|
<svg class="dv-border-svg-container" :width="width" :height="height">
|
||||||
|
<defs>
|
||||||
|
<filter :id="filterId" height="150%" width="150%" x="-25%" y="-25%">
|
||||||
|
<feMorphology operator="dilate" radius="2" in="SourceAlpha" result="thicken" />
|
||||||
|
<feGaussianBlur in="thicken" stdDeviation="3" result="blurred" />
|
||||||
|
<feFlood :flood-color="mergedColor[1]" result="glowColor" />
|
||||||
|
<feComposite in="glowColor" in2="blurred" operator="in" result="softGlowColored" />
|
||||||
|
<feMerge>
|
||||||
|
<feMergeNode in="softGlowColored"/>
|
||||||
|
<feMergeNode in="SourceGraphic"/>
|
||||||
|
</feMerge>
|
||||||
|
</filter>
|
||||||
|
</defs>
|
||||||
|
|
||||||
|
<polygon :fill="backgroundColor" :points="`
|
||||||
|
20, 32 ${width * 0.5 - titleWidth / 2}, 32 ${width * 0.5 - titleWidth / 2 + 20}, 53
|
||||||
|
${width * 0.5 + titleWidth / 2 - 20}, 53 ${width * 0.5 + titleWidth / 2}, 32
|
||||||
|
${width - 20}, 32 ${width - 8}, 48 ${width - 8}, ${height - 25} ${width - 20}, ${height - 8}
|
||||||
|
20, ${height - 8} 8, ${height - 25} 8, 50
|
||||||
|
`" />
|
||||||
|
|
||||||
|
<polyline
|
||||||
|
:stroke="mergedColor[0]"
|
||||||
|
:filter="`url(#${filterId})`"
|
||||||
|
:points="`
|
||||||
|
${(width - titleWidth) / 2}, 30
|
||||||
|
20, 30 7, 50 7, ${50 + (height - 167) / 2}
|
||||||
|
13, ${55 + (height - 167) / 2} 13, ${135 + (height - 167) / 2}
|
||||||
|
7, ${140 + (height - 167) / 2} 7, ${height - 27}
|
||||||
|
20, ${height - 7} ${width - 20}, ${height - 7} ${width - 7}, ${height - 27}
|
||||||
|
${width - 7}, ${140 + (height - 167) / 2} ${width - 13}, ${135 + (height - 167) / 2}
|
||||||
|
${width - 13}, ${55 + (height - 167) / 2} ${width - 7}, ${50 + (height - 167) / 2}
|
||||||
|
${width - 7}, 50 ${width - 20}, 30 ${(width + titleWidth) / 2}, 30
|
||||||
|
${(width + titleWidth) / 2 - 20}, 7 ${(width - titleWidth) / 2 + 20}, 7
|
||||||
|
${(width - titleWidth) / 2}, 30 ${(width - titleWidth) / 2 + 20}, 52
|
||||||
|
${(width + titleWidth) / 2 - 20}, 52 ${(width + titleWidth) / 2}, 30
|
||||||
|
`"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<polygon
|
||||||
|
:stroke="mergedColor[0]"
|
||||||
|
fill="transparent"
|
||||||
|
:points="`
|
||||||
|
${(width + titleWidth) / 2 - 5}, 30 ${(width + titleWidth) / 2 - 21}, 11
|
||||||
|
${(width + titleWidth) / 2 - 27}, 11 ${(width + titleWidth) / 2 - 8}, 34
|
||||||
|
`"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<polygon
|
||||||
|
:stroke="mergedColor[0]"
|
||||||
|
fill="transparent"
|
||||||
|
:points="`
|
||||||
|
${(width - titleWidth) / 2 + 5}, 30 ${(width - titleWidth) / 2 + 22}, 49
|
||||||
|
${(width - titleWidth) / 2 + 28}, 49 ${(width - titleWidth) / 2 + 8}, 26
|
||||||
|
`"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<polygon
|
||||||
|
:stroke="mergedColor[0]"
|
||||||
|
:fill="fade(mergedColor[1] || defaultColor[1], 30)"
|
||||||
|
:filter="`url(#${filterId})`"
|
||||||
|
:points="`
|
||||||
|
${(width + titleWidth) / 2 - 11}, 37 ${(width + titleWidth) / 2 - 32}, 11
|
||||||
|
${(width - titleWidth) / 2 + 23}, 11 ${(width - titleWidth) / 2 + 11}, 23
|
||||||
|
${(width - titleWidth) / 2 + 33}, 49 ${(width + titleWidth) / 2 - 22}, 49
|
||||||
|
`"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<polygon
|
||||||
|
:filter="`url(#${filterId})`"
|
||||||
|
:fill="mergedColor[0]"
|
||||||
|
opacity="1"
|
||||||
|
:points="`
|
||||||
|
${(width - titleWidth) / 2 - 10}, 37 ${(width - titleWidth) / 2 - 31}, 37
|
||||||
|
${(width - titleWidth) / 2 - 25}, 46 ${(width - titleWidth) / 2 - 4}, 46
|
||||||
|
`"
|
||||||
|
>
|
||||||
|
<animate
|
||||||
|
attributeName="opacity"
|
||||||
|
values="1;0.7;1"
|
||||||
|
dur="2s"
|
||||||
|
begin="0s"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
/>
|
||||||
|
</polygon>
|
||||||
|
|
||||||
|
|
||||||
|
<polygon
|
||||||
|
:filter="`url(#${filterId})`"
|
||||||
|
:fill="mergedColor[0]"
|
||||||
|
opacity="0.7"
|
||||||
|
:points="`
|
||||||
|
${(width - titleWidth) / 2 - 40}, 37 ${(width - titleWidth) / 2 - 61}, 37
|
||||||
|
${(width - titleWidth) / 2 - 55}, 46 ${(width - titleWidth) / 2 - 34}, 46
|
||||||
|
`"
|
||||||
|
>
|
||||||
|
<animate
|
||||||
|
attributeName="opacity"
|
||||||
|
values="0.7;0.4;0.7"
|
||||||
|
dur="2s"
|
||||||
|
begin="0s"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
/>
|
||||||
|
</polygon>
|
||||||
|
|
||||||
|
<polygon
|
||||||
|
:filter="`url(#${filterId})`"
|
||||||
|
:fill="mergedColor[0]"
|
||||||
|
opacity="0.5"
|
||||||
|
:points="`
|
||||||
|
${(width - titleWidth) / 2 - 70}, 37 ${(width - titleWidth) / 2 - 91}, 37
|
||||||
|
${(width - titleWidth) / 2 - 85}, 46 ${(width - titleWidth) / 2 - 64}, 46
|
||||||
|
`"
|
||||||
|
>
|
||||||
|
<animate
|
||||||
|
attributeName="opacity"
|
||||||
|
values="0.5;0.2;0.5"
|
||||||
|
dur="2s"
|
||||||
|
begin="0s"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
/>
|
||||||
|
</polygon>
|
||||||
|
|
||||||
|
<polygon
|
||||||
|
:filter="`url(#${filterId})`"
|
||||||
|
:fill="mergedColor[0]"
|
||||||
|
opacity="1"
|
||||||
|
:points="`
|
||||||
|
${(width + titleWidth) / 2 + 30}, 37 ${(width + titleWidth) / 2 + 9}, 37
|
||||||
|
${(width + titleWidth) / 2 + 3}, 46 ${(width + titleWidth) / 2 + 24}, 46
|
||||||
|
`"
|
||||||
|
>
|
||||||
|
<animate
|
||||||
|
attributeName="opacity"
|
||||||
|
values="1;0.7;1"
|
||||||
|
dur="2s"
|
||||||
|
begin="0s"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
/>
|
||||||
|
</polygon>
|
||||||
|
|
||||||
|
<polygon
|
||||||
|
:filter="`url(#${filterId})`"
|
||||||
|
:fill="mergedColor[0]"
|
||||||
|
opacity="0.7"
|
||||||
|
:points="`
|
||||||
|
${(width + titleWidth) / 2 + 60}, 37 ${(width + titleWidth) / 2 + 39}, 37
|
||||||
|
${(width + titleWidth) / 2 + 33}, 46 ${(width + titleWidth) / 2 + 54}, 46
|
||||||
|
`"
|
||||||
|
>
|
||||||
|
<animate
|
||||||
|
attributeName="opacity"
|
||||||
|
values="0.7;0.4;0.7"
|
||||||
|
dur="2s"
|
||||||
|
begin="0s"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
/>
|
||||||
|
</polygon>
|
||||||
|
|
||||||
|
<polygon
|
||||||
|
:filter="`url(#${filterId})`"
|
||||||
|
:fill="mergedColor[0]"
|
||||||
|
opacity="0.5"
|
||||||
|
:points="`
|
||||||
|
${(width + titleWidth) / 2 + 90}, 37 ${(width + titleWidth) / 2 + 69}, 37
|
||||||
|
${(width + titleWidth) / 2 + 63}, 46 ${(width + titleWidth) / 2 + 84}, 46
|
||||||
|
`"
|
||||||
|
>
|
||||||
|
<animate
|
||||||
|
attributeName="opacity"
|
||||||
|
values="0.5;0.2;0.5"
|
||||||
|
dur="2s"
|
||||||
|
begin="0s"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
/>
|
||||||
|
</polygon>
|
||||||
|
|
||||||
|
<text
|
||||||
|
class="dv-border-box-11-title"
|
||||||
|
:x="`${width / 2}`"
|
||||||
|
y="32"
|
||||||
|
fill="#fff"
|
||||||
|
font-size="18"
|
||||||
|
text-anchor="middle"
|
||||||
|
dominant-baseline="middle"
|
||||||
|
>
|
||||||
|
{{ title }}
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<polygon
|
||||||
|
:fill="mergedColor[0]"
|
||||||
|
:filter="`url(#${filterId})`"
|
||||||
|
:points="`
|
||||||
|
7, ${53 + (height - 167) / 2} 11, ${57 + (height - 167) / 2}
|
||||||
|
11, ${133 + (height - 167) / 2} 7, ${137 + (height - 167) / 2}
|
||||||
|
`"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<polygon
|
||||||
|
:fill="mergedColor[0]"
|
||||||
|
:filter="`url(#${filterId})`"
|
||||||
|
:points="`
|
||||||
|
${width - 7}, ${53 + (height - 167) / 2} ${width - 11}, ${57 + (height - 167) / 2}
|
||||||
|
${width - 11}, ${133 + (height - 167) / 2} ${width - 7}, ${137 + (height - 167) / 2}
|
||||||
|
`"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<div class="border-box-content">
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import autoResize from '../../../mixin/autoResize'
|
||||||
|
import { uuid } from '../../../util/index'
|
||||||
|
|
||||||
|
import { deepMerge } from '@jiaminghi/charts/lib/util/index'
|
||||||
|
|
||||||
|
import { deepClone } from '@jiaminghi/c-render/lib/plugin/util'
|
||||||
|
|
||||||
|
import { fade } from '@jiaminghi/color'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DvBorderBox11',
|
||||||
|
mixins: [autoResize],
|
||||||
|
props: {
|
||||||
|
color: {
|
||||||
|
type: Array,
|
||||||
|
default: () => ([])
|
||||||
|
},
|
||||||
|
titleWidth: {
|
||||||
|
type: Number,
|
||||||
|
default: 250
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
backgroundColor: {
|
||||||
|
type: String,
|
||||||
|
default: 'transparent'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
const id = uuid()
|
||||||
|
return {
|
||||||
|
ref: 'border-box-11',
|
||||||
|
filterId: `border-box-11-filterId-${id}`,
|
||||||
|
|
||||||
|
defaultColor: ['#8aaafb', '#1f33a2'],
|
||||||
|
|
||||||
|
mergedColor: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
color () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
mergeColor () {
|
||||||
|
const { color, defaultColor } = this
|
||||||
|
|
||||||
|
this.mergedColor = deepMerge(deepClone(defaultColor, true), color || [])
|
||||||
|
},
|
||||||
|
fade
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
6
lib/components/borderBox12/index.js
Normal file
6
lib/components/borderBox12/index.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import './src/main.css'
|
||||||
|
import BorderBox12 from './src/main.vue'
|
||||||
|
|
||||||
|
export default function (Vue) {
|
||||||
|
Vue.component(BorderBox12.name, BorderBox12)
|
||||||
|
}
|
17
lib/components/borderBox12/src/main.css
Normal file
17
lib/components/borderBox12/src/main.css
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
.dv-border-box-12 {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.dv-border-box-12 .dv-border-svg-container {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
top: 0px;
|
||||||
|
left: 0px;
|
||||||
|
}
|
||||||
|
.dv-border-box-12 .border-box-content {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
148
lib/components/borderBox12/src/main.vue
Normal file
148
lib/components/borderBox12/src/main.vue
Normal file
@ -0,0 +1,148 @@
|
|||||||
|
<template>
|
||||||
|
<div class="dv-border-box-12" :ref="ref">
|
||||||
|
<svg class="dv-border-svg-container" :width="width" :height="height">
|
||||||
|
<defs>
|
||||||
|
<filter :id="filterId" height="150%" width="150%" x="-25%" y="-25%">
|
||||||
|
<feMorphology operator="dilate" radius="1" in="SourceAlpha" result="thicken" />
|
||||||
|
<feGaussianBlur in="thicken" stdDeviation="2" result="blurred" />
|
||||||
|
<feFlood :flood-color="fade(mergedColor[1] || defaultColor[1], 70)" result="glowColor">
|
||||||
|
<animate
|
||||||
|
attributeName="flood-color"
|
||||||
|
:values="`
|
||||||
|
${fade(mergedColor[1] || defaultColor[1], 70)};
|
||||||
|
${fade(mergedColor[1] || defaultColor[1], 30)};
|
||||||
|
${fade(mergedColor[1] || defaultColor[1], 70)};
|
||||||
|
`"
|
||||||
|
dur="3s"
|
||||||
|
begin="0s"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
/>
|
||||||
|
</feFlood>
|
||||||
|
<feComposite in="glowColor" in2="blurred" operator="in" result="softGlowColored" />
|
||||||
|
<feMerge>
|
||||||
|
<feMergeNode in="softGlowColored"/>
|
||||||
|
<feMergeNode in="SourceGraphic"/>
|
||||||
|
</feMerge>
|
||||||
|
</filter>
|
||||||
|
</defs>
|
||||||
|
|
||||||
|
<path
|
||||||
|
v-if="width && height"
|
||||||
|
:fill="backgroundColor"
|
||||||
|
stroke-width="2"
|
||||||
|
:stroke="mergedColor[0]"
|
||||||
|
:d="`
|
||||||
|
M15 5 L ${width - 15} 5 Q ${width - 5} 5, ${width - 5} 15
|
||||||
|
L ${width - 5} ${height - 15} Q ${width - 5} ${height - 5}, ${width - 15} ${height - 5}
|
||||||
|
L 15, ${height - 5} Q 5 ${height - 5} 5 ${height - 15} L 5 15
|
||||||
|
Q 5 5 15 5
|
||||||
|
`"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<path
|
||||||
|
stroke-width="2"
|
||||||
|
fill="transparent"
|
||||||
|
stroke-linecap="round"
|
||||||
|
:filter="`url(#${filterId})`"
|
||||||
|
:stroke="mergedColor[1]"
|
||||||
|
:d="`M 20 5 L 15 5 Q 5 5 5 15 L 5 20`"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<path
|
||||||
|
stroke-width="2"
|
||||||
|
fill="transparent"
|
||||||
|
stroke-linecap="round"
|
||||||
|
:filter="`url(#${filterId})`"
|
||||||
|
:stroke="mergedColor[1]"
|
||||||
|
:d="`M ${width - 20} 5 L ${width - 15} 5 Q ${width - 5} 5 ${width - 5} 15 L ${width - 5} 20`"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<path
|
||||||
|
stroke-width="2"
|
||||||
|
fill="transparent"
|
||||||
|
stroke-linecap="round"
|
||||||
|
:filter="`url(#${filterId})`"
|
||||||
|
:stroke="mergedColor[1]"
|
||||||
|
:d="`
|
||||||
|
M ${width - 20} ${height - 5} L ${width - 15} ${height - 5}
|
||||||
|
Q ${width - 5} ${height - 5} ${width - 5} ${height - 15}
|
||||||
|
L ${width - 5} ${height - 20}
|
||||||
|
`"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<path
|
||||||
|
stroke-width="2"
|
||||||
|
fill="transparent"
|
||||||
|
stroke-linecap="round"
|
||||||
|
:filter="`url(#${filterId})`"
|
||||||
|
:stroke="mergedColor[1]"
|
||||||
|
:d="`
|
||||||
|
M 20 ${height - 5} L 15 ${height - 5}
|
||||||
|
Q 5 ${height - 5} 5 ${height - 15}
|
||||||
|
L 5 ${height - 20}
|
||||||
|
`"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<div class="border-box-content">
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import autoResize from '../../../mixin/autoResize'
|
||||||
|
import { uuid } from '../../../util/index'
|
||||||
|
|
||||||
|
import { deepMerge } from '@jiaminghi/charts/lib/util/index'
|
||||||
|
|
||||||
|
import { deepClone } from '@jiaminghi/c-render/lib/plugin/util'
|
||||||
|
|
||||||
|
import { fade } from '@jiaminghi/color'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DvBorderBox12',
|
||||||
|
mixins: [autoResize],
|
||||||
|
props: {
|
||||||
|
color: {
|
||||||
|
type: Array,
|
||||||
|
default: () => ([])
|
||||||
|
},
|
||||||
|
backgroundColor: {
|
||||||
|
type: String,
|
||||||
|
default: 'transparent'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
const id = uuid()
|
||||||
|
return {
|
||||||
|
ref: 'border-box-12',
|
||||||
|
filterId: `borderr-box-12-filterId-${id}`,
|
||||||
|
|
||||||
|
defaultColor: ['#2e6099', '#7ce7fd'],
|
||||||
|
|
||||||
|
mergedColor: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
color () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
mergeColor () {
|
||||||
|
const { color, defaultColor } = this
|
||||||
|
|
||||||
|
this.mergedColor = deepMerge(deepClone(defaultColor, true), color || [])
|
||||||
|
},
|
||||||
|
fade
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
6
lib/components/borderBox13/index.js
Normal file
6
lib/components/borderBox13/index.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import './src/main.css'
|
||||||
|
import BorderBox13 from './src/main.vue'
|
||||||
|
|
||||||
|
export default function (Vue) {
|
||||||
|
Vue.component(BorderBox13.name, BorderBox13)
|
||||||
|
}
|
17
lib/components/borderBox13/src/main.css
Normal file
17
lib/components/borderBox13/src/main.css
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
.dv-border-box-13 {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.dv-border-box-13 .dv-border-svg-container {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
top: 0px;
|
||||||
|
left: 0px;
|
||||||
|
}
|
||||||
|
.dv-border-box-13 .border-box-content {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
92
lib/components/borderBox13/src/main.vue
Normal file
92
lib/components/borderBox13/src/main.vue
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
<template>
|
||||||
|
<div class="dv-border-box-13" :ref="ref">
|
||||||
|
<svg class="dv-border-svg-container" :width="width" :height="height">
|
||||||
|
<path
|
||||||
|
:fill="backgroundColor"
|
||||||
|
:stroke="mergedColor[0]"
|
||||||
|
:d="`
|
||||||
|
M 5 20 L 5 10 L 12 3 L 60 3 L 68 10
|
||||||
|
L ${width - 20} 10 L ${width - 5} 25
|
||||||
|
L ${width - 5} ${height - 5} L 20 ${height - 5}
|
||||||
|
L 5 ${height - 20} L 5 20
|
||||||
|
`"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<path
|
||||||
|
fill="transparent"
|
||||||
|
stroke-width="3"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-dasharray="10, 5"
|
||||||
|
:stroke="mergedColor[0]"
|
||||||
|
:d="`M 16 9 L 61 9`"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<path
|
||||||
|
fill="transparent"
|
||||||
|
:stroke="mergedColor[1]"
|
||||||
|
:d="`M 5 20 L 5 10 L 12 3 L 60 3 L 68 10`"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<path
|
||||||
|
fill="transparent"
|
||||||
|
:stroke="mergedColor[1]"
|
||||||
|
:d="`M ${width - 5} ${height - 30} L ${width - 5} ${height - 5} L ${width - 30} ${height - 5}`"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<div class="border-box-content">
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import autoResize from '../../../mixin/autoResize'
|
||||||
|
|
||||||
|
import { deepMerge } from '@jiaminghi/charts/lib/util/index'
|
||||||
|
|
||||||
|
import { deepClone } from '@jiaminghi/c-render/lib/plugin/util'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DvBorderBox13',
|
||||||
|
mixins: [autoResize],
|
||||||
|
props: {
|
||||||
|
color: {
|
||||||
|
type: Array,
|
||||||
|
default: () => ([])
|
||||||
|
},
|
||||||
|
backgroundColor: {
|
||||||
|
type: String,
|
||||||
|
default: 'transparent'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
ref: 'border-box-13',
|
||||||
|
|
||||||
|
defaultColor: ['#6586ec', '#2cf7fe'],
|
||||||
|
|
||||||
|
mergedColor: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
color () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
mergeColor () {
|
||||||
|
const { color, defaultColor } = this
|
||||||
|
|
||||||
|
this.mergedColor = deepMerge(deepClone(defaultColor, true), color || [])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
6
lib/components/borderBox2/index.js
Normal file
6
lib/components/borderBox2/index.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import './src/main.css'
|
||||||
|
import BorderBox2 from './src/main.vue'
|
||||||
|
|
||||||
|
export default function (Vue) {
|
||||||
|
Vue.component(BorderBox2.name, BorderBox2)
|
||||||
|
}
|
21
lib/components/borderBox2/src/main.css
Normal file
21
lib/components/borderBox2/src/main.css
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
.dv-border-box-2 {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.dv-border-box-2 .dv-border-svg-container {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
top: 0px;
|
||||||
|
left: 0px;
|
||||||
|
}
|
||||||
|
.dv-border-box-2 .dv-border-svg-container polyline {
|
||||||
|
fill: none;
|
||||||
|
stroke-width: 1;
|
||||||
|
}
|
||||||
|
.dv-border-box-2 .border-box-content {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
77
lib/components/borderBox2/src/main.vue
Normal file
77
lib/components/borderBox2/src/main.vue
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
<template>
|
||||||
|
<div class="dv-border-box-2" :ref="ref">
|
||||||
|
<svg class="dv-border-svg-container" :width="width" :height="height">
|
||||||
|
<polygon :fill="backgroundColor" :points="`
|
||||||
|
7, 7 ${width - 7}, 7 ${width - 7}, ${height - 7} 7, ${height - 7}
|
||||||
|
`" />
|
||||||
|
|
||||||
|
<polyline
|
||||||
|
:stroke="mergedColor[0]"
|
||||||
|
:points="`2, 2 ${width - 2} ,2 ${width - 2}, ${height - 2} 2, ${height - 2} 2, 2`"
|
||||||
|
/>
|
||||||
|
<polyline
|
||||||
|
:stroke="mergedColor[1]"
|
||||||
|
:points="`6, 6 ${width - 6}, 6 ${width - 6}, ${height - 6} 6, ${height - 6} 6, 6`"
|
||||||
|
/>
|
||||||
|
<circle :fill="mergedColor[0]" cx="11" cy="11" r="1" />
|
||||||
|
<circle :fill="mergedColor[0]" :cx="width - 11" cy="11" r="1" />
|
||||||
|
<circle :fill="mergedColor[0]" :cx="width - 11" :cy="height - 11" r="1" />
|
||||||
|
<circle :fill="mergedColor[0]" cx="11" :cy="height - 11" r="1" />
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<div class="border-box-content">
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import autoResize from '../../../mixin/autoResize'
|
||||||
|
|
||||||
|
import { deepMerge } from '@jiaminghi/charts/lib/util/index'
|
||||||
|
|
||||||
|
import { deepClone } from '@jiaminghi/c-render/lib/plugin/util'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DvBorderBox2',
|
||||||
|
mixins: [autoResize],
|
||||||
|
props: {
|
||||||
|
color: {
|
||||||
|
type: Array,
|
||||||
|
default: () => ([])
|
||||||
|
},
|
||||||
|
backgroundColor: {
|
||||||
|
type: String,
|
||||||
|
default: 'transparent'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
ref: 'border-box-2',
|
||||||
|
|
||||||
|
defaultColor: ['#fff', 'rgba(255, 255, 255, 0.6)'],
|
||||||
|
|
||||||
|
mergedColor: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
color () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
mergeColor () {
|
||||||
|
const { color, defaultColor } = this
|
||||||
|
|
||||||
|
this.mergedColor = deepMerge(deepClone(defaultColor, true), color || [])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
6
lib/components/borderBox3/index.js
Normal file
6
lib/components/borderBox3/index.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import './src/main.css'
|
||||||
|
import BorderBox3 from './src/main.vue'
|
||||||
|
|
||||||
|
export default function (Vue) {
|
||||||
|
Vue.component(BorderBox3.name, BorderBox3)
|
||||||
|
}
|
26
lib/components/borderBox3/src/main.css
Normal file
26
lib/components/borderBox3/src/main.css
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
.dv-border-box-3 {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.dv-border-box-3 .dv-border-svg-container {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
top: 0px;
|
||||||
|
left: 0px;
|
||||||
|
}
|
||||||
|
.dv-border-box-3 .dv-border-svg-container polyline {
|
||||||
|
fill: none;
|
||||||
|
}
|
||||||
|
.dv-border-box-3 .dv-bb3-line1 {
|
||||||
|
stroke-width: 3;
|
||||||
|
}
|
||||||
|
.dv-border-box-3 .dv-bb3-line2 {
|
||||||
|
stroke-width: 1;
|
||||||
|
}
|
||||||
|
.dv-border-box-3 .border-box-content {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
81
lib/components/borderBox3/src/main.vue
Normal file
81
lib/components/borderBox3/src/main.vue
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
<template>
|
||||||
|
<div class="dv-border-box-3" :ref="ref">
|
||||||
|
<svg class="dv-border-svg-container" :width="width" :height="height">
|
||||||
|
<polygon :fill="backgroundColor" :points="`
|
||||||
|
23, 23 ${width - 24}, 23 ${width - 24}, ${height - 24} 23, ${height - 24}
|
||||||
|
`" />
|
||||||
|
|
||||||
|
<polyline class="dv-bb3-line1"
|
||||||
|
:stroke="mergedColor[0]"
|
||||||
|
:points="`4, 4 ${width - 22} ,4 ${width - 22}, ${height - 22} 4, ${height - 22} 4, 4`"
|
||||||
|
/>
|
||||||
|
<polyline class="dv-bb3-line2"
|
||||||
|
:stroke="mergedColor[1]"
|
||||||
|
:points="`10, 10 ${width - 16}, 10 ${width - 16}, ${height - 16} 10, ${height - 16} 10, 10`"
|
||||||
|
/>
|
||||||
|
<polyline class="dv-bb3-line2"
|
||||||
|
:stroke="mergedColor[1]"
|
||||||
|
:points="`16, 16 ${width - 10}, 16 ${width - 10}, ${height - 10} 16, ${height - 10} 16, 16`"
|
||||||
|
/>
|
||||||
|
<polyline class="dv-bb3-line2"
|
||||||
|
:stroke="mergedColor[1]"
|
||||||
|
:points="`22, 22 ${width - 4}, 22 ${width - 4}, ${height - 4} 22, ${height - 4} 22, 22`"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<div class="border-box-content">
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import autoResize from '../../../mixin/autoResize'
|
||||||
|
|
||||||
|
import { deepMerge } from '@jiaminghi/charts/lib/util/index'
|
||||||
|
|
||||||
|
import { deepClone } from '@jiaminghi/c-render/lib/plugin/util'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DvBorderBox3',
|
||||||
|
mixins: [autoResize],
|
||||||
|
props: {
|
||||||
|
color: {
|
||||||
|
type: Array,
|
||||||
|
default: () => ([])
|
||||||
|
},
|
||||||
|
backgroundColor: {
|
||||||
|
type: String,
|
||||||
|
default: 'transparent'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
ref: 'border-box-3',
|
||||||
|
|
||||||
|
defaultColor: ['#2862b7', '#2862b7'],
|
||||||
|
|
||||||
|
mergedColor: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
color () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
mergeColor () {
|
||||||
|
const { color, defaultColor } = this
|
||||||
|
|
||||||
|
this.mergedColor = deepMerge(deepClone(defaultColor, true), color || [])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
6
lib/components/borderBox4/index.js
Normal file
6
lib/components/borderBox4/index.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import './src/main.css'
|
||||||
|
import BorderBox4 from './src/main.vue'
|
||||||
|
|
||||||
|
export default function (Vue) {
|
||||||
|
Vue.component(BorderBox4.name, BorderBox4)
|
||||||
|
}
|
66
lib/components/borderBox4/src/main.css
Normal file
66
lib/components/borderBox4/src/main.css
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
.dv-border-box-4 {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.dv-border-box-4 .dv-reverse {
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
|
.dv-border-box-4 .dv-border-svg-container {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
top: 0px;
|
||||||
|
left: 0px;
|
||||||
|
}
|
||||||
|
.dv-border-box-4 .dv-border-svg-container polyline {
|
||||||
|
fill: none;
|
||||||
|
}
|
||||||
|
.dv-border-box-4 .sw1 {
|
||||||
|
stroke-width: 1;
|
||||||
|
}
|
||||||
|
.dv-border-box-4 .sw3 {
|
||||||
|
stroke-width: 3px;
|
||||||
|
stroke-linecap: round;
|
||||||
|
}
|
||||||
|
.dv-border-box-4 .dv-bb4-line-1 {
|
||||||
|
stroke-width: 1;
|
||||||
|
}
|
||||||
|
.dv-border-box-4 .dv-bb4-line-2 {
|
||||||
|
stroke-width: 1;
|
||||||
|
}
|
||||||
|
.dv-border-box-4 .dv-bb4-line-3 {
|
||||||
|
stroke-width: 3px;
|
||||||
|
stroke-linecap: round;
|
||||||
|
}
|
||||||
|
.dv-border-box-4 .dv-bb4-line-4 {
|
||||||
|
stroke-width: 3px;
|
||||||
|
stroke-linecap: round;
|
||||||
|
}
|
||||||
|
.dv-border-box-4 .dv-bb4-line-5 {
|
||||||
|
stroke-width: 1;
|
||||||
|
}
|
||||||
|
.dv-border-box-4 .dv-bb4-line-6 {
|
||||||
|
stroke-width: 1;
|
||||||
|
}
|
||||||
|
.dv-border-box-4 .dv-bb4-line-7 {
|
||||||
|
stroke-width: 1;
|
||||||
|
}
|
||||||
|
.dv-border-box-4 .dv-bb4-line-8 {
|
||||||
|
stroke-width: 3px;
|
||||||
|
stroke-linecap: round;
|
||||||
|
}
|
||||||
|
.dv-border-box-4 .dv-bb4-line-9 {
|
||||||
|
stroke-width: 3px;
|
||||||
|
stroke-linecap: round;
|
||||||
|
stroke-dasharray: 100 250;
|
||||||
|
}
|
||||||
|
.dv-border-box-4 .dv-bb4-line-10 {
|
||||||
|
stroke-width: 1;
|
||||||
|
stroke-dasharray: 80 270;
|
||||||
|
}
|
||||||
|
.dv-border-box-4 .border-box-content {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
89
lib/components/borderBox4/src/main.vue
Normal file
89
lib/components/borderBox4/src/main.vue
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
<template>
|
||||||
|
<div class="dv-border-box-4" :ref="ref">
|
||||||
|
<svg :class="`dv-border-svg-container ${reverse && 'dv-reverse'}`" :width="width" :height="height">
|
||||||
|
<polygon :fill="backgroundColor" :points="`
|
||||||
|
${width - 15}, 22 170, 22 150, 7 40, 7 28, 21 32, 24
|
||||||
|
16, 42 16, ${height - 32} 41, ${height - 7} ${width - 15}, ${height - 7}
|
||||||
|
`" />
|
||||||
|
|
||||||
|
<polyline class="dv-bb4-line-1"
|
||||||
|
:stroke="mergedColor[0]"
|
||||||
|
:points="`145, ${height - 5} 40, ${height - 5} 10, ${height - 35}
|
||||||
|
10, 40 40, 5 150, 5 170, 20 ${width - 15}, 20`"
|
||||||
|
/>
|
||||||
|
<polyline
|
||||||
|
:stroke="mergedColor[1]"
|
||||||
|
class="dv-bb4-line-2" :points="`245, ${height - 1} 36, ${height - 1} 14, ${height - 23}
|
||||||
|
14, ${height - 100}`"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<polyline class="dv-bb4-line-3" :stroke="mergedColor[0]" :points="`7, ${height - 40} 7, ${height - 75}`" />
|
||||||
|
<polyline class="dv-bb4-line-4" :stroke="mergedColor[0]" :points="`28, 24 13, 41 13, 64`" />
|
||||||
|
<polyline class="dv-bb4-line-5" :stroke="mergedColor[0]" :points="`5, 45 5, 140`" />
|
||||||
|
<polyline class="dv-bb4-line-6" :stroke="mergedColor[1]" :points="`14, 75 14, 180`" />
|
||||||
|
<polyline class="dv-bb4-line-7" :stroke="mergedColor[1]" :points="`55, 11 147, 11 167, 26 250, 26`" />
|
||||||
|
<polyline class="dv-bb4-line-8" :stroke="mergedColor[1]" :points="`158, 5 173, 16`" />
|
||||||
|
<polyline class="dv-bb4-line-9" :stroke="mergedColor[0]" :points="`200, 17 ${width - 10}, 17`" />
|
||||||
|
<polyline class="dv-bb4-line-10" :stroke="mergedColor[1]" :points="`385, 17 ${width - 10}, 17`" />
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<div class="border-box-content">
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import autoResize from '../../../mixin/autoResize'
|
||||||
|
|
||||||
|
import { deepMerge } from '@jiaminghi/charts/lib/util/index'
|
||||||
|
|
||||||
|
import { deepClone } from '@jiaminghi/c-render/lib/plugin/util'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DvBorderBox4',
|
||||||
|
mixins: [autoResize],
|
||||||
|
props: {
|
||||||
|
color: {
|
||||||
|
type: Array,
|
||||||
|
default: () => ([])
|
||||||
|
},
|
||||||
|
reverse: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
backgroundColor: {
|
||||||
|
type: String,
|
||||||
|
default: 'transparent'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
ref: 'border-box-4',
|
||||||
|
|
||||||
|
defaultColor: ['red', 'rgba(0,0,255,0.8)'],
|
||||||
|
|
||||||
|
mergedColor: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
color () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
mergeColor () {
|
||||||
|
const { color, defaultColor } = this
|
||||||
|
|
||||||
|
this.mergedColor = deepMerge(deepClone(defaultColor, true), color || [])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
6
lib/components/borderBox5/index.js
Normal file
6
lib/components/borderBox5/index.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import './src/main.css'
|
||||||
|
import BorderBox5 from './src/main.vue'
|
||||||
|
|
||||||
|
export default function (Vue) {
|
||||||
|
Vue.component(BorderBox5.name, BorderBox5)
|
||||||
|
}
|
35
lib/components/borderBox5/src/main.css
Normal file
35
lib/components/borderBox5/src/main.css
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
.dv-border-box-5 {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.dv-border-box-5 .dv-reverse {
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
|
.dv-border-box-5 .dv-svg-container {
|
||||||
|
position: absolute;
|
||||||
|
top: 0px;
|
||||||
|
left: 0px;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.dv-border-box-5 .dv-svg-container polyline {
|
||||||
|
fill: none;
|
||||||
|
}
|
||||||
|
.dv-border-box-5 .dv-bb5-line-1,
|
||||||
|
.dv-border-box-5 .dv-bb5-line-2 {
|
||||||
|
stroke-width: 1;
|
||||||
|
}
|
||||||
|
.dv-border-box-5 .dv-bb5-line-3,
|
||||||
|
.dv-border-box-5 .dv-bb5-line-6 {
|
||||||
|
stroke-width: 5;
|
||||||
|
}
|
||||||
|
.dv-border-box-5 .dv-bb5-line-4,
|
||||||
|
.dv-border-box-5 .dv-bb5-line-5 {
|
||||||
|
stroke-width: 2;
|
||||||
|
}
|
||||||
|
.dv-border-box-5 .border-box-content {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
85
lib/components/borderBox5/src/main.vue
Normal file
85
lib/components/borderBox5/src/main.vue
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
<template>
|
||||||
|
<div class="dv-border-box-5" :ref="ref">
|
||||||
|
<svg :class="`dv-svg-container ${reverse && 'dv-reverse'}`" :width="width" :height="height">
|
||||||
|
<polygon :fill="backgroundColor" :points="`
|
||||||
|
10, 22 ${width - 22}, 22 ${width - 22}, ${height - 86} ${width - 84}, ${height - 24} 10, ${height - 24}
|
||||||
|
`" />
|
||||||
|
|
||||||
|
<polyline
|
||||||
|
class="dv-bb5-line-1"
|
||||||
|
:stroke="mergedColor[0]"
|
||||||
|
:points="`8, 5 ${width - 5}, 5 ${width - 5}, ${height - 100}
|
||||||
|
${width - 100}, ${height - 5} 8, ${height - 5} 8, 5`"
|
||||||
|
/>
|
||||||
|
<polyline
|
||||||
|
class="dv-bb5-line-2"
|
||||||
|
:stroke="mergedColor[1]"
|
||||||
|
:points="`3, 5 ${width - 20}, 5 ${width - 20}, ${height - 60}
|
||||||
|
${width - 74}, ${height - 5} 3, ${height - 5} 3, 5`"
|
||||||
|
/>
|
||||||
|
<polyline class="dv-bb5-line-3" :stroke="mergedColor[1]" :points="`50, 13 ${width - 35}, 13`" />
|
||||||
|
<polyline class="dv-bb5-line-4" :stroke="mergedColor[1]" :points="`15, 20 ${width - 35}, 20`" />
|
||||||
|
<polyline class="dv-bb5-line-5" :stroke="mergedColor[1]" :points="`15, ${height - 20} ${width - 110}, ${height - 20}`" />
|
||||||
|
<polyline class="dv-bb5-line-6" :stroke="mergedColor[1]" :points="`15, ${height - 13} ${width - 110}, ${height - 13}`" />
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<div class="border-box-content">
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import autoResize from '../../../mixin/autoResize'
|
||||||
|
|
||||||
|
import { deepMerge } from '@jiaminghi/charts/lib/util/index'
|
||||||
|
|
||||||
|
import { deepClone } from '@jiaminghi/c-render/lib/plugin/util'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DvBorderBox5',
|
||||||
|
mixins: [autoResize],
|
||||||
|
props: {
|
||||||
|
color: {
|
||||||
|
type: Array,
|
||||||
|
default: () => ([])
|
||||||
|
},
|
||||||
|
reverse: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
backgroundColor: {
|
||||||
|
type: String,
|
||||||
|
default: 'transparent'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
ref: 'border-box-5',
|
||||||
|
|
||||||
|
defaultColor: ['rgba(255, 255, 255, 0.35)', 'rgba(255, 255, 255, 0.20)'],
|
||||||
|
|
||||||
|
mergedColor: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
color () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
mergeColor () {
|
||||||
|
const { color, defaultColor } = this
|
||||||
|
|
||||||
|
this.mergedColor = deepMerge(deepClone(defaultColor, true), color || [])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
6
lib/components/borderBox6/index.js
Normal file
6
lib/components/borderBox6/index.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import './src/main.css'
|
||||||
|
import BorderBox6 from './src/main.vue'
|
||||||
|
|
||||||
|
export default function (Vue) {
|
||||||
|
Vue.component(BorderBox6.name, BorderBox6)
|
||||||
|
}
|
21
lib/components/borderBox6/src/main.css
Normal file
21
lib/components/borderBox6/src/main.css
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
.dv-border-box-6 {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.dv-border-box-6 .dv-svg-container {
|
||||||
|
position: absolute;
|
||||||
|
top: 0px;
|
||||||
|
left: 0px;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.dv-border-box-6 .dv-svg-container polyline {
|
||||||
|
fill: none;
|
||||||
|
stroke-width: 1;
|
||||||
|
}
|
||||||
|
.dv-border-box-6 .border-box-content {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
81
lib/components/borderBox6/src/main.vue
Normal file
81
lib/components/borderBox6/src/main.vue
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
<template>
|
||||||
|
<div class="dv-border-box-6" :ref="ref">
|
||||||
|
<svg class="dv-svg-container" :width="width" :height="height">
|
||||||
|
<polygon :fill="backgroundColor" :points="`
|
||||||
|
9, 7 ${width - 9}, 7 ${width - 9}, ${height - 7} 9, ${height - 7}
|
||||||
|
`" />
|
||||||
|
|
||||||
|
<circle :fill="mergedColor[1]" cx="5" cy="5" r="2"/>
|
||||||
|
<circle :fill="mergedColor[1]" :cx="width - 5" cy="5" r="2" />
|
||||||
|
<circle :fill="mergedColor[1]" :cx="width - 5" :cy="height - 5" r="2" />
|
||||||
|
<circle :fill="mergedColor[1]" cx="5" :cy="height - 5" r="2" />
|
||||||
|
<polyline :stroke="mergedColor[0]" :points="`10, 4 ${width - 10}, 4`" />
|
||||||
|
<polyline :stroke="mergedColor[0]" :points="`10, ${height - 4} ${width - 10}, ${height - 4}`" />
|
||||||
|
<polyline :stroke="mergedColor[0]" :points="`5, 70 5, ${height - 70}`" />
|
||||||
|
<polyline :stroke="mergedColor[0]" :points="`${width - 5}, 70 ${width - 5}, ${height - 70}`" />
|
||||||
|
<polyline :stroke="mergedColor[0]" :points="`3, 10, 3, 50`" />
|
||||||
|
<polyline :stroke="mergedColor[0]" :points="`7, 30 7, 80`" />
|
||||||
|
<polyline :stroke="mergedColor[0]" :points="`${width - 3}, 10 ${width - 3}, 50`" />
|
||||||
|
<polyline :stroke="mergedColor[0]" :points="`${width - 7}, 30 ${width - 7}, 80`" />
|
||||||
|
<polyline :stroke="mergedColor[0]" :points="`3, ${height - 10} 3, ${height - 50}`" />
|
||||||
|
<polyline :stroke="mergedColor[0]" :points="`7, ${height - 30} 7, ${height - 80}`" />
|
||||||
|
<polyline :stroke="mergedColor[0]" :points="`${width - 3}, ${height - 10} ${width - 3}, ${height - 50}`" />
|
||||||
|
<polyline :stroke="mergedColor[0]" :points="`${width - 7}, ${height - 30} ${width - 7}, ${height - 80}`" />
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<div class="border-box-content">
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import autoResize from '../../../mixin/autoResize.js'
|
||||||
|
|
||||||
|
import { deepMerge } from '@jiaminghi/charts/lib/util/index'
|
||||||
|
|
||||||
|
import { deepClone } from '@jiaminghi/c-render/lib/plugin/util'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DvBorderBox6',
|
||||||
|
mixins: [autoResize],
|
||||||
|
props: {
|
||||||
|
color: {
|
||||||
|
type: Array,
|
||||||
|
default: () => ([])
|
||||||
|
},
|
||||||
|
backgroundColor: {
|
||||||
|
type: String,
|
||||||
|
default: 'transparent'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
ref: 'border-box-6',
|
||||||
|
|
||||||
|
defaultColor: ['rgba(255, 255, 255, 0.35)', 'gray'],
|
||||||
|
|
||||||
|
mergedColor: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
color () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
mergeColor () {
|
||||||
|
const { color, defaultColor } = this
|
||||||
|
|
||||||
|
this.mergedColor = deepMerge(deepClone(defaultColor, true), color || [])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
6
lib/components/borderBox7/index.js
Normal file
6
lib/components/borderBox7/index.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import './src/main.css'
|
||||||
|
import BorderBox7 from './src/main.vue'
|
||||||
|
|
||||||
|
export default function (Vue) {
|
||||||
|
Vue.component(BorderBox7.name, BorderBox7)
|
||||||
|
}
|
27
lib/components/borderBox7/src/main.css
Normal file
27
lib/components/borderBox7/src/main.css
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
.dv-border-box-7 {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.dv-border-box-7 .dv-svg-container {
|
||||||
|
position: absolute;
|
||||||
|
top: 0px;
|
||||||
|
left: 0px;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.dv-border-box-7 .dv-svg-container polyline {
|
||||||
|
fill: none;
|
||||||
|
stroke-linecap: round;
|
||||||
|
}
|
||||||
|
.dv-border-box-7 .dv-bb7-line-width-2 {
|
||||||
|
stroke-width: 2;
|
||||||
|
}
|
||||||
|
.dv-border-box-7 .dv-bb7-line-width-5 {
|
||||||
|
stroke-width: 5;
|
||||||
|
}
|
||||||
|
.dv-border-box-7 .border-box-content {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
75
lib/components/borderBox7/src/main.vue
Normal file
75
lib/components/borderBox7/src/main.vue
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
|
||||||
|
<template>
|
||||||
|
<div
|
||||||
|
class="dv-border-box-7"
|
||||||
|
:style="`box-shadow: inset 0 0 40px ${mergedColor[0]}; border: 1px solid ${mergedColor[0]}; background-color: ${backgroundColor}`"
|
||||||
|
:ref="ref"
|
||||||
|
>
|
||||||
|
<svg class="dv-svg-container" :width="width" :height="height">
|
||||||
|
<polyline class="dv-bb7-line-width-2" :stroke="mergedColor[0]" :points="`0, 25 0, 0 25, 0`" />
|
||||||
|
<polyline class="dv-bb7-line-width-2" :stroke="mergedColor[0]" :points="`${width - 25}, 0 ${width}, 0 ${width}, 25`" />
|
||||||
|
<polyline class="dv-bb7-line-width-2" :stroke="mergedColor[0]" :points="`${width - 25}, ${height} ${width}, ${height} ${width}, ${height - 25}`" />
|
||||||
|
<polyline class="dv-bb7-line-width-2" :stroke="mergedColor[0]" :points="`0, ${height - 25} 0, ${height} 25, ${height}`" />
|
||||||
|
|
||||||
|
<polyline class="dv-bb7-line-width-5" :stroke="mergedColor[1]" :points="`0, 10 0, 0 10, 0`" />
|
||||||
|
<polyline class="dv-bb7-line-width-5" :stroke="mergedColor[1]" :points="`${width - 10}, 0 ${width}, 0 ${width}, 10`" />
|
||||||
|
<polyline class="dv-bb7-line-width-5" :stroke="mergedColor[1]" :points="`${width - 10}, ${height} ${width}, ${height} ${width}, ${height - 10}`" />
|
||||||
|
<polyline class="dv-bb7-line-width-5" :stroke="mergedColor[1]" :points="`0, ${height - 10} 0, ${height} 10, ${height}`" />
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<div class="border-box-content">
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import autoResize from '../../../mixin/autoResize'
|
||||||
|
|
||||||
|
import { deepMerge } from '@jiaminghi/charts/lib/util/index'
|
||||||
|
|
||||||
|
import { deepClone } from '@jiaminghi/c-render/lib/plugin/util'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DvBorderBox7',
|
||||||
|
mixins: [autoResize],
|
||||||
|
props: {
|
||||||
|
color: {
|
||||||
|
type: Array,
|
||||||
|
default: () => ([])
|
||||||
|
},
|
||||||
|
backgroundColor: {
|
||||||
|
type: String,
|
||||||
|
default: 'transparent'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
ref: 'border-box-7',
|
||||||
|
|
||||||
|
defaultColor: ['rgba(128,128,128,0.3)', 'rgba(128,128,128,0.5)'],
|
||||||
|
|
||||||
|
mergedColor: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
color () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
mergeColor () {
|
||||||
|
const { color, defaultColor } = this
|
||||||
|
|
||||||
|
this.mergedColor = deepMerge(deepClone(defaultColor, true), color || [])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
6
lib/components/borderBox8/index.js
Normal file
6
lib/components/borderBox8/index.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import './src/main.css'
|
||||||
|
import BorderBox8 from './src/main.vue'
|
||||||
|
|
||||||
|
export default function (Vue) {
|
||||||
|
Vue.component(BorderBox8.name, BorderBox8)
|
||||||
|
}
|
17
lib/components/borderBox8/src/main.css
Normal file
17
lib/components/borderBox8/src/main.css
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
.dv-border-box-8 {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.dv-border-box-8 svg {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
left: 0px;
|
||||||
|
top: 0px;
|
||||||
|
}
|
||||||
|
.dv-border-box-8 .border-box-content {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
142
lib/components/borderBox8/src/main.vue
Normal file
142
lib/components/borderBox8/src/main.vue
Normal file
@ -0,0 +1,142 @@
|
|||||||
|
<template>
|
||||||
|
<div class="dv-border-box-8" :ref="ref">
|
||||||
|
<svg class="dv-svg-container" :width="width" :height="height">
|
||||||
|
<defs>
|
||||||
|
<path
|
||||||
|
:id="path"
|
||||||
|
:d="pathD"
|
||||||
|
fill="transparent"
|
||||||
|
/>
|
||||||
|
<radialGradient
|
||||||
|
:id="gradient"
|
||||||
|
cx="50%" cy="50%" r="50%"
|
||||||
|
>
|
||||||
|
<stop
|
||||||
|
offset="0%" stop-color="#fff"
|
||||||
|
stop-opacity="1"
|
||||||
|
/>
|
||||||
|
<stop
|
||||||
|
offset="100%" stop-color="#fff"
|
||||||
|
stop-opacity="0"
|
||||||
|
/>
|
||||||
|
</radialGradient>
|
||||||
|
|
||||||
|
<mask :id="mask">
|
||||||
|
<circle cx="0" cy="0" r="150" :fill="`url(#${gradient})`">
|
||||||
|
<animateMotion
|
||||||
|
:dur="`${dur}s`"
|
||||||
|
:path="pathD"
|
||||||
|
rotate="auto"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
/>
|
||||||
|
</circle>
|
||||||
|
</mask>
|
||||||
|
</defs>
|
||||||
|
|
||||||
|
<polygon :fill="backgroundColor" :points="`5, 5 ${width - 5}, 5 ${width - 5} ${height - 5} 5, ${height - 5}`" />
|
||||||
|
|
||||||
|
<use
|
||||||
|
:stroke="mergedColor[0]"
|
||||||
|
stroke-width="1"
|
||||||
|
:xlink:href="`#${path}`"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<use
|
||||||
|
:stroke="mergedColor[1]"
|
||||||
|
stroke-width="3"
|
||||||
|
:xlink:href="`#${path}`"
|
||||||
|
:mask="`url(#${mask})`"
|
||||||
|
>
|
||||||
|
<animate
|
||||||
|
attributeName="stroke-dasharray"
|
||||||
|
:from="`0, ${length}`"
|
||||||
|
:to="`${length}, 0`"
|
||||||
|
:dur="`${dur}s`"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
/>
|
||||||
|
</use>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<div class="border-box-content">
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import autoResize from '../../../mixin/autoResize'
|
||||||
|
import { uuid } from '../../../util/index'
|
||||||
|
|
||||||
|
import { deepMerge } from '@jiaminghi/charts/lib/util/index'
|
||||||
|
|
||||||
|
import { deepClone } from '@jiaminghi/c-render/lib/plugin/util'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DvBorderBox8',
|
||||||
|
mixins: [autoResize],
|
||||||
|
props: {
|
||||||
|
color: {
|
||||||
|
type: Array,
|
||||||
|
default: () => ([])
|
||||||
|
},
|
||||||
|
dur: {
|
||||||
|
type: Number,
|
||||||
|
default: 3
|
||||||
|
},
|
||||||
|
backgroundColor: {
|
||||||
|
type: String,
|
||||||
|
default: 'transparent'
|
||||||
|
},
|
||||||
|
reverse: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
const id = uuid()
|
||||||
|
return {
|
||||||
|
ref: 'border-box-8',
|
||||||
|
path: `border-box-8-path-${id}`,
|
||||||
|
gradient: `border-box-8-gradient-${id}`,
|
||||||
|
mask: `border-box-8-mask-${id}`,
|
||||||
|
|
||||||
|
defaultColor: ['#235fa7', '#4fd2dd'],
|
||||||
|
|
||||||
|
mergedColor: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
length () {
|
||||||
|
const { width, height } = this
|
||||||
|
|
||||||
|
return (width + height - 5) * 2
|
||||||
|
},
|
||||||
|
pathD () {
|
||||||
|
const { reverse, width, height } = this
|
||||||
|
|
||||||
|
if (reverse) return `M 2.5, 2.5 L 2.5, ${height - 2.5} L ${width - 2.5}, ${height - 2.5} L ${width - 2.5}, 2.5 L 2.5, 2.5`
|
||||||
|
|
||||||
|
return `M2.5, 2.5 L${width - 2.5}, 2.5 L${width - 2.5}, ${height - 2.5} L2.5, ${height - 2.5} L2.5, 2.5`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
color () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
mergeColor () {
|
||||||
|
const { color, defaultColor } = this
|
||||||
|
|
||||||
|
this.mergedColor = deepMerge(deepClone(defaultColor, true), color || [])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
6
lib/components/borderBox9/index.js
Normal file
6
lib/components/borderBox9/index.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import './src/main.css'
|
||||||
|
import BorderBox9 from './src/main.vue'
|
||||||
|
|
||||||
|
export default function (Vue) {
|
||||||
|
Vue.component(BorderBox9.name, BorderBox9)
|
||||||
|
}
|
17
lib/components/borderBox9/src/main.css
Normal file
17
lib/components/borderBox9/src/main.css
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
.dv-border-box-9 {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.dv-border-box-9 svg {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
left: 0px;
|
||||||
|
top: 0px;
|
||||||
|
}
|
||||||
|
.dv-border-box-9 .border-box-content {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
180
lib/components/borderBox9/src/main.vue
Normal file
180
lib/components/borderBox9/src/main.vue
Normal file
@ -0,0 +1,180 @@
|
|||||||
|
<template>
|
||||||
|
<div class="dv-border-box-9" :ref="ref">
|
||||||
|
<svg class="dv-svg-container" :width="width" :height="height">
|
||||||
|
<defs>
|
||||||
|
<linearGradient :id="gradientId" x1="0%" y1="0%" x2="100%" y2="100%">
|
||||||
|
<animate
|
||||||
|
attributeName="x1"
|
||||||
|
values="0%;100%;0%"
|
||||||
|
dur="10s"
|
||||||
|
begin="0s"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<animate
|
||||||
|
attributeName="x2"
|
||||||
|
values="100%;0%;100%"
|
||||||
|
dur="10s"
|
||||||
|
begin="0s"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<stop offset="0%" :stop-color="mergedColor[0]">
|
||||||
|
<animate
|
||||||
|
attributeName="stop-color"
|
||||||
|
:values="`${mergedColor[0]};${mergedColor[1]};${mergedColor[0]}`"
|
||||||
|
dur="10s"
|
||||||
|
begin="0s"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
/>
|
||||||
|
</stop>
|
||||||
|
<stop offset="100%" :stop-color="mergedColor[1]">
|
||||||
|
<animate
|
||||||
|
attributeName="stop-color"
|
||||||
|
:values="`${mergedColor[1]};${mergedColor[0]};${mergedColor[1]}`"
|
||||||
|
dur="10s"
|
||||||
|
begin="0s"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
/>
|
||||||
|
</stop>
|
||||||
|
</linearGradient>
|
||||||
|
|
||||||
|
<mask :id="maskId">
|
||||||
|
<polyline
|
||||||
|
stroke="#fff"
|
||||||
|
stroke-width="3"
|
||||||
|
fill="transparent"
|
||||||
|
:points="`8, ${height * 0.4} 8, 3, ${width * 0.4 + 7}, 3`"
|
||||||
|
/>
|
||||||
|
<polyline
|
||||||
|
fill="#fff"
|
||||||
|
:points="
|
||||||
|
`8, ${height * 0.15} 8, 3, ${width * 0.1 + 7}, 3
|
||||||
|
${width * 0.1}, 8 14, 8 14, ${height * 0.15 - 7}
|
||||||
|
`"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<polyline
|
||||||
|
stroke="#fff"
|
||||||
|
stroke-width="3"
|
||||||
|
fill="transparent"
|
||||||
|
:points="`${width * 0.5}, 3 ${width - 3}, 3, ${width - 3}, ${height * 0.25}`"
|
||||||
|
/>
|
||||||
|
<polyline
|
||||||
|
fill="#fff"
|
||||||
|
:points="`
|
||||||
|
${width * 0.52}, 3 ${width * 0.58}, 3
|
||||||
|
${width * 0.58 - 7}, 9 ${width * 0.52 + 7}, 9
|
||||||
|
`"
|
||||||
|
/>
|
||||||
|
<polyline
|
||||||
|
fill="#fff"
|
||||||
|
:points="`
|
||||||
|
${width * 0.9}, 3 ${width - 3}, 3 ${width - 3}, ${height * 0.1}
|
||||||
|
${width - 9}, ${height * 0.1 - 7} ${width - 9}, 9 ${width * 0.9 + 7}, 9
|
||||||
|
`"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<polyline
|
||||||
|
stroke="#fff"
|
||||||
|
stroke-width="3"
|
||||||
|
fill="transparent"
|
||||||
|
:points="`8, ${height * 0.5} 8, ${height - 3} ${width * 0.3 + 7}, ${height - 3}`"
|
||||||
|
/>
|
||||||
|
<polyline
|
||||||
|
fill="#fff"
|
||||||
|
:points="`
|
||||||
|
8, ${height * 0.55} 8, ${height * 0.7}
|
||||||
|
2, ${height * 0.7 - 7} 2, ${height * 0.55 + 7}
|
||||||
|
`"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<polyline
|
||||||
|
stroke="#fff"
|
||||||
|
stroke-width="3"
|
||||||
|
fill="transparent"
|
||||||
|
:points="`${width * 0.35}, ${height - 3} ${width - 3}, ${height - 3} ${width - 3}, ${height * 0.35}`"
|
||||||
|
/>
|
||||||
|
<polyline
|
||||||
|
fill="#fff"
|
||||||
|
:points="`
|
||||||
|
${width * 0.92}, ${height - 3} ${width - 3}, ${height - 3} ${width - 3}, ${height * 0.8}
|
||||||
|
${width - 9}, ${height * 0.8 + 7} ${width - 9}, ${height - 9} ${width * 0.92 + 7}, ${height - 9}
|
||||||
|
`"
|
||||||
|
/>
|
||||||
|
</mask>
|
||||||
|
</defs>
|
||||||
|
|
||||||
|
<polygon :fill="backgroundColor" :points="`
|
||||||
|
15, 9 ${width * 0.1 + 1}, 9 ${width * 0.1 + 4}, 6 ${width * 0.52 + 2}, 6
|
||||||
|
${width * 0.52 + 6}, 10 ${width * 0.58 - 7}, 10 ${width * 0.58 - 2}, 6
|
||||||
|
${width * 0.9 + 2}, 6 ${width * 0.9 + 6}, 10 ${width - 10}, 10 ${width - 10}, ${height * 0.1 - 6}
|
||||||
|
${width - 6}, ${height * 0.1 - 1} ${width - 6}, ${height * 0.8 + 1} ${width - 10}, ${height * 0.8 + 6}
|
||||||
|
${width - 10}, ${height - 10} ${width * 0.92 + 7}, ${height - 10} ${width * 0.92 + 2}, ${height - 6}
|
||||||
|
11, ${height - 6} 11, ${height * 0.15 - 2} 15, ${height * 0.15 - 7}
|
||||||
|
`" />
|
||||||
|
|
||||||
|
<rect x="0" y="0" :width="width" :height="height" :fill="`url(#${gradientId})`" :mask="`url(#${maskId})`" />
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<div class="border-box-content">
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import autoResize from '../../../mixin/autoResize'
|
||||||
|
import { uuid } from '../../../util/index'
|
||||||
|
|
||||||
|
import { deepMerge } from '@jiaminghi/charts/lib/util/index'
|
||||||
|
|
||||||
|
import { deepClone } from '@jiaminghi/c-render/lib/plugin/util'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DvBorderBox9',
|
||||||
|
mixins: [autoResize],
|
||||||
|
props: {
|
||||||
|
color: {
|
||||||
|
type: Array,
|
||||||
|
default: () => ([])
|
||||||
|
},
|
||||||
|
backgroundColor: {
|
||||||
|
type: String,
|
||||||
|
default: 'transparent'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
const id = uuid()
|
||||||
|
return {
|
||||||
|
ref: 'border-box-9',
|
||||||
|
|
||||||
|
gradientId: `border-box-9-gradient-${id}`,
|
||||||
|
maskId: `border-box-9-mask-${id}`,
|
||||||
|
|
||||||
|
defaultColor: ['#11eefd', '#0078d2'],
|
||||||
|
|
||||||
|
mergedColor: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
color () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
mergeColor () {
|
||||||
|
const { color, defaultColor } = this
|
||||||
|
|
||||||
|
this.mergedColor = deepMerge(deepClone(defaultColor, true), color || [])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
6
lib/components/capsuleChart/index.js
Normal file
6
lib/components/capsuleChart/index.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import './src/main.css'
|
||||||
|
import CapsuleChart from './src/main.vue'
|
||||||
|
|
||||||
|
export default function (Vue) {
|
||||||
|
Vue.component(CapsuleChart.name, CapsuleChart)
|
||||||
|
}
|
63
lib/components/capsuleChart/src/main.css
Normal file
63
lib/components/capsuleChart/src/main.css
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
.dv-capsule-chart {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 10px;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.dv-capsule-chart .label-column {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding-right: 10px;
|
||||||
|
text-align: right;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
.dv-capsule-chart .label-column div {
|
||||||
|
height: 20px;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
.dv-capsule-chart .capsule-container {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.dv-capsule-chart .capsule-item {
|
||||||
|
box-shadow: 0 0 3px #999;
|
||||||
|
height: 10px;
|
||||||
|
margin: 5px 0px;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
.dv-capsule-chart .capsule-item .capsule-item-column {
|
||||||
|
position: relative;
|
||||||
|
height: 8px;
|
||||||
|
margin-top: 1px;
|
||||||
|
border-radius: 5px;
|
||||||
|
transition: all 0.3s;
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.dv-capsule-chart .capsule-item .capsule-item-column .capsule-item-value {
|
||||||
|
font-size: 12px;
|
||||||
|
transform: translateX(100%);
|
||||||
|
}
|
||||||
|
.dv-capsule-chart .unit-label {
|
||||||
|
height: 20px;
|
||||||
|
font-size: 12px;
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.dv-capsule-chart .unit-text {
|
||||||
|
text-align: right;
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 20px;
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
150
lib/components/capsuleChart/src/main.vue
Normal file
150
lib/components/capsuleChart/src/main.vue
Normal file
@ -0,0 +1,150 @@
|
|||||||
|
<template>
|
||||||
|
<div class="dv-capsule-chart">
|
||||||
|
<template v-if="mergedConfig">
|
||||||
|
<div class="label-column">
|
||||||
|
<div v-for="item in mergedConfig.data" :key="item.name">{{ item.name }}</div>
|
||||||
|
<div> </div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="capsule-container">
|
||||||
|
<div class="capsule-item" v-for="(capsule, index) in capsuleLength" :key="index">
|
||||||
|
<div
|
||||||
|
class="capsule-item-column"
|
||||||
|
:style="`width: ${capsule * 100}%; background-color: ${mergedConfig.colors[index % mergedConfig.colors.length]};`"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
v-if="mergedConfig.showValue"
|
||||||
|
class="capsule-item-value"
|
||||||
|
>{{ capsuleValue[index] }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="unit-label">
|
||||||
|
<div
|
||||||
|
v-for="(label, index) in labelData"
|
||||||
|
:key="label + index"
|
||||||
|
>{{ label }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="unit-text" v-if="mergedConfig.unit">{{ mergedConfig.unit }}</div>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { deepMerge } from '@jiaminghi/charts/lib/util/index'
|
||||||
|
|
||||||
|
import { deepClone } from '@jiaminghi/c-render/lib/plugin/util'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DvCapsuleChart',
|
||||||
|
props: {
|
||||||
|
config: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
defaultConfig: {
|
||||||
|
/**
|
||||||
|
* @description Capsule chart data
|
||||||
|
* @type {Array<Object>}
|
||||||
|
* @default data = []
|
||||||
|
* @example data = [{ name: 'foo1', value: 100 }, { name: 'foo2', value: 100 }]
|
||||||
|
*/
|
||||||
|
data: [],
|
||||||
|
/**
|
||||||
|
* @description Colors (hex|rgb|rgba|color keywords)
|
||||||
|
* @type {Array<String>}
|
||||||
|
* @default color = ['#37a2da', '#32c5e9', '#67e0e3', '#9fe6b8', '#ffdb5c', '#ff9f7f', '#fb7293']
|
||||||
|
* @example color = ['#000', 'rgb(0, 0, 0)', 'rgba(0, 0, 0, 1)', 'red']
|
||||||
|
*/
|
||||||
|
colors: [
|
||||||
|
'#37a2da',
|
||||||
|
'#32c5e9',
|
||||||
|
'#67e0e3',
|
||||||
|
'#9fe6b8',
|
||||||
|
'#ffdb5c',
|
||||||
|
'#ff9f7f',
|
||||||
|
'#fb7293'
|
||||||
|
],
|
||||||
|
/**
|
||||||
|
* @description Chart unit
|
||||||
|
* @type {String}
|
||||||
|
* @default unit = ''
|
||||||
|
*/
|
||||||
|
unit: '',
|
||||||
|
/**
|
||||||
|
* @description Show item value
|
||||||
|
* @type {Boolean}
|
||||||
|
* @default showValue = false
|
||||||
|
*/
|
||||||
|
showValue: false
|
||||||
|
},
|
||||||
|
|
||||||
|
mergedConfig: null,
|
||||||
|
|
||||||
|
capsuleLength: [],
|
||||||
|
capsuleValue: [],
|
||||||
|
labelData: [],
|
||||||
|
labelDataLength: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
config() {
|
||||||
|
const { calcData } = this
|
||||||
|
|
||||||
|
calcData()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
calcData() {
|
||||||
|
const { mergeConfig, calcCapsuleLengthAndLabelData } = this
|
||||||
|
|
||||||
|
mergeConfig()
|
||||||
|
|
||||||
|
calcCapsuleLengthAndLabelData()
|
||||||
|
},
|
||||||
|
mergeConfig() {
|
||||||
|
let { config, defaultConfig } = this
|
||||||
|
|
||||||
|
this.mergedConfig = deepMerge(
|
||||||
|
deepClone(defaultConfig, true),
|
||||||
|
config || {}
|
||||||
|
)
|
||||||
|
},
|
||||||
|
calcCapsuleLengthAndLabelData() {
|
||||||
|
const { data } = this.mergedConfig
|
||||||
|
|
||||||
|
if (!data.length) return
|
||||||
|
|
||||||
|
const capsuleValue = data.map(({ value }) => value)
|
||||||
|
|
||||||
|
const maxValue = Math.max(...capsuleValue)
|
||||||
|
|
||||||
|
this.capsuleValue = capsuleValue
|
||||||
|
|
||||||
|
this.capsuleLength = capsuleValue.map(v => (maxValue ? v / maxValue : 0))
|
||||||
|
|
||||||
|
const oneFifth = maxValue / 5
|
||||||
|
|
||||||
|
const labelData = Array.from(
|
||||||
|
new Set(new Array(6).fill(0).map((v, i) => Math.ceil(i * oneFifth)))
|
||||||
|
)
|
||||||
|
|
||||||
|
this.labelData = labelData
|
||||||
|
|
||||||
|
this.labelDataLength = Array.from(labelData).map(v =>
|
||||||
|
maxValue ? v / maxValue : 0
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
const { calcData } = this
|
||||||
|
|
||||||
|
calcData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
6
lib/components/charts/index.js
Normal file
6
lib/components/charts/index.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import './src/main.css'
|
||||||
|
import Charts from './src/main.vue'
|
||||||
|
|
||||||
|
export default function (Vue) {
|
||||||
|
Vue.component(Charts.name, Charts)
|
||||||
|
}
|
9
lib/components/charts/src/main.css
Normal file
9
lib/components/charts/src/main.css
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
.dv-charts-container {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.dv-charts-container .charts-canvas-container {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
67
lib/components/charts/src/main.vue
Normal file
67
lib/components/charts/src/main.vue
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
<template>
|
||||||
|
<div class="dv-charts-container" :ref="ref">
|
||||||
|
<div class="charts-canvas-container" :ref="chartRef" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { uuid } from '../../../util/index'
|
||||||
|
|
||||||
|
import autoResize from '../../../mixin/autoResize'
|
||||||
|
|
||||||
|
import Charts from '@jiaminghi/charts'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DvCharts',
|
||||||
|
mixins: [autoResize],
|
||||||
|
props: {
|
||||||
|
option: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
const id = uuid()
|
||||||
|
return {
|
||||||
|
ref: `charts-container-${id}`,
|
||||||
|
chartRef: `chart-${id}`,
|
||||||
|
|
||||||
|
chart: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
option () {
|
||||||
|
let { chart, option } = this
|
||||||
|
|
||||||
|
if (!chart) return
|
||||||
|
|
||||||
|
if (!option) option = {}
|
||||||
|
|
||||||
|
chart.setOption(option, true)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
afterAutoResizeMixinInit () {
|
||||||
|
const { initChart } = this
|
||||||
|
|
||||||
|
initChart()
|
||||||
|
},
|
||||||
|
initChart () {
|
||||||
|
const { $refs, chartRef, option } = this
|
||||||
|
|
||||||
|
const chart = this.chart = new Charts($refs[chartRef])
|
||||||
|
|
||||||
|
if (!option) return
|
||||||
|
|
||||||
|
chart.setOption(option)
|
||||||
|
},
|
||||||
|
onResize () {
|
||||||
|
const { chart } = this
|
||||||
|
|
||||||
|
if (!chart) return
|
||||||
|
|
||||||
|
chart.resize()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
6
lib/components/conicalColumnChart/index.js
Normal file
6
lib/components/conicalColumnChart/index.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import './src/main.css'
|
||||||
|
import ConicalColumnChart from './src/main.vue'
|
||||||
|
|
||||||
|
export default function (Vue) {
|
||||||
|
Vue.component(ConicalColumnChart.name, ConicalColumnChart)
|
||||||
|
}
|
7
lib/components/conicalColumnChart/src/main.css
Normal file
7
lib/components/conicalColumnChart/src/main.css
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
.dv-conical-column-chart {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.dv-conical-column-chart text {
|
||||||
|
text-anchor: middle;
|
||||||
|
}
|
208
lib/components/conicalColumnChart/src/main.vue
Normal file
208
lib/components/conicalColumnChart/src/main.vue
Normal file
@ -0,0 +1,208 @@
|
|||||||
|
<template>
|
||||||
|
<div class="dv-conical-column-chart" :ref="ref">
|
||||||
|
<svg :width="width" :height="height">
|
||||||
|
<g
|
||||||
|
v-for="(item, i) in column"
|
||||||
|
:key="i"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
:d="item.d"
|
||||||
|
:fill="mergedConfig.columnColor"
|
||||||
|
/>
|
||||||
|
<text
|
||||||
|
:style="`fontSize:${mergedConfig.fontSize}px`"
|
||||||
|
:fill="mergedConfig.textColor"
|
||||||
|
:x="item.x"
|
||||||
|
:y="height - 4"
|
||||||
|
>
|
||||||
|
{{ item.name }}
|
||||||
|
</text>
|
||||||
|
<image
|
||||||
|
v-if="mergedConfig.img.length"
|
||||||
|
:xlink:href="mergedConfig.img[i % mergedConfig.img.length]"
|
||||||
|
:width="mergedConfig.imgSideLength"
|
||||||
|
:height="mergedConfig.imgSideLength"
|
||||||
|
:x="item.x - mergedConfig.imgSideLength / 2"
|
||||||
|
:y="item.y - mergedConfig.imgSideLength"
|
||||||
|
/>
|
||||||
|
<text
|
||||||
|
v-if="mergedConfig.showValue"
|
||||||
|
:style="`fontSize:${mergedConfig.fontSize}px`"
|
||||||
|
:fill="mergedConfig.textColor"
|
||||||
|
:x="item.x"
|
||||||
|
:y="item.textY"
|
||||||
|
>
|
||||||
|
{{ item.value }}
|
||||||
|
</text>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import autoResize from '../../../mixin/autoResize'
|
||||||
|
|
||||||
|
import { deepMerge } from '@jiaminghi/charts/lib/util/index'
|
||||||
|
|
||||||
|
import { deepClone } from '@jiaminghi/c-render/lib/plugin/util'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DvConicalColumnChart',
|
||||||
|
mixins: [autoResize],
|
||||||
|
props: {
|
||||||
|
config: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
ref: 'conical-column-chart',
|
||||||
|
|
||||||
|
defaultConfig: {
|
||||||
|
/**
|
||||||
|
* @description Chart data
|
||||||
|
* @type {Array<Object>}
|
||||||
|
* @default data = []
|
||||||
|
*/
|
||||||
|
data: [],
|
||||||
|
/**
|
||||||
|
* @description Chart img
|
||||||
|
* @type {Array<String>}
|
||||||
|
* @default img = []
|
||||||
|
*/
|
||||||
|
img: [],
|
||||||
|
/**
|
||||||
|
* @description Chart font size
|
||||||
|
* @type {Number}
|
||||||
|
* @default fontSize = 12
|
||||||
|
*/
|
||||||
|
fontSize: 12,
|
||||||
|
/**
|
||||||
|
* @description Img side length
|
||||||
|
* @type {Number}
|
||||||
|
* @default imgSideLength = 30
|
||||||
|
*/
|
||||||
|
imgSideLength: 30,
|
||||||
|
/**
|
||||||
|
* @description Column color
|
||||||
|
* @type {String}
|
||||||
|
* @default columnColor = 'rgba(0, 194, 255, 0.4)'
|
||||||
|
*/
|
||||||
|
columnColor: 'rgba(0, 194, 255, 0.4)',
|
||||||
|
/**
|
||||||
|
* @description Text color
|
||||||
|
* @type {String}
|
||||||
|
* @default textColor = '#fff'
|
||||||
|
*/
|
||||||
|
textColor: '#fff',
|
||||||
|
/**
|
||||||
|
* @description Show value
|
||||||
|
* @type {Boolean}
|
||||||
|
* @default showValue = false
|
||||||
|
*/
|
||||||
|
showValue: false
|
||||||
|
},
|
||||||
|
|
||||||
|
mergedConfig: null,
|
||||||
|
|
||||||
|
column: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
config () {
|
||||||
|
const { calcData } = this
|
||||||
|
|
||||||
|
calcData()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
afterAutoResizeMixinInit () {
|
||||||
|
const { calcData } = this
|
||||||
|
|
||||||
|
calcData()
|
||||||
|
},
|
||||||
|
onResize () {
|
||||||
|
const { calcData } = this
|
||||||
|
|
||||||
|
calcData()
|
||||||
|
},
|
||||||
|
calcData () {
|
||||||
|
const { mergeConfig, initData, calcSVGPath } = this
|
||||||
|
|
||||||
|
mergeConfig()
|
||||||
|
|
||||||
|
initData()
|
||||||
|
|
||||||
|
calcSVGPath()
|
||||||
|
},
|
||||||
|
mergeConfig () {
|
||||||
|
const { defaultConfig, config } = this
|
||||||
|
|
||||||
|
this.mergedConfig = deepMerge(deepClone(defaultConfig, true), config || {})
|
||||||
|
},
|
||||||
|
initData () {
|
||||||
|
const { mergedConfig } = this
|
||||||
|
let { data } = mergedConfig
|
||||||
|
|
||||||
|
data = deepClone(data, true)
|
||||||
|
|
||||||
|
data.sort(({ value: a }, { value: b }) => {
|
||||||
|
if (a > b) return -1
|
||||||
|
if (a < b) return 1
|
||||||
|
if (a === b) return 0
|
||||||
|
})
|
||||||
|
|
||||||
|
const max = data[0] ? data[0].value : 10
|
||||||
|
|
||||||
|
data = data.map(item => ({
|
||||||
|
...item,
|
||||||
|
percent: item.value / max
|
||||||
|
}))
|
||||||
|
|
||||||
|
mergedConfig.data = data
|
||||||
|
},
|
||||||
|
calcSVGPath () {
|
||||||
|
const { mergedConfig, width, height } = this
|
||||||
|
|
||||||
|
const { imgSideLength, fontSize, data } = mergedConfig
|
||||||
|
|
||||||
|
const itemNum = data.length
|
||||||
|
const gap = width / (itemNum + 1)
|
||||||
|
|
||||||
|
const useAbleHeight = height - imgSideLength - fontSize - 5
|
||||||
|
const svgBottom = height - fontSize - 5
|
||||||
|
|
||||||
|
this.column = data.map((item, i) => {
|
||||||
|
const { percent } = item
|
||||||
|
|
||||||
|
const middleXPos = gap * (i + 1)
|
||||||
|
const leftXPos = gap * i
|
||||||
|
const rightXpos = gap * (i + 2)
|
||||||
|
|
||||||
|
const middleYPos = svgBottom - useAbleHeight * percent
|
||||||
|
const controlYPos = useAbleHeight * percent * 0.6 + middleYPos
|
||||||
|
|
||||||
|
const d = `
|
||||||
|
M${leftXPos}, ${svgBottom}
|
||||||
|
Q${middleXPos}, ${controlYPos} ${middleXPos},${middleYPos}
|
||||||
|
M${middleXPos},${middleYPos}
|
||||||
|
Q${middleXPos}, ${controlYPos} ${rightXpos},${svgBottom}
|
||||||
|
L${leftXPos}, ${svgBottom}
|
||||||
|
Z
|
||||||
|
`
|
||||||
|
|
||||||
|
const textY = (svgBottom + middleYPos) / 2 + fontSize / 2
|
||||||
|
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
d,
|
||||||
|
x: middleXPos,
|
||||||
|
y: middleYPos,
|
||||||
|
textY
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
6
lib/components/decoration1/index.js
Normal file
6
lib/components/decoration1/index.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import './src/main.css'
|
||||||
|
import Decoration1 from './src/main.vue'
|
||||||
|
|
||||||
|
export default function (Vue) {
|
||||||
|
Vue.component(Decoration1.name, Decoration1)
|
||||||
|
}
|
7
lib/components/decoration1/src/main.css
Normal file
7
lib/components/decoration1/src/main.css
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
.dv-decoration-1 {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.dv-decoration-1 svg {
|
||||||
|
transform-origin: left top;
|
||||||
|
}
|
197
lib/components/decoration1/src/main.vue
Normal file
197
lib/components/decoration1/src/main.vue
Normal file
@ -0,0 +1,197 @@
|
|||||||
|
<template>
|
||||||
|
<div class="dv-decoration-1" :ref="ref">
|
||||||
|
<svg :width="`${svgWH[0]}px`" :height="`${svgWH[1]}px`" :style="`transform:scale(${svgScale[0]},${svgScale[1]});`">
|
||||||
|
|
||||||
|
<template
|
||||||
|
v-for="(point, i) in points"
|
||||||
|
>
|
||||||
|
<rect
|
||||||
|
v-if="Math.random() > 0.6"
|
||||||
|
:key="i"
|
||||||
|
:fill="mergedColor[0]"
|
||||||
|
:x="point[0] - halfPointSideLength"
|
||||||
|
:y="point[1] - halfPointSideLength"
|
||||||
|
:width="pointSideLength"
|
||||||
|
:height="pointSideLength"
|
||||||
|
>
|
||||||
|
<animate
|
||||||
|
v-if="Math.random() > 0.6"
|
||||||
|
attributeName="fill"
|
||||||
|
:values="`${mergedColor[0]};transparent`"
|
||||||
|
dur="1s"
|
||||||
|
:begin="Math.random() * 2"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
/>
|
||||||
|
</rect>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<rect
|
||||||
|
v-if="rects[0]"
|
||||||
|
:fill="mergedColor[1]"
|
||||||
|
:x="rects[0][0] - pointSideLength"
|
||||||
|
:y="rects[0][1] - pointSideLength"
|
||||||
|
:width="pointSideLength * 2"
|
||||||
|
:height="pointSideLength * 2"
|
||||||
|
>
|
||||||
|
<animate
|
||||||
|
attributeName="width"
|
||||||
|
:values="`0;${pointSideLength * 2}`"
|
||||||
|
dur="2s"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
/>
|
||||||
|
<animate
|
||||||
|
attributeName="height"
|
||||||
|
:values="`0;${pointSideLength * 2}`"
|
||||||
|
dur="2s"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
/>
|
||||||
|
<animate
|
||||||
|
attributeName="x"
|
||||||
|
:values="`${rects[0][0]};${rects[0][0] - pointSideLength}`"
|
||||||
|
dur="2s"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
/>
|
||||||
|
<animate
|
||||||
|
attributeName="y"
|
||||||
|
:values="`${rects[0][1]};${rects[0][1] - pointSideLength}`"
|
||||||
|
dur="2s"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
/>
|
||||||
|
</rect>
|
||||||
|
|
||||||
|
<rect
|
||||||
|
v-if="rects[1]"
|
||||||
|
:fill="mergedColor[1]"
|
||||||
|
:x="rects[1][0] - 40"
|
||||||
|
:y="rects[1][1] - pointSideLength"
|
||||||
|
:width="40"
|
||||||
|
:height="pointSideLength * 2"
|
||||||
|
>
|
||||||
|
<animate
|
||||||
|
attributeName="width"
|
||||||
|
values="0;40;0"
|
||||||
|
dur="2s"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
/>
|
||||||
|
<animate
|
||||||
|
attributeName="x"
|
||||||
|
:values="`${rects[1][0]};${rects[1][0] - 40};${rects[1][0]}`"
|
||||||
|
dur="2s"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
/>
|
||||||
|
</rect>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import autoResize from '../../../mixin/autoResize'
|
||||||
|
|
||||||
|
import { deepMerge } from '@jiaminghi/charts/lib/util/index'
|
||||||
|
|
||||||
|
import { deepClone } from '@jiaminghi/c-render/lib/plugin/util'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DvDecoration1',
|
||||||
|
mixins: [autoResize],
|
||||||
|
props: {
|
||||||
|
color: {
|
||||||
|
type: Array,
|
||||||
|
default: () => ([])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
const pointSideLength = 2.5
|
||||||
|
|
||||||
|
return {
|
||||||
|
ref: 'decoration-1',
|
||||||
|
|
||||||
|
svgWH: [200, 50],
|
||||||
|
|
||||||
|
svgScale: [1, 1],
|
||||||
|
|
||||||
|
rowNum: 4,
|
||||||
|
rowPoints: 20,
|
||||||
|
|
||||||
|
pointSideLength,
|
||||||
|
halfPointSideLength: pointSideLength / 2,
|
||||||
|
|
||||||
|
points: [],
|
||||||
|
|
||||||
|
rects: [],
|
||||||
|
|
||||||
|
defaultColor: ['#fff', '#0de7c2'],
|
||||||
|
|
||||||
|
mergedColor: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
color () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
afterAutoResizeMixinInit () {
|
||||||
|
const { calcSVGData } = this
|
||||||
|
|
||||||
|
calcSVGData()
|
||||||
|
},
|
||||||
|
calcSVGData () {
|
||||||
|
const { calcPointsPosition, calcRectsPosition, calcScale } = this
|
||||||
|
|
||||||
|
calcPointsPosition()
|
||||||
|
|
||||||
|
calcRectsPosition()
|
||||||
|
|
||||||
|
calcScale()
|
||||||
|
},
|
||||||
|
calcPointsPosition () {
|
||||||
|
const { svgWH, rowNum, rowPoints } = this
|
||||||
|
|
||||||
|
const [w, h] = svgWH
|
||||||
|
|
||||||
|
const horizontalGap = w / (rowPoints + 1)
|
||||||
|
const verticalGap = h / (rowNum + 1)
|
||||||
|
|
||||||
|
let points = new Array(rowNum).fill(0).map((foo, i) =>
|
||||||
|
new Array(rowPoints).fill(0).map((foo, j) => [
|
||||||
|
horizontalGap * (j + 1), verticalGap * (i + 1)
|
||||||
|
]))
|
||||||
|
|
||||||
|
this.points = points.reduce((all, item) => [...all, ...item], [])
|
||||||
|
},
|
||||||
|
calcRectsPosition () {
|
||||||
|
const { points, rowPoints } = this
|
||||||
|
|
||||||
|
const rect1 = points[rowPoints * 2 - 1]
|
||||||
|
const rect2 = points[rowPoints * 2 - 3]
|
||||||
|
|
||||||
|
this.rects = [rect1, rect2]
|
||||||
|
},
|
||||||
|
calcScale () {
|
||||||
|
const { width, height, svgWH } = this
|
||||||
|
|
||||||
|
const [w, h] = svgWH
|
||||||
|
|
||||||
|
this.svgScale = [width / w, height / h]
|
||||||
|
},
|
||||||
|
onResize () {
|
||||||
|
const { calcSVGData } = this
|
||||||
|
|
||||||
|
calcSVGData()
|
||||||
|
},
|
||||||
|
mergeColor () {
|
||||||
|
const { color, defaultColor } = this
|
||||||
|
|
||||||
|
this.mergedColor = deepMerge(deepClone(defaultColor, true), color || [])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
6
lib/components/decoration10/index.js
Normal file
6
lib/components/decoration10/index.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import './src/main.css'
|
||||||
|
import Decoration10 from './src/main.vue'
|
||||||
|
|
||||||
|
export default function (Vue) {
|
||||||
|
Vue.component(Decoration10.name, Decoration10)
|
||||||
|
}
|
5
lib/components/decoration10/src/main.css
Normal file
5
lib/components/decoration10/src/main.css
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
.dv-decoration-10 {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
}
|
203
lib/components/decoration10/src/main.vue
Normal file
203
lib/components/decoration10/src/main.vue
Normal file
@ -0,0 +1,203 @@
|
|||||||
|
<template>
|
||||||
|
<div class="dv-decoration-10" :ref="ref">
|
||||||
|
<svg :width="width" :height="height">
|
||||||
|
<polyline
|
||||||
|
:stroke="mergedColor[1]"
|
||||||
|
stroke-width="2"
|
||||||
|
:points="`0, ${height / 2} ${width}, ${height / 2}`"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<polyline
|
||||||
|
:stroke="mergedColor[0]"
|
||||||
|
stroke-width="2"
|
||||||
|
:points="`5, ${height / 2} ${width * 0.2 - 3}, ${height / 2}`"
|
||||||
|
:stroke-dasharray="`0, ${width * 0.2}`"
|
||||||
|
fill="freeze"
|
||||||
|
>
|
||||||
|
<animate
|
||||||
|
:id="animationId2"
|
||||||
|
attributeName="stroke-dasharray"
|
||||||
|
:values="`0, ${width * 0.2};${width * 0.2}, 0;`"
|
||||||
|
dur="3s"
|
||||||
|
:begin="`${animationId1}.end`"
|
||||||
|
fill="freeze"
|
||||||
|
/>
|
||||||
|
<animate
|
||||||
|
attributeName="stroke-dasharray"
|
||||||
|
:values="`${width * 0.2}, 0;0, ${width * 0.2}`"
|
||||||
|
dur="0.01s"
|
||||||
|
:begin="`${animationId7}.end`"
|
||||||
|
fill="freeze"
|
||||||
|
/>
|
||||||
|
</polyline>
|
||||||
|
|
||||||
|
<polyline
|
||||||
|
:stroke="mergedColor[0]"
|
||||||
|
stroke-width="2"
|
||||||
|
:points="`${width * 0.2 + 3}, ${height / 2} ${width * 0.8 - 3}, ${height / 2}`"
|
||||||
|
:stroke-dasharray="`0, ${width * 0.6}`"
|
||||||
|
>
|
||||||
|
<animate
|
||||||
|
:id="animationId4"
|
||||||
|
attributeName="stroke-dasharray"
|
||||||
|
:values="`0, ${width * 0.6};${width * 0.6}, 0`"
|
||||||
|
dur="3s"
|
||||||
|
:begin="`${animationId3}.end + 1s`"
|
||||||
|
fill="freeze"
|
||||||
|
/>
|
||||||
|
<animate
|
||||||
|
attributeName="stroke-dasharray"
|
||||||
|
:values="`${width * 0.6}, 0;0, ${width * 0.6}`"
|
||||||
|
dur="0.01s"
|
||||||
|
:begin="`${animationId7}.end`"
|
||||||
|
fill="freeze"
|
||||||
|
/>
|
||||||
|
</polyline>
|
||||||
|
|
||||||
|
<polyline
|
||||||
|
:stroke="mergedColor[0]"
|
||||||
|
stroke-width="2"
|
||||||
|
:points="`${width * 0.8 + 3}, ${height / 2} ${width - 5}, ${height / 2}`"
|
||||||
|
:stroke-dasharray="`0, ${width * 0.2}`"
|
||||||
|
>
|
||||||
|
<animate
|
||||||
|
:id="animationId6"
|
||||||
|
attributeName="stroke-dasharray"
|
||||||
|
:values="`0, ${width * 0.2};${width * 0.2}, 0`"
|
||||||
|
dur="3s"
|
||||||
|
:begin="`${animationId5}.end + 1s`"
|
||||||
|
fill="freeze"
|
||||||
|
/>
|
||||||
|
<animate
|
||||||
|
attributeName="stroke-dasharray"
|
||||||
|
:values="`${width * 0.2}, 0;0, ${width * 0.3}`"
|
||||||
|
dur="0.01s"
|
||||||
|
:begin="`${animationId7}.end`"
|
||||||
|
fill="freeze"
|
||||||
|
/>
|
||||||
|
</polyline>
|
||||||
|
|
||||||
|
<circle cx="2" :cy="height / 2" r="2" :fill="mergedColor[1]">
|
||||||
|
<animate
|
||||||
|
:id="animationId1"
|
||||||
|
attributeName="fill"
|
||||||
|
:values="`${mergedColor[1]};${mergedColor[0]}`"
|
||||||
|
:begin="`0s;${animationId7}.end`"
|
||||||
|
dur="0.3s"
|
||||||
|
fill="freeze"
|
||||||
|
/>
|
||||||
|
</circle>
|
||||||
|
|
||||||
|
<circle :cx="width * 0.2" :cy="height / 2" r="2" :fill="mergedColor[1]">
|
||||||
|
<animate
|
||||||
|
:id="animationId3"
|
||||||
|
attributeName="fill"
|
||||||
|
:values="`${mergedColor[1]};${mergedColor[0]}`"
|
||||||
|
:begin="`${animationId2}.end`"
|
||||||
|
dur="0.3s"
|
||||||
|
fill="freeze"
|
||||||
|
/>
|
||||||
|
<animate
|
||||||
|
attributeName="fill"
|
||||||
|
:values="`${mergedColor[1]};${mergedColor[1]}`"
|
||||||
|
dur="0.01s"
|
||||||
|
:begin="`${animationId7}.end`"
|
||||||
|
fill="freeze"
|
||||||
|
/>
|
||||||
|
</circle>
|
||||||
|
|
||||||
|
<circle :cx="width * 0.8" :cy="height / 2" r="2" :fill="mergedColor[1]">
|
||||||
|
<animate
|
||||||
|
:id="animationId5"
|
||||||
|
attributeName="fill"
|
||||||
|
:values="`${mergedColor[1]};${mergedColor[0]}`"
|
||||||
|
:begin="`${animationId4}.end`"
|
||||||
|
dur="0.3s"
|
||||||
|
fill="freeze"
|
||||||
|
/>
|
||||||
|
<animate
|
||||||
|
attributeName="fill"
|
||||||
|
:values="`${mergedColor[1]};${mergedColor[1]}`"
|
||||||
|
dur="0.01s"
|
||||||
|
:begin="`${animationId7}.end`"
|
||||||
|
fill="freeze"
|
||||||
|
/>
|
||||||
|
</circle>
|
||||||
|
|
||||||
|
<circle :cx="width - 2" :cy="height / 2" r="2" :fill="mergedColor[1]">
|
||||||
|
<animate
|
||||||
|
:id="animationId7"
|
||||||
|
attributeName="fill"
|
||||||
|
:values="`${mergedColor[1]};${mergedColor[0]}`"
|
||||||
|
:begin="`${animationId6}.end`"
|
||||||
|
dur="0.3s"
|
||||||
|
fill="freeze"
|
||||||
|
/>
|
||||||
|
<animate
|
||||||
|
attributeName="fill"
|
||||||
|
:values="`${mergedColor[1]};${mergedColor[1]}`"
|
||||||
|
dur="0.01s"
|
||||||
|
:begin="`${animationId7}.end`"
|
||||||
|
fill="freeze"
|
||||||
|
/>
|
||||||
|
</circle>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import autoResize from '../../../mixin/autoResize'
|
||||||
|
import { uuid } from '../../../util/index'
|
||||||
|
|
||||||
|
import { deepMerge } from '@jiaminghi/charts/lib/util/index'
|
||||||
|
|
||||||
|
import { deepClone } from '@jiaminghi/c-render/lib/plugin/util'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DvDecoration10',
|
||||||
|
mixins: [autoResize],
|
||||||
|
props: {
|
||||||
|
color: {
|
||||||
|
type: Array,
|
||||||
|
default: () => ([])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
const id = uuid()
|
||||||
|
return {
|
||||||
|
ref: 'decoration-10',
|
||||||
|
|
||||||
|
animationId1: `d10ani1${id}`,
|
||||||
|
animationId2: `d10ani2${id}`,
|
||||||
|
animationId3: `d10ani3${id}`,
|
||||||
|
animationId4: `d10ani4${id}`,
|
||||||
|
animationId5: `d10ani5${id}`,
|
||||||
|
animationId6: `d10ani6${id}`,
|
||||||
|
animationId7: `d10ani7${id}`,
|
||||||
|
|
||||||
|
defaultColor: ['#00c2ff', 'rgba(0, 194, 255, 0.3)'],
|
||||||
|
|
||||||
|
mergedColor: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
color () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
mergeColor () {
|
||||||
|
const { color, defaultColor } = this
|
||||||
|
|
||||||
|
this.mergedColor = deepMerge(deepClone(defaultColor, true), color || [])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
6
lib/components/decoration11/index.js
Normal file
6
lib/components/decoration11/index.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import './src/main.css'
|
||||||
|
import Decoration11 from './src/main.vue'
|
||||||
|
|
||||||
|
export default function (Vue) {
|
||||||
|
Vue.component(Decoration11.name, Decoration11)
|
||||||
|
}
|
16
lib/components/decoration11/src/main.css
Normal file
16
lib/components/decoration11/src/main.css
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
.dv-decoration-11 {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.dv-decoration-11 .decoration-content {
|
||||||
|
position: absolute;
|
||||||
|
top: 0px;
|
||||||
|
left: 0px;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
104
lib/components/decoration11/src/main.vue
Normal file
104
lib/components/decoration11/src/main.vue
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
<template>
|
||||||
|
<div class="dv-decoration-11" :ref="ref">
|
||||||
|
<svg :width="width" :height="height">
|
||||||
|
<polygon
|
||||||
|
:fill="fade(mergedColor[1] || defaultColor[1], 10)"
|
||||||
|
:stroke="mergedColor[1]"
|
||||||
|
:points="`20 10, 25 4, 55 4 60 10`"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<polygon
|
||||||
|
:fill="fade(mergedColor[1] || defaultColor[1], 10)"
|
||||||
|
:stroke="mergedColor[1]"
|
||||||
|
:points="`20 ${height - 10}, 25 ${height - 4}, 55 ${height - 4} 60 ${height - 10}`"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<polygon
|
||||||
|
:fill="fade(mergedColor[1] || defaultColor[1], 10)"
|
||||||
|
:stroke="mergedColor[1]"
|
||||||
|
:points="`${width - 20} 10, ${width - 25} 4, ${width - 55} 4 ${width - 60} 10`"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<polygon
|
||||||
|
:fill="fade(mergedColor[1] || defaultColor[1], 10)"
|
||||||
|
:stroke="mergedColor[1]"
|
||||||
|
:points="`${width - 20} ${height - 10}, ${width - 25} ${height - 4}, ${width - 55} ${height - 4} ${width - 60} ${height - 10}`"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<polygon
|
||||||
|
:fill="fade(mergedColor[0] || defaultColor[0], 20)"
|
||||||
|
:stroke="mergedColor[0]"
|
||||||
|
:points="`
|
||||||
|
20 10, 5 ${height / 2} 20 ${height - 10}
|
||||||
|
${width - 20} ${height - 10} ${width - 5} ${height / 2} ${width - 20} 10
|
||||||
|
`"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<polyline
|
||||||
|
fill="transparent"
|
||||||
|
:stroke="fade(mergedColor[0] || defaultColor[0], 70)"
|
||||||
|
:points="`25 18, 15 ${height / 2} 25 ${height - 18}`"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<polyline
|
||||||
|
fill="transparent"
|
||||||
|
:stroke="fade(mergedColor[0] || defaultColor[0], 70)"
|
||||||
|
:points="`${width - 25} 18, ${width - 15} ${height / 2} ${width - 25} ${height - 18}`"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<div class="decoration-content">
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import autoResize from '../../../mixin/autoResize'
|
||||||
|
|
||||||
|
import { deepMerge } from '@jiaminghi/charts/lib/util/index'
|
||||||
|
|
||||||
|
import { deepClone } from '@jiaminghi/c-render/lib/plugin/util'
|
||||||
|
|
||||||
|
import { fade } from '@jiaminghi/color'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DvDecoration11',
|
||||||
|
mixins: [autoResize],
|
||||||
|
props: {
|
||||||
|
color: {
|
||||||
|
type: Array,
|
||||||
|
default: () => ([])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
ref: 'decoration-11',
|
||||||
|
|
||||||
|
defaultColor: ['#1a98fc', '#2cf7fe'],
|
||||||
|
|
||||||
|
mergedColor: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
color () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
mergeColor () {
|
||||||
|
const { color, defaultColor } = this
|
||||||
|
|
||||||
|
this.mergedColor = deepMerge(deepClone(defaultColor, true), color || [])
|
||||||
|
},
|
||||||
|
fade
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
6
lib/components/decoration2/index.js
Normal file
6
lib/components/decoration2/index.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import './src/main.css'
|
||||||
|
import Decoration2 from './src/main.vue'
|
||||||
|
|
||||||
|
export default function (Vue) {
|
||||||
|
Vue.component(Decoration2.name, Decoration2)
|
||||||
|
}
|
7
lib/components/decoration2/src/main.css
Normal file
7
lib/components/decoration2/src/main.css
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
.dv-decoration-2 {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
118
lib/components/decoration2/src/main.vue
Normal file
118
lib/components/decoration2/src/main.vue
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
<template>
|
||||||
|
<div class="dv-decoration-2" :ref="ref">
|
||||||
|
<svg :width="`${width}px`" :height="`${height}px`">
|
||||||
|
<rect :x="x" :y="y" :width="w" :height="h" :fill="mergedColor[0]">
|
||||||
|
<animate
|
||||||
|
:attributeName="reverse ? 'height' : 'width'"
|
||||||
|
from="0"
|
||||||
|
:to="reverse ? height : width"
|
||||||
|
dur="6s"
|
||||||
|
calcMode="spline"
|
||||||
|
keyTimes="0;1"
|
||||||
|
keySplines=".42,0,.58,1"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
/>
|
||||||
|
</rect>
|
||||||
|
|
||||||
|
<rect :x="x" :y="y" width="1" height="1" :fill="mergedColor[1]">
|
||||||
|
<animate
|
||||||
|
:attributeName="reverse ? 'y' : 'x'"
|
||||||
|
from="0"
|
||||||
|
:to="reverse ? height : width"
|
||||||
|
dur="6s"
|
||||||
|
calcMode="spline"
|
||||||
|
keyTimes="0;1"
|
||||||
|
keySplines="0.42,0,0.58,1"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
/>
|
||||||
|
</rect>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import autoResize from '../../../mixin/autoResize'
|
||||||
|
|
||||||
|
import { deepMerge } from '@jiaminghi/charts/lib/util/index'
|
||||||
|
|
||||||
|
import { deepClone } from '@jiaminghi/c-render/lib/plugin/util'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DvDecoration2',
|
||||||
|
mixins: [autoResize],
|
||||||
|
props: {
|
||||||
|
color: {
|
||||||
|
type: Array,
|
||||||
|
default: () => ([])
|
||||||
|
},
|
||||||
|
reverse: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
ref: 'decoration-2',
|
||||||
|
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
|
||||||
|
w: 0,
|
||||||
|
h: 0,
|
||||||
|
|
||||||
|
defaultColor: ['#3faacb', '#fff'],
|
||||||
|
|
||||||
|
mergedColor: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
color () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
},
|
||||||
|
reverse () {
|
||||||
|
const { calcSVGData } = this
|
||||||
|
|
||||||
|
calcSVGData()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
afterAutoResizeMixinInit () {
|
||||||
|
const { calcSVGData } = this
|
||||||
|
|
||||||
|
calcSVGData()
|
||||||
|
},
|
||||||
|
calcSVGData () {
|
||||||
|
const { reverse, width, height } = this
|
||||||
|
|
||||||
|
if (reverse) {
|
||||||
|
this.w = 1
|
||||||
|
this.h = height
|
||||||
|
this.x = width / 2
|
||||||
|
this.y = 0
|
||||||
|
} else {
|
||||||
|
this.w = width
|
||||||
|
this.h = 1
|
||||||
|
this.x = 0
|
||||||
|
this.y = height / 2
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onResize () {
|
||||||
|
const { calcSVGData } = this
|
||||||
|
|
||||||
|
calcSVGData()
|
||||||
|
},
|
||||||
|
mergeColor () {
|
||||||
|
const { color, defaultColor } = this
|
||||||
|
|
||||||
|
this.mergedColor = deepMerge(deepClone(defaultColor, true), color || [])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
6
lib/components/decoration3/index.js
Normal file
6
lib/components/decoration3/index.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import './src/main.css'
|
||||||
|
import Decoration3 from './src/main.vue'
|
||||||
|
|
||||||
|
export default function (Vue) {
|
||||||
|
Vue.component(Decoration3.name, Decoration3)
|
||||||
|
}
|
7
lib/components/decoration3/src/main.css
Normal file
7
lib/components/decoration3/src/main.css
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
.dv-decoration-3 {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.dv-decoration-3 svg {
|
||||||
|
transform-origin: left top;
|
||||||
|
}
|
128
lib/components/decoration3/src/main.vue
Normal file
128
lib/components/decoration3/src/main.vue
Normal file
@ -0,0 +1,128 @@
|
|||||||
|
<template>
|
||||||
|
<div class="dv-decoration-3" :ref="ref">
|
||||||
|
<svg :width="`${svgWH[0]}px`" :height="`${svgWH[1]}px`" :style="`transform:scale(${svgScale[0]},${svgScale[1]});`">
|
||||||
|
|
||||||
|
<template
|
||||||
|
v-for="(point, i) in points"
|
||||||
|
>
|
||||||
|
<rect
|
||||||
|
:key="i"
|
||||||
|
:fill="mergedColor[0]"
|
||||||
|
:x="point[0] - halfPointSideLength"
|
||||||
|
:y="point[1] - halfPointSideLength"
|
||||||
|
:width="pointSideLength"
|
||||||
|
:height="pointSideLength"
|
||||||
|
>
|
||||||
|
<animate
|
||||||
|
v-if="Math.random() > 0.6"
|
||||||
|
attributeName="fill"
|
||||||
|
:values="`${mergedColor.join(';')}`"
|
||||||
|
:dur="Math.random() + 1 + 's'"
|
||||||
|
:begin="Math.random() * 2"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
/>
|
||||||
|
</rect>
|
||||||
|
</template>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import autoResize from '../../../mixin/autoResize'
|
||||||
|
|
||||||
|
import { deepMerge } from '@jiaminghi/charts/lib/util/index'
|
||||||
|
|
||||||
|
import { deepClone } from '@jiaminghi/c-render/lib/plugin/util'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DvDecoration3',
|
||||||
|
mixins: [autoResize],
|
||||||
|
props: {
|
||||||
|
color: {
|
||||||
|
type: Array,
|
||||||
|
default: () => ([])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
const pointSideLength = 7
|
||||||
|
|
||||||
|
return {
|
||||||
|
ref: 'decoration-3',
|
||||||
|
|
||||||
|
svgWH: [300, 35],
|
||||||
|
|
||||||
|
svgScale: [1, 1],
|
||||||
|
|
||||||
|
rowNum: 2,
|
||||||
|
rowPoints: 25,
|
||||||
|
|
||||||
|
pointSideLength,
|
||||||
|
halfPointSideLength: pointSideLength / 2,
|
||||||
|
|
||||||
|
points: [],
|
||||||
|
|
||||||
|
defaultColor: ['#7acaec', 'transparent'],
|
||||||
|
|
||||||
|
mergedColor: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
color () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
afterAutoResizeMixinInit () {
|
||||||
|
const { calcSVGData } = this
|
||||||
|
|
||||||
|
calcSVGData()
|
||||||
|
},
|
||||||
|
calcSVGData () {
|
||||||
|
const { calcPointsPosition, calcScale } = this
|
||||||
|
|
||||||
|
calcPointsPosition()
|
||||||
|
|
||||||
|
calcScale()
|
||||||
|
},
|
||||||
|
calcPointsPosition () {
|
||||||
|
const { svgWH, rowNum, rowPoints } = this
|
||||||
|
|
||||||
|
const [w, h] = svgWH
|
||||||
|
|
||||||
|
const horizontalGap = w / (rowPoints + 1)
|
||||||
|
const verticalGap = h / (rowNum + 1)
|
||||||
|
|
||||||
|
let points = new Array(rowNum).fill(0).map((foo, i) =>
|
||||||
|
new Array(rowPoints).fill(0).map((foo, j) => [
|
||||||
|
horizontalGap * (j + 1), verticalGap * (i + 1)
|
||||||
|
]))
|
||||||
|
|
||||||
|
this.points = points.reduce((all, item) => [...all, ...item], [])
|
||||||
|
},
|
||||||
|
calcScale () {
|
||||||
|
const { width, height, svgWH } = this
|
||||||
|
|
||||||
|
const [w, h] = svgWH
|
||||||
|
|
||||||
|
this.svgScale = [width / w, height / h]
|
||||||
|
},
|
||||||
|
onResize () {
|
||||||
|
const { calcSVGData } = this
|
||||||
|
|
||||||
|
calcSVGData()
|
||||||
|
},
|
||||||
|
mergeColor () {
|
||||||
|
const { color, defaultColor } = this
|
||||||
|
|
||||||
|
this.mergedColor = deepMerge(deepClone(defaultColor, true), color || [])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
6
lib/components/decoration4/index.js
Normal file
6
lib/components/decoration4/index.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import './src/main.css'
|
||||||
|
import Decoration4 from './src/main.vue'
|
||||||
|
|
||||||
|
export default function (Vue) {
|
||||||
|
Vue.component(Decoration4.name, Decoration4)
|
||||||
|
}
|
43
lib/components/decoration4/src/main.css
Normal file
43
lib/components/decoration4/src/main.css
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
.dv-decoration-4 {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.dv-decoration-4 .container {
|
||||||
|
display: flex;
|
||||||
|
overflow: hidden;
|
||||||
|
position: absolute;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
.dv-decoration-4 .normal {
|
||||||
|
animation: ani-height 3s ease-in-out infinite;
|
||||||
|
left: 50%;
|
||||||
|
margin-left: -2px;
|
||||||
|
}
|
||||||
|
.dv-decoration-4 .reverse {
|
||||||
|
animation: ani-width 3s ease-in-out infinite;
|
||||||
|
top: 50%;
|
||||||
|
margin-top: -2px;
|
||||||
|
}
|
||||||
|
@keyframes ani-height {
|
||||||
|
0% {
|
||||||
|
height: 0%;
|
||||||
|
}
|
||||||
|
70% {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@keyframes ani-width {
|
||||||
|
0% {
|
||||||
|
width: 0%;
|
||||||
|
}
|
||||||
|
70% {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
74
lib/components/decoration4/src/main.vue
Normal file
74
lib/components/decoration4/src/main.vue
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
<template>
|
||||||
|
<div class="dv-decoration-4" :ref="ref">
|
||||||
|
<div
|
||||||
|
:class="`container ${reverse ? 'reverse' : 'normal'}`"
|
||||||
|
:style="reverse ? `width:${width}px;height:5px` : `width:5px;height:${height}px;`"
|
||||||
|
>
|
||||||
|
<svg :width="reverse ? width : 5" :height="reverse ? 5 : height">
|
||||||
|
<polyline
|
||||||
|
:stroke="mergedColor[0]"
|
||||||
|
:points="reverse ? `0, 2.5 ${width}, 2.5` : `2.5, 0 2.5, ${height}`"
|
||||||
|
/>
|
||||||
|
<polyline
|
||||||
|
class="bold-line"
|
||||||
|
:stroke="mergedColor[1]"
|
||||||
|
stroke-width="3"
|
||||||
|
stroke-dasharray="20, 80"
|
||||||
|
stroke-dashoffset="-30"
|
||||||
|
:points="reverse ? `0, 2.5 ${width}, 2.5` : `2.5, 0 2.5, ${height}`"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import autoResize from '../../../mixin/autoResize'
|
||||||
|
|
||||||
|
import { deepMerge } from '@jiaminghi/charts/lib/util/index'
|
||||||
|
|
||||||
|
import { deepClone } from '@jiaminghi/c-render/lib/plugin/util'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DvDecoration4',
|
||||||
|
mixins: [autoResize],
|
||||||
|
props: {
|
||||||
|
color: {
|
||||||
|
type: Array,
|
||||||
|
default: () => ([])
|
||||||
|
},
|
||||||
|
reverse: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
ref: 'decoration-4',
|
||||||
|
|
||||||
|
defaultColor: ['rgba(255, 255, 255, 0.3)', 'rgba(255, 255, 255, 0.3)'],
|
||||||
|
|
||||||
|
mergedColor: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
color () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
mergeColor () {
|
||||||
|
const { color, defaultColor } = this
|
||||||
|
|
||||||
|
this.mergedColor = deepMerge(deepClone(defaultColor, true), color || [])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
6
lib/components/decoration5/index.js
Normal file
6
lib/components/decoration5/index.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import './src/main.css'
|
||||||
|
import Decoration5 from './src/main.vue'
|
||||||
|
|
||||||
|
export default function (Vue) {
|
||||||
|
Vue.component(Decoration5.name, Decoration5)
|
||||||
|
}
|
4
lib/components/decoration5/src/main.css
Normal file
4
lib/components/decoration5/src/main.css
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
.dv-decoration-5 {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
134
lib/components/decoration5/src/main.vue
Normal file
134
lib/components/decoration5/src/main.vue
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
<template>
|
||||||
|
<div class="dv-decoration-5" :ref="ref">
|
||||||
|
<svg :width="width" :height="height">
|
||||||
|
<polyline
|
||||||
|
fill="transparent"
|
||||||
|
:stroke="mergedColor[0]"
|
||||||
|
stroke-width="3"
|
||||||
|
:points="line1Points"
|
||||||
|
>
|
||||||
|
<animate
|
||||||
|
attributeName="stroke-dasharray"
|
||||||
|
attributeType="XML"
|
||||||
|
:from="`0, ${line1Length / 2}, 0, ${line1Length / 2}`"
|
||||||
|
:to="`0, 0, ${line1Length}, 0`"
|
||||||
|
dur="1.2s"
|
||||||
|
begin="0s"
|
||||||
|
calcMode="spline"
|
||||||
|
keyTimes="0;1"
|
||||||
|
keySplines="0.4,1,0.49,0.98"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
/>
|
||||||
|
</polyline>
|
||||||
|
<polyline
|
||||||
|
fill="transparent"
|
||||||
|
:stroke="mergedColor[1]"
|
||||||
|
stroke-width="2"
|
||||||
|
:points="line2Points"
|
||||||
|
>
|
||||||
|
<animate
|
||||||
|
attributeName="stroke-dasharray"
|
||||||
|
attributeType="XML"
|
||||||
|
:from="`0, ${line2Length / 2}, 0, ${line2Length / 2}`"
|
||||||
|
:to="`0, 0, ${line2Length}, 0`"
|
||||||
|
dur="1.2s"
|
||||||
|
begin="0s"
|
||||||
|
calcMode="spline"
|
||||||
|
keyTimes="0;1"
|
||||||
|
keySplines=".4,1,.49,.98"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
/>
|
||||||
|
</polyline>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import autoResize from '../../../mixin/autoResize'
|
||||||
|
|
||||||
|
import { getPolylineLength } from '@jiaminghi/charts/lib/util'
|
||||||
|
|
||||||
|
import { deepMerge } from '@jiaminghi/charts/lib/util/index'
|
||||||
|
|
||||||
|
import { deepClone } from '@jiaminghi/c-render/lib/plugin/util'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DvDecoration5',
|
||||||
|
mixins: [autoResize],
|
||||||
|
props: {
|
||||||
|
color: {
|
||||||
|
type: Array,
|
||||||
|
default: () => ([])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
ref: 'decoration-5',
|
||||||
|
|
||||||
|
line1Points: '',
|
||||||
|
line2Points: '',
|
||||||
|
|
||||||
|
line1Length: 0,
|
||||||
|
line2Length: 0,
|
||||||
|
|
||||||
|
defaultColor: ['#3f96a5', '#3f96a5'],
|
||||||
|
|
||||||
|
mergedColor: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
color () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
afterAutoResizeMixinInit () {
|
||||||
|
const { calcSVGData } = this
|
||||||
|
|
||||||
|
calcSVGData()
|
||||||
|
},
|
||||||
|
calcSVGData () {
|
||||||
|
const { width, height } = this
|
||||||
|
|
||||||
|
let line1Points = [
|
||||||
|
[0, height * 0.2], [width * 0.18, height * 0.2], [width * 0.2, height * 0.4], [width * 0.25, height * 0.4],
|
||||||
|
[width * 0.27, height * 0.6], [width * 0.72, height * 0.6], [width * 0.75, height * 0.4],
|
||||||
|
[width * 0.8, height * 0.4], [width * 0.82, height * 0.2], [width, height * 0.2]
|
||||||
|
]
|
||||||
|
|
||||||
|
let line2Points = [
|
||||||
|
[width * 0.3, height * 0.8], [width * 0.7, height * 0.8]
|
||||||
|
]
|
||||||
|
|
||||||
|
const line1Length = getPolylineLength(line1Points)
|
||||||
|
const line2Length = getPolylineLength(line2Points)
|
||||||
|
|
||||||
|
line1Points = line1Points.map(point => point.join(',')).join(' ')
|
||||||
|
line2Points = line2Points.map(point => point.join(',')).join(' ')
|
||||||
|
|
||||||
|
this.line1Points = line1Points
|
||||||
|
this.line2Points = line2Points
|
||||||
|
|
||||||
|
this.line1Length = line1Length
|
||||||
|
this.line2Length = line2Length
|
||||||
|
},
|
||||||
|
onResize () {
|
||||||
|
const { calcSVGData } = this
|
||||||
|
|
||||||
|
calcSVGData()
|
||||||
|
},
|
||||||
|
mergeColor () {
|
||||||
|
const { color, defaultColor } = this
|
||||||
|
|
||||||
|
this.mergedColor = deepMerge(deepClone(defaultColor, true), color || [])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
const { mergeColor } = this
|
||||||
|
|
||||||
|
mergeColor()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user