form-dialog.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  1. exports.ids = [13,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. /***/ 177:
  346. /***/ (function(module, exports) {
  347. // Exports
  348. module.exports = {
  349. };
  350. /***/ }),
  351. /***/ 197:
  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__(177);
  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. /***/ 206:
  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__(157);
  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__(197)
  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__(157).default})
  603. /***/ })
  604. };;
  605. //# sourceMappingURL=form-dialog.js.map