@cmstops/pro-compo 0.1.27 → 0.1.29

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 (83) hide show
  1. package/dist/index.css +72 -55
  2. package/dist/index.min.css +1 -1
  3. package/es/contentDetailList/components/Content/DocItem/index.js +1 -1
  4. package/es/contentDetailList/components/Content/DocMpItem/index.js +1 -1
  5. package/es/contentDetailList/components/Content/KongoNavItem/index.js +1 -1
  6. package/es/contentDetailList/components/Content/MaccountItem/index.js +1 -1
  7. package/es/contentDetailList/style/index.css +0 -48
  8. package/es/contentDetailList/style/index.less +0 -1
  9. package/es/contentModal/component.js +165 -5
  10. package/es/contentModal/components/CompoList/index.js +13 -6
  11. package/es/contentModal/components/ContentList/MediaFilter/index.js +112 -0
  12. package/es/contentModal/components/ContentList/index.d.ts +0 -0
  13. package/es/contentModal/components/ContentList/index.js +269 -0
  14. package/es/contentModal/components/LiveList/MediaFilter/index.d.ts +0 -0
  15. package/es/contentModal/components/LiveList/MediaFilter/index.js +74 -0
  16. package/es/contentModal/components/LiveList/index.d.ts +0 -0
  17. package/es/contentModal/components/LiveList/index.js +227 -0
  18. package/es/contentModal/components/MpAccountList/MpAccountFilter/index.d.ts +0 -0
  19. package/es/contentModal/components/MpAccountList/MpAccountFilter/index.js +62 -0
  20. package/es/contentModal/components/MpAccountList/index.d.ts +0 -0
  21. package/es/contentModal/components/MpAccountList/index.js +222 -0
  22. package/es/contentModal/components/MpContentList/MediaFilter/index.d.ts +0 -0
  23. package/es/contentModal/components/MpContentList/MediaFilter/index.js +85 -0
  24. package/es/contentModal/components/MpContentList/index.d.ts +0 -0
  25. package/es/contentModal/components/MpContentList/index.js +214 -0
  26. package/es/contentModal/components/ViewAllColumn/MediaFilter/index.js +176 -12
  27. package/es/contentModal/components/ViewAllColumn/index.js +33 -14
  28. package/es/contentModal/images/user.js +2 -0
  29. package/es/contentModal/script/api.d.ts +3 -0
  30. package/es/contentModal/script/api.js +22 -1
  31. package/es/contentModal/style/ViewAllColumn.less +51 -31
  32. package/es/contentModal/style/index.css +21 -7
  33. package/es/dataTags/component.d.ts +0 -0
  34. package/es/{contentDetailList/components/DocTags/index.js → dataTags/component.js} +9 -7
  35. package/es/dataTags/index.d.ts +2 -0
  36. package/es/dataTags/index.js +7 -0
  37. package/es/dataTags/style/css.js +1 -0
  38. package/es/dataTags/style/index.css +51 -0
  39. package/es/dataTags/style/index.d.ts +1 -0
  40. package/es/dataTags/style/index.js +1 -0
  41. package/{lib/contentDetailList/style/DocTags.less → es/dataTags/style/index.less} +12 -8
  42. package/es/emptyData/component.js +5 -5
  43. package/es/index.css +72 -55
  44. package/es/index.d.ts +1 -0
  45. package/es/index.js +1 -0
  46. package/es/index.less +1 -0
  47. package/es/utils/typeMap.d.ts +6 -15
  48. package/es/utils/typeMap.js +21 -1
  49. package/lib/contentDetailList/components/Content/DocItem/index.js +4 -4
  50. package/lib/contentDetailList/components/Content/DocMpItem/index.js +2 -2
  51. package/lib/contentDetailList/components/Content/KongoNavItem/index.js +2 -2
  52. package/lib/contentDetailList/components/Content/MaccountItem/index.js +2 -2
  53. package/lib/contentDetailList/style/index.css +0 -48
  54. package/lib/contentDetailList/style/index.less +0 -1
  55. package/lib/contentModal/component.js +165 -5
  56. package/lib/contentModal/components/CompoList/index.js +15 -8
  57. package/lib/contentModal/components/ContentList/MediaFilter/index.js +113 -0
  58. package/lib/contentModal/components/ContentList/index.js +270 -0
  59. package/lib/contentModal/components/LiveList/MediaFilter/index.js +75 -0
  60. package/lib/contentModal/components/LiveList/index.js +228 -0
  61. package/lib/contentModal/components/MpAccountList/MpAccountFilter/index.js +63 -0
  62. package/lib/contentModal/components/MpAccountList/index.js +223 -0
  63. package/lib/contentModal/components/MpContentList/MediaFilter/index.js +86 -0
  64. package/lib/contentModal/components/MpContentList/index.js +215 -0
  65. package/lib/contentModal/components/ViewAllColumn/MediaFilter/index.js +175 -11
  66. package/lib/contentModal/components/ViewAllColumn/index.js +33 -14
  67. package/lib/contentModal/images/user.js +3 -0
  68. package/lib/contentModal/script/api.js +24 -0
  69. package/lib/contentModal/style/ViewAllColumn.less +51 -31
  70. package/lib/contentModal/style/index.css +21 -7
  71. package/lib/{contentDetailList/components/DocTags/index.js → dataTags/component.js} +9 -7
  72. package/lib/dataTags/index.js +8 -0
  73. package/lib/dataTags/style/css.js +2 -0
  74. package/lib/dataTags/style/index.css +51 -0
  75. package/lib/dataTags/style/index.js +2 -0
  76. package/{es/contentDetailList/style/DocTags.less → lib/dataTags/style/index.less} +12 -8
  77. package/lib/emptyData/component.js +4 -4
  78. package/lib/index.css +72 -55
  79. package/lib/index.js +2 -0
  80. package/lib/index.less +1 -0
  81. package/lib/utils/typeMap.js +22 -0
  82. package/package.json +1 -1
  83. /package/es/{contentDetailList/components/DocTags → contentModal/components/ContentList/MediaFilter}/index.d.ts +0 -0
@@ -1,7 +1,11 @@
1
1
  import { defineComponent, computed, ref, onMounted, openBlock, createBlock, unref, withCtx, createTextVNode, toDisplayString, createVNode, createCommentVNode } from "vue";
2
2
  import { Modal, Tabs, TabPane, Button } from "@arco-design/web-vue";
3
3
  import _sfc_main$1 from "./components/ViewAllColumn/index.js";
4
- import _sfc_main$3 from "./components/CompoList/index.js";
4
+ import _sfc_main$4 from "./components/CompoList/index.js";
5
+ import _sfc_main$6 from "./components/MpAccountList/index.js";
6
+ import _sfc_main$3 from "./components/ContentList/index.js";
7
+ import _sfc_main$5 from "./components/LiveList/index.js";
8
+ import _sfc_main$7 from "./components/MpContentList/index.js";
5
9
  import _sfc_main$2 from "./components/storeBox/index.js";
6
10
  import "../typeIcons/style/index.js";
7
11
  import { DEFAULT_BASE_API } from "../config.js";
@@ -58,6 +62,9 @@ const _sfc_main = defineComponent({
58
62
  const HandleClose = () => {
59
63
  selectedData.value = [];
60
64
  };
65
+ const tabsChange = () => {
66
+ selectedData.value = [];
67
+ };
61
68
  onMounted(() => {
62
69
  if (props.userStore) {
63
70
  userInfo.value = { BASE_API, ...props.userStore };
@@ -86,7 +93,8 @@ const _sfc_main = defineComponent({
86
93
  default: withCtx(() => [
87
94
  createVNode(unref(Tabs), {
88
95
  class: "content-tabs",
89
- justify: ""
96
+ justify: "",
97
+ onTabClick: tabsChange
90
98
  }, {
91
99
  default: withCtx(() => [
92
100
  typeDataController.value.addDoc ? (openBlock(), createBlock(unref(TabPane), {
@@ -127,9 +135,9 @@ const _sfc_main = defineComponent({
127
135
  ]),
128
136
  _: 1
129
137
  })) : createCommentVNode("v-if", true),
130
- typeDataController.value.addCompo ? (openBlock(), createBlock(unref(TabPane), {
138
+ typeDataController.value.addContentList ? (openBlock(), createBlock(unref(TabPane), {
131
139
  key: "2",
132
- title: "\u7EC4\u4EF6"
140
+ title: "\u9891\u9053"
133
141
  }, {
134
142
  default: withCtx(() => [
135
143
  unref(userInfo) && unref(userInfo).repository_id ? (openBlock(), createBlock(_sfc_main$3, {
@@ -138,8 +146,8 @@ const _sfc_main = defineComponent({
138
146
  "default-selected-data": selectedData.value,
139
147
  "outside-select-data": _ctx.outsideSelectData || [],
140
148
  "type-data": typeDataController.value,
141
- columns: typeDataController.value.compoType,
142
149
  "user-info": unref(userInfo),
150
+ type: typeDataController.value.contentListType,
143
151
  onChange: selectedDataChangeHandle
144
152
  }, {
145
153
  store: withCtx(() => [
@@ -161,6 +169,158 @@ const _sfc_main = defineComponent({
161
169
  }, 8, ["disabled"])
162
170
  ]),
163
171
  _: 1
172
+ }, 8, ["max-select", "default-selected-data", "outside-select-data", "type-data", "user-info", "type"])) : createCommentVNode("v-if", true)
173
+ ]),
174
+ _: 1
175
+ })) : createCommentVNode("v-if", true),
176
+ typeDataController.value.addCompo ? (openBlock(), createBlock(unref(TabPane), {
177
+ key: "5",
178
+ title: "\u7EC4\u4EF6"
179
+ }, {
180
+ default: withCtx(() => [
181
+ unref(userInfo) && unref(userInfo).repository_id ? (openBlock(), createBlock(_sfc_main$4, {
182
+ key: 0,
183
+ "max-select": _ctx.maxSelect,
184
+ "default-selected-data": selectedData.value,
185
+ "outside-select-data": _ctx.outsideSelectData || [],
186
+ "type-data": typeDataController.value,
187
+ columns: typeDataController.value.compoType,
188
+ "user-info": unref(userInfo),
189
+ onChange: selectedDataChangeHandle
190
+ }, {
191
+ store: withCtx(() => [
192
+ createVNode(_sfc_main$2, {
193
+ selectData: selectedData.value,
194
+ "onUpdate:selectData": _cache[2] || (_cache[2] = ($event) => selectedData.value = $event)
195
+ }, null, 8, ["selectData"])
196
+ ]),
197
+ options: withCtx(() => [
198
+ createVNode(unref(Button), {
199
+ type: "primary",
200
+ disabled: !hasSelected.value,
201
+ onClick: comfirm
202
+ }, {
203
+ default: withCtx(() => [
204
+ createTextVNode(" \u6DFB\u52A0 ")
205
+ ]),
206
+ _: 1
207
+ }, 8, ["disabled"])
208
+ ]),
209
+ _: 1
210
+ }, 8, ["max-select", "default-selected-data", "outside-select-data", "type-data", "columns", "user-info"])) : createCommentVNode("v-if", true)
211
+ ]),
212
+ _: 1
213
+ })) : createCommentVNode("v-if", true),
214
+ typeDataController.value.addCompo ? (openBlock(), createBlock(unref(TabPane), {
215
+ key: "6",
216
+ title: "\u4E92\u52A8\u76F4\u64AD"
217
+ }, {
218
+ default: withCtx(() => [
219
+ unref(userInfo) && unref(userInfo).repository_id ? (openBlock(), createBlock(_sfc_main$5, {
220
+ key: 0,
221
+ "max-select": _ctx.maxSelect,
222
+ "default-selected-data": selectedData.value,
223
+ "outside-select-data": _ctx.outsideSelectData || [],
224
+ "type-data": typeDataController.value,
225
+ columns: typeDataController.value.compoType,
226
+ "user-info": unref(userInfo),
227
+ onChange: selectedDataChangeHandle
228
+ }, {
229
+ store: withCtx(() => [
230
+ createVNode(_sfc_main$2, {
231
+ selectData: selectedData.value,
232
+ "onUpdate:selectData": _cache[3] || (_cache[3] = ($event) => selectedData.value = $event)
233
+ }, null, 8, ["selectData"])
234
+ ]),
235
+ options: withCtx(() => [
236
+ createVNode(unref(Button), {
237
+ type: "primary",
238
+ disabled: !hasSelected.value,
239
+ onClick: comfirm
240
+ }, {
241
+ default: withCtx(() => [
242
+ createTextVNode(" \u6DFB\u52A0 ")
243
+ ]),
244
+ _: 1
245
+ }, 8, ["disabled"])
246
+ ]),
247
+ _: 1
248
+ }, 8, ["max-select", "default-selected-data", "outside-select-data", "type-data", "columns", "user-info"])) : createCommentVNode("v-if", true)
249
+ ]),
250
+ _: 1
251
+ })) : createCommentVNode("v-if", true),
252
+ typeDataController.value.addMpAccount ? (openBlock(), createBlock(unref(TabPane), {
253
+ key: "7",
254
+ title: "\u516C\u4F17\u53F7"
255
+ }, {
256
+ default: withCtx(() => [
257
+ unref(userInfo) && unref(userInfo).repository_id ? (openBlock(), createBlock(_sfc_main$6, {
258
+ key: 0,
259
+ "max-select": _ctx.maxSelect,
260
+ "default-selected-data": selectedData.value,
261
+ "outside-select-data": _ctx.outsideSelectData || [],
262
+ "type-data": typeDataController.value,
263
+ columns: typeDataController.value.MpAccountType,
264
+ "user-info": unref(userInfo),
265
+ onChange: selectedDataChangeHandle
266
+ }, {
267
+ store: withCtx(() => [
268
+ createVNode(_sfc_main$2, {
269
+ selectData: selectedData.value,
270
+ "onUpdate:selectData": _cache[4] || (_cache[4] = ($event) => selectedData.value = $event)
271
+ }, null, 8, ["selectData"])
272
+ ]),
273
+ options: withCtx(() => [
274
+ createVNode(unref(Button), {
275
+ type: "primary",
276
+ disabled: !hasSelected.value,
277
+ onClick: comfirm
278
+ }, {
279
+ default: withCtx(() => [
280
+ createTextVNode(" \u6DFB\u52A0 ")
281
+ ]),
282
+ _: 1
283
+ }, 8, ["disabled"])
284
+ ]),
285
+ _: 1
286
+ }, 8, ["max-select", "default-selected-data", "outside-select-data", "type-data", "columns", "user-info"])) : createCommentVNode("v-if", true)
287
+ ]),
288
+ _: 1
289
+ })) : createCommentVNode("v-if", true),
290
+ typeDataController.value.addMpContent ? (openBlock(), createBlock(unref(TabPane), {
291
+ key: "8",
292
+ title: "\u516C\u4F17\u53F7\u5185\u5BB9"
293
+ }, {
294
+ default: withCtx(() => [
295
+ unref(userInfo) && unref(userInfo).repository_id ? (openBlock(), createBlock(_sfc_main$7, {
296
+ key: 0,
297
+ "max-select": _ctx.maxSelect,
298
+ "default-selected-data": selectedData.value,
299
+ "outside-select-data": _ctx.outsideSelectData || [],
300
+ "type-data": typeDataController.value,
301
+ columns: typeDataController.value.MpAccountType,
302
+ "user-info": unref(userInfo),
303
+ onChange: selectedDataChangeHandle
304
+ }, {
305
+ store: withCtx(() => [
306
+ createVNode(_sfc_main$2, {
307
+ selectData: selectedData.value,
308
+ "onUpdate:selectData": _cache[5] || (_cache[5] = ($event) => selectedData.value = $event)
309
+ }, null, 8, ["selectData"])
310
+ ]),
311
+ options: withCtx(() => [
312
+ createVNode(unref(Button), {
313
+ type: "primary",
314
+ disabled: !hasSelected.value,
315
+ onClick: comfirm
316
+ }, {
317
+ default: withCtx(() => [
318
+ createTextVNode(" \u6DFB\u52A0 ")
319
+ ]),
320
+ _: 1
321
+ }, 8, ["disabled"])
322
+ ]),
323
+ _: 1
164
324
  }, 8, ["max-select", "default-selected-data", "outside-select-data", "type-data", "columns", "user-info"])) : createCommentVNode("v-if", true)
165
325
  ]),
166
326
  _: 1
@@ -5,7 +5,7 @@ import _sfc_main$1 from "./CompoFilter/index.js";
5
5
  import useTableBatch from "../../../hooks/batch.js";
6
6
  import { searchMlists, getCategorylistsGroups } from "../../script/api.js";
7
7
  import { compoColumnsMap } from "../../../utils/typeMap.js";
8
- import { dateYYYYDDMMHHmm } from "../../../utils/index.js";
8
+ import { timeFormat } from "../../../utils/index.js";
9
9
  const _hoisted_1 = { class: "view-all-column-container" };
10
10
  const _hoisted_2 = { class: "content-table-view" };
11
11
  const _hoisted_3 = { class: "title-span" };
@@ -26,7 +26,13 @@ const _sfc_main = defineComponent({
26
26
  emits: ["change"],
27
27
  setup(__props, { emit }) {
28
28
  const props = __props;
29
- const columnIdMap = compoColumnsMap();
29
+ const columnIdMap = (compo) => {
30
+ if ((compo == null ? void 0 : compo.term_switch) === 1) {
31
+ return "PC\u6A21\u5757";
32
+ }
33
+ const _type = compoColumnsMap();
34
+ return _type[compo.columns];
35
+ };
30
36
  const _maxSelect = props.maxSelect || 100;
31
37
  const selectedData = ref([]);
32
38
  const tempSelectedData = computed(() => {
@@ -131,7 +137,8 @@ const _sfc_main = defineComponent({
131
137
  let params = {
132
138
  rid: props.userInfo.repository_id,
133
139
  state: 1,
134
- group_type: 2
140
+ group_type: 2,
141
+ terminal: "pc"
135
142
  };
136
143
  if (filter.value) {
137
144
  params = { ...params, ...filter.value };
@@ -148,7 +155,7 @@ const _sfc_main = defineComponent({
148
155
  v.channel_type = 1;
149
156
  v.target_id = v.id;
150
157
  v.target_type = 6;
151
- v.pub_time = dateYYYYDDMMHHmm(v.publish_at);
158
+ v.pub_time = v.publish_at;
152
159
  v.update_time = v.updated_at;
153
160
  v.pub_user_alias = v.publish_user_alias;
154
161
  v.creator_alias = v.creator_alias || v.author_alias;
@@ -224,10 +231,10 @@ const _sfc_main = defineComponent({
224
231
  ])
225
232
  ]),
226
233
  type: withCtx(({ record }) => [
227
- createElementVNode("span", null, toDisplayString(unref(columnIdMap)[record.columns]), 1)
234
+ createElementVNode("span", null, toDisplayString(columnIdMap(record)), 1)
228
235
  ]),
229
236
  pub_time: withCtx(({ record }) => [
230
- createElementVNode("span", null, toDisplayString(record.pub_time), 1)
237
+ createElementVNode("span", null, toDisplayString(unref(timeFormat)(record.pub_time)), 1)
231
238
  ]),
232
239
  _: 1
233
240
  }, 8, ["data", "loading", "onCellMouseEnter", "onCellMouseLeave"])
@@ -0,0 +1,112 @@
1
+ import { defineComponent, ref, computed, watch, openBlock, createElementBlock, createVNode, unref, withCtx, Fragment, renderList, createBlock } from "vue";
2
+ import { Space, Select, Option, Input } from "@arco-design/web-vue";
3
+ import { contentList_relation_type_map } from "../../../../utils/typeMap.js";
4
+ const _hoisted_1 = { class: "media-filter-container" };
5
+ const _sfc_main = defineComponent({
6
+ ...{ name: "MediaFilter" },
7
+ __name: "index",
8
+ props: {
9
+ group_id: {},
10
+ groups: {},
11
+ type: {}
12
+ },
13
+ emits: ["update:group_id", "search"],
14
+ setup(__props, { emit }) {
15
+ const props = __props;
16
+ const filter = ref({ keyword: "", relation_type: "" });
17
+ const groupId = computed({
18
+ get() {
19
+ return props.group_id;
20
+ },
21
+ set(val) {
22
+ emit("update:group_id", val);
23
+ }
24
+ });
25
+ const typeOptions = computed(() => {
26
+ const arr = Object.keys(contentList_relation_type_map).map((key) => {
27
+ return {
28
+ label: contentList_relation_type_map[key],
29
+ value: key
30
+ };
31
+ });
32
+ return [{ value: "", label: "\u5168\u90E8\u7C7B\u578B" }, ...arr].filter((item) => {
33
+ if (props.type === "all")
34
+ return true;
35
+ const arr2 = props.type.split(",");
36
+ filter.value.relation_type = props.type;
37
+ if (item.key === "all") {
38
+ item.value = props.type;
39
+ return true;
40
+ }
41
+ return arr2.includes(item.value);
42
+ });
43
+ });
44
+ const groupOptions = computed(() => {
45
+ const arr = props.groups.map((item) => {
46
+ return {
47
+ label: item.alias || item.title,
48
+ value: item.id
49
+ };
50
+ });
51
+ return [{ value: "all", label: "\u5168\u90E8\u9891\u9053" }, ...arr];
52
+ });
53
+ const handleSearch = () => {
54
+ emit("search", filter.value);
55
+ };
56
+ watch(filter.value, () => {
57
+ handleSearch();
58
+ });
59
+ return (_ctx, _cache) => {
60
+ return openBlock(), createElementBlock("div", _hoisted_1, [
61
+ createVNode(unref(Space), { size: "large" }, {
62
+ default: withCtx(() => [
63
+ createVNode(unref(Select), {
64
+ modelValue: groupId.value,
65
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => groupId.value = $event),
66
+ class: "filter-item",
67
+ placeholder: "\u6A21\u5757"
68
+ }, {
69
+ default: withCtx(() => [
70
+ (openBlock(true), createElementBlock(Fragment, null, renderList(groupOptions.value, (item) => {
71
+ return openBlock(), createBlock(unref(Option), {
72
+ key: item.value,
73
+ label: item.label,
74
+ value: item.value
75
+ }, null, 8, ["label", "value"]);
76
+ }), 128))
77
+ ]),
78
+ _: 1
79
+ }, 8, ["modelValue"]),
80
+ createVNode(unref(Select), {
81
+ modelValue: filter.value.relation_type,
82
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => filter.value.relation_type = $event),
83
+ class: "filter-item",
84
+ placeholder: "\u7C7B\u578B"
85
+ }, {
86
+ default: withCtx(() => [
87
+ (openBlock(true), createElementBlock(Fragment, null, renderList(typeOptions.value, (item) => {
88
+ return openBlock(), createBlock(unref(Option), {
89
+ key: item.value,
90
+ label: item.label,
91
+ value: item.value
92
+ }, null, 8, ["label", "value"]);
93
+ }), 128))
94
+ ]),
95
+ _: 1
96
+ }, 8, ["modelValue"]),
97
+ createVNode(unref(Input), {
98
+ modelValue: filter.value.keyword,
99
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => filter.value.keyword = $event),
100
+ class: "filter-item",
101
+ "allow-clear": "",
102
+ placeholder: "\u8F93\u5165\u5185\u5BB9\u6807\u9898",
103
+ onPressEnter: handleSearch
104
+ }, null, 8, ["modelValue"])
105
+ ]),
106
+ _: 1
107
+ })
108
+ ]);
109
+ };
110
+ }
111
+ });
112
+ export { _sfc_main as default };
@@ -0,0 +1,269 @@
1
+ import { defineComponent, ref, computed, watch, onMounted, openBlock, createElementBlock, createVNode, createElementVNode, unref, withCtx, withModifiers, createBlock, toDisplayString, renderSlot } from "vue";
2
+ import { Table, Checkbox, Message } from "@arco-design/web-vue";
3
+ import _sfc_main$2 from "../../../typeIcons/component.js";
4
+ import _sfc_main$1 from "./MediaFilter/index.js";
5
+ import useTableBatch from "../../../hooks/batch.js";
6
+ import { dateYYYYDDMMHHmm } from "../../../utils/index.js";
7
+ import { searchMlists, getCategorylistsGroups } from "../../script/api.js";
8
+ import { contentList_relation_type_map } from "../../../utils/typeMap.js";
9
+ const _hoisted_1 = { class: "view-all-column-container" };
10
+ const _hoisted_2 = { class: "content-table-view" };
11
+ const _hoisted_3 = { class: "title-span" };
12
+ const _hoisted_4 = ["onClick"];
13
+ const _hoisted_5 = { class: "title" };
14
+ const _hoisted_6 = { class: "bottom-view" };
15
+ const _hoisted_7 = { class: "left" };
16
+ const _sfc_main = defineComponent({
17
+ ...{ name: "ContentList" },
18
+ __name: "index",
19
+ props: {
20
+ type: { default: "all" },
21
+ maxSelect: {},
22
+ outsideSelectData: {},
23
+ defaultSelectedData: {},
24
+ userInfo: {}
25
+ },
26
+ emits: ["change"],
27
+ setup(__props, { emit }) {
28
+ const props = __props;
29
+ const _maxSelect = props.maxSelect || 100;
30
+ const selectedData = ref([]);
31
+ const groupData = ref([]);
32
+ const group_id = ref("all");
33
+ const mediaFileData = ref([]);
34
+ const dataLoading = ref(false);
35
+ const page = ref({
36
+ index: 1,
37
+ size: 100,
38
+ total: 0
39
+ });
40
+ const filter = ref(null);
41
+ const columns = [
42
+ {
43
+ title: "\u9891\u9053\u6807\u9898",
44
+ dataIndex: "title",
45
+ slotName: "title"
46
+ },
47
+ {
48
+ title: "\u9891\u9053\u7C7B\u578B",
49
+ dataIndex: "relation_type",
50
+ slotName: "relation_type"
51
+ },
52
+ {
53
+ title: "\u521B\u5EFA\u65F6\u95F4",
54
+ dataIndex: "created_at",
55
+ slotName: "created_at"
56
+ }
57
+ ];
58
+ const scrollPercent = { y: "100%" };
59
+ const tempSelectedData = computed(() => {
60
+ return props.defaultSelectedData || [];
61
+ });
62
+ const search = (_filter) => {
63
+ if (_filter.keyword || _filter.relation_type) {
64
+ filter.value = { ..._filter };
65
+ } else {
66
+ filter.value = null;
67
+ }
68
+ page.value.index = 1;
69
+ loadData();
70
+ };
71
+ const loadData = async () => {
72
+ const gid = group_id.value;
73
+ if (!gid)
74
+ return;
75
+ let params = {
76
+ rid: props.userInfo.repository_id,
77
+ state: 1,
78
+ group_type: 0
79
+ };
80
+ if (props.type !== "all") {
81
+ params.relation_type = props.type;
82
+ }
83
+ if (filter.value) {
84
+ params = { ...params, ...filter.value };
85
+ }
86
+ if (gid !== "all") {
87
+ params.gid = gid;
88
+ }
89
+ dataLoading.value = true;
90
+ const { code, message } = await searchMlists(props.userInfo.BASE_API, params);
91
+ dataLoading.value = false;
92
+ if (code === 0) {
93
+ mediaFileData.value = message.map((v) => {
94
+ v.catalog = "contentList";
95
+ v.channel_type = 1;
96
+ v.target_id = v.id;
97
+ v.target_type = 6;
98
+ v.pub_time = dateYYYYDDMMHHmm(v.publish_at);
99
+ v.created_at = dateYYYYDDMMHHmm(v.created_at);
100
+ v.update_time = v.updated_at;
101
+ v.pub_user_alias = v.publish_user_alias;
102
+ v.creator_alias = v.creator_alias || v.author_alias;
103
+ v._type = 2;
104
+ switch (v.relation_type) {
105
+ case 0:
106
+ v._listType = "putongpindao";
107
+ break;
108
+ case 1:
109
+ v._listType = "lianjiepindao";
110
+ break;
111
+ case 2:
112
+ v._listType = "yinyongpindao";
113
+ break;
114
+ case 3:
115
+ v._listType = "zijipindao";
116
+ break;
117
+ }
118
+ return v;
119
+ }) || [];
120
+ }
121
+ };
122
+ const clickCheckbox = (e, record) => {
123
+ e.stopPropagation();
124
+ e.preventDefault();
125
+ selectData(record);
126
+ };
127
+ const selectTableCell = (record) => {
128
+ selectData(record);
129
+ };
130
+ const selectData = (record) => {
131
+ if (checkSameAdd(record)) {
132
+ Message.warning({ content: "\u8BF7\u52FF\u6DFB\u52A0\u91CD\u590D\u6570\u636E", duration: 3e3 });
133
+ return;
134
+ }
135
+ addDataToSelectedList(record);
136
+ };
137
+ const checkSameAdd = (record) => {
138
+ const selected = props.outsideSelectData;
139
+ if (!selected.length)
140
+ return false;
141
+ return selected.map((row) => row.id).includes(record.id);
142
+ };
143
+ const addDataToSelectedList = async (record) => {
144
+ const index = selectedData.value.findIndex((v) => v.id === record.id);
145
+ if (selectedData.value.length < _maxSelect) {
146
+ if (index === -1) {
147
+ selectedData.value.push(record);
148
+ } else {
149
+ selectedData.value.splice(index, 1);
150
+ }
151
+ emitChange();
152
+ } else {
153
+ if (index === -1) {
154
+ selectedData.value.splice(selectedData.value.length - 1, 1);
155
+ selectedData.value.push(record);
156
+ } else {
157
+ selectedData.value.splice(index, 1);
158
+ }
159
+ Message.warning({ content: "\u5DF2\u8FBE\u5230\u9009\u62E9\u6570\u91CF\u7684\u4E0A\u9650", duration: 3e3 });
160
+ emitChange();
161
+ }
162
+ };
163
+ const emitChange = () => {
164
+ emit("change", selectedData.value);
165
+ };
166
+ const getGroupData = async () => {
167
+ const params = {
168
+ rid: props.userInfo.repository_id,
169
+ cid: props.userInfo.default_wap_channel_id,
170
+ group_type: 0,
171
+ less: true,
172
+ active: true,
173
+ limit: 100,
174
+ offset: 0
175
+ };
176
+ const { code, message } = await getCategorylistsGroups(
177
+ props.userInfo.BASE_API,
178
+ params
179
+ );
180
+ if (code === 0 && message) {
181
+ const { groups } = message;
182
+ groupData.value = groups.map((v) => {
183
+ v._type = 1;
184
+ v.catalog = "group";
185
+ return v;
186
+ });
187
+ loadData();
188
+ }
189
+ };
190
+ const {
191
+ isItemChecked,
192
+ hoverBatchBox,
193
+ tableCellMouseEnter,
194
+ tableCellMouseLeave
195
+ } = useTableBatch();
196
+ watch(
197
+ () => tempSelectedData.value,
198
+ (val) => {
199
+ selectedData.value = val;
200
+ }
201
+ );
202
+ watch(
203
+ () => group_id.value,
204
+ () => {
205
+ loadData();
206
+ }
207
+ );
208
+ onMounted(() => {
209
+ getGroupData();
210
+ });
211
+ return (_ctx, _cache) => {
212
+ return openBlock(), createElementBlock("div", _hoisted_1, [
213
+ createVNode(_sfc_main$1, {
214
+ group_id: group_id.value,
215
+ "onUpdate:group_id": _cache[0] || (_cache[0] = ($event) => group_id.value = $event),
216
+ groups: groupData.value,
217
+ type: props.type,
218
+ onSearch: search
219
+ }, null, 8, ["group_id", "groups", "type"]),
220
+ createElementVNode("div", _hoisted_2, [
221
+ createVNode(unref(Table), {
222
+ columns,
223
+ scroll: scrollPercent,
224
+ pagination: false,
225
+ bordered: false,
226
+ data: mediaFileData.value,
227
+ loading: dataLoading.value,
228
+ onCellMouseEnter: unref(tableCellMouseEnter),
229
+ onCellMouseLeave: unref(tableCellMouseLeave),
230
+ onRowClick: selectTableCell
231
+ }, {
232
+ title: withCtx(({ record }) => [
233
+ createElementVNode("span", _hoisted_3, [
234
+ unref(hoverBatchBox)(selectedData.value, record) ? (openBlock(), createElementBlock("span", {
235
+ key: 0,
236
+ onClick: withModifiers(($event) => clickCheckbox($event, record), ["stop"])
237
+ }, [
238
+ createVNode(unref(Checkbox), {
239
+ class: "icon",
240
+ "model-value": unref(isItemChecked)(selectedData.value, record)
241
+ }, null, 8, ["model-value"])
242
+ ], 8, _hoisted_4)) : (openBlock(), createBlock(_sfc_main$2, {
243
+ key: 1,
244
+ class: "icon",
245
+ type: record.series
246
+ }, null, 8, ["type"])),
247
+ createElementVNode("span", _hoisted_5, toDisplayString(record.title || record.alias || "--"), 1)
248
+ ])
249
+ ]),
250
+ relation_type: withCtx(({ record }) => [
251
+ createElementVNode("span", null, toDisplayString(unref(contentList_relation_type_map)[record.relation_type] || "--"), 1)
252
+ ]),
253
+ created_at: withCtx(({ record }) => [
254
+ createElementVNode("span", null, toDisplayString(record.created_at), 1)
255
+ ]),
256
+ _: 1
257
+ }, 8, ["data", "loading", "onCellMouseEnter", "onCellMouseLeave"])
258
+ ]),
259
+ createElementVNode("div", _hoisted_6, [
260
+ createElementVNode("div", _hoisted_7, [
261
+ renderSlot(_ctx.$slots, "store")
262
+ ]),
263
+ renderSlot(_ctx.$slots, "options")
264
+ ])
265
+ ]);
266
+ };
267
+ }
268
+ });
269
+ export { _sfc_main as default };