web-component-gallery 1.1.41 → 1.1.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/amap.umd.js +5 -5
- package/dist/form.umd.js +5 -5
- package/dist/index.umd.js +5 -5
- package/lib/form/Model.js +6 -7
- package/lib/form/components/ASelectCustom.vue +1 -1
- package/lib/form/components/AUpload.vue +15 -6
- package/lib/form/utils/render.js +12 -4
- package/package.json +1 -1
- package/plugins/lib/form/Model.js +6 -7
- package/plugins/lib/form/components/ASelectCustom.vue +1 -1
- package/plugins/lib/form/components/AUpload.vue +15 -6
- package/plugins/lib/form/utils/render.js +12 -4
- package/plugins/method/AMap.js +9 -4
- package/plugins/utils/AutoFlexible.js +0 -39
package/dist/amap.umd.js
CHANGED
|
@@ -8613,7 +8613,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var mome
|
|
|
8613
8613
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
8614
8614
|
|
|
8615
8615
|
"use strict";
|
|
8616
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/select/index.js\");\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/checkbox/index.js\");\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/pagination/index.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'TAntdSelect',\n components: {\n VNodes: {\n functional: true,\n render: (h, ctx) => ctx.props.vnodes\n },\n Select: ant_design_vue__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n SelectOption: ant_design_vue__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Option,\n Checkbox: ant_design_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n Pagination: ant_design_vue__WEBPACK_IMPORTED_MODULE_2__[\"default\"]\n },\n props: {\n value: {\n type: [String, Number, Array, Boolean, Object],\n default: undefined\n },\n // 多选 'multiple'\n mode: {\n type: String\n },\n // 是否支持输入\n isInput: {\n type: Boolean,\n default: false\n },\n placeholder: {\n type: String,\n default: '请选择'\n },\n // 选择框宽度\n width: {\n type: String\n },\n // 是否自定义设置下拉label\n customLabel: {\n type: String\n },\n // 传入的option数组中,要作为最终选择项的键值key\n valueKey: {\n type: String,\n default: 'value'\n },\n // 传入的option数组中,要作为显示项的键值名称\n labelKey: {\n type: String,\n default: 'label'\n },\n // 下拉框组件数据源\n options: {\n type: Array\n },\n // 是否显示分页\n isShowPagination: {\n type: Boolean,\n default: false\n },\n // 分页配置项\n paginationOption: {\n type: Object,\n default: () => {\n return {\n pageSize: 6,\n // 每页显示条数\n current: 1,\n // 当前页\n total: 0 // 总条数\n };\n }\n }\n },\n data() {\n return {\n selectOpen: false\n };\n },\n computed: {\n childSelectedValue: {\n get() {\n return this.value;\n },\n set(val) {\n this.$emit('input', val);\n }\n },\n attrs() {\n return {\n allowClear: true,\n showSearch: true,\n ...this.$attrs\n };\n },\n selectChecked: {\n get() {\n return this.childSelectedValue?.length === this.options?.length;\n },\n set(val) {\n this.$emit('input', val);\n }\n }\n },\n mounted() {\n document.addEventListener('click', this.bodyCloseMenus);\n },\n beforeDestroy() {\n document.removeEventListener('click', this.bodyCloseMenus);\n },\n methods: {\n filterOption(input, option) {\n this.isInput && (this.childSelectedValue = input);\n return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0;\n },\n // 点击空白区域\n bodyCloseMenus(e) {\n if (this.$refs.main && !this.$refs.main.contains(e.target)) {\n if (this.selectOpen == true) {\n this.selectOpen = false;\n }\n }\n },\n // 点击全选\n selectAll(val) {\n const options = JSON.parse(JSON.stringify(this.options));\n if (val.target.checked) {\n const childSelectedValue = options?.map(item => {\n return item[this.valueKey];\n });\n setTimeout(() => {\n this.$emit('input', childSelectedValue);\n }, 0);\n } else {\n this.$emit('input', null);\n }\n this.selectOpen = false;\n },\n handleSelect(value, option) {\n if (value) {\n this.selectOpen = false;\n }\n const options = this.options.find(e => e[this.valueKey] == value);\n this.$emit('select', value, options);\n },\n // 切换分页\n currentChange(val) {\n // console.log('切换分页', val)\n if (!this.mode) {\n this.childSelectedValue = null;\n }\n setTimeout(() => {\n this.selectOpen = true;\n }, 0);\n this.$emit('current-change', val);\n },\n // 自定义label显示\n customLabelHandler(item) {\n // eslint-disable-next-line no-eval\n return eval(this.customLabel);\n }\n }\n});\n\n//# sourceURL=webpack://mui/./plugins/lib/form/components/ASelectCustom.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options");
|
|
8616
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/select/index.js\");\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/checkbox/index.js\");\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/pagination/index.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'TAntdSelect',\n components: {\n VNodes: {\n functional: true,\n render: (h, ctx) => ctx.props.vnodes\n },\n Select: ant_design_vue__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n SelectOption: ant_design_vue__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Option,\n Checkbox: ant_design_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n Pagination: ant_design_vue__WEBPACK_IMPORTED_MODULE_2__[\"default\"]\n },\n props: {\n value: {\n type: [String, Number, Array, Boolean, Object],\n default: undefined\n },\n // 多选 'multiple'\n mode: {\n type: String\n },\n // 是否支持输入\n isInput: {\n type: Boolean,\n default: false\n },\n placeholder: {\n type: String,\n default: '请选择'\n },\n // 选择框宽度\n width: {\n type: String\n },\n // 是否自定义设置下拉label\n customLabel: {\n type: String\n },\n // 传入的option数组中,要作为最终选择项的键值key\n valueKey: {\n type: String,\n default: 'value'\n },\n // 传入的option数组中,要作为显示项的键值名称\n labelKey: {\n type: String,\n default: 'label'\n },\n // 下拉框组件数据源\n options: {\n type: Array\n },\n // 是否显示分页\n isShowPagination: {\n type: Boolean,\n default: false\n },\n // 分页配置项\n paginationOption: {\n type: Object,\n default: () => {\n return {\n pageSize: 6,\n // 每页显示条数\n current: 1,\n // 当前页\n total: 0 // 总条数\n };\n }\n }\n },\n data() {\n return {\n selectOpen: false\n };\n },\n computed: {\n childSelectedValue: {\n get() {\n return this.value;\n },\n set(val) {\n this.$emit('input', val);\n }\n },\n attrs() {\n return {\n allowClear: true,\n showSearch: true,\n ...this.$attrs\n };\n },\n selectChecked: {\n get() {\n return this.childSelectedValue?.length === this.options?.length;\n },\n set(val) {\n this.$emit('input', val);\n }\n }\n },\n mounted() {\n document.addEventListener('click', this.bodyCloseMenus);\n },\n beforeDestroy() {\n document.removeEventListener('click', this.bodyCloseMenus);\n },\n methods: {\n filterOption(input, option) {\n this.isInput && (this.childSelectedValue = input);\n return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0;\n },\n // 点击空白区域\n bodyCloseMenus(e) {\n if (this.$refs.main && !this.$refs.main.contains(e.target)) {\n if (this.selectOpen == true) {\n this.selectOpen = false;\n }\n }\n },\n // 点击全选\n selectAll(val) {\n const options = JSON.parse(JSON.stringify(this.options));\n if (val.target.checked) {\n const childSelectedValue = options?.map(item => {\n return item[this.valueKey];\n });\n setTimeout(() => {\n this.$emit('input', childSelectedValue);\n }, 0);\n } else {\n this.$emit('input', null);\n }\n this.selectOpen = false;\n },\n handleSelect(value, option) {\n if (value) {\n this.selectOpen = false;\n }\n const options = this.options.find(e => e[this.valueKey] == value);\n options[this.valueKey] && this.$emit('select', value, options);\n },\n // 切换分页\n currentChange(val) {\n // console.log('切换分页', val)\n if (!this.mode) {\n this.childSelectedValue = null;\n }\n setTimeout(() => {\n this.selectOpen = true;\n }, 0);\n this.$emit('current-change', val);\n },\n // 自定义label显示\n customLabelHandler(item) {\n // eslint-disable-next-line no-eval\n return eval(this.customLabel);\n }\n }\n});\n\n//# sourceURL=webpack://mui/./plugins/lib/form/components/ASelectCustom.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options");
|
|
8617
8617
|
|
|
8618
8618
|
/***/ }),
|
|
8619
8619
|
|
|
@@ -8646,7 +8646,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var ant_
|
|
|
8646
8646
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
8647
8647
|
|
|
8648
8648
|
"use strict";
|
|
8649
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/icon/index.js\");\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/upload/index.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n model: {\n prop: 'value',\n event: 'handleFileUpload'\n },\n components: {\n Icon: ant_design_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n
|
|
8649
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/icon/index.js\");\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/button/index.js\");\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/upload/index.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n model: {\n prop: 'value',\n event: 'handleFileUpload'\n },\n components: {\n Icon: ant_design_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n Button: ant_design_vue__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n Upload: ant_design_vue__WEBPACK_IMPORTED_MODULE_3__[\"default\"]\n },\n props: {\n value: {\n type: [String, Array],\n default: () => []\n },\n /* 提示文字 */\n tips: String,\n /* 上传文件数量限制 */\n uploadLen: {\n type: Number,\n default: 1\n },\n /* 上传接口 */\n fileUploadUrl: String,\n /* 显示需要pin的接口前缀 */\n filePrefixUrl: String,\n /* 上传文件格式限制 */\n fileAccept: String,\n /* 上传文件携带Headers信息 */\n fileHeaders: Object,\n /* 删除文件函数回调 */\n fileRemoveHandle: Function\n },\n data() {\n return {\n fileList: [],\n modalValue: []\n };\n },\n watch: {\n value() {\n this.setResetFile();\n }\n },\n computed: {\n uploadAttrs() {\n return {\n listType: 'picture-card',\n prefix: this.filePrefixUrl ?? this.$https.FILEURL,\n action: this.fileUploadUrl ?? this.$https.UPLOADURL,\n headers: this.fileHeaders ?? this.$store.getters.fileHeaders,\n ...this.$attrs\n };\n }\n },\n mounted() {\n this.setResetFile();\n },\n methods: {\n setResetFile() {\n let arrayObject;\n try {\n arrayObject = JSON.parse(this.value);\n } catch (e) {\n arrayObject = [].concat(this.value);\n }\n this.modalValue = arrayObject ?? [];\n this.fileList = this.modalValue.map(file => ({\n ...file,\n url: `${this.uploadAttrs.prefix}${file.url}`,\n type: file.contentType,\n status: 'done'\n }));\n },\n handleFilePreview({\n uid,\n contentType,\n url\n }) {\n let suffix = url.substr(url.lastIndexOf('.') + 1);\n const pictureSuffix = ['JPEG', 'JPG', 'GIF', 'PNG', 'TIFF', 'WEBP', 'BMP'];\n if (contentType.includes('image') || pictureSuffix.includes(suffix.toUpperCase())) {\n this.$viewerApi({\n options: {\n url: 'url',\n toolbar: true,\n initialViewIndex: this.fileList.findIndex(file => file.url == url)\n },\n images: this.fileList\n });\n return;\n }\n this.$dialog('Brower', {\n data: url\n }, {\n title: '预览文件',\n width: 1104,\n height: 848,\n centered: true,\n maskClosable: false,\n footer: false,\n bodyStyle: {\n height: 'calc( 100% - 54px )'\n }\n });\n },\n handleFileChange({\n file,\n fileList\n }) {\n file.status == 'uploading' && (this.fileList = fileList);\n switch (file.status) {\n case 'removed':\n const params = {\n id: file.uid\n };\n const requestHandle = this.fileRemoveHandle ? this.fileRemoveHandle(params) : this.$store.dispatch('fileRemoveHandle', params);\n requestHandle.then(Response => {\n const i = this.modalValue.findIndex(e => e.uid == file.uid);\n this.modalValue.splice(i, 1);\n this.$emit('handleFileUpload', JSON.stringify(this.modalValue));\n });\n break;\n case 'done':\n const {\n data\n } = file.response;\n const uploadFileObj = {\n ...data,\n uid: data.id\n };\n delete uploadFileObj.id;\n this.modalValue.push(uploadFileObj);\n this.$emit('handleFileUpload', JSON.stringify(this.modalValue));\n break;\n }\n }\n }\n});\n\n//# sourceURL=webpack://mui/./plugins/lib/form/components/AUpload.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options");
|
|
8650
8650
|
|
|
8651
8651
|
/***/ }),
|
|
8652
8652
|
|
|
@@ -8877,7 +8877,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
8877
8877
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
8878
8878
|
|
|
8879
8879
|
"use strict";
|
|
8880
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ render: function() { return /* binding */ render; },\n/* harmony export */ staticRenderFns: function() { return /* binding */ staticRenderFns; }\n/* harmony export */ });\nvar render = function render() {\n var _vm = this,\n _c = _vm._self._c;\n return _c(\"div\", {\n staticClass: \"TAntdUpload\"\n }, [_c(\"Upload\", _vm._b({\n attrs: {\n name: \"file\",\n \"file-list\": _vm.fileList,\n
|
|
8880
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ render: function() { return /* binding */ render; },\n/* harmony export */ staticRenderFns: function() { return /* binding */ staticRenderFns; }\n/* harmony export */ });\nvar render = function render() {\n var _vm = this,\n _c = _vm._self._c;\n return _c(\"div\", {\n staticClass: \"TAntdUpload\"\n }, [_c(\"Upload\", _vm._b({\n attrs: {\n name: \"file\",\n \"file-list\": _vm.fileList,\n accept: _vm.fileAccept\n },\n on: {\n change: _vm.handleFileChange,\n preview: _vm.handleFilePreview,\n reject: function ($event) {\n return _vm.$message.error(`上传文件类型只能为${_vm.fileAccept}`);\n }\n }\n }, \"Upload\", _vm.uploadAttrs, false), [_vm.uploadAttrs.listType === \"text\" ? _c(\"Button\", {\n attrs: {\n type: \"primary\"\n }\n }, [_c(\"Icon\", {\n attrs: {\n type: \"upload\"\n }\n }), _vm._v(\"上传\\n \")], 1) : [!_vm.fileList || _vm.fileList.length < _vm.uploadLen ? _c(\"Icon\", {\n staticStyle: {\n fontsize: \"36px\"\n },\n attrs: {\n type: \"plus\"\n }\n }) : _vm._e()]], 2), _vm._v(\" \"), _vm.tips ? _c(\"span\", {\n staticClass: \"tips\"\n }, [_vm._v(_vm._s(_vm.tips))]) : _vm._e()], 1);\n};\nvar staticRenderFns = [];\nrender._withStripped = true;\n\n\n//# sourceURL=webpack://mui/./plugins/lib/form/components/AUpload.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet%5B1%5D.rules%5B2%5D!./node_modules/vue-loader/lib/index.js??vue-loader-options");
|
|
8881
8881
|
|
|
8882
8882
|
/***/ }),
|
|
8883
8883
|
|
|
@@ -9108,7 +9108,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var ant_
|
|
|
9108
9108
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
9109
9109
|
|
|
9110
9110
|
"use strict";
|
|
9111
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vue/babel-helper-vue-jsx-merge-props */ \"./node_modules/@vue/babel-helper-vue-jsx-merge-props/dist/helper.js\");\n/* harmony import */ var _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/form-model/index.js\");\n/* harmony import */ var _utils_render__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/render */ \"./plugins/lib/form/utils/render.js\");\n/* harmony import */ var _style_Model_less__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style/Model.less */ \"./plugins/lib/form/style/Model.less\");\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'Model',\n model: {\n prop: 'value',\n event: 'Change:Model'\n },\n data() {\n return {\n formRules: {}\n };\n },\n props: {\n value: {\n type: Object,\n default: () => ({})\n },\n /* Form布局方式 */\n layout: {\n type: String,\n default: 'vertical'\n },\n /* 一行显示几个 PS:最多5个 */\n layoutSize: {\n type: Number,\n default: 4,\n validator: value => {\n return value <= 5;\n }\n },\n /* 表单项配置 */\n formSetting: Array\n },\n computed: {\n form: {\n get() {\n /** 校验单独赋值延迟的字段 */\n for (const k in this.value) {\n Object.hasOwnProperty.call(this.formRules, k) && this.$refs.FormModel?.validateField(k);\n }\n return this.value;\n },\n set(value) {\n this.$emit('Change:Model', value);\n }\n },\n formAttrs() {\n let attr = {\n labelCol: {\n span: 4\n },\n wrapperCol: {\n span: 20\n },\n ...this.$attrs\n };\n this.layout === 'vertical' && (delete attr.labelCol, delete attr.wrapperCol);\n return attr;\n },\n filterSetting() {\n return this.formSetting.filter(settingItem => !settingItem.hidden);\n }\n },\n watch: {\n filterSetting: {\n handler(newVal, oldVal) {\n newVal.forEach(node => this.$set(this.formRules, node.model, _utils_render__WEBPACK_IMPORTED_MODULE_1__.setFormItemRule.call(this, node)));\n },\n immediate: true\n }\n },\n mounted() {\n this.$emit('update:refForm', this.$refs.FormModel);\n },\n methods: {\n /** 包含单表单项,多表单项,动态增减表单项合并处理 */\n setModelRender(props) {\n const h = this.$createElement;\n const dynamicModel = this.form[props.model];\n return (\n /** \r\n * multiple为动态多项\r\n * multipleConfig为配置的动态项数据 */\n h(\"div\", {\n \"class\": props.multiple && ['MultipleForm'],\n \"attrs\": {\n ...{\n style: _utils_render__WEBPACK_IMPORTED_MODULE_1__.getFormWidth.call(this, props, this.layoutSize)\n }\n }\n }, [this.$scopedSlots[`${props.model}Tips`] && this.$scopedSlots[`${props.model}Tips`](props), /** 处理动态增减表单 */\n dynamicModel instanceof Array && props.multiple ? dynamicModel.map((modelItem, index) => props.multipleConfig.map((configItem, key) => {\n /** 为动态项时重新定义绑定key、prop等来进行检验 */\n /** 目前还有一个动态项layoutSize排版问题 */\n const childAttrs = {\n key: index,\n prop: `${props.model}.${index}.${configItem.model}`,\n
|
|
9111
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vue/babel-helper-vue-jsx-merge-props */ \"./node_modules/@vue/babel-helper-vue-jsx-merge-props/dist/helper.js\");\n/* harmony import */ var _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/form-model/index.js\");\n/* harmony import */ var _utils_render__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/render */ \"./plugins/lib/form/utils/render.js\");\n/* harmony import */ var _style_Model_less__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style/Model.less */ \"./plugins/lib/form/style/Model.less\");\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'Model',\n model: {\n prop: 'value',\n event: 'Change:Model'\n },\n data() {\n return {\n formRules: {}\n };\n },\n props: {\n value: {\n type: Object,\n default: () => ({})\n },\n /* Form布局方式 */\n layout: {\n type: String,\n default: 'vertical'\n },\n /* 一行显示几个 PS:最多5个 */\n layoutSize: {\n type: Number,\n default: 4,\n validator: value => {\n return value <= 5;\n }\n },\n /* 表单项配置 */\n formSetting: Array\n },\n computed: {\n form: {\n get() {\n /** 校验单独赋值延迟的字段 */\n for (const k in this.value) {\n Object.hasOwnProperty.call(this.formRules, k) && this.$refs.FormModel?.validateField(k);\n }\n return this.value;\n },\n set(value) {\n this.$emit('Change:Model', value);\n }\n },\n formAttrs() {\n let attr = {\n labelCol: {\n span: 4\n },\n wrapperCol: {\n span: 20\n },\n ...this.$attrs\n };\n this.layout === 'vertical' && (delete attr.labelCol, delete attr.wrapperCol);\n return attr;\n },\n filterSetting() {\n return this.formSetting.filter(settingItem => !settingItem.hidden);\n }\n },\n watch: {\n filterSetting: {\n handler(newVal, oldVal) {\n newVal.forEach(node => this.$set(this.formRules, node.model, _utils_render__WEBPACK_IMPORTED_MODULE_1__.setFormItemRule.call(this, node)));\n },\n immediate: true\n }\n },\n mounted() {\n this.$emit('update:refForm', this.$refs.FormModel);\n },\n methods: {\n /** 包含单表单项,多表单项,动态增减表单项合并处理 */\n setModelRender(props) {\n const h = this.$createElement;\n const dynamicModel = this.form[props.model];\n return (\n /** \r\n * multiple为动态多项\r\n * multipleConfig为配置的动态项数据 */\n h(\"div\", {\n \"class\": props.multiple && ['MultipleForm'],\n \"attrs\": {\n ...{\n style: _utils_render__WEBPACK_IMPORTED_MODULE_1__.getFormWidth.call(this, props, this.layoutSize)\n }\n }\n }, [this.$scopedSlots[`${props.model}Tips`] && this.$scopedSlots[`${props.model}Tips`](props), /** 处理动态增减表单 */\n dynamicModel instanceof Array && props.multiple ? dynamicModel.map((modelItem, index) => props.multipleConfig.map((configItem, key) => {\n /** 为动态项时重新定义绑定key、prop等来进行检验 */\n /** 目前还有一个动态项layoutSize排版问题 */\n const childAttrs = {\n key: index,\n prop: `${props.model}.${index}.${configItem.model}`,\n style: _utils_render__WEBPACK_IMPORTED_MODULE_1__.getFormWidth.call(this, configItem, this.layoutSize ?? props.layoutSize),\n rules: _utils_render__WEBPACK_IMPORTED_MODULE_1__.setFormItemRule.call(this, configItem, props),\n parentModel: props.model\n };\n return _utils_render__WEBPACK_IMPORTED_MODULE_1__.setFormItem.call(this, h, modelItem, configItem, childAttrs);\n })) : _utils_render__WEBPACK_IMPORTED_MODULE_1__.setFormItem.call(this, h, this.form, props), this.$scopedSlots[`${props.model}Operate`] && this.$scopedSlots[`${props.model}Operate`](props)])\n );\n },\n /** 提交测验 */\n formSubmit() {\n return new Promise((resolve, reject) => {\n this.$refs.FormModel.validate().then(resolve).catch(err => this.$nextTick(() => {\n const errorDiv = document.getElementsByClassName('has-error');\n errorDiv[0].scrollIntoView({\n behavior: \"smooth\",\n block: \"center\"\n });\n }));\n });\n }\n },\n render() {\n const h = arguments[0];\n const {\n layout,\n formAttrs,\n setModelRender\n } = this;\n return h(ant_design_vue__WEBPACK_IMPORTED_MODULE_3__[\"default\"], _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0___default()([{\n \"ref\": \"FormModel\",\n \"class\": \"FormModel\"\n }, {\n \"props\": {\n model: this.form,\n rules: this.formRules,\n layout,\n ...formAttrs\n }\n }]), [this.$slots.default ?? this.filterSetting.map(props => setModelRender(props))]);\n }\n});\n\n//# sourceURL=webpack://mui/./plugins/lib/form/Model.js?");
|
|
9112
9112
|
|
|
9113
9113
|
/***/ }),
|
|
9114
9114
|
|
|
@@ -9130,7 +9130,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
9130
9130
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
9131
9131
|
|
|
9132
9132
|
"use strict";
|
|
9133
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getFormWidth: function() { return /* binding */ getFormWidth; },\n/* harmony export */ setFormItem: function() { return /* binding */ setFormItem; },\n/* harmony export */ setFormItemRule: function() { return /* binding */ setFormItemRule; }\n/* harmony export */ });\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/form-model/index.js\");\n/* harmony import */ var _components_RenderComp_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/RenderComp.vue */ \"./plugins/lib/form/components/RenderComp.vue\");\n\n\nconst FormModelItem = ant_design_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"].Item;\n\n/** 根据layoutSize来进行距离及大小切分 */\nfunction getFormWidth(child, layoutSize) {\n if (this.layout === 'vertical') return `flex: 0 1 calc((${100 / layoutSize * (child.size ?? 1)}% - 24px));margin-right:24px;`;\n return `flex: 0 1 ${100 / layoutSize * (child.size ?? 1)}%;`;\n}\n\n/** 动态设置单个表单项规则 (同时解决处理动态增减表单项操作 */\nfunction setFormItemRule(node, nodeParent = {}) {\n const required = node.required ?? nodeParent.required ?? this.formAttrs.required ?? true;\n\n /** node.placeholder与组件内的提示文字位置不对等 */\n const message = node.attrs?.placeholder || (/(select|picker|radio|upload)/.test((node.is ?? 'Input').toLowerCase()) ? '请选择' : '请输入') + (node.label || '');\n const rules = [{\n required,\n message,\n trigger: ['change', 'blur']\n }].concat((node.rules || []).filter(i => {\n i.pattern && (i.pattern = new RegExp(i.pattern));\n return i;\n }));\n return rules;\n}\n\n/** 动态渲染表单项 */\nfunction setFormItem(h, vModel, child, childAttrs) {\n const {\n layout,\n layoutSize,\n $scopedSlots\n } = this;\n let formItemAttrs = childAttrs ?? {\n key: child.model,\n prop: child.model,\n
|
|
9133
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getFormWidth: function() { return /* binding */ getFormWidth; },\n/* harmony export */ setFormItem: function() { return /* binding */ setFormItem; },\n/* harmony export */ setFormItemRule: function() { return /* binding */ setFormItemRule; }\n/* harmony export */ });\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/form-model/index.js\");\n/* harmony import */ var _components_RenderComp_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/RenderComp.vue */ \"./plugins/lib/form/components/RenderComp.vue\");\n\n\nconst FormModelItem = ant_design_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"].Item;\n\n/** 根据layoutSize来进行距离及大小切分 */\nfunction getFormWidth(child, layoutSize) {\n if (this.layout === 'vertical') return `flex: 0 1 calc((${100 / layoutSize * (child.size ?? 1)}% - 24px));margin-right:24px;`;\n return `flex: 0 1 ${100 / layoutSize * (child.size ?? 1)}%;`;\n}\n\n/** 动态设置单个表单项规则 (同时解决处理动态增减表单项操作 */\nfunction setFormItemRule(node, nodeParent = {}) {\n const required = node.required ?? nodeParent.required ?? this.formAttrs.required ?? true;\n\n /** node.placeholder与组件内的提示文字位置不对等 */\n const message = node.attrs?.placeholder || (/(select|picker|radio|upload)/.test((node.is ?? 'Input').toLowerCase()) ? '请选择' : '请输入') + (node.label || '');\n const rules = [{\n required,\n message,\n trigger: ['change', 'blur']\n }].concat((node.rules || []).filter(i => {\n i.pattern && (i.pattern = new RegExp(i.pattern));\n return i;\n }));\n return rules;\n}\n\n/** 动态渲染表单项 */\nfunction setFormItem(h, vModel, child, childAttrs) {\n const {\n layout,\n layoutSize,\n $scopedSlots\n } = this;\n let formItemAttrs = childAttrs ?? {\n key: child.model,\n prop: child.model,\n colon: !(layout == 'inline')\n };\n const slotsName = (childAttrs?.parentModel ?? '') + child.model;\n const {\n label,\n customLabel\n } = child;\n return h(FormModelItem, {\n \"class\": [{\n FormLineVertical: child.size === layoutSize && layout === 'vertical'\n }, {\n FormLine: child.size === layoutSize\n }],\n \"attrs\": {\n ...formItemAttrs\n }\n }, [h(\"template\", {\n \"slot\": \"label\"\n }, [customLabel ? customLabel(vModel) : h(\"span\", [label])]), $scopedSlots[child.model] ? $scopedSlots[child.model](child) : h(_components_RenderComp_vue__WEBPACK_IMPORTED_MODULE_0__[\"default\"], {\n \"attrs\": {\n \"component\": child.is,\n ...child.attrs\n },\n \"on\": {\n ...child.event\n },\n \"model\": {\n value: vModel[child.model],\n callback: $$v => {\n this.$set(vModel, child.model, $$v);\n }\n }\n }), $scopedSlots[`${slotsName}Handle`] && $scopedSlots[`${slotsName}Handle`](formItemAttrs)]);\n}\n\n//# sourceURL=webpack://mui/./plugins/lib/form/utils/render.js?");
|
|
9134
9134
|
|
|
9135
9135
|
/***/ }),
|
|
9136
9136
|
|
package/dist/form.umd.js
CHANGED
|
@@ -7253,7 +7253,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var mome
|
|
|
7253
7253
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
7254
7254
|
|
|
7255
7255
|
"use strict";
|
|
7256
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/select/index.js\");\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/checkbox/index.js\");\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/pagination/index.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'TAntdSelect',\n components: {\n VNodes: {\n functional: true,\n render: (h, ctx) => ctx.props.vnodes\n },\n Select: ant_design_vue__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n SelectOption: ant_design_vue__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Option,\n Checkbox: ant_design_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n Pagination: ant_design_vue__WEBPACK_IMPORTED_MODULE_2__[\"default\"]\n },\n props: {\n value: {\n type: [String, Number, Array, Boolean, Object],\n default: undefined\n },\n // 多选 'multiple'\n mode: {\n type: String\n },\n // 是否支持输入\n isInput: {\n type: Boolean,\n default: false\n },\n placeholder: {\n type: String,\n default: '请选择'\n },\n // 选择框宽度\n width: {\n type: String\n },\n // 是否自定义设置下拉label\n customLabel: {\n type: String\n },\n // 传入的option数组中,要作为最终选择项的键值key\n valueKey: {\n type: String,\n default: 'value'\n },\n // 传入的option数组中,要作为显示项的键值名称\n labelKey: {\n type: String,\n default: 'label'\n },\n // 下拉框组件数据源\n options: {\n type: Array\n },\n // 是否显示分页\n isShowPagination: {\n type: Boolean,\n default: false\n },\n // 分页配置项\n paginationOption: {\n type: Object,\n default: () => {\n return {\n pageSize: 6,\n // 每页显示条数\n current: 1,\n // 当前页\n total: 0 // 总条数\n };\n }\n }\n },\n data() {\n return {\n selectOpen: false\n };\n },\n computed: {\n childSelectedValue: {\n get() {\n return this.value;\n },\n set(val) {\n this.$emit('input', val);\n }\n },\n attrs() {\n return {\n allowClear: true,\n showSearch: true,\n ...this.$attrs\n };\n },\n selectChecked: {\n get() {\n return this.childSelectedValue?.length === this.options?.length;\n },\n set(val) {\n this.$emit('input', val);\n }\n }\n },\n mounted() {\n document.addEventListener('click', this.bodyCloseMenus);\n },\n beforeDestroy() {\n document.removeEventListener('click', this.bodyCloseMenus);\n },\n methods: {\n filterOption(input, option) {\n this.isInput && (this.childSelectedValue = input);\n return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0;\n },\n // 点击空白区域\n bodyCloseMenus(e) {\n if (this.$refs.main && !this.$refs.main.contains(e.target)) {\n if (this.selectOpen == true) {\n this.selectOpen = false;\n }\n }\n },\n // 点击全选\n selectAll(val) {\n const options = JSON.parse(JSON.stringify(this.options));\n if (val.target.checked) {\n const childSelectedValue = options?.map(item => {\n return item[this.valueKey];\n });\n setTimeout(() => {\n this.$emit('input', childSelectedValue);\n }, 0);\n } else {\n this.$emit('input', null);\n }\n this.selectOpen = false;\n },\n handleSelect(value, option) {\n if (value) {\n this.selectOpen = false;\n }\n const options = this.options.find(e => e[this.valueKey] == value);\n this.$emit('select', value, options);\n },\n // 切换分页\n currentChange(val) {\n // console.log('切换分页', val)\n if (!this.mode) {\n this.childSelectedValue = null;\n }\n setTimeout(() => {\n this.selectOpen = true;\n }, 0);\n this.$emit('current-change', val);\n },\n // 自定义label显示\n customLabelHandler(item) {\n // eslint-disable-next-line no-eval\n return eval(this.customLabel);\n }\n }\n});\n\n//# sourceURL=webpack://mui/./plugins/lib/form/components/ASelectCustom.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options");
|
|
7256
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/select/index.js\");\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/checkbox/index.js\");\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/pagination/index.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'TAntdSelect',\n components: {\n VNodes: {\n functional: true,\n render: (h, ctx) => ctx.props.vnodes\n },\n Select: ant_design_vue__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n SelectOption: ant_design_vue__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Option,\n Checkbox: ant_design_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n Pagination: ant_design_vue__WEBPACK_IMPORTED_MODULE_2__[\"default\"]\n },\n props: {\n value: {\n type: [String, Number, Array, Boolean, Object],\n default: undefined\n },\n // 多选 'multiple'\n mode: {\n type: String\n },\n // 是否支持输入\n isInput: {\n type: Boolean,\n default: false\n },\n placeholder: {\n type: String,\n default: '请选择'\n },\n // 选择框宽度\n width: {\n type: String\n },\n // 是否自定义设置下拉label\n customLabel: {\n type: String\n },\n // 传入的option数组中,要作为最终选择项的键值key\n valueKey: {\n type: String,\n default: 'value'\n },\n // 传入的option数组中,要作为显示项的键值名称\n labelKey: {\n type: String,\n default: 'label'\n },\n // 下拉框组件数据源\n options: {\n type: Array\n },\n // 是否显示分页\n isShowPagination: {\n type: Boolean,\n default: false\n },\n // 分页配置项\n paginationOption: {\n type: Object,\n default: () => {\n return {\n pageSize: 6,\n // 每页显示条数\n current: 1,\n // 当前页\n total: 0 // 总条数\n };\n }\n }\n },\n data() {\n return {\n selectOpen: false\n };\n },\n computed: {\n childSelectedValue: {\n get() {\n return this.value;\n },\n set(val) {\n this.$emit('input', val);\n }\n },\n attrs() {\n return {\n allowClear: true,\n showSearch: true,\n ...this.$attrs\n };\n },\n selectChecked: {\n get() {\n return this.childSelectedValue?.length === this.options?.length;\n },\n set(val) {\n this.$emit('input', val);\n }\n }\n },\n mounted() {\n document.addEventListener('click', this.bodyCloseMenus);\n },\n beforeDestroy() {\n document.removeEventListener('click', this.bodyCloseMenus);\n },\n methods: {\n filterOption(input, option) {\n this.isInput && (this.childSelectedValue = input);\n return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0;\n },\n // 点击空白区域\n bodyCloseMenus(e) {\n if (this.$refs.main && !this.$refs.main.contains(e.target)) {\n if (this.selectOpen == true) {\n this.selectOpen = false;\n }\n }\n },\n // 点击全选\n selectAll(val) {\n const options = JSON.parse(JSON.stringify(this.options));\n if (val.target.checked) {\n const childSelectedValue = options?.map(item => {\n return item[this.valueKey];\n });\n setTimeout(() => {\n this.$emit('input', childSelectedValue);\n }, 0);\n } else {\n this.$emit('input', null);\n }\n this.selectOpen = false;\n },\n handleSelect(value, option) {\n if (value) {\n this.selectOpen = false;\n }\n const options = this.options.find(e => e[this.valueKey] == value);\n options[this.valueKey] && this.$emit('select', value, options);\n },\n // 切换分页\n currentChange(val) {\n // console.log('切换分页', val)\n if (!this.mode) {\n this.childSelectedValue = null;\n }\n setTimeout(() => {\n this.selectOpen = true;\n }, 0);\n this.$emit('current-change', val);\n },\n // 自定义label显示\n customLabelHandler(item) {\n // eslint-disable-next-line no-eval\n return eval(this.customLabel);\n }\n }\n});\n\n//# sourceURL=webpack://mui/./plugins/lib/form/components/ASelectCustom.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options");
|
|
7257
7257
|
|
|
7258
7258
|
/***/ }),
|
|
7259
7259
|
|
|
@@ -7286,7 +7286,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var ant_
|
|
|
7286
7286
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
7287
7287
|
|
|
7288
7288
|
"use strict";
|
|
7289
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/icon/index.js\");\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/upload/index.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n model: {\n prop: 'value',\n event: 'handleFileUpload'\n },\n components: {\n Icon: ant_design_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n
|
|
7289
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/icon/index.js\");\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/button/index.js\");\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/upload/index.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n model: {\n prop: 'value',\n event: 'handleFileUpload'\n },\n components: {\n Icon: ant_design_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n Button: ant_design_vue__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n Upload: ant_design_vue__WEBPACK_IMPORTED_MODULE_3__[\"default\"]\n },\n props: {\n value: {\n type: [String, Array],\n default: () => []\n },\n /* 提示文字 */\n tips: String,\n /* 上传文件数量限制 */\n uploadLen: {\n type: Number,\n default: 1\n },\n /* 上传接口 */\n fileUploadUrl: String,\n /* 显示需要pin的接口前缀 */\n filePrefixUrl: String,\n /* 上传文件格式限制 */\n fileAccept: String,\n /* 上传文件携带Headers信息 */\n fileHeaders: Object,\n /* 删除文件函数回调 */\n fileRemoveHandle: Function\n },\n data() {\n return {\n fileList: [],\n modalValue: []\n };\n },\n watch: {\n value() {\n this.setResetFile();\n }\n },\n computed: {\n uploadAttrs() {\n return {\n listType: 'picture-card',\n prefix: this.filePrefixUrl ?? this.$https.FILEURL,\n action: this.fileUploadUrl ?? this.$https.UPLOADURL,\n headers: this.fileHeaders ?? this.$store.getters.fileHeaders,\n ...this.$attrs\n };\n }\n },\n mounted() {\n this.setResetFile();\n },\n methods: {\n setResetFile() {\n let arrayObject;\n try {\n arrayObject = JSON.parse(this.value);\n } catch (e) {\n arrayObject = [].concat(this.value);\n }\n this.modalValue = arrayObject ?? [];\n this.fileList = this.modalValue.map(file => ({\n ...file,\n url: `${this.uploadAttrs.prefix}${file.url}`,\n type: file.contentType,\n status: 'done'\n }));\n },\n handleFilePreview({\n uid,\n contentType,\n url\n }) {\n let suffix = url.substr(url.lastIndexOf('.') + 1);\n const pictureSuffix = ['JPEG', 'JPG', 'GIF', 'PNG', 'TIFF', 'WEBP', 'BMP'];\n if (contentType.includes('image') || pictureSuffix.includes(suffix.toUpperCase())) {\n this.$viewerApi({\n options: {\n url: 'url',\n toolbar: true,\n initialViewIndex: this.fileList.findIndex(file => file.url == url)\n },\n images: this.fileList\n });\n return;\n }\n this.$dialog('Brower', {\n data: url\n }, {\n title: '预览文件',\n width: 1104,\n height: 848,\n centered: true,\n maskClosable: false,\n footer: false,\n bodyStyle: {\n height: 'calc( 100% - 54px )'\n }\n });\n },\n handleFileChange({\n file,\n fileList\n }) {\n file.status == 'uploading' && (this.fileList = fileList);\n switch (file.status) {\n case 'removed':\n const params = {\n id: file.uid\n };\n const requestHandle = this.fileRemoveHandle ? this.fileRemoveHandle(params) : this.$store.dispatch('fileRemoveHandle', params);\n requestHandle.then(Response => {\n const i = this.modalValue.findIndex(e => e.uid == file.uid);\n this.modalValue.splice(i, 1);\n this.$emit('handleFileUpload', JSON.stringify(this.modalValue));\n });\n break;\n case 'done':\n const {\n data\n } = file.response;\n const uploadFileObj = {\n ...data,\n uid: data.id\n };\n delete uploadFileObj.id;\n this.modalValue.push(uploadFileObj);\n this.$emit('handleFileUpload', JSON.stringify(this.modalValue));\n break;\n }\n }\n }\n});\n\n//# sourceURL=webpack://mui/./plugins/lib/form/components/AUpload.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options");
|
|
7290
7290
|
|
|
7291
7291
|
/***/ }),
|
|
7292
7292
|
|
|
@@ -7385,7 +7385,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
7385
7385
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
7386
7386
|
|
|
7387
7387
|
"use strict";
|
|
7388
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ render: function() { return /* binding */ render; },\n/* harmony export */ staticRenderFns: function() { return /* binding */ staticRenderFns; }\n/* harmony export */ });\nvar render = function render() {\n var _vm = this,\n _c = _vm._self._c;\n return _c(\"div\", {\n staticClass: \"TAntdUpload\"\n }, [_c(\"Upload\", _vm._b({\n attrs: {\n name: \"file\",\n \"file-list\": _vm.fileList,\n
|
|
7388
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ render: function() { return /* binding */ render; },\n/* harmony export */ staticRenderFns: function() { return /* binding */ staticRenderFns; }\n/* harmony export */ });\nvar render = function render() {\n var _vm = this,\n _c = _vm._self._c;\n return _c(\"div\", {\n staticClass: \"TAntdUpload\"\n }, [_c(\"Upload\", _vm._b({\n attrs: {\n name: \"file\",\n \"file-list\": _vm.fileList,\n accept: _vm.fileAccept\n },\n on: {\n change: _vm.handleFileChange,\n preview: _vm.handleFilePreview,\n reject: function ($event) {\n return _vm.$message.error(`上传文件类型只能为${_vm.fileAccept}`);\n }\n }\n }, \"Upload\", _vm.uploadAttrs, false), [_vm.uploadAttrs.listType === \"text\" ? _c(\"Button\", {\n attrs: {\n type: \"primary\"\n }\n }, [_c(\"Icon\", {\n attrs: {\n type: \"upload\"\n }\n }), _vm._v(\"上传\\n \")], 1) : [!_vm.fileList || _vm.fileList.length < _vm.uploadLen ? _c(\"Icon\", {\n staticStyle: {\n fontsize: \"36px\"\n },\n attrs: {\n type: \"plus\"\n }\n }) : _vm._e()]], 2), _vm._v(\" \"), _vm.tips ? _c(\"span\", {\n staticClass: \"tips\"\n }, [_vm._v(_vm._s(_vm.tips))]) : _vm._e()], 1);\n};\nvar staticRenderFns = [];\nrender._withStripped = true;\n\n\n//# sourceURL=webpack://mui/./plugins/lib/form/components/AUpload.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet%5B1%5D.rules%5B2%5D!./node_modules/vue-loader/lib/index.js??vue-loader-options");
|
|
7389
7389
|
|
|
7390
7390
|
/***/ }),
|
|
7391
7391
|
|
|
@@ -7440,7 +7440,7 @@ eval("/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source cod
|
|
|
7440
7440
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
7441
7441
|
|
|
7442
7442
|
"use strict";
|
|
7443
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vue/babel-helper-vue-jsx-merge-props */ \"./node_modules/@vue/babel-helper-vue-jsx-merge-props/dist/helper.js\");\n/* harmony import */ var _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/form-model/index.js\");\n/* harmony import */ var _utils_render__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/render */ \"./plugins/lib/form/utils/render.js\");\n/* harmony import */ var _style_Model_less__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style/Model.less */ \"./plugins/lib/form/style/Model.less\");\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'Model',\n model: {\n prop: 'value',\n event: 'Change:Model'\n },\n data() {\n return {\n formRules: {}\n };\n },\n props: {\n value: {\n type: Object,\n default: () => ({})\n },\n /* Form布局方式 */\n layout: {\n type: String,\n default: 'vertical'\n },\n /* 一行显示几个 PS:最多5个 */\n layoutSize: {\n type: Number,\n default: 4,\n validator: value => {\n return value <= 5;\n }\n },\n /* 表单项配置 */\n formSetting: Array\n },\n computed: {\n form: {\n get() {\n /** 校验单独赋值延迟的字段 */\n for (const k in this.value) {\n Object.hasOwnProperty.call(this.formRules, k) && this.$refs.FormModel?.validateField(k);\n }\n return this.value;\n },\n set(value) {\n this.$emit('Change:Model', value);\n }\n },\n formAttrs() {\n let attr = {\n labelCol: {\n span: 4\n },\n wrapperCol: {\n span: 20\n },\n ...this.$attrs\n };\n this.layout === 'vertical' && (delete attr.labelCol, delete attr.wrapperCol);\n return attr;\n },\n filterSetting() {\n return this.formSetting.filter(settingItem => !settingItem.hidden);\n }\n },\n watch: {\n filterSetting: {\n handler(newVal, oldVal) {\n newVal.forEach(node => this.$set(this.formRules, node.model, _utils_render__WEBPACK_IMPORTED_MODULE_1__.setFormItemRule.call(this, node)));\n },\n immediate: true\n }\n },\n mounted() {\n this.$emit('update:refForm', this.$refs.FormModel);\n },\n methods: {\n /** 包含单表单项,多表单项,动态增减表单项合并处理 */\n setModelRender(props) {\n const h = this.$createElement;\n const dynamicModel = this.form[props.model];\n return (\n /** \r\n * multiple为动态多项\r\n * multipleConfig为配置的动态项数据 */\n h(\"div\", {\n \"class\": props.multiple && ['MultipleForm'],\n \"attrs\": {\n ...{\n style: _utils_render__WEBPACK_IMPORTED_MODULE_1__.getFormWidth.call(this, props, this.layoutSize)\n }\n }\n }, [this.$scopedSlots[`${props.model}Tips`] && this.$scopedSlots[`${props.model}Tips`](props), /** 处理动态增减表单 */\n dynamicModel instanceof Array && props.multiple ? dynamicModel.map((modelItem, index) => props.multipleConfig.map((configItem, key) => {\n /** 为动态项时重新定义绑定key、prop等来进行检验 */\n /** 目前还有一个动态项layoutSize排版问题 */\n const childAttrs = {\n key: index,\n prop: `${props.model}.${index}.${configItem.model}`,\n
|
|
7443
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vue/babel-helper-vue-jsx-merge-props */ \"./node_modules/@vue/babel-helper-vue-jsx-merge-props/dist/helper.js\");\n/* harmony import */ var _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/form-model/index.js\");\n/* harmony import */ var _utils_render__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/render */ \"./plugins/lib/form/utils/render.js\");\n/* harmony import */ var _style_Model_less__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style/Model.less */ \"./plugins/lib/form/style/Model.less\");\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'Model',\n model: {\n prop: 'value',\n event: 'Change:Model'\n },\n data() {\n return {\n formRules: {}\n };\n },\n props: {\n value: {\n type: Object,\n default: () => ({})\n },\n /* Form布局方式 */\n layout: {\n type: String,\n default: 'vertical'\n },\n /* 一行显示几个 PS:最多5个 */\n layoutSize: {\n type: Number,\n default: 4,\n validator: value => {\n return value <= 5;\n }\n },\n /* 表单项配置 */\n formSetting: Array\n },\n computed: {\n form: {\n get() {\n /** 校验单独赋值延迟的字段 */\n for (const k in this.value) {\n Object.hasOwnProperty.call(this.formRules, k) && this.$refs.FormModel?.validateField(k);\n }\n return this.value;\n },\n set(value) {\n this.$emit('Change:Model', value);\n }\n },\n formAttrs() {\n let attr = {\n labelCol: {\n span: 4\n },\n wrapperCol: {\n span: 20\n },\n ...this.$attrs\n };\n this.layout === 'vertical' && (delete attr.labelCol, delete attr.wrapperCol);\n return attr;\n },\n filterSetting() {\n return this.formSetting.filter(settingItem => !settingItem.hidden);\n }\n },\n watch: {\n filterSetting: {\n handler(newVal, oldVal) {\n newVal.forEach(node => this.$set(this.formRules, node.model, _utils_render__WEBPACK_IMPORTED_MODULE_1__.setFormItemRule.call(this, node)));\n },\n immediate: true\n }\n },\n mounted() {\n this.$emit('update:refForm', this.$refs.FormModel);\n },\n methods: {\n /** 包含单表单项,多表单项,动态增减表单项合并处理 */\n setModelRender(props) {\n const h = this.$createElement;\n const dynamicModel = this.form[props.model];\n return (\n /** \r\n * multiple为动态多项\r\n * multipleConfig为配置的动态项数据 */\n h(\"div\", {\n \"class\": props.multiple && ['MultipleForm'],\n \"attrs\": {\n ...{\n style: _utils_render__WEBPACK_IMPORTED_MODULE_1__.getFormWidth.call(this, props, this.layoutSize)\n }\n }\n }, [this.$scopedSlots[`${props.model}Tips`] && this.$scopedSlots[`${props.model}Tips`](props), /** 处理动态增减表单 */\n dynamicModel instanceof Array && props.multiple ? dynamicModel.map((modelItem, index) => props.multipleConfig.map((configItem, key) => {\n /** 为动态项时重新定义绑定key、prop等来进行检验 */\n /** 目前还有一个动态项layoutSize排版问题 */\n const childAttrs = {\n key: index,\n prop: `${props.model}.${index}.${configItem.model}`,\n style: _utils_render__WEBPACK_IMPORTED_MODULE_1__.getFormWidth.call(this, configItem, this.layoutSize ?? props.layoutSize),\n rules: _utils_render__WEBPACK_IMPORTED_MODULE_1__.setFormItemRule.call(this, configItem, props),\n parentModel: props.model\n };\n return _utils_render__WEBPACK_IMPORTED_MODULE_1__.setFormItem.call(this, h, modelItem, configItem, childAttrs);\n })) : _utils_render__WEBPACK_IMPORTED_MODULE_1__.setFormItem.call(this, h, this.form, props), this.$scopedSlots[`${props.model}Operate`] && this.$scopedSlots[`${props.model}Operate`](props)])\n );\n },\n /** 提交测验 */\n formSubmit() {\n return new Promise((resolve, reject) => {\n this.$refs.FormModel.validate().then(resolve).catch(err => this.$nextTick(() => {\n const errorDiv = document.getElementsByClassName('has-error');\n errorDiv[0].scrollIntoView({\n behavior: \"smooth\",\n block: \"center\"\n });\n }));\n });\n }\n },\n render() {\n const h = arguments[0];\n const {\n layout,\n formAttrs,\n setModelRender\n } = this;\n return h(ant_design_vue__WEBPACK_IMPORTED_MODULE_3__[\"default\"], _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0___default()([{\n \"ref\": \"FormModel\",\n \"class\": \"FormModel\"\n }, {\n \"props\": {\n model: this.form,\n rules: this.formRules,\n layout,\n ...formAttrs\n }\n }]), [this.$slots.default ?? this.filterSetting.map(props => setModelRender(props))]);\n }\n});\n\n//# sourceURL=webpack://mui/./plugins/lib/form/Model.js?");
|
|
7444
7444
|
|
|
7445
7445
|
/***/ }),
|
|
7446
7446
|
|
|
@@ -7462,7 +7462,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
7462
7462
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
7463
7463
|
|
|
7464
7464
|
"use strict";
|
|
7465
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getFormWidth: function() { return /* binding */ getFormWidth; },\n/* harmony export */ setFormItem: function() { return /* binding */ setFormItem; },\n/* harmony export */ setFormItemRule: function() { return /* binding */ setFormItemRule; }\n/* harmony export */ });\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/form-model/index.js\");\n/* harmony import */ var _components_RenderComp_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/RenderComp.vue */ \"./plugins/lib/form/components/RenderComp.vue\");\n\n\nconst FormModelItem = ant_design_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"].Item;\n\n/** 根据layoutSize来进行距离及大小切分 */\nfunction getFormWidth(child, layoutSize) {\n if (this.layout === 'vertical') return `flex: 0 1 calc((${100 / layoutSize * (child.size ?? 1)}% - 24px));margin-right:24px;`;\n return `flex: 0 1 ${100 / layoutSize * (child.size ?? 1)}%;`;\n}\n\n/** 动态设置单个表单项规则 (同时解决处理动态增减表单项操作 */\nfunction setFormItemRule(node, nodeParent = {}) {\n const required = node.required ?? nodeParent.required ?? this.formAttrs.required ?? true;\n\n /** node.placeholder与组件内的提示文字位置不对等 */\n const message = node.attrs?.placeholder || (/(select|picker|radio|upload)/.test((node.is ?? 'Input').toLowerCase()) ? '请选择' : '请输入') + (node.label || '');\n const rules = [{\n required,\n message,\n trigger: ['change', 'blur']\n }].concat((node.rules || []).filter(i => {\n i.pattern && (i.pattern = new RegExp(i.pattern));\n return i;\n }));\n return rules;\n}\n\n/** 动态渲染表单项 */\nfunction setFormItem(h, vModel, child, childAttrs) {\n const {\n layout,\n layoutSize,\n $scopedSlots\n } = this;\n let formItemAttrs = childAttrs ?? {\n key: child.model,\n prop: child.model,\n
|
|
7465
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getFormWidth: function() { return /* binding */ getFormWidth; },\n/* harmony export */ setFormItem: function() { return /* binding */ setFormItem; },\n/* harmony export */ setFormItemRule: function() { return /* binding */ setFormItemRule; }\n/* harmony export */ });\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/form-model/index.js\");\n/* harmony import */ var _components_RenderComp_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/RenderComp.vue */ \"./plugins/lib/form/components/RenderComp.vue\");\n\n\nconst FormModelItem = ant_design_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"].Item;\n\n/** 根据layoutSize来进行距离及大小切分 */\nfunction getFormWidth(child, layoutSize) {\n if (this.layout === 'vertical') return `flex: 0 1 calc((${100 / layoutSize * (child.size ?? 1)}% - 24px));margin-right:24px;`;\n return `flex: 0 1 ${100 / layoutSize * (child.size ?? 1)}%;`;\n}\n\n/** 动态设置单个表单项规则 (同时解决处理动态增减表单项操作 */\nfunction setFormItemRule(node, nodeParent = {}) {\n const required = node.required ?? nodeParent.required ?? this.formAttrs.required ?? true;\n\n /** node.placeholder与组件内的提示文字位置不对等 */\n const message = node.attrs?.placeholder || (/(select|picker|radio|upload)/.test((node.is ?? 'Input').toLowerCase()) ? '请选择' : '请输入') + (node.label || '');\n const rules = [{\n required,\n message,\n trigger: ['change', 'blur']\n }].concat((node.rules || []).filter(i => {\n i.pattern && (i.pattern = new RegExp(i.pattern));\n return i;\n }));\n return rules;\n}\n\n/** 动态渲染表单项 */\nfunction setFormItem(h, vModel, child, childAttrs) {\n const {\n layout,\n layoutSize,\n $scopedSlots\n } = this;\n let formItemAttrs = childAttrs ?? {\n key: child.model,\n prop: child.model,\n colon: !(layout == 'inline')\n };\n const slotsName = (childAttrs?.parentModel ?? '') + child.model;\n const {\n label,\n customLabel\n } = child;\n return h(FormModelItem, {\n \"class\": [{\n FormLineVertical: child.size === layoutSize && layout === 'vertical'\n }, {\n FormLine: child.size === layoutSize\n }],\n \"attrs\": {\n ...formItemAttrs\n }\n }, [h(\"template\", {\n \"slot\": \"label\"\n }, [customLabel ? customLabel(vModel) : h(\"span\", [label])]), $scopedSlots[child.model] ? $scopedSlots[child.model](child) : h(_components_RenderComp_vue__WEBPACK_IMPORTED_MODULE_0__[\"default\"], {\n \"attrs\": {\n \"component\": child.is,\n ...child.attrs\n },\n \"on\": {\n ...child.event\n },\n \"model\": {\n value: vModel[child.model],\n callback: $$v => {\n this.$set(vModel, child.model, $$v);\n }\n }\n }), $scopedSlots[`${slotsName}Handle`] && $scopedSlots[`${slotsName}Handle`](formItemAttrs)]);\n}\n\n//# sourceURL=webpack://mui/./plugins/lib/form/utils/render.js?");
|
|
7466
7466
|
|
|
7467
7467
|
/***/ }),
|
|
7468
7468
|
|
package/dist/index.umd.js
CHANGED
|
@@ -8613,7 +8613,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var mome
|
|
|
8613
8613
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
8614
8614
|
|
|
8615
8615
|
"use strict";
|
|
8616
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/select/index.js\");\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/checkbox/index.js\");\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/pagination/index.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'TAntdSelect',\n components: {\n VNodes: {\n functional: true,\n render: (h, ctx) => ctx.props.vnodes\n },\n Select: ant_design_vue__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n SelectOption: ant_design_vue__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Option,\n Checkbox: ant_design_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n Pagination: ant_design_vue__WEBPACK_IMPORTED_MODULE_2__[\"default\"]\n },\n props: {\n value: {\n type: [String, Number, Array, Boolean, Object],\n default: undefined\n },\n // 多选 'multiple'\n mode: {\n type: String\n },\n // 是否支持输入\n isInput: {\n type: Boolean,\n default: false\n },\n placeholder: {\n type: String,\n default: '请选择'\n },\n // 选择框宽度\n width: {\n type: String\n },\n // 是否自定义设置下拉label\n customLabel: {\n type: String\n },\n // 传入的option数组中,要作为最终选择项的键值key\n valueKey: {\n type: String,\n default: 'value'\n },\n // 传入的option数组中,要作为显示项的键值名称\n labelKey: {\n type: String,\n default: 'label'\n },\n // 下拉框组件数据源\n options: {\n type: Array\n },\n // 是否显示分页\n isShowPagination: {\n type: Boolean,\n default: false\n },\n // 分页配置项\n paginationOption: {\n type: Object,\n default: () => {\n return {\n pageSize: 6,\n // 每页显示条数\n current: 1,\n // 当前页\n total: 0 // 总条数\n };\n }\n }\n },\n data() {\n return {\n selectOpen: false\n };\n },\n computed: {\n childSelectedValue: {\n get() {\n return this.value;\n },\n set(val) {\n this.$emit('input', val);\n }\n },\n attrs() {\n return {\n allowClear: true,\n showSearch: true,\n ...this.$attrs\n };\n },\n selectChecked: {\n get() {\n return this.childSelectedValue?.length === this.options?.length;\n },\n set(val) {\n this.$emit('input', val);\n }\n }\n },\n mounted() {\n document.addEventListener('click', this.bodyCloseMenus);\n },\n beforeDestroy() {\n document.removeEventListener('click', this.bodyCloseMenus);\n },\n methods: {\n filterOption(input, option) {\n this.isInput && (this.childSelectedValue = input);\n return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0;\n },\n // 点击空白区域\n bodyCloseMenus(e) {\n if (this.$refs.main && !this.$refs.main.contains(e.target)) {\n if (this.selectOpen == true) {\n this.selectOpen = false;\n }\n }\n },\n // 点击全选\n selectAll(val) {\n const options = JSON.parse(JSON.stringify(this.options));\n if (val.target.checked) {\n const childSelectedValue = options?.map(item => {\n return item[this.valueKey];\n });\n setTimeout(() => {\n this.$emit('input', childSelectedValue);\n }, 0);\n } else {\n this.$emit('input', null);\n }\n this.selectOpen = false;\n },\n handleSelect(value, option) {\n if (value) {\n this.selectOpen = false;\n }\n const options = this.options.find(e => e[this.valueKey] == value);\n this.$emit('select', value, options);\n },\n // 切换分页\n currentChange(val) {\n // console.log('切换分页', val)\n if (!this.mode) {\n this.childSelectedValue = null;\n }\n setTimeout(() => {\n this.selectOpen = true;\n }, 0);\n this.$emit('current-change', val);\n },\n // 自定义label显示\n customLabelHandler(item) {\n // eslint-disable-next-line no-eval\n return eval(this.customLabel);\n }\n }\n});\n\n//# sourceURL=webpack://mui/./plugins/lib/form/components/ASelectCustom.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options");
|
|
8616
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/select/index.js\");\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/checkbox/index.js\");\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/pagination/index.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'TAntdSelect',\n components: {\n VNodes: {\n functional: true,\n render: (h, ctx) => ctx.props.vnodes\n },\n Select: ant_design_vue__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n SelectOption: ant_design_vue__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Option,\n Checkbox: ant_design_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n Pagination: ant_design_vue__WEBPACK_IMPORTED_MODULE_2__[\"default\"]\n },\n props: {\n value: {\n type: [String, Number, Array, Boolean, Object],\n default: undefined\n },\n // 多选 'multiple'\n mode: {\n type: String\n },\n // 是否支持输入\n isInput: {\n type: Boolean,\n default: false\n },\n placeholder: {\n type: String,\n default: '请选择'\n },\n // 选择框宽度\n width: {\n type: String\n },\n // 是否自定义设置下拉label\n customLabel: {\n type: String\n },\n // 传入的option数组中,要作为最终选择项的键值key\n valueKey: {\n type: String,\n default: 'value'\n },\n // 传入的option数组中,要作为显示项的键值名称\n labelKey: {\n type: String,\n default: 'label'\n },\n // 下拉框组件数据源\n options: {\n type: Array\n },\n // 是否显示分页\n isShowPagination: {\n type: Boolean,\n default: false\n },\n // 分页配置项\n paginationOption: {\n type: Object,\n default: () => {\n return {\n pageSize: 6,\n // 每页显示条数\n current: 1,\n // 当前页\n total: 0 // 总条数\n };\n }\n }\n },\n data() {\n return {\n selectOpen: false\n };\n },\n computed: {\n childSelectedValue: {\n get() {\n return this.value;\n },\n set(val) {\n this.$emit('input', val);\n }\n },\n attrs() {\n return {\n allowClear: true,\n showSearch: true,\n ...this.$attrs\n };\n },\n selectChecked: {\n get() {\n return this.childSelectedValue?.length === this.options?.length;\n },\n set(val) {\n this.$emit('input', val);\n }\n }\n },\n mounted() {\n document.addEventListener('click', this.bodyCloseMenus);\n },\n beforeDestroy() {\n document.removeEventListener('click', this.bodyCloseMenus);\n },\n methods: {\n filterOption(input, option) {\n this.isInput && (this.childSelectedValue = input);\n return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0;\n },\n // 点击空白区域\n bodyCloseMenus(e) {\n if (this.$refs.main && !this.$refs.main.contains(e.target)) {\n if (this.selectOpen == true) {\n this.selectOpen = false;\n }\n }\n },\n // 点击全选\n selectAll(val) {\n const options = JSON.parse(JSON.stringify(this.options));\n if (val.target.checked) {\n const childSelectedValue = options?.map(item => {\n return item[this.valueKey];\n });\n setTimeout(() => {\n this.$emit('input', childSelectedValue);\n }, 0);\n } else {\n this.$emit('input', null);\n }\n this.selectOpen = false;\n },\n handleSelect(value, option) {\n if (value) {\n this.selectOpen = false;\n }\n const options = this.options.find(e => e[this.valueKey] == value);\n options[this.valueKey] && this.$emit('select', value, options);\n },\n // 切换分页\n currentChange(val) {\n // console.log('切换分页', val)\n if (!this.mode) {\n this.childSelectedValue = null;\n }\n setTimeout(() => {\n this.selectOpen = true;\n }, 0);\n this.$emit('current-change', val);\n },\n // 自定义label显示\n customLabelHandler(item) {\n // eslint-disable-next-line no-eval\n return eval(this.customLabel);\n }\n }\n});\n\n//# sourceURL=webpack://mui/./plugins/lib/form/components/ASelectCustom.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options");
|
|
8617
8617
|
|
|
8618
8618
|
/***/ }),
|
|
8619
8619
|
|
|
@@ -8646,7 +8646,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var ant_
|
|
|
8646
8646
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
8647
8647
|
|
|
8648
8648
|
"use strict";
|
|
8649
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/icon/index.js\");\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/upload/index.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n model: {\n prop: 'value',\n event: 'handleFileUpload'\n },\n components: {\n Icon: ant_design_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n
|
|
8649
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/icon/index.js\");\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/button/index.js\");\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/upload/index.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n model: {\n prop: 'value',\n event: 'handleFileUpload'\n },\n components: {\n Icon: ant_design_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n Button: ant_design_vue__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n Upload: ant_design_vue__WEBPACK_IMPORTED_MODULE_3__[\"default\"]\n },\n props: {\n value: {\n type: [String, Array],\n default: () => []\n },\n /* 提示文字 */\n tips: String,\n /* 上传文件数量限制 */\n uploadLen: {\n type: Number,\n default: 1\n },\n /* 上传接口 */\n fileUploadUrl: String,\n /* 显示需要pin的接口前缀 */\n filePrefixUrl: String,\n /* 上传文件格式限制 */\n fileAccept: String,\n /* 上传文件携带Headers信息 */\n fileHeaders: Object,\n /* 删除文件函数回调 */\n fileRemoveHandle: Function\n },\n data() {\n return {\n fileList: [],\n modalValue: []\n };\n },\n watch: {\n value() {\n this.setResetFile();\n }\n },\n computed: {\n uploadAttrs() {\n return {\n listType: 'picture-card',\n prefix: this.filePrefixUrl ?? this.$https.FILEURL,\n action: this.fileUploadUrl ?? this.$https.UPLOADURL,\n headers: this.fileHeaders ?? this.$store.getters.fileHeaders,\n ...this.$attrs\n };\n }\n },\n mounted() {\n this.setResetFile();\n },\n methods: {\n setResetFile() {\n let arrayObject;\n try {\n arrayObject = JSON.parse(this.value);\n } catch (e) {\n arrayObject = [].concat(this.value);\n }\n this.modalValue = arrayObject ?? [];\n this.fileList = this.modalValue.map(file => ({\n ...file,\n url: `${this.uploadAttrs.prefix}${file.url}`,\n type: file.contentType,\n status: 'done'\n }));\n },\n handleFilePreview({\n uid,\n contentType,\n url\n }) {\n let suffix = url.substr(url.lastIndexOf('.') + 1);\n const pictureSuffix = ['JPEG', 'JPG', 'GIF', 'PNG', 'TIFF', 'WEBP', 'BMP'];\n if (contentType.includes('image') || pictureSuffix.includes(suffix.toUpperCase())) {\n this.$viewerApi({\n options: {\n url: 'url',\n toolbar: true,\n initialViewIndex: this.fileList.findIndex(file => file.url == url)\n },\n images: this.fileList\n });\n return;\n }\n this.$dialog('Brower', {\n data: url\n }, {\n title: '预览文件',\n width: 1104,\n height: 848,\n centered: true,\n maskClosable: false,\n footer: false,\n bodyStyle: {\n height: 'calc( 100% - 54px )'\n }\n });\n },\n handleFileChange({\n file,\n fileList\n }) {\n file.status == 'uploading' && (this.fileList = fileList);\n switch (file.status) {\n case 'removed':\n const params = {\n id: file.uid\n };\n const requestHandle = this.fileRemoveHandle ? this.fileRemoveHandle(params) : this.$store.dispatch('fileRemoveHandle', params);\n requestHandle.then(Response => {\n const i = this.modalValue.findIndex(e => e.uid == file.uid);\n this.modalValue.splice(i, 1);\n this.$emit('handleFileUpload', JSON.stringify(this.modalValue));\n });\n break;\n case 'done':\n const {\n data\n } = file.response;\n const uploadFileObj = {\n ...data,\n uid: data.id\n };\n delete uploadFileObj.id;\n this.modalValue.push(uploadFileObj);\n this.$emit('handleFileUpload', JSON.stringify(this.modalValue));\n break;\n }\n }\n }\n});\n\n//# sourceURL=webpack://mui/./plugins/lib/form/components/AUpload.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options");
|
|
8650
8650
|
|
|
8651
8651
|
/***/ }),
|
|
8652
8652
|
|
|
@@ -8877,7 +8877,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
8877
8877
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
8878
8878
|
|
|
8879
8879
|
"use strict";
|
|
8880
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ render: function() { return /* binding */ render; },\n/* harmony export */ staticRenderFns: function() { return /* binding */ staticRenderFns; }\n/* harmony export */ });\nvar render = function render() {\n var _vm = this,\n _c = _vm._self._c;\n return _c(\"div\", {\n staticClass: \"TAntdUpload\"\n }, [_c(\"Upload\", _vm._b({\n attrs: {\n name: \"file\",\n \"file-list\": _vm.fileList,\n
|
|
8880
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ render: function() { return /* binding */ render; },\n/* harmony export */ staticRenderFns: function() { return /* binding */ staticRenderFns; }\n/* harmony export */ });\nvar render = function render() {\n var _vm = this,\n _c = _vm._self._c;\n return _c(\"div\", {\n staticClass: \"TAntdUpload\"\n }, [_c(\"Upload\", _vm._b({\n attrs: {\n name: \"file\",\n \"file-list\": _vm.fileList,\n accept: _vm.fileAccept\n },\n on: {\n change: _vm.handleFileChange,\n preview: _vm.handleFilePreview,\n reject: function ($event) {\n return _vm.$message.error(`上传文件类型只能为${_vm.fileAccept}`);\n }\n }\n }, \"Upload\", _vm.uploadAttrs, false), [_vm.uploadAttrs.listType === \"text\" ? _c(\"Button\", {\n attrs: {\n type: \"primary\"\n }\n }, [_c(\"Icon\", {\n attrs: {\n type: \"upload\"\n }\n }), _vm._v(\"上传\\n \")], 1) : [!_vm.fileList || _vm.fileList.length < _vm.uploadLen ? _c(\"Icon\", {\n staticStyle: {\n fontsize: \"36px\"\n },\n attrs: {\n type: \"plus\"\n }\n }) : _vm._e()]], 2), _vm._v(\" \"), _vm.tips ? _c(\"span\", {\n staticClass: \"tips\"\n }, [_vm._v(_vm._s(_vm.tips))]) : _vm._e()], 1);\n};\nvar staticRenderFns = [];\nrender._withStripped = true;\n\n\n//# sourceURL=webpack://mui/./plugins/lib/form/components/AUpload.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet%5B1%5D.rules%5B2%5D!./node_modules/vue-loader/lib/index.js??vue-loader-options");
|
|
8881
8881
|
|
|
8882
8882
|
/***/ }),
|
|
8883
8883
|
|
|
@@ -9108,7 +9108,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var ant_
|
|
|
9108
9108
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
9109
9109
|
|
|
9110
9110
|
"use strict";
|
|
9111
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vue/babel-helper-vue-jsx-merge-props */ \"./node_modules/@vue/babel-helper-vue-jsx-merge-props/dist/helper.js\");\n/* harmony import */ var _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/form-model/index.js\");\n/* harmony import */ var _utils_render__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/render */ \"./plugins/lib/form/utils/render.js\");\n/* harmony import */ var _style_Model_less__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style/Model.less */ \"./plugins/lib/form/style/Model.less\");\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'Model',\n model: {\n prop: 'value',\n event: 'Change:Model'\n },\n data() {\n return {\n formRules: {}\n };\n },\n props: {\n value: {\n type: Object,\n default: () => ({})\n },\n /* Form布局方式 */\n layout: {\n type: String,\n default: 'vertical'\n },\n /* 一行显示几个 PS:最多5个 */\n layoutSize: {\n type: Number,\n default: 4,\n validator: value => {\n return value <= 5;\n }\n },\n /* 表单项配置 */\n formSetting: Array\n },\n computed: {\n form: {\n get() {\n /** 校验单独赋值延迟的字段 */\n for (const k in this.value) {\n Object.hasOwnProperty.call(this.formRules, k) && this.$refs.FormModel?.validateField(k);\n }\n return this.value;\n },\n set(value) {\n this.$emit('Change:Model', value);\n }\n },\n formAttrs() {\n let attr = {\n labelCol: {\n span: 4\n },\n wrapperCol: {\n span: 20\n },\n ...this.$attrs\n };\n this.layout === 'vertical' && (delete attr.labelCol, delete attr.wrapperCol);\n return attr;\n },\n filterSetting() {\n return this.formSetting.filter(settingItem => !settingItem.hidden);\n }\n },\n watch: {\n filterSetting: {\n handler(newVal, oldVal) {\n newVal.forEach(node => this.$set(this.formRules, node.model, _utils_render__WEBPACK_IMPORTED_MODULE_1__.setFormItemRule.call(this, node)));\n },\n immediate: true\n }\n },\n mounted() {\n this.$emit('update:refForm', this.$refs.FormModel);\n },\n methods: {\n /** 包含单表单项,多表单项,动态增减表单项合并处理 */\n setModelRender(props) {\n const h = this.$createElement;\n const dynamicModel = this.form[props.model];\n return (\n /** \r\n * multiple为动态多项\r\n * multipleConfig为配置的动态项数据 */\n h(\"div\", {\n \"class\": props.multiple && ['MultipleForm'],\n \"attrs\": {\n ...{\n style: _utils_render__WEBPACK_IMPORTED_MODULE_1__.getFormWidth.call(this, props, this.layoutSize)\n }\n }\n }, [this.$scopedSlots[`${props.model}Tips`] && this.$scopedSlots[`${props.model}Tips`](props), /** 处理动态增减表单 */\n dynamicModel instanceof Array && props.multiple ? dynamicModel.map((modelItem, index) => props.multipleConfig.map((configItem, key) => {\n /** 为动态项时重新定义绑定key、prop等来进行检验 */\n /** 目前还有一个动态项layoutSize排版问题 */\n const childAttrs = {\n key: index,\n prop: `${props.model}.${index}.${configItem.model}`,\n
|
|
9111
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vue/babel-helper-vue-jsx-merge-props */ \"./node_modules/@vue/babel-helper-vue-jsx-merge-props/dist/helper.js\");\n/* harmony import */ var _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/form-model/index.js\");\n/* harmony import */ var _utils_render__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/render */ \"./plugins/lib/form/utils/render.js\");\n/* harmony import */ var _style_Model_less__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style/Model.less */ \"./plugins/lib/form/style/Model.less\");\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'Model',\n model: {\n prop: 'value',\n event: 'Change:Model'\n },\n data() {\n return {\n formRules: {}\n };\n },\n props: {\n value: {\n type: Object,\n default: () => ({})\n },\n /* Form布局方式 */\n layout: {\n type: String,\n default: 'vertical'\n },\n /* 一行显示几个 PS:最多5个 */\n layoutSize: {\n type: Number,\n default: 4,\n validator: value => {\n return value <= 5;\n }\n },\n /* 表单项配置 */\n formSetting: Array\n },\n computed: {\n form: {\n get() {\n /** 校验单独赋值延迟的字段 */\n for (const k in this.value) {\n Object.hasOwnProperty.call(this.formRules, k) && this.$refs.FormModel?.validateField(k);\n }\n return this.value;\n },\n set(value) {\n this.$emit('Change:Model', value);\n }\n },\n formAttrs() {\n let attr = {\n labelCol: {\n span: 4\n },\n wrapperCol: {\n span: 20\n },\n ...this.$attrs\n };\n this.layout === 'vertical' && (delete attr.labelCol, delete attr.wrapperCol);\n return attr;\n },\n filterSetting() {\n return this.formSetting.filter(settingItem => !settingItem.hidden);\n }\n },\n watch: {\n filterSetting: {\n handler(newVal, oldVal) {\n newVal.forEach(node => this.$set(this.formRules, node.model, _utils_render__WEBPACK_IMPORTED_MODULE_1__.setFormItemRule.call(this, node)));\n },\n immediate: true\n }\n },\n mounted() {\n this.$emit('update:refForm', this.$refs.FormModel);\n },\n methods: {\n /** 包含单表单项,多表单项,动态增减表单项合并处理 */\n setModelRender(props) {\n const h = this.$createElement;\n const dynamicModel = this.form[props.model];\n return (\n /** \r\n * multiple为动态多项\r\n * multipleConfig为配置的动态项数据 */\n h(\"div\", {\n \"class\": props.multiple && ['MultipleForm'],\n \"attrs\": {\n ...{\n style: _utils_render__WEBPACK_IMPORTED_MODULE_1__.getFormWidth.call(this, props, this.layoutSize)\n }\n }\n }, [this.$scopedSlots[`${props.model}Tips`] && this.$scopedSlots[`${props.model}Tips`](props), /** 处理动态增减表单 */\n dynamicModel instanceof Array && props.multiple ? dynamicModel.map((modelItem, index) => props.multipleConfig.map((configItem, key) => {\n /** 为动态项时重新定义绑定key、prop等来进行检验 */\n /** 目前还有一个动态项layoutSize排版问题 */\n const childAttrs = {\n key: index,\n prop: `${props.model}.${index}.${configItem.model}`,\n style: _utils_render__WEBPACK_IMPORTED_MODULE_1__.getFormWidth.call(this, configItem, this.layoutSize ?? props.layoutSize),\n rules: _utils_render__WEBPACK_IMPORTED_MODULE_1__.setFormItemRule.call(this, configItem, props),\n parentModel: props.model\n };\n return _utils_render__WEBPACK_IMPORTED_MODULE_1__.setFormItem.call(this, h, modelItem, configItem, childAttrs);\n })) : _utils_render__WEBPACK_IMPORTED_MODULE_1__.setFormItem.call(this, h, this.form, props), this.$scopedSlots[`${props.model}Operate`] && this.$scopedSlots[`${props.model}Operate`](props)])\n );\n },\n /** 提交测验 */\n formSubmit() {\n return new Promise((resolve, reject) => {\n this.$refs.FormModel.validate().then(resolve).catch(err => this.$nextTick(() => {\n const errorDiv = document.getElementsByClassName('has-error');\n errorDiv[0].scrollIntoView({\n behavior: \"smooth\",\n block: \"center\"\n });\n }));\n });\n }\n },\n render() {\n const h = arguments[0];\n const {\n layout,\n formAttrs,\n setModelRender\n } = this;\n return h(ant_design_vue__WEBPACK_IMPORTED_MODULE_3__[\"default\"], _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0___default()([{\n \"ref\": \"FormModel\",\n \"class\": \"FormModel\"\n }, {\n \"props\": {\n model: this.form,\n rules: this.formRules,\n layout,\n ...formAttrs\n }\n }]), [this.$slots.default ?? this.filterSetting.map(props => setModelRender(props))]);\n }\n});\n\n//# sourceURL=webpack://mui/./plugins/lib/form/Model.js?");
|
|
9112
9112
|
|
|
9113
9113
|
/***/ }),
|
|
9114
9114
|
|
|
@@ -9130,7 +9130,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
9130
9130
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
9131
9131
|
|
|
9132
9132
|
"use strict";
|
|
9133
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getFormWidth: function() { return /* binding */ getFormWidth; },\n/* harmony export */ setFormItem: function() { return /* binding */ setFormItem; },\n/* harmony export */ setFormItemRule: function() { return /* binding */ setFormItemRule; }\n/* harmony export */ });\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/form-model/index.js\");\n/* harmony import */ var _components_RenderComp_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/RenderComp.vue */ \"./plugins/lib/form/components/RenderComp.vue\");\n\n\nconst FormModelItem = ant_design_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"].Item;\n\n/** 根据layoutSize来进行距离及大小切分 */\nfunction getFormWidth(child, layoutSize) {\n if (this.layout === 'vertical') return `flex: 0 1 calc((${100 / layoutSize * (child.size ?? 1)}% - 24px));margin-right:24px;`;\n return `flex: 0 1 ${100 / layoutSize * (child.size ?? 1)}%;`;\n}\n\n/** 动态设置单个表单项规则 (同时解决处理动态增减表单项操作 */\nfunction setFormItemRule(node, nodeParent = {}) {\n const required = node.required ?? nodeParent.required ?? this.formAttrs.required ?? true;\n\n /** node.placeholder与组件内的提示文字位置不对等 */\n const message = node.attrs?.placeholder || (/(select|picker|radio|upload)/.test((node.is ?? 'Input').toLowerCase()) ? '请选择' : '请输入') + (node.label || '');\n const rules = [{\n required,\n message,\n trigger: ['change', 'blur']\n }].concat((node.rules || []).filter(i => {\n i.pattern && (i.pattern = new RegExp(i.pattern));\n return i;\n }));\n return rules;\n}\n\n/** 动态渲染表单项 */\nfunction setFormItem(h, vModel, child, childAttrs) {\n const {\n layout,\n layoutSize,\n $scopedSlots\n } = this;\n let formItemAttrs = childAttrs ?? {\n key: child.model,\n prop: child.model,\n
|
|
9133
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getFormWidth: function() { return /* binding */ getFormWidth; },\n/* harmony export */ setFormItem: function() { return /* binding */ setFormItem; },\n/* harmony export */ setFormItemRule: function() { return /* binding */ setFormItemRule; }\n/* harmony export */ });\n/* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ant-design-vue */ \"./node_modules/ant-design-vue/es/form-model/index.js\");\n/* harmony import */ var _components_RenderComp_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/RenderComp.vue */ \"./plugins/lib/form/components/RenderComp.vue\");\n\n\nconst FormModelItem = ant_design_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"].Item;\n\n/** 根据layoutSize来进行距离及大小切分 */\nfunction getFormWidth(child, layoutSize) {\n if (this.layout === 'vertical') return `flex: 0 1 calc((${100 / layoutSize * (child.size ?? 1)}% - 24px));margin-right:24px;`;\n return `flex: 0 1 ${100 / layoutSize * (child.size ?? 1)}%;`;\n}\n\n/** 动态设置单个表单项规则 (同时解决处理动态增减表单项操作 */\nfunction setFormItemRule(node, nodeParent = {}) {\n const required = node.required ?? nodeParent.required ?? this.formAttrs.required ?? true;\n\n /** node.placeholder与组件内的提示文字位置不对等 */\n const message = node.attrs?.placeholder || (/(select|picker|radio|upload)/.test((node.is ?? 'Input').toLowerCase()) ? '请选择' : '请输入') + (node.label || '');\n const rules = [{\n required,\n message,\n trigger: ['change', 'blur']\n }].concat((node.rules || []).filter(i => {\n i.pattern && (i.pattern = new RegExp(i.pattern));\n return i;\n }));\n return rules;\n}\n\n/** 动态渲染表单项 */\nfunction setFormItem(h, vModel, child, childAttrs) {\n const {\n layout,\n layoutSize,\n $scopedSlots\n } = this;\n let formItemAttrs = childAttrs ?? {\n key: child.model,\n prop: child.model,\n colon: !(layout == 'inline')\n };\n const slotsName = (childAttrs?.parentModel ?? '') + child.model;\n const {\n label,\n customLabel\n } = child;\n return h(FormModelItem, {\n \"class\": [{\n FormLineVertical: child.size === layoutSize && layout === 'vertical'\n }, {\n FormLine: child.size === layoutSize\n }],\n \"attrs\": {\n ...formItemAttrs\n }\n }, [h(\"template\", {\n \"slot\": \"label\"\n }, [customLabel ? customLabel(vModel) : h(\"span\", [label])]), $scopedSlots[child.model] ? $scopedSlots[child.model](child) : h(_components_RenderComp_vue__WEBPACK_IMPORTED_MODULE_0__[\"default\"], {\n \"attrs\": {\n \"component\": child.is,\n ...child.attrs\n },\n \"on\": {\n ...child.event\n },\n \"model\": {\n value: vModel[child.model],\n callback: $$v => {\n this.$set(vModel, child.model, $$v);\n }\n }\n }), $scopedSlots[`${slotsName}Handle`] && $scopedSlots[`${slotsName}Handle`](formItemAttrs)]);\n}\n\n//# sourceURL=webpack://mui/./plugins/lib/form/utils/render.js?");
|
|
9134
9134
|
|
|
9135
9135
|
/***/ }),
|
|
9136
9136
|
|
package/lib/form/Model.js
CHANGED
|
@@ -96,22 +96,21 @@ export default {
|
|
|
96
96
|
/** 为动态项时重新定义绑定key、prop等来进行检验 */
|
|
97
97
|
/** 目前还有一个动态项layoutSize排版问题 */
|
|
98
98
|
const childAttrs = {
|
|
99
|
-
key: index,
|
|
100
|
-
prop: `${props.model}.${index}.${configItem.model}`,
|
|
101
|
-
label: configItem.label,
|
|
99
|
+
key: index,
|
|
100
|
+
prop: `${props.model}.${index}.${configItem.model}`,
|
|
102
101
|
style: getFormWidth.call(this, configItem, this.layoutSize ?? props.layoutSize),
|
|
103
|
-
rules: setFormItemRule.call(this, configItem,
|
|
102
|
+
rules: setFormItemRule.call(this, configItem, props),
|
|
104
103
|
parentModel: props.model
|
|
105
|
-
}
|
|
104
|
+
}
|
|
106
105
|
return setFormItem.call(this, h, modelItem, configItem, childAttrs)
|
|
107
106
|
} )
|
|
108
|
-
) :
|
|
107
|
+
) :
|
|
109
108
|
setFormItem.call(this, h, this.form, props)
|
|
110
109
|
}
|
|
111
110
|
{/* 使用场景:如另起一行添加其他额外信息及操作 */}
|
|
112
111
|
{this.$scopedSlots[`${props.model}Operate`] && this.$scopedSlots[`${props.model}Operate`](props)}
|
|
113
112
|
</div>
|
|
114
|
-
)
|
|
113
|
+
)
|
|
115
114
|
},
|
|
116
115
|
/** 提交测验 */
|
|
117
116
|
formSubmit() {
|
|
@@ -196,7 +196,7 @@ export default {
|
|
|
196
196
|
this.selectOpen = false
|
|
197
197
|
}
|
|
198
198
|
const options = this.options.find(e => e[this.valueKey] == value)
|
|
199
|
-
this.$emit('select', value, options)
|
|
199
|
+
options[this.valueKey] && this.$emit('select', value, options)
|
|
200
200
|
},
|
|
201
201
|
// 切换分页
|
|
202
202
|
currentChange(val) {
|
|
@@ -3,16 +3,24 @@
|
|
|
3
3
|
<Upload
|
|
4
4
|
name="file"
|
|
5
5
|
:file-list="fileList"
|
|
6
|
-
list-type="picture-card"
|
|
7
6
|
:accept="fileAccept"
|
|
8
7
|
v-bind="uploadAttrs"
|
|
9
8
|
@change="handleFileChange"
|
|
10
9
|
@preview="handleFilePreview"
|
|
11
10
|
@reject="$message.error(`上传文件类型只能为${fileAccept}`)"
|
|
12
11
|
>
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
<Button
|
|
13
|
+
type="primary"
|
|
14
|
+
v-if="uploadAttrs.listType === 'text'"
|
|
15
|
+
>
|
|
16
|
+
<Icon type="upload" />上传
|
|
17
|
+
</Button>
|
|
18
|
+
<template v-else>
|
|
19
|
+
<Icon v-if="!fileList || fileList.length < uploadLen"
|
|
20
|
+
type="plus"
|
|
21
|
+
style="fontsize: 36px"
|
|
22
|
+
/>
|
|
23
|
+
</template>
|
|
16
24
|
</Upload>
|
|
17
25
|
|
|
18
26
|
<span class="tips" v-if="tips">{{ tips }}</span>
|
|
@@ -21,14 +29,14 @@
|
|
|
21
29
|
|
|
22
30
|
<script>
|
|
23
31
|
|
|
24
|
-
import { Icon, Upload } from 'ant-design-vue'
|
|
32
|
+
import { Icon, Button, Upload } from 'ant-design-vue'
|
|
25
33
|
|
|
26
34
|
export default {
|
|
27
35
|
model: {
|
|
28
36
|
prop: 'value',
|
|
29
37
|
event: 'handleFileUpload'
|
|
30
38
|
},
|
|
31
|
-
components: { Icon, Upload },
|
|
39
|
+
components: { Icon, Button, Upload },
|
|
32
40
|
props: {
|
|
33
41
|
value: {
|
|
34
42
|
type: [String, Array],
|
|
@@ -66,6 +74,7 @@ export default {
|
|
|
66
74
|
computed: {
|
|
67
75
|
uploadAttrs() {
|
|
68
76
|
return {
|
|
77
|
+
listType: 'picture-card',
|
|
69
78
|
prefix: this.filePrefixUrl ?? this.$https.FILEURL,
|
|
70
79
|
action: this.fileUploadUrl ?? this.$https.UPLOADURL,
|
|
71
80
|
headers: this.fileHeaders ?? this.$store.getters.fileHeaders,
|
package/lib/form/utils/render.js
CHANGED
|
@@ -13,7 +13,7 @@ export function getFormWidth(child, layoutSize) {
|
|
|
13
13
|
/** 动态设置单个表单项规则 (同时解决处理动态增减表单项操作 */
|
|
14
14
|
export function setFormItemRule(node, nodeParent = {}) {
|
|
15
15
|
const required = (node.required ?? nodeParent.required ?? this.formAttrs.required) ?? true
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
/** node.placeholder与组件内的提示文字位置不对等 */
|
|
18
18
|
const message =
|
|
19
19
|
node.attrs?.placeholder ||
|
|
@@ -45,13 +45,14 @@ export function setFormItem(h, vModel, child, childAttrs) {
|
|
|
45
45
|
{
|
|
46
46
|
key: child.model,
|
|
47
47
|
prop: child.model,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
48
|
+
colon: !(layout == 'inline')
|
|
49
|
+
}
|
|
51
50
|
|
|
52
51
|
const slotsName =
|
|
53
52
|
(childAttrs?.parentModel ?? '') + child.model
|
|
54
53
|
|
|
54
|
+
const {label, customLabel} = child
|
|
55
|
+
|
|
55
56
|
return (
|
|
56
57
|
<FormModelItem
|
|
57
58
|
class={[
|
|
@@ -60,6 +61,13 @@ export function setFormItem(h, vModel, child, childAttrs) {
|
|
|
60
61
|
]}
|
|
61
62
|
{...{ attrs: formItemAttrs }}
|
|
62
63
|
>
|
|
64
|
+
<template slot="label">
|
|
65
|
+
{
|
|
66
|
+
customLabel ?
|
|
67
|
+
customLabel(vModel) :
|
|
68
|
+
<span>{label}</span>
|
|
69
|
+
}
|
|
70
|
+
</template>
|
|
63
71
|
{/* 当前表单项可slot进行单独开发配置 (目前仅支持非动态增减情况) */}
|
|
64
72
|
{$scopedSlots[child.model] ? (
|
|
65
73
|
$scopedSlots[child.model](child)
|
package/package.json
CHANGED
|
@@ -96,22 +96,21 @@ export default {
|
|
|
96
96
|
/** 为动态项时重新定义绑定key、prop等来进行检验 */
|
|
97
97
|
/** 目前还有一个动态项layoutSize排版问题 */
|
|
98
98
|
const childAttrs = {
|
|
99
|
-
key: index,
|
|
100
|
-
prop: `${props.model}.${index}.${configItem.model}`,
|
|
101
|
-
label: configItem.label,
|
|
99
|
+
key: index,
|
|
100
|
+
prop: `${props.model}.${index}.${configItem.model}`,
|
|
102
101
|
style: getFormWidth.call(this, configItem, this.layoutSize ?? props.layoutSize),
|
|
103
|
-
rules: setFormItemRule.call(this, configItem,
|
|
102
|
+
rules: setFormItemRule.call(this, configItem, props),
|
|
104
103
|
parentModel: props.model
|
|
105
|
-
}
|
|
104
|
+
}
|
|
106
105
|
return setFormItem.call(this, h, modelItem, configItem, childAttrs)
|
|
107
106
|
} )
|
|
108
|
-
) :
|
|
107
|
+
) :
|
|
109
108
|
setFormItem.call(this, h, this.form, props)
|
|
110
109
|
}
|
|
111
110
|
{/* 使用场景:如另起一行添加其他额外信息及操作 */}
|
|
112
111
|
{this.$scopedSlots[`${props.model}Operate`] && this.$scopedSlots[`${props.model}Operate`](props)}
|
|
113
112
|
</div>
|
|
114
|
-
)
|
|
113
|
+
)
|
|
115
114
|
},
|
|
116
115
|
/** 提交测验 */
|
|
117
116
|
formSubmit() {
|
|
@@ -196,7 +196,7 @@ export default {
|
|
|
196
196
|
this.selectOpen = false
|
|
197
197
|
}
|
|
198
198
|
const options = this.options.find(e => e[this.valueKey] == value)
|
|
199
|
-
this.$emit('select', value, options)
|
|
199
|
+
options[this.valueKey] && this.$emit('select', value, options)
|
|
200
200
|
},
|
|
201
201
|
// 切换分页
|
|
202
202
|
currentChange(val) {
|
|
@@ -3,16 +3,24 @@
|
|
|
3
3
|
<Upload
|
|
4
4
|
name="file"
|
|
5
5
|
:file-list="fileList"
|
|
6
|
-
list-type="picture-card"
|
|
7
6
|
:accept="fileAccept"
|
|
8
7
|
v-bind="uploadAttrs"
|
|
9
8
|
@change="handleFileChange"
|
|
10
9
|
@preview="handleFilePreview"
|
|
11
10
|
@reject="$message.error(`上传文件类型只能为${fileAccept}`)"
|
|
12
11
|
>
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
<Button
|
|
13
|
+
type="primary"
|
|
14
|
+
v-if="uploadAttrs.listType === 'text'"
|
|
15
|
+
>
|
|
16
|
+
<Icon type="upload" />上传
|
|
17
|
+
</Button>
|
|
18
|
+
<template v-else>
|
|
19
|
+
<Icon v-if="!fileList || fileList.length < uploadLen"
|
|
20
|
+
type="plus"
|
|
21
|
+
style="fontsize: 36px"
|
|
22
|
+
/>
|
|
23
|
+
</template>
|
|
16
24
|
</Upload>
|
|
17
25
|
|
|
18
26
|
<span class="tips" v-if="tips">{{ tips }}</span>
|
|
@@ -21,14 +29,14 @@
|
|
|
21
29
|
|
|
22
30
|
<script>
|
|
23
31
|
|
|
24
|
-
import { Icon, Upload } from 'ant-design-vue'
|
|
32
|
+
import { Icon, Button, Upload } from 'ant-design-vue'
|
|
25
33
|
|
|
26
34
|
export default {
|
|
27
35
|
model: {
|
|
28
36
|
prop: 'value',
|
|
29
37
|
event: 'handleFileUpload'
|
|
30
38
|
},
|
|
31
|
-
components: { Icon, Upload },
|
|
39
|
+
components: { Icon, Button, Upload },
|
|
32
40
|
props: {
|
|
33
41
|
value: {
|
|
34
42
|
type: [String, Array],
|
|
@@ -66,6 +74,7 @@ export default {
|
|
|
66
74
|
computed: {
|
|
67
75
|
uploadAttrs() {
|
|
68
76
|
return {
|
|
77
|
+
listType: 'picture-card',
|
|
69
78
|
prefix: this.filePrefixUrl ?? this.$https.FILEURL,
|
|
70
79
|
action: this.fileUploadUrl ?? this.$https.UPLOADURL,
|
|
71
80
|
headers: this.fileHeaders ?? this.$store.getters.fileHeaders,
|
|
@@ -13,7 +13,7 @@ export function getFormWidth(child, layoutSize) {
|
|
|
13
13
|
/** 动态设置单个表单项规则 (同时解决处理动态增减表单项操作 */
|
|
14
14
|
export function setFormItemRule(node, nodeParent = {}) {
|
|
15
15
|
const required = (node.required ?? nodeParent.required ?? this.formAttrs.required) ?? true
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
/** node.placeholder与组件内的提示文字位置不对等 */
|
|
18
18
|
const message =
|
|
19
19
|
node.attrs?.placeholder ||
|
|
@@ -45,13 +45,14 @@ export function setFormItem(h, vModel, child, childAttrs) {
|
|
|
45
45
|
{
|
|
46
46
|
key: child.model,
|
|
47
47
|
prop: child.model,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
48
|
+
colon: !(layout == 'inline')
|
|
49
|
+
}
|
|
51
50
|
|
|
52
51
|
const slotsName =
|
|
53
52
|
(childAttrs?.parentModel ?? '') + child.model
|
|
54
53
|
|
|
54
|
+
const {label, customLabel} = child
|
|
55
|
+
|
|
55
56
|
return (
|
|
56
57
|
<FormModelItem
|
|
57
58
|
class={[
|
|
@@ -60,6 +61,13 @@ export function setFormItem(h, vModel, child, childAttrs) {
|
|
|
60
61
|
]}
|
|
61
62
|
{...{ attrs: formItemAttrs }}
|
|
62
63
|
>
|
|
64
|
+
<template slot="label">
|
|
65
|
+
{
|
|
66
|
+
customLabel ?
|
|
67
|
+
customLabel(vModel) :
|
|
68
|
+
<span>{label}</span>
|
|
69
|
+
}
|
|
70
|
+
</template>
|
|
63
71
|
{/* 当前表单项可slot进行单独开发配置 (目前仅支持非动态增减情况) */}
|
|
64
72
|
{$scopedSlots[child.model] ? (
|
|
65
73
|
$scopedSlots[child.model](child)
|
package/plugins/method/AMap.js
CHANGED
|
@@ -15,9 +15,6 @@ export const setAMapSecurity = ({key, securityJsCode}) => {
|
|
|
15
15
|
// 在 Vue 插件中封装高德地图的初始化和常用方法
|
|
16
16
|
export default {
|
|
17
17
|
install(Vue, options) {
|
|
18
|
-
|
|
19
|
-
/** 地图公共bus来抛出和接收数据 */
|
|
20
|
-
Vue.prototype.$amapBus = new Vue()
|
|
21
18
|
|
|
22
19
|
/** 加载地图sdk */
|
|
23
20
|
AMapLoader.load({
|
|
@@ -77,7 +74,8 @@ export default {
|
|
|
77
74
|
getMapSearch,
|
|
78
75
|
setMapDriving,
|
|
79
76
|
drawMapAnimation,
|
|
80
|
-
parseRouteToPath
|
|
77
|
+
parseRouteToPath,
|
|
78
|
+
getOverlayPos
|
|
81
79
|
}
|
|
82
80
|
|
|
83
81
|
} ).catch( error => { throw new Error('高德地图脚本还未加载,请确保在使用此插件前已经加载高德地图SDK。') } )
|
|
@@ -137,6 +135,13 @@ export default {
|
|
|
137
135
|
|
|
138
136
|
}
|
|
139
137
|
|
|
138
|
+
/** 获取图层信息 */
|
|
139
|
+
function getOverlayPos(overlay) {
|
|
140
|
+
return overlay.type === 'AMap.Marker' ?
|
|
141
|
+
[overlay.getPosition().lng, overlay.getPosition().lat] :
|
|
142
|
+
overlay.getPath().map(l => [l.lng, l.lat])
|
|
143
|
+
}
|
|
144
|
+
|
|
140
145
|
/** 地图设置信息窗体 */
|
|
141
146
|
function setInfoWindow(window, callback) {
|
|
142
147
|
/** 此处的VUE需以可解析template方式引入
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import 'amfe-flexible'
|
|
2
|
-
|
|
3
|
-
export function autoFlexible(designWidth = 1920) {
|
|
4
|
-
|
|
5
|
-
// designWidth 设计稿的宽度基准
|
|
6
|
-
// 动态调整根字体大小的函数
|
|
7
|
-
const updateRootFontSize = () => {
|
|
8
|
-
const baseSize = 14 // 基准字体大小
|
|
9
|
-
const minFontSize = 12 // 最小字体大小
|
|
10
|
-
const maxFontSize = 16 // 最大字体大小
|
|
11
|
-
const clientWidth = document.documentElement.clientWidth // 当前窗口的宽度
|
|
12
|
-
const scale = clientWidth / designWidth // 计算当前窗口宽度与设计稿宽度的比例
|
|
13
|
-
let newSize = baseSize * scale
|
|
14
|
-
|
|
15
|
-
// 限制字体大小在最小和最大范围内
|
|
16
|
-
if (newSize < minFontSize) {
|
|
17
|
-
newSize = minFontSize
|
|
18
|
-
} else if (newSize > maxFontSize) {
|
|
19
|
-
newSize = maxFontSize
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// 判断是否为弹窗,如若弹窗大小不为最大最小值则在基础上添加对应比例差
|
|
23
|
-
const isModal = document.documentURI.includes('?type=modal')
|
|
24
|
-
if (isModal) {
|
|
25
|
-
newSize = newSize + baseSize * (1920 - designWidth) / 1920
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
console.log(newSize, '不同屏幕下字体大小')
|
|
29
|
-
|
|
30
|
-
// 设置根元素的字体大小
|
|
31
|
-
document.documentElement.style.fontSize = `${newSize}px`
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// 监听窗口大小变化,并动态调整字体大小
|
|
35
|
-
window.addEventListener('resize', () => updateRootFontSize(designWidth))
|
|
36
|
-
|
|
37
|
-
// 初始化时立即设置一次字体大小
|
|
38
|
-
updateRootFontSize(designWidth)
|
|
39
|
-
}
|