@cmstops/pro-compo 3.9.2-alpha.12 → 3.9.2-alpha.14

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.
@@ -0,0 +1,178 @@
1
+ "use strict";
2
+ var vue = require("vue");
3
+ var webVue = require("@arco-design/web-vue");
4
+ var index = require("./components/ViewAllColumn/index.js");
5
+ require("../typeIcons/style/index.js");
6
+ var api = require("./script/api.js");
7
+ var config = require("../config.js");
8
+ var user = require("../hooks/user.js");
9
+ const _sfc_main = vue.defineComponent({
10
+ ...{ name: "selectAddTo" },
11
+ __name: "component",
12
+ props: {
13
+ BASE_API: {},
14
+ visible: { type: Boolean },
15
+ title: {},
16
+ outsideSelectData: {},
17
+ defaultSelectedData: {},
18
+ maxSelect: {},
19
+ typeData: {},
20
+ userStore: {},
21
+ compoFilter: { type: Boolean, default: false },
22
+ typeKey: {},
23
+ rid: {}
24
+ },
25
+ emits: ["update:visible", "comfirm"],
26
+ setup(__props, { emit: __emit }) {
27
+ var _a, _b, _c;
28
+ const emit = __emit;
29
+ const props = __props;
30
+ const BASE_API = props.BASE_API || config.DEFAULT_BASE_API;
31
+ const visible = vue.computed({
32
+ get() {
33
+ return props.visible;
34
+ },
35
+ set(value) {
36
+ setVisible(value);
37
+ }
38
+ });
39
+ const title = vue.computed(() => {
40
+ let title2 = "";
41
+ switch (props.typeKey) {
42
+ case "series:video_album":
43
+ title2 = "\u6DFB\u52A0\u81F3\u89C6\u9891\u5408\u96C6";
44
+ break;
45
+ case "series:special_v3":
46
+ title2 = "\u6DFB\u52A0\u81F3\u4E13\u9898";
47
+ break;
48
+ case "series:audio_album":
49
+ title2 = "\u6DFB\u52A0\u81F3\u97F3\u9891\u5408\u96C6";
50
+ break;
51
+ case "series:article_album":
52
+ title2 = "\u6DFB\u52A0\u81F3\u653F\u60C5\u4EBA\u7269\u76F8\u5173\u62A5\u9053";
53
+ break;
54
+ }
55
+ return title2;
56
+ });
57
+ ((_c = (_b = (_a = window.situoyun) == null ? void 0 : _a.config) == null ? void 0 : _b.oem_config) == null ? void 0 : _c.mp_name) || "\u516C\u4F17\u53F7";
58
+ const selectedData = vue.ref([]);
59
+ const hasSelected = vue.computed(() => {
60
+ return selectedData.value.length > 0;
61
+ });
62
+ vue.computed(() => {
63
+ const ret = JSON.parse(JSON.stringify(props.typeData));
64
+ return ret;
65
+ });
66
+ const setVisible = (bool) => {
67
+ emit("update:visible", bool);
68
+ };
69
+ const selectedDataChangeHandle = (data) => {
70
+ selectedData.value = data;
71
+ };
72
+ const handleOk = () => {
73
+ setVisible(false);
74
+ };
75
+ const handleCancel = () => {
76
+ setVisible(false);
77
+ };
78
+ const comfirm = () => {
79
+ emit("comfirm", JSON.parse(JSON.stringify(selectedData.value)));
80
+ };
81
+ const { userInfo, getUserInfoHandle } = user["default"](BASE_API);
82
+ const HandleOpen = () => {
83
+ selectedData.value = props.defaultSelectedData || [];
84
+ };
85
+ const HandleClose = () => {
86
+ selectedData.value = [];
87
+ };
88
+ const tabsChange = () => {
89
+ selectedData.value = [];
90
+ };
91
+ const configData = vue.ref({});
92
+ const loadConfig = async () => {
93
+ var _a2;
94
+ const res = await api.getConfigurationNew(BASE_API, {
95
+ module: "third_party_services"
96
+ });
97
+ if (res.code === 0 && ((_a2 = res.message) == null ? void 0 : _a2.length)) {
98
+ res.message.forEach((item) => {
99
+ configData.value[item.key] = JSON.parse(item.value);
100
+ });
101
+ }
102
+ };
103
+ vue.onMounted(() => {
104
+ if (props.userStore) {
105
+ userInfo.value = { BASE_API, ...props.userStore };
106
+ } else {
107
+ getUserInfoHandle();
108
+ }
109
+ loadConfig();
110
+ });
111
+ return (_ctx, _cache) => {
112
+ const _component_storeBox = vue.resolveComponent("storeBox");
113
+ return vue.openBlock(), vue.createBlock(vue.unref(webVue.Modal), {
114
+ footer: false,
115
+ "mask-closable": false,
116
+ visible: visible.value,
117
+ "body-class": "add-content-modal-body",
118
+ "modal-class": "add-content-modal-wrapper",
119
+ "title-align": "start",
120
+ "unmount-on-close": "",
121
+ width: "1020px",
122
+ onCancel: handleCancel,
123
+ onClose: HandleClose,
124
+ onOk: handleOk,
125
+ onOpen: HandleOpen
126
+ }, {
127
+ title: vue.withCtx(() => [
128
+ vue.createTextVNode(vue.toDisplayString(title.value), 1)
129
+ ]),
130
+ default: vue.withCtx(() => [
131
+ vue.createVNode(vue.unref(webVue.Tabs), {
132
+ class: "content-tabs",
133
+ justify: "",
134
+ "lazy-load": "",
135
+ onTabClick: tabsChange
136
+ }, {
137
+ default: vue.withCtx(() => [
138
+ vue.createCommentVNode(" \u680F\u76EE\u7A3F\u4EF6 "),
139
+ _ctx.rid ? (vue.openBlock(), vue.createBlock(index, {
140
+ key: 0,
141
+ rid: _ctx.rid,
142
+ "default-selected-data": selectedData.value,
143
+ "max-select": _ctx.maxSelect,
144
+ "user-info": vue.unref(userInfo),
145
+ typeKey: _ctx.typeKey,
146
+ onChange: selectedDataChangeHandle
147
+ }, {
148
+ store: vue.withCtx(() => [
149
+ vue.createVNode(_component_storeBox, {
150
+ selectData: selectedData.value,
151
+ "onUpdate:selectData": _cache[0] || (_cache[0] = ($event) => selectedData.value = $event)
152
+ }, null, 8, ["selectData"])
153
+ ]),
154
+ options: vue.withCtx(() => [
155
+ vue.createVNode(vue.unref(webVue.Button), {
156
+ disabled: !hasSelected.value,
157
+ type: "primary",
158
+ onClick: comfirm
159
+ }, {
160
+ default: vue.withCtx(() => _cache[1] || (_cache[1] = [
161
+ vue.createTextVNode("\u6DFB\u52A0 ")
162
+ ])),
163
+ _: 1,
164
+ __: [1]
165
+ }, 8, ["disabled"])
166
+ ]),
167
+ _: 1
168
+ }, 8, ["rid", "default-selected-data", "max-select", "user-info", "typeKey"])) : vue.createCommentVNode("v-if", true)
169
+ ]),
170
+ _: 1
171
+ })
172
+ ]),
173
+ _: 1
174
+ }, 8, ["visible"]);
175
+ };
176
+ }
177
+ });
178
+ module.exports = _sfc_main;
@@ -0,0 +1,166 @@
1
+ "use strict";
2
+ var vue = require("vue");
3
+ var webVue = require("@arco-design/web-vue");
4
+ var icon = require("@arco-design/web-vue/es/icon");
5
+ const _hoisted_1 = { class: "media-filter-container" };
6
+ const _hoisted_2 = { style: { "display": "flex", "align-items": "center", "gap": "5px" } };
7
+ const _hoisted_3 = { class: "sort-button" };
8
+ const _sfc_main = vue.defineComponent({
9
+ ...{ name: "MediaFilter" },
10
+ __name: "index",
11
+ props: {
12
+ groupId: {},
13
+ tree: { default: () => [] },
14
+ series: { default: "all" },
15
+ banner: { default: "all" },
16
+ height: {},
17
+ userInfo: {}
18
+ },
19
+ emits: ["update:group_id", "search"],
20
+ setup(__props, { emit: __emit }) {
21
+ const props = __props;
22
+ const column_id = vue.ref("all");
23
+ const emit = __emit;
24
+ const filter = vue.ref({
25
+ keywords: "",
26
+ type: "",
27
+ cover_type: "",
28
+ banner: "",
29
+ sort: -1,
30
+ order: "create_time",
31
+ wordState: "precision"
32
+ });
33
+ const wordStateOptions = [
34
+ {
35
+ value: "precision",
36
+ label: "\u7CBE\u51C6\u641C",
37
+ desc: "\u4F1A\u4EE5\u8F93\u5165\u7684\u5B8C\u6574\u5173\u952E\u8BCD\u201C\u6210\u957F\u201D\u8FDB\u884C\u641C\u7D22\uFF0C\u641C\u7D22\u7ED3\u679C\u5173\u8054\u6027\u66F4\u9AD8\uFF0C\u4F46\u641C\u7D22\u7ED3\u679C\u66F4\u5C11"
38
+ },
39
+ {
40
+ value: "blur",
41
+ label: "\u6A21\u7CCA\u641C",
42
+ desc: "\u4F1A\u5C06\u8F93\u5165\u5185\u5BB9\u5206\u8BCD\uFF0C\u4F8B\u5982\u201C\u6210\u957F\u201D\u4F1A\u5206\u4E3A\u201C\u6210\u201D\u3001\u201C\u957F\u201D\u3001\u201C\u6210\u957F\u201D\uFF0C\u5185\u5BB9\u5305\u542B\u4E09\u4E2A\u8BCD\u4E2D\u4EFB\u610F\u4E00\u4E2A\u5747\u4F1A\u663E\u793A\u51FA\u6765\uFF0C\u641C\u7D22\u5185\u5BB9\u66F4\u52A0\u4E30\u5BCC"
43
+ }
44
+ ];
45
+ const sortMethodOptions = vue.computed(() => {
46
+ return [
47
+ { value: "pub_time", label: "\u53D1\u5E03\u65F6\u95F4" },
48
+ { value: "create_time", label: "\u521B\u5EFA\u65F6\u95F4" }
49
+ ];
50
+ });
51
+ const checkout = (type) => {
52
+ filter.value.wordState = type;
53
+ };
54
+ const handleSearch = () => {
55
+ const params = JSON.parse(JSON.stringify(filter.value));
56
+ if (filter.value.wordState === "precision") {
57
+ params.precise_kw = params.keywords;
58
+ delete params.keywords;
59
+ }
60
+ delete params.wordState;
61
+ emit("search", params);
62
+ };
63
+ vue.watch(
64
+ () => filter.value,
65
+ () => {
66
+ handleSearch();
67
+ },
68
+ { deep: true }
69
+ );
70
+ vue.watch(
71
+ () => props.groupId,
72
+ (val) => {
73
+ column_id.value = val;
74
+ }
75
+ );
76
+ vue.watch(
77
+ () => props.banner,
78
+ (val) => {
79
+ filter.value.banner = val === "all" ? "" : val;
80
+ },
81
+ { immediate: true }
82
+ );
83
+ vue.watch(
84
+ () => column_id.value,
85
+ (val) => {
86
+ emit("update:group_id", val);
87
+ }
88
+ );
89
+ return (_ctx, _cache) => {
90
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
91
+ vue.createVNode(vue.unref(webVue.Space), { size: "small" }, {
92
+ default: vue.withCtx(() => [
93
+ vue.createVNode(vue.unref(webVue.Input), {
94
+ modelValue: filter.value.keywords,
95
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => filter.value.keywords = $event),
96
+ "allow-clear": "",
97
+ class: "filter-item keyword",
98
+ placeholder: "\u8BF7\u8F93\u5165\u5185\u5BB9\u6807\u9898",
99
+ style: { width: "240px" },
100
+ onPressEnter: handleSearch
101
+ }, {
102
+ prepend: vue.withCtx(() => [
103
+ vue.createVNode(vue.unref(webVue.Select), {
104
+ modelValue: filter.value.wordState,
105
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => filter.value.wordState = $event),
106
+ placeholder: "\u8BF7\u9009\u62E9",
107
+ onSelect: checkout
108
+ }, {
109
+ default: vue.withCtx(() => [
110
+ (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(wordStateOptions, (item, index) => {
111
+ return vue.createVNode(vue.unref(webVue.Option), {
112
+ key: index,
113
+ value: item.value,
114
+ label: item.label
115
+ }, {
116
+ default: vue.withCtx(() => [
117
+ vue.createElementVNode("div", _hoisted_2, [
118
+ vue.createElementVNode("span", null, vue.toDisplayString(item.label), 1),
119
+ vue.createVNode(vue.unref(webVue.Tooltip), {
120
+ effect: "dark",
121
+ content: item.desc,
122
+ position: "right"
123
+ }, {
124
+ default: vue.withCtx(() => [
125
+ vue.createVNode(vue.unref(icon.IconInfoCircle))
126
+ ]),
127
+ _: 2
128
+ }, 1032, ["content"])
129
+ ])
130
+ ]),
131
+ _: 2
132
+ }, 1032, ["value", "label"]);
133
+ }), 64))
134
+ ]),
135
+ _: 1
136
+ }, 8, ["modelValue"])
137
+ ]),
138
+ _: 1
139
+ }, 8, ["modelValue"])
140
+ ]),
141
+ _: 1
142
+ }),
143
+ vue.createElementVNode("div", _hoisted_3, [
144
+ vue.createVNode(vue.unref(webVue.Select), {
145
+ modelValue: filter.value.order,
146
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => filter.value.order = $event),
147
+ class: "filter-item",
148
+ placeholder: "\u53D1\u5E03\u65F6\u95F4"
149
+ }, {
150
+ default: vue.withCtx(() => [
151
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(sortMethodOptions.value, (item) => {
152
+ return vue.openBlock(), vue.createBlock(vue.unref(webVue.Option), {
153
+ key: item.value,
154
+ label: item.label,
155
+ value: item.value
156
+ }, null, 8, ["label", "value"]);
157
+ }), 128))
158
+ ]),
159
+ _: 1
160
+ }, 8, ["modelValue"])
161
+ ])
162
+ ]);
163
+ };
164
+ }
165
+ });
166
+ module.exports = _sfc_main;
@@ -0,0 +1,152 @@
1
+ "use strict";
2
+ var vue = require("vue");
3
+ var webVue = require("@arco-design/web-vue");
4
+ var icon = require("@arco-design/web-vue/es/icon");
5
+ var api = require("../../../script/api.js");
6
+ const _hoisted_1 = { class: "column-selection-container" };
7
+ const _hoisted_2 = { class: "search-column" };
8
+ const _sfc_main = vue.defineComponent({
9
+ ...{ name: "columnTree" },
10
+ __name: "index",
11
+ props: {
12
+ column_id: {},
13
+ tree: {},
14
+ height: {},
15
+ userInfo: {}
16
+ },
17
+ emits: ["update:column_id"],
18
+ setup(__props, { emit: __emit }) {
19
+ const props = __props;
20
+ const emit = __emit;
21
+ const treeOptions = {
22
+ title: "alias",
23
+ isLeaf: "leaf"
24
+ };
25
+ const selectAlias = vue.ref("\u5168\u90E8\u5185\u5BB9");
26
+ const lastSearchKey = vue.ref(window.localStorage.getItem("lastSearchKey") || "");
27
+ const searchKey = vue.ref("");
28
+ const aTreeRef = vue.ref();
29
+ const treeData = vue.computed(() => {
30
+ if (!searchKey.value)
31
+ return props.tree;
32
+ return searchData(searchKey.value);
33
+ });
34
+ const searchData = (keyword) => {
35
+ const loop = (data) => {
36
+ const result = [];
37
+ data.forEach((item) => {
38
+ var _a;
39
+ if ((_a = item.alias) == null ? void 0 : _a.includes(keyword)) {
40
+ result.push({ ...item });
41
+ } else if (item.children) {
42
+ const filterData = loop(item.children);
43
+ if (filterData.length) {
44
+ result.push({
45
+ ...item,
46
+ children: filterData
47
+ });
48
+ }
49
+ }
50
+ });
51
+ return result;
52
+ };
53
+ return loop(props.tree);
54
+ };
55
+ const clickLastItem = () => {
56
+ aTreeRef.value.selectNode(lastSearchKey.value, true);
57
+ };
58
+ vue.watch(
59
+ () => props.column_id,
60
+ (val) => {
61
+ setSelectAlias(val);
62
+ }
63
+ );
64
+ const setSelectAlias = async (id) => {
65
+ if (id === "all") {
66
+ selectAlias.value = "\u5168\u90E8\u5185\u5BB9";
67
+ return;
68
+ }
69
+ const { code, message } = await api.getCategoryPath(props.userInfo.BASE_API, {
70
+ repo: props.userInfo.repository_id,
71
+ category: id
72
+ });
73
+ if (code === 0) {
74
+ const pathArr = [];
75
+ for (const i of message) {
76
+ pathArr.push(i.category_alias);
77
+ }
78
+ selectAlias.value = pathArr.join("/");
79
+ }
80
+ };
81
+ const AddColumnSelected = (selectedKeys, data) => {
82
+ lastSearchKey.value = selectedKeys[0];
83
+ window.localStorage.setItem("lastSearchKey", lastSearchKey.value);
84
+ emit("update:column_id", data.node.id);
85
+ };
86
+ return (_ctx, _cache) => {
87
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
88
+ vue.createVNode(vue.unref(webVue.Popover), {
89
+ "content-style": { minWidth: "120px" },
90
+ "content-class": "column-selection-popover-content",
91
+ position: "bottom",
92
+ trigger: "click"
93
+ }, {
94
+ content: vue.withCtx(() => [
95
+ vue.createElementVNode("div", _hoisted_2, [
96
+ vue.createVNode(vue.unref(webVue.InputSearch), {
97
+ modelValue: searchKey.value,
98
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchKey.value = $event),
99
+ placeholder: "\u8BF7\u8F93\u5165\u680F\u76EE\u540D\u79F0"
100
+ }, null, 8, ["modelValue"])
101
+ ]),
102
+ lastSearchKey.value ? (vue.openBlock(), vue.createElementBlock("div", {
103
+ key: 0,
104
+ class: "last-search-key",
105
+ onClick: clickLastItem
106
+ }, "\u4E0A\u4E00\u6B21\u9009\u62E9 ")) : vue.createCommentVNode("v-if", true),
107
+ vue.createElementVNode("div", {
108
+ style: vue.normalizeStyle({ minHeight: props.height + "px" }),
109
+ class: "column-selection-main"
110
+ }, [
111
+ vue.createElementVNode("div", {
112
+ style: vue.normalizeStyle({ height: props.height + "px" }),
113
+ class: "column-v"
114
+ }, [
115
+ vue.createVNode(vue.unref(webVue.Scrollbar), {
116
+ "outer-class": "column-outer-scrollbar",
117
+ style: { "height": "100%", "overflow": "auto" }
118
+ }, {
119
+ default: vue.withCtx(() => [
120
+ vue.createVNode(vue.unref(webVue.Tree), {
121
+ ref_key: "aTreeRef",
122
+ ref: aTreeRef,
123
+ data: treeData.value,
124
+ "default-expand-all": false,
125
+ "field-names": treeOptions,
126
+ "block-node": "",
127
+ "check-strictly": "",
128
+ onSelect: AddColumnSelected
129
+ }, null, 8, ["data"])
130
+ ]),
131
+ _: 1
132
+ })
133
+ ], 4)
134
+ ], 4)
135
+ ]),
136
+ default: vue.withCtx(() => [
137
+ vue.createVNode(vue.unref(webVue.Button), { class: "button" }, {
138
+ default: vue.withCtx(() => [
139
+ vue.createVNode(vue.unref(icon.IconDragDotVertical)),
140
+ vue.createTextVNode(" " + vue.toDisplayString(selectAlias.value) + " ", 1),
141
+ vue.createVNode(vue.unref(icon.IconCaretRight))
142
+ ]),
143
+ _: 1
144
+ })
145
+ ]),
146
+ _: 1
147
+ })
148
+ ]);
149
+ };
150
+ }
151
+ });
152
+ module.exports = _sfc_main;