design-form-dialog.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666
  1. exports.ids = [10,41,43,44,45];
  2. exports.modules = {
  3. /***/ 155:
  4. /***/ (function(module, exports) {
  5. // Exports
  6. module.exports = {
  7. };
  8. /***/ }),
  9. /***/ 157:
  10. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11. "use strict";
  12. // ESM COMPAT FLAG
  13. __webpack_require__.r(__webpack_exports__);
  14. // 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
  15. var render = function render() {
  16. var _vm = this,
  17. _c = _vm._self._c;
  18. return _c('div', {
  19. staticClass: "tinymce-container",
  20. class: {
  21. fullscreen: _vm.fullscreen
  22. },
  23. style: {
  24. width: _vm.containerWidth
  25. }
  26. }, [_vm._ssrNode("<textarea" + _vm._ssrAttr("id", _vm.tinymceId) + " class=\"tinymce-textarea\" data-v-a9d38a5e></textarea>")]);
  27. };
  28. var staticRenderFns = [];
  29. // CONCATENATED MODULE: ./components/Tinymce/index.vue?vue&type=template&id=a9d38a5e&scoped=true
  30. // EXTERNAL MODULE: ./components/Tinymce/plugins.js
  31. var plugins = __webpack_require__(162);
  32. // EXTERNAL MODULE: ./components/Tinymce/toolbar.js
  33. var toolbar = __webpack_require__(163);
  34. // EXTERNAL MODULE: ./components/Tinymce/dynamicLoadScript.js
  35. var dynamicLoadScript = __webpack_require__(164);
  36. // 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
  37. /**
  38. * docs:
  39. * https://panjiachen.github.io/vue-element-admin-site/feature/component/rich-editor.html#tinymce
  40. */
  41. // import editorImage from './components/EditorImage'
  42. // why use this cdn, detail see https://github.com/PanJiaChen/tinymce-all-in-one
  43. const tinymceCDN = '//cdn.jsdelivr.net/npm/tinymce-all-in-one@4.9.3/tinymce.min.js';
  44. /* harmony default export */ var Tinymcevue_type_script_lang_js = ({
  45. name: 'Tinymce',
  46. // components: { editorImage },
  47. props: {
  48. id: {
  49. type: String,
  50. default: function () {
  51. return 'vue-tinymce-' + +new Date() + ((Math.random() * 1000).toFixed(0) + '');
  52. }
  53. },
  54. value: {
  55. type: String,
  56. default: ''
  57. },
  58. toolbar: {
  59. type: Array,
  60. required: false,
  61. default() {
  62. return [];
  63. }
  64. },
  65. menubar: {
  66. type: String,
  67. default: 'file edit insert view format table'
  68. },
  69. height: {
  70. type: [Number, String],
  71. required: false,
  72. default: 360
  73. },
  74. width: {
  75. type: [Number, String],
  76. required: false,
  77. default: 'auto'
  78. }
  79. },
  80. data() {
  81. return {
  82. hasChange: false,
  83. hasInit: false,
  84. tinymceId: this.id,
  85. fullscreen: false,
  86. languageTypeList: {
  87. 'en': 'en',
  88. 'zh': 'zh_CN',
  89. 'es': 'es_MX',
  90. 'ja': 'ja'
  91. }
  92. };
  93. },
  94. computed: {
  95. language() {
  96. return this.languageTypeList[this.$store.getters.language];
  97. },
  98. containerWidth() {
  99. const width = this.width;
  100. if (/^[\d]+(\.[\d]+)?$/.test(width)) {
  101. // matches `100`, `'100'`
  102. return `${width}px`;
  103. }
  104. return width;
  105. }
  106. },
  107. watch: {
  108. value(val) {
  109. if (!this.hasChange && this.hasInit) {
  110. this.$nextTick(() => window.tinymce.get(this.tinymceId).setContent(val || ''));
  111. }
  112. },
  113. language() {
  114. this.destroyTinymce();
  115. this.$nextTick(() => this.initTinymce());
  116. }
  117. },
  118. mounted() {
  119. this.init();
  120. },
  121. activated() {
  122. if (window.tinymce) {
  123. this.initTinymce();
  124. }
  125. },
  126. deactivated() {
  127. this.destroyTinymce();
  128. },
  129. destroyed() {
  130. this.destroyTinymce();
  131. },
  132. methods: {
  133. init() {
  134. // dynamic load tinymce from cdn
  135. Object(dynamicLoadScript["default"])(tinymceCDN, err => {
  136. if (err) {
  137. this.$message.error(err.message);
  138. return;
  139. }
  140. this.initTinymce();
  141. });
  142. },
  143. initTinymce() {
  144. const _this = this;
  145. window.tinymce.init({
  146. language: this.language,
  147. selector: `#${this.tinymceId}`,
  148. height: this.height,
  149. body_class: 'panel-body ',
  150. object_resizing: false,
  151. toolbar: this.toolbar.length > 0 ? this.toolbar : toolbar["default"],
  152. menubar: this.menubar,
  153. plugins: plugins["default"],
  154. end_container_on_empty_block: true,
  155. powerpaste_word_import: 'clean',
  156. code_dialog_height: 450,
  157. code_dialog_width: 1000,
  158. advlist_bullet_styles: 'square',
  159. advlist_number_styles: 'default',
  160. imagetools_cors_hosts: ['www.tinymce.com', 'codepen.io'],
  161. default_link_target: '_blank',
  162. link_title: false,
  163. nonbreaking_force_tab: true,
  164. // inserting nonbreaking space &nbsp; need Nonbreaking Space Plugin
  165. init_instance_callback: editor => {
  166. if (_this.value) {
  167. editor.setContent(_this.value);
  168. }
  169. _this.hasInit = true;
  170. editor.on('NodeChange Change KeyUp SetContent', () => {
  171. this.hasChange = true;
  172. this.$emit('input', editor.getContent());
  173. });
  174. },
  175. setup(editor) {
  176. editor.on('FullscreenStateChanged', e => {
  177. _this.fullscreen = e.state;
  178. });
  179. },
  180. // it will try to keep these URLs intact
  181. // https://www.tiny.cloud/docs-3x/reference/configuration/Configuration3x@convert_urls/
  182. // https://stackoverflow.com/questions/5196205/disable-tinymce-absolute-to-relative-url-conversions
  183. convert_urls: false
  184. // 整合七牛上传
  185. // images_dataimg_filter(img) {
  186. // setTimeout(() => {
  187. // const $image = $(img);
  188. // $image.removeAttr('width');
  189. // $image.removeAttr('height');
  190. // if ($image[0].height && $image[0].width) {
  191. // $image.attr('data-wscntype', 'image');
  192. // $image.attr('data-wscnh', $image[0].height);
  193. // $image.attr('data-wscnw', $image[0].width);
  194. // $image.addClass('wscnph');
  195. // }
  196. // }, 0);
  197. // return img
  198. // },
  199. // images_upload_handler(blobInfo, success, failure, progress) {
  200. // progress(0);
  201. // const token = _this.$store.getters.token;
  202. // getToken(token).then(response => {
  203. // const url = response.data.qiniu_url;
  204. // const formData = new FormData();
  205. // formData.append('token', response.data.qiniu_token);
  206. // formData.append('key', response.data.qiniu_key);
  207. // formData.append('file', blobInfo.blob(), url);
  208. // upload(formData).then(() => {
  209. // success(url);
  210. // progress(100);
  211. // })
  212. // }).catch(err => {
  213. // failure('出现未知问题,刷新页面,或者联系程序员')
  214. // console.log(err);
  215. // });
  216. // },
  217. });
  218. },
  219. destroyTinymce() {
  220. const tinymce = window.tinymce.get(this.tinymceId);
  221. if (this.fullscreen) {
  222. tinymce.execCommand('mceFullScreen');
  223. }
  224. if (tinymce) {
  225. tinymce.destroy();
  226. }
  227. },
  228. setContent(value) {
  229. window.tinymce.get(this.tinymceId).setContent(value);
  230. },
  231. getContent() {
  232. window.tinymce.get(this.tinymceId).getContent();
  233. },
  234. imageSuccessCBK(arr) {
  235. arr.forEach(v => window.tinymce.get(this.tinymceId).insertContent(`<img class="wscnph" src="${v.url}" >`));
  236. }
  237. }
  238. });
  239. // CONCATENATED MODULE: ./components/Tinymce/index.vue?vue&type=script&lang=js
  240. /* harmony default export */ var components_Tinymcevue_type_script_lang_js = (Tinymcevue_type_script_lang_js);
  241. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  242. var componentNormalizer = __webpack_require__(2);
  243. // CONCATENATED MODULE: ./components/Tinymce/index.vue
  244. function injectStyles (context) {
  245. var style0 = __webpack_require__(176)
  246. if (style0.__inject__) style0.__inject__(context)
  247. }
  248. /* normalize component */
  249. var component = Object(componentNormalizer["a" /* default */])(
  250. components_Tinymcevue_type_script_lang_js,
  251. render,
  252. staticRenderFns,
  253. false,
  254. injectStyles,
  255. "a9d38a5e",
  256. "2f101c14"
  257. )
  258. /* harmony default export */ var Tinymce = __webpack_exports__["default"] = (component.exports);
  259. /***/ }),
  260. /***/ 162:
  261. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  262. "use strict";
  263. __webpack_require__.r(__webpack_exports__);
  264. // Any plugins you want to use has to be imported
  265. // Detail plugins list see https://www.tinymce.com/docs/plugins/
  266. // Custom builds see https://www.tinymce.com/download/custom-builds/
  267. 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'];
  268. //anchor codesample emoticons pagebreak searchreplace image imagetools media
  269. /* harmony default export */ __webpack_exports__["default"] = (plugins);
  270. /***/ }),
  271. /***/ 163:
  272. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  273. "use strict";
  274. __webpack_require__.r(__webpack_exports__);
  275. // Here is a list of the toolbar
  276. // Detail list see https://www.tinymce.com/docs/advanced/editor-control-identifiers/#toolbarcontrols
  277. 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'];
  278. /* harmony default export */ __webpack_exports__["default"] = (toolbar);
  279. /***/ }),
  280. /***/ 164:
  281. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  282. "use strict";
  283. __webpack_require__.r(__webpack_exports__);
  284. let callbacks = [];
  285. function loadedTinymce() {
  286. // to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2144
  287. // check is successfully downloaded script
  288. return window.tinymce;
  289. }
  290. const dynamicLoadScript = (src, callback) => {
  291. const existingScript = document.getElementById(src);
  292. const cb = callback || function () {};
  293. if (!existingScript) {
  294. const script = document.createElement('script');
  295. script.src = src; // src url for the third-party library being loaded.
  296. script.id = src;
  297. document.body.appendChild(script);
  298. callbacks.push(cb);
  299. const onEnd = 'onload' in script ? stdOnEnd : ieOnEnd;
  300. onEnd(script);
  301. }
  302. if (existingScript && cb) {
  303. if (loadedTinymce()) {
  304. cb(null, existingScript);
  305. } else {
  306. callbacks.push(cb);
  307. }
  308. }
  309. function stdOnEnd(script) {
  310. script.onload = function () {
  311. // this.onload = null here is necessary
  312. // because even IE9 works not like others
  313. this.onerror = this.onload = null;
  314. for (const cb of callbacks) {
  315. cb(null, script);
  316. }
  317. callbacks = null;
  318. };
  319. script.onerror = function () {
  320. this.onerror = this.onload = null;
  321. cb(new Error('Failed to load ' + src), script);
  322. };
  323. }
  324. function ieOnEnd(script) {
  325. script.onreadystatechange = function () {
  326. if (this.readyState !== 'complete' && this.readyState !== 'loaded') return;
  327. this.onreadystatechange = null;
  328. for (const cb of callbacks) {
  329. cb(null, script); // there is no way to catch loading errors in IE8
  330. }
  331. callbacks = null;
  332. };
  333. }
  334. };
  335. /* harmony default export */ __webpack_exports__["default"] = (dynamicLoadScript);
  336. /***/ }),
  337. /***/ 176:
  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__(155);
  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. /***/ 246:
  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. /***/ 278:
  353. /***/ (function(module, exports) {
  354. // Exports
  355. module.exports = {
  356. };
  357. /***/ }),
  358. /***/ 332:
  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__(278);
  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. /***/ 367:
  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__(246);
  499. // EXTERNAL MODULE: ./components/Tinymce/index.vue + 4 modules
  500. var Tinymce = __webpack_require__(157);
  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__(332)
  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__(157).default})
  585. /***/ })
  586. };;
  587. //# sourceMappingURL=design-form-dialog.js.map