Compare commits
75 Commits
V2.4.1-alp
...
V2.4.8-alp
Author | SHA1 | Date | |
---|---|---|---|
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 |
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请求
|
||||
|
||||
**其他信息:**
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,6 +1,7 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
package-lock.json
|
||||
/deploy/config.js
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
|
37
CHANGELOG.md
37
CHANGELOG.md
@ -1,3 +1,40 @@
|
||||
# 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
|
||||
|
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
||||
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
|
||||
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 |
34
README.md
34
README.md
@ -2,8 +2,8 @@
|
||||
|
||||
<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 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" />
|
||||
@ -12,10 +12,10 @@
|
||||
|
||||
## DataV是干什么的?
|
||||
|
||||
* DataV是一个基于**Vue**的数据可视化组件库.
|
||||
* 提供用于提升页面视觉效果的**SVG**边框和装饰.
|
||||
* 提供常用的**图表**如折线图等.
|
||||
* 飞线图/轮播表等其他组件.
|
||||
* DataV是一个基于**Vue**的数据可视化组件库(当然也有[React版本](https://github.com/DataV-Team/DataV-React))
|
||||
* 提供用于提升页面视觉效果的**SVG**边框和装饰
|
||||
* 提供常用的**图表**如折线图等
|
||||
* 飞线图/轮播表等其他组件
|
||||
|
||||
### npm安装
|
||||
|
||||
@ -38,6 +38,24 @@ Vue.use(borderBox1)
|
||||
|
||||
详细文档及示例请移步[HomePage](http://datav.jiaminghi.com).
|
||||
|
||||
### UMD版
|
||||
|
||||
`UMD`版可直接使用`script`标签引入,`UMD`版文件位于项目`dist`目录下,引入后将自动把所有组件注册为**Vue全局组件**,引入`DataV`前请确保已引入`Vue`。
|
||||
|
||||
[UMD版使用示例](./umdExample.html)
|
||||
|
||||
### TODO
|
||||
|
||||
* **飞线图**添加多中心点及反向飞线功能
|
||||
* **边框**及**装饰**添加颜色及其他必要配置项,增强可配置性及灵活性.
|
||||
|
||||
### 致谢
|
||||
|
||||
组件库的开发基于个人学习和兴趣,由于技术水平及经验的限制,组件尚有许多不完善之处,如有BUG可及时提交[issue](https://github.com/DataV-Team/DataV/issues/new?template=bug_report.md)或添加反馈群进行反馈,也欢迎提供指正和建议,感谢各位的支持。
|
||||
|
||||
### 反馈
|
||||

|
||||
|
||||
### Demo
|
||||
|
||||
Demo页面使用了全屏组件,请F11全屏后查看。
|
||||
@ -49,3 +67,7 @@ Demo页面使用了全屏组件,请F11全屏后查看。
|
||||
* [机电运维管理台](http://datav.jiaminghi.com/demo/manage-desk/index.html)
|
||||
|
||||

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

|
||||
|
39
README_EN.md
39
README_EN.md
@ -3,8 +3,8 @@
|
||||
<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 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" />
|
||||
@ -13,7 +13,7 @@
|
||||
|
||||
## What is DataV?
|
||||
|
||||
* DataV is a data **visualization** components library based on **Vue**.
|
||||
* 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.
|
||||
@ -39,6 +39,35 @@ 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
|
||||
|
||||
* **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/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.
|
||||
@ -50,3 +79,7 @@ The Demo page uses the full-screen component, please view it after F11 full scre
|
||||
* [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 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.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()
|
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']
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 144 KiB 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 |
Binary file not shown.
Before Width: | Height: | Size: 151 KiB 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
|
20224
dist/datav.map.vue.js
vendored
Normal file
20224
dist/datav.map.vue.js
vendored
Normal file
File diff suppressed because one or more lines are too long
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
@ -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'
|
||||
|
||||
@ -113,7 +113,7 @@ export default {
|
||||
|
||||
const sum = value.reduce((all, v) => all + v, 0)
|
||||
|
||||
const percent = parseInt(value[activeIndex] / sum * 100)
|
||||
const percent = parseInt(value[activeIndex] / sum * 100) || 0
|
||||
|
||||
return {
|
||||
content: '{nt}%',
|
||||
@ -174,7 +174,7 @@ export default {
|
||||
|
||||
const option = getRingOption()
|
||||
|
||||
chart.setOption(option)
|
||||
chart.setOption(option, true)
|
||||
|
||||
ringAnimation()
|
||||
},
|
||||
@ -236,7 +236,7 @@ export default {
|
||||
}
|
||||
})
|
||||
|
||||
chart.setOption(option)
|
||||
chart.setOption(option, true)
|
||||
|
||||
const { activeTimeGap } = option.series[0]
|
||||
|
||||
|
@ -68,11 +68,12 @@ export default {
|
||||
name: 'DvBorderBox8',
|
||||
mixins: [autoResize],
|
||||
data () {
|
||||
const timestamp = Date.now()
|
||||
return {
|
||||
ref: 'border-box-8',
|
||||
path: `border-box-8-path-${(new Date()).getTime()}`,
|
||||
gradient: `border-box-8-gradient-${(new Date()).getTime()}`,
|
||||
mask: `border-box-8-mask-${(new Date()).getTime()}`
|
||||
path: `border-box-8-path-${timestamp}`,
|
||||
gradient: `border-box-8-gradient-${timestamp}`,
|
||||
mask: `border-box-8-mask-${timestamp}`
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -89,11 +89,12 @@ export default {
|
||||
name: 'DvBorderBox9',
|
||||
mixins: [autoResize],
|
||||
data () {
|
||||
const timestamp = Date.now()
|
||||
return {
|
||||
ref: 'border-box-9',
|
||||
|
||||
gradientId: `border-box-9-gradient-${(new Date()).getTime()}`,
|
||||
maskId: `border-box-9-mask-${(new Date()).getTime()}`
|
||||
gradientId: `border-box-9-gradient-${timestamp}`,
|
||||
maskId: `border-box-9-mask-${timestamp}`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
.capsule-chart {
|
||||
.dv-capsule-chart {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
@ -6,7 +6,7 @@
|
||||
padding: 10px;
|
||||
color: #fff;
|
||||
}
|
||||
.capsule-chart .label-column {
|
||||
.dv-capsule-chart .label-column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
@ -15,41 +15,41 @@
|
||||
text-align: right;
|
||||
font-size: 12px;
|
||||
}
|
||||
.capsule-chart .label-column div {
|
||||
.dv-capsule-chart .label-column div {
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
}
|
||||
.capsule-chart .capsule-container {
|
||||
.dv-capsule-chart .capsule-container {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.capsule-chart .capsule-item {
|
||||
.dv-capsule-chart .capsule-item {
|
||||
box-shadow: 0 0 3px #999;
|
||||
height: 10px;
|
||||
margin: 5px 0px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.capsule-chart .capsule-item div {
|
||||
.dv-capsule-chart .capsule-item div {
|
||||
height: 8px;
|
||||
margin-top: 1px;
|
||||
border-radius: 5px;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
.capsule-chart .unit-label {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
line-height: 20px;
|
||||
.dv-capsule-chart .unit-label {
|
||||
height: 20px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.capsule-chart .unit-text {
|
||||
width: 30px;
|
||||
text-align: right;
|
||||
}
|
||||
.capsule-chart .unit-container {
|
||||
flex: 1;
|
||||
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;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="capsule-chart">
|
||||
<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>
|
||||
@ -11,18 +11,16 @@
|
||||
class="capsule-item"
|
||||
v-for="(capsule, index) in capsuleLength"
|
||||
:key="index"
|
||||
:style="`width: calc(100% - ${mergedConfig.unit ? 30 : 0}px)`"
|
||||
>
|
||||
<div :style="`width: ${capsule * 100}%; background-color: ${mergedConfig.colors[index % mergedConfig.colors.length]};`"></div>
|
||||
</div>
|
||||
|
||||
<div class="unit-label">
|
||||
<div class="unit-container">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -19,9 +19,10 @@ export default {
|
||||
}
|
||||
},
|
||||
data () {
|
||||
const timestamp = Date.now()
|
||||
return {
|
||||
ref: `charts-container-${(new Date()).getTime()}`,
|
||||
chartRef: `chart-${(new Date()).getTime()}`,
|
||||
ref: `charts-container-${timestamp}`,
|
||||
chartRef: `chart-${timestamp}`,
|
||||
|
||||
chart: null
|
||||
}
|
||||
@ -34,7 +35,7 @@ export default {
|
||||
|
||||
if (!option) option = {}
|
||||
|
||||
chart.setOption(option)
|
||||
chart.setOption(option, true)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -152,16 +152,17 @@ export default {
|
||||
name: 'DvDecoration10',
|
||||
mixins: [autoResize],
|
||||
data () {
|
||||
const timestamp = Date.now()
|
||||
return {
|
||||
ref: 'decoration-10',
|
||||
|
||||
animationId1: `d10ani1${(new Date()).getTime()}`,
|
||||
animationId2: `d10ani2${(new Date()).getTime()}`,
|
||||
animationId3: `d10ani3${(new Date()).getTime()}`,
|
||||
animationId4: `d10ani4${(new Date()).getTime()}`,
|
||||
animationId5: `d10ani5${(new Date()).getTime()}`,
|
||||
animationId6: `d10ani6${(new Date()).getTime()}`,
|
||||
animationId7: `d10ani7${(new Date()).getTime()}`
|
||||
animationId1: `d10ani1${timestamp}`,
|
||||
animationId2: `d10ani2${timestamp}`,
|
||||
animationId3: `d10ani3${timestamp}`,
|
||||
animationId4: `d10ani4${timestamp}`,
|
||||
animationId5: `d10ani5${timestamp}`,
|
||||
animationId6: `d10ani6${timestamp}`,
|
||||
animationId7: `d10ani7${timestamp}`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -90,10 +90,11 @@ export default {
|
||||
name: 'DvDecoration9',
|
||||
mixins: [autoResize],
|
||||
data () {
|
||||
const timestamp = Date.now()
|
||||
return {
|
||||
ref: 'decoration-9',
|
||||
|
||||
polygonId: `decoration-9-polygon-${(new Date()).getTime()}`,
|
||||
polygonId: `decoration-9-polygon-${timestamp}`,
|
||||
|
||||
svgWH: [100, 100],
|
||||
|
||||
|
@ -151,6 +151,8 @@ export default {
|
||||
update () {
|
||||
const { mergeConfig, mergeShape, getShape, getStyle, graph, mergedConfig } = this
|
||||
|
||||
graph.animationEnd()
|
||||
|
||||
mergeConfig()
|
||||
|
||||
if (!graph) return
|
||||
|
@ -171,13 +171,14 @@ export default {
|
||||
}
|
||||
},
|
||||
data () {
|
||||
const timestamp = Date.now()
|
||||
return {
|
||||
ref: 'dv-flyline-chart',
|
||||
unique: Math.random(),
|
||||
maskId: `flyline-mask-id-${(new Date()).getTime()}`,
|
||||
maskCircleId: `mask-circle-id-${(new Date()).getTime()}`,
|
||||
gradientId: `gradient-id-${(new Date()).getTime()}`,
|
||||
gradient2Id: `gradient2-id-${(new Date()).getTime()}`,
|
||||
maskId: `flyline-mask-id-${timestamp}`,
|
||||
maskCircleId: `mask-circle-id-${timestamp}`,
|
||||
gradientId: `gradient-id-${timestamp}`,
|
||||
gradient2Id: `gradient2-id-${timestamp}`,
|
||||
|
||||
defaultConfig: {
|
||||
/**
|
||||
|
@ -57,9 +57,10 @@ export default {
|
||||
}
|
||||
},
|
||||
data () {
|
||||
const timestamp = Date.now()
|
||||
return {
|
||||
gradientId1: `percent-pond-gradientId1-${(new Date()).getTime()}`,
|
||||
gradientId2: `percent-pond-gradientId2-${(new Date()).getTime()}`,
|
||||
gradientId1: `percent-pond-gradientId1-${timestamp}`,
|
||||
gradientId2: `percent-pond-gradientId2-${timestamp}`,
|
||||
|
||||
width: 0,
|
||||
height: 0,
|
||||
@ -239,7 +240,7 @@ export default {
|
||||
this.height = dom.clientHeight
|
||||
},
|
||||
mergeConfig () {
|
||||
let { config, defaultConfig } = this
|
||||
const { config, defaultConfig } = this
|
||||
|
||||
this.mergedConfig = deepMerge(deepClone(defaultConfig, true), config || {})
|
||||
}
|
||||
|
@ -236,7 +236,7 @@ export default {
|
||||
data = data.map((row, i) => {
|
||||
row = [...row]
|
||||
|
||||
const indexTag = `<span class="index" style="background-color: ${headerBGC};">${i + 1}</spand>`
|
||||
const indexTag = `<span class="index" style="background-color: ${headerBGC};">${i + 1}</span>`
|
||||
|
||||
row.unshift(indexTag)
|
||||
|
||||
@ -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,
|
||||
|
@ -53,8 +53,9 @@ export default {
|
||||
default: () => ({})
|
||||
},
|
||||
data () {
|
||||
const timestamp = Date.now()
|
||||
return {
|
||||
gradientId: `water-level-pond-${(new Date()).getTime()}`,
|
||||
gradientId: `water-level-pond-${timestamp}`,
|
||||
|
||||
defaultConfig: {
|
||||
/**
|
||||
|
29
package.json
29
package.json
@ -1,21 +1,22 @@
|
||||
{
|
||||
"name": "@jiaminghi/data-view",
|
||||
"version": "2.4.1",
|
||||
"version": "2.4.7",
|
||||
"author": "JiaMing <743192023@qq.com>",
|
||||
"description": "Vue Large screen data display component library",
|
||||
"main": "lib/index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jiaming743/DataV.git"
|
||||
"url": "https://github.com/DataV-Team/DataV.git"
|
||||
},
|
||||
"scripts": {
|
||||
"compile": "node publish.js",
|
||||
"prepublish": "npm run compile",
|
||||
"build": "node build/index.js",
|
||||
"prepublish": "npm run build",
|
||||
"deploy": "node deploy/index.js",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jiaming743/DataV/issues"
|
||||
"url": "https://github.com/DataV-Team/DataV/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"vue",
|
||||
@ -24,10 +25,22 @@
|
||||
"datavisual"
|
||||
],
|
||||
"dependencies": {
|
||||
"@jiaminghi/charts": "*"
|
||||
"@jiaminghi/charts": "*",
|
||||
"@babel/runtime": "^7.5.5"
|
||||
},
|
||||
"homepage": "https://github.com/jiaming743/DataV#readme",
|
||||
"homepage": "https://github.com/DataV-Team/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",
|
||||
"ftp": "^0.3.10",
|
||||
"rollup-plugin-babel": "^4.3.3",
|
||||
"rollup-plugin-commonjs": "^10.1.0",
|
||||
"rollup-plugin-node-resolve": "^5.2.0",
|
||||
"rollup-plugin-terser": "^5.1.1",
|
||||
"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'
|
||||
|
||||
@ -113,7 +113,7 @@ export default {
|
||||
|
||||
const sum = value.reduce((all, v) => all + v, 0)
|
||||
|
||||
const percent = parseInt(value[activeIndex] / sum * 100)
|
||||
const percent = parseInt(value[activeIndex] / sum * 100) || 0
|
||||
|
||||
return {
|
||||
content: '{nt}%',
|
||||
@ -174,7 +174,7 @@ export default {
|
||||
|
||||
const option = getRingOption()
|
||||
|
||||
chart.setOption(option)
|
||||
chart.setOption(option, true)
|
||||
|
||||
ringAnimation()
|
||||
},
|
||||
@ -236,7 +236,7 @@ export default {
|
||||
}
|
||||
})
|
||||
|
||||
chart.setOption(option)
|
||||
chart.setOption(option, true)
|
||||
|
||||
const { activeTimeGap } = option.series[0]
|
||||
|
||||
|
@ -68,11 +68,12 @@ export default {
|
||||
name: 'DvBorderBox8',
|
||||
mixins: [autoResize],
|
||||
data () {
|
||||
const timestamp = Date.now()
|
||||
return {
|
||||
ref: 'border-box-8',
|
||||
path: `border-box-8-path-${(new Date()).getTime()}`,
|
||||
gradient: `border-box-8-gradient-${(new Date()).getTime()}`,
|
||||
mask: `border-box-8-mask-${(new Date()).getTime()}`
|
||||
path: `border-box-8-path-${timestamp}`,
|
||||
gradient: `border-box-8-gradient-${timestamp}`,
|
||||
mask: `border-box-8-mask-${timestamp}`
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -89,11 +89,12 @@ export default {
|
||||
name: 'DvBorderBox9',
|
||||
mixins: [autoResize],
|
||||
data () {
|
||||
const timestamp = Date.now()
|
||||
return {
|
||||
ref: 'border-box-9',
|
||||
|
||||
gradientId: `border-box-9-gradient-${(new Date()).getTime()}`,
|
||||
maskId: `border-box-9-mask-${(new Date()).getTime()}`
|
||||
gradientId: `border-box-9-gradient-${timestamp}`,
|
||||
maskId: `border-box-9-mask-${timestamp}`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="capsule-chart">
|
||||
<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>
|
||||
@ -114,7 +114,7 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.capsule-chart {
|
||||
.dv-capsule-chart {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
@ -19,9 +19,10 @@ export default {
|
||||
}
|
||||
},
|
||||
data () {
|
||||
const timestamp = Date.now()
|
||||
return {
|
||||
ref: `charts-container-${(new Date()).getTime()}`,
|
||||
chartRef: `chart-${(new Date()).getTime()}`,
|
||||
ref: `charts-container-${timestamp}`,
|
||||
chartRef: `chart-${timestamp}`,
|
||||
|
||||
chart: null
|
||||
}
|
||||
@ -34,7 +35,7 @@ export default {
|
||||
|
||||
if (!option) option = {}
|
||||
|
||||
chart.setOption(option)
|
||||
chart.setOption(option, true)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -152,16 +152,17 @@ export default {
|
||||
name: 'DvDecoration10',
|
||||
mixins: [autoResize],
|
||||
data () {
|
||||
const timestamp = Date.now()
|
||||
return {
|
||||
ref: 'decoration-10',
|
||||
|
||||
animationId1: `d10ani1${(new Date()).getTime()}`,
|
||||
animationId2: `d10ani2${(new Date()).getTime()}`,
|
||||
animationId3: `d10ani3${(new Date()).getTime()}`,
|
||||
animationId4: `d10ani4${(new Date()).getTime()}`,
|
||||
animationId5: `d10ani5${(new Date()).getTime()}`,
|
||||
animationId6: `d10ani6${(new Date()).getTime()}`,
|
||||
animationId7: `d10ani7${(new Date()).getTime()}`
|
||||
animationId1: `d10ani1${timestamp}`,
|
||||
animationId2: `d10ani2${timestamp}`,
|
||||
animationId3: `d10ani3${timestamp}`,
|
||||
animationId4: `d10ani4${timestamp}`,
|
||||
animationId5: `d10ani5${timestamp}`,
|
||||
animationId6: `d10ani6${timestamp}`,
|
||||
animationId7: `d10ani7${timestamp}`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -90,10 +90,11 @@ export default {
|
||||
name: 'DvDecoration9',
|
||||
mixins: [autoResize],
|
||||
data () {
|
||||
const timestamp = Date.now()
|
||||
return {
|
||||
ref: 'decoration-9',
|
||||
|
||||
polygonId: `decoration-9-polygon-${(new Date()).getTime()}`,
|
||||
polygonId: `decoration-9-polygon-${timestamp}`,
|
||||
|
||||
svgWH: [100, 100],
|
||||
|
||||
|
@ -151,6 +151,8 @@ export default {
|
||||
update () {
|
||||
const { mergeConfig, mergeShape, getShape, getStyle, graph, mergedConfig } = this
|
||||
|
||||
graph.animationEnd()
|
||||
|
||||
mergeConfig()
|
||||
|
||||
if (!graph) return
|
||||
|
@ -171,13 +171,14 @@ export default {
|
||||
}
|
||||
},
|
||||
data () {
|
||||
const timestamp = Date.now()
|
||||
return {
|
||||
ref: 'dv-flyline-chart',
|
||||
unique: Math.random(),
|
||||
maskId: `flyline-mask-id-${(new Date()).getTime()}`,
|
||||
maskCircleId: `mask-circle-id-${(new Date()).getTime()}`,
|
||||
gradientId: `gradient-id-${(new Date()).getTime()}`,
|
||||
gradient2Id: `gradient2-id-${(new Date()).getTime()}`,
|
||||
maskId: `flyline-mask-id-${timestamp}`,
|
||||
maskCircleId: `mask-circle-id-${timestamp}`,
|
||||
gradientId: `gradient-id-${timestamp}`,
|
||||
gradient2Id: `gradient2-id-${timestamp}`,
|
||||
|
||||
defaultConfig: {
|
||||
/**
|
||||
|
@ -57,9 +57,10 @@ export default {
|
||||
}
|
||||
},
|
||||
data () {
|
||||
const timestamp = Date.now()
|
||||
return {
|
||||
gradientId1: `percent-pond-gradientId1-${(new Date()).getTime()}`,
|
||||
gradientId2: `percent-pond-gradientId2-${(new Date()).getTime()}`,
|
||||
gradientId1: `percent-pond-gradientId1-${timestamp}`,
|
||||
gradientId2: `percent-pond-gradientId2-${timestamp}`,
|
||||
|
||||
width: 0,
|
||||
height: 0,
|
||||
@ -239,7 +240,7 @@ export default {
|
||||
this.height = dom.clientHeight
|
||||
},
|
||||
mergeConfig () {
|
||||
let { config, defaultConfig } = this
|
||||
const { config, defaultConfig } = this
|
||||
|
||||
this.mergedConfig = deepMerge(deepClone(defaultConfig, true), config || {})
|
||||
}
|
||||
|
@ -236,7 +236,7 @@ export default {
|
||||
data = data.map((row, i) => {
|
||||
row = [...row]
|
||||
|
||||
const indexTag = `<span class="index" style="background-color: ${headerBGC};">${i + 1}</spand>`
|
||||
const indexTag = `<span class="index" style="background-color: ${headerBGC};">${i + 1}</span>`
|
||||
|
||||
row.unshift(indexTag)
|
||||
|
||||
@ -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,
|
||||
|
@ -53,8 +53,9 @@ export default {
|
||||
default: () => ({})
|
||||
},
|
||||
data () {
|
||||
const timestamp = Date.now()
|
||||
return {
|
||||
gradientId: `water-level-pond-${(new Date()).getTime()}`,
|
||||
gradientId: `water-level-pond-${timestamp}`,
|
||||
|
||||
defaultConfig: {
|
||||
/**
|
||||
|
41
umdExample.html
Normal file
41
umdExample.html
Normal file
@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>DataV</title>
|
||||
<script src="https://unpkg.com/vue"></script>
|
||||
<!--Debug version-->
|
||||
<!--调试版-->
|
||||
<script src="https://unpkg.com/@jiaminghi/data-view/dist/datav.map.vue.js"></script>
|
||||
<!--Compression version-->
|
||||
<!--压缩版-->
|
||||
<!-- <script src="https://unpkg.com/@jiaminghi/data-view/dist/datav.min.vue.js"></script> -->
|
||||
<style>
|
||||
html, body, #app {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.border-box-content {
|
||||
color: rgb(66,185,131);
|
||||
font-size: 40px;
|
||||
font-weight: bold;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<dv-border-box-1>Welcome to DataV</dv-border-box-1>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var app = new Vue({
|
||||
el: '#app'
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user