@cmstops/pro-compo 0.3.48 → 0.3.49

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.
@@ -23,7 +23,7 @@ function getAttachmentsMyMessage(BASE_API, query) {
23
23
  }
24
24
  function useAttachement(options) {
25
25
  const key = ref(options.key);
26
- const limit = ref(20);
26
+ const limit = ref(30);
27
27
  const offset = ref(0);
28
28
  const filter = ref({});
29
29
  const params = computed(() => {
@@ -28,7 +28,7 @@ function useUpload() {
28
28
  const originList = list.value;
29
29
  const taskIndex = originList.findIndex((task) => task.id === file.id);
30
30
  if (taskIndex !== -1) {
31
- progress !== -1 && (originList[taskIndex].progress = Math.round(progress));
31
+ progress !== -1 && (originList[taskIndex].progress = progress.toFixed(2));
32
32
  file.status != null && (originList[taskIndex].status = file.status);
33
33
  file.msg != null && (originList[taskIndex].msg = file.msg);
34
34
  if (isTrans)
@@ -36,7 +36,7 @@ function useUpload() {
36
36
  originList[taskIndex].url = file.url;
37
37
  } else {
38
38
  file.created_at = new Date().getTime();
39
- originList.push({ ...file, progress, status: 1 });
39
+ originList.unshift({ ...file, progress, status: 1 });
40
40
  }
41
41
  list.value = originList;
42
42
  }
@@ -60,6 +60,7 @@ const _sfc_main = defineComponent({
60
60
  };
61
61
  });
62
62
  const activeKey = ref("all");
63
+ provide("filterOptions", computed(() => props.filterOptions));
63
64
  provide("userInfo", computed(() => props.userInfo));
64
65
  provide("baseAPI", BASE_API);
65
66
  const {
@@ -1,4 +1,5 @@
1
- import { defineComponent, computed, openBlock, createElementBlock, withModifiers, createElementVNode, normalizeClass, renderSlot, toDisplayString, createCommentVNode } from "vue";
1
+ import { defineComponent, inject, computed, openBlock, createElementBlock, withModifiers, createElementVNode, normalizeClass, createVNode, unref, toDisplayString, createCommentVNode } from "vue";
2
+ import thumbCard from "../../../thumbCard/index.js";
2
3
  const _hoisted_1 = /* @__PURE__ */ createElementVNode("div", { class: "mask" }, null, -1);
3
4
  const _hoisted_2 = { class: "card-alias" };
4
5
  const _hoisted_3 = {
@@ -13,13 +14,15 @@ const _sfc_main = defineComponent({
13
14
  __name: "index",
14
15
  props: {
15
16
  item: {},
17
+ extraKeys: {},
16
18
  selectKeys: {},
17
19
  disable: { type: Boolean }
18
20
  },
19
- emits: ["select"],
21
+ emits: ["select", "select-one"],
20
22
  setup(__props, { emit: __emit }) {
21
23
  const props = __props;
22
24
  const emits = __emit;
25
+ const filterOptions = inject("filterOptions");
23
26
  const selectedOrder = computed(() => {
24
27
  var _a;
25
28
  const result = {};
@@ -33,15 +36,50 @@ const _sfc_main = defineComponent({
33
36
  return;
34
37
  emits("select", props.item);
35
38
  }
39
+ function handleOption(params) {
40
+ const { key, item } = params;
41
+ if (key === "select") {
42
+ emits("select-one", item);
43
+ }
44
+ }
45
+ const canIUse = computed(() => {
46
+ if (props.disable)
47
+ return false;
48
+ if (filterOptions == null ? void 0 : filterOptions.value) {
49
+ const { mediaType, mediaTypeStrict } = filterOptions.value;
50
+ if (mediaTypeStrict)
51
+ return props.item.catalog === mediaType;
52
+ }
53
+ if (props.item.progress >= 0)
54
+ return false;
55
+ return true;
56
+ });
57
+ const handlersKey = computed(() => {
58
+ var _a;
59
+ if (((_a = props.selectKeys) == null ? void 0 : _a.length) > 0 || props.disable || !canIUse.value)
60
+ return [];
61
+ return [{ label: "\u9009\u7528", key: "select" }].concat(props.extraKeys || []);
62
+ });
36
63
  return (_ctx, _cache) => {
37
64
  return openBlock(), createElementBlock("div", {
38
65
  class: "card-wrapper-image",
39
66
  onClick: withModifiers(handleCheck, ["stop"])
40
67
  }, [
41
68
  createElementVNode("div", {
42
- class: normalizeClass(["card-wrapper", { disable: _ctx.disable, active: selectedOrder.value[_ctx.item.id] }])
69
+ class: normalizeClass(["card-wrapper", { disable: !canIUse.value, active: selectedOrder.value[_ctx.item.id] }])
43
70
  }, [
44
- renderSlot(_ctx.$slots, "default"),
71
+ createVNode(unref(thumbCard), {
72
+ url: _ctx.item.url,
73
+ thumb: _ctx.item.thumb || _ctx.item.url,
74
+ catalog: _ctx.item.catalog,
75
+ meta: _ctx.item,
76
+ options: {
77
+ fit: _ctx.item.catalog === "image" ? "contain" : "cover"
78
+ },
79
+ "use-mask": true,
80
+ "handlers-key": handlersKey.value,
81
+ onHandle: handleOption
82
+ }, null, 8, ["url", "thumb", "catalog", "meta", "options", "handlers-key"]),
45
83
  _hoisted_1
46
84
  ], 2),
47
85
  createElementVNode("div", _hoisted_2, toDisplayString(_ctx.item.alias), 1),
@@ -49,7 +87,7 @@ const _sfc_main = defineComponent({
49
87
  class: "check-box-wrapper",
50
88
  onClick: withModifiers(handleCheck, ["stop"])
51
89
  }, [
52
- selectedOrder.value[_ctx.item.id] ? (openBlock(), createElementBlock("div", _hoisted_3, toDisplayString(selectedOrder.value[_ctx.item.id]), 1)) : !_ctx.disable ? (openBlock(), createElementBlock("div", _hoisted_4)) : createCommentVNode("v-if", true)
90
+ selectedOrder.value[_ctx.item.id] ? (openBlock(), createElementBlock("div", _hoisted_3, toDisplayString(selectedOrder.value[_ctx.item.id]), 1)) : canIUse.value ? (openBlock(), createElementBlock("div", _hoisted_4)) : createCommentVNode("v-if", true)
53
91
  ])
54
92
  ]);
55
93
  };
@@ -1,7 +1,6 @@
1
- import { defineComponent, computed, openBlock, createElementBlock, Fragment, renderList, createBlock, withCtx, createVNode, unref, createCommentVNode } from "vue";
1
+ import { defineComponent, openBlock, createElementBlock, Fragment, renderList, createBlock, createCommentVNode, unref } from "vue";
2
2
  import { Spin } from "@arco-design/web-vue";
3
3
  import emptyData from "../../../emptyData/index.js";
4
- import thumbCard from "../../../thumbCard/index.js";
5
4
  import _sfc_main$1 from "../ListCardWrapper/index.js";
6
5
  const _hoisted_1 = { class: "card-list-wrapper" };
7
6
  const _sfc_main = defineComponent({
@@ -14,20 +13,7 @@ const _sfc_main = defineComponent({
14
13
  },
15
14
  emits: ["select", "select-one"],
16
15
  setup(__props, { emit: __emit }) {
17
- const props = __props;
18
16
  const emits = __emit;
19
- const handlersKey = computed(() => {
20
- var _a;
21
- if (((_a = props.selectKeys) == null ? void 0 : _a.length) > 0 || props.disable)
22
- return [];
23
- return [{ label: "\u9009\u7528", key: "select" }];
24
- });
25
- function handleOption(params) {
26
- const { key, item } = params;
27
- if (key === "select") {
28
- emits("select-one", item);
29
- }
30
- }
31
17
  return (_ctx, _cache) => {
32
18
  var _a, _b;
33
19
  return openBlock(), createElementBlock("div", _hoisted_1, [
@@ -37,24 +23,9 @@ const _sfc_main = defineComponent({
37
23
  item,
38
24
  "select-keys": _ctx.selectKeys,
39
25
  disable: _ctx.disable,
40
- onSelect: () => emits("select", item)
41
- }, {
42
- default: withCtx(() => [
43
- createVNode(unref(thumbCard), {
44
- url: item.url,
45
- thumb: item.thumb,
46
- catalog: item.catalog,
47
- meta: item,
48
- "use-mask": true,
49
- "handlers-key": handlersKey.value,
50
- options: {
51
- fit: item.catalog === "image" ? "contain" : "cover"
52
- },
53
- onHandle: handleOption
54
- }, null, 8, ["url", "thumb", "catalog", "meta", "handlers-key", "options"])
55
- ]),
56
- _: 2
57
- }, 1032, ["item", "select-keys", "disable", "onSelect"]);
26
+ onSelect: () => emits("select", item),
27
+ onSelectOne: () => emits("select-one", item)
28
+ }, null, 8, ["item", "select-keys", "disable", "onSelect", "onSelectOne"]);
58
29
  }), 128)),
59
30
  createCommentVNode(" \u7A7A\u72B6\u6001 "),
60
31
  ((_a = _ctx.list) == null ? void 0 : _a.length) === 0 && _ctx.loading ? (openBlock(), createBlock(unref(Spin), {
@@ -1,7 +1,6 @@
1
- import { defineComponent, inject, computed, openBlock, createElementBlock, createCommentVNode, createElementVNode, createVNode, unref, toDisplayString, Fragment, renderList, createBlock, withCtx } from "vue";
1
+ import { defineComponent, inject, computed, openBlock, createElementBlock, createCommentVNode, createElementVNode, createVNode, unref, toDisplayString, Fragment, renderList, createBlock } from "vue";
2
2
  import _sfc_main$1 from "./components/Upload.js";
3
3
  import useUpload from "../../../hooks/useUpload.js";
4
- import thumbCard from "../../../thumbCard/index.js";
5
4
  import _sfc_main$2 from "../ListCardWrapper/index.js";
6
5
  const _hoisted_1 = { class: "upload-list-wrapper" };
7
6
  const _hoisted_2 = { class: "list-upload" };
@@ -19,7 +18,6 @@ const _sfc_main = defineComponent({
19
18
  },
20
19
  emits: ["select", "select-one"],
21
20
  setup(__props, { emit: __emit }) {
22
- const props = __props;
23
21
  const emits = __emit;
24
22
  const userInfo = inject("userInfo");
25
23
  const baseAPI = inject("baseAPI");
@@ -27,18 +25,6 @@ const _sfc_main = defineComponent({
27
25
  var _a;
28
26
  return (_a = userInfo == null ? void 0 : userInfo.value) == null ? void 0 : _a.repository_id;
29
27
  });
30
- const handlersKey = computed(() => {
31
- var _a;
32
- if (((_a = props.selectKeys) == null ? void 0 : _a.length) > 0 || props.disable)
33
- return [];
34
- return [{ label: "\u9009\u7528", key: "select" }];
35
- });
36
- function handleOption(params) {
37
- const { key, item } = params;
38
- if (key === "select") {
39
- emits("select-one", item);
40
- }
41
- }
42
28
  const { list, uploadFile, transcodingFile } = useUpload();
43
29
  function handleChange(file) {
44
30
  if (!baseAPI || !repoId.value)
@@ -68,24 +54,9 @@ const _sfc_main = defineComponent({
68
54
  item,
69
55
  "select-keys": _ctx.selectKeys,
70
56
  disable: _ctx.disable,
71
- onSelect: () => emits("select", item)
72
- }, {
73
- default: withCtx(() => [
74
- createVNode(unref(thumbCard), {
75
- url: item.url,
76
- thumb: item.thumb || item.url,
77
- catalog: item.catalog,
78
- meta: item,
79
- options: {
80
- fit: item.catalog === "image" ? "contain" : "cover"
81
- },
82
- "use-mask": true,
83
- "handlers-key": handlersKey.value,
84
- onHandle: handleOption
85
- }, null, 8, ["url", "thumb", "catalog", "meta", "options", "handlers-key"])
86
- ]),
87
- _: 2
88
- }, 1032, ["item", "select-keys", "disable", "onSelect"]);
57
+ onSelect: () => emits("select", item),
58
+ onSelectOne: () => emits("select-one", item)
59
+ }, null, 8, ["item", "select-keys", "disable", "onSelect", "onSelectOne"]);
89
60
  }), 128))
90
61
  ])
91
62
  ])
@@ -103,9 +103,7 @@ const _sfc_main = defineComponent({
103
103
  watch(
104
104
  () => searchType.value,
105
105
  () => {
106
- filter.value.sf = "";
107
- filter.value.precise_keyword = "";
108
- filter.value.keyword = "";
106
+ searchInput.value = filter.value.keyword || filter.value.precise_keyword;
109
107
  }
110
108
  );
111
109
  const isEmpty = computed(() => {
@@ -135,17 +133,15 @@ const _sfc_main = defineComponent({
135
133
  var _a;
136
134
  if ((_a = props.filterOptions) == null ? void 0 : _a.mediaType) {
137
135
  filter.value.catalog = props.filterOptions.mediaType;
136
+ if (props.filterOptions.mediaTypeStrict) {
137
+ originFilter.catalog = props.filterOptions.mediaType;
138
+ }
138
139
  }
139
140
  },
140
- { immediate: true }
141
+ { immediate: true, deep: true }
141
142
  );
142
143
  onMounted(() => {
143
- var _a;
144
144
  load();
145
- if (((_a = props.filterOptions) == null ? void 0 : _a.mediaType) && !props.filterOptions.mediaTypeStrict) {
146
- filter.value.catalog = props.filterOptions.mediaType;
147
- originFilter.catalog = props.filterOptions.mediaType;
148
- }
149
145
  });
150
146
  __expose({
151
147
  resetFilter: handleReset
@@ -25,7 +25,7 @@ function getAttachmentsMyMessage(BASE_API, query) {
25
25
  }
26
26
  function useAttachement(options) {
27
27
  const key = vue.ref(options.key);
28
- const limit = vue.ref(20);
28
+ const limit = vue.ref(30);
29
29
  const offset = vue.ref(0);
30
30
  const filter = vue.ref({});
31
31
  const params = vue.computed(() => {
@@ -30,7 +30,7 @@ function useUpload() {
30
30
  const originList = list.value;
31
31
  const taskIndex = originList.findIndex((task) => task.id === file.id);
32
32
  if (taskIndex !== -1) {
33
- progress !== -1 && (originList[taskIndex].progress = Math.round(progress));
33
+ progress !== -1 && (originList[taskIndex].progress = progress.toFixed(2));
34
34
  file.status != null && (originList[taskIndex].status = file.status);
35
35
  file.msg != null && (originList[taskIndex].msg = file.msg);
36
36
  if (isTrans)
@@ -38,7 +38,7 @@ function useUpload() {
38
38
  originList[taskIndex].url = file.url;
39
39
  } else {
40
40
  file.created_at = new Date().getTime();
41
- originList.push({ ...file, progress, status: 1 });
41
+ originList.unshift({ ...file, progress, status: 1 });
42
42
  }
43
43
  list.value = originList;
44
44
  }
@@ -61,6 +61,7 @@ const _sfc_main = vue.defineComponent({
61
61
  };
62
62
  });
63
63
  const activeKey = vue.ref("all");
64
+ vue.provide("filterOptions", vue.computed(() => props.filterOptions));
64
65
  vue.provide("userInfo", vue.computed(() => props.userInfo));
65
66
  vue.provide("baseAPI", BASE_API);
66
67
  const {
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  var vue = require("vue");
3
+ var index = require("../../../thumbCard/index.js");
3
4
  const _hoisted_1 = /* @__PURE__ */ vue.createElementVNode("div", { class: "mask" }, null, -1);
4
5
  const _hoisted_2 = { class: "card-alias" };
5
6
  const _hoisted_3 = {
@@ -14,18 +15,20 @@ const _sfc_main = vue.defineComponent({
14
15
  __name: "index",
15
16
  props: {
16
17
  item: {},
18
+ extraKeys: {},
17
19
  selectKeys: {},
18
20
  disable: { type: Boolean }
19
21
  },
20
- emits: ["select"],
22
+ emits: ["select", "select-one"],
21
23
  setup(__props, { emit: __emit }) {
22
24
  const props = __props;
23
25
  const emits = __emit;
26
+ const filterOptions = vue.inject("filterOptions");
24
27
  const selectedOrder = vue.computed(() => {
25
28
  var _a;
26
29
  const result = {};
27
- (_a = props.selectKeys) == null ? void 0 : _a.forEach((key, index) => {
28
- result[key] = index + 1;
30
+ (_a = props.selectKeys) == null ? void 0 : _a.forEach((key, index2) => {
31
+ result[key] = index2 + 1;
29
32
  });
30
33
  return result;
31
34
  });
@@ -34,15 +37,50 @@ const _sfc_main = vue.defineComponent({
34
37
  return;
35
38
  emits("select", props.item);
36
39
  }
40
+ function handleOption(params) {
41
+ const { key, item } = params;
42
+ if (key === "select") {
43
+ emits("select-one", item);
44
+ }
45
+ }
46
+ const canIUse = vue.computed(() => {
47
+ if (props.disable)
48
+ return false;
49
+ if (filterOptions == null ? void 0 : filterOptions.value) {
50
+ const { mediaType, mediaTypeStrict } = filterOptions.value;
51
+ if (mediaTypeStrict)
52
+ return props.item.catalog === mediaType;
53
+ }
54
+ if (props.item.progress >= 0)
55
+ return false;
56
+ return true;
57
+ });
58
+ const handlersKey = vue.computed(() => {
59
+ var _a;
60
+ if (((_a = props.selectKeys) == null ? void 0 : _a.length) > 0 || props.disable || !canIUse.value)
61
+ return [];
62
+ return [{ label: "\u9009\u7528", key: "select" }].concat(props.extraKeys || []);
63
+ });
37
64
  return (_ctx, _cache) => {
38
65
  return vue.openBlock(), vue.createElementBlock("div", {
39
66
  class: "card-wrapper-image",
40
67
  onClick: vue.withModifiers(handleCheck, ["stop"])
41
68
  }, [
42
69
  vue.createElementVNode("div", {
43
- class: vue.normalizeClass(["card-wrapper", { disable: _ctx.disable, active: selectedOrder.value[_ctx.item.id] }])
70
+ class: vue.normalizeClass(["card-wrapper", { disable: !canIUse.value, active: selectedOrder.value[_ctx.item.id] }])
44
71
  }, [
45
- vue.renderSlot(_ctx.$slots, "default"),
72
+ vue.createVNode(vue.unref(index), {
73
+ url: _ctx.item.url,
74
+ thumb: _ctx.item.thumb || _ctx.item.url,
75
+ catalog: _ctx.item.catalog,
76
+ meta: _ctx.item,
77
+ options: {
78
+ fit: _ctx.item.catalog === "image" ? "contain" : "cover"
79
+ },
80
+ "use-mask": true,
81
+ "handlers-key": handlersKey.value,
82
+ onHandle: handleOption
83
+ }, null, 8, ["url", "thumb", "catalog", "meta", "options", "handlers-key"]),
46
84
  _hoisted_1
47
85
  ], 2),
48
86
  vue.createElementVNode("div", _hoisted_2, vue.toDisplayString(_ctx.item.alias), 1),
@@ -50,7 +88,7 @@ const _sfc_main = vue.defineComponent({
50
88
  class: "check-box-wrapper",
51
89
  onClick: vue.withModifiers(handleCheck, ["stop"])
52
90
  }, [
53
- selectedOrder.value[_ctx.item.id] ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, vue.toDisplayString(selectedOrder.value[_ctx.item.id]), 1)) : !_ctx.disable ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4)) : vue.createCommentVNode("v-if", true)
91
+ selectedOrder.value[_ctx.item.id] ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, vue.toDisplayString(selectedOrder.value[_ctx.item.id]), 1)) : canIUse.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4)) : vue.createCommentVNode("v-if", true)
54
92
  ])
55
93
  ]);
56
94
  };
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  var vue = require("vue");
3
3
  var webVue = require("@arco-design/web-vue");
4
- var index$2 = require("../../../emptyData/index.js");
5
- var index$1 = require("../../../thumbCard/index.js");
4
+ var index$1 = require("../../../emptyData/index.js");
6
5
  var index = require("../ListCardWrapper/index.js");
7
6
  const _hoisted_1 = { class: "card-list-wrapper" };
8
7
  const _sfc_main = vue.defineComponent({
@@ -15,20 +14,7 @@ const _sfc_main = vue.defineComponent({
15
14
  },
16
15
  emits: ["select", "select-one"],
17
16
  setup(__props, { emit: __emit }) {
18
- const props = __props;
19
17
  const emits = __emit;
20
- const handlersKey = vue.computed(() => {
21
- var _a;
22
- if (((_a = props.selectKeys) == null ? void 0 : _a.length) > 0 || props.disable)
23
- return [];
24
- return [{ label: "\u9009\u7528", key: "select" }];
25
- });
26
- function handleOption(params) {
27
- const { key, item } = params;
28
- if (key === "select") {
29
- emits("select-one", item);
30
- }
31
- }
32
18
  return (_ctx, _cache) => {
33
19
  var _a, _b;
34
20
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
@@ -38,30 +24,15 @@ const _sfc_main = vue.defineComponent({
38
24
  item,
39
25
  "select-keys": _ctx.selectKeys,
40
26
  disable: _ctx.disable,
41
- onSelect: () => emits("select", item)
42
- }, {
43
- default: vue.withCtx(() => [
44
- vue.createVNode(vue.unref(index$1), {
45
- url: item.url,
46
- thumb: item.thumb,
47
- catalog: item.catalog,
48
- meta: item,
49
- "use-mask": true,
50
- "handlers-key": handlersKey.value,
51
- options: {
52
- fit: item.catalog === "image" ? "contain" : "cover"
53
- },
54
- onHandle: handleOption
55
- }, null, 8, ["url", "thumb", "catalog", "meta", "handlers-key", "options"])
56
- ]),
57
- _: 2
58
- }, 1032, ["item", "select-keys", "disable", "onSelect"]);
27
+ onSelect: () => emits("select", item),
28
+ onSelectOne: () => emits("select-one", item)
29
+ }, null, 8, ["item", "select-keys", "disable", "onSelect", "onSelectOne"]);
59
30
  }), 128)),
60
31
  vue.createCommentVNode(" \u7A7A\u72B6\u6001 "),
61
32
  ((_a = _ctx.list) == null ? void 0 : _a.length) === 0 && _ctx.loading ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Spin), {
62
33
  key: 0,
63
34
  loading: true
64
- })) : !((_b = _ctx.list) == null ? void 0 : _b.length) ? (vue.openBlock(), vue.createBlock(vue.unref(index$2), {
35
+ })) : !((_b = _ctx.list) == null ? void 0 : _b.length) ? (vue.openBlock(), vue.createBlock(vue.unref(index$1), {
65
36
  key: 1,
66
37
  type: "empty",
67
38
  customTip: "\u6682\u65E0\u6570\u636E"
@@ -2,7 +2,6 @@
2
2
  var vue = require("vue");
3
3
  var Upload = require("./components/Upload.js");
4
4
  var useUpload = require("../../../hooks/useUpload.js");
5
- var index$1 = require("../../../thumbCard/index.js");
6
5
  var index = require("../ListCardWrapper/index.js");
7
6
  const _hoisted_1 = { class: "upload-list-wrapper" };
8
7
  const _hoisted_2 = { class: "list-upload" };
@@ -20,7 +19,6 @@ const _sfc_main = vue.defineComponent({
20
19
  },
21
20
  emits: ["select", "select-one"],
22
21
  setup(__props, { emit: __emit }) {
23
- const props = __props;
24
22
  const emits = __emit;
25
23
  const userInfo = vue.inject("userInfo");
26
24
  const baseAPI = vue.inject("baseAPI");
@@ -28,18 +26,6 @@ const _sfc_main = vue.defineComponent({
28
26
  var _a;
29
27
  return (_a = userInfo == null ? void 0 : userInfo.value) == null ? void 0 : _a.repository_id;
30
28
  });
31
- const handlersKey = vue.computed(() => {
32
- var _a;
33
- if (((_a = props.selectKeys) == null ? void 0 : _a.length) > 0 || props.disable)
34
- return [];
35
- return [{ label: "\u9009\u7528", key: "select" }];
36
- });
37
- function handleOption(params) {
38
- const { key, item } = params;
39
- if (key === "select") {
40
- emits("select-one", item);
41
- }
42
- }
43
29
  const { list, uploadFile, transcodingFile } = useUpload["default"]();
44
30
  function handleChange(file) {
45
31
  if (!baseAPI || !repoId.value)
@@ -69,24 +55,9 @@ const _sfc_main = vue.defineComponent({
69
55
  item,
70
56
  "select-keys": _ctx.selectKeys,
71
57
  disable: _ctx.disable,
72
- onSelect: () => emits("select", item)
73
- }, {
74
- default: vue.withCtx(() => [
75
- vue.createVNode(vue.unref(index$1), {
76
- url: item.url,
77
- thumb: item.thumb || item.url,
78
- catalog: item.catalog,
79
- meta: item,
80
- options: {
81
- fit: item.catalog === "image" ? "contain" : "cover"
82
- },
83
- "use-mask": true,
84
- "handlers-key": handlersKey.value,
85
- onHandle: handleOption
86
- }, null, 8, ["url", "thumb", "catalog", "meta", "options", "handlers-key"])
87
- ]),
88
- _: 2
89
- }, 1032, ["item", "select-keys", "disable", "onSelect"]);
58
+ onSelect: () => emits("select", item),
59
+ onSelectOne: () => emits("select-one", item)
60
+ }, null, 8, ["item", "select-keys", "disable", "onSelect", "onSelectOne"]);
90
61
  }), 128))
91
62
  ])
92
63
  ])
@@ -104,9 +104,7 @@ const _sfc_main = vue.defineComponent({
104
104
  vue.watch(
105
105
  () => searchType.value,
106
106
  () => {
107
- filter.value.sf = "";
108
- filter.value.precise_keyword = "";
109
- filter.value.keyword = "";
107
+ searchInput.value = filter.value.keyword || filter.value.precise_keyword;
110
108
  }
111
109
  );
112
110
  const isEmpty = vue.computed(() => {
@@ -136,17 +134,15 @@ const _sfc_main = vue.defineComponent({
136
134
  var _a;
137
135
  if ((_a = props.filterOptions) == null ? void 0 : _a.mediaType) {
138
136
  filter.value.catalog = props.filterOptions.mediaType;
137
+ if (props.filterOptions.mediaTypeStrict) {
138
+ originFilter.catalog = props.filterOptions.mediaType;
139
+ }
139
140
  }
140
141
  },
141
- { immediate: true }
142
+ { immediate: true, deep: true }
142
143
  );
143
144
  vue.onMounted(() => {
144
- var _a;
145
145
  load();
146
- if (((_a = props.filterOptions) == null ? void 0 : _a.mediaType) && !props.filterOptions.mediaTypeStrict) {
147
- filter.value.catalog = props.filterOptions.mediaType;
148
- originFilter.catalog = props.filterOptions.mediaType;
149
- }
150
146
  });
151
147
  __expose({
152
148
  resetFilter: handleReset
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmstops/pro-compo",
3
- "version": "0.3.48",
3
+ "version": "0.3.49",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "vue",