form-dialog.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  1. exports.ids = [13,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. /***/ 278:
  346. /***/ (function(module, exports) {
  347. // Exports
  348. module.exports = {
  349. };
  350. /***/ }),
  351. /***/ 338:
  352. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  353. "use strict";
  354. __webpack_require__.r(__webpack_exports__);
  355. /* 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_FormDialog_vue_vue_type_style_index_0_id_2aff96f1_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(278);
  356. /* 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_FormDialog_vue_vue_type_style_index_0_id_2aff96f1_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_FormDialog_vue_vue_type_style_index_0_id_2aff96f1_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
  357. /* 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_FormDialog_vue_vue_type_style_index_0_id_2aff96f1_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_FormDialog_vue_vue_type_style_index_0_id_2aff96f1_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  358. /***/ }),
  359. /***/ 375:
  360. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  361. "use strict";
  362. // ESM COMPAT FLAG
  363. __webpack_require__.r(__webpack_exports__);
  364. // 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/FormDialog.vue?vue&type=template&id=2aff96f1&scoped=true
  365. var render = function render() {
  366. var _vm = this,
  367. _c = _vm._self._c;
  368. return _c('el-dialog', {
  369. attrs: {
  370. "lock-scroll": false,
  371. "title": _vm.title,
  372. "visible": _vm.visible,
  373. "width": "700px",
  374. "before-close": _vm.handleClose,
  375. "top": _vm.top,
  376. "show-close": false
  377. },
  378. on: {
  379. "update:visible": function ($event) {
  380. _vm.visible = $event;
  381. }
  382. }
  383. }, [_c('el-form', {
  384. ref: "ruleForm",
  385. attrs: {
  386. "model": _vm.emailForm,
  387. "rules": _vm.rules
  388. }
  389. }, _vm._l(_vm.comEnquiryConfig, function (item) {
  390. return _c('el-form-item', {
  391. key: item.prop,
  392. style: {
  393. marginBottom: _vm.marginBottom + 'px'
  394. },
  395. attrs: {
  396. "label": item.prop,
  397. "label-width": _vm.labelWidth,
  398. "prop": item.prop
  399. }
  400. }, [item.type === 'text' ? _c('span', [_vm._v(_vm._s(_vm.emailForm[item.prop]))]) : _vm._e(), _vm._v(" "), item.type === 'input' ? _c('el-input', {
  401. attrs: {
  402. "type": item.type,
  403. "clearable": ""
  404. },
  405. model: {
  406. value: _vm.emailForm[item.prop],
  407. callback: function ($$v) {
  408. _vm.$set(_vm.emailForm, item.prop, $$v);
  409. },
  410. expression: "emailForm[item.prop]"
  411. }
  412. }) : item.type === 'textarea' ? _c('el-input', {
  413. attrs: {
  414. "type": "textarea",
  415. "rows": 5,
  416. "clearable": ""
  417. },
  418. model: {
  419. value: _vm.emailForm[item.prop],
  420. callback: function ($$v) {
  421. _vm.$set(_vm.emailForm, item.prop, $$v);
  422. },
  423. expression: "emailForm[item.prop]"
  424. }
  425. }) : item.type === 'tinymce' ? _c('tinymce', {
  426. attrs: {
  427. "height": 240
  428. },
  429. model: {
  430. value: _vm.emailForm[item.prop],
  431. callback: function ($$v) {
  432. _vm.$set(_vm.emailForm, item.prop, $$v);
  433. },
  434. expression: "emailForm[item.prop]"
  435. }
  436. }) : item.type === 'select' && item.isShow ? _c('el-select', {
  437. attrs: {
  438. "clearable": "",
  439. "filterable": "",
  440. "placeholder": item.placeholder ? item.placeholder : 'Please select'
  441. },
  442. model: {
  443. value: _vm.emailForm[item.prop],
  444. callback: function ($$v) {
  445. _vm.$set(_vm.emailForm, item.prop, $$v);
  446. },
  447. expression: "emailForm[item.prop]"
  448. }
  449. }, _vm._l(item.selectlist, function (i) {
  450. return _c('el-option', {
  451. key: i.id,
  452. attrs: {
  453. "label": i.name,
  454. "value": i.name
  455. }
  456. });
  457. }), 1) : item.type === 'checkbox' ? _c('el-checkbox-group', {
  458. model: {
  459. value: _vm.emailForm[item.prop],
  460. callback: function ($$v) {
  461. _vm.$set(_vm.emailForm, item.prop, $$v);
  462. },
  463. expression: "emailForm[item.prop]"
  464. }
  465. }, _vm._l(item.selectlist, function (i, k) {
  466. return _c('el-checkbox', {
  467. key: k,
  468. attrs: {
  469. "label": k + 1
  470. }
  471. }, [_vm._v(_vm._s(i))]);
  472. }), 1) : _vm._e()], 1);
  473. }), 1), _vm._v(" "), _c('div', {
  474. staticClass: "dialog-footer",
  475. attrs: {
  476. "slot": "footer"
  477. },
  478. slot: "footer"
  479. }, [_c('el-button', {
  480. attrs: {
  481. "type": "primary",
  482. "loading": _vm.$store.state.product.loading
  483. },
  484. on: {
  485. "click": _vm.handleSend
  486. }
  487. }, [_vm._v(_vm._s(_vm.sendbtnCext))]), _vm._v(" "), _c('el-button', {
  488. attrs: {
  489. "type": "info",
  490. "plain": ""
  491. },
  492. on: {
  493. "click": _vm.handleClose
  494. }
  495. }, [_vm._v(_vm._s(_vm.cancelbtnCext))])], 1)], 1);
  496. };
  497. var staticRenderFns = [];
  498. // CONCATENATED MODULE: ./components/FormDialog.vue?vue&type=template&id=2aff96f1&scoped=true
  499. // EXTERNAL MODULE: ./components/Tinymce/index.vue + 4 modules
  500. var Tinymce = __webpack_require__(204);
  501. // EXTERNAL MODULE: external "vuex"
  502. var external_vuex_ = __webpack_require__(6);
  503. // 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/FormDialog.vue?vue&type=script&lang=js
  504. /* harmony default export */ var FormDialogvue_type_script_lang_js = ({
  505. components: {
  506. Tinymce: Tinymce["default"]
  507. },
  508. props: {
  509. title: {
  510. type: String,
  511. default: 'Send Email'
  512. },
  513. sendbtnCext: {
  514. type: String,
  515. default: 'Send Enquiry'
  516. },
  517. cancelbtnCext: {
  518. type: String,
  519. default: 'Cancel'
  520. },
  521. top: {
  522. type: String,
  523. default: '5vh'
  524. },
  525. isSendPdf: {
  526. type: Boolean,
  527. default: false
  528. },
  529. emailForm: {},
  530. enquiryConfig: [],
  531. rules: {},
  532. labelWidth: {
  533. type: Number,
  534. default: 150
  535. },
  536. marginBottom: {
  537. type: Number,
  538. default: 20
  539. },
  540. visible: {
  541. type: Boolean,
  542. default: false
  543. }
  544. },
  545. data() {
  546. return {
  547. downloading: false
  548. };
  549. },
  550. computed: {
  551. comEnquiryConfig() {
  552. return this.enquiryConfig.filter(item => {
  553. if (!item.hasOwnProperty('isShow') || item.isShow) {
  554. return item;
  555. }
  556. });
  557. }
  558. },
  559. methods: {
  560. ...Object(external_vuex_["mapMutations"])('product', ['setLoading']),
  561. handleClose() {
  562. this.$emit('update:visible', false);
  563. },
  564. handleSend() {
  565. this.$refs.ruleForm.validate(valid => {
  566. if (valid) {
  567. this.setLoading(true);
  568. if (this.isSendPdf) {
  569. // Bus.$emit("sendPdf");
  570. this.$emit("handleSend");
  571. } else {
  572. this.$emit("handleSend");
  573. }
  574. } else {
  575. return false;
  576. }
  577. });
  578. }
  579. }
  580. });
  581. // CONCATENATED MODULE: ./components/FormDialog.vue?vue&type=script&lang=js
  582. /* harmony default export */ var components_FormDialogvue_type_script_lang_js = (FormDialogvue_type_script_lang_js);
  583. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  584. var componentNormalizer = __webpack_require__(2);
  585. // CONCATENATED MODULE: ./components/FormDialog.vue
  586. function injectStyles (context) {
  587. var style0 = __webpack_require__(338)
  588. if (style0.__inject__) style0.__inject__(context)
  589. }
  590. /* normalize component */
  591. var component = Object(componentNormalizer["a" /* default */])(
  592. components_FormDialogvue_type_script_lang_js,
  593. render,
  594. staticRenderFns,
  595. false,
  596. injectStyles,
  597. "2aff96f1",
  598. "45dfc6da"
  599. )
  600. /* harmony default export */ var FormDialog = __webpack_exports__["default"] = (component.exports);
  601. /* nuxt-component-imports */
  602. installComponents(component, {Tinymce: __webpack_require__(204).default})
  603. /***/ })
  604. };;
  605. //# sourceMappingURL=form-dialog.js.map