@cmstops/pro-compo 3.9.1-rc.1 → 3.9.1-rc.11

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 (101) hide show
  1. package/README.md +103 -76
  2. package/dist/index.css +49 -4
  3. package/dist/index.min.css +1 -1
  4. package/es/baseFilter/component.js +71 -14
  5. package/es/config.js +1 -1
  6. package/es/contentDetailList/component.js +24 -0
  7. package/es/contentDetailList/components/Content/index.js +2 -1
  8. package/es/contentDetailList/components/Doc/index.js +6 -0
  9. package/es/docHistory/component.js +41 -12
  10. package/es/docHistory/scripts/diff.js +4 -3
  11. package/es/docHistory/style/index.css +4 -0
  12. package/es/docHistory/style/index.less +5 -0
  13. package/es/hooks/useAttachement.js +2 -9
  14. package/es/hooks/usePopper.d.ts +1 -1
  15. package/es/hooks/usePopper.js +3 -3
  16. package/es/hooks/useUpload.d.ts +50 -2
  17. package/es/hooks/useUpload.js +43 -4
  18. package/es/index.css +49 -4
  19. package/es/index.d.ts +1 -0
  20. package/es/index.js +1 -0
  21. package/es/selectAddTo/component.d.ts +0 -0
  22. package/es/selectAddTo/component.js +125 -0
  23. package/es/selectAddTo/component.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
  24. package/es/selectAddTo/components/ViewAllColumn/MediaFilter/index.d.ts +0 -0
  25. package/es/selectAddTo/components/ViewAllColumn/MediaFilter/index.js +169 -0
  26. package/es/selectAddTo/components/ViewAllColumn/columnTree/index.d.ts +0 -0
  27. package/es/selectAddTo/components/ViewAllColumn/index.d.ts +0 -0
  28. package/es/selectAddTo/components/ViewAllColumn/index.js +209 -0
  29. package/es/selectAddTo/components/ViewAllColumn/index.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
  30. package/es/selectAddTo/components/ViewAllColumn/script/useTableColumns.js +78 -0
  31. package/es/selectAddTo/components/ViewAllColumn/script/useViewAllColumnState.d.ts +144 -0
  32. package/es/selectAddTo/components/ViewAllColumn/script/useViewAllColumnState.js +193 -0
  33. package/es/selectAddTo/components/ViewAllColumn/types/index.d.ts +59 -0
  34. package/es/selectAddTo/index.d.ts +2 -0
  35. package/es/selectAddTo/index.js +7 -0
  36. package/es/selectAddTo/script/api.d.ts +18 -0
  37. package/es/selectAddTo/script/api.js +30 -0
  38. package/es/selectAddTo/script/index.d.ts +2 -0
  39. package/es/selectAddTo/script/useSelectAddToState.d.ts +21 -0
  40. package/es/selectAddTo/script/useSelectAddToState.js +106 -0
  41. package/es/selectAddTo/style/css.js +1 -0
  42. package/es/selectAddTo/style/index.css +3 -0
  43. package/es/selectAddTo/style/index.d.ts +1 -0
  44. package/es/selectAddTo/style/index.js +1 -0
  45. package/es/selectAddTo/style/index.less +3 -0
  46. package/es/selectAddTo/types/index.d.ts +42 -0
  47. package/es/selectResourceModal/__demo__/module/DivWrapper.d.ts +268 -0
  48. package/es/selectResourceModal/__demo__/module/basic.d.ts +299 -0
  49. package/es/selectResourceModal/components/List/ListLocal/index.js +8 -3
  50. package/es/selectResourceModal/components/List/ListNormal/Filter.js +201 -89
  51. package/es/selectResourceModal/components/List/ListNormal/index.js +23 -7
  52. package/es/selectResourceModal/hooks/useResponsiveFilter.d.ts +21 -0
  53. package/es/selectResourceModal/hooks/useResponsiveFilter.js +142 -0
  54. package/es/selectResourceModal/scripts/useCompoLf.js +1 -1
  55. package/es/selectResourceModal/style/index.css +45 -4
  56. package/es/selectResourceModal/style/index.less +14 -0
  57. package/es/selectResourceModal/style/list.less +40 -4
  58. package/es/selectThumb/component.js +16 -27
  59. package/es/style.css +57 -0
  60. package/es/typeIcons/component.js +1 -1
  61. package/es/utils/index.js +6 -6
  62. package/lib/baseFilter/component.js +69 -12
  63. package/lib/config.js +1 -1
  64. package/lib/contentDetailList/component.js +24 -0
  65. package/lib/contentDetailList/components/Content/index.js +2 -1
  66. package/lib/contentDetailList/components/Doc/index.js +6 -0
  67. package/lib/docHistory/component.js +39 -10
  68. package/lib/docHistory/scripts/diff.js +4 -3
  69. package/lib/docHistory/style/index.css +4 -0
  70. package/lib/docHistory/style/index.less +5 -0
  71. package/lib/hooks/useAttachement.js +2 -9
  72. package/lib/hooks/usePopper.js +3 -3
  73. package/lib/hooks/useUpload.js +43 -3
  74. package/lib/index.css +49 -4
  75. package/lib/index.js +2 -0
  76. package/lib/selectAddTo/component.js +126 -0
  77. package/lib/selectAddTo/component.vue_vue_type_style_index_0_scoped_true_lang.js +3 -0
  78. package/lib/selectAddTo/components/ViewAllColumn/MediaFilter/index.js +170 -0
  79. package/lib/selectAddTo/components/ViewAllColumn/index.js +210 -0
  80. package/lib/selectAddTo/components/ViewAllColumn/index.vue_vue_type_style_index_0_scoped_true_lang.js +3 -0
  81. package/lib/selectAddTo/components/ViewAllColumn/script/useTableColumns.js +80 -0
  82. package/lib/selectAddTo/components/ViewAllColumn/script/useViewAllColumnState.js +195 -0
  83. package/lib/selectAddTo/index.js +8 -0
  84. package/lib/selectAddTo/script/api.js +35 -0
  85. package/lib/selectAddTo/script/useSelectAddToState.js +108 -0
  86. package/lib/selectAddTo/style/css.js +2 -0
  87. package/lib/selectAddTo/style/index.css +3 -0
  88. package/lib/selectAddTo/style/index.js +2 -0
  89. package/lib/selectAddTo/style/index.less +3 -0
  90. package/lib/selectResourceModal/components/List/ListLocal/index.js +6 -1
  91. package/lib/selectResourceModal/components/List/ListNormal/Filter.js +198 -86
  92. package/lib/selectResourceModal/components/List/ListNormal/index.js +22 -6
  93. package/lib/selectResourceModal/hooks/useResponsiveFilter.js +144 -0
  94. package/lib/selectResourceModal/scripts/useCompoLf.js +1 -1
  95. package/lib/selectResourceModal/style/index.css +45 -4
  96. package/lib/selectResourceModal/style/index.less +14 -0
  97. package/lib/selectResourceModal/style/list.less +40 -4
  98. package/lib/selectThumb/component.js +16 -27
  99. package/lib/typeIcons/component.js +1 -1
  100. package/lib/utils/index.js +6 -6
  101. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- import { defineComponent, ref, computed, watch, nextTick, toRaw, openBlock, createElementBlock, Fragment, createElementVNode, withModifiers, createVNode, withCtx, renderList, createBlock, unref, normalizeStyle, createCommentVNode, renderSlot } from "vue";
2
- import { InputSearch, Select, Option, RangePicker } from "@arco-design/web-vue";
1
+ import { defineComponent, ref, computed, watch, nextTick, toRaw, openBlock, createElementBlock, Fragment, createElementVNode, withModifiers, createVNode, withCtx, renderList, createBlock, renderSlot, unref, createTextVNode, toDisplayString, normalizeStyle, createCommentVNode } from "vue";
2
+ import { InputGroup, Select, Option, Input, InputSearch, RangePicker, RadioGroup, Radio } from "@arco-design/web-vue";
3
3
  import _sfc_main$2 from "./components/filterItem.js";
4
4
  import _sfc_main$1 from "./components/FilterGroup.js";
5
5
  const _sfc_main = defineComponent({
@@ -37,9 +37,11 @@ const _sfc_main = defineComponent({
37
37
  });
38
38
  return _columns;
39
39
  });
40
- const getOptions = (item) => {
41
- return item.options ? item.options : [];
42
- };
40
+ const getOptions = computed(() => {
41
+ return (item) => {
42
+ return item.options ? item.options : [];
43
+ };
44
+ });
43
45
  const hasValue = computed(() => {
44
46
  return (key) => {
45
47
  var _a, _b;
@@ -76,7 +78,10 @@ const _sfc_main = defineComponent({
76
78
  _form[column.range] = rangeTemp[column.range];
77
79
  } else if (column.component === "select") {
78
80
  _form[column.key] = column.defaultValue || null;
79
- } else {
81
+ } else if (column.component === "input-group") {
82
+ _form[column.selectKey] = column.selectDefaultValue || "";
83
+ _form[column.inputKey] = column.inputDefaultValue || "";
84
+ } else if (column.component) {
80
85
  _form[column.key] = column.defaultValue || "";
81
86
  }
82
87
  });
@@ -178,17 +183,48 @@ const _sfc_main = defineComponent({
178
183
  active: hasValue.value(item.key)
179
184
  }, {
180
185
  default: withCtx(() => [
181
- item.component === "input" ? (openBlock(), createBlock(unref(InputSearch), {
182
- key: 0,
186
+ item.slot ? renderSlot(_ctx.$slots, item.slot, { key: 0 }) : item.component === "input-group" ? (openBlock(), createBlock(unref(InputGroup), { key: 1 }, {
187
+ default: withCtx(() => [
188
+ createVNode(unref(Select), {
189
+ modelValue: form.value[item.selectKey],
190
+ "onUpdate:modelValue": ($event) => form.value[item.selectKey] = $event,
191
+ "default-active-first-option": "",
192
+ style: { "width": "100px" }
193
+ }, {
194
+ default: withCtx(() => [
195
+ (openBlock(true), createElementBlock(Fragment, null, renderList(item.selectOptions, (option, idx) => {
196
+ return openBlock(), createBlock(unref(Option), {
197
+ key: idx,
198
+ value: option.value
199
+ }, {
200
+ default: withCtx(() => [
201
+ createTextVNode(toDisplayString(option.label), 1)
202
+ ]),
203
+ _: 2
204
+ }, 1032, ["value"]);
205
+ }), 128))
206
+ ]),
207
+ _: 2
208
+ }, 1032, ["modelValue", "onUpdate:modelValue"]),
209
+ createVNode(unref(Input), {
210
+ modelValue: form.value[item.inputKey],
211
+ "onUpdate:modelValue": ($event) => form.value[item.inputKey] = $event,
212
+ placeholder: item.placeholder ? item.placeholder : `\u8BF7\u8F93\u5165${item.inputLabel}`,
213
+ style: { "width": "180px" }
214
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
215
+ ]),
216
+ _: 2
217
+ }, 1024)) : item.component === "input" ? (openBlock(), createBlock(unref(InputSearch), {
218
+ key: 2,
183
219
  modelValue: form.value[item.key],
184
220
  "onUpdate:modelValue": ($event) => form.value[item.key] = $event,
185
221
  style: normalizeStyle({ width: styleWidth(columnsMap.value[item.key]) }),
186
222
  "allow-clear": "",
187
223
  size: "medium",
188
- placeholder: `\u8BF7\u8F93\u5165${item.label}`
224
+ placeholder: item.placeholder ? item.placeholder : `\u8BF7\u8F93\u5165${item.label}`
189
225
  }, null, 8, ["modelValue", "onUpdate:modelValue", "style", "placeholder"])) : createCommentVNode("v-if", true),
190
226
  item.component === "select" ? (openBlock(), createBlock(unref(Select), {
191
- key: 1,
227
+ key: 3,
192
228
  modelValue: form.value[item.key],
193
229
  "onUpdate:modelValue": ($event) => form.value[item.key] = $event,
194
230
  "popup-container": "#base-filter-popup-container",
@@ -196,13 +232,13 @@ const _sfc_main = defineComponent({
196
232
  "allow-search": item.allowSearch,
197
233
  "default-active-first-option": false,
198
234
  style: normalizeStyle({ width: styleWidth(columnsMap.value[item.key]) }),
199
- placeholder: `\u8BF7\u9009\u62E9${item.label}`,
235
+ placeholder: item.placeholder ? item.placeholder : `\u8BF7\u9009\u62E9${item.label}`,
200
236
  onSearch: ($event) => handleSelectSearch($event, item),
201
237
  onPopupVisibleChange: ($event) => handleSelectPopupChange($event, item),
202
238
  onChange: ($event) => handleSelectChange($event, item)
203
239
  }, {
204
240
  default: withCtx(() => [
205
- (openBlock(true), createElementBlock(Fragment, null, renderList(getOptions(item), (opt) => {
241
+ (openBlock(true), createElementBlock(Fragment, null, renderList(getOptions.value(item), (opt) => {
206
242
  return openBlock(), createBlock(unref(Option), {
207
243
  key: opt.value,
208
244
  label: opt.label,
@@ -213,7 +249,7 @@ const _sfc_main = defineComponent({
213
249
  _: 2
214
250
  }, 1032, ["modelValue", "onUpdate:modelValue", "allow-search", "style", "placeholder", "onSearch", "onPopupVisibleChange", "onChange"])) : createCommentVNode("v-if", true),
215
251
  item.component === "range-picker" ? (openBlock(), createBlock(unref(RangePicker), {
216
- key: 2,
252
+ key: 4,
217
253
  modelValue: form.value[item.key].range,
218
254
  "onUpdate:modelValue": ($event) => form.value[item.key].range = $event,
219
255
  style: normalizeStyle({ width: styleWidth(form.value[item.key]) }),
@@ -224,7 +260,28 @@ const _sfc_main = defineComponent({
224
260
  "popup-container": "#base-filter-popup-container",
225
261
  onClick: _cache[1] || (_cache[1] = withModifiers(() => {
226
262
  }, ["stop"]))
227
- }, null, 8, ["modelValue", "onUpdate:modelValue", "style"])) : createCommentVNode("v-if", true)
263
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "style"])) : createCommentVNode("v-if", true),
264
+ item.component === "radio" ? (openBlock(), createBlock(unref(RadioGroup), {
265
+ key: 5,
266
+ modelValue: form.value[item.key],
267
+ "onUpdate:modelValue": ($event) => form.value[item.key] = $event,
268
+ type: "button"
269
+ }, {
270
+ default: withCtx(() => [
271
+ (openBlock(true), createElementBlock(Fragment, null, renderList(item.options || [], (option, idx) => {
272
+ return openBlock(), createBlock(unref(Radio), {
273
+ key: idx,
274
+ value: option.value
275
+ }, {
276
+ default: withCtx(() => [
277
+ createTextVNode(toDisplayString(option.label), 1)
278
+ ]),
279
+ _: 2
280
+ }, 1032, ["value"]);
281
+ }), 128))
282
+ ]),
283
+ _: 2
284
+ }, 1032, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("v-if", true)
228
285
  ]),
229
286
  _: 2
230
287
  }, 1032, ["active"]);
package/es/config.js CHANGED
@@ -1,5 +1,5 @@
1
1
  var _a, _b, _c, _d, _e, _f, _g, _h;
2
- const DEFAULT_BASE_API = ((_b = (_a = window.situoyun) == null ? void 0 : _a.env) == null ? void 0 : _b.BASE_HOST) || "https://site.cmstop.xyz";
2
+ const DEFAULT_BASE_API = ((_b = (_a = window.situoyun) == null ? void 0 : _a.env) == null ? void 0 : _b.BASE_HOST) || "https://site.r.cmstop.xyz";
3
3
  const DEFAULT_BASE_ACCOUNT_HOST = ((_d = (_c = window.situoyun) == null ? void 0 : _c.env) == null ? void 0 : _d.BASE_ACCOUNT_HOST) || "https://account.cmstop.xyz";
4
4
  const DEFAULT_UPLOAD_CHUNK_SIZE = ((_f = (_e = window.situoyun) == null ? void 0 : _e.env) == null ? void 0 : _f.UPLOAD_CHUNK_SIZE) || 5242880;
5
5
  const DEFAULT_UPLOAD_URL = ((_h = (_g = window.situoyun) == null ? void 0 : _g.env) == null ? void 0 : _h.BASE_STATIC_FILE_API) || "https://oss.cmstop.xyz/maple/v1";
@@ -104,6 +104,12 @@ const _sfc_main = defineComponent({
104
104
  onCellMouseEnter: tableCellMouseEnter,
105
105
  onCellMouseLeave: tableCellMouseLeave
106
106
  }, {
107
+ "after-index": withCtx(() => [
108
+ renderSlot(_ctx.$slots, "after-index", {
109
+ row: element,
110
+ index
111
+ })
112
+ ]),
107
113
  batch: withCtx(() => [
108
114
  renderSlot(_ctx.$slots, "batch", {
109
115
  row: element,
@@ -128,6 +134,12 @@ const _sfc_main = defineComponent({
128
134
  onCellMouseEnter: tableCellMouseEnter,
129
135
  onCellMouseLeave: tableCellMouseLeave
130
136
  }, {
137
+ "after-index": withCtx(() => [
138
+ renderSlot(_ctx.$slots, "after-index", {
139
+ row: element,
140
+ index
141
+ })
142
+ ]),
131
143
  tip: withCtx(() => [
132
144
  renderSlot(_ctx.$slots, "tip", {
133
145
  row: element,
@@ -224,6 +236,12 @@ const _sfc_main = defineComponent({
224
236
  onCellMouseEnter: tableCellMouseEnter,
225
237
  onCellMouseLeave: tableCellMouseLeave
226
238
  }, {
239
+ "after-index": withCtx(() => [
240
+ renderSlot(_ctx.$slots, "after-index", {
241
+ row: item,
242
+ index
243
+ })
244
+ ]),
227
245
  batch: withCtx(() => [
228
246
  renderSlot(_ctx.$slots, "batch", {
229
247
  row: item,
@@ -248,6 +266,12 @@ const _sfc_main = defineComponent({
248
266
  onCellMouseEnter: tableCellMouseEnter,
249
267
  onCellMouseLeave: tableCellMouseLeave
250
268
  }, {
269
+ "after-index": withCtx(() => [
270
+ renderSlot(_ctx.$slots, "after-index", {
271
+ row: item,
272
+ index
273
+ })
274
+ ]),
251
275
  tip: withCtx(() => [
252
276
  renderSlot(_ctx.$slots, "tip", {
253
277
  row: item,
@@ -142,7 +142,8 @@ const _sfc_main = defineComponent({
142
142
  })
143
143
  ]),
144
144
  index: withCtx(() => [
145
- createElementVNode("span", _hoisted_1, toDisplayString(_ctx.index + 1), 1)
145
+ createElementVNode("span", _hoisted_1, toDisplayString(_ctx.index + 1), 1),
146
+ renderSlot(_ctx.$slots, "after-index")
146
147
  ]),
147
148
  tip: withCtx(() => [
148
149
  createCommentVNode(" \u5148\u6DFB\u52A0\u6587\u4EF6\u8D44\u6E90\uFF0C\u672A\u53D1\u5E03 "),
@@ -37,6 +37,12 @@ const _sfc_main = defineComponent({
37
37
  index: _ctx.index
38
38
  })
39
39
  ]),
40
+ "after-index": withCtx(() => [
41
+ renderSlot(_ctx.$slots, "after-index", {
42
+ row: _ctx.element,
43
+ index: _ctx.index
44
+ })
45
+ ]),
40
46
  batch: withCtx(() => [
41
47
  renderSlot(_ctx.$slots, "batch", {
42
48
  row: _ctx.item,
@@ -1,5 +1,5 @@
1
- import { defineComponent, computed, watch, onMounted, openBlock, createBlock, unref, withCtx, createVNode, createTextVNode, createElementVNode, createElementBlock, Fragment, createCommentVNode } from "vue";
2
- import { Drawer, Button, Spin, Scrollbar } from "@arco-design/web-vue";
1
+ import { defineComponent, computed, watch, onMounted, openBlock, createBlock, resolveDynamicComponent, mergeProps, withCtx, createVNode, unref, createTextVNode, createElementVNode, createElementBlock, Fragment, createCommentVNode } from "vue";
2
+ import { Button, Spin, Scrollbar, Drawer, Modal } from "@arco-design/web-vue";
3
3
  import { DEFAULT_BASE_API } from "../config.js";
4
4
  import { useDocHistory } from "./scripts/useDocHistory.js";
5
5
  import _sfc_main$2 from "./components/DocHistoryList/index.js";
@@ -13,9 +13,11 @@ const _sfc_main = defineComponent({
13
13
  __name: "component",
14
14
  props: {
15
15
  BASE_API: {},
16
+ wrap: { default: "drawer" },
16
17
  visible: { type: Boolean },
17
18
  docInfo: {},
18
- pub: { type: Boolean }
19
+ pub: { type: Boolean },
20
+ currentIdx: {}
19
21
  },
20
22
  emits: ["update:visible", "select"],
21
23
  setup(__props, { emit: __emit }) {
@@ -27,6 +29,20 @@ const _sfc_main = defineComponent({
27
29
  emits("update:visible", val);
28
30
  }
29
31
  });
32
+ const wrapProps = computed(() => {
33
+ if (props.wrap === "drawer") {
34
+ return {
35
+ class: "doc-history-drawer-wrap",
36
+ title: "\u7248\u672C\u8BB0\u5F55",
37
+ width: 1e3
38
+ };
39
+ }
40
+ return {
41
+ bodyClass: "doc-history-modal-wrap",
42
+ title: "\u7248\u672C\u8BB0\u5F55",
43
+ width: 1e3
44
+ };
45
+ });
30
46
  const BASE_API = props.BASE_API || DEFAULT_BASE_API;
31
47
  const {
32
48
  initParams,
@@ -37,6 +53,10 @@ const _sfc_main = defineComponent({
37
53
  list,
38
54
  current
39
55
  } = useDocHistory(BASE_API);
56
+ const wrapComponent = {
57
+ drawer: Drawer,
58
+ modal: Modal
59
+ };
40
60
  function handeRevert() {
41
61
  emits("select", list.value[current.value]);
42
62
  }
@@ -49,20 +69,29 @@ const _sfc_main = defineComponent({
49
69
  },
50
70
  { immediate: true }
51
71
  );
52
- onMounted(() => {
72
+ watch(
73
+ () => props.currentIdx,
74
+ (val) => {
75
+ if (val) {
76
+ handleSelect(val);
77
+ }
78
+ },
79
+ { immediate: true }
80
+ );
81
+ onMounted(async () => {
53
82
  if (!props.docInfo)
54
83
  return;
55
84
  initParams(props.docInfo.id, props.pub);
56
- loadData();
85
+ await loadData();
86
+ if (props.currentIdx) {
87
+ handleSelect(props.currentIdx);
88
+ }
57
89
  });
58
90
  return (_ctx, _cache) => {
59
- return openBlock(), createBlock(unref(Drawer), {
91
+ return openBlock(), createBlock(resolveDynamicComponent(wrapComponent[_ctx.wrap]), mergeProps({
60
92
  visible: vis.value,
61
- "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => vis.value = $event),
62
- class: "doc-history-drawer",
63
- title: "\u7248\u672C\u8BB0\u5F55",
64
- width: 1e3
65
- }, {
93
+ "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => vis.value = $event)
94
+ }, wrapProps.value), {
66
95
  footer: withCtx(() => [
67
96
  createVNode(unref(Button), {
68
97
  type: "primary",
@@ -123,7 +152,7 @@ const _sfc_main = defineComponent({
123
152
  ])
124
153
  ]),
125
154
  _: 1
126
- }, 8, ["visible"]);
155
+ }, 16, ["visible"]);
127
156
  };
128
157
  }
129
158
  });
@@ -38,15 +38,16 @@ function CompareText(v_LeftList, v_RightList, lftPNode = null) {
38
38
  for (let i = 0; i < rightLen; i++) {
39
39
  if (!rightFather)
40
40
  rightFather = v_RightList[i].parentNode;
41
- const node = v_RightList[i].clone(true);
41
+ const node = v_RightList[i].cloneNode(true);
42
42
  try {
43
43
  rightFather.removeChild(v_RightList[i]);
44
44
  } catch (e) {
45
45
  console.log(e);
46
46
  }
47
- if (lftPNode)
47
+ if (lftPNode && lftPNode.nodeType !== 3) {
48
48
  lftPNode.appendChild(node);
49
- PaintRemove(node);
49
+ PaintRemove(node);
50
+ }
50
51
  }
51
52
  } else if (rightLen === 0) {
52
53
  for (let i = 0; i < leftLen; i++)
@@ -105,3 +105,7 @@
105
105
  .doc-history-drawer .arco-drawer-footer {
106
106
  text-align: left;
107
107
  }
108
+ .doc-history-modal-wrap {
109
+ height: 70vh;
110
+ padding: 0;
111
+ }
@@ -30,3 +30,8 @@
30
30
  text-align: left;
31
31
  }
32
32
  }
33
+
34
+ .doc-history-modal-wrap {
35
+ height: 70vh;
36
+ padding: 0;
37
+ }
@@ -110,7 +110,7 @@ function getSysRsPage(BASE_API, params) {
110
110
  }
111
111
  function getDirectory(BASE_API, params) {
112
112
  return request(BASE_API, {
113
- url: "/poplar/v3/directories",
113
+ url: "/poplar/v3/directory/tree",
114
114
  method: "get",
115
115
  params
116
116
  });
@@ -123,14 +123,7 @@ function useDirectory(options) {
123
123
  if (code === 0) {
124
124
  if (!Array.isArray(message.data))
125
125
  return [];
126
- return message.data.map(({ alias, id }) => {
127
- return {
128
- title: alias,
129
- key: id,
130
- isLeaf: false,
131
- children: []
132
- };
133
- });
126
+ return message.data;
134
127
  }
135
128
  return [];
136
129
  }
@@ -1,7 +1,7 @@
1
1
  import { Placement } from '@popperjs/core';
2
2
  import { Ref } from 'vue';
3
3
  export default function usePopper(pannel: Ref<HTMLElement | undefined>, triggerEl: Ref<HTMLElement | undefined>): {
4
- initPopper: (placement?: Placement) => void;
4
+ initPopper: (placement?: Placement, of?: number[] | undefined) => void;
5
5
  show: () => void;
6
6
  hide: () => void;
7
7
  visible: Ref<boolean, boolean>;
@@ -8,16 +8,16 @@ function usePopper(pannel, triggerEl) {
8
8
  };
9
9
  const show = () => {
10
10
  visible.value = true;
11
- window.onclick = (e) => {
11
+ window.onclick = () => {
12
12
  hide();
13
13
  visible.value = false;
14
14
  window.onclick = null;
15
15
  };
16
16
  };
17
- const initPopper = (placement = "bottom-start") => {
17
+ const initPopper = (placement = "bottom-start", of) => {
18
18
  if (!pannel.value || !triggerEl.value)
19
19
  return;
20
- const offset = [0, 10];
20
+ const offset = of != null ? of : [0, 10];
21
21
  if (window.__POWERED_BY_WUJIE__) {
22
22
  offset[1] = -54;
23
23
  }
@@ -7,24 +7,72 @@ export declare type TypeAddMediaParam = {
7
7
  directory_id: number;
8
8
  size: number;
9
9
  };
10
+ declare type WaterMark = {
11
+ id: string;
12
+ position: string;
13
+ url: string;
14
+ title: string;
15
+ };
16
+ declare type UploadTemplate = {
17
+ watermark?: {
18
+ default?: WaterMark;
19
+ images: WaterMark[];
20
+ };
21
+ };
10
22
  export declare function getSize(value: number): string;
11
23
  export declare function addMedia(BASE_API: string, params: TypeAddMediaParam): Promise<import("axios").AxiosResponse<any, any>>;
12
24
  export declare function getMediaDetails(BASE_API: string, repoId: number, id: number): Promise<import("axios").AxiosResponse<any, any>>;
13
25
  export declare function reTranscodeMedia(BASE_API: string, media_id: number): Promise<import("axios").AxiosResponse<any, any>>;
14
26
  declare type UploadOptions = {
15
- noAddMedia: boolean;
27
+ noAddMedia?: boolean;
28
+ };
29
+ declare type UploadFileOptions = {
30
+ template?: UploadTemplate;
16
31
  };
17
32
  export default function useUpload(options?: UploadOptions): {
18
33
  list: import("vue").Ref<any[], any[]>;
19
- uploadFile: (BASE_API: string, file: any, dir: number | undefined, repoId: number, callback?: CallbackFunc | undefined) => void;
34
+ uploadFile: (BASE_API: string, file: any, dir: number | undefined, repoId: number, callback?: CallbackFunc | undefined, upOptions?: UploadFileOptions | undefined) => void;
20
35
  reTranscode: (BASE_API: string, file: any) => Promise<boolean>;
21
36
  transcodingFile: (BASE_API: string, file: any, repoId: number) => void;
22
37
  recordTaskStatusChange: (file: any, progress: number, isTrans?: boolean | undefined) => void;
23
38
  removeRecord: (file: any) => void;
24
39
  };
40
+ export declare function getWatermarkTemplate(BASE_API: string): Promise<import("axios").AxiosResponse<any, any>>;
25
41
  export declare function useUploadConfig(): {
26
42
  config: import("vue").Ref<any, any>;
43
+ template: import("vue").Ref<{
44
+ watermark?: {
45
+ default?: {
46
+ id: string;
47
+ position: string;
48
+ url: string;
49
+ title: string;
50
+ } | undefined;
51
+ images: {
52
+ id: string;
53
+ position: string;
54
+ url: string;
55
+ title: string;
56
+ }[];
57
+ } | undefined;
58
+ }, UploadTemplate | {
59
+ watermark?: {
60
+ default?: {
61
+ id: string;
62
+ position: string;
63
+ url: string;
64
+ title: string;
65
+ } | undefined;
66
+ images: {
67
+ id: string;
68
+ position: string;
69
+ url: string;
70
+ title: string;
71
+ }[];
72
+ } | undefined;
73
+ }>;
27
74
  checkFileSizeOutLimit: (file: File, callback: (msg: string) => void) => boolean;
28
75
  initUploadConfig: (BASE_API: string, domainId: number) => Promise<void>;
76
+ initTemplate: (BASE_API: string) => Promise<void>;
29
77
  };
30
78
  export {};
@@ -73,7 +73,7 @@ function useUpload(options) {
73
73
  list.value = originList;
74
74
  }
75
75
  };
76
- const uploadFile = (BASE_API, file, dir = 0, repoId, callback) => {
76
+ const uploadFile = (BASE_API, file, dir = 0, repoId, callback, upOptions) => {
77
77
  const newFile = {
78
78
  id: file.id || generateUUID(),
79
79
  sig_id: file.sig_id || generateUUID(),
@@ -93,18 +93,24 @@ function useUpload(options) {
93
93
  };
94
94
  const uploading = upload.start(progress);
95
95
  uploading.then(async (url) => {
96
+ var _a;
96
97
  if (options == null ? void 0 : options.noAddMedia) {
97
98
  recordTaskStatusChange({ ...newFile, status: 0, url }, 1);
98
99
  callback && callback({ ...newFile, url }, "success");
99
100
  return;
100
101
  }
102
+ const params = {};
103
+ if ((_a = upOptions == null ? void 0 : upOptions.template) == null ? void 0 : _a.watermark) {
104
+ params.watermark = upOptions.template.watermark.default;
105
+ }
101
106
  const { code, message } = await addMedia(BASE_API, {
102
107
  url,
103
108
  size: newFile.size,
104
109
  directory_id: dir,
105
110
  repository_id: repoId,
106
111
  catalog: newFile.type,
107
- alias: newFile.name
112
+ alias: newFile.name,
113
+ ...params
108
114
  });
109
115
  if (code !== 0) {
110
116
  console.log("\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525} \u4E0A\u4F20\u5931\u8D25\uFF1A", newFile.name, code, message);
@@ -194,9 +200,16 @@ function getConfiguration(BASE_API, params) {
194
200
  params
195
201
  });
196
202
  }
203
+ function getWatermarkTemplate(BASE_API) {
204
+ return request(BASE_API, {
205
+ url: `/poplar/v2/material/image/watermark`,
206
+ method: "get"
207
+ });
208
+ }
197
209
  function useUploadConfig() {
198
210
  const { get, set, remove } = useLocalstorage("LOCAL_UPLOAD_CONFIG");
199
211
  const config = ref(get() || {});
212
+ const template = ref({});
200
213
  async function initUploadConfig(BASE_API, domainId) {
201
214
  if (config.value.size_config_enabled != null)
202
215
  return;
@@ -245,11 +258,37 @@ function useUploadConfig() {
245
258
  );
246
259
  return false;
247
260
  }
261
+ async function initTemplate(BASE_API) {
262
+ try {
263
+ const { code, message } = await getWatermarkTemplate(BASE_API);
264
+ if (code !== 0)
265
+ return;
266
+ if (message) {
267
+ let defaultWaterMark;
268
+ if (Array.isArray(message.images)) {
269
+ message.images.forEach((item) => {
270
+ if (message.default === item.id)
271
+ defaultWaterMark = item;
272
+ });
273
+ }
274
+ template.value = {
275
+ watermark: {
276
+ default: defaultWaterMark,
277
+ images: message.images
278
+ }
279
+ };
280
+ }
281
+ } catch (e) {
282
+ console.error(e);
283
+ }
284
+ }
248
285
  window.addEventListener("beforeunload", remove, false);
249
286
  return {
250
287
  config,
288
+ template,
251
289
  checkFileSizeOutLimit,
252
- initUploadConfig
290
+ initUploadConfig,
291
+ initTemplate
253
292
  };
254
293
  }
255
- export { addMedia, useUpload as default, getMediaDetails, getSize, reTranscodeMedia, useUploadConfig };
294
+ export { addMedia, useUpload as default, getMediaDetails, getSize, getWatermarkTemplate, reTranscodeMedia, useUploadConfig };