diff --git a/.vscode/settings.json b/.vscode/settings.json index 096d7ad9..bbcf8694 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -25,8 +25,8 @@ //============= files ======================= //=========================================== "files.trimTrailingWhitespace": true, - "files.insertFinalNewline": true, - "files.trimFinalNewlines": true, + // "files.insertFinalNewline": true, + // "files.trimFinalNewlines": true, "files.eol": "\n", "search.exclude": { "**/node_modules": true, @@ -76,14 +76,14 @@ // =========================================== // ================ Vetur ==================== // =========================================== - "vetur.experimental.templateInterpolationService": true, - "vetur.format.options.tabSize": 2, - "vetur.languageFeatures.codeActions": false, - "vetur.format.defaultFormatterOptions": { - "js-beautify-html": { - "wrap_attributes": "force-expand-multiline" - } - }, + // "vetur.experimental.templateInterpolationService": true, + // "vetur.format.options.tabSize": 2, + // "vetur.languageFeatures.codeActions": false, + // "vetur.format.defaultFormatterOptions": { + // "js-beautify-html": { + // "wrap_attributes": "force-expand-multiline" + // } + // }, "liveServer.settings.donotShowInfoMsg": true, "telemetry.enableCrashReporter": false, "workbench.settings.enableNaturalLanguageSearch": false, diff --git a/build/vite/plugin/compress.ts b/build/vite/plugin/compress.ts index 45583be2..9563679c 100644 --- a/build/vite/plugin/compress.ts +++ b/build/vite/plugin/compress.ts @@ -8,7 +8,7 @@ import compressPlugin from 'vite-plugin-compression'; export function configCompressPlugin( compress: 'gzip' | 'brotli' | 'none', - deleteOriginFile: boolean = false + deleteOriginFile = false ): Plugin | Plugin[] { const compressList = compress.split(','); diff --git a/package.json b/package.json index cab3846e..1fd90090 100644 --- a/package.json +++ b/package.json @@ -122,7 +122,7 @@ "concurrently": "^5.3.0", "@commitlint/cli": "^12.1.4", "@commitlint/config-conventional": "^12.1.4", - "@iconify/json": "^1.1.350", + "@iconify/json": "^1.1.353", "@purge-icons/generated": "^0.7.0", "@types/codemirror": "^5.60.0", "@types/crypto-js": "^4.0.1", @@ -130,7 +130,7 @@ "@types/inquirer": "^7.3.1", "@types/lodash-es": "^4.17.4", "@types/mockjs": "^1.0.3", - "@types/node": "^15.12.0", + "@types/node": "^15.12.1", "@types/nprogress": "^0.2.0", "@types/qrcode": "^1.4.0", "@types/qs": "^6.9.6", @@ -146,12 +146,12 @@ "conventional-changelog-cli": "^2.1.1", "cross-env": "^7.0.3", "dotenv": "^10.0.0", - "eslint": "^7.27.0", + "eslint": "^7.28.0", "eslint-config-prettier": "^8.3.0", "eslint-define-config": "^1.0.8", "eslint-plugin-prettier": "^3.4.0", "eslint-plugin-vue": "^7.10.0", - "esno": "^0.6.0", + "esno": "^0.7.0", "fs-extra": "^10.0.0", "http-server": "^0.12.3", "husky": "^6.0.0", @@ -160,7 +160,7 @@ "less": "^4.1.1", "lint-staged": "^11.0.0", "postcss": "^8.3.0", - "prettier": "^2.3.0", + "prettier": "^2.3.1", "pretty-quick": "^3.1.0", "rimraf": "^3.0.2", "rollup-plugin-visualizer": "5.5.0", @@ -187,7 +187,7 @@ "resolutions": { "//": "Used to install imagemin dependencies, because imagemin may not be installed in China. If it is abroad, you can delete it", "bin-wrapper": "npm:bin-wrapper-china", - "rollup": "^2.50.6" + "rollup": "^2.51.0" }, "repository": { "type": "git", diff --git a/src/components/Button/src/BasicButton.vue b/src/components/Button/src/BasicButton.vue index 8d349e8d..d4fadbcb 100644 --- a/src/components/Button/src/BasicButton.vue +++ b/src/components/Button/src/BasicButton.vue @@ -1,47 +1,49 @@ - diff --git a/src/components/Button/src/PopConfirmButton.vue b/src/components/Button/src/PopConfirmButton.vue index 7691cf60..4e546a05 100644 --- a/src/components/Button/src/PopConfirmButton.vue +++ b/src/components/Button/src/PopConfirmButton.vue @@ -1,31 +1,33 @@ diff --git a/src/components/Table/src/components/settings/ColumnSetting.vue b/src/components/Table/src/components/settings/ColumnSetting.vue index 9c78c826..e77dae9b 100644 --- a/src/components/Table/src/components/settings/ColumnSetting.vue +++ b/src/components/Table/src/components/settings/ColumnSetting.vue @@ -114,7 +114,7 @@ import { getPopupContainer } from '/@/utils'; import { omit } from 'lodash-es'; - import type { BasicColumn } from '../../types/table'; + import type { BasicColumn, ColumnChangeParam } from '../../types/table'; interface State { checkAll: boolean; @@ -141,8 +141,9 @@ Divider, Icon, }, + emits: ['columns-change'], - setup() { + setup(_, { emit }) { const { t } = useI18n(); const table = useTableContext(); @@ -234,10 +235,10 @@ const checkList = plainOptions.value.map((item) => item.value); if (e.target.checked) { state.checkedList = checkList; - table.setColumns(checkList); + setColumns(checkList); } else { state.checkedList = []; - table.setColumns([]); + setColumns([]); } } @@ -257,7 +258,7 @@ checkedList.sort((prev, next) => { return sortList.indexOf(prev) - sortList.indexOf(next); }); - table.setColumns(checkedList); + setColumns(checkedList); } // reset columns @@ -266,7 +267,7 @@ state.checkAll = true; plainOptions.value = unref(cachePlainOptions); plainSortOptions.value = unref(cachePlainOptions); - table.setColumns(table.getCacheColumns()); + setColumns(table.getCacheColumns()); } // Open the pop-up window for drag and drop initialization @@ -298,7 +299,7 @@ plainSortOptions.value = columns; plainOptions.value = columns; - table.setColumns(columns); + setColumns(columns); }, }); initSortable(); @@ -335,7 +336,21 @@ item.width = 100; } table.setCacheColumnsByField?.(item.dataIndex, { fixed: isFixed }); + setColumns(columns); + } + + function setColumns(columns: BasicColumn[] | string[]) { table.setColumns(columns); + const data: ColumnChangeParam[] = unref(plainOptions).map((col) => { + const visible = + columns.findIndex( + (c: BasicColumn | string) => + c === col.value || (typeof c !== 'string' && c.dataIndex === col.value) + ) !== -1; + return { dataIndex: col.value, fixed: col.fixed, visible }; + }); + + emit('columns-change', data); } return { diff --git a/src/components/Table/src/components/settings/index.vue b/src/components/Table/src/components/settings/index.vue index ed079993..4c0b054d 100644 --- a/src/components/Table/src/components/settings/index.vue +++ b/src/components/Table/src/components/settings/index.vue @@ -2,13 +2,13 @@