@cmstops/pro-compo 0.1.70 → 0.1.72

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.
@@ -1,9 +1,10 @@
1
- import { defineComponent, computed, openBlock, createBlock, unref, withCtx, createElementVNode, renderSlot, createCommentVNode, createElementBlock, Fragment, renderList } from "vue";
1
+ import { defineComponent, computed, openBlock, createBlock, unref, withCtx, createElementVNode, renderSlot, createElementBlock, Fragment, renderList } from "vue";
2
2
  import { Scrollbar } from "@arco-design/web-vue";
3
3
  import draggable from "vuedraggable";
4
4
  import _sfc_main$1 from "./components/Content/index.js";
5
5
  import _sfc_main$2 from "./components/Doc/index.js";
6
6
  import _sfc_main$3 from "./components/Records/index.js";
7
+ import _sfc_main$4 from "./components/CustomWrp/index.js";
7
8
  const _hoisted_1 = { class: "content-detail-list-container" };
8
9
  const _hoisted_2 = { class: "drag-item" };
9
10
  const _sfc_main = defineComponent({
@@ -112,8 +113,7 @@ const _sfc_main = defineComponent({
112
113
  })
113
114
  ]),
114
115
  _: 2
115
- }, 1032, ["item", "index", "parmas", "abttrites", "extraAttrs"])) : createCommentVNode("v-if", true),
116
- props.type === "doc" ? (openBlock(), createBlock(_sfc_main$2, {
116
+ }, 1032, ["item", "index", "parmas", "abttrites", "extraAttrs"])) : props.type === "doc" ? (openBlock(), createBlock(_sfc_main$2, {
117
117
  key: index,
118
118
  item: element,
119
119
  index,
@@ -142,8 +142,7 @@ const _sfc_main = defineComponent({
142
142
  })
143
143
  ]),
144
144
  _: 2
145
- }, 1032, ["item", "index", "abttrites", "extraAttrs"])) : createCommentVNode("v-if", true),
146
- props.type === "record" ? (openBlock(), createBlock(_sfc_main$3, {
145
+ }, 1032, ["item", "index", "abttrites", "extraAttrs"])) : props.type === "record" ? (openBlock(), createBlock(_sfc_main$3, {
147
146
  key: index,
148
147
  item: element,
149
148
  index,
@@ -167,7 +166,36 @@ const _sfc_main = defineComponent({
167
166
  })
168
167
  ]),
169
168
  _: 2
170
- }, 1032, ["item", "index", "parmas", "abttrites", "extraAttrs"])) : createCommentVNode("v-if", true)
169
+ }, 1032, ["item", "index", "parmas", "abttrites", "extraAttrs"])) : (openBlock(), createBlock(_sfc_main$4, {
170
+ key: 3,
171
+ item: element,
172
+ index,
173
+ abttrites: unref(abttritesProps),
174
+ extraAttrs: _ctx.extraAttrs,
175
+ onClickTitle: clickTitle,
176
+ onCellMouseEnter: tableCellMouseEnter,
177
+ onCellMouseLeave: tableCellMouseLeave
178
+ }, {
179
+ tip: withCtx(() => [
180
+ renderSlot(_ctx.$slots, "tip", {
181
+ row: element,
182
+ index
183
+ })
184
+ ]),
185
+ batch: withCtx(() => [
186
+ renderSlot(_ctx.$slots, "batch", {
187
+ row: element,
188
+ index
189
+ })
190
+ ]),
191
+ option: withCtx(() => [
192
+ renderSlot(_ctx.$slots, "option", {
193
+ row: element,
194
+ index
195
+ })
196
+ ]),
197
+ _: 2
198
+ }, 1032, ["item", "index", "abttrites", "extraAttrs"]))
171
199
  ])
172
200
  ]),
173
201
  _: 3
@@ -197,8 +225,7 @@ const _sfc_main = defineComponent({
197
225
  })
198
226
  ]),
199
227
  _: 2
200
- }, 1032, ["item", "index", "parmas", "abttrites", "extraAttrs"])) : createCommentVNode("v-if", true),
201
- props.type === "doc" ? (openBlock(), createBlock(_sfc_main$2, {
228
+ }, 1032, ["item", "index", "parmas", "abttrites", "extraAttrs"])) : props.type === "doc" ? (openBlock(), createBlock(_sfc_main$2, {
202
229
  key: index,
203
230
  item,
204
231
  index,
@@ -227,8 +254,7 @@ const _sfc_main = defineComponent({
227
254
  })
228
255
  ]),
229
256
  _: 2
230
- }, 1032, ["item", "index", "abttrites", "extraAttrs"])) : createCommentVNode("v-if", true),
231
- props.type === "record" ? (openBlock(), createBlock(_sfc_main$3, {
257
+ }, 1032, ["item", "index", "abttrites", "extraAttrs"])) : props.type === "record" ? (openBlock(), createBlock(_sfc_main$3, {
232
258
  key: index,
233
259
  item,
234
260
  index,
@@ -252,7 +278,36 @@ const _sfc_main = defineComponent({
252
278
  })
253
279
  ]),
254
280
  _: 2
255
- }, 1032, ["item", "index", "parmas", "abttrites", "extraAttrs"])) : createCommentVNode("v-if", true)
281
+ }, 1032, ["item", "index", "parmas", "abttrites", "extraAttrs"])) : (openBlock(), createBlock(_sfc_main$4, {
282
+ key: 3,
283
+ item,
284
+ index,
285
+ abttrites: unref(abttritesProps),
286
+ extraAttrs: _ctx.extraAttrs,
287
+ onClickTitle: clickTitle,
288
+ onCellMouseEnter: tableCellMouseEnter,
289
+ onCellMouseLeave: tableCellMouseLeave
290
+ }, {
291
+ tip: withCtx(() => [
292
+ renderSlot(_ctx.$slots, "tip", {
293
+ row: item,
294
+ index
295
+ })
296
+ ]),
297
+ batch: withCtx(() => [
298
+ renderSlot(_ctx.$slots, "batch", {
299
+ row: item,
300
+ index
301
+ })
302
+ ]),
303
+ option: withCtx(() => [
304
+ renderSlot(_ctx.$slots, "option", {
305
+ row: item,
306
+ index
307
+ })
308
+ ]),
309
+ _: 2
310
+ }, 1032, ["item", "index", "abttrites", "extraAttrs"]))
256
311
  ], 64);
257
312
  }), 128))
258
313
  ])
@@ -0,0 +1,140 @@
1
+ import { defineComponent, computed, ref, onMounted, openBlock, createElementBlock, normalizeClass, createElementVNode, createCommentVNode, createBlock, unref, toDisplayString, renderSlot, createTextVNode, Fragment, renderList, createVNode, withCtx } from "vue";
2
+ import { Image, Tooltip } from "@arco-design/web-vue";
3
+ import { getDocThumb } from "../../../utils/doc.js";
4
+ import { noCoverText } from "../../../utils/index.js";
5
+ const _hoisted_1 = { class: "cover-view" };
6
+ const _hoisted_2 = {
7
+ key: 1,
8
+ class: "no-img"
9
+ };
10
+ const _hoisted_3 = { class: "batch-select" };
11
+ const _hoisted_4 = { class: "info-view" };
12
+ const _hoisted_5 = { class: "abttrite-v" };
13
+ const _hoisted_6 = { class: "left" };
14
+ const _hoisted_7 = { class: "right" };
15
+ const _sfc_main = defineComponent({
16
+ __name: "CustomItem",
17
+ props: {
18
+ item: {},
19
+ showAttrs: {},
20
+ thumbKey: {}
21
+ },
22
+ emits: ["clickTitle", "cellMouseEnter", "cellMouseLeave"],
23
+ setup(__props, { emit: __emit }) {
24
+ const props = __props;
25
+ const emit = __emit;
26
+ const title = computed(() => {
27
+ const { alias, title: title2 } = props.item;
28
+ return alias || title2;
29
+ });
30
+ const thumb = computed(() => {
31
+ if (!props.item)
32
+ return null;
33
+ if (!props.thumbKey) {
34
+ return getDocThumb(props.item);
35
+ }
36
+ return props.item[props.thumbKey];
37
+ });
38
+ const noImgText = computed(() => {
39
+ if (title.value)
40
+ return "\u65E0\u56FE";
41
+ return noCoverText(props.item);
42
+ });
43
+ const hide = computed(() => {
44
+ const { hide: hide2 } = props.item;
45
+ return hide2 === 7 || hide2 === 6;
46
+ });
47
+ const silent = computed(() => {
48
+ return props.item && props.item.mourn_style === 1;
49
+ });
50
+ const attributes = ref([]);
51
+ function initAttributes() {
52
+ if (!props.showAttrs)
53
+ return;
54
+ attributes.value = props.showAttrs.map((item) => {
55
+ let value = "--";
56
+ if (item.key)
57
+ value = props.item[item.key] || "--";
58
+ else if (item.getValue)
59
+ value = item.getValue(props.item) || "--";
60
+ return {
61
+ value,
62
+ ...item
63
+ };
64
+ });
65
+ }
66
+ const mouseEnterFun = (event, row) => {
67
+ emit("cellMouseEnter", { row, event });
68
+ };
69
+ const mouseLeaveFun = (event, row) => {
70
+ emit("cellMouseLeave", { row, event });
71
+ };
72
+ const clickTitle = () => {
73
+ emit("clickTitle", props.item);
74
+ };
75
+ onMounted(() => {
76
+ initAttributes();
77
+ });
78
+ return (_ctx, _cache) => {
79
+ return openBlock(), createElementBlock("div", {
80
+ class: normalizeClass(["medialist-doc-item-view", { "gray-forbidden": hide.value, "gray-for-state-hide": silent.value }]),
81
+ onMouseenter: _cache[0] || (_cache[0] = ($event) => mouseEnterFun($event, _ctx.item)),
82
+ onMouseleave: _cache[1] || (_cache[1] = ($event) => mouseLeaveFun($event, _ctx.item))
83
+ }, [
84
+ createElementVNode("div", _hoisted_1, [
85
+ createCommentVNode(" \u5C01\u9762 "),
86
+ thumb.value ? (openBlock(), createBlock(unref(Image), {
87
+ key: 0,
88
+ class: "image",
89
+ src: thumb.value,
90
+ preview: false,
91
+ fit: "cover"
92
+ }, null, 8, ["src"])) : (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(noImgText.value), 1)),
93
+ createElementVNode("div", _hoisted_3, [
94
+ renderSlot(_ctx.$slots, "batch", { row: _ctx.item })
95
+ ])
96
+ ]),
97
+ createCommentVNode(" \u4FE1\u606F "),
98
+ createElementVNode("div", _hoisted_4, [
99
+ createCommentVNode(" \u6807\u9898 "),
100
+ createElementVNode("div", {
101
+ class: "title",
102
+ onClick: clickTitle
103
+ }, [
104
+ renderSlot(_ctx.$slots, "index"),
105
+ createTextVNode(" " + toDisplayString(title.value || "\u2014\u2014"), 1)
106
+ ]),
107
+ createCommentVNode(" \u5143\u4FE1\u606F "),
108
+ createElementVNode("div", _hoisted_5, [
109
+ createElementVNode("div", _hoisted_6, [
110
+ createCommentVNode(" \u524D\u7F00 "),
111
+ renderSlot(_ctx.$slots, "tip"),
112
+ createCommentVNode(" \u5C5E\u6027 "),
113
+ (openBlock(true), createElementBlock(Fragment, null, renderList(attributes.value, (attr, index) => {
114
+ return openBlock(), createElementBlock("span", {
115
+ key: index,
116
+ class: "abttr"
117
+ }, [
118
+ createVNode(unref(Tooltip), {
119
+ content: `${attr.label}: ${attr.value}`,
120
+ placement: "top"
121
+ }, {
122
+ default: withCtx(() => [
123
+ createElementVNode("span", null, toDisplayString(attr.value || "--"), 1)
124
+ ]),
125
+ _: 2
126
+ }, 1032, ["content"])
127
+ ]);
128
+ }), 128))
129
+ ]),
130
+ createElementVNode("div", _hoisted_7, [
131
+ createCommentVNode(" \u540E\u7F00 "),
132
+ renderSlot(_ctx.$slots, "option", { row: _ctx.item })
133
+ ])
134
+ ])
135
+ ])
136
+ ], 34);
137
+ };
138
+ }
139
+ });
140
+ export { _sfc_main as default };
@@ -0,0 +1,60 @@
1
+ import { defineComponent, computed, openBlock, createBlock, withCtx, renderSlot } from "vue";
2
+ import _sfc_main$1 from "./CustomItem.js";
3
+ const _sfc_main = defineComponent({
4
+ __name: "index",
5
+ props: {
6
+ abttrites: {},
7
+ extraAttrs: {},
8
+ item: {},
9
+ index: {}
10
+ },
11
+ emits: ["cellMouseEnter", "cellMouseLeave", "clickTitle"],
12
+ setup(__props, { emit: __emit }) {
13
+ const props = __props;
14
+ const emit = __emit;
15
+ const customMeta = computed(() => {
16
+ return props.extraAttrs.custom || {};
17
+ });
18
+ const cellMouseEnter = (params) => {
19
+ emit("cellMouseEnter", params);
20
+ };
21
+ const cellMouseLeave = (params) => {
22
+ emit("cellMouseLeave", params);
23
+ };
24
+ const clickTitle = (item) => {
25
+ emit("clickTitle", item);
26
+ };
27
+ return (_ctx, _cache) => {
28
+ return openBlock(), createBlock(_sfc_main$1, {
29
+ item: _ctx.item,
30
+ abttrites: _ctx.abttrites,
31
+ "thumb-key": customMeta.value.thumbKey,
32
+ "show-attrs": customMeta.value.showAttrs,
33
+ onCellMouseEnter: cellMouseEnter,
34
+ onCellMouseLeave: cellMouseLeave,
35
+ onClickTitle: clickTitle
36
+ }, {
37
+ tip: withCtx(() => [
38
+ renderSlot(_ctx.$slots, "tip", {
39
+ row: _ctx.item,
40
+ index: _ctx.index
41
+ })
42
+ ]),
43
+ batch: withCtx(() => [
44
+ renderSlot(_ctx.$slots, "batch", {
45
+ row: _ctx.item,
46
+ index: _ctx.index
47
+ })
48
+ ]),
49
+ option: withCtx(() => [
50
+ renderSlot(_ctx.$slots, "option", {
51
+ row: _ctx.item,
52
+ index: _ctx.index
53
+ })
54
+ ]),
55
+ _: 3
56
+ }, 8, ["item", "abttrites", "thumb-key", "show-attrs"]);
57
+ };
58
+ }
59
+ });
60
+ export { _sfc_main as default };
@@ -78,6 +78,7 @@ const _sfc_main = defineComponent({
78
78
  cropper: { type: Boolean },
79
79
  aiImages: {},
80
80
  series: {},
81
+ thumbsMax: {},
81
82
  mediaUseType: {}
82
83
  },
83
84
  emits: ["update:dataValue", "upload"],
@@ -126,7 +127,7 @@ const _sfc_main = defineComponent({
126
127
  data = { model: 3, data: [{ url: value, thumb: value }] };
127
128
  } else if (Array.isArray(value)) {
128
129
  data = {
129
- model: value.length > 1 ? 1 : 3,
130
+ model: 99,
130
131
  data: value.map((img) => {
131
132
  return {
132
133
  url: img
@@ -148,13 +149,11 @@ const _sfc_main = defineComponent({
148
149
  },
149
150
  { immediate: true }
150
151
  );
151
- const thumbsModeList = computed({
152
- get() {
153
- return props.dataValue;
154
- },
155
- set(value) {
156
- emit("update:dataValue", value);
152
+ const thumbsLengthList = computed(() => {
153
+ if (props.thumbsMax && thumbList.value.length >= props.thumbsMax) {
154
+ return props.thumbsMax;
157
155
  }
156
+ return thumbList.value.length + 1;
158
157
  });
159
158
  const callback = (value) => {
160
159
  var _a;
@@ -171,8 +170,10 @@ const _sfc_main = defineComponent({
171
170
  temp.data = [];
172
171
  }
173
172
  if (props.mode === "thumbs") {
174
- console.log(temp);
175
- thumbsModeList.value[thumbOptionIndex.value] = temp.data[0].url;
173
+ emit(
174
+ "update:dataValue",
175
+ temp.data.map((item) => item.url)
176
+ );
176
177
  } else {
177
178
  emit("update:dataValue", JSON.stringify(temp));
178
179
  }
@@ -245,10 +246,10 @@ const _sfc_main = defineComponent({
245
246
  const _useCropper = props.mode === "doc" ? true : useCropper.value;
246
247
  if (["smiple", "thumbs"].includes(props.mode)) {
247
248
  dialogMediaSelectionShow.value = false;
248
- const medias = data.map((media) => {
249
- return { url: media.url, thumb: media.url };
250
- });
251
- styleData.value.data = medias;
249
+ const media = data[0];
250
+ const temp = JSON.parse(JSON.stringify(styleData.value.data || []));
251
+ temp[thumbOptionIndex.value] = { url: media.url, thumb: media.url };
252
+ styleData.value.data = temp;
252
253
  callback(styleData.value);
253
254
  } else if (isPcBaner || !_useCropper) {
254
255
  dialogMediaSelectionShow.value = false;
@@ -385,11 +386,11 @@ const _sfc_main = defineComponent({
385
386
  ], 4)) : createCommentVNode("v-if", true),
386
387
  createElementVNode("div", _hoisted_4, [
387
388
  ["thumbs"].includes(_ctx.mode) ? (openBlock(), createElementBlock("div", _hoisted_5, [
388
- (openBlock(true), createElementBlock(Fragment, null, renderList(thumbsModeList.value, (item, index) => {
389
+ (openBlock(true), createElementBlock(Fragment, null, renderList(thumbsLengthList.value, (item, index) => {
389
390
  return openBlock(), createBlock(_sfc_main$1, {
390
391
  key: index,
391
392
  id: `thumb-card-${index}`,
392
- data: { url: item },
393
+ data: thumbList.value[index],
393
394
  "preview-list": previewList.value,
394
395
  "thumb-model": "thumb",
395
396
  onOpen: ($event) => openDialogMediaSelection($event, index)
package/es/utils/doc.d.ts CHANGED
@@ -72,4 +72,5 @@ export declare const getPublishParmas: (categories: any[], categories_with: any[
72
72
  clean_offline_time: boolean;
73
73
  id: any;
74
74
  };
75
+ export declare function getDocThumb(item: any): any;
75
76
  export {};
package/es/utils/doc.js CHANGED
@@ -101,4 +101,18 @@ const approvalItem = (item) => {
101
101
  }
102
102
  return item.approval_status;
103
103
  };
104
- export { approvalItem, docPubStateMap, docSeries, docStateMap, docThumbArrMap, docThumbMap, docThumbObjMap, docThumbRatioMap, docThumbTypeMap, stateOptions, typeOptions };
104
+ function getDocThumb(item) {
105
+ if (item.preview_url) {
106
+ return item.preview_url;
107
+ }
108
+ if (item.style) {
109
+ let { style } = item;
110
+ if (typeof style === "string") {
111
+ style = JSON.parse(style);
112
+ return style.data && style.data[0] && style.data[0].thumb;
113
+ }
114
+ return style.data && style.data[0] && style.data[0].thumb;
115
+ }
116
+ return item.cover && item.cover.data && item.cover.data[0] && item.cover.data[0].thumb;
117
+ }
118
+ export { approvalItem, docPubStateMap, docSeries, docStateMap, docThumbArrMap, docThumbMap, docThumbObjMap, docThumbRatioMap, docThumbTypeMap, getDocThumb, stateOptions, typeOptions };
@@ -134,7 +134,7 @@ const local_live_doc_type = {
134
134
  const local_live_doc_status = [
135
135
  { value: 0, label: "\u672A\u5F00\u59CB", bgColor: "#FF8000" },
136
136
  { value: 1, label: "\u76F4\u64AD\u4E2D", bgColor: "#FF192D" },
137
- { value: 2, label: "\u5DF2\u7ED3\u675F", bgColor: "#C9CDD4" }
137
+ { value: 2, label: "\u5DF2\u7ED3\u675F", bgColor: "rgba(0, 0, 0, 0.6)" }
138
138
  ];
139
139
  const matrixPublishStateMap = {
140
140
  0: "\u5F85\u53D1\u5E03",
@@ -5,6 +5,7 @@ var draggable = require("vuedraggable");
5
5
  var index = require("./components/Content/index.js");
6
6
  var index$1 = require("./components/Doc/index.js");
7
7
  var index$2 = require("./components/Records/index.js");
8
+ var index$3 = require("./components/CustomWrp/index.js");
8
9
  function _interopDefaultLegacy(e) {
9
10
  return e && typeof e === "object" && "default" in e ? e : { "default": e };
10
11
  }
@@ -91,12 +92,12 @@ const _sfc_main = vue.defineComponent({
91
92
  onChange: sortChange,
92
93
  onStart: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("dragstart"))
93
94
  }, {
94
- item: vue.withCtx(({ element, index: index$3 }) => [
95
+ item: vue.withCtx(({ element, index: index$4 }) => [
95
96
  vue.createElementVNode("div", _hoisted_2, [
96
97
  props.type === "content" ? (vue.openBlock(), vue.createBlock(index, {
97
- key: index$3,
98
+ key: index$4,
98
99
  item: element,
99
- index: index$3,
100
+ index: index$4,
100
101
  parmas: vue.unref(parmasProps),
101
102
  abttrites: vue.unref(abttritesProps),
102
103
  extraAttrs: _ctx.extraAttrs,
@@ -107,21 +108,20 @@ const _sfc_main = vue.defineComponent({
107
108
  batch: vue.withCtx(() => [
108
109
  vue.renderSlot(_ctx.$slots, "batch", {
109
110
  row: element,
110
- index: index$3
111
+ index: index$4
111
112
  })
112
113
  ]),
113
114
  option: vue.withCtx(() => [
114
115
  vue.renderSlot(_ctx.$slots, "option", {
115
116
  row: element,
116
- index: index$3
117
+ index: index$4
117
118
  })
118
119
  ]),
119
120
  _: 2
120
- }, 1032, ["item", "index", "parmas", "abttrites", "extraAttrs"])) : vue.createCommentVNode("v-if", true),
121
- props.type === "doc" ? (vue.openBlock(), vue.createBlock(index$1, {
122
- key: index$3,
121
+ }, 1032, ["item", "index", "parmas", "abttrites", "extraAttrs"])) : props.type === "doc" ? (vue.openBlock(), vue.createBlock(index$1, {
122
+ key: index$4,
123
123
  item: element,
124
- index: index$3,
124
+ index: index$4,
125
125
  abttrites: vue.unref(abttritesProps),
126
126
  extraAttrs: _ctx.extraAttrs,
127
127
  onClickTitle: clickTitle,
@@ -131,27 +131,26 @@ const _sfc_main = vue.defineComponent({
131
131
  tip: vue.withCtx(() => [
132
132
  vue.renderSlot(_ctx.$slots, "tip", {
133
133
  row: element,
134
- index: index$3
134
+ index: index$4
135
135
  })
136
136
  ]),
137
137
  batch: vue.withCtx(() => [
138
138
  vue.renderSlot(_ctx.$slots, "batch", {
139
139
  row: element,
140
- index: index$3
140
+ index: index$4
141
141
  })
142
142
  ]),
143
143
  option: vue.withCtx(() => [
144
144
  vue.renderSlot(_ctx.$slots, "option", {
145
145
  row: element,
146
- index: index$3
146
+ index: index$4
147
147
  })
148
148
  ]),
149
149
  _: 2
150
- }, 1032, ["item", "index", "abttrites", "extraAttrs"])) : vue.createCommentVNode("v-if", true),
151
- props.type === "record" ? (vue.openBlock(), vue.createBlock(index$2, {
152
- key: index$3,
150
+ }, 1032, ["item", "index", "abttrites", "extraAttrs"])) : props.type === "record" ? (vue.openBlock(), vue.createBlock(index$2, {
151
+ key: index$4,
153
152
  item: element,
154
- index: index$3,
153
+ index: index$4,
155
154
  parmas: vue.unref(parmasProps),
156
155
  abttrites: vue.unref(abttritesProps),
157
156
  extraAttrs: _ctx.extraAttrs,
@@ -162,26 +161,55 @@ const _sfc_main = vue.defineComponent({
162
161
  batch: vue.withCtx(() => [
163
162
  vue.renderSlot(_ctx.$slots, "batch", {
164
163
  row: element,
165
- index: index$3
164
+ index: index$4
166
165
  })
167
166
  ]),
168
167
  option: vue.withCtx(() => [
169
168
  vue.renderSlot(_ctx.$slots, "option", {
170
169
  row: element,
171
- index: index$3
170
+ index: index$4
172
171
  })
173
172
  ]),
174
173
  _: 2
175
- }, 1032, ["item", "index", "parmas", "abttrites", "extraAttrs"])) : vue.createCommentVNode("v-if", true)
174
+ }, 1032, ["item", "index", "parmas", "abttrites", "extraAttrs"])) : (vue.openBlock(), vue.createBlock(index$3, {
175
+ key: 3,
176
+ item: element,
177
+ index: index$4,
178
+ abttrites: vue.unref(abttritesProps),
179
+ extraAttrs: _ctx.extraAttrs,
180
+ onClickTitle: clickTitle,
181
+ onCellMouseEnter: tableCellMouseEnter,
182
+ onCellMouseLeave: tableCellMouseLeave
183
+ }, {
184
+ tip: vue.withCtx(() => [
185
+ vue.renderSlot(_ctx.$slots, "tip", {
186
+ row: element,
187
+ index: index$4
188
+ })
189
+ ]),
190
+ batch: vue.withCtx(() => [
191
+ vue.renderSlot(_ctx.$slots, "batch", {
192
+ row: element,
193
+ index: index$4
194
+ })
195
+ ]),
196
+ option: vue.withCtx(() => [
197
+ vue.renderSlot(_ctx.$slots, "option", {
198
+ row: element,
199
+ index: index$4
200
+ })
201
+ ]),
202
+ _: 2
203
+ }, 1032, ["item", "index", "abttrites", "extraAttrs"]))
176
204
  ])
177
205
  ]),
178
206
  _: 3
179
- }, 8, ["modelValue", "sort"])) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(dataList.value, (item, index$3) => {
180
- return vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: index$3 }, [
207
+ }, 8, ["modelValue", "sort"])) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(dataList.value, (item, index$4) => {
208
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: index$4 }, [
181
209
  props.type === "content" ? (vue.openBlock(), vue.createBlock(index, {
182
- key: index$3,
210
+ key: index$4,
183
211
  item,
184
- index: index$3,
212
+ index: index$4,
185
213
  parmas: vue.unref(parmasProps),
186
214
  abttrites: vue.unref(abttritesProps),
187
215
  extraAttrs: _ctx.extraAttrs,
@@ -192,21 +220,20 @@ const _sfc_main = vue.defineComponent({
192
220
  batch: vue.withCtx(() => [
193
221
  vue.renderSlot(_ctx.$slots, "batch", {
194
222
  row: item,
195
- index: index$3
223
+ index: index$4
196
224
  })
197
225
  ]),
198
226
  option: vue.withCtx(() => [
199
227
  vue.renderSlot(_ctx.$slots, "option", {
200
228
  row: item,
201
- index: index$3
229
+ index: index$4
202
230
  })
203
231
  ]),
204
232
  _: 2
205
- }, 1032, ["item", "index", "parmas", "abttrites", "extraAttrs"])) : vue.createCommentVNode("v-if", true),
206
- props.type === "doc" ? (vue.openBlock(), vue.createBlock(index$1, {
207
- key: index$3,
233
+ }, 1032, ["item", "index", "parmas", "abttrites", "extraAttrs"])) : props.type === "doc" ? (vue.openBlock(), vue.createBlock(index$1, {
234
+ key: index$4,
208
235
  item,
209
- index: index$3,
236
+ index: index$4,
210
237
  abttrites: vue.unref(abttritesProps),
211
238
  extraAttrs: _ctx.extraAttrs,
212
239
  onClickTitle: clickTitle,
@@ -216,27 +243,26 @@ const _sfc_main = vue.defineComponent({
216
243
  tip: vue.withCtx(() => [
217
244
  vue.renderSlot(_ctx.$slots, "tip", {
218
245
  row: item,
219
- index: index$3
246
+ index: index$4
220
247
  })
221
248
  ]),
222
249
  batch: vue.withCtx(() => [
223
250
  vue.renderSlot(_ctx.$slots, "batch", {
224
251
  row: item,
225
- index: index$3
252
+ index: index$4
226
253
  })
227
254
  ]),
228
255
  option: vue.withCtx(() => [
229
256
  vue.renderSlot(_ctx.$slots, "option", {
230
257
  row: item,
231
- index: index$3
258
+ index: index$4
232
259
  })
233
260
  ]),
234
261
  _: 2
235
- }, 1032, ["item", "index", "abttrites", "extraAttrs"])) : vue.createCommentVNode("v-if", true),
236
- props.type === "record" ? (vue.openBlock(), vue.createBlock(index$2, {
237
- key: index$3,
262
+ }, 1032, ["item", "index", "abttrites", "extraAttrs"])) : props.type === "record" ? (vue.openBlock(), vue.createBlock(index$2, {
263
+ key: index$4,
238
264
  item,
239
- index: index$3,
265
+ index: index$4,
240
266
  parmas: vue.unref(parmasProps),
241
267
  abttrites: vue.unref(abttritesProps),
242
268
  extraAttrs: _ctx.extraAttrs,
@@ -247,17 +273,46 @@ const _sfc_main = vue.defineComponent({
247
273
  batch: vue.withCtx(() => [
248
274
  vue.renderSlot(_ctx.$slots, "batch", {
249
275
  row: item,
250
- index: index$3
276
+ index: index$4
277
+ })
278
+ ]),
279
+ option: vue.withCtx(() => [
280
+ vue.renderSlot(_ctx.$slots, "option", {
281
+ row: item,
282
+ index: index$4
283
+ })
284
+ ]),
285
+ _: 2
286
+ }, 1032, ["item", "index", "parmas", "abttrites", "extraAttrs"])) : (vue.openBlock(), vue.createBlock(index$3, {
287
+ key: 3,
288
+ item,
289
+ index: index$4,
290
+ abttrites: vue.unref(abttritesProps),
291
+ extraAttrs: _ctx.extraAttrs,
292
+ onClickTitle: clickTitle,
293
+ onCellMouseEnter: tableCellMouseEnter,
294
+ onCellMouseLeave: tableCellMouseLeave
295
+ }, {
296
+ tip: vue.withCtx(() => [
297
+ vue.renderSlot(_ctx.$slots, "tip", {
298
+ row: item,
299
+ index: index$4
300
+ })
301
+ ]),
302
+ batch: vue.withCtx(() => [
303
+ vue.renderSlot(_ctx.$slots, "batch", {
304
+ row: item,
305
+ index: index$4
251
306
  })
252
307
  ]),
253
308
  option: vue.withCtx(() => [
254
309
  vue.renderSlot(_ctx.$slots, "option", {
255
310
  row: item,
256
- index: index$3
311
+ index: index$4
257
312
  })
258
313
  ]),
259
314
  _: 2
260
- }, 1032, ["item", "index", "parmas", "abttrites", "extraAttrs"])) : vue.createCommentVNode("v-if", true)
315
+ }, 1032, ["item", "index", "abttrites", "extraAttrs"]))
261
316
  ], 64);
262
317
  }), 128))
263
318
  ])
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+ var vue = require("vue");
3
+ var webVue = require("@arco-design/web-vue");
4
+ var doc = require("../../../utils/doc.js");
5
+ var index = require("../../../utils/index.js");
6
+ const _hoisted_1 = { class: "cover-view" };
7
+ const _hoisted_2 = {
8
+ key: 1,
9
+ class: "no-img"
10
+ };
11
+ const _hoisted_3 = { class: "batch-select" };
12
+ const _hoisted_4 = { class: "info-view" };
13
+ const _hoisted_5 = { class: "abttrite-v" };
14
+ const _hoisted_6 = { class: "left" };
15
+ const _hoisted_7 = { class: "right" };
16
+ const _sfc_main = vue.defineComponent({
17
+ __name: "CustomItem",
18
+ props: {
19
+ item: {},
20
+ showAttrs: {},
21
+ thumbKey: {}
22
+ },
23
+ emits: ["clickTitle", "cellMouseEnter", "cellMouseLeave"],
24
+ setup(__props, { emit: __emit }) {
25
+ const props = __props;
26
+ const emit = __emit;
27
+ const title = vue.computed(() => {
28
+ const { alias, title: title2 } = props.item;
29
+ return alias || title2;
30
+ });
31
+ const thumb = vue.computed(() => {
32
+ if (!props.item)
33
+ return null;
34
+ if (!props.thumbKey) {
35
+ return doc.getDocThumb(props.item);
36
+ }
37
+ return props.item[props.thumbKey];
38
+ });
39
+ const noImgText = vue.computed(() => {
40
+ if (title.value)
41
+ return "\u65E0\u56FE";
42
+ return index.noCoverText(props.item);
43
+ });
44
+ const hide = vue.computed(() => {
45
+ const { hide: hide2 } = props.item;
46
+ return hide2 === 7 || hide2 === 6;
47
+ });
48
+ const silent = vue.computed(() => {
49
+ return props.item && props.item.mourn_style === 1;
50
+ });
51
+ const attributes = vue.ref([]);
52
+ function initAttributes() {
53
+ if (!props.showAttrs)
54
+ return;
55
+ attributes.value = props.showAttrs.map((item) => {
56
+ let value = "--";
57
+ if (item.key)
58
+ value = props.item[item.key] || "--";
59
+ else if (item.getValue)
60
+ value = item.getValue(props.item) || "--";
61
+ return {
62
+ value,
63
+ ...item
64
+ };
65
+ });
66
+ }
67
+ const mouseEnterFun = (event, row) => {
68
+ emit("cellMouseEnter", { row, event });
69
+ };
70
+ const mouseLeaveFun = (event, row) => {
71
+ emit("cellMouseLeave", { row, event });
72
+ };
73
+ const clickTitle = () => {
74
+ emit("clickTitle", props.item);
75
+ };
76
+ vue.onMounted(() => {
77
+ initAttributes();
78
+ });
79
+ return (_ctx, _cache) => {
80
+ return vue.openBlock(), vue.createElementBlock("div", {
81
+ class: vue.normalizeClass(["medialist-doc-item-view", { "gray-forbidden": hide.value, "gray-for-state-hide": silent.value }]),
82
+ onMouseenter: _cache[0] || (_cache[0] = ($event) => mouseEnterFun($event, _ctx.item)),
83
+ onMouseleave: _cache[1] || (_cache[1] = ($event) => mouseLeaveFun($event, _ctx.item))
84
+ }, [
85
+ vue.createElementVNode("div", _hoisted_1, [
86
+ vue.createCommentVNode(" \u5C01\u9762 "),
87
+ thumb.value ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Image), {
88
+ key: 0,
89
+ class: "image",
90
+ src: thumb.value,
91
+ preview: false,
92
+ fit: "cover"
93
+ }, null, 8, ["src"])) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_2, vue.toDisplayString(noImgText.value), 1)),
94
+ vue.createElementVNode("div", _hoisted_3, [
95
+ vue.renderSlot(_ctx.$slots, "batch", { row: _ctx.item })
96
+ ])
97
+ ]),
98
+ vue.createCommentVNode(" \u4FE1\u606F "),
99
+ vue.createElementVNode("div", _hoisted_4, [
100
+ vue.createCommentVNode(" \u6807\u9898 "),
101
+ vue.createElementVNode("div", {
102
+ class: "title",
103
+ onClick: clickTitle
104
+ }, [
105
+ vue.renderSlot(_ctx.$slots, "index"),
106
+ vue.createTextVNode(" " + vue.toDisplayString(title.value || "\u2014\u2014"), 1)
107
+ ]),
108
+ vue.createCommentVNode(" \u5143\u4FE1\u606F "),
109
+ vue.createElementVNode("div", _hoisted_5, [
110
+ vue.createElementVNode("div", _hoisted_6, [
111
+ vue.createCommentVNode(" \u524D\u7F00 "),
112
+ vue.renderSlot(_ctx.$slots, "tip"),
113
+ vue.createCommentVNode(" \u5C5E\u6027 "),
114
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(attributes.value, (attr, index2) => {
115
+ return vue.openBlock(), vue.createElementBlock("span", {
116
+ key: index2,
117
+ class: "abttr"
118
+ }, [
119
+ vue.createVNode(vue.unref(webVue.Tooltip), {
120
+ content: `${attr.label}: ${attr.value}`,
121
+ placement: "top"
122
+ }, {
123
+ default: vue.withCtx(() => [
124
+ vue.createElementVNode("span", null, vue.toDisplayString(attr.value || "--"), 1)
125
+ ]),
126
+ _: 2
127
+ }, 1032, ["content"])
128
+ ]);
129
+ }), 128))
130
+ ]),
131
+ vue.createElementVNode("div", _hoisted_7, [
132
+ vue.createCommentVNode(" \u540E\u7F00 "),
133
+ vue.renderSlot(_ctx.$slots, "option", { row: _ctx.item })
134
+ ])
135
+ ])
136
+ ])
137
+ ], 34);
138
+ };
139
+ }
140
+ });
141
+ module.exports = _sfc_main;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var vue = require("vue");
3
+ var CustomItem = require("./CustomItem.js");
4
+ const _sfc_main = vue.defineComponent({
5
+ __name: "index",
6
+ props: {
7
+ abttrites: {},
8
+ extraAttrs: {},
9
+ item: {},
10
+ index: {}
11
+ },
12
+ emits: ["cellMouseEnter", "cellMouseLeave", "clickTitle"],
13
+ setup(__props, { emit: __emit }) {
14
+ const props = __props;
15
+ const emit = __emit;
16
+ const customMeta = vue.computed(() => {
17
+ return props.extraAttrs.custom || {};
18
+ });
19
+ const cellMouseEnter = (params) => {
20
+ emit("cellMouseEnter", params);
21
+ };
22
+ const cellMouseLeave = (params) => {
23
+ emit("cellMouseLeave", params);
24
+ };
25
+ const clickTitle = (item) => {
26
+ emit("clickTitle", item);
27
+ };
28
+ return (_ctx, _cache) => {
29
+ return vue.openBlock(), vue.createBlock(CustomItem, {
30
+ item: _ctx.item,
31
+ abttrites: _ctx.abttrites,
32
+ "thumb-key": customMeta.value.thumbKey,
33
+ "show-attrs": customMeta.value.showAttrs,
34
+ onCellMouseEnter: cellMouseEnter,
35
+ onCellMouseLeave: cellMouseLeave,
36
+ onClickTitle: clickTitle
37
+ }, {
38
+ tip: vue.withCtx(() => [
39
+ vue.renderSlot(_ctx.$slots, "tip", {
40
+ row: _ctx.item,
41
+ index: _ctx.index
42
+ })
43
+ ]),
44
+ batch: vue.withCtx(() => [
45
+ vue.renderSlot(_ctx.$slots, "batch", {
46
+ row: _ctx.item,
47
+ index: _ctx.index
48
+ })
49
+ ]),
50
+ option: vue.withCtx(() => [
51
+ vue.renderSlot(_ctx.$slots, "option", {
52
+ row: _ctx.item,
53
+ index: _ctx.index
54
+ })
55
+ ]),
56
+ _: 3
57
+ }, 8, ["item", "abttrites", "thumb-key", "show-attrs"]);
58
+ };
59
+ }
60
+ });
61
+ module.exports = _sfc_main;
@@ -79,6 +79,7 @@ const _sfc_main = vue.defineComponent({
79
79
  cropper: { type: Boolean },
80
80
  aiImages: {},
81
81
  series: {},
82
+ thumbsMax: {},
82
83
  mediaUseType: {}
83
84
  },
84
85
  emits: ["update:dataValue", "upload"],
@@ -127,7 +128,7 @@ const _sfc_main = vue.defineComponent({
127
128
  data = { model: 3, data: [{ url: value, thumb: value }] };
128
129
  } else if (Array.isArray(value)) {
129
130
  data = {
130
- model: value.length > 1 ? 1 : 3,
131
+ model: 99,
131
132
  data: value.map((img) => {
132
133
  return {
133
134
  url: img
@@ -149,13 +150,11 @@ const _sfc_main = vue.defineComponent({
149
150
  },
150
151
  { immediate: true }
151
152
  );
152
- const thumbsModeList = vue.computed({
153
- get() {
154
- return props.dataValue;
155
- },
156
- set(value) {
157
- emit("update:dataValue", value);
153
+ const thumbsLengthList = vue.computed(() => {
154
+ if (props.thumbsMax && thumbList.value.length >= props.thumbsMax) {
155
+ return props.thumbsMax;
158
156
  }
157
+ return thumbList.value.length + 1;
159
158
  });
160
159
  const callback = (value) => {
161
160
  var _a;
@@ -172,8 +171,10 @@ const _sfc_main = vue.defineComponent({
172
171
  temp.data = [];
173
172
  }
174
173
  if (props.mode === "thumbs") {
175
- console.log(temp);
176
- thumbsModeList.value[thumbOptionIndex.value] = temp.data[0].url;
174
+ emit(
175
+ "update:dataValue",
176
+ temp.data.map((item) => item.url)
177
+ );
177
178
  } else {
178
179
  emit("update:dataValue", JSON.stringify(temp));
179
180
  }
@@ -246,10 +247,10 @@ const _sfc_main = vue.defineComponent({
246
247
  const _useCropper = props.mode === "doc" ? true : useCropper.value;
247
248
  if (["smiple", "thumbs"].includes(props.mode)) {
248
249
  dialogMediaSelectionShow.value = false;
249
- const medias = data.map((media) => {
250
- return { url: media.url, thumb: media.url };
251
- });
252
- styleData.value.data = medias;
250
+ const media = data[0];
251
+ const temp = JSON.parse(JSON.stringify(styleData.value.data || []));
252
+ temp[thumbOptionIndex.value] = { url: media.url, thumb: media.url };
253
+ styleData.value.data = temp;
253
254
  callback(styleData.value);
254
255
  } else if (isPcBaner || !_useCropper) {
255
256
  dialogMediaSelectionShow.value = false;
@@ -386,11 +387,11 @@ const _sfc_main = vue.defineComponent({
386
387
  ], 4)) : vue.createCommentVNode("v-if", true),
387
388
  vue.createElementVNode("div", _hoisted_4, [
388
389
  ["thumbs"].includes(_ctx.mode) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [
389
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(thumbsModeList.value, (item, index) => {
390
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(thumbsLengthList.value, (item, index) => {
390
391
  return vue.openBlock(), vue.createBlock(card, {
391
392
  key: index,
392
393
  id: `thumb-card-${index}`,
393
- data: { url: item },
394
+ data: thumbList.value[index],
394
395
  "preview-list": previewList.value,
395
396
  "thumb-model": "thumb",
396
397
  onOpen: ($event) => openDialogMediaSelection($event, index)
package/lib/utils/doc.js CHANGED
@@ -103,6 +103,20 @@ const approvalItem = (item) => {
103
103
  }
104
104
  return item.approval_status;
105
105
  };
106
+ function getDocThumb(item) {
107
+ if (item.preview_url) {
108
+ return item.preview_url;
109
+ }
110
+ if (item.style) {
111
+ let { style } = item;
112
+ if (typeof style === "string") {
113
+ style = JSON.parse(style);
114
+ return style.data && style.data[0] && style.data[0].thumb;
115
+ }
116
+ return style.data && style.data[0] && style.data[0].thumb;
117
+ }
118
+ return item.cover && item.cover.data && item.cover.data[0] && item.cover.data[0].thumb;
119
+ }
106
120
  exports.approvalItem = approvalItem;
107
121
  exports.docPubStateMap = docPubStateMap;
108
122
  exports.docSeries = docSeries;
@@ -112,5 +126,6 @@ exports.docThumbMap = docThumbMap;
112
126
  exports.docThumbObjMap = docThumbObjMap;
113
127
  exports.docThumbRatioMap = docThumbRatioMap;
114
128
  exports.docThumbTypeMap = docThumbTypeMap;
129
+ exports.getDocThumb = getDocThumb;
115
130
  exports.stateOptions = stateOptions;
116
131
  exports.typeOptions = typeOptions;
@@ -136,7 +136,7 @@ const local_live_doc_type = {
136
136
  const local_live_doc_status = [
137
137
  { value: 0, label: "\u672A\u5F00\u59CB", bgColor: "#FF8000" },
138
138
  { value: 1, label: "\u76F4\u64AD\u4E2D", bgColor: "#FF192D" },
139
- { value: 2, label: "\u5DF2\u7ED3\u675F", bgColor: "#C9CDD4" }
139
+ { value: 2, label: "\u5DF2\u7ED3\u675F", bgColor: "rgba(0, 0, 0, 0.6)" }
140
140
  ];
141
141
  const matrixPublishStateMap = {
142
142
  0: "\u5F85\u53D1\u5E03",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmstops/pro-compo",
3
- "version": "0.1.70",
3
+ "version": "0.1.72",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "vue",