15.js 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833
  1. webpackJsonp([15],{
  2. /***/ 332:
  3. /***/ (function(module, exports, __webpack_require__) {
  4. var disposed = false
  5. function injectStyle (ssrContext) {
  6. if (disposed) return
  7. __webpack_require__(333)
  8. __webpack_require__(335)
  9. }
  10. var normalizeComponent = __webpack_require__(2)
  11. /* script */
  12. var __vue_script__ = __webpack_require__(337)
  13. /* template */
  14. var __vue_template__ = __webpack_require__(338)
  15. /* template functional */
  16. var __vue_template_functional__ = false
  17. /* styles */
  18. var __vue_styles__ = injectStyle
  19. /* scopeId */
  20. var __vue_scopeId__ = "data-v-c6b4dc88"
  21. /* moduleIdentifier (server only) */
  22. var __vue_module_identifier__ = null
  23. var Component = normalizeComponent(
  24. __vue_script__,
  25. __vue_template__,
  26. __vue_template_functional__,
  27. __vue_styles__,
  28. __vue_scopeId__,
  29. __vue_module_identifier__
  30. )
  31. Component.options.__file = "resources/assets/js/main/components/TEditor.vue"
  32. /* hot reload */
  33. if (false) {(function () {
  34. var hotAPI = require("vue-hot-reload-api")
  35. hotAPI.install(require("vue"), false)
  36. if (!hotAPI.compatible) return
  37. module.hot.accept()
  38. if (!module.hot.data) {
  39. hotAPI.createRecord("data-v-c6b4dc88", Component.options)
  40. } else {
  41. hotAPI.reload("data-v-c6b4dc88", Component.options)
  42. }
  43. module.hot.dispose(function (data) {
  44. disposed = true
  45. })
  46. })()}
  47. module.exports = Component.exports
  48. /***/ }),
  49. /***/ 333:
  50. /***/ (function(module, exports, __webpack_require__) {
  51. // style-loader: Adds some css to the DOM by adding a <style> tag
  52. // load the styles
  53. var content = __webpack_require__(334);
  54. if(typeof content === 'string') content = [[module.i, content, '']];
  55. if(content.locals) module.exports = content.locals;
  56. // add the styles to the DOM
  57. var update = __webpack_require__(1)("b8965312", content, false, {});
  58. // Hot Module Replacement
  59. if(false) {
  60. // When the styles change, update the <style> tags
  61. if(!content.locals) {
  62. module.hot.accept("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-c6b4dc88\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./TEditor.vue", function() {
  63. var newContent = require("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-c6b4dc88\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./TEditor.vue");
  64. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  65. update(newContent);
  66. });
  67. }
  68. // When the module is disposed, remove the <style> tags
  69. module.hot.dispose(function() { update(); });
  70. }
  71. /***/ }),
  72. /***/ 334:
  73. /***/ (function(module, exports, __webpack_require__) {
  74. exports = module.exports = __webpack_require__(0)(false);
  75. // imports
  76. // module
  77. exports.push([module.i, "\n.teditor-box textarea {\n opacity: 0;\n}\n.teditor-box .tox-tinymce {\n -webkit-box-shadow: none;\n box-shadow: none;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n border-color: #dddee1;\n border-radius: 4px;\n overflow: hidden;\n}\n.teditor-box .tox-tinymce .tox-statusbar span.tox-statusbar__branding a {\n display: none;\n}\n.teditor-transfer {\n background-color: #ffffff;\n}\n.teditor-transfer .tox-toolbar > div:last-child > button:last-child {\n margin-right: 64px;\n}\n.teditor-transfer .ivu-modal-header {\n display: none;\n}\n.teditor-transfer .ivu-modal-close {\n top: 7px;\n z-index: 2;\n}\n.teditor-transfer .teditor-transfer-body {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\n}\n.teditor-transfer .teditor-transfer-body textarea {\n opacity: 0;\n}\n.teditor-transfer .teditor-transfer-body .tox-tinymce {\n border: 0;\n}\n.teditor-transfer .teditor-transfer-body .tox-tinymce .tox-statusbar span.tox-statusbar__branding a {\n display: none;\n}\n.tox.tox-silver-sink {\n z-index: 13000;\n}\n", ""]);
  78. // exports
  79. /***/ }),
  80. /***/ 335:
  81. /***/ (function(module, exports, __webpack_require__) {
  82. // style-loader: Adds some css to the DOM by adding a <style> tag
  83. // load the styles
  84. var content = __webpack_require__(336);
  85. if(typeof content === 'string') content = [[module.i, content, '']];
  86. if(content.locals) module.exports = content.locals;
  87. // add the styles to the DOM
  88. var update = __webpack_require__(1)("4b0c3b6f", content, false, {});
  89. // Hot Module Replacement
  90. if(false) {
  91. // When the styles change, update the <style> tags
  92. if(!content.locals) {
  93. module.hot.accept("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-c6b4dc88\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./TEditor.vue", function() {
  94. var newContent = require("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-c6b4dc88\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./TEditor.vue");
  95. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  96. update(newContent);
  97. });
  98. }
  99. // When the module is disposed, remove the <style> tags
  100. module.hot.dispose(function() { update(); });
  101. }
  102. /***/ }),
  103. /***/ 336:
  104. /***/ (function(module, exports, __webpack_require__) {
  105. exports = module.exports = __webpack_require__(0)(false);
  106. // imports
  107. // module
  108. exports.push([module.i, "\n.teditor-loadstyle[data-v-c6b4dc88] {\n width: 100%;\n height: 180px;\n overflow: hidden;\n position: relative;\n}\n.teditor-loadedstyle[data-v-c6b4dc88] {\n width: 100%;\n max-height: inherit;\n overflow: inherit;\n position: relative;\n}\n.upload-control[data-v-c6b4dc88] {\n display: none;\n width: 0;\n height: 0;\n overflow: hidden;\n}\n", ""]);
  109. // exports
  110. /***/ }),
  111. /***/ 337:
  112. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113. "use strict";
  114. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  115. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tinymce_tinymce__ = __webpack_require__(53);
  116. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tinymce_tinymce___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_tinymce_tinymce__);
  117. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ImgUpload__ = __webpack_require__(17);
  118. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ImgUpload___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__ImgUpload__);
  119. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  120. //
  121. //
  122. //
  123. //
  124. //
  125. //
  126. //
  127. //
  128. //
  129. //
  130. //
  131. //
  132. //
  133. //
  134. //
  135. //
  136. //
  137. //
  138. //
  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. /* harmony default export */ __webpack_exports__["default"] = ({
  258. name: 'TEditor',
  259. components: { ImgUpload: __WEBPACK_IMPORTED_MODULE_1__ImgUpload___default.a },
  260. props: {
  261. id: {
  262. type: String,
  263. default: function _default() {
  264. return "tinymce_" + Math.round(Math.random() * 10000);
  265. }
  266. },
  267. value: {
  268. default: ''
  269. },
  270. height: {
  271. default: 360
  272. },
  273. htmlClass: {
  274. default: '',
  275. type: String
  276. },
  277. plugins: {
  278. type: Array,
  279. default: function _default() {
  280. return ['advlist autolink lists link image charmap print preview hr anchor pagebreak imagetools', 'searchreplace visualblocks visualchars code', 'insertdatetime media nonbreaking save table contextmenu directionality', 'emoticons paste textcolor colorpicker imagetools codesample'];
  281. }
  282. },
  283. toolbar: {
  284. type: String,
  285. default: ' undo redo | styleselect | uploadImages | uploadFiles | bold italic underline forecolor backcolor | alignleft aligncenter alignright | bullist numlist outdent indent | link image emoticons media codesample | preview screenload'
  286. },
  287. other_options: {
  288. type: Object,
  289. default: function _default() {
  290. return {};
  291. }
  292. },
  293. readonly: {
  294. type: Boolean,
  295. default: false
  296. }
  297. },
  298. data: function data() {
  299. return {
  300. content: '',
  301. editor: null,
  302. editorT: null,
  303. cTinyMce: null,
  304. checkerTimeout: null,
  305. isTyping: false,
  306. spinShow: true,
  307. transfer: false,
  308. uploadIng: 0,
  309. uploadFormat: ['jpg', 'jpeg', 'png', 'gif', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'esp', 'pdf', 'rar', 'zip', 'gz', 'ai', 'avi', 'bmp', 'cdr', 'eps', 'mov', 'mp3', 'mp4', 'pr', 'psd', 'svg', 'tif'],
  310. actionUrl: $A.apiUrl('system/fileupload'),
  311. params: { token: $A.getToken() },
  312. maxSize: 204800
  313. };
  314. },
  315. mounted: function mounted() {
  316. this.content = this.value;
  317. this.init();
  318. },
  319. activated: function activated() {
  320. this.content = this.value;
  321. this.init();
  322. },
  323. deactivated: function deactivated() {
  324. if (this.editor !== null) {
  325. this.editor.destroy();
  326. }
  327. this.spinShow = true;
  328. $A(this.$refs.myTextarea).show();
  329. },
  330. watch: {
  331. value: function value(newValue) {
  332. if (newValue == null) {
  333. newValue = "";
  334. }
  335. if (!this.isTyping) {
  336. if (this.getEditor() !== null) {
  337. this.getEditor().setContent(newValue);
  338. } else {
  339. this.content = newValue;
  340. }
  341. }
  342. },
  343. readonly: function readonly(value) {
  344. if (this.editor !== null) {
  345. if (value) {
  346. this.editor.setMode('readonly');
  347. } else {
  348. this.editor.setMode('design');
  349. }
  350. }
  351. }
  352. },
  353. methods: {
  354. init: function init() {
  355. var _this = this;
  356. this.$nextTick(function () {
  357. __WEBPACK_IMPORTED_MODULE_0_tinymce_tinymce___default.a.init(_this.concatAssciativeArrays(_this.options(false), _this.other_options));
  358. });
  359. },
  360. initTransfer: function initTransfer() {
  361. var _this2 = this;
  362. this.$nextTick(function () {
  363. __WEBPACK_IMPORTED_MODULE_0_tinymce_tinymce___default.a.init(_this2.concatAssciativeArrays(_this2.options(true), _this2.other_options));
  364. });
  365. },
  366. options: function options(isFull) {
  367. var _this3 = this;
  368. return {
  369. selector: (isFull ? '#T_' : '#') + this.id,
  370. base_url: $A.serverUrl('js/build'),
  371. language: "zh_CN",
  372. toolbar: this.toolbar,
  373. plugins: this.plugins,
  374. save_onsavecallback: function save_onsavecallback(e) {
  375. _this3.$emit('editorSave', e);
  376. },
  377. paste_data_images: true,
  378. menu: {
  379. view: {
  380. title: 'View',
  381. items: 'code | visualaid visualchars visualblocks | spellchecker | preview fullscreen screenload | showcomments'
  382. },
  383. insert: {
  384. title: "Insert",
  385. items: "image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime | uploadImages browseImages | uploadFiles"
  386. }
  387. },
  388. codesample_languages: [{ text: "HTML/VUE/XML", value: "markup" }, { text: "JavaScript", value: "javascript" }, { text: "CSS", value: "css" }, { text: "PHP", value: "php" }, { text: "Ruby", value: "ruby" }, { text: "Python", value: "python" }, { text: "Java", value: "java" }, { text: "C", value: "c" }, { text: "C#", value: "csharp" }, { text: "C++", value: "cpp" }],
  389. height: isFull ? '100%' : $A.rightExists(this.height, '%') ? this.height : $A.runNum(this.height) || 360,
  390. resize: !isFull,
  391. convert_urls: false,
  392. toolbar_mode: 'sliding',
  393. toolbar_drawer: 'floating',
  394. setup: function setup(editor) {
  395. editor.ui.registry.addMenuButton('uploadImages', {
  396. text: _this3.$L('图片'),
  397. tooltip: _this3.$L('上传/浏览 图片'),
  398. fetch: function fetch(callback) {
  399. var items = [{
  400. type: 'menuitem',
  401. text: _this3.$L('上传图片'),
  402. onAction: function onAction() {
  403. _this3.$refs.myUpload.handleClick();
  404. }
  405. }, {
  406. type: 'menuitem',
  407. text: _this3.$L('浏览图片'),
  408. onAction: function onAction() {
  409. _this3.$refs.myUpload.browsePicture();
  410. }
  411. }];
  412. callback(items);
  413. }
  414. });
  415. editor.ui.registry.addMenuItem('uploadImages', {
  416. text: _this3.$L('上传图片'),
  417. onAction: function onAction() {
  418. _this3.$refs.myUpload.handleClick();
  419. }
  420. });
  421. editor.ui.registry.addMenuItem('browseImages', {
  422. text: _this3.$L('浏览图片'),
  423. onAction: function onAction() {
  424. _this3.$refs.myUpload.browsePicture();
  425. }
  426. });
  427. editor.ui.registry.addButton('uploadFiles', {
  428. text: _this3.$L('文件'),
  429. tooltip: _this3.$L('上传文件'),
  430. onAction: function onAction() {
  431. if (_this3.handleBeforeUpload()) {
  432. _this3.$refs.fileUpload.handleClick();
  433. }
  434. }
  435. });
  436. editor.ui.registry.addMenuItem('uploadFiles', {
  437. text: _this3.$L('上传文件'),
  438. onAction: function onAction() {
  439. if (_this3.handleBeforeUpload()) {
  440. _this3.$refs.fileUpload.handleClick();
  441. }
  442. }
  443. });
  444. if (isFull) {
  445. editor.ui.registry.addButton('screenload', {
  446. icon: 'fullscreen',
  447. tooltip: _this3.$L('退出全屏'),
  448. onAction: function onAction() {
  449. _this3.closeFull();
  450. }
  451. });
  452. editor.ui.registry.addMenuItem('screenload', {
  453. text: _this3.$L('退出全屏'),
  454. onAction: function onAction() {
  455. _this3.closeFull();
  456. }
  457. });
  458. editor.on('Init', function (e) {
  459. _this3.editorT = editor;
  460. _this3.editorT.setContent(_this3.content);
  461. if (_this3.readonly) {
  462. _this3.editorT.setMode('readonly');
  463. } else {
  464. _this3.editorT.setMode('design');
  465. }
  466. });
  467. } else {
  468. editor.ui.registry.addButton('screenload', {
  469. icon: 'fullscreen',
  470. tooltip: _this3.$L('全屏'),
  471. onAction: function onAction() {
  472. _this3.content = editor.getContent();
  473. _this3.transfer = true;
  474. _this3.initTransfer();
  475. }
  476. });
  477. editor.ui.registry.addMenuItem('screenload', {
  478. text: _this3.$L('全屏'),
  479. onAction: function onAction() {
  480. _this3.content = editor.getContent();
  481. _this3.transfer = true;
  482. _this3.initTransfer();
  483. }
  484. });
  485. editor.on('Init', function (e) {
  486. _this3.spinShow = false;
  487. _this3.editor = editor;
  488. _this3.editor.setContent(_this3.content);
  489. if (_this3.readonly) {
  490. _this3.editor.setMode('readonly');
  491. } else {
  492. _this3.editor.setMode('design');
  493. }
  494. _this3.$emit('editorInit', _this3.editor);
  495. });
  496. editor.on('KeyUp', function (e) {
  497. if (_this3.editor !== null) {
  498. _this3.submitNewContent();
  499. }
  500. });
  501. editor.on('Change', function (e) {
  502. if (_this3.editor !== null) {
  503. if (_this3.getContent() !== _this3.value) {
  504. _this3.submitNewContent();
  505. }
  506. _this3.$emit('editorChange', e);
  507. }
  508. });
  509. }
  510. }
  511. };
  512. },
  513. closeFull: function closeFull() {
  514. this.content = this.getContent();
  515. this.$emit('input', this.content);
  516. this.transfer = false;
  517. if (this.editorT != null) {
  518. this.editorT.destroy();
  519. this.editorT = null;
  520. }
  521. },
  522. transferChange: function transferChange(visible) {
  523. if (!visible && this.editorT != null) {
  524. this.content = this.editorT.getContent();
  525. this.$emit('input', this.content);
  526. this.editorT.destroy();
  527. this.editorT = null;
  528. }
  529. },
  530. getEditor: function getEditor() {
  531. return this.transfer ? this.editorT : this.editor;
  532. },
  533. concatAssciativeArrays: function concatAssciativeArrays(array1, array2) {
  534. if (array2.length === 0) return array1;
  535. if (array1.length === 0) return array2;
  536. var dest = [];
  537. for (var key in array1) {
  538. if (array1.hasOwnProperty(key)) {
  539. dest[key] = array1[key];
  540. }
  541. }
  542. for (var _key in array2) {
  543. if (array2.hasOwnProperty(_key)) {
  544. dest[_key] = array2[_key];
  545. }
  546. }
  547. return dest;
  548. },
  549. submitNewContent: function submitNewContent() {
  550. var _this4 = this;
  551. this.isTyping = true;
  552. if (this.checkerTimeout !== null) {
  553. clearTimeout(this.checkerTimeout);
  554. }
  555. this.checkerTimeout = setTimeout(function () {
  556. _this4.isTyping = false;
  557. }, 300);
  558. this.$emit('input', this.getContent());
  559. },
  560. insertContent: function insertContent(content) {
  561. if (this.getEditor() !== null) {
  562. this.getEditor().insertContent(content);
  563. } else {
  564. this.content += content;
  565. }
  566. },
  567. getContent: function getContent() {
  568. if (this.getEditor() === null) {
  569. return "";
  570. }
  571. return this.getEditor().getContent();
  572. },
  573. insertImage: function insertImage(src) {
  574. this.insertContent('<img src="' + src + '">');
  575. },
  576. editorImage: function editorImage(lists) {
  577. for (var i = 0; i < lists.length; i++) {
  578. var item = lists[i];
  579. if ((typeof item === 'undefined' ? 'undefined' : _typeof(item)) === 'object' && typeof item.url === "string") {
  580. this.insertImage(item.url);
  581. }
  582. }
  583. },
  584. /********************文件上传部分************************/
  585. handleProgress: function handleProgress() {
  586. //开始上传
  587. this.uploadIng++;
  588. },
  589. handleSuccess: function handleSuccess(res, file) {
  590. //上传完成
  591. this.uploadIng--;
  592. if (res.ret === 1) {
  593. this.insertContent('<a href="' + res.data.url + '" target="_blank">' + res.data.name + ' (' + $A.bytesToSize(res.data.size * 1024) + ')</a>');
  594. } else {
  595. this.$Modal.warning({
  596. title: this.$L('上传失败'),
  597. content: this.$L('文件 % 上传失败,%', file.name, res.msg)
  598. });
  599. }
  600. },
  601. handleError: function handleError() {
  602. //上传错误
  603. this.uploadIng--;
  604. },
  605. handleFormatError: function handleFormatError(file) {
  606. //上传类型错误
  607. this.$Modal.warning({
  608. title: this.$L('文件格式不正确'),
  609. content: this.$L('文件 % 格式不正确,仅支持上传:%', file.name, this.uploadFormat.join(','))
  610. });
  611. },
  612. handleMaxSize: function handleMaxSize(file) {
  613. //上传大小错误
  614. this.$Modal.warning({
  615. title: this.$L('超出文件大小限制'),
  616. content: this.$L('文件 % 太大,不能超过%。', file.name, $A.bytesToSize(this.maxSize * 1024))
  617. });
  618. },
  619. handleBeforeUpload: function handleBeforeUpload() {
  620. //上传前判断
  621. this.params = {
  622. token: $A.getToken()
  623. };
  624. return true;
  625. }
  626. }
  627. });
  628. /***/ }),
  629. /***/ 338:
  630. /***/ (function(module, exports, __webpack_require__) {
  631. var render = function() {
  632. var _vm = this
  633. var _h = _vm.$createElement
  634. var _c = _vm._self._c || _h
  635. return _c(
  636. "div",
  637. [
  638. _c(
  639. "div",
  640. {
  641. staticClass: "teditor-box",
  642. class: [_vm.spinShow ? "teditor-loadstyle" : "teditor-loadedstyle"]
  643. },
  644. [
  645. _c("textarea", { ref: "myTextarea", attrs: { id: _vm.id } }, [
  646. _vm._v(_vm._s(_vm.content))
  647. ]),
  648. _vm._v(" "),
  649. _vm.spinShow
  650. ? _c(
  651. "Spin",
  652. { attrs: { fix: "" } },
  653. [
  654. _c("Icon", {
  655. staticClass: "upload-control-spin-icon-load",
  656. attrs: { type: "ios-loading", size: "18" }
  657. }),
  658. _vm._v(" "),
  659. _c("div", [_vm._v(_vm._s(_vm.$L("加载组件中...")))])
  660. ],
  661. 1
  662. )
  663. : _vm._e(),
  664. _vm._v(" "),
  665. _c("ImgUpload", {
  666. ref: "myUpload",
  667. staticClass: "upload-control",
  668. attrs: { type: "callback", uploadIng: _vm.uploadIng, num: "50" },
  669. on: {
  670. "update:uploadIng": function($event) {
  671. _vm.uploadIng = $event
  672. },
  673. "update:upload-ing": function($event) {
  674. _vm.uploadIng = $event
  675. },
  676. "on-callback": _vm.editorImage
  677. }
  678. }),
  679. _vm._v(" "),
  680. _c("Upload", {
  681. ref: "fileUpload",
  682. staticClass: "upload-control",
  683. attrs: {
  684. name: "files",
  685. action: _vm.actionUrl,
  686. data: _vm.params,
  687. multiple: "",
  688. format: _vm.uploadFormat,
  689. "show-upload-list": false,
  690. "max-size": _vm.maxSize,
  691. "on-progress": _vm.handleProgress,
  692. "on-success": _vm.handleSuccess,
  693. "on-error": _vm.handleError,
  694. "on-format-error": _vm.handleFormatError,
  695. "on-exceeded-size": _vm.handleMaxSize,
  696. "before-upload": _vm.handleBeforeUpload
  697. }
  698. })
  699. ],
  700. 1
  701. ),
  702. _vm._v(" "),
  703. _vm.uploadIng > 0
  704. ? _c(
  705. "Spin",
  706. { attrs: { fix: "" } },
  707. [
  708. _c("Icon", {
  709. staticClass: "upload-control-spin-icon-load",
  710. attrs: { type: "ios-loading" }
  711. }),
  712. _vm._v(" "),
  713. _c("div", [_vm._v(_vm._s(_vm.$L("正在上传文件...")))])
  714. ],
  715. 1
  716. )
  717. : _vm._e(),
  718. _vm._v(" "),
  719. _c(
  720. "Modal",
  721. {
  722. staticClass: "teditor-transfer",
  723. attrs: { "footer-hide": "", fullscreen: "", transfer: "" },
  724. on: { "on-visible-change": _vm.transferChange },
  725. model: {
  726. value: _vm.transfer,
  727. callback: function($$v) {
  728. _vm.transfer = $$v
  729. },
  730. expression: "transfer"
  731. }
  732. },
  733. [
  734. _c(
  735. "div",
  736. { attrs: { slot: "close" }, slot: "close" },
  737. [
  738. _c("Button", { attrs: { type: "primary", size: "small" } }, [
  739. _vm._v(_vm._s(_vm.$L("完成")))
  740. ])
  741. ],
  742. 1
  743. ),
  744. _vm._v(" "),
  745. _c("div", { staticClass: "teditor-transfer-body" }, [
  746. _c("textarea", { attrs: { id: "T_" + _vm.id } }, [
  747. _vm._v(_vm._s(_vm.content))
  748. ])
  749. ]),
  750. _vm._v(" "),
  751. _vm.uploadIng > 0
  752. ? _c(
  753. "Spin",
  754. { attrs: { fix: "" } },
  755. [
  756. _c("Icon", {
  757. staticClass: "upload-control-spin-icon-load",
  758. attrs: { type: "ios-loading" }
  759. }),
  760. _vm._v(" "),
  761. _c("div", [_vm._v(_vm._s(_vm.$L("正在上传文件...")))])
  762. ],
  763. 1
  764. )
  765. : _vm._e()
  766. ],
  767. 1
  768. )
  769. ],
  770. 1
  771. )
  772. }
  773. var staticRenderFns = []
  774. render._withStripped = true
  775. module.exports = { render: render, staticRenderFns: staticRenderFns }
  776. if (false) {
  777. module.hot.accept()
  778. if (module.hot.data) {
  779. require("vue-hot-reload-api") .rerender("data-v-c6b4dc88", module.exports)
  780. }
  781. }
  782. /***/ })
  783. });