@cmstops/pro-compo 0.3.72 → 0.3.73
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/es/selectResourceModal/component.js +17 -4
- package/es/selectResourceModal/scripts/useCompoLf.d.ts +8 -2
- package/es/selectResourceModal/scripts/useCompoLf.js +11 -5
- package/es/selectResourceModal/scripts/useTabFilter.js +0 -1
- package/lib/selectResourceModal/component.js +16 -3
- package/lib/selectResourceModal/scripts/useCompoLf.js +11 -5
- package/lib/selectResourceModal/scripts/useTabFilter.js +0 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, openBlock, createElementBlock, createBlock, resolveDynamicComponent, unref, mergeProps, withCtx, createElementVNode, createCommentVNode, createVNode, isRef, Fragment, createTextVNode } from "vue";
|
|
1
|
+
import { defineComponent, watch, openBlock, createElementBlock, createBlock, resolveDynamicComponent, unref, mergeProps, withCtx, createElementVNode, createCommentVNode, createVNode, isRef, Fragment, createTextVNode } from "vue";
|
|
2
2
|
import { Drawer, Modal, Button } from "@arco-design/web-vue";
|
|
3
3
|
import emptyData from "../emptyData/index.js";
|
|
4
4
|
import _sfc_main$1 from "./components/ListTabs/index.js";
|
|
@@ -33,7 +33,19 @@ const _sfc_main = defineComponent({
|
|
|
33
33
|
const emits = __emit;
|
|
34
34
|
const { selected, selectedKeys, disableSelect, handleSelect, handleClear } = useResourceSelect(props);
|
|
35
35
|
const { activeKey, activeComponent, tabKeyList, handelChangeTab } = useTabFilter(props);
|
|
36
|
-
const { wrapProps, close, submit } = useCompoentLifycycle(props, emits
|
|
36
|
+
const { wrapProps, close, submit } = useCompoentLifycycle(props, emits, {
|
|
37
|
+
onClose: () => {
|
|
38
|
+
handleClear();
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
watch(
|
|
42
|
+
() => props.visible,
|
|
43
|
+
(val) => {
|
|
44
|
+
if (val)
|
|
45
|
+
activeKey.value = tabKeyList.value[0].key;
|
|
46
|
+
},
|
|
47
|
+
{ immediate: true }
|
|
48
|
+
);
|
|
37
49
|
const handleOptions = (options, handleOptions2) => {
|
|
38
50
|
const { key, item } = options;
|
|
39
51
|
if (key === "select-one") {
|
|
@@ -70,7 +82,8 @@ const _sfc_main = defineComponent({
|
|
|
70
82
|
onClose: unref(close)
|
|
71
83
|
}, null, 8, ["model-value", "tabList", "onClose"]),
|
|
72
84
|
createCommentVNode(" \u5217\u8868\u5206\u53D1\u5668 "),
|
|
73
|
-
(openBlock(), createBlock(resolveDynamicComponent(unref(activeComponent)), {
|
|
85
|
+
_ctx.visible ? (openBlock(), createBlock(resolveDynamicComponent(unref(activeComponent)), {
|
|
86
|
+
key: 0,
|
|
74
87
|
"active-key": unref(activeKey),
|
|
75
88
|
onChangeTab: unref(handelChangeTab)
|
|
76
89
|
}, {
|
|
@@ -136,7 +149,7 @@ const _sfc_main = defineComponent({
|
|
|
136
149
|
], 64))
|
|
137
150
|
]),
|
|
138
151
|
_: 1
|
|
139
|
-
}, 40, ["active-key", "onChangeTab"]))
|
|
152
|
+
}, 40, ["active-key", "onChangeTab"])) : createCommentVNode("v-if", true)
|
|
140
153
|
])) : (openBlock(), createBlock(unref(emptyData), {
|
|
141
154
|
key: 1,
|
|
142
155
|
type: "empty",
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
declare type LifeCycleHandler = {
|
|
2
|
+
onClose: () => void;
|
|
3
|
+
};
|
|
4
|
+
export default function useCompoentLifycycle(props: any, emits: any, handler?: LifeCycleHandler): {
|
|
2
5
|
wrapProps: import("vue").ComputedRef<{
|
|
3
6
|
class: string;
|
|
4
7
|
header: boolean;
|
|
5
8
|
width: string;
|
|
6
9
|
footer: boolean;
|
|
10
|
+
unmountOnClose: boolean;
|
|
7
11
|
bodyClass?: undefined;
|
|
8
12
|
closable?: undefined;
|
|
9
13
|
hideTitle?: undefined;
|
|
@@ -13,9 +17,11 @@ export default function useCompoentLifycycle(props: any, emits: any): {
|
|
|
13
17
|
closable: boolean;
|
|
14
18
|
hideTitle: boolean;
|
|
15
19
|
footer: boolean;
|
|
20
|
+
unmountOnClose: boolean;
|
|
16
21
|
class?: undefined;
|
|
17
22
|
header?: undefined;
|
|
18
23
|
}>;
|
|
19
|
-
close: () =>
|
|
24
|
+
close: () => void;
|
|
20
25
|
submit: (data: any, ...args: any) => void;
|
|
21
26
|
};
|
|
27
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed, provide } from "vue";
|
|
2
2
|
import { DEFAULT_BASE_API } from "../../config.js";
|
|
3
|
-
function useCompoentLifycycle(props, emits) {
|
|
3
|
+
function useCompoentLifycycle(props, emits, handler) {
|
|
4
4
|
const BASE_API = props.BASE_API || DEFAULT_BASE_API;
|
|
5
5
|
const wrapProps = computed(() => {
|
|
6
6
|
if (props.wrap === "drawer") {
|
|
@@ -8,7 +8,8 @@ function useCompoentLifycycle(props, emits) {
|
|
|
8
8
|
class: "resource-select-drawer",
|
|
9
9
|
header: false,
|
|
10
10
|
width: "1024px",
|
|
11
|
-
footer: false
|
|
11
|
+
footer: false,
|
|
12
|
+
unmountOnClose: true
|
|
12
13
|
};
|
|
13
14
|
}
|
|
14
15
|
return {
|
|
@@ -16,7 +17,8 @@ function useCompoentLifycycle(props, emits) {
|
|
|
16
17
|
width: "986px",
|
|
17
18
|
closable: false,
|
|
18
19
|
hideTitle: false,
|
|
19
|
-
footer: false
|
|
20
|
+
footer: false,
|
|
21
|
+
unmountOnClose: true
|
|
20
22
|
};
|
|
21
23
|
});
|
|
22
24
|
provide("baseAPI", BASE_API);
|
|
@@ -25,12 +27,16 @@ function useCompoentLifycycle(props, emits) {
|
|
|
25
27
|
provide("mediaUseType", computed(() => props.mediaUseType));
|
|
26
28
|
provide("aiThumbList", computed(() => props.aiThumbList));
|
|
27
29
|
provide("videoThumbOptions", computed(() => props.videoThumbOptions));
|
|
30
|
+
function close() {
|
|
31
|
+
emits("update:visible", false);
|
|
32
|
+
handler == null ? void 0 : handler.onClose();
|
|
33
|
+
}
|
|
28
34
|
return {
|
|
29
35
|
wrapProps,
|
|
30
|
-
close
|
|
36
|
+
close,
|
|
31
37
|
submit: (data, ...args) => {
|
|
32
38
|
emits("submit", JSON.parse(JSON.stringify(data)), ...args);
|
|
33
|
-
|
|
39
|
+
close();
|
|
34
40
|
}
|
|
35
41
|
};
|
|
36
42
|
}
|
|
@@ -34,7 +34,19 @@ const _sfc_main = vue.defineComponent({
|
|
|
34
34
|
const emits = __emit;
|
|
35
35
|
const { selected, selectedKeys, disableSelect, handleSelect, handleClear } = useResourceSelect.useResourceSelect(props);
|
|
36
36
|
const { activeKey, activeComponent, tabKeyList, handelChangeTab } = useTabFilter(props);
|
|
37
|
-
const { wrapProps, close, submit } = useCompoLf(props, emits
|
|
37
|
+
const { wrapProps, close, submit } = useCompoLf(props, emits, {
|
|
38
|
+
onClose: () => {
|
|
39
|
+
handleClear();
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
vue.watch(
|
|
43
|
+
() => props.visible,
|
|
44
|
+
(val) => {
|
|
45
|
+
if (val)
|
|
46
|
+
activeKey.value = tabKeyList.value[0].key;
|
|
47
|
+
},
|
|
48
|
+
{ immediate: true }
|
|
49
|
+
);
|
|
38
50
|
const handleOptions = (options, handleOptions2) => {
|
|
39
51
|
const { key, item } = options;
|
|
40
52
|
if (key === "select-one") {
|
|
@@ -71,7 +83,8 @@ const _sfc_main = vue.defineComponent({
|
|
|
71
83
|
onClose: vue.unref(close)
|
|
72
84
|
}, null, 8, ["model-value", "tabList", "onClose"]),
|
|
73
85
|
vue.createCommentVNode(" \u5217\u8868\u5206\u53D1\u5668 "),
|
|
74
|
-
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(activeComponent)), {
|
|
86
|
+
_ctx.visible ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(activeComponent)), {
|
|
87
|
+
key: 0,
|
|
75
88
|
"active-key": vue.unref(activeKey),
|
|
76
89
|
onChangeTab: vue.unref(handelChangeTab)
|
|
77
90
|
}, {
|
|
@@ -137,7 +150,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
137
150
|
], 64))
|
|
138
151
|
]),
|
|
139
152
|
_: 1
|
|
140
|
-
}, 40, ["active-key", "onChangeTab"]))
|
|
153
|
+
}, 40, ["active-key", "onChangeTab"])) : vue.createCommentVNode("v-if", true)
|
|
141
154
|
])) : (vue.openBlock(), vue.createBlock(vue.unref(index$2), {
|
|
142
155
|
key: 1,
|
|
143
156
|
type: "empty",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var vue = require("vue");
|
|
3
3
|
var config = require("../../config.js");
|
|
4
|
-
function useCompoentLifycycle(props, emits) {
|
|
4
|
+
function useCompoentLifycycle(props, emits, handler) {
|
|
5
5
|
const BASE_API = props.BASE_API || config.DEFAULT_BASE_API;
|
|
6
6
|
const wrapProps = vue.computed(() => {
|
|
7
7
|
if (props.wrap === "drawer") {
|
|
@@ -9,7 +9,8 @@ function useCompoentLifycycle(props, emits) {
|
|
|
9
9
|
class: "resource-select-drawer",
|
|
10
10
|
header: false,
|
|
11
11
|
width: "1024px",
|
|
12
|
-
footer: false
|
|
12
|
+
footer: false,
|
|
13
|
+
unmountOnClose: true
|
|
13
14
|
};
|
|
14
15
|
}
|
|
15
16
|
return {
|
|
@@ -17,7 +18,8 @@ function useCompoentLifycycle(props, emits) {
|
|
|
17
18
|
width: "986px",
|
|
18
19
|
closable: false,
|
|
19
20
|
hideTitle: false,
|
|
20
|
-
footer: false
|
|
21
|
+
footer: false,
|
|
22
|
+
unmountOnClose: true
|
|
21
23
|
};
|
|
22
24
|
});
|
|
23
25
|
vue.provide("baseAPI", BASE_API);
|
|
@@ -26,12 +28,16 @@ function useCompoentLifycycle(props, emits) {
|
|
|
26
28
|
vue.provide("mediaUseType", vue.computed(() => props.mediaUseType));
|
|
27
29
|
vue.provide("aiThumbList", vue.computed(() => props.aiThumbList));
|
|
28
30
|
vue.provide("videoThumbOptions", vue.computed(() => props.videoThumbOptions));
|
|
31
|
+
function close() {
|
|
32
|
+
emits("update:visible", false);
|
|
33
|
+
handler == null ? void 0 : handler.onClose();
|
|
34
|
+
}
|
|
29
35
|
return {
|
|
30
36
|
wrapProps,
|
|
31
|
-
close
|
|
37
|
+
close,
|
|
32
38
|
submit: (data, ...args) => {
|
|
33
39
|
emits("submit", JSON.parse(JSON.stringify(data)), ...args);
|
|
34
|
-
|
|
40
|
+
close();
|
|
35
41
|
}
|
|
36
42
|
};
|
|
37
43
|
}
|