@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
@@ -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 };
@@ -0,0 +1,62 @@
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 { mp_type_map } from "../../../../utils/typeMap.js";
4
+ const _hoisted_1 = { class: "media-filter-container" };
5
+ const _sfc_main = defineComponent({
6
+ ...{ name: "MpAccountFilter" },
7
+ __name: "index",
8
+ emits: ["search"],
9
+ setup(__props, { emit }) {
10
+ const filter = ref({ mp_name: "", mp_type: "" });
11
+ const typeOptions = computed(() => {
12
+ const arr = Object.keys(mp_type_map).map((key) => {
13
+ return {
14
+ label: mp_type_map[key],
15
+ value: key
16
+ };
17
+ });
18
+ return [{ value: "", label: "\u5168\u90E8\u7C7B\u578B" }, ...arr];
19
+ });
20
+ const handleSearch = () => {
21
+ emit("search", filter.value);
22
+ };
23
+ watch(filter.value, () => {
24
+ handleSearch();
25
+ });
26
+ return (_ctx, _cache) => {
27
+ return openBlock(), createElementBlock("div", _hoisted_1, [
28
+ createVNode(unref(Space), { size: "large" }, {
29
+ default: withCtx(() => [
30
+ createVNode(unref(Select), {
31
+ modelValue: filter.value.mp_type,
32
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => filter.value.mp_type = $event),
33
+ class: "filter-item",
34
+ placeholder: "\u8D26\u53F7\u7C7B\u578B"
35
+ }, {
36
+ default: withCtx(() => [
37
+ (openBlock(true), createElementBlock(Fragment, null, renderList(typeOptions.value, (item) => {
38
+ return openBlock(), createBlock(unref(Option), {
39
+ key: item.value,
40
+ label: item.label,
41
+ value: item.value
42
+ }, null, 8, ["label", "value"]);
43
+ }), 128))
44
+ ]),
45
+ _: 1
46
+ }, 8, ["modelValue"]),
47
+ createVNode(unref(Input), {
48
+ modelValue: filter.value.mp_name,
49
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => filter.value.mp_name = $event),
50
+ class: "filter-item",
51
+ "allow-clear": "",
52
+ placeholder: "\u8BF7\u8F93\u5165\u516C\u4F17\u53F7\u540D\u79F0",
53
+ onPressEnter: handleSearch
54
+ }, null, 8, ["modelValue"])
55
+ ]),
56
+ _: 1
57
+ })
58
+ ]);
59
+ };
60
+ }
61
+ });
62
+ export { _sfc_main as default };
@@ -0,0 +1,222 @@
1
+ import { defineComponent, ref, computed, watch, onMounted, openBlock, createElementBlock, createVNode, createElementVNode, unref, withCtx, withModifiers, createBlock, toDisplayString, renderSlot } from "vue";
2
+ import _imports_0 from "../../images/user.js";
3
+ import { Table, Checkbox, Message } from "@arco-design/web-vue";
4
+ import _sfc_main$2 from "../../../typeIcons/component.js";
5
+ import _sfc_main$1 from "./MpAccountFilter/index.js";
6
+ import useTableBatch from "../../../hooks/batch.js";
7
+ import { searchMpaccount } from "../../script/api.js";
8
+ import { key_target_type_map, mp_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: "mp_title-span" };
12
+ const _hoisted_4 = ["onClick"];
13
+ const _hoisted_5 = { class: "title" };
14
+ const _hoisted_6 = ["src"];
15
+ const _hoisted_7 = {
16
+ key: 1,
17
+ class: "user-avatar",
18
+ src: _imports_0
19
+ };
20
+ const _hoisted_8 = { class: "bottom-view" };
21
+ const _hoisted_9 = { class: "left" };
22
+ const _sfc_main = defineComponent({
23
+ ...{ name: "MpAccountList" },
24
+ __name: "index",
25
+ props: {
26
+ maxSelect: {},
27
+ userInfo: {},
28
+ outsideSelectData: {},
29
+ defaultSelectedData: {}
30
+ },
31
+ emits: ["change"],
32
+ setup(__props, { emit }) {
33
+ const props = __props;
34
+ const _maxSelect = props.maxSelect || 100;
35
+ const selectedData = ref([]);
36
+ const group_id = ref("all");
37
+ const mediaFileData = ref([]);
38
+ const dataLoading = ref(false);
39
+ const page = ref({
40
+ index: 1,
41
+ size: 100,
42
+ total: 0
43
+ });
44
+ const filter = ref(null);
45
+ const scrollPercent = { y: "100%" };
46
+ const columns = [
47
+ { title: "\u516C\u4F17\u53F7\u540D\u79F0", dataIndex: "mp_name", slotName: "mp_name" },
48
+ { title: "\u5934\u50CF", dataIndex: "mp_logo", slotName: "mp_logo" },
49
+ { title: "\u8D26\u53F7\u7C7B\u578B", dataIndex: "mp_type", slotName: "mp_type" },
50
+ { title: "\u8FD0\u8425\u8005", dataIndex: "mp_user_name", slotName: "mp_user_name" },
51
+ { title: "\u6240\u5C5E\u9886\u57DF", dataIndex: "catalog_alias", slotName: "catalog_alias" }
52
+ ];
53
+ const tempSelectedData = computed(() => {
54
+ return props.defaultSelectedData || [];
55
+ });
56
+ watch(
57
+ () => tempSelectedData.value,
58
+ (val) => {
59
+ selectedData.value = val;
60
+ }
61
+ );
62
+ watch(
63
+ () => group_id.value,
64
+ () => {
65
+ loadData();
66
+ }
67
+ );
68
+ const search = (_filter) => {
69
+ if (_filter.mp_name || _filter.mp_type) {
70
+ filter.value = { ..._filter };
71
+ } else {
72
+ filter.value = null;
73
+ }
74
+ page.value.index = 1;
75
+ loadData();
76
+ };
77
+ const loadData = async () => {
78
+ const gid = group_id.value;
79
+ if (!gid)
80
+ return;
81
+ let params = {
82
+ limit: page.value.size,
83
+ offset: page.value.size * (page.value.index - 1)
84
+ };
85
+ if (filter.value) {
86
+ params = { ...params, ...filter.value };
87
+ }
88
+ if (gid !== "all") {
89
+ params.gid = gid;
90
+ }
91
+ dataLoading.value = true;
92
+ const { code, data } = await searchMpaccount(props.userInfo.BASE_API, params);
93
+ dataLoading.value = false;
94
+ if (code === 0) {
95
+ if (!data.data) {
96
+ mediaFileData.value = [];
97
+ } else {
98
+ mediaFileData.value = data.data.map((v) => {
99
+ v.target_id = v.uid;
100
+ v.target_type = 14;
101
+ v.catalog = key_target_type_map[v.target_type];
102
+ return v;
103
+ }) || [];
104
+ }
105
+ }
106
+ };
107
+ const clickCheckbox = (e, record) => {
108
+ e.stopPropagation();
109
+ e.preventDefault();
110
+ selectData(record);
111
+ };
112
+ const selectTableCell = (record) => {
113
+ selectData(record);
114
+ };
115
+ const selectData = (record) => {
116
+ if (checkSameAdd(record)) {
117
+ Message.warning({ content: "\u8BF7\u52FF\u6DFB\u52A0\u91CD\u590D\u6570\u636E", duration: 3e3 });
118
+ return;
119
+ }
120
+ addDataToSelectedList(record);
121
+ };
122
+ const checkSameAdd = (record) => {
123
+ const selected = props.outsideSelectData;
124
+ if (!selected.length)
125
+ return false;
126
+ return selected.map((row) => row.id).includes(record.id);
127
+ };
128
+ const addDataToSelectedList = async (record) => {
129
+ const index = selectedData.value.findIndex((v) => v.id === record.id);
130
+ if (selectedData.value.length < _maxSelect) {
131
+ if (index === -1) {
132
+ selectedData.value.push(record);
133
+ } else {
134
+ selectedData.value.splice(index, 1);
135
+ }
136
+ emitChange();
137
+ } else {
138
+ if (index === -1) {
139
+ selectedData.value.splice(selectedData.value.length - 1, 1);
140
+ selectedData.value.push(record);
141
+ } else {
142
+ selectedData.value.splice(index, 1);
143
+ }
144
+ Message.warning({ content: "\u5DF2\u8FBE\u5230\u9009\u62E9\u6570\u91CF\u7684\u4E0A\u9650", duration: 3e3 });
145
+ emitChange();
146
+ }
147
+ };
148
+ const emitChange = () => {
149
+ emit("change", selectedData.value);
150
+ };
151
+ const {
152
+ isItemChecked,
153
+ hoverBatchBox,
154
+ tableCellMouseEnter,
155
+ tableCellMouseLeave
156
+ } = useTableBatch();
157
+ onMounted(() => {
158
+ loadData();
159
+ });
160
+ return (_ctx, _cache) => {
161
+ return openBlock(), createElementBlock("div", _hoisted_1, [
162
+ createVNode(_sfc_main$1, { onSearch: search }),
163
+ createElementVNode("div", _hoisted_2, [
164
+ createVNode(unref(Table), {
165
+ columns,
166
+ scroll: scrollPercent,
167
+ pagination: false,
168
+ bordered: false,
169
+ data: mediaFileData.value,
170
+ loading: dataLoading.value,
171
+ onCellMouseEnter: unref(tableCellMouseEnter),
172
+ onCellMouseLeave: unref(tableCellMouseLeave),
173
+ onRowClick: selectTableCell
174
+ }, {
175
+ mp_name: withCtx(({ record }) => [
176
+ createElementVNode("span", _hoisted_3, [
177
+ unref(hoverBatchBox)(selectedData.value, record) ? (openBlock(), createElementBlock("span", {
178
+ key: 0,
179
+ onClick: withModifiers(($event) => clickCheckbox($event, record), ["stop"])
180
+ }, [
181
+ createVNode(unref(Checkbox), {
182
+ class: "icon",
183
+ "model-value": unref(isItemChecked)(selectedData.value, record)
184
+ }, null, 8, ["model-value"])
185
+ ], 8, _hoisted_4)) : (openBlock(), createBlock(_sfc_main$2, {
186
+ key: 1,
187
+ class: "icon",
188
+ type: "mpdoc"
189
+ })),
190
+ createElementVNode("span", _hoisted_5, toDisplayString(record.mp_name || "--"), 1)
191
+ ])
192
+ ]),
193
+ mp_logo: withCtx(({ record }) => [
194
+ record.mp_logo ? (openBlock(), createElementBlock("img", {
195
+ key: 0,
196
+ class: "user-avatar",
197
+ src: record.mp_logo
198
+ }, null, 8, _hoisted_6)) : (openBlock(), createElementBlock("img", _hoisted_7))
199
+ ]),
200
+ mp_type: withCtx(({ record }) => [
201
+ createElementVNode("span", null, toDisplayString(unref(mp_type_map)[record.mp_type]), 1)
202
+ ]),
203
+ mp_user_name: withCtx(({ record }) => [
204
+ createElementVNode("span", null, toDisplayString(record.mp_user_name || "--"), 1)
205
+ ]),
206
+ catalog_alias: withCtx(({ record }) => [
207
+ createElementVNode("span", null, toDisplayString(record.catalog_alias), 1)
208
+ ]),
209
+ _: 1
210
+ }, 8, ["data", "loading", "onCellMouseEnter", "onCellMouseLeave"])
211
+ ]),
212
+ createElementVNode("div", _hoisted_8, [
213
+ createElementVNode("div", _hoisted_9, [
214
+ renderSlot(_ctx.$slots, "store")
215
+ ]),
216
+ renderSlot(_ctx.$slots, "options")
217
+ ])
218
+ ]);
219
+ };
220
+ }
221
+ });
222
+ export { _sfc_main as default };
@@ -0,0 +1,85 @@
1
+ import { defineComponent, ref, computed, watch, onMounted, openBlock, createElementBlock, createVNode, unref, withCtx, Fragment, renderList, createBlock } from "vue";
2
+ import { Space, Input, Select, Option } from "@arco-design/web-vue";
3
+ import { searchMpaccount } from "../../../script/api.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
+ userInfo: {}
11
+ },
12
+ emits: ["update:group_id", "search"],
13
+ setup(__props, { emit }) {
14
+ const props = __props;
15
+ const filter = ref({ wd: "", account_uid: "", order: 1 });
16
+ const typeOptions = ref([{ mp_name: "\u5168\u90E8", uid: "all" }]);
17
+ const limit = ref(100);
18
+ computed({
19
+ get() {
20
+ return props.group_id;
21
+ },
22
+ set(val) {
23
+ emit("update:group_id", val);
24
+ }
25
+ });
26
+ const getTypeData = async () => {
27
+ const query = {
28
+ limit: limit.value,
29
+ offset: typeOptions.value.length
30
+ };
31
+ const { code, data } = await searchMpaccount(props.userInfo.BASE_API, query);
32
+ if (code !== 0)
33
+ return;
34
+ typeOptions.value = typeOptions.value.concat(data.data || []);
35
+ };
36
+ const handleSearch = () => {
37
+ emit("search", filter.value);
38
+ };
39
+ watch(filter.value, () => {
40
+ if (filter.value.account_uid === "all") {
41
+ filter.value.account_uid = "";
42
+ }
43
+ handleSearch();
44
+ });
45
+ onMounted(() => {
46
+ getTypeData();
47
+ });
48
+ return (_ctx, _cache) => {
49
+ return openBlock(), createElementBlock("div", _hoisted_1, [
50
+ createVNode(unref(Space), { size: "large" }, {
51
+ default: withCtx(() => [
52
+ createVNode(unref(Input), {
53
+ modelValue: filter.value.wd,
54
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => filter.value.wd = $event),
55
+ class: "filter-item",
56
+ "allow-clear": "",
57
+ placeholder: "\u8F93\u5165\u5185\u5BB9\u6807\u9898",
58
+ onPressEnter: handleSearch
59
+ }, null, 8, ["modelValue"]),
60
+ createVNode(unref(Select), {
61
+ modelValue: filter.value.account_uid,
62
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => filter.value.account_uid = $event),
63
+ class: "filter-item",
64
+ placeholder: "\u516C\u4F17\u53F7",
65
+ "allow-search": ""
66
+ }, {
67
+ default: withCtx(() => [
68
+ (openBlock(true), createElementBlock(Fragment, null, renderList(typeOptions.value, (item) => {
69
+ return openBlock(), createBlock(unref(Option), {
70
+ key: item.uid,
71
+ label: item.mp_name,
72
+ value: item.uid
73
+ }, null, 8, ["label", "value"]);
74
+ }), 128))
75
+ ]),
76
+ _: 1
77
+ }, 8, ["modelValue"])
78
+ ]),
79
+ _: 1
80
+ })
81
+ ]);
82
+ };
83
+ }
84
+ });
85
+ export { _sfc_main as default };