@cmstops/pro-compo 0.1.26 → 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 (97) hide show
  1. package/dist/index.css +100 -65
  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 +3 -3
  6. package/es/contentDetailList/components/Content/MaccountItem/index.js +30 -23
  7. package/es/contentDetailList/style/ComoItem.less +4 -0
  8. package/es/contentDetailList/style/ContentListItem.less +4 -0
  9. package/es/contentDetailList/style/DocItem.less +4 -6
  10. package/es/contentDetailList/style/DocMpItem.less +4 -6
  11. package/es/contentDetailList/style/KongoNavItem.less +4 -0
  12. package/es/contentDetailList/style/LiveItem.less +4 -0
  13. package/es/contentDetailList/style/MaccountItem.less +4 -0
  14. package/es/contentDetailList/style/index.css +28 -58
  15. package/es/contentDetailList/style/index.less +0 -1
  16. package/es/contentModal/component.js +165 -5
  17. package/es/contentModal/components/CompoList/index.js +13 -6
  18. package/es/contentModal/components/ContentList/MediaFilter/index.js +112 -0
  19. package/es/contentModal/components/ContentList/index.d.ts +0 -0
  20. package/es/contentModal/components/ContentList/index.js +269 -0
  21. package/es/contentModal/components/LiveList/MediaFilter/index.d.ts +0 -0
  22. package/es/contentModal/components/LiveList/MediaFilter/index.js +74 -0
  23. package/es/contentModal/components/LiveList/index.d.ts +0 -0
  24. package/es/contentModal/components/LiveList/index.js +227 -0
  25. package/es/contentModal/components/MpAccountList/MpAccountFilter/index.d.ts +0 -0
  26. package/es/contentModal/components/MpAccountList/MpAccountFilter/index.js +62 -0
  27. package/es/contentModal/components/MpAccountList/index.d.ts +0 -0
  28. package/es/contentModal/components/MpAccountList/index.js +222 -0
  29. package/es/contentModal/components/MpContentList/MediaFilter/index.d.ts +0 -0
  30. package/es/contentModal/components/MpContentList/MediaFilter/index.js +85 -0
  31. package/es/contentModal/components/MpContentList/index.d.ts +0 -0
  32. package/es/contentModal/components/MpContentList/index.js +214 -0
  33. package/es/contentModal/components/ViewAllColumn/MediaFilter/index.js +176 -12
  34. package/es/contentModal/components/ViewAllColumn/index.js +33 -14
  35. package/es/contentModal/images/user.js +2 -0
  36. package/es/contentModal/script/api.d.ts +3 -0
  37. package/es/contentModal/script/api.js +22 -1
  38. package/es/contentModal/style/ViewAllColumn.less +51 -31
  39. package/es/contentModal/style/index.css +21 -7
  40. package/es/dataTags/component.d.ts +0 -0
  41. package/es/{contentDetailList/components/DocTags/index.js → dataTags/component.js} +10 -8
  42. package/es/dataTags/index.d.ts +2 -0
  43. package/es/dataTags/index.js +7 -0
  44. package/es/dataTags/style/css.js +1 -0
  45. package/es/dataTags/style/index.css +51 -0
  46. package/es/dataTags/style/index.d.ts +1 -0
  47. package/es/dataTags/style/index.js +1 -0
  48. package/{lib/contentDetailList/style/DocTags.less → es/dataTags/style/index.less} +12 -8
  49. package/es/emptyData/component.js +5 -5
  50. package/es/index.css +100 -65
  51. package/es/index.d.ts +1 -0
  52. package/es/index.js +1 -0
  53. package/es/index.less +1 -0
  54. package/es/utils/typeMap.d.ts +6 -15
  55. package/es/utils/typeMap.js +21 -1
  56. package/lib/contentDetailList/components/Content/DocItem/index.js +4 -4
  57. package/lib/contentDetailList/components/Content/DocMpItem/index.js +2 -2
  58. package/lib/contentDetailList/components/Content/KongoNavItem/index.js +4 -4
  59. package/lib/contentDetailList/components/Content/MaccountItem/index.js +30 -23
  60. package/lib/contentDetailList/style/ComoItem.less +4 -0
  61. package/lib/contentDetailList/style/ContentListItem.less +4 -0
  62. package/lib/contentDetailList/style/DocItem.less +4 -6
  63. package/lib/contentDetailList/style/DocMpItem.less +4 -6
  64. package/lib/contentDetailList/style/KongoNavItem.less +4 -0
  65. package/lib/contentDetailList/style/LiveItem.less +4 -0
  66. package/lib/contentDetailList/style/MaccountItem.less +4 -0
  67. package/lib/contentDetailList/style/index.css +28 -58
  68. package/lib/contentDetailList/style/index.less +0 -1
  69. package/lib/contentModal/component.js +165 -5
  70. package/lib/contentModal/components/CompoList/index.js +15 -8
  71. package/lib/contentModal/components/ContentList/MediaFilter/index.js +113 -0
  72. package/lib/contentModal/components/ContentList/index.js +270 -0
  73. package/lib/contentModal/components/LiveList/MediaFilter/index.js +75 -0
  74. package/lib/contentModal/components/LiveList/index.js +228 -0
  75. package/lib/contentModal/components/MpAccountList/MpAccountFilter/index.js +63 -0
  76. package/lib/contentModal/components/MpAccountList/index.js +223 -0
  77. package/lib/contentModal/components/MpContentList/MediaFilter/index.js +86 -0
  78. package/lib/contentModal/components/MpContentList/index.js +215 -0
  79. package/lib/contentModal/components/ViewAllColumn/MediaFilter/index.js +175 -11
  80. package/lib/contentModal/components/ViewAllColumn/index.js +33 -14
  81. package/lib/contentModal/images/user.js +3 -0
  82. package/lib/contentModal/script/api.js +24 -0
  83. package/lib/contentModal/style/ViewAllColumn.less +51 -31
  84. package/lib/contentModal/style/index.css +21 -7
  85. package/lib/{contentDetailList/components/DocTags/index.js → dataTags/component.js} +10 -8
  86. package/lib/dataTags/index.js +8 -0
  87. package/lib/dataTags/style/css.js +2 -0
  88. package/lib/dataTags/style/index.css +51 -0
  89. package/lib/dataTags/style/index.js +2 -0
  90. package/{es/contentDetailList/style/DocTags.less → lib/dataTags/style/index.less} +12 -8
  91. package/lib/emptyData/component.js +4 -4
  92. package/lib/index.css +100 -65
  93. package/lib/index.js +2 -0
  94. package/lib/index.less +1 -0
  95. package/lib/utils/typeMap.js +22 -0
  96. package/package.json +1 -1
  97. /package/es/{contentDetailList/components/DocTags → contentModal/components/ContentList/MediaFilter}/index.d.ts +0 -0
@@ -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 };
@@ -0,0 +1,74 @@
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 { ilive_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
+ },
11
+ emits: ["update:group_id", "search"],
12
+ setup(__props, { emit }) {
13
+ const props = __props;
14
+ const filter = ref({ type: "", name: "" });
15
+ computed({
16
+ get() {
17
+ return props.group_id;
18
+ },
19
+ set(val) {
20
+ emit("update:group_id", val);
21
+ }
22
+ });
23
+ const typeOptions = computed(() => {
24
+ const arr = Object.keys(ilive_type_map).map((key) => {
25
+ return {
26
+ label: ilive_type_map[key],
27
+ value: key
28
+ };
29
+ });
30
+ return [{ value: "", label: "\u5168\u90E8\u7C7B\u578B" }, ...arr];
31
+ });
32
+ const handleSearch = () => {
33
+ emit("search", filter.value);
34
+ };
35
+ watch(filter.value, () => {
36
+ handleSearch();
37
+ });
38
+ return (_ctx, _cache) => {
39
+ return openBlock(), createElementBlock("div", _hoisted_1, [
40
+ createVNode(unref(Space), { size: "large" }, {
41
+ default: withCtx(() => [
42
+ createVNode(unref(Select), {
43
+ modelValue: filter.value.type,
44
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => filter.value.type = $event),
45
+ class: "filter-item",
46
+ placeholder: "\u76F4\u64AD\u7C7B\u578B"
47
+ }, {
48
+ default: withCtx(() => [
49
+ (openBlock(true), createElementBlock(Fragment, null, renderList(typeOptions.value, (item) => {
50
+ return openBlock(), createBlock(unref(Option), {
51
+ key: item.value,
52
+ label: item.label,
53
+ value: item.value
54
+ }, null, 8, ["label", "value"]);
55
+ }), 128))
56
+ ]),
57
+ _: 1
58
+ }, 8, ["modelValue"]),
59
+ createVNode(unref(Input), {
60
+ modelValue: filter.value.name,
61
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => filter.value.name = $event),
62
+ class: "filter-item",
63
+ "allow-clear": "",
64
+ placeholder: "\u8F93\u5165\u5185\u5BB9\u6807\u9898",
65
+ onPressEnter: handleSearch
66
+ }, null, 8, ["modelValue"])
67
+ ]),
68
+ _: 1
69
+ })
70
+ ]);
71
+ };
72
+ }
73
+ });
74
+ export { _sfc_main as default };
File without changes
@@ -0,0 +1,227 @@
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 { getBroadcastList } from "../../script/api.js";
8
+ import { ilive_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: "LiveList" },
18
+ __name: "index",
19
+ props: {
20
+ maxSelect: {},
21
+ outsideSelectData: {},
22
+ defaultSelectedData: {},
23
+ userInfo: {}
24
+ },
25
+ emits: ["change"],
26
+ setup(__props, { emit }) {
27
+ const props = __props;
28
+ const _maxSelect = props.maxSelect || 100;
29
+ const selectedData = ref([]);
30
+ const group_id = ref("all");
31
+ const mediaFileData = ref([]);
32
+ const dataLoading = ref(false);
33
+ const page = ref({
34
+ index: 1,
35
+ size: 100,
36
+ total: 0
37
+ });
38
+ const filter = ref(null);
39
+ const columns = [
40
+ {
41
+ title: "\u6807\u9898",
42
+ dataIndex: "title",
43
+ slotName: "title"
44
+ },
45
+ {
46
+ title: "\u7C7B\u578B",
47
+ dataIndex: "live_type",
48
+ slotName: "live_type"
49
+ },
50
+ {
51
+ title: "\u53D1\u5E03\u65F6\u95F4",
52
+ dataIndex: "pub_time",
53
+ slotName: "pub_time"
54
+ }
55
+ ];
56
+ const scrollPercent = { y: "100%" };
57
+ const tempSelectedData = computed(() => {
58
+ return props.defaultSelectedData || [];
59
+ });
60
+ const search = (_filter) => {
61
+ if (_filter.name || _filter.type) {
62
+ filter.value = { ..._filter };
63
+ } else {
64
+ filter.value = null;
65
+ }
66
+ page.value.index = 1;
67
+ loadData();
68
+ };
69
+ const loadData = async () => {
70
+ const gid = group_id.value;
71
+ if (!gid)
72
+ return;
73
+ let params = {
74
+ limit: page.value.size,
75
+ offset: page.value.size * (page.value.index - 1),
76
+ now_status: 0
77
+ };
78
+ if (filter.value) {
79
+ params = { ...params, ...filter.value };
80
+ }
81
+ if (gid !== "all") {
82
+ params.gid = gid;
83
+ }
84
+ dataLoading.value = true;
85
+ const { code, message } = await getBroadcastList(
86
+ props.userInfo.BASE_API,
87
+ params
88
+ );
89
+ dataLoading.value = false;
90
+ if (code === 0) {
91
+ const { count, list } = message;
92
+ mediaFileData.value = list.map((v) => {
93
+ v.catalog = "ilive";
94
+ v.channel_type = 2;
95
+ v.id = v.ID || v.id;
96
+ v.target_id = v.ID;
97
+ v.target_type = 13;
98
+ v.pub_time = dateYYYYDDMMHHmm(v.CreatedAt);
99
+ v.update_time = v.UpdatedAt;
100
+ v._type = 3;
101
+ return v;
102
+ }) || [];
103
+ page.value.total = count || 0;
104
+ }
105
+ };
106
+ const clickCheckbox = (e, record) => {
107
+ e.stopPropagation();
108
+ e.preventDefault();
109
+ selectData(record);
110
+ };
111
+ const selectTableCell = (record) => {
112
+ selectData(record);
113
+ };
114
+ const selectData = (record) => {
115
+ if (checkSameAdd(record)) {
116
+ Message.warning({ content: "\u8BF7\u52FF\u6DFB\u52A0\u91CD\u590D\u6570\u636E", duration: 3e3 });
117
+ return;
118
+ }
119
+ addDataToSelectedList(record);
120
+ };
121
+ const checkSameAdd = (record) => {
122
+ const selected = props.outsideSelectData;
123
+ if (!selected.length)
124
+ return false;
125
+ return selected.map((row) => row.id).includes(record.id);
126
+ };
127
+ const addDataToSelectedList = async (record) => {
128
+ const index = selectedData.value.findIndex((v) => v.id === record.id);
129
+ if (selectedData.value.length < _maxSelect) {
130
+ if (index === -1) {
131
+ selectedData.value.push(record);
132
+ } else {
133
+ selectedData.value.splice(index, 1);
134
+ }
135
+ emitChange();
136
+ } else {
137
+ if (index === -1) {
138
+ selectedData.value.splice(selectedData.value.length - 1, 1);
139
+ selectedData.value.push(record);
140
+ } else {
141
+ selectedData.value.splice(index, 1);
142
+ }
143
+ Message.warning({ content: "\u5DF2\u8FBE\u5230\u9009\u62E9\u6570\u91CF\u7684\u4E0A\u9650", duration: 3e3 });
144
+ emitChange();
145
+ }
146
+ };
147
+ const emitChange = () => {
148
+ emit("change", selectedData.value);
149
+ };
150
+ const {
151
+ isItemChecked,
152
+ hoverBatchBox,
153
+ tableCellMouseEnter,
154
+ tableCellMouseLeave
155
+ } = useTableBatch();
156
+ watch(
157
+ () => tempSelectedData.value,
158
+ (val) => {
159
+ selectedData.value = val;
160
+ }
161
+ );
162
+ watch(
163
+ () => group_id.value,
164
+ () => {
165
+ loadData();
166
+ }
167
+ );
168
+ onMounted(() => {
169
+ loadData();
170
+ });
171
+ return (_ctx, _cache) => {
172
+ return openBlock(), createElementBlock("div", _hoisted_1, [
173
+ createVNode(_sfc_main$1, {
174
+ group_id: group_id.value,
175
+ "onUpdate:group_id": _cache[0] || (_cache[0] = ($event) => group_id.value = $event),
176
+ onSearch: search
177
+ }, null, 8, ["group_id"]),
178
+ createElementVNode("div", _hoisted_2, [
179
+ createVNode(unref(Table), {
180
+ columns,
181
+ scroll: scrollPercent,
182
+ pagination: false,
183
+ bordered: false,
184
+ data: mediaFileData.value,
185
+ loading: dataLoading.value,
186
+ onCellMouseEnter: unref(tableCellMouseEnter),
187
+ onCellMouseLeave: unref(tableCellMouseLeave),
188
+ onRowClick: selectTableCell
189
+ }, {
190
+ title: withCtx(({ record }) => [
191
+ createElementVNode("span", _hoisted_3, [
192
+ unref(hoverBatchBox)(selectedData.value, record) ? (openBlock(), createElementBlock("span", {
193
+ key: 0,
194
+ onClick: withModifiers(($event) => clickCheckbox($event, record), ["stop"])
195
+ }, [
196
+ createVNode(unref(Checkbox), {
197
+ class: "icon",
198
+ "model-value": unref(isItemChecked)(selectedData.value, record)
199
+ }, null, 8, ["model-value"])
200
+ ], 8, _hoisted_4)) : (openBlock(), createBlock(_sfc_main$2, {
201
+ key: 1,
202
+ class: "icon",
203
+ type: record.series
204
+ }, null, 8, ["type"])),
205
+ createElementVNode("span", _hoisted_5, toDisplayString(record.title || record.alias || "--"), 1)
206
+ ])
207
+ ]),
208
+ live_type: withCtx(({ record }) => [
209
+ createElementVNode("span", null, toDisplayString(unref(ilive_type_map)[record.live_type] || "--"), 1)
210
+ ]),
211
+ pub_time: withCtx(({ record }) => [
212
+ createElementVNode("span", null, toDisplayString(record.pub_time), 1)
213
+ ]),
214
+ _: 1
215
+ }, 8, ["data", "loading", "onCellMouseEnter", "onCellMouseLeave"])
216
+ ]),
217
+ createElementVNode("div", _hoisted_6, [
218
+ createElementVNode("div", _hoisted_7, [
219
+ renderSlot(_ctx.$slots, "store")
220
+ ]),
221
+ renderSlot(_ctx.$slots, "options")
222
+ ])
223
+ ]);
224
+ };
225
+ }
226
+ });
227
+ export { _sfc_main as default };