design-form-dialog.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666
  1. exports.ids = [10,41,43,44,45];
  2. exports.modules = {
  3. /***/ 181:
  4. /***/ (function(module, exports) {
  5. // Exports
  6. module.exports = {
  7. };
  8. /***/ }),
  9. /***/ 192:
  10. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11. "use strict";
  12. __webpack_require__.r(__webpack_exports__);
  13. // Any plugins you want to use has to be imported
  14. // Detail plugins list see https://www.tinymce.com/docs/plugins/
  15. // Custom builds see https://www.tinymce.com/download/custom-builds/
  16. const plugins = ['advlist autolink autosave code colorpicker colorpicker contextmenu directionality fullscreen hr insertdatetime link lists nonbreaking noneditable paste preview print save spellchecker tabfocus table template textcolor textpattern visualblocks visualchars wordcount'];
  17. //anchor codesample emoticons pagebreak searchreplace image imagetools media
  18. /* harmony default export */ __webpack_exports__["default"] = (plugins);
  19. /***/ }),
  20. /***/ 193:
  21. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22. "use strict";
  23. __webpack_require__.r(__webpack_exports__);
  24. // Here is a list of the toolbar
  25. // Detail list see https://www.tinymce.com/docs/advanced/editor-control-identifiers/#toolbarcontrols
  26. const toolbar = ['searchreplace bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript code codesample', 'hr bullist numlist link image charmap preview anchor pagebreak insertdatetime media table emoticons forecolor backcolor fullscreen'];
  27. /* harmony default export */ __webpack_exports__["default"] = (toolbar);
  28. /***/ }),
  29. /***/ 194:
  30. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  31. "use strict";
  32. __webpack_require__.r(__webpack_exports__);
  33. let callbacks = [];
  34. function loadedTinymce() {
  35. // to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2144
  36. // check is successfully downloaded script
  37. return window.tinymce;
  38. }
  39. const dynamicLoadScript = (src, callback) => {
  40. const existingScript = document.getElementById(src);
  41. const cb = callback || function () {};
  42. if (!existingScript) {
  43. const script = document.createElement('script');
  44. script.src = src; // src url for the third-party library being loaded.
  45. script.id = src;
  46. document.body.appendChild(script);
  47. callbacks.push(cb);
  48. const onEnd = 'onload' in script ? stdOnEnd : ieOnEnd;
  49. onEnd(script);
  50. }
  51. if (existingScript && cb) {
  52. if (loadedTinymce()) {
  53. cb(null, existingScript);
  54. } else {
  55. callbacks.push(cb);
  56. }
  57. }
  58. function stdOnEnd(script) {
  59. script.onload = function () {
  60. // this.onload = null here is necessary
  61. // because even IE9 works not like others
  62. this.onerror = this.onload = null;
  63. for (const cb of callbacks) {
  64. cb(null, script);
  65. }
  66. callbacks = null;
  67. };
  68. script.onerror = function () {
  69. this.onerror = this.onload = null;
  70. cb(new Error('Failed to load ' + src), script);
  71. };
  72. }
  73. function ieOnEnd(script) {
  74. script.onreadystatechange = function () {
  75. if (this.readyState !== 'complete' && this.readyState !== 'loaded') return;
  76. this.onreadystatechange = null;
  77. for (const cb of callbacks) {
  78. cb(null, script); // there is no way to catch loading errors in IE8
  79. }
  80. callbacks = null;
  81. };
  82. }
  83. };
  84. /* harmony default export */ __webpack_exports__["default"] = (dynamicLoadScript);
  85. /***/ }),
  86. /***/ 204:
  87. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88. "use strict";
  89. // ESM COMPAT FLAG
  90. __webpack_require__.r(__webpack_exports__);
  91. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/Tinymce/index.vue?vue&type=template&id=a9d38a5e&scoped=true
  92. var render = function render() {
  93. var _vm = this,
  94. _c = _vm._self._c;
  95. return _c('div', {
  96. staticClass: "tinymce-container",
  97. class: {
  98. fullscreen: _vm.fullscreen
  99. },
  100. style: {
  101. width: _vm.containerWidth
  102. }
  103. }, [_vm._ssrNode("<textarea" + _vm._ssrAttr("id", _vm.tinymceId) + " class=\"tinymce-textarea\" data-v-a9d38a5e></textarea>")]);
  104. };
  105. var staticRenderFns = [];
  106. // CONCATENATED MODULE: ./components/Tinymce/index.vue?vue&type=template&id=a9d38a5e&scoped=true
  107. // EXTERNAL MODULE: ./components/Tinymce/plugins.js
  108. var plugins = __webpack_require__(192);
  109. // EXTERNAL MODULE: ./components/Tinymce/toolbar.js
  110. var toolbar = __webpack_require__(193);
  111. // EXTERNAL MODULE: ./components/Tinymce/dynamicLoadScript.js
  112. var dynamicLoadScript = __webpack_require__(194);
  113. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/Tinymce/index.vue?vue&type=script&lang=js
  114. /**
  115. * docs:
  116. * https://panjiachen.github.io/vue-element-admin-site/feature/component/rich-editor.html#tinymce
  117. */
  118. // import editorImage from './components/EditorImage'
  119. // why use this cdn, detail see https://github.com/PanJiaChen/tinymce-all-in-one
  120. const tinymceCDN = '//cdn.jsdelivr.net/npm/tinymce-all-in-one@4.9.3/tinymce.min.js';
  121. /* harmony default export */ var Tinymcevue_type_script_lang_js = ({
  122. name: 'Tinymce',
  123. // components: { editorImage },
  124. props: {
  125. id: {
  126. type: String,
  127. default: function () {
  128. return 'vue-tinymce-' + +new Date() + ((Math.random() * 1000).toFixed(0) + '');
  129. }
  130. },
  131. value: {
  132. type: String,
  133. default: ''
  134. },
  135. toolbar: {
  136. type: Array,
  137. required: false,
  138. default() {
  139. return [];
  140. }
  141. },
  142. menubar: {
  143. type: String,
  144. default: 'file edit insert view format table'
  145. },
  146. height: {
  147. type: [Number, String],
  148. required: false,
  149. default: 360
  150. },
  151. width: {
  152. type: [Number, String],
  153. required: false,
  154. default: 'auto'
  155. }
  156. },
  157. data() {
  158. return {
  159. hasChange: false,
  160. hasInit: false,
  161. tinymceId: this.id,
  162. fullscreen: false,
  163. languageTypeList: {
  164. 'en': 'en',
  165. 'zh': 'zh_CN',
  166. 'es': 'es_MX',
  167. 'ja': 'ja'
  168. }
  169. };
  170. },
  171. computed: {
  172. language() {
  173. return this.languageTypeList[this.$store.getters.language];
  174. },
  175. containerWidth() {
  176. const width = this.width;
  177. if (/^[\d]+(\.[\d]+)?$/.test(width)) {
  178. // matches `100`, `'100'`
  179. return `${width}px`;
  180. }
  181. return width;
  182. }
  183. },
  184. watch: {
  185. value(val) {
  186. if (!this.hasChange && this.hasInit) {
  187. this.$nextTick(() => window.tinymce.get(this.tinymceId).setContent(val || ''));
  188. }
  189. },
  190. language() {
  191. this.destroyTinymce();
  192. this.$nextTick(() => this.initTinymce());
  193. }
  194. },
  195. mounted() {
  196. this.init();
  197. },
  198. activated() {
  199. if (window.tinymce) {
  200. this.initTinymce();
  201. }
  202. },
  203. deactivated() {
  204. this.destroyTinymce();
  205. },
  206. destroyed() {
  207. this.destroyTinymce();
  208. },
  209. methods: {
  210. init() {
  211. // dynamic load tinymce from cdn
  212. Object(dynamicLoadScript["default"])(tinymceCDN, err => {
  213. if (err) {
  214. this.$message.error(err.message);
  215. return;
  216. }
  217. this.initTinymce();
  218. });
  219. },
  220. initTinymce() {
  221. const _this = this;
  222. window.tinymce.init({
  223. language: this.language,
  224. selector: `#${this.tinymceId}`,
  225. height: this.height,
  226. body_class: 'panel-body ',
  227. object_resizing: false,
  228. toolbar: this.toolbar.length > 0 ? this.toolbar : toolbar["default"],
  229. menubar: this.menubar,
  230. plugins: plugins["default"],
  231. end_container_on_empty_block: true,
  232. powerpaste_word_import: 'clean',
  233. code_dialog_height: 450,
  234. code_dialog_width: 1000,
  235. advlist_bullet_styles: 'square',
  236. advlist_number_styles: 'default',
  237. imagetools_cors_hosts: ['www.tinymce.com', 'codepen.io'],
  238. default_link_target: '_blank',
  239. link_title: false,
  240. nonbreaking_force_tab: true,
  241. // inserting nonbreaking space &nbsp; need Nonbreaking Space Plugin
  242. init_instance_callback: editor => {
  243. if (_this.value) {
  244. editor.setContent(_this.value);
  245. }
  246. _this.hasInit = true;
  247. editor.on('NodeChange Change KeyUp SetContent', () => {
  248. this.hasChange = true;
  249. this.$emit('input', editor.getContent());
  250. });
  251. },
  252. setup(editor) {
  253. editor.on('FullscreenStateChanged', e => {
  254. _this.fullscreen = e.state;
  255. });
  256. },
  257. // it will try to keep these URLs intact
  258. // https://www.tiny.cloud/docs-3x/reference/configuration/Configuration3x@convert_urls/
  259. // https://stackoverflow.com/questions/5196205/disable-tinymce-absolute-to-relative-url-conversions
  260. convert_urls: false
  261. // 整合七牛上传
  262. // images_dataimg_filter(img) {
  263. // setTimeout(() => {
  264. // const $image = $(img);
  265. // $image.removeAttr('width');
  266. // $image.removeAttr('height');
  267. // if ($image[0].height && $image[0].width) {
  268. // $image.attr('data-wscntype', 'image');
  269. // $image.attr('data-wscnh', $image[0].height);
  270. // $image.attr('data-wscnw', $image[0].width);
  271. // $image.addClass('wscnph');
  272. // }
  273. // }, 0);
  274. // return img
  275. // },
  276. // images_upload_handler(blobInfo, success, failure, progress) {
  277. // progress(0);
  278. // const token = _this.$store.getters.token;
  279. // getToken(token).then(response => {
  280. // const url = response.data.qiniu_url;
  281. // const formData = new FormData();
  282. // formData.append('token', response.data.qiniu_token);
  283. // formData.append('key', response.data.qiniu_key);
  284. // formData.append('file', blobInfo.blob(), url);
  285. // upload(formData).then(() => {
  286. // success(url);
  287. // progress(100);
  288. // })
  289. // }).catch(err => {
  290. // failure('出现未知问题,刷新页面,或者联系程序员')
  291. // console.log(err);
  292. // });
  293. // },
  294. });
  295. },
  296. destroyTinymce() {
  297. const tinymce = window.tinymce.get(this.tinymceId);
  298. if (this.fullscreen) {
  299. tinymce.execCommand('mceFullScreen');
  300. }
  301. if (tinymce) {
  302. tinymce.destroy();
  303. }
  304. },
  305. setContent(value) {
  306. window.tinymce.get(this.tinymceId).setContent(value);
  307. },
  308. getContent() {
  309. window.tinymce.get(this.tinymceId).getContent();
  310. },
  311. imageSuccessCBK(arr) {
  312. arr.forEach(v => window.tinymce.get(this.tinymceId).insertContent(`<img class="wscnph" src="${v.url}" >`));
  313. }
  314. }
  315. });
  316. // CONCATENATED MODULE: ./components/Tinymce/index.vue?vue&type=script&lang=js
  317. /* harmony default export */ var components_Tinymcevue_type_script_lang_js = (Tinymcevue_type_script_lang_js);
  318. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  319. var componentNormalizer = __webpack_require__(2);
  320. // CONCATENATED MODULE: ./components/Tinymce/index.vue
  321. function injectStyles (context) {
  322. var style0 = __webpack_require__(220)
  323. if (style0.__inject__) style0.__inject__(context)
  324. }
  325. /* normalize component */
  326. var component = Object(componentNormalizer["a" /* default */])(
  327. components_Tinymcevue_type_script_lang_js,
  328. render,
  329. staticRenderFns,
  330. false,
  331. injectStyles,
  332. "a9d38a5e",
  333. "2f101c14"
  334. )
  335. /* harmony default export */ var Tinymce = __webpack_exports__["default"] = (component.exports);
  336. /***/ }),
  337. /***/ 220:
  338. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  339. "use strict";
  340. __webpack_require__.r(__webpack_exports__);
  341. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_a9d38a5e_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(181);
  342. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_a9d38a5e_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_a9d38a5e_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
  343. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_a9d38a5e_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_a9d38a5e_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  344. /***/ }),
  345. /***/ 243:
  346. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  347. "use strict";
  348. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
  349. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  350. /* harmony default export */ __webpack_exports__["a"] = (new vue__WEBPACK_IMPORTED_MODULE_0___default.a());
  351. /***/ }),
  352. /***/ 276:
  353. /***/ (function(module, exports) {
  354. // Exports
  355. module.exports = {
  356. };
  357. /***/ }),
  358. /***/ 336:
  359. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  360. "use strict";
  361. __webpack_require__.r(__webpack_exports__);
  362. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_DesignFormDialog_vue_vue_type_style_index_0_id_7d26e39b_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(276);
  363. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_DesignFormDialog_vue_vue_type_style_index_0_id_7d26e39b_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_DesignFormDialog_vue_vue_type_style_index_0_id_7d26e39b_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
  364. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_DesignFormDialog_vue_vue_type_style_index_0_id_7d26e39b_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_DesignFormDialog_vue_vue_type_style_index_0_id_7d26e39b_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  365. /***/ }),
  366. /***/ 373:
  367. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  368. "use strict";
  369. // ESM COMPAT FLAG
  370. __webpack_require__.r(__webpack_exports__);
  371. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/DesignFormDialog.vue?vue&type=template&id=7d26e39b&scoped=true
  372. var render = function render() {
  373. var _vm = this,
  374. _c = _vm._self._c;
  375. return _c('el-dialog', {
  376. attrs: {
  377. "title": _vm.title,
  378. "visible": _vm.visible,
  379. "width": "700px",
  380. "before-close": _vm.handleClose,
  381. "top": _vm.top,
  382. "show-close": false
  383. },
  384. on: {
  385. "update:visible": function ($event) {
  386. _vm.visible = $event;
  387. }
  388. }
  389. }, [_c('el-form', {
  390. ref: "ruleForm",
  391. attrs: {
  392. "model": _vm.formData,
  393. "rules": _vm.rules
  394. }
  395. }, _vm._l(_vm.formConfig, function (item) {
  396. return _c('el-form-item', {
  397. key: item.label,
  398. attrs: {
  399. "label": item.label,
  400. "prop": item.prop,
  401. "label-width": _vm.labelWidth + 'px'
  402. }
  403. }, [item.type === 'input' ? _c('el-input', {
  404. style: {
  405. width: item.width
  406. },
  407. attrs: {
  408. "disabled": item.disabled,
  409. "readonly": item.readonly,
  410. "placeholder": item.placeholder ? item.placeholder : '',
  411. "clearable": "",
  412. "type": item.inputType
  413. },
  414. on: {
  415. "change": function ($event) {
  416. item.change && item.change(_vm.formData[item.prop]);
  417. }
  418. },
  419. model: {
  420. value: _vm.formData[item.prop],
  421. callback: function ($$v) {
  422. _vm.$set(_vm.formData, item.prop, $$v);
  423. },
  424. expression: "formData[item.prop]"
  425. }
  426. }) : _vm._e(), _vm._v(" "), item.type === 'selectObj' ? _c('el-select', {
  427. style: {
  428. width: '100%'
  429. },
  430. attrs: {
  431. "disabled": item.disabled,
  432. "clearable": "",
  433. "filterable": "",
  434. "multiple": item.multiple
  435. },
  436. on: {
  437. "change": function ($event) {
  438. item.change && item.change(_vm.formData[item.prop]);
  439. }
  440. },
  441. model: {
  442. value: _vm.formData[item.prop],
  443. callback: function ($$v) {
  444. _vm.$set(_vm.formData, item.prop, $$v);
  445. },
  446. expression: "formData[item.prop]"
  447. }
  448. }, _vm._l(item.selectList, function (val, key) {
  449. return _c('el-option', {
  450. key: parseInt(key),
  451. attrs: {
  452. "label": val,
  453. "value": val
  454. }
  455. });
  456. }), 1) : _vm._e(), _vm._v(" "), item.type === 'tinymce' ? _c('tinymce', {
  457. staticStyle: {
  458. "display": "inline-block"
  459. },
  460. attrs: {
  461. "height": item.height,
  462. "width": item.width
  463. },
  464. model: {
  465. value: _vm.formData[item.prop],
  466. callback: function ($$v) {
  467. _vm.$set(_vm.formData, item.prop, $$v);
  468. },
  469. expression: "formData[item.prop]"
  470. }
  471. }) : _vm._e()], 1);
  472. }), 1), _vm._v(" "), _c('div', {
  473. staticClass: "dialog-footer",
  474. attrs: {
  475. "slot": "footer"
  476. },
  477. slot: "footer"
  478. }, [_c('el-button', {
  479. attrs: {
  480. "type": "primary"
  481. },
  482. on: {
  483. "click": _vm.handleSend
  484. }
  485. }, [_vm._v(_vm._s(_vm.sendbtnCext))]), _vm._v(" "), _c('el-button', {
  486. attrs: {
  487. "type": "primary",
  488. "plain": ""
  489. },
  490. on: {
  491. "click": _vm.handleClose
  492. }
  493. }, [_vm._v("CANCEL")])], 1)], 1);
  494. };
  495. var staticRenderFns = [];
  496. // CONCATENATED MODULE: ./components/DesignFormDialog.vue?vue&type=template&id=7d26e39b&scoped=true
  497. // EXTERNAL MODULE: ./plugins/bus.js
  498. var bus = __webpack_require__(243);
  499. // EXTERNAL MODULE: ./components/Tinymce/index.vue + 4 modules
  500. var Tinymce = __webpack_require__(204);
  501. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/DesignFormDialog.vue?vue&type=script&lang=js
  502. /* harmony default export */ var DesignFormDialogvue_type_script_lang_js = ({
  503. components: {
  504. Tinymce: Tinymce["default"]
  505. },
  506. props: {
  507. title: {
  508. type: String,
  509. default: 'Send Email'
  510. },
  511. // 表单域标签的宽度
  512. labelWidth: {
  513. type: Number,
  514. default: 95
  515. },
  516. // 表单配置
  517. formConfig: {
  518. type: Array,
  519. required: true
  520. },
  521. // 表单数据
  522. formData: {
  523. type: Object,
  524. required: true
  525. },
  526. sendbtnCext: {
  527. type: String,
  528. default: 'SUBMIT REQUEST'
  529. },
  530. top: {
  531. type: String,
  532. default: '5vh'
  533. },
  534. isSendPdf: {
  535. type: Boolean,
  536. default: false
  537. },
  538. rules: {},
  539. visible: {
  540. type: Boolean,
  541. default: false
  542. }
  543. },
  544. methods: {
  545. handleClose() {
  546. this.$emit('update:visible', false);
  547. },
  548. handleSend() {
  549. this.$refs.ruleForm.validate(valid => {
  550. if (valid) {
  551. if (this.isSendPdf) {
  552. bus["a" /* default */].$emit("sendPdf");
  553. } else {
  554. this.$emit("handleSend");
  555. }
  556. } else {
  557. return false;
  558. }
  559. });
  560. }
  561. }
  562. });
  563. // CONCATENATED MODULE: ./components/DesignFormDialog.vue?vue&type=script&lang=js
  564. /* harmony default export */ var components_DesignFormDialogvue_type_script_lang_js = (DesignFormDialogvue_type_script_lang_js);
  565. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  566. var componentNormalizer = __webpack_require__(2);
  567. // CONCATENATED MODULE: ./components/DesignFormDialog.vue
  568. function injectStyles (context) {
  569. var style0 = __webpack_require__(336)
  570. if (style0.__inject__) style0.__inject__(context)
  571. }
  572. /* normalize component */
  573. var component = Object(componentNormalizer["a" /* default */])(
  574. components_DesignFormDialogvue_type_script_lang_js,
  575. render,
  576. staticRenderFns,
  577. false,
  578. injectStyles,
  579. "7d26e39b",
  580. "c1f17090"
  581. )
  582. /* harmony default export */ var DesignFormDialog = __webpack_exports__["default"] = (component.exports);
  583. /* nuxt-component-imports */
  584. installComponents(component, {Tinymce: __webpack_require__(204).default})
  585. /***/ })
  586. };;
  587. //# sourceMappingURL=design-form-dialog.js.map