diff --git a/packages/ui/certd-client/CHANGELOG.md b/packages/ui/certd-client/CHANGELOG.md index a50f3cd2..e61c11ed 100644 --- a/packages/ui/certd-client/CHANGELOG.md +++ b/packages/ui/certd-client/CHANGELOG.md @@ -3,6 +3,27 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.14.4](https://github.com/fast-crud/fast-crud/compare/v1.14.3...v1.14.4) (2023-07-02) + +**Note:** Version bump only for package @fast-crud/fs-admin-antdv + +## [1.14.3](https://github.com/fast-crud/fast-crud/compare/v1.14.2...v1.14.3) (2023-07-02) + +**Note:** Version bump only for package @fast-crud/fs-admin-antdv + +## [1.14.2](https://github.com/fast-crud/fast-crud/compare/v1.14.1...v1.14.2) (2023-07-02) + +### Bug Fixes + +* 修复多选导出csv,导致表格错位的bug ([4e0bf5b](https://github.com/fast-crud/fast-crud/commit/4e0bf5bae3bd39fd1654c5cf10991039eacf1acc)) +* 修复某些情况下fs-icon spin失效的bug ([2499a33](https://github.com/fast-crud/fast-crud/commit/2499a338def7436356c91a9b547e570c4204286d)) +* 修复行编辑模式下,render、conditionalRender无效的bug ([403fedc](https://github.com/fast-crud/fast-crud/commit/403fedc6e22817e33a1f4ac316a016e570127aa8)) + +### Performance Improvements + +* 导出重构 ([e99dc7b](https://github.com/fast-crud/fast-crud/commit/e99dc7bb6b24d4456fc524a04e8787e16b07511e)) +* export 功能 ([2accdba](https://github.com/fast-crud/fast-crud/commit/2accdba5d087c01a87c6fd20b98c6510d0038f9d)) + ## [1.14.1](https://github.com/fast-crud/fast-crud/compare/v1.14.0...v1.14.1) (2023-06-16) **Note:** Version bump only for package @fast-crud/fs-admin-antdv diff --git a/packages/ui/certd-client/package.json b/packages/ui/certd-client/package.json index 7b168230..9fe20e4d 100644 --- a/packages/ui/certd-client/package.json +++ b/packages/ui/certd-client/package.json @@ -1,6 +1,6 @@ { "name": "@fast-crud/fs-admin-antdv", - "version": "1.14.1", + "version": "1.14.4", "private": true, "scripts": { "dev": "vite", @@ -25,10 +25,10 @@ "@ant-design/icons-vue": "^6.1.0", "@aws-sdk/client-s3": "^3.292.0", "@aws-sdk/s3-request-presigner": "^3.292.0", - "@fast-crud/fast-crud": "^1.14.1", - "@fast-crud/fast-extends": "^1.14.1", - "@fast-crud/ui-antdv": "^1.14.1", - "@fast-crud/ui-interface": "^1.14.1", + "@fast-crud/fast-crud": "^1.14.4", + "@fast-crud/fast-extends": "^1.14.4", + "@fast-crud/ui-antdv": "^1.14.4", + "@fast-crud/ui-interface": "^1.14.4", "@iconify/iconify": "^3.1.0", "@iconify/json": "^2.2.35", "@purge-icons/generated": "^0.9.0", diff --git a/packages/ui/certd-client/public/template-import.csv b/packages/ui/certd-client/public/template-import.csv new file mode 100644 index 00000000..457000ed --- /dev/null +++ b/packages/ui/certd-client/public/template-import.csv @@ -0,0 +1,6 @@ +name,mobile +张三,18603040102 +李四,18603040103 +王五,18603040104 +赵六,18603040105 +田七,18603040106 diff --git a/packages/ui/certd-client/src/router/source/modules/crud.ts b/packages/ui/certd-client/src/router/source/modules/crud.ts index 28656bdf..06d281d0 100644 --- a/packages/ui/certd-client/src/router/source/modules/crud.ts +++ b/packages/ui/certd-client/src/router/source/modules/crud.ts @@ -579,6 +579,12 @@ export const crudResources = [ path: "/crud/feature/local-v-model", component: "/crud/feature/local-v-model/index.vue" }, + { + title: "导入", + name: "FeatureImport", + path: "/crud/feature/local-import", + component: "/crud/feature/local-import/index.vue" + }, { title: "自定义删除", name: "FeatureRemove", diff --git a/packages/ui/certd-client/src/views/crud/feature/local-import/crud.tsx b/packages/ui/certd-client/src/views/crud/feature/local-import/crud.tsx new file mode 100644 index 00000000..8f629a2c --- /dev/null +++ b/packages/ui/certd-client/src/views/crud/feature/local-import/crud.tsx @@ -0,0 +1,90 @@ +import { CreateCrudOptionsProps, CreateCrudOptionsRet, importTable } from "@fast-crud/fast-crud"; +import { Modal, notification } from "ant-design-vue"; + +export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOptionsRet { + const crudBinding = crudExpose.crudBinding; + return { + crudOptions: { + mode: { + name: "local", + isMergeWhenUpdate: true, + isAppendWhenAdd: true + }, + //启用addRow按钮 + actionbar: { + buttons: { + //禁用弹框添加 + add: { show: false }, + //启用添加行 + addRow: { show: true }, + //导入按钮 + import: { + show: true, + text: "批量导入", + type: "primary", + click() { + const modal = Modal.info({ + title: "批量导入", + okText: "关闭", + content() { + async function onChange(e: any) { + const file = e.target.files[0]; + await importTable(crudExpose, { file, append: true }); + modal.destroy(); + notification.success({ + message: "导入成功" + }); + } + return ( +
+

+ 1、下载导入模板 +

+

+ 2、模板填充数据 +

+

+ 3、导入: + +

+
+ ); + } + }); + } + } + } + }, + table: { + remove: { + //删除数据后不请求后台 + refreshTable: false + }, + editable: { + enabled: true, + mode: "row", + activeTrigger: false + } + }, + search: { + show: false + }, + toolbar: { + show: false + }, + pagination: { + show: false + }, + columns: { + name: { + type: "text", + title: "联系人姓名" + }, + mobile: { + type: "text", + title: "联系人手机号码" + } + } + } + }; +} diff --git a/packages/ui/certd-client/src/views/crud/feature/local-import/index.vue b/packages/ui/certd-client/src/views/crud/feature/local-import/index.vue new file mode 100644 index 00000000..0e3200d6 --- /dev/null +++ b/packages/ui/certd-client/src/views/crud/feature/local-import/index.vue @@ -0,0 +1,47 @@ + + + diff --git a/packages/ui/certd-client/src/views/crud/feature/local-import/local.vue b/packages/ui/certd-client/src/views/crud/feature/local-import/local.vue new file mode 100644 index 00000000..88fc1585 --- /dev/null +++ b/packages/ui/certd-client/src/views/crud/feature/local-import/local.vue @@ -0,0 +1,57 @@ + + + +