Browse Source

fix:BsUi-组件修改

hanxiaohui 4 months ago
parent
commit
086fa70865

+ 1 - 7
src/components/BsUi/Modal/Modal.vue

@@ -33,10 +33,4 @@
     };
   });
 </script>
-<style lang="scss" scoped>
-  .bs-modal {
-    :deep(.ant-modal-content) {
-      background-color: #f8f8f8;
-    }
-  }
-</style>
+<style lang="scss" scoped></style>

+ 17 - 2
src/components/BsUi/Modal/index.js

@@ -1,6 +1,7 @@
 import BsModal from './Modal.vue';
-import { onBeforeMount, onMounted, reactive, toRaw } from 'vue';
+import {h, onBeforeMount, onMounted, reactive, toRaw} from 'vue';
 import { set, get } from 'lodash';
+import { CheckCircleOutlined, CloseCircleOutlined  } from "@ant-design/icons-vue"
 
 export const useBsModal = (options, modalRef) => {
   const modalOptions = reactive(options.modalOptions);
@@ -13,7 +14,21 @@ export const useBsModal = (options, modalRef) => {
     return toRaw(get(modalOptions, path, undefined));
   };
 
-  onMounted(() => {});
+  const initModalOptions = () => {
+    setModalPropsValue("modalExtraProps.okButtonProps", {
+      icon: h(CheckCircleOutlined),
+      ...options.modalOptions?.modalExtraProps?.okButtonProps
+    })
+
+    setModalPropsValue("modalExtraProps.cancelButtonProps", {
+      icon: h(CloseCircleOutlined),
+      ...options.modalOptions?.modalExtraProps?.cancelButtonProps
+    })
+  }
+
+  onMounted(() => {
+    initModalOptions()
+  });
 
   return {
     modalOptions,

+ 16 - 0
src/components/BsUi/styles/index.less

@@ -0,0 +1,16 @@
+.bs-modal {
+  .ant-modal-content {
+    padding: 20px 0 0 0;
+  }
+  .ant-modal-header {
+    padding: 0 20px;
+  }
+  .ant-modal-body {
+    padding: 0 20px;
+  }
+  .ant-modal-footer {
+    border-top: 1px solid rgba(#888888, 0.2);
+    margin: 0;
+    padding: 10px;
+  }
+}