diff --git a/.gitpod.yml b/.gitpod.yml
index 51f4bdcb..866381fc 100644
--- a/.gitpod.yml
+++ b/.gitpod.yml
@@ -3,4 +3,4 @@ ports:
onOpen: open-preview
tasks:
- init: pnpm install
- command: pnpm dev
+ command: pnpm run dev
diff --git a/.husky/lintstagedrc.js b/.husky/lintstagedrc.js
deleted file mode 100644
index 08d8c9e8..00000000
--- a/.husky/lintstagedrc.js
+++ /dev/null
@@ -1,8 +0,0 @@
-module.exports = {
- '*.{js,jsx,ts,tsx}': ['eslint --fix', 'prettier --write'],
- '{!(package)*.json,*.code-snippets,.!(browserslist)*rc}': ['prettier --write--parser json'],
- 'package.json': ['prettier --write'],
- '*.vue': ['eslint --fix', 'prettier --write', 'stylelint --fix'],
- '*.{scss,less,styl,html}': ['stylelint --fix', 'prettier --write'],
- '*.md': ['prettier --write'],
-};
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
index 0af47dea..94dc8139 100644
--- a/.vscode/extensions.json
+++ b/.vscode/extensions.json
@@ -1,6 +1,6 @@
{
"recommendations": [
- "octref.vetur",
+ "johnsoncodehk.volar",
"dbaeumer.vscode-eslint",
"stylelint.vscode-stylelint",
"esbenp.prettier-vscode",
diff --git a/index.html b/index.html
index 5b99faf6..f615e97c 100644
--- a/index.html
+++ b/index.html
@@ -8,7 +8,6 @@
name="viewport"
content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0"
/>
-
<%= title %>
@@ -30,7 +29,7 @@
}
html[data-theme='dark'] .app-loading .app-loading-title {
- color: rgba(255, 255, 255, 0.85);
+ color: rgb(255 255 255 / 85%);
}
.app-loading {
@@ -48,7 +47,6 @@
top: 50%;
left: 50%;
display: flex;
- -webkit-transform: translate3d(-50%, -50%, 0);
transform: translate3d(-50%, -50%, 0);
justify-content: center;
align-items: center;
@@ -66,7 +64,7 @@
display: flex;
margin-top: 30px;
font-size: 30px;
- color: rgba(0, 0, 0, 0.85);
+ color: rgb(0 0 0 / 85%);
justify-content: center;
align-items: center;
}
@@ -97,7 +95,7 @@
height: 20px;
background-color: #0065cc;
border-radius: 100%;
- opacity: 0.3;
+ opacity: 30%;
transform: scale(0.75);
animation: antSpinMove 1s infinite linear alternate;
transform-origin: 50% 50%;
@@ -111,43 +109,38 @@
.dot i:nth-child(2) {
top: 0;
right: 0;
- -webkit-animation-delay: 0.4s;
animation-delay: 0.4s;
}
.dot i:nth-child(3) {
right: 0;
bottom: 0;
- -webkit-animation-delay: 0.8s;
animation-delay: 0.8s;
}
.dot i:nth-child(4) {
bottom: 0;
left: 0;
- -webkit-animation-delay: 1.2s;
animation-delay: 1.2s;
}
@keyframes antRotate {
to {
- -webkit-transform: rotate(405deg);
transform: rotate(405deg);
}
}
- @-webkit-keyframes antRotate {
+ @keyframes antRotate {
to {
- -webkit-transform: rotate(405deg);
transform: rotate(405deg);
}
}
@keyframes antSpinMove {
to {
- opacity: 1;
+ opacity: 100%;
}
}
- @-webkit-keyframes antSpinMove {
+ @keyframes antSpinMove {
to {
- opacity: 1;
+ opacity: 100%;
}
}
diff --git a/package.json b/package.json
index 3469a304..d37f95a0 100644
--- a/package.json
+++ b/package.json
@@ -23,7 +23,7 @@
"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 -c ./.husky/lintstagedrc.js",
+ "lint:lint-staged": "lint-staged",
"test:unit": "jest",
"test:unit-coverage": "jest --coverage",
"test:gzip": "npx http-server dist --cors --gzip -c-1",
@@ -159,5 +159,29 @@
"homepage": "https://github.com/anncwb/vue-vben-admin",
"engines": {
"node": "^12 || >=14"
+ },
+ "lint-staged": {
+ "*.{js,jsx,ts,tsx}": [
+ "eslint --fix",
+ "prettier --write"
+ ],
+ "{!(package)*.json,*.code-snippets,.!(browserslist)*rc}": [
+ "prettier --write--parser json"
+ ],
+ "package.json": [
+ "prettier --write"
+ ],
+ "*.vue": [
+ "eslint --fix",
+ "prettier --write",
+ "stylelint --fix"
+ ],
+ "*.{scss,less,styl,html}": [
+ "stylelint --fix",
+ "prettier --write"
+ ],
+ "*.md": [
+ "prettier --write"
+ ]
}
}
diff --git a/src/components/Table/src/components/settings/ColumnSetting.vue b/src/components/Table/src/components/settings/ColumnSetting.vue
index 24e42d4d..db0e124e 100644
--- a/src/components/Table/src/components/settings/ColumnSetting.vue
+++ b/src/components/Table/src/components/settings/ColumnSetting.vue
@@ -43,7 +43,7 @@
-
+
{{ item.label }}
@@ -120,7 +120,7 @@
import { useSortable } from '/@/hooks/web/useSortable';
import { isFunction, isNullAndUnDef } from '/@/utils/is';
import { getPopupContainer as getParentContainer } from '/@/utils';
- import { omit } from 'lodash-es';
+ import { cloneDeep, omit } from 'lodash-es';
interface State {
checkAll: boolean;
@@ -250,16 +250,15 @@
const indeterminate = computed(() => {
const len = plainOptions.value.length;
- let checkdedLen = state.checkedList.length;
- unref(checkIndex) && checkdedLen--;
- return checkdedLen > 0 && checkdedLen < len;
+ let checkedLen = state.checkedList.length;
+ unref(checkIndex) && checkedLen--;
+ return checkedLen > 0 && checkedLen < len;
});
// Trigger when check/uncheck a column
function onChange(checkedList: string[]) {
- const len = plainOptions.value.length;
+ const len = plainSortOptions.value.length;
state.checkAll = checkedList.length === len;
-
const sortList = unref(plainSortOptions).map((item) => item.value);
checkedList.sort((prev, next) => {
return sortList.indexOf(prev) - sortList.indexOf(next);
@@ -286,14 +285,14 @@
if (!el) return;
// Drag and drop sort
const { initSortable } = useSortable(el, {
- handle: '.table-coulmn-drag-icon ',
+ handle: '.table-column-drag-icon',
onEnd: (evt) => {
const { oldIndex, newIndex } = evt;
if (isNullAndUnDef(oldIndex) || isNullAndUnDef(newIndex) || oldIndex === newIndex) {
return;
}
// Sort column
- const columns = getColumns();
+ const columns = cloneDeep(plainSortOptions.value);
if (oldIndex > newIndex) {
columns.splice(newIndex, 0, columns[oldIndex]);
@@ -304,7 +303,6 @@
}
plainSortOptions.value = columns;
- plainOptions.value = columns;
setColumns(columns);
},
});
@@ -347,7 +345,7 @@
function setColumns(columns: BasicColumn[] | string[]) {
table.setColumns(columns);
- const data: ColumnChangeParam[] = unref(plainOptions).map((col) => {
+ const data: ColumnChangeParam[] = unref(plainSortOptions).map((col) => {
const visible =
columns.findIndex(
(c: BasicColumn | string) =>
@@ -390,7 +388,7 @@