pc-global-form.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  1. exports.ids = [20];
  2. exports.modules = {
  3. /***/ 221:
  4. /***/ (function(module, exports) {
  5. // Exports
  6. module.exports = {
  7. };
  8. /***/ }),
  9. /***/ 244:
  10. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11. "use strict";
  12. __webpack_require__.r(__webpack_exports__);
  13. /* 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_PcGlobalForm_vue_vue_type_style_index_0_id_4b4d0fec_prod_lang_scss_scope_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(221);
  14. /* 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_PcGlobalForm_vue_vue_type_style_index_0_id_4b4d0fec_prod_lang_scss_scope_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_PcGlobalForm_vue_vue_type_style_index_0_id_4b4d0fec_prod_lang_scss_scope_true__WEBPACK_IMPORTED_MODULE_0__);
  15. /* 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_PcGlobalForm_vue_vue_type_style_index_0_id_4b4d0fec_prod_lang_scss_scope_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_PcGlobalForm_vue_vue_type_style_index_0_id_4b4d0fec_prod_lang_scss_scope_true__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  16. /***/ }),
  17. /***/ 295:
  18. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19. "use strict";
  20. // ESM COMPAT FLAG
  21. __webpack_require__.r(__webpack_exports__);
  22. // 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/PcGlobalForm.vue?vue&type=template&id=4b4d0fec
  23. var render = function render() {
  24. var _vm = this,
  25. _c = _vm._self._c;
  26. return _c('div', {
  27. staticClass: "form global-form"
  28. }, [_c('el-form', {
  29. ref: "ruleForm",
  30. staticClass: "form-list",
  31. attrs: {
  32. "model": _vm.formData,
  33. "rules": _vm.rules
  34. }
  35. }, _vm._l(_vm.formConfig, function (item) {
  36. return _c('el-form-item', {
  37. key: item.label,
  38. attrs: {
  39. "prop": item.prop
  40. }
  41. }, [item.type === 'input' ? _c('el-input', {
  42. style: {
  43. width: item.width
  44. },
  45. attrs: {
  46. "disabled": item.disabled,
  47. "placeholder": item.placeholder,
  48. "clearable": ""
  49. },
  50. on: {
  51. "change": function ($event) {
  52. item.change && item.change(_vm.formData[item.prop]);
  53. }
  54. },
  55. model: {
  56. value: _vm.formData[item.prop],
  57. callback: function ($$v) {
  58. _vm.$set(_vm.formData, item.prop, $$v);
  59. },
  60. expression: "formData[item.prop]"
  61. }
  62. }) : _vm._e(), _vm._v(" "), item.type === 'password' ? _c('el-input', {
  63. style: {
  64. width: item.width
  65. },
  66. attrs: {
  67. "type": _vm.flag ? 'text' : 'password',
  68. "autocomplete": "off",
  69. "placeholder": item.placeholder,
  70. "clearable": ""
  71. },
  72. on: {
  73. "change": function ($event) {
  74. item.change && item.change(_vm.formData[item.prop]);
  75. }
  76. },
  77. model: {
  78. value: _vm.formData[item.prop],
  79. callback: function ($$v) {
  80. _vm.$set(_vm.formData, item.prop, $$v);
  81. },
  82. expression: "formData[item.prop]"
  83. }
  84. }, [!_vm.flag ? _c('i', {
  85. staticClass: "el-input__icon iconfont",
  86. staticStyle: {
  87. "font-size": "22px"
  88. },
  89. attrs: {
  90. "slot": "suffix"
  91. },
  92. on: {
  93. "click": _vm.showPassword
  94. },
  95. slot: "suffix"
  96. }, [_vm._v("")]) : _c('i', {
  97. staticClass: "el-input__icon iconfont",
  98. staticStyle: {
  99. "font-size": "22px"
  100. },
  101. attrs: {
  102. "slot": "suffix"
  103. },
  104. on: {
  105. "click": _vm.showPassword
  106. },
  107. slot: "suffix"
  108. }, [_vm._v("")])]) : _vm._e(), _vm._v(" "), item.type === 'textarea' ? _c('el-input', {
  109. style: {
  110. width: item.width
  111. },
  112. attrs: {
  113. "type": "textarea",
  114. "disabled": item.disabled,
  115. "maxlength": item.maxlength,
  116. "rows": item.rows,
  117. "show-word-limit": item.showWordLimit
  118. },
  119. on: {
  120. "change": function ($event) {
  121. item.change && item.change(_vm.formData[item.prop]);
  122. }
  123. },
  124. model: {
  125. value: _vm.formData[item.prop],
  126. callback: function ($$v) {
  127. _vm.$set(_vm.formData, item.prop, $$v);
  128. },
  129. expression: "formData[item.prop]"
  130. }
  131. }) : _vm._e(), _vm._v(" "), item.type === 'select' ? _c('el-select', {
  132. style: {
  133. width: item.width
  134. },
  135. attrs: {
  136. "disabled": item.disabled,
  137. "clearable": "",
  138. "multiple": _vm.multiple,
  139. "placeholder": item.placeholder
  140. },
  141. on: {
  142. "change": function ($event) {
  143. item.change && item.change(_vm.formData[item.prop]);
  144. }
  145. },
  146. model: {
  147. value: _vm.formData[item.prop],
  148. callback: function ($$v) {
  149. _vm.$set(_vm.formData, item.prop, $$v);
  150. },
  151. expression: "formData[item.prop]"
  152. }
  153. }, _vm._l(item.selectList, function (option) {
  154. return _c('el-option', {
  155. key: option.id,
  156. attrs: {
  157. "label": option.name,
  158. "value": option.id
  159. }
  160. });
  161. }), 1) : _vm._e(), _vm._v(" "), item.type === 'selectObj' ? _c('el-select', {
  162. style: {
  163. width: item.width
  164. },
  165. attrs: {
  166. "disabled": item.disabled,
  167. "filterable": "",
  168. "clearable": "",
  169. "placeholder": item.placeholder
  170. },
  171. on: {
  172. "change": function ($event) {
  173. item.change && item.change(_vm.formData[item.prop]);
  174. }
  175. },
  176. model: {
  177. value: _vm.formData[item.prop],
  178. callback: function ($$v) {
  179. _vm.$set(_vm.formData, item.prop, $$v);
  180. },
  181. expression: "formData[item.prop]"
  182. }
  183. }, _vm._l(item.selectList, function (item, key) {
  184. return _c('el-option', {
  185. key: parseInt(key),
  186. attrs: {
  187. "label": item,
  188. "value": parseInt(key)
  189. }
  190. });
  191. }), 1) : _vm._e(), _vm._v(" "), item.type === 'radio' ? _c('el-radio-group', {
  192. attrs: {
  193. "disabled": item.disabled
  194. },
  195. on: {
  196. "change": function ($event) {
  197. item.change && item.change(_vm.formData[item.prop]);
  198. }
  199. },
  200. model: {
  201. value: _vm.formData[item.prop],
  202. callback: function ($$v) {
  203. _vm.$set(_vm.formData, item.prop, $$v);
  204. },
  205. expression: "formData[item.prop]"
  206. }
  207. }, _vm._l(item.radios, function (radio) {
  208. return _c('el-radio', {
  209. key: radio.label,
  210. attrs: {
  211. "label": radio.label
  212. }
  213. });
  214. }), 1) : _vm._e(), _vm._v(" "), item.type === 'checkbox' ? _c('el-checkbox-group', {
  215. attrs: {
  216. "disabled": item.disabled
  217. },
  218. on: {
  219. "change": function ($event) {
  220. item.change && item.change(_vm.formData[item.prop]);
  221. }
  222. },
  223. model: {
  224. value: _vm.formData[item.prop],
  225. callback: function ($$v) {
  226. _vm.$set(_vm.formData, item.prop, $$v);
  227. },
  228. expression: "formData[item.prop]"
  229. }
  230. }, _vm._l(item.checkboxs, function (item) {
  231. return _c('el-checkbox', {
  232. key: item.label,
  233. attrs: {
  234. "label": item.label
  235. }
  236. }, [_vm._v(_vm._s(item.label))]);
  237. }), 1) : _vm._e(), _vm._v(" "), item.type === 'switch' ? _c('el-switch', {
  238. attrs: {
  239. "disabled": item.disabled
  240. },
  241. on: {
  242. "change": function ($event) {
  243. item.change && item.change(_vm.formData[item.prop]);
  244. }
  245. },
  246. model: {
  247. value: _vm.formData[item.prop],
  248. callback: function ($$v) {
  249. _vm.$set(_vm.formData, item.prop, $$v);
  250. },
  251. expression: "formData[item.prop]"
  252. }
  253. }) : _vm._e(), _vm._v(" "), item.type === 'slot' ? [_vm._t(item.slotName)] : _vm._e()], 2);
  254. }), 1), _vm._ssrNode(" "), _vm._ssrNode("<div class=\"submit-btn\">", "</div>", [_vm.showLoginBtn ? _c('el-button', {
  255. attrs: {
  256. "loading": _vm.submitLoading
  257. },
  258. nativeOn: {
  259. "click": function ($event) {
  260. return _vm.submit.apply(null, arguments);
  261. }
  262. }
  263. }, [_vm._v("\n LOGIN\n ")]) : _vm._e(), _vm._ssrNode(" "), _vm.showRegisterBtn ? _c('el-button', {
  264. attrs: {
  265. "loading": _vm.submitLoading
  266. },
  267. nativeOn: {
  268. "click": function ($event) {
  269. return _vm.submit.apply(null, arguments);
  270. }
  271. }
  272. }, [_vm._v("\n REGISTER\n ")]) : _vm._e(), _vm._ssrNode(" "), _vm.showDeleteBtn ? _c('el-button', {
  273. nativeOn: {
  274. "click": function ($event) {
  275. return _vm.close.apply(null, arguments);
  276. }
  277. }
  278. }, [_vm._v("取 消")]) : _vm._e()], 2)], 2);
  279. };
  280. var staticRenderFns = [];
  281. // CONCATENATED MODULE: ./components/PcGlobalForm.vue?vue&type=template&id=4b4d0fec
  282. // 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/PcGlobalForm.vue?vue&type=script&lang=js
  283. /* harmony default export */ var PcGlobalFormvue_type_script_lang_js = ({
  284. name: "GlobalForm",
  285. props: {
  286. showDeleteBtn: {
  287. type: Boolean,
  288. default: true
  289. },
  290. showLoginBtn: {
  291. type: Boolean,
  292. default: true
  293. },
  294. showRegisterBtn: {
  295. type: Boolean,
  296. default: true
  297. },
  298. // 表单配置
  299. formConfig: {
  300. type: Array,
  301. required: true
  302. },
  303. // 表单数据
  304. formData: {
  305. type: Object,
  306. required: true
  307. },
  308. // 表单规则
  309. rules: {
  310. type: Object
  311. },
  312. submitLoading: {
  313. type: Boolean
  314. }
  315. },
  316. data() {
  317. return {
  318. flag: false
  319. };
  320. },
  321. methods: {
  322. submit() {
  323. this.$refs.ruleForm.validate(valid => {
  324. if (valid) {
  325. this.$emit("handleSubmit");
  326. } else {
  327. console.log("error submit!!");
  328. return false;
  329. }
  330. });
  331. },
  332. close() {
  333. this.$emit("handleClose");
  334. },
  335. showPassword() {
  336. this.flag = !this.flag;
  337. }
  338. }
  339. });
  340. // CONCATENATED MODULE: ./components/PcGlobalForm.vue?vue&type=script&lang=js
  341. /* harmony default export */ var components_PcGlobalFormvue_type_script_lang_js = (PcGlobalFormvue_type_script_lang_js);
  342. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  343. var componentNormalizer = __webpack_require__(2);
  344. // CONCATENATED MODULE: ./components/PcGlobalForm.vue
  345. function injectStyles (context) {
  346. var style0 = __webpack_require__(244)
  347. if (style0.__inject__) style0.__inject__(context)
  348. }
  349. /* normalize component */
  350. var component = Object(componentNormalizer["a" /* default */])(
  351. components_PcGlobalFormvue_type_script_lang_js,
  352. render,
  353. staticRenderFns,
  354. false,
  355. injectStyles,
  356. null,
  357. "905cdef0"
  358. )
  359. /* harmony default export */ var PcGlobalForm = __webpack_exports__["default"] = (component.exports);
  360. /***/ })
  361. };;
  362. //# sourceMappingURL=pc-global-form.js.map