From dbfd014209a358b7633720b6f4e710327027dcaa Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Mon, 18 Mar 2024 12:42:05 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20`ReDialog`=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=85=A8=E5=B1=8F=E5=9B=9E=E8=B0=83=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ReDialog/index.vue | 17 ++++++++++++++--- src/components/ReDialog/type.ts | 15 ++++++++++++++- src/views/components/dialog/index.vue | 8 +++++--- 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/src/components/ReDialog/index.vue b/src/components/ReDialog/index.vue index aa9ad3834..15b6c1073 100644 --- a/src/components/ReDialog/index.vue +++ b/src/components/ReDialog/index.vue @@ -64,9 +64,10 @@ const fullscreenClass = computed(() => { function eventsCallBack( event: EventType, options: DialogOptions, - index: number + index: number, + isClickFullScreen = false ) { - fullscreen.value = options?.fullscreen ?? false; + if (!isClickFullScreen) fullscreen.value = options?.fullscreen ?? false; if (options?.[event] && isFunction(options?.[event])) { return options?.[event]({ options, index }); } @@ -108,7 +109,17 @@ function handleClose( void; -type EventType = "open" | "close" | "openAutoFocus" | "closeAutoFocus"; +type EventType = + | "open" + | "close" + | "openAutoFocus" + | "closeAutoFocus" + | "fullscreenCallBack"; type ArgsType = { /** `cancel` 点击取消按钮、`sure` 点击确定按钮、`close` 点击右上角关闭按钮或空白页或按下了esc键 */ command: "cancel" | "sure" | "close"; @@ -175,6 +180,14 @@ interface DialogOptions extends DialogProps { index: number; args: any; }) => void; + /** 点击全屏按钮时的回调 */ + fullscreenCallBack?: ({ + options, + index + }: { + options: DialogOptions; + index: number; + }) => void; /** 输入焦点聚焦在 `Dialog` 内容时的回调 */ openAutoFocus?: ({ options, diff --git a/src/views/components/dialog/index.vue b/src/views/components/dialog/index.vue index 0df0df694..5a8f59e04 100644 --- a/src/views/components/dialog/index.vue +++ b/src/views/components/dialog/index.vue @@ -43,9 +43,11 @@ function onFullscreenClick() { function onFullscreenIconClick() { addDialog({ - title: "全屏按钮", + title: "全屏按钮和全屏事件", fullscreenIcon: true, - contentRenderer: () =>

弹框内容-全屏按钮

+ fullscreenCallBack: ({ options, index }) => + message(options.fullscreen ? "全屏" : "非全屏"), + contentRenderer: () =>

弹框内容-全屏按钮和全屏事件

}); } @@ -468,7 +470,7 @@ function onBeforeSureClick() { 基础用法 可拖拽 全屏 - 全屏按钮 + 全屏按钮和全屏事件 无背景遮罩层 自定义弹出位置 延时2秒打开弹框 From e46d3e57fed4806fb842ffc185e057d774f77678 Mon Sep 17 00:00:00 2001 From: xiaoming <1923740402@qq.com> Date: Mon, 18 Mar 2024 16:13:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20`pure-admin-table`=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=8D=95=E5=85=83=E6=A0=BC=E7=BC=96=E8=BE=91=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E7=9A=84=E7=AE=80=E6=98=93=E7=94=A8=E6=B3=95=20(#992)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: `pure-admin-table`添加单元格编辑表格的简易用法 --- locales/zh-CN.yaml | 4 +- src/views/pure-table/edit/data.ts | 29 ++++- src/views/pure-table/edit/demo1/index.vue | 4 +- src/views/pure-table/edit/demo2/index.vue | 5 +- src/views/pure-table/edit/demo3/columns.tsx | 87 +++++++++++++ src/views/pure-table/edit/demo3/index.vue | 22 ++++ src/views/pure-table/edit/list.tsx | 7 ++ src/views/pure-table/high/edit/columns.tsx | 133 -------------------- src/views/pure-table/high/edit/index.vue | 9 -- src/views/pure-table/high/list.tsx | 7 -- 10 files changed, 150 insertions(+), 157 deletions(-) create mode 100644 src/views/pure-table/edit/demo3/columns.tsx create mode 100644 src/views/pure-table/edit/demo3/index.vue delete mode 100644 src/views/pure-table/high/edit/columns.tsx delete mode 100644 src/views/pure-table/high/edit/index.vue diff --git a/locales/zh-CN.yaml b/locales/zh-CN.yaml index cc6281b21..882ed3241 100644 --- a/locales/zh-CN.yaml +++ b/locales/zh-CN.yaml @@ -128,8 +128,8 @@ menus: hsSensitive: 敏感词过滤 hsPinyin: 汉语拼音 hsdanmaku: 弹幕 - hsPureTableBase: 基础用法(23个示例) - hsPureTableHigh: 高级用法(11个示例) + hsPureTableBase: 基础用法 + hsPureTableHigh: 高级用法 hsPureTableEdit: 可编辑用法 hsboard: 艺术画板 hsMenuoverflow: 目录超出显示 Tooltip 文字提示 diff --git a/src/views/pure-table/edit/data.ts b/src/views/pure-table/edit/data.ts index 9ce85d053..1fbeaf340 100644 --- a/src/views/pure-table/edit/data.ts +++ b/src/views/pure-table/edit/data.ts @@ -1,23 +1,27 @@ const tableData = [ { + id: 1, name: "Tom", sex: 0, // 0代表男 1代表女 hobby: 2, date: "2024-03-17" }, { + id: 2, name: "Jack", sex: 0, hobby: 1, date: "2024-03-18" }, { + id: 3, name: "Lily", sex: 1, hobby: 1, date: "2024-03-19" }, { + id: 4, name: "Mia", sex: 1, hobby: 3, @@ -44,4 +48,27 @@ const options = [ } ]; -export { tableData, options }; +const tableDataEdit = [ + { + id: 1, + name: "Tom", + address: "home" + }, + { + id: 2, + name: "Jack", + address: "office" + }, + { + id: 3, + name: "Lily", + address: "library" + }, + { + id: 4, + name: "Mia", + address: "playground" + } +]; + +export { tableData, tableDataEdit, options }; diff --git a/src/views/pure-table/edit/demo1/index.vue b/src/views/pure-table/edit/demo1/index.vue index 208bfd065..6beea0cd3 100644 --- a/src/views/pure-table/edit/demo1/index.vue +++ b/src/views/pure-table/edit/demo1/index.vue @@ -10,9 +10,9 @@ const { columns, dataList, onAdd, onDel } = useColumns();