cloud-web-corejs-haier 1.0.20 → 1.0.21
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/code-editor/index.vue +136 -51
- package/src/components/fileLibrary/index.vue +17 -14
- package/src/components/fileLibrary/mixins/categoryMoveDialogMixins.js +1 -1
- package/src/components/fileLibrary/mixins/fileCategoryDialogMixins.js +1 -1
- package/src/components/fileLibrary/mixins/fileHistoryDialogMixins.js +2 -2
- package/src/components/fileLibrary/mixins/fileObjAuthDialogMixin.js +350 -202
- package/src/components/fileLibrary/mixins/fileObjAuthEditDialogMixin.js +33 -26
- package/src/components/fileLibrary/mixins/fileObjAuthEditMixin.js +5 -5
- package/src/components/fileLibrary/mixins/indexMixins.js +250 -106
- package/src/components/fileLibrary/mixins/propertiesDialogMixins.js +64 -4
- package/src/components/fileLibrary/mixins/recycleBinDialogMixins.js +3 -4
- package/src/components/table/CellSlot.vue +29 -2
package/package.json
CHANGED
|
@@ -2,85 +2,124 @@
|
|
|
2
2
|
<div class="ace-container">
|
|
3
3
|
<!-- 官方文档中使用id,这里禁止使用,在后期打包后容易出现问题,使用 ref 或者 DOM 就行 -->
|
|
4
4
|
<div class="ace-editor" ref="ace" :style="editorStyle"></div>
|
|
5
|
+
<template v-if="resize">
|
|
6
|
+
<div id="editor-resize-bar" @mousedown="btnMouseDown"></div>
|
|
7
|
+
<div class="icon-drag" @mousedown="btnMouseDown"></div>
|
|
8
|
+
</template>
|
|
5
9
|
</div>
|
|
6
10
|
</template>
|
|
7
11
|
|
|
8
12
|
<script>
|
|
9
|
-
import ace from
|
|
13
|
+
import ace from "ace-builds";
|
|
10
14
|
/* 启用此行后webpack打包回生成很多动态加载的js文件,不便于部署,故禁用!!
|
|
11
15
|
特别提示:禁用此行后,需要调用ace.config.set('basePath', 'path...')指定动态js加载URL!!
|
|
12
16
|
*/
|
|
13
17
|
//import 'ace-builds/webpack-resolver'
|
|
14
18
|
|
|
15
19
|
//import 'ace-builds/src-min-noconflict/theme-monokai' // 默认设置的主题
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
const ACE_BASE_PATH = window.WEB_PREFIX +
|
|
23
|
-
|
|
20
|
+
import "ace-builds/src-min-noconflict/theme-sqlserver"; // 新设主题
|
|
21
|
+
import "ace-builds/src-min-noconflict/mode-javascript"; // 默认设置的语言模式
|
|
22
|
+
import "ace-builds/src-min-noconflict/mode-json"; //
|
|
23
|
+
import "ace-builds/src-min-noconflict/mode-css"; //
|
|
24
|
+
import "ace-builds/src-min-noconflict/mode-java"; //
|
|
25
|
+
import "ace-builds/src-min-noconflict/ext-language_tools";
|
|
26
|
+
const ACE_BASE_PATH = window.WEB_PREFIX + "/base/ace/src-min-noconflict";
|
|
27
|
+
import indexUtil from "../../utils/index.js";
|
|
24
28
|
export default {
|
|
25
|
-
name:
|
|
29
|
+
name: "CodeEditor",
|
|
26
30
|
props: {
|
|
27
31
|
value: {
|
|
28
32
|
type: String,
|
|
29
|
-
default:
|
|
33
|
+
default: "",
|
|
30
34
|
},
|
|
31
35
|
readonly: {
|
|
32
36
|
type: Boolean,
|
|
33
|
-
default: false
|
|
37
|
+
default: false,
|
|
34
38
|
},
|
|
35
39
|
mode: {
|
|
36
40
|
type: String,
|
|
37
|
-
default:
|
|
41
|
+
default: "javascript",
|
|
38
42
|
},
|
|
39
43
|
userWorker: {
|
|
40
44
|
//是否开启语法检查,默认开启
|
|
41
45
|
type: Boolean,
|
|
42
|
-
default: true
|
|
46
|
+
default: true,
|
|
43
47
|
},
|
|
44
48
|
maxLines: {
|
|
45
49
|
type: Number,
|
|
46
|
-
default: 20
|
|
50
|
+
default: 20,
|
|
47
51
|
},
|
|
48
52
|
minLines: {
|
|
49
53
|
type: Number,
|
|
50
|
-
default: 20
|
|
54
|
+
default: 20,
|
|
51
55
|
},
|
|
52
56
|
height: {
|
|
53
57
|
type: String,
|
|
54
|
-
default:
|
|
58
|
+
default: "450px;",
|
|
59
|
+
},
|
|
60
|
+
resize: {
|
|
61
|
+
//是否开启语法检查,默认开启
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: true,
|
|
55
64
|
},
|
|
56
65
|
},
|
|
57
66
|
computed: {
|
|
58
|
-
editorStyle:function(){
|
|
59
|
-
return
|
|
67
|
+
editorStyle: function () {
|
|
68
|
+
return "height:" + this.height;
|
|
60
69
|
},
|
|
61
|
-
modePath: function() {
|
|
62
|
-
return
|
|
70
|
+
modePath: function () {
|
|
71
|
+
return "ace/mode/" + this.mode;
|
|
63
72
|
},
|
|
64
|
-
acData: function() {
|
|
73
|
+
acData: function () {
|
|
65
74
|
let acData = [];
|
|
66
|
-
if (this.mode ==
|
|
75
|
+
if (this.mode == "javascript") {
|
|
67
76
|
acData = [
|
|
68
|
-
{
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
{ meta:
|
|
77
|
+
{
|
|
78
|
+
meta: "VForm API",
|
|
79
|
+
caption: "getWidgetRef",
|
|
80
|
+
value: "getWidgetRef()",
|
|
81
|
+
score: 1,
|
|
82
|
+
},
|
|
83
|
+
{ meta: "VForm API", caption: "getFormRef", value: "getFormRef()", score: 1 },
|
|
84
|
+
{
|
|
85
|
+
meta: "VForm API",
|
|
86
|
+
caption: "addExtraAccessData",
|
|
87
|
+
value: "addExtraAccessData()",
|
|
88
|
+
score: 1,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
meta: "VForm API",
|
|
92
|
+
caption: "clearExtraAccessData",
|
|
93
|
+
value: "clearExtraAccessData()",
|
|
94
|
+
score: 1,
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
meta: "VForm API",
|
|
98
|
+
caption: "getFormParam",
|
|
99
|
+
value: "getFormParam()",
|
|
100
|
+
score: 1,
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
meta: "VForm API",
|
|
104
|
+
caption: "getGlobalConfig",
|
|
105
|
+
value: "getGlobalConfig()",
|
|
106
|
+
score: 1,
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
meta: "snippet",
|
|
110
|
+
caption: "setInterval",
|
|
111
|
+
value: "setInterval(function() {}, 5000);",
|
|
112
|
+
score: 1,
|
|
113
|
+
},
|
|
75
114
|
//TODO: 待补充!!
|
|
76
115
|
];
|
|
77
116
|
}
|
|
78
117
|
return acData;
|
|
79
|
-
}
|
|
118
|
+
},
|
|
80
119
|
},
|
|
81
120
|
mounted() {
|
|
82
121
|
//ace.config.set('basePath', 'https://ks3-cn-beijing.ksyun.com/vform2021/ace')
|
|
83
|
-
ace.config.set(
|
|
122
|
+
ace.config.set("basePath", ACE_BASE_PATH);
|
|
84
123
|
|
|
85
124
|
this.addAutoCompletion(ace); //添加自定义代码提示!!
|
|
86
125
|
|
|
@@ -93,18 +132,18 @@ export default {
|
|
|
93
132
|
tabSize: 2, // 制表符设置为2个空格大小
|
|
94
133
|
readOnly: this.readonly,
|
|
95
134
|
highlightActiveLine: true,
|
|
96
|
-
value: this.codeValue
|
|
135
|
+
value: this.codeValue,
|
|
97
136
|
});
|
|
98
137
|
|
|
99
138
|
this.aceEditor.setOptions({
|
|
100
139
|
enableBasicAutocompletion: true,
|
|
101
140
|
enableSnippets: true, // 设置代码片段提示
|
|
102
|
-
enableLiveAutocompletion: true // 设置自动提示
|
|
141
|
+
enableLiveAutocompletion: true, // 设置自动提示
|
|
103
142
|
});
|
|
104
143
|
|
|
105
|
-
if (this.mode ===
|
|
144
|
+
if (this.mode === "json") {
|
|
106
145
|
this.setJsonMode();
|
|
107
|
-
} else if (this.mode ===
|
|
146
|
+
} else if (this.mode === "css") {
|
|
108
147
|
this.setCssMode();
|
|
109
148
|
}
|
|
110
149
|
|
|
@@ -113,54 +152,100 @@ export default {
|
|
|
113
152
|
}
|
|
114
153
|
|
|
115
154
|
//编辑时同步数据
|
|
116
|
-
this.aceEditor.getSession().on(
|
|
155
|
+
this.aceEditor.getSession().on("change", (ev) => {
|
|
117
156
|
//this.$emit('update:value', this.aceEditor.getValue()) // 触发更新事件, 实现.sync双向绑定!!
|
|
118
|
-
this.$emit(
|
|
157
|
+
this.$emit("input", this.aceEditor.getValue());
|
|
119
158
|
});
|
|
120
159
|
},
|
|
121
160
|
data() {
|
|
122
161
|
return {
|
|
123
162
|
aceEditor: null,
|
|
124
|
-
themePath:
|
|
163
|
+
themePath: "ace/theme/sqlserver", // 不导入 webpack-resolver,该模块路径会报错
|
|
125
164
|
// modePath: 'ace/mode/javascript', // 同上
|
|
126
|
-
codeValue: this.value ||
|
|
165
|
+
codeValue: this.value || "",
|
|
127
166
|
};
|
|
128
167
|
},
|
|
129
|
-
watch: {
|
|
130
|
-
|
|
131
|
-
},
|
|
168
|
+
watch: {},
|
|
132
169
|
methods: {
|
|
133
170
|
addAutoCompletion(ace) {
|
|
134
171
|
let acData = this.acData;
|
|
135
|
-
let langTools = ace.require(
|
|
172
|
+
let langTools = ace.require("ace/ext/language_tools");
|
|
136
173
|
langTools.addCompleter({
|
|
137
|
-
getCompletions: function(editor, session, pos, prefix, callback) {
|
|
174
|
+
getCompletions: function (editor, session, pos, prefix, callback) {
|
|
138
175
|
if (prefix.length === 0) {
|
|
139
176
|
return callback(null, []);
|
|
140
177
|
} else {
|
|
141
178
|
return callback(null, acData);
|
|
142
179
|
}
|
|
143
|
-
}
|
|
180
|
+
},
|
|
144
181
|
});
|
|
145
182
|
},
|
|
146
183
|
|
|
147
184
|
setJsonMode() {
|
|
148
|
-
this.aceEditor.getSession().setMode(
|
|
185
|
+
this.aceEditor.getSession().setMode("ace/mode/json");
|
|
149
186
|
},
|
|
150
187
|
|
|
151
188
|
setCssMode() {
|
|
152
|
-
this.aceEditor.getSession().setMode(
|
|
189
|
+
this.aceEditor.getSession().setMode("ace/mode/css");
|
|
153
190
|
},
|
|
154
191
|
|
|
155
192
|
getEditorAnnotations() {
|
|
156
193
|
return this.aceEditor.getSession().getAnnotations();
|
|
157
194
|
},
|
|
158
|
-
setValue(val){
|
|
195
|
+
setValue(val) {
|
|
159
196
|
this.aceEditor.setValue(val);
|
|
160
|
-
}
|
|
161
|
-
|
|
197
|
+
},
|
|
198
|
+
btnMouseDown(event) {
|
|
199
|
+
let rootDom = document.body.querySelector("#app");
|
|
200
|
+
indexUtil.addClass(rootDom, "ns-resize-ing");
|
|
201
|
+
const editor = this.aceEditor;
|
|
202
|
+
const startY = event.clientY;
|
|
203
|
+
const startHeight = editor.container.clientHeight;
|
|
204
|
+
|
|
205
|
+
const onMouseMove = (moveEvent) => {
|
|
206
|
+
const deltaY = moveEvent.clientY - startY;
|
|
207
|
+
editor.container.style.height = startHeight + deltaY + "px";
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
const onMouseUp = () => {
|
|
211
|
+
indexUtil.removeClass(rootDom, "ns-resize-ing");
|
|
212
|
+
document.removeEventListener("mousemove", onMouseMove);
|
|
213
|
+
document.removeEventListener("mouseup", onMouseUp);
|
|
214
|
+
editor.resize();
|
|
215
|
+
editor.focus();
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
document.addEventListener("mousemove", onMouseMove);
|
|
219
|
+
document.addEventListener("mouseup", onMouseUp);
|
|
220
|
+
},
|
|
221
|
+
},
|
|
162
222
|
};
|
|
163
223
|
</script>
|
|
164
224
|
|
|
165
225
|
<style lang="scss" scoped>
|
|
226
|
+
#editor-resize-bar {
|
|
227
|
+
width: 100%;
|
|
228
|
+
height: 5px;
|
|
229
|
+
cursor: ns-resize;
|
|
230
|
+
position: absolute;
|
|
231
|
+
bottom: 0;
|
|
232
|
+
left: 0;
|
|
233
|
+
}
|
|
234
|
+
.ace-container {
|
|
235
|
+
position: relative;
|
|
236
|
+
.icon-drag {
|
|
237
|
+
position: absolute;
|
|
238
|
+
right: 3px;
|
|
239
|
+
bottom: 3px;
|
|
240
|
+
font-family: "iconfont";
|
|
241
|
+
font-size: 10px;
|
|
242
|
+
cursor: n-resize;
|
|
243
|
+
width: 12px;
|
|
244
|
+
height: 12px;
|
|
245
|
+
line-height: 12px;
|
|
246
|
+
&:before {
|
|
247
|
+
content: "\e61e";
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
166
251
|
</style>
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
icon="el-icon-edit-outline"
|
|
32
32
|
class="btn"
|
|
33
33
|
@click="editFileCategory()"
|
|
34
|
-
:disabled="currentFileCategory
|
|
34
|
+
:disabled="currentFileCategory === null || !currentFileCategory.id"
|
|
35
35
|
v-if="fileObjAuth.editAuth"
|
|
36
36
|
>
|
|
37
37
|
{{ $t2("编辑", "components.fileLibrary.editCategory") }}
|
|
@@ -303,7 +303,7 @@
|
|
|
303
303
|
icon="iconfont icon-icmenu2"
|
|
304
304
|
@click="changeShowType()"
|
|
305
305
|
class="button-sty icon-btn"
|
|
306
|
-
v-show="showType
|
|
306
|
+
v-show="showType === 1"
|
|
307
307
|
>{{ $t2("列表", "components.fileLibrary.tableList") }}
|
|
308
308
|
</el-button>
|
|
309
309
|
<el-button
|
|
@@ -312,7 +312,7 @@
|
|
|
312
312
|
icon="el-icon-menu"
|
|
313
313
|
@click="changeShowType()"
|
|
314
314
|
class="button-sty icon-btn"
|
|
315
|
-
v-show="showType
|
|
315
|
+
v-show="showType === 2"
|
|
316
316
|
>{{ $t2("图示", "components.fileLibrary.imageList") }}
|
|
317
317
|
</el-button>
|
|
318
318
|
</div>
|
|
@@ -321,7 +321,7 @@
|
|
|
321
321
|
<div
|
|
322
322
|
class="containter1"
|
|
323
323
|
ref="containter1"
|
|
324
|
-
v-show="showType
|
|
324
|
+
v-show="showType === 1"
|
|
325
325
|
style="overflow: auto"
|
|
326
326
|
>
|
|
327
327
|
<div class="annex-piclist">
|
|
@@ -458,7 +458,7 @@
|
|
|
458
458
|
</div> -->
|
|
459
459
|
<div
|
|
460
460
|
class="status s-1"
|
|
461
|
-
v-if="!attachment.dirs && attachment.status
|
|
461
|
+
v-if="!attachment.dirs && attachment.status === 1"
|
|
462
462
|
></div>
|
|
463
463
|
<div
|
|
464
464
|
class="img"
|
|
@@ -535,7 +535,7 @@
|
|
|
535
535
|
</div>
|
|
536
536
|
<div class="annex-grid-height">
|
|
537
537
|
<vxe-grid
|
|
538
|
-
v-show="showType
|
|
538
|
+
v-show="showType === 2"
|
|
539
539
|
ref="table-m1"
|
|
540
540
|
v-bind="vxeOption"
|
|
541
541
|
:data="page.records"
|
|
@@ -574,7 +574,7 @@
|
|
|
574
574
|
<a
|
|
575
575
|
href="javascript:void(0);"
|
|
576
576
|
class="a-link"
|
|
577
|
-
v-if="isEdit && fileObjAuth.editAuth
|
|
577
|
+
v-if="isEdit && fileObjAuth.editAuth === 1"
|
|
578
578
|
@click="openPropertiesDialog(row)"
|
|
579
579
|
>
|
|
580
580
|
<el-tooltip
|
|
@@ -590,7 +590,7 @@
|
|
|
590
590
|
<a
|
|
591
591
|
href="javascript:void(0);"
|
|
592
592
|
class="a-link"
|
|
593
|
-
v-if="fileObjAuth.downloadAuth
|
|
593
|
+
v-if="fileObjAuth.downloadAuth === 1"
|
|
594
594
|
@click="downloadSingerFile(row)"
|
|
595
595
|
>
|
|
596
596
|
<el-tooltip
|
|
@@ -606,7 +606,7 @@
|
|
|
606
606
|
<a
|
|
607
607
|
href="javascript:void(0);"
|
|
608
608
|
class="a-link"
|
|
609
|
-
v-if="fileObjAuth.shareAuth
|
|
609
|
+
v-if="fileObjAuth.shareAuth === 1"
|
|
610
610
|
@click="openShareDialog(row)"
|
|
611
611
|
>
|
|
612
612
|
<el-tooltip
|
|
@@ -622,7 +622,7 @@
|
|
|
622
622
|
<a
|
|
623
623
|
href="javascript:void(0);"
|
|
624
624
|
class="a-link"
|
|
625
|
-
v-if="isEdit && row.status != 1 && fileObjAuth.replaceAuth
|
|
625
|
+
v-if="isEdit && row.status != 1 && fileObjAuth.replaceAuth === 1"
|
|
626
626
|
@click="replaceFile(row, rowIndex, items)"
|
|
627
627
|
>
|
|
628
628
|
<el-tooltip
|
|
@@ -638,7 +638,7 @@
|
|
|
638
638
|
<a
|
|
639
639
|
href="javascript:void(0);"
|
|
640
640
|
class="a-link"
|
|
641
|
-
v-if="isEdit && row.status != 1 && fileObjAuth.historyAuth
|
|
641
|
+
v-if="isEdit && row.status != 1 && fileObjAuth.historyAuth === 1"
|
|
642
642
|
@click="openFileHistoryDialog(row)"
|
|
643
643
|
>
|
|
644
644
|
<el-tooltip
|
|
@@ -654,7 +654,7 @@
|
|
|
654
654
|
<a
|
|
655
655
|
href="javascript:void(0);"
|
|
656
656
|
class="a-link"
|
|
657
|
-
v-if="isEdit && row.status != 1 && fileObjAuth.deleteAuth
|
|
657
|
+
v-if="isEdit && row.status != 1 && fileObjAuth.deleteAuth === 1"
|
|
658
658
|
@click="deleteAttach(row)"
|
|
659
659
|
>
|
|
660
660
|
<el-tooltip
|
|
@@ -672,7 +672,7 @@
|
|
|
672
672
|
<a
|
|
673
673
|
href="javascript:void(0);"
|
|
674
674
|
class="a-link"
|
|
675
|
-
v-if="isEdit && isCategoryEdit && fileObjAuth.editAuth
|
|
675
|
+
v-if="isEdit && isCategoryEdit && fileObjAuth.editAuth === 1"
|
|
676
676
|
@click="editFileCategory(row)"
|
|
677
677
|
>
|
|
678
678
|
<el-tooltip
|
|
@@ -688,7 +688,7 @@
|
|
|
688
688
|
<a
|
|
689
689
|
href="javascript:void(0);"
|
|
690
690
|
class="a-link"
|
|
691
|
-
v-if="isEdit && isCategoryEdit && fileObjAuth.deleteDirAuth
|
|
691
|
+
v-if="isEdit && isCategoryEdit && fileObjAuth.deleteDirAuth === 1"
|
|
692
692
|
@click="deleteAttach(row)"
|
|
693
693
|
>
|
|
694
694
|
<el-tooltip
|
|
@@ -776,6 +776,9 @@
|
|
|
776
776
|
>
|
|
777
777
|
<el-input v-model="editCategory.fileName" clearable class="all-width" />
|
|
778
778
|
</el-form-item>
|
|
779
|
+
<el-form-item :label="$t1('关联编码')">
|
|
780
|
+
<el-input v-model="editCategory.relationCode" clearable class="all-width" />
|
|
781
|
+
</el-form-item>
|
|
779
782
|
</el-form>
|
|
780
783
|
</div>
|
|
781
784
|
<span slot="footer" class="dialog-footer">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {selectDialogMixins} from '
|
|
2
|
-
import ElImageViewer from '
|
|
1
|
+
import {selectDialogMixins} from '@base/mixins/selectDialog/index.js';
|
|
2
|
+
import ElImageViewer from '@base/components/VabUpload/image-viewer';
|
|
3
3
|
|
|
4
4
|
let modules;
|
|
5
5
|
modules = {
|