@cmstops/pro-compo 0.3.38 → 0.3.40

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 (50) hide show
  1. package/dist/index.css +81 -0
  2. package/dist/index.min.css +1 -1
  3. package/es/docHistory/component.d.ts +0 -0
  4. package/es/docHistory/component.js +100 -0
  5. package/es/docHistory/components/DocDiffPanel/index.d.ts +0 -0
  6. package/es/docHistory/components/DocDiffPanel/index.js +22 -0
  7. package/es/docHistory/components/DocHistoryList/index.d.ts +0 -0
  8. package/es/docHistory/components/DocHistoryList/index.js +37 -0
  9. package/es/docHistory/index.d.ts +2 -0
  10. package/es/docHistory/index.js +7 -0
  11. package/es/docHistory/scripts/diff.d.ts +1 -0
  12. package/es/docHistory/scripts/diff.js +293 -0
  13. package/es/docHistory/scripts/useDocHistory.d.ts +10 -0
  14. package/es/docHistory/scripts/useDocHistory.js +71 -0
  15. package/es/docHistory/style/css.js +1 -0
  16. package/es/docHistory/style/docDiffPanel.less +9 -0
  17. package/es/docHistory/style/docHistoryList.less +58 -0
  18. package/es/docHistory/style/index.css +74 -0
  19. package/es/docHistory/style/index.d.ts +1 -0
  20. package/es/docHistory/style/index.js +1 -0
  21. package/es/docHistory/style/index.less +28 -0
  22. package/es/index.css +81 -0
  23. package/es/index.d.ts +1 -0
  24. package/es/index.js +1 -0
  25. package/es/index.less +1 -0
  26. package/es/selectResourceModal/component.js +52 -204
  27. package/es/selectResourceModal/components/Main/index.d.ts +0 -0
  28. package/es/selectResourceModal/components/Main/index.js +215 -0
  29. package/es/selectResourceModal/style/index.css +7 -0
  30. package/es/selectResourceModal/style/index.less +9 -0
  31. package/lib/docHistory/component.js +101 -0
  32. package/lib/docHistory/components/DocDiffPanel/index.js +23 -0
  33. package/lib/docHistory/components/DocHistoryList/index.js +38 -0
  34. package/lib/docHistory/index.js +8 -0
  35. package/lib/docHistory/scripts/diff.js +295 -0
  36. package/lib/docHistory/scripts/useDocHistory.js +74 -0
  37. package/lib/docHistory/style/css.js +2 -0
  38. package/lib/docHistory/style/docDiffPanel.less +9 -0
  39. package/lib/docHistory/style/docHistoryList.less +58 -0
  40. package/lib/docHistory/style/index.css +74 -0
  41. package/lib/docHistory/style/index.js +2 -0
  42. package/lib/docHistory/style/index.less +28 -0
  43. package/lib/index.css +81 -0
  44. package/lib/index.js +2 -0
  45. package/lib/index.less +1 -0
  46. package/lib/selectResourceModal/component.js +50 -202
  47. package/lib/selectResourceModal/components/Main/index.js +216 -0
  48. package/lib/selectResourceModal/style/index.css +7 -0
  49. package/lib/selectResourceModal/style/index.less +9 -0
  50. package/package.json +7 -5
@@ -0,0 +1,74 @@
1
+ .doc-diff-panel-wrap {
2
+ padding: 24px;
3
+ }
4
+ .doc-diff-panel-wrap .doc-title {
5
+ color: var(--color-text-1);
6
+ font-weight: bold;
7
+ font-size: 24px;
8
+ }
9
+ .doc-history-list-wrap {
10
+ box-sizing: border-box;
11
+ border-left: 1px solid var(--color-border-1);
12
+ }
13
+ .doc-history-list-wrap .doc-history-item {
14
+ display: flex;
15
+ flex-direction: column;
16
+ gap: 5px;
17
+ box-sizing: border-box;
18
+ width: 260px;
19
+ padding: 20px 16px;
20
+ border-bottom: 1px solid var(--color-border-1);
21
+ border-left: 3px solid transparent;
22
+ cursor: pointer;
23
+ }
24
+ .doc-history-list-wrap .doc-history-item .update-time {
25
+ color: var(--color-text-1);
26
+ font-size: 14px;
27
+ }
28
+ .doc-history-list-wrap .doc-history-item .tips {
29
+ color: var(--color-text-2);
30
+ font-size: 12px;
31
+ }
32
+ .doc-history-list-wrap .doc-history-item .doc-author {
33
+ display: flex;
34
+ gap: 8px;
35
+ align-items: center;
36
+ color: var(--color-text-1);
37
+ font-size: 14px;
38
+ }
39
+ .doc-history-list-wrap .doc-history-item .doc-author::before {
40
+ width: 5px;
41
+ height: 5px;
42
+ background-color: rgb(var(--primary-6));
43
+ border-radius: 50%;
44
+ content: ' ';
45
+ }
46
+ .doc-history-list-wrap .doc-history-item.active {
47
+ background-color: rgba(var(--primary-6), 0.1);
48
+ border-left-color: rgb(var(--primary-6));
49
+ }
50
+ .doc-history-list-wrap .doc-history-item.active .update-time {
51
+ color: rgb(var(--primary-6));
52
+ }
53
+ .doc-history-list-wrap .doc-history-item:hover {
54
+ background-color: var(--color-fill-1);
55
+ }
56
+ .doc-history-wrap {
57
+ display: flex;
58
+ width: 100%;
59
+ height: 100%;
60
+ overflow: hidden;
61
+ }
62
+ .doc-history-wrap .doc-diff-panel {
63
+ flex: 1;
64
+ height: 100%;
65
+ }
66
+ .doc-history-wrap .doc-diff-panel .doc-diff-panel-wrap {
67
+ padding: 24px;
68
+ }
69
+ .doc-history-wrap .doc-history-list {
70
+ height: 100%;
71
+ }
72
+ .doc-history-drawer .arco-drawer-body {
73
+ padding: 0;
74
+ }
@@ -0,0 +1 @@
1
+ import './index.less';
@@ -0,0 +1 @@
1
+ import "./index.less";
@@ -0,0 +1,28 @@
1
+ @import './docDiffPanel.less';
2
+ @import './docHistoryList.less';
3
+
4
+ .doc-history-wrap {
5
+ display: flex;
6
+ width: 100%;
7
+ height: 100%;
8
+ overflow: hidden;
9
+
10
+ .doc-diff-panel {
11
+ flex: 1;
12
+ height: 100%;
13
+
14
+ .doc-diff-panel-wrap {
15
+ padding: 24px;
16
+ }
17
+ }
18
+
19
+ .doc-history-list {
20
+ height: 100%;
21
+ }
22
+ }
23
+
24
+ .doc-history-drawer {
25
+ .arco-drawer-body {
26
+ padding: 0;
27
+ }
28
+ }
package/es/index.css CHANGED
@@ -4484,6 +4484,13 @@
4484
4484
  background-color: #165dff;
4485
4485
  border-color: #165dff;
4486
4486
  }
4487
+ .resource-select-modal-body {
4488
+ height: 70vh;
4489
+ padding: 0;
4490
+ }
4491
+ .resource-select-main {
4492
+ height: 100%;
4493
+ }
4487
4494
  .resource-select-drawer .arco-drawer-body {
4488
4495
  box-sizing: border-box;
4489
4496
  padding: 0;
@@ -4665,3 +4672,77 @@
4665
4672
  font-size: 20px;
4666
4673
  cursor: pointer;
4667
4674
  }
4675
+ .doc-diff-panel-wrap {
4676
+ padding: 24px;
4677
+ }
4678
+ .doc-diff-panel-wrap .doc-title {
4679
+ color: var(--color-text-1);
4680
+ font-weight: bold;
4681
+ font-size: 24px;
4682
+ }
4683
+ .doc-history-list-wrap {
4684
+ box-sizing: border-box;
4685
+ border-left: 1px solid var(--color-border-1);
4686
+ }
4687
+ .doc-history-list-wrap .doc-history-item {
4688
+ display: flex;
4689
+ flex-direction: column;
4690
+ gap: 5px;
4691
+ box-sizing: border-box;
4692
+ width: 260px;
4693
+ padding: 20px 16px;
4694
+ border-bottom: 1px solid var(--color-border-1);
4695
+ border-left: 3px solid transparent;
4696
+ cursor: pointer;
4697
+ }
4698
+ .doc-history-list-wrap .doc-history-item .update-time {
4699
+ color: var(--color-text-1);
4700
+ font-size: 14px;
4701
+ }
4702
+ .doc-history-list-wrap .doc-history-item .tips {
4703
+ color: var(--color-text-2);
4704
+ font-size: 12px;
4705
+ }
4706
+ .doc-history-list-wrap .doc-history-item .doc-author {
4707
+ display: flex;
4708
+ gap: 8px;
4709
+ align-items: center;
4710
+ color: var(--color-text-1);
4711
+ font-size: 14px;
4712
+ }
4713
+ .doc-history-list-wrap .doc-history-item .doc-author::before {
4714
+ width: 5px;
4715
+ height: 5px;
4716
+ background-color: rgb(var(--primary-6));
4717
+ border-radius: 50%;
4718
+ content: ' ';
4719
+ }
4720
+ .doc-history-list-wrap .doc-history-item.active {
4721
+ background-color: rgba(var(--primary-6), 0.1);
4722
+ border-left-color: rgb(var(--primary-6));
4723
+ }
4724
+ .doc-history-list-wrap .doc-history-item.active .update-time {
4725
+ color: rgb(var(--primary-6));
4726
+ }
4727
+ .doc-history-list-wrap .doc-history-item:hover {
4728
+ background-color: var(--color-fill-1);
4729
+ }
4730
+ .doc-history-wrap {
4731
+ display: flex;
4732
+ width: 100%;
4733
+ height: 100%;
4734
+ overflow: hidden;
4735
+ }
4736
+ .doc-history-wrap .doc-diff-panel {
4737
+ flex: 1;
4738
+ height: 100%;
4739
+ }
4740
+ .doc-history-wrap .doc-diff-panel .doc-diff-panel-wrap {
4741
+ padding: 24px;
4742
+ }
4743
+ .doc-history-wrap .doc-history-list {
4744
+ height: 100%;
4745
+ }
4746
+ .doc-history-drawer .arco-drawer-body {
4747
+ padding: 0;
4748
+ }
package/es/index.d.ts CHANGED
@@ -25,3 +25,4 @@ export { default as mediaView } from './mediaView';
25
25
  export { default as thumbCard } from './thumbCard';
26
26
  export { default as selectResourceModal } from './selectResourceModal';
27
27
  export { default as docPreview } from './docPreview';
28
+ export { default as docHistory } from './docHistory';
package/es/index.js CHANGED
@@ -25,3 +25,4 @@ export { default as mediaView } from "./mediaView/index.js";
25
25
  export { default as thumbCard } from "./thumbCard/index.js";
26
26
  export { default as selectResourceModal } from "./selectResourceModal/index.js";
27
27
  export { default as docPreview } from "./docPreview/index.js";
28
+ export { default as docHistory } from "./docHistory/index.js";
package/es/index.less CHANGED
@@ -25,3 +25,4 @@
25
25
  @import './thumbCard/style/index.less';
26
26
  @import './selectResourceModal/style/index.less';
27
27
  @import './docPreview/style/index.less';
28
+ @import './docHistory/style/index.less';
@@ -1,29 +1,7 @@
1
- import { defineComponent, ref, provide, computed, openBlock, createBlock, unref, withCtx, createElementBlock, createCommentVNode, createElementVNode, createVNode, withDirectives, vShow, createTextVNode } from "vue";
2
- import { Drawer, Tabs, Button, TabPane, Scrollbar, Pagination } from "@arco-design/web-vue";
3
- import { IconClose } from "@arco-design/web-vue/es/icon";
4
- import emptyData from "../emptyData/index.js";
5
- import _sfc_main$1 from "./components/ListFilter/index.js";
6
- import _sfc_main$2 from "./components/ListContent/index.js";
7
- import _sfc_main$4 from "./components/ListSelected/index.js";
8
- import _sfc_main$3 from "./components/ListContentLocal/index.js";
9
- import useAttachement from "../hooks/useAttachement.js";
10
- import { DEFAULT_BASE_API } from "../config.js";
11
- const _hoisted_1 = {
12
- key: 0,
13
- class: "resource-select-container"
14
- };
15
- const _hoisted_2 = { class: "resource-select-header" };
16
- const _hoisted_3 = {
17
- key: 0,
18
- class: "resource-select-filter"
19
- };
20
- const _hoisted_4 = { class: "resource-select-content" };
21
- const _hoisted_5 = { class: "resource-select-footer" };
22
- const _hoisted_6 = { class: "footer-left" };
23
- const _hoisted_7 = {
24
- key: 0,
25
- class: "footer-right"
26
- };
1
+ import { defineComponent, ref, openBlock, createElementBlock, createBlock, unref, withCtx, createVNode, createCommentVNode } from "vue";
2
+ import { Drawer, Modal } from "@arco-design/web-vue";
3
+ import _sfc_main$1 from "./components/Main/index.js";
4
+ const _hoisted_1 = { class: "resource-select-wrap" };
27
5
  const _sfc_main = defineComponent({
28
6
  ...{ name: "selectResourceModal" },
29
7
  __name: "component",
@@ -32,193 +10,63 @@ const _sfc_main = defineComponent({
32
10
  visible: { type: Boolean },
33
11
  userInfo: {},
34
12
  maxcount: {},
13
+ wrap: {},
35
14
  filterOptions: {}
36
15
  },
37
16
  emits: ["update:visible", "submit"],
38
17
  setup(__props, { emit: __emit }) {
39
18
  const props = __props;
40
19
  const emits = __emit;
41
- const BASE_API = props.BASE_API || DEFAULT_BASE_API;
42
- const activeKey = ref("all");
43
- provide("userInfo", computed(() => props.userInfo));
44
- provide("baseAPI", BASE_API);
45
- const {
46
- list,
47
- total,
48
- limit,
49
- loading,
50
- changeKey,
51
- changeFilter,
52
- changePage,
53
- changeSize
54
- } = useAttachement({ key: "all", BASE_API });
55
- const selected = ref([]);
56
- const selectedKeys = computed(() => selected.value.map((item) => item.id));
57
- const disableSelect = computed(() => props.maxcount && selected.value.length >= props.maxcount);
58
- function handleSelect(params) {
59
- const { id } = params;
60
- const index = selected.value.findIndex((item) => item.id === id);
61
- if (index > -1)
62
- selected.value.splice(index, 1);
63
- else
64
- selected.value.push(params);
65
- }
66
- function handleClear() {
67
- selected.value = [];
68
- }
69
- function handleClose() {
70
- handleClear();
20
+ const wrapMode = ref(props.wrap || "modal");
21
+ const handleClose = () => {
71
22
  emits("update:visible", false);
72
- }
73
- const handleSelectOne = (params) => {
74
- if (Array.isArray(params))
75
- emits("submit", params);
76
- else
77
- emits("submit", [params]);
78
- handleClose();
79
23
  };
80
- function handleConfirm() {
81
- handleSelectOne(selected.value);
82
- }
83
- function handleToUpload() {
84
- changeKey("local");
85
- activeKey.value = "local";
86
- }
24
+ const handleSubmit = (data) => {
25
+ emits("submit", JSON.parse(JSON.stringify(data)));
26
+ };
87
27
  return (_ctx, _cache) => {
88
- return openBlock(), createBlock(unref(Drawer), {
89
- visible: _ctx.visible,
90
- width: "1024px",
91
- header: false,
92
- footer: false,
93
- class: "resource-select-drawer"
94
- }, {
95
- default: withCtx(() => [
96
- _ctx.userInfo ? (openBlock(), createElementBlock("div", _hoisted_1, [
97
- createCommentVNode(" \u5934\u90E8 "),
98
- createElementVNode("div", _hoisted_2, [
99
- createVNode(unref(Tabs), {
100
- "active-key": activeKey.value,
101
- "onUpdate:activeKey": _cache[0] || (_cache[0] = ($event) => activeKey.value = $event),
102
- onChange: unref(changeKey)
103
- }, {
104
- extra: withCtx(() => [
105
- createVNode(unref(Button), {
106
- type: "secondary",
107
- shape: "round",
108
- onClick: handleClose
109
- }, {
110
- icon: withCtx(() => [
111
- createVNode(unref(IconClose))
112
- ]),
113
- _: 1
114
- })
115
- ]),
116
- default: withCtx(() => [
117
- createVNode(unref(TabPane), {
118
- key: "all",
119
- title: "\u5168\u90E8\u7D20\u6750"
120
- }),
121
- createVNode(unref(TabPane), {
122
- key: "my",
123
- title: "\u6211\u7684\u7D20\u6750"
124
- }),
125
- createVNode(unref(TabPane), {
126
- key: "remind",
127
- title: "\u63D0\u9192\u6211\u7684"
128
- }),
129
- createVNode(unref(TabPane), {
130
- key: "local",
131
- title: "\u672C\u5730\u7D20\u6750"
132
- })
133
- ]),
134
- _: 1
135
- }, 8, ["active-key", "onChange"])
136
- ]),
137
- createCommentVNode(" \u7B5B\u9009 "),
138
- activeKey.value !== "local" ? (openBlock(), createElementBlock("div", _hoisted_3, [
139
- createVNode(_sfc_main$1, {
140
- "disable-upload-by": activeKey.value !== "all",
141
- filterOptions: _ctx.filterOptions,
142
- onChange: unref(changeFilter),
143
- onUpload: handleToUpload
144
- }, null, 8, ["disable-upload-by", "filterOptions", "onChange"])
145
- ])) : createCommentVNode("v-if", true),
146
- createCommentVNode(" \u5217\u8868\u90E8\u5206 "),
147
- createElementVNode("div", _hoisted_4, [
148
- createVNode(unref(Scrollbar), {
149
- "outer-style": { height: "100%" },
150
- style: { "height": "100%", "overflow": "auto" }
151
- }, {
152
- default: withCtx(() => [
153
- withDirectives(createVNode(_sfc_main$2, {
154
- loading: unref(loading),
155
- list: unref(list),
156
- disable: disableSelect.value,
157
- "select-keys": selectedKeys.value,
158
- onSelect: handleSelect,
159
- onSelectOne: handleSelectOne
160
- }, null, 8, ["loading", "list", "disable", "select-keys"]), [
161
- [vShow, activeKey.value !== "local"]
162
- ]),
163
- withDirectives(createVNode(_sfc_main$3, {
164
- disable: disableSelect.value,
165
- "select-keys": selectedKeys.value,
166
- onSelect: handleSelect,
167
- onSelectOne: handleSelectOne
168
- }, null, 8, ["disable", "select-keys"]), [
169
- [vShow, activeKey.value === "local"]
170
- ])
171
- ]),
172
- _: 1
173
- })
174
- ]),
175
- createCommentVNode(" \u5E95\u90E8 "),
176
- createElementVNode("div", _hoisted_5, [
177
- createElementVNode("div", _hoisted_6, [
178
- activeKey.value !== "local" ? (openBlock(), createBlock(unref(Pagination), {
179
- key: 0,
180
- total: unref(total),
181
- "page-size": unref(limit),
182
- "show-total": "",
183
- "show-page-size": "",
184
- "base-size": 3,
185
- "buffer-size": 1,
186
- onChange: _cache[1] || (_cache[1] = (e) => unref(changePage)((e - 1) * unref(limit))),
187
- onPageSizeChange: unref(changeSize)
188
- }, null, 8, ["total", "page-size", "onPageSizeChange"])) : createCommentVNode("v-if", true)
189
- ]),
190
- selected.value.length ? (openBlock(), createElementBlock("div", _hoisted_7, [
191
- createVNode(_sfc_main$4, {
192
- maxcount: _ctx.maxcount,
193
- selected: selected.value,
194
- onRemove: handleSelect,
195
- onClear: handleClear
196
- }, null, 8, ["maxcount", "selected"]),
197
- createVNode(unref(Button), { onClick: handleClose }, {
198
- default: withCtx(() => [
199
- createTextVNode("\u53D6\u6D88")
200
- ]),
201
- _: 1
202
- }),
203
- createVNode(unref(Button), {
204
- type: "primary",
205
- onClick: handleConfirm
206
- }, {
207
- default: withCtx(() => [
208
- createTextVNode("\u786E\u5B9A")
209
- ]),
210
- _: 1
211
- })
212
- ])) : createCommentVNode("v-if", true)
213
- ])
214
- ])) : (openBlock(), createBlock(unref(emptyData), {
215
- key: 1,
216
- type: "empty",
217
- customTip: "\u6682\u65E0\u6743\u9650"
218
- }))
219
- ]),
220
- _: 1
221
- }, 8, ["visible"]);
28
+ return openBlock(), createElementBlock("div", _hoisted_1, [
29
+ wrapMode.value === "drawer" ? (openBlock(), createBlock(unref(Drawer), {
30
+ key: 0,
31
+ visible: _ctx.visible,
32
+ width: "1024px",
33
+ header: false,
34
+ footer: false,
35
+ class: "resource-select-drawer"
36
+ }, {
37
+ default: withCtx(() => [
38
+ createVNode(_sfc_main$1, {
39
+ BASE_API: _ctx.BASE_API,
40
+ userInfo: _ctx.userInfo,
41
+ maxcount: _ctx.maxcount,
42
+ filterOptions: _ctx.filterOptions,
43
+ onClose: handleClose,
44
+ onSubmit: handleSubmit
45
+ }, null, 8, ["BASE_API", "userInfo", "maxcount", "filterOptions"])
46
+ ]),
47
+ _: 1
48
+ }, 8, ["visible"])) : wrapMode.value === "modal" ? (openBlock(), createBlock(unref(Modal), {
49
+ key: 1,
50
+ visible: _ctx.visible,
51
+ width: "986px",
52
+ "body-class": "resource-select-modal-body",
53
+ "hide-title": false,
54
+ closable: false,
55
+ footer: false
56
+ }, {
57
+ default: withCtx(() => [
58
+ createVNode(_sfc_main$1, {
59
+ BASE_API: _ctx.BASE_API,
60
+ userInfo: _ctx.userInfo,
61
+ maxcount: _ctx.maxcount,
62
+ filterOptions: _ctx.filterOptions,
63
+ onClose: handleClose,
64
+ onSubmit: handleSubmit
65
+ }, null, 8, ["BASE_API", "userInfo", "maxcount", "filterOptions"])
66
+ ]),
67
+ _: 1
68
+ }, 8, ["visible"])) : createCommentVNode("v-if", true)
69
+ ]);
222
70
  };
223
71
  }
224
72
  });