@cmstops/pro-compo 3.9.1-rc.10 → 3.9.1-rc.12

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 (43) hide show
  1. package/README.md +134 -134
  2. package/es/docHistory/style/index.less +37 -37
  3. package/es/index.js +1 -0
  4. package/es/selectAddTo/component.js +127 -0
  5. package/es/selectAddTo/component.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
  6. package/es/selectAddTo/components/ViewAllColumn/MediaFilter/index.js +169 -0
  7. package/es/selectAddTo/components/ViewAllColumn/index.js +211 -0
  8. package/es/selectAddTo/components/ViewAllColumn/index.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
  9. package/es/selectAddTo/components/ViewAllColumn/script/useTableColumns.js +102 -0
  10. package/es/selectAddTo/components/ViewAllColumn/script/useViewAllColumnState.js +195 -0
  11. package/es/selectAddTo/index.js +7 -0
  12. package/es/selectAddTo/script/api.js +30 -0
  13. package/es/selectAddTo/script/useSelectAddToState.js +106 -0
  14. package/es/selectAddTo/style/css.js +1 -0
  15. package/es/selectAddTo/style/index.css +3 -0
  16. package/es/selectAddTo/style/index.js +1 -0
  17. package/es/selectAddTo/style/index.less +3 -0
  18. package/es/selectResourceModal/components/List/ListLocal/index.js +1 -1
  19. package/es/selectResourceModal/style/index.less +55 -55
  20. package/es/selectResourceModal/style/list.less +203 -203
  21. package/es/style.css +57 -0
  22. package/es/typeIcons/component.js +1 -1
  23. package/lib/docHistory/style/index.less +37 -37
  24. package/lib/index.js +2 -0
  25. package/lib/selectAddTo/component.js +128 -0
  26. package/lib/selectAddTo/component.vue_vue_type_style_index_0_scoped_true_lang.js +3 -0
  27. package/lib/selectAddTo/components/ViewAllColumn/MediaFilter/index.js +170 -0
  28. package/lib/selectAddTo/components/ViewAllColumn/index.js +212 -0
  29. package/lib/selectAddTo/components/ViewAllColumn/index.vue_vue_type_style_index_0_scoped_true_lang.js +3 -0
  30. package/lib/selectAddTo/components/ViewAllColumn/script/useTableColumns.js +108 -0
  31. package/lib/selectAddTo/components/ViewAllColumn/script/useViewAllColumnState.js +197 -0
  32. package/lib/selectAddTo/index.js +8 -0
  33. package/lib/selectAddTo/script/api.js +35 -0
  34. package/lib/selectAddTo/script/useSelectAddToState.js +108 -0
  35. package/lib/selectAddTo/style/css.js +2 -0
  36. package/lib/selectAddTo/style/index.css +3 -0
  37. package/lib/selectAddTo/style/index.js +2 -0
  38. package/lib/selectAddTo/style/index.less +3 -0
  39. package/lib/selectResourceModal/components/List/ListLocal/index.js +1 -1
  40. package/lib/selectResourceModal/style/index.less +55 -55
  41. package/lib/selectResourceModal/style/list.less +203 -203
  42. package/lib/typeIcons/component.js +1 -1
  43. package/package.json +138 -138
@@ -0,0 +1,211 @@
1
+ import { defineComponent, ref, onMounted, openBlock, createElementBlock, createVNode, unref, isRef, withCtx, createBlock, createElementVNode, toDisplayString, renderSlot, withDirectives, vShow } from "vue";
2
+ import { IconRight, IconDown } from "@arco-design/web-vue/es/icon";
3
+ import { Table, Checkbox, Pagination } from "@arco-design/web-vue";
4
+ import _sfc_main$2 from "../../../typeIcons/component.js";
5
+ import _sfc_main$1 from "./MediaFilter/index.js";
6
+ import _sfc_main$3 from "../../../dataTags/component.js";
7
+ import { timeFormat } from "../../../utils/index.js";
8
+ import { useViewAllColumnState } from "./script/useViewAllColumnState.js";
9
+ import { useTableColumns } from "./script/useTableColumns.js";
10
+ import "./index.vue_vue_type_style_index_0_scoped_true_lang.js";
11
+ import _export_sfc from "../../../_virtual/plugin-vue_export-helper.js";
12
+ const _hoisted_1 = { class: "view-all-column-container" };
13
+ const _hoisted_2 = {
14
+ key: 0,
15
+ class: "content-table-view"
16
+ };
17
+ const _hoisted_3 = { class: "title-span" };
18
+ const _hoisted_4 = { class: "title" };
19
+ const _hoisted_5 = { class: "title-span" };
20
+ const _hoisted_6 = { class: "title-span" };
21
+ const _hoisted_7 = {
22
+ key: 1,
23
+ class: "content-table-view"
24
+ };
25
+ const _hoisted_8 = { class: "title-span" };
26
+ const _hoisted_9 = { class: "title" };
27
+ const _hoisted_10 = { class: "title-span" };
28
+ const _hoisted_11 = { class: "title-span" };
29
+ const _hoisted_12 = { class: "bottom-view" };
30
+ const _hoisted_13 = { class: "left" };
31
+ const _sfc_main = defineComponent({
32
+ ...{ name: "ViewAllColumn" },
33
+ __name: "index",
34
+ props: {
35
+ maxSelect: {},
36
+ defaultSelectedData: {},
37
+ typeData: {},
38
+ series: {},
39
+ banner: {},
40
+ userInfo: {},
41
+ typeKey: {},
42
+ rid: {}
43
+ },
44
+ emits: ["change"],
45
+ setup(__props, { emit: __emit }) {
46
+ const emit = __emit;
47
+ const props = __props;
48
+ const listMinHeight = ref(0);
49
+ const categoryCascaderData = ref([]);
50
+ const scrollPercent = { y: "100%" };
51
+ const {
52
+ selectedData,
53
+ mediaFileData,
54
+ dataLoading,
55
+ group_id,
56
+ page,
57
+ isItemChecked,
58
+ tableCellMouseEnter,
59
+ tableCellMouseLeave,
60
+ selectTableCell,
61
+ selectTableAll,
62
+ search,
63
+ pageChangeHandle,
64
+ loadData,
65
+ loadMore,
66
+ filter
67
+ } = useViewAllColumnState(props, emit);
68
+ const { columns, politicalColumns } = useTableColumns(
69
+ props,
70
+ selectedData,
71
+ isItemChecked,
72
+ filter
73
+ );
74
+ onMounted(() => {
75
+ loadData();
76
+ });
77
+ return (_ctx, _cache) => {
78
+ return openBlock(), createElementBlock("div", _hoisted_1, [
79
+ createVNode(_sfc_main$1, {
80
+ group_id: unref(group_id),
81
+ "onUpdate:group_id": _cache[0] || (_cache[0] = ($event) => isRef(group_id) ? group_id.value = $event : null),
82
+ height: listMinHeight.value,
83
+ tree: categoryCascaderData.value,
84
+ "type-key": _ctx.typeKey,
85
+ onSearch: unref(search)
86
+ }, null, 8, ["group_id", "height", "tree", "type-key", "onSearch"]),
87
+ _ctx.typeKey && _ctx.typeKey !== "ZQ" ? (openBlock(), createElementBlock("div", _hoisted_2, [
88
+ createVNode(unref(Table), {
89
+ bordered: false,
90
+ columns: unref(columns),
91
+ data: unref(mediaFileData),
92
+ pagination: false,
93
+ loading: unref(dataLoading),
94
+ scroll: scrollPercent,
95
+ "load-more": unref(loadMore),
96
+ onCellMouseEnter: unref(tableCellMouseEnter),
97
+ onCellMouseLeave: unref(tableCellMouseLeave),
98
+ onRowClick: unref(selectTableCell)
99
+ }, {
100
+ "expand-icon": withCtx(({ expanded }) => [
101
+ !expanded ? (openBlock(), createBlock(unref(IconRight), { key: 0 })) : (openBlock(), createBlock(unref(IconDown), { key: 1 }))
102
+ ]),
103
+ selectTitle: withCtx(() => [
104
+ createVNode(unref(Checkbox), {
105
+ "model-value": unref(selectedData).length === unref(mediaFileData).length,
106
+ class: "icon",
107
+ onChange: unref(selectTableAll)
108
+ }, null, 8, ["model-value", "onChange"])
109
+ ]),
110
+ select: withCtx(({ record }) => [
111
+ createVNode(unref(Checkbox), {
112
+ "model-value": unref(isItemChecked)(unref(selectedData), record),
113
+ class: "icon"
114
+ }, null, 8, ["model-value"])
115
+ ]),
116
+ title: withCtx(({ record }) => [
117
+ createElementVNode("span", _hoisted_3, [
118
+ createVNode(_sfc_main$2, {
119
+ type: record.series,
120
+ class: "icon",
121
+ doc: true
122
+ }, null, 8, ["type"]),
123
+ createElementVNode("span", _hoisted_4, toDisplayString(record.title || record.alias || "--"), 1)
124
+ ])
125
+ ]),
126
+ series: withCtx(({ record }) => [
127
+ createVNode(_sfc_main$3, { item: record }, null, 8, ["item"])
128
+ ]),
129
+ duty_editor: withCtx(({ record }) => [
130
+ createElementVNode("span", _hoisted_5, [
131
+ createElementVNode("span", null, toDisplayString(record.duty_editor || "--"), 1)
132
+ ])
133
+ ]),
134
+ pub_time: withCtx(({ record }) => [
135
+ createElementVNode("span", _hoisted_6, [
136
+ createElementVNode("span", null, toDisplayString(unref(timeFormat)(record.pub_time)), 1)
137
+ ])
138
+ ]),
139
+ _: 1
140
+ }, 8, ["columns", "data", "loading", "load-more", "onCellMouseEnter", "onCellMouseLeave", "onRowClick"])
141
+ ])) : (openBlock(), createElementBlock("div", _hoisted_7, [
142
+ createVNode(unref(Table), {
143
+ bordered: false,
144
+ columns: unref(politicalColumns),
145
+ data: unref(mediaFileData),
146
+ pagination: false,
147
+ loading: unref(dataLoading),
148
+ scroll: scrollPercent,
149
+ onCellMouseEnter: unref(tableCellMouseEnter),
150
+ onCellMouseLeave: unref(tableCellMouseLeave),
151
+ onRowClick: unref(selectTableCell)
152
+ }, {
153
+ selectTitle: withCtx(() => [
154
+ createVNode(unref(Checkbox), {
155
+ "model-value": unref(selectedData).length === unref(mediaFileData).length,
156
+ class: "icon",
157
+ onChange: unref(selectTableAll)
158
+ }, null, 8, ["model-value", "onChange"])
159
+ ]),
160
+ select: withCtx(({ record }) => [
161
+ createVNode(unref(Checkbox), {
162
+ "model-value": unref(isItemChecked)(unref(selectedData), record),
163
+ class: "icon"
164
+ }, null, 8, ["model-value"])
165
+ ]),
166
+ name: withCtx(({ record }) => [
167
+ createElementVNode("span", _hoisted_8, [
168
+ createVNode(_sfc_main$2, {
169
+ type: record.series,
170
+ class: "icon",
171
+ doc: ""
172
+ }, null, 8, ["type"]),
173
+ createElementVNode("span", _hoisted_9, toDisplayString(record.name || record.alias || "--"), 1)
174
+ ])
175
+ ]),
176
+ series: withCtx(({ record }) => [
177
+ createVNode(_sfc_main$3, { item: record }, null, 8, ["item"])
178
+ ]),
179
+ position: withCtx(({ record }) => [
180
+ createElementVNode("span", _hoisted_10, [
181
+ createElementVNode("span", null, toDisplayString(record.position || "--"), 1)
182
+ ])
183
+ ]),
184
+ city_alias: withCtx(({ record }) => [
185
+ createElementVNode("span", _hoisted_11, [
186
+ createElementVNode("span", null, toDisplayString(record.city_alias || "--"), 1)
187
+ ])
188
+ ]),
189
+ _: 1
190
+ }, 8, ["columns", "data", "loading", "onCellMouseEnter", "onCellMouseLeave", "onRowClick"])
191
+ ])),
192
+ createElementVNode("div", _hoisted_12, [
193
+ createElementVNode("div", _hoisted_13, [
194
+ renderSlot(_ctx.$slots, "store", {}, void 0, true),
195
+ withDirectives(createVNode(unref(Pagination), {
196
+ current: unref(page).index,
197
+ "page-size": unref(page).size,
198
+ total: unref(page).total,
199
+ onChange: unref(pageChangeHandle)
200
+ }, null, 8, ["current", "page-size", "total", "onChange"]), [
201
+ [vShow, unref(mediaFileData).length > 0]
202
+ ])
203
+ ]),
204
+ renderSlot(_ctx.$slots, "options", {}, void 0, true)
205
+ ])
206
+ ]);
207
+ };
208
+ }
209
+ });
210
+ var ViewAllColumn = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-510948a5"]]);
211
+ export { ViewAllColumn as default };
@@ -0,0 +1,2 @@
1
+ var index_vue_vue_type_style_index_0_scoped_true_lang = "";
2
+ export { index_vue_vue_type_style_index_0_scoped_true_lang as default };
@@ -0,0 +1,102 @@
1
+ import { ref, h, computed } from "vue";
2
+ import { Checkbox } from "@arco-design/web-vue";
3
+ import dayjs from "dayjs";
4
+ const useTableColumns = (props, selectedData, isItemChecked, filter) => {
5
+ const columns = ref([
6
+ {
7
+ title: "\u52FE",
8
+ dataIndex: "select",
9
+ slotName: "select",
10
+ width: 40,
11
+ titleSlotName: "selectTitle",
12
+ render: ({ record }) => {
13
+ if (props.typeKey === "series:special_v3") {
14
+ if (record.isLeaf && record.parentId) {
15
+ return h(Checkbox, {
16
+ modelValue: isItemChecked.value(selectedData.value, record),
17
+ class: "icon"
18
+ });
19
+ }
20
+ return null;
21
+ }
22
+ return h(Checkbox, {
23
+ modelValue: isItemChecked.value(selectedData.value, record),
24
+ class: "icon"
25
+ });
26
+ }
27
+ },
28
+ {
29
+ title: "\u4E13\u9898/\u680F\u76EE\u540D\u79F0",
30
+ dataIndex: "title",
31
+ slotName: "title",
32
+ width: 428
33
+ },
34
+ {
35
+ title: "\u7F16\u8F91",
36
+ dataIndex: "duty_editor",
37
+ slotName: "duty_editor",
38
+ width: 100
39
+ },
40
+ {
41
+ title: computed(() => {
42
+ var _a;
43
+ return ((_a = filter.value) == null ? void 0 : _a.order) === "pub_time" ? "\u53D1\u5E03\u65F6\u95F4" : "\u521B\u5EFA\u65F6\u95F4";
44
+ }),
45
+ dataIndex: computed(
46
+ () => {
47
+ var _a;
48
+ return ((_a = filter.value) == null ? void 0 : _a.order) === "pub_time" ? "pub_time" : "created_at";
49
+ }
50
+ ),
51
+ slotName: "pub_time",
52
+ width: 150,
53
+ render: ({ record }) => {
54
+ var _a;
55
+ if (((_a = filter.value) == null ? void 0 : _a.order) === "pub_time") {
56
+ const raw2 = record.pub_time;
57
+ if (!raw2)
58
+ return "--";
59
+ const d2 = typeof raw2 === "number" || /^\d+$/.test(raw2) ? dayjs.unix(Number(raw2)) : dayjs(raw2);
60
+ return d2.isValid() ? d2.format("YYYY-M-D HH:mm") : raw2;
61
+ }
62
+ const raw = record.created_at;
63
+ if (!raw)
64
+ return "--";
65
+ const d = dayjs(raw);
66
+ return d.isValid() ? d.format("YYYY-M-D HH:mm") : raw;
67
+ }
68
+ }
69
+ ]);
70
+ const politicalColumns = ref([
71
+ {
72
+ title: "\u52FE",
73
+ dataIndex: "select",
74
+ slotName: "select",
75
+ width: 40,
76
+ titleSlotName: "selectTitle"
77
+ },
78
+ {
79
+ title: "\u653F\u60C5\u4EBA\u7269\u59D3\u540D",
80
+ dataIndex: "name",
81
+ slotName: "name",
82
+ width: 428
83
+ },
84
+ {
85
+ title: "\u804C\u4F4D",
86
+ dataIndex: "position",
87
+ slotName: "position",
88
+ width: 100
89
+ },
90
+ {
91
+ title: "\u5730\u533A",
92
+ dataIndex: "city_alias",
93
+ slotName: "city_alias",
94
+ width: 150
95
+ }
96
+ ]);
97
+ return {
98
+ columns,
99
+ politicalColumns
100
+ };
101
+ };
102
+ export { useTableColumns };
@@ -0,0 +1,195 @@
1
+ import { ref, computed, watch } from "vue";
2
+ import { Message } from "@arco-design/web-vue";
3
+ import { DEFAULT_BASE_API } from "../../../../config.js";
4
+ import { getCategoryMediaNew, getPoliticals, getMlists } from "../../../script/api.js";
5
+ import useTableBatch from "../../../../hooks/batch.js";
6
+ const useViewAllColumnState = (props, emit) => {
7
+ const _maxSelect = props.maxSelect || 100;
8
+ const selectedData = ref([]);
9
+ const mediaFileData = ref([]);
10
+ const filter = ref(null);
11
+ const dataLoading = ref(false);
12
+ const group_id = ref(0);
13
+ const page = ref({
14
+ index: 1,
15
+ size: 30,
16
+ total: 0
17
+ });
18
+ const tempSelectedData = computed(() => props.defaultSelectedData || []);
19
+ watch(
20
+ () => tempSelectedData.value,
21
+ (val) => {
22
+ selectedData.value = val;
23
+ }
24
+ );
25
+ const importantBanner = computed(() => {
26
+ if (!props.banner || props.banner === "all")
27
+ return false;
28
+ return !!props.banner;
29
+ });
30
+ const { isItemChecked, tableCellMouseEnter, tableCellMouseLeave } = useTableBatch();
31
+ const selectTableCell = (record) => {
32
+ if (props.typeKey === "series:special_v3" ? record.isLeaf && record.parentId : true) {
33
+ selectData(record);
34
+ }
35
+ };
36
+ const selectTableAll = (checked) => {
37
+ if (checked) {
38
+ selectedData.value = [];
39
+ mediaFileData.value.forEach((item) => selectData(item));
40
+ } else {
41
+ selectedData.value = [];
42
+ }
43
+ emitChange();
44
+ };
45
+ const selectData = (record) => {
46
+ if (importantBanner.value) {
47
+ const { cover } = record;
48
+ if (!(cover == null ? void 0 : cover.banner)) {
49
+ return Message.warning({ content: "\u8BE5\u5185\u5BB9\u4E0D\u5177\u5907\u72EC\u7ACB\u8F6E\u64AD\u56FE" });
50
+ }
51
+ }
52
+ addDataToSelectedList(record);
53
+ return true;
54
+ };
55
+ const addDataToSelectedList = async (record) => {
56
+ const index = selectedData.value.findIndex((v) => v.id === record.id);
57
+ if (selectedData.value.length < _maxSelect) {
58
+ if (index === -1) {
59
+ selectedData.value.push(record);
60
+ } else {
61
+ selectedData.value.splice(index, 1);
62
+ }
63
+ emitChange();
64
+ } else {
65
+ if (index === -1) {
66
+ selectedData.value.splice(selectedData.value.length - 1, 1);
67
+ selectedData.value.push(record);
68
+ } else {
69
+ selectedData.value.splice(index, 1);
70
+ }
71
+ emitChange();
72
+ }
73
+ };
74
+ const emitChange = () => {
75
+ emit("change", selectedData.value);
76
+ };
77
+ const search = (_filter) => {
78
+ var _a;
79
+ _filter = { ..._filter };
80
+ const where = [];
81
+ _filter.precise_kw && where.push(`precise_kw:${_filter.precise_kw}`);
82
+ _filter.keywords && where.push(`kw:${_filter.keywords}`);
83
+ _filter.type && where.push(`series:${_filter.type}`);
84
+ _filter.state && where.push(`state:${_filter.state}`);
85
+ _filter.cover_type && where.push(`cover_type:${_filter.cover_type}`);
86
+ _filter.banner && where.push(`banner:${_filter.banner}`);
87
+ if (((_a = _filter.publish_date) == null ? void 0 : _a.length) === 2) {
88
+ where.push(`publish_from:${_filter.publish_date[0] / 1e3}`);
89
+ where.push(`publish_to:${_filter.publish_date[1] / 1e3}`);
90
+ }
91
+ _filter.where = where;
92
+ filter.value = _filter;
93
+ page.value.index = 1;
94
+ loadData();
95
+ };
96
+ const pageChangeHandle = (index) => {
97
+ page.value.index = index;
98
+ loadData();
99
+ };
100
+ watch(
101
+ () => group_id.value,
102
+ () => {
103
+ page.value.index = 1;
104
+ loadData();
105
+ }
106
+ );
107
+ const loadData = async () => {
108
+ var _a, _b;
109
+ const params = {
110
+ limit: page.value.size,
111
+ offset: page.value.size * (page.value.index - 1),
112
+ where: ["state:15|19"]
113
+ };
114
+ params.where.push(props.typeKey);
115
+ if (filter.value) {
116
+ const _filter = filter.value;
117
+ params.order = _filter.order;
118
+ params.sort = _filter.sort;
119
+ if (_filter.where) {
120
+ params.where = [...params.where, ..._filter.where];
121
+ }
122
+ }
123
+ params.where = params.where.join(",");
124
+ dataLoading.value = true;
125
+ try {
126
+ let response;
127
+ if (props.typeKey && props.typeKey !== "ZQ") {
128
+ response = await getCategoryMediaNew(DEFAULT_BASE_API, params);
129
+ } else {
130
+ params.keyword = ((_a = filter.value) == null ? void 0 : _a.precise_kw) || ((_b = filter.value) == null ? void 0 : _b.keywords) || "";
131
+ params.state = 2;
132
+ response = await getPoliticals(DEFAULT_BASE_API, params);
133
+ }
134
+ const { code, message } = response;
135
+ if (code === 0) {
136
+ mediaFileData.value = (message.data || message.datas).map((v) => ({
137
+ ...v,
138
+ catalog: "doc",
139
+ target_id: v.id,
140
+ target_type: 3,
141
+ pub_time: v.pub_time || v.created_at,
142
+ update_time: v.updated_at,
143
+ pub_user_alias: v.author_alias,
144
+ key: v.id,
145
+ isLeaf: props.typeKey !== "series:special_v3"
146
+ }));
147
+ page.value.total = message.total || message.count;
148
+ }
149
+ } catch (error) {
150
+ console.error("Failed to load data:", error);
151
+ } finally {
152
+ dataLoading.value = false;
153
+ }
154
+ };
155
+ const loadMore = async (record, done) => {
156
+ try {
157
+ const res = await getMlists(DEFAULT_BASE_API, {
158
+ rid: props.rid,
159
+ gid: record.special_id
160
+ });
161
+ setTimeout(() => {
162
+ done(
163
+ res.message.map((item) => ({
164
+ ...item,
165
+ isLeaf: true,
166
+ key: item.id,
167
+ parentName: record.title,
168
+ parentId: record.id
169
+ }))
170
+ );
171
+ }, 2e3);
172
+ } catch (error) {
173
+ console.error("Failed to load more data:", error);
174
+ done([]);
175
+ }
176
+ };
177
+ return {
178
+ selectedData,
179
+ mediaFileData,
180
+ filter,
181
+ dataLoading,
182
+ group_id,
183
+ page,
184
+ isItemChecked,
185
+ tableCellMouseEnter,
186
+ tableCellMouseLeave,
187
+ selectTableCell,
188
+ selectTableAll,
189
+ search,
190
+ pageChangeHandle,
191
+ loadData,
192
+ loadMore
193
+ };
194
+ };
195
+ export { useViewAllColumnState };
@@ -0,0 +1,7 @@
1
+ import _selectAddTo from "./component.js";
2
+ const selectAddTo = Object.assign(_selectAddTo, {
3
+ install: (app) => {
4
+ app.component(_selectAddTo.name, _selectAddTo);
5
+ }
6
+ });
7
+ export { selectAddTo as default };
@@ -0,0 +1,30 @@
1
+ import request from "../../utils/request.js";
2
+ function getCategoryMediaNew(BASE_API, params) {
3
+ return request(BASE_API, {
4
+ url: `/poplar/v3/s/documents`,
5
+ method: "get",
6
+ params
7
+ });
8
+ }
9
+ function getPoliticals(BASE_API, params) {
10
+ return request(BASE_API, {
11
+ url: "/poplar/v2/politics/list",
12
+ method: "get",
13
+ params
14
+ });
15
+ }
16
+ function getMlists(BASE_API, params) {
17
+ return request(BASE_API, {
18
+ url: `/poplar/v2/mlists`,
19
+ method: "get",
20
+ params
21
+ });
22
+ }
23
+ function getConfigurationNew(BASE_API, params) {
24
+ return request(BASE_API, {
25
+ url: "/poplar/v2/configuration",
26
+ method: "get",
27
+ params
28
+ });
29
+ }
30
+ export { getCategoryMediaNew, getConfigurationNew, getMlists, getPoliticals };
@@ -0,0 +1,106 @@
1
+ import { computed, ref } from "vue";
2
+ import { getConfigurationNew } from "./api.js";
3
+ import { DEFAULT_BASE_API } from "../../config.js";
4
+ import useLoadUserInfo from "../../hooks/user.js";
5
+ const useSelectAddToState = (props, emit) => {
6
+ const BASE_API = props.BASE_API || DEFAULT_BASE_API;
7
+ const visible = computed({
8
+ get() {
9
+ return props.visible;
10
+ },
11
+ set(value) {
12
+ setVisible(value);
13
+ }
14
+ });
15
+ const selectedData = ref([]);
16
+ const configData = ref({});
17
+ const { userInfo, getUserInfoHandle } = useLoadUserInfo(BASE_API);
18
+ const title = computed(() => {
19
+ const titleMap = {
20
+ "series:video_album": "\u6DFB\u52A0\u81F3\u89C6\u9891\u5408\u96C6",
21
+ "series:special_v3": "\u6DFB\u52A0\u81F3\u4E13\u9898",
22
+ "series:audio_album": "\u6DFB\u52A0\u81F3\u97F3\u9891\u5408\u96C6",
23
+ "series:article_album": "\u6DFB\u52A0\u81F3\u653F\u60C5\u4EBA\u7269\u76F8\u5173\u62A5\u9053"
24
+ };
25
+ return titleMap[props.typeKey || ""] || "";
26
+ });
27
+ const hasSelected = computed(() => selectedData.value.length > 0);
28
+ const typeDataController = computed(() => {
29
+ if (!props.typeData)
30
+ return {};
31
+ try {
32
+ return JSON.parse(JSON.stringify(props.typeData));
33
+ } catch (e) {
34
+ console.warn("Failed to parse typeData:", e);
35
+ return {};
36
+ }
37
+ });
38
+ const setVisible = (bool) => {
39
+ emit("update:visible", bool);
40
+ };
41
+ const selectedDataChangeHandle = (data) => {
42
+ selectedData.value = data;
43
+ };
44
+ const handleOk = () => {
45
+ setVisible(false);
46
+ };
47
+ const handleCancel = () => {
48
+ setVisible(false);
49
+ };
50
+ const comfirm = () => {
51
+ emit("comfirm", JSON.parse(JSON.stringify(selectedData.value)));
52
+ };
53
+ const HandleOpen = () => {
54
+ selectedData.value = props.defaultSelectedData || [];
55
+ };
56
+ const HandleClose = () => {
57
+ selectedData.value = [];
58
+ };
59
+ const tabsChange = () => {
60
+ selectedData.value = [];
61
+ };
62
+ const loadConfig = async () => {
63
+ var _a;
64
+ try {
65
+ const res = await getConfigurationNew(BASE_API, {
66
+ module: "third_party_services"
67
+ });
68
+ if (res.code === 0 && ((_a = res.message) == null ? void 0 : _a.length)) {
69
+ res.message.forEach((item) => {
70
+ configData.value[item.key] = JSON.parse(item.value);
71
+ });
72
+ }
73
+ } catch (error) {
74
+ console.error("Failed to load configuration:", error);
75
+ }
76
+ };
77
+ const checkServiceEnable = (key) => {
78
+ const data = configData.value[key];
79
+ if (!data)
80
+ return false;
81
+ if (!data.enable && typeof data.enable !== "undefined")
82
+ return false;
83
+ return true;
84
+ };
85
+ return {
86
+ visible,
87
+ title,
88
+ selectedData,
89
+ hasSelected,
90
+ typeDataController,
91
+ userInfo,
92
+ configData,
93
+ setVisible,
94
+ selectedDataChangeHandle,
95
+ handleOk,
96
+ handleCancel,
97
+ comfirm,
98
+ HandleOpen,
99
+ HandleClose,
100
+ tabsChange,
101
+ loadConfig,
102
+ checkServiceEnable,
103
+ getUserInfoHandle
104
+ };
105
+ };
106
+ export { useSelectAddToState };
@@ -0,0 +1 @@
1
+ import "./index.css";
@@ -0,0 +1,3 @@
1
+ .select-add-to {
2
+ display: inline-block;
3
+ }
@@ -0,0 +1 @@
1
+ import "./index.less";
@@ -0,0 +1,3 @@
1
+ .select-add-to {
2
+ display: inline-block;
3
+ }
@@ -78,7 +78,7 @@ const _sfc_main = defineComponent({
78
78
  return openBlock(), createElementBlock(Fragment, {
79
79
  key: item.sig_id
80
80
  }, [
81
- createCommentVNode(" \r\n onOptions \u7528\u4E8E\u5904\u7406\u5361\u7247\u91CC\u5916\u90E8\u4E0D\u80FD\u6355\u83B7\u7684\u64CD\u4F5C\r\n 1. \u6BD4\u5982\u5916\u90E8\u65E0\u6CD5\u5904\u7406\u9700\u8981\u91CD\u65B0\u4E0A\u4F20/\u8F6C\u7801/\u5220\u9664\u7684\u903B\u8F91 \r\n 2. \u90A3\u4E48\u5C31\u5C06\u5904\u7406\u7684\u65B9\u6CD5\u4E5F\u4E00\u540C\u629B\u51FA\uFF0C\u7531\u5916\u90E8\u8C03\u7528\r\n "),
81
+ createCommentVNode(" \n onOptions \u7528\u4E8E\u5904\u7406\u5361\u7247\u91CC\u5916\u90E8\u4E0D\u80FD\u6355\u83B7\u7684\u64CD\u4F5C\n 1. \u6BD4\u5982\u5916\u90E8\u65E0\u6CD5\u5904\u7406\u9700\u8981\u91CD\u65B0\u4E0A\u4F20/\u8F6C\u7801/\u5220\u9664\u7684\u903B\u8F91 \n 2. \u90A3\u4E48\u5C31\u5C06\u5904\u7406\u7684\u65B9\u6CD5\u4E5F\u4E00\u540C\u629B\u51FA\uFF0C\u7531\u5916\u90E8\u8C03\u7528\n "),
82
82
  renderSlot(_ctx.$slots, "item", {
83
83
  item,
84
84
  onOptions: handleOptions