cloud-web-corejs 1.0.249 → 1.0.251
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.
- package/package.json +1 -1
- package/src/components/xform/form-designer/designer.js +1 -0
- package/src/components/xform/form-designer/setting-panel/form-setting.vue +3 -0
- package/src/components/xform/utils/util.js +1 -0
- package/src/views/bd/setting/formVersion/button.vue +55 -0
- package/src/views/bd/setting/formVersion/compareBasicSection.vue +125 -0
- package/src/views/bd/setting/formVersion/compareCodeSection.vue +539 -0
- package/src/views/bd/setting/formVersion/compareContMixin.scss +65 -0
- package/src/views/bd/setting/formVersion/compareContent.vue +63 -0
- package/src/views/bd/setting/formVersion/compareDialog.vue +88 -0
- package/src/views/bd/setting/formVersion/compareMixin.js +93 -0
- package/src/views/bd/setting/formVersion/fieldCompare.vue +54 -0
- package/src/views/bd/setting/formVersion/formScriptCompareView.vue +94 -0
- package/src/views/bd/setting/formVersion/formTemplateCompareView.vue +74 -0
- package/src/views/bd/setting/formVersion/ftHistoryDialog.vue +491 -0
- package/src/views/bd/setting/formVersion/link.vue +58 -0
- package/src/views/bd/setting/formVersion/preformDialog.vue +87 -0
- package/src/views/bd/setting/formVersion/reverButton.vue +82 -0
- package/src/views/bd/setting/formVersion/tableDetailDiff.js +99 -0
- package/src/views/bd/setting/formVersion/tableModelCompareView.vue +514 -0
- package/src/views/bd/setting/formVersion/textDiff.js +102 -0
- package/src/views/bd/setting/form_import_log/edit.vue +6 -3
- package/src/views/bd/setting/form_import_log/list.vue +5 -0
- package/src/views/bd/setting/form_script/edit.vue +196 -83
- package/src/views/bd/setting/form_script/edit1.vue +410 -220
- package/src/views/bd/setting/form_script/form_list.vue +19 -0
- package/src/views/bd/setting/form_script/list.vue +95 -21
- package/src/views/bd/setting/form_script/list1.vue +24 -0
- package/src/views/bd/setting/form_script/mixins/dialog.js +2 -2
- package/src/views/bd/setting/form_script/mixins/edit.js +265 -207
- package/src/views/bd/setting/form_script/mixins/edit1.js +259 -201
- package/src/views/bd/setting/form_script/mixins/form_list.js +322 -296
- package/src/views/bd/setting/form_script/mixins/list.js +163 -95
- package/src/views/bd/setting/form_script/mixins/list1.js +244 -155
- package/src/views/bd/setting/form_script/mixins/otherAuthDialog.js +1 -1
- package/src/views/bd/setting/form_template/batchWfObjConfigDialog.vue +1 -1
- package/src/views/bd/setting/form_template/edit.vue +355 -205
- package/src/views/bd/setting/form_template/formDesignerDialog.vue +171 -0
- package/src/views/bd/setting/form_template/list.vue +49 -74
- package/src/views/bd/setting/form_template/mixins/batchWfObjConfigDialog.js +3 -3
- package/src/views/bd/setting/form_template/mixins/edit.js +51 -8
- package/src/views/bd/setting/form_template/mixins/itemList.js +1 -1
- package/src/views/bd/setting/form_template/mixins/list.js +114 -82
- package/src/views/bd/setting/form_template/mixins/list2.js +3 -3
- package/src/views/bd/setting/form_template/mixins/otherAuthDialog.js +1 -1
- package/src/views/bd/setting/form_template/mixins/wf_list.js +3 -7
- package/src/views/bd/setting/form_template/wf_list.vue +161 -127
- package/src/views/bd/setting/request_setting/list.vue +15 -25
- package/src/views/bd/setting/table_model/edit.vue +702 -498
- package/src/views/bd/setting/table_model/list.vue +28 -0
- package/src/views/bd/setting/table_model/mixins/dialog.js +1 -1
- package/src/views/bd/setting/table_model/mixins/edit.js +228 -121
- package/src/views/bd/setting/table_model/mixins/list.js +55 -20
- package/src/views/bd/setting/table_model/mixins/otherAuthDialog.js +1 -1
- package/src/views/bd/setting/table_model/mixins/zdDialog.js +50 -46
- package/src/views/bd/setting/utils/index.js +15 -0
- package/src/views/user/form/vform/designer.vue +303 -287
- package/src/views/user/form/vform/formFieldMapping.js +2 -3
- package/src/views/user/form/vform/render.vue +8 -0
- package/src/views/user/form/view/list.vue +5 -1
|
@@ -0,0 +1,539 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="compare-cont compare-code-section"
|
|
4
|
+
:class="{ 'is-section-fullscreen': fullscreen, 'is-diff-mode': enableDiff }"
|
|
5
|
+
>
|
|
6
|
+
<div class="compare-code-header">
|
|
7
|
+
<div class="compare-header-main">
|
|
8
|
+
<div class="title">
|
|
9
|
+
<b>{{ $t1(sectionTitle) }}</b>
|
|
10
|
+
</div>
|
|
11
|
+
<div v-if="enableDiff" class="compare-diff-legend">
|
|
12
|
+
<span class="compare-diff-nav">
|
|
13
|
+
<el-button plain
|
|
14
|
+
:type="!diffNavList.length ? 'info' : 'primary'"
|
|
15
|
+
class="button-sty"
|
|
16
|
+
:disabled="!diffNavList.length"
|
|
17
|
+
@click="diffNavList.length && gotoPrevDiff()"
|
|
18
|
+
>
|
|
19
|
+
<i class="el-icon-top"></i>{{ $t1("上一处差异") }}
|
|
20
|
+
</el-button>
|
|
21
|
+
<el-button plain
|
|
22
|
+
:type="!diffNavList.length ? 'info' : 'primary'"
|
|
23
|
+
class="button-sty"
|
|
24
|
+
:disabled="!diffNavList.length"
|
|
25
|
+
@click="diffNavList.length && gotoNextDiff()"
|
|
26
|
+
>
|
|
27
|
+
<i class="el-icon-bottom"></i>{{ $t1("下一处差异") }}
|
|
28
|
+
</el-button>
|
|
29
|
+
<el-button type="primary" plain @click="gotoTop" class="button-sty">
|
|
30
|
+
<i class="el-icon-caret-top"></i>{{ $t1("返回顶部") }}
|
|
31
|
+
</el-button>
|
|
32
|
+
<span v-if="diffNavList.length" class="diff-nav-count">
|
|
33
|
+
{{ currentDiffIndex < 0 ? "-" : currentDiffIndex + 1 }} /
|
|
34
|
+
{{ diffNavList.length }}
|
|
35
|
+
</span>
|
|
36
|
+
</span>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
<el-tooltip
|
|
40
|
+
class="item"
|
|
41
|
+
effect="dark"
|
|
42
|
+
:content="$t1('全屏')"
|
|
43
|
+
placement="top"
|
|
44
|
+
>
|
|
45
|
+
<el-link class="is-full" :underline="false" @click="toggleFullscreen">
|
|
46
|
+
<i class="iconfont icon-quanping"></i>
|
|
47
|
+
</el-link>
|
|
48
|
+
</el-tooltip>
|
|
49
|
+
</div>
|
|
50
|
+
<div class="flex compare-code-flex">
|
|
51
|
+
<div class="flex-1 compare-code-col">
|
|
52
|
+
<span class="version-blue">{{ $t1("版本号") }}:{{ preVersion }}</span>
|
|
53
|
+
<div class="compare-code-editor-wrap">
|
|
54
|
+
<code-editor
|
|
55
|
+
ref="leftEditor"
|
|
56
|
+
:mode="mode"
|
|
57
|
+
:readonly="true"
|
|
58
|
+
:value="leftCode"
|
|
59
|
+
:resize="false"
|
|
60
|
+
:height="editorHeight"
|
|
61
|
+
/>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
<div class="flex-1 compare-code-col">
|
|
65
|
+
<span class="version-green">{{ $t1("版本号") }}:{{ curVersion }}</span>
|
|
66
|
+
<div class="compare-code-editor-wrap">
|
|
67
|
+
<code-editor
|
|
68
|
+
ref="rightEditor"
|
|
69
|
+
:mode="mode"
|
|
70
|
+
:readonly="true"
|
|
71
|
+
:value="rightCode"
|
|
72
|
+
:resize="false"
|
|
73
|
+
:height="editorHeight"
|
|
74
|
+
/>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</template>
|
|
80
|
+
|
|
81
|
+
<script>
|
|
82
|
+
import ace from "ace-builds";
|
|
83
|
+
import { diffLines } from "./textDiff";
|
|
84
|
+
|
|
85
|
+
export default {
|
|
86
|
+
name: "compareCodeSection",
|
|
87
|
+
props: {
|
|
88
|
+
sectionTitle: {
|
|
89
|
+
type: String,
|
|
90
|
+
default: "脚本",
|
|
91
|
+
},
|
|
92
|
+
preVersion: [String, Number],
|
|
93
|
+
curVersion: [String, Number],
|
|
94
|
+
leftCode: {
|
|
95
|
+
type: String,
|
|
96
|
+
default: "",
|
|
97
|
+
},
|
|
98
|
+
rightCode: {
|
|
99
|
+
type: String,
|
|
100
|
+
default: "",
|
|
101
|
+
},
|
|
102
|
+
mode: {
|
|
103
|
+
type: String,
|
|
104
|
+
default: "java",
|
|
105
|
+
},
|
|
106
|
+
enableDiff: {
|
|
107
|
+
type: Boolean,
|
|
108
|
+
default: false,
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
data() {
|
|
112
|
+
return {
|
|
113
|
+
fullscreen: false,
|
|
114
|
+
diffNavList: [],
|
|
115
|
+
currentDiffIndex: -1,
|
|
116
|
+
diffMarkerIds: {
|
|
117
|
+
left: [],
|
|
118
|
+
right: [],
|
|
119
|
+
},
|
|
120
|
+
activeMarkerIds: {
|
|
121
|
+
left: null,
|
|
122
|
+
right: null,
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
},
|
|
126
|
+
computed: {
|
|
127
|
+
editorHeight() {
|
|
128
|
+
return this.fullscreen ? "100%" : "450px";
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
watch: {
|
|
132
|
+
leftCode() {
|
|
133
|
+
this.syncAndApplyDiff();
|
|
134
|
+
},
|
|
135
|
+
rightCode() {
|
|
136
|
+
this.syncAndApplyDiff();
|
|
137
|
+
},
|
|
138
|
+
editorHeight() {
|
|
139
|
+
this.resizeEditors();
|
|
140
|
+
if (this.enableDiff) {
|
|
141
|
+
this.syncAndApplyDiff();
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
enableDiff(val) {
|
|
145
|
+
if (val) {
|
|
146
|
+
this.syncAndApplyDiff();
|
|
147
|
+
} else {
|
|
148
|
+
this.clearDiffMarkers();
|
|
149
|
+
this.diffNavList = [];
|
|
150
|
+
this.currentDiffIndex = -1;
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
mounted() {
|
|
155
|
+
this.syncAndApplyDiff();
|
|
156
|
+
},
|
|
157
|
+
beforeDestroy() {
|
|
158
|
+
this.clearDiffMarkers();
|
|
159
|
+
},
|
|
160
|
+
methods: {
|
|
161
|
+
syncEditorContent() {
|
|
162
|
+
[
|
|
163
|
+
{ ref: "leftEditor", code: this.leftCode },
|
|
164
|
+
{ ref: "rightEditor", code: this.rightCode },
|
|
165
|
+
].forEach(({ ref, code }) => {
|
|
166
|
+
const editorComp = this.$refs[ref];
|
|
167
|
+
const aceEditor = editorComp?.aceEditor;
|
|
168
|
+
if (!aceEditor) return;
|
|
169
|
+
const newVal = code || "";
|
|
170
|
+
if (aceEditor.getValue() !== newVal) {
|
|
171
|
+
aceEditor.setValue(newVal, -1);
|
|
172
|
+
aceEditor.clearSelection();
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
},
|
|
176
|
+
syncAndApplyDiff() {
|
|
177
|
+
this.$nextTick(() => {
|
|
178
|
+
this.syncEditorContent();
|
|
179
|
+
if (!this.enableDiff) return;
|
|
180
|
+
this.$nextTick(() => {
|
|
181
|
+
this.applyDiffHighlightWithRetry();
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
},
|
|
185
|
+
applyDiffHighlightWithRetry(retry = 0) {
|
|
186
|
+
if (!this.enableDiff) return;
|
|
187
|
+
const leftReady = !!this.$refs.leftEditor?.aceEditor;
|
|
188
|
+
const rightReady = !!this.$refs.rightEditor?.aceEditor;
|
|
189
|
+
if ((!leftReady || !rightReady) && retry < 20) {
|
|
190
|
+
setTimeout(() => this.applyDiffHighlightWithRetry(retry + 1), 50);
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
this.syncEditorContent();
|
|
194
|
+
this.applyDiffHighlight();
|
|
195
|
+
},
|
|
196
|
+
toggleFullscreen() {
|
|
197
|
+
this.fullscreen = !this.fullscreen;
|
|
198
|
+
this.$nextTick(() => {
|
|
199
|
+
this.resizeEditors();
|
|
200
|
+
this.syncAndApplyDiff();
|
|
201
|
+
});
|
|
202
|
+
},
|
|
203
|
+
resizeEditors() {
|
|
204
|
+
this.$nextTick(() => {
|
|
205
|
+
["leftEditor", "rightEditor"].forEach((refName) => {
|
|
206
|
+
const editor = this.$refs[refName];
|
|
207
|
+
if (editor && editor.aceEditor) {
|
|
208
|
+
editor.aceEditor.resize();
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
},
|
|
213
|
+
clearDiffMarkers() {
|
|
214
|
+
this.clearActiveMarkers();
|
|
215
|
+
["leftEditor", "rightEditor"].forEach((refName, index) => {
|
|
216
|
+
const side = index === 0 ? "left" : "right";
|
|
217
|
+
const editor = this.$refs[refName]?.aceEditor;
|
|
218
|
+
if (!editor) return;
|
|
219
|
+
this.diffMarkerIds[side].forEach((id) => {
|
|
220
|
+
editor.session.removeMarker(id);
|
|
221
|
+
});
|
|
222
|
+
this.diffMarkerIds[side] = [];
|
|
223
|
+
});
|
|
224
|
+
},
|
|
225
|
+
clearActiveMarkers() {
|
|
226
|
+
["leftEditor", "rightEditor"].forEach((refName, index) => {
|
|
227
|
+
const side = index === 0 ? "left" : "right";
|
|
228
|
+
const editor = this.$refs[refName]?.aceEditor;
|
|
229
|
+
const markerId = this.activeMarkerIds[side];
|
|
230
|
+
if (editor && markerId != null) {
|
|
231
|
+
editor.session.removeMarker(markerId);
|
|
232
|
+
}
|
|
233
|
+
this.activeMarkerIds[side] = null;
|
|
234
|
+
});
|
|
235
|
+
},
|
|
236
|
+
applyDiffHighlight() {
|
|
237
|
+
if (!this.enableDiff) return;
|
|
238
|
+
|
|
239
|
+
const leftEditor = this.$refs.leftEditor?.aceEditor;
|
|
240
|
+
const rightEditor = this.$refs.rightEditor?.aceEditor;
|
|
241
|
+
if (!leftEditor || !rightEditor) return;
|
|
242
|
+
|
|
243
|
+
this.syncEditorContent();
|
|
244
|
+
this.clearDiffMarkers();
|
|
245
|
+
|
|
246
|
+
const leftText = leftEditor.getValue();
|
|
247
|
+
const rightText = rightEditor.getValue();
|
|
248
|
+
const { oldMarks, newMarks, diffNavList } = diffLines(
|
|
249
|
+
leftText,
|
|
250
|
+
rightText
|
|
251
|
+
);
|
|
252
|
+
this.diffNavList = diffNavList || [];
|
|
253
|
+
this.currentDiffIndex = -1;
|
|
254
|
+
const Range = ace.require("ace/range").Range;
|
|
255
|
+
|
|
256
|
+
this.diffMarkerIds.left = oldMarks.map((row) =>
|
|
257
|
+
leftEditor.session.addMarker(
|
|
258
|
+
new Range(row, 0, row, Number.MAX_VALUE),
|
|
259
|
+
"compare-diff-old",
|
|
260
|
+
"fullLine",
|
|
261
|
+
false
|
|
262
|
+
)
|
|
263
|
+
);
|
|
264
|
+
this.diffMarkerIds.right = newMarks.map((row) =>
|
|
265
|
+
rightEditor.session.addMarker(
|
|
266
|
+
new Range(row, 0, row, Number.MAX_VALUE),
|
|
267
|
+
"compare-diff-new",
|
|
268
|
+
"fullLine",
|
|
269
|
+
false
|
|
270
|
+
)
|
|
271
|
+
);
|
|
272
|
+
},
|
|
273
|
+
gotoPrevDiff() {
|
|
274
|
+
if (!this.diffNavList.length) return;
|
|
275
|
+
this.currentDiffIndex =
|
|
276
|
+
(this.currentDiffIndex - 1 + this.diffNavList.length) %
|
|
277
|
+
this.diffNavList.length;
|
|
278
|
+
this.locateCurrentDiff();
|
|
279
|
+
},
|
|
280
|
+
gotoNextDiff() {
|
|
281
|
+
if (!this.diffNavList.length) return;
|
|
282
|
+
this.currentDiffIndex =
|
|
283
|
+
(this.currentDiffIndex + 1) % this.diffNavList.length;
|
|
284
|
+
this.locateCurrentDiff();
|
|
285
|
+
},
|
|
286
|
+
gotoTop() {
|
|
287
|
+
const leftEditor = this.$refs.leftEditor?.aceEditor;
|
|
288
|
+
const rightEditor = this.$refs.rightEditor?.aceEditor;
|
|
289
|
+
if (!leftEditor || !rightEditor) return;
|
|
290
|
+
|
|
291
|
+
this.clearActiveMarkers();
|
|
292
|
+
this.currentDiffIndex = -1;
|
|
293
|
+
this.scrollEditorToLine(leftEditor, 0);
|
|
294
|
+
this.scrollEditorToLine(rightEditor, 0);
|
|
295
|
+
},
|
|
296
|
+
resolveDiffScrollRows(diffItem) {
|
|
297
|
+
const leftRow =
|
|
298
|
+
diffItem.left != null ? diffItem.left : diffItem.anchorLeft ?? 0;
|
|
299
|
+
const rightRow =
|
|
300
|
+
diffItem.right != null ? diffItem.right : diffItem.anchorRight ?? 0;
|
|
301
|
+
return { leftRow, rightRow };
|
|
302
|
+
},
|
|
303
|
+
addActiveHunkMarker(editor, side, diffItem) {
|
|
304
|
+
const Range = ace.require("ace/range").Range;
|
|
305
|
+
const isLeft = side === "left";
|
|
306
|
+
const start = isLeft ? diffItem.left : diffItem.right;
|
|
307
|
+
const end = isLeft ? diffItem.leftEnd : diffItem.rightEnd;
|
|
308
|
+
|
|
309
|
+
if (start == null) return null;
|
|
310
|
+
|
|
311
|
+
const endRow = end != null ? end : start;
|
|
312
|
+
return editor.session.addMarker(
|
|
313
|
+
new Range(start, 0, endRow, Number.MAX_VALUE),
|
|
314
|
+
isLeft ? "compare-diff-active-old" : "compare-diff-active-new",
|
|
315
|
+
"fullLine",
|
|
316
|
+
false
|
|
317
|
+
);
|
|
318
|
+
},
|
|
319
|
+
scrollEditorToLine(editor, row) {
|
|
320
|
+
const maxRow = Math.max(editor.session.getLength() - 1, 0);
|
|
321
|
+
const targetRow = Math.max(0, Math.min(row, maxRow));
|
|
322
|
+
editor.scrollToLine(targetRow, true, true, () => {});
|
|
323
|
+
editor.gotoLine(targetRow + 1, 0, true);
|
|
324
|
+
editor.renderer.scrollCursorIntoView({ row: targetRow, column: 0 }, 0.5);
|
|
325
|
+
},
|
|
326
|
+
locateCurrentDiff() {
|
|
327
|
+
const diffItem = this.diffNavList[this.currentDiffIndex];
|
|
328
|
+
if (!diffItem) return;
|
|
329
|
+
|
|
330
|
+
const leftEditor = this.$refs.leftEditor?.aceEditor;
|
|
331
|
+
const rightEditor = this.$refs.rightEditor?.aceEditor;
|
|
332
|
+
if (!leftEditor || !rightEditor) return;
|
|
333
|
+
|
|
334
|
+
this.clearActiveMarkers();
|
|
335
|
+
const { leftRow, rightRow } = this.resolveDiffScrollRows(diffItem);
|
|
336
|
+
|
|
337
|
+
this.scrollEditorToLine(leftEditor, leftRow);
|
|
338
|
+
this.scrollEditorToLine(rightEditor, rightRow);
|
|
339
|
+
|
|
340
|
+
this.activeMarkerIds.left = this.addActiveHunkMarker(
|
|
341
|
+
leftEditor,
|
|
342
|
+
"left",
|
|
343
|
+
diffItem
|
|
344
|
+
);
|
|
345
|
+
this.activeMarkerIds.right = this.addActiveHunkMarker(
|
|
346
|
+
rightEditor,
|
|
347
|
+
"right",
|
|
348
|
+
diffItem
|
|
349
|
+
);
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
};
|
|
353
|
+
</script>
|
|
354
|
+
|
|
355
|
+
<style scoped lang="scss">
|
|
356
|
+
@import "./compareContMixin.scss";
|
|
357
|
+
|
|
358
|
+
.compare-code-section {
|
|
359
|
+
@include compare-cont-shell;
|
|
360
|
+
@include compare-cont-full-link;
|
|
361
|
+
@include compare-version-label;
|
|
362
|
+
@include compare-flex-row;
|
|
363
|
+
padding:0 16px 16px;
|
|
364
|
+
overflow: hidden;
|
|
365
|
+
.compare-code-flex {
|
|
366
|
+
margin-top: 0;
|
|
367
|
+
|
|
368
|
+
.compare-code-col {
|
|
369
|
+
.version-blue,
|
|
370
|
+
.version-green {
|
|
371
|
+
margin-bottom: 8px;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
::v-deep .ace-container {
|
|
376
|
+
border: 1px solid #ebeef5;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
.compare-code-header {
|
|
381
|
+
position: relative;
|
|
382
|
+
min-height: 28px;
|
|
383
|
+
padding-right: 24px;
|
|
384
|
+
margin-bottom:16px;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.compare-header-main {
|
|
388
|
+
position:relative;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.title {
|
|
392
|
+
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.compare-diff-legend {
|
|
396
|
+
display: inline-flex;
|
|
397
|
+
align-items: center;
|
|
398
|
+
flex-wrap: wrap;
|
|
399
|
+
font-size: 12px;
|
|
400
|
+
gap: 0 12px;
|
|
401
|
+
position: absolute;
|
|
402
|
+
top: 8px;
|
|
403
|
+
left: 127px;
|
|
404
|
+
.legend-item {
|
|
405
|
+
display: inline-block;
|
|
406
|
+
padding: 2px 8px;
|
|
407
|
+
border-radius: 2px;
|
|
408
|
+
|
|
409
|
+
&.legend-old {
|
|
410
|
+
background: rgba(245, 108, 108, 0.2);
|
|
411
|
+
color: #f56c6c;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
&.legend-new {
|
|
415
|
+
background: rgba(103, 194, 58, 0.2);
|
|
416
|
+
color: #67c23a;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
.compare-diff-nav {
|
|
421
|
+
display: inline-flex;
|
|
422
|
+
align-items: center;
|
|
423
|
+
gap: 8px;
|
|
424
|
+
|
|
425
|
+
.diff-nav-btn {
|
|
426
|
+
display: inline-flex;
|
|
427
|
+
align-items: center;
|
|
428
|
+
height: 24px;
|
|
429
|
+
padding: 0 10px;
|
|
430
|
+
font-size: 12px;
|
|
431
|
+
line-height: 22px;
|
|
432
|
+
color: #409eff;
|
|
433
|
+
background: #ecf5ff;
|
|
434
|
+
border: 1px solid #b3d8ff;
|
|
435
|
+
border-radius: 2px;
|
|
436
|
+
cursor: pointer;
|
|
437
|
+
white-space: nowrap;
|
|
438
|
+
user-select: none;
|
|
439
|
+
transition: all 0.2s;
|
|
440
|
+
|
|
441
|
+
i {
|
|
442
|
+
margin-right: 4px;
|
|
443
|
+
font-size: 12px;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
&:hover:not(.is-disabled) {
|
|
447
|
+
color: #fff;
|
|
448
|
+
background: #409eff;
|
|
449
|
+
border-color: #409eff;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
&.is-disabled {
|
|
453
|
+
color: #c0c4cc;
|
|
454
|
+
background: #f5f7fa;
|
|
455
|
+
border-color: #e4e7ed;
|
|
456
|
+
cursor: not-allowed;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.diff-nav-count {
|
|
461
|
+
color: #909399;
|
|
462
|
+
white-space: nowrap;
|
|
463
|
+
padding-left: 4px;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
&.is-diff-mode {
|
|
469
|
+
::v-deep .ace_marker-layer {
|
|
470
|
+
.compare-diff-old {
|
|
471
|
+
position: absolute;
|
|
472
|
+
background: rgba(245, 108, 108, 0.2);
|
|
473
|
+
z-index: 3;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
.compare-diff-new {
|
|
477
|
+
position: absolute;
|
|
478
|
+
background: rgba(103, 194, 58, 0.2);
|
|
479
|
+
z-index: 3;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
.compare-diff-active-old {
|
|
483
|
+
position: absolute;
|
|
484
|
+
background: rgba(245, 108, 108, 0.35);
|
|
485
|
+
z-index: 4;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
.compare-diff-active-new {
|
|
489
|
+
position: absolute;
|
|
490
|
+
background: rgba(103, 194, 58, 0.35);
|
|
491
|
+
z-index: 4;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
&.is-section-fullscreen {
|
|
497
|
+
position: fixed;
|
|
498
|
+
top: 0;
|
|
499
|
+
right: 0;
|
|
500
|
+
bottom: 0;
|
|
501
|
+
left: 0;
|
|
502
|
+
z-index: 9999;
|
|
503
|
+
display: flex;
|
|
504
|
+
flex-direction: column;
|
|
505
|
+
margin: 0;
|
|
506
|
+
overflow: hidden;
|
|
507
|
+
background:#FFF;border-radius:12px;
|
|
508
|
+
|
|
509
|
+
.compare-code-header {
|
|
510
|
+
flex-shrink: 0;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
.compare-code-flex {
|
|
514
|
+
flex: 1;
|
|
515
|
+
min-height: 0;
|
|
516
|
+
align-items: stretch;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
.compare-code-col {
|
|
520
|
+
display: flex;
|
|
521
|
+
flex-direction: column;
|
|
522
|
+
min-height: 0;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
.compare-code-editor-wrap {
|
|
526
|
+
flex: 1;
|
|
527
|
+
min-height: 0;
|
|
528
|
+
|
|
529
|
+
::v-deep .ace-container {
|
|
530
|
+
height: 100%;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
::v-deep .ace-editor {
|
|
534
|
+
height: 100% !important;
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
</style>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
@import "~@/styles/variables.scss";
|
|
2
|
+
@mixin compare-cont-shell {
|
|
3
|
+
position: relative;
|
|
4
|
+
~ .compare-cont {
|
|
5
|
+
margin-bottom: 0;
|
|
6
|
+
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@mixin compare-cont-title {
|
|
11
|
+
> .title {
|
|
12
|
+
margin: -16px -16px 16px;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@mixin compare-cont-full-link {
|
|
17
|
+
.is-full {
|
|
18
|
+
position: absolute;
|
|
19
|
+
top: 12px;
|
|
20
|
+
right: 12px;
|
|
21
|
+
padding: 4px 6px;
|
|
22
|
+
font-size: 16px;
|
|
23
|
+
color: $baseColor;
|
|
24
|
+
background: #f2f6fc;
|
|
25
|
+
border-radius: 4px;
|
|
26
|
+
|
|
27
|
+
i {
|
|
28
|
+
font-size: 16px;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@mixin compare-version-label {
|
|
34
|
+
.version-blue,
|
|
35
|
+
.version-green {
|
|
36
|
+
display: inline-block;
|
|
37
|
+
height: 26px;
|
|
38
|
+
padding: 0 8px;
|
|
39
|
+
line-height: 26px;
|
|
40
|
+
color: #fff;
|
|
41
|
+
vertical-align: middle;
|
|
42
|
+
width: 88px;
|
|
43
|
+
text-align: center;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.version-blue {
|
|
47
|
+
background: $baseColor;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.version-green {
|
|
51
|
+
background: $green;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@mixin compare-flex-row {
|
|
56
|
+
.flex {
|
|
57
|
+
display: flex;
|
|
58
|
+
|
|
59
|
+
.flex-1 {
|
|
60
|
+
flex: 1;
|
|
61
|
+
min-width: 0;
|
|
62
|
+
margin: 0 8px;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<component
|
|
4
|
+
v-if="type"
|
|
5
|
+
:is="type"
|
|
6
|
+
:objType="objType"
|
|
7
|
+
:objCode="objCode"
|
|
8
|
+
:compareHData1="compareHData1"
|
|
9
|
+
:compareHData2="compareHData2"
|
|
10
|
+
:preVersion="preVersion"
|
|
11
|
+
:curVersion="curVersion"
|
|
12
|
+
@reverCallback="$emit('reverCallback')"
|
|
13
|
+
/>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
<script>
|
|
17
|
+
import formTemplateCompareView from "./formTemplateCompareView.vue";
|
|
18
|
+
import formScriptCompareView from "./formScriptCompareView.vue";
|
|
19
|
+
import tableModelCompareView from "./tableModelCompareView.vue";
|
|
20
|
+
export default {
|
|
21
|
+
name: "compareContent",
|
|
22
|
+
components: {
|
|
23
|
+
formTemplateCompareView,
|
|
24
|
+
formScriptCompareView,
|
|
25
|
+
tableModelCompareView,
|
|
26
|
+
},
|
|
27
|
+
props: {
|
|
28
|
+
objType: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: "",
|
|
31
|
+
},
|
|
32
|
+
objCode: String,
|
|
33
|
+
compareHData1: {
|
|
34
|
+
type: Object,
|
|
35
|
+
default: () => ({}),
|
|
36
|
+
},
|
|
37
|
+
compareHData2: {
|
|
38
|
+
type: Object,
|
|
39
|
+
default: () => ({}),
|
|
40
|
+
},
|
|
41
|
+
preVersion: [String, Number],
|
|
42
|
+
curVersion: [String, Number],
|
|
43
|
+
},
|
|
44
|
+
data() {
|
|
45
|
+
return {
|
|
46
|
+
type: null,
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
created() {
|
|
50
|
+
this.initType();
|
|
51
|
+
},
|
|
52
|
+
methods: {
|
|
53
|
+
initType() {
|
|
54
|
+
this.type =
|
|
55
|
+
this.objType === "FormTemplate"
|
|
56
|
+
? "formTemplateCompareView"
|
|
57
|
+
: this.objType === "FormScript"
|
|
58
|
+
? "formScriptCompareView"
|
|
59
|
+
: "tableModelCompareView";
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
</script>
|