@cmstops/pro-compo 0.1.35 → 0.1.37

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.
@@ -18,12 +18,12 @@ const _sfc_main = defineComponent({
18
18
  emits: ["update:dialogVisible", "submit", "upload"],
19
19
  setup(__props, { emit: __emit }) {
20
20
  const props = __props;
21
+ const BASE_API_R = props.BASE_API || DEFAULT_BASE_API;
21
22
  const injectMediaUseType = inject("mediaUseType");
22
23
  if (!injectMediaUseType && props.mediaUseType) {
23
24
  provide("mediaUseType", props.mediaUseType || mediaUseEnum.THUMB);
24
25
  }
25
26
  provide("baseAPI", props.BASE_API || DEFAULT_BASE_API);
26
- const BASE_API = props.BASE_API || DEFAULT_BASE_API;
27
27
  const selectedMax = ref(1);
28
28
  const emit = __emit;
29
29
  const submit = (itemData) => {
@@ -66,13 +66,13 @@ const _sfc_main = defineComponent({
66
66
  createVNode(_sfc_main$1, {
67
67
  "selected-max": selectedMax.value,
68
68
  "catalog-props": _ctx.catalogProps,
69
- "b-a-s-e-a-p-i": unref(BASE_API),
69
+ BASE_API: unref(BASE_API_R),
70
70
  ai_static_covers: _ctx.ai_static_covers,
71
71
  ai_gif_covers: _ctx.ai_gif_covers,
72
72
  preview: _ctx.preview,
73
73
  onConfirm: submit,
74
- onUpload: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("upload"))
75
- }, null, 8, ["selected-max", "catalog-props", "b-a-s-e-a-p-i", "ai_static_covers", "ai_gif_covers", "preview"])
74
+ onUpload: _cache[0] || (_cache[0] = (cb) => _ctx.$emit("upload", cb))
75
+ }, null, 8, ["selected-max", "catalog-props", "BASE_API", "ai_static_covers", "ai_gif_covers", "preview"])
76
76
  ]),
77
77
  _: 1
78
78
  }, 8, ["visible"]);
@@ -29,6 +29,7 @@ const _sfc_main = defineComponent({
29
29
  const props = __props;
30
30
  const emit = __emit;
31
31
  const mediaUseType = inject("mediaUseType");
32
+ const baseApi = inject("baseAPI");
32
33
  const confirm = (itemData) => {
33
34
  emit("confirm", itemData);
34
35
  };
@@ -120,9 +121,9 @@ const _sfc_main = defineComponent({
120
121
  query = Object.assign(query, filter.value);
121
122
  folderList.value = [];
122
123
  }
123
- const promise = filter.value ? [API(props.BASE_API, query)] : [
124
- API(props.BASE_API, query),
125
- getDirectories(props.BASE_API, { parent_id: query.directory_id })
124
+ const promise = filter.value ? [API(baseApi, query)] : [
125
+ API(baseApi, query),
126
+ getDirectories(baseApi, { parent_id: query.directory_id })
126
127
  ];
127
128
  Promise.all(promise).then((res) => {
128
129
  const files = res[0].code === 0 ? res[0].message.data || [] : [];
@@ -158,6 +159,12 @@ const _sfc_main = defineComponent({
158
159
  filter.value = value === null ? null : { ...value };
159
160
  loadData();
160
161
  };
162
+ const handleUpload = () => {
163
+ emit("upload", () => {
164
+ getFilesQueryParam.value.offset = 0;
165
+ loadData({ more: false });
166
+ });
167
+ };
161
168
  return (_ctx, _cache) => {
162
169
  return openBlock(), createElementBlock("div", _hoisted_1, [
163
170
  createElementVNode("div", _hoisted_2, [
@@ -215,9 +222,9 @@ const _sfc_main = defineComponent({
215
222
  ref: getMoreData,
216
223
  class: "tool-search-box",
217
224
  "active-media-type": activeMediaType.value,
218
- "b-a-s-e-a-p-i": _ctx.BASE_API,
225
+ BASE_API: unref(baseApi),
219
226
  onSearch: search,
220
- onUpload: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("upload"))
227
+ onUpload: handleUpload
221
228
  }, {
222
229
  other: withCtx(() => [
223
230
  breadCrumbs.value.length > 1 ? (openBlock(), createBlock(unref(Button), {
@@ -234,7 +241,7 @@ const _sfc_main = defineComponent({
234
241
  })) : createCommentVNode("v-if", true)
235
242
  ]),
236
243
  _: 1
237
- }, 8, ["active-media-type", "b-a-s-e-a-p-i"])
244
+ }, 8, ["active-media-type", "BASE_API"])
238
245
  ]),
239
246
  breadCrumbs.value.length > 1 ? (openBlock(), createBlock(unref(Breadcrumb), {
240
247
  key: 0,
@@ -412,7 +412,7 @@ const _sfc_main = defineComponent({
412
412
  ai_static_covers: _ctx.aiImages,
413
413
  BASE_API: unref(BASE_API),
414
414
  onSubmit: submitCallback,
415
- onUpload: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("upload"))
415
+ onUpload: _cache[3] || (_cache[3] = (cb) => _ctx.$emit("upload", cb))
416
416
  }, null, 8, ["dialogVisible", "ai_static_covers", "BASE_API"]),
417
417
  createVNode(_sfc_main$4, {
418
418
  visible: dialogCropperShow.value,
@@ -19,12 +19,12 @@ const _sfc_main = vue.defineComponent({
19
19
  emits: ["update:dialogVisible", "submit", "upload"],
20
20
  setup(__props, { emit: __emit }) {
21
21
  const props = __props;
22
+ const BASE_API_R = props.BASE_API || config.DEFAULT_BASE_API;
22
23
  const injectMediaUseType = vue.inject("mediaUseType");
23
24
  if (!injectMediaUseType && props.mediaUseType) {
24
25
  vue.provide("mediaUseType", props.mediaUseType || mediaSelection.mediaUseEnum.THUMB);
25
26
  }
26
27
  vue.provide("baseAPI", props.BASE_API || config.DEFAULT_BASE_API);
27
- const BASE_API = props.BASE_API || config.DEFAULT_BASE_API;
28
28
  const selectedMax = vue.ref(1);
29
29
  const emit = __emit;
30
30
  const submit = (itemData) => {
@@ -67,13 +67,13 @@ const _sfc_main = vue.defineComponent({
67
67
  vue.createVNode(index, {
68
68
  "selected-max": selectedMax.value,
69
69
  "catalog-props": _ctx.catalogProps,
70
- "b-a-s-e-a-p-i": vue.unref(BASE_API),
70
+ BASE_API: vue.unref(BASE_API_R),
71
71
  ai_static_covers: _ctx.ai_static_covers,
72
72
  ai_gif_covers: _ctx.ai_gif_covers,
73
73
  preview: _ctx.preview,
74
74
  onConfirm: submit,
75
- onUpload: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("upload"))
76
- }, null, 8, ["selected-max", "catalog-props", "b-a-s-e-a-p-i", "ai_static_covers", "ai_gif_covers", "preview"])
75
+ onUpload: _cache[0] || (_cache[0] = (cb) => _ctx.$emit("upload", cb))
76
+ }, null, 8, ["selected-max", "catalog-props", "BASE_API", "ai_static_covers", "ai_gif_covers", "preview"])
77
77
  ]),
78
78
  _: 1
79
79
  }, 8, ["visible"]);
@@ -30,6 +30,7 @@ const _sfc_main = vue.defineComponent({
30
30
  const props = __props;
31
31
  const emit = __emit;
32
32
  const mediaUseType = vue.inject("mediaUseType");
33
+ const baseApi = vue.inject("baseAPI");
33
34
  const confirm = (itemData) => {
34
35
  emit("confirm", itemData);
35
36
  };
@@ -121,9 +122,9 @@ const _sfc_main = vue.defineComponent({
121
122
  query = Object.assign(query, filter.value);
122
123
  folderList.value = [];
123
124
  }
124
- const promise = filter.value ? [API(props.BASE_API, query)] : [
125
- API(props.BASE_API, query),
126
- api.getDirectories(props.BASE_API, { parent_id: query.directory_id })
125
+ const promise = filter.value ? [API(baseApi, query)] : [
126
+ API(baseApi, query),
127
+ api.getDirectories(baseApi, { parent_id: query.directory_id })
127
128
  ];
128
129
  Promise.all(promise).then((res) => {
129
130
  const files = res[0].code === 0 ? res[0].message.data || [] : [];
@@ -159,6 +160,12 @@ const _sfc_main = vue.defineComponent({
159
160
  filter.value = value === null ? null : { ...value };
160
161
  loadData();
161
162
  };
163
+ const handleUpload = () => {
164
+ emit("upload", () => {
165
+ getFilesQueryParam.value.offset = 0;
166
+ loadData({ more: false });
167
+ });
168
+ };
162
169
  return (_ctx, _cache) => {
163
170
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
164
171
  vue.createElementVNode("div", _hoisted_2, [
@@ -216,9 +223,9 @@ const _sfc_main = vue.defineComponent({
216
223
  ref: getMoreData,
217
224
  class: "tool-search-box",
218
225
  "active-media-type": activeMediaType.value,
219
- "b-a-s-e-a-p-i": _ctx.BASE_API,
226
+ BASE_API: vue.unref(baseApi),
220
227
  onSearch: search,
221
- onUpload: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("upload"))
228
+ onUpload: handleUpload
222
229
  }, {
223
230
  other: vue.withCtx(() => [
224
231
  breadCrumbs.value.length > 1 ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Button), {
@@ -235,7 +242,7 @@ const _sfc_main = vue.defineComponent({
235
242
  })) : vue.createCommentVNode("v-if", true)
236
243
  ]),
237
244
  _: 1
238
- }, 8, ["active-media-type", "b-a-s-e-a-p-i"])
245
+ }, 8, ["active-media-type", "BASE_API"])
239
246
  ]),
240
247
  breadCrumbs.value.length > 1 ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Breadcrumb), {
241
248
  key: 0,
@@ -413,7 +413,7 @@ const _sfc_main = vue.defineComponent({
413
413
  ai_static_covers: _ctx.aiImages,
414
414
  BASE_API: vue.unref(BASE_API),
415
415
  onSubmit: submitCallback,
416
- onUpload: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("upload"))
416
+ onUpload: _cache[3] || (_cache[3] = (cb) => _ctx.$emit("upload", cb))
417
417
  }, null, 8, ["dialogVisible", "ai_static_covers", "BASE_API"]),
418
418
  vue.createVNode(component$1, {
419
419
  visible: dialogCropperShow.value,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmstops/pro-compo",
3
- "version": "0.1.35",
3
+ "version": "0.1.37",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "vue",