meixioacomponent 1.1.49 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/index.d.ts +1 -1
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +3 -3
- package/lib/config/use/UseImg.d.ts.map +1 -1
- package/lib/config/use/UseImg.js +1 -0
- package/lib/meixioacomponent.common.js +17542 -38683
- package/lib/meixioacomponent.umd.js +17594 -38735
- package/lib/meixioacomponent.umd.min.js +6 -159
- package/lib/style/font-family.less +2 -1
- package/lib/style/index.less +9 -2
- package/lib/style/meixioacomponenticonfont/TCloudNumberVF.ttf +0 -0
- package/lib/style/tableStyle.less +15 -13
- package/lib/style/tdesignStyle.less +9 -0
- package/lib/style/variables.less +1 -1
- package/package.json +3 -3
- package/packages/components/base/baseAppendix/baseAppendix.vue +12 -11
- package/packages/components/base/baseArea/baseArea.vue +49 -54
- package/packages/components/base/baseAvatar/baseAvatar.vue +16 -14
- package/packages/components/base/baseButton/baseButton.vue +80 -0
- package/packages/components/base/baseButton/index.js +6 -0
- package/packages/components/base/baseButtonHandle/baseButtonHandle.vue +36 -4
- package/packages/components/base/baseDialog/index.vue +131 -102
- package/packages/components/base/baseDialogTable/dialogTable.vue +1 -0
- package/packages/components/base/baseDrawer/index.vue +121 -96
- package/packages/components/base/baseEdito/baseEdito.vue +56 -50
- package/packages/components/base/baseFixedHeader/baseFixedHeader.vue +44 -37
- package/packages/components/base/baseImageViewer/image-viewer.vue +29 -311
- package/packages/components/base/baseImg/baseImg.vue +8 -7
- package/packages/components/base/baseInforWrap/baseInforWrap.vue +14 -7
- package/packages/components/base/baseLineInfoItem/baseLineInfoItem.vue +4 -4
- package/packages/components/base/baseList/index.vue +10 -23
- package/packages/components/base/baseMoverVerifiBar/baseMoverVerifiBar.vue +7 -13
- package/packages/components/base/baseNumberInput/index.vue +42 -158
- package/packages/components/base/basePagination/index.vue +24 -31
- package/packages/components/base/basePlainTable/basePlainTable.vue +89 -183
- package/packages/components/base/basePopoverButton/index.vue +45 -36
- package/packages/components/base/baseSection/baseSection.vue +17 -8
- package/packages/components/base/baseSingleImgUpload/index.vue +2 -2
- package/packages/components/base/baseSkeleton/baseSkeleton.vue +0 -1
- package/packages/components/base/baseStoreSelect/index.vue +48 -64
- package/packages/components/base/baseTag/index.vue +12 -96
- package/packages/components/base/baseText/index.vue +66 -79
- package/packages/components/base/baseTimeLine/baseTimeLineLeft.vue +1 -1
- package/packages/components/base/baseTimeLine/baseTimeLineRight.vue +1 -1
- package/packages/components/base/baseTimeTypeSelect/base_time_type_select.vue +73 -78
- package/packages/components/base/baseToggle/toggle.vue +28 -48
- package/packages/components/base/baseTreeSelect/index.vue +20 -147
- package/packages/components/base/baseUpload/baseUploadItem.vue +74 -77
- package/packages/components/base/baseUpload/mixins.js +0 -1
- package/packages/components/base/baseUpload/uploadMediaView.vue +14 -13
- package/packages/components/base/baseUploadImgAndName/index.vue +28 -11
- package/packages/components/base/baseUploadTemplate/index.vue +27 -11
- package/packages/components/base/baseVideo/index.vue +9 -7
- package/packages/components/base/upload/upload.vue +17 -14
- package/packages/components/base/upload/uploadItem.vue +40 -46
- package/packages/components/dialogCache/index.vue +30 -24
- package/packages/components/index.js +3 -3
- package/packages/components/index.ts +4 -3
- package/packages/components/mixins/tableSectionMixins.js +0 -12
- package/packages/components/proForm/dialogForm/baseDialogForm.vue +17 -14
- package/packages/components/proForm/proForm/proFormItem/pro_form_item.vue +95 -79
- package/packages/components/proForm/proForm/pro_form.vue +47 -52
- package/packages/components/proPageTable/oaProTableSearch/oa_pro-table-search.vue +2 -2
- package/packages/components/proPageTable/oaProTableSearch/oa_pro_screen.vue +19 -10
- package/packages/components/proPageTable/oaProTableSearch/oa_pro_screen_item.vue +28 -27
- package/packages/components/proPageTable/oa_pro_colum_config.vue +8 -10
- package/packages/components/proPageTable/oa_pro_footer.vue +15 -15
- package/packages/components/proPageTable/oa_pro_table-header.vue +19 -31
- package/packages/components/proPageTable/oa_pro_table.vue +208 -284
- package/packages/components/proPageTable/oa_pro_table_check_handle_bar.vue +28 -16
- package/packages/components/searchHeader/searchHeader.vue +16 -17
- package/packages/components/style/font-family.less +2 -1
- package/packages/components/style/index.less +9 -2
- package/packages/components/style/meixioacomponenticonfont/TCloudNumberVF.ttf +0 -0
- package/packages/components/style/tableStyle.less +15 -13
- package/packages/components/style/tdesignStyle.less +9 -0
- package/packages/components/style/variables.less +1 -1
- package/packages/config/use/UseImg.js +1 -0
- package/packages/config/use/UseImg.ts +1 -0
- package/packages/utils/upload.js +61 -72
- package/packages/utils/utils.js +316 -276
- package/lib/fonts/element-icons.f1a45d74.ttf +0 -0
- package/lib/fonts/element-icons.ff18efd1.woff +0 -0
- package/lib/style/element/common_class.less +0 -3
- package/lib/style/element/fonts/element-icons.ttf +0 -0
- package/lib/style/element/fonts/element-icons.woff +0 -0
- package/lib/style/element/index.css +0 -30219
- package/packages/components/base/elDatePicker/basic/date-table.vue +0 -441
- package/packages/components/base/elDatePicker/basic/month-table.vue +0 -269
- package/packages/components/base/elDatePicker/basic/time-spinner.vue +0 -304
- package/packages/components/base/elDatePicker/basic/year-table.vue +0 -111
- package/packages/components/base/elDatePicker/index.js +0 -6
- package/packages/components/base/elDatePicker/index.vue +0 -28
- package/packages/components/base/elDatePicker/panel/date-range.vue +0 -680
- package/packages/components/base/elDatePicker/panel/date.vue +0 -609
- package/packages/components/base/elDatePicker/panel/month-range.vue +0 -289
- package/packages/components/base/elDatePicker/panel/time-range.vue +0 -248
- package/packages/components/base/elDatePicker/panel/time-select.vue +0 -178
- package/packages/components/base/elDatePicker/panel/time.vue +0 -186
- package/packages/components/base/elDatePicker/picker/date-picker.js +0 -55
- package/packages/components/base/elDatePicker/picker/time-picker.js +0 -39
- package/packages/components/base/elDatePicker/picker/time-select.js +0 -21
- package/packages/components/base/elDatePicker/picker.vue +0 -956
- package/packages/components/style/element/common_class.less +0 -3
- package/packages/components/style/element/fonts/element-icons.ttf +0 -0
- package/packages/components/style/element/fonts/element-icons.woff +0 -0
- package/packages/components/style/element/index.css +0 -30219
|
@@ -1,90 +1,88 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div v-if="isShow" class="dialog-wrap">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
v-if="isCache"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
:event="true"
|
|
50
|
-
:name="`meixicomponenticon-close`"
|
|
51
|
-
:size="`d`"
|
|
52
|
-
@iconClick="onHandleClose"
|
|
53
|
-
></base-icon>
|
|
54
|
-
|
|
55
|
-
<slot name="dialog-title-right-plugin"></slot>
|
|
3
|
+
|
|
4
|
+
<t-dialog
|
|
5
|
+
ref="dialog"
|
|
6
|
+
:footer="false"
|
|
7
|
+
:header="false"
|
|
8
|
+
:closeBtn="false"
|
|
9
|
+
:attach="attach" :showOverlay="modal" :closeOnOverlayClick="false" :closeOnEscKeydown="false"
|
|
10
|
+
:top="top"
|
|
11
|
+
:destroy-on-close="destroyOnClose"
|
|
12
|
+
:width="width" :visible.sync="centerDialogVisible">
|
|
13
|
+
|
|
14
|
+
<template #body>
|
|
15
|
+
|
|
16
|
+
<base-wait
|
|
17
|
+
:duration="0"
|
|
18
|
+
:show-overlay="true"
|
|
19
|
+
:wait="status === 'wait'"
|
|
20
|
+
:wait-text="waitText"
|
|
21
|
+
>
|
|
22
|
+
<div slot="waitContent" class="dialog__content">
|
|
23
|
+
<div ref="dialogTitleWrap" class="dialog-title-wrap">
|
|
24
|
+
<span>{{ title }}</span>
|
|
25
|
+
<div class="title-handle-wrap">
|
|
26
|
+
|
|
27
|
+
<t-button shape="square" variant="outline" v-if="isCache" @click="handleCache">
|
|
28
|
+
<template #icon>
|
|
29
|
+
<remove-icon
|
|
30
|
+
></remove-icon>
|
|
31
|
+
</template>
|
|
32
|
+
</t-button>
|
|
33
|
+
|
|
34
|
+
<drag-move-icon
|
|
35
|
+
v-if="onDrag"
|
|
36
|
+
ref="dragIcon"
|
|
37
|
+
></drag-move-icon>
|
|
38
|
+
|
|
39
|
+
<t-button shape="square" variant="outline" v-if="hasCloseIcon" @click="onHandleClose">
|
|
40
|
+
<template #icon>
|
|
41
|
+
<close-icon
|
|
42
|
+
></close-icon>
|
|
43
|
+
</template>
|
|
44
|
+
</t-button>
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
<slot name="dialog-title-right-plugin"></slot>
|
|
48
|
+
</div>
|
|
56
49
|
</div>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
50
|
+
<div v-show="status !== 'loading'">
|
|
51
|
+
<base-list
|
|
52
|
+
ref="baseListRef"
|
|
53
|
+
:noresize="false"
|
|
54
|
+
:style="dialogContentStyle"
|
|
55
|
+
class="dialog-content-wrap"
|
|
56
|
+
>
|
|
57
|
+
<slot name="dialog-content"></slot>
|
|
58
|
+
</base-list>
|
|
59
|
+
|
|
60
|
+
<div class="dialog__footer__wrap">
|
|
61
|
+
<slot name="dialog-footer"></slot>
|
|
62
|
+
</div>
|
|
70
63
|
</div>
|
|
71
64
|
</div>
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
</
|
|
76
|
-
</
|
|
77
|
-
|
|
65
|
+
<div v-if="status === 'loading'" slot="waitContent">
|
|
66
|
+
<dialog-skeleton></dialog-skeleton>
|
|
67
|
+
</div>
|
|
68
|
+
</base-wait>
|
|
69
|
+
</template>
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
</t-dialog>
|
|
73
|
+
|
|
74
|
+
|
|
78
75
|
</div>
|
|
79
76
|
</template>
|
|
80
77
|
|
|
81
78
|
<script>
|
|
82
|
-
import UseDrag from "../../../config/use/useDrag";
|
|
83
79
|
import DialogSkeleton from "./dialogSkeleton";
|
|
80
|
+
import UseDrag from "../../../config/use/useDrag";
|
|
81
|
+
import {CloseIcon, DragMoveIcon, RemoveIcon} from "tdesign-icons-vue"
|
|
84
82
|
|
|
85
83
|
export default {
|
|
86
84
|
name: "baseDialog",
|
|
87
|
-
components: {
|
|
85
|
+
components: {DialogSkeleton, RemoveIcon, CloseIcon, DragMoveIcon},
|
|
88
86
|
data() {
|
|
89
87
|
return {
|
|
90
88
|
isShow: true,
|
|
@@ -94,9 +92,10 @@ export default {
|
|
|
94
92
|
};
|
|
95
93
|
},
|
|
96
94
|
|
|
97
|
-
mounted() {
|
|
95
|
+
mounted() {
|
|
96
|
+
},
|
|
98
97
|
beforeDestroy() {
|
|
99
|
-
const {
|
|
98
|
+
const {isCache} = this.$props;
|
|
100
99
|
if (isCache) {
|
|
101
100
|
this.$store.dispatch("dialogCacheStore/closeCache", this);
|
|
102
101
|
}
|
|
@@ -132,7 +131,7 @@ export default {
|
|
|
132
131
|
// 是否关闭后销毁dom
|
|
133
132
|
isDestroy: {
|
|
134
133
|
type: Boolean,
|
|
135
|
-
default:
|
|
134
|
+
default: true,
|
|
136
135
|
},
|
|
137
136
|
// 关闭前的回调方法
|
|
138
137
|
beforeClose: {
|
|
@@ -196,24 +195,35 @@ export default {
|
|
|
196
195
|
};
|
|
197
196
|
},
|
|
198
197
|
destroyOnClose() {
|
|
199
|
-
const {
|
|
198
|
+
const {isDestroy, isCache} = this.$props;
|
|
200
199
|
if (isCache) {
|
|
201
200
|
return false;
|
|
202
201
|
}
|
|
203
202
|
return isDestroy;
|
|
204
203
|
},
|
|
205
|
-
},
|
|
206
|
-
methods: {
|
|
207
|
-
init() {
|
|
208
|
-
let target = this.$refs.dialog.$el.childNodes[0];
|
|
209
204
|
|
|
210
|
-
|
|
211
|
-
|
|
205
|
+
attach() {
|
|
206
|
+
if (this.$props.appendToBody) {
|
|
207
|
+
return () => {
|
|
208
|
+
return document.body;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
return ''
|
|
212
|
+
}
|
|
212
213
|
|
|
213
|
-
target.style.cssText += `top:${parseInt(
|
|
214
|
-
this.$props.top
|
|
215
|
-
)}px;left:${left}px;margin:0px !important`;
|
|
216
214
|
|
|
215
|
+
},
|
|
216
|
+
methods: {
|
|
217
|
+
init() {
|
|
218
|
+
// let target = this.$refs.dialog.$el.childNodes[0];
|
|
219
|
+
//
|
|
220
|
+
// let left =
|
|
221
|
+
// (document.documentElement.clientWidth - target.clientWidth) / 2;
|
|
222
|
+
//
|
|
223
|
+
// target.style.cssText += `top:${parseInt(
|
|
224
|
+
// this.$props.top
|
|
225
|
+
// )}px;left:${left}px;margin:0px !important`;
|
|
226
|
+
//
|
|
217
227
|
this.$nextTick(() => {
|
|
218
228
|
if (this.$props.onDrag) {
|
|
219
229
|
let iconEl = this.$refs.dragIcon.$el;
|
|
@@ -232,7 +242,8 @@ export default {
|
|
|
232
242
|
this.useDrag = new UseDrag({
|
|
233
243
|
target: target,
|
|
234
244
|
handle: target.childNodes[0],
|
|
235
|
-
onDragEnd: () => {
|
|
245
|
+
onDragEnd: () => {
|
|
246
|
+
},
|
|
236
247
|
});
|
|
237
248
|
this.$nextTick(() => {
|
|
238
249
|
this.useDrag.startDrag(e);
|
|
@@ -256,7 +267,7 @@ export default {
|
|
|
256
267
|
});
|
|
257
268
|
},
|
|
258
269
|
closeDialog() {
|
|
259
|
-
const {
|
|
270
|
+
const {isDestroy} = this.$props;
|
|
260
271
|
this.onUnListen();
|
|
261
272
|
if (isDestroy) {
|
|
262
273
|
this.isShow = false;
|
|
@@ -268,7 +279,7 @@ export default {
|
|
|
268
279
|
}
|
|
269
280
|
},
|
|
270
281
|
onHandleClose() {
|
|
271
|
-
const {
|
|
282
|
+
const {beforeClose, closeNotice} = this.$props;
|
|
272
283
|
if (beforeClose) {
|
|
273
284
|
// 先执行传入的方法 this.closeDialog 再手动执行关闭的方法
|
|
274
285
|
this.beforeClose(this.closeDialog);
|
|
@@ -288,21 +299,39 @@ export default {
|
|
|
288
299
|
this.closeDialog();
|
|
289
300
|
return;
|
|
290
301
|
}
|
|
291
|
-
this.$confirm(`${this.noticeText}`, "提示", {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
})
|
|
296
|
-
|
|
302
|
+
// this.$confirm(`${this.noticeText}`, "提示", {
|
|
303
|
+
// type: "warning",
|
|
304
|
+
// cancelButtonText: "取消",
|
|
305
|
+
// confirmButtonText: "确定",
|
|
306
|
+
// })
|
|
307
|
+
// .then((res) => {
|
|
308
|
+
// this.closeDialog();
|
|
309
|
+
// })
|
|
310
|
+
// .catch(() => {
|
|
311
|
+
// });
|
|
312
|
+
|
|
313
|
+
const confirmDia = this.$dialog.confirm({
|
|
314
|
+
header: '关闭对话框',
|
|
315
|
+
body: `${this.noticeText}`,
|
|
316
|
+
confirmBtn: '确定',
|
|
317
|
+
cancelBtn: '取消',
|
|
318
|
+
onConfirm: ({e}) => {
|
|
319
|
+
confirmDia.destroy();
|
|
297
320
|
this.closeDialog();
|
|
298
|
-
}
|
|
299
|
-
|
|
321
|
+
},
|
|
322
|
+
onClose: ({e, trigger}) => {
|
|
323
|
+
confirmDia.destroy();
|
|
324
|
+
},
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
|
|
300
328
|
},
|
|
301
329
|
onUnListen() {
|
|
302
330
|
try {
|
|
303
331
|
let iconEl = this.$refs.dragIcon.$el;
|
|
304
332
|
iconEl.removeEventListener("mousedown", this.startDrag);
|
|
305
|
-
} catch (error) {
|
|
333
|
+
} catch (error) {
|
|
334
|
+
}
|
|
306
335
|
},
|
|
307
336
|
},
|
|
308
337
|
};
|
|
@@ -318,9 +347,9 @@ export default {
|
|
|
318
347
|
position: relative;
|
|
319
348
|
|
|
320
349
|
|
|
321
|
-
/deep
|
|
322
|
-
|
|
323
|
-
}
|
|
350
|
+
/deep/ .el-scrollbar__view {
|
|
351
|
+
height: 100%;
|
|
352
|
+
}
|
|
324
353
|
}
|
|
325
354
|
|
|
326
355
|
.dialog-content-wrap {
|
|
@@ -1,58 +1,59 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
@close="close"
|
|
16
|
-
@closed="drawerClosed"
|
|
17
|
-
@opened="opened"
|
|
2
|
+
|
|
3
|
+
<t-drawer ref="drawer"
|
|
4
|
+
:attach="attach"
|
|
5
|
+
:placement="placement"
|
|
6
|
+
:destroy-on-close="destroyOnClose"
|
|
7
|
+
:visible.sync="open"
|
|
8
|
+
:showOverlay="false"
|
|
9
|
+
:size="drawerSize.toString()"
|
|
10
|
+
:header="false"
|
|
11
|
+
:footer="false"
|
|
12
|
+
@close="close"
|
|
13
|
+
:close-on-esc-keydown="closeOnPressEscape"
|
|
14
|
+
:close-on-overlay-click="wrapperClosable"
|
|
18
15
|
>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<div v-
|
|
22
|
-
<div class="drawer-handle-
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
<template #body>
|
|
17
|
+
<!-- 插槽插入你需要渲染的内容 -->
|
|
18
|
+
<div v-clickOutside="closeDrawerByOutside" class="drawer-content-wrap">
|
|
19
|
+
<div v-if="handleShow" :style="handleStyle" class="drawer-handle-wrap">
|
|
20
|
+
<div class="drawer-handle-content">
|
|
21
|
+
|
|
22
|
+
<base-button type="primary" size="small" shape="square" variant="base" @click="hiddenDrawer"
|
|
23
|
+
style="margin-top: 100px;width: 44px;height: 44px">
|
|
24
|
+
<template #icon>
|
|
25
|
+
<close-icon></close-icon>
|
|
26
|
+
</template>
|
|
27
|
+
</base-button>
|
|
28
|
+
|
|
29
|
+
<div ref="handleResize" class="drawer-handle-resize"></div>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="drawer-container-wrap" :style="containerStyle">
|
|
33
|
+
<div v-if="header" class="drawer-content-title">
|
|
34
|
+
{{ title }}
|
|
35
|
+
</div>
|
|
36
|
+
<!--成功的状态-->
|
|
37
|
+
<base-list
|
|
38
|
+
v-if="status !== 'error'"
|
|
39
|
+
v-show="status === 'success'"
|
|
40
|
+
:style="contentStyle"
|
|
41
|
+
class="drawer-content"
|
|
42
|
+
>
|
|
43
|
+
<slot name="drawer-content"></slot>
|
|
44
|
+
</base-list>
|
|
45
|
+
<!--骨架屏-->
|
|
46
|
+
<drawer-skeleton v-if="status === 'loading'"></drawer-skeleton>
|
|
47
|
+
<!--错误状态-->
|
|
48
|
+
<drawer-error
|
|
49
|
+
:style="contentStyle"
|
|
50
|
+
v-if="status === 'error'"
|
|
51
|
+
:default-text="defaultText"
|
|
52
|
+
></drawer-error>
|
|
31
53
|
</div>
|
|
32
54
|
</div>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
{{ title }}
|
|
36
|
-
</div>
|
|
37
|
-
<!--成功的状态-->
|
|
38
|
-
<base-list
|
|
39
|
-
v-if="status !== 'error'"
|
|
40
|
-
v-show="status === 'success'"
|
|
41
|
-
:noresize="false"
|
|
42
|
-
:style="contentStyle"
|
|
43
|
-
class="drawer-content"
|
|
44
|
-
>
|
|
45
|
-
<slot name="drawer-content"></slot>
|
|
46
|
-
</base-list>
|
|
47
|
-
<!--骨架屏-->
|
|
48
|
-
<drawer-skeleton v-if="status === 'loading'"></drawer-skeleton>
|
|
49
|
-
<!--错误状态-->
|
|
50
|
-
<drawer-error
|
|
51
|
-
v-if="status === 'error'"
|
|
52
|
-
:default-text="defaultText"
|
|
53
|
-
></drawer-error>
|
|
54
|
-
</div>
|
|
55
|
-
</el-drawer>
|
|
55
|
+
</template>
|
|
56
|
+
</t-drawer>
|
|
56
57
|
</template>
|
|
57
58
|
|
|
58
59
|
<script>
|
|
@@ -62,6 +63,7 @@ import DrawerSkeleton from "./drawerSkeleton";
|
|
|
62
63
|
import drawerController from "./drawerController";
|
|
63
64
|
//
|
|
64
65
|
import UseResize from "../../../config/use/UseResize";
|
|
66
|
+
import {CloseIcon} from "tdesign-icons-vue"
|
|
65
67
|
|
|
66
68
|
export default {
|
|
67
69
|
name: "baseDrawer",
|
|
@@ -69,34 +71,16 @@ export default {
|
|
|
69
71
|
return {
|
|
70
72
|
open: false,
|
|
71
73
|
useResize: null,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
ignoreList: [
|
|
75
|
-
"el-image-viewer__wrapper",
|
|
76
|
-
"guide-content-wrap",
|
|
77
|
-
"base-guide-overlay",
|
|
78
|
-
"el-drawer__wrapper",
|
|
79
|
-
"el-message-box__wrapper",
|
|
80
|
-
"v-modal",
|
|
81
|
-
"el-dialog__wrapper",
|
|
82
|
-
"el-drawer__container",
|
|
83
|
-
"el-message",
|
|
84
|
-
],
|
|
85
|
-
|
|
74
|
+
ignoreList: [],
|
|
86
75
|
showCloseButton: false
|
|
87
76
|
};
|
|
88
77
|
},
|
|
89
78
|
created() {
|
|
90
|
-
this.drawerSize = this.$props.size;
|
|
91
|
-
|
|
92
79
|
this.setCloseButton(this.$props.useCloseButton);
|
|
93
|
-
|
|
94
|
-
|
|
95
80
|
},
|
|
96
|
-
|
|
97
81
|
mounted() {
|
|
98
82
|
},
|
|
99
|
-
components: {DrawerError, DrawerSkeleton, baseList},
|
|
83
|
+
components: {DrawerError, DrawerSkeleton, baseList, CloseIcon},
|
|
100
84
|
props: {
|
|
101
85
|
resize: {
|
|
102
86
|
type: Boolean,
|
|
@@ -216,16 +200,20 @@ export default {
|
|
|
216
200
|
|
|
217
201
|
hiddenDrawer() {
|
|
218
202
|
if (this.isExis()) {
|
|
219
|
-
this.$
|
|
203
|
+
if (this.$props.beforeClose) {
|
|
204
|
+
this.$props.beforeClose(this.closeDrawerAfter);
|
|
205
|
+
} else {
|
|
206
|
+
this.$refs.drawer.closeDrawer();
|
|
207
|
+
}
|
|
220
208
|
}
|
|
221
209
|
},
|
|
222
210
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
// return;
|
|
227
|
-
// }
|
|
211
|
+
closeDrawerAfter() {
|
|
212
|
+
this.$refs.drawer.closeDrawer();
|
|
213
|
+
},
|
|
228
214
|
|
|
215
|
+
closeDrawerByOutside(event) {
|
|
216
|
+
if (!this.$props.wrapperClosable) return;
|
|
229
217
|
// 只需处理活跃的抽屉
|
|
230
218
|
if (this._uid === drawerController.activityId) {
|
|
231
219
|
let res = this.deepClass(event.target);
|
|
@@ -312,6 +300,30 @@ export default {
|
|
|
312
300
|
|
|
313
301
|
},
|
|
314
302
|
computed: {
|
|
303
|
+
drawerSize() {
|
|
304
|
+
if (this.handleShow) {
|
|
305
|
+
return this.$props.size + 44
|
|
306
|
+
}
|
|
307
|
+
return this.$props.size;
|
|
308
|
+
},
|
|
309
|
+
containerStyle() {
|
|
310
|
+
return {
|
|
311
|
+
width: `${this.handleShow ? "calc(100% - 44px)" : '100%'}`
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
placement() {
|
|
315
|
+
let direction = this.$props.direction;
|
|
316
|
+
switch (direction) {
|
|
317
|
+
case 'rtl':
|
|
318
|
+
return 'right';
|
|
319
|
+
case 'ltr':
|
|
320
|
+
return 'left'
|
|
321
|
+
default:
|
|
322
|
+
return 'right'
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
|
|
326
|
+
|
|
315
327
|
handleShow() {
|
|
316
328
|
let direction = this.$props.direction;
|
|
317
329
|
return direction === "rtl" || direction === "ltr";
|
|
@@ -319,7 +331,7 @@ export default {
|
|
|
319
331
|
|
|
320
332
|
contentStyle() {
|
|
321
333
|
if (this.$props.header) {
|
|
322
|
-
return {height: `calc(100% -
|
|
334
|
+
return {height: `calc(100% - 40px)`};
|
|
323
335
|
} else {
|
|
324
336
|
return {height: `calc(100%)`};
|
|
325
337
|
}
|
|
@@ -329,18 +341,30 @@ export default {
|
|
|
329
341
|
if (direction === "rtl") {
|
|
330
342
|
return {
|
|
331
343
|
width: "44px",
|
|
332
|
-
left: `calc(100% - 44px - ${this.drawerSize}px)`,
|
|
333
344
|
};
|
|
334
345
|
} else if (direction === "ltr") {
|
|
335
346
|
return {
|
|
336
347
|
width: "44px",
|
|
337
|
-
left: `calc(${this.drawerSize}px)`,
|
|
338
348
|
};
|
|
339
349
|
}
|
|
340
350
|
},
|
|
341
351
|
|
|
342
|
-
|
|
352
|
+
attach() {
|
|
353
|
+
if (this.$props.appendToBody) {
|
|
354
|
+
return () => {
|
|
355
|
+
return document.body;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
return ''
|
|
359
|
+
}
|
|
343
360
|
},
|
|
361
|
+
watch: {
|
|
362
|
+
open(newVal) {
|
|
363
|
+
if (newVal) {
|
|
364
|
+
this.opened();
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
344
368
|
};
|
|
345
369
|
</script>
|
|
346
370
|
|
|
@@ -349,7 +373,10 @@ export default {
|
|
|
349
373
|
width: 100%;
|
|
350
374
|
height: 100%;
|
|
351
375
|
overflow-y: auto;
|
|
352
|
-
|
|
376
|
+
display: flex;
|
|
377
|
+
align-items: flex-start;
|
|
378
|
+
flex-flow: row nowrap;
|
|
379
|
+
justify-content: flex-start;
|
|
353
380
|
box-sizing: border-box;
|
|
354
381
|
|
|
355
382
|
.drawer-content-title {
|
|
@@ -368,6 +395,16 @@ export default {
|
|
|
368
395
|
line-height: calc(var(--font-size-xl) + 8);
|
|
369
396
|
}
|
|
370
397
|
|
|
398
|
+
.drawer-container-wrap {
|
|
399
|
+
width: 100%;
|
|
400
|
+
height: 100%;
|
|
401
|
+
padding: var(--td-comp-paddingTB-l) var(--td-comp-paddingLR-l);
|
|
402
|
+
box-sizing: border-box;
|
|
403
|
+
box-shadow: var(--shadow-fixed);
|
|
404
|
+
background: var(--bg-white);
|
|
405
|
+
|
|
406
|
+
}
|
|
407
|
+
|
|
371
408
|
.drawer-content {
|
|
372
409
|
width: 100%;
|
|
373
410
|
overflow-y: auto;
|
|
@@ -376,27 +413,15 @@ export default {
|
|
|
376
413
|
}
|
|
377
414
|
|
|
378
415
|
.drawer-handle-wrap {
|
|
379
|
-
|
|
416
|
+
width: 0;
|
|
380
417
|
height: 100%;
|
|
381
|
-
|
|
382
|
-
background: transparent;
|
|
383
|
-
justify-content: center;
|
|
418
|
+
|
|
384
419
|
|
|
385
420
|
.drawer-handle-content {
|
|
386
421
|
width: 100%;
|
|
387
422
|
height: 100%;
|
|
388
423
|
position: relative;
|
|
389
424
|
|
|
390
|
-
.drawer-close-button {
|
|
391
|
-
right: 0;
|
|
392
|
-
top: 100px;
|
|
393
|
-
width: 40px;
|
|
394
|
-
height: 40px;
|
|
395
|
-
display: flex;
|
|
396
|
-
flex-flow: row;
|
|
397
|
-
position: absolute;
|
|
398
|
-
justify-content: center;
|
|
399
|
-
}
|
|
400
425
|
|
|
401
426
|
.drawer-handle-resize {
|
|
402
427
|
top: 0;
|