From bdaf2c8c1bedefc1f5b88518301560dc9c0799ac Mon Sep 17 00:00:00 2001 From: youzi <2410633923@qq.com> Date: Tue, 24 Dec 2024 09:48:07 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=91=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 +- src/api/mix/index.js | 7 + src/views/widget/component/gold.js | 147 ++ src/views/widget/component/gold.vue | 74 + src/views/widget/index.vue | 63 +- vite.config.js | 1 + yarn.lock | 2153 +++++++++++++-------------- 7 files changed, 1279 insertions(+), 1169 deletions(-) create mode 100644 src/views/widget/component/gold.js create mode 100644 src/views/widget/component/gold.vue diff --git a/package.json b/package.json index ca91f39..1748762 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "module": "dist/index.esm.js", "unpkg": "dist/index.umd.js", "types": "dist/index.d.ts", - "packageManager":"yarn@1.22.22", + "packageManager": "yarn@1.22.22", "files": [ "dist" ], @@ -34,6 +34,7 @@ "browserslist": "^4.24.2", "chinese-workday": "^1.10.0", "colorofchina": "^1.0.6", + "echarts": "^5.5.1", "gsap": "^3.12.2", "less": "^4.1.3", "naive-ui": "^2.40.1", diff --git a/src/api/mix/index.js b/src/api/mix/index.js index 59d1114..361d8d9 100644 --- a/src/api/mix/index.js +++ b/src/api/mix/index.js @@ -50,3 +50,10 @@ export function hydict(params) { params:{word:params} }); } +// goldPrice +export function goldPrice() { + return request({ + url: '/why/gold', + method: 'get', + }) +} \ No newline at end of file diff --git a/src/views/widget/component/gold.js b/src/views/widget/component/gold.js new file mode 100644 index 0000000..92084cc --- /dev/null +++ b/src/views/widget/component/gold.js @@ -0,0 +1,147 @@ + +export function goldOp(x, y) { + console.log(x, y); + + let option = { + // backgroundColor: '#0e202d', + "title": { + show: false, + }, + "grid": { + "top": 50, + "bottom": 60 + }, + "tooltip": {}, + "xAxis": { + "data": x, + "axisTick": { + "show": false + }, + "axisLine": { + "show": false + }, + "axisLabel": { + interval: 0, + textStyle: { + color: '#beceff', + fontSize: 13, + }, + margin: 30, //刻度标签与轴线之间的距离。 + } + }, + "yAxis": { + "splitLine": { + "show": false + }, + "axisTick": { + "show": false + }, + "axisLine": { + "show": false + }, + "axisLabel": { + "show": false + } + }, + "series": [ + { + + "type": "bar", + // "silent": true, + "barWidth": 20, + "barGap": "-100%", + "label": { + "normal": { + "show": true, + "position": "top", + "distance": 20, + "textStyle": { + "color": "#b9b7ff", //柱子对应数值颜色 + "fontSize": 18, + } + } + }, + "itemStyle": { + "normal": { + "color": { + "x": 0, + "y": 0, + "x2": 0, + "y2": 1, + "type": "linear", + "global": false, + "colorStops": [{ + "offset": 0, + "color": "rgba(185,183,255,0.5)" + }, { + "offset": 1, + "color": "#e9a5ff" //底部渐变颜色 + }] + } + } + }, + data: y + }, + { + "name": "", + "type": "pictorialBar", + "symbolSize": [20, 10], + "symbolOffset": [0, -5], + "z": 12, + "symbolPosition": "end", + "itemStyle": { + "normal": { + "color": "#b9b7ff" //圆柱顶部颜色 + } + }, + data: y + }, + { + "name": "", + "type": "pictorialBar", + "symbolSize": [20, 10], + "symbolOffset": [0, 5], + "z": 12, + "itemStyle": { + "normal": { + "color": "#e9a5ff" //圆柱底部颜色 + } + }, + data: y + }, + { + "name": "", + "type": "pictorialBar", + "symbolSize": [30, 15], + "symbolOffset": [0, 10], + "z": 11, + "itemStyle": { + "normal": { + "color": "transparent", + "borderColor": "#e9a5ff", //底部内圆圈颜色 + "borderWidth": 5 + } + }, + data: y + }, + { + "name": "", + "type": "pictorialBar", + "symbolSize": [60, 30], + "symbolOffset": [0, 18], + "z": 10, + "itemStyle": { + "normal": { + "color": "transparent", + "borderColor": "#e9a5ff", //底部外圆圈颜色 + "borderType": "dashed", + "borderWidth": 5 + } + }, + data: y + }, + + ] + } + return option +} \ No newline at end of file diff --git a/src/views/widget/component/gold.vue b/src/views/widget/component/gold.vue new file mode 100644 index 0000000..6bceaf3 --- /dev/null +++ b/src/views/widget/component/gold.vue @@ -0,0 +1,74 @@ + + + + + \ No newline at end of file diff --git a/src/views/widget/index.vue b/src/views/widget/index.vue index e3afde3..4925f4c 100644 --- a/src/views/widget/index.vue +++ b/src/views/widget/index.vue @@ -5,7 +5,8 @@
小工具
- + @@ -29,37 +30,41 @@