diry 1 saat önce
ebeveyn
işleme
7421f3803c
5 değiştirilmiş dosya ile 452 ekleme ve 439 silme
  1. 0 0
      lib/config.json
  2. 0 0
      lib/css/style.css
  3. 231 231
      lib/js/SModal.js
  4. 32 15
      lib/js/SModal2.js
  5. 189 193
      lib/js/workplace.js

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
lib/config.json


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
lib/css/style.css


Dosya farkı çok büyük olduğundan ihmal edildi
+ 231 - 231
lib/js/SModal.js


+ 32 - 15
lib/js/SModal2.js

@@ -1,4 +1,4 @@
-const n = `<template>
+const e = `<template>
   <!--  v-bind处理a-table 传递过来的参数,你们开发的时候不用再子组件中接收这么ant原有的参数-->
   <a-modal
     :open="isOpen"
@@ -182,6 +182,11 @@ const props = defineProps({
     type: Boolean,
     default: true
   },
+  // 是否默认以全屏状态展示,仍可点右上角还原
+  defaultFullScreen: {
+    type: Boolean,
+    default: false
+  },
   // 页签配置,传了才显示页签区
   tabs: {
     type: Array,
@@ -240,8 +245,8 @@ const dragRect = ref({ left: 0, right: 0, top: 0, bottom: 0 })
 /*****************/
 const bodySlot = ref(null)
 const footerSlot = ref(null)
-const modalWidth = ref(props.width)
-const fullModal = ref()
+const modalWidth = ref(props.defaultFullScreen ? '100vw' : props.width)
+const fullModal = ref(props.defaultFullScreen ? 's-full-modal' : '')
 const isOpen = ref(props.value)
 const spaceSize = ref(8)
 // 页签取值字段:tabKey.value 未传时回退到 label,避免所有 pane 的 key 都是 undefined
@@ -319,19 +324,27 @@ const scheduleMeasure = () => {
     })
   })
 }
+// 全屏 / 还原 状态统一切换,保证两处入口行为一致
+const setFullScreenState = (full) => {
+  if (full) {
+    modalWidth.value = '100vw'
+    fullModal.value = 's-full-modal'
+    modalTitleRef.value = null
+    transformX.value = 0
+    transformY.value = 0
+  } else {
+    modalWidth.value = props.width
+    fullModal.value = ''
+    modalTitleRef.value = titleEl.value
+  }
+}
 // 全屏
 const handleFullScreen = () => {
-  modalWidth.value = '100vw'
-  fullModal.value = 's-full-modal'
-  modalTitleRef.value = null
-  transformX.value = 0
-  transformY.value = 0
+  setFullScreenState(true)
 }
 // 还原
 const handleReduction = () => {
-  modalWidth.value = props.width
-  fullModal.value = ''
-  modalTitleRef.value = titleEl.value
+  setFullScreenState(false)
 }
 const closeModal = () => {
   emit('update:value', false)
@@ -341,11 +354,15 @@ const closeModal = () => {
  * @description: Modal 完全关闭后的回调
  */
 const handleAfterClose = () => {
-  fullModal.value = ''
-  modalTitleRef.value = titleEl.value
-  modalWidth.value = props.width
+  // 关闭后回到「默认状态」:配了 defaultFullScreen 就还是全屏
+  setFullScreenState(props.defaultFullScreen)
   emit('afterClose')
 }
+// 属性运行中变化时同步当前展示状态
+watch(
+  () => props.defaultFullScreen,
+  (val) => setFullScreenState(val)
+)
 const handTabChange = (e) => {
   activeTabKey.value = e
   emit('tabsChange', e)
@@ -540,5 +557,5 @@ onBeforeUnmount(() => {
 </style>
 `;
 export {
-  n as default
+  e as default
 };

Dosya farkı çok büyük olduğundan ihmal edildi
+ 189 - 193
lib/js/workplace.js


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor