@cmstops/pro-compo 0.3.48 → 0.3.50

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.
Files changed (37) hide show
  1. package/dist/index.css +30 -13
  2. package/dist/index.min.css +1 -1
  3. package/es/docPreview/component.js +33 -30
  4. package/es/hooks/useAttachement.js +1 -1
  5. package/es/hooks/useUpload.d.ts +1 -0
  6. package/es/hooks/useUpload.js +28 -10
  7. package/es/index.css +30 -13
  8. package/es/selectResourceModal/component.js +1 -0
  9. package/es/selectResourceModal/components/ListCardWrapper/index.js +48 -6
  10. package/es/selectResourceModal/components/ListContent/index.js +6 -32
  11. package/es/selectResourceModal/components/ListContentLocal/index.js +30 -35
  12. package/es/selectResourceModal/components/ListFilter/index.js +17 -11
  13. package/es/selectResourceModal/style/index.css +7 -1
  14. package/es/selectResourceModal/style/listCardWrapper.less +11 -1
  15. package/es/thumbCard/component.js +36 -35
  16. package/es/thumbCard/components/ThumbUploading/index.d.ts +0 -0
  17. package/es/thumbCard/components/ThumbUploading/index.js +42 -0
  18. package/es/thumbCard/style/index.css +23 -12
  19. package/es/thumbCard/style/index.less +6 -16
  20. package/es/thumbCard/style/thumbUploading.less +26 -0
  21. package/lib/docPreview/component.js +33 -30
  22. package/lib/hooks/useAttachement.js +1 -1
  23. package/lib/hooks/useUpload.js +28 -10
  24. package/lib/index.css +30 -13
  25. package/lib/selectResourceModal/component.js +1 -0
  26. package/lib/selectResourceModal/components/ListCardWrapper/index.js +49 -7
  27. package/lib/selectResourceModal/components/ListContent/index.js +7 -33
  28. package/lib/selectResourceModal/components/ListContentLocal/index.js +29 -34
  29. package/lib/selectResourceModal/components/ListFilter/index.js +17 -11
  30. package/lib/selectResourceModal/style/index.css +7 -1
  31. package/lib/selectResourceModal/style/listCardWrapper.less +11 -1
  32. package/lib/thumbCard/component.js +35 -34
  33. package/lib/thumbCard/components/ThumbUploading/index.js +43 -0
  34. package/lib/thumbCard/style/index.css +23 -12
  35. package/lib/thumbCard/style/index.less +6 -16
  36. package/lib/thumbCard/style/thumbUploading.less +26 -0
  37. package/package.json +1 -1
@@ -6,23 +6,22 @@ import _sfc_main$1 from "./components/PreviewIframe.js";
6
6
  import { useDocPreview, EXPIRE_TIME_OPTIONS } from "./scripts/hook.js";
7
7
  const _hoisted_1 = { class: "preview-close" };
8
8
  const _hoisted_2 = /* @__PURE__ */ createElementVNode("div", { class: "doc-preview-share" }, null, -1);
9
- const _hoisted_3 = { class: "doc-preview-share" };
10
- const _hoisted_4 = { class: "doc-preview-share-img" };
11
- const _hoisted_5 = ["src"];
12
- const _hoisted_6 = /* @__PURE__ */ createElementVNode("div", { class: "doc-preview-share-tips" }, "\u626B\u63CF\u4E8C\u7EF4\u7801\u8BBF\u95EE", -1);
13
- const _hoisted_7 = { class: "doc-preview-share-header" };
14
- const _hoisted_8 = /* @__PURE__ */ createElementVNode("span", null, "\u9884\u89C8\u5730\u5740", -1);
15
- const _hoisted_9 = { class: "doc-preview-share-link" };
16
- const _hoisted_10 = { class: "doc-preview-share-link-value" };
17
- const _hoisted_11 = { class: "doc-preview-share-link-hint" };
18
- const _hoisted_12 = { class: "doc-preview-share-action" };
19
- const _hoisted_13 = /* @__PURE__ */ createElementVNode("div", { class: "doc-preview-share-img" }, [
9
+ const _hoisted_3 = { class: "doc-preview-share-img" };
10
+ const _hoisted_4 = ["src"];
11
+ const _hoisted_5 = /* @__PURE__ */ createElementVNode("div", { class: "doc-preview-share-tips" }, "\u626B\u63CF\u4E8C\u7EF4\u7801\u8BBF\u95EE", -1);
12
+ const _hoisted_6 = { class: "doc-preview-share-header" };
13
+ const _hoisted_7 = /* @__PURE__ */ createElementVNode("span", null, "\u9884\u89C8\u5730\u5740", -1);
14
+ const _hoisted_8 = { class: "doc-preview-share-link" };
15
+ const _hoisted_9 = { class: "doc-preview-share-link-value" };
16
+ const _hoisted_10 = { class: "doc-preview-share-link-hint" };
17
+ const _hoisted_11 = { class: "doc-preview-share-action" };
18
+ const _hoisted_12 = /* @__PURE__ */ createElementVNode("div", { class: "doc-preview-share-img" }, [
20
19
  /* @__PURE__ */ createElementVNode("div", { class: "doc-preview-share-img-hint" }, " \u6682\u65E0\u9884\u89C8 ")
21
20
  ], -1);
22
- const _hoisted_14 = /* @__PURE__ */ createElementVNode("div", { class: "doc-preview-share-tips" }, " \u5185\u5BB9\u6682\u65E0\u9884\u89C8\u94FE\u63A5\uFF0C\u53EF\u751F\u6210\u9884\u89C8\u94FE\u63A5 ", -1);
23
- const _hoisted_15 = { class: "doc-preview-share-header" };
24
- const _hoisted_16 = /* @__PURE__ */ createElementVNode("span", null, "\u94FE\u63A5\u6709\u6548\u65F6\u957F", -1);
25
- const _hoisted_17 = { class: "doc-preview-share-action" };
21
+ const _hoisted_13 = /* @__PURE__ */ createElementVNode("div", { class: "doc-preview-share-tips" }, " \u5185\u5BB9\u6682\u65E0\u9884\u89C8\u94FE\u63A5\uFF0C\u53EF\u751F\u6210\u9884\u89C8\u94FE\u63A5 ", -1);
22
+ const _hoisted_14 = { class: "doc-preview-share-header" };
23
+ const _hoisted_15 = /* @__PURE__ */ createElementVNode("span", null, "\u94FE\u63A5\u6709\u6548\u65F6\u957F", -1);
24
+ const _hoisted_16 = { class: "doc-preview-share-action" };
26
25
  const _sfc_main = defineComponent({
27
26
  ...{ name: "docPreview" },
28
27
  __name: "component",
@@ -51,7 +50,7 @@ const _sfc_main = defineComponent({
51
50
  return (_ctx, _cache) => {
52
51
  return openBlock(), createElementBlock("div", {
53
52
  class: "doc-preview-container",
54
- onClick: _cache[6] || (_cache[6] = ($event) => emits("close"))
53
+ onClick: _cache[7] || (_cache[7] = ($event) => emits("close"))
55
54
  }, [
56
55
  createElementVNode("div", _hoisted_1, [
57
56
  createVNode(unref(IconClose), {
@@ -66,20 +65,24 @@ const _sfc_main = defineComponent({
66
65
  }, null, 8, ["src"]),
67
66
  createVNode(unref(Spin), { loading: unref(loading) }, {
68
67
  default: withCtx(() => [
69
- createElementVNode("div", _hoisted_3, [
68
+ createElementVNode("div", {
69
+ class: "doc-preview-share",
70
+ onClick: _cache[6] || (_cache[6] = withModifiers(() => {
71
+ }, ["stop"]))
72
+ }, [
70
73
  unref(shareData) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
71
74
  createCommentVNode(" \u4E8C\u7EF4\u7801 "),
72
- createElementVNode("div", _hoisted_4, [
75
+ createElementVNode("div", _hoisted_3, [
73
76
  createElementVNode("img", {
74
77
  src: unref(shareData).qrCode,
75
78
  alt: ""
76
- }, null, 8, _hoisted_5)
79
+ }, null, 8, _hoisted_4)
77
80
  ]),
78
81
  createCommentVNode(" \u5907\u6CE8 "),
79
- _hoisted_6,
82
+ _hoisted_5,
80
83
  createCommentVNode(" \u94FE\u63A5\u524D\u7F6E\u64CD\u4F5C "),
81
- createElementVNode("div", _hoisted_7, [
82
- _hoisted_8,
84
+ createElementVNode("div", _hoisted_6, [
85
+ _hoisted_7,
83
86
  createVNode(unref(Link), {
84
87
  type: "text",
85
88
  onClick: unref(copy)
@@ -91,12 +94,12 @@ const _sfc_main = defineComponent({
91
94
  }, 8, ["onClick"])
92
95
  ]),
93
96
  createCommentVNode(" \u94FE\u63A5 "),
94
- createElementVNode("div", _hoisted_9, [
95
- createElementVNode("div", _hoisted_10, toDisplayString(unref(shareData).shareUrl), 1),
96
- createElementVNode("div", _hoisted_11, " \u94FE\u63A5\u5269\u4F59\u65F6\u95F4\uFF1A" + toDisplayString(unref(intervalTime)), 1)
97
+ createElementVNode("div", _hoisted_8, [
98
+ createElementVNode("div", _hoisted_9, toDisplayString(unref(shareData).shareUrl), 1),
99
+ createElementVNode("div", _hoisted_10, " \u94FE\u63A5\u5269\u4F59\u65F6\u95F4\uFF1A" + toDisplayString(unref(intervalTime)), 1)
97
100
  ]),
98
101
  createCommentVNode(" \u64CD\u4F5C "),
99
- createElementVNode("div", _hoisted_12, [
102
+ createElementVNode("div", _hoisted_11, [
100
103
  createVNode(unref(Button), {
101
104
  onClick: _cache[2] || (_cache[2] = ($event) => unref(cancel)())
102
105
  }, {
@@ -116,10 +119,10 @@ const _sfc_main = defineComponent({
116
119
  })
117
120
  ])
118
121
  ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
122
+ _hoisted_12,
119
123
  _hoisted_13,
120
- _hoisted_14,
121
- createElementVNode("div", _hoisted_15, [
122
- _hoisted_16,
124
+ createElementVNode("div", _hoisted_14, [
125
+ _hoisted_15,
123
126
  createVNode(unref(Select), {
124
127
  modelValue: unref(expireTime),
125
128
  "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => isRef(expireTime) ? expireTime.value = $event : null),
@@ -138,7 +141,7 @@ const _sfc_main = defineComponent({
138
141
  _: 1
139
142
  }, 8, ["modelValue"])
140
143
  ]),
141
- createElementVNode("div", _hoisted_17, [
144
+ createElementVNode("div", _hoisted_16, [
142
145
  createVNode(unref(Button), {
143
146
  type: "primary",
144
147
  onClick: _cache[5] || (_cache[5] = () => unref(generate)())
@@ -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(() => {
@@ -13,4 +13,5 @@ export default function useUpload(): {
13
13
  uploadFile: (BASE_API: string, file: any, dir: number | undefined, repoId: number, callback?: CallbackFunc | undefined) => void;
14
14
  transcodingFile: (BASE_API: string, file: any) => void;
15
15
  recordTaskStatusChange: (file: any, progress: number, isTrans?: boolean | undefined) => void;
16
+ removeRecord: (file: any) => void;
16
17
  };
@@ -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,23 +36,32 @@ 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
  }
43
+ const removeRecord = (file) => {
44
+ const originList = list.value;
45
+ const taskIndex = originList.findIndex((task) => task.id === file.id);
46
+ if (taskIndex !== -1) {
47
+ originList.splice(taskIndex, 1);
48
+ list.value = originList;
49
+ }
50
+ };
43
51
  const uploadFile = (BASE_API, file, dir = 0, repoId, callback) => {
44
52
  const newFile = {
45
- id: generateUUID(),
53
+ id: file.id || generateUUID(),
46
54
  sig_id: file.sig_id || generateUUID(),
47
55
  name: file.name,
48
56
  url: "",
49
57
  size: file.size,
50
58
  isUpload: true,
51
- type: file.type
59
+ type: file.type,
60
+ originFile: file
52
61
  };
53
62
  const upload = new TusUploadTask(file);
54
63
  newFile.abort = () => upload.abort();
55
- recordTaskStatusChange(newFile, 0);
64
+ recordTaskStatusChange({ ...newFile, status: 1, msg: "\u4E0A\u4F20\u4E2D\u2026\u2026" }, 0);
56
65
  const progress = (percent, total) => {
57
66
  const progress2 = percent / total;
58
67
  recordTaskStatusChange(newFile, progress2);
@@ -82,7 +91,9 @@ function useUpload() {
82
91
  callback && callback({ ...message, sig_id: newFile.sig_id }, "success");
83
92
  }).catch((e) => {
84
93
  console.log("\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525} \u4E0A\u4F20\u5931\u8D25\uFF1A", e);
85
- recordTaskStatusChange({ ...newFile, status: 2, msg: "\u5931\u8D25" }, -1);
94
+ setTimeout(() => {
95
+ recordTaskStatusChange({ ...newFile, status: 2, msg: "\u4E0A\u4F20\u5931\u8D25" }, -1);
96
+ }, 1e3);
86
97
  callback && callback(newFile, "fail");
87
98
  });
88
99
  };
@@ -96,7 +107,7 @@ function useUpload() {
96
107
  if (idx === -1)
97
108
  return;
98
109
  const item = list.value[idx];
99
- recordTaskStatusChange(item, 0, true);
110
+ recordTaskStatusChange({ ...item, status: 1, msg: "\u8F6C\u7801\u4E2D\u2026\u2026" }, 0, true);
100
111
  const progress = (progress2) => recordTaskStatusChange(item, progress2);
101
112
  const transing = task.start(BASE_API, progress);
102
113
  transing.then(async (res) => {
@@ -106,11 +117,17 @@ function useUpload() {
106
117
  setTimeout(() => uploadSuccess(file), 200);
107
118
  } else {
108
119
  console.log("\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525} \u8F6C\u7801\u5931\u8D25\uFF1A", item);
109
- recordTaskStatusChange({ ...item, status: 2, msg: "\u8F6C\u7801\u5931\u8D25" }, -1);
120
+ recordTaskStatusChange(
121
+ { ...item, mediaFile: file, status: 3, msg: "\u8F6C\u7801\u5931\u8D25" },
122
+ -1
123
+ );
110
124
  }
111
125
  }).catch((e) => {
112
126
  console.log("\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525} \u8F6C\u7801\u5931\u8D25", e);
113
- recordTaskStatusChange({ ...item, status: 2, msg: "\u8F6C\u7801\u5931\u8D25" }, -1);
127
+ recordTaskStatusChange(
128
+ { ...item, mediaFile: file, status: 3, msg: "\u8F6C\u7801\u5931\u8D25" },
129
+ -1
130
+ );
114
131
  });
115
132
  };
116
133
  watch(() => list.value, set, { deep: true });
@@ -119,7 +136,8 @@ function useUpload() {
119
136
  list,
120
137
  uploadFile,
121
138
  transcodingFile,
122
- recordTaskStatusChange
139
+ recordTaskStatusChange,
140
+ removeRecord
123
141
  };
124
142
  }
125
143
  export { addMedia, useUpload as default };
package/es/index.css CHANGED
@@ -4246,29 +4246,37 @@
4246
4246
  color: #fff;
4247
4247
  font-size: 18px;
4248
4248
  }
4249
- .thumb-select-wrapper {
4250
- position: relative;
4249
+ .thumb-upload-loading {
4251
4250
  display: flex;
4251
+ flex-direction: column;
4252
4252
  align-items: center;
4253
4253
  justify-content: center;
4254
4254
  width: 100%;
4255
4255
  height: 100%;
4256
- overflow: hidden;
4257
- border-radius: 2px;
4258
- cursor: pointer;
4256
+ background-color: rgba(0, 0, 0, 0.5);
4259
4257
  }
4260
- .thumb-select-wrapper .thumb-upload-loading {
4258
+ .thumb-upload-loading .arco-progress-circle-text {
4259
+ color: #fff;
4260
+ }
4261
+ .thumb-upload-loading .thumb-upload-text {
4262
+ color: #fff;
4263
+ }
4264
+ .thumb-upload-loading .thumb-upload-text-success {
4265
+ color: rgb(var(--success-2));
4266
+ }
4267
+ .thumb-upload-loading .thumb-upload-text-error {
4268
+ color: rgb(var(--danger-6));
4269
+ }
4270
+ .thumb-select-wrapper {
4271
+ position: relative;
4261
4272
  display: flex;
4262
- flex-direction: column;
4263
4273
  align-items: center;
4264
4274
  justify-content: center;
4265
4275
  width: 100%;
4266
4276
  height: 100%;
4267
- color: #fff;
4268
- background-color: rgba(0, 0, 0, 0.5);
4269
- }
4270
- .thumb-select-wrapper .thumb-upload-loading .arco-progress-circle-text {
4271
- color: #fff;
4277
+ overflow: hidden;
4278
+ border-radius: 2px;
4279
+ cursor: pointer;
4272
4280
  }
4273
4281
  .thumb-select-wrapper .thumb-image img {
4274
4282
  width: 100%;
@@ -4288,6 +4296,9 @@
4288
4296
  opacity: 0;
4289
4297
  transition: all 0.3s ease-in-out;
4290
4298
  }
4299
+ .thumb-select-wrapper .thumb-handler-list.thumb-handler-always {
4300
+ opacity: 1 !important;
4301
+ }
4291
4302
  .thumb-select-wrapper .thumb-handler-list .handler-item {
4292
4303
  padding: 0 8px;
4293
4304
  color: #fff;
@@ -4463,6 +4474,8 @@
4463
4474
  .card-wrapper-image {
4464
4475
  position: relative;
4465
4476
  overflow: hidden;
4477
+ user-select: none;
4478
+ -webkit-user-drag: none;
4466
4479
  }
4467
4480
  .card-wrapper-image .card-wrapper {
4468
4481
  position: relative;
@@ -4471,9 +4484,13 @@
4471
4484
  transition: all 0.3s ease-in-out;
4472
4485
  aspect-ratio: 4 / 3;
4473
4486
  }
4474
- .card-wrapper-image .card-wrapper.disable:not(.active) {
4487
+ .card-wrapper-image .card-wrapper.disable:not(.active) .thumb-image {
4488
+ cursor: not-allowed;
4475
4489
  opacity: 0.4;
4476
4490
  }
4491
+ .card-wrapper-image .card-wrapper.disable:not(.active) .thumb-upload-loading {
4492
+ cursor: not-allowed;
4493
+ }
4477
4494
  .card-wrapper-image .card-wrapper .mask {
4478
4495
  position: absolute;
4479
4496
  top: 0;
@@ -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", "options"],
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 = {};
@@ -28,8 +31,36 @@ const _sfc_main = defineComponent({
28
31
  });
29
32
  return result;
30
33
  });
34
+ const canIUse = computed(() => {
35
+ if (props.disable)
36
+ return false;
37
+ if (filterOptions == null ? void 0 : filterOptions.value) {
38
+ const { mediaType, mediaTypeStrict } = filterOptions.value;
39
+ if (mediaTypeStrict)
40
+ return props.item.catalog === mediaType;
41
+ }
42
+ if (props.item.progress >= 0)
43
+ return false;
44
+ return true;
45
+ });
46
+ const handlersKey = computed(() => {
47
+ var _a;
48
+ if (props.item.status === 2) {
49
+ return [
50
+ { label: "\u91CD\u65B0\u4E0A\u4F20", key: "reupload" },
51
+ { label: "\u5220\u9664\u8BB0\u5F55", key: "remove" }
52
+ ];
53
+ }
54
+ if (props.item.status === 3) {
55
+ return [{ label: "\u91CD\u65B0\u8F6C\u7801", key: "retranscode" }];
56
+ }
57
+ if (((_a = props.selectKeys) == null ? void 0 : _a.length) > 0 || props.disable || !canIUse.value) {
58
+ return [];
59
+ }
60
+ return [{ label: "\u9009\u7528", key: "select-one" }].concat(props.extraKeys || []);
61
+ });
31
62
  function handleCheck() {
32
- if (props.disable && !selectedOrder.value[props.item.id])
63
+ if (!canIUse.value && !selectedOrder.value[props.item.id])
33
64
  return;
34
65
  emits("select", props.item);
35
66
  }
@@ -39,9 +70,20 @@ const _sfc_main = defineComponent({
39
70
  onClick: withModifiers(handleCheck, ["stop"])
40
71
  }, [
41
72
  createElementVNode("div", {
42
- class: normalizeClass(["card-wrapper", { disable: _ctx.disable, active: selectedOrder.value[_ctx.item.id] }])
73
+ class: normalizeClass(["card-wrapper", { disable: !canIUse.value, active: selectedOrder.value[_ctx.item.id] }])
43
74
  }, [
44
- renderSlot(_ctx.$slots, "default"),
75
+ createVNode(unref(thumbCard), {
76
+ url: _ctx.item.url,
77
+ thumb: _ctx.item.thumb || _ctx.item.url,
78
+ catalog: _ctx.item.catalog,
79
+ meta: _ctx.item,
80
+ options: {
81
+ fit: _ctx.item.catalog === "image" ? "contain" : "cover"
82
+ },
83
+ "use-mask": true,
84
+ "handlers-key": handlersKey.value,
85
+ onHandle: _cache[0] || (_cache[0] = (e) => emits("options", e))
86
+ }, null, 8, ["url", "thumb", "catalog", "meta", "options", "handlers-key"]),
45
87
  _hoisted_1
46
88
  ], 2),
47
89
  createElementVNode("div", _hoisted_2, toDisplayString(_ctx.item.alias), 1),
@@ -49,7 +91,7 @@ const _sfc_main = defineComponent({
49
91
  class: "check-box-wrapper",
50
92
  onClick: withModifiers(handleCheck, ["stop"])
51
93
  }, [
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)
94
+ 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
95
  ])
54
96
  ]);
55
97
  };
@@ -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,19 +13,9 @@ 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
- }
17
+ function handleOptions(e) {
18
+ emits(e.key, e.item);
30
19
  }
31
20
  return (_ctx, _cache) => {
32
21
  var _a, _b;
@@ -37,24 +26,9 @@ const _sfc_main = defineComponent({
37
26
  item,
38
27
  "select-keys": _ctx.selectKeys,
39
28
  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"]);
29
+ onSelect: () => emits("select", item),
30
+ onOptions: handleOptions
31
+ }, null, 8, ["item", "select-keys", "disable", "onSelect"]);
58
32
  }), 128)),
59
33
  createCommentVNode(" \u7A7A\u72B6\u6001 "),
60
34
  ((_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" };
@@ -17,9 +16,8 @@ const _sfc_main = defineComponent({
17
16
  selectKeys: {},
18
17
  disable: { type: Boolean }
19
18
  },
20
- emits: ["select", "select-one"],
19
+ emits: ["select", "select-one", "reupload"],
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,19 +25,7 @@ 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
- const { list, uploadFile, transcodingFile } = useUpload();
28
+ const { list, uploadFile, transcodingFile, removeRecord } = useUpload();
43
29
  function handleChange(file) {
44
30
  if (!baseAPI || !repoId.value)
45
31
  return;
@@ -51,6 +37,30 @@ const _sfc_main = defineComponent({
51
37
  (media) => transcodingFile(baseAPI, media)
52
38
  );
53
39
  }
40
+ function handleOptions(e) {
41
+ var _a, _b;
42
+ if (e.key === "reupload") {
43
+ if (!e.item || !((_a = e.item) == null ? void 0 : _a.originFile))
44
+ return;
45
+ e.item.originFile.sig_id = e.item.sig_id;
46
+ e.item.originFile.id = e.item.id;
47
+ handleChange({ file: e.item.originFile });
48
+ return;
49
+ }
50
+ if (e.key === "retranscode") {
51
+ if (!baseAPI || !((_b = e.item) == null ? void 0 : _b.mediaFile))
52
+ return;
53
+ transcodingFile(baseAPI, e.item.mediaFile);
54
+ return;
55
+ }
56
+ if (e.key === "remove") {
57
+ if (!e.item)
58
+ return;
59
+ removeRecord(e.item);
60
+ return;
61
+ }
62
+ emits(e.key, e.item);
63
+ }
54
64
  return (_ctx, _cache) => {
55
65
  var _a, _b;
56
66
  return openBlock(), createElementBlock("div", _hoisted_1, [
@@ -68,24 +78,9 @@ const _sfc_main = defineComponent({
68
78
  item,
69
79
  "select-keys": _ctx.selectKeys,
70
80
  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"]);
81
+ onSelect: () => emits("select", item),
82
+ onOptions: handleOptions
83
+ }, null, 8, ["item", "select-keys", "disable", "onSelect"]);
89
84
  }), 128))
90
85
  ])
91
86
  ])
@@ -74,8 +74,18 @@ const _sfc_main = defineComponent({
74
74
  set(val) {
75
75
  if (val) {
76
76
  const [start, end] = val;
77
- filter.value.created_begin = +new Date(start) / 1e3;
78
- filter.value.created_end = +new Date(end) / 1e3;
77
+ const created_begin = new Date(start);
78
+ const created_end = new Date(end);
79
+ created_begin.setHours(0, 0, 0, 0);
80
+ created_end.setHours(23, 59, 59, 0);
81
+ filter.value.created_begin = parseInt(
82
+ (created_begin.getTime() / 1e3).toFixed(0),
83
+ 10
84
+ );
85
+ filter.value.created_end = parseInt(
86
+ (created_end.getTime() / 1e3).toFixed(0),
87
+ 10
88
+ );
79
89
  } else {
80
90
  filter.value.created_begin = "";
81
91
  filter.value.created_end = "";
@@ -103,9 +113,7 @@ const _sfc_main = defineComponent({
103
113
  watch(
104
114
  () => searchType.value,
105
115
  () => {
106
- filter.value.sf = "";
107
- filter.value.precise_keyword = "";
108
- filter.value.keyword = "";
116
+ searchInput.value = filter.value.keyword || filter.value.precise_keyword;
109
117
  }
110
118
  );
111
119
  const isEmpty = computed(() => {
@@ -135,17 +143,15 @@ const _sfc_main = defineComponent({
135
143
  var _a;
136
144
  if ((_a = props.filterOptions) == null ? void 0 : _a.mediaType) {
137
145
  filter.value.catalog = props.filterOptions.mediaType;
146
+ if (props.filterOptions.mediaTypeStrict) {
147
+ originFilter.catalog = props.filterOptions.mediaType;
148
+ }
138
149
  }
139
150
  },
140
- { immediate: true }
151
+ { immediate: true, deep: true }
141
152
  );
142
153
  onMounted(() => {
143
- var _a;
144
154
  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
155
  });
150
156
  __expose({
151
157
  resetFilter: handleReset
@@ -135,6 +135,8 @@
135
135
  .card-wrapper-image {
136
136
  position: relative;
137
137
  overflow: hidden;
138
+ user-select: none;
139
+ -webkit-user-drag: none;
138
140
  }
139
141
  .card-wrapper-image .card-wrapper {
140
142
  position: relative;
@@ -143,9 +145,13 @@
143
145
  transition: all 0.3s ease-in-out;
144
146
  aspect-ratio: 4 / 3;
145
147
  }
146
- .card-wrapper-image .card-wrapper.disable:not(.active) {
148
+ .card-wrapper-image .card-wrapper.disable:not(.active) .thumb-image {
149
+ cursor: not-allowed;
147
150
  opacity: 0.4;
148
151
  }
152
+ .card-wrapper-image .card-wrapper.disable:not(.active) .thumb-upload-loading {
153
+ cursor: not-allowed;
154
+ }
149
155
  .card-wrapper-image .card-wrapper .mask {
150
156
  position: absolute;
151
157
  top: 0;