@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,215 @@
1
+ import { defineComponent, ref, provide, computed, openBlock, createElementBlock, createCommentVNode, createElementVNode, createVNode, unref, withCtx, withDirectives, vShow, createBlock, createTextVNode } from "vue";
2
+ import { 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 "../ListFilter/index.js";
6
+ import _sfc_main$2 from "../ListContent/index.js";
7
+ import _sfc_main$4 from "../ListSelected/index.js";
8
+ import _sfc_main$3 from "../ListContentLocal/index.js";
9
+ import useAttachement from "../../../hooks/useAttachement.js";
10
+ import { DEFAULT_BASE_API } from "../../../config.js";
11
+ const _hoisted_1 = { class: "resource-select-main" };
12
+ const _hoisted_2 = {
13
+ key: 0,
14
+ class: "resource-select-container"
15
+ };
16
+ const _hoisted_3 = { class: "resource-select-header" };
17
+ const _hoisted_4 = {
18
+ key: 0,
19
+ class: "resource-select-filter"
20
+ };
21
+ const _hoisted_5 = { class: "resource-select-content" };
22
+ const _hoisted_6 = { class: "resource-select-footer" };
23
+ const _hoisted_7 = { class: "footer-left" };
24
+ const _hoisted_8 = {
25
+ key: 0,
26
+ class: "footer-right"
27
+ };
28
+ const _sfc_main = defineComponent({
29
+ __name: "index",
30
+ props: {
31
+ BASE_API: {},
32
+ userInfo: {},
33
+ maxcount: {},
34
+ filterOptions: {}
35
+ },
36
+ emits: ["close", "submit"],
37
+ setup(__props, { emit: __emit }) {
38
+ const props = __props;
39
+ const emits = __emit;
40
+ const BASE_API = props.BASE_API || DEFAULT_BASE_API;
41
+ const activeKey = ref("all");
42
+ provide("userInfo", computed(() => props.userInfo));
43
+ provide("baseAPI", BASE_API);
44
+ const {
45
+ list,
46
+ total,
47
+ limit,
48
+ loading,
49
+ changeKey,
50
+ changeFilter,
51
+ changePage,
52
+ changeSize
53
+ } = useAttachement({ key: "all", BASE_API });
54
+ const selected = ref([]);
55
+ const selectedKeys = computed(() => selected.value.map((item) => item.id));
56
+ const disableSelect = computed(() => props.maxcount && selected.value.length >= props.maxcount);
57
+ function handleSelect(params) {
58
+ const { id } = params;
59
+ const index = selected.value.findIndex((item) => item.id === id);
60
+ if (index > -1)
61
+ selected.value.splice(index, 1);
62
+ else
63
+ selected.value.push(params);
64
+ }
65
+ function handleClear() {
66
+ selected.value = [];
67
+ }
68
+ function handleClose() {
69
+ handleClear();
70
+ emits("close");
71
+ }
72
+ const handleSelectOne = (params) => {
73
+ if (Array.isArray(params))
74
+ emits("submit", params);
75
+ else
76
+ emits("submit", [params]);
77
+ handleClose();
78
+ };
79
+ function handleConfirm() {
80
+ handleSelectOne(selected.value);
81
+ }
82
+ function handleToUpload() {
83
+ changeKey("local");
84
+ activeKey.value = "local";
85
+ }
86
+ return (_ctx, _cache) => {
87
+ return openBlock(), createElementBlock("div", _hoisted_1, [
88
+ _ctx.userInfo ? (openBlock(), createElementBlock("div", _hoisted_2, [
89
+ createCommentVNode(" \u5934\u90E8 "),
90
+ createElementVNode("div", _hoisted_3, [
91
+ createVNode(unref(Tabs), {
92
+ "active-key": activeKey.value,
93
+ "onUpdate:activeKey": _cache[0] || (_cache[0] = ($event) => activeKey.value = $event),
94
+ onChange: unref(changeKey)
95
+ }, {
96
+ extra: withCtx(() => [
97
+ createVNode(unref(Button), {
98
+ type: "secondary",
99
+ shape: "round",
100
+ onClick: handleClose
101
+ }, {
102
+ icon: withCtx(() => [
103
+ createVNode(unref(IconClose))
104
+ ]),
105
+ _: 1
106
+ })
107
+ ]),
108
+ default: withCtx(() => [
109
+ createVNode(unref(TabPane), {
110
+ key: "all",
111
+ title: "\u5168\u90E8\u7D20\u6750"
112
+ }),
113
+ createVNode(unref(TabPane), {
114
+ key: "my",
115
+ title: "\u6211\u7684\u7D20\u6750"
116
+ }),
117
+ createVNode(unref(TabPane), {
118
+ key: "remind",
119
+ title: "\u63D0\u9192\u6211\u7684"
120
+ }),
121
+ createVNode(unref(TabPane), {
122
+ key: "local",
123
+ title: "\u672C\u5730\u7D20\u6750"
124
+ })
125
+ ]),
126
+ _: 1
127
+ }, 8, ["active-key", "onChange"])
128
+ ]),
129
+ createCommentVNode(" \u7B5B\u9009 "),
130
+ activeKey.value !== "local" ? (openBlock(), createElementBlock("div", _hoisted_4, [
131
+ createVNode(_sfc_main$1, {
132
+ "disable-upload-by": activeKey.value !== "all",
133
+ filterOptions: _ctx.filterOptions,
134
+ onChange: unref(changeFilter),
135
+ onUpload: handleToUpload
136
+ }, null, 8, ["disable-upload-by", "filterOptions", "onChange"])
137
+ ])) : createCommentVNode("v-if", true),
138
+ createCommentVNode(" \u5217\u8868\u90E8\u5206 "),
139
+ createElementVNode("div", _hoisted_5, [
140
+ createVNode(unref(Scrollbar), {
141
+ "outer-style": { height: "100%" },
142
+ style: { "height": "100%", "overflow": "auto" }
143
+ }, {
144
+ default: withCtx(() => [
145
+ withDirectives(createVNode(_sfc_main$2, {
146
+ loading: unref(loading),
147
+ list: unref(list),
148
+ disable: disableSelect.value,
149
+ "select-keys": selectedKeys.value,
150
+ onSelect: handleSelect,
151
+ onSelectOne: handleSelectOne
152
+ }, null, 8, ["loading", "list", "disable", "select-keys"]), [
153
+ [vShow, activeKey.value !== "local"]
154
+ ]),
155
+ withDirectives(createVNode(_sfc_main$3, {
156
+ disable: disableSelect.value,
157
+ "select-keys": selectedKeys.value,
158
+ onSelect: handleSelect,
159
+ onSelectOne: handleSelectOne
160
+ }, null, 8, ["disable", "select-keys"]), [
161
+ [vShow, activeKey.value === "local"]
162
+ ])
163
+ ]),
164
+ _: 1
165
+ })
166
+ ]),
167
+ createCommentVNode(" \u5E95\u90E8 "),
168
+ createElementVNode("div", _hoisted_6, [
169
+ createElementVNode("div", _hoisted_7, [
170
+ activeKey.value !== "local" ? (openBlock(), createBlock(unref(Pagination), {
171
+ key: 0,
172
+ total: unref(total),
173
+ "page-size": unref(limit),
174
+ "show-total": "",
175
+ "show-page-size": "",
176
+ "base-size": 3,
177
+ "buffer-size": 1,
178
+ onChange: _cache[1] || (_cache[1] = (e) => unref(changePage)((e - 1) * unref(limit))),
179
+ onPageSizeChange: unref(changeSize)
180
+ }, null, 8, ["total", "page-size", "onPageSizeChange"])) : createCommentVNode("v-if", true)
181
+ ]),
182
+ selected.value.length ? (openBlock(), createElementBlock("div", _hoisted_8, [
183
+ createVNode(_sfc_main$4, {
184
+ maxcount: _ctx.maxcount,
185
+ selected: selected.value,
186
+ onRemove: handleSelect,
187
+ onClear: handleClear
188
+ }, null, 8, ["maxcount", "selected"]),
189
+ createVNode(unref(Button), { onClick: handleClose }, {
190
+ default: withCtx(() => [
191
+ createTextVNode("\u53D6\u6D88")
192
+ ]),
193
+ _: 1
194
+ }),
195
+ createVNode(unref(Button), {
196
+ type: "primary",
197
+ onClick: handleConfirm
198
+ }, {
199
+ default: withCtx(() => [
200
+ createTextVNode("\u786E\u5B9A")
201
+ ]),
202
+ _: 1
203
+ })
204
+ ])) : createCommentVNode("v-if", true)
205
+ ])
206
+ ])) : (openBlock(), createBlock(unref(emptyData), {
207
+ key: 1,
208
+ type: "empty",
209
+ customTip: "\u6682\u65E0\u6743\u9650"
210
+ }))
211
+ ]);
212
+ };
213
+ }
214
+ });
215
+ export { _sfc_main as default };
@@ -155,6 +155,13 @@
155
155
  background-color: #165dff;
156
156
  border-color: #165dff;
157
157
  }
158
+ .resource-select-modal-body {
159
+ height: 70vh;
160
+ padding: 0;
161
+ }
162
+ .resource-select-main {
163
+ height: 100%;
164
+ }
158
165
  .resource-select-drawer .arco-drawer-body {
159
166
  box-sizing: border-box;
160
167
  padding: 0;
@@ -4,6 +4,15 @@
4
4
  @import './listContentLocal.less';
5
5
  @import './listCardWrapper.less';
6
6
 
7
+ .resource-select-modal-body {
8
+ height: 70vh;
9
+ padding: 0;
10
+ }
11
+
12
+ .resource-select-main {
13
+ height: 100%;
14
+ }
15
+
7
16
  .resource-select-drawer {
8
17
  .arco-drawer-body {
9
18
  box-sizing: border-box;
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ var vue = require("vue");
3
+ var webVue = require("@arco-design/web-vue");
4
+ var config = require("../config.js");
5
+ var useDocHistory = require("./scripts/useDocHistory.js");
6
+ var index$1 = require("./components/DocHistoryList/index.js");
7
+ var index = require("./components/DocDiffPanel/index.js");
8
+ const _hoisted_1 = { class: "doc-history-wrap" };
9
+ const _hoisted_2 = { class: "doc-diff-panel" };
10
+ const _hoisted_3 = { class: "doc-history-list" };
11
+ const _sfc_main = vue.defineComponent({
12
+ ...{ name: "docHistory" },
13
+ __name: "component",
14
+ props: {
15
+ BASE_API: {},
16
+ visible: { type: Boolean },
17
+ docInfo: {},
18
+ pub: { type: Boolean }
19
+ },
20
+ emits: ["update:visible"],
21
+ setup(__props, { emit: __emit }) {
22
+ const props = __props;
23
+ const emits = __emit;
24
+ const vis = vue.computed({
25
+ get: () => props.visible,
26
+ set: (val) => {
27
+ emits("update:visible", val);
28
+ }
29
+ });
30
+ const BASE_API = props.BASE_API || config.DEFAULT_BASE_API;
31
+ const {
32
+ initParams,
33
+ loadData,
34
+ handleSelect,
35
+ loading,
36
+ diffContent,
37
+ list,
38
+ current
39
+ } = useDocHistory.useDocHistory(BASE_API);
40
+ vue.onMounted(() => {
41
+ if (!props.docInfo)
42
+ return;
43
+ initParams(props.docInfo.id, props.pub);
44
+ loadData();
45
+ });
46
+ return (_ctx, _cache) => {
47
+ return vue.openBlock(), vue.createBlock(vue.unref(webVue.Drawer), {
48
+ visible: vis.value,
49
+ "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => vis.value = $event),
50
+ class: "doc-history-drawer",
51
+ title: "\u7248\u672C\u8BB0\u5F55",
52
+ width: 1e3,
53
+ footer: false
54
+ }, {
55
+ default: vue.withCtx(() => [
56
+ vue.createElementVNode("div", _hoisted_1, [
57
+ vue.createElementVNode("div", _hoisted_2, [
58
+ vue.createVNode(vue.unref(webVue.Spin), {
59
+ loading: vue.unref(loading),
60
+ style: { "height": "100%", "width": "100%" }
61
+ }, {
62
+ default: vue.withCtx(() => [
63
+ vue.createVNode(vue.unref(webVue.Scrollbar), {
64
+ "outer-style": { height: "100%" },
65
+ style: { "height": "100%", "overflow": "auto" }
66
+ }, {
67
+ default: vue.withCtx(() => [
68
+ vue.unref(diffContent) ? (vue.openBlock(), vue.createBlock(index, {
69
+ key: 0,
70
+ doc: vue.unref(diffContent)
71
+ }, null, 8, ["doc"])) : vue.createCommentVNode("v-if", true)
72
+ ]),
73
+ _: 1
74
+ })
75
+ ]),
76
+ _: 1
77
+ }, 8, ["loading"])
78
+ ]),
79
+ vue.createElementVNode("div", _hoisted_3, [
80
+ vue.createVNode(vue.unref(webVue.Scrollbar), {
81
+ "outer-style": { height: "100%" },
82
+ style: { "height": "100%", "overflow": "auto" }
83
+ }, {
84
+ default: vue.withCtx(() => [
85
+ vue.createVNode(index$1, {
86
+ list: vue.unref(list),
87
+ current: vue.unref(current),
88
+ onSelect: vue.unref(handleSelect)
89
+ }, null, 8, ["list", "current", "onSelect"])
90
+ ]),
91
+ _: 1
92
+ })
93
+ ])
94
+ ])
95
+ ]),
96
+ _: 1
97
+ }, 8, ["visible"]);
98
+ };
99
+ }
100
+ });
101
+ module.exports = _sfc_main;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var vue = require("vue");
3
+ const _hoisted_1 = { class: "doc-diff-panel-wrap" };
4
+ const _hoisted_2 = { class: "doc-title" };
5
+ const _hoisted_3 = ["innerHTML"];
6
+ const _sfc_main = vue.defineComponent({
7
+ __name: "index",
8
+ props: {
9
+ doc: {}
10
+ },
11
+ setup(__props) {
12
+ return (_ctx, _cache) => {
13
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
14
+ vue.createElementVNode("div", _hoisted_2, vue.toDisplayString(_ctx.doc.title), 1),
15
+ vue.createElementVNode("div", {
16
+ class: "doc-content",
17
+ innerHTML: _ctx.doc.content
18
+ }, null, 8, _hoisted_3)
19
+ ]);
20
+ };
21
+ }
22
+ });
23
+ module.exports = _sfc_main;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var vue = require("vue");
3
+ var index = require("../../../utils/index.js");
4
+ const _hoisted_1 = { class: "doc-history-list-wrap" };
5
+ const _hoisted_2 = ["onClick"];
6
+ const _hoisted_3 = { class: "update-time" };
7
+ const _hoisted_4 = {
8
+ key: 0,
9
+ class: "tips"
10
+ };
11
+ const _hoisted_5 = { class: "doc-author" };
12
+ const _sfc_main = vue.defineComponent({
13
+ __name: "index",
14
+ props: {
15
+ list: {},
16
+ current: {}
17
+ },
18
+ emits: ["select"],
19
+ setup(__props, { emit: __emit }) {
20
+ const emits = __emit;
21
+ return (_ctx, _cache) => {
22
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
23
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.list, (item, idx) => {
24
+ return vue.openBlock(), vue.createElementBlock("div", {
25
+ key: item,
26
+ class: vue.normalizeClass(["doc-history-item", { active: idx === _ctx.current }]),
27
+ onClick: ($event) => emits("select", idx)
28
+ }, [
29
+ vue.createElementVNode("div", _hoisted_3, vue.toDisplayString(vue.unref(index.timeFormat)(item.update_time)), 1),
30
+ idx === 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, " \u6700\u8FD1\u66F4\u65B0")) : vue.createCommentVNode("v-if", true),
31
+ vue.createElementVNode("div", _hoisted_5, vue.toDisplayString(item.author), 1)
32
+ ], 10, _hoisted_2);
33
+ }), 128))
34
+ ]);
35
+ };
36
+ }
37
+ });
38
+ module.exports = _sfc_main;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var component = require("./component.js");
3
+ const docHistory = Object.assign(component, {
4
+ install: (app) => {
5
+ app.component(component.name, component);
6
+ }
7
+ });
8
+ module.exports = docHistory;