cloud-web-corejs 1.1.0-dev.33 → 1.1.0-dev.35

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