cloud-web-corejs 1.1.0-dev.34 → 1.1.0-dev.36
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/bin/core-resources.js +16 -0
- package/docs/child-app/README.md +6 -3
- package/docs/child-app/activiti-resources.md +63 -0
- package/docs/child-app/generate-prompt.md +7 -1
- package/docs/child-app/luckysheet-resources.md +80 -0
- package/docs/child-app/public-resources-plan.md +288 -0
- package/docs/child-app/resources-implementation.md +101 -0
- package/docs/child-app/tinymce-resources.md +88 -0
- package/docs/child-app/validation.md +4 -3
- package/package.json +10 -2
- package/resource-tools/index.js +126 -0
- package/src/app-bootstrap.js +7 -2
- package/src/components/Tinymce/dynamicLoadScript.js +51 -59
- package/src/components/Tinymce/index.vue +382 -339
- package/src/components/code-editor/index.vue +361 -343
- package/src/components/luckysheet/loadResources.js +64 -0
- package/src/components/luckysheet/view.vue +239 -210
- package/src/components/onlineTalk/index.vue +2 -2
- package/src/components/xform/form-designer/form-widget/field-widget/dropdown-widget.vue +34 -3
- package/src/layout/components/Sidebar/default.vue +17 -16
- package/src/utils/chunkLoadError.js +24 -0
- package/src/utils/featureResources.js +57 -0
- package/src/views/bd/setting/form_template/mixins/list.js +7 -6
- package/src/views/bd/setting/form_template/mixins/list2.js +412 -411
- package/src/views/bd/setting/form_template/mixins/wf_list.js +431 -430
- package/src/views/user/form/form_template/list.vue +527 -506
- package/src/views/user/wf/wf_manage/wfContentDialog.vue +65 -40
- package/src/views/user/wf/wf_obj_config/activiti_wf.vue +134 -133
- package/src/views/user/wf/wf_obj_config/list.vue +747 -746
- package/src/views/user/wf/wf_obj_config/list_form.vue +374 -373
- package/templates/child-app/README.md +2 -0
- package/templates/child-app/core-resources.config.js +15 -0
- package/templates/child-app/gitignore +1 -0
- package/templates/child-app/package.json +5 -0
- package/templates/child-app/vue.config.js +2 -1
|
@@ -1,339 +1,382 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
:class="[fullscreen ? 'fullscreen' : null, readonly ? 'readonly' : null]"
|
|
4
|
-
class="tinymce-container"
|
|
5
|
-
:style="{ width: containerWidth }"
|
|
6
|
-
>
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
<
|
|
10
|
-
</div>
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
type:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
type:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
default: "
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
type:
|
|
87
|
-
default:
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
this.
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
this.
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
.
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
.
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="[fullscreen ? 'fullscreen' : null, readonly ? 'readonly' : null]"
|
|
4
|
+
class="tinymce-container"
|
|
5
|
+
:style="{ width: containerWidth }"
|
|
6
|
+
>
|
|
7
|
+
<div v-if="resourceError" role="alert">
|
|
8
|
+
{{ resourceError }}
|
|
9
|
+
<button type="button" @click="init">重试</button>
|
|
10
|
+
</div>
|
|
11
|
+
<textarea :id="tinymceId" class="tinymce-textarea" v-if="isActivated" />
|
|
12
|
+
<!-- <div class="editor-custom-btn-container">
|
|
13
|
+
<editorImage color="#ED6C44 " class="editor-upload-btn" @successCBK="imageSuccessCBK" />
|
|
14
|
+
</div> -->
|
|
15
|
+
<template v-if="!readonly">
|
|
16
|
+
<div class="editor-custom-btn-container">
|
|
17
|
+
<div class="upload-container">
|
|
18
|
+
<el-button
|
|
19
|
+
icon="el-icon-upload"
|
|
20
|
+
size="mini"
|
|
21
|
+
type="primary"
|
|
22
|
+
@click="handleShow({ key: 'value' })"
|
|
23
|
+
>
|
|
24
|
+
{{ $t2("上传", "components.Tinymce.uploadButton") }}
|
|
25
|
+
</el-button>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
<vab-upload
|
|
29
|
+
ref="vabUpload"
|
|
30
|
+
accept="image/png, image/jpeg"
|
|
31
|
+
@callback="fileConfirm"
|
|
32
|
+
></vab-upload>
|
|
33
|
+
</template>
|
|
34
|
+
</div>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script>
|
|
38
|
+
/**
|
|
39
|
+
* docs:
|
|
40
|
+
* https://panjiachen.github.io/vue-element-admin-site/feature/component/rich-editor.html#tinymce
|
|
41
|
+
*/
|
|
42
|
+
import plugins from "./plugins";
|
|
43
|
+
import toolbar from "./toolbar";
|
|
44
|
+
import load from "./dynamicLoadScript";
|
|
45
|
+
import { richTextResourcePath } from "../../utils/featureResources";
|
|
46
|
+
// import EditorImage from './components/EditorImage.vue'
|
|
47
|
+
|
|
48
|
+
// why use this cdn, detail see https://github.com/PanJiaChen/tinymce-all-in-one
|
|
49
|
+
|
|
50
|
+
export default {
|
|
51
|
+
name: "Tinymce",
|
|
52
|
+
components: { VabUpload: () => import("../../components/VabUpload/index.vue") },
|
|
53
|
+
props: {
|
|
54
|
+
id: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: function () {
|
|
57
|
+
return "vue-tinymce-" + +new Date() + ((Math.random() * 1000).toFixed(0) + "");
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
value: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: "",
|
|
63
|
+
},
|
|
64
|
+
toolbar: {
|
|
65
|
+
type: Array,
|
|
66
|
+
required: false,
|
|
67
|
+
default() {
|
|
68
|
+
return [];
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
menubar: {
|
|
72
|
+
type: String,
|
|
73
|
+
default: "file edit insert view format table",
|
|
74
|
+
},
|
|
75
|
+
height: {
|
|
76
|
+
type: [Number, String],
|
|
77
|
+
required: false,
|
|
78
|
+
default: 360,
|
|
79
|
+
},
|
|
80
|
+
width: {
|
|
81
|
+
type: [Number, String],
|
|
82
|
+
required: false,
|
|
83
|
+
default: "auto",
|
|
84
|
+
},
|
|
85
|
+
color: {
|
|
86
|
+
type: String,
|
|
87
|
+
default: "#1890ff",
|
|
88
|
+
},
|
|
89
|
+
readonly: {
|
|
90
|
+
type: Boolean,
|
|
91
|
+
default: () => false,
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
data() {
|
|
95
|
+
return {
|
|
96
|
+
resourceError: "",
|
|
97
|
+
resourceBase: "",
|
|
98
|
+
initializing: false,
|
|
99
|
+
initGeneration: 0,
|
|
100
|
+
hasChange: false,
|
|
101
|
+
hasInit: false,
|
|
102
|
+
isActivated: true,
|
|
103
|
+
tinymceId: this.id,
|
|
104
|
+
fullscreen: false,
|
|
105
|
+
languageTypeList: {
|
|
106
|
+
en: "en",
|
|
107
|
+
zh: "zh_CN",
|
|
108
|
+
es: "es_MX",
|
|
109
|
+
ja: "ja",
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
},
|
|
113
|
+
computed: {
|
|
114
|
+
containerWidth() {
|
|
115
|
+
const width = this.width;
|
|
116
|
+
if (/^[\d]+(\.[\d]+)?$/.test(width)) {
|
|
117
|
+
// matches `100`, `'100'`
|
|
118
|
+
return `${width}px`;
|
|
119
|
+
}
|
|
120
|
+
return width;
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
watch: {
|
|
124
|
+
value(val) {
|
|
125
|
+
if (!this.hasChange && this.hasInit) {
|
|
126
|
+
this.$nextTick(() => {
|
|
127
|
+
const editor = window.tinymce && window.tinymce.get(this.tinymceId);
|
|
128
|
+
if (editor) editor.setContent(val || "");
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
mounted() {
|
|
134
|
+
this.init();
|
|
135
|
+
},
|
|
136
|
+
activated() {
|
|
137
|
+
this.isActivated = true;
|
|
138
|
+
this.$nextTick(() => this.init());
|
|
139
|
+
},
|
|
140
|
+
deactivated() {
|
|
141
|
+
this.destroyTinymce();
|
|
142
|
+
this.isActivated = false;
|
|
143
|
+
},
|
|
144
|
+
beforeDestroy() {
|
|
145
|
+
this.isActivated = false;
|
|
146
|
+
this.destroyTinymce();
|
|
147
|
+
},
|
|
148
|
+
methods: {
|
|
149
|
+
handleShow(data) {
|
|
150
|
+
this.$baseUpload.open({
|
|
151
|
+
accept: "image/png, image/jpeg",
|
|
152
|
+
callback: this.fileConfirm,
|
|
153
|
+
// pickPrivateProfile:this.pickPrivateProfile,
|
|
154
|
+
// confirmUpload: this.confirmUpload,
|
|
155
|
+
// otherParams: this.$attrs,
|
|
156
|
+
});
|
|
157
|
+
// this.$refs['vabUpload'].handleShow(data);
|
|
158
|
+
},
|
|
159
|
+
init() {
|
|
160
|
+
if (!this.isActivated || this.hasInit || this.initializing) return;
|
|
161
|
+
const generation = ++this.initGeneration;
|
|
162
|
+
this.initializing = true;
|
|
163
|
+
this.resourceError = "";
|
|
164
|
+
try {
|
|
165
|
+
const locale = this.$i18n && this.$i18n.locale || "zh";
|
|
166
|
+
this.resourceBase = richTextResourcePath(this.languageTypeList[locale] || "en");
|
|
167
|
+
} catch (error) {
|
|
168
|
+
this.resourceFailed(error);
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
load(this.resourceBase + "tinymce.min.js", (err) => {
|
|
172
|
+
if (generation !== this.initGeneration || !this.isActivated) return;
|
|
173
|
+
if (err) {
|
|
174
|
+
this.resourceFailed(err);
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
try { this.initTinymce(generation); } catch (error) { this.resourceFailed(error); }
|
|
178
|
+
});
|
|
179
|
+
// this.initTinymce()
|
|
180
|
+
},
|
|
181
|
+
resourceFailed(error) {
|
|
182
|
+
this.initializing = false;
|
|
183
|
+
this.resourceError = error.message;
|
|
184
|
+
this.$emit("resource-error", error);
|
|
185
|
+
},
|
|
186
|
+
initTinymce(generation) {
|
|
187
|
+
const _this = this;
|
|
188
|
+
let locale = this.$i18n && this.$i18n.locale ? this.$i18n.locale : "zh";
|
|
189
|
+
const language = this.languageTypeList[locale] || "en";
|
|
190
|
+
window.tinymce.overrideDefaults({ ...window.tinymce.defaultSettings,
|
|
191
|
+
base_url: this.resourceBase, suffix: ".min" });
|
|
192
|
+
const initialization = window.tinymce.init({
|
|
193
|
+
target: this.$el.querySelector("textarea"),
|
|
194
|
+
language,
|
|
195
|
+
language_url: language === "en" ? undefined : this.resourceBase + "langs/" + language + ".js",
|
|
196
|
+
skin_url: this.resourceBase + "skins/lightgray",
|
|
197
|
+
height: this.height,
|
|
198
|
+
body_class: "panel-body ",
|
|
199
|
+
object_resizing: false,
|
|
200
|
+
toolbar: this.toolbar.length > 0 ? this.toolbar : toolbar,
|
|
201
|
+
menubar: this.menubar,
|
|
202
|
+
plugins: plugins,
|
|
203
|
+
end_container_on_empty_block: true,
|
|
204
|
+
powerpaste_word_import: "clean",
|
|
205
|
+
code_dialog_height: 450,
|
|
206
|
+
code_dialog_width: 1000,
|
|
207
|
+
advlist_bullet_styles: "square",
|
|
208
|
+
advlist_number_styles: "default",
|
|
209
|
+
imagetools_cors_hosts: ["www.tinymce.com", "codepen.io"],
|
|
210
|
+
default_link_target: "_blank",
|
|
211
|
+
link_title: false,
|
|
212
|
+
nonbreaking_force_tab: true, // inserting nonbreaking space need Nonbreaking Space Plugin
|
|
213
|
+
paste_data_images: true, // 允许粘贴图像
|
|
214
|
+
readonly: this.readonly,
|
|
215
|
+
init_instance_callback: (editor) => {
|
|
216
|
+
if (generation !== this.initGeneration || !this.isActivated) {
|
|
217
|
+
editor.remove();
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
if (_this.value) {
|
|
221
|
+
editor.setContent(_this.value);
|
|
222
|
+
}
|
|
223
|
+
_this.hasInit = true;
|
|
224
|
+
_this.initializing = false;
|
|
225
|
+
editor.on("NodeChange Change KeyUp SetContent", () => {
|
|
226
|
+
this.hasChange = true;
|
|
227
|
+
this.$emit("input", editor.getContent());
|
|
228
|
+
});
|
|
229
|
+
},
|
|
230
|
+
setup(editor) {
|
|
231
|
+
editor.on("FullscreenStateChanged", (e) => {
|
|
232
|
+
_this.fullscreen = e.state;
|
|
233
|
+
});
|
|
234
|
+
},
|
|
235
|
+
// it will try to keep these URLs intact
|
|
236
|
+
// https://www.tiny.cloud/docs-3x/reference/configuration/Configuration3x@convert_urls/
|
|
237
|
+
// https://stackoverflow.com/questions/5196205/disable-tinymce-absolute-to-relative-url-conversions
|
|
238
|
+
convert_urls: false,
|
|
239
|
+
// 整合七牛上传
|
|
240
|
+
// images_dataimg_filter(img) {
|
|
241
|
+
// setTimeout(() => {
|
|
242
|
+
// const $image = $(img);
|
|
243
|
+
// $image.removeAttr('width');
|
|
244
|
+
// $image.removeAttr('height');
|
|
245
|
+
// if ($image[0].height && $image[0].width) {
|
|
246
|
+
// $image.attr('data-wscntype', 'image');
|
|
247
|
+
// $image.attr('data-wscnh', $image[0].height);
|
|
248
|
+
// $image.attr('data-wscnw', $image[0].width);
|
|
249
|
+
// $image.addClass('wscnph');
|
|
250
|
+
// }
|
|
251
|
+
// }, 0);
|
|
252
|
+
// return img
|
|
253
|
+
// },
|
|
254
|
+
images_upload_handler(blobInfo, success, failure, progress) {
|
|
255
|
+
/* progress(0);
|
|
256
|
+
_this.$baseUpload.upload({
|
|
257
|
+
file:blobInfo.blob(),
|
|
258
|
+
onProgress:(e)=>{
|
|
259
|
+
progress(e.percent)
|
|
260
|
+
},
|
|
261
|
+
callback:(res)=>{
|
|
262
|
+
if(res.type=="success"){
|
|
263
|
+
let url = res.objx.domain + res.objx.url;
|
|
264
|
+
success(url);
|
|
265
|
+
progress(100);
|
|
266
|
+
}else{
|
|
267
|
+
failure(res.content)
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
error:(e)=>{
|
|
271
|
+
failure(e.message)
|
|
272
|
+
}
|
|
273
|
+
}) */
|
|
274
|
+
/* progress(0);
|
|
275
|
+
const token = _this.$store.getters.token;
|
|
276
|
+
getToken(token).then(response => {
|
|
277
|
+
const url = response.data.qiniu_url;
|
|
278
|
+
const formData = new FormData();
|
|
279
|
+
formData.append('token', response.data.qiniu_token);
|
|
280
|
+
formData.append('key', response.data.qiniu_key);
|
|
281
|
+
formData.append('file', blobInfo.blob(), url);
|
|
282
|
+
upload(formData).then(() => {
|
|
283
|
+
success(url);
|
|
284
|
+
progress(100);
|
|
285
|
+
})
|
|
286
|
+
}).catch(err => {
|
|
287
|
+
failure('出现未知问题,刷新页面,或者联系程序员')
|
|
288
|
+
console.log(err);
|
|
289
|
+
}); */
|
|
290
|
+
},
|
|
291
|
+
});
|
|
292
|
+
if (initialization && initialization.catch) initialization.catch(error => {
|
|
293
|
+
if (generation === this.initGeneration) this.resourceFailed(error);
|
|
294
|
+
});
|
|
295
|
+
},
|
|
296
|
+
destroyTinymce() {
|
|
297
|
+
this.initGeneration++;
|
|
298
|
+
this.initializing = false;
|
|
299
|
+
this.hasInit = false;
|
|
300
|
+
this.hasChange = false;
|
|
301
|
+
if (window.tinymce && window.tinymce.get) {
|
|
302
|
+
const tinymce = window.tinymce.get(this.tinymceId);
|
|
303
|
+
if (tinymce && this.fullscreen) {
|
|
304
|
+
tinymce.execCommand("mceFullScreen");
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
if (tinymce) {
|
|
308
|
+
tinymce.remove();
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
setContent(value) {
|
|
313
|
+
const editor = window.tinymce && window.tinymce.get(this.tinymceId);
|
|
314
|
+
if (editor) editor.setContent(value);
|
|
315
|
+
},
|
|
316
|
+
getContent() {
|
|
317
|
+
const editor = window.tinymce && window.tinymce.get(this.tinymceId);
|
|
318
|
+
return editor ? editor.getContent() : "";
|
|
319
|
+
},
|
|
320
|
+
imageSuccessCBK(arr) {
|
|
321
|
+
arr.forEach((v) =>
|
|
322
|
+
window.tinymce
|
|
323
|
+
.get(this.tinymceId)
|
|
324
|
+
.insertContent(`<img class="wscnph" src="${v.url}" >`)
|
|
325
|
+
);
|
|
326
|
+
},
|
|
327
|
+
fileConfirm(arr) {
|
|
328
|
+
let txt = "";
|
|
329
|
+
arr.forEach((v) => {
|
|
330
|
+
let realUrl = v.domain + v.url;
|
|
331
|
+
txt = txt + '<img class="wscnph" src="' + realUrl + '" >';
|
|
332
|
+
});
|
|
333
|
+
window.tinymce.get(this.tinymceId).insertContent(`<p>${txt}</p>`);
|
|
334
|
+
},
|
|
335
|
+
},
|
|
336
|
+
};
|
|
337
|
+
</script>
|
|
338
|
+
|
|
339
|
+
<style lang="scss">
|
|
340
|
+
@import "./mce-chrome.scss";
|
|
341
|
+
</style>
|
|
342
|
+
<style lang="scss" scoped>
|
|
343
|
+
.tinymce-container {
|
|
344
|
+
position: relative;
|
|
345
|
+
line-height: normal;
|
|
346
|
+
|
|
347
|
+
&.readonly {
|
|
348
|
+
::v-deep .mce-top-part {
|
|
349
|
+
display: none !important;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.tinymce-container {
|
|
355
|
+
::v-deep {
|
|
356
|
+
.mce-fullscreen {
|
|
357
|
+
z-index: 10000;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.tinymce-textarea {
|
|
363
|
+
visibility: hidden;
|
|
364
|
+
z-index: -1;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.editor-custom-btn-container {
|
|
368
|
+
position: absolute;
|
|
369
|
+
right: 4px;
|
|
370
|
+
top: 4px;
|
|
371
|
+
/*z-index: 2005;*/
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.fullscreen .editor-custom-btn-container {
|
|
375
|
+
z-index: 10000;
|
|
376
|
+
position: fixed;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.editor-upload-btn {
|
|
380
|
+
display: inline-block;
|
|
381
|
+
}
|
|
382
|
+
</style>
|