Compare commits

...

337 Commits

Author SHA1 Message Date
奔跑的面条
2386687f2e build: 升级版本到 2.2.0 2023-03-16 21:00:13 +08:00
奔跑的面条
f0f9905583 Merge branch 'master-fetch-dev' into master-fetch 2023-03-16 20:59:37 +08:00
奔跑的面条
8d57af2dab fix: 处理联动的合并问题 2023-03-16 20:25:31 +08:00
奔跑的面条
98b1380d0d Merge branch 'dev' into master-fetch-dev 2023-03-16 20:02:18 +08:00
奔跑的面条
f51a6a8a46 !142 消除编辑时provide警告
Merge pull request !142 from xiangmaoshuo/feat/canvas
2023-03-16 11:33:27 +00:00
xiangmaoshuo
f6afbcfe5a fix: 消除编辑时provide警告 2023-03-16 18:13:48 +08:00
奔跑的面条
e821556400 style: 去除多余代码 2023-03-16 17:26:36 +08:00
奔跑的面条
a27110df34 perf: 去除多余依赖 2023-03-16 16:55:27 +08:00
奔跑的面条
72ec2e37a1 !138 fix: 修正添加query参数的时候ID获取异常,使用前置守卫把外部动态参数放入window.route.params,后续API动态接口可以拼接参数
Merge pull request !138 from guo_ddt/dev
2023-03-16 07:14:46 +00:00
奔跑的面条
2799463d53 !139 fix: 解决预览时模糊问题
Merge pull request !139 from xiangmaoshuo/feat/canvas
2023-03-16 07:12:46 +00:00
奔跑的面条
ebd08bc3a4 feat: 新增 tab 组件 2023-03-16 14:06:00 +08:00
奔跑的面条
cfb8b038ce feat: 新增选择器 2023-03-16 11:51:45 +08:00
奔跑的面条
1130deab48 feat: 修改时间组件为静态组件 2023-03-16 10:18:37 +08:00
奔跑的面条
f3bfdeaccd perf: 优化缩放交互 2023-03-15 20:58:09 +08:00
奔跑的面条
8f0f9ea334 perf: 优化时间选择器 2023-03-15 20:21:10 +08:00
奔跑的面条
34b4eb77ba fix: 修改图片引入错误的bug 2023-03-14 22:21:11 +08:00
奔跑的面条
40453c51bb perf: 优化交互结构,优化时间选择器组件 2023-03-14 22:19:55 +08:00
奔跑的面条
63db4f8c87 chore: 移动控件分类 2023-03-11 22:11:57 +08:00
奔跑的面条
b2594d2f66 perf: 优化联动交互 2023-03-11 22:03:35 +08:00
奔跑的面条
4edc639cf8 feat: 补充组件类型 2023-03-11 22:03:13 +08:00
奔跑的面条
35dd70ef08 perf: 优化页面交互 2023-03-11 20:40:02 +08:00
limingzhang
c2e733aaaa fix: 空间交互失效 2023-03-11 20:21:08 +08:00
奔跑的面条
0db6976e4a perf: 优化组件图片 2023-03-11 20:21:08 +08:00
奔跑的面条
05bb2a5eb6 feat: 优化交互组件 2023-03-11 20:21:08 +08:00
limingz
3f3f54f3b7 feat: 控件加入Header 参数控制 2023-03-11 20:21:08 +08:00
Min
35664e7e3d docs: 日期控件配置 2023-03-11 20:21:08 +08:00
Min
495d93a835 feat: 控件与组件交互 2023-03-11 20:21:08 +08:00
Min
26116685e1 feat: icon 增加RowDelete 2023-03-11 20:21:08 +08:00
Min
eccb39acad feat: 预览采用pinia驱动 2023-03-11 20:21:08 +08:00
Min
ccd5b8f0d0 feat:扩展eventsFn 事件 2023-03-11 20:21:07 +08:00
Min
aafa8bd8c3 feat: 加入时间筛选控件 2023-03-11 20:21:07 +08:00
Min
59502e4be5 build: 添加dayjs 2023-03-11 20:21:07 +08:00
xiangmaoshuo
c5532f46bb fix: 解决预览时模糊问题 2023-03-10 09:13:46 +08:00
郭孔泉
fec03fe3fd fix: 修正添加query参数的时候ID获取异常,使用前置守卫把外部动态参数放入window.route.params,后续API动态接口可以拼接参数
http://localhost:3000/#/chart/preview/792622755697790976?t=123
动态请求参数中使用javascript: return window.route?.params?.t
2023-03-09 16:18:32 +08:00
奔跑的面条
a448bb678b Merge branch 'master-fetch-dev' into master-fetch 2023-03-04 17:32:50 +08:00
奔跑的面条
ca580db132 Merge branch 'dev' into master-fetch-dev 2023-03-04 17:32:27 +08:00
奔跑的面条
dbd33cd676 perf: 优化顶部展示 2023-03-04 17:31:49 +08:00
奔跑的面条
b248f73a88 Merge branch 'master-fetch-dev' into master-fetch 2023-03-04 17:07:17 +08:00
奔跑的面条
8bff2f9b12 Merge branch 'dev' into master-fetch-dev 2023-03-04 17:06:51 +08:00
奔跑的面条
19a382afe5 perf: 优化轮播组件 2023-03-04 17:05:07 +08:00
奔跑的面条
02fe552d1b !131 feat: 新增轮播图组件
Merge pull request !131 from Ryker/dev
2023-03-04 17:02:56 +08:00
奔跑的面条
aa1b11d9f0 Merge branch 'master-fetch-dev' into master-fetch 2023-03-04 16:25:17 +08:00
奔跑的面条
d5fb0b54de build: 升级版本到 2.1.9 2023-03-04 16:24:57 +08:00
奔跑的面条
3d88a39a02 Merge branch 'master-fetch-dev' into master-fetch 2023-03-04 16:22:02 +08:00
奔跑的面条
a626f64e57 !133 解决adcode类型不正确可能导致的问题
Merge pull request !133 from wallellen/master-fetch-dev
2023-03-04 16:18:08 +08:00
奔跑的面条
873c6fef53 !133 解决adcode类型不正确可能导致的问题
Merge pull request !133 from wallellen/master-fetch-dev
2023-03-04 16:10:45 +08:00
奔跑的面条
b2f53a7123 !133 解决adcode类型不正确可能导致的问题
Merge pull request !133 from wallellen/master-fetch-dev
2023-03-04 08:01:54 +00:00
奔跑的面条
2a850e4249 Merge branch 'dev' into master-fetch-dev 2023-03-04 14:42:56 +08:00
奔跑的面条
00a4c752ed perf: 优化 JSONParse 过滤函数值表达式写法 2023-03-04 14:18:17 +08:00
wallellen
0b89aeca82 update src/packages/components/Charts/Maps/MapBase/index.vue.
解决https://gitee.com/dromara/go-view/issues/I6E0JS问题

Signed-off-by: wallellen <wallellen@hotmail.com>
2023-03-04 05:59:26 +00:00
奔跑的面条
134b44944e !132 fix: 动态请求中,body的json参数使用javasctipt
Merge pull request !132 from guo_ddt/master-fetch
2023-03-04 13:49:35 +08:00
奔跑的面条
126c7ce5d2 !132 fix: 动态请求中,body的json参数使用javasctipt
Merge pull request !132 from guo_ddt/master-fetch
2023-03-04 13:47:02 +08:00
奔跑的面条
e2ba151794 !132 fix: 动态请求中,body的json参数使用javasctipt
Merge pull request !132 from guo_ddt/master-fetch
2023-03-04 05:46:01 +00:00
奔跑的面条
1eb0485a86 perf: 优化编辑 JSON 交互功能 2023-03-03 22:25:36 +08:00
郭孔泉
92dcd7fecd fix: 动态请求中,body的json参数使用javasctipt拼接 2023-03-03 11:03:05 +08:00
奔跑的面条
e841d3db17 Merge branch 'master-fetch-dev' into master-fetch 2023-02-27 19:04:38 +08:00
奔跑的面条
800a0141a5 build: 升级版本到2.1.8 2023-02-27 19:04:05 +08:00
奔跑的面条
c92d7cab97 Merge branch 'dev' into master-fetch-dev 2023-02-27 13:07:05 +08:00
奔跑的面条
dc458ea88e fix: 解决删除颜色之后自动选择的错误 2023-02-27 13:06:27 +08:00
奔跑的面条
86de4e105e Merge branch 'dev' into master-fetch-dev 2023-02-27 12:53:44 +08:00
奔跑的面条
6f4e967b49 perf: 优化自定义颜色组件交互 2023-02-27 12:46:36 +08:00
奔跑的面条
62a2ed2b4a feat: 新增颜色自定义功能 2023-02-27 00:29:47 +08:00
奔跑的面条
97899f275a perf: 优化自定义颜色交互 2023-02-27 00:24:19 +08:00
奔跑的面条
8b6c616a15 perf: 处理渐变色和自定义色的交互 2023-02-26 23:34:40 +08:00
奔跑的面条
87386e69a3 feat: 对接全局颜色和自定义组件交互 2023-02-26 18:36:15 +08:00
奔跑的面条
196df94aee perf: 优化颜色组件展示 2023-02-26 13:08:22 +08:00
奔跑的面条
a407d118fa perf: 优化 UI 控件交互 2023-02-26 01:43:46 +08:00
奔跑的面条
0fc7bde348 perf: 优化数据 2023-02-25 23:44:03 +08:00
奔跑的面条
9a8899ae40 feat: 优化颜色选择器页面 2023-02-25 22:28:09 +08:00
奔跑的面条
8cb711b892 feat: 新增自定义颜色弹窗 2023-02-25 22:00:55 +08:00
奔跑的面条
49d8c35747 perf: 优化主题颜色UI 2023-02-24 21:42:27 +08:00
奔跑的面条
125856677a fix: 处理 deep 失效的问题 2023-02-24 21:34:15 +08:00
奔跑的面条
e8e05033cd Merge branch 'master-fetch-dev' into master-fetch 2023-02-17 18:15:50 +08:00
奔跑的面条
3790bc0207 Merge branch 'dev' into master-fetch-dev 2023-02-17 18:15:35 +08:00
奔跑的面条
b3bff2ee45 fix: 解决顶层无法写 await 的问题 2023-02-17 18:15:00 +08:00
奔跑的面条
8c4e3e8965 Merge branch 'master-fetch-dev' into master-fetch 2023-02-17 14:34:28 +08:00
奔跑的面条
b03107d8cb build: 升级带后端版本到2.1.7 2023-02-17 14:33:53 +08:00
奔跑的面条
e9a4ebe38f Merge branch 'master-fetch-dev' into master-fetch 2023-02-17 14:33:18 +08:00
奔跑的面条
a702decfd4 Merge branch 'dev' into master-fetch-dev 2023-02-15 14:26:56 +08:00
奔跑的面条
fc58df2148 feat: 新增 public 预览配置项preview 2023-02-15 14:24:56 +08:00
奔跑的面条
0eecc1e19d Merge branch 'dev' into master-fetch-dev 2023-02-15 09:45:37 +08:00
奔跑的面条
4f2609a121 perf: 优化内存泄漏问题 2023-02-15 09:20:48 +08:00
奔跑的面条
f21c9f1246 perf: 优化 iframe 组件默认宽度 2023-02-14 21:12:30 +08:00
奔跑的面条
182b2c508a Merge branch 'dev' into master-fetch-dev 2023-02-09 16:24:19 +08:00
奔跑的面条
d7aa41094b perf: 优化过滤器体验,提示错误内容 2023-02-09 11:29:23 +08:00
奔跑的面条
4ec1bbd912 fix: 解决预览序列化遗漏替换的位置 2023-02-08 16:38:38 +08:00
奔跑的面条
a7b98fe3d6 feat: 新增初始化函数,全局异步错误捕获功能 2023-02-02 20:54:02 +08:00
奔跑的面条
bc02950a6f !126 工作空间初始化,右侧页面配置内容被挤出
Merge pull request !126 from 且听风吟720/N/A
2023-02-02 09:45:29 +00:00
且听风吟720
4e5c921bf2 fix: 工作空间初始化,右侧页面配置内容被挤出
Signed-off-by: 且听风吟720 <shige720@qq.com>
2023-02-02 09:34:50 +00:00
奔跑的面条
14c5d935c4 !125 轮播列表配置界面增加轮播方式配置项
Merge pull request !125 from alucardpj/dev
2023-02-02 08:52:08 +00:00
pengjian
b73893a6af 轮播列表配置界面增加轮播方式配置项 2023-02-02 10:00:30 +08:00
奔跑的面条
2907d1b514 Merge branch 'master-fetch-dev' into master-fetch 2023-01-17 15:35:40 +08:00
奔跑的面条
7bda46021a feat: 合并修复序列化代码,解决冲突 2023-01-17 15:34:10 +08:00
奔跑的面条
923b7759f8 fix: 排除反序列化函数的问题,规范事件类型代码 2023-01-17 15:31:16 +08:00
奔跑的面条
6d91262faa feat: 合并dev 2023-01-17 14:49:49 +08:00
奔跑的面条
c7988f2d83 fix: 处理序列化导致时间错误的问题 2023-01-17 14:45:13 +08:00
奔跑的面条
0111f42803 perf: 优化mock数据,优化接口强制性格式 2023-01-17 14:31:42 +08:00
奔跑的面条
1672978730 Merge branch 'master-fetch-dev' into master-fetch 2023-01-16 17:59:40 +08:00
奔跑的面条
36a6bb4214 Merge branch 'dev' into master-fetch-dev 2023-01-16 17:58:29 +08:00
奔跑的面条
ad72070af1 fix: 解决切换组件图片不会变动的问题 2023-01-16 17:58:07 +08:00
奔跑的面条
14b37d82d0 Merge branch 'dev' into master-fetch-dev 2023-01-16 13:51:54 +08:00
奔跑的面条
8824d636f4 fix: 修复反序列化无法处理es6简写函数的问题 2023-01-16 12:45:47 +08:00
奔跑的面条
4300b1f617 Merge remote-tracking branch 'origin/dev' into master-fetch-dev 2023-01-16 10:22:13 +08:00
奔跑的面条
8e28c524b3 fix: 处理搜索结果无法展示图片的问题 2023-01-16 10:02:26 +08:00
奔跑的面条
de4bd655ed build: 升级版本到 2.1.6 2023-01-13 16:53:12 +08:00
奔跑的面条
0434c779cd Merge branch 'master-fetch-dev' into master-fetch 2023-01-13 16:52:43 +08:00
奔跑的面条
aa0578776c Merge remote-tracking branch 'origin/dev' into master-fetch-dev 2023-01-13 16:52:28 +08:00
CarnivalO
5dd39926f8 update src/packages/components/Decorates/Three/ThreeEarth01/index.vue.
Edge浏览器不行 Edg应该也是<-1

Signed-off-by: CarnivalO <xmwjn@qq.com>
2023-01-13 16:51:06 +08:00
奔跑的面条
3bd8cbe535 Merge branch 'dev' into master-fetch-dev 2023-01-13 16:15:09 +08:00
奔跑的面条
cbf541282a fix: 处理本地存储序列化的问题 2023-01-13 16:14:42 +08:00
奔跑的面条
279f414db0 perf: 调换导入导出的 logo 2023-01-13 15:54:41 +08:00
奔跑的面条
c81aff2c57 fix: 处理 ts 报错 2023-01-09 20:20:19 +08:00
奔跑的面条
59eaed5b09 feat: 合并标题名称功能, 解决冲突 2023-01-09 20:18:27 +08:00
奔跑的面条
9aff88c678 feat: 新增tab名称跟随项目名称 2023-01-09 20:13:58 +08:00
奔跑的面条
5d0c6f4487 Merge branch 'dev' into master-fetch-dev 2023-01-09 19:32:54 +08:00
奔跑的面条
f82cde2faf fix: 处理组件图片路径会报错的问题 2023-01-09 19:32:09 +08:00
奔跑的面条
c903b607df fix: 优化 JSON 序列化无法处理函数的问题 2023-01-09 11:37:57 +08:00
奔跑的面条
ec5bed5b13 feat: 合并dev 2023-01-09 11:31:54 +08:00
奔跑的面条
462a613bd3 perf: 优化 JSON 序列化无法处理函数的问题 2023-01-09 11:25:03 +08:00
奔跑的面条
5e0baa4923 style: 修改默认提供的颜色 2023-01-09 11:12:18 +08:00
奔跑的面条
ec97340c25 build: 升级版本 2.1.5 2023-01-08 20:08:37 +08:00
奔跑的面条
7bbf285e8e build: 升级版本到 2.1.5 2023-01-08 20:06:11 +08:00
奔跑的面条
d652b06137 feat: 合并 dev 分支功能 2023-01-08 20:01:49 +08:00
奔跑的面条
d46a0b5134 build: 升级 pnpm 依赖说明文件 2023-01-08 19:23:02 +08:00
奔跑的面条
45cadcecc3 fix: 处理 model 报错 2023-01-08 19:20:44 +08:00
奔跑的面条
7b262c9db2 fix: 处理 i18n 报错和 props 报错 2023-01-08 19:10:41 +08:00
奔跑的面条
4e091c7f49 !121 修改胶囊柱图mock数据,解决胶囊主图labe不变化bug
Merge pull request !121 from daidai/dev
2023-01-08 09:13:15 +00:00
刘嘉威
1310234803 fix: 修改胶囊柱图mock数据,解决胶囊主图labe不变化bug 2023-01-03 16:59:04 +08:00
奔跑的面条
e55e63bca1 Merge remote-tracking branch 'origin/master-fetch-dev' into master-fetch 2022-12-31 21:26:42 +08:00
奔跑的面条
9b47d353c0 build: 新增提醒 2022-12-31 21:26:18 +08:00
奔跑的面条
c3f9a470fc feat: 合并 2.1.4 2022-12-31 21:07:51 +08:00
奔跑的面条
bd2557f3e4 build: 修改版本号到2.1.3 2022-12-31 20:56:55 +08:00
奔跑的面条
730099efb9 build: 升级2.1.2 2022-12-31 20:55:12 +08:00
奔跑的面条
3c1b741c37 fix: 处理创建分组后,预览不显示的bug 2022-12-31 20:50:08 +08:00
奔跑的面条
36fdc22634 style: 格式化文件 2022-12-31 20:33:21 +08:00
奔跑的面条
5261a09381 !120 胶囊柱图展示数据不刷新
Merge pull request !120 from daidai/dev
2022-12-31 12:18:50 +00:00
刘嘉威
25864dc3b6 fix: 胶囊柱图预览时数据更新页面不更新bug 2022-12-26 17:37:29 +08:00
奔跑的面条
09c2ec06d4 fix: 补充丢失的flow文件 2022-12-22 19:43:24 +08:00
奔跑的面条
2378be571d build: 限制node版本 2022-12-22 14:51:51 +08:00
奔跑的面条
59fd7ebceb perf: 优化框选功能 2022-12-22 01:31:42 +08:00
奔跑的面条
e0d99a6b28 perf: 优化缩放时辅助线的渲染 2022-12-22 01:13:40 +08:00
奔跑的面条
e4514505c3 perf: 优化画布放大缩小的体验 2022-12-22 00:51:25 +08:00
奔跑的面条
f2c49b171e perf: 优化画布缩放体验 2022-12-20 20:00:21 +08:00
奔跑的面条
c5706f839e Merge branch 'dev' into master-fetch-dev 2022-12-20 17:05:32 +08:00
奔跑的面条
de9e304dd4 perf: 优化加载进度条体验 2022-12-20 17:05:13 +08:00
奔跑的面条
faa0d6538f Merge branch 'dev' into master-fetch-dev 2022-12-20 16:59:55 +08:00
奔跑的面条
1fb57ad1ff feat: 新增加载提示 2022-12-20 16:54:04 +08:00
奔跑的面条
65127ced7f perf: 新增快捷键说明 2022-12-20 15:16:25 +08:00
奔跑的面条
5b1458b22f fix: 解决 deep 报错 2022-12-20 15:09:12 +08:00
奔跑的面条
6f74be7092 !116 fix: 修复画布无法滚动
Merge pull request !116 from jeo_young/dev
2022-12-18 08:36:36 +00:00
jeo young
1f9790e5f5 fix: 画布不能滚动 2022-12-18 10:24:49 +08:00
奔跑的面条
0b8ab9adfa style: 修改错误单词 2022-12-18 00:00:41 +08:00
奔跑的面条
a17d7a4182 style: 优化代码格式 2022-12-17 22:25:19 +08:00
奔跑的面条
4ef77fcf25 !115 画布优化
Merge pull request !115 from MajorMayer/dev
2022-12-17 13:57:38 +00:00
jeo young
d204b459d9 fix: 去掉多余代码 2022-12-17 17:56:36 +08:00
jeo young
6ae6645d3c fix: 画布scale始终保持居中
feat: 鼠标中键按住可拖拽画布
2022-12-17 17:53:53 +08:00
奔跑的面条
a925ced533 perf: 修改进度条的长度 2022-12-17 15:35:50 +08:00
jeo young
8dcccef54d fix: 修复按住空格键时 不允许框选 2022-12-17 01:33:27 +08:00
jeo young
dff639e901 feat: 按住鼠标中键 可以拖拽画布 2022-12-17 01:32:03 +08:00
jeo young
0376703fd2 fix: 画布变化后始终居中 2022-12-17 00:56:42 +08:00
jeo young
7341ff11f3 fix: 空格热键导致ctrl 无法多选组件 2022-12-16 23:27:02 +08:00
奔跑的面条
57193beeab fix: 处理标尺展示不全的问题 2022-12-16 22:47:55 +08:00
奔跑的面条
405e884e70 perf: 优化画布拖拽逻辑 2022-12-16 22:18:24 +08:00
奔跑的面条
0d4e83c940 build: 新增dom-helpers依赖 2022-12-16 19:36:14 +08:00
奔跑的面条
b8ed389f60 !110 画布优化
Merge pull request !110 from MajorMayer/dev
2022-12-16 11:34:53 +00:00
jeo young
b308275d99 fix: 画布优化 2022-12-16 19:08:34 +08:00
奔跑的面条
f15e0cd15f build: 升级版本到2.1.3 2022-12-16 14:02:09 +08:00
奔跑的面条
aa17e93966 Merge branch 'master-fetch-dev' into master-fetch 2022-12-16 13:55:55 +08:00
奔跑的面条
feb9796449 feat: 全局接口保存之后调接口存储 2022-12-16 13:01:15 +08:00
奔跑的面条
e4b641a9c9 Merge branch 'dev' into master-fetch-dev 2022-12-16 12:56:28 +08:00
奔跑的面条
0cd31f48c1 style: 修改注释 2022-12-16 12:11:16 +08:00
奔跑的面条
e35e98c023 feat: 拉取图片路径处理的PR代码 2022-12-16 12:04:42 +08:00
奔跑的面条
352a1742cf !104 fix:图片hash会出现404问题
Merge pull request !104 from lastbee1204/master-fetch
2022-12-16 04:03:40 +00:00
奔跑的面条
11cd4d0da1 perf: 优化数字翻牌组件说明 2022-12-16 11:12:16 +08:00
奔跑的面条
8987dd1682 perf: 优化饼图展示 2022-12-16 11:01:02 +08:00
奔跑的面条
ff1384c825 !108 饼状图新增功能 显示标签,标签显示内容,引导线显示,饼状图圆角设置
Merge pull request !108 from 李少白/master-fetch
2022-12-16 10:44:32 +08:00
奔跑的面条
1af7ae865d !108 饼状图新增功能 显示标签,标签显示内容,引导线显示,饼状图圆角设置
Merge pull request !108 from 李少白/master-fetch
2022-12-16 02:44:00 +00:00
奔跑的面条
0e42f4ff35 fix: 解决预览时没有overflow-hidden 的问题 2022-12-16 10:31:04 +08:00
奔跑的面条
cfcc262fd6 fix: 禁用个别弹窗使用esc 2022-12-16 10:15:25 +08:00
奔跑的面条
36ca877d49 style: 优化代码格式 2022-12-16 09:19:56 +08:00
奔跑的面条
3bad7ec758 !107 修复过滤器编辑器未更新问题
Merge pull request !107 from Furoe/dev
2022-12-16 01:18:57 +00:00
奔跑的面条
e1e26cafcf fix: 新增编辑接口同步修改所有组件功能 2022-12-15 21:04:00 +08:00
奔跑的面条
99cd66c835 feat: 新增全局请求定时功能 2022-12-15 20:53:28 +08:00
奔跑的面条
e4aac1597f feat: 处理全局接口编辑请求 2022-12-15 20:22:05 +08:00
奔跑的面条
2dc7bc3b61 perf: 优化全局接口功能 2022-12-15 19:49:58 +08:00
奔跑的面条
07b7eec457 perf: 优化全局接口功能 2022-12-15 19:48:16 +08:00
奔跑的面条
eaab8d1d49 feat: 新增数据池配置页面 2022-12-15 19:37:43 +08:00
slxb
7bc6ff7619 饼状图新增功能 显示标签,标签显示内容,引导线显示,饼状图圆角设置 2022-12-13 19:07:47 +08:00
yangwq7
9903e73a69 fix: 修复过滤器编辑器未更新问题 2022-12-12 11:33:43 +08:00
奔跑的面条
7f1c001c99 fix: 解决颜色列表卡顿的问题 2022-12-10 17:04:24 +08:00
刘彪
67f6dcd1fe fix:图片hash会出现404问题 2022-11-29 11:56:37 +08:00
刘彪
de60c7cde5 fix:图片hash会出现404问题 2022-11-29 11:47:54 +08:00
奔跑的面条
889e5075ba style: 去除全局多余代码 2022-11-28 11:02:52 +08:00
奔跑的面条
2bba1dcae0 style: 修改代码格式,修改错误单词 2022-11-28 10:54:54 +08:00
奔跑的面条
9d81159141 !103 优化Axios相关类型推断和语法
Merge pull request !103 from 石头web/master-fetch-dev
2022-11-28 01:46:22 +00:00
a876691666
f8ebaa60b1 feat: 接口增加泛型支持 2022-11-27 12:16:32 +08:00
a876691666
02ec3c78d6 feat: 更新Type类型 2022-11-27 11:40:00 +08:00
奔跑的面条
21ba5c02b0 perf: 优化缩放动画 2022-11-24 11:48:13 +08:00
奔跑的面条
500795b7e5 feat: 新增数据池代码 2022-11-22 21:25:52 +08:00
奔跑的面条
8230757bd1 !102 fix:修复状态变更时(如切换语言等),useSync.hook.ts 中 dataSyncFetch 反复执行导致 chartEditStore.componentList 重复
Merge pull request !102 from fankeke007/N/A
2022-11-22 11:18:28 +00:00
奔跑的面条
c1de1f9db6 Merge remote-tracking branch 'origin/master-fetch-dev' into master-fetch 2022-11-22 12:44:37 +08:00
奔跑的面条
1b0591ee62 Merge remote-tracking branch 'origin/dev' into master-fetch-dev 2022-11-22 12:43:27 +08:00
奔跑的面条
5ea963fb93 fix: 处理旧数据基础事件报错的问题 2022-11-22 12:42:23 +08:00
奔跑的面条
3ee5faa248 Merge branch 'master-fetch-dev' into master-fetch 2022-11-21 10:50:33 +08:00
奔跑的面条
ab9b79e8a8 Merge branch 'dev' into master-fetch-dev 2022-11-21 10:50:10 +08:00
奔跑的面条
be014225c1 fix: 去除页面错误静态数据 2022-11-21 10:49:04 +08:00
奔跑的面条
b6a78c64ed build: 升级版本到 2.1.2 2022-11-19 21:05:32 +08:00
奔跑的面条
9855d28e33 Merge branch 'master-fetch-dev' into master-fetch 2022-11-19 21:05:15 +08:00
奔跑的面条
16fb258908 Merge branch 'dev' into master-fetch-dev 2022-11-19 20:37:29 +08:00
奔跑的面条
936d78975e fix: 解决点击图表分列没反应的bug 2022-11-19 20:37:06 +08:00
奔跑的面条
52ed72e502 Merge branch 'dev' into master-fetch-dev 2022-11-19 20:27:10 +08:00
奔跑的面条
6f9993e9e8 perf: 解决登录按钮 loading 不会关闭的问题 2022-11-19 20:23:20 +08:00
奔跑的面条
3347e3b12a !94 使右上方正确显示登录账号名
Merge pull request !94 from 吴医生/master0fetch-dev-my
2022-11-19 09:47:01 +00:00
奔跑的面条
b4a5ff7935 fix: 预览页接口错误不处理,默认正确 2022-11-19 15:07:54 +08:00
奔跑的面条
a25f9bc5a1 !100 胶囊柱图问题 ,滚动排名列表问题
Merge pull request !100 from daidai/dev
2022-11-19 06:03:47 +00:00
fankeke007
e75e2ccfe6 fix:修复状态变更时(如切换语言等),useSync.hook.ts 中 dataSyncFetch 反复执行导致 chartEditStore.componentList 重复
Signed-off-by: fankeke007 <610047449@qq.com>
2022-11-18 08:03:35 +00:00
刘嘉威
5454f19f3d fix: 滚动排名列表问题当数据量小于等于列表数时,第一条数据会直接不显示 2022-11-18 11:25:41 +08:00
刘嘉威
b95cf946a8 perf: 胶囊图增加cloneDeep防止多个互相影响 2022-11-18 10:16:41 +08:00
刘嘉威
1b9a3f6f5b fix: 胶囊柱图source数量变化页面展示效果数量不变问题 2022-11-18 09:23:37 +08:00
奔跑的面条
d91cd00310 fix: 补充误删的代码 2022-11-17 22:35:49 +08:00
奔跑的面条
e4f821f46d perf: 去除多余代码,优化全局配置页面 2022-11-17 21:39:51 +08:00
奔跑的面条
ed5a452e2f perf: 优化配置页面结构 2022-11-17 00:41:11 +08:00
奔跑的面条
907a0afb77 chore: 优化地址输入框的长度 2022-11-17 00:18:39 +08:00
奔跑的面条
b32c718780 style: 新增注释 2022-11-16 22:55:03 +08:00
潘潘
adbdad1e88 perf: 注释定时同步 2022-11-15 21:42:22 +08:00
潘潘
f8229a0518 perf: 编辑JSON优化 2022-11-15 21:42:09 +08:00
奔跑的面条
3d568f08de !95 feat: JSON编辑优化以及兼容后端接口保存
Merge pull request !95 from 潘潘/master-fetch-dev
2022-11-15 13:39:49 +00:00
奔跑的面条
48f00e44f6 feat: 新增数据池 hook 2022-11-15 21:25:35 +08:00
潘潘
5cc20e9b19 perf: 编辑JSON兼容后端优化 2022-11-15 16:26:52 +08:00
潘潘
dec1130ace perf: 编辑JSON优化 2022-11-15 16:21:35 +08:00
潘潘
e3a294eb00 perf: 注释定时同步 2022-11-14 21:07:12 +08:00
吴医生
104551b600 fix: 使正确显示右上方登录账号名
Signed-off-by: 吴医生 <draculakkk@hotmail.com>
2022-11-14 09:26:21 +00:00
奔跑的面条
5c6bf57de1 docs: 优化说明文档 2022-11-14 10:00:30 +08:00
奔跑的面条
b0cb3addbd Merge branch 'dev' into master-fetch-dev 2022-11-13 21:45:16 +08:00
奔跑的面条
8c089b800a perf: 修改列表的样式wenti 2022-11-13 21:38:46 +08:00
奔跑的面条
44199fa4c4 feat: 新增图表展示模式切换 2022-11-13 21:28:38 +08:00
奔跑的面条
77ff4cdffd Merge branch 'dev' into master-fetch-dev 2022-11-13 02:39:13 +08:00
奔跑的面条
5e20689356 feat: 新增基础事件功能 2022-11-13 02:36:04 +08:00
奔跑的面条
9a9b752a96 feat: 新增基础事件 2022-11-12 23:03:13 +08:00
奔跑的面条
1ddf056ca6 fix: 修改事件类型错误 2022-11-12 22:03:51 +08:00
奔跑的面条
572ab73c92 perf: 优化事件代码结构 2022-11-12 21:49:04 +08:00
奔跑的面条
dde92bfe60 Merge branch 'dev' into master-fetch-dev 2022-11-12 17:42:39 +08:00
奔跑的面条
afc8f907ce perf: 优化修改json的代码 2022-11-12 17:20:11 +08:00
奔跑的面条
f6bad1513b perf: 优化获取id 的旧代码 2022-11-12 16:16:03 +08:00
奔跑的面条
fce514c490 chore: 转移master-fetch分支获取id函数到dev分支 2022-11-12 16:10:14 +08:00
奔跑的面条
30a9deaee7 fix: 解决部分组件的配置缺失深拷贝的问题 2022-11-12 15:37:41 +08:00
奔跑的面条
a8bcc93aed fix: 修改500展示文案 2022-11-05 21:45:48 +08:00
奔跑的面条
b6903a777a Merge branch 'dev' of https://gitee.com/MTrun/go-view into master-fetch-dev 2022-11-05 21:34:39 +08:00
奔跑的面条
32762aa8a7 fix: 修改预览页面的报错问题 2022-11-05 21:31:42 +08:00
奔跑的面条
c35dd6fad9 fix: 解决锁定时,修改模块隐藏展示,标尺不会自适应的问题 2022-11-05 21:16:34 +08:00
奔跑的面条
8d05953b8b chore: 修改路径地址 2022-11-05 15:45:29 +08:00
奔跑的面条
afed1cb6b3 fix: 处理切换语言,UI框架不会变的问题 2022-11-05 15:23:01 +08:00
奔跑的面条
f6a4e87e05 style: 优化提示文案 2022-11-03 09:27:09 +08:00
奔跑的面条
f7cbc75e22 fix: 修改地址 2022-11-02 21:33:20 +08:00
奔跑的面条
e36265a2f4 style: 修改 iframe默认地址 2022-11-02 20:03:32 +08:00
奔跑的面条
0e1ae71b78 fix: 修改类型错误的问题 2022-11-02 19:30:47 +08:00
奔跑的面条
7fcfb953bd build: 修改版本到2.1.1 2022-11-02 19:07:18 +08:00
奔跑的面条
a76ad93600 Merge branch 'dev' of https://gitee.com/MTrun/go-view into master-fetch-dev 2022-11-02 19:06:49 +08:00
奔跑的面条
3dd94fb408 feat: 新增点击事件案例 2022-11-02 16:35:08 +08:00
奔跑的面条
f9ed391c81 chore: 修改上传地址的接口和图片的展示地址拼接 2022-11-01 21:17:24 +08:00
奔跑的面条
8ab64846d4 fix: 处理更换背景图内容不会更新的问题 2022-10-31 10:40:58 +08:00
奔跑的面条
bb46050bb3 style: 优化代码结构 2022-10-31 09:52:02 +08:00
奔跑的面条
b50620ec2c style: 优化代码结构 2022-10-31 09:30:35 +08:00
奔跑的面条
7bef69af92 style: 修改翻牌器全局引用的目录 2022-10-31 09:29:22 +08:00
奔跑的面条
ae8fcd640b perf: 优化 iframe 组件 2022-10-29 19:10:47 +08:00
奔跑的面条
455f3ff09a perf: 优化iframe 2022-10-29 17:55:14 +08:00
奔跑的面条
e4afaded36 !92 新增Iframe组件
Merge pull request !92 from 自由/dev-wu-20221027
2022-10-29 09:27:15 +00:00
奔跑的面条
a10409f829 perf: 优化 mock 列表的快捷写法 2022-10-29 17:15:14 +08:00
奔跑的面条
112138fdc5 perf: 优化高德地图 2022-10-29 17:14:47 +08:00
wuyuting1
73e5ca59df feat: 增加iframe组件 2022-10-28 11:38:39 +08:00
奔跑的面条
38f92febb7 feat: 优化胶囊图,新增配置 2022-10-28 11:13:52 +08:00
奔跑的面条
cd6f1e0438 perf: 优化版权声明的UI 2022-10-28 09:49:35 +08:00
奔跑的面条
1d73f71aaf fix: 优化在线编辑JSON的代码和交互 2022-10-27 21:10:58 +08:00
奔跑的面条
e4e77cd141 !91 增加胶囊柱图
Merge pull request !91 from daidai/dev
2022-10-27 12:30:58 +00:00
奔跑的面条
e0e7270623 !87 feat:新增高德地图
Merge pull request !87 from jiangcheng/dev
2022-10-27 12:27:22 +00:00
奔跑的面条
885c376e2a !85 feat: 新增JSON编辑页面 以及 保存跨窗口同步视图更新
Merge pull request !85 from 潘潘/dev
2022-10-27 12:27:01 +00:00
奔跑的面条
2845e9829d fix: 修改工作台不去除监听的问题 2022-10-27 19:38:58 +08:00
刘嘉威
36b82de301 style: remove console.log 2022-10-27 11:41:53 +08:00
刘嘉威
a2ac99e7cb feat: 胶囊柱图增加mock数据源 2022-10-27 11:40:53 +08:00
刘嘉威
d037e1ff36 feat: 增加胶囊柱图 2022-10-27 11:01:41 +08:00
潘潘
9d4424356d feat: 定时、失焦、保存同步 2022-10-26 12:10:19 +08:00
奔跑的面条
a82cc840b5 fix: 修改发布API错误调用 2022-10-26 10:51:10 +08:00
奔跑的面条
f087a0766b !89 解决编译混淆的警告和i18n的控制台警告
Merge pull request !89 from unidmr/dev
2022-10-25 04:50:31 +00:00
xushihao
0bb7400755 chore:解决控制台关于vue-i18n的告警 2022-10-25 09:55:18 +08:00
xushihao
6460c475b6 build:用terser混淆时会出现警告,需要配置minify为terser,或者用esbuild 2022-10-25 09:52:12 +08:00
蒋承
f8b645f867 feat: 添加点标记 2022-10-24 10:20:06 +08:00
panjianhua
834b330bc8 style: 修改UI 2022-10-22 21:16:37 +08:00
潘潘
a4b4ce57bd feat: 预览页\JSON编辑页\图表页保存同步更新 2022-10-20 15:38:15 +08:00
蒋承
ff7a0830d0 feat: 高德地图新增属性 2022-10-19 10:21:48 +08:00
蒋承
ff43d0c2d8 feat: 新增高德地图 2022-10-19 09:29:50 +08:00
奔跑的面条
bad4b5d7b3 fix: 去除单独颜色设置 2022-10-18 21:23:18 +08:00
奔跑的面条
adaf30dd3b perf: 优化弹幕图片 2022-10-18 21:00:41 +08:00
奔跑的面条
c0fc84061e !81 feat:新增弹幕文字组件
Merge pull request !81 from jiangcheng/dev
2022-10-18 12:58:35 +00:00
蒋承
b84ad0f598 feat: 弹幕文字 2022-10-18 11:24:57 +08:00
奔跑的面条
aa0569ef4b fix: 修改列表图偏移的问题 2022-10-17 09:42:56 +08:00
奔跑的面条
b88d90cb80 perf: 优化文案描述 2022-10-17 09:26:19 +08:00
奔跑的面条
c055129309 perf: 优化标题 2022-10-16 20:49:48 +08:00
奔跑的面条
30351cecb5 feat: 新增案例说明 2022-10-16 20:46:01 +08:00
奔跑的面条
4f6757fff2 perf: 优化事件编辑页面 2022-10-16 16:27:15 +08:00
奔跑的面条
284fdb8e05 perf: 修改事件文件位置,修改图标 2022-10-16 10:41:12 +08:00
奔跑的面条
738bcae563 fix: 去除 setPosition 2022-10-16 10:29:01 +08:00
奔跑的面条
987a68a6d1 !76 新增组件生命周期事件
Merge pull request !76 from 潘潘/dev
2022-10-16 02:28:09 +00:00
奔跑的面条
2171843c61 build: 修改版本号为2.1.0 2022-10-15 17:28:23 +08:00
奔跑的面条
934bac7201 fix: 修改版本号到2.0.10 2022-10-15 17:22:06 +08:00
奔跑的面条
ed2a46a3ef Merge branch 'dev' of https://gitee.com/MTrun/go-view into master-fetch-dev 2022-10-15 17:20:05 +08:00
奔跑的面条
59cb5d609d perf: 去除grid多余配置,添加散点图、热力图的grid 2022-10-15 16:51:16 +08:00
奔跑的面条
4add9ce4c6 !80 feat: 折线图和柱状图添加网格配置,xy轴标签偏移量
Merge pull request !80 from jiangcheng/dev
2022-10-15 02:09:47 +00:00
蒋承
c75d9f7a59 feat: x,y轴标签偏移量 2022-10-14 17:09:26 +08:00
蒋承
2d94085c54 feat: 网格容器配置 2022-10-14 16:50:06 +08:00
蒋承
2a6e5915f5 feat: 柱状图折线图添加网格配置 2022-10-14 16:46:41 +08:00
潘潘
656532e43d Merge branch 'dev' of gitee.com:dromara/go-view into dev
Signed-off-by: 潘潘 <97274247@qq.com>
2022-10-14 07:01:47 +00:00
奔跑的面条
d835a904c9 fix: 解决导入时顺序不对的问题 2022-10-14 14:33:14 +08:00
奔跑的面条
a5bf0e9f6a perf: 优化导入失败提示 2022-10-14 09:37:31 +08:00
奔跑的面条
7e3efa46ee perf: 优化亮色模式图层提示 2022-10-14 09:37:12 +08:00
奔跑的面条
ce68910e48 fix: 解决 分组复制 id 会重复的问题 2022-10-13 21:10:32 +08:00
奔跑的面条
6dce639a0e perf: 优化按下文案tishi 2022-10-13 20:48:12 +08:00
奔跑的面条
c738103fec perf: 优化键盘按下的提示 2022-10-13 20:45:51 +08:00
奔跑的面条
801f298448 perf: 优化报错信息捕获,去除setPosition自带函数 2022-10-13 20:21:33 +08:00
奔跑的面条
e08a7723b6 perf: 优化格式 2022-10-13 19:52:41 +08:00
奔跑的面条
166b5b98e8 !78 feat: 过滤方法增加api返回顶级对象作为参数,增强过滤器兼容性
Merge pull request !78 from dodu/dev-api-filter
2022-10-13 10:05:39 +00:00
奔跑的面条
07e56631da perf: 优化异常处理 2022-10-12 21:57:30 +08:00
奔跑的面条
1435789a6c !77 feat: 折线图和柱状图配置label选项
Merge pull request !77 from jiangcheng/dev
2022-10-12 13:35:36 +00:00
奔跑的面条
7c5fa7610d fix: 新增三维组件限制 2022-10-12 21:30:08 +08:00
奔跑的面条
084e680e12 perf: 优化三维地球内存泄漏 2022-10-12 21:15:08 +08:00
奔跑的面条
380a6b95b7 feat: 新增三维地球 2022-10-12 21:08:24 +08:00
tnt group
9467feff23 fix: 移除开发标记 2022-10-12 16:50:25 +08:00
tnt group
a6f4267915 feat: 过滤方法增加api返回顶级对象作为参数,增强过滤器兼容性 2022-10-12 16:41:49 +08:00
jiangcheng
cfe9efd4dd Merge branch 'dev' of https://gitee.com/jiang_cheng_1/go-view into dev 2022-10-12 11:31:05 +08:00
jiangcheng
971b03620a fix: 格式问题 2022-10-12 11:30:54 +08:00
潘潘
92339dae28 feat: 组件生命周期事件 2022-10-11 18:31:29 +08:00
奔跑的面条
c84f6d9c33 perf: 优化补丁的判单方式 2022-10-11 16:02:43 +08:00
奔跑的面条
e187c012cc perf: 修改ctrl默认值 2022-10-11 15:15:03 +08:00
奔跑的面条
af1c280f28 perf: 优化 ctrl 监听 2022-10-10 18:47:07 +08:00
蒋承
016e48cc69 feat: 折线图和柱状图配置label 2022-10-09 16:04:29 +08:00
蒋承
6dcd39983f feat: 更新 2022-10-09 15:50:46 +08:00
蒋承
b055b6c511 Merge branch 'dev' of https://gitee.com/jiang_cheng_1/go-view into dev 2022-10-09 15:36:00 +08:00
蒋承
1d18c86dc7 feat: 动态数据维度不同,导致整合维度bug 2022-10-09 13:58:29 +08:00
361 changed files with 10848 additions and 7161 deletions

4
.env
View File

@@ -2,7 +2,7 @@
VITE_DEV_PORT = '8080'
# development path
VITE_DEV_PATH = 'http://1.117.240.165:8080'
VITE_DEV_PATH = 'https://demo.mtruning.club'
# production path
VITE_PRO_PATH = 'http://1.117.240.165:8080'
VITE_PRO_PATH = 'https://demo.mtruning.club'

View File

@@ -0,0 +1,51 @@
version: '1.0'
name: branch-pipeline
displayName: BranchPipeline
stages:
- stage:
name: compile
displayName: 编译
steps:
- step: build@nodejs
name: build_nodejs
displayName: Nodejs 构建
# 支持8.16.2、10.17.0、12.16.1、14.16.0、15.12.0五个版本
nodeVersion: 14.16.0
# 构建命令:安装依赖 -> 清除上次打包产物残留 -> 执行构建 【请根据项目实际产出进行填写】
commands:
- npm install && rm -rf ./dist && npm run build
# 非必填字段开启后表示将构建产物暂存但不会上传到制品库中7天后自动清除
artifacts:
# 构建产物名字作为产物的唯一标识可向下传递支持自定义默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址
- name: BUILD_ARTIFACT
# 构建产物获取路径,是指代码编译完毕之后构建物的所在路径
path:
- ./dist
- step: publish@general_artifacts
name: publish_general_artifacts
displayName: 上传制品
# 上游构建任务定义的产物名默认BUILD_ARTIFACT
dependArtifact: BUILD_ARTIFACT
# 上传到制品库时的制品命名默认output
artifactName: output
dependsOn: build_nodejs
- stage:
name: release
displayName: 发布
steps:
- step: publish@release_artifacts
name: publish_release_artifacts
displayName: '发布'
# 上游上传制品任务的产出
dependArtifact: output
# 发布制品版本号
version: '1.0.0.0'
# 是否开启版本号自增,默认开启
autoIncrement: true
triggers:
push:
branches:
exclude:
- master
include:
- .*

View File

@@ -0,0 +1,49 @@
version: '1.0'
name: master-pipeline
displayName: MasterPipeline
stages:
- stage:
name: compile
displayName: 编译
steps:
- step: build@nodejs
name: build_nodejs
displayName: Nodejs 构建
# 支持8.16.2、10.17.0、12.16.1、14.16.0、15.12.0五个版本
nodeVersion: 14.16.0
# 构建命令:安装依赖 -> 清除上次打包产物残留 -> 执行构建 【请根据项目实际产出进行填写】
commands:
- npm install && rm -rf ./dist && npm run build
# 非必填字段开启后表示将构建产物暂存但不会上传到制品库中7天后自动清除
artifacts:
# 构建产物名字作为产物的唯一标识可向下传递支持自定义默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址
- name: BUILD_ARTIFACT
# 构建产物获取路径,是指代码编译完毕之后构建物的所在路径
path:
- ./dist
- step: publish@general_artifacts
name: publish_general_artifacts
displayName: 上传制品
# 上游构建任务定义的产物名默认BUILD_ARTIFACT
dependArtifact: BUILD_ARTIFACT
# 上传到制品库时的制品命名默认output
artifactName: output
dependsOn: build_nodejs
- stage:
name: release
displayName: 发布
steps:
- step: publish@release_artifacts
name: publish_release_artifacts
displayName: '发布'
# 上游上传制品任务的产出
dependArtifact: output
# 发布制品版本号
version: '1.0.0.0'
# 是否开启版本号自增,默认开启
autoIncrement: true
triggers:
push:
branches:
include:
- master

36
.workflow/pr-pipeline.yml Normal file
View File

@@ -0,0 +1,36 @@
version: '1.0'
name: pr-pipeline
displayName: PRPipeline
stages:
- stage:
name: compile
displayName: 编译
steps:
- step: build@nodejs
name: build_nodejs
displayName: Nodejs 构建
# 支持8.16.2、10.17.0、12.16.1、14.16.0、15.12.0五个版本
nodeVersion: 14.16.0
# 构建命令:安装依赖 -> 清除上次打包产物残留 -> 执行构建 【请根据项目实际产出进行填写】
commands:
- npm install && rm -rf ./dist && npm run build
# 非必填字段开启后表示将构建产物暂存但不会上传到制品库中7天后自动清除
artifacts:
# 构建产物名字作为产物的唯一标识可向下传递支持自定义默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址
- name: BUILD_ARTIFACT
# 构建产物获取路径,是指代码编译完毕之后构建物的所在路径
path:
- ./dist
- step: publish@general_artifacts
name: publish_general_artifacts
displayName: 上传制品
# 上游构建任务定义的产物名默认BUILD_ARTIFACT
dependArtifact: BUILD_ARTIFACT
# 上传到制品库时的制品命名默认output
artifactName: output
dependsOn: build_nodejs
triggers:
pr:
branches:
include:
- master

View File

@@ -1,7 +1,5 @@
## 总览
![logo](readme/logo-t-y.png)
**`master-fetch` 分支是带有后端接口请求的分支**
**后端项目地址:[https://gitee.com/MTrun/go-view-serve](https://gitee.com/MTrun/go-view-serve)**
@@ -14,12 +12,6 @@
接口地址修改:`.env`
### 🤯 后端项目
后端项目gitee地址[https://gitee.com/MTrun/go-view-serve](https://gitee.com/MTrun/go-view-serve)
接口说明地址:[https://docs.apipost.cn/preview/5aa85d10a59d66ce/ddb813732007ad2b?target_id=84dbc5b0-158f-4bcb-8f74-793ac604ada3#3e053622-1e76-43f9-a039-756aee822dbb](https://docs.apipost.cn/preview/5aa85d10a59d66ce/ddb813732007ad2b?target_id=84dbc5b0-158f-4bcb-8f74-793ac604ada3#3e053622-1e76-43f9-a039-756aee822dbb)
```shell
# port
VITE_DEV_PORT = '8080'

View File

@@ -1,3 +1,4 @@
import path from 'path'
export const OUTPUT_DIR = 'dist'
// monaco-editor 路径
@@ -6,7 +7,7 @@ export const prefix = `monaco-editor/esm/vs`
// chunk 警告大小
export const chunkSizeWarningLimit = 2000
// 禁用 brotli 压缩大小报告
// 禁用 brotliSize 压缩大小报告
export const brotliSize = false
// 分包
@@ -14,7 +15,12 @@ export const rollupOptions = {
output: {
chunkFileNames: 'static/js/[name]-[hash].js',
entryFileNames: 'static/js/[name]-[hash].js',
assetFileNames: 'static/[ext]/[name]-[hash].[ext]',
assetFileNames: (chunkInfo) => {
if(['.png', '.jpg', '.jpeg'].includes(path.extname(chunkInfo.name))) {
return `static/[ext]/[name].[ext]`
}
return `static/[ext]/[name]-[hash].[ext]`
},
manualChunks: {
jsonWorker: [`${prefix}/language/json/json.worker`],
cssWorker: [`${prefix}/language/css/css.worker`],

View File

@@ -1,6 +1,9 @@
{
"name": "go-view",
"version": "2.0.91",
"version": "2.2.0",
"engines": {
"node": ">=12.0"
},
"scripts": {
"dev": "vite --host",
"build": "vue-tsc --noEmit && vite build",
@@ -11,6 +14,8 @@
"lint:fix": "eslint --ext .js,.jsx,.ts,.tsx,.vue src --fix"
},
"dependencies": {
"@amap/amap-jsapi-loader": "^1.0.1",
"@amap/amap-jsapi-types": "^0.0.8",
"@types/color": "^3.0.3",
"@types/crypto-js": "^4.1.1",
"@types/keymaster": "^1.6.30",
@@ -19,19 +24,23 @@
"axios": "^0.27.2",
"color": "^4.2.3",
"crypto-js": "^4.1.1",
"dayjs": "^1.11.7",
"dom-helpers": "^5.2.1",
"echarts-liquidfill": "^3.1.0",
"echarts-stat": "^1.2.0",
"echarts-wordcloud": "^2.0.0",
"gsap": "^3.11.3",
"highlight.js": "^11.5.0",
"html2canvas": "^1.4.1",
"keymaster": "^1.6.2",
"monaco-editor": "^0.33.0",
"naive-ui": "2.33.4",
"naive-ui": "2.34.3",
"pinia": "^2.0.13",
"screenfull": "^6.0.1",
"three": "^0.145.0",
"vue": "^3.2.31",
"vue-demi": "^0.13.1",
"vue-i18n": "9.1.10",
"vue-i18n": "^9.2.2",
"vue-router": "4.0.12",
"vue3-lazyload": "^0.2.5-beta",
"vue3-sketch-ruler": "^1.3.3",
@@ -41,6 +50,7 @@
"@commitlint/cli": "^17.0.2",
"@commitlint/config-conventional": "^17.0.2",
"@types/node": "^16.11.26",
"@types/three": "^0.144.0",
"@typescript-eslint/eslint-plugin": "^5.18.0",
"@typescript-eslint/parser": "^5.18.0",
"@vicons/carbon": "^0.12.0",
@@ -73,4 +83,4 @@
"vue-echarts": "^6.0.2",
"vue-tsc": "^0.28.10"
}
}
}

167
pnpm-lock.yaml generated
View File

@@ -1,6 +1,8 @@
lockfileVersion: 5.4
specifiers:
'@amap/amap-jsapi-loader': ^1.0.1
'@amap/amap-jsapi-types': ^0.0.8
'@commitlint/cli': ^17.0.2
'@commitlint/config-conventional': ^17.0.2
'@types/color': ^3.0.3
@@ -8,6 +10,7 @@ specifiers:
'@types/keymaster': ^1.6.30
'@types/lodash': ^4.14.184
'@types/node': ^16.11.26
'@types/three': ^0.144.0
'@typescript-eslint/eslint-plugin': ^5.18.0
'@typescript-eslint/parser': ^5.18.0
'@vicons/carbon': ^0.12.0
@@ -22,6 +25,7 @@ specifiers:
commitlint: ^17.0.2
crypto-js: ^4.1.1
default-passive-events: ^2.0.0
dom-helpers: ^5.2.1
echarts: ^5.3.2
echarts-liquidfill: ^3.1.0
echarts-stat: ^1.2.0
@@ -31,6 +35,7 @@ specifiers:
eslint-plugin-import: ^2.26.0
eslint-plugin-prettier: ^4.0.0
eslint-plugin-vue: ^8.5.0
gsap: ^3.11.3
highlight.js: ^11.5.0
html2canvas: ^1.4.1
husky: ^8.0.1
@@ -38,13 +43,14 @@ specifiers:
lodash: ~4.17.21
mockjs: ^1.1.0
monaco-editor: ^0.33.0
naive-ui: 2.33.4
naive-ui: 2.34.3
pinia: ^2.0.13
plop: ^3.0.5
prettier: ^2.6.2
sass: ^1.49.11
sass-loader: ^12.6.0
screenfull: ^6.0.1
three: ^0.145.0
typescript: 4.6.3
vite: 2.9.9
vite-plugin-compression: ^0.5.1
@@ -54,7 +60,7 @@ specifiers:
vue: ^3.2.31
vue-demi: ^0.13.1
vue-echarts: ^6.0.2
vue-i18n: 9.1.10
vue-i18n: ^9.2.2
vue-router: 4.0.12
vue-tsc: ^0.28.10
vue3-lazyload: ^0.2.5-beta
@@ -62,6 +68,8 @@ specifiers:
vuedraggable: ^4.1.0
dependencies:
'@amap/amap-jsapi-loader': 1.0.1
'@amap/amap-jsapi-types': 0.0.8
'@types/color': 3.0.3
'@types/crypto-js': 4.1.1
'@types/keymaster': 1.6.30
@@ -70,19 +78,22 @@ dependencies:
axios: 0.27.2
color: 4.2.3
crypto-js: 4.1.1
dom-helpers: 5.2.1
echarts-liquidfill: 3.1.0_echarts@5.3.3
echarts-stat: 1.2.0
echarts-wordcloud: 2.0.0_echarts@5.3.3
gsap: 3.11.3
highlight.js: 11.5.1
html2canvas: 1.4.1
keymaster: 1.6.2
monaco-editor: 0.33.0
naive-ui: 2.33.4_vue@3.2.37
naive-ui: 2.34.3_vue@3.2.37
pinia: 2.0.14_ub5l46u3nefphax5x2tezui4oq
screenfull: 6.0.1
three: 0.145.0
vue: 3.2.37
vue-demi: 0.13.1_vue@3.2.37
vue-i18n: 9.1.10_vue@3.2.37
vue-i18n: 9.2.2_vue@3.2.37
vue-router: 4.0.12_vue@3.2.37
vue3-lazyload: 0.2.5-beta_2yymnzrok6eda47acnj2yjm3ae
vue3-sketch-ruler: 1.3.4_vue@3.2.37
@@ -92,6 +103,7 @@ devDependencies:
'@commitlint/cli': 17.0.2
'@commitlint/config-conventional': 17.0.2
'@types/node': 16.11.40
'@types/three': 0.144.0
'@typescript-eslint/eslint-plugin': 5.28.0_evi7yu7wunhzwb24olrfvzynny
'@typescript-eslint/parser': 5.28.0_sfmgizikprcxt7r54j7cnzjamu
'@vicons/carbon': 0.12.0
@@ -126,6 +138,14 @@ devDependencies:
packages:
/@amap/amap-jsapi-loader/1.0.1:
resolution: {integrity: sha512-nPyLKt7Ow/ThHLkSvn2etQlUzqxmTVgK7bIgwdBRTg2HK5668oN7xVxkaiRe3YZEzGzfV2XgH5Jmu2T73ljejw==}
dev: false
/@amap/amap-jsapi-types/0.0.8:
resolution: {integrity: sha512-q0FyZDIJcXjsMLGc3oS9rjfJsErOvt9rcp6AgzY4k14vo7bBhdq4eKwoSdVp/pYjR/rfaKBns5v10ycZOFwf/A==}
dev: false
/@ampproject/remapping/2.2.0:
resolution: {integrity: sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==}
engines: {node: '>=6.0.0'}
@@ -384,6 +404,13 @@ packages:
- supports-color
dev: true
/@babel/runtime/7.20.6:
resolution: {integrity: sha512-Q+8MqP7TiHMWzSfwiJwXCjyf4GYA4Dgw3emg/7xmwsdLJOZUp+nMqcOwOzzYheuM1rhDu8FSj2l0aoMygEuXuA==}
engines: {node: '>=6.9.0'}
dependencies:
regenerator-runtime: 0.13.11
dev: false
/@babel/template/7.16.7:
resolution: {integrity: sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==}
engines: {node: '>=6.9.0'}
@@ -653,60 +680,42 @@ packages:
resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==}
dev: true
/@intlify/core-base/9.1.10:
resolution: {integrity: sha512-So9CNUavB/IsZ+zBmk2Cv6McQp6vc2wbGi1S0XQmJ8Vz+UFcNn9MFXAe9gY67PreIHrbLsLxDD0cwo1qsxM1Nw==}
engines: {node: '>= 10'}
/@intlify/core-base/9.2.2:
resolution: {integrity: sha512-JjUpQtNfn+joMbrXvpR4hTF8iJQ2sEFzzK3KIESOx+f+uwIjgw20igOyaIdhfsVVBCds8ZM64MoeNSx+PHQMkA==}
engines: {node: '>= 14'}
dependencies:
'@intlify/devtools-if': 9.1.10
'@intlify/message-compiler': 9.1.10
'@intlify/message-resolver': 9.1.10
'@intlify/runtime': 9.1.10
'@intlify/shared': 9.1.10
'@intlify/vue-devtools': 9.1.10
'@intlify/devtools-if': 9.2.2
'@intlify/message-compiler': 9.2.2
'@intlify/shared': 9.2.2
'@intlify/vue-devtools': 9.2.2
dev: false
/@intlify/devtools-if/9.1.10:
resolution: {integrity: sha512-SHaKoYu6sog3+Q8js1y3oXLywuogbH1sKuc7NSYkN3GElvXSBaMoCzW+we0ZSFqj/6c7vTNLg9nQ6rxhKqYwnQ==}
engines: {node: '>= 10'}
/@intlify/devtools-if/9.2.2:
resolution: {integrity: sha512-4ttr/FNO29w+kBbU7HZ/U0Lzuh2cRDhP8UlWOtV9ERcjHzuyXVZmjyleESK6eVP60tGC9QtQW9yZE+JeRhDHkg==}
engines: {node: '>= 14'}
dependencies:
'@intlify/shared': 9.1.10
'@intlify/shared': 9.2.2
dev: false
/@intlify/message-compiler/9.1.10:
resolution: {integrity: sha512-+JiJpXff/XTb0EadYwdxOyRTB0hXNd4n1HaJ/a4yuV960uRmPXaklJsedW0LNdcptd/hYUZtCkI7Lc9J5C1gxg==}
engines: {node: '>= 10'}
/@intlify/message-compiler/9.2.2:
resolution: {integrity: sha512-IUrQW7byAKN2fMBe8z6sK6riG1pue95e5jfokn8hA5Q3Bqy4MBJ5lJAofUsawQJYHeoPJ7svMDyBaVJ4d0GTtA==}
engines: {node: '>= 14'}
dependencies:
'@intlify/message-resolver': 9.1.10
'@intlify/shared': 9.1.10
'@intlify/shared': 9.2.2
source-map: 0.6.1
dev: false
/@intlify/message-resolver/9.1.10:
resolution: {integrity: sha512-5YixMG/M05m0cn9+gOzd4EZQTFRUu8RGhzxJbR1DWN21x/Z3bJ8QpDYj6hC4FwBj5uKsRfKpJQ3Xqg98KWoA+w==}
engines: {node: '>= 10'}
/@intlify/shared/9.2.2:
resolution: {integrity: sha512-wRwTpsslgZS5HNyM7uDQYZtxnbI12aGiBZURX3BTR9RFIKKRWpllTsgzHWvj3HKm3Y2Sh5LPC1r0PDCKEhVn9Q==}
engines: {node: '>= 14'}
dev: false
/@intlify/runtime/9.1.10:
resolution: {integrity: sha512-7QsuByNzpe3Gfmhwq6hzgXcMPpxz8Zxb/XFI6s9lQdPLPe5Lgw4U1ovRPZTOs6Y2hwitR3j/HD8BJNGWpJnOFA==}
engines: {node: '>= 10'}
/@intlify/vue-devtools/9.2.2:
resolution: {integrity: sha512-+dUyqyCHWHb/UcvY1MlIpO87munedm3Gn6E9WWYdWrMuYLcoIoOEVDWSS8xSwtlPU+kA+MEQTP6Q1iI/ocusJg==}
engines: {node: '>= 14'}
dependencies:
'@intlify/message-compiler': 9.1.10
'@intlify/message-resolver': 9.1.10
'@intlify/shared': 9.1.10
dev: false
/@intlify/shared/9.1.10:
resolution: {integrity: sha512-Om54xJeo1Vw+K1+wHYyXngE8cAbrxZHpWjYzMR9wCkqbhGtRV5VLhVc214Ze2YatPrWlS2WSMOWXR8JktX/IgA==}
engines: {node: '>= 10'}
dev: false
/@intlify/vue-devtools/9.1.10:
resolution: {integrity: sha512-5l3qYARVbkWAkagLu1XbDUWRJSL8br1Dj60wgMaKB0+HswVsrR6LloYZTg7ozyvM621V6+zsmwzbQxbVQyrytQ==}
engines: {node: '>= 10'}
dependencies:
'@intlify/message-resolver': 9.1.10
'@intlify/runtime': 9.1.10
'@intlify/shared': 9.1.10
'@intlify/core-base': 9.2.2
'@intlify/shared': 9.2.2
dev: false
/@jridgewell/gen-mapping/0.1.1:
@@ -871,6 +880,10 @@ packages:
resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==}
dev: true
/@types/katex/0.14.0:
resolution: {integrity: sha512-+2FW2CcT0K3P+JMR8YG846bmDwplKUTsWgT2ENwdQ1UdVfRk3GQrh6Mi4sTopy30gI8Uau5CEqHTDZ6YvWIUPA==}
dev: false
/@types/keymaster/1.6.30:
resolution: {integrity: sha512-mtL/NuDBX72zmyIa3cYHA1bQj1WAYlSC4eZcIQj+DHJkcRyTRF2XJXo7DBmkkY8TEq7XaAf7B8TGxs5PHhjRtw==}
dev: false
@@ -905,7 +918,7 @@ packages:
dev: true
/@types/node/17.0.43:
resolution: {integrity: sha512-jnUpgw8fL9kP2iszfIDyBQtw5Mf4/XSqy0Loc1J9pI14ejL83XcCEvSf50Gs/4ET0I9VCCDoOfufQysj0S66xA==, registry: https://registry.npm.taobao.org/}
resolution: {integrity: sha512-jnUpgw8fL9kP2iszfIDyBQtw5Mf4/XSqy0Loc1J9pI14ejL83XcCEvSf50Gs/4ET0I9VCCDoOfufQysj0S66xA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/@types/node/-/node-17.0.43.tgz}
/@types/normalize-package-data/2.4.1:
resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==}
@@ -921,12 +934,22 @@ packages:
'@types/node': 17.0.43
dev: true
/@types/three/0.144.0:
resolution: {integrity: sha512-psvEs6q5rLN50jUYZ3D4pZMfxTbdt3A243blt0my7/NcL6chaCZpHe2csbCtx0SOD9fI/XnF3wnVUAYZGqCSYg==}
dependencies:
'@types/webxr': 0.5.0
dev: true
/@types/through/0.0.30:
resolution: {integrity: sha512-FvnCJljyxhPM3gkRgWmxmDZyAQSiBQQWLI0A0VFL0K7W1oRUrPJSqNO0NvTnLkBcotdlp3lKvaT0JrnyRDkzOg==}
dependencies:
'@types/node': 17.0.43
dev: true
/@types/webxr/0.5.0:
resolution: {integrity: sha512-IUMDPSXnYIbEO2IereEFcgcqfDREOgmbGqtrMpVPpACTU6pltYLwHgVkrnYv0XhWEcjio9sYEfIEzgn3c7nDqA==}
dev: true
/@typescript-eslint/eslint-plugin/5.28.0_evi7yu7wunhzwb24olrfvzynny:
resolution: {integrity: sha512-DXVU6Cg29H2M6EybqSg2A+x8DgO9TCUBRp4QEXQHJceLS7ogVDP0g3Lkg/SZCqcvkAP/RruuQqK0gdlkgmhSUA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
@@ -1191,6 +1214,10 @@ packages:
resolution: {integrity: sha512-IiA0SvDrJEgXvVxjNkHPFfDx6SXw0b/TUkqMcDZWNg9fnCAHbTpoo59YfJ9QLFkwa3raau5vSlRVzMSLDnfdtQ==}
dev: false
/@vue/devtools-api/6.4.5:
resolution: {integrity: sha512-JD5fcdIuFxU4fQyXUu3w2KpAJHzTVdN+p4iOX2lMWSHMOoQdMAcpFLZzm9Z/2nmsoZ1a96QEhZ26e50xLBsgOQ==}
dev: false
/@vue/reactivity-transform/3.2.37:
resolution: {integrity: sha512-IWopkKEb+8qpu/1eMKVeXrK0NLw9HicGviJzhJDEyfxTR9e1WtpnnbYkJWurX6WwoFP0sz10xQg8yL8lgskAZg==}
dependencies:
@@ -1884,7 +1911,7 @@ packages:
dev: true
/csstype/2.6.20:
resolution: {integrity: sha512-/WwNkdXfckNgw6S5R125rrW8ez139lBHWouiBvX8dfMFtcn6V81REDqnH7+CRpRipfYlyU1CmOnOxrmGcFOjeA==, registry: https://registry.npm.taobao.org/}
resolution: {integrity: sha512-/WwNkdXfckNgw6S5R125rrW8ez139lBHWouiBvX8dfMFtcn6V81REDqnH7+CRpRipfYlyU1CmOnOxrmGcFOjeA==}
dev: false
/csstype/3.0.11:
@@ -2037,6 +2064,13 @@ packages:
resolution: {integrity: sha512-LLBi6pEqS6Do3EKQ3J0NqHWV5hhb78Pi8vvESYwyOy2c31ZEZVdtitdzsQsKb7878PEERhzUk0ftqGhG6Mz+pQ==}
dev: true
/dom-helpers/5.2.1:
resolution: {integrity: sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==}
dependencies:
'@babel/runtime': 7.20.6
csstype: 3.0.11
dev: false
/dom-serializer/1.4.1:
resolution: {integrity: sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==}
dependencies:
@@ -2091,7 +2125,7 @@ packages:
dev: false
/echarts-wordcloud/2.0.0_echarts@5.3.3:
resolution: {integrity: sha512-K7l6pTklqdW7ZWzT/1CS0KhBSINr/cd7c5N1fVMzZMwLQHEwT7x+nivK7g5hkVh7WNcAv4Dn6/ZS5zMKRozC1g==, registry: https://registry.npm.taobao.org/}
resolution: {integrity: sha512-K7l6pTklqdW7ZWzT/1CS0KhBSINr/cd7c5N1fVMzZMwLQHEwT7x+nivK7g5hkVh7WNcAv4Dn6/ZS5zMKRozC1g==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/echarts-wordcloud/-/echarts-wordcloud-2.0.0.tgz}
peerDependencies:
echarts: ^5.0.1
dependencies:
@@ -3032,6 +3066,10 @@ packages:
resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==}
dev: true
/gsap/3.11.3:
resolution: {integrity: sha512-xc/iIJy+LWiMbRa4IdMtdnnKa/7PXEK6NNzV71gdOYUVeTZN7UWnLU0fB7Hi1iwiz4ZZoYkBZPPYGg+2+zzFHA==}
dev: false
/handlebars/4.7.7:
resolution: {integrity: sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==}
engines: {node: '>=0.4.7'}
@@ -3042,7 +3080,7 @@ packages:
source-map: 0.6.1
wordwrap: 1.0.0
optionalDependencies:
uglify-js: 3.16.0
uglify-js: 3.17.4
dev: true
/hard-rejection/2.1.0:
@@ -3798,13 +3836,14 @@ packages:
resolution: {integrity: sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==}
dev: true
/naive-ui/2.33.4_vue@3.2.37:
resolution: {integrity: sha512-4tK2lWx3v8sbEeTLG/tL5Ur9VvZyUxSnC0VcTO6NO1rM/D15JXg8jVwQCRFYnEp7mp3gfD5B3i8kN4JisTeiFA==}
/naive-ui/2.34.3_vue@3.2.37:
resolution: {integrity: sha512-fUMr0dzb/iGsOTWgoblPVobY5X5dihQ1eam5dA+H74oyLYAvgX4pL96xQFPBLIYqvyRFBAsN85kHN5pLqdtpxA==}
peerDependencies:
vue: ^3.0.0
dependencies:
'@css-render/plugin-bem': 0.15.10_css-render@0.15.10
'@css-render/vue3-ssr': 0.15.10_vue@3.2.37
'@types/katex': 0.14.0
'@types/lodash': 4.14.185
'@types/lodash-es': 4.17.6
async-validator: 4.1.1
@@ -4430,6 +4469,10 @@ packages:
strip-indent: 3.0.0
dev: true
/regenerator-runtime/0.13.11:
resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==}
dev: false
/regexp.prototype.flags/1.4.3:
resolution: {integrity: sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==}
engines: {node: '>= 0.4'}
@@ -4825,6 +4868,10 @@ packages:
resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==}
dev: true
/three/0.145.0:
resolution: {integrity: sha512-EKoHQEtEJ4CB6b2BGMBgLZrfwLjXcSUfoI/MiIXUuRpeYsfK5aPWbYhdtIVWOH+x6X0TouldHKHBuc/LAiFzAw==}
dev: false
/through/2.3.8:
resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==}
dev: true
@@ -4978,8 +5025,8 @@ packages:
hasBin: true
dev: true
/uglify-js/3.16.0:
resolution: {integrity: sha512-FEikl6bR30n0T3amyBh3LoiBdqHRy/f4H80+My34HOesOKyHfOsxAPAxOoqC0JUnC1amnO0IwkYC3sko51caSw==}
/uglify-js/3.17.4:
resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==}
engines: {node: '>=0.8.0'}
hasBin: true
requiresBuild: true
@@ -5349,16 +5396,16 @@ packages:
- supports-color
dev: true
/vue-i18n/9.1.10_vue@3.2.37:
resolution: {integrity: sha512-jpr7gV5KPk4n+sSPdpZT8Qx3XzTcNDWffRlHV/cT2NUyEf+sEgTTmLvnBAibjOFJ0zsUyZlVTAWH5DDnYep+1g==}
engines: {node: '>= 10'}
/vue-i18n/9.2.2_vue@3.2.37:
resolution: {integrity: sha512-yswpwtj89rTBhegUAv9Mu37LNznyu3NpyLQmozF3i1hYOhwpG8RjcjIFIIfnu+2MDZJGSZPXaKWvnQA71Yv9TQ==}
engines: {node: '>= 14'}
peerDependencies:
vue: ^3.0.0
dependencies:
'@intlify/core-base': 9.1.10
'@intlify/shared': 9.1.10
'@intlify/vue-devtools': 9.1.10
'@vue/devtools-api': 6.1.4
'@intlify/core-base': 9.2.2
'@intlify/shared': 9.2.2
'@intlify/vue-devtools': 9.2.2
'@vue/devtools-api': 6.4.5
vue: 3.2.37
dev: false

View File

@@ -1,9 +1,9 @@
<template>
<n-config-provider
:locale="zhCN"
:theme="darkTheme"
:hljs="hljsTheme"
:date-locale="dateZhCN"
:locale="locale"
:date-locale="dateLocale"
:theme-overrides="overridesTheme"
>
<go-app-provider>
@@ -14,11 +14,10 @@
</template>
<script lang="ts" setup>
import { zhCN, dateZhCN, NConfigProvider } from 'naive-ui'
import { NConfigProvider } from 'naive-ui'
import { GoAppProvider } from '@/components/GoAppProvider'
import { I18n } from '@/components/I18n'
import { useSystemInit, useDarkThemeHook, useThemeOverridesHook, useCode } from '@/hooks'
import { useSystemInit, useDarkThemeHook, useThemeOverridesHook, useCode, useLang } from '@/hooks'
// 暗黑主题
const darkTheme = useDarkThemeHook()
@@ -31,4 +30,8 @@ const hljsTheme = useCode()
// 系统全局数据初始化
useSystemInit()
// 全局语言
const { locale, dateLocale } = useLang()
</script>

View File

@@ -1,17 +1,27 @@
import axios, { AxiosResponse, AxiosRequestConfig } from 'axios'
import { ResultEnum } from "@/enums/httpEnum"
import axios, { AxiosResponse, AxiosRequestConfig, Axios } from 'axios'
import { ResultEnum, ModuleTypeEnum } from "@/enums/httpEnum"
import { PageEnum, ErrorPageNameMap } from "@/enums/pageEnum"
import { StorageEnum } from '@/enums/storageEnum'
import { axiosPre } from '@/settings/httpSetting'
import { SystemStoreEnum, SystemStoreUserInfoEnum } from '@/store/modules/systemStore/systemStore.d'
import { redirectErrorPage, getLocalStorage, routerTurnByName, httpErrorHandle } from '@/utils'
import { redirectErrorPage, getLocalStorage, routerTurnByName, isPreview } from '@/utils'
import { fetchAllowList } from './axios.config'
import includes from 'lodash/includes'
export interface MyResponseType<T> {
code: ResultEnum
data: T
message: string
}
export interface MyRequestInstance extends Axios {
<T = any>(config: AxiosRequestConfig): Promise<MyResponseType<T>>
}
const axiosInstance = axios.create({
baseURL: `${import.meta.env.PROD ? import.meta.env.VITE_PRO_PATH : ''}${axiosPre}`,
timeout: ResultEnum.TIMEOUT,
})
}) as unknown as MyRequestInstance
axiosInstance.interceptors.request.use(
(config: AxiosRequestConfig) => {
@@ -39,8 +49,14 @@ axiosInstance.interceptors.request.use(
// 响应拦截器
axiosInstance.interceptors.response.use(
(res: AxiosResponse) => {
// 预览页面错误不进行处理
if (isPreview()) {
return Promise.resolve(res.data)
}
const { code } = res.data as { code: number }
if (code === undefined || code === null) return Promise.resolve(res)
// 成功
if (code === ResultEnum.SUCCESS) {
return Promise.resolve(res.data)

View File

@@ -9,16 +9,16 @@ import {
} from '@/enums/httpEnum'
import type { RequestGlobalConfigType, RequestConfigType } from '@/store/modules/chartEditStore/chartEditStore.d'
export const get = (url: string, params?: object) => {
return axiosInstance({
export const get = <T = any>(url: string, params?: object) => {
return axiosInstance<T>({
url: url,
method: RequestHttpEnum.GET,
params: params,
})
}
export const post = (url: string, data?: object, headersType?: string) => {
return axiosInstance({
export const post = <T = any>(url: string, data?: object, headersType?: string) => {
return axiosInstance<T>({
url: url,
method: RequestHttpEnum.POST,
data: data,
@@ -28,8 +28,8 @@ export const post = (url: string, data?: object, headersType?: string) => {
})
}
export const patch = (url: string, data?: object, headersType?: string) => {
return axiosInstance({
export const patch = <T = any>(url: string, data?: object, headersType?: string) => {
return axiosInstance<T>({
url: url,
method: RequestHttpEnum.PATCH,
data: data,
@@ -39,8 +39,8 @@ export const patch = (url: string, data?: object, headersType?: string) => {
})
}
export const put = (url: string, data?: object, headersType?: ContentTypeEnum) => {
return axiosInstance({
export const put = <T = any>(url: string, data?: object, headersType?: ContentTypeEnum) => {
return axiosInstance<T>({
url: url,
method: RequestHttpEnum.PUT,
data: data,
@@ -50,8 +50,8 @@ export const put = (url: string, data?: object, headersType?: ContentTypeEnum) =
})
}
export const del = (url: string, params?: object) => {
return axiosInstance({
export const del = <T = any>(url: string, params?: object) => {
return axiosInstance<T>({
url: url,
method: RequestHttpEnum.DELETE,
params
@@ -82,11 +82,11 @@ export const http = (type?: RequestHttpEnum) => {
}
const prefix = 'javascript:'
// 对输入字符进行转义处理
export const translateStr = (target: string | object) => {
export const translateStr = (target: string | Record<any, any>) => {
if (typeof target === 'string') {
if (target.startsWith(prefix)) {
const funcStr = target.split(prefix)[1]
let result;
let result
try {
result = new Function(`${funcStr}`)()
} catch (error) {
@@ -100,8 +100,8 @@ export const translateStr = (target: string | object) => {
}
for (const key in target) {
if (Object.prototype.hasOwnProperty.call(target, key)) {
const subTarget = (target as any)[key];
(target as any)[key] = translateStr(subTarget)
const subTarget = target[key]
target[key] = translateStr(subTarget)
}
}
return target
@@ -116,7 +116,6 @@ export const customizeHttp = (targetParams: RequestConfigType, globalParams: Req
if (!targetParams || !globalParams) {
return
}
// 全局
const {
// 全局请求源地址
@@ -173,7 +172,9 @@ export const customizeHttp = (targetParams: RequestConfigType, globalParams: Req
case RequestBodyEnum.JSON:
headers['Content-Type'] = ContentTypeEnum.JSON
data = translateStr(JSON.parse(targetRequestParams.Body['json']))
//json对象也能使用'javasctipt:'来动态拼接参数
data = translateStr(targetRequestParams.Body['json'])
if(typeof data === 'string') data = JSON.parse(data)
// json 赋值给 data
break

View File

@@ -15,8 +15,10 @@ export const radarUrl = '/mock/radarData'
export const heatMapUrl = '/mock/heatMapData'
export const scatterBasicUrl = '/mock/scatterBasic'
export const mapUrl = '/mock/map'
export const capsuleUrl = '/mock/capsule'
export const wordCloudUrl = '/mock/wordCloud'
export const treemapUrl = '/mock/treemap'
export const threeEarth01Url = '/mock/threeEarth01Data'
const mockObject: MockMethod[] = [
{
@@ -81,6 +83,11 @@ const mockObject: MockMethod[] = [
method: RequestHttpEnum.GET,
response: () => test.fetchMap
},
{
url: capsuleUrl,
method: RequestHttpEnum.GET,
response: () => test.fetchCapsule
},
{
url: wordCloudUrl,
method: RequestHttpEnum.GET,
@@ -91,6 +98,11 @@ const mockObject: MockMethod[] = [
method: RequestHttpEnum.GET,
response: () => test.fetchTreemap
},
{
url: threeEarth01Url,
method: RequestHttpEnum.GET,
response: () => test.threeEarth01Data
},
]
export default mockObject

View File

@@ -1,79 +1,9 @@
{
"point": [
"markers|50": [
{
"name": "北京",
"value": [116.405285, 39.904989, 200]
},
{
"name": "郑州",
"value": [113.665412, 34.757975, 888]
},
{
"name": "青海",
"value": [101.778916, 36.623178, 666]
},
{
"name": "宁夏回族自治区",
"value": [106.278179, 38.46637, 66]
},
{
"name": "哈尔滨市",
"value": [126.642464, 45.756967, 101]
"name": "某某地市",
"value": "@integer(2, 20)",
"position": ["@float(115, 117, 1, 6)", "@float(38, 40, 1, 6)"]
}
],
"map": [
{
"name": "北京市",
"value": "@integer(0, 1000)"
},
{
"name": "河北省",
"value": "@integer(0, 1000)"
},
{
"name": "江苏省",
"value": "@integer(0, 1000)"
},
{
"name": "福建省",
"value": "@integer(0, 1000)"
},
{
"name": "山东省",
"value": "@integer(0, 1000)"
},
{
"name": "河南省",
"value": "@integer(0, 1000)"
},
{
"name": "湖北省",
"value": "@integer(0, 1000)"
},
{
"name": "广西壮族自治区",
"value": "@integer(0, 1000)"
},
{
"name": "海南省",
"value": "@integer(0, 1000)"
},
{
"name": "青海省",
"value": "@integer(0, 1000)"
},
{
"name": "新疆维吾尔自治区",
"value": "@integer(0, 1000)"
}
],
"pieces": [
{ "gte": 1000, "label": ">1000" },
{ "gte": 600, "lte": 999, "label": "600-999" },
{ "gte": 200, "lte": 599, "label": "200-599" },
{ "gte": 50, "lte": 199, "label": "49-199" },
{ "gte": 10, "lte": 49, "label": "10-49" },
{ "lte": 9, "label": "<9" }
]
}

View File

@@ -10,28 +10,8 @@ export default {
status: 200,
msg: '请求成功',
data: {
dimensions: ['product', 'dataOne'],
source: [
{
product: '@name',
'dataOne|0-900': 3
},
{
product: '@name',
'dataOne|0-900': 3
},
{
product: '@name',
'dataOne|0-900': 3
},
{
product: '@name',
'dataOne|0-900': 3
},
{
product: '@name',
'dataOne|0-900': 3
},
dimensions: ['product', 'dataOne'],
'source|20': [
{
product: '@name',
'dataOne|0-900': 3
@@ -39,43 +19,31 @@ export default {
]
}
},
// 胶囊图
fetchCapsule: {
code: 0,
status: 200,
msg: '请求成功',
data: {
dimensions: ['name', 'value'],
"source|2-5": [
{ 'name|+1': ["厦门","福州","北京","上海","新疆","郑州","湖南","内蒙古"], 'value|0-40': 20 },
]
}
},
// 图表
fetchMockData: {
code: 0,
status: 200,
msg: '请求成功',
data: {
dimensions: ['product', 'dataOne', 'dataTwo'],
source: [
dimensions: ['product', 'dataOne', 'dataTwo', 'dataThree'],
'source|20': [
{
product: '@name',
'dataOne|100-900': 3,
'dataTwo|100-900': 3
},
{
product: '@name',
'dataOne|100-900': 3,
'dataTwo|100-900': 3
},
{
product: '@name',
'dataOne|100-900': 3,
'dataTwo|100-900': 3
},
{
product: '@name',
'dataOne|100-900': 3,
'dataTwo|100-900': 3
},
{
product: '@name',
'dataOne|100-900': 3,
'dataTwo|100-900': 3
},
{
product: '@name',
'dataOne|100-900': 3,
'dataTwo|100-900': 3
'dataTwo|100-900': 3,
'dataThree|100-900': 3
}
]
}
@@ -85,21 +53,7 @@ export default {
code: 0,
status: 200,
msg: '请求成功',
data: [
{ name: '@name', 'value|100-900': 5 },
{ name: '@name', 'value|100-900': 5 },
{ name: '@name', 'value|100-900': 5 },
{ name: '@name', 'value|100-900': 5 },
{ name: '@name', 'value|100-900': 5 },
{ name: '@name', 'value|100-900': 5 },
{ name: '@name', 'value|100-900': 5 },
{ name: '@name', 'value|100-900': 5 },
{ name: '@name', 'value|100-900': 5 },
{ name: '@name', 'value|100-900': 5 },
{ name: '@name', 'value|100-900': 5 },
{ name: '@name', 'value|100-900': 5 },
{ name: '@name', 'value|100-900': 5 }
]
'data|50': [{ name: '@name', 'value|100-900': 5 }]
},
// 轮播表格
fetchScrollBoard: {
@@ -254,4 +208,16 @@ export default {
msg: '请求成功',
data: tTreemapJson
},
// 三维地球
threeEarth01Data: {
code: 0,
status: 200,
msg: '请求成功',
data: [
{
startArray: { name: '@name', N: '@integer(10, 100)', E: '@integer(10, 100)' },
'endArray|10': [{ name: '@name', N: '@integer(10, 100)', E: '@integer(10, 100)' }]
}
]
}
}

View File

@@ -1,84 +1,98 @@
import { http } from '@/api/http'
import { httpErrorHandle } from '@/utils'
import { ContentTypeEnum, RequestHttpEnum, ModuleTypeEnum } from '@/enums/httpEnum'
import { ProjectItem, ProjectDetail } from './project'
// * 项目列表
export const projectListApi = async (data: object) => {
try {
const res = await http(RequestHttpEnum.GET)(`${ModuleTypeEnum.PROJECT}/list`, data);
return res;
try {
const res = await http(RequestHttpEnum.GET)<ProjectItem[]>(`${ModuleTypeEnum.PROJECT}/list`, data)
return res
} catch {
httpErrorHandle();
httpErrorHandle()
}
}
// * 新增项目
export const createProjectApi = async (data: object) => {
try {
const res = await http(RequestHttpEnum.POST)(`${ModuleTypeEnum.PROJECT}/create`, data);
return res;
try {
const res = await http(RequestHttpEnum.POST)<{
/**
* 项目id
*/
id: number
}>(`${ModuleTypeEnum.PROJECT}/create`, data)
return res
} catch {
httpErrorHandle();
httpErrorHandle()
}
}
// * 获取项目
export const fetchProjectApi = async (data: object) => {
try {
const res = await http(RequestHttpEnum.GET)(`${ModuleTypeEnum.PROJECT}/getData`, data);
return res;
try {
const res = await http(RequestHttpEnum.GET)<ProjectDetail>(`${ModuleTypeEnum.PROJECT}/getData`, data)
return res
} catch {
httpErrorHandle();
httpErrorHandle()
}
}
// * 保存项目
export const saveProjectApi = async (data: object) => {
try {
const res = await http(RequestHttpEnum.POST)(`${ModuleTypeEnum.PROJECT}/save/data`, data, ContentTypeEnum.FORM_URLENCODED);
return res;
try {
const res = await http(RequestHttpEnum.POST)(
`${ModuleTypeEnum.PROJECT}/save/data`,
data,
ContentTypeEnum.FORM_URLENCODED
)
return res
} catch {
httpErrorHandle();
httpErrorHandle()
}
}
// * 修改项目基础信息
export const updateProjectApi = async (data: object) => {
try {
const res = await http(RequestHttpEnum.POST)(`${ModuleTypeEnum.PROJECT}/edit`, data);
return res;
const res = await http(RequestHttpEnum.POST)(`${ModuleTypeEnum.PROJECT}/edit`, data)
return res
} catch {
httpErrorHandle();
httpErrorHandle()
}
}
// * 删除项目
export const deleteProjectApi = async (data: object) => {
try {
const res = await http(RequestHttpEnum.DELETE)(`${ModuleTypeEnum.PROJECT}/delete`, data);
return res;
try {
const res = await http(RequestHttpEnum.DELETE)(`${ModuleTypeEnum.PROJECT}/delete`, data)
return res
} catch {
httpErrorHandle();
httpErrorHandle()
}
}
// * 修改发布状态 [-1未发布,1发布]
export const changeProjectReleaseApi = async (data: object) => {
try {
const res = await http(RequestHttpEnum.PUT)(`${ModuleTypeEnum.PROJECT}/publish`, data);
return res;
try {
const res = await http(RequestHttpEnum.PUT)(`${ModuleTypeEnum.PROJECT}/publish`, data)
return res
} catch {
httpErrorHandle();
httpErrorHandle()
}
}
// * 上传文件
export const uploadFile = async (url:string, data: object) => {
try {
const res = await http(RequestHttpEnum.POST)(url, data, ContentTypeEnum.FORM_DATA);
return res;
export const uploadFile = async (data: object) => {
try {
const res = await http(RequestHttpEnum.POST)<{
/**
* 文件地址
*/
fileName: string
}>(`${ModuleTypeEnum.PROJECT}/upload`, data, ContentTypeEnum.FORM_DATA)
return res
} catch {
httpErrorHandle();
httpErrorHandle()
}
}
}

39
src/api/path/project.d.ts vendored Normal file
View File

@@ -0,0 +1,39 @@
export type ProjectItem = {
/**
* 项目 id
*/
id: string
/**
* 项目名称
*/
projectName: string
/**
* 项目状态:\
* -1: 未发布\
* 1: 已发布
*/
state: number
/**
* 创建时间
*/
createTime: string
/**
* 预览图片url
*/
indexImage: string
/**
* 创建者 id
*/
createUserId: string
/**
* 项目备注
*/
remarks: string
}
export interface ProjectDetail extends ProjectItem {
/**
* 项目参数
*/
content: string
}

View File

@@ -1,33 +1,39 @@
import { http } from '@/api/http'
import { httpErrorHandle } from '@/utils'
import { RequestHttpEnum, ModuleTypeEnum } from '@/enums/httpEnum'
import { LoginResult } from './system'
// * 登录
export const loginApi = async (data: object) => {
try {
const res = await http(RequestHttpEnum.POST)(`${ModuleTypeEnum.SYSTEM}/login`, data);
return res;
} catch(err) {
httpErrorHandle();
const res = await http(RequestHttpEnum.POST)<LoginResult>(`${ModuleTypeEnum.SYSTEM}/login`, data)
return res
} catch (err) {
httpErrorHandle()
}
}
// * 登出
export const logoutApi = async () => {
try {
const res = await http(RequestHttpEnum.GET)(`${ModuleTypeEnum.SYSTEM}/logout`);
return res;
} catch(err) {
httpErrorHandle();
const res = await http(RequestHttpEnum.GET)(`${ModuleTypeEnum.SYSTEM}/logout`)
return res
} catch (err) {
httpErrorHandle()
}
}
// * 获取 oss 上传接口
export const ossUrlApi = async (data: object) => {
try {
const res = await http(RequestHttpEnum.GET)(`${ModuleTypeEnum.SYSTEM}/getOssInfo`, data);
return res;
} catch(err) {
httpErrorHandle();
const res = await http(RequestHttpEnum.GET)<{
/**
* bucket 地址
*/
bucketURL?: string
}>(`${ModuleTypeEnum.SYSTEM}/getOssInfo`, data)
return res
} catch (err) {
httpErrorHandle()
}
}
}

26
src/api/path/system.d.ts vendored Normal file
View File

@@ -0,0 +1,26 @@
export interface LoginResult {
token: {
/**
* token 值
*/
tokenValue: string
/**
* token key
*/
tokenName: string
}
userinfo: {
/**
* 昵称
*/
nickname: string
/**
* 用户名
*/
username: string
/**
* 用户 id
*/
id: string
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -14,16 +14,19 @@
</template>
<script lang="ts" setup>
import { useI18n } from "vue-i18n";
import { useLangStore } from '@/store/modules/langStore/langStore'
import { langList } from '@/i18n/index'
import { LangEnum } from '@/enums/styleEnum'
import { icon } from '@/plugins'
const { LanguageIcon } = icon.ionicons5
const { locale } = useI18n();
const langStore = useLangStore()
const options = langList
const handleSelect = (key: LangEnum) => {
locale.value = key;
langStore.changeLang(key)
}
</script>

View File

@@ -1,5 +1,5 @@
<template>
<n-modal v-model:show="modelShow" @afterLeave="closeHandle">
<n-modal v-model:show="modelShowRef" @afterLeave="closeHandle">
<n-list bordered class="go-system-info">
<template #header>
<n-space justify="space-between">
@@ -11,7 +11,7 @@
</template>
<n-list-item>
<n-space :size="20">
<n-space class="go-my-2" :size="20">
<n-text class="item-left">版权声明</n-text>
<n-text>
GoView 版权属于
@@ -21,8 +21,7 @@
</n-list-item>
<n-list-item>
<n-divider style="margin-top: 0" />
<n-space :size="20">
<n-space class="go-my-2" :size="20">
<n-text class="item-left">协议备注</n-text>
<n-text>
请遵守开源 MIT 协议以上声明 <n-text type="error">不可删除</n-text>否则视作侵权行为后果自负
@@ -31,8 +30,7 @@
</n-list-item>
<n-list-item>
<n-divider style="margin-top: 0" />
<n-space :size="20">
<n-space class="go-mt-2" :size="20">
<n-text class="item-left">商业授权</n-text>
<n-text>
若不想保留版权声明请通过仓库/交流群 联系项目作者进行授权
@@ -44,15 +42,21 @@
</template>
<script lang="ts" setup>
import { ref, watch } from 'vue'
import { icon } from '@/plugins'
const { HelpOutlineIcon, CloseIcon } = icon.ionicons5
const emit = defineEmits(['update:modelShow'])
defineProps({
const props = defineProps({
modelShow: Boolean
})
const emit = defineEmits(['update:modelShow'])
const { HelpOutlineIcon, CloseIcon } = icon.ionicons5
const modelShowRef = ref(false)
watch(() => props.modelShow, (newValue) => {
modelShowRef.value = newValue
})
const closeHandle = () => {
emit('update:modelShow', false)
}

View File

@@ -1,5 +1,5 @@
<template>
<n-modal v-model:show="modelShow" @afterLeave="closeHandle">
<n-modal v-model:show="modelShowRef" @afterLeave="closeHandle">
<n-list bordered class="go-system-setting">
<template #header>
<n-space justify="space-between">
@@ -69,21 +69,20 @@
</template>
<script script lang="ts" setup>
import { reactive } from 'vue'
import { reactive, ref, watch } from 'vue'
import { ListType } from './index.d'
import { useSettingStore } from '@/store/modules/settingStore/settingStore'
import { SettingStoreEnums, ToolsStatusEnum } from '@/store/modules/settingStore/settingStore.d'
import { icon } from '@/plugins'
const { HelpOutlineIcon, CloseIcon } = icon.ionicons5
const emit = defineEmits(['update:modelShow'])
defineProps({
const props = defineProps({
modelShow: Boolean
})
const emit = defineEmits(['update:modelShow'])
const { HelpOutlineIcon, CloseIcon } = icon.ionicons5
const settingStore = useSettingStore()
const modelShowRef = ref(false)
const list = reactive<ListType[]>([
{
@@ -168,6 +167,10 @@ const list = reactive<ListType[]>([
}
])
watch(() => props.modelShow, (newValue) => {
modelShowRef.value = newValue
})
const closeHandle = () => {
emit('update:modelShow', false)
}

View File

@@ -27,7 +27,9 @@
<script lang="ts" setup>
import { h, ref } from 'vue'
import { NAvatar, NText } from 'naive-ui'
import { renderIcon } from '@/utils'
import { renderIcon, getLocalStorage } from '@/utils'
import { SystemStoreEnum, SystemStoreUserInfoEnum } from '@/store/modules/systemStore/systemStore.d'
import { StorageEnum } from '@/enums/storageEnum'
import { logout, renderLang } from '@/utils'
import { GoSystemSet } from '@/components/GoSystemSet/index'
import { GoSystemInfo } from '@/components/GoSystemInfo/index'
@@ -64,7 +66,17 @@ const renderUserInfo = () => {
}),
h('div', null, [
h('div', null, [
h(NText, { depth: 2 }, { default: () => '奔跑的面条' })
h(NText, { depth: 2 }, {
default: () => {
const info = getLocalStorage(StorageEnum.GO_SYSTEM_STORE)
if (info) {
return info[SystemStoreEnum.USER_INFO][SystemStoreUserInfoEnum.USER_NAME];
}
else {
return 'admin';
}
}
})
])
])
]
@@ -137,4 +149,4 @@ const handleSelect = (key: string) => {
cursor: pointer;
transform: scale(0.7);
}
</style>
</style>

View File

@@ -0,0 +1,3 @@
import ChartGlobImage from './index.vue'
export { ChartGlobImage }

View File

@@ -0,0 +1,31 @@
<template>
<img class="list-img" v-lazy="imageInfo" alt="图表图片" />
</template>
<script setup lang="ts">
import { ref, PropType, watch } from 'vue'
import { fetchImages } from '@/packages'
import { ConfigType } from '@/packages/index.d'
const props = defineProps({
chartConfig: {
type: Object as PropType<ConfigType>,
required: true
}
})
const imageInfo = ref('')
// 获取图片
const fetchImageUrl = async () => {
imageInfo.value = await fetchImages(props.chartConfig)
}
watch(
() => props.chartConfig.key,
() => fetchImageUrl(),
{
immediate: true
}
)
</script>

View File

@@ -0,0 +1,45 @@
<template>
<n-radio-group :value="props.modelValue || INHERIT_VALUE" @update:value="handleChange">
<n-space>
<n-tooltip :show-arrow="false" trigger="hover" v-for="item in rendererList" :key="item.value">
<template #trigger>
<n-radio :value="item.value">
{{ item.value }}
</n-radio>
</template>
{{ item.desc }}
</n-tooltip>
</n-space>
</n-radio-group>
</template>
<script setup lang="ts">
import { type EchartsRenderer } from '@/settings/chartThemes'
const props = defineProps<{ modelValue?: EchartsRenderer; includeInherit?: boolean }>()
const emits = defineEmits(['update:modelValue'])
const INHERIT_VALUE = 'inherit'
const handleChange = (val: EchartsRenderer & typeof INHERIT_VALUE) => {
emits('update:modelValue', val === INHERIT_VALUE ? undefined : val)
}
const rendererList = [
{
value: 'svg',
desc: '在缩放场景下具有更好的表现'
},
{
value: 'canvas',
desc: '数据量较大(经验判断 > 1k、较多交互时建议选择'
},
...(props.includeInherit
? [
{
value: INHERIT_VALUE,
desc: '默认继承全局配置'
}
]
: [])
]
</script>

View File

@@ -1,4 +1,34 @@
<template>
<collapse-item name="渲染器">
<setting-item-box :alone="true">
<template #name>
<n-text>全局</n-text>
<n-tooltip trigger="hover">
<template #trigger>
<n-icon size="21" :depth="3">
<help-outline-icon></help-outline-icon>
</n-icon>
</template>
<n-text>所有echarts图表组件默认都将采用所选的渲染器进行渲染</n-text>
</n-tooltip>
</template>
<EchartsRendererSetting v-model="themeSetting.renderer" />
</setting-item-box>
<setting-item-box :alone="true">
<template #name>
<n-text>当前</n-text>
<n-tooltip trigger="hover">
<template #trigger>
<n-icon size="21" :depth="3">
<help-outline-icon></help-outline-icon>
</n-icon>
</template>
<n-text>仅当前组件采用指定渲染器渲染</n-text>
</n-tooltip>
</template>
<EchartsRendererSetting v-model="optionData.renderer" includeInherit />
</setting-item-box>
</collapse-item>
<collapse-item v-if="title" name="标题">
<template #header>
<n-switch v-model:value="title.show" size="small"></n-switch>
@@ -21,6 +51,23 @@
</setting-item-box>
</collapse-item>
<collapse-item v-if="grid" name="容器">
<setting-item-box name="距离">
<setting-item name="左侧距离">
<n-input v-model:value="grid.left" size="small"></n-input>
</setting-item>
<setting-item name="右侧距离">
<n-input v-model:value="grid.right" size="small"></n-input>
</setting-item>
<setting-item name="上侧距离">
<n-input v-model:value="grid.top" size="small"></n-input>
</setting-item>
<setting-item name="下侧距离">
<n-input v-model:value="grid.bottom" size="small"></n-input>
</setting-item>
</setting-item-box>
</collapse-item>
<collapse-item v-if="xAxis" name="X轴">
<template #header>
<n-switch v-model:value="xAxis.show" size="small"></n-switch>
@@ -51,6 +98,9 @@
<setting-item name="大小">
<n-input-number v-model:value="xAxis.axisLabel.fontSize" :min="8" size="small"></n-input-number>
</setting-item>
<setting-item name="偏移量">
<n-input-number v-model:value="xAxis.axisLabel.rotate" :min="-90" :max="90" size="small"></n-input-number>
</setting-item>
</setting-item-box>
<setting-item-box name="轴线">
<setting-item name="展示">
@@ -140,6 +190,9 @@
<setting-item name="大小">
<n-input-number v-model:value="yAxis.axisLabel.fontSize" :min="8" size="small"></n-input-number>
</setting-item>
<setting-item name="偏移量">
<n-input-number v-model:value="yAxis.axisLabel.rotate" :min="-90" :max="90" size="small"></n-input-number>
</setting-item>
</setting-item-box>
<setting-item-box name="轴线">
<setting-item name="展示">
@@ -260,6 +313,11 @@ import { PropType, computed } from 'vue'
import { GlobalThemeJsonType } from '@/settings/chartThemes/index'
import { axisConfig } from '@/packages/chartConfiguration/echarts/index'
import { CollapseItem, SettingItemBox, SettingItem, GlobalSettingPosition } from '@/components/Pages/ChartItemSetting'
import { icon } from '@/plugins'
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
import EchartsRendererSetting from './EchartsRendererSetting.vue'
const { HelpOutlineIcon } = icon.ionicons5
const props = defineProps({
optionData: {
@@ -273,6 +331,12 @@ const props = defineProps({
}
})
const chartEditStore = useChartEditStore()
const themeSetting = computed(() => {
const chartThemeSetting = chartEditStore.getEditCanvasConfig.chartThemeSetting
return chartThemeSetting
})
const title = computed(() => {
return props.optionData.title
})
@@ -289,6 +353,10 @@ const legend = computed(() => {
return props.optionData.legend
})
const grid = computed(() => {
return props.optionData.grid
})
const visualMap = computed(() => {
return props.optionData.visualMap
})

View File

@@ -1,5 +1,5 @@
<template>
<setting-item-box name="位置">
<setting-item-box v-if="targetData" name="位置">
<setting-item :name="`偏移 X${targetData.left || 0}px`">
<n-input-number v-model:value="targetData.left" size="small" step="10"></n-input-number>
</setting-item>

View File

@@ -1,4 +1,5 @@
import Flipper from './index.vue'
type FlipType = 'up' | 'down'
export { Flipper, FlipType }

View File

@@ -1,19 +1,13 @@
<template>
<div class="M-Flipper" :class="[flipType, { go: isFlipping }]">
<div class="go-Flipper" :class="[flipType, { go: isFlipping }]">
<div class="digital front" :data-front="frontTextFromData"></div>
<div class="digital back" :data-back="backTextFromData"></div>
</div>
</template>
<script lang="ts">
export default {
name: 'Flipper'
}
</script>
<script lang="ts" setup>
import { ref, PropType, watch } from 'vue'
import { FlipType } from '.'
import { FlipType } from './index'
const props = defineProps({
flipType: {
@@ -131,7 +125,7 @@ $lineColor: #4a9ef8;
}
// #endregion
.M-Flipper {
.go-Flipper {
display: inline-block;
position: relative;
width: $width;

View File

@@ -99,6 +99,7 @@ const colorSelectHandle = (color: AppThemeColorType) => {
overflow: hidden;
border-radius: 5px;
@extend .go-background-filter-shallow;
backdrop-filter: none;
}
&-color {
width: 8px;

View File

@@ -36,7 +36,7 @@
</div>
<div class="model-footer">
中国色列表来自于
<n-a href="http://zhongguose.com">http://zhongguose.com</n-a>
<n-a href="http://zhongguose.com" target="_blank">http://zhongguose.com</n-a>
</div>
</div>
</n-modal>
@@ -157,6 +157,7 @@ $height: 85vh;
}
}
.model-footer {
z-index: 1;
text-align: end;
}
}

View File

@@ -9,6 +9,13 @@ export enum DragKeyEnum {
DRAG_KEY = 'ChartData'
}
// 不同页面保存操作
export enum SavePageEnum {
CHART = 'SaveChart',
JSON = 'SaveJSON',
CLOSE = 'close'
}
// 操作枚举
export enum MenuEnum {
// 移动
@@ -60,7 +67,8 @@ export enum WinKeyboard {
ALT = ' alt',
CTRL_SOURCE_KEY = 'control',
SHIFT_SOURCE_KEY = 'shift',
ALT_SOURCE_KEY = 'alt'
ALT_SOURCE_KEY = 'alt',
SPACE = 'Space'
}
// Mac 键盘枚举
@@ -71,7 +79,8 @@ export enum MacKeyboard {
ALT = '⌥',
CTRL_SOURCE_KEY = '⌘',
SHIFT_SOURCE_KEY = '⇧',
ALT_SOURCE_KEY = '⌥'
ALT_SOURCE_KEY = '⌥',
SPACE = 'Space'
}
// 同步状态枚举

59
src/enums/eventEnum.ts Normal file
View File

@@ -0,0 +1,59 @@
// 基础事件类型(vue不加 on)
export enum BaseEvent {
// 点击
ON_CLICK = 'click',
// 双击
ON_DBL_CLICK = 'dblclick',
// 移入
ON_MOUSE_ENTER = 'mouseenter',
// 移出
ON_MOUSE_LEAVE = 'mouseleave'
}
// 组件交互回调事件
export enum InteractEvents {
INTERACT_ON = 'interactOn',
INTERACT_COMPONENT_ID = 'interactComponentId',
INTERACT_FN = 'interactFn'
}
// 全局组件交互回调事件触发的类型(当然可以自定义名称)
export enum InteractEventOn {
CLICK = 'click',
CHANGE = 'change'
}
// 确定交互组件触发类型 key名称
export const COMPONENT_INTERACT_EVENT_KET = 'componentInteractEventKey'
// 交互式组件的触发配置
export type InteractActionsType = {
interactType: InteractEventOn
interactName: string
componentEmitEvents: { [T: string]: { value: any; label: string }[] }
}
// vue3 生命周期事件
export enum EventLife {
// 渲染之后
VNODE_MOUNTED = 'vnodeMounted',
// 渲染之前
VNODE_BEFORE_MOUNT = 'vnodeBeforeMount'
}
// 内置字符串函数对象列表
export const excludeParseEventKeyList = [
EventLife.VNODE_BEFORE_MOUNT,
EventLife.VNODE_MOUNTED,
BaseEvent.ON_CLICK,
BaseEvent.ON_DBL_CLICK,
BaseEvent.ON_MOUSE_ENTER,
BaseEvent.ON_MOUSE_LEAVE,
//过滤器
'filter'
]
// 内置字符串函数键值列表
export const excludeParseEventValueList = [
// 请求里的函数语句
'javascript:'
]

View File

@@ -20,7 +20,9 @@ export enum RequestDataTypeEnum {
// 静态数据
STATIC = 0,
// 请求数据
AJAX = 1
AJAX = 1,
// 数据池
Pond = 2
}
// 请求主体类型

View File

@@ -12,6 +12,12 @@ export enum PreviewEnum {
CHART_PREVIEW_NAME = 'ChartPreview',
}
export enum EditEnum {
// 图表JSON编辑
CHART_EDIT = '/chart/edit/:id(.*)*',
CHART_EDIT_NAME = 'ChartEdit',
}
export enum PageEnum {
// 登录
BASE_LOGIN = '/login',

View File

@@ -2,4 +2,8 @@ export * from '@/hooks/useTheme.hook'
export * from '@/hooks/usePreviewScale.hook'
export * from '@/hooks/useCode.hook'
export * from '@/hooks/useChartDataFetch.hook'
export * from '@/hooks/useSystemInit.hook'
export * from '@/hooks/useSystemInit.hook'
export * from '@/hooks/useChartDataPondFetch.hook'
export * from '@/hooks/useLifeHandler.hook'
export * from '@/hooks/useLang.hook'
export * from '@/hooks/useChartInteract.hook'

View File

@@ -0,0 +1,26 @@
import { inject, type Ref } from 'vue'
import { EchartsRenderer } from '@/settings/chartThemes'
import { SCALE_KEY } from '@/views/preview/hooks/useScale.hook'
import { use } from 'echarts/core'
import { CanvasRenderer, SVGRenderer } from 'echarts/renderers'
use([CanvasRenderer, SVGRenderer])
type InitOptions = {
renderer: EchartsRenderer
devicePixelRatio?: number
}
// 获取需要给当前echarts组件设置什么初始值
export function useCanvasInitOptions(option: any, themeSetting: any) {
const renderer = option.renderer || themeSetting.renderer
const initOptions: InitOptions = { renderer }
const scaleRef = inject<Ref<{ width: number; height: number }>>(SCALE_KEY) || { value: { width: 1, height: 1 } }
if (renderer === 'canvas') {
initOptions.devicePixelRatio = Math.ceil(
Math.max(window.devicePixelRatio, scaleRef.value.width, scaleRef.value.height)
)
}
return initOptions
}

View File

@@ -1,10 +1,12 @@
import { ref, toRefs, toRaw } from 'vue'
import { ref, toRefs, toRaw, watch } from 'vue'
import type VChart from 'vue-echarts'
import { customizeHttp } from '@/api/http'
import { useChartDataPondFetch } from '@/hooks/'
import { CreateComponentType, ChartFrameEnum } from '@/packages/index.d'
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
import { RequestDataTypeEnum } from '@/enums/httpEnum'
import { isPreview, newFunctionHandle, intervalUnitHandle } from '@/utils'
import { setOption } from '@/packages/public/chart'
// 获取类型
type ChartEditStoreType = typeof useChartEditStore
@@ -23,6 +25,21 @@ export const useChartDataFetch = (
const vChartRef = ref<typeof VChart | null>(null)
let fetchInterval: any = 0
// 数据池
const { addGlobalDataInterface } = useChartDataPondFetch()
// 组件类型
const { chartFrame } = targetComponent.chartConfig
// eCharts 组件配合 vChart 库更新方式
const echartsUpdateHandle = (dataset: any) => {
if (chartFrame === ChartFrameEnum.ECHARTS) {
if (vChartRef.value) {
setOption(vChartRef.value, { dataset: dataset })
}
}
}
const requestIntervalFn = () => {
const chartEditStore = useChartEditStore()
@@ -41,9 +58,6 @@ export const useChartDataFetch = (
requestInterval: targetInterval
} = toRefs(targetComponent.request)
// 组件类型
const { chartFrame } = targetComponent.chartConfig
// 非请求类型
if (requestDataType.value !== RequestDataTypeEnum.AJAX) return
@@ -58,19 +72,14 @@ export const useChartDataFetch = (
clearInterval(fetchInterval)
const fetchFn = async () => {
const res = await customizeHttp(toRaw(targetComponent.request), toRaw(chartEditStore.requestGlobalConfig))
if (res && res.data) {
const res = await customizeHttp(toRaw(targetComponent.request), toRaw(chartEditStore.getRequestGlobalConfig))
if (res) {
try {
const filter = targetComponent.filter
// eCharts 组件配合 vChart 库更新方式
if (chartFrame === ChartFrameEnum.ECHARTS) {
if (vChartRef.value) {
vChartRef.value.setOption({ dataset: newFunctionHandle(res.data, filter) })
}
}
echartsUpdateHandle(newFunctionHandle(res?.data, res, filter))
// 更新回调函数
if (updateCallback) {
updateCallback(newFunctionHandle(res.data, filter))
updateCallback(newFunctionHandle(res?.data, res, filter))
}
} catch (error) {
console.error(error)
@@ -78,8 +87,17 @@ export const useChartDataFetch = (
}
}
// 立即调用
fetchFn()
// 普通初始化与组件交互处理监听
watch(
() => targetComponent.request,
() => {
fetchFn()
},
{
immediate: true,
deep: true
}
)
// 定时时间
const time = targetInterval && targetInterval.value ? targetInterval.value : globalRequestInterval.value
@@ -90,10 +108,15 @@ export const useChartDataFetch = (
}
// eslint-disable-next-line no-empty
} catch (error) {
console.log(error);
console.log(error)
}
}
isPreview() && requestIntervalFn()
if (isPreview()) {
// 判断是否是数据池类型
targetComponent.request.requestDataType === RequestDataTypeEnum.Pond
? addGlobalDataInterface(targetComponent, useChartEditStore, updateCallback || echartsUpdateHandle)
: requestIntervalFn()
}
return { vChartRef }
}

View File

@@ -0,0 +1,115 @@
import { toRaw } from 'vue'
import { customizeHttp } from '@/api/http'
import { CreateComponentType } from '@/packages/index.d'
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
import { RequestGlobalConfigType, RequestDataPondItemType } from '@/store/modules/chartEditStore/chartEditStore.d'
import { newFunctionHandle, intervalUnitHandle } from '@/utils'
// 获取类型
type ChartEditStoreType = typeof useChartEditStore
// 数据池存储的数据类型
type DataPondMapType = {
updateCallback: (...args: any) => any
filter?: string | undefined
}
// 数据池 Map 中请求对应 callback
const mittDataPondMap = new Map<string, DataPondMapType[]>()
// 创建单个数据项轮询接口
const newPondItemInterval = (
requestGlobalConfig: RequestGlobalConfigType,
requestDataPondItem: RequestDataPondItemType,
dataPondMapItem?: DataPondMapType[]
) => {
if (!dataPondMapItem) return
let fetchInterval: any = 0
clearInterval(fetchInterval)
// 请求
const fetchFn = async () => {
try {
const res = await customizeHttp(toRaw(requestDataPondItem.dataPondRequestConfig), toRaw(requestGlobalConfig))
if (res) {
try {
// 遍历更新回调函数
dataPondMapItem.forEach(item => {
item.updateCallback(newFunctionHandle(res?.data, res, item.filter))
})
} catch (error) {
console.error(error)
return error
}
}
} catch (error) {
return error
}
}
// 立即调用
fetchFn()
const targetInterval = requestDataPondItem.dataPondRequestConfig.requestInterval
const targetUnit = requestDataPondItem.dataPondRequestConfig.requestIntervalUnit
const globalRequestInterval = requestGlobalConfig.requestInterval
const globalUnit = requestGlobalConfig.requestIntervalUnit
// 定时时间
const time = targetInterval ? targetInterval : globalRequestInterval
// 单位
const unit = targetInterval ? targetUnit : globalUnit
// 开启轮询
if (time) fetchInterval = setInterval(fetchFn, intervalUnitHandle(time, unit))
}
/**
* 数据池接口处理
*/
export const useChartDataPondFetch = () => {
// 新增全局接口
const addGlobalDataInterface = (
targetComponent: CreateComponentType,
useChartEditStore: ChartEditStoreType,
updateCallback: (...args: any) => any
) => {
const chartEditStore = useChartEditStore()
const { requestDataPond } = chartEditStore.getRequestGlobalConfig
// 组件对应的数据池 Id
const requestDataPondId = targetComponent.request.requestDataPondId as string
// 新增数据项
const mittPondIdArr = mittDataPondMap.get(requestDataPondId) || []
mittPondIdArr.push({
updateCallback: updateCallback,
filter: targetComponent.filter
})
mittDataPondMap.set(requestDataPondId, mittPondIdArr)
}
// 清除旧数据
const clearMittDataPondMap = () => {
mittDataPondMap.clear()
}
// 初始化数据池
const initDataPond = (requestGlobalConfig: RequestGlobalConfigType) => {
const { requestDataPond } = requestGlobalConfig
// 根据 mapId 查找对应的数据池配置
for (let pondKey of mittDataPondMap.keys()) {
const requestDataPondItem = requestDataPond.find(item => item.dataPondId === pondKey)
if (requestDataPondItem) {
newPondItemInterval(requestGlobalConfig, requestDataPondItem, mittDataPondMap.get(pondKey))
}
}
}
return {
addGlobalDataInterface,
clearMittDataPondMap,
initDataPond
}
}

View File

@@ -0,0 +1,40 @@
import { toRefs } from 'vue'
import { CreateComponentType } from '@/packages/index.d'
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
// 获取类型
type ChartEditStoreType = typeof useChartEditStore
// Params 参数修改触发 api 更新图表请求
export const useChartInteract = (
chartConfig: CreateComponentType,
useChartEditStore: ChartEditStoreType,
param: { [T: string]: any },
interactEventOn: string
) => {
const chartEditStore = useChartEditStore()
const { interactEvents } = chartConfig.events
const fnOnEvent = interactEvents.filter(item => {
return item.interactOn === interactEventOn
})
if (fnOnEvent.length === 0) return
fnOnEvent.forEach(item => {
const index = chartEditStore.fetchTargetIndex(item.interactComponentId)
if (index === -1) return
const { Params, Header } = toRefs(chartEditStore.componentList[index].request.requestParams)
Object.keys(item.interactFn).forEach(key => {
if (Params.value[key]) {
Params.value[key] = param[item.interactFn[key]]
}
if (Header.value[key]) {
Header.value[key] = param[item.interactFn[key]]
}
})
})
}
// 联动事件触发的 type 变更时,清除当前绑定内容
export const clearInteractEvent = (chartConfig: CreateComponentType) => {
}

24
src/hooks/useLang.hook.ts Normal file
View File

@@ -0,0 +1,24 @@
import { computed } from 'vue'
import { LangEnum } from '@/enums/styleEnum'
import { useLangStore } from '@/store/modules/langStore/langStore'
import { zhCN, enUS, dateEnUS, dateZhCN } from 'naive-ui'
type LangStoreType = typeof useLangStore
// 语言切换
export const useLang = () => {
const lang = useLangStore()
const locale = computed(() => {
return lang.getLang === LangEnum.ZH ? zhCN : enUS
})
const dateLocale = computed(() => {
return lang.getLang === LangEnum.ZH ? dateZhCN : dateEnUS
})
return {
locale,
dateLocale
}
}

View File

@@ -0,0 +1,79 @@
import { CreateComponentType, CreateComponentGroupType } from '@/packages/index.d'
import { EventLife } from '@/enums/eventEnum'
import * as echarts from 'echarts'
// 所有图表组件集合对象
const components: { [K in string]?: any } = {}
// 项目提供的npm 包变量
export const npmPkgs = { echarts }
// 组件事件处理 hook
export const useLifeHandler = (chartConfig: CreateComponentType | CreateComponentGroupType) => {
if (!chartConfig.events) return {}
// 处理基础事件
const baseEvent: { [key: string]: any } = {}
for (const key in chartConfig.events.baseEvent) {
const fnStr: string | undefined = (chartConfig.events.baseEvent as any)[key]
// 动态绑定基础事件
if (fnStr) {
baseEvent[key] = generateBaseFunc(fnStr)
}
}
// 生成生命周期事件
const events = chartConfig.events.advancedEvents || {}
const lifeEvents = {
[EventLife.VNODE_BEFORE_MOUNT](e: any) {
// 存储组件
components[chartConfig.id] = e.component
const fnStr = (events[EventLife.VNODE_BEFORE_MOUNT] || '').trim()
generateFunc(fnStr, e)
},
[EventLife.VNODE_MOUNTED](e: any) {
const fnStr = (events[EventLife.VNODE_MOUNTED] || '').trim()
generateFunc(fnStr, e)
}
}
return { ...baseEvent, ...lifeEvents }
}
/**
* 生成基础函数
* @param fnStr 用户方法体代码
* @param event 鼠标事件
*/
export function generateBaseFunc(fnStr: string) {
try {
return new Function(`
return (
async function(mouseEvent){
${fnStr}
}
)`)()
} catch (error) {
console.error(error)
}
}
/**
* 生成高级函数
* @param fnStr 用户方法体代码
* @param e 执行生命周期的动态组件实例
*/
function generateFunc(fnStr: string, e: any) {
try {
// npmPkgs 便于拷贝 echarts 示例时设置option 的formatter等相关内容
Function(`
"use strict";
return (
async function(e, components, node_modules){
const {${Object.keys(npmPkgs).join()}} = node_modules;
${fnStr}
}
)`)().bind(e?.component)(e, components, npmPkgs)
} catch (error) {
console.error(error)
}
}

View File

@@ -1,17 +1,17 @@
import { useSystemStore } from '@/store/modules/systemStore/systemStore'
import { SystemStoreEnum } from '@/store/modules/systemStore/systemStore.d'
import { ResultEnum } from '@/enums/httpEnum'
import { ossUrlApi } from '@/api/path/'
import { ossUrlApi } from '@/api/path'
// * 初始化
export const useSystemInit = async () => {
const systemStore = useSystemStore()
// 获取 OSS 信息
// 获取 OSS 信息的 url 地址,用来拼接展示图片的地址
const getOssUrl = async () => {
const res = await ossUrlApi({}) as unknown as MyResponseType
if (res.code === ResultEnum.SUCCESS) {
const res = await ossUrlApi({})
if (res && res.code === ResultEnum.SUCCESS) {
systemStore.setItem(SystemStoreEnum.FETCH_INFO, {
OSSUrl: res.data?.bucketURL
})

View File

@@ -23,6 +23,8 @@ export const langList = [
]
const i18n = createI18n({
legacy: false,
globalInjection:true,
locale: langStorage?.lang || lang,
fallbackLocale: langStorage?.lang || lang,
messages: {

View File

@@ -1,6 +1,6 @@
<template>
<n-layout-header bordered class="go-header">
<header class="go-header-box">
<header class="go-header-box" :class="{ 'is-project': isProject }">
<div class="header-item left">
<n-space>
<slot name="left"></slot>
@@ -23,17 +23,29 @@
</template>
<script setup lang="ts">
import { computed } from 'vue'
import { useRoute } from 'vue-router'
import { GoThemeSelect } from '@/components/GoThemeSelect'
import { GoLangSelect } from '@/components/GoLangSelect'
import { ThemeColorSelect } from '@/components/Pages/ThemeColorSelect'
import { PageEnum } from '@/enums/pageEnum'
const route = useRoute()
const isProject = computed(() => {
return route.fullPath === PageEnum.BASE_HOME_ITEMS
})
</script>
<style lang="scss" scoped>
$min-width: 400px;
$min-width: 520px;
@include go(header) {
&-box {
display: grid;
grid-template-columns: repeat(3, 33.33%);
grid-template-columns: repeat(3, 33%);
&.is-project {
grid-template-columns: none;
}
.header-item {
display: flex;
align-items: center;
@@ -49,7 +61,7 @@ $min-width: 400px;
}
}
height: $--header-height;
padding: 0 60px;
padding: 0 20px 0 60px;
}
}
</style>

View File

@@ -3,7 +3,7 @@ import App from './App.vue'
import router, { setupRouter } from '@/router'
import i18n from '@/i18n/index'
import { setupStore } from '@/store'
import { setupNaive, setupDirectives, setupCustomComponents } from '@/plugins'
import { setupNaive, setupDirectives, setupCustomComponents, initFunction } from '@/plugins'
import { GoAppProvider } from '@/components/GoAppProvider/index'
import { setHtmlTheme } from '@/utils'
@@ -53,4 +53,7 @@ async function appInit() {
window['$vue'] = app
}
void appInit()
appInit().then(() => {
initFunction()
})

View File

@@ -1,2 +1,3 @@
export * from './axis'
export * from './line'
export * from './line'
export * from './label'

View File

@@ -0,0 +1,7 @@
export const labelConfig = {
position: [
{ label: '外侧', value: 'outside' },
{ label: '内部', value: 'inside' },
{ label: '中心', value: 'center' }
]
}

View File

@@ -4,17 +4,21 @@ import { CreateComponentType } from '@/packages/index.d'
import cloneDeep from 'lodash/cloneDeep'
import dataJson from './data.json'
export const includes = ['legend', 'xAxis', 'yAxis']
export const includes = ['legend', 'xAxis', 'yAxis', 'grid']
export const seriesItem = {
type: 'bar',
barWidth: null,
barWidth: 15,
label: {
show: true,
position: 'top',
color: '#fff',
fontSize: 12
},
itemStyle: {
color: null,
borderRadius: 0
borderRadius: 2
}
}
export const option = {
tooltip: {
show: true,
@@ -24,10 +28,7 @@ export const option = {
type: 'shadow'
}
},
legend: {
show: true
},
xAxis: {
xAxis: {
show: true,
type: 'category'
},

View File

@@ -1,25 +1,8 @@
<template>
<!-- Echarts 全局设置 -->
<!-- Echarts 全局设置 -->
<global-setting :optionData="optionData"></global-setting>
<CollapseItem
v-for="(item, index) in seriesList"
:key="index"
:name="`柱状图-${index + 1}`"
:expanded="true"
>
<CollapseItem v-for="(item, index) in seriesList" :key="index" :name="`柱状图-${index + 1}`" :expanded="true">
<SettingItemBox name="图形">
<SettingItem name="颜色">
<n-color-picker
size="small"
:modes="['hex']"
v-model:value="item.itemStyle.color"
></n-color-picker>
</SettingItem>
<SettingItem>
<n-button size="small" @click="item.itemStyle.color = null">
恢复默认
</n-button>
</SettingItem>
<SettingItem name="宽度">
<n-input-number
v-model:value="item.barWidth"
@@ -30,24 +13,40 @@
></n-input-number>
</SettingItem>
<SettingItem name="圆角">
<n-input-number
v-model:value="item.itemStyle.borderRadius"
:min="0"
size="small"
></n-input-number>
<n-input-number v-model:value="item.itemStyle.borderRadius" :min="0" size="small"></n-input-number>
</SettingItem>
</SettingItemBox>
<setting-item-box name="标签">
<setting-item>
<n-space>
<n-switch v-model:value="item.label.show" size="small" />
<n-text>展示标签</n-text>
</n-space>
</setting-item>
<setting-item name="大小">
<n-input-number v-model:value="item.label.fontSize" size="small" :min="1"></n-input-number>
</setting-item>
<setting-item name="颜色">
<n-color-picker size="small" :modes="['hex']" v-model:value="item.label.color"></n-color-picker>
</setting-item>
<setting-item name="位置">
<n-select
v-model:value="item.label.position"
:options="[
{ label: 'top', value: 'top' },
{ label: 'left', value: 'left' },
{ label: 'right', value: 'right' },
{ label: 'bottom', value: 'bottom' }
]"
/>
</setting-item>
</setting-item-box>
</CollapseItem>
</template>
<script setup lang="ts">
import { PropType, computed } from 'vue'
import {
GlobalSetting,
CollapseItem,
SettingItemBox,
SettingItem
} from '@/components/Pages/ChartItemSetting'
import { GlobalSetting, CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting'
import { GlobalThemeJsonType } from '@/settings/chartThemes/index'
const props = defineProps({

View File

@@ -1,4 +1,3 @@
import image from '@/assets/images/chart/charts/bar_x.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@@ -11,5 +10,5 @@ export const BarCommonConfig: ConfigType = {
categoryName: ChatCategoryEnumName.BAR,
package: PackagesCategoryEnum.CHARTS,
chartFrame: ChartFrameEnum.ECHARTS,
image
image: 'bar_x.png'
}

View File

@@ -1,6 +1,7 @@
<template>
<v-chart
ref="vChartRef"
:init-options="initOptions"
:theme="themeColor"
:option="option"
:manual-update="isPreview()"
@@ -14,6 +15,7 @@
<script setup lang="ts">
import { ref, nextTick, computed, watch, PropType } from 'vue'
import VChart from 'vue-echarts'
import { useCanvasInitOptions } from '@/hooks/useCanvasInitOptions.hook'
import { use } from 'echarts/core'
import { CanvasRenderer } from 'echarts/renderers'
import { BarChart } from 'echarts/charts'
@@ -41,6 +43,8 @@ const props = defineProps({
}
})
const initOptions = useCanvasInitOptions(props.chartConfig.option, props.themeSetting)
use([DatasetComponent, CanvasRenderer, BarChart, GridComponent, TooltipComponent, LegendComponent])
const replaceMergeArr = ref<string[]>()
@@ -53,17 +57,21 @@ const option = computed(() => {
watch(
() => props.chartConfig.option.dataset,
(newData: { dimensions: any }, oldData) => {
if (!isObject(newData) || !('dimensions' in newData)) return
if (newData?.dimensions.length !== oldData?.dimensions.length) {
const seriesArr = []
for (let i = 0; i < newData.dimensions.length - 1; i++) {
seriesArr.push(seriesItem)
try {
if (!isObject(newData) || !('dimensions' in newData)) return
if (Array.isArray(newData?.dimensions)) {
const seriesArr = []
for (let i = 0; i < newData.dimensions.length - 1; i++) {
seriesArr.push(seriesItem)
}
replaceMergeArr.value = ['series']
props.chartConfig.option.series = seriesArr
nextTick(() => {
replaceMergeArr.value = []
})
}
replaceMergeArr.value = ['series']
props.chartConfig.option.series = seriesArr
nextTick(() => {
replaceMergeArr.value = []
})
} catch (error) {
console.log(error)
}
},
{

View File

@@ -4,17 +4,21 @@ import { CreateComponentType } from '@/packages/index.d'
import cloneDeep from 'lodash/cloneDeep'
import dataJson from './data.json'
export const includes = ['legend', 'xAxis', 'yAxis']
export const includes = ['legend', 'xAxis', 'yAxis', 'grid']
export const seriesItem = {
type: 'bar',
barWidth: null,
label: {
show: true,
position: 'right',
color: '#fff',
fontSize: 12
},
itemStyle: {
color: null,
borderRadius: 0
}
}
export const option = {
tooltip: {
show: true,
@@ -24,12 +28,9 @@ export const option = {
type: 'shadow'
}
},
legend: {
show: true
},
xAxis: {
show: true,
type: 'value',
type: 'value'
},
yAxis: {
show: true,

View File

@@ -3,12 +3,6 @@
<global-setting :optionData="optionData"></global-setting>
<CollapseItem v-for="(item, index) in seriesList" :key="index" :name="`柱状图-${index+1}`" :expanded="true">
<SettingItemBox name="图形">
<SettingItem name="颜色">
<n-color-picker size="small" :modes="['hex']" v-model:value="item.itemStyle.color"></n-color-picker>
</SettingItem>
<SettingItem>
<n-button size="small" @click="item.itemStyle.color = null">恢复默认</n-button>
</SettingItem>
<SettingItem name="宽度">
<n-input-number
v-model:value="item.barWidth"
@@ -26,6 +20,39 @@
></n-input-number>
</SettingItem>
</SettingItemBox>
<setting-item-box name="标签">
<setting-item>
<n-space>
<n-switch v-model:value="item.label.show" size="small" />
<n-text>展示标签</n-text>
</n-space>
</setting-item>
<setting-item name="大小">
<n-input-number
v-model:value="item.label.fontSize"
size="small"
:min="1"
></n-input-number>
</setting-item>
<setting-item name="颜色">
<n-color-picker
size="small"
:modes="['hex']"
v-model:value="item.label.color"
></n-color-picker>
</setting-item>
<setting-item name="位置">
<n-select
v-model:value="item.label.position"
:options="[
{ label: 'top', value: 'top' },
{ label: 'left', value: 'left' },
{ label: 'right', value: 'right' },
{ label: 'bottom', value: 'bottom' },
]"
/>
</setting-item>
</setting-item-box>
</CollapseItem>
</template>

View File

@@ -1,4 +1,3 @@
import image from '@/assets/images/chart/charts/bar_y.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@@ -11,5 +10,5 @@ export const BarCrossrangeConfig: ConfigType = {
categoryName: ChatCategoryEnumName.BAR,
package: PackagesCategoryEnum.CHARTS,
chartFrame: ChartFrameEnum.ECHARTS,
image
image: 'bar_y.png'
}

View File

@@ -1,6 +1,7 @@
<template>
<v-chart
ref="vChartRef"
:init-options="initOptions"
:theme="themeColor"
:option="option"
:manual-update="isPreview()"
@@ -14,6 +15,7 @@
<script setup lang="ts">
import { ref, nextTick, computed, watch, PropType } from 'vue'
import VChart from 'vue-echarts'
import { useCanvasInitOptions } from '@/hooks/useCanvasInitOptions.hook'
import { use } from 'echarts/core'
import { CanvasRenderer } from 'echarts/renderers'
import { BarChart } from 'echarts/charts'
@@ -40,6 +42,8 @@ const props = defineProps({
}
})
const initOptions = useCanvasInitOptions(props.chartConfig.option, props.themeSetting)
use([DatasetComponent, CanvasRenderer, BarChart, GridComponent, TooltipComponent, LegendComponent])
const replaceMergeArr = ref<string[]>()
@@ -52,17 +56,21 @@ const option = computed(() => {
watch(
() => props.chartConfig.option.dataset,
(newData: { dimensions: any }, oldData) => {
if (!isObject(newData) || !('dimensions' in newData)) return
if (newData?.dimensions.length !== oldData?.dimensions.length) {
const seriesArr = []
for (let i = 0; i < newData.dimensions.length - 1; i++) {
seriesArr.push(seriesItem)
try {
if (!isObject(newData) || !('dimensions' in newData)) return
if (Array.isArray(newData?.dimensions)) {
const seriesArr = []
for (let i = 0; i < newData.dimensions.length - 1; i++) {
seriesArr.push(seriesItem)
}
replaceMergeArr.value = ['series']
props.chartConfig.option.series = seriesArr
nextTick(() => {
replaceMergeArr.value = []
})
}
replaceMergeArr.value = ['series']
props.chartConfig.option.series = seriesArr
nextTick(() => {
replaceMergeArr.value = []
})
} catch (error) {
console.log(error)
}
},
{

View File

@@ -0,0 +1,25 @@
import { PublicConfigClass } from '@/packages/public'
import { CapsuleChartConfig } from './index'
import { CreateComponentType } from '@/packages/index.d'
import { chartInitConfig } from '@/settings/designSetting'
import cloneDeep from 'lodash/cloneDeep'
import dataJson from './data.json'
export const option = {
dataset: dataJson,
colors: ['#c4ebad', '#6be6c1', '#a0a7e6', '#96dee8', '#3fb1e3' ],
unit: '',
itemHeight: 10,
valueFontSize: 16,
paddingRight: 50,
paddingLeft: 50,
showValue: true
}
export default class Config extends PublicConfigClass implements CreateComponentType {
public key: string = CapsuleChartConfig.key
public attr = { ...chartInitConfig, zIndex: -1 }
public chartConfig = cloneDeep(CapsuleChartConfig)
public option = cloneDeep(option)
}

View File

@@ -0,0 +1,53 @@
<template>
<!-- Echarts 全局设置 -->
<global-setting :optionData="optionData"> </global-setting>
<!-- 胶囊柱图 -->
<collapse-item name="胶囊柱图" expanded>
<SettingItemBox name="布局">
<setting-item name="左侧边距">
<n-input-number v-model:value="optionData.paddingLeft" :min="10" :step="1" size="small"></n-input-number>
</setting-item>
<setting-item name="右侧边距">
<n-input-number v-model:value="optionData.paddingRight" :min="10" :step="1" size="small"></n-input-number>
</setting-item>
<setting-item name="每块高度(px)">
<n-input-number v-model:value="optionData.itemHeight" :min="0" :step="1" size="small"></n-input-number>
</setting-item>
</SettingItemBox>
<SettingItemBox name="文本">
<setting-item name="所有文字大小">
<n-input-number v-model:value="optionData.valueFontSize" :min="0" :step="1" size="small"></n-input-number>
</setting-item>
<setting-item name="单位">
<n-input v-model:value="optionData.unit" size="small"></n-input>
</setting-item>
<SettingItem>
<n-space>
<n-switch v-model:value="optionData.showValue" size="small"></n-switch>
<n-text>显示数值</n-text>
</n-space>
</SettingItem>
</SettingItemBox>
<SettingItemBox name="颜色">
<setting-item v-for="(item, index) in optionData.colors" :key="index" :name="`颜色${index}`">
<n-color-picker v-model:value="optionData.colors[index]" size="small" :modes="['hex']"></n-color-picker>
</setting-item>
</SettingItemBox>
</collapse-item>
</template>
<script setup lang="ts">
import { PropType, computed } from 'vue'
import { GlobalSetting, CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting'
import { GlobalThemeJsonType } from '@/settings/chartThemes/index'
import { option } from './config'
const props = defineProps({
optionData: {
type: Object as PropType<typeof option & GlobalThemeJsonType>,
required: true
}
})
</script>

View File

@@ -0,0 +1,10 @@
{
"dimensions": ["name", "value"],
"source": [
{ "name": "厦门", "value": 20 },
{ "name": "南阳", "value": 40 },
{ "name": "北京", "value": 60 },
{ "name": "上海", "value": 80 },
{ "name": "新疆", "value": 100 }
]
}

View File

@@ -0,0 +1,14 @@
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
export const CapsuleChartConfig: ConfigType = {
key: 'CapsuleChart',
chartKey: 'VCapsuleChart',
conKey: 'VCCapsuleChart',
title: '胶囊柱图',
category: ChatCategoryEnum.BAR,
categoryName: ChatCategoryEnumName.BAR,
package: PackagesCategoryEnum.CHARTS,
chartFrame: ChartFrameEnum.COMMON,
image: 'capsule.png'
}

View File

@@ -0,0 +1,231 @@
<template>
<div
v-if="state.mergedConfig"
class="go-dv-capsule-chart"
:style="{
fontSize: numberSizeHandle(state.mergedConfig.valueFontSize),
paddingLeft: numberSizeHandle(state.mergedConfig.paddingLeft),
paddingRight: numberSizeHandle(state.mergedConfig.paddingRight)
}"
>
<div class="label-column">
<div
v-for="item in state.mergedConfig.dataset.source"
:key="item[state.mergedConfig.dataset.dimensions[0]]"
:style="{ height: state.capsuleItemHeight, lineHeight: state.capsuleItemHeight }"
>
{{ item[state.mergedConfig.dataset.dimensions[0]] }}
</div>
<div class="laset">&nbsp;</div>
</div>
<div class="capsule-container">
<div
v-for="(capsule, index) in state.capsuleLength"
:key="index"
class="capsule-item"
:style="{ height: state.capsuleItemHeight }"
>
<div
class="capsule-item-column"
:style="`width: ${capsule * 100}%; background-color: ${
state.mergedConfig.colors[index % state.mergedConfig.colors.length]
};height:calc(100% - ${2}px);`"
>
<div v-if="state.mergedConfig.showValue" class="capsule-item-value">
{{ state.capsuleValue[index] }}
</div>
</div>
</div>
<div class="unit-label">
<div v-for="(label, index) in state.labelData" :key="label + index">
{{ label }}
</div>
</div>
</div>
<div v-if="state.mergedConfig.unit" class="unit-text">
{{ state.mergedConfig.unit }}
</div>
</div>
</template>
<script setup lang="ts">
import { onMounted, watch, reactive, PropType } from 'vue'
import { useChartDataFetch } from '@/hooks'
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
import config, { option } from './config'
import cloneDeep from 'lodash/cloneDeep'
type DataProps = {
name: string | number
value: string | number
[key: string]: string | number
}
interface StateProps {
defaultConfig: {
dataset: {
dimensions: Array<string>
source: Array<DataProps>
}
colors: Array<string>
unit: string
showValue: boolean
itemHeight: number
valueFontSize: number
paddingLeft: number
paddingRight: number
}
mergedConfig: any
capsuleLength: Array<number>
capsuleValue: Array<string | Object>
labelData: Array<number>
capsuleItemHeight: string
}
const props = defineProps({
chartConfig: {
type: Object as PropType<config>,
default: () => ({})
}
})
const state = reactive<StateProps>({
defaultConfig: option,
mergedConfig: null,
capsuleLength: [],
capsuleValue: [],
labelData: [],
capsuleItemHeight: ''
})
watch(
() => props.chartConfig.option,
newVal => {
calcData(newVal)
},
{
deep: true
}
)
const calcData = (data: any, type?: string) => {
let cloneConfig = cloneDeep(props.chartConfig.option || {})
state.mergedConfig = cloneConfig
if (type == 'preview') {
cloneConfig.dataset = data
}
calcCapsuleLengthAndLabelData(state.mergedConfig.dataset)
}
// 数据解析
const calcCapsuleLengthAndLabelData = (dataset: any) => {
try {
const { source } = dataset
if (!source || !source.length) return
state.capsuleItemHeight = numberSizeHandle(state.mergedConfig.itemHeight)
const capsuleValue = source.map((item: DataProps) => item[state.mergedConfig.dataset.dimensions[1]])
const maxValue = Math.max(...capsuleValue)
state.capsuleValue = capsuleValue
state.capsuleLength = capsuleValue.map((v: any) => (maxValue ? v / maxValue : 0))
const oneFifth = maxValue / 5
const labelData = Array.from(new Set(new Array(6).fill(0).map((v, i) => Math.ceil(i * oneFifth))))
state.labelData = labelData
} catch (error) {
console.warn(error);
}
}
const numberSizeHandle = (val: string | number) => {
return val + 'px'
}
onMounted(() => {
calcData(props.chartConfig.option)
})
// 预览
useChartDataFetch(props.chartConfig, useChartEditStore, (newData: any) => {
calcData(newData, 'preview')
})
</script>
<style lang="scss" scoped>
@include go('dv-capsule-chart') {
position: relative;
display: flex;
flex-direction: row;
box-sizing: border-box;
padding: 20px;
padding-right: 50px;
color: #b9b8cc;
.label-column {
display: flex;
flex-direction: column;
justify-content: space-between;
box-sizing: border-box;
padding-right: 10px;
text-align: right;
> div:not(:last-child) {
margin: 5px 0;
}
}
.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;
.capsule-item-column {
position: relative;
height: 8px;
margin-top: 1px;
border-radius: 5px;
transition: all 0.3s;
display: flex;
justify-content: flex-end;
align-items: center;
.capsule-item-value {
padding-left: 10px;
transform: translateX(100%);
}
}
}
.unit-label {
height: 20px;
position: relative;
display: flex;
justify-content: space-between;
align-items: center;
}
.unit-text {
text-align: right;
display: flex;
align-items: flex-end;
line-height: 20px;
margin-left: 10px;
}
}
</style>

View File

@@ -1,4 +1,5 @@
import { BarCommonConfig } from './BarCommon/index'
import { BarCrossrangeConfig } from './BarCrossrange/index'
import { CapsuleChartConfig } from './CapsuleChart/index'
export default [BarCommonConfig, BarCrossrangeConfig]
export default [BarCommonConfig, BarCrossrangeConfig, CapsuleChartConfig]

View File

@@ -1,20 +1,27 @@
import { echartOptionProfixHandle, PublicConfigClass } from '@/packages/public'
import { LineCommonConfig } from './index'
import { CreateComponentType } from '@/packages/index.d'
import { defaultTheme, chartColorsSearch } from '@/settings/chartThemes/index'
import cloneDeep from 'lodash/cloneDeep'
import dataJson from './data.json'
export const includes = ['legend', 'xAxis', 'yAxis']
export const includes = ['legend', 'xAxis', 'yAxis', 'grid']
export const seriesItem = {
type: 'line',
label: {
show: true,
position: 'top',
color: '#fff',
fontSize: 12
},
symbolSize: 5, //设定实心点的大小
itemStyle: {
color: null,
borderRadius: 0
},
lineStyle: {
type: 'solid',
width: 3,
itemStyle: {
color: null,
borderRadius: 0
}
color: null
}
}
@@ -26,9 +33,6 @@ export const option = {
type: 'line'
}
},
legend: {
show: true
},
xAxis: {
show: true,
type: 'category'
@@ -43,7 +47,7 @@ export const option = {
export default class Config extends PublicConfigClass implements CreateComponentType {
public key: string = LineCommonConfig.key
public chartConfig = LineCommonConfig
public chartConfig = cloneDeep(LineCommonConfig)
// 图表配置项
public option = echartOptionProfixHandle(option, includes)
}

View File

@@ -1,12 +1,7 @@
<template>
<!-- Echarts 全局设置 -->
<global-setting :optionData="optionData"></global-setting>
<CollapseItem
v-for="(item, index) in seriesList"
:key="index"
:name="`折线图-${index + 1}`"
:expanded="true"
>
<CollapseItem v-for="(item, index) in seriesList" :key="index" :name="`折线图-${index + 1}`" :expanded="true">
<SettingItemBox name="线条">
<SettingItem name="宽度">
<n-input-number
@@ -15,16 +10,48 @@
:max="100"
size="small"
placeholder="自动计算"
></n-input-number>
></n-input-number>
</SettingItem>
<SettingItem name="类型">
<n-select
v-model:value="item.lineStyle.type"
size="small"
:options="lineConf.lineStyle.type"
></n-select>
<n-select v-model:value="item.lineStyle.type" size="small" :options="lineConf.lineStyle.type"></n-select>
</SettingItem>
</SettingItemBox>
<SettingItemBox name="实心点">
<SettingItem name="大小">
<n-input-number
v-model:value="item.symbolSize"
:min="1"
:max="100"
size="small"
placeholder="自动计算"
></n-input-number>
</SettingItem>
</SettingItemBox>
<setting-item-box name="标签">
<setting-item>
<n-space>
<n-switch v-model:value="item.label.show" size="small" />
<n-text>展示标签</n-text>
</n-space>
</setting-item>
<setting-item name="大小">
<n-input-number v-model:value="item.label.fontSize" size="small" :min="1"></n-input-number>
</setting-item>
<setting-item name="颜色">
<n-color-picker size="small" :modes="['hex']" v-model:value="item.label.color"></n-color-picker>
</setting-item>
<setting-item name="位置">
<n-select
v-model:value="item.label.position"
:options="[
{ label: 'top', value: 'top' },
{ label: 'left', value: 'left' },
{ label: 'right', value: 'right' },
{ label: 'bottom', value: 'bottom' }
]"
/>
</setting-item>
</setting-item-box>
</CollapseItem>
</template>
@@ -32,12 +59,7 @@
import { PropType, computed } from 'vue'
import { lineConf } from '@/packages/chartConfiguration/echarts/index'
import { GlobalThemeJsonType } from '@/settings/chartThemes/index'
import {
GlobalSetting,
CollapseItem,
SettingItemBox,
SettingItem
} from '@/components/Pages/ChartItemSetting'
import { GlobalSetting, CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting'
const props = defineProps({
optionData: {

View File

@@ -1,4 +1,3 @@
import image from '@/assets/images/chart/charts/line.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@@ -11,5 +10,5 @@ export const LineCommonConfig: ConfigType = {
categoryName: ChatCategoryEnumName.LINE,
package: PackagesCategoryEnum.CHARTS,
chartFrame: ChartFrameEnum.ECHARTS,
image
image: 'line.png'
}

View File

@@ -1,6 +1,7 @@
<template>
<v-chart
ref="vChartRef"
:init-options="initOptions"
:theme="themeColor"
:option="option"
:manual-update="isPreview()"
@@ -15,6 +16,7 @@
<script setup lang="ts">
import { PropType, computed, watch, ref, nextTick } from 'vue'
import VChart from 'vue-echarts'
import { useCanvasInitOptions } from '@/hooks/useCanvasInitOptions.hook'
import { use } from 'echarts/core'
import { CanvasRenderer } from 'echarts/renderers'
import { LineChart } from 'echarts/charts'
@@ -41,6 +43,8 @@ const props = defineProps({
}
})
const initOptions = useCanvasInitOptions(props.chartConfig.option, props.themeSetting)
use([DatasetComponent, CanvasRenderer, LineChart, GridComponent, TooltipComponent, LegendComponent])
const replaceMergeArr = ref<string[]>()
@@ -53,17 +57,21 @@ const option = computed(() => {
watch(
() => props.chartConfig.option.dataset,
(newData: { dimensions: any }, oldData) => {
if (!isObject(newData) || !('dimensions' in newData)) return
if (newData?.dimensions.length !== oldData?.dimensions.length) {
const seriesArr = []
for (let i = 0; i < newData.dimensions.length - 1; i++) {
seriesArr.push(seriesItem)
try {
if (!isObject(newData) || !('dimensions' in newData)) return
if (Array.isArray(newData?.dimensions)) {
const seriesArr = []
for (let i = 0; i < newData.dimensions.length - 1; i++) {
seriesArr.push(seriesItem)
}
replaceMergeArr.value = ['series']
props.chartConfig.option.series = seriesArr
nextTick(() => {
replaceMergeArr.value = []
})
}
replaceMergeArr.value = ['series']
props.chartConfig.option.series = seriesArr
nextTick(() => {
replaceMergeArr.value = []
})
} catch (error) {
console.log(error)
}
},
{

View File

@@ -3,9 +3,10 @@ import { LineGradientSingleConfig } from './index'
import { CreateComponentType } from '@/packages/index.d'
import { graphic } from 'echarts/core'
import { defaultTheme, chartColorsSearch } from '@/settings/chartThemes/index'
import cloneDeep from 'lodash/cloneDeep'
import dataJson from './data.json'
export const includes = ['legend', 'xAxis', 'yAxis']
export const includes = ['legend', 'xAxis', 'yAxis', 'grid']
const options = {
tooltip: {
@@ -15,9 +16,6 @@ const options = {
type: 'line'
}
},
legend: {
show: true
},
xAxis: {
show: true,
type: 'category'
@@ -31,6 +29,13 @@ const options = {
{
type: 'line',
smooth: false,
symbolSize: 5, //设定实心点的大小
label: {
show: true,
position: 'top',
color: '#fff',
fontSize: 12
},
lineStyle: {
type: 'solid',
width: 3
@@ -54,7 +59,7 @@ const options = {
export default class Config extends PublicConfigClass implements CreateComponentType {
public key: string = LineGradientSingleConfig.key
public chartConfig = LineGradientSingleConfig
public chartConfig = cloneDeep(LineGradientSingleConfig)
// 图表配置项
public option = echartOptionProfixHandle(options, includes)
}

View File

@@ -1,12 +1,7 @@
<template>
<!-- Echarts 全局设置 -->
<global-setting :optionData="optionData"></global-setting>
<CollapseItem
v-for="(item, index) in seriesList"
:key="index"
name="单折线面积图"
:expanded="true"
>
<CollapseItem v-for="(item, index) in seriesList" :key="index" name="单折线面积图" :expanded="true">
<SettingItemBox name="线条">
<SettingItem name="宽度">
<n-input-number
@@ -18,13 +13,45 @@
></n-input-number>
</SettingItem>
<SettingItem name="类型">
<n-select
v-model:value="item.lineStyle.type"
size="small"
:options="lineConf.lineStyle.type"
></n-select>
<n-select v-model:value="item.lineStyle.type" size="small" :options="lineConf.lineStyle.type"></n-select>
</SettingItem>
</SettingItemBox>
<SettingItemBox name="实心点">
<SettingItem name="大小">
<n-input-number
v-model:value="item.symbolSize"
:min="1"
:max="100"
size="small"
placeholder="自动计算"
></n-input-number>
</SettingItem>
</SettingItemBox>
<setting-item-box name="标签">
<setting-item>
<n-space>
<n-switch v-model:value="item.label.show" size="small" />
<n-text>展示标签</n-text>
</n-space>
</setting-item>
<setting-item name="大小">
<n-input-number v-model:value="item.label.fontSize" size="small" :min="1"></n-input-number>
</setting-item>
<setting-item name="颜色">
<n-color-picker size="small" :modes="['hex']" v-model:value="item.label.color"></n-color-picker>
</setting-item>
<setting-item name="位置">
<n-select
v-model:value="item.label.position"
:options="[
{ label: 'top', value: 'top' },
{ label: 'left', value: 'left' },
{ label: 'right', value: 'right' },
{ label: 'bottom', value: 'bottom' }
]"
/>
</setting-item>
</setting-item-box>
</CollapseItem>
</template>
@@ -32,18 +59,13 @@
import { PropType, computed } from 'vue'
import { lineConf } from '@/packages/chartConfiguration/echarts/index'
import { GlobalThemeJsonType } from '@/settings/chartThemes/index'
import {
GlobalSetting,
CollapseItem,
SettingItemBox,
SettingItem
} from '@/components/Pages/ChartItemSetting'
import { GlobalSetting, CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting'
const props = defineProps({
optionData: {
type: Object as PropType<GlobalThemeJsonType>,
required: true
},
}
})
const seriesList = computed(() => {

View File

@@ -1,4 +1,3 @@
import image from '@/assets/images/chart/charts/line_gradient_single.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@@ -11,5 +10,5 @@ export const LineGradientSingleConfig: ConfigType = {
categoryName: ChatCategoryEnumName.LINE,
package: PackagesCategoryEnum.CHARTS,
chartFrame: ChartFrameEnum.ECHARTS,
image
image: 'line_gradient_single.png'
}

View File

@@ -1,11 +1,12 @@
<template>
<v-chart ref="vChartRef" :theme="themeColor" :option="option.value" :manual-update="isPreview()" autoresize>
<v-chart ref="vChartRef" :init-options="initOptions" :theme="themeColor" :option="option.value" :manual-update="isPreview()" autoresize>
</v-chart>
</template>
<script setup lang="ts">
import { reactive, watch, PropType } from 'vue'
import VChart from 'vue-echarts'
import { useCanvasInitOptions } from '@/hooks/useCanvasInitOptions.hook'
import { use, graphic } from 'echarts/core'
import { CanvasRenderer } from 'echarts/renderers'
import { LineChart } from 'echarts/charts'
@@ -15,7 +16,7 @@ import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore
import { chartColorsSearch, defaultTheme } from '@/settings/chartThemes/index'
import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent } from 'echarts/components'
import { useChartDataFetch } from '@/hooks'
import { isPreview } from '@/utils'
import { isPreview, colorGradientCustomMerge} from '@/utils'
const props = defineProps({
themeSetting: {
@@ -32,6 +33,8 @@ const props = defineProps({
}
})
const initOptions = useCanvasInitOptions(props.chartConfig.option, props.themeSetting)
use([DatasetComponent, CanvasRenderer, LineChart, GridComponent, TooltipComponent, LegendComponent])
const chartEditStore = useChartEditStore()
@@ -43,23 +46,29 @@ const option = reactive({
watch(
() => chartEditStore.getEditCanvasConfig.chartThemeColor,
(newColor: keyof typeof chartColorsSearch) => {
if (!isPreview()) {
const themeColor = chartColorsSearch[newColor] || chartColorsSearch[defaultTheme]
props.chartConfig.option.series.forEach((value: any, index: number) => {
value.areaStyle.color = new graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: themeColor[3]
},
{
offset: 1,
color: 'rgba(0,0,0, 0)'
}
])
})
try {
if (!isPreview()) {
const themeColor =
colorGradientCustomMerge(chartEditStore.getEditCanvasConfig.chartCustomThemeColorInfo)[newColor] ||
colorGradientCustomMerge(chartEditStore.getEditCanvasConfig.chartCustomThemeColorInfo)[defaultTheme]
props.chartConfig.option.series.forEach((value: any, index: number) => {
value.areaStyle.color = new graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: themeColor[3]
},
{
offset: 1,
color: 'rgba(0,0,0, 0)'
}
])
})
}
option.value = mergeTheme(props.chartConfig.option, props.themeSetting, includes)
props.chartConfig.option = option.value
} catch (error) {
console.log(error)
}
option.value = mergeTheme(props.chartConfig.option, props.themeSetting, includes)
props.chartConfig.option = option.value
},
{
immediate: true
@@ -70,9 +79,6 @@ watch(
() => props.chartConfig.option.dataset,
() => {
option.value = props.chartConfig.option
},
{
deep: false
}
)

View File

@@ -3,14 +3,12 @@ import { LineGradientsConfig } from './index'
import { CreateComponentType } from '@/packages/index.d'
import { graphic } from 'echarts/core'
import { defaultTheme, chartColorsSearch } from '@/settings/chartThemes/index'
import cloneDeep from 'lodash/cloneDeep'
import dataJson from './data.json'
export const includes = ['legend', 'xAxis', 'yAxis']
export const includes = ['legend', 'xAxis', 'yAxis', 'grid']
const option = {
legend: {
show: true
},
tooltip: {
show: true,
trigger: 'axis',
@@ -31,6 +29,13 @@ const option = {
{
type: 'line',
smooth: false,
symbolSize: 5, //设定实心点的大小
label: {
show: true,
position: 'top',
color: '#fff',
fontSize: 12
},
lineStyle: {
width: 3,
type: 'solid'
@@ -52,6 +57,12 @@ const option = {
{
type: 'line',
smooth: false,
label: {
show: true,
position: 'top',
color: '#fff',
fontSize: 12
},
lineStyle: {
width: 3,
type: 'solid'
@@ -75,7 +86,7 @@ const option = {
export default class Config extends PublicConfigClass implements CreateComponentType {
public key: string = LineGradientsConfig.key
public chartConfig = LineGradientsConfig
public chartConfig = cloneDeep(LineGradientsConfig)
// 图表配置项
public option = echartOptionProfixHandle(option, includes)
}

View File

@@ -12,7 +12,6 @@
<n-input-number
v-model:value="item.lineStyle.width"
:min="1"
:max="100"
size="small"
placeholder="自动计算"
></n-input-number>
@@ -25,6 +24,50 @@
></n-select>
</SettingItem>
</SettingItemBox>
<SettingItemBox name="实心点">
<SettingItem name="大小">
<n-input-number
v-model:value="item.symbolSize"
:min="1"
:max="100"
size="small"
placeholder="自动计算"
></n-input-number>
</SettingItem>
</SettingItemBox>
<setting-item-box name="标签">
<setting-item>
<n-space>
<n-switch v-model:value="item.label.show" size="small" />
<n-text>展示标签</n-text>
</n-space>
</setting-item>
<setting-item name="大小">
<n-input-number
v-model:value="item.label.fontSize"
size="small"
:min="1"
></n-input-number>
</setting-item>
<setting-item name="颜色">
<n-color-picker
size="small"
:modes="['hex']"
v-model:value="item.label.color"
></n-color-picker>
</setting-item>
<setting-item name="位置">
<n-select
v-model:value="item.label.position"
:options="[
{ label: 'top', value: 'top' },
{ label: 'left', value: 'left' },
{ label: 'right', value: 'right' },
{ label: 'bottom', value: 'bottom' },
]"
/>
</setting-item>
</setting-item-box>
</CollapseItem>
</template>

View File

@@ -1,4 +1,3 @@
import image from '@/assets/images/chart/charts/line_gradient.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@@ -11,5 +10,5 @@ export const LineGradientsConfig: ConfigType = {
categoryName: ChatCategoryEnumName.LINE,
package: PackagesCategoryEnum.CHARTS,
chartFrame: ChartFrameEnum.ECHARTS,
image
image: 'line_gradient.png'
}

View File

@@ -1,10 +1,11 @@
<template>
<v-chart ref="vChartRef" :theme="themeColor" :option="option.value" :manual-update="isPreview()" autoresize></v-chart>
<v-chart ref="vChartRef" :init-options="initOptions" :theme="themeColor" :option="option.value" :manual-update="isPreview()" autoresize></v-chart>
</template>
<script setup lang="ts">
import { reactive, watch, PropType } from 'vue'
import VChart from 'vue-echarts'
import { useCanvasInitOptions } from '@/hooks/useCanvasInitOptions.hook'
import { use, graphic } from 'echarts/core'
import { CanvasRenderer } from 'echarts/renderers'
import { LineChart } from 'echarts/charts'
@@ -14,7 +15,7 @@ import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore
import { chartColorsSearch, defaultTheme } from '@/settings/chartThemes/index'
import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent } from 'echarts/components'
import { useChartDataFetch } from '@/hooks'
import { isPreview } from '@/utils'
import { isPreview, colorGradientCustomMerge} from '@/utils'
const props = defineProps({
themeSetting: {
@@ -31,6 +32,8 @@ const props = defineProps({
}
})
const initOptions = useCanvasInitOptions(props.chartConfig.option, props.themeSetting)
use([DatasetComponent, CanvasRenderer, LineChart, GridComponent, TooltipComponent, LegendComponent])
const chartEditStore = useChartEditStore()
@@ -42,23 +45,29 @@ const option = reactive({
watch(
() => chartEditStore.getEditCanvasConfig.chartThemeColor,
(newColor: keyof typeof chartColorsSearch) => {
if (!isPreview()) {
const themeColor = chartColorsSearch[newColor] || chartColorsSearch[defaultTheme]
props.chartConfig.option.series.forEach((value: any, index: number) => {
value.areaStyle.color = new graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: themeColor[3 + index]
},
{
offset: 1,
color: 'rgba(0,0,0, 0)'
}
])
})
try {
if (!isPreview()) {
const themeColor =
colorGradientCustomMerge(chartEditStore.getEditCanvasConfig.chartCustomThemeColorInfo)[newColor] ||
colorGradientCustomMerge(chartEditStore.getEditCanvasConfig.chartCustomThemeColorInfo)[defaultTheme]
props.chartConfig.option.series.forEach((value: any, index: number) => {
value.areaStyle.color = new graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: themeColor[3 + index]
},
{
offset: 1,
color: 'rgba(0,0,0, 0)'
}
])
})
}
option.value = mergeTheme(props.chartConfig.option, props.themeSetting, includes)
props.chartConfig.option = option.value
} catch (error) {
console.log(error)
}
option.value = mergeTheme(props.chartConfig.option, props.themeSetting, includes)
props.chartConfig.option = option.value
},
{
immediate: true
@@ -71,6 +80,5 @@ watch(
option.value = props.chartConfig.option
}
)
const { vChartRef } = useChartDataFetch(props.chartConfig, useChartEditStore)
</script>

View File

@@ -2,9 +2,10 @@ import { echartOptionProfixHandle, PublicConfigClass } from '@/packages/public'
import { LineLinearSingleConfig } from './index'
import { CreateComponentType } from '@/packages/index.d'
import { defaultTheme, chartColorsSearch } from '@/settings/chartThemes/index'
import cloneDeep from 'lodash/cloneDeep'
import dataJson from './data.json'
export const includes = ['legend', 'xAxis', 'yAxis']
export const includes = ['legend', 'xAxis', 'yAxis', 'grid']
export const option = {
tooltip: {
@@ -14,9 +15,6 @@ export const option = {
type: 'line'
}
},
legend: {
show: true
},
xAxis: {
show: true,
type: 'category'
@@ -29,6 +27,7 @@ export const option = {
series: [
{
type: 'line',
symbolSize: 5, //设定实心点的大小
lineStyle: {
type: 'solid',
width: 3,
@@ -56,7 +55,7 @@ export const option = {
export default class Config extends PublicConfigClass implements CreateComponentType {
public key: string = LineLinearSingleConfig.key
public chartConfig = LineLinearSingleConfig
public chartConfig = cloneDeep(LineLinearSingleConfig)
// 图表配置项
public option = echartOptionProfixHandle(option, includes)
}

View File

@@ -39,6 +39,17 @@
></n-select>
</SettingItem>
</SettingItemBox>
<SettingItemBox name="实心点">
<SettingItem name="大小">
<n-input-number
v-model:value="item.symbolSize"
:min="1"
:max="100"
size="small"
placeholder="自动计算"
></n-input-number>
</SettingItem>
</SettingItemBox>
<SettingItemBox name="阴影" :alone="true">
<SettingItem name="颜色">
<n-color-picker

View File

@@ -1,4 +1,3 @@
import image from '@/assets/images/chart/charts/line_linear_single.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@@ -11,5 +10,5 @@ export const LineLinearSingleConfig: ConfigType = {
categoryName: ChatCategoryEnumName.LINE,
package: PackagesCategoryEnum.CHARTS,
chartFrame: ChartFrameEnum.ECHARTS,
image
image: 'line_linear_single.png'
}

View File

@@ -1,11 +1,12 @@
<template>
<v-chart ref="vChartRef" :theme="themeColor" :option="option.value" :manual-update="isPreview()" autoresize>
<v-chart ref="vChartRef" :init-options="initOptions" :theme="themeColor" :option="option.value" :manual-update="isPreview()" autoresize>
</v-chart>
</template>
<script setup lang="ts">
import { PropType, watch, reactive } from 'vue'
import VChart from 'vue-echarts'
import { useCanvasInitOptions } from '@/hooks/useCanvasInitOptions.hook'
import { use } from 'echarts/core'
import { CanvasRenderer } from 'echarts/renderers'
import { LineChart } from 'echarts/charts'
@@ -15,7 +16,7 @@ import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore
import { chartColorsSearch, defaultTheme } from '@/settings/chartThemes/index'
import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent } from 'echarts/components'
import { useChartDataFetch } from '@/hooks'
import { isPreview } from '@/utils'
import { isPreview, colorGradientCustomMerge } from '@/utils'
const props = defineProps({
themeSetting: {
@@ -32,6 +33,8 @@ const props = defineProps({
}
})
const initOptions = useCanvasInitOptions(props.chartConfig.option, props.themeSetting)
use([DatasetComponent, CanvasRenderer, LineChart, GridComponent, TooltipComponent, LegendComponent])
const chartEditStore = useChartEditStore()
@@ -43,17 +46,23 @@ const option = reactive({
watch(
() => chartEditStore.getEditCanvasConfig.chartThemeColor,
(newColor: keyof typeof chartColorsSearch) => {
if (!isPreview()) {
const themeColor = chartColorsSearch[newColor] || chartColorsSearch[defaultTheme]
props.chartConfig.option.series.forEach((value: any) => {
value.lineStyle.shadowColor = themeColor[2]
value.lineStyle.color.colorStops.forEach((v: { color: string }, i: number) => {
v.color = themeColor[i]
try {
if (!isPreview()) {
const themeColor =
colorGradientCustomMerge(chartEditStore.getEditCanvasConfig.chartCustomThemeColorInfo)[newColor] ||
colorGradientCustomMerge(chartEditStore.getEditCanvasConfig.chartCustomThemeColorInfo)[defaultTheme]
props.chartConfig.option.series.forEach((value: any) => {
value.lineStyle.shadowColor = themeColor[2]
value.lineStyle.color.colorStops.forEach((v: { color: string }, i: number) => {
v.color = themeColor[i]
})
})
})
}
option.value = mergeTheme(props.chartConfig.option, props.themeSetting, includes)
props.chartConfig.option = option.value
} catch (error) {
console.log(error)
}
option.value = mergeTheme(props.chartConfig.option, props.themeSetting, includes)
props.chartConfig.option = option.value
},
{
immediate: true

View File

@@ -0,0 +1,83 @@
import { PublicConfigClass } from '@/packages/public'
import { CreateComponentType } from '@/packages/index.d'
import { MapAmapConfig } from './index'
import { chartInitConfig } from '@/settings/designSetting'
import cloneDeep from 'lodash/cloneDeep'
import dataJson from './data.json'
export enum ThemeEnum {
NORMAL = 'normal',
DARK = 'dark',
LIGHT = 'light',
WHITES_MOKE = 'whitesmoke',
FRESH = 'fresh',
GREY = 'grey',
GRAFFITI = 'graffiti',
MACARON = 'macaron',
BLUE = 'blue',
DARKBLUE = 'darkblue',
WINE = 'wine'
}
export enum LangEnum {
ZH_CN = 'zh_cn',
EN = 'en',
ZH_EN = 'zh_en'
}
export enum ViewModeEnum {
PLANE = '2D',
STEREOSCOPIC = '3D'
}
export enum FeaturesEnum {
BG = 'bg',
POINT = 'point',
ROAD = 'road',
BUILDING = 'building'
}
export enum MarkerEnum {
// 圆圈
CIRCLE_MARKER = 'CircleMarker',
// 定位标点
MARKER = 'Marker',
// 暂无
NONE = 'none'
}
export const option = {
dataset: dataJson,
mapOptions: {
pitch: 60,
skyColor: '#53A9DE',
amapKey: 'd5f3e16589dbecae64d05fe90e2ba4f2',
amapStyleKey: ThemeEnum.DARK,
amapStyleKeyCustom: '',
amapLon: 116.397428,
amapLat: 39.90923,
amapZindex: 11,
marker: {
fillColor: '#E98984FF',
fillOpacity: 0.5,
strokeColor: 'white',
strokeWeight: 2,
strokeOpacity: 0.5,
zIndex: 10,
bubble: true,
cursor: 'pointer',
clickable: true
},
mapMarkerType: MarkerEnum.CIRCLE_MARKER,
viewMode: ViewModeEnum.PLANE,
lang: LangEnum.ZH_CN,
features: [FeaturesEnum.BG, FeaturesEnum.POINT, FeaturesEnum.ROAD, FeaturesEnum.BUILDING]
}
}
export default class Config extends PublicConfigClass implements CreateComponentType {
public key = MapAmapConfig.key
public attr = { ...chartInitConfig, w: 1000, h: 800, zIndex: -1 }
public chartConfig = cloneDeep(MapAmapConfig)
public option = cloneDeep(option)
}

View File

@@ -0,0 +1,199 @@
<template>
<collapse-item name="基础" :expanded="true">
<setting-item-box name="语言类型" :alone="true">
<setting-item>
<n-select size="small" v-model:value="optionData.mapOptions.lang" :options="langOptions" />
</setting-item>
</setting-item-box>
<setting-item-box name="Key" :alone="true">
<setting-item name="请务必使用自己的高德应用 key">
<n-input v-model:value="optionData.mapOptions.amapKey" size="small"></n-input>
</setting-item>
</setting-item-box>
<setting-item-box name="自定义地图样式ID" :alone="true">
<setting-item>
<n-input size="small" v-model:value="optionData.mapOptions.amapStyleKeyCustom" />
</setting-item>
</setting-item-box>
</collapse-item>
<collapse-item name="地图" :expanded="true">
<setting-item-box name="主题">
<setting-item>
<n-select size="small" v-model:value="optionData.mapOptions.amapStyleKey" :options="themeOptions" />
</setting-item>
</setting-item-box>
<setting-item-box name="内容" :alone="true">
<n-checkbox-group v-model:value="optionData.mapOptions.features">
<n-space item-style="display: flex;">
<n-checkbox :value="item.value" :label="item.label" v-for="(item, index) in featuresOptions" :key="index" />
</n-space>
</n-checkbox-group>
</setting-item-box>
<setting-item-box name="位置">
<setting-item name="经度">
<n-input-number v-model:value="optionData.mapOptions.amapLon" :show-button="false" size="small">
<template #suffix>°</template>
</n-input-number>
</setting-item>
<setting-item name="纬度">
<n-input-number v-model:value="optionData.mapOptions.amapLat" :show-button="false" size="small">
<template #suffix>°</template>
</n-input-number>
</setting-item>
<setting-item name="初始缩放">
<n-input-number v-model:value="optionData.mapOptions.amapZindex" :min="0" size="small"></n-input-number>
</setting-item>
</setting-item-box>
<setting-item-box name="模式" :alone="true">
<setting-item>
<n-radio-group v-model:value="optionData.mapOptions.viewMode" name="radiogroup">
<n-space>
<n-radio v-for="song in viewModeOptions" :key="song.value" :value="song.value">
{{ song.label }}
</n-radio>
</n-space>
</n-radio-group>
</setting-item>
</setting-item-box>
<template v-if="optionData.mapOptions.viewMode === '3D'">
<setting-item-box>
<setting-item name="天空色">
<n-color-picker size="small" :modes="['hex']" v-model:value="optionData.mapOptions.skyColor"></n-color-picker>
</setting-item>
<setting-item name="俯仰角">
<n-input-number v-model:value="optionData.mapOptions.pitch" :min="0" :max="83" size="small"></n-input-number>
</setting-item>
</setting-item-box>
</template>
</collapse-item>
<collapse-item name="标记" :expanded="true">
<setting-item-box name="样式">
<setting-item name="类型">
<n-select size="small" v-model:value="optionData.mapOptions.mapMarkerType" :options="MarkerOptions" />
</setting-item>
<setting-item name="颜色">
<n-color-picker v-model:value="optionData.mapOptions.marker.fillColor" size="small"></n-color-picker>
</setting-item>
</setting-item-box>
</collapse-item>
</template>
<script setup lang="ts">
import { PropType } from 'vue'
import { option, MarkerEnum, ThemeEnum, LangEnum, ViewModeEnum, FeaturesEnum } from './config'
import { CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting'
defineProps({
optionData: {
type: Object as PropType<typeof option>,
required: true
}
})
const themeOptions = [
{
value: ThemeEnum.NORMAL,
label: '标准'
},
{
value: ThemeEnum.DARK,
label: '幻影黑'
},
{
value: ThemeEnum.LIGHT,
label: '月光银'
},
{
value: ThemeEnum.WHITES_MOKE,
label: '远山黛'
},
{
value: ThemeEnum.FRESH,
label: '草色青'
},
{
value: ThemeEnum.GREY,
label: '雅士灰'
},
{
value: ThemeEnum.GRAFFITI,
label: '涂鸦'
},
{
value: ThemeEnum.MACARON,
label: '马卡龙'
},
{
value: ThemeEnum.BLUE,
label: '靛青蓝'
},
{
value: ThemeEnum.DARKBLUE,
label: '极夜蓝'
},
{
value: ThemeEnum.WINE,
label: '酱籽'
}
]
const langOptions = [
{
value: LangEnum.ZH_CN,
label: '中文简体'
},
{
value: LangEnum.EN,
label: '英文'
},
{
value: LangEnum.ZH_EN,
label: '中英文对照'
}
]
const viewModeOptions = [
{
value: ViewModeEnum.PLANE,
label: '2D'
},
{
value: ViewModeEnum.STEREOSCOPIC,
label: '3D'
}
]
const featuresOptions = [
{
value: FeaturesEnum.BG,
label: '显示地图背景'
},
{
value: FeaturesEnum.POINT,
label: '显示标识'
},
{
value: FeaturesEnum.ROAD,
label: '显示道路'
},
{
value: FeaturesEnum.BUILDING,
label: '显示建筑'
}
]
const MarkerOptions = [
{
value: MarkerEnum.CIRCLE_MARKER,
label: '圆形标点'
},
{
value: MarkerEnum.MARKER,
label: '定位标点'
},
{
value: MarkerEnum.NONE,
label: '隐藏标点'
}
]
</script>

View File

@@ -0,0 +1,19 @@
{
"markers": [
{
"name": "某某地市",
"value": 10,
"position": [116.300467, 39.907761]
},
{
"name": "某某地市",
"value": 15,
"position": [116.400567, 39.908761]
},
{
"name": "某某地市",
"value": 20,
"position": [116.200467, 39.937761]
}
]
}

View File

@@ -0,0 +1,14 @@
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
export const MapAmapConfig: ConfigType = {
key: 'MapAmap',
chartKey: 'VMapAmap',
conKey: 'VCMapAmap',
title: '高德地图',
category: ChatCategoryEnum.MAP,
categoryName: ChatCategoryEnumName.MAP,
package: PackagesCategoryEnum.CHARTS,
chartFrame: ChartFrameEnum.COMMON,
image: 'map_amap.png'
}

View File

@@ -0,0 +1,130 @@
<template>
<div ref="vChartRef"></div>
</template>
<script setup lang="ts">
import { ref, PropType, toRefs, watch } from 'vue'
import AMapLoader from '@amap/amap-jsapi-loader'
import { CreateComponentType } from '@/packages/index.d'
import { useChartDataFetch } from '@/hooks'
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
import { MarkerEnum } from './config'
import { isArray } from '@/utils'
const props = defineProps({
chartConfig: {
type: Object as PropType<CreateComponentType>,
required: true
}
})
let {
amapKey,
amapStyleKey,
amapLon,
amapLat,
amapZindex,
mapMarkerType,
lang,
amapStyleKeyCustom,
features,
viewMode,
pitch,
skyColor,
marker
} = toRefs(props.chartConfig.option.mapOptions)
let mapIns: any = null
let markers: any = []
let AMapIns: any = null
const vChartRef = ref<HTMLElement>()
const initMap = (newData: any) => {
// 初始化
AMapLoader.load({
key: amapKey.value, //api服务key--另外需要在public中使用安全密钥
version: '1.4.8', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
plugins: ['AMap.PlaceSearch', 'AMap.AutoComplete'] // 需要使用的的插件列表
})
.then(AMap => {
AMapIns = AMap
mapIns = new AMap.Map(vChartRef.value, {
resizeEnable: true,
zoom: amapZindex.value, // 地图显示的缩放级别
center: [amapLon.value, amapLat.value],
mapStyle: `amap://styles/${amapStyleKeyCustom.value !== '' ? amapStyleKeyCustom.value : amapStyleKey.value}`, //自定义地图的显示样式
lang: lang.value,
features: features.value,
pitch: pitch.value, // 地图俯仰角度,有效范围 0 度- 83 度
skyColor: skyColor.value,
viewMode: viewMode.value, // 地图模式
willReadFrequently: true
})
dataHandle(props.chartConfig.option.dataset)
})
.catch(e => {})
}
const dataHandle = (newData: any) => {
if (!mapIns && !AMapIns) {
initMap(props.chartConfig.option)
return
}
if (isArray(newData.markers)) {
// 先清除旧标记
mapIns.remove(markers)
markers = []
// 记录新标记
if (mapMarkerType.value === MarkerEnum.MARKER) {
newData.markers.forEach((markerItem: any) => {
const markerInstance = new AMapIns.Marker({
position: [markerItem.position[0], markerItem.position[1]],
offset: new AMapIns.Pixel(-13, -30)
})
markers.push(markerInstance)
markerInstance.setMap(mapIns)
})
} else if (mapMarkerType.value === MarkerEnum.CIRCLE_MARKER) {
newData.markers.forEach((markerItem: any) => {
const markerInstance = new AMapIns.CircleMarker({
center: [markerItem.position[0], markerItem.position[1]],
radius: markerItem.value,
...marker.value
})
markers.push(markerInstance)
markerInstance.setMap(mapIns)
})
}
}
}
const stopWatch = watch(
() => props.chartConfig.option.mapOptions,
option => {
initMap(option)
},
{
immediate: true,
deep: true
}
)
watch(
() => props.chartConfig.option.dataset,
newData => {
try {
dataHandle(newData)
} catch (error) {
console.log(error)
}
},
{
deep: false
}
)
// 预览
useChartDataFetch(props.chartConfig, useChartEditStore, (newData: any) => {
stopWatch()
dataHandle(newData)
})
</script>

View File

@@ -2,6 +2,7 @@ import { echartOptionProfixHandle, PublicConfigClass } from '@/packages/public'
import { MapBaseConfig } from './index'
import { chartInitConfig } from '@/settings/designSetting'
import { CreateComponentType } from '@/packages/index.d'
import cloneDeep from 'lodash/cloneDeep'
import dataJson from './data.json'
export const includes = []
@@ -151,6 +152,6 @@ export const MapDefaultConfig = { ...option }
export default class Config extends PublicConfigClass implements CreateComponentType {
public key: string = MapBaseConfig.key
public attr = { ...chartInitConfig, w: 750, h: 800, zIndex: -1 }
public chartConfig = MapBaseConfig
public chartConfig = cloneDeep(MapBaseConfig)
public option = echartOptionProfixHandle(option, includes)
}

View File

@@ -1,5 +1,4 @@
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import image from '@/assets/images/chart/charts/map.png'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
export const MapBaseConfig: ConfigType = {
@@ -11,5 +10,5 @@ export const MapBaseConfig: ConfigType = {
categoryName: ChatCategoryEnumName.MAP,
package: PackagesCategoryEnum.CHARTS,
chartFrame: ChartFrameEnum.COMMON,
image
}
image: 'map.png'
}

View File

@@ -1,5 +1,5 @@
<template>
<v-chart ref="vChartRef" :theme="themeColor" :option="option.value" :manual-update="isPreview()" autoresize>
<v-chart ref="vChartRef" :init-options="initOptions" :theme="themeColor" :option="option.value" :manual-update="isPreview()" autoresize>
</v-chart>
</template>
@@ -7,11 +7,12 @@
import { PropType, reactive, watch, ref, nextTick } from 'vue'
import config, { includes } from './config'
import VChart from 'vue-echarts'
import { useCanvasInitOptions } from '@/hooks/useCanvasInitOptions.hook'
import { use, registerMap } from 'echarts/core'
import { EffectScatterChart, MapChart } from 'echarts/charts'
import { CanvasRenderer } from 'echarts/renderers'
import { useChartDataFetch } from '@/hooks'
import { mergeTheme } from '@/packages/public/chart'
import { mergeTheme, setOption } from '@/packages/public/chart'
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
import { isPreview } from '@/utils'
import mapJsonWithoutHainanIsLands from './mapWithoutHainanIsLands.json'
@@ -32,6 +33,8 @@ const props = defineProps({
}
})
const initOptions = useCanvasInitOptions(props.chartConfig.option, props.themeSetting)
use([
MapChart,
DatasetComponent,
@@ -59,14 +62,15 @@ const getGeojson = (regionId: string) => {
}
//异步时先注册空的 保证初始化不报错
registerMap(props.chartConfig.option.mapRegion.adcode, { geoJSON: {} as any, specialAreas: {} })
registerMap(`${props.chartConfig.option.mapRegion.adcode}`, { geoJSON: {} as any, specialAreas: {} })
// 进行更换初始化地图 如果为china 单独处理
const registerMapInitAsync = async () => {
await nextTick()
if (props.chartConfig.option.mapRegion.adcode!="china") {
await getGeojson(props.chartConfig.option.mapRegion.adcode)
}else{
const adCode = `${props.chartConfig.option.mapRegion.adcode}`;
if (adCode !== 'china') {
await getGeojson(adCode)
} else {
await hainanLandsHandle(props.chartConfig.option.mapRegion.showHainanIsLands)
}
vEchartsSetOption()
@@ -76,7 +80,7 @@ registerMapInitAsync()
// 手动触发渲染
const vEchartsSetOption = () => {
option.value = props.chartConfig.option
vChartRef.value?.setOption(props.chartConfig.option)
setOption(vChartRef.value, props.chartConfig.option)
}
// 更新数据处理
@@ -90,12 +94,12 @@ const dataSetHandle = async (dataset: any) => {
isPreview() && vEchartsSetOption()
}
// 处理海南群岛
const hainanLandsHandle=async(newData:boolean)=>{
const hainanLandsHandle = async (newData: boolean) => {
if (newData) {
await getGeojson('china')
} else {
registerMap('china', { geoJSON: mapJsonWithoutHainanIsLands as any, specialAreas: {} })
}
await getGeojson('china')
} else {
registerMap('china', { geoJSON: mapJsonWithoutHainanIsLands as any, specialAreas: {} })
}
}
//监听 dataset 数据发生变化
watch(
@@ -113,8 +117,12 @@ watch(
watch(
() => props.chartConfig.option.mapRegion.showHainanIsLands,
async newData => {
await hainanLandsHandle(newData)
vEchartsSetOption()
try {
await hainanLandsHandle(newData)
vEchartsSetOption()
} catch (error) {
console.log(error)
}
},
{
deep: false
@@ -123,14 +131,18 @@ watch(
//监听地图展示区域发生变化
watch(
() => props.chartConfig.option.mapRegion.adcode,
() => `${props.chartConfig.option.mapRegion.adcode}`,
async newData => {
await getGeojson(newData)
props.chartConfig.option.geo.map = newData
props.chartConfig.option.series.forEach((item: any) => {
if (item.type === 'map') item.map = newData
})
vEchartsSetOption()
try {
await getGeojson(newData)
props.chartConfig.option.geo.map = newData
props.chartConfig.option.series.forEach((item: any) => {
if (item.type === 'map') item.map = newData
})
vEchartsSetOption()
} catch (error) {
console.log(error)
}
},
{
deep: false

View File

@@ -1,3 +1,4 @@
import { MapBaseConfig } from './MapBase/index'
import { MapAmapConfig } from './MapAmap/index'
export default [ MapBaseConfig ]
export default [MapBaseConfig, MapAmapConfig]

View File

@@ -1,4 +1,3 @@
import image from '@/assets/images/chart/charts/funnel.png'
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@@ -11,5 +10,5 @@ export const FunnelConfig: ConfigType = {
categoryName: ChatCategoryEnumName.MORE,
package: PackagesCategoryEnum.CHARTS,
chartFrame: ChartFrameEnum.ECHARTS,
image
image: 'funnel.png'
}

View File

@@ -1,10 +1,11 @@
<template>
<v-chart ref="vChartRef" :theme="themeColor" :option="option" :manual-update="isPreview()" autoresize></v-chart>
<v-chart ref="vChartRef" :init-options="initOptions" :theme="themeColor" :option="option" :manual-update="isPreview()" autoresize></v-chart>
</template>
<script setup lang="ts">
import { computed, PropType } from 'vue'
import VChart from 'vue-echarts'
import { useCanvasInitOptions } from '@/hooks/useCanvasInitOptions.hook'
import { use } from 'echarts/core'
import { CanvasRenderer } from 'echarts/renderers'
import { FunnelChart } from 'echarts/charts'
@@ -31,6 +32,8 @@ const props = defineProps({
}
})
const initOptions = useCanvasInitOptions(props.chartConfig.option, props.themeSetting)
use([DatasetComponent, CanvasRenderer, FunnelChart, GridComponent, TooltipComponent, LegendComponent])
const option = computed(() => {

View File

@@ -4,7 +4,7 @@ import { CreateComponentType } from '@/packages/index.d'
import { cloneDeep } from 'lodash'
import dataJson from './data.json'
export const includes = ['xAxis', 'yAxis']
export const includes = ['xAxis', 'yAxis', 'grid']
export const option = {
dataset: { ...dataJson },

Some files were not shown because too many files have changed in this diff Show More