From 769554d454e60374aa6b3a36c2ec7b284371134b Mon Sep 17 00:00:00 2001
From: zenglf <18502938215@163.com>
Date: 星期二, 31 十月 2023 15:25:14 +0800
Subject: [PATCH] Merge branch 'develop'
---
src/components/jeecg/JModal/JModal.vue | 24 +++++++++++++++++++++++-
1 files changed, 23 insertions(+), 1 deletions(-)
diff --git a/src/components/jeecg/JModal/JModal.vue b/src/components/jeecg/JModal/JModal.vue
index 1e5bb9f..bc8936e 100644
--- a/src/components/jeecg/JModal/JModal.vue
+++ b/src/components/jeecg/JModal/JModal.vue
@@ -8,7 +8,7 @@
v-on="$listeners"
@ok="handleOk"
@cancel="handleCancel"
- destroyOnClose
+ :destroyOnClose="destroyOnClose"
>
<slot></slot>
@@ -49,13 +49,17 @@
import { getClass, getStyle } from '@/utils/props-util'
import { triggerWindowResizeEvent } from '@/utils/util'
+import ModalDragMixins from './ModalDragMixins'
export default {
name: 'JModal',
+ mixins: [ModalDragMixins],
props: {
title: String,
// 鍙娇鐢� .sync 淇グ绗�
visible: Boolean,
+ // 鏄惁寮�鍚嫋鎷�
+ draggable: Boolean,
// 鏄惁鍏ㄥ睆寮圭獥锛屽綋鍏ㄥ睆鏃舵棤璁哄浣曢兘浼氱姝� body 婊氬姩銆傚彲浣跨敤 .sync 淇グ绗�
fullscreen: {
type: Boolean,
@@ -68,6 +72,11 @@
},
// 鐐瑰嚮纭畾鎸夐挳鐨勬椂鍊欐槸鍚﹀叧闂脊绐�
okClose: {
+ type: Boolean,
+ default: true
+ },
+ // 鍏抽棴鏃堕攢姣佸脊绐楀唴瀹�
+ destroyOnClose: {
type: Boolean,
default: true
},
@@ -162,6 +171,19 @@
toggleFullscreen() {
this.innerFullscreen = !this.innerFullscreen
triggerWindowResizeEvent()
+ // 寮�鍚嫋鎷藉悗鐨勭壒娈婂鐞�
+ if (this.draggable) {
+ // 鍏ㄥ睆鐨勬椂鍊欑姝㈡嫋鍔�
+ if (this.innerFullscreen) {
+ // 杩樺師寮圭獥鐨勪綅缃负0,0
+ this.setModalPosition(0, 0, false)
+ this.dragSettings.headerEl.style.cursor = null
+ } else {
+ // 鍙栨秷鍏ㄥ睆鐨勬椂鍊欙紝灏嗗脊绐楃Щ鍔ㄥ埌涓婃璁板綍鐨勪綅缃�
+ this.resetModalPosition()
+ this.dragSettings.headerEl.style.cursor = 'move'
+ }
+ }
},
}
--
Gitblit v1.9.3