@cmstops/pro-compo 0.3.47 → 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.
@@ -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
  }
package/lib/index.css CHANGED
@@ -4797,6 +4797,9 @@
4797
4797
  .doc-history-drawer .arco-drawer-body {
4798
4798
  padding: 0;
4799
4799
  }
4800
+ .doc-history-drawer .arco-drawer-footer {
4801
+ text-align: left;
4802
+ }
4800
4803
  .video-thumb {
4801
4804
  display: flex;
4802
4805
  flex-direction: column;
@@ -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
  ])
@@ -57,8 +57,8 @@ const _sfc_main = vue.defineComponent({
57
57
  const originFilter = {
58
58
  catalog: "",
59
59
  source: "",
60
- create_begin: "",
61
- create_end: "",
60
+ created_begin: "",
61
+ created_end: "",
62
62
  keyword: "",
63
63
  precise_keyword: "",
64
64
  upload_by: null,
@@ -70,16 +70,16 @@ const _sfc_main = vue.defineComponent({
70
70
  };
71
71
  const rangeTime = vue.computed({
72
72
  get() {
73
- return filter.value.create_begin && filter.value.create_end ? [filter.value.create_begin * 1e3, filter.value.create_end * 1e3] : null;
73
+ return filter.value.created_begin && filter.value.created_end ? [filter.value.created_begin * 1e3, filter.value.created_end * 1e3] : null;
74
74
  },
75
75
  set(val) {
76
76
  if (val) {
77
77
  const [start, end] = val;
78
- filter.value.create_begin = +new Date(start) / 1e3;
79
- filter.value.create_end = +new Date(end) / 1e3;
78
+ filter.value.created_begin = +new Date(start) / 1e3;
79
+ filter.value.created_end = +new Date(end) / 1e3;
80
80
  } else {
81
- filter.value.create_begin = "";
82
- filter.value.create_end = "";
81
+ filter.value.created_begin = "";
82
+ filter.value.created_end = "";
83
83
  }
84
84
  }
85
85
  });
@@ -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.47",
3
+ "version": "0.3.49",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "vue",