@cmstops/pro-compo 3.9.2-alpha.12 → 3.9.2-alpha.14

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