From baf5b6c0658406ae1759c51eed00ecea9d34ac5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=9E=E4=BB=99=E9=83=BD=E6=B2=A1=E7=94=A8?= <615206459@qq.com> Date: Thu, 26 Sep 2024 16:07:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20formatter=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/crud/components/table/formatter.vue | 98 +++++++++++++++++++ .../demo/views/crud/components/table/op.vue | 3 +- src/modules/demo/views/crud/index.vue | 2 + src/modules/user/components/select.vue | 7 +- 4 files changed, 104 insertions(+), 6 deletions(-) create mode 100644 src/modules/demo/views/crud/components/table/formatter.vue diff --git a/src/modules/demo/views/crud/components/table/formatter.vue b/src/modules/demo/views/crud/components/table/formatter.vue new file mode 100644 index 0000000..eba5481 --- /dev/null +++ b/src/modules/demo/views/crud/components/table/formatter.vue @@ -0,0 +1,98 @@ + + + + formatter + 数据格式化 + + + + 预览 + + + + + + + + + + + + + + + + + + + 2024-09-26 + + + + + diff --git a/src/modules/demo/views/crud/components/table/op.vue b/src/modules/demo/views/crud/components/table/op.vue index 2be8828..ba2f566 100644 --- a/src/modules/demo/views/crud/components/table/op.vue +++ b/src/modules/demo/views/crud/components/table/op.vue @@ -116,7 +116,8 @@ const Table = useTable({ ] // 动态返回按钮配置 - // buttons() { + // 用于控制是否根据状态显示按钮 + // buttons({ scope }) { // return ['edit', 'info', 'delete'] // } } diff --git a/src/modules/demo/views/crud/index.vue b/src/modules/demo/views/crud/index.vue index 8188a51..8de32fe 100644 --- a/src/modules/demo/views/crud/index.vue +++ b/src/modules/demo/views/crud/index.vue @@ -50,6 +50,7 @@ import FormComponent from "./components/form/component/index.vue"; import FormPlugin from "./components/form/plugin/index.vue"; import TableBase from "./components/table/base.vue"; +import TableFormatter from "./components/table/formatter.vue"; import TableOp from "./components/table/op.vue"; import TableSearch from "./components/table/search.vue"; import TableSelection from "./components/table/selection.vue"; @@ -105,6 +106,7 @@ const list = [ label: "基础", children: [ TableBase, + TableFormatter, TableOp, TableSearch, TableSelection, diff --git a/src/modules/user/components/select.vue b/src/modules/user/components/select.vue index 25df8fe..5cd6ae5 100644 --- a/src/modules/user/components/select.vue +++ b/src/modules/user/components/select.vue @@ -104,13 +104,10 @@ import { CircleClose } from "@element-plus/icons-vue"; type Item = Eps.UserInfoEntity; const props = defineProps({ - modelValue: { - type: [Array, Number] as PropType, - default: () => [] - }, + modelValue: null, isDisabled: Boolean, prop: String, - scope: null, + scope: Object as PropType, disabled: Boolean, // 是否多选