@cmstops/pro-compo 3.9.1-rc.15 → 3.9.1-rc.16

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.
@@ -1,6 +1,8 @@
1
- import { defineComponent, ref, computed, watch, openBlock, createElementBlock, createVNode, unref, withCtx, Fragment, renderList, createElementVNode, toDisplayString, createBlock } from "vue";
2
- import { Space, Input, Select, Option, Tooltip } from "@arco-design/web-vue";
3
- import { IconInfoCircle } from "@arco-design/web-vue/es/icon";
1
+ import { defineComponent, ref, computed, watch, openBlock, createElementBlock, createVNode, unref, withCtx, Fragment, renderList, createElementVNode, toDisplayString, createBlock, withDirectives, createTextVNode, vShow } from "vue";
2
+ import { Space, Input, Select, Option, Tooltip, Button } from "@arco-design/web-vue";
3
+ import { IconInfoCircle, IconRefresh } from "@arco-design/web-vue/es/icon";
4
+ import { docSeries, docThumbMap } from "../../../../utils/doc.js";
5
+ import _sfc_main$1 from "../columnTree/index.js";
4
6
  const _hoisted_1 = { class: "media-filter-container" };
5
7
  const _hoisted_2 = { style: { "display": "flex", "align-items": "center", "gap": "5px" } };
6
8
  const _hoisted_3 = { class: "sort-button" };
@@ -10,7 +12,10 @@ const _sfc_main = defineComponent({
10
12
  props: {
11
13
  groupId: {},
12
14
  tree: { default: () => [] },
13
- height: {}
15
+ series: { default: "all" },
16
+ banner: { default: "all" },
17
+ height: {},
18
+ userInfo: {}
14
19
  },
15
20
  emits: ["update:group_id", "search"],
16
21
  setup(__props, { emit: __emit }) {
@@ -38,12 +43,82 @@ const _sfc_main = defineComponent({
38
43
  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"
39
44
  }
40
45
  ];
46
+ const bannerOptions = computed(() => {
47
+ const options = [
48
+ {
49
+ value: "0",
50
+ key: "0",
51
+ label: "\u65E0\u72EC\u7ACB\u8F6E\u64AD"
52
+ },
53
+ {
54
+ value: "1",
55
+ key: "1",
56
+ label: "\u6709\u72EC\u7ACB\u8F6E\u64AD"
57
+ }
58
+ ];
59
+ return options.filter(
60
+ (item) => props.banner === "all" || props.banner === item.key
61
+ );
62
+ });
63
+ const typeOptions = computed(() => {
64
+ const arr = Object.keys(docSeries).map((key) => {
65
+ return {
66
+ value: key,
67
+ label: docSeries[key].replace("\u7A3F\u4EF6", "")
68
+ };
69
+ });
70
+ return arr.filter((item) => {
71
+ if (props.series === "all") {
72
+ return true;
73
+ }
74
+ return props.series.split(",").includes(item.value);
75
+ });
76
+ });
77
+ const thumbOptions = computed(() => {
78
+ return Object.keys(docThumbMap()).map((key) => {
79
+ return {
80
+ value: key,
81
+ label: docThumbMap()[key]
82
+ };
83
+ });
84
+ });
41
85
  const sortMethodOptions = computed(() => {
42
86
  return [
43
87
  { value: "pub_time", label: "\u53D1\u5E03\u65F6\u95F4" },
44
88
  { value: "create_time", label: "\u521B\u5EFA\u65F6\u95F4" }
45
89
  ];
46
90
  });
91
+ const showReset = computed(() => {
92
+ let { banner } = filter.value;
93
+ if (props.banner !== "all") {
94
+ banner = "";
95
+ }
96
+ let series = filter.value.type;
97
+ if (props.series !== "all") {
98
+ series = "";
99
+ }
100
+ return filter.value.keywords || series || filter.value.cover_type || banner || filter.value.sort !== -1;
101
+ });
102
+ const reset = () => {
103
+ const _set = {
104
+ keywords: "",
105
+ cover_type: "",
106
+ sort: -1,
107
+ order: "create_time"
108
+ };
109
+ Object.assign(filter.value, _set);
110
+ if (props.banner !== "all") {
111
+ filter.value.banner = props.banner;
112
+ } else {
113
+ filter.value.banner = "";
114
+ }
115
+ if (props.series !== "all" && props.series.split(",").length === 1) {
116
+ filter.value.type = props.series;
117
+ } else {
118
+ filter.value.type = "";
119
+ }
120
+ column_id.value = "all";
121
+ };
47
122
  const checkout = (type) => {
48
123
  filter.value.wordState = type;
49
124
  };
@@ -69,6 +144,19 @@ const _sfc_main = defineComponent({
69
144
  column_id.value = val;
70
145
  }
71
146
  );
147
+ watch(
148
+ () => props.banner,
149
+ (val) => {
150
+ filter.value.banner = val === "all" ? "" : val;
151
+ },
152
+ { immediate: true }
153
+ );
154
+ watch(
155
+ () => column_id.value,
156
+ (val) => {
157
+ emit("update:group_id", val);
158
+ }
159
+ );
72
160
  return (_ctx, _cache) => {
73
161
  return openBlock(), createElementBlock("div", _hoisted_1, [
74
162
  createVNode(unref(Space), { size: "small" }, {
@@ -119,14 +207,97 @@ const _sfc_main = defineComponent({
119
207
  }, 8, ["modelValue"])
120
208
  ]),
121
209
  _: 1
122
- }, 8, ["modelValue"])
210
+ }, 8, ["modelValue"]),
211
+ createVNode(_sfc_main$1, {
212
+ column_id: column_id.value,
213
+ "onUpdate:column_id": _cache[2] || (_cache[2] = ($event) => column_id.value = $event),
214
+ height: props.height,
215
+ tree: props.tree,
216
+ "user-info": props.userInfo
217
+ }, null, 8, ["column_id", "height", "tree", "user-info"]),
218
+ createVNode(unref(Select), {
219
+ modelValue: filter.value.type,
220
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => filter.value.type = $event),
221
+ style: { width: "96px" },
222
+ "trigger-props": { autoFitPopupMinWidth: true },
223
+ "allow-clear": "",
224
+ class: "filter-item",
225
+ placeholder: "\u7C7B\u578B"
226
+ }, {
227
+ default: withCtx(() => [
228
+ (openBlock(true), createElementBlock(Fragment, null, renderList(typeOptions.value, (item) => {
229
+ return openBlock(), createBlock(unref(Option), {
230
+ key: item.value,
231
+ label: item.label,
232
+ value: item.value
233
+ }, null, 8, ["label", "value"]);
234
+ }), 128))
235
+ ]),
236
+ _: 1
237
+ }, 8, ["modelValue"]),
238
+ createVNode(unref(Select), {
239
+ modelValue: filter.value.cover_type,
240
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => filter.value.cover_type = $event),
241
+ style: { width: "96px" },
242
+ "trigger-props": { autoFitPopupMinWidth: true },
243
+ "allow-clear": "",
244
+ class: "filter-item",
245
+ placeholder: "\u5C01\u9762"
246
+ }, {
247
+ default: withCtx(() => [
248
+ (openBlock(true), createElementBlock(Fragment, null, renderList(thumbOptions.value, (item) => {
249
+ return openBlock(), createBlock(unref(Option), {
250
+ key: item.value,
251
+ label: item.label,
252
+ value: item.value
253
+ }, null, 8, ["label", "value"]);
254
+ }), 128))
255
+ ]),
256
+ _: 1
257
+ }, 8, ["modelValue"]),
258
+ createVNode(unref(Select), {
259
+ modelValue: filter.value.banner,
260
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => filter.value.banner = $event),
261
+ style: { width: "124px" },
262
+ "trigger-props": { autoFitPopupMinWidth: true },
263
+ "allow-clear": "",
264
+ class: "filter-item",
265
+ disabled: props.banner !== "all",
266
+ placeholder: "\u72EC\u7ACB\u8F6E\u64AD"
267
+ }, {
268
+ default: withCtx(() => [
269
+ (openBlock(true), createElementBlock(Fragment, null, renderList(bannerOptions.value, (item) => {
270
+ return openBlock(), createBlock(unref(Option), {
271
+ key: item.value,
272
+ label: item.label,
273
+ value: item.value
274
+ }, null, 8, ["label", "value"]);
275
+ }), 128))
276
+ ]),
277
+ _: 1
278
+ }, 8, ["modelValue", "disabled"]),
279
+ withDirectives(createVNode(unref(Button), {
280
+ class: "reset-button",
281
+ size: "small",
282
+ type: "text",
283
+ onClick: reset
284
+ }, {
285
+ default: withCtx(() => [
286
+ createVNode(unref(IconRefresh), { class: "reset-icon" }),
287
+ _cache[7] || (_cache[7] = createTextVNode(" \u91CD\u7F6E "))
288
+ ]),
289
+ _: 1,
290
+ __: [7]
291
+ }, 512), [
292
+ [vShow, showReset.value]
293
+ ])
123
294
  ]),
124
295
  _: 1
125
296
  }),
126
297
  createElementVNode("div", _hoisted_3, [
127
298
  createVNode(unref(Select), {
128
299
  modelValue: filter.value.order,
129
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => filter.value.order = $event),
300
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => filter.value.order = $event),
130
301
  class: "filter-item",
131
302
  placeholder: "\u53D1\u5E03\u65F6\u95F4"
132
303
  }, {
@@ -0,0 +1,151 @@
1
+ import { defineComponent, ref, computed, watch, openBlock, createElementBlock, createVNode, unref, withCtx, createElementVNode, createCommentVNode, normalizeStyle, createTextVNode, toDisplayString } from "vue";
2
+ import { Popover, InputSearch, Scrollbar, Tree, Button } from "@arco-design/web-vue";
3
+ import { IconDragDotVertical, IconCaretRight } from "@arco-design/web-vue/es/icon";
4
+ import { getCategoryPath } from "../../../script/api.js";
5
+ const _hoisted_1 = { class: "column-selection-container" };
6
+ const _hoisted_2 = { class: "search-column" };
7
+ const _sfc_main = defineComponent({
8
+ ...{ name: "columnTree" },
9
+ __name: "index",
10
+ props: {
11
+ column_id: {},
12
+ tree: {},
13
+ height: {},
14
+ userInfo: {}
15
+ },
16
+ emits: ["update:column_id"],
17
+ setup(__props, { emit: __emit }) {
18
+ const props = __props;
19
+ const emit = __emit;
20
+ const treeOptions = {
21
+ title: "alias",
22
+ isLeaf: "leaf"
23
+ };
24
+ const selectAlias = ref("\u5168\u90E8\u5185\u5BB9");
25
+ const lastSearchKey = ref(window.localStorage.getItem("lastSearchKey") || "");
26
+ const searchKey = ref("");
27
+ const aTreeRef = ref();
28
+ const treeData = computed(() => {
29
+ if (!searchKey.value)
30
+ return props.tree;
31
+ return searchData(searchKey.value);
32
+ });
33
+ const searchData = (keyword) => {
34
+ const loop = (data) => {
35
+ const result = [];
36
+ data.forEach((item) => {
37
+ var _a;
38
+ if ((_a = item.alias) == null ? void 0 : _a.includes(keyword)) {
39
+ result.push({ ...item });
40
+ } else if (item.children) {
41
+ const filterData = loop(item.children);
42
+ if (filterData.length) {
43
+ result.push({
44
+ ...item,
45
+ children: filterData
46
+ });
47
+ }
48
+ }
49
+ });
50
+ return result;
51
+ };
52
+ return loop(props.tree);
53
+ };
54
+ const clickLastItem = () => {
55
+ aTreeRef.value.selectNode(lastSearchKey.value, true);
56
+ };
57
+ watch(
58
+ () => props.column_id,
59
+ (val) => {
60
+ setSelectAlias(val);
61
+ }
62
+ );
63
+ const setSelectAlias = async (id) => {
64
+ if (id === "all") {
65
+ selectAlias.value = "\u5168\u90E8\u5185\u5BB9";
66
+ return;
67
+ }
68
+ const { code, message } = await getCategoryPath(props.userInfo.BASE_API, {
69
+ repo: props.userInfo.repository_id,
70
+ category: id
71
+ });
72
+ if (code === 0) {
73
+ const pathArr = [];
74
+ for (const i of message) {
75
+ pathArr.push(i.category_alias);
76
+ }
77
+ selectAlias.value = pathArr.join("/");
78
+ }
79
+ };
80
+ const AddColumnSelected = (selectedKeys, data) => {
81
+ lastSearchKey.value = selectedKeys[0];
82
+ window.localStorage.setItem("lastSearchKey", lastSearchKey.value);
83
+ emit("update:column_id", data.node.id);
84
+ };
85
+ return (_ctx, _cache) => {
86
+ return openBlock(), createElementBlock("div", _hoisted_1, [
87
+ createVNode(unref(Popover), {
88
+ "content-style": { minWidth: "120px" },
89
+ "content-class": "column-selection-popover-content",
90
+ position: "bottom",
91
+ trigger: "click"
92
+ }, {
93
+ content: withCtx(() => [
94
+ createElementVNode("div", _hoisted_2, [
95
+ createVNode(unref(InputSearch), {
96
+ modelValue: searchKey.value,
97
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchKey.value = $event),
98
+ placeholder: "\u8BF7\u8F93\u5165\u680F\u76EE\u540D\u79F0"
99
+ }, null, 8, ["modelValue"])
100
+ ]),
101
+ lastSearchKey.value ? (openBlock(), createElementBlock("div", {
102
+ key: 0,
103
+ class: "last-search-key",
104
+ onClick: clickLastItem
105
+ }, "\u4E0A\u4E00\u6B21\u9009\u62E9 ")) : createCommentVNode("v-if", true),
106
+ createElementVNode("div", {
107
+ style: normalizeStyle({ minHeight: props.height + "px" }),
108
+ class: "column-selection-main"
109
+ }, [
110
+ createElementVNode("div", {
111
+ style: normalizeStyle({ height: props.height + "px" }),
112
+ class: "column-v"
113
+ }, [
114
+ createVNode(unref(Scrollbar), {
115
+ "outer-class": "column-outer-scrollbar",
116
+ style: { "height": "100%", "overflow": "auto" }
117
+ }, {
118
+ default: withCtx(() => [
119
+ createVNode(unref(Tree), {
120
+ ref_key: "aTreeRef",
121
+ ref: aTreeRef,
122
+ data: treeData.value,
123
+ "default-expand-all": false,
124
+ "field-names": treeOptions,
125
+ "block-node": "",
126
+ "check-strictly": "",
127
+ onSelect: AddColumnSelected
128
+ }, null, 8, ["data"])
129
+ ]),
130
+ _: 1
131
+ })
132
+ ], 4)
133
+ ], 4)
134
+ ]),
135
+ default: withCtx(() => [
136
+ createVNode(unref(Button), { class: "button" }, {
137
+ default: withCtx(() => [
138
+ createVNode(unref(IconDragDotVertical)),
139
+ createTextVNode(" " + toDisplayString(selectAlias.value) + " ", 1),
140
+ createVNode(unref(IconCaretRight))
141
+ ]),
142
+ _: 1
143
+ })
144
+ ]),
145
+ _: 1
146
+ })
147
+ ]);
148
+ };
149
+ }
150
+ });
151
+ export { _sfc_main as default };
@@ -6,6 +6,12 @@ function getCategoryCategoriesTree(BASE_API, params) {
6
6
  params
7
7
  });
8
8
  }
9
+ function getCategoryPath(BASE_API, params) {
10
+ return request(BASE_API, {
11
+ url: `/poplar/v2/repo/${params == null ? void 0 : params.repo}/category/${params == null ? void 0 : params.category}/path`,
12
+ method: "get"
13
+ });
14
+ }
9
15
  function getCategoryMediaNew(BASE_API, params) {
10
16
  return request(BASE_API, {
11
17
  url: `/poplar/v3/s/documents`,
@@ -92,4 +98,4 @@ function getTypeConfig(BASE_API, params) {
92
98
  params
93
99
  });
94
100
  }
95
- export { checkCommitFulfillment, getBroadcastList, getCategoryCategoriesTree, getCategoryMediaNew, getCategorylistsGroups, getConfigurationNew, getEqxiuList, getMpContentList, getReporterContent, getRevealContent, getTypeConfig, searchMlists, searchMpaccount };
101
+ export { checkCommitFulfillment, getBroadcastList, getCategoryCategoriesTree, getCategoryMediaNew, getCategoryPath, getCategorylistsGroups, getConfigurationNew, getEqxiuList, getMpContentList, getReporterContent, getRevealContent, getTypeConfig, searchMlists, searchMpaccount };
@@ -2,6 +2,8 @@
2
2
  var vue = require("vue");
3
3
  var webVue = require("@arco-design/web-vue");
4
4
  var icon = require("@arco-design/web-vue/es/icon");
5
+ var doc = require("../../../../utils/doc.js");
6
+ var index = require("../columnTree/index.js");
5
7
  const _hoisted_1 = { class: "media-filter-container" };
6
8
  const _hoisted_2 = { style: { "display": "flex", "align-items": "center", "gap": "5px" } };
7
9
  const _hoisted_3 = { class: "sort-button" };
@@ -11,7 +13,10 @@ const _sfc_main = vue.defineComponent({
11
13
  props: {
12
14
  groupId: {},
13
15
  tree: { default: () => [] },
14
- height: {}
16
+ series: { default: "all" },
17
+ banner: { default: "all" },
18
+ height: {},
19
+ userInfo: {}
15
20
  },
16
21
  emits: ["update:group_id", "search"],
17
22
  setup(__props, { emit: __emit }) {
@@ -39,12 +44,82 @@ const _sfc_main = vue.defineComponent({
39
44
  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"
40
45
  }
41
46
  ];
47
+ const bannerOptions = vue.computed(() => {
48
+ const options = [
49
+ {
50
+ value: "0",
51
+ key: "0",
52
+ label: "\u65E0\u72EC\u7ACB\u8F6E\u64AD"
53
+ },
54
+ {
55
+ value: "1",
56
+ key: "1",
57
+ label: "\u6709\u72EC\u7ACB\u8F6E\u64AD"
58
+ }
59
+ ];
60
+ return options.filter(
61
+ (item) => props.banner === "all" || props.banner === item.key
62
+ );
63
+ });
64
+ const typeOptions = vue.computed(() => {
65
+ const arr = Object.keys(doc.docSeries).map((key) => {
66
+ return {
67
+ value: key,
68
+ label: doc.docSeries[key].replace("\u7A3F\u4EF6", "")
69
+ };
70
+ });
71
+ return arr.filter((item) => {
72
+ if (props.series === "all") {
73
+ return true;
74
+ }
75
+ return props.series.split(",").includes(item.value);
76
+ });
77
+ });
78
+ const thumbOptions = vue.computed(() => {
79
+ return Object.keys(doc.docThumbMap()).map((key) => {
80
+ return {
81
+ value: key,
82
+ label: doc.docThumbMap()[key]
83
+ };
84
+ });
85
+ });
42
86
  const sortMethodOptions = vue.computed(() => {
43
87
  return [
44
88
  { value: "pub_time", label: "\u53D1\u5E03\u65F6\u95F4" },
45
89
  { value: "create_time", label: "\u521B\u5EFA\u65F6\u95F4" }
46
90
  ];
47
91
  });
92
+ const showReset = vue.computed(() => {
93
+ let { banner } = filter.value;
94
+ if (props.banner !== "all") {
95
+ banner = "";
96
+ }
97
+ let series = filter.value.type;
98
+ if (props.series !== "all") {
99
+ series = "";
100
+ }
101
+ return filter.value.keywords || series || filter.value.cover_type || banner || filter.value.sort !== -1;
102
+ });
103
+ const reset = () => {
104
+ const _set = {
105
+ keywords: "",
106
+ cover_type: "",
107
+ sort: -1,
108
+ order: "create_time"
109
+ };
110
+ Object.assign(filter.value, _set);
111
+ if (props.banner !== "all") {
112
+ filter.value.banner = props.banner;
113
+ } else {
114
+ filter.value.banner = "";
115
+ }
116
+ if (props.series !== "all" && props.series.split(",").length === 1) {
117
+ filter.value.type = props.series;
118
+ } else {
119
+ filter.value.type = "";
120
+ }
121
+ column_id.value = "all";
122
+ };
48
123
  const checkout = (type) => {
49
124
  filter.value.wordState = type;
50
125
  };
@@ -70,6 +145,19 @@ const _sfc_main = vue.defineComponent({
70
145
  column_id.value = val;
71
146
  }
72
147
  );
148
+ vue.watch(
149
+ () => props.banner,
150
+ (val) => {
151
+ filter.value.banner = val === "all" ? "" : val;
152
+ },
153
+ { immediate: true }
154
+ );
155
+ vue.watch(
156
+ () => column_id.value,
157
+ (val) => {
158
+ emit("update:group_id", val);
159
+ }
160
+ );
73
161
  return (_ctx, _cache) => {
74
162
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
75
163
  vue.createVNode(vue.unref(webVue.Space), { size: "small" }, {
@@ -91,9 +179,9 @@ const _sfc_main = vue.defineComponent({
91
179
  onSelect: checkout
92
180
  }, {
93
181
  default: vue.withCtx(() => [
94
- (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(wordStateOptions, (item, index) => {
182
+ (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(wordStateOptions, (item, index2) => {
95
183
  return vue.createVNode(vue.unref(webVue.Option), {
96
- key: index,
184
+ key: index2,
97
185
  value: item.value,
98
186
  label: item.label
99
187
  }, {
@@ -120,14 +208,97 @@ const _sfc_main = vue.defineComponent({
120
208
  }, 8, ["modelValue"])
121
209
  ]),
122
210
  _: 1
123
- }, 8, ["modelValue"])
211
+ }, 8, ["modelValue"]),
212
+ vue.createVNode(index, {
213
+ column_id: column_id.value,
214
+ "onUpdate:column_id": _cache[2] || (_cache[2] = ($event) => column_id.value = $event),
215
+ height: props.height,
216
+ tree: props.tree,
217
+ "user-info": props.userInfo
218
+ }, null, 8, ["column_id", "height", "tree", "user-info"]),
219
+ vue.createVNode(vue.unref(webVue.Select), {
220
+ modelValue: filter.value.type,
221
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => filter.value.type = $event),
222
+ style: { width: "96px" },
223
+ "trigger-props": { autoFitPopupMinWidth: true },
224
+ "allow-clear": "",
225
+ class: "filter-item",
226
+ placeholder: "\u7C7B\u578B"
227
+ }, {
228
+ default: vue.withCtx(() => [
229
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(typeOptions.value, (item) => {
230
+ return vue.openBlock(), vue.createBlock(vue.unref(webVue.Option), {
231
+ key: item.value,
232
+ label: item.label,
233
+ value: item.value
234
+ }, null, 8, ["label", "value"]);
235
+ }), 128))
236
+ ]),
237
+ _: 1
238
+ }, 8, ["modelValue"]),
239
+ vue.createVNode(vue.unref(webVue.Select), {
240
+ modelValue: filter.value.cover_type,
241
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => filter.value.cover_type = $event),
242
+ style: { width: "96px" },
243
+ "trigger-props": { autoFitPopupMinWidth: true },
244
+ "allow-clear": "",
245
+ class: "filter-item",
246
+ placeholder: "\u5C01\u9762"
247
+ }, {
248
+ default: vue.withCtx(() => [
249
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(thumbOptions.value, (item) => {
250
+ return vue.openBlock(), vue.createBlock(vue.unref(webVue.Option), {
251
+ key: item.value,
252
+ label: item.label,
253
+ value: item.value
254
+ }, null, 8, ["label", "value"]);
255
+ }), 128))
256
+ ]),
257
+ _: 1
258
+ }, 8, ["modelValue"]),
259
+ vue.createVNode(vue.unref(webVue.Select), {
260
+ modelValue: filter.value.banner,
261
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => filter.value.banner = $event),
262
+ style: { width: "124px" },
263
+ "trigger-props": { autoFitPopupMinWidth: true },
264
+ "allow-clear": "",
265
+ class: "filter-item",
266
+ disabled: props.banner !== "all",
267
+ placeholder: "\u72EC\u7ACB\u8F6E\u64AD"
268
+ }, {
269
+ default: vue.withCtx(() => [
270
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(bannerOptions.value, (item) => {
271
+ return vue.openBlock(), vue.createBlock(vue.unref(webVue.Option), {
272
+ key: item.value,
273
+ label: item.label,
274
+ value: item.value
275
+ }, null, 8, ["label", "value"]);
276
+ }), 128))
277
+ ]),
278
+ _: 1
279
+ }, 8, ["modelValue", "disabled"]),
280
+ vue.withDirectives(vue.createVNode(vue.unref(webVue.Button), {
281
+ class: "reset-button",
282
+ size: "small",
283
+ type: "text",
284
+ onClick: reset
285
+ }, {
286
+ default: vue.withCtx(() => [
287
+ vue.createVNode(vue.unref(icon.IconRefresh), { class: "reset-icon" }),
288
+ _cache[7] || (_cache[7] = vue.createTextVNode(" \u91CD\u7F6E "))
289
+ ]),
290
+ _: 1,
291
+ __: [7]
292
+ }, 512), [
293
+ [vue.vShow, showReset.value]
294
+ ])
124
295
  ]),
125
296
  _: 1
126
297
  }),
127
298
  vue.createElementVNode("div", _hoisted_3, [
128
299
  vue.createVNode(vue.unref(webVue.Select), {
129
300
  modelValue: filter.value.order,
130
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => filter.value.order = $event),
301
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => filter.value.order = $event),
131
302
  class: "filter-item",
132
303
  placeholder: "\u53D1\u5E03\u65F6\u95F4"
133
304
  }, {
@@ -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;
@@ -8,6 +8,12 @@ function getCategoryCategoriesTree(BASE_API, params) {
8
8
  params
9
9
  });
10
10
  }
11
+ function getCategoryPath(BASE_API, params) {
12
+ return request(BASE_API, {
13
+ url: `/poplar/v2/repo/${params == null ? void 0 : params.repo}/category/${params == null ? void 0 : params.category}/path`,
14
+ method: "get"
15
+ });
16
+ }
11
17
  function getCategoryMediaNew(BASE_API, params) {
12
18
  return request(BASE_API, {
13
19
  url: `/poplar/v3/s/documents`,
@@ -98,6 +104,7 @@ exports.checkCommitFulfillment = checkCommitFulfillment;
98
104
  exports.getBroadcastList = getBroadcastList;
99
105
  exports.getCategoryCategoriesTree = getCategoryCategoriesTree;
100
106
  exports.getCategoryMediaNew = getCategoryMediaNew;
107
+ exports.getCategoryPath = getCategoryPath;
101
108
  exports.getCategorylistsGroups = getCategorylistsGroups;
102
109
  exports.getConfigurationNew = getConfigurationNew;
103
110
  exports.getEqxiuList = getEqxiuList;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmstops/pro-compo",
3
- "version": "3.9.1-rc.15",
3
+ "version": "3.9.1-rc.16",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "vue",