@cmstops/pro-compo 0.3.39 → 0.3.41

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 (43) hide show
  1. package/dist/index.css +74 -0
  2. package/dist/index.min.css +1 -1
  3. package/es/contentModal/components/ViewAllColumn/MediaFilter/index.js +45 -51
  4. package/es/docHistory/component.d.ts +0 -0
  5. package/es/docHistory/component.js +100 -0
  6. package/es/docHistory/components/DocDiffPanel/index.d.ts +0 -0
  7. package/es/docHistory/components/DocDiffPanel/index.js +22 -0
  8. package/es/docHistory/components/DocHistoryList/index.d.ts +0 -0
  9. package/es/docHistory/components/DocHistoryList/index.js +37 -0
  10. package/es/docHistory/index.d.ts +2 -0
  11. package/es/docHistory/index.js +7 -0
  12. package/es/docHistory/scripts/diff.d.ts +1 -0
  13. package/es/docHistory/scripts/diff.js +293 -0
  14. package/es/docHistory/scripts/useDocHistory.d.ts +10 -0
  15. package/es/docHistory/scripts/useDocHistory.js +71 -0
  16. package/es/docHistory/style/css.js +1 -0
  17. package/es/docHistory/style/docDiffPanel.less +9 -0
  18. package/es/docHistory/style/docHistoryList.less +58 -0
  19. package/es/docHistory/style/index.css +74 -0
  20. package/es/docHistory/style/index.d.ts +1 -0
  21. package/es/docHistory/style/index.js +1 -0
  22. package/es/docHistory/style/index.less +28 -0
  23. package/es/index.css +74 -0
  24. package/es/index.d.ts +1 -0
  25. package/es/index.js +1 -0
  26. package/es/index.less +1 -0
  27. package/lib/contentModal/components/ViewAllColumn/MediaFilter/index.js +44 -50
  28. package/lib/docHistory/component.js +101 -0
  29. package/lib/docHistory/components/DocDiffPanel/index.js +23 -0
  30. package/lib/docHistory/components/DocHistoryList/index.js +38 -0
  31. package/lib/docHistory/index.js +8 -0
  32. package/lib/docHistory/scripts/diff.js +295 -0
  33. package/lib/docHistory/scripts/useDocHistory.js +74 -0
  34. package/lib/docHistory/style/css.js +2 -0
  35. package/lib/docHistory/style/docDiffPanel.less +9 -0
  36. package/lib/docHistory/style/docHistoryList.less +58 -0
  37. package/lib/docHistory/style/index.css +74 -0
  38. package/lib/docHistory/style/index.js +2 -0
  39. package/lib/docHistory/style/index.less +28 -0
  40. package/lib/index.css +74 -0
  41. package/lib/index.js +2 -0
  42. package/lib/index.less +1 -0
  43. package/package.json +7 -5
@@ -0,0 +1,71 @@
1
+ import { ref } from "vue";
2
+ import request from "../../utils/request.js";
3
+ import { CompareById2 } from "./diff.js";
4
+ function getDocHistory(BASE_API, id, pub) {
5
+ return request(BASE_API, {
6
+ url: `/poplar/v2/content/${id}/history?pub=${pub}`,
7
+ method: "get"
8
+ });
9
+ }
10
+ function useDocHistory(BASE_API) {
11
+ const list = ref([]);
12
+ const loading = ref(true);
13
+ const current = ref(0);
14
+ const diffContent = ref();
15
+ const id = ref();
16
+ const pub = ref(false);
17
+ function initParams(mediaId, docPub) {
18
+ id.value = mediaId;
19
+ pub.value = docPub;
20
+ }
21
+ async function loadData() {
22
+ if (!id.value)
23
+ return;
24
+ loading.value = true;
25
+ try {
26
+ const { code, message } = await getDocHistory(BASE_API, id.value, pub.value);
27
+ if (code !== 0)
28
+ return;
29
+ list.value = message;
30
+ handleSelect(0);
31
+ } catch (e) {
32
+ console.log(e);
33
+ } finally {
34
+ loading.value = false;
35
+ }
36
+ }
37
+ async function handleSelect(idx) {
38
+ loading.value = true;
39
+ try {
40
+ current.value = idx;
41
+ await new Promise((resolve) => setTimeout(resolve, 500));
42
+ const cur = list.value[idx];
43
+ const prev = list.value[idx + 1];
44
+ const value = JSON.parse(JSON.stringify(cur));
45
+ if (!prev) {
46
+ diffContent.value = value;
47
+ return;
48
+ }
49
+ const curHtml = document.createElement("div");
50
+ curHtml.innerHTML = cur.content;
51
+ const prevHtml = document.createElement("div");
52
+ prevHtml.innerHTML = prev.content;
53
+ value.content = CompareById2(curHtml, prevHtml);
54
+ diffContent.value = value;
55
+ } catch (e) {
56
+ console.log(e, "diff \u5931\u8D25");
57
+ } finally {
58
+ loading.value = false;
59
+ }
60
+ }
61
+ return {
62
+ diffContent,
63
+ current,
64
+ loading,
65
+ list,
66
+ loadData,
67
+ initParams,
68
+ handleSelect
69
+ };
70
+ }
71
+ export { getDocHistory, useDocHistory };
@@ -0,0 +1 @@
1
+ import "./index.css";
@@ -0,0 +1,9 @@
1
+ .doc-diff-panel-wrap {
2
+ padding: 24px;
3
+
4
+ .doc-title {
5
+ color: var(--color-text-1);
6
+ font-weight: bold;
7
+ font-size: 24px;
8
+ }
9
+ }
@@ -0,0 +1,58 @@
1
+ .doc-history-list-wrap {
2
+ box-sizing: border-box;
3
+ border-left: 1px solid var(--color-border-1);
4
+
5
+ // 单条历史记录
6
+ .doc-history-item {
7
+ display: flex;
8
+ flex-direction: column;
9
+ gap: 5px;
10
+ box-sizing: border-box;
11
+ width: 260px;
12
+ padding: 20px 16px;
13
+ border-bottom: 1px solid var(--color-border-1);
14
+ border-left: 3px solid transparent;
15
+ cursor: pointer;
16
+
17
+ .update-time {
18
+ color: var(--color-text-1);
19
+ font-size: 14px;
20
+ }
21
+
22
+ .tips {
23
+ color: var(--color-text-2);
24
+ font-size: 12px;
25
+ }
26
+
27
+ .doc-author {
28
+ display: flex;
29
+ gap: 8px;
30
+ align-items: center;
31
+ color: var(--color-text-1);
32
+ font-size: 14px;
33
+
34
+ &::before {
35
+ width: 5px;
36
+ height: 5px;
37
+ background-color: rgb(var(--primary-6));
38
+ border-radius: 50%;
39
+ content: ' ';
40
+ }
41
+ }
42
+
43
+ // 激活/选中状态
44
+ &.active {
45
+ background-color: rgba(var(--primary-6), 0.1);
46
+ border-left-color: rgb(var(--primary-6));
47
+
48
+ .update-time {
49
+ color: rgb(var(--primary-6));
50
+ }
51
+ }
52
+
53
+ // 悬浮
54
+ &:hover {
55
+ background-color: var(--color-fill-1);
56
+ }
57
+ }
58
+ }
@@ -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
@@ -4672,3 +4672,77 @@
4672
4672
  font-size: 20px;
4673
4673
  cursor: pointer;
4674
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';
@@ -6,10 +6,7 @@ var doc = require("../../../../utils/doc.js");
6
6
  var index = require("../columnTree/index.js");
7
7
  const _hoisted_1 = { class: "media-filter-container" };
8
8
  const _hoisted_2 = { style: { "display": "flex", "align-items": "center", "gap": "5px" } };
9
- const _hoisted_3 = /* @__PURE__ */ vue.createElementVNode("span", null, "\u7CBE\u51C6\u641C", -1);
10
- const _hoisted_4 = { style: { "display": "flex", "align-items": "center", "gap": "5px" } };
11
- const _hoisted_5 = /* @__PURE__ */ vue.createElementVNode("span", null, "\u6A21\u7CCA\u641C", -1);
12
- const _hoisted_6 = { class: "sort-button" };
9
+ const _hoisted_3 = { class: "sort-button" };
13
10
  const _sfc_main = vue.defineComponent({
14
11
  ...{ name: "MediaFilter" },
15
12
  __name: "index",
@@ -24,7 +21,7 @@ const _sfc_main = vue.defineComponent({
24
21
  emits: ["update:group_id", "search"],
25
22
  setup(__props, { emit: __emit }) {
26
23
  const props = __props;
27
- const column_id = vue.ref(0);
24
+ const column_id = vue.ref("all");
28
25
  const emit = __emit;
29
26
  const filter = vue.ref({
30
27
  keywords: "",
@@ -35,6 +32,18 @@ const _sfc_main = vue.defineComponent({
35
32
  order: "create_time",
36
33
  wordState: "precision"
37
34
  });
35
+ const wordStateOptions = [
36
+ {
37
+ value: "precision",
38
+ label: "\u7CBE\u51C6\u641C",
39
+ desc: "\u4F1A\u4EE5\u8F93\u5165\u7684\u5B8C\u6574\u5173\u952E\u8BCD\u201C\u6210\u957F\u201D\u8FDB\u884C\u641C\u7D22\uFF0C\u641C\u7D22\u7ED3\u679C\u5173\u8054\u6027\u66F4\u9AD8\uFF0C\u4F46\u641C\u7D22\u7ED3\u679C\u66F4\u5C11"
40
+ },
41
+ {
42
+ value: "blur",
43
+ label: "\u6A21\u7CCA\u641C",
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"
45
+ }
46
+ ];
38
47
  const bannerOptions = vue.computed(() => {
39
48
  const options = [
40
49
  {
@@ -92,22 +101,24 @@ const _sfc_main = vue.defineComponent({
92
101
  return filter.value.keywords || series || filter.value.cover_type || banner || filter.value.sort !== -1;
93
102
  });
94
103
  const reset = () => {
95
- filter.value = {
104
+ const _set = {
96
105
  keywords: "",
97
106
  cover_type: "",
98
107
  sort: -1,
99
108
  order: "create_time"
100
109
  };
110
+ Object.assign(filter.value, _set);
101
111
  if (props.banner !== "all") {
102
112
  filter.value.banner = props.banner;
103
113
  } else {
104
114
  filter.value.banner = "";
105
115
  }
106
- if (props.series !== "all") {
116
+ if (props.series !== "all" && props.series.split(",").length === 1) {
107
117
  filter.value.type = props.series;
108
118
  } else {
109
119
  filter.value.type = "";
110
120
  }
121
+ column_id.value = "all";
111
122
  };
112
123
  const checkout = (type) => {
113
124
  filter.value.wordState = type;
@@ -157,6 +168,7 @@ const _sfc_main = vue.defineComponent({
157
168
  "allow-clear": "",
158
169
  class: "filter-item keyword",
159
170
  placeholder: "\u8BF7\u8F93\u5165\u5185\u5BB9\u6807\u9898",
171
+ style: { width: "240px" },
160
172
  onPressEnter: handleSearch
161
173
  }, {
162
174
  prepend: vue.withCtx(() => [
@@ -167,48 +179,30 @@ const _sfc_main = vue.defineComponent({
167
179
  onSelect: checkout
168
180
  }, {
169
181
  default: vue.withCtx(() => [
170
- vue.createVNode(vue.unref(webVue.Option), {
171
- value: "precision",
172
- label: "\u7CBE\u51C6\u641C"
173
- }, {
174
- default: vue.withCtx(() => [
175
- vue.createElementVNode("div", _hoisted_2, [
176
- _hoisted_3,
177
- vue.createVNode(vue.unref(webVue.Tooltip), {
178
- effect: "dark",
179
- content: "\u4F1A\u4EE5\u8F93\u5165\u7684\u5B8C\u6574\u5173\u952E\u8BCD\u201C\u6210\u957F\u201D\u8FDB\u884C\u641C\u7D22\uFF0C\u641C\u7D22\u7ED3\u679C\u5173\u8054\u6027\u66F4\u9AD8\uFF0C\u4F46\u641C\u7D22\u7ED3\u679C\u66F4\u5C11",
180
- position: "right"
181
- }, {
182
- default: vue.withCtx(() => [
183
- vue.createVNode(vue.unref(icon.IconInfoCircle))
184
- ]),
185
- _: 1
186
- })
187
- ])
188
- ]),
189
- _: 1
190
- }),
191
- vue.createVNode(vue.unref(webVue.Option), {
192
- value: "blur",
193
- label: "\u6A21\u7CCA\u641C"
194
- }, {
195
- default: vue.withCtx(() => [
196
- vue.createElementVNode("div", _hoisted_4, [
197
- _hoisted_5,
198
- vue.createVNode(vue.unref(webVue.Tooltip), {
199
- effect: "dark",
200
- content: "\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",
201
- position: "right"
202
- }, {
203
- default: vue.withCtx(() => [
204
- vue.createVNode(vue.unref(icon.IconInfoCircle))
205
- ]),
206
- _: 1
207
- })
208
- ])
209
- ]),
210
- _: 1
211
- })
182
+ (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(wordStateOptions, (item, index2) => {
183
+ return vue.createVNode(vue.unref(webVue.Option), {
184
+ key: index2,
185
+ value: item.value,
186
+ label: item.label
187
+ }, {
188
+ default: vue.withCtx(() => [
189
+ vue.createElementVNode("div", _hoisted_2, [
190
+ vue.createElementVNode("span", null, vue.toDisplayString(item.label), 1),
191
+ vue.createVNode(vue.unref(webVue.Tooltip), {
192
+ effect: "dark",
193
+ content: item.desc,
194
+ position: "right"
195
+ }, {
196
+ default: vue.withCtx(() => [
197
+ vue.createVNode(vue.unref(icon.IconInfoCircle))
198
+ ]),
199
+ _: 2
200
+ }, 1032, ["content"])
201
+ ])
202
+ ]),
203
+ _: 2
204
+ }, 1032, ["value", "label"]);
205
+ }), 64))
212
206
  ]),
213
207
  _: 1
214
208
  }, 8, ["modelValue"])
@@ -300,7 +294,7 @@ const _sfc_main = vue.defineComponent({
300
294
  ]),
301
295
  _: 1
302
296
  }),
303
- vue.createElementVNode("div", _hoisted_6, [
297
+ vue.createElementVNode("div", _hoisted_3, [
304
298
  vue.createVNode(vue.unref(webVue.Select), {
305
299
  modelValue: filter.value.order,
306
300
  "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => filter.value.order = $event),
@@ -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;