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