Skip to content

Commit 9d3dc3c

Browse files
author
shisan
committed
chore: merge branch 'main' of github.com:anncwb/vue-vben-admin into main
2 parents 2a790d2 + 2aa5e5d commit 9d3dc3c

File tree

173 files changed

+2416
-1394
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+2416
-1394
lines changed

.vscode/launch.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
"url": "http://localhost:3100",
99
"webRoot": "${workspaceFolder}/src",
1010
"sourceMaps": true
11-
},
11+
}
1212
]
1313
}

CHANGELOG.en_US.md

+28
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
## 2.7.2(2021-09-14)
2+
3+
### ✨ Features
4+
5+
- **BasicForm** New `Divider` in the form component for dividing the area of longer forms
6+
- **BasicTable**
7+
- Cell editor adds submit callback, which will decide whether to submit data to the form based on the result returned by the callback function
8+
- Add check method for row editing, allowing only check but not submit value, so asynchronously save data successfully before submit to table
9+
- Fix the problem that the `rowClassName` property cannot be used at the same time as `striped`.
10+
- New component **MarkdownViewer** for displaying rich text in Markdown format
11+
12+
### 🐛 Bug Fixes
13+
14+
- **CodeEditor** Fix JSON editor throwing exception when formatting invalid JSON text
15+
- **Tinymce** fixes an issue where inline mode throws an exception in some scenarios
16+
- **BasicTable**
17+
- Repair the problem that the editing icon is not displayed when the content of editable cell is empty
18+
- Repair the problem that the total row at the end of the table sometimes fails to align with the columns in the main part of the table.
19+
- **MarkDown** Repair the problem that the value of initial value property does not work.
20+
- **BasicUpload** Repair the problem that `accept` property does not support `MIME` and suffix name starting with dot.
21+
- **ApiSelect** Fix the problem of type definition of `value` property.
22+
- **Other**
23+
- Repair the problem that some wrapper components give error when using slots.
24+
- Repair the problem that `theme` parameter of `useECharts` does not work.
25+
- Repair the problem that when `Token` is invalid, pressing F5 to refresh the page may cause abnormal page loading.
26+
- Repair the problem that the improper call of `useRedo` may lead to `path` redirection abnormality.
27+
- Repair the problem that `vite` custom mode name does not support underscore.
28+
129
## 2.7.1(2021-08-16)
230

331
- Upgrade vue 3.2, if the operation fails, delete node_modules and reinstall it

CHANGELOG.md

+54
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,57 @@
1+
## [2.7.2](https://github.com/anncwb/vue-vben-admin/compare/v2.7.1...v2.7.2) (2021-09-13)
2+
3+
### Bug Fixes
4+
5+
- fixed token clear error ([9640484](https://github.com/anncwb/vue-vben-admin/commit/96404848955f84d57b88dd240ab3a57b7017103c))
6+
- improve type introduction, fix [#1196](https://github.com/anncwb/vue-vben-admin/issues/1196) ([2820d5a](https://github.com/anncwb/vue-vben-admin/commit/2820d5a627260bb8eddfcd25df1cd7d1196932e8))
7+
- **api-select:** fixed `value` prop define ([f87b0f2](https://github.com/anncwb/vue-vben-admin/commit/f87b0f2f5efe4e9977c4cc0742dbcaefbad2ca02)), closes [#1175](https://github.com/anncwb/vue-vben-admin/issues/1175)
8+
- **card-list:** fixed build error ([628e820](https://github.com/anncwb/vue-vben-admin/commit/628e820684ce5d81f130548505efe83e8d516131))
9+
- **code-editor:** fixed formatting error ([e7c9636](https://github.com/anncwb/vue-vben-admin/commit/e7c96363a1963b7733a9ee498403eb6a062160e6))
10+
- **echarts:** theme setting supported ([93812f7](https://github.com/anncwb/vue-vben-admin/commit/93812f734ec85529aa27fc3100a2eaef8c7a6df5)), closes [#1095](https://github.com/anncwb/vue-vben-admin/issues/1095)
11+
- **markdown:** the hierarchy of markDown components after full screen ([c8017b1](https://github.com/anncwb/vue-vben-admin/commit/c8017b1365ea49f95a26148a539f8c30d8a8631f))
12+
- **markdown:** `value` not worked on init ([0bb9c03](https://github.com/anncwb/vue-vben-admin/commit/0bb9c035f77588c58d36b3fd45d89b9730cd70d7))
13+
- **modal:** avoid style pollution to the whole world ([#1128](https://github.com/anncwb/vue-vben-admin/issues/1128)) ([6e7f6f8](https://github.com/anncwb/vue-vben-admin/commit/6e7f6f82ed2819e02e2b3114884e665d0762d7e9))
14+
- **table:** `rowClassName` not worked with `striped` ([044e2e4](https://github.com/anncwb/vue-vben-admin/commit/044e2e4e866dd5b120daab03c47aba1ca1f9140a)), closes [#1167](https://github.com/anncwb/vue-vben-admin/issues/1167)
15+
- **table:** 修复表格背景颜色再深色模式下会被穿透问题 ([#1133](https://github.com/anncwb/vue-vben-admin/issues/1133)) ([30fa4cf](https://github.com/anncwb/vue-vben-admin/commit/30fa4cfa2ab6229efc67224fd082e32da0a95d49))
16+
- **table:** editable icon not show with empty cell ([edc3096](https://github.com/anncwb/vue-vben-admin/commit/edc30965653831b4572c5d5e067f556f4757ce75)), closes [#1103](https://github.com/anncwb/vue-vben-admin/issues/1103)
17+
- **table:** fix table footer style ([a426b90](https://github.com/anncwb/vue-vben-admin/commit/a426b9027ef524f9033d510d0c74cd17b2ad5bcf)), closes [#1112](https://github.com/anncwb/vue-vben-admin/issues/1112)
18+
- **table:** Solve the bug of setting ifshow to false in table column ([#1166](https://github.com/anncwb/vue-vben-admin/issues/1166)) ([5fa730c](https://github.com/anncwb/vue-vben-admin/commit/5fa730c49ae46fa448d49d597dc7b2b6a019b268))
19+
- **table-action:** `divider` not work as expected ([7593ef6](https://github.com/anncwb/vue-vben-admin/commit/7593ef6a4f081ed800658b70316ab2f1e3ee631d))
20+
- **tinymce:** fixed `inline` mode ([8e01377](https://github.com/anncwb/vue-vben-admin/commit/8e01377481a34cda221de6bbb01fc7d5b2824c82)), closes [#1092](https://github.com/anncwb/vue-vben-admin/issues/1092)
21+
- **upload:** `accept` not work as expected ([656ee4e](https://github.com/anncwb/vue-vben-admin/commit/656ee4e5c9b363b6ab59aa071915414e5ee95de4))
22+
- `getUserinfo` is compatible with empty roles data ([1ddfc31](https://github.com/anncwb/vue-vben-admin/commit/1ddfc31c3c4c792c5f741f6d0f0754ffc9a6613c))
23+
- `slots` worked in `basicTable` and `basicModal` ([5138e44](https://github.com/anncwb/vue-vben-admin/commit/5138e447e74ef01309457d22f44129c8b1b2f815))
24+
- `useRedo` called duplicate may cause exception ([1235978](https://github.com/anncwb/vue-vben-admin/commit/1235978ab23740dfb11e3de7ac26a7d10a4899dc)), closes [#1121](https://github.com/anncwb/vue-vben-admin/issues/1121)
25+
- 修复 `apiSelect` 绑定值 `attrs` 的问题 ([#1172](https://github.com/anncwb/vue-vben-admin/issues/1172)) ([c753d94](https://github.com/anncwb/vue-vben-admin/commit/c753d945e08f72cab5bc8a585601cab6a0523fca))
26+
- 修复弹窗全屏按钮异常关闭的问题([#1177](https://github.com/anncwb/vue-vben-admin/issues/1177)) ([#1182](https://github.com/anncwb/vue-vben-admin/issues/1182)) ([9e9ea3f](https://github.com/anncwb/vue-vben-admin/commit/9e9ea3f43d8c4b88649c1998bf89186b5f7ee6a2))
27+
- 修改 axios 中 urlPrefix 字段不生效问题 ([#1170](https://github.com/anncwb/vue-vben-admin/issues/1170)) ([7df9b51](https://github.com/anncwb/vue-vben-admin/commit/7df9b513447d8deab2fd8e86fa23c807adb6d440))
28+
- add loss action for userStore ([a36825a](https://github.com/anncwb/vue-vben-admin/commit/a36825a6d423aae9aaf1936ce55947ba8c2104b0))
29+
- fix all types of errors, compatible with volar plugin ([e15b4f1](https://github.com/anncwb/vue-vben-admin/commit/e15b4f14db51812effd55670b3d2da7b082e00a7))
30+
- fixed build warning for style of `intro.js` ([d27633f](https://github.com/anncwb/vue-vben-admin/commit/d27633fb31824e92cbeb24f8d626d8e33ce7179e)), closes [#1130](https://github.com/anncwb/vue-vben-admin/issues/1130)
31+
- Improve content height calculation ([#1136](https://github.com/anncwb/vue-vben-admin/issues/1136)) ([6717fe6](https://github.com/anncwb/vue-vben-admin/commit/6717fe654e88e6a939a16c523832870388ec1886))
32+
- name of vite `mode` support more characters ([9f68229](https://github.com/anncwb/vue-vben-admin/commit/9f6822991c4b2da78e0a5d0c7d6e0288f0d9d1cb)), closes [#1115](https://github.com/anncwb/vue-vben-admin/issues/1115)
33+
- refresh failed while token invalid ([3a5d1a5](https://github.com/anncwb/vue-vben-admin/commit/3a5d1a5757c0a2be17e6dd370cbb023ddbb30d5e)), closes [#1101](https://github.com/anncwb/vue-vben-admin/issues/1101)
34+
- warning in logout action ([b3307fe](https://github.com/anncwb/vue-vben-admin/commit/b3307fe2836fb6f9806d602d5bdb7e540c49f1b0))
35+
- **tinymce:** fixed `tinymce` destory method ([fb43fad](https://github.com/anncwb/vue-vben-admin/commit/fb43fad555b093af23194bdb3670bc1347c0010f))
36+
37+
### Features
38+
39+
- **demo:** add `JsonPreview` demo ([83c1683](https://github.com/anncwb/vue-vben-admin/commit/83c1683bfdcf4ea33de771895b46e41f276969e8)), closes [#1146](https://github.com/anncwb/vue-vben-admin/issues/1146)
40+
- **form:** add `Divider` for schema component type ([47a448b](https://github.com/anncwb/vue-vben-admin/commit/47a448b8aea572e54dac97dc4f9fb6c1c005685a))
41+
- **form:** component `Divider` support `helpMessage` ([a5ff592](https://github.com/anncwb/vue-vben-admin/commit/a5ff59237f2eb6ea4c1770acc594c75bf1f6e95f))
42+
- **markdown-viewer:** add new component ([73dc492](https://github.com/anncwb/vue-vben-admin/commit/73dc492b2a49793d945ccdae7f5c429c874f298c)), closes [#1181](https://github.com/anncwb/vue-vben-admin/issues/1181)
43+
- **table:** 添加和支持动态删除和插入数据 ([#1152](https://github.com/anncwb/vue-vben-admin/issues/1152)) ([59a9087](https://github.com/anncwb/vue-vben-admin/commit/59a90877287a289f746eec97d12c2d3a1d5476b0))
44+
- **table:** add `beforeEditSubmit` for editable cell ([2c867b3](https://github.com/anncwb/vue-vben-admin/commit/2c867b3d636d57cdc526a4ca600af7d747b7d833))
45+
- **table:** add `onValid` for editRow ([ee7c31d](https://github.com/anncwb/vue-vben-admin/commit/ee7c31db44fd8f99f0d26da368e1d82b5630f309))
46+
- **tree:** 1. 添加自定义数据过滤判断方法 2. 添加搜索完成自动展开结果选项 3. 添加搜索完成自动选中结果选项 4. 树节点数据变化时强制搜索(同步 searchData 避免展示错误) ([#1132](https://github.com/anncwb/vue-vben-admin/issues/1132)) ([e00578c](https://github.com/anncwb/vue-vben-admin/commit/e00578c40a585a4a35f235c0228aebaf62cea1ba))
47+
- add CardList component ([0f5ddbf](https://github.com/anncwb/vue-vben-admin/commit/0f5ddbf1ec777fc238a94bd037d37ea787316757))
48+
49+
### Performance Improvements
50+
51+
- **tree:** 优化 Tree 搜索功能,添加搜索高亮功能,优化样式表现 ([#1153](https://github.com/anncwb/vue-vben-admin/issues/1153)) ([3b6b4f7](https://github.com/anncwb/vue-vben-admin/commit/3b6b4f73033e8757fd3a032f0910dfcc30dee151))
52+
- not waiting for router.isReady ([2884e86](https://github.com/anncwb/vue-vben-admin/commit/2884e863ce826cd92cd782f40cdee31588bc6d32))
53+
- optimize css volume ([466d4ed](https://github.com/anncwb/vue-vben-admin/commit/466d4edcd02fc91e2b4cdbbc3c501bfd2fde7a3d))
54+
155
## [2.7.1](https://github.com/anncwb/vue-vben-admin/compare/v2.6.1...v2.7.1) (2021-08-16)
256

357
### Bug Fixes

CHANGELOG.zh_CN.md

+28
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
## 2.7.2(2021-09-14)
2+
3+
### ✨ Features
4+
5+
- **BasicForm** 表单组件新增`Divider`,用于较长表单的区域分割
6+
- **BasicTable**
7+
- 单元格编辑新增提交回调,将根据回调函数返回的结果来决定是否将数据提交到表格
8+
- 行编辑添加校验方法,允许只校验而不提交值,以便异步保存数据成功后才提交倒表格
9+
- 修复`rowClassName`属性无法和`striped`同时使用的问题
10+
- 新增组件 **MarkdownViewer** 用于显示 Markdown 格式的富文本
11+
12+
### 🐛 Bug Fixes
13+
14+
- **CodeEditor** 修复 JSON 编辑器在格式化无效 JSON 文本时会抛出异常的问题
15+
- **Tinymce** 修复 inline 模式在一些场景下会出现异常的问题
16+
- **BasicTable**
17+
- 修复可编辑单元格的内容为空时,不会显示编辑图标的问题
18+
- 修复表尾合计行与表格主体部分的列有时候未能对齐的问题
19+
- **MarkDown** 修复初始 value 属性的值不起作用的问题
20+
- **BasicUpload** 修复`accept`属性不支持`MIME`及点开头的后缀名的问题
21+
- **ApiSelect** 修复`value`属性的类型定义问题
22+
- **其它**
23+
- 修复部分封装组件在使用插槽时报错的问题
24+
- 修复`useECharts``theme`参数不起作用的问题
25+
- 修复`Token`失效时,按 F5 刷新页面可能会出现页面加载异常的问题
26+
- 修复`useRedo`的不当调用可能会导致重定向`path`异常的问题
27+
- 修复`vite`自定义模式名称不支持下划线的问题
28+
129
## 2.7.1(2021-08-16)
230

331
- 升级 vue 3.2,如果运行失败,删除 node_modules 后重装即可

README.zh-CN.md

+1
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ yarn build
150150
## 后台整合示例
151151

152152
- [lamp-cloud](https://github.com/zuihou/lamp-cloud) - 基于 SpringCloud Alibaba 的微服务中后台快速开发平台
153+
- [matecloud](https://github.com/matevip/matecloud) - MateCloud 微服务脚手架,基于 Spring Cloud 2020.0.3、SpringBoot 2.5.3 的全开源平台
153154

154155
## 维护者
155156

build/generate/icon/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,19 @@ async function generateIcon() {
5252
const { prefix } = data;
5353
const isLocal = useType === 'local';
5454
const icons = Object.keys(data.icons).map(
55-
(item) => `${isLocal ? prefix + ':' : ''}${item}`
55+
(item) => `${isLocal ? prefix + ':' : ''}${item}`,
5656
);
5757

5858
await fs.writeFileSync(
5959
path.join(output, `icons.data.ts`),
60-
`export default ${isLocal ? JSON.stringify(icons) : JSON.stringify({ prefix, icons })}`
60+
`export default ${isLocal ? JSON.stringify(icons) : JSON.stringify({ prefix, icons })}`,
6161
);
6262
prefixSet.push(prefix);
6363
}
6464
}
6565
fs.emptyDir(path.join(process.cwd(), 'node_modules/.vite'));
6666
console.log(
67-
`✨ ${chalk.cyan(`[${pkg.name}]`)}` + ' - Icon generated successfully:' + `[${prefixSet}]`
67+
`✨ ${chalk.cyan(`[${pkg.name}]`)}` + ' - Icon generated successfully:' + `[${prefixSet}]`,
6868
);
6969
});
7070
}

build/script/buildConf.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function createConfig(
1515
configName,
1616
config,
1717
configFileName = GLOB_CONFIG_FILE_NAME,
18-
}: { configName: string; config: any; configFileName?: string } = { configName: '', config: {} }
18+
}: { configName: string; config: any; configFileName?: string } = { configName: '', config: {} },
1919
) {
2020
try {
2121
const windowConf = `window.${configName}`;

build/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export function wrapperEnv(envConf: Recordable): ViteEnv {
5050
*/
5151
function getConfFiles() {
5252
const script = process.env.npm_lifecycle_script;
53-
const reg = new RegExp('--mode ([a-z]+)');
53+
const reg = new RegExp('--mode ([a-z_\\d]+)');
5454
const result = reg.exec(script as string) as any;
5555
if (result) {
5656
const mode = result[1] as string;

build/vite/plugin/compress.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
* https://github.com/anncwb/vite-plugin-compression
44
*/
55
import type { Plugin } from 'vite';
6-
76
import compressPlugin from 'vite-plugin-compression';
87

98
export function configCompressPlugin(
109
compress: 'gzip' | 'brotli' | 'none',
11-
deleteOriginFile = false
10+
deleteOriginFile = false,
1211
): Plugin | Plugin[] {
1312
const compressList = compress.split(',');
1413

@@ -19,16 +18,17 @@ export function configCompressPlugin(
1918
compressPlugin({
2019
ext: '.gz',
2120
deleteOriginFile,
22-
})
21+
}),
2322
);
2423
}
24+
2525
if (compressList.includes('brotli')) {
2626
plugins.push(
2727
compressPlugin({
2828
ext: '.br',
2929
algorithm: 'brotliCompress',
3030
deleteOriginFile,
31-
})
31+
}),
3232
);
3333
}
3434
return plugins;

build/vite/plugin/html.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
* https://github.com/anncwb/vite-plugin-html
44
*/
55
import type { Plugin } from 'vite';
6-
76
import html from 'vite-plugin-html';
8-
97
import pkg from '../../../package.json';
108
import { GLOB_CONFIG_FILE_NAME } from '../../constant';
119

@@ -22,7 +20,7 @@ export function configHtmlPlugin(env: ViteEnv, isBuild: boolean) {
2220
minify: isBuild,
2321
inject: {
2422
// Inject data into ejs template
25-
injectData: {
23+
data: {
2624
title: VITE_GLOB_APP_TITLE,
2725
},
2826
// Embed the generated app.config.js file

build/vite/plugin/imagemin.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Image resource files used to compress the output of the production environment
22
// https://github.com/anncwb/vite-plugin-imagemin
3-
43
import viteImagemin from 'vite-plugin-imagemin';
54

65
export function configImageminPlugin() {

build/vite/plugin/index.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import type { Plugin } from 'vite';
2-
32
import vue from '@vitejs/plugin-vue';
43
import vueJsx from '@vitejs/plugin-vue-jsx';
54
import legacy from '@vitejs/plugin-legacy';
6-
75
import purgeIcons from 'vite-plugin-purge-icons';
86
import windiCSS from 'vite-plugin-windicss';
7+
import vueSetupExtend from 'vite-plugin-vue-setup-extend';
98
import { configHtmlPlugin } from './html';
109
import { configPwaConfig } from './pwa';
1110
import { configMockPlugin } from './mock';
@@ -31,6 +30,8 @@ export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) {
3130
vue(),
3231
// have to
3332
vueJsx(),
33+
// support name
34+
vueSetupExtend(),
3435
];
3536

3637
// vite-plugin-windicss
@@ -70,7 +71,7 @@ export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) {
7071

7172
// rollup-plugin-gzip
7273
vitePlugins.push(
73-
configCompressPlugin(VITE_BUILD_COMPRESS, VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE)
74+
configCompressPlugin(VITE_BUILD_COMPRESS, VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE),
7475
);
7576

7677
// vite-plugin-pwa

build/vite/plugin/pwa.ts

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* Zero-config PWA for Vite
33
* https://github.com/antfu/vite-plugin-pwa
44
*/
5-
65
import { VitePWA } from 'vite-plugin-pwa';
76

87
export function configPwaConfig(env: ViteEnv) {

build/vite/plugin/styleImport.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
* Introduces component library styles on demand.
33
* https://github.com/anncwb/vite-plugin-style-import
44
*/
5-
65
import styleImport from 'vite-plugin-style-import';
76

87
export function configStyleImportPlugin(isBuild: boolean) {
9-
if (!isBuild) return [];
8+
if (!isBuild) {
9+
return [];
10+
}
1011
const styleImportPlugin = styleImport({
1112
libs: [
1213
{

build/vite/plugin/theme.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export function configThemePlugin(isBuild: boolean): Plugin[] {
6666
'border-color-base': '#303030',
6767
// 'border-color-split': '#30363d',
6868
'item-active-bg': '#111b26',
69-
'app-content-background': 'rgb(255 255 255 / 4%)',
69+
'app-content-background': '#1e1e1e',
7070
'tree-node-selected-bg': '#11263c',
7171

7272
'alert-success-border-color': '#274916',

mock/_util.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export function resultPageSuccess<T = any>(
1313
page: number,
1414
pageSize: number,
1515
list: T[],
16-
{ message = 'ok' } = {}
16+
{ message = 'ok' } = {},
1717
) {
1818
const pageData = pagination(page, pageSize, list);
1919

mock/sys/user.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default [
5252
response: ({ body }) => {
5353
const { username, password } = body;
5454
const checkUser = createFakeUserList().find(
55-
(item) => item.username === username && password === item.password
55+
(item) => item.username === username && password === item.password,
5656
);
5757
if (!checkUser) {
5858
return resultError('Incorrect account or password!');

0 commit comments

Comments
 (0)