Compare commits

..

494 Commits

Author SHA1 Message Date
vben
a969d2091a chore: release 2.10.0, 2.x 版本不再更新,如有任何pr,请提交到 next分支 2023-04-08 00:08:22 +08:00
vben
e285947716 fix: cross-env script 2023-04-08 00:04:56 +08:00
zhenbintuo
cfbd5e9851 修复insertNodesByKey方法批量添加异常问题 (#2695)
当批量添加节点parentKey为空时,未赋值treeDataRef导致添加异常
2023-04-08 00:03:11 +08:00
kissGoodBye
122db78e84 feat(directives/ellipsis): add ellipsis directive (#2688) 2023-04-07 09:22:51 +08:00
vben
5c69b3d5a8 chore: 删除无用文件 2023-04-07 00:15:06 +08:00
vben
335f30c887 chore: 优化 useScrollTo、useWindowSizeFn 2023-04-07 00:12:26 +08:00
vben
6a9bd686d5 chore: remove LazyContainer 2023-04-06 23:49:20 +08:00
vben
6890dd7201 perf: 新包使用更严格的eslint 2023-04-06 23:28:37 +08:00
vben
762e5dee14 fix: 修复循环依赖问题 2023-04-06 23:16:15 +08:00
vben
fa18365c21 chore: 移除 useTimeoutFn文件,使用 vueuse 2023-04-06 22:49:16 +08:00
vben
feadf64ee3 fix: Icon加载问题 2023-04-06 22:47:39 +08:00
vben
553ee9c7ae chore: revert fix(Icon): Cannot access Icon before initialization #2680 (#2683) 2023-04-06 22:44:26 +08:00
vben
9f8e010534 feat: 重构 useRefs 2023-04-06 22:17:18 +08:00
vben
14ba72dd1c fix: 主题样式设置无效,close #2685 2023-04-06 22:12:17 +08:00
前端爱码士
be0d35394c fix: 解决项目配置/界面功能/自动锁屏&菜单展开宽度样式变形问题 (#2681) 2023-04-06 22:03:26 +08:00
Kirk Lin
b14a15e66b refactor: axios Canceler use AbortController (#2676) 2023-04-06 22:03:12 +08:00
Kirk Lin
ae5f5cb13c feat: sync mitt (#2677) 2023-04-06 22:03:00 +08:00
Kirk Lin
ccaa84c305 fix: axios type (#2678)
* fix: axios type

* fix: axios type
2023-04-06 22:02:42 +08:00
Kirk Lin
357beabaeb fix: an object literal cannot have multiple properties with the same name. (#2682) 2023-04-06 22:02:23 +08:00
xingyu
7469312ffc fix(Icon): Cannot access Icon before initialization #2680 (#2683)
* fix(Icon): Cannot access Icon before initialization

* fix(comps): import eslint

* fix(Icon): Cannot access Icon before initialization

* fix(comps): import eslint
2023-04-06 22:02:02 +08:00
oooplz
401fcaf325 fix: 空数组覆盖有效数组 (#2687) 2023-04-06 22:01:25 +08:00
vben
5e8ef2f64f feat: 添加 defineOptions 2023-04-06 00:08:17 +08:00
vben
8e5a6b7ce5 perf: 修复部分 eslint 错误 2023-04-05 22:47:14 +08:00
vben
279977b817 feat: 逐步抽离部分包到packages 2023-04-05 22:29:16 +08:00
vben
a5ed79fc94 Merge branch 'main' of https://github.com/anncwb/vue-vben-admin 2023-04-05 21:25:37 +08:00
Cherelle Spencer
660024c6f3 perf: tsconfig 同步vite配置修改, 增加路径映射 (#2675)
Co-authored-by: 苗大 <caoshengmiao@hypergryph.com>
2023-04-05 20:34:53 +08:00
vben
d25df8321e chore: windcss -> unocss 2023-04-05 18:17:55 +08:00
luoawai
6b30c9f7bb fix(useFormItem):修复ApiSelect的onChange事件获取不到第二个参数(#2592) (#2674) 2023-04-05 15:58:43 +08:00
vben
aedb8e53aa perf: 优化env字段 2023-04-05 15:58:03 +08:00
vben
358b77fe96 chore: release 2.9.1 2023-04-05 00:21:09 +08:00
vben
5e99463cd0 perf: Refactor vite configuration 2023-04-05 00:20:48 +08:00
vben
5e4be0adbc chore: update config 2023-04-04 17:29:58 +08:00
vben
c2590cbfb5 Merge branch 'main' of https://github.com/anncwb/vue-vben-admin 2023-04-04 17:14:06 +08:00
vben
08d4e34b77 chore: config ts-config 2023-04-04 17:13:09 +08:00
前端爱码士
7a8978dcff fix: 解决打包报内存溢出问题 (#2672) 2023-04-04 17:11:03 +08:00
oooplz
af54b0fbc6 feat: 多路径字段获取值 (#2664) 2023-04-04 16:59:43 +08:00
Cherelle Spencer
4418eccfab fix(deepMerge): 修复递归合并操作, 合并数组未去重的bug (#2667)
Co-authored-by: 苗大 <caoshengmiao@hypergryph.com>
2023-04-04 16:59:30 +08:00
Cherelle Spencer
02d41197b6 fix: propTypes.extend()方法已经废弃, 改为官方推荐的ES6+方法 (#2670)
Co-authored-by: 苗大 <caoshengmiao@hypergryph.com>
2023-04-04 16:59:19 +08:00
vben
ba2415c3b4 chore: Extract lint config 2023-04-04 16:55:34 +08:00
vben
84a5fc1256 chore: 项目所有依赖升级到最新 2023-04-02 00:20:01 +08:00
vben
8180b2d15f chore: 暂时移除主题切换及暗黑模式切换功能 2023-04-02 00:02:52 +08:00
vben
699cf6d7af chore: remove vite-plugin-pwa 2023-04-01 23:56:02 +08:00
vben
fea323cff1 chore: css is no longer imported on demand 2023-04-01 23:53:26 +08:00
vben
dc39567a14 chore: remove @vitejs/plugin-legacy vite-plugin-imagemin 2023-04-01 23:48:19 +08:00
vben
ab74480083 chore: Requires pnpm 8 and node 16 2023-04-01 23:39:36 +08:00
Wit〆苗大
9579a45b3c feat(excel导出): 增加批量导出功能, 增加demo示例 (#2657)
* feat(excel导出): 批量导出功能

* feat(excel导出): 批量导出功能, 增加参数类型定义;增加demo示例

---------

Co-authored-by: 苗大 <caoshengmiao@hypergryph.com>
2023-03-30 09:53:55 +08:00
Wit〆苗大
302afe5860 fix(项目配置): 修复 #2652 重置项目配置,导致左侧菜单栏整体变成白色 (#2656)
Co-authored-by: 苗大 <caoshengmiao@hypergryph.com>
2023-03-30 09:53:44 +08:00
Wit〆苗大
7b21e9dc24 fix(useFormEvents): 修复#2648修改导致的末尾大括号丢失 (#2655)
Co-authored-by: 苗大 <caoshengmiao@hypergryph.com>
2023-03-30 09:53:24 +08:00
Wit〆苗大
f05b90f86b fix(form-design): CollapseItem组件页面css添加prefixCls前缀, 防止打包后污染全局样式 (#2654)
Co-authored-by: 苗大 <caoshengmiao@hypergryph.com>
2023-03-30 09:53:03 +08:00
oooplz
1b30834eb3 feat: 解构字段设置value (#2648) 2023-03-29 14:59:11 +08:00
Wit〆苗大
c5f97b9d9f perf(BasicTable): css 内 ant-tag margin改动仅对表格内单元格生效, 防止影响其他地方的tag (#2653)
* perf(BasicTable): ant-tag margin改动仅对表格内单元格生效, 防止影响其他地方的tag, 如搜索表单内时间范围自定预设范围的tag

* perf(BasicTable):css 内 ant-tag margin改动仅对表格内单元格生效, 防止影响其他地方的tag, 如搜索表单内时间范围自定预设范围的tag

---------

Co-authored-by: 苗大 <caoshengmiao@hypergryph.com>
2023-03-29 14:58:42 +08:00
Lantz
3a1ec7ac86 fix(hooks): 修改在使用useEcharts时, getInstance无法获取到最新的echarts实例的问题 (#2650) 2023-03-29 14:58:18 +08:00
Kirk Lin
4c63b1abb7 refactor: deepMerge (#2649) 2023-03-28 21:34:11 +08:00
vben
5d8d9786e3 chore: release 2.9.0 2023-03-24 18:02:27 +08:00
vben
2cca7e8bfb chore: update vscode setting 2023-03-24 18:00:53 +08:00
LooSheng
74ded8aed7 perf: respect the writing style of pinia getters (#2645) 2023-03-24 17:48:35 +08:00
wh
d620758c2f fix(ApiSelect): 支持x.x.x格式 (#2637)
Co-authored-by: whong <whif@foxmail.com>
2023-03-23 11:45:44 +08:00
luocong2016
f2ec2ca273 feat: 添加更多配置项 (#2607) 2023-03-17 12:35:38 +08:00
zty
b66a83c10f fix: upload component preview .webp image (#2631)
Co-authored-by: tianyuan233 <zty.dev@outlook.com>
2023-03-16 13:05:07 +08:00
zty
7bbb86249b fix: set type of FormActionType.setFieldsValue same as type of setFieldsValue in useFormEvents (#2630) 2023-03-16 13:04:49 +08:00
zty
b0a45d4739 fix: modalheader dblclick (#2628) 2023-03-15 13:22:57 +08:00
lzdjack
1095d44110 feat: 替换vextable中button组件 (#2625) 2023-03-14 17:06:57 +08:00
Wit〆苗大
e938e8e9a8 perf(BasicButton): 按钮颜色设置支持主题色primary (#2623)
Co-authored-by: 苗大 <caoshengmiao@hypergryph.com>
2023-03-14 17:06:41 +08:00
予ヾ
3b0077dc73 fix: 修复水印重复叠加问题 (#2622)
Co-authored-by: whong <whif@foxmail.com>
2023-03-14 17:06:25 +08:00
lzdjack
3de5b53bcd fix: 修复表单验证 (#2620)
1.优化验证
2.修复自定义组件验证出错的问题
2023-03-14 17:06:10 +08:00
qixianc94
d7f5dfeb9f fix: ApiTransfer的targetKeys属性无效 (#2615) 2023-03-10 11:32:49 +08:00
儿时的夏日
85bc1f2340 fix: vxe-table与vben ApiTreeSelect适配 (#2613) 2023-03-10 11:32:36 +08:00
Partoo
edede25c8f fix: 修复TypeError: item.indexOf is not a function报错 (#2611) 2023-03-10 11:31:51 +08:00
mfish
6da30edef5 fix(SettingFooter): 解决主题重置后Theme不实时更新问题 (#2608)
* feat(axiosSuccess): 操作成功后根据传入提示模式进行相应

* fix(axiosRetry): 解决get重试请求返回的headers造成无法成功请求的问题

* fix(axiosRetry): 参数首字母小写

* fix(useDataSource): 解决deleteTableRecord删除树形表格的行记录时,无法删除,无法找到子节点的问题

* feat(useDataSource): 删除之前提交代码遗留的console

* fix(permissionGuard): 当获取用户信息失败时,不允许正常登陆返回登陆界面

* fix(permissionGuard): 代码还原

* fix(menu): 解决隐藏菜单目录只能隐藏第一层目录的问题,递归隐藏所有子菜单

* feat(baseSetting): 个人设置图标修改时弹出窗显示原图片,由于跨域获取图片存在问题暂时将user.ts中的跨域图片链接去掉,直接采用本地图片

* fix(ApiSelect): 解决参数类型为string时的警告问题

* fix(SettingFooter): 解决主题重置后Theme不实时更新问题
2023-03-10 11:31:31 +08:00
superlollipop
d9286b5345 修复表格设置固定列,事件回调数据错误 (#2605)
* fix: 修复异步加载表格列时,表格设置显示列为空

* fix: 修复表格设置固定按钮回调事件,未过滤当前选择的列导致回调数据错误
2023-03-06 17:29:54 +08:00
JokeHe
8d218ec8d5 Update useTree.ts (#2602)
修复获取子节点出错
2023-03-06 11:24:24 +08:00
luocong2016
72dbe574d3 fix: 修复表单验证失败的多个错误提示,语法报错问题 (#2601) 2023-03-06 11:24:09 +08:00
superlollipop
4c91ac11e2 fix: 修复异步加载表格列时,表格设置显示列为空 (#2599) 2023-03-04 14:08:32 +08:00
前端爱码士
ce480c5d66 fix: 解决BasicModal弹窗动态:wrapClassName属性被useFullScreen hooks覆盖的问题 (#2598) 2023-03-04 14:08:23 +08:00
前端爱码士
7f5e415da9 fix: 修复deepMerge方法问题 (#2597) 2023-03-04 14:08:13 +08:00
yx lin
714a351036 Feat/cancel event (#2593)
* feat(excel): add cancel event for import excel

* feat(excel): add cancel emits
2023-03-03 13:14:01 +08:00
luocong2016
a78c3a305b Update CollapseHeader.vue (#2583)
#2582
2023-03-02 15:14:00 +08:00
前端爱码士
bb8c2dea40 fix: 解决IconPicker初始拷贝了value的值,导致剪切板内容被覆盖 (#2591) 2023-03-02 15:13:45 +08:00
luocong2016
dce3aba20d refactor: 重构案例代码 (#2589) 2023-03-02 15:13:30 +08:00
jsong
256e0275fe Feat/modify input excel (#2587)
* feat: optimize parameter

* Revert "feat: optimize parameter"

This reverts commit 957dfc95dd.

* feat: can input irregulate excel
2023-02-27 12:52:09 +08:00
tttleon
c70cf3cace fix 主动调用 axioscancelToken 的 cancel 取消请求时 无效的问题 (#2586)
cancelToken 如果被深拷贝,会导致最外层无法使用cancel方法来取消请求
2023-02-27 12:51:51 +08:00
前端爱码士
4f4bec0c22 fix: 修复消息hooks icon类型 (#2585) 2023-02-27 12:51:26 +08:00
luocong2016
491941e4c5 fix<CollapseContainer>: v-show 才不会丢失目标容器 (#2584) 2023-02-27 12:51:13 +08:00
珍藏的小板凳
f1678a7cc0 fix: 修复Container中头部组件插槽中的action不生效的问题 (#2582)
Co-authored-by: xuyang.geng <xuyang.geng@gaea.com>
2023-02-27 12:50:36 +08:00
luocong2016
ed8cffb2a1 fix: 组件属性优先默认 (#2581) 2023-02-27 12:50:11 +08:00
luocong2016
8284d106e2 refactor<useForm>: 重构案例 (#2577) 2023-02-23 22:57:38 +08:00
lzdjack
de305ecd47 fix: 修复页面缓存 (#2575)
1. 修复页面不能缓存的bug
2. 此更新为破坏性更新,页面不支持多标签使用
3. 将表单设计模块多标签改成单标签
2023-02-23 10:28:05 +08:00
luocong2016
a222404220 refactor<mock>: compatibility notes (#2555) 2023-02-22 18:32:53 +08:00
luojz
5335ae7578 fix(FormTable): fix table spread selection(#2565) (#2574)
Co-authored-by: luojingzhou <luojingzhou@kezaihui.com>
2023-02-22 18:32:32 +08:00
luocong2016
f32d2715ef fix: css !mt-5 (#2573) 2023-02-22 18:32:20 +08:00
luocong2016
fb73be0928 fix: table 高度消失 (#2572) 2023-02-22 18:32:07 +08:00
luocong2016
c2a159155c fix: 重复点击全屏会抖动 (#2571) 2023-02-22 18:31:44 +08:00
luocong2016
70ee1c8403 refactor: 插槽优先属性调整,prefixCls优先关系调整 (#2570) 2023-02-22 18:31:27 +08:00
luocong2016
7346988622 refactor: collapse/CollapseContainer (#2569) 2023-02-22 18:31:13 +08:00
luocong2016
d6fdfd9f93 fix<utils>: Color Regular Error (#2567) 2023-02-22 18:30:46 +08:00
Houtaroy
d88915bac3 🐞 fix(Tree): 调整checkedKeys属性的类型 (#2562) 2023-02-22 18:09:30 +08:00
ZhangZhiChao
a1b9bbc2ce fix: 重置表单时移除URL中的参数 (#2559) 2023-02-19 14:25:09 +08:00
luocong2016
64d6fece08 docs: optimization point notes (#2534) 2023-02-15 11:43:50 +08:00
luocong2016
be3d98fa3d chore<table>: fix type (#2529) 2023-02-15 11:43:35 +08:00
luocong2016
ce0f528ba8 chore<table>: fix type (#2528) 2023-02-15 11:43:23 +08:00
luocong2016
085929a9c0 fix<table>: 高度丢失 (#2527) 2023-02-15 11:43:09 +08:00
Vinton
de4eaddffd fix: 注释build/util文件中的代码,修复热更新无效的问题 (#2551)
Co-authored-by: huangwentao <huangwentao@dianchu.com>
2023-02-15 11:42:50 +08:00
wwsheng009
e1804bd866 form-design优化代码格式,清除无用的注释与引用 (#2547)
* fix: 修复form设计器在黑暗模式下的显示问题

* perf: [form-design]优化源代码,清除无用注释与注释
2023-02-15 11:42:35 +08:00
Wit〆苗大
334a0ea8e5 fix(TableAction): 修复outside模式引用时报错;VxeTable demo引用TableAction改为outside模式, 属性添加keepSource以解决警告 (#2544)
* fix(TableAction): 修复outside模式引用时报错: TypeError: Cannot read properties of undefined (reading 'value')

* perf(VxeTable): demo引用TableAction改为outside模式以解决警告; 属性添加keepSource以解决警告

---------

Co-authored-by: 苗大 <caoshengmiao@hypergryph.com>
2023-02-10 19:53:32 +08:00
wwsheng009
bce6cee53a fix: 修复form设计器在黑暗模式下的显示问题 (#2543) 2023-02-10 19:52:57 +08:00
ZhangZhiChao
32daad6198 fix: 修复esbuild的drop_console (#2542) 2023-02-10 19:52:42 +08:00
luocong2016
a4a5a44009 feat<useLogin>: original Form.validate (#2535) 2023-02-10 07:44:29 +08:00
wwsheng009
c5b39f2c16 feat: 增加表单设计器 (#2533) 2023-02-10 07:43:27 +08:00
Wit〆苗大
4c0f2038af perf(vxetable): 封装方法中加入可编辑表格和表单验证相关方法名,并在demo中增加新增和删除方法调用实现 (#2532)
* perf(vxetable): 封装方法中加入可编辑表格相关方法名,并在demo中增加新增和删除方法调用实现

* perf(vxetable): 封装方法中加入表单验证方法名

---------

Co-authored-by: 苗大 <caoshengmiao@hypergryph.com>
2023-02-10 07:42:59 +08:00
luocong2016
d25dfcc7c0 docs:optimization point notes (#2526) 2023-02-10 07:42:04 +08:00
ZhangZhiChao
8992ef472e build: 替换vite废弃的选项brotliSizereportCompressedSize,移除v-i18n-next的fix warning (#2522) 2023-02-10 07:41:36 +08:00
Carson
f7a1b02236 fix(useColumns): 多级表头下的列支持行内编辑 (#2521) 2023-02-05 16:33:12 +08:00
刘大卫
0dc2f1496b fix: 合并单元格页面 由于 ant-design-vue 升级 v3 版本,页面报 Warning: columns.customRender 即将废弃,columns.customRender 用 columns. customCell 替换 (#2520)
* fix(MergeHeader): 组件/Table/合并单元格页面 修改 Tabel.title 值为 合并单元格、修改 Table.bordered 值为 true 更好显示合并单元格效果

* fix(tableData): 由于 ant-design-vue 升级 v3 版本,页面报 Warning: columns.customRender 即将废弃
2023-02-05 16:33:03 +08:00
mfish
dab977ffbc fix(ApiSelect): 解决参数类型为string时的警告问题 (#2517)
* feat(axiosSuccess): 操作成功后根据传入提示模式进行相应

* fix(axiosRetry): 解决get重试请求返回的headers造成无法成功请求的问题

* fix(axiosRetry): 参数首字母小写

* fix(useDataSource): 解决deleteTableRecord删除树形表格的行记录时,无法删除,无法找到子节点的问题

* feat(useDataSource): 删除之前提交代码遗留的console

* fix(permissionGuard): 当获取用户信息失败时,不允许正常登陆返回登陆界面

* fix(permissionGuard): 代码还原

* fix(menu): 解决隐藏菜单目录只能隐藏第一层目录的问题,递归隐藏所有子菜单

* feat(baseSetting): 个人设置图标修改时弹出窗显示原图片,由于跨域获取图片存在问题暂时将user.ts中的跨域图片链接去掉,直接采用本地图片

* fix(ApiSelect): 解决参数类型为string时的警告问题
2023-02-05 16:32:53 +08:00
luocong2016
92cc603680 chore: fix type (#2516) 2023-02-05 16:32:44 +08:00
lzdjack
d3ec7a58ad fix: 修复RadioButtonGroup组件返回值不正确的bug (#2513) 2023-01-31 18:03:21 +08:00
lzdjack
83e529681a perf: 优化ApiRadioGroup回调函数change参数 (#2512) 2023-01-31 18:03:11 +08:00
lzdjack
4d6f24d053 perf: 优化ApiCascader回调函数change参数 (#2511) 2023-01-31 18:03:02 +08:00
lzdjack
45b0be7f7e fix: 修复表单自定义组件验证不通过的bug (#2510) 2023-01-31 18:02:53 +08:00
jinmao88
c999abb236 fix: ci error 2023-01-30 16:20:54 +08:00
jinmao88
816fffe960 fix: lodash 2023-01-30 16:13:07 +08:00
jinmao88
0ad30503a7 chore: update ci 2023-01-30 15:58:36 +08:00
jinmao88
d02ab2d220 chore: update ci 2023-01-30 15:44:56 +08:00
lzdjack
6753e24b3d feat: 接入vextable组件 (#2508) 2023-01-30 14:48:04 +08:00
Wit〆苗大
b90d3572a9 fix(AppendForm): 修复 批量添加表单配置 按钮点击事件未使用批量方法 问题; 表单排版改用baseColProps一次配置,减少重复代码 (#2504)
* fix(AppendForm): 修复 批量添加表单配置 按钮点击事件未使用批量方法 问题

* perf(AppendForm): 表单排版改用baseColProps一次配置,减少重复代码

Co-authored-by: 苗大 <caoshengmiao@hypergryph.com>
2023-01-18 22:43:45 +08:00
Cyrus Zhou
1657439569 修复 updateSchema 多个field 属性时,第二个无效问题。 (#2493)
* Table BasicColumn 添加 editDynamicDisabled
Co-authored-by: Cyrus Zhou <6802207@qq.com>
使用方式同 Form FormSchema dynamicDisabled
```
export const Columns: BasicColumn[] = [
  {
    title: 'Title',
    dataIndex: 'Title',
    editRow: true,
    editComponent: 'Select',
    editDynamicDisabled: ({ record }) => record.isDisabled,
  },

* editComponentProps onChange 功能恢复
Co-authored-by: Cyrus Zhou <6802207@qq.com>
说明:
...omit(compProps, 'onChange')
这会忽略 onChange ,导致 editComponentProps onChange 被取消

如下功能将不支持:
```
editComponentProps: ({ record }) => {
  return {
    options: effectTypeData,
    onChange: () => {
    },
  };
},
```

* tableData == null 报错

* ApiSelect 第一次选择触发required错误提示问题

* 恢复 虽然可以解决第一次选择提示报错问题,但是会导致 onChange: (e: any, options: any) => 无法获得 options 的值

* 修复标签页切换灰屏不显示内容问题
Co-authored-by: Cyrus Zhou <6802207@qq.com>
问题描述页面没有用 div 包括 会提示 Component inside <Transition> renders non-element root node that cannot be animated ,
导致页灰屏必须刷新页面才可以显示内容

* 添加 Form ApiTransfer
## 使用方式
api 方式:
```
    ......
    component: 'ApiTransfer',
    componentProps: {
       api: sysUserSelector,
       labelField: 'name',
       valueField: 'id',
    },
    .....
```
数据方式:
```
     ....
     componentProps: {
      dataSource: [
        { title: 'Test01', key: '0', disabled: false, description: 'description 01' },
        { title: 'Test02', key: '1', disabled: false, description: 'description 02' },
        { title: 'Test03', key: '2', disabled: false, description: 'description 03' },
        { title: 'Test04', key: '3', disabled: false, description: 'description 04' },
        { title: 'Test05', key: '4', disabled: false, description: 'description 05' },
      ],
    },
    ....
```

* style: eslint 书写规范

* fix: 频繁切换页面导致灰屏

* fix: 修复 updateSchema 多个field 属性时,第二个无效问题。

如:
```
updateSchema([
          {
            field: 'password',
            ifShow: !unref(isUpdate),
          },
          {
            field: 'confirm',
            ifShow: !unref(isUpdate),
          },
        ]);
        ```

Co-authored-by: CyrusZhou <6802207@qq.com>
2023-01-18 11:17:44 +08:00
mfish
8dd8a5ed01 个人设置图标修改时弹出窗显示原图片,由于跨域获取图片存在问题暂时将user.ts中的跨域图片链接去掉,直接采用本地图片 (#2487)
* feat(axiosSuccess): 操作成功后根据传入提示模式进行相应

* fix(axiosRetry): 解决get重试请求返回的headers造成无法成功请求的问题

* fix(axiosRetry): 参数首字母小写

* fix(useDataSource): 解决deleteTableRecord删除树形表格的行记录时,无法删除,无法找到子节点的问题

* feat(useDataSource): 删除之前提交代码遗留的console

* fix(permissionGuard): 当获取用户信息失败时,不允许正常登陆返回登陆界面

* fix(permissionGuard): 代码还原

* fix(menu): 解决隐藏菜单目录只能隐藏第一层目录的问题,递归隐藏所有子菜单

* feat(baseSetting): 个人设置图标修改时弹出窗显示原图片,由于跨域获取图片存在问题暂时将user.ts中的跨域图片链接去掉,直接采用本地图片
2023-01-18 11:17:18 +08:00
前端爱码士
f1717973c4 fix: 修复props中Array类型定义问题 (#2491) 2023-01-18 11:16:43 +08:00
Wit〆苗大
0cc53558fb fix(EditableCell): 修复可编辑表格 组件onChange重复问题 (#2495)
* fix: props 初始化拼写错误 defualt => default

* fix: props 定义默认值拼写错误 defualt => default

* fix(EditableCell): 修复可编辑表格select组件onChange重复问题

Co-authored-by: 苗大 <caoshengmiao@hypergryph.com>
2023-01-18 11:16:33 +08:00
nalomu
7e77177ed8 fix:修复header下拉菜单和外部页面菜单的文档链接 (#2500) 2023-01-18 11:16:15 +08:00
前端爱码士
bb1fee5885 fix: 修复table组件insertTableDataRecord方法的返回类型 (#2490) 2023-01-18 11:16:04 +08:00
1xuanyuan1
53b2b23620 fix: 修复权限切换不生效问题 (#2488)
Co-authored-by: 戴文俊 <daiwenjun@qutoutiao.net>
2023-01-18 11:15:46 +08:00
vivianma83
4c67d8c388 feat: 使用useForm时调用setFieldsValue后,组件的onChange未主动触发 (#2142) (#2503)
Co-authored-by: maxiaojing <maxiaojing@hashdata.cn>
2023-01-18 11:15:16 +08:00
Zuo Jiangtao
0ab2a541cb build: git config (#2474) 2023-01-18 11:14:58 +08:00
MAM
4dc5385104 upgrade (#2486)
* fix: upgrade vue from 3.2.37 to 3.2.45

Snyk has created this PR to upgrade vue from 3.2.37 to 3.2.45.

See this package in npm:


See this project in Snyk:
https://app.snyk.io/org/mam-06/project/2dc2fb63-61b9-4ffd-b74e-e101b53b7190?utm_source=github&utm_medium=referral&page=upgrade-pr

* fix: package.json & yarn.lock to reduce vulnerabilities (#6)

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-TINYMCE-3166281

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Co-authored-by: Snyk bot <github+bot@snyk.io>
2023-01-07 03:09:09 +08:00
mfish
26bd4aeba6 解决隐藏菜单目录只能隐藏第一层目录的问题,递归隐藏所有子菜单 (#2484)
* feat(axiosSuccess): 操作成功后根据传入提示模式进行相应

* fix(axiosRetry): 解决get重试请求返回的headers造成无法成功请求的问题

* fix(axiosRetry): 参数首字母小写

* fix(useDataSource): 解决deleteTableRecord删除树形表格的行记录时,无法删除,无法找到子节点的问题

* feat(useDataSource): 删除之前提交代码遗留的console

* fix(permissionGuard): 当获取用户信息失败时,不允许正常登陆返回登陆界面

* fix(permissionGuard): 代码还原

* fix(menu): 解决隐藏菜单目录只能隐藏第一层目录的问题,递归隐藏所有子菜单
2023-01-07 03:08:52 +08:00
yuh
61d6057fa4 fix: 裁剪上传接口与uploadModal统一:url (#2482) 2023-01-03 20:13:46 +08:00
李勇
9090cee184 fix: table-datasource,如果后端返回的page total是字符串,会导致页码乱掉 (#2483) 2023-01-03 20:13:26 +08:00
Vinton
31042de6bc perf(component): 优化table 组件的insertTableDataRecord的方法,增加批量插入的功能。 (#2481)
Co-authored-by: huangwentao <huangwentao@dianchu.com>
2023-01-01 17:25:10 +08:00
ruxue777
aabafe8610 fix(components): [Table,EditableCell] rename Function (#2466) 2022-12-27 12:11:59 +08:00
Vinton
098621892d perf(component): 1.优化appendSchemaByField只能单一添加一个表单项的问题,可以传入数组表单项,统一添加,减少重复方法调用 2. 增加批量添加表单项demo (#2472) 2022-12-22 21:36:36 +08:00
sevth
582d7e7351 fix: table cell edit bug. (#2465) 2022-12-18 19:54:39 +08:00
mfish
ca487426a1 删除之前遗留的console (#2463)
* feat(axiosSuccess): 操作成功后根据传入提示模式进行相应

* fix(axiosRetry): 解决get重试请求返回的headers造成无法成功请求的问题

* fix(axiosRetry): 参数首字母小写

* fix(useDataSource): 解决deleteTableRecord删除树形表格的行记录时,无法删除,无法找到子节点的问题

* feat(useDataSource): 删除之前提交代码遗留的console
2022-12-18 19:53:55 +08:00
Sunny-117
2387dcdc6d chore: change website link (#2462)
* chore: change website link

* chore: change website link en
2022-12-18 19:53:30 +08:00
mfish
9435b480ab 解决deleteTableRecord删除树形表格的行记录时,无法删除,无法找到子节点的问题 (#2461)
* feat(axiosSuccess): 操作成功后根据传入提示模式进行相应

* fix(axiosRetry): 解决get重试请求返回的headers造成无法成功请求的问题

* fix(axiosRetry): 参数首字母小写

* fix(useDataSource): 解决deleteTableRecord删除树形表格的行记录时,无法删除,无法找到子节点的问题
2022-12-15 18:30:44 +08:00
李勇
8c2ba755c1 fix:增加basictable组件name,防止注册组件的时候组件没有name (#2440) 2022-12-07 17:12:09 +08:00
Little-LittleProgrammer
c7639c4909 fix(basicForm): Fixed an issue where custom rules trigger would not take effect (#2439)
Co-authored-by: 吴安乐 <wuanle@qimao.com>
2022-12-07 17:11:42 +08:00
wangzhi
6af828260e Update index.vue (#2433)
下面这块代码 在我的项目打包后在比较宽的屏幕(2K 31 寸)有显示 bug 两边会出现大面积空白,   有偶发性 清缓存首次进入会出现 , 刷新就没了, 这里为什么要指定宽度 ?
2022-12-02 09:39:29 +08:00
前端爱码士
5a9a8644d6 fix: 修复Form组件emptySpan类型定义错误 (#2432) 2022-12-01 13:04:46 +08:00
Vinton
0bb3b7f90d fix: 修复频繁调用_setDefaultValue方法,设置初始值的时候,多次调用失效的问题 (#2431)
Co-authored-by: huangwentao <huangwentao@dianchu.com>
2022-12-01 13:04:31 +08:00
yaoyylm
87ee7cd27a 处理(Warning 'Use of eval is strongly discouraged')警告 (#2424) 2022-11-25 08:42:02 +08:00
mfish
ce030d2d1d axiosRetry参数首字母小写 (#2419)
* feat(axiosSuccess): 操作成功后根据传入提示模式进行相应

* fix(axiosRetry): 解决get重试请求返回的headers造成无法成功请求的问题

* fix(axiosRetry): 参数首字母小写
2022-11-24 18:16:34 +08:00
mfish
43c8bf0d0b 解决get重试请求返回的headers造成无法成功请求的问题 (#2416)
* feat(axiosSuccess): 操作成功后根据传入提示模式进行相应

* fix(axiosRetry): 解决get重试请求返回的headers造成无法成功请求的问题
2022-11-24 06:45:28 +08:00
coder_Q
bc099041ce style: optimize the way success hints are encoded in transformRespons… (#2411)
* style: optimize the way success hints are encoded in transformResponseHook #2410

* style: move to introduce location

Co-authored-by: 邱子建 <qiuzijian@qiuzijiandeMacBook-Air.local>
2022-11-24 06:44:53 +08:00
前端爱码士
0629cc7b14 fix: 修复表格图片插槽margin不生效问题 (#2400) 2022-11-22 10:56:24 +08:00
tnnevol
4e16438494 fix: #2390 [Preview]缩小后scale为负值 (#2391) 2022-11-17 23:51:34 +08:00
JinMao
c5713c75ec chore: update ci 2022-11-16 20:48:58 +08:00
JinMao
e7ac09cf39 chore: update ci 2022-11-16 20:31:00 +08:00
JinMao
be4c98b980 chore: update ci 2022-11-16 19:28:57 +08:00
JinMao
e013f04151 chore: update ci 2022-11-16 19:09:44 +08:00
JinMao
3948ba1b01 chore: update ci 2022-11-16 19:02:24 +08:00
JinMao
e74a9ed337 chore: update ci 2022-11-16 18:50:10 +08:00
JinMao
750a50ebfd chore: update ci 2022-11-16 18:46:42 +08:00
JinMao
6d1adce462 chore: update ci 2022-11-16 18:12:16 +08:00
JinMao
d01c1b4d05 chore: update ci 2022-11-16 18:02:57 +08:00
WYH
6844f69c20 fix: 修复demo中formTable几个空指针报错和selectedRowKeys丢失响应式的问题 (#2386)
Co-authored-by: 王一骅 <wangyihua@yazuishou.com>
2022-11-16 17:19:27 +08:00
JinMao
057b82632b chore: update ci 2022-11-15 20:21:43 +08:00
JinMao
908a2fbb3a chore: update ci 2022-11-15 19:43:20 +08:00
smilv
2d2a265418 fix: views中country目录不存在 (#2383) 2022-11-15 18:12:00 +08:00
johnshi
e05a009989 加载失败显示图像占位符。 (#2381)
* 加载失败显示图像占位符。

* fix: 更新package.json
2022-11-15 18:11:43 +08:00
zreren
7fad00cb77 The link of document had been expired (#2378)
* fix:doc link expired

* fix:doc link expired
2022-11-15 08:12:15 +08:00
vben
93d4655285 chore: update ci 2022-11-14 15:04:30 +08:00
vben
448d21287c chore: update ci 2022-11-14 14:56:59 +08:00
vben
31f489fa90 chore: update ci 2022-11-14 14:36:42 +08:00
vben
640ac6217f chore: update ci 2022-11-14 14:26:05 +08:00
vben
37c25a42f5 fix: ci 2022-11-14 14:05:09 +08:00
vben
cdb460897b chore: update ci 2022-11-14 13:59:10 +08:00
vben
84df7a4bb2 chore: update ci 2022-11-14 13:29:56 +08:00
vben
476b2b8acc chore: update CNAME 2022-11-14 13:26:14 +08:00
hunshcn
4041284345 fix(vite-plugin-styleImport): fix ATextarea 直接引用出现样式导入错误的问题 (#2365) 2022-11-14 11:54:59 +08:00
前端爱码士
a12c5706e8 fix: 修复props默认字段default返回空对象语法问题 (#2369) 2022-11-14 11:54:30 +08:00
Wit〆苗大
6fa35521b7 fix: props 定义默认值拼写错误 defualt => default (#2362)
* fix: props 初始化拼写错误 defualt => default

* fix: props 定义默认值拼写错误 defualt => default

Co-authored-by: 苗大 <caoshengmiao@hypergryph.com>
2022-11-12 00:19:58 +08:00
前端爱码士
00c446efff fix: 修复导入相同excel文件不发生change事件 (#2356) 2022-11-12 00:19:44 +08:00
hunshcn
5539190c39 fix(utils): fix dateUtil.formatToDate/formatToDateTime ts type (#2354) 2022-11-11 09:52:30 +08:00
hunshcn
384f929443 fix(utils): fix dateUtil.formatToDate ts type (#2345) 2022-11-10 11:58:33 +08:00
前端爱码士
9ba15705b5 fix: 统一errorMessageMode值为单引号 (#2343) 2022-11-10 11:58:14 +08:00
destiny
d16f6f8e44 fix(component): 解决导出excel数据某一项为null时计算宽度报错 (#2338) 2022-11-09 09:58:30 +08:00
Corn
fc2e2c8789 fix: fix typo (#2337) 2022-11-08 09:06:54 +08:00
ludens blunt
df0e0cbe69 Update index.ts (#2336)
fix(deepMerge): 原对象受浅拷贝影响的问题
2022-11-08 09:06:24 +08:00
Wit〆苗大
7dcb38cac6 fix(BasicTable): setSelectedRows 引入但未加入 tableAction (#2332)
Co-authored-by: 苗大 <caoshengmiao@hypergryph.com>
2022-11-08 09:06:08 +08:00
zxiaozhou
eda251a426 表格添加一个setRows方法以便数据回显后重新获取数据 (#2327) 2022-11-06 06:55:39 +08:00
mfish
17d16ae545 feat(axiosSuccess): 操作成功后根据传入提示模式进行相应 (#2326) 2022-11-06 06:55:07 +08:00
Wit〆苗大
9ae67bf9ca fix: inputNumberGroup(前置/后置标签) span 不起作用的问题,增加样式之后可以根据Span动态适应 (#2325) 2022-11-04 23:45:57 +08:00
前端爱码士
8ba4fb2449 fix: 修复RouteMeta接口定义缺少的RoleEnum引用 (#2323) 2022-11-04 23:45:37 +08:00
无木
1bafeb6638 fix(fullscreen): fix judging full screen status, fixed #2281 2022-10-31 13:12:23 +08:00
无木
fd57b83db6 fix(basicTree): checked with searching, fixed #2070 2022-10-29 10:47:12 +08:00
无木
513ccb9543 fix(route): url with hash not work. fixed #2301 #1311 #1253 2022-10-29 10:35:36 +08:00
无木
e962fa039a fix: auto resize echart on menu collapsed, fixed #2265 2022-10-29 10:05:44 +08:00
无木
58b30aae9a refactor: form advanced logic,fixed #2124, #2078,#2089 . follow #2125 2022-10-29 09:37:39 +08:00
无木
4f9cdc5634 fix(table): rollback value on cancel editing, fixed:#2309 2022-10-28 13:47:06 +08:00
无木
5292838fcd fix(apiSelect): remove attribute warning, fixed #2247 2022-10-28 13:31:43 +08:00
前端爱码士
fd9450304d fix: 关闭非当前的标签没有同步清理cacheTabList数据 (#2306) 2022-10-25 08:49:06 +08:00
sevth
bc499744c0 feat(Form): 支持filedMapToTime分别格式化时间,支持配置时间相关组件默认值处理开关,当组件配置valueFormat时,默认值绑定不再是moment对象,此时应关闭默认值的转换处理 (#2305)
* fix: 修复使用 extendSlots 时插槽参数未传递的问题。

* feat(Form): `fieldMapToTime`additional time formatting support separately.

* fix(Form): Add `isHandleDateDefaultValue` property.

Co-authored-by: sevth <pengqiang@vastweb>
2022-10-25 08:48:47 +08:00
Sizhu Wang
c8b169494f fix(form): 修复表单fieldMapToTime对应的值为空仍提交原来的字段值 (#2303) 2022-10-25 08:48:29 +08:00
sedice
c1d3a94371 refactor: 重构button代码props的引入方式,获取更优雅的类型提示 (#2302)
Co-authored-by: zengqinglong <1107238436@qq.com>
2022-10-23 03:17:50 +08:00
CherishTao
0eb1275c34 Update layout.ts (#2298) 2022-10-23 03:16:50 +08:00
Wit〆苗大
e08a155c40 feat(EditableCell): table 可编辑单元格和可编辑行 增加 单选框相关组件, 并增加示例 (#2294)
Co-authored-by: 苗大 <caoshengmiao@hypergryph.com>
2022-10-20 06:57:56 +08:00
前端爱码士
c37a15fefb fix: 修复getParentLayout方法接受了参数,但并没有用上 (#2290) 2022-10-19 13:34:58 +08:00
前端爱码士
7e4312ec1e fix: vscode安装本地缓存插件后,项目根目录下会生成.history文件夹,忽略提交 (#2287) 2022-10-19 13:34:31 +08:00
前端爱码士
839271d70a fix: 解决mac系统提交代码环境变量报错问题 (#2286) 2022-10-19 13:33:55 +08:00
JinMao
768fadbffb fix: Form method name field 2022-10-18 14:47:50 +08:00
前端爱码士
9aa2cf3ebf fix: 修复单词拼写错误,replace 'Filed' width 'Feild' (#2285) 2022-10-17 09:07:09 +08:00
Luke
b1f78c6696 fix: 取消重复请求,错误处理 (#2184) 2022-10-16 14:22:59 +08:00
zhangcheng1164
dda27477af fix: 修复ColumnSetting中列展示复选框在所有普通列都处于选中状态时没有处于选中状态的bug (#2278) (#2280) 2022-10-14 23:41:41 +08:00
JinMao
1a8cdeb374 fix: workflows 2022-10-13 08:53:00 +08:00
JinMao
5f0bf59a8b fix: workflows 2022-10-13 08:40:30 +08:00
JinMao
1b7896c435 fix: workflows 2022-10-13 08:29:12 +08:00
JinMao
d39e13270c fix: workflows 2022-10-13 08:20:32 +08:00
JinMao
5cabd4a6eb fix: workflows 2022-10-13 08:14:17 +08:00
JinMao
451371a812 fix: workflows 2022-10-13 07:59:31 +08:00
JinMao
6faacd2d85 fix: workflows 2022-10-13 07:51:18 +08:00
JinMao
61aefcaa65 fix: workflows 2022-10-12 20:12:43 +08:00
JinMao
acfba7cccc fix: workflows 2022-10-12 20:02:47 +08:00
JinMao
cb28986683 fix: workflows 2022-10-12 18:13:51 +08:00
姚文强
a89ba204eb fix typo (#2266) 2022-10-12 16:18:33 +08:00
Lovell Liu
a45208673a Fix/workbech page (#2264)
* fix: fix display issues when reloading page

* feat: change a fit color for js-logo icon

* fix: prevent layout chaos because of text wrap
2022-10-12 16:17:42 +08:00
wujieli
39188780ea feat(components): 更新 tinymce skins 目录文件版本 #2155 (#2192) 2022-10-09 16:26:32 +08:00
wangkang
99326342bc 表格查询条件下拉框文本超长显示错乱 (#2242)
* Update index.less

fix: 下拉框文本超长显示问题修改

* Update BasicTable.vue

fix: 表格查询条件下拉框文本超长显示错乱
2022-10-02 06:12:14 +08:00
acdxxx177
dfe560a542 perf: 头像上传组件返回值增加后端接口的返回值 (#2244) 2022-10-02 06:12:01 +08:00
wujieli
692df33fd8 types(components): ApiTransfer props 类型错误,删除多余属性 (#2197) 2022-09-29 13:49:44 +08:00
c37csq
9316d950b1 fix: excel export set width (#2206) 2022-09-29 13:49:32 +08:00
MrAlenZhong
5abb0f2b37 feat: 对BaseTree组件新增treeWrapperClassName属性 (#2217) 2022-09-29 13:49:17 +08:00
wangkang
e47c618b18 Update index.less (#2237)
fix: 下拉框文本超长显示问题修改
2022-09-29 13:49:01 +08:00
adeewu
2abc8275c6 修复调试位置与代码映射位置不一致问题 (#2228) 2022-09-29 13:48:50 +08:00
Aborn Jiang
f1d42769ea Update table.ts (#2223)
兼容row key有可能为number的情况
2022-09-29 13:48:35 +08:00
前端爱码士
dac9301af4 fix: 右键组件缺少PropType类型引用 (#2129)
右键组件缺少PropType类型引用
2022-08-05 11:12:26 +08:00
wjc112233
20c10df846 fix: 修改BasicForm表单的展开和收起按钮状态错误的bug (#2089) (#2109)
Co-authored-by: wjc <7098544231@qq.com>
2022-07-23 19:27:39 +08:00
wjc112233
b11df08aa4 fix: 修复SimpleSubMenu组件被意外地重新渲染的bug (#2106) (#2108)
Co-authored-by: wjc <7098544231@qq.com>
2022-07-23 19:26:33 +08:00
BlackTooth
6e391af3fe fix(keep-alive): disabler (#2101)
Co-authored-by: 隆杰 <longjie.li@taxsoyea.net>
2022-07-23 19:25:15 +08:00
Name6
7925c1ea28 fix(Login): fix display issues when AppLocalePicker's showText property is true (#2097) 2022-07-23 19:24:38 +08:00
newplum
442bd440ba fix(axios): 非GET请求时增加判断config.data是否为FormData (#2082) 2022-07-19 12:10:06 +08:00
wjc112233
4a4321a77d fix: 修改表格的resizeColumn事件的回调函数中,修改列宽度无效的bug (vbenjs#2073) (#2081)
Co-authored-by: wjc <7098544231@qq.com>
2022-07-19 12:09:45 +08:00
Arvin
aee08b14fa Revert "style: 优化滚动条显示,只有在内容超过显示高度时才会出现 (#1978)" (#2080)
This reverts commit deff31bc5d.
2022-07-19 12:09:12 +08:00
zuihou
b9dee8595f feat: 复现:表格中增加比较多的列,且加了rowSelection后,表格错位问题 2022-07-13 19:05:42 +08:00
zuihou
a753eb35cb feat: 表格中增加比较多的列,复现表格错位问题 2022-07-13 18:37:05 +08:00
GauharChan
c001535b56 fix(styleImport): fix ImagePreviewGroup build error (#2068)
Co-authored-by: gauhar chan <chenguohua@gzhtedu.cn>
2022-07-12 01:08:28 +08:00
vancenlee
9afb4318fd fix: inputnumber span 不起作用的问题,增加样式之后可以根据Span动态适应 (#2065)
Co-authored-by: van <vancnblog@126.com>
2022-07-10 18:29:37 +08:00
Henry
baa42a57fd fix: 使用枚举属性表示mock的响应状态 (#2062) 2022-07-10 18:29:21 +08:00
Arvin
6981b73ef6 fix: fix table header and table body cannot be aligned (#2058)
* fix: fix wrong naming

* perf: 表单设置初始值defaultValue时候使用深度拷贝

* perf: 表单设置初始值defaultValue时候使用深度拷贝

* Revert "perf: 表单设置初始值defaultValue时候使用深度拷贝"

This reverts commit a103cd11b4.

* perf: perf Tree Component

* fix: 解决tree树形异步懒加载,点击两次才能关闭

* fix: fix table header and table body cannot be aligned

Co-authored-by: yfh01 <unconfigured@null.spigotmc.org>
2022-07-10 18:28:52 +08:00
sevth
266c33819f fix: 修复使用 extendSlots 时插槽参数未传递的问题。 (#2056)
Co-authored-by: sevth <pengqiang@vastweb>
2022-07-10 18:27:56 +08:00
zhengqbbb
9c26ee1b9c chore: use cz-git commitizen adapter (#2054)
* chore: use `cz-git` commitizen adapter

* workflow: update `cz-git` types description
2022-07-10 18:27:38 +08:00
cn.shperry
f305637366 fix: 中文模式下日期选择框月份及星期异常显示英文 (#1406). (#2053)
Co-authored-by: 舒培培 <622292@ky-tech.com.cn>
2022-07-10 18:26:55 +08:00
Cyrus Zhou
40071529d2 添加 Form ApiTransfer , 修复标签页切换灰屏不显示内容问题 (#2052)
* Table BasicColumn 添加 editDynamicDisabled
Co-authored-by: Cyrus Zhou <6802207@qq.com>
使用方式同 Form FormSchema dynamicDisabled
```
export const Columns: BasicColumn[] = [
  {
    title: 'Title',
    dataIndex: 'Title',
    editRow: true,
    editComponent: 'Select',
    editDynamicDisabled: ({ record }) => record.isDisabled,
  },

* editComponentProps onChange 功能恢复
Co-authored-by: Cyrus Zhou <6802207@qq.com>
说明:
...omit(compProps, 'onChange')
这会忽略 onChange ,导致 editComponentProps onChange 被取消

如下功能将不支持:
```
editComponentProps: ({ record }) => {
  return {
    options: effectTypeData,
    onChange: () => {
    },
  };
},
```

* tableData == null 报错

* ApiSelect 第一次选择触发required错误提示问题

* 恢复 虽然可以解决第一次选择提示报错问题,但是会导致 onChange: (e: any, options: any) => 无法获得 options 的值

* 修复标签页切换灰屏不显示内容问题
Co-authored-by: Cyrus Zhou <6802207@qq.com>
问题描述页面没有用 div 包括 会提示 Component inside <Transition> renders non-element root node that cannot be animated ,
导致页灰屏必须刷新页面才可以显示内容

* 添加 Form ApiTransfer
## 使用方式
api 方式:
```
    ......
    component: 'ApiTransfer',
    componentProps: {
       api: sysUserSelector,
       labelField: 'name',
       valueField: 'id',
    },
    .....
```
数据方式:
```
     ....
     componentProps: {
      dataSource: [
        { title: 'Test01', key: '0', disabled: false, description: 'description 01' },
        { title: 'Test02', key: '1', disabled: false, description: 'description 02' },
        { title: 'Test03', key: '2', disabled: false, description: 'description 03' },
        { title: 'Test04', key: '3', disabled: false, description: 'description 04' },
        { title: 'Test05', key: '4', disabled: false, description: 'description 05' },
      ],
    },
    ....
```
2022-07-10 18:26:39 +08:00
Wit〆苗大
6f5711b088 fix(is.ts): 修复isUrl正则不能匹配到 hash模式的外链 的问题 (#2051)
Co-authored-by: 苗大 <v.caoshm@yoozoo.com>
2022-07-07 15:42:50 +08:00
quyanan
bc55b92c9b fix(expandtable): 恢复可展开表格Demo,修复开启可展开表格后横向滚动失效问题 (#2050)
Co-authored-by: jinmao88 <50581550+jinmao88@users.noreply.github.com>
2022-07-07 15:42:30 +08:00
fuling
f1e8e241b1 feat: ImportExcel组件增加直接获取文件功能,方便后端处理大Excel文件。 (#2045)
* style: 优化系统管理中账号、角色和部门表单样式

* feat: ImportExcel组件增加直接获取文件功能,方便后端处理大Excel文件。

Co-authored-by: 发光的卤蛋 <zdxndy@qq.com>
2022-07-07 15:41:25 +08:00
muamuamu
5833043d14 fix(useRedo): 重新加载页面useRedo方法会添加一条浏览记录 (#2043) 2022-07-07 15:41:08 +08:00
GauharChan
35f2d074ae fix: 修复#2030改动引起的可展开table失效 (#2042) 2022-07-07 15:40:33 +08:00
Tianyuan Zhang
c0e40fa01e refactor: update class AxiosTransform (#2041)
rename transformRequestHook to transformResponseHook
2022-07-07 15:39:48 +08:00
wjc112233
ddb678ddfa fix: fix#2031 修复表格可编辑行在编辑模式下,无法处理数组类型的值的问题 (#2035)
Co-authored-by: wjc <7098544231@qq.com>
2022-07-05 11:56:58 +08:00
Wit〆苗大
91e13c4287 fix(is.ts): fix#2028 修复isUrl正则可以匹配到/www问题 (#2033)
Co-authored-by: 苗大 <v.caoshm@yoozoo.com>
2022-07-05 11:56:45 +08:00
Wit〆苗大
de7279399d fix(table): 彻底修复column.slots已废弃的antd报错, 所有用到的demo页修改为antd 3.x v-slot:headerCell 和 v-slot:bodyCell 写法 (#2030)
Co-authored-by: 苗大 <v.caoshm@yoozoo.com>
2022-07-05 11:56:29 +08:00
Wit〆苗大
a89e497e82 fix: markdown深色模式内容区和代码块未适配bug; markdownViewer改为vidtor自带预览模式 (#2023)
* fix(Markdown): 修复深色模式 内容区和代码块 未改变主题bug

* perf(Markdown): MarkDown组件示例增加不同功能示例; 切换深色主题按钮 同时改变 内容区和代码块主题

* perf(MarkdownViewer): MarkdownViewer改为vditor自带的预览模式; 同时适配深色模式

Co-authored-by: 苗大 <v.caoshm@yoozoo.com>
2022-07-05 11:55:26 +08:00
BlackTooth
0f50e0458e fix(useTableFooter): not synchronization scroll bug (#2022)
Co-authored-by: 隆杰 <longjie.li@taxsoyea.net>
2022-07-05 11:43:53 +08:00
Cyrus Zhou
4730b3af31 Table BasicColumn 添加 editDynamicDisabled (#2018)
* Table BasicColumn 添加 editDynamicDisabled
Co-authored-by: Cyrus Zhou <6802207@qq.com>
使用方式同 Form FormSchema dynamicDisabled
```
export const Columns: BasicColumn[] = [
  {
    title: 'Title',
    dataIndex: 'Title',
    editRow: true,
    editComponent: 'Select',
    editDynamicDisabled: ({ record }) => record.isDisabled,
  },

* editComponentProps onChange 功能恢复
Co-authored-by: Cyrus Zhou <6802207@qq.com>
说明:
...omit(compProps, 'onChange')
这会忽略 onChange ,导致 editComponentProps onChange 被取消

如下功能将不支持:
```
editComponentProps: ({ record }) => {
  return {
    options: effectTypeData,
    onChange: () => {
    },
  };
},
```

* tableData == null 报错

* ApiSelect 第一次选择触发required错误提示问题

* 恢复 虽然可以解决第一次选择提示报错问题,但是会导致 onChange: (e: any, options: any) => 无法获得 options 的值
2022-07-05 11:43:34 +08:00
Charles
740d160198 fix: keep spaces of env config on prod build (#2015) 2022-07-05 11:42:49 +08:00
ParkerFiend
aefde45ad5 Update extensions.json (#1989) 2022-07-05 11:42:16 +08:00
Tanimodori
3cc72d6791 fix: 更新Schema时默认值不应覆盖已有值,fix #1997 (#2003) 2022-06-26 12:47:53 +08:00
Tanimodori
fbcba766ae fix: 修复DrawerFooter border-top导致滚动条出现的问题 (#2002) 2022-06-26 12:47:33 +08:00
Kuizuo
1455eb48db fix: rules validator tips (#2000) 2022-06-26 12:46:43 +08:00
Tanimodori
ba97f80d33 修复tinymce嵌入表单示例页面换行错误,清理!important,revert(vbenjs#1996) (#1999)
* revert: "修改tinymce富文本下拉菜单错位的bug (#1996)"

* style: 修复tinymce嵌入表单示例页面换行错误,清理!important
2022-06-26 12:46:27 +08:00
liuya6
0902de7504 修改tinymce富文本下拉菜单错位的bug (#1996) 2022-06-24 04:37:38 +08:00
cn.shperry
da8e0bdf91 fix: type warning. (#1994)
Co-authored-by: 舒培培 <622292@ky-tech.com.cn>
2022-06-24 04:37:21 +08:00
fuling
06236c9fe0 style: 优化系统管理中账号、角色和部门表单样式 (#1992)
Co-authored-by: 发光的卤蛋 <zdxndy@qq.com>
2022-06-24 04:36:38 +08:00
GauharChan
2c536976e8 feat(function): add table bodyCell slot for antdv3.x; and fix #1705 (#1991) 2022-06-24 04:36:20 +08:00
Tanimodori
c2e2ca9bed style: 修复antdv Modal header高度错误 (#1987) 2022-06-24 04:35:21 +08:00
Tanimodori
02c469b17a types: 再次修复RouteLocationRawEx类型错误 (vbenjs#1968) (#1975) 2022-06-19 17:51:28 +08:00
Micah
deff31bc5d style: 优化滚动条显示,只有在内容超过显示高度时才会出现 (#1978) 2022-06-19 17:50:33 +08:00
cn.shperry
e09a797d05 types: 缩减 setup script 警告 & 修复表格列设置组件中部分方法参数类型错误. (#1980)
Co-authored-by: 舒培培 <622292@ky-tech.com.cn>
2022-06-19 17:50:16 +08:00
cn.shperry
8a7d9bcd4d fix: 修复表格列设置下拉框中偶现列数据区域空白 (#1958) (#1981)
Co-authored-by: 舒培培 <622292@ky-tech.com.cn>
2022-06-19 17:49:47 +08:00
Micah
934ccd34ea fix: 修复 当窗口过窄时,表格中的删除确认框样式错乱 的问题 (#1972) 2022-06-16 19:05:10 +08:00
Tanimodori
85f1e58bcc types: 修复RouteLocationRawEx类型错误 (vbenjs#1968) (#1970) 2022-06-16 19:04:50 +08:00
ChenErik
e073b4c944 fix(echarts): add resize animation (#1950) 2022-06-16 19:04:30 +08:00
You
554f4615a1 fix: 菜单响应式隐藏时宽度计算错误 (#1945)
Co-authored-by: zeozhou <zeozhou@tencent.com>
2022-06-16 19:04:07 +08:00
Arvin
d21578ab33 表单设置初始值defaultValue时候使用深度拷贝 (#1935)
* fix: fix wrong naming

* perf: 表单设置初始值defaultValue时候使用深度拷贝

* perf: 表单设置初始值defaultValue时候使用深度拷贝

* Revert "perf: 表单设置初始值defaultValue时候使用深度拷贝"

This reverts commit a103cd11b4.

* perf: perf Tree Component

* fix: 解决tree树形异步懒加载,点击两次才能关闭

Co-authored-by: yfh01 <unconfigured@null.spigotmc.org>
2022-06-16 19:03:37 +08:00
山田
857af11ced feat(useContext): 删除多余重载 (#1932) 2022-06-16 19:02:51 +08:00
小顾
50468e9581 fix: 修复ColumnSetting中默认隐藏列拖拽排序错误的bug (#1931)
Co-authored-by: 顾佳磊 <jareygu@gmail.com>
2022-06-16 19:02:33 +08:00
Jim
19dc88b4e0 docs: 添加注释, 修复 (#1927)
* docs: 添加注释

* docs: 添加注释

* fix: 后台动态权限changePermissionCode加上await

* docs: 添加注释

* docs: 添加注释

* docs: 添加注释

* docs: 添加注释

* docs: 添加注释
2022-06-16 19:02:10 +08:00
Jim
cfbd52bbe7 docs: 添加注释 (#1924) 2022-05-28 05:49:18 +08:00
前端爱码士
c0edd7b70e fix: 个人中心(data.tsx)多余的html片段 (#1894)
删除个人中心(data.tsx)多余的html片段
2022-05-20 18:02:44 +08:00
chengj
fe5848cf21 feat: contextMenuItem add hidden property (#1890)
* fix: dropdown placement bottomCenter to bottom

* feat: contextMenuItem add hidden property
2022-05-20 18:02:23 +08:00
山田
c3b5abc392 fix(echarts): 修复无法使用散点图表 (#1880) 2022-05-20 18:01:14 +08:00
shellingfordly
a40332cbfe style: fix style error of login page (#1901)
Co-authored-by: liuyao <liuyao@liuyaodeiMac.local>
2022-05-20 18:00:31 +08:00
Joyboo
42908a4535 add TabsForm demo (#1914)
* chore: table size放到settings

* chore(TableAction): 操作确认框增加placement属性支持

* chore(Form): 表单field支持a.b.c嵌套写法

* feat(Form): add TabsForm demo

Co-authored-by: jinmao88 <50581550+jinmao88@users.noreply.github.com>
2022-05-20 18:00:08 +08:00
Felix Hoi
a0920d284d fix(useFormEvents): isNullOrUnDef is not defined (#1915)
* fix/invaild dateFormat

* fix(useFormEvents): isNullOrUnDef is not defined

Co-authored-by: Felix Hoi <felixhoi@ssm.gov.mo>
2022-05-20 17:59:45 +08:00
zuihou
419b7aea07 fix(axios): 请求异常时,无法正确执行 catch 2022-05-06 10:39:46 +08:00
仲灏
e807539b80 perf: Changing variable names (#1869) 2022-05-04 15:11:23 +08:00
Felix Hoi
0634f2ca9e fix/invaild dateFormat (#1871)
Co-authored-by: Felix Hoi <felixhoi@ssm.gov.mo>
2022-05-04 15:11:05 +08:00
Joyboo
d09e998ae7 表单field支持a.b.c的写法 (#1549)
* chore: table size放到settings

* chore(TableAction): 操作确认框增加placement属性支持

* chore(Form): 表单field支持a.b.c嵌套写法

Co-authored-by: jinmao88 <50581550+jinmao88@users.noreply.github.com>
2022-04-30 19:05:02 +08:00
Hongbusi
e097600003 Update README.md (#1861) 2022-04-29 18:39:41 +08:00
chengj
3ee7051950 fix: dropdown placement bottomCenter to bottom (#1865) 2022-04-29 18:39:16 +08:00
chengj
5ad93c6004 feat(function): get selected tree node (#1857) 2022-04-29 09:55:14 +08:00
爱吃薯片的内存条
ce7f382b9b fix: 修复tree组件初次渲染时无法应用已勾选的节点数组及一处字段名错误 (#1854) 2022-04-29 09:54:43 +08:00
Li Kui
1832d0c07a fix: custom validator check failed for prop "placement" (#1851)
[VueTypes warn]: oneOf - value should be one of "topLeft", "topCenter", "topRight", "bottomLeft", "bottomCenter", "bottomRight".
[Vue warn]: Invalid prop: custom validator check failed for prop "placement".
2022-04-29 09:54:18 +08:00
chengj
e05a40f680 feat: specify the position of Pagination in Table component (#1849)
* feat: table add pagination postion property

* feat: specify the postion of Pagination in Table
2022-04-26 13:36:18 +08:00
iconFehu
ee85839ba3 fix: fix wrong naming (#1845)
Co-authored-by: yfh01 <unconfigured@null.spigotmc.org>
2022-04-26 13:35:50 +08:00
Mr Tao
d6a3eecbc2 fix: update @vue/compiler-sfc version (#1836) 2022-04-22 06:32:58 +08:00
George Tan
8932bf9a2d fix(styleImport): fix RangePicker build error (#1820) 2022-04-21 10:48:22 +08:00
JinMao
9d4d78d2c9 chore: update deps 2022-04-21 10:30:04 +08:00
JinMao
2d553f204a chore: update deps 2022-04-18 08:25:20 +08:00
JinMao
3b86435766 feat: ApiTree add afterFetch props,add ApiTree demo 2022-04-18 08:21:04 +08:00
jenson
e3637e7af4 fix: 修复Tree组件如果重新定义fieldNames的title字段后设置actionList失效的问题 (#1778)
Co-authored-by: miaojingu <miaojingu@zclhgroup.com>
2022-04-13 19:46:08 +08:00
Henry Rao
b41e3939ac fix: 修复updateSchema之后会把已填值重置为defaultValue的问题 (#1792) 2022-04-13 19:45:55 +08:00
chengj
23e0932883 fix: 修复Description组件渲染function xxxx() { [native code] }的问题 (#1796)
* fix/description-render-prototype-methods

* fix/description-render-prototype-methods
2022-04-13 19:44:36 +08:00
jinmao88
8f2008ac74 Merge pull request #1799 from hsldymq/fix-fade-transition
fix(Transition): fade-transition淡出淡入无效
2022-04-13 19:41:09 +08:00
jinmao88
2bf48e0f23 合并拉取请求 #1801
feat: 实时监听form表单项值变化
2022-04-13 19:34:58 +08:00
chengj
c0441cf5c3 feat: listen form field value change 2022-04-13 10:49:53 +08:00
hsldymq
b3f6b04981 fix(Transition): fade-transition淡出淡入无效 2022-04-13 00:15:20 +08:00
zuihou
8d93e047d0 fix: 已经存在rules时,required不生效 2022-04-08 23:58:39 +08:00
zuihou
fb43e54847 feat(BasicTree): 支持设置加载中 2022-04-08 18:27:22 +08:00
zuihou
1e0ede09a2 fix: 已经存在rules时,required不生效 2022-04-08 16:39:32 +08:00
JinMao
823f7b3226 chore: update deps 2022-04-08 13:09:03 +08:00
zuihou
28d73f95bd fix: 无需导入 defineExpose 2022-03-30 09:38:48 +08:00
zuihou
418ca2405e Merge remote-tracking branch 'origin/main' 2022-03-28 09:23:52 +08:00
jinmao88
7c21eb9b3a Merge pull request #1752 from chenli1989/main
pref: Optimize tabs dropdown-menu style
2022-03-28 07:25:15 +08:00
zuihou
923ecdab3c fix: 修复表格编辑时 Checkbox 组件无法正常取消勾选 2022-03-28 00:43:07 +08:00
zuihou
eb231120e1 fix(table): 表格编辑支持AutoComplete 2022-03-28 00:41:59 +08:00
zuihou
a343b49014 feat: 表单新增name属性。 配置name后,可以解决同一个页面有多个表单且存在相同字段时, 生成的组件字段的id相同的问题 2022-03-28 00:41:09 +08:00
zuihou
28078d4263 refactor: 支持外部调用展开关闭接口 2022-03-28 00:39:46 +08:00
chenli1989
de266e538d perf: optimize tabs dropdown-menu style 2022-03-26 14:38:24 +08:00
chenli1989
b85a11d0f0 perf: optimize step-by-step form layout 2022-03-26 14:35:38 +08:00
Redon
770574c9b0 fix: 修复 Dropdown 组件 bottomCenter 参数变更的报错提示 (#1745) 2022-03-25 23:40:34 +08:00
chenls
0c633ff67d fix: Set cache overflow of the setTimeout Maximum delay value (#1742) 2022-03-25 23:40:15 +08:00
wangxiaoer5200
d31cb904db fix: 修复控制台一些常见报错和警告 (#1750)
Co-authored-by: wangbin <18695686631@163.com>
2022-03-25 23:39:49 +08:00
jianjianxu
a542317dc3 fix: wrong item.time without the "expires" (#1740) 2022-03-23 22:31:50 +08:00
chenls
e4305daf98 perf: remove ant-design-vue@3.0.0-beta.11 .ant-col fix (#1734) 2022-03-23 22:31:28 +08:00
Micah
10b59395b2 fix: 修复 运行npm run lint:stylelint命令时,无法识别less内置函数 (#1736)
删除 stylelint.config.js文件 rules中重复的selector-class-pattern

Co-authored-by: Micah <yumingsheng@hrbeu.edu.cn>
2022-03-23 22:31:01 +08:00
vben
1dca636521 fix: lint 2022-03-19 07:47:49 +08:00
vben
5db1250a8d fix: stylelint config, close #1658 2022-03-19 06:55:37 +08:00
Captain
136cbb1e3b feat: add request retry (#1553) 2022-03-19 00:07:34 +08:00
LuCat
78535bdd86 fix: 修复右键按钮在弹窗下层级问题 (#1552) 2022-03-19 00:06:37 +08:00
lzdjack
aaa30fbf10 feat(form): appendSchemaByField和updateSchema支持defaultValue (#1608)
1. 兼容appendSchemaByField和updateSchema支持设置默认值
2022-03-19 00:06:01 +08:00
Caisin
9092c34cd5 fix(table):basicColumn加泛型 (#1618)
新版本ant design vue的columnProps使用了泛型,导致xxx.data.ts里面定义的BasicColumn使用customRender地方全部报错
2022-03-19 00:05:49 +08:00
Leo Caan (陈栋)
3d55b0d45b fix: 修复Table当dataIndex为数组时,列设置中勾选列是否展示时使column结构异常的问题 (#1626) 2022-03-19 00:05:30 +08:00
Dack Wang
573a443007 fix(ApiCascader): 引入缺少useI18n库的t方法 (#1648)
* fix():  The Style of tableTitle slot

* fix(ApiCascader): 引入缺少useI18n库的t方法

Co-authored-by: 王英琦 <wangyingqi@91bihu.com>
Co-authored-by: wangyingqi <wangyingqi@chinapost.com.cn>
2022-03-19 00:05:14 +08:00
lee
79eb909c66 feat: make fields key of form deconstructable (#1663)
Co-authored-by: liheng.wu <liheng.wu@tcl.com>
2022-03-19 00:04:11 +08:00
vben
927220933e Merge branch 'main' of https://github.com/anncwb/vue-vben-admin 2022-03-18 21:36:55 +08:00
vben
5a3a7633ac chore: chalk is replaced by piccolors 2022-03-18 18:39:32 +08:00
vben
414101613e chore: lint fix 2022-03-18 20:34:44 +08:00
vben
21bae3ad49 chore: remove jest 2022-03-18 20:22:05 +08:00
vben
b303f1bea3 chore: update deps 2022-03-18 20:07:37 +08:00
JinMao
8f1bd4ae76 fix: Table Title Error 2 2022-03-18 13:50:03 +08:00
JinMao
5c24a1c4c4 fix: Table Title Error 2022-03-15 14:27:16 +08:00
JinMao
e91d757169 chore: update deps 2022-03-15 12:54:27 +08:00
jinmao88
4cda7c6fc1 Merge pull request #1705 from shellingfordly/main
fix(table): 修复antd报错,column.slots已废弃,修改为v-slot:headerCell
2022-03-14 11:38:58 +08:00
liuyao
a23020b76d fix(table): 修复antd报错,将column.slots修改为v-slot:headerCell 2022-03-11 16:17:36 +08:00
vben
af6ab98945 fix: build error 2022-02-28 00:21:26 +08:00
vben
ecc2135b5e chore: update deps 2022-01-24 23:30:26 +08:00
vben
4e4ce944bc feat: support dev https 2022-01-18 22:05:51 +08:00
lzdjack
b63f7d17de feat: 增强可编辑单元格功能 (#1576)
1. 增加可编辑单元格非编辑状态下可自定义样式
2. 扩展editComponentProps,可接受方法
2022-01-18 21:49:24 +08:00
ToQuery
67d514ad0e 新增 api tree 组件 (#1582)
* tsconfig 增加 types , 解决webstorm提示错误

* api-tree
2022-01-18 21:48:58 +08:00
lqxlearn
929141be96 fix:fetch-success total 0 (#1597)
Co-authored-by: qiuxiang <liumeiwang@localhost.com>
2022-01-18 21:48:05 +08:00
wentmac
e82bafa43e fix: 修复EditCellTable 可编辑单元格当columns.ellipsis=true时,回调中取不到key的值。 (#1598) 2022-01-18 21:47:47 +08:00
wangxiaoer5200
5fc28f92d5 fix: 修复CollapseContainer组件按钮插槽问题,close #1555 (#1557) 2021-12-31 09:26:58 +08:00
vben
5ac055be2f fix: build error 2021-12-28 21:48:12 +08:00
ToQuery
266b566850 tsconfig 增加 types , 解决webstorm提示错误 (#1527) 2021-12-28 18:47:57 +08:00
Captain
a281631ae3 fix: The value of ignoreCancelToken is not available in headers (#1506) 2021-12-28 18:47:44 +08:00
1sm
f964533701 feat(BasicForm): add submitOnChange option (#1521) 2021-12-28 18:47:21 +08:00
lzdjack
dd158a17fe feat: 添加table继承父元素高度的功能 (#1523)
在保证了原有的高度计算上,额外新增继承父级高度, 只需设置isCanResizeParent:true
2021-12-28 18:46:57 +08:00
CXM
c8d59a0bbc fix "fix: collapse canExpand (#1501)" (#1525)
* fix(type): fix ant-design-vue  ->

* fix: fix base64 blob

* fix: fix CollapseHeader canExpan bug
2021-12-28 18:46:38 +08:00
wangxiaoer5200
2423aeab64 fix: 修复表单重置某些input类型组件不生效问题,close #1519 (#1526)
Co-authored-by: bingguo <bingguo@gaoding.com>
2021-12-28 18:46:17 +08:00
George Tan
1a43142252 fix(form component): fix form 'vertical' layout row width (#1535) 2021-12-28 18:46:03 +08:00
Eikon
52e295f1d5 docs(enums): update description (#1532) 2021-12-28 18:45:48 +08:00
George Tan
de8ea59177 fix(table component): reduce 'insertTableDataRecord' code logic (#1536) 2021-12-28 18:45:32 +08:00
George Tan
1dc6faf3e6 feat(table component): add 'expandRows' table action (#1537)
* fix(table component): add 'expandRows'

* feat(table component): add 'expandRows' table action
2021-12-28 18:45:14 +08:00
George Tan
598ce5a1bf feat(table component): add 'scrollTo' table action (#1538) 2021-12-28 18:44:51 +08:00
Yinux
8c607b38f1 fix: Fix the date and week display issue on the lock screen(#1539) (#1542) 2021-12-28 18:42:51 +08:00
bingzhe
b84cc5eb06 fix(Modal): repair cancel event missing (#1545) 2021-12-28 18:42:03 +08:00
vben
f015a874e2 chore: update deps 2021-12-19 21:44:29 +08:00
sevth
4f35b95b6b fix: Multiple calls to createAxios function transform parameters are overwritten by other calls (#1474) 2021-12-18 22:28:20 +08:00
Henry Rao
46e28f0203 FixEditcell: 修复可编辑单元格不显示0的bug (#1486)
* fix: 修复可编辑表格不显示 0 的bug

* fix: 修复编辑单元格为空时不能触发编辑的bug
2021-12-18 22:27:44 +08:00
Henry Rao
aab6b4f393 fix: 修复多tab带参数匹配不正确的bug (#1482) 2021-12-18 22:27:28 +08:00
Mark
54ea44cdad fix(Modal): 修复弹窗在最新的360浏览器和搜狗失效的问题 (#1381) (#1488) 2021-12-18 22:26:27 +08:00
lzdjack
a462be0a5e fix: 修复上传附件之后回显了多余条目 (#1495) 2021-12-18 22:25:49 +08:00
lzdjack
b639650397 fix: 修复table自适应高度和title属性声明问题 (#1496)
1.修复table升级ant3.0导致无法自适应剩余高度
2.修复table升级ant3.0导致BasicColumn类型的title属性无法找到
2021-12-18 22:25:33 +08:00
lzdjack
9217a12bcc fix: 修复在windows下pnpm执行package.js里的脚本报错的问题 (#1497) 2021-12-18 22:25:19 +08:00
lzdjack
6b594aec53 fix: Fix the issue that clear verification does not take effect in the reset form (#1498) 2021-12-18 22:24:58 +08:00
CXM
fa33c6b0d7 fix: collapse canExpand (#1501)
* fix(type): fix ant-design-vue  ->

* fix: fix base64 blob

* fix: fix CollapseContainer canExpan
2021-12-18 22:24:28 +08:00
lzdjack
a2b594c962 fix: Fix the problem that the table setting menu cannot be dragged (#1503) 2021-12-18 22:23:42 +08:00
wujieli0207
0dafaa5972 fix(function): Add defineProps reference (#1505) 2021-12-18 22:23:11 +08:00
vben
b0a0cbcd6a fix: Fix context menu not working 2021-12-12 23:17:00 +08:00
Jiang
f6e27aee16 Update ColumnSetting.vue (#1451)
修复配置项中,拖拽后  点击   重置按钮   table 恢复还原,但 拖拽列表并未还原bug
2021-12-12 22:09:29 +08:00
Jiang
23b5538eae 修复 init 运行时机不正确 (#1452)
修复去掉checkList 后,移动配置中的table顺序后,调用tabel.setColum() 时触发 init() ,导致checkList 被重置bug
2021-12-12 22:09:14 +08:00
1sm
ab62739fd1 ApiSelect Add alwaysLoad option (#1461)
* fix(modal): 取消全屏功能后关闭图标颜色异常

* chore: move to pnpm

* fix: RangePicekr在表单项中占满分配的宽度

* chore: comment format

* Revert "fix: RangePicekr在表单项中占满分配的宽度"

This reverts commit cd70e41dac.

* feat(ApiSelect): 新增每次加载选项

Co-authored-by: liushiman <smliu@gk-estor.com>
2021-12-12 22:08:42 +08:00
XC
b70fade587 fix(treeHelper): 修复 listToTree 方法 parent 获取 children 问题 (#1464) 2021-12-12 22:08:23 +08:00
zuihou
05bad7b9dc fix(BasicTree): 加了top参数,操作按钮会错位 2021-12-11 12:18:05 +08:00
zuihou
13d660bede feat: 添加BasicTree使用 fieldNames 后,actionList 和 插槽 会失效的示例代码 2021-12-10 22:19:43 +08:00
zuihou
8523afd512 fix(BasicTree): 修复升级antdv3.x后产生的问题
1. BasicTree组件无法正确使用插槽的问题
2. 无法递归遍历的问题

Closes #1453
2021-12-10 22:17:47 +08:00
zuihou
8480454b73 fix(Form): 修复form宽度问题 2021-12-10 21:24:48 +08:00
vben
e024f6a6e7 fix: typo 2021-12-01 23:09:28 +08:00
vben
cb1759b257 perf(table): remove ExpandIcon 2021-12-01 22:40:29 +08:00
vben
81560fd3c6 fix(tree): fix display error 2021-12-01 22:29:54 +08:00
vben
170a4bceb1 fix(tree-select): replaceFields to fieldNames,close #1423 2021-12-01 22:20:58 +08:00
humanscrew
cfda62ef9c fix: Fix Layout Page Tabs dragable (#1433)
* fix: pnpm install

* fix: Fix Tabs dragable
2021-12-01 22:02:18 +08:00
arika163
16cd2438dd remove duplicate judgment (#1432)
Co-authored-by: zhangchao3 <zhangchao3@corp.netease.com>
2021-12-01 22:01:50 +08:00
JinMao
2a667c9e7f fix: Fix depends @vue/shared @vue/runtime-core 2021-12-01 13:33:59 +08:00
vben
52257f061d refactor(tree): Refactor tree to support antv3.0 2021-11-30 01:01:19 +08:00
vben
50cf2d0b8f chore: update deps 2021-11-28 16:27:56 +08:00
vben
2aabbc788a fix: Fix multi-language errors and installation errors 2021-11-26 00:09:08 +08:00
vben
bc18ecb277 fix: Fix github action running error 2021-11-25 00:23:30 +08:00
vben
413df9f5e1 Merge branch 'feat/antdv3.x' 2021-11-24 23:32:34 +08:00
vben
3fcfac1f37 wip: Upgrade ant-design-vue 3.0 2021-11-24 23:25:13 +08:00
1sm
5fca9ce2c5 chore: comment format (#1398)
* fix(modal): 取消全屏功能后关闭图标颜色异常

* chore: move to pnpm

* fix: RangePicekr在表单项中占满分配的宽度

* chore: comment format

* Revert "fix: RangePicekr在表单项中占满分配的宽度"

This reverts commit cd70e41dac.

Co-authored-by: liushiman <smliu@gk-estor.com>
2021-11-24 23:17:11 +08:00
Carson
dc4b05272f refactor(dashboard): adjust the spacing of Card under the small screen (#1399)
Co-authored-by: huguangju <huguangju@wowkai.cn>
2021-11-24 23:16:53 +08:00
handsomeFu
b8411c9311 chore: fix typo (#1384) 2021-11-22 09:15:59 +08:00
西安十大杰出青年
4806aced85 Update TableAction.vue (#1394)
fix: 解决TableAction组件Dropdown因为权限导致分割线显示错误的问题.
2021-11-22 09:15:50 +08:00
nsk
3b3f6c903a fix: some mistakes close #1349, close #1250 close#1245 (#1373)
* fix(Loading): add theme prop, The repair background prop does not take effect

* fix(AppLogo): fix title line height

* fix(Table,Upload): fix #1349 #1250 #1245
2021-11-15 18:59:28 +08:00
Coderclc
b3c4002b69 fix: Fix setting hideMenu, bread bar jump problem (#1358) 2021-11-15 09:32:14 +08:00
handsomeFu
7e00488635 chore: Update extensions.json (#1359)
Use volar instead of vetur
2021-11-15 09:32:01 +08:00
vben
090d844014 fix: type, #1347 2021-11-11 22:28:39 +08:00
CXM
013cb7f16b fix: fix base64 blob (#1356)
* fix(type): fix ant-design-vue  ->

* fix: fix base64 blob
2021-11-11 22:18:22 +08:00
vben
c2b207dd51 fix: Fix stylelint does not support html files 2021-11-10 23:24:39 +08:00
vben
83921284a6 chore: update deps 2021-11-10 21:49:41 +08:00
HUCHAOQI
59b309aa7e fix(table): 使用lodash 的merge来递归assign,优化在多对象嵌套情况下的结构 (#1350) 2021-11-10 21:45:33 +08:00
liweijie0812
49c890ebec fix: Form appendSchemaByField移除hasInList判断 (#1341) 2021-11-09 09:36:10 +08:00
Joyboo
c8dd3b6c14 TableAction确认框增加placement属性 (#1335)
* chore: table size放到settings

* chore(TableAction): 操作确认框增加placement属性支持
2021-11-08 09:24:53 +08:00
1sm
9999650a9a package.json yarn -> pnpm (#1336)
* fix(modal): 取消全屏功能后关闭图标颜色异常

* chore: move to pnpm

Co-authored-by: liushiman <smliu@gk-estor.com>
2021-11-08 09:24:22 +08:00
miofly
b5364fe546 chore:add rules (#1340) 2021-11-08 09:24:00 +08:00
vben
74b0dfd54f chore: update pkg 2021-11-03 00:38:24 +08:00
vben
642d48870c chore: release 2.8.0 2021-11-03 00:28:43 +08:00
vben
3b63e41b68 chore: move to pnpm 2021-11-03 00:28:32 +08:00
madlight-du
d6cdff97b6 fix: direct import for antdv subcomponents supported(8b00112) (#1322)
* fix: direct import for antdv subcomponents supported

修复commit<8b00112>使用直接过滤部分antdv子组件的方式,导致build后刷新页面子组件样式会丢失的问题。

* Update styleImport.ts

* Update styleImport.ts
2021-11-01 08:00:01 +08:00
Jobin
97fe8e2058 feat(ApiCascader): add asynchronous cascader component (#1321) 2021-11-01 07:59:15 +08:00
zuihou
5c491a4258 fix(Menu): 左侧菜单混合模式 在动态更改路由时,左侧显示的菜单没有实时更新 2021-10-30 01:38:28 +08:00
zuihou
5225345496 fix: 全局日期格式化缺少秒(大多数场景日期格式都需要携带秒!) 2021-10-29 20:09:43 +08:00
vben
a248e20013 chore: fix type 2021-10-26 01:19:51 +08:00
vben
ed40b333f3 chore: Allow git message to be uppercase 2021-10-26 01:11:56 +08:00
vben
b7813b9ba8 perf: typo 2021-10-26 01:06:35 +08:00
vben
dbcc40f5ea chore: remove pretty 2021-10-26 01:00:49 +08:00
vben
acea184320 chore: format code 2021-10-25 23:49:03 +08:00
vben
0f44291c5c chore: update deps 2021-10-25 23:45:58 +08:00
Jungzl
83bce6c1d4 chore: support for pnpm (#1310) 2021-10-25 23:33:24 +08:00
scil
85a68d5fc3 fix: check if searchText is null (#1301) 2021-10-25 23:33:11 +08:00
pq
a0165d1eee perf(useRuleFormItem): more accurate return type (#1290) 2021-10-20 09:13:04 +08:00
Joyboo
8447331197 chore: table size放到settings (#1294) 2021-10-20 09:12:27 +08:00
vben
787bc462e7 chore: update deps 2021-10-20 01:11:29 +08:00
zuihou
89414f173e feat(Form): 新增 ApiRadioGroup 组件 2021-10-16 21:25:57 +08:00
tangyh
34781d42e8 feat(Table): 支持设置默认的排序值 2021-10-14 22:15:19 +08:00
无木
456a661488 fix(table): deleteTableDataRecord not work 2021-10-14 14:59:12 +08:00
miofly
5902886798 fix(type): 修复几个 ts 报错,和文件引用位置 (#1283)
* fix(type): 删除多余的类型定义

* fix(login): 删除登录时的 toRaw 包裹参数

* fix(type): 修复几个 ts 报错,和文件引用位置
2021-10-12 18:30:32 +08:00
miofly
7a1b6e74ab fix(type): typo (#1281)
* fix(type): 删除多余的类型定义

* fix(login): 删除登录时的 toRaw 包裹参数
2021-10-12 11:49:50 +08:00
zmtlwzy
b653412260 fixed: (update pageTitle when change local) (#1278)
If AppLocalePicker reload prop is false, Should be updated when changing the language
2021-10-12 11:49:05 +08:00
nsk
a530ec867b fix(Loading): add theme prop, The repair background prop does not tak… (#1271)
* fix(Loading): add theme prop, The repair background prop does not take effect

* fix(AppLogo): fix title line height
2021-10-12 09:12:10 +08:00
Lowell
d6f65d476e fix(Table): 解决设置了分页的情况下,调整表格分页条数后,如果翻页,分页条数会重置的问题。 (#1270) 2021-10-12 09:11:50 +08:00
Haceral
052eff91c4 perf: Improve the dynamic routing and automatically close the Tab function (#1264)
* 增加动态路由最大打开Tab数控制

* 增加动态路由打开数控制Router参数

* feat(Tab): 新增动态路由打开数限制Demo

* fix(multipleTab.ts): 将原来的打开数限制从固定的 5 修改为读取配置

Co-authored-by: Haceral <18274416193@163.com>
2021-10-12 09:11:25 +08:00
无木
e1cbe23e96 fix(api-tree-select): fetch not triggered when params changed
修复ApiTreeSelect的params变化未能触发重新请求API数据的问题
2021-10-11 07:48:41 +08:00
JinMao
f3f56288af fix: build error 2021-10-06 12:01:13 +08:00
Lowell
473e56e4e0 form的label属性实际上可以使用VNode (#1252) 2021-10-05 22:55:02 +08:00
Haceral
eac2fb4aaa feat: 动态路由 Tab打开数量控制,超出限制自动关闭起始Tab (#1256)
* 增加动态路由最大打开Tab数控制

* 增加动态路由打开数控制Router参数
2021-10-05 22:54:49 +08:00
钱忠旺
7d40773b5b style(buildConf.ts): 增加函数接口和修改默认的 (#1259)
增加CreateConfigParams接口,并修改createConfig参数默认值

Co-authored-by: QIANZW <1870271825@gqq.com>
2021-10-05 22:53:53 +08:00
erniu
935d4fc12d feat(Upload): 兼容ant-design-vue的upload属性 (#1247)
1. 兼容`name`属性,用于自定义发到后台的文件参数名; 2. 兼容`filename`属性

Co-authored-by: erniu <joe.cheng237@gmail.com>
2021-10-05 22:53:21 +08:00
vben
2849743a4d chore: update deps 2021-10-05 22:52:34 +08:00
vben
437211107f chore: update deps 2021-09-28 00:56:47 +08:00
1sm
2f2526c564 fix(modal): 取消全屏功能后关闭图标颜色异常 (#1240)
Co-authored-by: liushiman <smliu@gk-estor.com>
2021-09-28 00:22:23 +08:00
Joyboo
754d1986e9 fix: 修复ApiSelect属性被覆盖的问题 (#1226) 2021-09-28 00:22:04 +08:00
Leon Guan
034e39ef06 fix: 当前路由所在菜单路径是嵌套并且隐藏时无法正常高亮根菜单节点 (#1201)
修复当路由所在菜单路径是嵌套并且隐藏时无法正常高亮根菜单节点的问题。

Fixed #1080
2021-09-28 00:21:53 +08:00
CXM
bfdbccfece fix: Dev/fix modal event (#1241)
* fix(type): fix ant-design-vue  ->

* fix: fix editor BasicModal type event check error
2021-09-28 00:21:16 +08:00
vben
246c5f795b chore: update deps 2021-09-24 15:52:21 +08:00
zuihou
902d38dc2f Merge remote-tracking branch 'origin/main' 2021-09-23 12:32:26 +08:00
zuihou
1abf7fdf5f refactor(route): 动态路由 component 属性支持以 / 开头或者以 .vue 和 .tsx 结尾 2021-09-23 12:28:21 +08:00
无木
96ce18c073 revert(form): revert formItem style 2021-09-23 12:27:25 +08:00
无木
f8102446d0 fix(form): fixed formitem style
修复FormItem样式问题

fixed: #1231
2021-09-23 09:33:29 +08:00
zuihou
07b17b9798 perf: 优化代码 2021-09-23 00:10:03 +08:00
zuihou
452b2599f4 fix(route): 获取 LAYOUT 或 IFRAME 忽略大小写。 并且在通过component找不到页面时打印警告,并返回404页面 2021-09-23 00:05:58 +08:00
zuihou
7028e0031d fix(Breadcrumb): 隐藏面包屑应交给 hideBreadcrumb 参数,而非hideMenu 参数 2021-09-22 23:46:42 +08:00
无木
6e0c70f415 fix(import-excel): support datetime raw data import
importExcel支持导入原始日期时间数据

fixed: #1215
2021-09-21 23:23:32 +08:00
无木
01b667facf fix(form): fixed custom item style
修复自定义FormItem组件的内容宽度可能超出范围的问题

fixed: #1225
2021-09-20 20:48:50 +08:00
无木
a82a69d00d fix(dropdown): add missing function
添加Dropdown组件缺失的函数
2021-09-20 19:06:26 +08:00
无木
8b00112d5a fix: direct import for antdv subcomponents supported
修复直接import部分antdv子组件时会在build过程中报错的问题
2021-09-19 11:14:19 +08:00
无木
853bde9275 fix: fixed prop mode of CodeEditor 2021-09-18 20:18:41 +08:00
无木
5af452754b fix: hmr error fixed
修复部分组件可能会造成热更新异常的问题
2021-09-18 14:58:22 +08:00
无木
9c5f11a54b fix: remove warning in building action
移除build过程中的警告
2021-09-18 12:32:15 +08:00
无木
6c08dae921 fix: build error for CodeEditor 2021-09-18 12:29:54 +08:00
无木
02eabe1f9f chore: update deps 2021-09-18 12:08:18 +08:00
无木
2875a97b70 fix(table): clickToRowSelect support disabled checkbox
修复`clickToRowSelect`会无视行选择框disabled状态的问题
2021-09-17 15:44:39 +08:00
无木
067753d490 feat(env): VITE_PROXY support single quote
env文件中的VITE_PROXY配置支持单引号

close: #1204
2021-09-17 09:40:22 +08:00
无木
7b6d5e44a9 fix(table): reload in useTable not support await
修复useTable返回的reload方法不支持使用await等待加载完毕的问题
2021-09-16 16:29:26 +08:00
无木
e85649bde2 fix(tabs): close tab without navigation
修复多标签在某些情况下关闭页签不会跳转路由的问题

fixed: #1131
2021-09-16 00:09:18 +08:00
无木
cecdfbaf29 fix(tabs): dropdown items enabled unnecessary
修复标签头的右键菜单某些项目不恰当地处于可用状态

fixed: #1207
2021-09-15 23:15:01 +08:00
无木
84c7d516df fix(table): prop inset take no effect
修复BasicTabled的inset属性不起作用的问题

fixed: #1209
2021-09-15 23:04:36 +08:00
无木
15ea0d2f53 fix(tree): node slot take no effect
修复BasicTree节点插槽不起作用的问题
2021-09-15 19:50:26 +08:00
无木
ba2c1a3bf5 fix(table): editable cell can not submit
修复可编辑单元格某些情况下无法提交的问题
2021-09-15 12:51:21 +08:00
无木
2346a90c08 fix(modal): maskClosable and Esc take no effect
修复BasicModal按Esc和点击遮罩无法关闭的问题

fixed: #1203
2021-09-15 10:56:14 +08:00
无木
6544f84bc2 feat(demo): add token expired example
添加token超时例子
2021-09-14 22:11:21 +08:00
560 changed files with 25368 additions and 23829 deletions

4
.browserslistrc Normal file
View File

@@ -0,0 +1,4 @@
> 1%
last 2 versions
not dead
not ie 11

107
.commitlintrc.js Normal file
View File

@@ -0,0 +1,107 @@
const fs = require('fs');
const path = require('path');
const { execSync } = require('child_process');
const scopes = fs
.readdirSync(path.resolve(__dirname, 'src'), { withFileTypes: true })
.filter((dirent) => dirent.isDirectory())
.map((dirent) => dirent.name.replace(/s$/, ''));
// precomputed scope
const scopeComplete = execSync('git status --porcelain || true')
.toString()
.trim()
.split('\n')
.find((r) => ~r.indexOf('M src'))
?.replace(/(\/)/g, '%%')
?.match(/src%%((\w|-)*)/)?.[1]
?.replace(/s$/, '');
/** @type {import('cz-git').UserConfig} */
module.exports = {
ignores: [(commit) => commit.includes('init')],
extends: ['@commitlint/config-conventional'],
rules: {
'body-leading-blank': [2, 'always'],
'footer-leading-blank': [1, 'always'],
'header-max-length': [2, 'always', 108],
'subject-empty': [2, 'never'],
'type-empty': [2, 'never'],
'subject-case': [0],
'type-enum': [
2,
'always',
[
'feat',
'fix',
'perf',
'style',
'docs',
'test',
'refactor',
'build',
'ci',
'chore',
'revert',
'wip',
'workflow',
'types',
'release',
],
],
},
prompt: {
/** @use `yarn commit :f` */
alias: {
f: 'docs: fix typos',
r: 'docs: update README',
s: 'style: update code format',
b: 'build: bump dependencies',
c: 'chore: update config',
},
customScopesAlign: !scopeComplete ? 'top' : 'bottom',
defaultScope: scopeComplete,
scopes: [...scopes, 'mock'],
allowEmptyIssuePrefixs: false,
allowCustomIssuePrefixs: false,
// English
typesAppend: [
{ value: 'wip', name: 'wip: work in process' },
{ value: 'workflow', name: 'workflow: workflow improvements' },
{ value: 'types', name: 'types: type definition file changes' },
],
// 中英文对照版
// messages: {
// type: '选择你要提交的类型 :',
// scope: '选择一个提交范围 (可选):',
// customScope: '请输入自定义的提交范围 :',
// subject: '填写简短精炼的变更描述 :\n',
// body: '填写更加详细的变更描述 (可选)。使用 "|" 换行 :\n',
// breaking: '列举非兼容性重大的变更 (可选)。使用 "|" 换行 :\n',
// footerPrefixsSelect: '选择关联issue前缀 (可选):',
// customFooterPrefixs: '输入自定义issue前缀 :',
// footer: '列举关联issue (可选) 例如: #31, #I3244 :\n',
// confirmCommit: '是否提交或修改commit ?',
// },
// types: [
// { value: 'feat', name: 'feat: 新增功能' },
// { value: 'fix', name: 'fix: 修复缺陷' },
// { value: 'docs', name: 'docs: 文档变更' },
// { value: 'style', name: 'style: 代码格式' },
// { value: 'refactor', name: 'refactor: 代码重构' },
// { value: 'perf', name: 'perf: 性能优化' },
// { value: 'test', name: 'test: 添加疏漏测试或已有测试改动' },
// { value: 'build', name: 'build: 构建流程、外部依赖变更 (如升级 npm 包、修改打包配置等)' },
// { value: 'ci', name: 'ci: 修改 CI 配置、脚本' },
// { value: 'revert', name: 'revert: 回滚 commit' },
// { value: 'chore', name: 'chore: 对构建过程或辅助工具和库的更改 (不影响源文件、测试用例)' },
// { value: 'wip', name: 'wip: 正在开发中' },
// { value: 'workflow', name: 'workflow: 工作流程改进' },
// { value: 'types', name: 'types: 类型定义文件修改' },
// ],
// emptyScopesAlias: 'empty: 不填写',
// customScopesAlias: 'custom: 自定义',
},
};

6
.env
View File

@@ -1,8 +1,2 @@
# port
VITE_PORT = 3100
# spa-title
VITE_GLOB_APP_TITLE = Vben Admin
# spa shortname
VITE_GLOB_APP_SHORT_NAME = vue_vben_admin

23
.env.analyze Normal file
View File

@@ -0,0 +1,23 @@
# Whether to open mock
VITE_USE_MOCK = true
# public path
VITE_PUBLIC_PATH = /
# Whether to enable gzip or brotli compression
# Optional: gzip | brotli | none
# If you need multiple forms, you can use `,` to separate
VITE_BUILD_COMPRESS = 'none'
# Basic interface address SPA
VITE_GLOB_API_URL=/basic-api
# File upload address optional
# It can be forwarded by nginx or write the actual address directly
VITE_GLOB_UPLOAD_URL=/upload
# Interface prefix
VITE_GLOB_API_URL_PREFIX=
VITE_ENABLE_ANALYZE = true

View File

@@ -4,14 +4,6 @@ VITE_USE_MOCK = true
# public path
VITE_PUBLIC_PATH = /
# Cross-domain proxy, you can configure multiple
# Please note that no line breaks
VITE_PROXY = [["/basic-api","http://localhost:3000"],["/upload","http://localhost:3300/upload"]]
# VITE_PROXY=[["/api","https://vvbin.cn/test"]]
# Delete console
VITE_DROP_CONSOLE = false
# Basic interface address SPA
VITE_GLOB_API_URL=/basic-api

View File

@@ -2,18 +2,13 @@
VITE_USE_MOCK = true
# public path
VITE_PUBLIC_PATH = ./
# Delete console
VITE_DROP_CONSOLE = true
VITE_PUBLIC_PATH = /
# Whether to enable gzip or brotli compression
# Optional: gzip | brotli | none
# If you need multiple forms, you can use `,` to separate
VITE_BUILD_COMPRESS = 'none'
# Whether to delete origin files when using compress, default false
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
# Basic interface address SPA
VITE_GLOB_API_URL=/basic-api
@@ -24,12 +19,3 @@ VITE_GLOB_UPLOAD_URL=/upload
# Interface prefix
VITE_GLOB_API_URL_PREFIX=
# Whether to enable image compression
VITE_USE_IMAGEMIN= true
# use pwa
VITE_USE_PWA = false
# Is it compatible with older browsers
VITE_LEGACY = false

View File

@@ -5,17 +5,11 @@ VITE_USE_MOCK = true
# public path
VITE_PUBLIC_PATH = /
# Delete console
VITE_DROP_CONSOLE = true
# Whether to enable gzip or brotli compression
# Optional: gzip | brotli | none
# If you need multiple forms, you can use `,` to separate
VITE_BUILD_COMPRESS = 'none'
# Whether to delete origin files when using compress, default false
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
# Basic interface address SPA
VITE_GLOB_API_URL=/basic-api
@@ -25,12 +19,3 @@ VITE_GLOB_UPLOAD_URL=/upload
# Interface prefix
VITE_GLOB_API_URL_PREFIX=
# Whether to enable image compression
VITE_USE_IMAGEMIN= true
# use pwa
VITE_USE_PWA = false
# Is it compatible with older browsers
VITE_LEGACY = false

View File

@@ -1,76 +1,4 @@
module.exports = {
root: true,
env: {
browser: true,
node: true,
es6: true,
},
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 2020,
sourceType: 'module',
jsxPragma: 'React',
ecmaFeatures: {
jsx: true,
},
},
extends: [
'plugin:vue/vue3-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
rules: {
'vue/script-setup-uses-vars': 'error',
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-empty-function': 'off',
'vue/custom-event-name-casing': 'off',
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'space-before-function-paren': 'off',
'vue/attributes-order': 'off',
'vue/one-component-per-file': 'off',
'vue/html-closing-bracket-newline': 'off',
'vue/max-attributes-per-line': 'off',
'vue/multiline-html-element-content-newline': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/attribute-hyphenation': 'off',
'vue/require-default-prop': 'off',
'vue/require-explicit-emits': 'off',
'vue/html-self-closing': [
'error',
{
html: {
void: 'always',
normal: 'never',
component: 'always',
},
svg: 'always',
math: 'always',
},
],
'vue/multi-word-component-names': 'off',
},
extends: ['@vben'],
};

11
.gitattributes vendored Normal file
View File

@@ -0,0 +1,11 @@
# https://docs.github.com/cn/get-started/getting-started-with-git/configuring-git-to-handle-line-endings
# Automatically normalize line endings (to LF) for all text-based files.
* text=auto eol=lf
# Declare files that will always have CRLF line endings on checkout.
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf
# Denote all files that are truly binary and should not be modified.
*.{ico,png,jpg,jpeg,gif,webp,svg,woff,woff2} binary

118
.github/workflows/deploy.yml vendored Normal file
View File

@@ -0,0 +1,118 @@
name: deploy
on:
push:
branches:
- main
jobs:
# push-to-ftp:
# if: "contains(github.event.head_commit.message, '[deploy]')"
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Sed Config Base
# shell: bash
# run: |
# sed -i 's#VITE_PUBLIC_PATH\s*=.*#VITE_PUBLIC_PATH = /next/#g' ./.env.production
# sed -i "s#VITE_BUILD_COMPRESS\s*=.*#VITE_BUILD_COMPRESS = 'gzip'#g" ./.env.production
# cat ./.env.production
# - name: use Node.js 14
# uses: actions/setup-node@v2.1.2
# with:
# node-version: '14.x'
# - name: Get yarn cache
# id: yarn-cache
# run: echo "::set-output name=dir::$(yarn cache dir)"
# - name: Cache dependencies
# uses: actions/cache@v2
# with:
# path: ${{ steps.yarn-cache.outputs.dir }}
# key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
# restore-keys: |
# ${{ runner.os }}-yarn-
# - name: Build
# run: |
# yarn install
# yarn run build
# - name: Deploy
# uses: SamKirkland/FTP-Deploy-Action@2.0.0
# env:
# FTP_SERVER: ${{ secrets.FTP_SERVER }}
# FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
# FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
# METHOD: sftp
# PORT: ${{ secrets.FTP_PORT }}
# LOCAL_DIR: dist
# REMOTE_DIR: /srv/www/vben-admin
# ARGS: --delete --verbose --parallel=80
push-to-gh-pages:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Sed Config Base
shell: bash
run: |
sed -i "s#VITE_BUILD_COMPRESS\s*=.*#VITE_BUILD_COMPRESS = 'gzip'#g" ./.env.production
sed -i "s#VITE_DROP_CONSOLE\s*=.*#VITE_DROP_CONSOLE = true#g" ./.env.production
cat ./.env.production
- name: use Node.js 16
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Set SSH Environment
env:
DOCS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
run: |
mkdir -p ~/.ssh/
echo "$ACTIONS_DEPLOY_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com > ~/.ssh/known_hosts
chmod 700 ~/.ssh && chmod 600 ~/.ssh/*
git config --global user.email "vbenadmin@163.com"
git config --global user.name "vbenAdmin"
- name: Build
env:
NODE_OPTIONS: '--max_old_space_size=4096'
run: |
yarn install
yarn run build
touch dist/.nojekyll
cp dist/index.html dist/404.html
- name: Delete gh-pages branch
run: |
git push origin --delete gh-pages
- name: Deploy
uses: peaceiris/actions-gh-pages@v3.9.0
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./dist
CNAME: vben.vvbin.cn

7
.gitignore vendored
View File

@@ -1,8 +1,8 @@
node_modules
.DS_Store
dist
.npmrc
.cache
.turbo
tests/server/static
tests/server/static/upload
@@ -27,3 +27,8 @@ pnpm-debug.log*
*.njsproj
*.sln
*.sw?
package-lock.json
pnpm-lock.yaml
.history

View File

@@ -3,4 +3,6 @@
# shellcheck source=./_/husky.sh
. "$(dirname "$0")/_/husky.sh"
PATH="/usr/local/bin:$PATH"
npx --no-install commitlint --edit "$1"

View File

@@ -4,5 +4,7 @@
[ -n "$CI" ] && exit 0
PATH="/usr/local/bin:$PATH"
# Format and submit code according to lintstagedrc.js configuration
npm run lint:lint-staged
pnpm exec lint-staged

7
.npmrc Normal file
View File

@@ -0,0 +1,7 @@
public-hoist-pattern[]=husky
public-hoist-pattern[]=*eslint*
public-hoist-pattern[]=*prettier*
public-hoist-pattern[]=lint-staged
public-hoist-pattern[]=*stylelint*
public-hoist-pattern[]=@commitlint/cli
public-hoist-pattern[]=@vben/eslint-config

View File

@@ -1,9 +1,10 @@
/dist/*
dist
.local
.output.js
/node_modules/**
node_modules
**/*.svg
**/*.sh
/public/*
public
.npmrc

View File

@@ -7,4 +7,13 @@ module.exports = {
proseWrap: 'never',
htmlWhitespaceSensitivity: 'strict',
endOfLine: 'auto',
plugins: ['prettier-plugin-packagejson'],
overrides: [
{
files: '.*rc',
options: {
parser: 'json',
},
},
],
};

View File

@@ -1,3 +1,2 @@
/dist/*
/public/*
public/*
dist
public

4
.stylelintrc.js Normal file
View File

@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: ['@vben/stylelint-config'],
};

View File

@@ -1,6 +1,6 @@
{
"recommendations": [
"johnsoncodehk.volar",
"vue.volar",
"dbaeumer.vscode-eslint",
"stylelint.vscode-stylelint",
"esbenp.prettier-vscode",

2
.vscode/launch.json vendored
View File

@@ -5,7 +5,7 @@
"type": "chrome",
"request": "launch",
"name": "Launch Chrome",
"url": "https://localhost:3100",
"url": "http://localhost:3100",
"webRoot": "${workspaceFolder}/src",
"sourceMaps": true
}

39
.vscode/settings.json vendored
View File

@@ -84,7 +84,8 @@
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": true,
"source.fixAll.stylelint": true
},
"[vue]": {
"editor.codeActionsOnSave": {
@@ -103,7 +104,6 @@
"i18n-ally.enabledFrameworks": ["vue", "react"],
"cSpell.words": [
"vben",
"windi",
"browserslist",
"tailwindcss",
"esnext",
@@ -135,5 +135,38 @@
"sider",
"pnpm",
"antd"
]
],
"vetur.format.scriptInitialIndent": true,
"vetur.format.styleInitialIndent": true,
"vetur.validation.script": false,
"MicroPython.executeButton": [
{
"text": "▶",
"tooltip": "运行",
"alignment": "left",
"command": "extension.executeFile",
"priority": 3.5
}
],
"MicroPython.syncButton": [
{
"text": "$(sync)",
"tooltip": "同步",
"alignment": "left",
"command": "extension.execute",
"priority": 4
}
],
// 控制相关文件嵌套展示
"explorer.fileNesting.enabled": true,
"explorer.fileNesting.expand": false,
"explorer.fileNesting.patterns": {
"*.ts": "$(capture).test.ts, $(capture).test.tsx",
"*.tsx": "$(capture).test.ts, $(capture).test.tsx",
"*.env": "$(capture).env.*",
"CHANGELOG.md": "CHANGELOG*",
"package.json": "pnpm-lock.yaml,pnpm-workspace.yaml,LICENSE,.gitattributes,.gitignore,.gitpod.yml,CNAME,README*,.npmrc,.browserslistrc",
".eslintrc.js": ".eslintignore,.prettierignore,.stylelintignore,.commitlintrc.js,.prettierrc.js,.stylelintrc.js"
},
"terminal.integrated.scrollback": 10000
}

1
CNAME Normal file
View File

@@ -0,0 +1 @@
vben.vvbin.cn

View File

@@ -21,11 +21,11 @@ Vue Vben Admin is a free and open source middle and back-end template. Using the
- **Authority** Built-in complete dynamic routing permission generation scheme.
- **Component** Multiple commonly used components are encapsulated twice
## 预览
## Preview
- [vue-vben-admin](https://vvbin.cn/next/) - Full version Chinese site
- [vue-vben-admin](https://vben.vvbin.cn/) - Full version Chinese site
- [vue-vben-admin-gh-pages](https://anncwb.github.io/vue-vben-admin/) - Full version of the github site
- [vben-admin-thin-next](https://vvbin.cn/thin/next/) - Simplified Chinese site
- [vben-admin-thin-next](https://vben.vvbin.cn/thin/next/) - Simplified Chinese site
- [vben-admin-thin-gh-pages](https://anncwb.github.io/vben-admin-thin-next/) -Simplified github site
Test account: vben/123456
@@ -44,7 +44,7 @@ Open the project in Gitpod (free online dev environment for GitHub) and start co
## Documentation
[Document](https://vvbin.cn/doc-next/)
[Document](https://doc.vvbin.cn/)
## Preparation
@@ -131,9 +131,6 @@ If these plugins are helpful to you, you can give a star support
- [vite-plugin-mock](https://github.com/anncwb/vite-plugin-mock) - Used for local and development environment data mock
- [vite-plugin-html](https://github.com/anncwb/vite-plugin-html) - Used for html template conversion and compression
- [vite-plugin-style-import](https://github.com/anncwb/vite-plugin-style-import) - Used for component library style introduction on demand
- [vite-plugin-theme](https://github.com/anncwb/vite-plugin-theme) - Used for online switching of theme colors and other color-related configurations
- [vite-plugin-imagemin](https://github.com/anncwb/vite-plugin-imagemin) - Used to pack compressed image resources
- [vite-plugin-compression](https://github.com/anncwb/vite-plugin-compression) - Used to pack input .gz|.brotil files
- [vite-plugin-svg-icons](https://github.com/anncwb/vite-plugin-svg-icons) - Used to quickly generate svg sprite

View File

@@ -23,9 +23,9 @@ Vue Vben Admin 是一个免费开源的中后台模版。使用了最新的`vue3
## 预览
- [vue-vben-admin](https://vvbin.cn/next/) - 完整版中文站点
- [vue-vben-admin](https://vben.vvbin.cn/) - 完整版中文站点
- [vue-vben-admin-gh-pages](https://anncwb.github.io/vue-vben-admin/) - 完整版 github 站点
- [vben-admin-thin-next](https://vvbin.cn/thin/next/) - 简化版中文站点
- [vben-admin-thin-next](https://vben.vvbin.cn/thin/next/) - 简化版中文站点
- [vben-admin-thin-gh-pages](https://anncwb.github.io/vben-admin-thin-next/) - 简化版 github 站点
测试账号: vben/123456
@@ -44,7 +44,7 @@ Vue Vben Admin 是一个免费开源的中后台模版。使用了最新的`vue3
## 文档
[文档地址](https://vvbin.cn/doc-next/)
[文档地址](https://doc.vvbin.cn/)
## 准备
@@ -141,9 +141,6 @@ pnpm build
- [vite-plugin-mock](https://github.com/anncwb/vite-plugin-mock) - 用于本地及开发环境数据 mock
- [vite-plugin-html](https://github.com/anncwb/vite-plugin-html) - 用于 html 模版转换及压缩
- [vite-plugin-style-import](https://github.com/anncwb/vite-plugin-style-import) - 用于组件库样式按需引入
- [vite-plugin-theme](https://github.com/anncwb/vite-plugin-theme) - 用于在线切换主题色等颜色相关配置
- [vite-plugin-imagemin](https://github.com/anncwb/vite-plugin-imagemin) - 用于打包压缩图片资源
- [vite-plugin-compression](https://github.com/anncwb/vite-plugin-compression) - 用于打包输出.gz|.brotil 文件
- [vite-plugin-svg-icons](https://github.com/anncwb/vite-plugin-svg-icons) - 用于快速生成 svg 雪碧图

View File

View File

@@ -59,5 +59,5 @@ app.use(router.allowedMethods());
app.use(koaStatic(path.join(__dirname)));
app.listen(PORT, () => {
console.log(`Application started successfully: https://localhost:${PORT}`);
console.log(`Application started successfully: http://localhost:${PORT}`);
});

View File

@@ -3,34 +3,34 @@
"version": "1.0.0",
"license": "MIT",
"scripts": {
"start": "nodemon",
"build": "rimraf ./dist && tsup ./index.ts --dts --format cjs,esm ",
"compile": "rimraf ./dist && tsup ./index.ts --dts --format cjs,esm ",
"prod": "npx pm2 start ecosystem.config.js --env production",
"restart": "pm2 restart ecosystem.config.js --env production",
"start": "nodemon",
"stop": "npx pm2 stop ecosystem.config.js"
},
"dependencies": {
"fs-extra": "^10.0.1",
"koa": "^2.13.4",
"koa-body": "^4.2.0",
"koa-bodyparser": "^4.3.0",
"fs-extra": "^11.1.1",
"koa": "^2.14.1",
"koa-body": "^6.0.1",
"koa-bodyparser": "^4.4.0",
"koa-route": "^3.2.0",
"koa-router": "^10.1.1",
"koa-router": "^12.0.0",
"koa-static": "^5.0.0",
"koa-websocket": "^6.0.0",
"koa-websocket": "^7.0.0",
"koa2-cors": "^2.0.6"
},
"devDependencies": {
"@types/koa": "^2.13.4",
"@types/koa": "^2.13.6",
"@types/koa-bodyparser": "^5.0.2",
"@types/koa-router": "^7.4.4",
"@types/node": "^17.0.21",
"nodemon": "^2.0.15",
"pm2": "^5.2.0",
"rimraf": "^3.0.2",
"ts-node": "^10.7.0",
"tsconfig-paths": "^3.14.0",
"tsup": "^5.12.1",
"typescript": "^4.6.2"
"@types/node": "^18.15.11",
"nodemon": "^2.0.22",
"pm2": "^5.3.0",
"rimraf": "^4.4.1",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.2.0",
"tsup": "^6.7.0",
"typescript": "^5.0.3"
}
}

View File

@@ -0,0 +1,7 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "@vben/ts-config/node-server.json",
"compilerOptions": {
"noImplicitAny": false
}
}

View File

@@ -1,63 +0,0 @@
import path from 'path';
import { RollupOptions } from 'rollup';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import esbuild from 'rollup-plugin-esbuild';
import alias from '@rollup/plugin-alias';
import json from '@rollup/plugin-json';
export function getRollupOptions(): RollupOptions {
return {
input: path.join(__dirname, '../../electron-main/index.ts'),
output: {
file: path.join(__dirname, '../../dist/main/build.js'),
format: 'cjs',
name: 'ElectronMainBundle',
sourcemap: true,
},
plugins: [
nodeResolve({ preferBuiltins: true, browser: true }), // 消除碰到 node.js 模块时⚠警告
commonjs(),
json(),
esbuild({
// All options are optional
include: /\.[jt]sx?$/, // default, inferred from `loaders` option
exclude: /node_modules/, // default
// watch: process.argv.includes('--watch'), // rollup 中有配置
sourceMap: false, // default
minify: process.env.NODE_ENV === 'production',
target: 'es2017', // default, or 'es20XX', 'esnext'
jsxFactory: 'React.createElement',
jsxFragment: 'React.Fragment',
// Like @rollup/plugin-replace
define: {
__VERSION__: '"x.y.z"',
},
// Add extra loaders
loaders: {
// Add .json files support
// require @rollup/plugin-commonjs
'.json': 'json',
// Enable JSX in .js files too
'.js': 'jsx',
},
}),
alias({
entries: [{ find: '/@main/', replacement: path.join(__dirname, '../../electron-main') }],
}),
],
external: [
'crypto',
'assert',
'fs',
'util',
'os',
'events',
'child_process',
'http',
'https',
'path',
'electron',
],
};
}

View File

@@ -1,79 +0,0 @@
import { generate } from '@ant-design/colors';
export const primaryColor = '#0960bd';
export const darkMode = 'light';
type Fn = (...arg: any) => any;
type GenerateTheme = 'default' | 'dark';
export interface GenerateColorsParams {
mixLighten: Fn;
mixDarken: Fn;
tinycolor: any;
color?: string;
}
export function generateAntColors(color: string, theme: GenerateTheme = 'default') {
return generate(color, {
theme,
});
}
export function getThemeColors(color?: string) {
const tc = color || primaryColor;
const lightColors = generateAntColors(tc);
const primary = lightColors[5];
const modeColors = generateAntColors(primary, 'dark');
return [...lightColors, ...modeColors];
}
export function generateColors({
color = primaryColor,
mixLighten,
mixDarken,
tinycolor,
}: GenerateColorsParams) {
const arr = new Array(19).fill(0);
const lightens = arr.map((_t, i) => {
return mixLighten(color, i / 5);
});
const darkens = arr.map((_t, i) => {
return mixDarken(color, i / 5);
});
const alphaColors = arr.map((_t, i) => {
return tinycolor(color)
.setAlpha(i / 20)
.toRgbString();
});
const shortAlphaColors = alphaColors.map((item) => item.replace(/\s/g, '').replace(/0\./g, '.'));
const tinycolorLightens = arr
.map((_t, i) => {
return tinycolor(color)
.lighten(i * 5)
.toHexString();
})
.filter((item) => item !== '#ffffff');
const tinycolorDarkens = arr
.map((_t, i) => {
return tinycolor(color)
.darken(i * 5)
.toHexString();
})
.filter((item) => item !== '#000000');
return [
...lightens,
...darkens,
...alphaColors,
...shortAlphaColors,
...tinycolorDarkens,
...tinycolorLightens,
].filter((item) => !item.includes('-'));
}

View File

@@ -1,6 +0,0 @@
/**
* The name of the configuration file entered in the production environment
*/
export const GLOB_CONFIG_FILE_NAME = '_app.config.js';
export const OUTPUT_DIR = 'dist';

View File

@@ -1,72 +0,0 @@
import path from 'path';
import fs from 'fs-extra';
import inquirer from 'inquirer';
import colors from 'picocolors';
import pkg from '../../../package.json';
async function generateIcon() {
const dir = path.resolve(process.cwd(), 'node_modules/@iconify/json');
const raw = await fs.readJSON(path.join(dir, 'collections.json'));
const collections = Object.entries(raw).map(([id, v]) => ({
...(v as any),
id,
}));
const choices = collections.map((item) => ({ key: item.id, value: item.id, name: item.name }));
inquirer
.prompt([
{
type: 'list',
name: 'useType',
choices: [
{ key: 'local', value: 'local', name: 'Local' },
{ key: 'onLine', value: 'onLine', name: 'OnLine' },
],
message: 'How to use icons?',
},
{
type: 'list',
name: 'iconSet',
choices: choices,
message: 'Select the icon set that needs to be generated?',
},
{
type: 'input',
name: 'output',
message: 'Select the icon set that needs to be generated?',
default: 'src/components/Icon/data',
},
])
.then(async (answers) => {
const { iconSet, output, useType } = answers;
const outputDir = path.resolve(process.cwd(), output);
fs.ensureDir(outputDir);
const genCollections = collections.filter((item) => [iconSet].includes(item.id));
const prefixSet: string[] = [];
for (const info of genCollections) {
const data = await fs.readJSON(path.join(dir, 'json', `${info.id}.json`));
if (data) {
const { prefix } = data;
const isLocal = useType === 'local';
const icons = Object.keys(data.icons).map(
(item) => `${isLocal ? prefix + ':' : ''}${item}`,
);
await fs.writeFileSync(
path.join(output, `icons.data.ts`),
`export default ${isLocal ? JSON.stringify(icons) : JSON.stringify({ prefix, icons })}`,
);
prefixSet.push(prefix);
}
}
fs.emptyDir(path.join(process.cwd(), 'node_modules/.vite'));
console.log(
`${colors.cyan(`[${pkg.name}]`)}` + ' - Icon generated successfully:' + `[${prefixSet}]`,
);
});
}
generateIcon();

View File

@@ -1,9 +0,0 @@
/**
* Get the configuration file variable name
* @param env
*/
export const getConfigFileName = (env: Record<string, any>) => {
return `__PRODUCTION__${env.VITE_GLOB_APP_SHORT_NAME || '__APP'}__CONF__`
.toUpperCase()
.replace(/\s/g, '');
};

View File

@@ -1,45 +0,0 @@
/**
* Generate additional configuration files when used for packaging. The file can be configured with some global variables, so that it can be changed directly externally without repackaging
*/
import { GLOB_CONFIG_FILE_NAME, OUTPUT_DIR } from '../constant';
import fs, { writeFileSync } from 'fs-extra';
import colors from 'picocolors';
import { getEnvConfig, getRootPath } from '../utils';
import { getConfigFileName } from '../getConfigFileName';
import pkg from '../../package.json';
interface CreateConfigParams {
configName: string;
config: any;
configFileName?: string;
}
function createConfig(params: CreateConfigParams) {
const { configName, config, configFileName } = params;
try {
const windowConf = `window.${configName}`;
// Ensure that the variable will not be modified
const configStr = `${windowConf}=${JSON.stringify(config)};
Object.freeze(${windowConf});
Object.defineProperty(window, "${configName}", {
configurable: false,
writable: false,
});
`.replace(/\s/g, '');
fs.mkdirp(getRootPath(OUTPUT_DIR));
writeFileSync(getRootPath(`${OUTPUT_DIR}/${configFileName}`), configStr);
console.log(colors.cyan(`✨ [${pkg.name}]`) + ` - configuration file is build successfully:`);
console.log(colors.gray(OUTPUT_DIR + '/' + colors.green(configFileName)) + '\n');
} catch (error) {
console.log(colors.red('configuration file configuration file failed to package:\n' + error));
}
}
export function runBuildConfig() {
const config = getEnvConfig();
const configFileName = getConfigFileName(config);
createConfig({ config, configName: configFileName, configFileName: GLOB_CONFIG_FILE_NAME });
}

View File

@@ -1,76 +0,0 @@
import rollup, { OutputOptions } from 'rollup';
import chalk from 'chalk';
import ora from 'ora';
import waitOn from 'wait-on';
import net from 'net';
import { URL } from 'url';
import minimist from 'minimist';
import electronConnect from 'electron-connect';
import { getRollupOptions } from '../config/rollupElectronConfig';
const argv = minimist(process.argv.slice(2));
const TAG = '[compiler-electron]';
export function startCompilerElectron(port = 80) {
// 因为 vite 不会重定向到 index.html所以直接写 index.html 路由。
const ELECTRON_URL = `https://localhost:${port}/index.html`;
const spinner = ora(`${TAG} Electron build...`);
const electron = electronConnect.server.create({ stopOnClose: true });
const rollupOptions = getRollupOptions();
function watchFunc() {
// once here, all resources are available
const watcher = rollup.watch(rollupOptions);
watcher.on('change', (filename) => {
const log = chalk.green(`change -- ${filename}`);
console.log(TAG, log);
});
watcher.on('event', (ev) => {
if (ev.code === 'END') {
// init-未启动、started-第一次启动、restarted-重新启动
electron.electronState === 'init' ? electron.start() : electron.restart();
} else if (ev.code === 'ERROR') {
console.log(ev.error);
}
});
}
if (argv.watch) {
waitOn(
{
resources: [ELECTRON_URL],
timeout: 5000,
},
(err) => {
if (err) {
const { hostname } = new URL(ELECTRON_URL);
const serverSocket = net.connect(port, hostname, () => {
watchFunc();
});
serverSocket.on('error', (e) => {
console.log(err);
console.log(e);
process.exit(1);
});
} else {
watchFunc();
}
}
);
} else {
spinner.start();
rollup
.rollup(rollupOptions)
.then((build) => {
spinner.stop();
console.log(TAG, chalk.green('Electron build successed.'));
build.write(rollupOptions.output as OutputOptions);
})
.catch((error) => {
spinner.stop();
console.log(`\n${TAG} ${chalk.red('构建报错')}\n`, error, '\n');
});
}
}

View File

@@ -1,23 +0,0 @@
// #!/usr/bin/env node
import { runBuildConfig } from './buildConf';
import colors from 'picocolors';
import pkg from '../../package.json';
export const runBuild = async () => {
try {
const argvList = process.argv.splice(2);
// Generate configuration file
if (!argvList.includes('disabled-config')) {
runBuildConfig();
}
console.log(`${colors.cyan(`[${pkg.name}]`)}` + ' - build successfully!');
} catch (error) {
console.log(colors.red('vite build error:\n' + error));
process.exit(1);
}
};
runBuild();

View File

@@ -1,22 +0,0 @@
import { createServer } from 'vite';
import path from 'path';
import { startCompilerElectron } from './compilerElectron';
import minimist from 'minimist';
(async () => {
const argv = minimist(process.argv.slice(2));
console.log(argv);
const isDev = argv.env === 'development';
let port: number | undefined = undefined;
if (isDev) {
const server = await createServer({
root: path.resolve(__dirname, '../../'),
});
const app = await server.listen();
port = app.config.server.port;
process.env.PORT = `${port}`;
}
startCompilerElectron(port);
})();

View File

@@ -1,92 +0,0 @@
import fs from 'fs';
import path from 'path';
import dotenv from 'dotenv';
export function isDevFn(mode: string): boolean {
return mode === 'development';
}
export function isProdFn(mode: string): boolean {
return mode === 'production';
}
/**
* Whether to generate package preview
*/
export function isReportMode(): boolean {
return process.env.REPORT === 'true';
}
// Read all environment variable configuration files to process.env
export function wrapperEnv(envConf: Recordable): ViteEnv {
const ret: any = {};
for (const envName of Object.keys(envConf)) {
let realName = envConf[envName].replace(/\\n/g, '\n');
realName = realName === 'true' ? true : realName === 'false' ? false : realName;
if (envName === 'VITE_PORT') {
realName = Number(realName);
}
if (envName === 'VITE_PROXY' && realName) {
try {
realName = JSON.parse(realName.replace(/'/g, '"'));
} catch (error) {
realName = '';
}
}
ret[envName] = realName;
if (typeof realName === 'string') {
process.env[envName] = realName;
} else if (typeof realName === 'object') {
process.env[envName] = JSON.stringify(realName);
}
}
return ret;
}
/**
* 获取当前环境下生效的配置文件名
*/
function getConfFiles() {
const script = process.env.npm_lifecycle_script;
const reg = new RegExp('--mode ([a-z_\\d]+)');
const result = reg.exec(script as string) as any;
if (result) {
const mode = result[1] as string;
return ['.env', `.env.${mode}`];
}
return ['.env', '.env.production'];
}
/**
* Get the environment variables starting with the specified prefix
* @param match prefix
* @param confFiles ext
*/
export function getEnvConfig(match = 'VITE_GLOB_', confFiles = getConfFiles()) {
let envConfig = {};
confFiles.forEach((item) => {
try {
const env = dotenv.parse(fs.readFileSync(path.resolve(process.cwd(), item)));
envConfig = { ...envConfig, ...env };
} catch (e) {
console.error(`Error in parsing ${item}`, e);
}
});
const reg = new RegExp(`^(${match})`);
Object.keys(envConfig).forEach((key) => {
if (!reg.test(key)) {
Reflect.deleteProperty(envConfig, key);
}
});
return envConfig;
}
/**
* Get user root directory
* @param dir file path
*/
export function getRootPath(...dir: string[]) {
return path.resolve(process.cwd(), ...dir);
}

View File

@@ -1,40 +0,0 @@
/**
* Plugin to minimize and use ejs template syntax in index.html.
* https://github.com/anncwb/vite-plugin-html
*/
import type { PluginOption } from 'vite';
import { createHtmlPlugin } from 'vite-plugin-html';
import pkg from '../../../package.json';
import { GLOB_CONFIG_FILE_NAME } from '../../constant';
export function configHtmlPlugin(env: ViteEnv, isBuild: boolean) {
const { VITE_GLOB_APP_TITLE, VITE_PUBLIC_PATH } = env;
const path = VITE_PUBLIC_PATH.endsWith('/') ? VITE_PUBLIC_PATH : `${VITE_PUBLIC_PATH}/`;
const getAppConfigSrc = () => {
return `${path || '/'}${GLOB_CONFIG_FILE_NAME}?v=${pkg.version}-${new Date().getTime()}`;
};
const htmlPlugin: PluginOption[] = createHtmlPlugin({
minify: isBuild,
inject: {
// Inject data into ejs template
data: {
title: VITE_GLOB_APP_TITLE,
},
// Embed the generated app.config.js file
tags: isBuild
? [
{
tag: 'script',
attrs: {
src: getAppConfigSrc(),
},
},
]
: [],
},
});
return htmlPlugin;
}

View File

@@ -1,34 +0,0 @@
// Image resource files used to compress the output of the production environment
// https://github.com/anncwb/vite-plugin-imagemin
import viteImagemin from 'vite-plugin-imagemin';
export function configImageminPlugin() {
const plugin = viteImagemin({
gifsicle: {
optimizationLevel: 7,
interlaced: false,
},
optipng: {
optimizationLevel: 7,
},
mozjpeg: {
quality: 20,
},
pngquant: {
quality: [0.8, 0.9],
speed: 4,
},
svgo: {
plugins: [
{
name: 'removeViewBox',
},
{
name: 'removeEmptyAttrs',
active: false,
},
],
},
});
return plugin;
}

View File

@@ -1,82 +0,0 @@
import { PluginOption } from 'vite';
import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx';
import legacy from '@vitejs/plugin-legacy';
import purgeIcons from 'vite-plugin-purge-icons';
import windiCSS from 'vite-plugin-windicss';
import VitePluginCertificate from 'vite-plugin-mkcert';
import vueSetupExtend from 'vite-plugin-vue-setup-extend';
import { configHtmlPlugin } from './html';
import { configPwaConfig } from './pwa';
import { configMockPlugin } from './mock';
import { configCompressPlugin } from './compress';
import { configStyleImportPlugin } from './styleImport';
import { configVisualizerConfig } from './visualizer';
import { configThemePlugin } from './theme';
import { configImageminPlugin } from './imagemin';
import { configSvgIconsPlugin } from './svgSprite';
export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) {
const {
VITE_USE_IMAGEMIN,
VITE_USE_MOCK,
VITE_LEGACY,
VITE_BUILD_COMPRESS,
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE,
} = viteEnv;
const vitePlugins: (PluginOption | PluginOption[])[] = [
// have to
vue(),
// have to
vueJsx(),
// support name
vueSetupExtend(),
VitePluginCertificate({
source: 'coding',
}),
];
// vite-plugin-windicss
vitePlugins.push(windiCSS());
// @vitejs/plugin-legacy
VITE_LEGACY && isBuild && vitePlugins.push(legacy());
// vite-plugin-html
vitePlugins.push(configHtmlPlugin(viteEnv, isBuild));
// vite-plugin-svg-icons
vitePlugins.push(configSvgIconsPlugin(isBuild));
// vite-plugin-mock
VITE_USE_MOCK && vitePlugins.push(configMockPlugin(isBuild));
// vite-plugin-purge-icons
vitePlugins.push(purgeIcons());
// vite-plugin-style-import
vitePlugins.push(configStyleImportPlugin(isBuild));
// rollup-plugin-visualizer
vitePlugins.push(configVisualizerConfig());
// vite-plugin-theme
vitePlugins.push(configThemePlugin(isBuild));
// The following plugins only work in the production environment
if (isBuild) {
// vite-plugin-imagemin
VITE_USE_IMAGEMIN && vitePlugins.push(configImageminPlugin());
// rollup-plugin-gzip
vitePlugins.push(
configCompressPlugin(VITE_BUILD_COMPRESS, VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE),
);
// vite-plugin-pwa
vitePlugins.push(configPwaConfig(viteEnv));
}
return vitePlugins;
}

View File

@@ -1,33 +0,0 @@
/**
* Zero-config PWA for Vite
* https://github.com/antfu/vite-plugin-pwa
*/
import { VitePWA } from 'vite-plugin-pwa';
export function configPwaConfig(env: ViteEnv) {
const { VITE_USE_PWA, VITE_GLOB_APP_TITLE, VITE_GLOB_APP_SHORT_NAME } = env;
if (VITE_USE_PWA) {
// vite-plugin-pwa
const pwaPlugin = VitePWA({
manifest: {
name: VITE_GLOB_APP_TITLE,
short_name: VITE_GLOB_APP_SHORT_NAME,
icons: [
{
src: './resource/img/pwa-192x192.png',
sizes: '192x192',
type: 'image/png',
},
{
src: './resource/img/pwa-512x512.png',
sizes: '512x512',
type: 'image/png',
},
],
},
});
return pwaPlugin;
}
return [];
}

View File

@@ -1,79 +0,0 @@
/**
* Introduces component library styles on demand.
* https://github.com/anncwb/vite-plugin-style-import
*/
import { createStyleImportPlugin } from 'vite-plugin-style-import';
export function configStyleImportPlugin(_isBuild: boolean) {
// if (!isBuild) {
// return [];
// }
const styleImportPlugin = createStyleImportPlugin({
libs: [
{
libraryName: 'ant-design-vue',
esModule: true,
resolveStyle: (name) => {
// 这里是无需额外引入样式文件的“子组件”列表
const ignoreList = [
'anchor-link',
'sub-menu',
'menu-item',
'menu-divider',
'menu-item-group',
'breadcrumb-item',
'breadcrumb-separator',
'form-item',
'step',
'select-option',
'select-opt-group',
'card-grid',
'card-meta',
'collapse-panel',
'descriptions-item',
'list-item',
'list-item-meta',
'table-column',
'table-column-group',
'tab-pane',
'tab-content',
'timeline-item',
'tree-node',
'skeleton-input',
'skeleton-avatar',
'skeleton-title',
'skeleton-paragraph',
'skeleton-image',
'skeleton-button',
];
// 这里是需要额外引入样式的子组件列表
// 单独引入子组件时需引入组件样式,否则会在打包后导致子组件样式丢失
const replaceList = {
'typography-text': 'typography',
'typography-title': 'typography',
'typography-paragraph': 'typography',
'typography-link': 'typography',
'dropdown-button': 'dropdown',
'input-password': 'input',
'input-search': 'input',
'input-group': 'input',
'radio-group': 'radio',
'checkbox-group': 'checkbox',
'layout-sider': 'layout',
'layout-content': 'layout',
'layout-footer': 'layout',
'layout-header': 'layout',
'month-picker': 'date-picker',
};
return ignoreList.includes(name)
? ''
: replaceList.hasOwnProperty(name)
? `ant-design-vue/es/${replaceList[name]}/style/index`
: `ant-design-vue/es/${name}/style/index`;
},
},
],
});
return styleImportPlugin;
}

View File

@@ -1,17 +0,0 @@
/**
* Vite Plugin for fast creating SVG sprites.
* https://github.com/anncwb/vite-plugin-svg-icons
*/
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons';
import path from 'path';
export function configSvgIconsPlugin(isBuild: boolean) {
const svgIconsPlugin = createSvgIconsPlugin({
iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')],
svgoOptions: isBuild,
// default
symbolId: 'icon-[dir]-[name]',
});
return svgIconsPlugin;
}

View File

@@ -1,89 +0,0 @@
/**
* Vite plugin for website theme color switching
* https://github.com/anncwb/vite-plugin-theme
*/
import type { PluginOption } from 'vite';
import path from 'path';
import {
viteThemePlugin,
antdDarkThemePlugin,
mixLighten,
mixDarken,
tinycolor,
} from 'vite-plugin-theme';
import { getThemeColors, generateColors } from '../../config/themeConfig';
import { generateModifyVars } from '../../generate/generateModifyVars';
export function configThemePlugin(isBuild: boolean): PluginOption[] {
const colors = generateColors({
mixDarken,
mixLighten,
tinycolor,
});
const plugin = [
viteThemePlugin({
resolveSelector: (s) => {
s = s.trim();
switch (s) {
case '.ant-steps-item-process .ant-steps-item-icon > .ant-steps-icon':
return '.ant-steps-item-icon > .ant-steps-icon';
case '.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled)':
case '.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover':
case '.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active':
return s;
case '.ant-steps-item-icon > .ant-steps-icon':
return s;
case '.ant-select-item-option-selected:not(.ant-select-item-option-disabled)':
return s;
default:
if (s.indexOf('.ant-btn') >= -1) {
// 按钮被重新定制过需要过滤掉class防止覆盖
return s;
}
}
return s.startsWith('[data-theme') ? s : `[data-theme] ${s}`;
},
colorVariables: [...getThemeColors(), ...colors],
}),
antdDarkThemePlugin({
preloadFiles: [
path.resolve(process.cwd(), 'node_modules/ant-design-vue/dist/antd.less'),
//path.resolve(process.cwd(), 'node_modules/ant-design-vue/dist/antd.dark.less'),
path.resolve(process.cwd(), 'src/design/index.less'),
],
filter: (id) => (isBuild ? !id.endsWith('antd.less') : true),
// extractCss: false,
darkModifyVars: {
...generateModifyVars(true),
'text-color': '#c9d1d9',
'primary-1': 'rgb(255 255 255 / 8%)',
'text-color-base': '#c9d1d9',
'component-background': '#151515',
'heading-color': 'rgb(255 255 255 / 65%)',
// black: '#0e1117',
// #8b949e
'text-color-secondary': '#8b949e',
'border-color-base': '#303030',
// 'border-color-split': '#30363d',
'item-active-bg': '#111b26',
'app-content-background': '#1e1e1e',
'tree-node-selected-bg': '#11263c',
'alert-success-border-color': '#274916',
'alert-success-bg-color': '#162312',
'alert-success-icon-color': '#49aa19',
'alert-info-border-color': '#153450',
'alert-info-bg-color': '#111b26',
'alert-info-icon-color': '#177ddc',
'alert-warning-border-color': '#594214',
'alert-warning-bg-color': '#2b2111',
'alert-warning-icon-color': '#d89614',
'alert-error-border-color': '#58181c',
'alert-error-bg-color': '#2a1215',
'alert-error-icon-color': '#a61d24',
},
}),
];
return plugin as unknown as PluginOption[];
}

View File

@@ -1,17 +0,0 @@
/**
* Package file volume analysis
*/
import visualizer from 'rollup-plugin-visualizer';
import { isReportMode } from '../../utils';
export function configVisualizerConfig() {
if (isReportMode()) {
return visualizer({
filename: './node_modules/.cache/visualizer/stats.html',
open: true,
gzipSize: true,
brotliSize: true,
}) as Plugin;
}
return [];
}

View File

@@ -1,34 +0,0 @@
/**
* Used to parse the .env.development proxy configuration
*/
import type { ProxyOptions } from 'vite';
type ProxyItem = [string, string];
type ProxyList = ProxyItem[];
type ProxyTargetList = Record<string, ProxyOptions>;
const httpsRE = /^https:\/\//;
/**
* Generate proxy
* @param list
*/
export function createProxy(list: ProxyList = []) {
const ret: ProxyTargetList = {};
for (const [prefix, target] of list) {
const isHttps = httpsRE.test(target);
// https://github.com/http-party/node-http-proxy#options
ret[prefix] = {
target: target,
changeOrigin: true,
ws: true,
rewrite: (path) => path.replace(new RegExp(`^${prefix}`), ''),
// https is require secure=false
...(isHttps ? { secure: false } : {}),
};
}
return ret;
}

View File

@@ -1,33 +0,0 @@
module.exports = {
ignores: [(commit) => commit.includes('init')],
extends: ['@commitlint/config-conventional'],
rules: {
'body-leading-blank': [2, 'always'],
'footer-leading-blank': [1, 'always'],
'header-max-length': [2, 'always', 108],
'subject-empty': [2, 'never'],
'type-empty': [2, 'never'],
'subject-case': [0],
'type-enum': [
2,
'always',
[
'feat',
'fix',
'perf',
'style',
'docs',
'test',
'refactor',
'build',
'ci',
'chore',
'revert',
'wip',
'workflow',
'types',
'release',
],
],
},
};

View File

@@ -1,64 +0,0 @@
import { app, BrowserWindow, screen } from 'electron';
import is_dev from 'electron-is-dev';
import { join } from 'path';
let mainWindow: BrowserWindow | null = null;
class createWin {
constructor() {
const displayWorkAreaSize = screen.getAllDisplays()[0].workArea;
mainWindow = new BrowserWindow({
width: parseInt(`${displayWorkAreaSize.width * 0.85}`, 10),
height: parseInt(`${displayWorkAreaSize.height * 0.85}`, 10),
movable: true,
// frame: false,
show: false,
center: true,
resizable: true,
// transparent: true,
titleBarStyle: 'default',
webPreferences: {
devTools: true,
contextIsolation: false,
nodeIntegration: true,
enableRemoteModule: true,
},
backgroundColor: '#fff',
});
const URL = is_dev
? `https://localhost:${process.env.PORT}` // vite 启动的服务器地址
: `file://${join(__dirname, '../index.html')}`; // vite 构建后的静态文件地址
mainWindow.loadURL(URL);
mainWindow.on('ready-to-show', () => {
mainWindow.show();
});
}
}
app.whenReady().then(() => new createWin());
const isFirstInstance = app.requestSingleInstanceLock();
if (!isFirstInstance) {
app.quit();
} else {
app.on('second-instance', () => {
if (mainWindow) {
mainWindow.focus();
}
});
}
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit();
}
});
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
new createWin();
}
});

View File

@@ -8,20 +8,10 @@
name="viewport"
content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0"
/>
<title><%= title %></title>
<title><%= VITE_GLOB_APP_TITLE %></title>
<link rel="icon" href="/favicon.ico" />
</head>
<body>
<script>
(() => {
var htmlRoot = document.getElementById('htmlRoot');
var theme = window.localStorage.getItem('__APP__DARK__MODE__');
if (htmlRoot && theme) {
htmlRoot.setAttribute('data-theme', theme);
theme = htmlRoot = null;
}
})();
</script>
<div id="app">
<style>
html[data-theme='dark'] .app-loading {
@@ -34,39 +24,39 @@
.app-loading {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
justify-content: center;
align-items: center;
flex-direction: column;
background-color: #f4f7f9;
}
.app-loading .app-loading-wrap {
display: flex;
position: absolute;
top: 50%;
left: 50%;
display: flex;
transform: translate3d(-50%, -50%, 0);
justify-content: center;
align-items: center;
flex-direction: column;
align-items: center;
justify-content: center;
transform: translate3d(-50%, -50%, 0);
}
.app-loading .dots {
display: flex;
padding: 98px;
justify-content: center;
align-items: center;
justify-content: center;
padding: 98px;
}
.app-loading .app-loading-title {
display: flex;
margin-top: 30px;
font-size: 30px;
color: rgb(0 0 0 / 85%);
justify-content: center;
align-items: center;
justify-content: center;
margin-top: 30px;
color: rgb(0 0 0 / 85%);
font-size: 30px;
}
.app-loading .app-loading-logo {
@@ -77,28 +67,28 @@
}
.dot {
position: relative;
display: inline-block;
position: relative;
box-sizing: border-box;
width: 48px;
height: 48px;
margin-top: 30px;
font-size: 32px;
transform: rotate(45deg);
box-sizing: border-box;
animation: antRotate 1.2s infinite linear;
animation: ant-rotate 1.2s infinite linear;
font-size: 32px;
}
.dot i {
position: absolute;
display: block;
position: absolute;
width: 20px;
height: 20px;
background-color: #0065cc;
border-radius: 100%;
opacity: 30%;
transform: scale(0.75);
animation: antSpinMove 1s infinite linear alternate;
transform-origin: 50% 50%;
animation: ant-spin-move 1s infinite linear alternate;
border-radius: 100%;
opacity: 0.3;
background-color: #0065cc;
}
.dot i:nth-child(1) {
@@ -123,34 +113,38 @@
left: 0;
animation-delay: 1.2s;
}
@keyframes antRotate {
@keyframes ant-rotate {
to {
transform: rotate(405deg);
}
}
@keyframes antRotate {
@keyframes ant-rotate {
to {
transform: rotate(405deg);
}
}
@keyframes antSpinMove {
@keyframes ant-spin-move {
to {
opacity: 100%;
opacity: 1;
}
}
@keyframes antSpinMove {
@keyframes ant-spin-move {
to {
opacity: 100%;
opacity: 1;
}
}
</style>
<div class="app-loading">
<div class="app-loading-wrap">
<img src="/resource/img/logo.png" class="app-loading-logo" alt="Logo" />
<img src="/logo.png" class="app-loading-logo" alt="Logo" />
<div class="app-loading-dots">
<span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
</div>
<div class="app-loading-title"><%= title %></div>
<div class="app-loading-title"><%= VITE_GLOB_APP_TITLE %></div>
</div>
</div>
</div>

View File

@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: ['@vben/eslint-config/strict'],
};

View File

@@ -0,0 +1,10 @@
import { defineBuildConfig } from 'unbuild';
export default defineBuildConfig({
clean: true,
entries: ['src/index', 'src/strict'],
declaration: true,
rollup: {
emitCJS: true,
},
});

View File

@@ -0,0 +1,49 @@
{
"name": "@vben/eslint-config",
"version": "1.0.0",
"private": true,
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": {
"url": "https://github.com/vbenjs/vue-vben-admin/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/vbenjs/vue-vben-admin.git",
"directory": "internal/eslint-config"
},
"license": "MIT",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
},
"./strict": {
"types": "./dist/strict.d.ts",
"import": "./dist/strict.mjs",
"require": "./dist/strict.cjs"
}
},
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"clean": "pnpm rimraf .turbo node_modules dist",
"lint": "pnpm eslint .",
"stub": "pnpm unbuild --stub"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.57.1",
"@typescript-eslint/parser": "^5.57.1",
"eslint": "^8.37.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-vue": "^9.10.0",
"vue-eslint-parser": "^9.1.1"
}
}

View File

@@ -0,0 +1,91 @@
export default {
env: {
browser: true,
node: true,
es6: true,
},
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 2020,
sourceType: 'module',
jsxPragma: 'React',
ecmaFeatures: {
jsx: true,
},
project: './tsconfig.*?.json',
createDefaultProgram: false,
extraFileExtensions: ['.vue'],
},
plugins: ['vue', '@typescript-eslint', 'import'],
extends: [
'eslint:recommended',
'plugin:vue/vue3-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
rules: {
'no-unused-vars': 'off',
'no-case-declarations': 'off',
'no-use-before-define': 'off',
'space-before-function-paren': 'off',
'import/first': 'error',
'import/newline-after-import': 'error',
'import/no-duplicates': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'vue/script-setup-uses-vars': 'error',
'vue/no-reserved-component-names': 'off',
'vue/custom-event-name-casing': 'off',
'vue/attributes-order': 'off',
'vue/one-component-per-file': 'off',
'vue/html-closing-bracket-newline': 'off',
'vue/max-attributes-per-line': 'off',
'vue/multiline-html-element-content-newline': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/attribute-hyphenation': 'off',
'vue/require-default-prop': 'off',
'vue/require-explicit-emits': 'off',
'vue/html-self-closing': [
'error',
{
html: {
void: 'always',
normal: 'never',
component: 'always',
},
svg: 'always',
math: 'always',
},
],
'vue/multi-word-component-names': 'off',
// 'sort-imports': [
// 'error',
// {
// ignoreCase: true,
// ignoreDeclarationSort: false,
// ignoreMemberSort: false,
// memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
// allowSeparatedGroups: false,
// },
// ],
},
globals: { defineOptions: 'readonly' },
};

View File

@@ -0,0 +1,57 @@
export default {
extends: ['@vben'],
plugins: ['simple-import-sort'],
rules: {
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'@typescript-eslint/ban-ts-comment': [
'error',
{
'ts-expect-error': 'allow-with-description',
'ts-ignore': 'allow-with-description',
'ts-nocheck': 'allow-with-description',
'ts-check': false,
},
],
/**
* 【强制】关键字前后有一个空格
* @link https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/keyword-spacing.md
*/
'keyword-spacing': 'off',
'@typescript-eslint/keyword-spacing': [
'error',
{
before: true,
after: true,
overrides: {
return: { after: true },
throw: { after: true },
case: { after: true },
},
},
],
/**
* 禁止出现空函数,普通函数(非 async/await/generator、箭头函数、类上的方法除外
* @link https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-empty-function.md
*/
'no-empty-function': 'off',
'@typescript-eslint/no-empty-function': [
'error',
{
allow: ['arrowFunctions', 'functions', 'methods'],
},
],
/**
* 优先使用 interface 而不是 type 定义对象类型
* @link https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/consistent-type-definitions.md
*/
'@typescript-eslint/consistent-type-definitions': ['warn', 'interface'],
'vue/attributes-order': 'error',
'vue/require-default-prop': 'error',
},
};

View File

@@ -0,0 +1,5 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "@vben/ts-config/node.json",
"include": ["src"]
}

View File

@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: ['@vben/eslint-config/strict'],
};

View File

@@ -0,0 +1,10 @@
import { defineBuildConfig } from 'unbuild';
export default defineBuildConfig({
clean: true,
entries: ['src/index'],
declaration: true,
rollup: {
emitCJS: true,
},
});

View File

@@ -0,0 +1,49 @@
{
"name": "@vben/stylelint-config",
"version": "1.0.0",
"private": true,
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": {
"url": "https://github.com/vbenjs/vue-vben-admin/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/vbenjs/vue-vben-admin.git",
"directory": "internal/stylelint-config"
},
"license": "MIT",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"clean": "pnpm rimraf .turbo node_modules dist",
"lint": "pnpm eslint .",
"stub": "pnpm unbuild --stub"
},
"devDependencies": {
"postcss": "^8.4.21",
"postcss-html": "^1.5.0",
"postcss-less": "^6.0.0",
"postcss-scss": "^4.0.6",
"prettier": "^2.8.7",
"stylelint": "^15.4.0",
"stylelint-config-property-sort-order-smacss": "^9.1.0",
"stylelint-config-recommended": "^11.0.0",
"stylelint-config-recommended-scss": "^9.0.1",
"stylelint-config-recommended-vue": "^1.4.0",
"stylelint-config-standard": "^32.0.0",
"stylelint-config-standard-scss": "^7.0.1",
"stylelint-order": "^6.0.3",
"stylelint-prettier": "^3.0.0"
}
}

View File

@@ -1,15 +1,35 @@
module.exports = {
root: true,
plugins: ['stylelint-order'],
extends: ['stylelint-config-standard', 'stylelint-config-prettier'],
export default {
extends: ['stylelint-config-standard', 'stylelint-config-property-sort-order-smacss'],
plugins: ['stylelint-order', 'stylelint-prettier'],
// customSyntax: 'postcss-html',
overrides: [
{
files: ['**/*.(css|html|vue)'],
customSyntax: 'postcss-html',
},
{
files: ['*.less', '**/*.less'],
customSyntax: 'postcss-less',
extends: ['stylelint-config-standard', 'stylelint-config-recommended-vue'],
},
{
files: ['*.scss', '**/*.scss'],
customSyntax: 'postcss-scss',
extends: ['stylelint-config-standard-scss', 'stylelint-config-recommended-vue/scss'],
rule: {
'scss/percent-placeholder-pattern': null,
},
},
],
rules: {
'selector-not-notation': null,
'import-notation': null,
'function-no-unknown': null,
'selector-class-pattern': null,
'selector-pseudo-class-no-unknown': [
true,
{
ignorePseudoClasses: ['global'],
ignorePseudoClasses: ['global', 'deep'],
},
],
'selector-pseudo-element-no-unknown': [
@@ -32,18 +52,15 @@ module.exports = {
'each',
'include',
'mixin',
'extend',
],
},
],
'no-empty-source': null,
'string-quotes': null,
'named-grid-areas-no-invalid': null,
'unicode-bom': 'never',
'no-descending-specificity': null,
'font-family-no-missing-generic-family-keyword': null,
'declaration-colon-space-after': 'always-single-line',
'declaration-colon-space-before': 'never',
// 'declaration-block-trailing-semicolon': 'always',
'rule-empty-line-before': [
'always',
{
@@ -67,34 +84,8 @@ module.exports = {
},
'rules',
],
{ severity: 'warning' },
{ severity: 'error' },
],
},
ignoreFiles: ['**/*.js', '**/*.jsx', '**/*.tsx', '**/*.ts'],
overrides: [
{
files: ['*.vue', '**/*.vue', '*.html', '**/*.html'],
extends: ['stylelint-config-recommended'],
rules: {
'keyframes-name-pattern': null,
'selector-pseudo-class-no-unknown': [
true,
{
ignorePseudoClasses: ['deep', 'global'],
},
],
'selector-pseudo-element-no-unknown': [
true,
{
ignorePseudoElements: ['v-deep', 'v-global', 'v-slotted'],
},
],
},
},
{
files: ['*.less', '**/*.less'],
customSyntax: 'postcss-less',
extends: ['stylelint-config-standard', 'stylelint-config-recommended-vue'],
},
],
};

View File

@@ -0,0 +1,5 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "@vben/ts-config/node.json",
"include": ["src"]
}

View File

@@ -0,0 +1,27 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Base",
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "node",
"strict": true,
"declaration": true,
"noImplicitOverride": true,
"noUnusedLocals": true,
"esModuleInterop": true,
"useUnknownInCatchVariables": false,
"composite": false,
"declarationMap": false,
"forceConsistentCasingInFileNames": true,
"inlineSources": false,
"isolatedModules": true,
"skipLibCheck": true,
"noUnusedParameters": false,
"preserveWatchOutput": true,
"experimentalDecorators": true,
"resolveJsonModule": true,
"removeComments": true
},
"exclude": ["**/node_modules/**", "**/dist/**"]
}

View File

@@ -1,4 +1,7 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Node Server Config",
"extends": "./base.json",
"compilerOptions": {
"module": "commonjs",
"declaration": false,

View File

@@ -0,0 +1,12 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Node Config",
"extends": "./base.json",
"compilerOptions": {
"lib": ["ESNext"],
"noImplicitAny": true,
"sourceMap": true,
"noEmit": true,
"baseUrl": "./"
}
}

View File

@@ -0,0 +1,26 @@
{
"name": "@vben/ts-config",
"version": "1.0.0",
"private": true,
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": {
"url": "https://github.com/vbenjs/vue-vben-admin/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/vbenjs/vue-vben-admin.git",
"directory": "internal/ts-config"
},
"license": "MIT",
"files": [
"base.json",
"node.json",
"vue.json",
"node-server.json"
],
"dependencies": {
"@types/node": "^18.15.11",
"unplugin-vue-define-options": "^1.3.3",
"vite": "^4.3.0-beta.2"
}
}

View File

@@ -0,0 +1,11 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Vue Application",
"extends": "./base.json",
"compilerOptions": {
"jsx": "preserve",
"lib": ["ESNext", "DOM"],
"noImplicitAny": false
}
}

View File

@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: ['@vben/eslint-config/strict'],
};

View File

@@ -0,0 +1,10 @@
import { defineBuildConfig } from 'unbuild';
export default defineBuildConfig({
clean: true,
entries: ['src/index'],
declaration: true,
rollup: {
emitCJS: true,
},
});

View File

@@ -0,0 +1,59 @@
{
"name": "@vben/vite-config",
"version": "1.0.0",
"private": true,
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": {
"url": "https://github.com/vbenjs/vue-vben-admin/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/vbenjs/vue-vben-admin.git",
"directory": "internal/vite-config"
},
"license": "MIT",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"clean": "pnpm rimraf .turbo node_modules dist",
"lint": "pnpm eslint .",
"stub": "pnpm unbuild --stub"
},
"dependencies": {
"@ant-design/colors": "^7.0.0",
"vite": "^4.3.0-beta.2"
},
"devDependencies": {
"@types/fs-extra": "^11.0.1",
"@vitejs/plugin-vue": "^4.1.0",
"@vitejs/plugin-vue-jsx": "^3.0.1",
"ant-design-vue": "^3.2.17",
"dayjs": "^1.11.7",
"dotenv": "^16.0.3",
"fs-extra": "^11.1.1",
"less": "^4.1.3",
"picocolors": "^1.0.0",
"pkg-types": "^1.0.2",
"rollup-plugin-visualizer": "^5.9.0",
"sass": "^1.60.0",
"unocss": "^0.50.6",
"unplugin-vue-define-options": "^1.3.3",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-dts": "^2.2.0",
"vite-plugin-html": "^3.2.0",
"vite-plugin-mock": "^2.9.6",
"vite-plugin-purge-icons": "^0.9.2",
"vite-plugin-svg-icons": "^2.0.1"
}
}

View File

@@ -0,0 +1,113 @@
import { resolve } from 'node:path';
import dayjs from 'dayjs';
import { readPackageJSON } from 'pkg-types';
import { defineConfig, loadEnv, mergeConfig, type UserConfig } from 'vite';
import { createPlugins } from '../plugins';
import { generateModifyVars } from '../utils/modifyVars';
import { commonConfig } from './common';
interface DefineOptions {
overrides?: UserConfig;
options?: {
//
};
}
function defineApplicationConfig(defineOptions: DefineOptions = {}) {
const { overrides = {} } = defineOptions;
return defineConfig(async ({ command, mode }) => {
const root = process.cwd();
const isBuild = command === 'build';
const { VITE_USE_MOCK, VITE_BUILD_COMPRESS, VITE_ENABLE_ANALYZE } = loadEnv(mode, root);
const defineData = await createDefineData(root);
const plugins = await createPlugins({
isBuild,
root,
enableAnalyze: VITE_ENABLE_ANALYZE === 'true',
enableMock: VITE_USE_MOCK === 'true',
compress: VITE_BUILD_COMPRESS,
});
const pathResolve = (pathname: string) => resolve(root, '.', pathname);
const applicationConfig: UserConfig = {
resolve: {
alias: [
{
find: 'vue-i18n',
replacement: 'vue-i18n/dist/vue-i18n.cjs.js',
},
// /@/xxxx => src/xxxx
{
find: /\/@\//,
replacement: pathResolve('src') + '/',
},
// /#/xxxx => types/xxxx
{
find: /\/#\//,
replacement: pathResolve('types') + '/',
},
// @/xxxx => src/xxxx
{
find: /@\//,
replacement: pathResolve('src') + '/',
},
// #/xxxx => types/xxxx
{
find: /#\//,
replacement: pathResolve('types') + '/',
},
],
},
define: defineData,
build: {
target: 'es2015',
cssTarget: 'chrome80',
rollupOptions: {
output: {
manualChunks: {
vue: ['vue', 'pinia', 'vue-router'],
antd: ['ant-design-vue', '@ant-design/icons-vue'],
},
},
},
},
css: {
preprocessorOptions: {
less: {
modifyVars: generateModifyVars(),
javascriptEnabled: true,
},
},
},
plugins,
};
const mergedConfig = mergeConfig(commonConfig, applicationConfig);
return mergeConfig(mergedConfig, overrides);
});
}
async function createDefineData(root: string) {
try {
const pkgJson = await readPackageJSON(root);
const { dependencies, devDependencies, name, version } = pkgJson;
const __APP_INFO__ = {
pkg: { dependencies, devDependencies, name, version },
lastBuildTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
};
return {
__APP_INFO__: JSON.stringify(__APP_INFO__),
};
} catch (error) {
return {};
}
}
export { defineApplicationConfig };

View File

@@ -0,0 +1,27 @@
import { presetTypography, presetUno } from 'unocss';
import UnoCSS from 'unocss/vite';
import { type UserConfig } from 'vite';
const commonConfig: UserConfig = {
server: {
host: true,
},
esbuild: {
drop: ['console', 'debugger'],
},
build: {
reportCompressedSize: false,
chunkSizeWarningLimit: 1500,
rollupOptions: {
// TODO: Prevent memory overflow
maxParallelFileOps: 3,
},
},
plugins: [
UnoCSS({
presets: [presetUno(), presetTypography()],
}),
],
};
export { commonConfig };

View File

@@ -0,0 +1,42 @@
import { readPackageJSON } from 'pkg-types';
import { defineConfig, mergeConfig, type UserConfig } from 'vite';
import dts from 'vite-plugin-dts';
import { commonConfig } from './common';
interface DefineOptions {
overrides?: UserConfig;
options?: {
//
};
}
function definePackageConfig(defineOptions: DefineOptions = {}) {
const { overrides = {} } = defineOptions;
const root = process.cwd();
return defineConfig(async () => {
const { dependencies = {}, peerDependencies = {} } = await readPackageJSON(root);
const packageConfig: UserConfig = {
build: {
lib: {
entry: 'src/index.ts',
formats: ['es'],
fileName: () => 'index.mjs',
},
rollupOptions: {
external: [...Object.keys(dependencies), ...Object.keys(peerDependencies)],
},
},
plugins: [
dts({
logLevel: 'error',
}),
],
};
const mergedConfig = mergeConfig(commonConfig, packageConfig);
return mergeConfig(mergedConfig, overrides);
});
}
export { definePackageConfig };

View File

@@ -0,0 +1,2 @@
export * from './config/application';
export * from './config/package';

View File

@@ -0,0 +1,96 @@
import colors from 'picocolors';
import { readPackageJSON } from 'pkg-types';
import { type PluginOption } from 'vite';
import { getEnvConfig } from '../utils/env';
import { createContentHash } from '../utils/hash';
const GLOBAL_CONFIG_FILE_NAME = '_app.config.js';
const PLUGIN_NAME = 'app-config';
async function createAppConfigPlugin({
root,
isBuild,
}: {
root: string;
isBuild: boolean;
}): Promise<PluginOption> {
let publicPath: string;
let source: string;
if (!isBuild) {
return {
name: PLUGIN_NAME,
};
}
const { version = '' } = await readPackageJSON(root);
return {
name: PLUGIN_NAME,
async configResolved(_config) {
let appTitle = _config?.env?.VITE_GLOB_APP_TITLE ?? '';
appTitle = appTitle.replace(/\s/g, '_');
publicPath = _config.base;
source = await getConfigSource(appTitle);
},
async transformIndexHtml(html) {
publicPath = publicPath.endsWith('/') ? publicPath : `${publicPath}/`;
const appConfigSrc = `${
publicPath || '/'
}${GLOBAL_CONFIG_FILE_NAME}?v=${version}-${createContentHash(source)}}`;
return {
html,
tags: [
{
tag: 'script',
attrs: {
src: appConfigSrc,
},
},
],
};
},
async generateBundle() {
try {
this.emitFile({
type: 'asset',
fileName: GLOBAL_CONFIG_FILE_NAME,
source,
});
console.log(colors.cyan(`✨configuration file is build successfully!`));
} catch (error) {
console.log(
colors.red('configuration file configuration file failed to package:\n' + error),
);
}
},
};
}
/**
* Get the configuration file variable name
* @param env
*/
const getVariableName = (title: string) => {
return `__PRODUCTION__${title || '__APP'}__CONF__`.toUpperCase().replace(/\s/g, '');
};
async function getConfigSource(appTitle: string) {
const config = await getEnvConfig();
const variableName = getVariableName(appTitle);
const windowVariable = `window.${variableName}`;
// Ensure that the variable will not be modified
let source = `${windowVariable}=${JSON.stringify(config)};`;
source += `
Object.freeze(${windowVariable});
Object.defineProperty(window, "${variableName}", {
configurable: false,
writable: false,
});
`.replace(/\s/g, '');
return source;
}
export { createAppConfigPlugin };

View File

@@ -5,10 +5,13 @@
import type { PluginOption } from 'vite';
import compressPlugin from 'vite-plugin-compression';
export function configCompressPlugin(
compress: 'gzip' | 'brotli' | 'none',
export function configCompressPlugin({
compress,
deleteOriginFile = false,
): PluginOption | PluginOption[] {
}: {
compress: string;
deleteOriginFile?: boolean;
}): PluginOption[] {
const compressList = compress.split(',');
const plugins: PluginOption[] = [];

View File

@@ -0,0 +1,13 @@
/**
* Plugin to minimize and use ejs template syntax in index.html.
* https://github.com/anncwb/vite-plugin-html
*/
import type { PluginOption } from 'vite';
import { createHtmlPlugin } from 'vite-plugin-html';
export function configHtmlPlugin({ isBuild }: { isBuild: boolean }) {
const htmlPlugin: PluginOption[] = createHtmlPlugin({
minify: isBuild,
});
return htmlPlugin;
}

View File

@@ -0,0 +1,61 @@
import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx';
// @ts-ignore: type unless
import DefineOptions from 'unplugin-vue-define-options/vite';
import { type PluginOption } from 'vite';
import purgeIcons from 'vite-plugin-purge-icons';
import { createAppConfigPlugin } from './appConfig';
import { configCompressPlugin } from './compress';
import { configHtmlPlugin } from './html';
import { configMockPlugin } from './mock';
import { configSvgIconsPlugin } from './svgSprite';
import { configVisualizerConfig } from './visualizer';
interface Options {
isBuild: boolean;
root: string;
compress: string;
enableMock?: boolean;
enableAnalyze?: boolean;
}
async function createPlugins({ isBuild, root, enableMock, compress, enableAnalyze }: Options) {
const vitePlugins: (PluginOption | PluginOption[])[] = [vue(), vueJsx(), DefineOptions()];
const appConfigPlugin = await createAppConfigPlugin({ root, isBuild });
vitePlugins.push(appConfigPlugin);
// vite-plugin-html
vitePlugins.push(configHtmlPlugin({ isBuild }));
// vite-plugin-svg-icons
vitePlugins.push(configSvgIconsPlugin({ isBuild }));
// vite-plugin-purge-icons
vitePlugins.push(purgeIcons());
// The following plugins only work in the production environment
if (isBuild) {
// rollup-plugin-gzip
vitePlugins.push(
configCompressPlugin({
compress,
}),
);
}
// rollup-plugin-visualizer
if (enableAnalyze) {
vitePlugins.push(configVisualizerConfig());
}
// vite-plugin-mock
if (enableMock) {
vitePlugins.push(configMockPlugin({ isBuild }));
}
return vitePlugins;
}
export { createPlugins };

View File

@@ -4,9 +4,9 @@
*/
import { viteMockServe } from 'vite-plugin-mock';
export function configMockPlugin(isBuild: boolean) {
export function configMockPlugin({ isBuild }: { isBuild: boolean }) {
return viteMockServe({
ignore: /^\_/,
ignore: /^_/,
mockPath: 'mock',
localEnabled: !isBuild,
prodEnabled: isBuild,

View File

@@ -0,0 +1,17 @@
/**
* Vite Plugin for fast creating SVG sprites.
* https://github.com/anncwb/vite-plugin-svg-icons
*/
import { resolve } from 'node:path';
import type { PluginOption } from 'vite';
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons';
export function configSvgIconsPlugin({ isBuild }: { isBuild: boolean }) {
const svgIconsPlugin = createSvgIconsPlugin({
iconDirs: [resolve(process.cwd(), 'src/assets/icons')],
svgoOptions: isBuild,
});
return svgIconsPlugin as PluginOption;
}

View File

@@ -0,0 +1,14 @@
/**
* Package file volume analysis
*/
import visualizer from 'rollup-plugin-visualizer';
import { type PluginOption } from 'vite';
export function configVisualizerConfig() {
return visualizer({
filename: './node_modules/.cache/visualizer/stats.html',
open: true,
gzipSize: true,
brotliSize: true,
}) as PluginOption;
}

View File

@@ -0,0 +1,44 @@
import { join } from 'node:path';
import dotenv from 'dotenv';
import { readFile } from 'fs-extra';
/**
* 获取当前环境下生效的配置文件名
*/
function getConfFiles() {
const script = process.env.npm_lifecycle_script as string;
const reg = new RegExp('--mode ([a-z_\\d]+)');
const result = reg.exec(script);
if (result) {
const mode = result[1];
return ['.env', `.env.${mode}`];
}
return ['.env', '.env.production'];
}
/**
* Get the environment variables starting with the specified prefix
* @param match prefix
* @param confFiles ext
*/
export async function getEnvConfig(match = 'VITE_GLOB_', confFiles = getConfFiles()) {
let envConfig = {};
for (const confFile of confFiles) {
try {
const envPath = await readFile(join(process.cwd(), confFile), { encoding: 'utf8' });
const env = dotenv.parse(envPath);
envConfig = { ...envConfig, ...env };
} catch (e) {
console.error(`Error in parsing ${confFile}`, e);
}
}
const reg = new RegExp(`^(${match})`);
Object.keys(envConfig).forEach((key) => {
if (!reg.test(key)) {
Reflect.deleteProperty(envConfig, key);
}
});
return envConfig;
}

View File

@@ -0,0 +1,8 @@
import { createHash } from 'node:crypto';
function createContentHash(content: string, hashLSize = 12) {
const hash = createHash('sha256').update(content);
return hash.digest('hex').slice(0, hashLSize);
}
export { createContentHash };

View File

@@ -1,11 +1,21 @@
import { generateAntColors, primaryColor } from '../config/themeConfig';
import { resolve } from 'node:path';
import { generate } from '@ant-design/colors';
// @ts-ignore: typo
import { getThemeVariables } from 'ant-design-vue/dist/theme';
import { resolve } from 'path';
const primaryColor = '#0960bd';
function generateAntColors(color: string, theme: 'default' | 'dark' = 'default') {
return generate(color, {
theme,
});
}
/**
* less global variable
*/
export function generateModifyVars(dark = false) {
export function generateModifyVars() {
const palettes = generateAntColors(primaryColor);
const primary = palettes[5];
@@ -15,10 +25,9 @@ export function generateModifyVars(dark = false) {
primaryColorObj[`primary-${index + 1}`] = palettes[index];
}
const modifyVars = getThemeVariables({ dark });
const modifyVars = getThemeVariables();
return {
...modifyVars,
// Used for global import to avoid the need to import each style file separately
// reference: Avoid repeated references
hack: `${modifyVars.hack} @import (reference) "${resolve('src/design/config.less')}";`,
'primary-color': primary,
@@ -28,7 +37,6 @@ export function generateModifyVars(dark = false) {
'success-color': '#55D187', // Success color
'error-color': '#ED6F6F', // False color
'warning-color': '#EFBD47', // Warning color
//'border-color-base': '#EEEEEE',
'font-size-base': '14px', // Main font size
'border-radius-base': '2px', // Component/float fillet
'link-color': primary, // Link color

View File

@@ -0,0 +1,5 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "@vben/ts-config/node.json",
"include": ["src"]
}

View File

@@ -1,5 +1,21 @@
import { createProdMockServer } from 'vite-plugin-mock/es/createProdMockServer';
// 问题描述
// 1. `import.meta.globEager` 已被弃用, 需要升级vite版本,有兼容问题
// 2. `vite-plugin-mock` 插件问题 https://github.com/vbenjs/vite-plugin-mock/issues/56
// const modules: Record<string, any> = import.meta.glob("./**/*.ts", {
// import: "default",
// eager: true,
// });
// const mockModules = Object.keys(modules).reduce((pre, key) => {
// if (!key.includes("/_")) {
// pre.push(...modules[key]);
// }
// return pre;
// }, [] as any[]);
const modules = import.meta.globEager('./**/*.ts');
const mockModules: any[] = [];

View File

@@ -1,8 +1,9 @@
// Interface data format used to return a unified format
import { ResultEnum } from '/@/enums/httpEnum';
export function resultSuccess<T = Recordable>(result: T, { message = 'ok' } = {}) {
return {
code: 0,
code: ResultEnum.SUCCESS,
result,
message,
type: 'success',
@@ -26,7 +27,10 @@ export function resultPageSuccess<T = any>(
};
}
export function resultError(message = 'Request failed', { code = -1, result = null } = {}) {
export function resultError(
message = 'Request failed',
{ code = ResultEnum.ERROR, result = null } = {},
) {
return {
code,
result,
@@ -37,11 +41,9 @@ export function resultError(message = 'Request failed', { code = -1, result = nu
export function pagination<T = any>(pageNo: number, pageSize: number, array: T[]): T[] {
const offset = (pageNo - 1) * Number(pageSize);
const ret =
offset + Number(pageSize) >= array.length
return offset + Number(pageSize) >= array.length
? array.slice(offset, array.length)
: array.slice(offset, offset + Number(pageSize));
return ret;
}
export interface requestParams {

View File

@@ -27,6 +27,9 @@ const demoList = (() => {
name6: '@cname()',
name7: '@cname()',
name8: '@cname()',
radio1: `选项${index + 1}`,
radio2: `选项${index + 1}`,
radio3: `选项${index + 1}`,
avatar: Random.image('400x400', Random.color(), Random.color(), Random.first()),
imgArr: getRandomPics(Math.ceil(Math.random() * 3) + 1),
imgs: getRandomPics(Math.ceil(Math.random() * 3) + 1),

View File

@@ -221,11 +221,11 @@ const linkRoute = {
name: 'Doc',
meta: {
title: 'routes.demo.iframe.doc',
frameSrc: 'https://vvbin.cn/doc-next/',
frameSrc: 'https://doc.vvbin.cn/',
},
},
{
path: 'https://vvbin.cn/doc-next/',
path: 'https://doc.vvbin.cn/',
name: 'DocExternal',
component: 'LAYOUT',
meta: {

View File

@@ -7,7 +7,7 @@ export function createFakeUserList() {
userId: '1',
username: 'vben',
realName: 'Vben Admin',
avatar: 'https://q1.qlogo.cn/g?b=qq&nk=190848757&s=640',
avatar: '',
desc: 'manager',
password: '123456',
token: 'fakeToken1',
@@ -24,7 +24,7 @@ export function createFakeUserList() {
username: 'test',
password: '123456',
realName: 'test user',
avatar: 'https://q1.qlogo.cn/g?b=qq&nk=339449197&s=640',
avatar: '',
desc: 'tester',
token: 'fakeToken2',
homePath: '/dashboard/workbench',

View File

@@ -1,223 +1,154 @@
{
"name": "vben-admin",
"version": "2.8.0",
"version": "2.10.0",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": {
"url": "https://github.com/vbenjs/vue-vben-admin/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/vbenjs/vue-vben-admin.git"
},
"license": "MIT",
"author": {
"name": "vben",
"email": "anncwb@126.com",
"url": "https://github.com/anncwb"
},
"main": "dist/main/build.js",
"build": {
"appId": "xxx@gmail.com",
"electronDownload": {
"mirror": "https://npm.taobao.org/mirrors/electron/"
},
"files": [
"!node_modules",
"dist/**"
],
"asar": false,
"mac": {
"artifactName": "${productName}_setup_${version}.${ext}",
"target": [
"dmg"
]
},
"linux": {
"icon": "build/icons/512x512.png",
"target": [
"deb"
]
},
"win": {
"target": [
{
"target": "nsis",
"arch": [
"x64"
]
}
],
"artifactName": "${productName}_setup_${version}.${ext}"
},
"nsis": {
"oneClick": false,
"perMachine": false,
"allowToChangeInstallationDirectory": true,
"deleteAppDataOnUninstall": false
}
},
"scripts": {
"bootstrap": "pnpm install",
"serve": "npm run dev",
"dev": "vite",
"build": "cross-env NODE_ENV=production vite build && esno ./build/script/postBuild.ts",
"build:test": "cross-env vite build --mode test && esno ./build/script/postBuild.ts",
"build": "cross-env NODE_ENV=production pnpm vite build",
"build:analyze": "pnpm vite build --mode analyze",
"build:no-cache": "pnpm clean:cache && npm run build",
"dev:app": "esno ./build/script/startElectron.ts --env=development --watch",
"build:app": "npm run build && esno ./build/script/startElectron.ts --env=production && electron-builder ",
"report": "cross-env REPORT=true npm run build",
"type:check": "vue-tsc --noEmit --skipLibCheck",
"preview": "npm run build && vite preview",
"preview:dist": "vite preview",
"log": "conventional-changelog -p angular -i CHANGELOG.md -s",
"clean:cache": "rimraf node_modules/.cache/ && rimraf node_modules/.vite",
"clean:lib": "rimraf node_modules",
"build:test": "pnpm vite build --mode test",
"commit": "czg",
"dev": "pnpm vite",
"preinstall": "npx only-allow pnpm",
"postinstall": "turbo run stub",
"lint": "turbo run lint",
"lint:eslint": "eslint --cache --max-warnings 0 \"{src,mock}/**/*.{vue,ts,tsx}\" --fix",
"lint:prettier": "prettier --write \"src/**/*.{js,json,tsx,css,less,scss,vue,html,md}\"",
"lint:stylelint": "stylelint --cache --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/",
"lint:lint-staged": "lint-staged",
"test:unit": "jest",
"test:gzip": "npx http-server dist --cors --gzip -c-1",
"test:br": "npx http-server dist --cors --brotli -c-1",
"reinstall": "rimraf pnpm-lock.yaml && rimraf package.lock.json && rimraf node_modules && npm run bootstrap",
"lint:prettier": "prettier --write .",
"lint:stylelint": "stylelint \"**/*.{vue,css,less.scss}\" --fix --cache --cache-location node_modules/.cache/stylelint/",
"prepare": "husky install",
"gen:icon": "esno ./build/generate/icon/index.ts"
"preview": "npm run build && vite preview",
"reinstall": "rimraf pnpm-lock.yaml && rimraf package.lock.json && rimraf node_modules && npm run bootstrap",
"serve": "npm run dev",
"test:gzip": "npx http-server dist --cors --gzip -c-1",
"type:check": "vue-tsc --noEmit --skipLibCheck"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"prettier --write",
"eslint --fix"
],
"{!(package)*.json,*.code-snippets,.!(browserslist)*rc}": [
"prettier --write--parser json"
],
"package.json": [
"prettier --write"
],
"*.vue": [
"prettier --write",
"eslint --fix",
"stylelint --fix"
],
"*.{scss,less,styl,html}": [
"prettier --write",
"stylelint --fix"
],
"*.md": [
"prettier --write"
]
},
"config": {
"commitizen": {
"path": "node_modules/cz-git"
}
},
"dependencies": {
"@ant-design/colors": "^6.0.0",
"@ant-design/icons-vue": "^6.1.0",
"@logicflow/core": "^0.6.16",
"@logicflow/extension": "^0.6.16",
"@iconify/iconify": "^2.2.1",
"@vue/runtime-core": "^3.2.31",
"@vue/shared": "^3.2.31",
"@vueuse/core": "^6.3.3",
"@vueuse/shared": "^6.3.3",
"@zxcvbn-ts/core": "^2.0.1",
"ant-design-vue": "3.1.1",
"axios": "^0.21.4",
"codemirror": "^5.62.3",
"cropperjs": "^1.5.12",
"electron-is-dev": "^1.2.0",
"@iconify/iconify": "^3.1.0",
"@logicflow/core": "^1.2.1",
"@logicflow/extension": "^1.2.1",
"@vben/hooks": "workspace:*",
"@vue/shared": "^3.2.47",
"@vueuse/core": "^9.13.0",
"@vueuse/shared": "^9.13.0",
"@zxcvbn-ts/core": "^2.2.1",
"ant-design-vue": "^3.2.17",
"axios": "^1.3.5",
"codemirror": "^5.65.12",
"cropperjs": "^1.5.13",
"crypto-js": "^4.1.1",
"dayjs": "^1.11.0",
"echarts": "^5.2.0",
"intro.js": "^4.2.2",
"dayjs": "^1.11.7",
"echarts": "^5.4.2",
"exceljs": "^4.3.0",
"intro.js": "^7.0.1",
"lodash-es": "^4.17.21",
"mockjs": "^1.1.0",
"nprogress": "^0.2.0",
"path-to-regexp": "^6.2.0",
"pinia": "2.0.12",
"path-to-regexp": "^6.2.1",
"pinia": "2.0.33",
"print-js": "^1.6.0",
"qrcode": "^1.4.4",
"qs": "^6.10.3",
"qrcode": "^1.5.1",
"qs": "^6.11.1",
"resize-observer-polyfill": "^1.5.1",
"showdown": "^1.9.1",
"sortablejs": "^1.14.0",
"tinymce": "^5.9.2",
"vditor": "^3.8.13",
"vue": "^3.2.31",
"vue-i18n": "^9.1.9",
"vue-json-pretty": "^2.0.6",
"vue-router": "^4.0.14",
"vue-types": "^4.1.1",
"showdown": "^2.1.0",
"sortablejs": "^1.15.0",
"tinymce": "^5.10.7",
"vditor": "^3.9.1",
"vue": "^3.2.47",
"vue-i18n": "^9.2.2",
"vue-json-pretty": "^2.2.4",
"vue-router": "^4.1.6",
"vue-types": "^5.0.2",
"vuedraggable": "^4.1.0",
"vxe-table": "^4.3.11",
"vxe-table-plugin-export-xlsx": "^3.0.4",
"xe-utils": "^3.5.7",
"xlsx": "^0.18.5"
},
"devDependencies": {
"@commitlint/cli": "^13.1.0",
"@commitlint/config-conventional": "^13.1.0",
"@iconify/json": "^1.1.401",
"@purge-icons/generated": "^0.7.0",
"@rollup/plugin-alias": "^3.1.1",
"@rollup/plugin-commonjs": "^15.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@types/codemirror": "^5.60.2",
"@types/crypto-js": "^4.0.2",
"@types/fs-extra": "^9.0.12",
"@types/inquirer": "^8.1.1",
"@types/intro.js": "^3.0.2",
"@types/jest": "^27.0.1",
"@types/lodash-es": "^4.17.5",
"@types/mockjs": "^1.0.4",
"@types/node": "^16.9.1",
"@commitlint/cli": "^17.5.1",
"@commitlint/config-conventional": "^17.4.4",
"@iconify/json": "^2.2.46",
"@purge-icons/generated": "^0.9.0",
"@types/codemirror": "^5.60.7",
"@types/crypto-js": "^4.1.1",
"@types/intro.js": "^5.1.1",
"@types/lodash-es": "^4.17.7",
"@types/mockjs": "^1.0.7",
"@types/nprogress": "^0.2.0",
"@types/qrcode": "^1.4.1",
"@types/qrcode": "^1.5.0",
"@types/qs": "^6.9.7",
"@types/showdown": "^1.9.4",
"@types/sortablejs": "^1.10.7",
"@typescript-eslint/eslint-plugin": "^4.31.0",
"@typescript-eslint/parser": "^4.31.0",
"@vitejs/plugin-legacy": "^1.5.3",
"@vitejs/plugin-vue": "^1.6.2",
"@vitejs/plugin-vue-jsx": "^1.1.8",
"@vue/compiler-sfc": "3.2.11",
"@vue/test-utils": "^2.0.0-rc.14",
"autoprefixer": "^10.3.4",
"commitizen": "^4.2.4",
"conventional-changelog-cli": "^2.1.1",
"@types/showdown": "^2.0.0",
"@types/sortablejs": "^1.15.1",
"@vben/eslint-config": "workspace:*",
"@vben/stylelint-config": "workspace:*",
"@vben/ts-config": "workspace:*",
"@vben/types": "workspace:*",
"@vben/vite-config": "workspace:*",
"@vue/compiler-sfc": "^3.2.47",
"@vue/test-utils": "^2.3.2",
"cross-env": "^7.0.3",
"dotenv": "^10.0.0",
"electron": "^18.0.0",
"electron-builder": "^22.8.0",
"electron-connect": "^0.6.3",
"electron-contextmenu-middleware": "^1.0.3",
"electron-input-menu": "^2.1.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-define-config": "^1.0.9",
"eslint-plugin-jest": "^24.4.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-vue": "^7.17.0",
"esno": "^0.9.1",
"fs-extra": "^10.0.0",
"http-server": "^13.0.1",
"husky": "^7.0.2",
"inquirer": "^8.1.2",
"is-ci": "^3.0.0",
"jest": "^27.2.0",
"less": "^4.1.1",
"lint-staged": "12.3.7",
"npm-run-all": "^4.1.5",
"picocolors": "^1.0.0",
"postcss": "^8.3.6",
"postcss-html": "^1.3.0",
"postcss-less": "^6.0.0",
"prettier": "^2.4.0",
"pretty-quick": "^3.1.1",
"rimraf": "^3.0.2",
"rollup-plugin-esbuild": "^3.0.2",
"rollup-plugin-visualizer": "5.5.2",
"stylelint": "^13.13.1",
"stylelint-config-prettier": "^8.0.2",
"stylelint-config-standard": "^22.0.0",
"stylelint-order": "^4.1.0",
"ts-jest": "^27.0.5",
"ts-node": "^10.2.1",
"typescript": "4.4.3",
"vite": "^2.9.1",
"vite-plugin-compression": "^0.3.5",
"vite-plugin-html": "^3.2.0",
"vite-plugin-imagemin": "^0.4.5",
"vite-plugin-mkcert": "^1.6.0",
"cz-git": "^1.6.1",
"czg": "^1.6.1",
"husky": "^8.0.3",
"lint-staged": "13.2.0",
"prettier": "^2.8.7",
"prettier-plugin-packagejson": "^2.4.3",
"rimraf": "^4.4.1",
"turbo": "^1.8.8",
"typescript": "^5.0.3",
"unbuild": "^1.2.0",
"unplugin-vue-define-options": "^1.3.3",
"vite": "^4.3.0-beta.2",
"vite-plugin-mock": "^2.9.6",
"vite-plugin-purge-icons": "^0.7.0",
"vite-plugin-pwa": "^0.11.2",
"vite-plugin-style-import": "^2.0.0",
"vite-plugin-svg-icons": "^2.0.1",
"vite-plugin-theme": "^0.8.1",
"wait-on": "^5.2.1",
"vite-plugin-vue-setup-extend": "^0.1.0",
"vite-plugin-windicss": "^1.4.2",
"vue-eslint-parser": "^7.11.0",
"vue-tsc": "^0.3.0"
"vue-tsc": "^1.2.0"
},
"resolutions": {
"bin-wrapper": "npm:bin-wrapper-china",
"rollup": "^2.56.3",
"gifsicle": "5.2.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/anncwb/vue-vben-admin.git"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/anncwb/vue-vben-admin/issues"
},
"homepage": "https://github.com/anncwb/vue-vben-admin",
"packageManager": "pnpm@8.1.0",
"engines": {
"node": "^12 || >=14"
"node": ">=16.15.1",
"pnpm": ">=8.1.0"
}
}

0
packages/.gitkeep Normal file
View File

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