@cmstops/pro-compo 3.9.2-alpha.11 → 3.9.2-alpha.13

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.
@@ -0,0 +1,436 @@
1
+ import { defineComponent, ref, computed, watch, h, onMounted, openBlock, createElementBlock, createVNode, unref, withCtx, createBlock, createElementVNode, toDisplayString, renderSlot, withDirectives, vShow } from "vue";
2
+ import { IconRight, IconDown } from "@arco-design/web-vue/es/icon";
3
+ import { Checkbox, Table, Pagination, Message } from "@arco-design/web-vue";
4
+ import _sfc_main$2 from "../../../typeIcons/component.js";
5
+ import _sfc_main$1 from "./MediaFilter/index.js";
6
+ import _sfc_main$3 from "../../../dataTags/component.js";
7
+ import useTableBatch from "../../../hooks/batch.js";
8
+ import { timeFormat } from "../../../utils/index.js";
9
+ import { getCategoryMediaNew, getPoliticals, getMlists } from "../../script/api.js";
10
+ import "./index.vue_vue_type_style_index_0_scoped_true_lang.js";
11
+ import _export_sfc from "../../../_virtual/plugin-vue_export-helper.js";
12
+ const _hoisted_1 = { class: "view-all-column-container" };
13
+ const _hoisted_2 = {
14
+ key: 0,
15
+ class: "content-table-view"
16
+ };
17
+ const _hoisted_3 = { class: "title-span" };
18
+ const _hoisted_4 = { class: "title" };
19
+ const _hoisted_5 = { class: "title-span" };
20
+ const _hoisted_6 = { class: "title-span" };
21
+ const _hoisted_7 = {
22
+ key: 1,
23
+ class: "content-table-view"
24
+ };
25
+ const _hoisted_8 = { class: "title-span" };
26
+ const _hoisted_9 = { class: "title" };
27
+ const _hoisted_10 = { class: "title-span" };
28
+ const _hoisted_11 = { class: "title-span" };
29
+ const _hoisted_12 = { class: "bottom-view" };
30
+ const _hoisted_13 = { class: "left" };
31
+ const _sfc_main = defineComponent({
32
+ ...{ name: "ViewAllColumn" },
33
+ __name: "index",
34
+ props: {
35
+ maxSelect: {},
36
+ defaultSelectedData: {},
37
+ typeData: {},
38
+ series: {},
39
+ banner: {},
40
+ userInfo: {},
41
+ typeKey: {}
42
+ },
43
+ emits: ["change"],
44
+ setup(__props, { emit: __emit }) {
45
+ const emit = __emit;
46
+ const props = __props;
47
+ const _maxSelect = props.maxSelect || 100;
48
+ const selectedData = ref([]);
49
+ const categoryCascaderData = ref([]);
50
+ const listMinHeight = ref(0);
51
+ const mediaFileData = ref([]);
52
+ const filter = ref(null);
53
+ const page = ref({
54
+ index: 1,
55
+ size: 30,
56
+ total: 0
57
+ });
58
+ const tempSelectedData = computed(() => {
59
+ return props.defaultSelectedData || [];
60
+ });
61
+ watch(
62
+ () => tempSelectedData.value,
63
+ (val) => {
64
+ selectedData.value = val;
65
+ }
66
+ );
67
+ const importantBanner = computed(() => {
68
+ if (!props.banner || props.banner === "all")
69
+ return false;
70
+ return !!props.banner;
71
+ });
72
+ const {
73
+ isItemChecked,
74
+ tableCellMouseEnter,
75
+ tableCellMouseLeave
76
+ } = useTableBatch();
77
+ const selectTableCell = (record) => {
78
+ selectData(record);
79
+ };
80
+ const selectTableAll = (checked) => {
81
+ if (checked) {
82
+ selectedData.value = [];
83
+ mediaFileData.value.forEach((item) => selectData(item));
84
+ } else {
85
+ selectedData.value = [];
86
+ }
87
+ emitChange();
88
+ };
89
+ const selectData = (record) => {
90
+ if (importantBanner.value) {
91
+ const {
92
+ cover: { banner }
93
+ } = record;
94
+ if (!banner) {
95
+ return Message.warning({ content: "\u8BE5\u5185\u5BB9\u4E0D\u5177\u5907\u72EC\u7ACB\u8F6E\u64AD\u56FE" });
96
+ }
97
+ }
98
+ addDataToSelectedList(record);
99
+ return true;
100
+ };
101
+ const addDataToSelectedList = async (record) => {
102
+ const index = selectedData.value.findIndex((v) => v.id === record.id);
103
+ if (selectedData.value.length < _maxSelect) {
104
+ if (index === -1) {
105
+ selectedData.value.push(record);
106
+ } else {
107
+ selectedData.value.splice(index, 1);
108
+ }
109
+ emitChange();
110
+ } else {
111
+ if (index === -1) {
112
+ selectedData.value.splice(selectedData.value.length - 1, 1);
113
+ selectedData.value.push(record);
114
+ } else {
115
+ selectedData.value.splice(index, 1);
116
+ }
117
+ emitChange();
118
+ }
119
+ };
120
+ const emitChange = () => {
121
+ emit("change", selectedData.value);
122
+ };
123
+ const group_id = ref(0);
124
+ const scrollPercent = { y: "100%" };
125
+ const search = (_filter) => {
126
+ columns.value.some((e) => {
127
+ if (e.dataIndex === "pub_time") {
128
+ e.title = _filter.order === "create_time" ? "\u521B\u5EFA\u65F6\u95F4" : "\u53D1\u5E03\u65F6\u95F4";
129
+ return e;
130
+ }
131
+ return false;
132
+ });
133
+ _filter = { ..._filter };
134
+ const where = [];
135
+ _filter.precise_kw && where.push(`precise_kw:${_filter.precise_kw}`);
136
+ _filter.keywords && where.push(`kw:${_filter.keywords}`);
137
+ _filter.type && where.push(`series:${_filter.type}`);
138
+ _filter.state && where.push(`state:${_filter.state}`);
139
+ _filter.cover_type && where.push(`cover_type:${_filter.cover_type}`);
140
+ _filter.banner && where.push(`banner:${_filter.banner}`);
141
+ if (_filter.publish_date && Array.isArray(_filter.publish_date) && _filter.publish_date.length > 0) {
142
+ where.push(`publish_from:${_filter.publish_date[0] / 1e3}`);
143
+ where.push(`publish_to:${_filter.publish_date[1] / 1e3}`);
144
+ }
145
+ _filter.where = where;
146
+ filter.value = { ..._filter };
147
+ page.value.index = 1;
148
+ loadData();
149
+ };
150
+ const pageChangeHandle = (index) => {
151
+ page.value.index = index;
152
+ loadData();
153
+ };
154
+ watch(
155
+ () => group_id.value,
156
+ () => {
157
+ page.value.index = 1;
158
+ loadData();
159
+ }
160
+ );
161
+ const columns = ref([
162
+ {
163
+ title: "\u52FE",
164
+ dataIndex: "select",
165
+ slotName: "select",
166
+ width: 40,
167
+ titleSlotName: "selectTitle",
168
+ render: ({ record }) => {
169
+ if (props.typeKey === "series:special_v3") {
170
+ if (record.isLeaf) {
171
+ return h(Checkbox, {
172
+ modelValue: isItemChecked.value(selectedData.value, record),
173
+ class: "icon"
174
+ });
175
+ }
176
+ return null;
177
+ }
178
+ return h(Checkbox, {
179
+ modelValue: isItemChecked.value(selectedData.value, record),
180
+ class: "icon"
181
+ });
182
+ }
183
+ },
184
+ {
185
+ title: "\u4E13\u9898/\u680F\u76EE\u540D\u79F0",
186
+ dataIndex: "title",
187
+ slotName: "title",
188
+ width: 428
189
+ },
190
+ {
191
+ title: "\u7F16\u8F91",
192
+ dataIndex: "duty_editor",
193
+ slotName: "duty_editor",
194
+ width: 100
195
+ },
196
+ {
197
+ title: "\u53D1\u5E03\u65F6\u95F4",
198
+ dataIndex: "pub_time",
199
+ slotName: "pub_time",
200
+ width: 150
201
+ }
202
+ ]);
203
+ const politicalColumns = ref([
204
+ {
205
+ title: "\u52FE",
206
+ dataIndex: "select",
207
+ slotName: "select",
208
+ width: 40,
209
+ titleSlotName: "selectTitle"
210
+ },
211
+ {
212
+ title: "\u653F\u60C5\u4EBA\u7269\u59D3\u540D",
213
+ dataIndex: "name",
214
+ slotName: "name",
215
+ width: 428
216
+ },
217
+ {
218
+ title: "\u804C\u4F4D",
219
+ dataIndex: "position",
220
+ slotName: "position",
221
+ width: 100
222
+ },
223
+ {
224
+ title: "\u5730\u533A",
225
+ dataIndex: "city_alias",
226
+ slotName: "city_alias",
227
+ width: 150
228
+ }
229
+ ]);
230
+ const dataLoading = ref(false);
231
+ const loadData = async () => {
232
+ const params = {
233
+ limit: page.value.size,
234
+ offset: page.value.size * (page.value.index - 1),
235
+ where: ["state:15|19"]
236
+ };
237
+ params.where.push(props.typeKey);
238
+ if (filter.value) {
239
+ const _filter = filter.value;
240
+ params.order = _filter.order;
241
+ params.sort = _filter.sort;
242
+ if (_filter.where) {
243
+ params.where = [...params.where, ..._filter.where];
244
+ }
245
+ }
246
+ params.where = params.where.join(",");
247
+ dataLoading.value = true;
248
+ let code = "";
249
+ let message = "";
250
+ if (props.typeKey) {
251
+ const { code: code1, message: message1 } = await getCategoryMediaNew(
252
+ props.userInfo.BASE_API,
253
+ params
254
+ );
255
+ code = code1;
256
+ message = message1;
257
+ } else {
258
+ params.state = 2;
259
+ const { code: code1, message: message1 } = await getPoliticals(
260
+ props.userInfo.BASE_API,
261
+ params
262
+ );
263
+ code = code1;
264
+ message = message1;
265
+ }
266
+ dataLoading.value = false;
267
+ if (code === 0) {
268
+ mediaFileData.value = (message.data || message.datas).map((v) => {
269
+ v.catalog = "doc";
270
+ v.target_id = v.id;
271
+ v.target_type = 3;
272
+ v.pub_time = v.pub_time || v.created_at;
273
+ v.update_time = v.updated_at;
274
+ v.pub_user_alias = v.author_alias;
275
+ v.key = v.id;
276
+ v.isLeaf = props.typeKey !== "series:special_v3";
277
+ return v;
278
+ }) || [];
279
+ page.value.total = message.total || message.count;
280
+ }
281
+ };
282
+ const loadMore = async (record, done) => {
283
+ const res = await getMlists(props.userInfo.BASE_API, {
284
+ rid: 4,
285
+ gid: record.special_id
286
+ });
287
+ window.setTimeout(() => {
288
+ done(
289
+ res.message.map((item) => ({
290
+ ...item,
291
+ isLeaf: true,
292
+ key: item.id
293
+ }))
294
+ );
295
+ }, 2e3);
296
+ };
297
+ onMounted(() => {
298
+ loadData();
299
+ });
300
+ return (_ctx, _cache) => {
301
+ return openBlock(), createElementBlock("div", _hoisted_1, [
302
+ createVNode(_sfc_main$1, {
303
+ group_id: group_id.value,
304
+ "onUpdate:group_id": _cache[0] || (_cache[0] = ($event) => group_id.value = $event),
305
+ banner: _ctx.banner,
306
+ height: listMinHeight.value,
307
+ series: props.series,
308
+ tree: categoryCascaderData.value,
309
+ "user-info": props.userInfo,
310
+ onSearch: search
311
+ }, null, 8, ["group_id", "banner", "height", "series", "tree", "user-info"]),
312
+ _ctx.typeKey ? (openBlock(), createElementBlock("div", _hoisted_2, [
313
+ createVNode(unref(Table), {
314
+ bordered: false,
315
+ columns: columns.value,
316
+ data: mediaFileData.value,
317
+ pagination: false,
318
+ loading: dataLoading.value,
319
+ scroll: scrollPercent,
320
+ "load-more": loadMore,
321
+ onCellMouseEnter: unref(tableCellMouseEnter),
322
+ onCellMouseLeave: unref(tableCellMouseLeave),
323
+ onRowClick: selectTableCell
324
+ }, {
325
+ "expand-icon": withCtx(({ expanded }) => [
326
+ !expanded ? (openBlock(), createBlock(unref(IconRight), { key: 0 })) : (openBlock(), createBlock(unref(IconDown), { key: 1 }))
327
+ ]),
328
+ selectTitle: withCtx(() => [
329
+ createVNode(unref(Checkbox), {
330
+ "model-value": selectedData.value.length === mediaFileData.value.length,
331
+ class: "icon",
332
+ onChange: selectTableAll
333
+ }, null, 8, ["model-value"])
334
+ ]),
335
+ select: withCtx(({ record }) => [
336
+ createVNode(unref(Checkbox), {
337
+ "model-value": unref(isItemChecked)(selectedData.value, record),
338
+ class: "icon"
339
+ }, null, 8, ["model-value"])
340
+ ]),
341
+ title: withCtx(({ record }) => [
342
+ createElementVNode("span", _hoisted_3, [
343
+ createVNode(_sfc_main$2, {
344
+ type: record.series,
345
+ class: "icon",
346
+ doc: ""
347
+ }, null, 8, ["type"]),
348
+ createElementVNode("span", _hoisted_4, toDisplayString(record.title || record.alias || "--"), 1)
349
+ ])
350
+ ]),
351
+ series: withCtx(({ record }) => [
352
+ createVNode(_sfc_main$3, { item: record }, null, 8, ["item"])
353
+ ]),
354
+ duty_editor: withCtx(({ record }) => [
355
+ createElementVNode("span", _hoisted_5, [
356
+ createElementVNode("span", null, toDisplayString(record.duty_editor || "--"), 1)
357
+ ])
358
+ ]),
359
+ pub_time: withCtx(({ record }) => [
360
+ createElementVNode("span", _hoisted_6, [
361
+ createElementVNode("span", null, toDisplayString(unref(timeFormat)(record.pub_time)), 1)
362
+ ])
363
+ ]),
364
+ _: 1
365
+ }, 8, ["columns", "data", "loading", "onCellMouseEnter", "onCellMouseLeave"])
366
+ ])) : (openBlock(), createElementBlock("div", _hoisted_7, [
367
+ createVNode(unref(Table), {
368
+ bordered: false,
369
+ columns: politicalColumns.value,
370
+ data: mediaFileData.value,
371
+ pagination: false,
372
+ loading: dataLoading.value,
373
+ scroll: scrollPercent,
374
+ onCellMouseEnter: unref(tableCellMouseEnter),
375
+ onCellMouseLeave: unref(tableCellMouseLeave),
376
+ onRowClick: selectTableCell
377
+ }, {
378
+ selectTitle: withCtx(() => [
379
+ createVNode(unref(Checkbox), {
380
+ "model-value": selectedData.value.length === mediaFileData.value.length,
381
+ class: "icon",
382
+ onChange: selectTableAll
383
+ }, null, 8, ["model-value"])
384
+ ]),
385
+ select: withCtx(({ record }) => [
386
+ createVNode(unref(Checkbox), {
387
+ "model-value": unref(isItemChecked)(selectedData.value, record),
388
+ class: "icon"
389
+ }, null, 8, ["model-value"])
390
+ ]),
391
+ name: withCtx(({ record }) => [
392
+ createElementVNode("span", _hoisted_8, [
393
+ createVNode(_sfc_main$2, {
394
+ type: record.series,
395
+ class: "icon",
396
+ doc: ""
397
+ }, null, 8, ["type"]),
398
+ createElementVNode("span", _hoisted_9, toDisplayString(record.name || record.alias || "--"), 1)
399
+ ])
400
+ ]),
401
+ series: withCtx(({ record }) => [
402
+ createVNode(_sfc_main$3, { item: record }, null, 8, ["item"])
403
+ ]),
404
+ position: withCtx(({ record }) => [
405
+ createElementVNode("span", _hoisted_10, [
406
+ createElementVNode("span", null, toDisplayString(record.position || "--"), 1)
407
+ ])
408
+ ]),
409
+ city_alias: withCtx(({ record }) => [
410
+ createElementVNode("span", _hoisted_11, [
411
+ createElementVNode("span", null, toDisplayString(record.city_alias || "--"), 1)
412
+ ])
413
+ ]),
414
+ _: 1
415
+ }, 8, ["columns", "data", "loading", "onCellMouseEnter", "onCellMouseLeave"])
416
+ ])),
417
+ createElementVNode("div", _hoisted_12, [
418
+ createElementVNode("div", _hoisted_13, [
419
+ renderSlot(_ctx.$slots, "store", {}, void 0, true),
420
+ withDirectives(createVNode(unref(Pagination), {
421
+ current: page.value.index,
422
+ "page-size": page.value.size,
423
+ total: page.value.total,
424
+ onChange: pageChangeHandle
425
+ }, null, 8, ["current", "page-size", "total"]), [
426
+ [vShow, mediaFileData.value.length > 0]
427
+ ])
428
+ ]),
429
+ renderSlot(_ctx.$slots, "options", {}, void 0, true)
430
+ ])
431
+ ]);
432
+ };
433
+ }
434
+ });
435
+ var ViewAllColumn = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-124914fc"]]);
436
+ export { ViewAllColumn as default };
@@ -0,0 +1,2 @@
1
+ var index_vue_vue_type_style_index_0_scoped_true_lang = "";
2
+ export { index_vue_vue_type_style_index_0_scoped_true_lang as default };
@@ -0,0 +1,16 @@
1
+ import _sfc_main from "./component.js";
2
+ import ViewAllColumn from "./components/ViewAllColumn/index.js";
3
+ export { default as ViewAllColumn } from "./components/ViewAllColumn/index.js";
4
+ import _sfc_main$1 from "./components/ViewAllColumn/MediaFilter/index.js";
5
+ export { default as MediaFilter } from "./components/ViewAllColumn/MediaFilter/index.js";
6
+ import _sfc_main$2 from "./components/ViewAllColumn/columnTree/index.js";
7
+ export { default as ColumnTree } from "./components/ViewAllColumn/columnTree/index.js";
8
+ const selectAddTo = Object.assign(_sfc_main, {
9
+ install: (app) => {
10
+ app.component("SelectAddTo", _sfc_main);
11
+ app.component("ViewAllColumn", ViewAllColumn);
12
+ app.component("MediaFilter", _sfc_main$1);
13
+ app.component("ColumnTree", _sfc_main$2);
14
+ }
15
+ });
16
+ export { selectAddTo as default };
@@ -0,0 +1,36 @@
1
+ import request from "../../utils/request.js";
2
+ function getCategoryPath(BASE_API, params) {
3
+ return request(BASE_API, {
4
+ url: `/poplar/v2/repo/${params == null ? void 0 : params.repo}/category/${params == null ? void 0 : params.category}/path`,
5
+ method: "get"
6
+ });
7
+ }
8
+ function getCategoryMediaNew(BASE_API, params) {
9
+ return request(BASE_API, {
10
+ url: `/poplar/v3/s/documents`,
11
+ method: "get",
12
+ params
13
+ });
14
+ }
15
+ function getPoliticals(BASE_API, params) {
16
+ return request(BASE_API, {
17
+ url: "/poplar/v2/politics/list",
18
+ method: "get",
19
+ params
20
+ });
21
+ }
22
+ function getMlists(BASE_API, params) {
23
+ return request(BASE_API, {
24
+ url: `/poplar/v2/mlists`,
25
+ method: "get",
26
+ params
27
+ });
28
+ }
29
+ function getConfigurationNew(BASE_API, params) {
30
+ return request(BASE_API, {
31
+ url: "/poplar/v2/configuration",
32
+ method: "get",
33
+ params
34
+ });
35
+ }
36
+ export { getCategoryMediaNew, getCategoryPath, getConfigurationNew, getMlists, getPoliticals };
package/es/style.css CHANGED
@@ -1,3 +1,19 @@
1
+ .pic-thumb-img[data-v-124914fc] {
2
+ width: 80px;
3
+ height: 80px;
4
+ object-fit: cover;
5
+ border-radius: 4px;
6
+ }
7
+ .pic-thumb-img.placeholder[data-v-124914fc] {
8
+ background-color: #f5f5f5;
9
+ display: flex;
10
+ align-items: center;
11
+ justify-content: center;
12
+ }
13
+ .pic-thumb-img.placeholder .placeholder-text[data-v-124914fc] {
14
+ color: #999;
15
+ font-size: 12px;
16
+ }
1
17
  .type-icons-container {
2
18
  display: inline-block;
3
19
  vertical-align: middle;
package/lib/index.js CHANGED
@@ -30,6 +30,7 @@ var index$p = require("./docPreview/index.js");
30
30
  var index$q = require("./docHistory/index.js");
31
31
  var index$r = require("./videoThumb/index.js");
32
32
  var index$s = require("./importData/index.js");
33
+ var index$t = require("./selectAddTo/index.js");
33
34
  exports["default"] = components;
34
35
  exports.appCenter = index;
35
36
  exports.messageBox = index$1;
@@ -60,3 +61,4 @@ exports.docPreview = index$p;
60
61
  exports.docHistory = index$q;
61
62
  exports.videoThumb = index$r;
62
63
  exports.importData = index$s;
64
+ exports.selectAddTo = index$t["default"];