sh-chart 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +21 -0
- package/README.en.md +36 -0
- package/README.md +39 -0
- package/package.json +42 -0
- package/packages/components/global-components/mixin/autoResize.js +152 -0
- package/packages/components/global-components/sh-border/components/border1.vue +70 -0
- package/packages/components/global-components/sh-border/components/border10.vue +54 -0
- package/packages/components/global-components/sh-border/components/border11.vue +207 -0
- package/packages/components/global-components/sh-border/components/border12.vue +112 -0
- package/packages/components/global-components/sh-border/components/border13.vue +50 -0
- package/packages/components/global-components/sh-border/components/border2.vue +50 -0
- package/packages/components/global-components/sh-border/components/border3.vue +53 -0
- package/packages/components/global-components/sh-border/components/border4.vue +95 -0
- package/packages/components/global-components/sh-border/components/border5.vue +64 -0
- package/packages/components/global-components/sh-border/components/border6.vue +60 -0
- package/packages/components/global-components/sh-border/components/border7.vue +57 -0
- package/packages/components/global-components/sh-border/components/border8.vue +75 -0
- package/packages/components/global-components/sh-border/components/border9.vue +92 -0
- package/packages/components/global-components/sh-border/index.vue +73 -0
- package/packages/components/global-components/sh-border/mixin/border.js +62 -0
- package/packages/components/global-components/sh-charts/config/config.js +58 -0
- package/packages/components/global-components/sh-charts/index.vue +169 -0
- package/packages/components/global-components/sh-decoration/components/decoration1.vue +81 -0
- package/packages/components/global-components/sh-decoration/components/decoration10.vue +80 -0
- package/packages/components/global-components/sh-decoration/components/decoration11.vue +63 -0
- package/packages/components/global-components/sh-decoration/components/decoration12.vue +171 -0
- package/packages/components/global-components/sh-decoration/components/decoration2.vue +78 -0
- package/packages/components/global-components/sh-decoration/components/decoration3.vue +65 -0
- package/packages/components/global-components/sh-decoration/components/decoration4.vue +72 -0
- package/packages/components/global-components/sh-decoration/components/decoration5.vue +96 -0
- package/packages/components/global-components/sh-decoration/components/decoration6.vue +84 -0
- package/packages/components/global-components/sh-decoration/components/decoration7.vue +31 -0
- package/packages/components/global-components/sh-decoration/components/decoration8.vue +32 -0
- package/packages/components/global-components/sh-decoration/components/decoration9.vue +63 -0
- package/packages/components/global-components/sh-decoration/index.vue +71 -0
- package/packages/components/global-components/sh-decoration/mixin/decoration.js +69 -0
- package/packages/components/global-components/sh-screen-header/components/header1.vue +228 -0
- package/packages/components/global-components/sh-screen-header/components/header2.vue +285 -0
- package/packages/components/global-components/sh-screen-header/components/header3.vue +452 -0
- package/packages/components/global-components/sh-screen-header/components/header4.vue +544 -0
- package/packages/components/global-components/sh-screen-header/components/header5.vue +291 -0
- package/packages/components/global-components/sh-screen-header/components/header6.vue +206 -0
- package/packages/components/global-components/sh-screen-header/index.vue +50 -0
- package/packages/components/global-components/sh-screen-header/mixin/header.js +62 -0
- package/packages/components/global-components/sh-spin/index.vue +44 -0
- package/packages/components/index.js +24 -0
- package/packages/echarts/index.js +94 -0
- package/packages/echarts/map/110000.json +1 -0
- package/packages/echarts/map/120000.json +1 -0
- package/packages/echarts/map/130000.json +1 -0
- package/packages/echarts/map/140000.json +1 -0
- package/packages/echarts/map/150000.json +1 -0
- package/packages/echarts/map/210000.json +1 -0
- package/packages/echarts/map/220000.json +1 -0
- package/packages/echarts/map/230000.json +1 -0
- package/packages/echarts/map/310000.json +1 -0
- package/packages/echarts/map/320000.json +1 -0
- package/packages/echarts/map/330000.json +1 -0
- package/packages/echarts/map/340000.json +1 -0
- package/packages/echarts/map/350000.json +1 -0
- package/packages/echarts/map/360000.json +1 -0
- package/packages/echarts/map/370000.json +1 -0
- package/packages/echarts/map/410000.json +1 -0
- package/packages/echarts/map/420000.json +1 -0
- package/packages/echarts/map/430000.json +1 -0
- package/packages/echarts/map/440000.json +1 -0
- package/packages/echarts/map/450000.json +1 -0
- package/packages/echarts/map/460000.json +1 -0
- package/packages/echarts/map/500000.json +1 -0
- package/packages/echarts/map/510000.json +1 -0
- package/packages/echarts/map/520000.json +1 -0
- package/packages/echarts/map/530000.json +1 -0
- package/packages/echarts/map/540000.json +1 -0
- package/packages/echarts/map/610000.json +1 -0
- package/packages/echarts/map/620000.json +1 -0
- package/packages/echarts/map/630000.json +1 -0
- package/packages/echarts/map/640000.json +1 -0
- package/packages/echarts/map/650000.json +1 -0
- package/packages/echarts/map/710000.json +1 -0
- package/packages/echarts/map/china.json +1 -0
- package/packages/echarts/theme/dark.js +128 -0
- package/packages/echarts/theme/infographic.js +181 -0
- package/packages/echarts/theme/macarons.js +194 -0
- package/packages/echarts/theme/roma.js +66 -0
- package/packages/echarts/theme/shine.js +136 -0
- package/packages/echarts/theme/vintage.js +11 -0
- package/packages/index.js +31 -0
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
root: true,
|
|
3
|
+
env: {
|
|
4
|
+
node: true
|
|
5
|
+
},
|
|
6
|
+
extends: ['plugin:vue/vue3-recommended', 'plugin:prettier/recommended'],
|
|
7
|
+
plugins: ['vue', 'prettier'],
|
|
8
|
+
parserOptions: {
|
|
9
|
+
parser: '@babel/eslint-parser',
|
|
10
|
+
requireConfigFile: false
|
|
11
|
+
},
|
|
12
|
+
rules: {
|
|
13
|
+
'prettier/prettier': 'error',
|
|
14
|
+
'no-console': 'off',
|
|
15
|
+
'no-debugger': 'off',
|
|
16
|
+
'no-unused-vars': 'off',
|
|
17
|
+
'no-empty': 'off',
|
|
18
|
+
'vue/no-v-html': 'off',
|
|
19
|
+
'vue/require-default-prop': 'off'
|
|
20
|
+
}
|
|
21
|
+
}
|
package/README.en.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# sh-chart
|
|
2
|
+
|
|
3
|
+
#### Description
|
|
4
|
+
{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}
|
|
5
|
+
|
|
6
|
+
#### Software Architecture
|
|
7
|
+
Software architecture description
|
|
8
|
+
|
|
9
|
+
#### Installation
|
|
10
|
+
|
|
11
|
+
1. xxxx
|
|
12
|
+
2. xxxx
|
|
13
|
+
3. xxxx
|
|
14
|
+
|
|
15
|
+
#### Instructions
|
|
16
|
+
|
|
17
|
+
1. xxxx
|
|
18
|
+
2. xxxx
|
|
19
|
+
3. xxxx
|
|
20
|
+
|
|
21
|
+
#### Contribution
|
|
22
|
+
|
|
23
|
+
1. Fork the repository
|
|
24
|
+
2. Create Feat_xxx branch
|
|
25
|
+
3. Commit your code
|
|
26
|
+
4. Create Pull Request
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
#### Gitee Feature
|
|
30
|
+
|
|
31
|
+
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
|
|
32
|
+
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
|
|
33
|
+
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
|
|
34
|
+
4. The most valuable open source project [GVP](https://gitee.com/gvp)
|
|
35
|
+
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
|
|
36
|
+
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# sh-chart
|
|
2
|
+
|
|
3
|
+
#### 介绍
|
|
4
|
+
{**以下是 Gitee 平台说明,您可以替换此简介**
|
|
5
|
+
Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台
|
|
6
|
+
无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)}
|
|
7
|
+
|
|
8
|
+
#### 软件架构
|
|
9
|
+
软件架构说明
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
#### 安装教程
|
|
13
|
+
|
|
14
|
+
1. xxxx
|
|
15
|
+
2. xxxx
|
|
16
|
+
3. xxxx
|
|
17
|
+
|
|
18
|
+
#### 使用说明
|
|
19
|
+
|
|
20
|
+
1. xxxx
|
|
21
|
+
2. xxxx
|
|
22
|
+
3. xxxx
|
|
23
|
+
|
|
24
|
+
#### 参与贡献
|
|
25
|
+
|
|
26
|
+
1. Fork 本仓库
|
|
27
|
+
2. 新建 Feat_xxx 分支
|
|
28
|
+
3. 提交代码
|
|
29
|
+
4. 新建 Pull Request
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
#### 特技
|
|
33
|
+
|
|
34
|
+
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
|
|
35
|
+
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
|
|
36
|
+
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
|
|
37
|
+
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
|
|
38
|
+
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
|
|
39
|
+
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sh-chart",
|
|
3
|
+
"version": "1.5.2",
|
|
4
|
+
"description": "基于echart二次封装",
|
|
5
|
+
"main": "packages/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"lib": "vue-cli-service build --target lib packages/index.js --name sh-chart --dest lib"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [
|
|
10
|
+
"sh-chart"
|
|
11
|
+
],
|
|
12
|
+
"author": "神秘的sh",
|
|
13
|
+
"license": "ISC",
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"babel-polyfill": "^6.26.0",
|
|
16
|
+
"core-js": "^3.8.3",
|
|
17
|
+
"echarts": "^5.4.0",
|
|
18
|
+
"sh-tools": "^1.2.0",
|
|
19
|
+
"vue": "^3.3.4"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@babel/core": "^7.12.16",
|
|
23
|
+
"@babel/eslint-parser": "^7.12.16",
|
|
24
|
+
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
|
|
25
|
+
"@vue/cli-plugin-babel": "~5.0.8",
|
|
26
|
+
"@vue/cli-plugin-eslint": "~5.0.8",
|
|
27
|
+
"@vue/cli-plugin-router": "~5.0.8",
|
|
28
|
+
"@vue/cli-plugin-vuex": "~5.0.8",
|
|
29
|
+
"@vue/cli-service": "~5.0.8",
|
|
30
|
+
"babel-loader": "^9.1.2",
|
|
31
|
+
"compression-webpack-plugin": "~6.1.1",
|
|
32
|
+
"eslint": "^7.32.0",
|
|
33
|
+
"eslint-config-prettier": "^8.3.0",
|
|
34
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
35
|
+
"eslint-plugin-vue": "^8.0.3",
|
|
36
|
+
"html-webpack-tags-plugin": "^3.0.2",
|
|
37
|
+
"node-polyfill-webpack-plugin": "^2.0.1",
|
|
38
|
+
"prettier": "^2.4.1",
|
|
39
|
+
"sass": "^1.32.7",
|
|
40
|
+
"sass-loader": "^12.0.0"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
let _interopRequireDefault = require('@babel/runtime/helpers/interopRequireDefault')
|
|
2
|
+
let _toConsumableArray2 = _interopRequireDefault(require('@babel/runtime/helpers/toConsumableArray'))
|
|
3
|
+
var _typeof2 = _interopRequireDefault(require('@babel/runtime/helpers/typeof'))
|
|
4
|
+
|
|
5
|
+
function debounce(delay, callback) {
|
|
6
|
+
let lastTime
|
|
7
|
+
return function () {
|
|
8
|
+
clearTimeout(lastTime)
|
|
9
|
+
const [that, args] = [this, arguments]
|
|
10
|
+
lastTime = setTimeout(() => {
|
|
11
|
+
callback.apply(that, args)
|
|
12
|
+
}, delay)
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function observerDomResize(dom, callback) {
|
|
17
|
+
const MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver
|
|
18
|
+
const observer = new MutationObserver(callback)
|
|
19
|
+
observer.observe(dom, { attributes: true, attributeFilter: ['style'], attributeOldValue: true })
|
|
20
|
+
return observer
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default {
|
|
24
|
+
data() {
|
|
25
|
+
return {
|
|
26
|
+
dom: '',
|
|
27
|
+
|
|
28
|
+
width: 0,
|
|
29
|
+
height: 0,
|
|
30
|
+
|
|
31
|
+
debounceInitWHFun: '',
|
|
32
|
+
|
|
33
|
+
domObserver: ''
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
methods: {
|
|
37
|
+
uuid(hasHyphen) {
|
|
38
|
+
return (hasHyphen ? 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx' : 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx').replace(/[xy]/g, function (c) {
|
|
39
|
+
const r = (Math.random() * 16) | 0
|
|
40
|
+
const v = c === 'x' ? r : (r & 0x3) | 0x8
|
|
41
|
+
return v.toString(16)
|
|
42
|
+
})
|
|
43
|
+
},
|
|
44
|
+
fade(color, percent) {
|
|
45
|
+
return this.$vUtils.fade(color, percent)
|
|
46
|
+
},
|
|
47
|
+
randomExtend(minNum, maxNum) {
|
|
48
|
+
if (arguments.length === 1) {
|
|
49
|
+
return parseInt(Math.random() * minNum + 1, 10)
|
|
50
|
+
} else {
|
|
51
|
+
return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10)
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
deepMerge(target, merged) {
|
|
55
|
+
for (var key in merged) {
|
|
56
|
+
if (target[key] && (0, _typeof2['default'])(target[key]) === 'object') {
|
|
57
|
+
this.deepMerge(target[key], merged[key])
|
|
58
|
+
continue
|
|
59
|
+
}
|
|
60
|
+
if ((0, _typeof2['default'])(merged[key]) === 'object') {
|
|
61
|
+
target[key] = (0, _util.deepClone)(merged[key], true)
|
|
62
|
+
continue
|
|
63
|
+
}
|
|
64
|
+
target[key] = merged[key]
|
|
65
|
+
}
|
|
66
|
+
return target
|
|
67
|
+
},
|
|
68
|
+
getCircleRadianPoint(x, y, radius, radian) {
|
|
69
|
+
return [x + cos(radian) * radius, y + sin(radian) * radius]
|
|
70
|
+
},
|
|
71
|
+
getTwoPointDistance(pointOne, pointTwo) {
|
|
72
|
+
let minusX = Math.abs(pointOne[0] - pointTwo[0])
|
|
73
|
+
let minusY = Math.abs(pointOne[1] - pointTwo[1])
|
|
74
|
+
return Math.sqrt(minusX * minusX + minusY * minusY)
|
|
75
|
+
},
|
|
76
|
+
getPolylineLength(points) {
|
|
77
|
+
let lineSegments = new Array(points.length - 1).fill(0).map(function (foo, i) {
|
|
78
|
+
return [points[i], points[i + 1]]
|
|
79
|
+
})
|
|
80
|
+
let lengths = lineSegments.map(function (item) {
|
|
81
|
+
return this.getTwoPointDistance.apply(void 0, (0, _toConsumableArray2['default'])(item))
|
|
82
|
+
})
|
|
83
|
+
return this.$vUtils.sum(lengths)
|
|
84
|
+
},
|
|
85
|
+
async autoResizeMixinInit() {
|
|
86
|
+
const { initWH, getDebounceInitWHFun, bindDomResizeCallback, afterAutoResizeMixinInit } = this
|
|
87
|
+
|
|
88
|
+
await initWH(false)
|
|
89
|
+
|
|
90
|
+
getDebounceInitWHFun()
|
|
91
|
+
|
|
92
|
+
bindDomResizeCallback()
|
|
93
|
+
|
|
94
|
+
if (typeof afterAutoResizeMixinInit === 'function') afterAutoResizeMixinInit()
|
|
95
|
+
},
|
|
96
|
+
initWH(resize = true) {
|
|
97
|
+
const { $nextTick, $refs, ref, onResize } = this
|
|
98
|
+
|
|
99
|
+
return new Promise(resolve => {
|
|
100
|
+
$nextTick(_ => {
|
|
101
|
+
const dom = (this.dom = $refs[ref])
|
|
102
|
+
|
|
103
|
+
this.width = dom ? dom.clientWidth : 0
|
|
104
|
+
this.height = dom ? dom.clientHeight : 0
|
|
105
|
+
|
|
106
|
+
if (!dom) {
|
|
107
|
+
console.warn('DataV: Failed to get dom node, component rendering may be abnormal!')
|
|
108
|
+
} else if (!this.width || !this.height) {
|
|
109
|
+
console.warn('DataV: Component width or height is 0px, rendering abnormality may occur!')
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (typeof onResize === 'function' && resize) onResize()
|
|
113
|
+
|
|
114
|
+
resolve()
|
|
115
|
+
})
|
|
116
|
+
})
|
|
117
|
+
},
|
|
118
|
+
getDebounceInitWHFun() {
|
|
119
|
+
const { initWH } = this
|
|
120
|
+
|
|
121
|
+
this.debounceInitWHFun = debounce(100, initWH)
|
|
122
|
+
},
|
|
123
|
+
bindDomResizeCallback() {
|
|
124
|
+
const { dom, debounceInitWHFun } = this
|
|
125
|
+
|
|
126
|
+
this.domObserver = observerDomResize(dom, debounceInitWHFun)
|
|
127
|
+
|
|
128
|
+
window.addEventListener('resize', debounceInitWHFun)
|
|
129
|
+
},
|
|
130
|
+
unbindDomResizeCallback() {
|
|
131
|
+
let { domObserver, debounceInitWHFun } = this
|
|
132
|
+
|
|
133
|
+
if (!domObserver) return
|
|
134
|
+
|
|
135
|
+
domObserver.disconnect()
|
|
136
|
+
domObserver.takeRecords()
|
|
137
|
+
domObserver = null
|
|
138
|
+
|
|
139
|
+
window.removeEventListener('resize', debounceInitWHFun)
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
mounted() {
|
|
143
|
+
const { autoResizeMixinInit } = this
|
|
144
|
+
|
|
145
|
+
autoResizeMixinInit()
|
|
146
|
+
},
|
|
147
|
+
beforeDestroy() {
|
|
148
|
+
const { unbindDomResizeCallback } = this
|
|
149
|
+
|
|
150
|
+
unbindDomResizeCallback()
|
|
151
|
+
}
|
|
152
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :ref="ref" class="sh-border-box-1">
|
|
3
|
+
<svg class="border" :width="width" :height="height">
|
|
4
|
+
<polygon
|
|
5
|
+
:fill="backgroundColor"
|
|
6
|
+
:points="`10, 27 10, ${height - 27} 13, ${height - 24} 13, ${height - 21} 24, ${height - 11}
|
|
7
|
+
38, ${height - 11} 41, ${height - 8} 73, ${height - 8} 75, ${height - 10} 81, ${height - 10}
|
|
8
|
+
85, ${height - 6} ${width - 85}, ${height - 6} ${width - 81}, ${height - 10} ${width - 75}, ${height - 10}
|
|
9
|
+
${width - 73}, ${height - 8} ${width - 41}, ${height - 8} ${width - 38}, ${height - 11}
|
|
10
|
+
${width - 24}, ${height - 11} ${width - 13}, ${height - 21} ${width - 13}, ${height - 24}
|
|
11
|
+
${width - 10}, ${height - 27} ${width - 10}, 27 ${width - 13}, 25 ${width - 13}, 21
|
|
12
|
+
${width - 24}, 11 ${width - 38}, 11 ${width - 41}, 8 ${width - 73}, 8 ${width - 75}, 10
|
|
13
|
+
${width - 81}, 10 ${width - 85}, 6 85, 6 81, 10 75, 10 73, 8 41, 8 38, 11 24, 11 13, 21 13, 24`" />
|
|
14
|
+
</svg>
|
|
15
|
+
|
|
16
|
+
<svg v-for="item in border" :key="item" width="150px" height="150px" :class="`${item} border`">
|
|
17
|
+
<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">
|
|
18
|
+
<animate attributeName="fill" :values="`${mergedColor[0]};${mergedColor[1]};${mergedColor[0]}`" dur="0.5s" begin="0s" repeatCount="indefinite" />
|
|
19
|
+
</polygon>
|
|
20
|
+
<polygon :fill="mergedColor[1]" points="27.599999999999998,4.8 38.4,4.8 35.4,7.8 30.599999999999998,7.8">
|
|
21
|
+
<animate attributeName="fill" :values="`${mergedColor[1]};${mergedColor[0]};${mergedColor[1]}`" dur="0.5s" begin="0s" repeatCount="indefinite" />
|
|
22
|
+
</polygon>
|
|
23
|
+
<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">
|
|
24
|
+
<animate attributeName="fill" :values="`${mergedColor[0]};${mergedColor[1]};transparent`" dur="1s" begin="0s" repeatCount="indefinite" />
|
|
25
|
+
</polygon>
|
|
26
|
+
</svg>
|
|
27
|
+
|
|
28
|
+
<div class="border-box-content">
|
|
29
|
+
<slot></slot>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script>
|
|
35
|
+
import mixin from '../mixin/border'
|
|
36
|
+
export default {
|
|
37
|
+
name: 'ShBorder1',
|
|
38
|
+
mixins: [mixin]
|
|
39
|
+
}
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<style scoped lang="scss">
|
|
43
|
+
.sh-border-box-1 {
|
|
44
|
+
position: relative;
|
|
45
|
+
width: 100%;
|
|
46
|
+
height: 100%;
|
|
47
|
+
.border {
|
|
48
|
+
position: absolute;
|
|
49
|
+
display: block;
|
|
50
|
+
&.right-top {
|
|
51
|
+
right: 0;
|
|
52
|
+
transform: rotateY(180deg);
|
|
53
|
+
}
|
|
54
|
+
&.left-bottom {
|
|
55
|
+
bottom: 0;
|
|
56
|
+
transform: rotateX(180deg);
|
|
57
|
+
}
|
|
58
|
+
&.right-bottom {
|
|
59
|
+
right: 0;
|
|
60
|
+
bottom: 0;
|
|
61
|
+
transform: rotateX(180deg) rotateY(180deg);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
.border-box-content {
|
|
65
|
+
position: relative;
|
|
66
|
+
width: 100%;
|
|
67
|
+
height: 100%;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
</style>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :ref="ref" class="sh-border-box-10">
|
|
3
|
+
<svg class="border-svg-container" :width="width" :height="height">
|
|
4
|
+
<polygon :fill="backgroundColor" :points="`4, 0 ${width - 4}, 0 ${width}, 4 ${width}, ${height - 4} ${width - 4}, ${height} 4, ${height} 0, ${height - 4} 0, 4`" />
|
|
5
|
+
</svg>
|
|
6
|
+
|
|
7
|
+
<svg v-for="item in border" :key="item" width="150px" height="150px" :class="`${item} border-svg-container`">
|
|
8
|
+
<polygon :fill="mergedColor[1]" points="40, 0 5, 0 0, 5 0, 16 3, 19 3, 7 7, 3 35, 3" />
|
|
9
|
+
</svg>
|
|
10
|
+
|
|
11
|
+
<div class="border-box-content">
|
|
12
|
+
<slot></slot>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
import mixin from '../mixin/border'
|
|
19
|
+
export default {
|
|
20
|
+
name: 'ShBorder10',
|
|
21
|
+
mixins: [mixin]
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<style scoped lang="scss">
|
|
26
|
+
.sh-border-box-10 {
|
|
27
|
+
position: relative;
|
|
28
|
+
width: 100%;
|
|
29
|
+
height: 100%;
|
|
30
|
+
border-radius: 6px;
|
|
31
|
+
.border-svg-container {
|
|
32
|
+
position: absolute;
|
|
33
|
+
display: block;
|
|
34
|
+
}
|
|
35
|
+
.right-top {
|
|
36
|
+
right: 0;
|
|
37
|
+
transform: rotateY(180deg);
|
|
38
|
+
}
|
|
39
|
+
.left-bottom {
|
|
40
|
+
bottom: 0;
|
|
41
|
+
transform: rotateX(180deg);
|
|
42
|
+
}
|
|
43
|
+
.right-bottom {
|
|
44
|
+
right: 0;
|
|
45
|
+
bottom: 0;
|
|
46
|
+
transform: rotateX(180deg) rotateY(180deg);
|
|
47
|
+
}
|
|
48
|
+
.border-box-content {
|
|
49
|
+
position: relative;
|
|
50
|
+
width: 100%;
|
|
51
|
+
height: 100%;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
</style>
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :ref="ref" class="sh-border-box-11">
|
|
3
|
+
<svg class="border-svg-container" :width="width" :height="height">
|
|
4
|
+
<defs>
|
|
5
|
+
<filter :id="filterId" height="150%" width="150%" x="-25%" y="-25%">
|
|
6
|
+
<feMorphology operator="dilate" radius="2" in="SourceAlpha" result="thicken" />
|
|
7
|
+
<feGaussianBlur in="thicken" stdDeviation="3" result="blurred" />
|
|
8
|
+
<feFlood :flood-color="mergedColor[1]" result="glowColor" />
|
|
9
|
+
<feComposite in="glowColor" in2="blurred" operator="in" result="softGlowColored" />
|
|
10
|
+
<feMerge>
|
|
11
|
+
<feMergeNode in="softGlowColored" />
|
|
12
|
+
<feMergeNode in="SourceGraphic" />
|
|
13
|
+
</feMerge>
|
|
14
|
+
</filter>
|
|
15
|
+
</defs>
|
|
16
|
+
|
|
17
|
+
<polygon
|
|
18
|
+
:fill="backgroundColor"
|
|
19
|
+
:points="`
|
|
20
|
+
20, 32 ${width * 0.5 - titleWidth / 2}, 32 ${width * 0.5 - titleWidth / 2 + 20}, 53
|
|
21
|
+
${width * 0.5 + titleWidth / 2 - 20}, 53 ${width * 0.5 + titleWidth / 2}, 32
|
|
22
|
+
${width - 20}, 32 ${width - 8}, 48 ${width - 8}, ${height - 25} ${width - 20}, ${height - 8}
|
|
23
|
+
20, ${height - 8} 8, ${height - 25} 8, 50
|
|
24
|
+
`" />
|
|
25
|
+
|
|
26
|
+
<polyline
|
|
27
|
+
:stroke="mergedColor[0]"
|
|
28
|
+
:filter="`url(#${filterId})`"
|
|
29
|
+
:points="`
|
|
30
|
+
${(width - titleWidth) / 2}, 30
|
|
31
|
+
20, 30 7, 50 7, ${50 + (height - 167) / 2}
|
|
32
|
+
13, ${55 + (height - 167) / 2} 13, ${135 + (height - 167) / 2}
|
|
33
|
+
7, ${140 + (height - 167) / 2} 7, ${height - 27}
|
|
34
|
+
20, ${height - 7} ${width - 20}, ${height - 7} ${width - 7}, ${height - 27}
|
|
35
|
+
${width - 7}, ${140 + (height - 167) / 2} ${width - 13}, ${135 + (height - 167) / 2}
|
|
36
|
+
${width - 13}, ${55 + (height - 167) / 2} ${width - 7}, ${50 + (height - 167) / 2}
|
|
37
|
+
${width - 7}, 50 ${width - 20}, 30 ${(width + titleWidth) / 2}, 30
|
|
38
|
+
${(width + titleWidth) / 2 - 20}, 7 ${(width - titleWidth) / 2 + 20}, 7
|
|
39
|
+
${(width - titleWidth) / 2}, 30 ${(width - titleWidth) / 2 + 20}, 52
|
|
40
|
+
${(width + titleWidth) / 2 - 20}, 52 ${(width + titleWidth) / 2}, 30
|
|
41
|
+
`" />
|
|
42
|
+
|
|
43
|
+
<polygon
|
|
44
|
+
:stroke="mergedColor[0]"
|
|
45
|
+
fill="transparent"
|
|
46
|
+
:points="`
|
|
47
|
+
${(width + titleWidth) / 2 - 5}, 30 ${(width + titleWidth) / 2 - 21}, 11
|
|
48
|
+
${(width + titleWidth) / 2 - 27}, 11 ${(width + titleWidth) / 2 - 8}, 34
|
|
49
|
+
`" />
|
|
50
|
+
|
|
51
|
+
<polygon
|
|
52
|
+
:stroke="mergedColor[0]"
|
|
53
|
+
fill="transparent"
|
|
54
|
+
:points="`
|
|
55
|
+
${(width - titleWidth) / 2 + 5}, 30 ${(width - titleWidth) / 2 + 22}, 49
|
|
56
|
+
${(width - titleWidth) / 2 + 28}, 49 ${(width - titleWidth) / 2 + 8}, 26
|
|
57
|
+
`" />
|
|
58
|
+
|
|
59
|
+
<polygon
|
|
60
|
+
:stroke="mergedColor[0]"
|
|
61
|
+
:fill="fade(mergedColor[1] || defaultColor[1], 30)"
|
|
62
|
+
:filter="`url(#${filterId})`"
|
|
63
|
+
:points="`
|
|
64
|
+
${(width + titleWidth) / 2 - 11}, 37 ${(width + titleWidth) / 2 - 32}, 11
|
|
65
|
+
${(width - titleWidth) / 2 + 23}, 11 ${(width - titleWidth) / 2 + 11}, 23
|
|
66
|
+
${(width - titleWidth) / 2 + 33}, 49 ${(width + titleWidth) / 2 - 22}, 49
|
|
67
|
+
`" />
|
|
68
|
+
|
|
69
|
+
<polygon
|
|
70
|
+
:filter="`url(#${filterId})`"
|
|
71
|
+
:fill="mergedColor[0]"
|
|
72
|
+
opacity="1"
|
|
73
|
+
:points="`
|
|
74
|
+
${(width - titleWidth) / 2 - 10}, 37 ${(width - titleWidth) / 2 - 31}, 37
|
|
75
|
+
${(width - titleWidth) / 2 - 25}, 46 ${(width - titleWidth) / 2 - 4}, 46
|
|
76
|
+
`">
|
|
77
|
+
<animate attributeName="opacity" values="1;0.7;1" dur="2s" begin="0s" repeatCount="indefinite" />
|
|
78
|
+
</polygon>
|
|
79
|
+
|
|
80
|
+
<polygon
|
|
81
|
+
:filter="`url(#${filterId})`"
|
|
82
|
+
:fill="mergedColor[0]"
|
|
83
|
+
opacity="0.7"
|
|
84
|
+
:points="`
|
|
85
|
+
${(width - titleWidth) / 2 - 40}, 37 ${(width - titleWidth) / 2 - 61}, 37
|
|
86
|
+
${(width - titleWidth) / 2 - 55}, 46 ${(width - titleWidth) / 2 - 34}, 46
|
|
87
|
+
`">
|
|
88
|
+
<animate attributeName="opacity" values="0.7;0.4;0.7" dur="2s" begin="0s" repeatCount="indefinite" />
|
|
89
|
+
</polygon>
|
|
90
|
+
|
|
91
|
+
<polygon
|
|
92
|
+
:filter="`url(#${filterId})`"
|
|
93
|
+
:fill="mergedColor[0]"
|
|
94
|
+
opacity="0.5"
|
|
95
|
+
:points="`
|
|
96
|
+
${(width - titleWidth) / 2 - 70}, 37 ${(width - titleWidth) / 2 - 91}, 37
|
|
97
|
+
${(width - titleWidth) / 2 - 85}, 46 ${(width - titleWidth) / 2 - 64}, 46
|
|
98
|
+
`">
|
|
99
|
+
<animate attributeName="opacity" values="0.5;0.2;0.5" dur="2s" begin="0s" repeatCount="indefinite" />
|
|
100
|
+
</polygon>
|
|
101
|
+
|
|
102
|
+
<polygon
|
|
103
|
+
:filter="`url(#${filterId})`"
|
|
104
|
+
:fill="mergedColor[0]"
|
|
105
|
+
opacity="1"
|
|
106
|
+
:points="`
|
|
107
|
+
${(width + titleWidth) / 2 + 30}, 37 ${(width + titleWidth) / 2 + 9}, 37
|
|
108
|
+
${(width + titleWidth) / 2 + 3}, 46 ${(width + titleWidth) / 2 + 24}, 46
|
|
109
|
+
`">
|
|
110
|
+
<animate attributeName="opacity" values="1;0.7;1" dur="2s" begin="0s" repeatCount="indefinite" />
|
|
111
|
+
</polygon>
|
|
112
|
+
|
|
113
|
+
<polygon
|
|
114
|
+
:filter="`url(#${filterId})`"
|
|
115
|
+
:fill="mergedColor[0]"
|
|
116
|
+
opacity="0.7"
|
|
117
|
+
:points="`
|
|
118
|
+
${(width + titleWidth) / 2 + 60}, 37 ${(width + titleWidth) / 2 + 39}, 37
|
|
119
|
+
${(width + titleWidth) / 2 + 33}, 46 ${(width + titleWidth) / 2 + 54}, 46
|
|
120
|
+
`">
|
|
121
|
+
<animate attributeName="opacity" values="0.7;0.4;0.7" dur="2s" begin="0s" repeatCount="indefinite" />
|
|
122
|
+
</polygon>
|
|
123
|
+
|
|
124
|
+
<polygon
|
|
125
|
+
:filter="`url(#${filterId})`"
|
|
126
|
+
:fill="mergedColor[0]"
|
|
127
|
+
opacity="0.5"
|
|
128
|
+
:points="`
|
|
129
|
+
${(width + titleWidth) / 2 + 90}, 37 ${(width + titleWidth) / 2 + 69}, 37
|
|
130
|
+
${(width + titleWidth) / 2 + 63}, 46 ${(width + titleWidth) / 2 + 84}, 46
|
|
131
|
+
`">
|
|
132
|
+
<animate attributeName="opacity" values="0.5;0.2;0.5" dur="2s" begin="0s" repeatCount="indefinite" />
|
|
133
|
+
</polygon>
|
|
134
|
+
|
|
135
|
+
<text class="border-box-11-title" :x="`${width / 2}`" y="32" fill="#fff" font-size="18" text-anchor="middle" dominant-baseline="middle">
|
|
136
|
+
{{ title }}
|
|
137
|
+
</text>
|
|
138
|
+
|
|
139
|
+
<polygon
|
|
140
|
+
:fill="mergedColor[0]"
|
|
141
|
+
:filter="`url(#${filterId})`"
|
|
142
|
+
:points="`
|
|
143
|
+
7, ${53 + (height - 167) / 2} 11, ${57 + (height - 167) / 2}
|
|
144
|
+
11, ${133 + (height - 167) / 2} 7, ${137 + (height - 167) / 2}
|
|
145
|
+
`" />
|
|
146
|
+
|
|
147
|
+
<polygon
|
|
148
|
+
:fill="mergedColor[0]"
|
|
149
|
+
:filter="`url(#${filterId})`"
|
|
150
|
+
:points="`
|
|
151
|
+
${width - 7}, ${53 + (height - 167) / 2} ${width - 11}, ${57 + (height - 167) / 2}
|
|
152
|
+
${width - 11}, ${133 + (height - 167) / 2} ${width - 7}, ${137 + (height - 167) / 2}
|
|
153
|
+
`" />
|
|
154
|
+
</svg>
|
|
155
|
+
|
|
156
|
+
<div class="border-box-content">
|
|
157
|
+
<slot></slot>
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
160
|
+
</template>
|
|
161
|
+
|
|
162
|
+
<script>
|
|
163
|
+
import mixin from '../mixin/border'
|
|
164
|
+
export default {
|
|
165
|
+
name: 'ShBorder11',
|
|
166
|
+
mixins: [mixin],
|
|
167
|
+
props: {
|
|
168
|
+
titleWidth: {
|
|
169
|
+
type: Number,
|
|
170
|
+
default: 250
|
|
171
|
+
},
|
|
172
|
+
title: {
|
|
173
|
+
type: String,
|
|
174
|
+
default: ''
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
computed: {
|
|
178
|
+
filterId() {
|
|
179
|
+
return `border-box-11-filterId-${this.borderId}`
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
</script>
|
|
184
|
+
|
|
185
|
+
<style scoped lang="scss">
|
|
186
|
+
.sh-border-box-11 {
|
|
187
|
+
position: relative;
|
|
188
|
+
width: 100%;
|
|
189
|
+
height: 100%;
|
|
190
|
+
.border-svg-container {
|
|
191
|
+
position: absolute;
|
|
192
|
+
width: 100%;
|
|
193
|
+
height: 100%;
|
|
194
|
+
top: 0;
|
|
195
|
+
left: 0;
|
|
196
|
+
& > polyline {
|
|
197
|
+
fill: none;
|
|
198
|
+
stroke-width: 1;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
.border-box-content {
|
|
202
|
+
position: relative;
|
|
203
|
+
width: 100%;
|
|
204
|
+
height: 100%;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
</style>
|