From 0eccb9ac7b225f3a63674196f2bafe5fa6d99c65 Mon Sep 17 00:00:00 2001 From: buqiyuan <1743369777@qq.com> Date: Sun, 28 Aug 2022 14:31:30 +0800 Subject: [PATCH] feat(components): [dynamic-table] support cell edit --- package.json | 17 +- .../src/components/editable-cell/index.vue | 197 ++++++++--- .../table-settings/column-setting.vue | 14 +- .../core/dynamic-table/src/dynamic-table.ts | 26 +- .../core/dynamic-table/src/dynamic-table.vue | 5 +- .../core/dynamic-table/src/hooks/index.ts | 7 +- .../dynamic-table/src/hooks/useColumns.tsx | 26 +- .../dynamic-table/src/hooks/useEditable.ts | 112 ++++++- .../src/hooks/useTableMethods.tsx | 8 +- .../dynamic-table/src/hooks/useTableState.tsx | 41 ++- .../core/dynamic-table/src/types/column.ts | 42 +-- .../core/dynamic-table/src/types/table.ts | 23 ++ .../core/schema-form/src/componentMap.ts | 2 + .../core/schema-form/src/hooks/useForm.tsx | 2 +- .../core/schema-form/src/schema-form-item.vue | 10 +- .../core/schema-form/src/schema-form.vue | 2 +- .../core/schema-form/src/types/component.ts | 12 + src/utils/index.ts | 4 +- src/utils/is/index.ts | 4 +- .../demos/form/basic-form/form-schema.tsx | 21 +- .../demos/tables/edit-row-table/columns.tsx | 75 ++--- .../demos/tables/edit-row-table/index.vue | 101 ++++-- .../demos/tables/search-table/columns.tsx | 1 + yarn.lock | 312 ++++++++++++------ 24 files changed, 775 insertions(+), 289 deletions(-) diff --git a/package.json b/package.json index e0829354d..3b745b97e 100644 --- a/package.json +++ b/package.json @@ -37,14 +37,14 @@ "@vueuse/core": "~9.1.1", "ant-design-vue": "3.2.11", "axios": "~0.27.2", - "core-js": "~3.24.1", + "core-js": "~3.25.0", "dayjs": "~1.11.5", "file-saver": "~2.0.5", "lodash-es": "~4.17.21", "mitt": "~3.0.0", "mockjs": "~1.1.0", "nprogress": "~1.0.0-1", - "pinia": "~2.0.20", + "pinia": "~2.0.21", "qs": "~6.11.0", "socket.io-client": "~4.5.1", "sortablejs": "~1.15.0", @@ -55,13 +55,13 @@ "xlsx": "~0.18.5" }, "devDependencies": { - "@commitlint/cli": "~17.0.3", - "@commitlint/config-conventional": "~17.0.3", + "@commitlint/cli": "~17.1.1", + "@commitlint/config-conventional": "~17.1.0", "@types/lodash-es": "~4.17.6", "@types/node": "~18.7.13", "@types/webpack-env": "~1.18.0", - "@typescript-eslint/eslint-plugin": "~5.34.0", - "@typescript-eslint/parser": "~5.34.0", + "@typescript-eslint/eslint-plugin": "~5.35.1", + "@typescript-eslint/parser": "~5.35.1", "@vue/cli-plugin-babel": "~5.0.8", "@vue/cli-plugin-eslint": "~5.0.8", "@vue/cli-plugin-router": "~5.0.8", @@ -74,7 +74,7 @@ "cross-env": "~7.0.3", "cz-git": "~1.3.11", "czg": "~1.3.11", - "eslint": "~8.22.0", + "eslint": "~8.23.0", "eslint-config-prettier": "~8.5.0", "eslint-plugin-import": "2.26.0", "eslint-plugin-prettier": "~4.2.1", @@ -98,11 +98,12 @@ "stylelint-config-standard": "~28.0.0", "stylelint-order": "~5.0.0", "svg-sprite-loader": "~6.0.11", + "ts-node": "^10.9.1", "typescript": "~4.7.4", "unplugin-vue-define-options": "~0.7.3", "vue-cli-plugin-windicss": "~1.1.6", "vue-eslint-parser": "~9.0.3", - "vue-tsc": "^0.40.1" + "vue-tsc": "^0.40.2" }, "__npminstall_done": false, "repository": { diff --git a/src/components/core/dynamic-table/src/components/editable-cell/index.vue b/src/components/core/dynamic-table/src/components/editable-cell/index.vue index efdc25795..89aa64469 100644 --- a/src/components/core/dynamic-table/src/components/editable-cell/index.vue +++ b/src/components/core/dynamic-table/src/components/editable-cell/index.vue @@ -1,60 +1,179 @@