Skip to content

Commit

Permalink
chore: merge branch 'main' of github.com:anncwb/vue-vben-admin into main
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb committed Oct 20, 2021
2 parents 9d3dc3c + a0165d1 commit 8efcba4
Show file tree
Hide file tree
Showing 63 changed files with 5,292 additions and 4,905 deletions.
27 changes: 27 additions & 0 deletions CHANGELOG.zh_CN.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
### ✨ Features

- **其它**
- `.env`文件中的`VITE_PROXY`配置支持单引号
- 移除 build 过程中的警告

### 🐛 Bug Fixes

- **BasicTable**
- 修复可编辑单元格某些情况下无法提交的问题
- 修复`inset`属性不起作用的问题
- 修复`useTable``BasicTable`实例的`reload`方法`await`表现不一致的问题
- 修复`clickToRowSelect`会无视行选择框 disabled 状态的问题
- 修复`BasicTable`在某些情况下,分页会被重置的问题
- 修改 `deleteTableDataRecord` 方法
- **BasicModal**
- 修复点击遮罩、按下`Esc`键都不能关闭`Modal`的问题
- 修复点击关闭按钮、最大化按钮旁边的空白区域也会导致`Modal`关闭的问题
- **BasicTree** 修复节点插槽不起作用的问题
- **CodeEditor** 修复可能会造成的`Build`失败的问题
- **BasicForm** 修复自定义 FormItem 组件的内容宽度可能超出范围的问题
- **ApiTreeSelect** 修复`params`变化未能触发重新请求 api 数据的问题
- **其它**
- 修复多标签在某些情况下关闭页签不会跳转路由的问题
- 修复部分组件可能会造成热更新异常的问题
- 修复直接`import`部分`antdv`子组件时会在 build 过程中报错的问题,如:TabPane、RadioGroup

## 2.7.2(2021-09-14)

### ✨ Features
Expand Down
19 changes: 10 additions & 9 deletions build/script/buildConf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@ import { GLOB_CONFIG_FILE_NAME, OUTPUT_DIR } from '../constant';
import fs, { writeFileSync } from 'fs-extra';
import chalk from 'chalk';

import { getRootPath, getEnvConfig } from '../utils';
import { getEnvConfig, getRootPath } from '../utils';
import { getConfigFileName } from '../getConfigFileName';

import pkg from '../../package.json';

function createConfig(
{
configName,
config,
configFileName = GLOB_CONFIG_FILE_NAME,
}: { configName: string; config: any; configFileName?: string } = { configName: '', config: {} },
) {
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
Expand All @@ -40,5 +41,5 @@ function createConfig(
export function runBuildConfig() {
const config = getEnvConfig();
const configFileName = getConfigFileName(config);
createConfig({ config, configName: configFileName });
createConfig({ config, configName: configFileName, configFileName: GLOB_CONFIG_FILE_NAME });
}
4 changes: 2 additions & 2 deletions build/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ export function wrapperEnv(envConf: Recordable): ViteEnv {
if (envName === 'VITE_PORT') {
realName = Number(realName);
}
if (envName === 'VITE_PROXY') {
if (envName === 'VITE_PROXY' && realName) {
try {
realName = JSON.parse(realName);
realName = JSON.parse(realName.replace(/'/g, '"'));
} catch (error) {
realName = '';
}
Expand Down
47 changes: 46 additions & 1 deletion build/vite/plugin/styleImport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,52 @@ export function configStyleImportPlugin(isBuild: boolean) {
libraryName: 'ant-design-vue',
esModule: true,
resolveStyle: (name) => {
return `ant-design-vue/es/${name}/style/index`;
// 这里是“子组件”列表,无需额外引入样式文件
const ignoreList = [
'typography-text',
'typography-title',
'typography-paragraph',
'typography-link',
'anchor-link',
'sub-menu',
'menu-item',
'menu-item-group',
'dropdown-button',
'breadcrumb-item',
'breadcrumb-separator',
'input-password',
'input-search',
'input-group',
'form-item',
'radio-group',
'checkbox-group',
'layout-sider',
'layout-content',
'layout-footer',
'layout-header',
'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',
];
return ignoreList.includes(name) ? '' : `ant-design-vue/es/${name}/style/index`;
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion build/vite/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type ProxyItem = [string, string];

type ProxyList = ProxyItem[];

type ProxyTargetList = Record<string, ProxyOptions & { rewrite: (path: string) => string }>;
type ProxyTargetList = Record<string, ProxyOptions>;

const httpsRE = /^https:\/\//;

Expand Down
9 changes: 9 additions & 0 deletions mock/demo/account.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { MockMethod } from 'vite-plugin-mock';
import { resultSuccess, resultError } from '../_util';
import { ResultEnum } from '../../src/enums/httpEnum';

const userInfo = {
name: 'Vben',
Expand Down Expand Up @@ -59,4 +60,12 @@ export default [
return resultError();
},
},
{
url: '/basic-api/user/tokenExpired',
method: 'post',
statusCode: 200,
response: () => {
return resultError('Token Expired!', { code: ResultEnum.TIMEOUT as number });
},
},
] as MockMethod[];
8 changes: 4 additions & 4 deletions mock/demo/select-demo.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { MockMethod } from 'vite-plugin-mock';
import { resultSuccess } from '../_util';

const demoList = (keyword) => {
const demoList = (keyword, count = 20) => {
const result = {
list: [] as any[],
};
for (let index = 0; index < 20; index++) {
for (let index = 0; index < count; index++) {
result.list.push({
name: `${keyword ?? ''}选项${index}`,
id: `${index}`,
Expand All @@ -20,9 +20,9 @@ export default [
timeout: 1000,
method: 'get',
response: ({ query }) => {
const { keyword } = query;
const { keyword, count } = query;
console.log(keyword);
return resultSuccess(demoList(keyword));
return resultSuccess(demoList(keyword, count));
},
},
] as MockMethod[];
2 changes: 1 addition & 1 deletion mock/demo/table-demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function getRandomPics(count = 10): string[] {

const demoList = (() => {
const result: any[] = [];
for (let index = 0; index < 60; index++) {
for (let index = 0; index < 200; index++) {
result.push({
id: `${index}`,
beginTime: '@datetime',
Expand Down
102 changes: 52 additions & 50 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,98 +35,100 @@
},
"dependencies": {
"@iconify/iconify": "^2.0.4",
"@vueuse/core": "^6.3.3",
"@vueuse/core": "^6.6.2",
"@zxcvbn-ts/core": "^1.0.0-beta.0",
"ant-design-vue": "2.2.7",
"axios": "^0.21.4",
"ant-design-vue": "2.2.8",
"axios": "^0.23.0",
"crypto-js": "^4.1.1",
"echarts": "^5.2.0",
"echarts": "^5.2.1",
"lodash-es": "^4.17.21",
"mockjs": "^1.1.0",
"nprogress": "^0.2.0",
"path-to-regexp": "^6.2.0",
"pinia": "2.0.0-rc.9",
"pinia": "2.0.0-rc.14",
"print-js": "^1.6.0",
"qrcode": "^1.4.4",
"resize-observer-polyfill": "^1.5.1",
"sortablejs": "^1.14.0",
"vue": "3.2.11",
"vue-i18n": "9.1.7",
"vue-router": "^4.0.11",
"vue-types": "^4.1.0"
"vue": "^3.2.20",
"vue-i18n": "^9.1.9",
"vue-json-pretty": "^2.0.4",
"vue-router": "^4.0.12",
"vue-types": "^4.1.1"
},
"devDependencies": {
"@commitlint/cli": "^13.1.0",
"@commitlint/config-conventional": "^13.1.0",
"@iconify/json": "^1.1.401",
"@commitlint/cli": "^13.2.1",
"@commitlint/config-conventional": "^13.2.0",
"@iconify/json": "^1.1.416",
"@purge-icons/generated": "^0.7.0",
"@types/codemirror": "^5.60.2",
"@types/codemirror": "^5.60.5",
"@types/crypto-js": "^4.0.2",
"@types/fs-extra": "^9.0.12",
"@types/inquirer": "^8.1.1",
"@types/fs-extra": "^9.0.13",
"@types/inquirer": "^8.1.3",
"@types/intro.js": "^3.0.2",
"@types/jest": "^27.0.1",
"@types/jest": "^27.0.2",
"@types/lodash-es": "^4.17.5",
"@types/mockjs": "^1.0.4",
"@types/node": "^16.9.1",
"@types/node": "^16.11.1",
"@types/nprogress": "^0.2.0",
"@types/qrcode": "^1.4.1",
"@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",
"@typescript-eslint/eslint-plugin": "^5.1.0",
"@typescript-eslint/parser": "^5.1.0",
"@vitejs/plugin-legacy": "^1.6.2",
"@vitejs/plugin-vue": "^1.9.3",
"@vitejs/plugin-vue-jsx": "^1.2.0",
"@vue/compiler-sfc": "3.2.20",
"@vue/test-utils": "^2.0.0-rc.16",
"autoprefixer": "^10.3.7",
"commitizen": "^4.2.4",
"conventional-changelog-cli": "^2.1.1",
"cross-env": "^7.0.3",
"dotenv": "^10.0.0",
"eslint": "^7.32.0",
"eslint": "^8.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-define-config": "^1.0.9",
"eslint-plugin-jest": "^24.4.0",
"eslint-define-config": "^1.1.1",
"eslint-plugin-jest": "^25.2.2",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-vue": "^7.17.0",
"esno": "^0.9.1",
"eslint-plugin-vue": "^7.19.1",
"esno": "^0.10.1",
"fs-extra": "^10.0.0",
"http-server": "^13.0.1",
"http-server": "^14.0.0",
"husky": "^7.0.2",
"inquirer": "^8.1.2",
"inquirer": "^8.2.0",
"is-ci": "^3.0.0",
"jest": "^27.2.0",
"less": "^4.1.1",
"lint-staged": "^11.1.2",
"jest": "^27.3.1",
"less": "^4.1.2",
"lint-staged": "^11.2.3",
"npm-run-all": "^4.1.5",
"postcss": "^8.3.6",
"prettier": "^2.4.0",
"postcss": "^8.3.9",
"prettier": "^2.4.1",
"pretty-quick": "^3.1.1",
"rimraf": "^3.0.2",
"rollup-plugin-visualizer": "5.5.2",
"rollup-plugin-visualizer": "^5.5.2",
"stylelint": "^13.13.1",
"stylelint-config-prettier": "^8.0.2",
"stylelint-config-prettier": "^9.0.3",
"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.5.7",
"ts-jest": "^27.0.7",
"ts-node": "^10.3.0",
"typescript": "^4.4.4",
"vite": "^2.6.10",
"vite-plugin-compression": "^0.3.5",
"vite-plugin-html": "^2.1.0",
"vite-plugin-imagemin": "^0.4.5",
"vite-plugin-html": "^2.1.1",
"vite-plugin-imagemin": "^0.4.6",
"vite-plugin-mock": "^2.9.6",
"vite-plugin-purge-icons": "^0.7.0",
"vite-plugin-pwa": "^0.11.2",
"vite-plugin-pwa": "^0.11.3",
"vite-plugin-style-import": "^1.2.1",
"vite-plugin-svg-icons": "^1.0.4",
"vite-plugin-svg-icons": "^1.0.5",
"vite-plugin-theme": "^0.8.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"
"vite-plugin-windicss": "^1.4.12",
"vue-eslint-parser": "^8.0.0",
"vue-tsc": "^0.28.7"
},
"resolutions": {
"//": "Used to install imagemin dependencies, because imagemin may not be installed in China. If it is abroad, you can delete it",
Expand Down
1 change: 1 addition & 0 deletions src/components/Application/src/AppLogo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
font-size: 16px;
font-weight: 700;
transition: all 0.5s;
line-height: normal;
}
}
</style>
2 changes: 2 additions & 0 deletions src/components/CodeEditor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ import jsonPreview from './src/json-preview/JsonPreview.vue';

export const CodeEditor = withInstall(codeEditor);
export const JsonPreview = withInstall(jsonPreview);

export * from './src/typing';
18 changes: 9 additions & 9 deletions src/components/CodeEditor/src/CodeEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@
/>
</div>
</template>

<script lang="ts">
export const MODE = {
JSON: 'application/json',
html: 'htmlmixed',
js: 'javascript',
};
</script>
<script lang="ts" setup>
import { computed } from 'vue';
import CodeMirrorEditor from './codemirror/CodeMirror.vue';
import { isString } from '/@/utils/is';
import { MODE } from './typing';
const props = defineProps({
value: { type: [Object, String] as PropType<Record<string, any> | string> },
mode: { type: String, default: MODE.JSON },
mode: {
type: String as PropType<MODE>,
default: MODE.JSON,
validator(value: any) {
// 这个值必须匹配下列字符串中的一个
return Object.values(MODE).includes(value);
},
},
readonly: { type: Boolean },
autoFormat: { type: Boolean, default: true },
});
Expand Down
Loading

0 comments on commit 8efcba4

Please sign in to comment.