소스 검색

improve: modal调整

From-wh 2 년 전
부모
커밋
03975529b8
3개의 변경된 파일38개의 추가작업 그리고 14개의 파일을 삭제
  1. 7 0
      template/admin/src/styles/style.css
  2. 1 1
      template/admin/src/utils/modal.js
  3. 30 13
      template/admin/src/utils/modalForm.js

+ 7 - 0
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;
+}

+ 1 - 1
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;',
               },
             }),
           ],

+ 30 - 13
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,
+              h('div', { class: 'common-form-create-footer' }, [
+                h(
+                  'Button',
+                  {
+                    class: 'common-form-button',
+                    props: {
+                      long: false,
+                    },
+                    on: {
+                      click: () => {
+                        modalInstance.remove();
+                      },
+                    },
                   },
-                  on: {
-                    click: () => {
-                      fApi.submit();
+                  ['取消'],
+                ),
+                h(
+                  'Button',
+                  {
+                    class: 'common-form-button',
+                    props: {
+                      type: 'primary',
+                      long: false,
+                    },
+                    on: {
+                      click: () => {
+                        fApi.submit();
+                      },
                     },
                   },
-                },
-                ['提交'],
-              ),
+                  ['提交'],
+                ),
+              ]),
             ]);
           },
         });