From 03975529b8acac367259b5b0f20cf98b734e5b44 Mon Sep 17 00:00:00 2001 From: From-wh Date: Thu, 9 Mar 2023 09:19:16 +0800 Subject: [PATCH] =?UTF-8?q?improve:=20modal=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/admin/src/styles/style.css | 7 +++++ template/admin/src/utils/modal.js | 2 +- template/admin/src/utils/modalForm.js | 45 ++++++++++++++++++--------- 3 files changed, 39 insertions(+), 15 deletions(-) diff --git a/template/admin/src/styles/style.css b/template/admin/src/styles/style.css index cd3ea6cae..3575b7cdb 100644 --- a/template/admin/src/styles/style.css +++ b/template/admin/src/styles/style.css @@ -716,3 +716,10 @@ body { .pt10 { padding-top: 10px; } +.common-form-create-footer{ + display: flex; + justify-content: right; +} +.common-form-button{ + margin-right: 10px; +} \ No newline at end of file diff --git a/template/admin/src/utils/modal.js b/template/admin/src/utils/modal.js index 50b4d5bce..3e38d4dbc 100644 --- a/template/admin/src/utils/modal.js +++ b/template/admin/src/utils/modal.js @@ -114,7 +114,7 @@ Modal.newInstance = (properties) => { }, domProps: { innerHTML: this.title, - style: 'margin-bottom: 10px;', + style: 'margin-bottom: 20px;border-bottom:1px solid #f2f2f2;padding-bottom:10px;', }, }), ], diff --git a/template/admin/src/utils/modalForm.js b/template/admin/src/utils/modalForm.js index 125387eec..b6bd1d4b5 100644 --- a/template/admin/src/utils/modalForm.js +++ b/template/admin/src/utils/modalForm.js @@ -133,22 +133,39 @@ export default function (formRequestPromise, { width = '700' } = { width: '700' }, }, }), - h( - 'Button', - { - class: 'common-form-button', - props: { - type: 'primary', - long: true, - }, - on: { - click: () => { - fApi.submit(); + h('div', { class: 'common-form-create-footer' }, [ + h( + 'Button', + { + class: 'common-form-button', + props: { + long: false, + }, + on: { + click: () => { + modalInstance.remove(); + }, }, }, - }, - ['提交'], - ), + ['取消'], + ), + h( + 'Button', + { + class: 'common-form-button', + props: { + type: 'primary', + long: false, + }, + on: { + click: () => { + fApi.submit(); + }, + }, + }, + ['提交'], + ), + ]), ]); }, });