Compare commits
57 Commits
V2.3.5-alp
...
V2.4.4-alp
Author | SHA1 | Date | |
---|---|---|---|
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 |
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请求
|
||||
|
||||
**其他信息:**
|
61
CHANGELOG.md
61
CHANGELOG.md
@ -1,8 +1,67 @@
|
||||
# 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.
|
||||
- **activeRingChart:** Color configuration does not take effect [(#3)](https://github.com/jiaming743/DataV/pull/3).
|
||||
|
||||
# 2.3.4-alpha (2019-08-15)
|
||||
|
||||
|
BIN
QQGroup.png
Normal file
BIN
QQGroup.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
32
README.md
32
README.md
@ -1,7 +1,6 @@
|
||||
[ENGLISH](./README_EN.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" />
|
||||
@ -37,4 +36,33 @@ import { borderBox1 } from '@jiaminghi/data-view'
|
||||
Vue.use(borderBox1)
|
||||
```
|
||||
|
||||
详细文档及示例请移步[HomePage](http://datav.jiaminghi.com).
|
||||
详细文档及示例请移步[HomePage](http://datav.jiaminghi.com).
|
||||
|
||||
### TODO
|
||||
|
||||
* **飞线图**添加多中心点及反向飞线功能
|
||||
* **边框**及**装饰**添加颜色及其他必要配置项,增强可配置性及灵活性.
|
||||
|
||||
### 致谢
|
||||
|
||||
组件库的开发基于个人学习和兴趣,由于技术水平及经验的限制,组件尚有许多不完善之处,如有BUG可及时提交[issue](https://github.com/jiaming743/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)
|
||||
|
||||

|
||||
|
31
README_EN.md
31
README_EN.md
@ -37,4 +37,33 @@ import { borderBox1 } from '@jiaminghi/data-view'
|
||||
Vue.use(borderBox1)
|
||||
```
|
||||
|
||||
Detailed documents and examples can be viewed on the [HomePage](http://datav.jiaminghi.com).
|
||||
Detailed documents and examples can be viewed on the [HomePage](http://datav.jiaminghi.com).
|
||||
|
||||
### TODO
|
||||
|
||||
* **flylineChart**Add multi-center point and reverse fly line function.
|
||||
* Add color and other necessary configuration to the **borderBox** and **decoration** to enhance configurability and flexibility.
|
||||
|
||||
### 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/jiaming743/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('@jiaminghi/fs')
|
||||
const print = require('./plugin/print')
|
||||
const path = require('path')
|
||||
const doExec = require('./plugin/exec')
|
||||
const exec = require('./plugin/exec')
|
||||
|
||||
const PACKAGE_SRC = './src'
|
||||
const COMPILE_SRC = './lib'
|
||||
const COMPONENTS_DIR = '/components'
|
||||
const ENTRANCE = '/index.js'
|
||||
const libName = 'datav'
|
||||
|
||||
async function start () {
|
||||
// Compile for NPM
|
||||
|
||||
const copyPackage = await copyDir(PACKAGE_SRC, COMPILE_SRC)
|
||||
|
||||
if (!copyPackage) {
|
||||
@ -63,6 +66,27 @@ async function start () {
|
||||
|
||||
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 uglifyjs = await exec(`uglifyjs dist/${libName}.map.js -o dist/${libName}.min.js`)
|
||||
|
||||
// if (!uglifyjs) {
|
||||
// print.error('Exception in uglifyjs')
|
||||
|
||||
// return
|
||||
// }
|
||||
|
||||
// print.tip('After uglifyjs')
|
||||
|
||||
print.yellow('-------------------------------------')
|
||||
print.success(' DataV Lib Compile Success! ')
|
||||
print.yellow('-------------------------------------')
|
||||
@ -122,7 +146,7 @@ async function compileLessToCss () {
|
||||
maxBuffer: 1024 ** 5
|
||||
})
|
||||
|
||||
const compile = await doExec(execString)
|
||||
const compile = await exec(execString)
|
||||
|
||||
if (!compile) {
|
||||
print.error(execString + ' Error!')
|
||||
@ -180,6 +204,8 @@ async function addComponentsExport () {
|
||||
return write
|
||||
}
|
||||
|
||||
module.exports = start
|
||||
async function compileUMDVersion () {
|
||||
|
||||
}
|
||||
|
||||
start()
|
23
build/rollup.config.js
Normal file
23
build/rollup.config.js
Normal file
@ -0,0 +1,23 @@
|
||||
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',
|
||||
// input: 'src/index.js',
|
||||
output: {
|
||||
format: 'umd',
|
||||
file: 'dist/datav.map.js',
|
||||
name: 'datav'
|
||||
},
|
||||
plugins: [
|
||||
resolve(),
|
||||
babel({
|
||||
exclude: 'node_modules/**'
|
||||
}),
|
||||
commonjs(),
|
||||
vue(),
|
||||
],
|
||||
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 |
23701
dist/datav.map.js
vendored
Normal file
23701
dist/datav.map.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -11,7 +11,7 @@
|
||||
<script>
|
||||
import Charts from '@jiaminghi/charts'
|
||||
|
||||
import dvDigitalFlop from '../../digitalFlop/src/main'
|
||||
import dvDigitalFlop from '../../digitalFlop/src/main.vue'
|
||||
|
||||
import { deepMerge } from '@jiaminghi/charts/lib/util/index'
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
}
|
||||
.dv-border-box-1 .border {
|
||||
position: absolute;
|
||||
display: block;
|
||||
}
|
||||
.dv-border-box-1 .right-top {
|
||||
right: 0px;
|
||||
|
@ -14,7 +14,7 @@
|
||||
<animate
|
||||
attributeName="fill"
|
||||
values="#4fd2dd;#235fa7;#4fd2dd"
|
||||
dur=".5s"
|
||||
dur="0.5s"
|
||||
begin="0s"
|
||||
repeatCount="indefinite"
|
||||
/>
|
||||
@ -26,7 +26,7 @@
|
||||
<animate
|
||||
attributeName="fill"
|
||||
values="#235fa7;#4fd2dd;#235fa7"
|
||||
dur=".5s"
|
||||
dur="0.5s"
|
||||
begin="0s"
|
||||
repeatCount="indefinite"
|
||||
/>
|
||||
@ -37,7 +37,7 @@
|
||||
>
|
||||
<animate
|
||||
attributeName="fill"
|
||||
values="#4fd2dd;#235fa7;#transparent"
|
||||
values="#4fd2dd;#235fa7;transparent"
|
||||
dur="1s"
|
||||
begin="0s"
|
||||
repeatCount="indefinite"
|
||||
|
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)
|
||||
}
|
29
lib/components/borderBox10/src/main.css
Normal file
29
lib/components/borderBox10/src/main.css
Normal file
@ -0,0 +1,29 @@
|
||||
.dv-border-box-10 {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-shadow: inset 0 0 25px 3px #1d48c4;
|
||||
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%;
|
||||
}
|
31
lib/components/borderBox10/src/main.vue
Normal file
31
lib/components/borderBox10/src/main.vue
Normal file
@ -0,0 +1,31 @@
|
||||
<template>
|
||||
<div class="dv-border-box-10">
|
||||
<svg
|
||||
width="150px"
|
||||
height="150px"
|
||||
:key="item"
|
||||
v-for="item in border"
|
||||
:class="`${item} border`"
|
||||
>
|
||||
<polygon
|
||||
fill="#d3e1f8"
|
||||
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>
|
||||
export default {
|
||||
name: 'DvBorderBox10',
|
||||
data () {
|
||||
return {
|
||||
border: ['left-top', 'right-top', 'left-bottom', 'right-bottom']
|
||||
}
|
||||
}
|
||||
}
|
||||
</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)
|
||||
}
|
55
lib/components/capsuleChart/src/main.css
Normal file
55
lib/components/capsuleChart/src/main.css
Normal file
@ -0,0 +1,55 @@
|
||||
.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 div {
|
||||
height: 8px;
|
||||
margin-top: 1px;
|
||||
border-radius: 5px;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
.dv-capsule-chart .unit-label {
|
||||
height: 20px;
|
||||
font-size: 12px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.dv-capsule-chart .unit-text {
|
||||
text-align: right;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
margin-left: 10px;
|
||||
}
|
114
lib/components/capsuleChart/src/main.vue
Normal file
114
lib/components/capsuleChart/src/main.vue
Normal file
@ -0,0 +1,114 @@
|
||||
<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 :style="`width: ${capsule * 100}%; background-color: ${mergedConfig.colors[index % mergedConfig.colors.length]};`"></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: ''
|
||||
},
|
||||
|
||||
mergedConfig: null,
|
||||
|
||||
capsuleLength: [],
|
||||
labelData: []
|
||||
}
|
||||
},
|
||||
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.capsuleLength = capsuleValue.map(v => maxValue ? v / maxValue : 0)
|
||||
|
||||
const oneFifth = maxValue / 5
|
||||
|
||||
this.labelData = new Array(6).fill(0).map((v, i) => Math.ceil(i * oneFifth))
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
const { calcData } = this
|
||||
|
||||
calcData()
|
||||
}
|
||||
}
|
||||
</script>
|
@ -22,7 +22,7 @@
|
||||
dur="6s"
|
||||
calcMode="spline"
|
||||
keyTimes="0;1"
|
||||
keySplines=".42,0,.58,1"
|
||||
keySplines="0.42,0,0.58,1"
|
||||
repeatCount="indefinite"
|
||||
/>
|
||||
</rect>
|
||||
|
@ -16,7 +16,7 @@
|
||||
begin="0s"
|
||||
calcMode="spline"
|
||||
keyTimes="0;1"
|
||||
keySplines=".4,1,.49,.98"
|
||||
keySplines="0.4,1,0.49,0.98"
|
||||
repeatCount="indefinite"
|
||||
/>
|
||||
</polyline>
|
||||
|
@ -16,9 +16,9 @@
|
||||
attributeName="y"
|
||||
:values="`${point[1] - minHeights[i] / 2};${point[1] - heights[i] / 2};${point[1] - minHeights[i] / 2}`"
|
||||
:dur="`${randoms[i]}s`"
|
||||
keyTimes="0;.5;1"
|
||||
keyTimes="0;0.5;1"
|
||||
calcMode="spline"
|
||||
keySplines=".42,0,.58,1;.42,0,.58,1"
|
||||
keySplines="0.42,0,0.58,1;0.42,0,0.58,1"
|
||||
begin="0s"
|
||||
repeatCount="indefinite"
|
||||
/>
|
||||
@ -26,9 +26,9 @@
|
||||
attributeName="height"
|
||||
:values="`${minHeights[i]};${heights[i]};${minHeights[i]}`"
|
||||
:dur="`${randoms[i]}s`"
|
||||
keyTimes="0;.5;1"
|
||||
keyTimes="0;0.5;1"
|
||||
calcMode="spline"
|
||||
keySplines=".42,0,.58,1;.42,0,.58,1"
|
||||
keySplines="0.42,0,0.58,1;0.42,0,0.58,1"
|
||||
begin="0s"
|
||||
repeatCount="indefinite"
|
||||
/>
|
||||
|
@ -1,7 +1,15 @@
|
||||
.dv-percent-pond {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.dv-percent-pond svg {
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.dv-percent-pond polyline {
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
@ -4,13 +4,13 @@
|
||||
<defs>
|
||||
<linearGradient :id="gradientId1" x1="0%" y1="0%" x2="100%" y2="0%">
|
||||
<stop v-for="lc in linearGradient" :key="lc[0]"
|
||||
:offset="lc[0]"
|
||||
:offset="`${lc[0]}%`"
|
||||
:stop-color="lc[1]" />
|
||||
</linearGradient>
|
||||
|
||||
<linearGradient :id="gradientId2" x1="0%" y1="0%" :x2="gradient2XPos" y2="0%">
|
||||
<stop v-for="lc in linearGradient" :key="lc[0]"
|
||||
:offset="lc[0]"
|
||||
:offset="`${lc[0]}%`"
|
||||
:stop-color="lc[1]" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
@ -22,8 +22,8 @@
|
||||
fill="transparent"
|
||||
:stroke-width="mergedConfig ? mergedConfig.borderWidth : '0'"
|
||||
:stroke="`url(#${gradientId1})`"
|
||||
:width="rectWidth"
|
||||
:height="rectHeight"
|
||||
:width="rectWidth > 0 ? rectWidth : 0"
|
||||
:height="rectHeight > 0 ? rectHeight : 0"
|
||||
/>
|
||||
<polyline
|
||||
:stroke-width="polylineWidth"
|
||||
|
@ -260,11 +260,16 @@ export default {
|
||||
calcWidths () {
|
||||
const { width, mergedConfig, rowsData } = this
|
||||
|
||||
const { columnWidth } = mergedConfig
|
||||
const { columnWidth, header } = mergedConfig
|
||||
|
||||
const usedWidth = columnWidth.reduce((all, w) => all + w, 0)
|
||||
|
||||
const columnNum = rowsData[0] ? rowsData[0].ceils.length : 0
|
||||
let columnNum = 0
|
||||
if (rowsData[0]) {
|
||||
columnNum = rowsData[0].ceils.length
|
||||
} else if (header.length) {
|
||||
columnNum = header.length
|
||||
}
|
||||
|
||||
const avgWidth = (width - usedWidth) / (columnNum - columnWidth.length)
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
<div class="ranking-info">
|
||||
<div class="rank">No.{{ item.ranking }}</div>
|
||||
<div class="info-name">{{ item.name }}</div>
|
||||
<div class="ranking-value">{{ item.value }}</div>
|
||||
<div class="ranking-value">{{ item.value + mergedConfig.unit }}</div>
|
||||
</div>
|
||||
|
||||
<div class="ranking-column">
|
||||
@ -69,7 +69,14 @@ export default {
|
||||
* @default carousel = 'single'
|
||||
* @example carousel = 'single' | 'page'
|
||||
*/
|
||||
carousel: 'single'
|
||||
carousel: 'single',
|
||||
/**
|
||||
* @description Value unit
|
||||
* @type {String}
|
||||
* @default unit = ''
|
||||
* @example unit = 'ton'
|
||||
*/
|
||||
unit: ''
|
||||
},
|
||||
|
||||
mergedConfig: null,
|
||||
|
@ -3,6 +3,7 @@
|
||||
*/
|
||||
export { default as activeRingChart } from './components/activeRingChart/index'
|
||||
export { default as borderBox1 } from './components/borderBox1/index'
|
||||
export { default as borderBox10 } from './components/borderBox10/index'
|
||||
export { default as borderBox2 } from './components/borderBox2/index'
|
||||
export { default as borderBox3 } from './components/borderBox3/index'
|
||||
export { default as borderBox4 } from './components/borderBox4/index'
|
||||
@ -11,6 +12,7 @@ export { default as borderBox6 } from './components/borderBox6/index'
|
||||
export { default as borderBox7 } from './components/borderBox7/index'
|
||||
export { default as borderBox8 } from './components/borderBox8/index'
|
||||
export { default as borderBox9 } from './components/borderBox9/index'
|
||||
export { default as capsuleChart } from './components/capsuleChart/index'
|
||||
export { default as charts } from './components/charts/index'
|
||||
export { default as conicalColumnChart } from './components/conicalColumnChart/index'
|
||||
export { default as decoration1 } from './components/decoration1/index'
|
||||
@ -47,6 +49,7 @@ import borderBox6 from './components/borderBox6/index'
|
||||
import borderBox7 from './components/borderBox7/index'
|
||||
import borderBox8 from './components/borderBox8/index'
|
||||
import borderBox9 from './components/borderBox9/index'
|
||||
import borderBox10 from './components/borderBox10/index'
|
||||
|
||||
// decoration
|
||||
import decoration1 from './components/decoration1/index'
|
||||
@ -64,6 +67,7 @@ import decoration10 from './components/decoration10/index'
|
||||
import charts from './components/charts/index'
|
||||
|
||||
import activeRingChart from './components/activeRingChart'
|
||||
import capsuleChart from './components/capsuleChart'
|
||||
import waterLevelPond from './components/waterLevelPond/index'
|
||||
import percentPond from './components/percentPond/index'
|
||||
import flylineChart from './components/flylineChart'
|
||||
@ -89,6 +93,7 @@ export default function (Vue) {
|
||||
Vue.use(borderBox7)
|
||||
Vue.use(borderBox8)
|
||||
Vue.use(borderBox9)
|
||||
Vue.use(borderBox10)
|
||||
|
||||
// decoration
|
||||
Vue.use(decoration1)
|
||||
@ -106,6 +111,7 @@ export default function (Vue) {
|
||||
Vue.use(charts)
|
||||
|
||||
Vue.use(activeRingChart)
|
||||
Vue.use(capsuleChart)
|
||||
Vue.use(waterLevelPond)
|
||||
Vue.use(percentPond)
|
||||
Vue.use(flylineChart)
|
||||
|
21
package.json
21
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@jiaminghi/data-view",
|
||||
"version": "2.3.5",
|
||||
"version": "2.4.4",
|
||||
"author": "JiaMing <743192023@qq.com>",
|
||||
"description": "Vue Large screen data display component library",
|
||||
"main": "lib/index.js",
|
||||
@ -9,8 +9,8 @@
|
||||
"url": "https://github.com/jiaming743/DataV.git"
|
||||
},
|
||||
"scripts": {
|
||||
"compile": "node publish.js",
|
||||
"prepublish": "npm run compile",
|
||||
"build": "node build/index.js",
|
||||
"prepublish": "npm run build",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"license": "MIT",
|
||||
@ -24,10 +24,21 @@
|
||||
"datavisual"
|
||||
],
|
||||
"dependencies": {
|
||||
"@jiaminghi/charts": "*"
|
||||
"@jiaminghi/charts": "*",
|
||||
"@babel/runtime": "^7.5.5"
|
||||
},
|
||||
"homepage": "https://github.com/jiaming743/DataV#readme",
|
||||
"devDependencies": {
|
||||
"@jiaminghi/fs": "0.0.1"
|
||||
"@babel/cli": "^7.4.4",
|
||||
"@babel/core": "^7.4.5",
|
||||
"@babel/plugin-transform-runtime": "^7.5.5",
|
||||
"@babel/preset-env": "^7.5.5",
|
||||
"@jiaminghi/fs": "0.0.1",
|
||||
"rollup-plugin-babel": "^4.3.3",
|
||||
"rollup-plugin-commonjs": "^10.1.0",
|
||||
"rollup-plugin-node-resolve": "^5.2.0",
|
||||
"rollup-plugin-uglify": "^6.0.3",
|
||||
"rollup-plugin-vue": "^5.0.1",
|
||||
"vue-template-compiler": "^2.6.10"
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +0,0 @@
|
||||
const start = require('./publish/index')
|
||||
|
||||
start()
|
@ -11,7 +11,7 @@
|
||||
<script>
|
||||
import Charts from '@jiaminghi/charts'
|
||||
|
||||
import dvDigitalFlop from '../../digitalFlop/src/main'
|
||||
import dvDigitalFlop from '../../digitalFlop/src/main.vue'
|
||||
|
||||
import { deepMerge } from '@jiaminghi/charts/lib/util/index'
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
<animate
|
||||
attributeName="fill"
|
||||
values="#4fd2dd;#235fa7;#4fd2dd"
|
||||
dur=".5s"
|
||||
dur="0.5s"
|
||||
begin="0s"
|
||||
repeatCount="indefinite"
|
||||
/>
|
||||
@ -26,7 +26,7 @@
|
||||
<animate
|
||||
attributeName="fill"
|
||||
values="#235fa7;#4fd2dd;#235fa7"
|
||||
dur=".5s"
|
||||
dur="0.5s"
|
||||
begin="0s"
|
||||
repeatCount="indefinite"
|
||||
/>
|
||||
@ -37,7 +37,7 @@
|
||||
>
|
||||
<animate
|
||||
attributeName="fill"
|
||||
values="#4fd2dd;#235fa7;#transparent"
|
||||
values="#4fd2dd;#235fa7;transparent"
|
||||
dur="1s"
|
||||
begin="0s"
|
||||
repeatCount="indefinite"
|
||||
@ -70,6 +70,7 @@ export default {
|
||||
|
||||
.border {
|
||||
position: absolute;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.right-top {
|
||||
|
5
src/components/borderBox10/index.js
Normal file
5
src/components/borderBox10/index.js
Normal file
@ -0,0 +1,5 @@
|
||||
import BorderBox10 from './src/main.vue'
|
||||
|
||||
export default function (Vue) {
|
||||
Vue.component(BorderBox10.name, BorderBox10)
|
||||
}
|
68
src/components/borderBox10/src/main.vue
Normal file
68
src/components/borderBox10/src/main.vue
Normal file
@ -0,0 +1,68 @@
|
||||
<template>
|
||||
<div class="dv-border-box-10">
|
||||
<svg
|
||||
width="150px"
|
||||
height="150px"
|
||||
:key="item"
|
||||
v-for="item in border"
|
||||
:class="`${item} border`"
|
||||
>
|
||||
<polygon
|
||||
fill="#d3e1f8"
|
||||
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>
|
||||
export default {
|
||||
name: 'DvBorderBox10',
|
||||
data () {
|
||||
return {
|
||||
border: ['left-top', 'right-top', 'left-bottom', 'right-bottom']
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.dv-border-box-10 {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-shadow: inset 0 0 25px 3px #1d48c4;
|
||||
border-radius: 6px;
|
||||
|
||||
.border {
|
||||
position: absolute;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.right-top {
|
||||
right: 0px;
|
||||
transform: rotateY(180deg);
|
||||
}
|
||||
|
||||
.left-bottom {
|
||||
bottom: 0px;
|
||||
transform: rotateX(180deg);
|
||||
}
|
||||
|
||||
.right-bottom {
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
transform: rotateX(180deg) rotateY(180deg);
|
||||
}
|
||||
|
||||
.border-box-content {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
5
src/components/capsuleChart/index.js
Normal file
5
src/components/capsuleChart/index.js
Normal file
@ -0,0 +1,5 @@
|
||||
import CapsuleChart from './src/main.vue'
|
||||
|
||||
export default function (Vue) {
|
||||
Vue.component(CapsuleChart.name, CapsuleChart)
|
||||
}
|
179
src/components/capsuleChart/src/main.vue
Normal file
179
src/components/capsuleChart/src/main.vue
Normal file
@ -0,0 +1,179 @@
|
||||
<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 :style="`width: ${capsule * 100}%; background-color: ${mergedConfig.colors[index % mergedConfig.colors.length]};`"></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: ''
|
||||
},
|
||||
|
||||
mergedConfig: null,
|
||||
|
||||
capsuleLength: [],
|
||||
labelData: []
|
||||
}
|
||||
},
|
||||
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.capsuleLength = capsuleValue.map(v => maxValue ? v / maxValue : 0)
|
||||
|
||||
const oneFifth = maxValue / 5
|
||||
|
||||
this.labelData = new Array(6).fill(0).map((v, i) => Math.ceil(i * oneFifth))
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
const { calcData } = this
|
||||
|
||||
calcData()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.dv-capsule-chart {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
box-sizing: border-box;
|
||||
padding: 10px;
|
||||
color: #fff;
|
||||
|
||||
.label-column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
padding-right: 10px;
|
||||
text-align: right;
|
||||
font-size: 12px;
|
||||
|
||||
div {
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.capsule-container {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.capsule-item {
|
||||
box-shadow: 0 0 3px #999;
|
||||
height: 10px;
|
||||
margin: 5px 0px;
|
||||
border-radius: 5px;
|
||||
|
||||
div {
|
||||
height: 8px;
|
||||
margin-top: 1px;
|
||||
border-radius: 5px;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
}
|
||||
|
||||
.unit-label {
|
||||
height: 20px;
|
||||
font-size: 12px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.unit-text {
|
||||
text-align: right;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -22,7 +22,7 @@
|
||||
dur="6s"
|
||||
calcMode="spline"
|
||||
keyTimes="0;1"
|
||||
keySplines=".42,0,.58,1"
|
||||
keySplines="0.42,0,0.58,1"
|
||||
repeatCount="indefinite"
|
||||
/>
|
||||
</rect>
|
||||
|
@ -16,7 +16,7 @@
|
||||
begin="0s"
|
||||
calcMode="spline"
|
||||
keyTimes="0;1"
|
||||
keySplines=".4,1,.49,.98"
|
||||
keySplines="0.4,1,0.49,0.98"
|
||||
repeatCount="indefinite"
|
||||
/>
|
||||
</polyline>
|
||||
|
@ -16,9 +16,9 @@
|
||||
attributeName="y"
|
||||
:values="`${point[1] - minHeights[i] / 2};${point[1] - heights[i] / 2};${point[1] - minHeights[i] / 2}`"
|
||||
:dur="`${randoms[i]}s`"
|
||||
keyTimes="0;.5;1"
|
||||
keyTimes="0;0.5;1"
|
||||
calcMode="spline"
|
||||
keySplines=".42,0,.58,1;.42,0,.58,1"
|
||||
keySplines="0.42,0,0.58,1;0.42,0,0.58,1"
|
||||
begin="0s"
|
||||
repeatCount="indefinite"
|
||||
/>
|
||||
@ -26,9 +26,9 @@
|
||||
attributeName="height"
|
||||
:values="`${minHeights[i]};${heights[i]};${minHeights[i]}`"
|
||||
:dur="`${randoms[i]}s`"
|
||||
keyTimes="0;.5;1"
|
||||
keyTimes="0;0.5;1"
|
||||
calcMode="spline"
|
||||
keySplines=".42,0,.58,1;.42,0,.58,1"
|
||||
keySplines="0.42,0,0.58,1;0.42,0,0.58,1"
|
||||
begin="0s"
|
||||
repeatCount="indefinite"
|
||||
/>
|
||||
|
@ -4,13 +4,13 @@
|
||||
<defs>
|
||||
<linearGradient :id="gradientId1" x1="0%" y1="0%" x2="100%" y2="0%">
|
||||
<stop v-for="lc in linearGradient" :key="lc[0]"
|
||||
:offset="lc[0]"
|
||||
:offset="`${lc[0]}%`"
|
||||
:stop-color="lc[1]" />
|
||||
</linearGradient>
|
||||
|
||||
<linearGradient :id="gradientId2" x1="0%" y1="0%" :x2="gradient2XPos" y2="0%">
|
||||
<stop v-for="lc in linearGradient" :key="lc[0]"
|
||||
:offset="lc[0]"
|
||||
:offset="`${lc[0]}%`"
|
||||
:stop-color="lc[1]" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
@ -22,8 +22,8 @@
|
||||
fill="transparent"
|
||||
:stroke-width="mergedConfig ? mergedConfig.borderWidth : '0'"
|
||||
:stroke="`url(#${gradientId1})`"
|
||||
:width="rectWidth"
|
||||
:height="rectHeight"
|
||||
:width="rectWidth > 0 ? rectWidth : 0"
|
||||
:height="rectHeight > 0 ? rectHeight : 0"
|
||||
/>
|
||||
<polyline
|
||||
:stroke-width="polylineWidth"
|
||||
@ -254,9 +254,18 @@ export default {
|
||||
|
||||
<style lang="less">
|
||||
.dv-percent-pond {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
svg {
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
polyline {
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
@ -260,11 +260,16 @@ export default {
|
||||
calcWidths () {
|
||||
const { width, mergedConfig, rowsData } = this
|
||||
|
||||
const { columnWidth } = mergedConfig
|
||||
const { columnWidth, header } = mergedConfig
|
||||
|
||||
const usedWidth = columnWidth.reduce((all, w) => all + w, 0)
|
||||
|
||||
const columnNum = rowsData[0] ? rowsData[0].ceils.length : 0
|
||||
let columnNum = 0
|
||||
if (rowsData[0]) {
|
||||
columnNum = rowsData[0].ceils.length
|
||||
} else if (header.length) {
|
||||
columnNum = header.length
|
||||
}
|
||||
|
||||
const avgWidth = (width - usedWidth) / (columnNum - columnWidth.length)
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
<div class="ranking-info">
|
||||
<div class="rank">No.{{ item.ranking }}</div>
|
||||
<div class="info-name">{{ item.name }}</div>
|
||||
<div class="ranking-value">{{ item.value }}</div>
|
||||
<div class="ranking-value">{{ item.value + mergedConfig.unit }}</div>
|
||||
</div>
|
||||
|
||||
<div class="ranking-column">
|
||||
@ -69,7 +69,14 @@ export default {
|
||||
* @default carousel = 'single'
|
||||
* @example carousel = 'single' | 'page'
|
||||
*/
|
||||
carousel: 'single'
|
||||
carousel: 'single',
|
||||
/**
|
||||
* @description Value unit
|
||||
* @type {String}
|
||||
* @default unit = ''
|
||||
* @example unit = 'ton'
|
||||
*/
|
||||
unit: ''
|
||||
},
|
||||
|
||||
mergedConfig: null,
|
||||
|
@ -14,6 +14,7 @@ import borderBox6 from './components/borderBox6/index'
|
||||
import borderBox7 from './components/borderBox7/index'
|
||||
import borderBox8 from './components/borderBox8/index'
|
||||
import borderBox9 from './components/borderBox9/index'
|
||||
import borderBox10 from './components/borderBox10/index'
|
||||
|
||||
// decoration
|
||||
import decoration1 from './components/decoration1/index'
|
||||
@ -31,6 +32,7 @@ import decoration10 from './components/decoration10/index'
|
||||
import charts from './components/charts/index'
|
||||
|
||||
import activeRingChart from './components/activeRingChart'
|
||||
import capsuleChart from './components/capsuleChart'
|
||||
import waterLevelPond from './components/waterLevelPond/index'
|
||||
import percentPond from './components/percentPond/index'
|
||||
import flylineChart from './components/flylineChart'
|
||||
@ -56,6 +58,7 @@ export default function (Vue) {
|
||||
Vue.use(borderBox7)
|
||||
Vue.use(borderBox8)
|
||||
Vue.use(borderBox9)
|
||||
Vue.use(borderBox10)
|
||||
|
||||
// decoration
|
||||
Vue.use(decoration1)
|
||||
@ -73,6 +76,7 @@ export default function (Vue) {
|
||||
Vue.use(charts)
|
||||
|
||||
Vue.use(activeRingChart)
|
||||
Vue.use(capsuleChart)
|
||||
Vue.use(waterLevelPond)
|
||||
Vue.use(percentPond)
|
||||
Vue.use(flylineChart)
|
||||
|
Reference in New Issue
Block a user