@cmstops/pro-compo 0.1.31 → 0.1.33

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 (66) hide show
  1. package/dist/index.css +190 -15
  2. package/dist/index.min.css +1 -1
  3. package/es/contentModal/component.js +35 -35
  4. package/es/contentModal/components/ViewAllColumn/MediaFilter/index.js +53 -22
  5. package/es/contentModal/components/ViewAllColumn/columnTree/index.js +67 -18
  6. package/es/contentModal/components/ViewAllColumn/index.js +91 -44
  7. package/es/contentModal/components/storeBox/index.js +6 -6
  8. package/es/contentModal/images/pic-thumb.js +2 -0
  9. package/es/contentModal/style/MediaFilter.less +35 -5
  10. package/es/contentModal/style/ViewAllColumn.less +11 -0
  11. package/es/contentModal/style/columnTree.less +25 -5
  12. package/es/contentModal/style/index.css +56 -11
  13. package/es/contentModal/style/storeBox.less +16 -6
  14. package/es/editMetaInfo/components/metaInfoForm.js +84 -81
  15. package/es/index.css +190 -15
  16. package/es/resourceModal/assets/images/sys_load_more.js +2 -0
  17. package/es/resourceModal/component.js +9 -2
  18. package/es/resourceModal/components/MediaSelection/MainContent/index.js +1 -1
  19. package/es/resourceModal/components/MediaSelection/SystemResourceSelected/components/SystemResourceFilter.d.ts +0 -0
  20. package/es/resourceModal/components/MediaSelection/SystemResourceSelected/components/SystemResourceFilter.js +139 -0
  21. package/es/resourceModal/components/MediaSelection/SystemResourceSelected/components/SystemResourceList.d.ts +0 -0
  22. package/es/resourceModal/components/MediaSelection/SystemResourceSelected/components/SystemResourceList.js +103 -0
  23. package/es/resourceModal/components/MediaSelection/SystemResourceSelected/index.d.ts +0 -0
  24. package/es/resourceModal/components/MediaSelection/SystemResourceSelected/index.js +103 -0
  25. package/es/resourceModal/components/MediaSelection/index.js +16 -7
  26. package/es/resourceModal/script/api.d.ts +17 -0
  27. package/es/resourceModal/script/api.js +21 -1
  28. package/es/resourceModal/script/mediaSelection.d.ts +4 -0
  29. package/es/resourceModal/script/mediaSelection.js +8 -0
  30. package/es/resourceModal/style/DocAiMediaSelected.less +2 -3
  31. package/es/resourceModal/style/MainContent.less +5 -3
  32. package/es/resourceModal/style/SystemResourceSelected.less +138 -0
  33. package/es/resourceModal/style/ToolbarSearch.less +13 -0
  34. package/es/resourceModal/style/index.css +135 -5
  35. package/es/resourceModal/style/index.less +1 -0
  36. package/es/selectThumb/component.js +6 -2
  37. package/lib/contentModal/component.js +35 -35
  38. package/lib/contentModal/components/ViewAllColumn/MediaFilter/index.js +51 -20
  39. package/lib/contentModal/components/ViewAllColumn/columnTree/index.js +65 -16
  40. package/lib/contentModal/components/ViewAllColumn/index.js +90 -43
  41. package/lib/contentModal/components/storeBox/index.js +6 -6
  42. package/lib/contentModal/images/pic-thumb.js +3 -0
  43. package/lib/contentModal/style/MediaFilter.less +35 -5
  44. package/lib/contentModal/style/ViewAllColumn.less +11 -0
  45. package/lib/contentModal/style/columnTree.less +25 -5
  46. package/lib/contentModal/style/index.css +56 -11
  47. package/lib/contentModal/style/storeBox.less +16 -6
  48. package/lib/editMetaInfo/components/metaInfoForm.js +83 -80
  49. package/lib/index.css +190 -15
  50. package/lib/resourceModal/assets/images/sys_load_more.js +3 -0
  51. package/lib/resourceModal/component.js +8 -1
  52. package/lib/resourceModal/components/MediaSelection/MainContent/index.js +2 -2
  53. package/lib/resourceModal/components/MediaSelection/SystemResourceSelected/components/SystemResourceFilter.js +140 -0
  54. package/lib/resourceModal/components/MediaSelection/SystemResourceSelected/components/SystemResourceList.js +104 -0
  55. package/lib/resourceModal/components/MediaSelection/SystemResourceSelected/index.js +104 -0
  56. package/lib/resourceModal/components/MediaSelection/index.js +15 -6
  57. package/lib/resourceModal/script/api.js +23 -0
  58. package/lib/resourceModal/script/mediaSelection.js +10 -0
  59. package/lib/resourceModal/style/DocAiMediaSelected.less +2 -3
  60. package/lib/resourceModal/style/MainContent.less +5 -3
  61. package/lib/resourceModal/style/SystemResourceSelected.less +138 -0
  62. package/lib/resourceModal/style/ToolbarSearch.less +13 -0
  63. package/lib/resourceModal/style/index.css +135 -5
  64. package/lib/resourceModal/style/index.less +1 -0
  65. package/lib/selectThumb/component.js +5 -1
  66. package/package.json +1 -1
@@ -78,18 +78,18 @@ const _sfc_main = defineComponent({
78
78
  });
79
79
  return (_ctx, _cache) => {
80
80
  return openBlock(), createBlock(unref(Modal), {
81
- visible: visible.value,
82
- width: "986px",
83
- "mask-closable": false,
84
81
  footer: false,
82
+ "mask-closable": false,
83
+ visible: visible.value,
84
+ "body-class": "add-content-modal-body",
85
+ "modal-class": "add-content-modal-wrapper",
85
86
  "title-align": "start",
86
87
  "unmount-on-close": "",
87
- "modal-class": "add-content-modal-wrapper",
88
- "body-class": "add-content-modal-body",
89
- onOk: handleOk,
90
- onOpen: HandleOpen,
88
+ width: "1020px",
89
+ onCancel: handleCancel,
91
90
  onClose: HandleClose,
92
- onCancel: handleCancel
91
+ onOk: handleOk,
92
+ onOpen: HandleOpen
93
93
  }, {
94
94
  title: withCtx(() => [
95
95
  createTextVNode(toDisplayString(props.title ? props.title : "\u6DFB\u52A0\u5185\u5BB9"), 1)
@@ -108,11 +108,11 @@ const _sfc_main = defineComponent({
108
108
  default: withCtx(() => [
109
109
  unref(userInfo) && unref(userInfo).repository_id ? (openBlock(), createBlock(_sfc_main$1, {
110
110
  key: 0,
111
- "max-select": _ctx.maxSelect,
111
+ banner: typeDataController.value.docBanner,
112
112
  "default-selected-data": selectedData.value,
113
- "type-data": typeDataController.value,
113
+ "max-select": _ctx.maxSelect,
114
114
  series: typeDataController.value.docSeries,
115
- banner: typeDataController.value.docBanner,
115
+ "type-data": typeDataController.value,
116
116
  "user-info": unref(userInfo),
117
117
  onChange: selectedDataChangeHandle
118
118
  }, {
@@ -124,18 +124,18 @@ const _sfc_main = defineComponent({
124
124
  ]),
125
125
  options: withCtx(() => [
126
126
  createVNode(unref(Button), {
127
- type: "primary",
128
127
  disabled: !hasSelected.value,
128
+ type: "primary",
129
129
  onClick: comfirm
130
130
  }, {
131
131
  default: withCtx(() => [
132
- createTextVNode("\u6DFB\u52A0")
132
+ createTextVNode("\u6DFB\u52A0 ")
133
133
  ]),
134
134
  _: 1
135
135
  }, 8, ["disabled"])
136
136
  ]),
137
137
  _: 1
138
- }, 8, ["max-select", "default-selected-data", "type-data", "series", "banner", "user-info"])) : createCommentVNode("v-if", true)
138
+ }, 8, ["banner", "default-selected-data", "max-select", "series", "type-data", "user-info"])) : createCommentVNode("v-if", true)
139
139
  ]),
140
140
  _: 1
141
141
  })) : createCommentVNode("v-if", true),
@@ -146,12 +146,12 @@ const _sfc_main = defineComponent({
146
146
  default: withCtx(() => [
147
147
  unref(userInfo) && unref(userInfo).repository_id ? (openBlock(), createBlock(_sfc_main$3, {
148
148
  key: 0,
149
- "max-select": _ctx.maxSelect,
150
149
  "default-selected-data": selectedData.value,
150
+ "max-select": _ctx.maxSelect,
151
151
  "outside-select-data": _ctx.outsideSelectData || [],
152
+ type: typeDataController.value.contentListType,
152
153
  "type-data": typeDataController.value,
153
154
  "user-info": unref(userInfo),
154
- type: typeDataController.value.contentListType,
155
155
  onChange: selectedDataChangeHandle
156
156
  }, {
157
157
  store: withCtx(() => [
@@ -162,8 +162,8 @@ const _sfc_main = defineComponent({
162
162
  ]),
163
163
  options: withCtx(() => [
164
164
  createVNode(unref(Button), {
165
- type: "primary",
166
165
  disabled: !hasSelected.value,
166
+ type: "primary",
167
167
  onClick: comfirm
168
168
  }, {
169
169
  default: withCtx(() => [
@@ -173,7 +173,7 @@ const _sfc_main = defineComponent({
173
173
  }, 8, ["disabled"])
174
174
  ]),
175
175
  _: 1
176
- }, 8, ["max-select", "default-selected-data", "outside-select-data", "type-data", "user-info", "type"])) : createCommentVNode("v-if", true)
176
+ }, 8, ["default-selected-data", "max-select", "outside-select-data", "type", "type-data", "user-info"])) : createCommentVNode("v-if", true)
177
177
  ]),
178
178
  _: 1
179
179
  })) : createCommentVNode("v-if", true),
@@ -184,13 +184,13 @@ const _sfc_main = defineComponent({
184
184
  default: withCtx(() => [
185
185
  unref(userInfo) && unref(userInfo).repository_id ? (openBlock(), createBlock(_sfc_main$4, {
186
186
  key: 0,
187
- "max-select": _ctx.maxSelect,
187
+ columns: typeDataController.value.compoType,
188
+ "compo-filter": _ctx.compoFilter,
188
189
  "default-selected-data": selectedData.value,
190
+ "max-select": _ctx.maxSelect,
189
191
  "outside-select-data": _ctx.outsideSelectData || [],
190
192
  "type-data": typeDataController.value,
191
- columns: typeDataController.value.compoType,
192
193
  "user-info": unref(userInfo),
193
- "compo-filter": _ctx.compoFilter,
194
194
  onChange: selectedDataChangeHandle
195
195
  }, {
196
196
  store: withCtx(() => [
@@ -201,8 +201,8 @@ const _sfc_main = defineComponent({
201
201
  ]),
202
202
  options: withCtx(() => [
203
203
  createVNode(unref(Button), {
204
- type: "primary",
205
204
  disabled: !hasSelected.value,
205
+ type: "primary",
206
206
  onClick: comfirm
207
207
  }, {
208
208
  default: withCtx(() => [
@@ -212,7 +212,7 @@ const _sfc_main = defineComponent({
212
212
  }, 8, ["disabled"])
213
213
  ]),
214
214
  _: 1
215
- }, 8, ["max-select", "default-selected-data", "outside-select-data", "type-data", "columns", "user-info", "compo-filter"])) : createCommentVNode("v-if", true)
215
+ }, 8, ["columns", "compo-filter", "default-selected-data", "max-select", "outside-select-data", "type-data", "user-info"])) : createCommentVNode("v-if", true)
216
216
  ]),
217
217
  _: 1
218
218
  })) : createCommentVNode("v-if", true),
@@ -223,11 +223,11 @@ const _sfc_main = defineComponent({
223
223
  default: withCtx(() => [
224
224
  unref(userInfo) && unref(userInfo).repository_id ? (openBlock(), createBlock(_sfc_main$5, {
225
225
  key: 0,
226
- "max-select": _ctx.maxSelect,
226
+ columns: typeDataController.value.compoType,
227
227
  "default-selected-data": selectedData.value,
228
+ "max-select": _ctx.maxSelect,
228
229
  "outside-select-data": _ctx.outsideSelectData || [],
229
230
  "type-data": typeDataController.value,
230
- columns: typeDataController.value.compoType,
231
231
  "user-info": unref(userInfo),
232
232
  onChange: selectedDataChangeHandle
233
233
  }, {
@@ -239,8 +239,8 @@ const _sfc_main = defineComponent({
239
239
  ]),
240
240
  options: withCtx(() => [
241
241
  createVNode(unref(Button), {
242
- type: "primary",
243
242
  disabled: !hasSelected.value,
243
+ type: "primary",
244
244
  onClick: comfirm
245
245
  }, {
246
246
  default: withCtx(() => [
@@ -250,7 +250,7 @@ const _sfc_main = defineComponent({
250
250
  }, 8, ["disabled"])
251
251
  ]),
252
252
  _: 1
253
- }, 8, ["max-select", "default-selected-data", "outside-select-data", "type-data", "columns", "user-info"])) : createCommentVNode("v-if", true)
253
+ }, 8, ["columns", "default-selected-data", "max-select", "outside-select-data", "type-data", "user-info"])) : createCommentVNode("v-if", true)
254
254
  ]),
255
255
  _: 1
256
256
  })) : createCommentVNode("v-if", true),
@@ -261,11 +261,11 @@ const _sfc_main = defineComponent({
261
261
  default: withCtx(() => [
262
262
  unref(userInfo) && unref(userInfo).repository_id ? (openBlock(), createBlock(_sfc_main$6, {
263
263
  key: 0,
264
- "max-select": _ctx.maxSelect,
264
+ columns: typeDataController.value.MpAccountType,
265
265
  "default-selected-data": selectedData.value,
266
+ "max-select": _ctx.maxSelect,
266
267
  "outside-select-data": _ctx.outsideSelectData || [],
267
268
  "type-data": typeDataController.value,
268
- columns: typeDataController.value.MpAccountType,
269
269
  "user-info": unref(userInfo),
270
270
  onChange: selectedDataChangeHandle
271
271
  }, {
@@ -277,8 +277,8 @@ const _sfc_main = defineComponent({
277
277
  ]),
278
278
  options: withCtx(() => [
279
279
  createVNode(unref(Button), {
280
- type: "primary",
281
280
  disabled: !hasSelected.value,
281
+ type: "primary",
282
282
  onClick: comfirm
283
283
  }, {
284
284
  default: withCtx(() => [
@@ -288,7 +288,7 @@ const _sfc_main = defineComponent({
288
288
  }, 8, ["disabled"])
289
289
  ]),
290
290
  _: 1
291
- }, 8, ["max-select", "default-selected-data", "outside-select-data", "type-data", "columns", "user-info"])) : createCommentVNode("v-if", true)
291
+ }, 8, ["columns", "default-selected-data", "max-select", "outside-select-data", "type-data", "user-info"])) : createCommentVNode("v-if", true)
292
292
  ]),
293
293
  _: 1
294
294
  }, 8, ["title"])) : createCommentVNode("v-if", true),
@@ -299,11 +299,11 @@ const _sfc_main = defineComponent({
299
299
  default: withCtx(() => [
300
300
  unref(userInfo) && unref(userInfo).repository_id ? (openBlock(), createBlock(_sfc_main$7, {
301
301
  key: 0,
302
- "max-select": _ctx.maxSelect,
302
+ columns: typeDataController.value.MpAccountType,
303
303
  "default-selected-data": selectedData.value,
304
+ "max-select": _ctx.maxSelect,
304
305
  "outside-select-data": _ctx.outsideSelectData || [],
305
306
  "type-data": typeDataController.value,
306
- columns: typeDataController.value.MpAccountType,
307
307
  "user-info": unref(userInfo),
308
308
  onChange: selectedDataChangeHandle
309
309
  }, {
@@ -315,8 +315,8 @@ const _sfc_main = defineComponent({
315
315
  ]),
316
316
  options: withCtx(() => [
317
317
  createVNode(unref(Button), {
318
- type: "primary",
319
318
  disabled: !hasSelected.value,
319
+ type: "primary",
320
320
  onClick: comfirm
321
321
  }, {
322
322
  default: withCtx(() => [
@@ -326,7 +326,7 @@ const _sfc_main = defineComponent({
326
326
  }, 8, ["disabled"])
327
327
  ]),
328
328
  _: 1
329
- }, 8, ["max-select", "default-selected-data", "outside-select-data", "type-data", "columns", "user-info"])) : createCommentVNode("v-if", true)
329
+ }, 8, ["columns", "default-selected-data", "max-select", "outside-select-data", "type-data", "user-info"])) : createCommentVNode("v-if", true)
330
330
  ]),
331
331
  _: 1
332
332
  }, 8, ["title"])) : createCommentVNode("v-if", true)
@@ -1,5 +1,6 @@
1
- import { defineComponent, ref, computed, watch, openBlock, createElementBlock, createVNode, unref, withCtx, Fragment, renderList, createBlock, withDirectives, createTextVNode, vShow } from "vue";
2
- import { Space, Select, Option, Input, Button } from "@arco-design/web-vue";
1
+ import { defineComponent, ref, computed, watch, openBlock, createElementBlock, createVNode, unref, withCtx, Fragment, renderList, createBlock, withDirectives, createTextVNode, vShow, createElementVNode } from "vue";
2
+ import { Space, Input, Select, Option, Button } from "@arco-design/web-vue";
3
+ import { IconRefresh } from "@arco-design/web-vue/es/icon";
3
4
  import { docSeries, docThumbMap } from "../../../../utils/doc.js";
4
5
  import _sfc_main$1 from "../columnTree/index.js";
5
6
  const _hoisted_1 = { class: "media-filter-container" };
@@ -7,7 +8,7 @@ const _sfc_main = defineComponent({
7
8
  ...{ name: "MediaFilter" },
8
9
  __name: "index",
9
10
  props: {
10
- group_id: {},
11
+ groupId: {},
11
12
  tree: { default: () => [] },
12
13
  series: { default: "all" },
13
14
  banner: { default: "all" },
@@ -66,6 +67,12 @@ const _sfc_main = defineComponent({
66
67
  });
67
68
  return [{ value: "", label: "\u5168\u90E8\u5C01\u9762\u7C7B\u578B" }, ...arr];
68
69
  });
70
+ const sortOptions = computed(() => {
71
+ return [
72
+ { value: -1, label: "\u53D1\u5E03\u65F6\u95F4" },
73
+ { value: 1, label: "\u521B\u5EFA\u65F6\u95F4" }
74
+ ];
75
+ });
69
76
  const showReset = computed(() => {
70
77
  let { banner } = filter.value;
71
78
  if (props.banner !== "all") {
@@ -75,7 +82,7 @@ const _sfc_main = defineComponent({
75
82
  if (props.series !== "all") {
76
83
  series = "";
77
84
  }
78
- return filter.value.keywords || series || filter.value.cover_type || banner;
85
+ return filter.value.keywords || series || filter.value.cover_type || banner || filter.value.sort !== -1;
79
86
  });
80
87
  const reset = () => {
81
88
  filter.value = {
@@ -100,13 +107,13 @@ const _sfc_main = defineComponent({
100
107
  };
101
108
  watch(
102
109
  () => filter.value,
103
- (val) => {
110
+ () => {
104
111
  handleSearch();
105
112
  },
106
113
  { deep: true }
107
114
  );
108
115
  watch(
109
- () => props.group_id,
116
+ () => props.groupId,
110
117
  (val) => {
111
118
  column_id.value = val;
112
119
  }
@@ -119,18 +126,26 @@ const _sfc_main = defineComponent({
119
126
  );
120
127
  return (_ctx, _cache) => {
121
128
  return openBlock(), createElementBlock("div", _hoisted_1, [
122
- createVNode(unref(Space), { size: "large" }, {
129
+ createVNode(unref(Space), { size: "small" }, {
123
130
  default: withCtx(() => [
131
+ createVNode(unref(Input), {
132
+ modelValue: filter.value.keywords,
133
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => filter.value.keywords = $event),
134
+ "allow-clear": "",
135
+ class: "filter-item",
136
+ placeholder: "\u8BF7\u8F93\u5165\u5185\u5BB9\u6807\u9898",
137
+ onPressEnter: handleSearch
138
+ }, null, 8, ["modelValue"]),
124
139
  createVNode(_sfc_main$1, {
125
140
  column_id: column_id.value,
126
- "onUpdate:column_id": _cache[0] || (_cache[0] = ($event) => column_id.value = $event),
141
+ "onUpdate:column_id": _cache[1] || (_cache[1] = ($event) => column_id.value = $event),
127
142
  height: props.height,
128
143
  tree: props.tree,
129
144
  "user-info": props.userInfo
130
145
  }, null, 8, ["column_id", "height", "tree", "user-info"]),
131
146
  createVNode(unref(Select), {
132
147
  modelValue: filter.value.type,
133
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => filter.value.type = $event),
148
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => filter.value.type = $event),
134
149
  class: "filter-item",
135
150
  placeholder: "\u7C7B\u578B"
136
151
  }, {
@@ -147,7 +162,7 @@ const _sfc_main = defineComponent({
147
162
  }, 8, ["modelValue"]),
148
163
  createVNode(unref(Select), {
149
164
  modelValue: filter.value.cover_type,
150
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => filter.value.cover_type = $event),
165
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => filter.value.cover_type = $event),
151
166
  class: "filter-item",
152
167
  placeholder: "\u5C01\u9762"
153
168
  }, {
@@ -164,7 +179,7 @@ const _sfc_main = defineComponent({
164
179
  }, 8, ["modelValue"]),
165
180
  createVNode(unref(Select), {
166
181
  modelValue: filter.value.banner,
167
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => filter.value.banner = $event),
182
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => filter.value.banner = $event),
168
183
  class: "filter-item",
169
184
  placeholder: "\u72EC\u7ACB\u8F6E\u64AD"
170
185
  }, {
@@ -179,21 +194,15 @@ const _sfc_main = defineComponent({
179
194
  ]),
180
195
  _: 1
181
196
  }, 8, ["modelValue"]),
182
- createVNode(unref(Input), {
183
- modelValue: filter.value.keywords,
184
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => filter.value.keywords = $event),
185
- class: "filter-item",
186
- "allow-clear": "",
187
- placeholder: "\u8BF7\u8F93\u5165\u5185\u5BB9\u6807\u9898",
188
- onPressEnter: handleSearch
189
- }, null, 8, ["modelValue"]),
190
197
  withDirectives(createVNode(unref(Button), {
191
- type: "text",
198
+ class: "reset-button",
192
199
  size: "small",
200
+ type: "text",
193
201
  onClick: reset
194
202
  }, {
195
203
  default: withCtx(() => [
196
- createTextVNode("\u91CD\u7F6E")
204
+ createVNode(unref(IconRefresh), { class: "reset-icon" }),
205
+ createTextVNode(" \u91CD\u7F6E ")
197
206
  ]),
198
207
  _: 1
199
208
  }, 512), [
@@ -201,7 +210,29 @@ const _sfc_main = defineComponent({
201
210
  ])
202
211
  ]),
203
212
  _: 1
204
- })
213
+ }),
214
+ createElementVNode("div", {
215
+ class: "sort-button",
216
+ onClick: reset
217
+ }, [
218
+ createVNode(unref(Select), {
219
+ modelValue: filter.value.sort,
220
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => filter.value.sort = $event),
221
+ class: "filter-item",
222
+ placeholder: "\u53D1\u5E03\u65F6\u95F4"
223
+ }, {
224
+ default: withCtx(() => [
225
+ (openBlock(true), createElementBlock(Fragment, null, renderList(sortOptions.value, (item) => {
226
+ return openBlock(), createBlock(unref(Option), {
227
+ key: item.value,
228
+ label: item.label,
229
+ value: item.value
230
+ }, null, 8, ["label", "value"]);
231
+ }), 128))
232
+ ]),
233
+ _: 1
234
+ }, 8, ["modelValue"])
235
+ ])
205
236
  ]);
206
237
  };
207
238
  }
@@ -1,8 +1,9 @@
1
- import { defineComponent, ref, watch, openBlock, createElementBlock, createVNode, unref, withCtx, createElementVNode, normalizeStyle, createTextVNode, toDisplayString } from "vue";
2
- import { Popover, Scrollbar, Tree, Button } from "@arco-design/web-vue";
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
3
  import { IconDragDotVertical, IconCaretRight } from "@arco-design/web-vue/es/icon";
4
4
  import { getCategoryPath } from "../../../script/api.js";
5
5
  const _hoisted_1 = { class: "column-selection-container" };
6
+ const _hoisted_2 = { class: "search-column" };
6
7
  const _sfc_main = defineComponent({
7
8
  ...{ name: "columnTree" },
8
9
  __name: "index",
@@ -14,22 +15,54 @@ const _sfc_main = defineComponent({
14
15
  },
15
16
  emits: ["update:column_id"],
16
17
  setup(__props, { emit: __emit }) {
17
- const emit = __emit;
18
18
  const props = __props;
19
- const selectAlais = ref("");
19
+ const emit = __emit;
20
20
  const treeOptions = {
21
21
  title: "alias",
22
22
  isLeaf: "leaf"
23
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
+ };
24
57
  watch(
25
58
  () => props.column_id,
26
59
  (val) => {
27
- setSelectAlais(val);
60
+ setSelectAlias(val);
28
61
  }
29
62
  );
30
- const setSelectAlais = async (id) => {
63
+ const setSelectAlias = async (id) => {
31
64
  if (id === "all") {
32
- selectAlais.value = "\u5168\u90E8\u5185\u5BB9";
65
+ selectAlias.value = "\u5168\u90E8\u5185\u5BB9";
33
66
  return;
34
67
  }
35
68
  const { code, message } = await getCategoryPath(props.userInfo.BASE_API, {
@@ -41,28 +74,42 @@ const _sfc_main = defineComponent({
41
74
  for (const i of message) {
42
75
  pathArr.push(i.category_alias);
43
76
  }
44
- selectAlais.value = pathArr.join("/");
77
+ selectAlias.value = pathArr.join("/");
45
78
  }
46
79
  };
47
80
  const AddColumnSelected = (selectedKeys, data) => {
81
+ lastSearchKey.value = selectedKeys[0];
82
+ window.localStorage.setItem("lastSearchKey", lastSearchKey.value);
48
83
  emit("update:column_id", data.node.id);
49
84
  };
50
85
  return (_ctx, _cache) => {
51
86
  return openBlock(), createElementBlock("div", _hoisted_1, [
52
87
  createVNode(unref(Popover), {
53
- position: "bottom",
54
- "content-class": "column-selection-popover-content",
55
88
  "content-style": { minWidth: "120px" },
89
+ "content-class": "column-selection-popover-content",
90
+ position: "bottom",
56
91
  trigger: "click"
57
92
  }, {
58
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),
59
106
  createElementVNode("div", {
60
- class: "column-selection-main",
61
- style: normalizeStyle({ minHeight: props.height + "px" })
107
+ style: normalizeStyle({ minHeight: props.height + "px" }),
108
+ class: "column-selection-main"
62
109
  }, [
63
110
  createElementVNode("div", {
64
- class: "column-v",
65
- style: normalizeStyle({ height: props.height + "px" })
111
+ style: normalizeStyle({ height: props.height + "px" }),
112
+ class: "column-v"
66
113
  }, [
67
114
  createVNode(unref(Scrollbar), {
68
115
  "outer-class": "column-outer-scrollbar",
@@ -70,11 +117,13 @@ const _sfc_main = defineComponent({
70
117
  }, {
71
118
  default: withCtx(() => [
72
119
  createVNode(unref(Tree), {
73
- "block-node": "",
74
- data: props.tree,
75
- "check-strictly": "",
120
+ ref_key: "aTreeRef",
121
+ ref: aTreeRef,
122
+ data: treeData.value,
76
123
  "default-expand-all": false,
77
124
  "field-names": treeOptions,
125
+ "block-node": "",
126
+ "check-strictly": "",
78
127
  onSelect: AddColumnSelected
79
128
  }, null, 8, ["data"])
80
129
  ]),
@@ -87,7 +136,7 @@ const _sfc_main = defineComponent({
87
136
  createVNode(unref(Button), { class: "button" }, {
88
137
  default: withCtx(() => [
89
138
  createVNode(unref(IconDragDotVertical)),
90
- createTextVNode(toDisplayString(selectAlais.value), 1),
139
+ createTextVNode(" " + toDisplayString(selectAlias.value) + " ", 1),
91
140
  createVNode(unref(IconCaretRight))
92
141
  ]),
93
142
  _: 1