@smallwei/avue 2.9.6 → 2.9.7
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/avue.js +10 -10
- package/lib/avue.min.js +3 -3
- package/package.json +1 -1
package/lib/avue.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* Avue.js v2.9.
|
2
|
+
* Avue.js v2.9.7
|
3
3
|
* (c) 2017-2022 Smallwei
|
4
4
|
* Released under the MIT License.
|
5
5
|
*
|
@@ -674,7 +674,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core
|
|
674
674
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
675
675
|
|
676
676
|
"use strict";
|
677
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_detail__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/detail */ \"./src/core/detail.js\");\n/* harmony import */ var core_create__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/create */ \"./src/core/create.js\");\n/* harmony import */ var common_common_init__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! common/common/init */ \"./packages/core/common/init.js\");\n/* harmony import */ var common_components_form_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! common/components/form/index */ \"./packages/core/components/form/index.vue\");\n/* harmony import */ var global_variable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! global/variable */ \"./src/global/variable.js\");\n/* harmony import */ var core_dataformat__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core/dataformat */ \"./src/core/dataformat.js\");\n/* harmony import */ var core_dic__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core/dic */ \"./src/core/dic.js\");\n/* harmony import */ var utils_util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! utils/util */ \"./src/utils/util.js\");\n/* harmony import */ var utils_mock__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! utils/mock */ \"./src/utils/mock.js\");\n/* harmony import */ var _menu__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./menu */ \"./packages/element-ui/form/menu.vue\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(core_create__WEBPACK_IMPORTED_MODULE_1__[\"default\"])({\n name: \"form\",\n mixins: [Object(common_common_init__WEBPACK_IMPORTED_MODULE_2__[\"default\"])()],\n components: {\n formTemp: common_components_form_index__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n formMenu: _menu__WEBPACK_IMPORTED_MODULE_9__[\"default\"]\n },\n data: function data() {\n return {\n activeName: '',\n labelWidth: 90,\n allDisabled: false,\n optionIndex: [],\n optionBox: false,\n tableOption: {},\n itemSpanDefault: 12,\n form: {},\n formList: [],\n formBind: {},\n formCreate: false,\n formDefault: {},\n formVal: {}\n };\n },\n provide: function provide() {\n return {\n formSafe: this\n };\n },\n watch: {\n tabsActive: {\n handler: function handler(val) {\n this.activeName = this.tabsActive;\n },\n immediate: true\n },\n form: {\n handler: function handler(val) {\n if (this.formCreate) this.setVal();\n },\n deep: true\n },\n DIC: {\n handler: function handler() {\n this.forEachLabel();\n },\n deep: true,\n immediate: true\n },\n allDisabled: {\n handler: function handler(val) {\n this.$emit('update:status', val);\n },\n deep: true,\n immediate: true\n },\n value: {\n handler: function handler(val) {\n if (this.formCreate) {\n this.setForm(val);\n } else {\n this.formVal = Object.assign(this.formVal, val || {});\n }\n },\n deep: true,\n immediate: true\n }\n },\n computed: {\n columnSlot: function columnSlot() {\n var _this = this;\n\n return Object.keys(this.$scopedSlots).filter(function (item) {\n return !_this.propOption.map(function (ele) {\n return ele.prop;\n }).includes(item);\n });\n },\n labelSuffix: function labelSuffix() {\n return this.parentOption.labelSuffix || ':';\n },\n isMenu: function isMenu() {\n return this.columnOption.length != 1;\n },\n isDetail: function isDetail() {\n return this.detail === true;\n },\n isTabs: function isTabs() {\n return this.parentOption.tabs === true;\n },\n isAdd: function isAdd() {\n return this.boxType === \"add\";\n },\n isEdit: function isEdit() {\n return this.boxType === \"edit\";\n },\n isView: function isView() {\n return this.boxType === \"view\";\n },\n gutter: function gutter() {\n return this.setPx((this.parentOption.gutter || 10) / 2);\n },\n detail: function detail() {\n return this.parentOption.detail;\n },\n disabled: function disabled() {\n return this.parentOption.disabled;\n },\n readonly: function readonly() {\n return this.parentOption.readonly;\n },\n tabsType: function tabsType() {\n return this.parentOption.tabsType;\n },\n columnLen: function columnLen() {\n return this.columnOption.length;\n },\n dynamicOption: function dynamicOption() {\n var _this2 = this;\n\n var list = [];\n this.propOption.forEach(function (ele) {\n if (ele.type == 'dynamic' && _this2.vaildDisplay(ele)) {\n list.push(ele);\n }\n });\n return list;\n },\n controlOption: function controlOption() {\n var list = [];\n this.propOption.forEach(function (ele) {\n if (ele.control) list.push(ele);\n });\n return list;\n },\n propOption: function propOption() {\n var list = [];\n this.columnOption.forEach(function (option) {\n if (option.display !== false) {\n option.column.forEach(function (column) {\n list.push(column);\n });\n }\n });\n return list;\n },\n parentOption: function parentOption() {\n var option = this.deepClone(this.tableOption);\n var group = option.group;\n\n if (!group) {\n option = Object.assign(option, {\n group: [this.deepClone(option)]\n });\n }\n\n if (group) {\n //处理分组以外的部分\n group.unshift({\n arrow: false,\n column: option.column\n });\n }\n\n return option;\n },\n columnOption: function columnOption() {\n var _this3 = this;\n\n var list = _toConsumableArray(this.parentOption.group) || [];\n list.forEach(function (ele, index) {\n ele.column = ele.column || []; // 循环列的全部属性\n\n ele.column.forEach(function (column, cindex) {\n //动态计算列的位置,如果为隐藏状态则或则手机状态不计算\n if (column.display !== false && !_this3.isMobile) {\n column = Object(core_dataformat__WEBPACK_IMPORTED_MODULE_5__[\"calcCount\"])(column, _this3.itemSpanDefault, cindex === 0);\n }\n }); //处理级联属性\n\n ele.column = Object(core_dataformat__WEBPACK_IMPORTED_MODULE_5__[\"calcCascader\"])(ele.column); //根据order排序\n\n ele.column = ele.column.sort(function (a, b) {\n return (b.order || 0) - (a.order || 0);\n });\n });\n return list;\n },\n menuPosition: function menuPosition() {\n if (this.parentOption.menuPosition) {\n return this.parentOption.menuPosition;\n } else {\n return \"center\";\n }\n },\n boxType: function boxType() {\n return this.parentOption.boxType;\n },\n isPrint: function isPrint() {\n return this.vaildData(this.parentOption.printBtn, false);\n },\n tabsActive: function tabsActive() {\n return this.vaildData(this.tableOption.tabsActive + '', '1');\n },\n isMock: function isMock() {\n return this.vaildData(this.parentOption.mockBtn, false);\n }\n },\n props: {\n uploadBefore: Function,\n uploadAfter: Function,\n uploadDelete: Function,\n uploadPreview: Function,\n uploadError: Function,\n uploadExceed: Function,\n status: {\n type: Boolean,\n \"default\": false\n },\n isCrud: {\n type: Boolean,\n \"default\": false\n },\n value: {\n type: Object,\n required: true,\n \"default\": function _default() {\n return {};\n }\n }\n },\n created: function created() {\n var _this4 = this;\n\n this.$nextTick(function () {\n _this4.dataFormat();\n\n _this4.setVal();\n\n _this4.$nextTick(function () {\n return _this4.clearValidate();\n });\n\n _this4.formCreate = true;\n });\n },\n methods: {\n getComponent: core_dataformat__WEBPACK_IMPORTED_MODULE_5__[\"getComponent\"],\n getPlaceholder: core_dataformat__WEBPACK_IMPORTED_MODULE_5__[\"getPlaceholder\"],\n getDisabled: function getDisabled(column) {\n return this.vaildDetail(column) || this.isDetail || this.vaildDisabled(column) || this.allDisabled;\n },\n getSpan: function getSpan(column) {\n return column.span || this.parentOption.span || this.itemSpanDefault;\n },\n isGroupShow: function isGroupShow(item, index) {\n if (this.isTabs) {\n return index == this.activeName || index == 0;\n } else {\n return true;\n }\n },\n forEachLabel: function forEachLabel() {\n var _this5 = this;\n\n if (this.tableOption.filterDic == true) {\n this.form = Object(utils_util__WEBPACK_IMPORTED_MODULE_7__[\"filterParams\"])(this.form, ['$']);\n return;\n }\n\n this.propOption.forEach(function (column) {\n var result;\n var DIC = _this5.DIC[column.prop];\n\n if (!_this5.validatenull(DIC)) {\n result = Object(core_detail__WEBPACK_IMPORTED_MODULE_0__[\"detail\"])(_this5.form, column, _this5.tableOption, DIC);\n\n _this5.$set(_this5.form, [\"$\" + column.prop], result);\n }\n });\n },\n handleGroupClick: function handleGroupClick(activeNames) {\n this.$emit('tab-click', activeNames);\n },\n handleTabClick: function handleTabClick(tab, event) {\n this.$emit('tab-click', tab, event);\n },\n getLabelWidth: function getLabelWidth(column, item) {\n var result;\n\n if (!this.validatenull(column.labelWidth)) {\n result = column.labelWidth;\n } else if (!this.validatenull(item.labelWidth)) {\n result = item.labelWidth;\n } else {\n result = this.parentOption.labelWidth;\n }\n\n return this.setPx(result, this.labelWidth);\n },\n //对部分表单字段进行校验的方法\n validateField: function validateField(val) {\n return this.$refs.form.validateField(val);\n },\n validTip: function validTip(column) {\n return !column.tip || column.type === 'upload';\n },\n getPropRef: function getPropRef(prop) {\n return this.$refs[prop][0];\n },\n //初始化表单\n dataFormat: function dataFormat() {\n this.formDefault = Object(core_dataformat__WEBPACK_IMPORTED_MODULE_5__[\"formInitVal\"])(this.propOption);\n var value = this.deepClone(this.formDefault.tableForm);\n this.setForm(this.deepClone(Object.assign(value, this.formVal)));\n },\n setVal: function setVal() {\n this.setControl();\n this.$emit(\"input\", this.form);\n this.$emit(\"change\", this.form);\n },\n setControl: function setControl() {\n var _this6 = this;\n\n this.controlOption.forEach(function (ele) {\n var control = ele.control(_this6.form[ele.prop], _this6.form) || {};\n Object.keys(control).forEach(function (item) {\n _this6.objectOption[item] = Object.assign(_this6.objectOption[item], control[item]);\n\n if (control[item].dicData) {\n _this6.DIC[item] = control[item].dicData;\n }\n });\n });\n },\n //表单赋值\n setForm: function setForm(value) {\n var _this7 = this;\n\n Object.keys(value).forEach(function (ele) {\n _this7.$set(_this7.form, ele, value[ele]);\n\n var column = _this7.propOption.find(function (column) {\n return column.prop == ele;\n }) || {};\n var prop = column.prop;\n var bind = column.bind;\n\n if (bind && !_this7.formBind[prop]) {\n _this7.$watch('form.' + prop, function (n, o) {\n if (n != o) Object(utils_util__WEBPACK_IMPORTED_MODULE_7__[\"setAsVal\"])(_this7.form, bind, n);\n });\n\n _this7.$watch('form.' + bind, function (n, o) {\n if (n != o) _this7.$set(_this7.form, prop, n);\n });\n\n _this7.$set(_this7.form, prop, eval('value.' + bind));\n\n _this7.formBind[prop] = true;\n }\n });\n this.forEachLabel();\n\n if (this.tableOption.filterNull === true) {\n this.form = Object(utils_util__WEBPACK_IMPORTED_MODULE_7__[\"filterParams\"])(this.form, ['']);\n }\n },\n handleChange: function handleChange(list, column) {\n var _this8 = this;\n\n this.$nextTick(function () {\n var cascader = column.cascader;\n var str = cascader.join(\",\");\n cascader.forEach(function (item) {\n var columnNextProp = item;\n var value = _this8.form[column.prop]; // 下一个节点\n\n var columnNext = _this8.findObject(list, columnNextProp);\n\n if (_this8.validatenull(columnNext)) return; // 如果不是首次加载则清空全部关联节点的属性值和字典值\n\n if (_this8.formList.includes(str)) {\n //清空子类字典列表和值\n cascader.forEach(function (ele) {\n _this8.form[ele] = \"\";\n\n _this8.$set(_this8.DIC, ele, []);\n });\n }\n /**\n * 1.判断当前节点是否有下级节点\n * 2.判断当前节点是否有值\n */\n\n\n if (_this8.validatenull(cascader) || _this8.validatenull(value) || _this8.validatenull(columnNext)) {\n return;\n } // 根据当前节点值获取下一个节点的字典\n\n\n Object(core_dic__WEBPACK_IMPORTED_MODULE_6__[\"sendDic\"])({\n column: columnNext,\n value: value,\n form: _this8.form\n }).then(function (res) {\n //首次加载的放入队列记录\n if (!_this8.formList.includes(str)) _this8.formList.push(str); // 修改字典\n\n var dic = res || [];\n\n _this8.$set(_this8.DIC, columnNextProp, dic);\n\n if (!_this8.validatenull(dic) && !_this8.validatenull(dic) && !_this8.validatenull(columnNext.cascaderIndex) && _this8.validatenull(_this8.form[columnNextProp])) {\n _this8.form[columnNextProp] = dic[columnNext.cascaderIndex][(columnNext.props || {}).value || global_variable__WEBPACK_IMPORTED_MODULE_4__[\"DIC_PROPS\"].value];\n }\n });\n });\n });\n },\n handlePrint: function handlePrint() {\n this.$Print(this.$el);\n },\n propChange: function propChange(option, column) {\n if (column.cascader) this.handleChange(option, column);\n },\n handleMock: function handleMock() {\n var _this9 = this;\n\n if (!this.isMock) return;\n this.columnOption.forEach(function (column) {\n var form = Object(utils_mock__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(column.column, _this9.DIC, _this9.form, _this9.isMock);\n\n if (!_this9.validatenull(form)) {\n Object.keys(form).forEach(function (ele) {\n _this9.form[ele] = form[ele];\n });\n }\n });\n this.$nextTick(function () {\n _this9.clearValidate();\n\n _this9.$emit('mock-change', _this9.form);\n });\n },\n vaildDetail: function vaildDetail(column) {\n var key;\n if (this.detail) return false;\n\n if (!this.validatenull(column.detail)) {\n key = 'detail';\n } else if (this.isAdd) {\n key = 'addDetail';\n } else if (this.isEdit) {\n key = 'editDetail';\n } else if (this.isView) {\n return false;\n }\n\n if (key) return this.vaildData(column[key], false);\n return false;\n },\n // 验证表单是否禁止\n vaildDisabled: function vaildDisabled(column) {\n var key;\n if (this.disabled) return true;\n\n if (!this.validatenull(column.disabled)) {\n key = 'disabled';\n } else if (this.isAdd) {\n key = 'addDisabled';\n } else if (this.isEdit) {\n key = 'editDisabled';\n } else if (this.isView) {\n return true;\n }\n\n if (key) return this.vaildData(column[key], false);\n return false;\n },\n // 验证表单是否显隐\n vaildDisplay: function vaildDisplay(column) {\n var key;\n\n if (!this.validatenull(column.display)) {\n key = 'display';\n } else if (this.isAdd) {\n key = 'addDisplay';\n } else if (this.isEdit) {\n key = 'editDisplay';\n } else if (this.isView) {\n key = 'viewDisplay';\n }\n\n if (key) return this.vaildData(column[key], true);\n return true;\n },\n clearValidate: function clearValidate(list) {\n this.$refs.form.clearValidate(list);\n },\n validateCellForm: function validateCellForm() {\n var _this10 = this;\n\n return new Promise(function (resolve) {\n _this10.$refs.form.validate(function (valid, msg) {\n resolve(msg);\n });\n });\n },\n validate: function validate(callback) {\n var _this11 = this;\n\n this.$refs.form.validate(function (valid, msg) {\n var dynamicList = [];\n var dynamicName = [];\n var dynamicError = {};\n\n _this11.dynamicOption.forEach(function (ele) {\n var isForm = ele.children.type === 'form';\n dynamicName.push(ele.prop);\n\n if (isForm) {\n if (!_this11.validatenull(_this11.$refs[ele.prop][0].$refs.temp.$refs.main)) {\n _this11.$refs[ele.prop][0].$refs.temp.$refs.main.forEach(function (ele) {\n dynamicList.push(ele.validateCellForm());\n });\n }\n } else {\n dynamicList.push(_this11.$refs[ele.prop][0].$refs.temp.$refs.main.validateCellForm());\n }\n });\n\n Promise.all(dynamicList).then(function (res) {\n var count = 0;\n res.forEach(function (error, index) {\n if (!_this11.validatenull(error)) {\n dynamicError[dynamicName[index]] = error;\n }\n });\n var result = Object.assign(dynamicError, msg);\n\n if (_this11.validatenull(result)) {\n _this11.show();\n\n callback(true, _this11.hide);\n } else {\n callback(false, _this11.hide, result);\n }\n });\n });\n },\n resetForm: function resetForm() {\n var _this12 = this;\n\n this.form = Object(utils_util__WEBPACK_IMPORTED_MODULE_7__[\"clearVal\"])(this.form, (this.tableOption.filterParams || []).concat([this.rowKey]));\n this.$nextTick(function () {\n _this12.clearValidate();\n\n _this12.$emit(\"reset-change\");\n });\n },\n resetFields: function resetFields() {\n this.$refs.form.resetFields();\n },\n show: function show() {\n this.allDisabled = true;\n },\n hide: function hide() {\n this.allDisabled = false;\n },\n submit: function submit() {\n var _this13 = this;\n\n this.validate(function (valid, msg) {\n if (valid) {\n _this13.$emit(\"submit\", Object(utils_util__WEBPACK_IMPORTED_MODULE_7__[\"filterParams\"])(_this13.form), _this13.hide);\n } else {\n _this13.$emit(\"error\", msg);\n }\n });\n }\n }\n}));\n\n//# sourceURL=webpack://AVUE/./packages/element-ui/form/index.vue?./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options");
|
677
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_detail__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/detail */ \"./src/core/detail.js\");\n/* harmony import */ var core_create__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/create */ \"./src/core/create.js\");\n/* harmony import */ var common_common_init__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! common/common/init */ \"./packages/core/common/init.js\");\n/* harmony import */ var common_components_form_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! common/components/form/index */ \"./packages/core/components/form/index.vue\");\n/* harmony import */ var global_variable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! global/variable */ \"./src/global/variable.js\");\n/* harmony import */ var core_dataformat__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core/dataformat */ \"./src/core/dataformat.js\");\n/* harmony import */ var core_dic__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core/dic */ \"./src/core/dic.js\");\n/* harmony import */ var utils_util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! utils/util */ \"./src/utils/util.js\");\n/* harmony import */ var utils_mock__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! utils/mock */ \"./src/utils/mock.js\");\n/* harmony import */ var _menu__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./menu */ \"./packages/element-ui/form/menu.vue\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(core_create__WEBPACK_IMPORTED_MODULE_1__[\"default\"])({\n name: \"form\",\n mixins: [Object(common_common_init__WEBPACK_IMPORTED_MODULE_2__[\"default\"])()],\n components: {\n formTemp: common_components_form_index__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n formMenu: _menu__WEBPACK_IMPORTED_MODULE_9__[\"default\"]\n },\n data: function data() {\n return {\n activeName: '',\n labelWidth: 90,\n allDisabled: false,\n optionIndex: [],\n optionBox: false,\n tableOption: {},\n itemSpanDefault: 12,\n form: {},\n formList: [],\n formBind: {},\n formCreate: false,\n formDefault: {},\n formVal: {}\n };\n },\n provide: function provide() {\n return {\n formSafe: this\n };\n },\n watch: {\n tabsActive: {\n handler: function handler(val) {\n this.activeName = this.tabsActive;\n },\n immediate: true\n },\n form: {\n handler: function handler(val) {\n if (this.formCreate) this.setVal();\n },\n deep: true\n },\n DIC: {\n handler: function handler() {\n this.forEachLabel();\n },\n deep: true,\n immediate: true\n },\n allDisabled: {\n handler: function handler(val) {\n this.$emit('update:status', val);\n },\n deep: true,\n immediate: true\n },\n value: {\n handler: function handler(val) {\n if (this.formCreate) {\n this.setForm(val);\n } else {\n this.formVal = Object.assign(this.formVal, val || {});\n }\n },\n deep: true,\n immediate: true\n }\n },\n computed: {\n columnSlot: function columnSlot() {\n var _this = this;\n\n return Object.keys(this.$scopedSlots).filter(function (item) {\n return !_this.propOption.map(function (ele) {\n return ele.prop;\n }).includes(item);\n });\n },\n labelSuffix: function labelSuffix() {\n return this.parentOption.labelSuffix || ':';\n },\n isMenu: function isMenu() {\n return this.columnOption.length != 1;\n },\n isDetail: function isDetail() {\n return this.detail === true;\n },\n isTabs: function isTabs() {\n return this.parentOption.tabs === true;\n },\n isAdd: function isAdd() {\n return this.boxType === \"add\";\n },\n isEdit: function isEdit() {\n return this.boxType === \"edit\";\n },\n isView: function isView() {\n return this.boxType === \"view\";\n },\n gutter: function gutter() {\n return this.setPx((this.parentOption.gutter || 10) / 2);\n },\n detail: function detail() {\n return this.parentOption.detail;\n },\n disabled: function disabled() {\n return this.parentOption.disabled;\n },\n readonly: function readonly() {\n return this.parentOption.readonly;\n },\n tabsType: function tabsType() {\n return this.parentOption.tabsType;\n },\n columnLen: function columnLen() {\n return this.columnOption.length;\n },\n dynamicOption: function dynamicOption() {\n var _this2 = this;\n\n var list = [];\n this.propOption.forEach(function (ele) {\n if (ele.type == 'dynamic' && _this2.vaildDisplay(ele)) {\n list.push(ele);\n }\n });\n return list;\n },\n controlOption: function controlOption() {\n var list = [];\n this.propOption.forEach(function (ele) {\n if (ele.control) list.push(ele);\n });\n return list;\n },\n propOption: function propOption() {\n var list = [];\n this.columnOption.forEach(function (option) {\n if (option.display !== false) {\n option.column.forEach(function (column) {\n list.push(column);\n });\n }\n });\n return list;\n },\n parentOption: function parentOption() {\n var option = this.deepClone(this.tableOption);\n var group = option.group;\n\n if (!group) {\n option = Object.assign(option, {\n group: [this.deepClone(option)]\n });\n }\n\n if (group) {\n //处理分组以外的部分\n group.unshift({\n arrow: false,\n column: option.column\n });\n }\n\n return option;\n },\n columnOption: function columnOption() {\n var _this3 = this;\n\n var list = _toConsumableArray(this.parentOption.group) || [];\n list.forEach(function (ele, index) {\n ele.column = ele.column || []; // 循环列的全部属性\n\n ele.column.forEach(function (column, cindex) {\n //动态计算列的位置,如果为隐藏状态则或则手机状态不计算\n if (column.display !== false && !_this3.isMobile) {\n column = Object(core_dataformat__WEBPACK_IMPORTED_MODULE_5__[\"calcCount\"])(column, _this3.itemSpanDefault, cindex === 0);\n }\n }); //处理级联属性\n\n ele.column = Object(core_dataformat__WEBPACK_IMPORTED_MODULE_5__[\"calcCascader\"])(ele.column); //根据order排序\n\n ele.column = ele.column.sort(function (a, b) {\n return (b.order || 0) - (a.order || 0);\n });\n });\n return list;\n },\n menuPosition: function menuPosition() {\n if (this.parentOption.menuPosition) {\n return this.parentOption.menuPosition;\n } else {\n return \"center\";\n }\n },\n boxType: function boxType() {\n return this.parentOption.boxType;\n },\n isPrint: function isPrint() {\n return this.vaildData(this.parentOption.printBtn, false);\n },\n tabsActive: function tabsActive() {\n return this.vaildData(this.tableOption.tabsActive + '', '1');\n },\n isMock: function isMock() {\n return this.vaildData(this.parentOption.mockBtn, false);\n }\n },\n props: {\n uploadBefore: Function,\n uploadAfter: Function,\n uploadDelete: Function,\n uploadPreview: Function,\n uploadError: Function,\n uploadExceed: Function,\n status: {\n type: Boolean,\n \"default\": false\n },\n isCrud: {\n type: Boolean,\n \"default\": false\n },\n value: {\n type: Object,\n required: true,\n \"default\": function _default() {\n return {};\n }\n }\n },\n created: function created() {\n var _this4 = this;\n\n this.$nextTick(function () {\n _this4.dataFormat();\n\n _this4.setVal();\n\n _this4.$nextTick(function () {\n return _this4.clearValidate();\n });\n\n _this4.formCreate = true;\n });\n },\n methods: {\n getComponent: core_dataformat__WEBPACK_IMPORTED_MODULE_5__[\"getComponent\"],\n getPlaceholder: core_dataformat__WEBPACK_IMPORTED_MODULE_5__[\"getPlaceholder\"],\n getDisabled: function getDisabled(column) {\n return this.vaildDetail(column) || this.isDetail || this.vaildDisabled(column) || this.allDisabled;\n },\n getSpan: function getSpan(column) {\n return column.span || this.parentOption.span || this.itemSpanDefault;\n },\n isGroupShow: function isGroupShow(item, index) {\n if (this.isTabs) {\n return index == this.activeName || index == 0;\n } else {\n return true;\n }\n },\n forEachLabel: function forEachLabel() {\n var _this5 = this;\n\n if (this.tableOption.filterDic == true) {\n this.form = Object(utils_util__WEBPACK_IMPORTED_MODULE_7__[\"filterParams\"])(this.form, ['$'], false);\n return;\n }\n\n this.propOption.forEach(function (column) {\n var result;\n var DIC = _this5.DIC[column.prop];\n\n if (!_this5.validatenull(DIC)) {\n result = Object(core_detail__WEBPACK_IMPORTED_MODULE_0__[\"detail\"])(_this5.form, column, _this5.tableOption, DIC);\n\n _this5.$set(_this5.form, [\"$\" + column.prop], result);\n }\n });\n },\n handleGroupClick: function handleGroupClick(activeNames) {\n this.$emit('tab-click', activeNames);\n },\n handleTabClick: function handleTabClick(tab, event) {\n this.$emit('tab-click', tab, event);\n },\n getLabelWidth: function getLabelWidth(column, item) {\n var result;\n\n if (!this.validatenull(column.labelWidth)) {\n result = column.labelWidth;\n } else if (!this.validatenull(item.labelWidth)) {\n result = item.labelWidth;\n } else {\n result = this.parentOption.labelWidth;\n }\n\n return this.setPx(result, this.labelWidth);\n },\n //对部分表单字段进行校验的方法\n validateField: function validateField(val) {\n return this.$refs.form.validateField(val);\n },\n validTip: function validTip(column) {\n return !column.tip || column.type === 'upload';\n },\n getPropRef: function getPropRef(prop) {\n return this.$refs[prop][0];\n },\n //初始化表单\n dataFormat: function dataFormat() {\n this.formDefault = Object(core_dataformat__WEBPACK_IMPORTED_MODULE_5__[\"formInitVal\"])(this.propOption);\n var value = this.deepClone(this.formDefault.tableForm);\n this.setForm(this.deepClone(Object.assign(value, this.formVal)));\n },\n setVal: function setVal() {\n this.setControl();\n this.$emit(\"input\", this.form);\n this.$emit(\"change\", this.form);\n },\n setControl: function setControl() {\n var _this6 = this;\n\n this.controlOption.forEach(function (ele) {\n var control = ele.control(_this6.form[ele.prop], _this6.form) || {};\n Object.keys(control).forEach(function (item) {\n _this6.objectOption[item] = Object.assign(_this6.objectOption[item], control[item]);\n\n if (control[item].dicData) {\n _this6.DIC[item] = control[item].dicData;\n }\n });\n });\n },\n //表单赋值\n setForm: function setForm(value) {\n var _this7 = this;\n\n Object.keys(value).forEach(function (ele) {\n _this7.$set(_this7.form, ele, value[ele]);\n\n var column = _this7.propOption.find(function (column) {\n return column.prop == ele;\n }) || {};\n var prop = column.prop;\n var bind = column.bind;\n\n if (bind && !_this7.formBind[prop]) {\n _this7.$watch('form.' + prop, function (n, o) {\n if (n != o) Object(utils_util__WEBPACK_IMPORTED_MODULE_7__[\"setAsVal\"])(_this7.form, bind, n);\n });\n\n _this7.$watch('form.' + bind, function (n, o) {\n if (n != o) _this7.$set(_this7.form, prop, n);\n });\n\n _this7.$set(_this7.form, prop, eval('value.' + bind));\n\n _this7.formBind[prop] = true;\n }\n });\n this.forEachLabel();\n\n if (this.tableOption.filterNull === true) {\n this.form = Object(utils_util__WEBPACK_IMPORTED_MODULE_7__[\"filterParams\"])(this.form, [''], false);\n }\n },\n handleChange: function handleChange(list, column) {\n var _this8 = this;\n\n this.$nextTick(function () {\n var cascader = column.cascader;\n var str = cascader.join(\",\");\n cascader.forEach(function (item) {\n var columnNextProp = item;\n var value = _this8.form[column.prop]; // 下一个节点\n\n var columnNext = _this8.findObject(list, columnNextProp);\n\n if (_this8.validatenull(columnNext)) return; // 如果不是首次加载则清空全部关联节点的属性值和字典值\n\n if (_this8.formList.includes(str)) {\n //清空子类字典列表和值\n cascader.forEach(function (ele) {\n _this8.form[ele] = \"\";\n\n _this8.$set(_this8.DIC, ele, []);\n });\n }\n /**\n * 1.判断当前节点是否有下级节点\n * 2.判断当前节点是否有值\n */\n\n\n if (_this8.validatenull(cascader) || _this8.validatenull(value) || _this8.validatenull(columnNext)) {\n return;\n } // 根据当前节点值获取下一个节点的字典\n\n\n Object(core_dic__WEBPACK_IMPORTED_MODULE_6__[\"sendDic\"])({\n column: columnNext,\n value: value,\n form: _this8.form\n }).then(function (res) {\n //首次加载的放入队列记录\n if (!_this8.formList.includes(str)) _this8.formList.push(str); // 修改字典\n\n var dic = res || [];\n\n _this8.$set(_this8.DIC, columnNextProp, dic);\n\n if (!_this8.validatenull(dic) && !_this8.validatenull(dic) && !_this8.validatenull(columnNext.cascaderIndex) && _this8.validatenull(_this8.form[columnNextProp])) {\n _this8.form[columnNextProp] = dic[columnNext.cascaderIndex][(columnNext.props || {}).value || global_variable__WEBPACK_IMPORTED_MODULE_4__[\"DIC_PROPS\"].value];\n }\n });\n });\n });\n },\n handlePrint: function handlePrint() {\n this.$Print(this.$el);\n },\n propChange: function propChange(option, column) {\n if (column.cascader) this.handleChange(option, column);\n },\n handleMock: function handleMock() {\n var _this9 = this;\n\n if (!this.isMock) return;\n this.columnOption.forEach(function (column) {\n var form = Object(utils_mock__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(column.column, _this9.DIC, _this9.form, _this9.isMock);\n\n if (!_this9.validatenull(form)) {\n Object.keys(form).forEach(function (ele) {\n _this9.form[ele] = form[ele];\n });\n }\n });\n this.$nextTick(function () {\n _this9.clearValidate();\n\n _this9.$emit('mock-change', _this9.form);\n });\n },\n vaildDetail: function vaildDetail(column) {\n var key;\n if (this.detail) return false;\n\n if (!this.validatenull(column.detail)) {\n key = 'detail';\n } else if (this.isAdd) {\n key = 'addDetail';\n } else if (this.isEdit) {\n key = 'editDetail';\n } else if (this.isView) {\n return false;\n }\n\n if (key) return this.vaildData(column[key], false);\n return false;\n },\n // 验证表单是否禁止\n vaildDisabled: function vaildDisabled(column) {\n var key;\n if (this.disabled) return true;\n\n if (!this.validatenull(column.disabled)) {\n key = 'disabled';\n } else if (this.isAdd) {\n key = 'addDisabled';\n } else if (this.isEdit) {\n key = 'editDisabled';\n } else if (this.isView) {\n return true;\n }\n\n if (key) return this.vaildData(column[key], false);\n return false;\n },\n // 验证表单是否显隐\n vaildDisplay: function vaildDisplay(column) {\n var key;\n\n if (!this.validatenull(column.display)) {\n key = 'display';\n } else if (this.isAdd) {\n key = 'addDisplay';\n } else if (this.isEdit) {\n key = 'editDisplay';\n } else if (this.isView) {\n key = 'viewDisplay';\n }\n\n if (key) return this.vaildData(column[key], true);\n return true;\n },\n clearValidate: function clearValidate(list) {\n this.$refs.form.clearValidate(list);\n },\n validateCellForm: function validateCellForm() {\n var _this10 = this;\n\n return new Promise(function (resolve) {\n _this10.$refs.form.validate(function (valid, msg) {\n resolve(msg);\n });\n });\n },\n validate: function validate(callback) {\n var _this11 = this;\n\n this.$refs.form.validate(function (valid, msg) {\n var dynamicList = [];\n var dynamicName = [];\n var dynamicError = {};\n\n _this11.dynamicOption.forEach(function (ele) {\n var isForm = ele.children.type === 'form';\n dynamicName.push(ele.prop);\n\n if (isForm) {\n if (!_this11.validatenull(_this11.$refs[ele.prop][0].$refs.temp.$refs.main)) {\n _this11.$refs[ele.prop][0].$refs.temp.$refs.main.forEach(function (ele) {\n dynamicList.push(ele.validateCellForm());\n });\n }\n } else {\n dynamicList.push(_this11.$refs[ele.prop][0].$refs.temp.$refs.main.validateCellForm());\n }\n });\n\n Promise.all(dynamicList).then(function (res) {\n var count = 0;\n res.forEach(function (error, index) {\n if (!_this11.validatenull(error)) {\n dynamicError[dynamicName[index]] = error;\n }\n });\n var result = Object.assign(dynamicError, msg);\n\n if (_this11.validatenull(result)) {\n _this11.show();\n\n callback(true, _this11.hide);\n } else {\n callback(false, _this11.hide, result);\n }\n });\n });\n },\n resetForm: function resetForm() {\n var _this12 = this;\n\n this.form = Object(utils_util__WEBPACK_IMPORTED_MODULE_7__[\"clearVal\"])(this.form, (this.tableOption.filterParams || []).concat([this.rowKey]));\n this.$nextTick(function () {\n _this12.clearValidate();\n\n _this12.$emit(\"reset-change\");\n });\n },\n resetFields: function resetFields() {\n this.$refs.form.resetFields();\n },\n show: function show() {\n this.allDisabled = true;\n },\n hide: function hide() {\n this.allDisabled = false;\n },\n submit: function submit() {\n var _this13 = this;\n\n this.validate(function (valid, msg) {\n if (valid) {\n _this13.$emit(\"submit\", Object(utils_util__WEBPACK_IMPORTED_MODULE_7__[\"filterParams\"])(_this13.form), _this13.hide);\n } else {\n _this13.$emit(\"error\", msg);\n }\n });\n }\n }\n}));\n\n//# sourceURL=webpack://AVUE/./packages/element-ui/form/index.vue?./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options");
|
678
678
|
|
679
679
|
/***/ }),
|
680
680
|
|
@@ -1647,9 +1647,9 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
1647
1647
|
|
1648
1648
|
/***/ }),
|
1649
1649
|
|
1650
|
-
/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./packages/element-ui/form/index.vue?vue&type=template&id=
|
1650
|
+
/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./packages/element-ui/form/index.vue?vue&type=template&id=56758728&":
|
1651
1651
|
/*!*********************************************************************************************************************************************************************************************************!*\
|
1652
|
-
!*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/element-ui/form/index.vue?vue&type=template&id=
|
1652
|
+
!*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/element-ui/form/index.vue?vue&type=template&id=56758728& ***!
|
1653
1653
|
\*********************************************************************************************************************************************************************************************************/
|
1654
1654
|
/*! exports provided: render, staticRenderFns */
|
1655
1655
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
@@ -3839,7 +3839,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _nod
|
|
3839
3839
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
3840
3840
|
|
3841
3841
|
"use strict";
|
3842
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var
|
3842
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _index_vue_vue_type_template_id_56758728___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.vue?vue&type=template&id=56758728& */ \"./packages/element-ui/form/index.vue?vue&type=template&id=56758728&\");\n/* harmony import */ var _index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index.vue?vue&type=script&lang=js& */ \"./packages/element-ui/form/index.vue?vue&type=script&lang=js&\");\n/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ \"./node_modules/vue-loader/lib/runtime/componentNormalizer.js\");\n\n\n\n\n\n/* normalize component */\n\nvar component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(\n _index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n _index_vue_vue_type_template_id_56758728___WEBPACK_IMPORTED_MODULE_0__[\"render\"],\n _index_vue_vue_type_template_id_56758728___WEBPACK_IMPORTED_MODULE_0__[\"staticRenderFns\"],\n false,\n null,\n null,\n null\n \n)\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (component.exports);\n\n//# sourceURL=webpack://AVUE/./packages/element-ui/form/index.vue?");
|
3843
3843
|
|
3844
3844
|
/***/ }),
|
3845
3845
|
|
@@ -3855,15 +3855,15 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _nod
|
|
3855
3855
|
|
3856
3856
|
/***/ }),
|
3857
3857
|
|
3858
|
-
/***/ "./packages/element-ui/form/index.vue?vue&type=template&id=
|
3858
|
+
/***/ "./packages/element-ui/form/index.vue?vue&type=template&id=56758728&":
|
3859
3859
|
/*!***************************************************************************!*\
|
3860
|
-
!*** ./packages/element-ui/form/index.vue?vue&type=template&id=
|
3860
|
+
!*** ./packages/element-ui/form/index.vue?vue&type=template&id=56758728& ***!
|
3861
3861
|
\***************************************************************************/
|
3862
3862
|
/*! exports provided: render, staticRenderFns */
|
3863
3863
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
3864
3864
|
|
3865
3865
|
"use strict";
|
3866
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var
|
3866
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_template_id_56758728___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./index.vue?vue&type=template&id=56758728& */ \"./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./packages/element-ui/form/index.vue?vue&type=template&id=56758728&\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_template_id_56758728___WEBPACK_IMPORTED_MODULE_0__[\"render\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_template_id_56758728___WEBPACK_IMPORTED_MODULE_0__[\"staticRenderFns\"]; });\n\n\n\n//# sourceURL=webpack://AVUE/./packages/element-ui/form/index.vue?");
|
3867
3867
|
|
3868
3868
|
/***/ }),
|
3869
3869
|
|
@@ -5375,7 +5375,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core
|
|
5375
5375
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
5376
5376
|
|
5377
5377
|
"use strict";
|
5378
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getFixed\", function() { return getFixed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAsVal\", function() { return getAsVal; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setAsVal\", function() { return setAsVal; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadScript\", function() { return loadScript; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"downFile\", function() { return downFile; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"strCorNum\", function() { return strCorNum; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createObj\", function() { return createObj; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dataURLtoFile\", function() { return dataURLtoFile; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"findObject\", function() { return findObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"randomId\", function() { return randomId; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getObjType\", function() { return getObjType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isJson\", function() { return isJson; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"deepClone\", function() { return deepClone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sortArrys\", function() { return sortArrys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setPx\", function() { return setPx; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"detailDataType\", function() { return detailDataType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getUrlParams\", function() { return getUrlParams; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"detailDic\", function() { return detailDic; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"findByValue\", function() { return findByValue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"filterParams\", function() { return filterParams; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"detailDicGroup\", function() { return detailDicGroup; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"findLabelNode\", function() { return findLabelNode; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDeepData\", function() { return getDeepData; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getObjValue\", function() { return getObjValue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"findArray\", function() { return findArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getPasswordChar\", function() { return getPasswordChar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"arraySort\", function() { return arraySort; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clearVal\", function() { return clearVal; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"vaildData\", function() { return vaildData; });\n/* harmony import */ var _validate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./validate */ \"./src/utils/validate.js\");\n/* harmony import */ var global_variable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! global/variable */ \"./src/global/variable.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n\n\nfunction getFixed() {\n var val = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var len = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;\n return Number(val.toFixed(len));\n}\nfunction getAsVal(obj) {\n var bind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var result = deepClone(obj);\n if (Object(_validate__WEBPACK_IMPORTED_MODULE_0__[\"validatenull\"])(bind)) return result;\n bind.split('.').forEach(function (ele) {\n result = !Object(_validate__WEBPACK_IMPORTED_MODULE_0__[\"validatenull\"])(result[ele]) ? result[ele] : '';\n });\n return result;\n}\nfunction setAsVal(obj) {\n var bind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var value = arguments.length > 2 ? arguments[2] : undefined;\n var result;\n var type = getObjType(value);\n\n if (Object(_validate__WEBPACK_IMPORTED_MODULE_0__[\"validatenull\"])(value)) {\n if (type === 'array') {\n result = \"obj.\".concat(bind, \"=[]\");\n } else if (type === 'object') {\n result = \"obj.\".concat(bind, \"={}\");\n } else if (['number', 'boolean'].includes(type)) {\n result = \"obj.\".concat(bind, \"=undefined\");\n } else {\n result = \"obj.\".concat(bind, \"=''\");\n }\n } else {\n if (type == 'string') {\n result = \"obj.\".concat(bind, \"='\").concat(value, \"'\");\n } else {\n result = \"obj.\".concat(bind, \"=\").concat(value);\n }\n }\n\n eval(result);\n return obj;\n}\nvar loadScript = function loadScript() {\n var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'js';\n var url = arguments.length > 1 ? arguments[1] : undefined;\n var flag = false;\n return new Promise(function (resolve) {\n var head = document.getElementsByTagName('head')[0];\n head.children.forEach(function (ele) {\n if ((ele.src || '').indexOf(url) !== -1) {\n flag = true;\n resolve();\n }\n });\n if (flag) return;\n var script;\n\n if (type === 'js') {\n script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = url;\n } else if (type === 'css') {\n script = document.createElement('link');\n script.rel = 'stylesheet';\n script.type = 'text/css';\n script.href = url;\n }\n\n head.appendChild(script);\n\n script.onload = function () {\n resolve();\n };\n });\n};\nfunction downFile(url, saveName) {\n if (_typeof(url) == 'object' && url instanceof Blob) {\n url = URL.createObjectURL(url); // 创建blob地址\n }\n\n var aLink = document.createElement('a');\n aLink.href = url;\n aLink.download = saveName || ''; // HTML5新增的属性,指定保存文件名,可以不要后缀,注意,file:///模式下不会生效\n\n var event;\n\n if (window.MouseEvent) {\n event = new MouseEvent('click');\n } else {\n event = document.createEvent('MouseEvents');\n event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\n }\n\n aLink.dispatchEvent(event);\n}\nfunction strCorNum(list) {\n list.forEach(function (ele, index) {\n list[index] = Number(ele);\n });\n return list;\n}\nfunction extend() {\n var target = arguments[0] || {};\n var deep = false;\n var arr = Array.prototype.slice.call(arguments);\n var i = 1;\n var options, src, key, copy;\n var isArray = false;\n\n if (typeof target === 'boolean') {\n deep = target;\n i++;\n target = arguments[1];\n }\n\n for (; i < arr.length; i++) {\n // 循环传入的对象数组\n if ((options = arr[i]) != null) {\n // 如果当前值不是null,如果是null不做处理\n for (key in options) {\n // for in循环对象中key\n copy = options[key];\n src = target[key]; // 如果对象中value值任然是一个引用类型\n\n if (deep && (toString.call(copy) === '[object Object]' || (isArray = toString.call(copy) == '[object Array]'))) {\n if (isArray) {\n // 如果引用类型是数组\n // 如果目标对象target存在当前key,且数据类型是数组,那就还原此值,如果不是就定义成一个空数组;\n src = toString.call(src) === '[object Array]' ? src : [];\n } else {\n // 如果目标对象target存在当前key,且数据类型是对象,那就还原此值,如果不是就定义成一个空对象;\n src = toString.call(src) === '[object Object]' ? src : {};\n } // 引用类型就再次调用extend,递归,直到此时copy是一个基本类型的值。\n\n\n target[key] = extend(deep, src, copy);\n } else if (copy !== undefined && copy !== src) {\n // 如果这个值是基本值类型,且不是undefined\n target[key] = copy;\n }\n }\n }\n }\n\n return target;\n}\nfunction createObj(obj, bind) {\n var list = bind.split('.');\n var first = list.splice(0, 1)[0];\n var deep = {};\n deep[first] = {};\n\n if (list.length >= 2) {\n var start = '{';\n var end = '}';\n var result = '';\n list.forEach(function (ele) {\n result = \"\".concat(result).concat(start, \"\\\"\").concat(ele, \"\\\":\");\n });\n result = \"\".concat(result, \"\\\"\\\"\");\n\n for (var i = 0; i < list.length; i++) {\n result = \"\".concat(result).concat(end);\n }\n\n result = JSON.parse(result);\n deep[first] = result;\n }\n\n obj = extend(true, obj, deep);\n return obj;\n}\nfunction dataURLtoFile(dataurl, filename) {\n var arr = dataurl.split(',');\n var mime = arr[0].match(/:(.*?);/)[1];\n var bstr = atob(arr[1]);\n var n = bstr.length;\n var u8arr = new Uint8Array(n);\n\n while (n--) {\n u8arr[n] = bstr.charCodeAt(n);\n }\n\n return new File([u8arr], filename, {\n type: mime\n });\n}\nfunction findObject(list, value) {\n var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'prop';\n var result = -1;\n\n var type = function () {\n var result;\n list.forEach(function (ele) {\n if (ele.column) {\n result = 'group';\n } else if (ele.children) {\n result = 'tree';\n }\n });\n return result;\n }();\n\n if (type === 'group') {\n list.forEach(function (ele) {\n var val = findArray(ele.column, value, key, true);\n if (val !== -1) result = val;\n });\n } else if (type === 'tree') {\n result = findLabelNode(list, value, {\n value: key\n }, true);\n } else {\n result = findArray(list, value, key, true);\n }\n\n return result;\n}\n/**\r\n * 生成随机数\r\n */\n\nfunction randomId() {\n var $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';\n var maxPos = $chars.length;\n var id = '';\n\n for (var i = 0; i < 16; i++) {\n id += $chars.charAt(Math.floor(Math.random() * maxPos));\n }\n\n return id;\n}\nvar getObjType = function getObjType(obj) {\n var toString = Object.prototype.toString;\n var map = {\n '[object Boolean]': 'boolean',\n '[object Number]': 'number',\n '[object String]': 'string',\n '[object Function]': 'function',\n '[object Array]': 'array',\n '[object Date]': 'date',\n '[object RegExp]': 'regExp',\n '[object Undefined]': 'undefined',\n '[object Null]': 'null',\n '[object Object]': 'object'\n };\n\n if (obj instanceof Element) {\n return 'element';\n }\n\n return map[toString.call(obj)];\n};\n/**\r\n *判断是否为json对象\r\n */\n\nvar isJson = function isJson(str) {\n if (Array.isArray(str)) {\n if (str[0] instanceof Object) {\n return true;\n } else {\n return false;\n }\n } else if (str instanceof Object) {\n return true;\n }\n\n return false;\n};\n/**\r\n * 对象深拷贝\r\n */\n\nvar deepClone = function deepClone(data) {\n var type = getObjType(data);\n var obj;\n if (type === 'array') obj = [];else if (type === 'object') obj = {};else return data;\n\n if (type === 'array') {\n for (var i = 0, len = data.length; i < len; i++) {\n data[i] = function () {\n if (data[i] === 0) {\n return data[i];\n }\n\n return data[i];\n }();\n\n if (data[i]) {\n delete data[i].$parent;\n }\n\n obj.push(deepClone(data[i]));\n }\n } else if (type === 'object') {\n for (var key in data) {\n if (data) {\n delete data.$parent;\n }\n\n obj[key] = deepClone(data[key]);\n }\n }\n\n return obj;\n};\n/**\r\n * 根据字段数组排序\r\n */\n\nvar sortArrys = function sortArrys(list, prop) {\n list.sort(function (a, b) {\n if (a[prop] > b[prop]) {\n return -1;\n }\n\n if (a[prop] < b[prop]) {\n return 1;\n }\n\n return 0;\n });\n return list;\n};\n/**\r\n * 设置px像素\r\n */\n\nvar setPx = function setPx(val) {\n var defval = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n if (Object(_validate__WEBPACK_IMPORTED_MODULE_0__[\"validatenull\"])(val)) val = defval;\n if (Object(_validate__WEBPACK_IMPORTED_MODULE_0__[\"validatenull\"])(val)) return '';\n val = val + '';\n\n if (val.indexOf('%') === -1) {\n val = val + 'px';\n }\n\n return val;\n};\n/**\r\n * 字符串数据类型转化\r\n */\n\nvar detailDataType = function detailDataType(value, type) {\n if (Object(_validate__WEBPACK_IMPORTED_MODULE_0__[\"validatenull\"])(value)) return value;\n\n if (type === 'number') {\n return Number(value);\n } else if (type === 'string') {\n return value + '';\n } else {\n return value;\n }\n}; // 获取url中的参数\n\nvar getUrlParams = function getUrlParams(url) {\n var result = {\n url: '',\n params: {}\n };\n var list = url.split('?');\n result.url = list[0];\n var params = list[1];\n\n if (params) {\n var _list = params.split('&');\n\n _list.forEach(function (ele) {\n var dic = ele.split('=');\n var label = dic[0];\n var value = dic[1];\n result.params[label] = value;\n });\n }\n\n return result;\n};\n/**\r\n * 数组的数据类型转化\r\n */\n\nvar detailDic = function detailDic() {\n var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var type = arguments.length > 2 ? arguments[2] : undefined;\n var valueKey = props.value || global_variable__WEBPACK_IMPORTED_MODULE_1__[\"DIC_PROPS\"].value;\n var childrenKey = props.children || global_variable__WEBPACK_IMPORTED_MODULE_1__[\"DIC_PROPS\"].children;\n list.forEach(function (ele) {\n ele[valueKey] = detailDataType(ele[valueKey], type);\n if (ele[childrenKey]) detailDic(ele[childrenKey], props, type);\n });\n return list;\n};\n/**\r\n * 根据字典的value显示label\r\n */\n\nvar findByValue = function findByValue(dic, value, props) {\n // 如果为空直接返回\n if (Object(_validate__WEBPACK_IMPORTED_MODULE_0__[\"validatenull\"])(dic)) return value;\n var result = '';\n var isArray = value instanceof Array;\n var list = isArray ? value : [value];\n props = props || global_variable__WEBPACK_IMPORTED_MODULE_1__[\"DIC_PROPS\"];\n result = [];\n\n for (var i = 0; i < list.length; i++) {\n result.push(findLabelNode(dic, list[i], props) || list[i]);\n }\n\n if (isArray) {\n return result.join(global_variable__WEBPACK_IMPORTED_MODULE_1__[\"DIC_SHOW_SPLIT\"]).toString();\n }\n\n return result.join();\n};\n/**\r\n * 过滤字典翻译字段和空字段\r\n */\n\nvar filterParams = function filterParams(form) {\n var list = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['', '$'];\n var data = deepClone(form);\n\n for (var o in data) {\n if (list.includes('')) {\n if (Object(_validate__WEBPACK_IMPORTED_MODULE_0__[\"validatenull\"])(data[o])) delete data[o];\n }\n\n if (list.includes('$')) {\n if (o.indexOf('$') !== -1) delete data[o];\n }\n }\n\n return data;\n};\n/**\r\n * 处理存在group分组的情况\r\n */\n\nvar detailDicGroup = function detailDicGroup() {\n var dic = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var list = deepClone(dic);\n var groupsKey = props[global_variable__WEBPACK_IMPORTED_MODULE_1__[\"DIC_PROPS\"].groups] || global_variable__WEBPACK_IMPORTED_MODULE_1__[\"DIC_PROPS\"].groups;\n dic.forEach(function (ele) {\n if (ele[groupsKey]) {\n list = list.concat(ele[groupsKey]);\n }\n });\n return list;\n};\n/**\r\n * 根据label去找到节点\r\n */\n\nvar findLabelNode = function findLabelNode(dic, value, props, obj) {\n var result;\n if (!obj) dic = detailDicGroup(dic, props);\n\n var rev = function rev(dic1) {\n var labelKey = props.label || global_variable__WEBPACK_IMPORTED_MODULE_1__[\"DIC_PROPS\"].label;\n var valueKey = props.value || global_variable__WEBPACK_IMPORTED_MODULE_1__[\"DIC_PROPS\"].value;\n var childrenKey = props.children || global_variable__WEBPACK_IMPORTED_MODULE_1__[\"DIC_PROPS\"].children;\n\n for (var i = 0; i < dic1.length; i++) {\n var ele = dic1[i];\n var children = ele[childrenKey] || [];\n\n if (ele[valueKey] === value) {\n result = obj ? ele : ele[labelKey];\n } else {\n rev(children);\n }\n }\n };\n\n rev(dic);\n return result;\n};\n/**\r\n * 获取多层data\r\n */\n\nvar getDeepData = function getDeepData(res) {\n return (Array.isArray(res) ? res : res.data) || [];\n};\nvar getObjValue = function getObjValue(data) {\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var type = arguments.length > 2 ? arguments[2] : undefined;\n var list = params.split('.');\n var result = data;\n\n if (list[0] === '' && type !== 'object') {\n return getDeepData(data);\n } else if (list[0] !== '') {\n list.forEach(function (ele) {\n result = result[ele];\n });\n }\n\n return result;\n};\n/**\r\n * 根据值查找对应的序号\r\n */\n\nvar findArray = function findArray(dic, value, valueKey, obj) {\n valueKey = valueKey || global_variable__WEBPACK_IMPORTED_MODULE_1__[\"DIC_PROPS\"].value;\n\n for (var i = 0; i < dic.length; i++) {\n if (dic[i][valueKey] === value) {\n return obj ? dic[i] : i;\n }\n }\n\n return -1;\n};\n/**\r\n * 根据位数获取*密码程度\r\n */\n\nvar getPasswordChar = function getPasswordChar() {\n var result = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n\n var _char = arguments.length > 1 ? arguments[1] : undefined;\n\n var len = result.toString().length;\n result = '';\n\n for (var i = 0; i < len; i++) {\n result = result + _char;\n }\n\n return result;\n};\nvar arraySort = function arraySort() {\n var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var prop = arguments.length > 1 ? arguments[1] : undefined;\n var callback = arguments.length > 2 ? arguments[2] : undefined;\n return list.filter(function (ele) {\n return !Object(_validate__WEBPACK_IMPORTED_MODULE_0__[\"validatenull\"])(ele[prop]);\n }).sort(function (a, b) {\n return callback(a, b);\n }).concat(list.filter(function (ele) {\n return Object(_validate__WEBPACK_IMPORTED_MODULE_0__[\"validatenull\"])(ele[prop]);\n }));\n};\nvar clearVal = function clearVal(obj) {\n var list = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n if (!obj) return {};\n Object.keys(obj).forEach(function (ele) {\n if (list.includes(ele)) return;else if (ele.includes('$')) delete obj[ele];else if (!Object(_validate__WEBPACK_IMPORTED_MODULE_0__[\"validatenull\"])(obj[ele])) {\n var type = getObjType(obj[ele]);\n if (type === 'array') obj[ele] = [];else if (type === 'object') obj[ele] = {};else if (['number', 'boolean'].includes(type)) obj[ele] = undefined;else obj[ele] = '';\n }\n });\n return obj;\n};\n/**\r\n * 验证是否存在true/false\r\n */\n\nvar vaildData = function vaildData(val, dafult) {\n if (typeof val === 'boolean') {\n return val;\n }\n\n return !Object(_validate__WEBPACK_IMPORTED_MODULE_0__[\"validatenull\"])(val) ? val : dafult;\n};\n\n//# sourceURL=webpack://AVUE/./src/utils/util.js?");
|
5378
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getFixed\", function() { return getFixed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAsVal\", function() { return getAsVal; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setAsVal\", function() { return setAsVal; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadScript\", function() { return loadScript; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"downFile\", function() { return downFile; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"strCorNum\", function() { return strCorNum; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createObj\", function() { return createObj; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dataURLtoFile\", function() { return dataURLtoFile; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"findObject\", function() { return findObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"randomId\", function() { return randomId; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getObjType\", function() { return getObjType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isJson\", function() { return isJson; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"deepClone\", function() { return deepClone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sortArrys\", function() { return sortArrys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setPx\", function() { return setPx; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"detailDataType\", function() { return detailDataType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getUrlParams\", function() { return getUrlParams; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"detailDic\", function() { return detailDic; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"findByValue\", function() { return findByValue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"filterParams\", function() { return filterParams; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"detailDicGroup\", function() { return detailDicGroup; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"findLabelNode\", function() { return findLabelNode; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDeepData\", function() { return getDeepData; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getObjValue\", function() { return getObjValue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"findArray\", function() { return findArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getPasswordChar\", function() { return getPasswordChar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"arraySort\", function() { return arraySort; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clearVal\", function() { return clearVal; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"vaildData\", function() { return vaildData; });\n/* harmony import */ var _validate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./validate */ \"./src/utils/validate.js\");\n/* harmony import */ var global_variable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! global/variable */ \"./src/global/variable.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n\n\nfunction getFixed() {\n var val = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var len = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;\n return Number(val.toFixed(len));\n}\nfunction getAsVal(obj) {\n var bind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var result = deepClone(obj);\n if (Object(_validate__WEBPACK_IMPORTED_MODULE_0__[\"validatenull\"])(bind)) return result;\n bind.split('.').forEach(function (ele) {\n result = !Object(_validate__WEBPACK_IMPORTED_MODULE_0__[\"validatenull\"])(result[ele]) ? result[ele] : '';\n });\n return result;\n}\nfunction setAsVal(obj) {\n var bind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var value = arguments.length > 2 ? arguments[2] : undefined;\n var result;\n var type = getObjType(value);\n\n if (Object(_validate__WEBPACK_IMPORTED_MODULE_0__[\"validatenull\"])(value)) {\n if (type === 'array') {\n result = \"obj.\".concat(bind, \"=[]\");\n } else if (type === 'object') {\n result = \"obj.\".concat(bind, \"={}\");\n } else if (['number', 'boolean'].includes(type)) {\n result = \"obj.\".concat(bind, \"=undefined\");\n } else {\n result = \"obj.\".concat(bind, \"=''\");\n }\n } else {\n if (type == 'string') {\n result = \"obj.\".concat(bind, \"='\").concat(value, \"'\");\n } else {\n result = \"obj.\".concat(bind, \"=\").concat(value);\n }\n }\n\n eval(result);\n return obj;\n}\nvar loadScript = function loadScript() {\n var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'js';\n var url = arguments.length > 1 ? arguments[1] : undefined;\n var flag = false;\n return new Promise(function (resolve) {\n var head = document.getElementsByTagName('head')[0];\n head.children.forEach(function (ele) {\n if ((ele.src || '').indexOf(url) !== -1) {\n flag = true;\n resolve();\n }\n });\n if (flag) return;\n var script;\n\n if (type === 'js') {\n script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = url;\n } else if (type === 'css') {\n script = document.createElement('link');\n script.rel = 'stylesheet';\n script.type = 'text/css';\n script.href = url;\n }\n\n head.appendChild(script);\n\n script.onload = function () {\n resolve();\n };\n });\n};\nfunction downFile(url, saveName) {\n if (_typeof(url) == 'object' && url instanceof Blob) {\n url = URL.createObjectURL(url); // 创建blob地址\n }\n\n var aLink = document.createElement('a');\n aLink.href = url;\n aLink.download = saveName || ''; // HTML5新增的属性,指定保存文件名,可以不要后缀,注意,file:///模式下不会生效\n\n var event;\n\n if (window.MouseEvent) {\n event = new MouseEvent('click');\n } else {\n event = document.createEvent('MouseEvents');\n event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\n }\n\n aLink.dispatchEvent(event);\n}\nfunction strCorNum(list) {\n list.forEach(function (ele, index) {\n list[index] = Number(ele);\n });\n return list;\n}\nfunction extend() {\n var target = arguments[0] || {};\n var deep = false;\n var arr = Array.prototype.slice.call(arguments);\n var i = 1;\n var options, src, key, copy;\n var isArray = false;\n\n if (typeof target === 'boolean') {\n deep = target;\n i++;\n target = arguments[1];\n }\n\n for (; i < arr.length; i++) {\n // 循环传入的对象数组\n if ((options = arr[i]) != null) {\n // 如果当前值不是null,如果是null不做处理\n for (key in options) {\n // for in循环对象中key\n copy = options[key];\n src = target[key]; // 如果对象中value值任然是一个引用类型\n\n if (deep && (toString.call(copy) === '[object Object]' || (isArray = toString.call(copy) == '[object Array]'))) {\n if (isArray) {\n // 如果引用类型是数组\n // 如果目标对象target存在当前key,且数据类型是数组,那就还原此值,如果不是就定义成一个空数组;\n src = toString.call(src) === '[object Array]' ? src : [];\n } else {\n // 如果目标对象target存在当前key,且数据类型是对象,那就还原此值,如果不是就定义成一个空对象;\n src = toString.call(src) === '[object Object]' ? src : {};\n } // 引用类型就再次调用extend,递归,直到此时copy是一个基本类型的值。\n\n\n target[key] = extend(deep, src, copy);\n } else if (copy !== undefined && copy !== src) {\n // 如果这个值是基本值类型,且不是undefined\n target[key] = copy;\n }\n }\n }\n }\n\n return target;\n}\nfunction createObj(obj, bind) {\n var list = bind.split('.');\n var first = list.splice(0, 1)[0];\n var deep = {};\n deep[first] = {};\n\n if (list.length >= 2) {\n var start = '{';\n var end = '}';\n var result = '';\n list.forEach(function (ele) {\n result = \"\".concat(result).concat(start, \"\\\"\").concat(ele, \"\\\":\");\n });\n result = \"\".concat(result, \"\\\"\\\"\");\n\n for (var i = 0; i < list.length; i++) {\n result = \"\".concat(result).concat(end);\n }\n\n result = JSON.parse(result);\n deep[first] = result;\n }\n\n obj = extend(true, obj, deep);\n return obj;\n}\nfunction dataURLtoFile(dataurl, filename) {\n var arr = dataurl.split(',');\n var mime = arr[0].match(/:(.*?);/)[1];\n var bstr = atob(arr[1]);\n var n = bstr.length;\n var u8arr = new Uint8Array(n);\n\n while (n--) {\n u8arr[n] = bstr.charCodeAt(n);\n }\n\n return new File([u8arr], filename, {\n type: mime\n });\n}\nfunction findObject(list, value) {\n var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'prop';\n var result = -1;\n\n var type = function () {\n var result;\n list.forEach(function (ele) {\n if (ele.column) {\n result = 'group';\n } else if (ele.children) {\n result = 'tree';\n }\n });\n return result;\n }();\n\n if (type === 'group') {\n list.forEach(function (ele) {\n var val = findArray(ele.column, value, key, true);\n if (val !== -1) result = val;\n });\n } else if (type === 'tree') {\n result = findLabelNode(list, value, {\n value: key\n }, true);\n } else {\n result = findArray(list, value, key, true);\n }\n\n return result;\n}\n/**\r\n * 生成随机数\r\n */\n\nfunction randomId() {\n var $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';\n var maxPos = $chars.length;\n var id = '';\n\n for (var i = 0; i < 16; i++) {\n id += $chars.charAt(Math.floor(Math.random() * maxPos));\n }\n\n return id;\n}\nvar getObjType = function getObjType(obj) {\n var toString = Object.prototype.toString;\n var map = {\n '[object Boolean]': 'boolean',\n '[object Number]': 'number',\n '[object String]': 'string',\n '[object Function]': 'function',\n '[object Array]': 'array',\n '[object Date]': 'date',\n '[object RegExp]': 'regExp',\n '[object Undefined]': 'undefined',\n '[object Null]': 'null',\n '[object Object]': 'object'\n };\n\n if (obj instanceof Element) {\n return 'element';\n }\n\n return map[toString.call(obj)];\n};\n/**\r\n *判断是否为json对象\r\n */\n\nvar isJson = function isJson(str) {\n if (Array.isArray(str)) {\n if (str[0] instanceof Object) {\n return true;\n } else {\n return false;\n }\n } else if (str instanceof Object) {\n return true;\n }\n\n return false;\n};\n/**\r\n * 对象深拷贝\r\n */\n\nvar deepClone = function deepClone(data) {\n var type = getObjType(data);\n var obj;\n if (type === 'array') obj = [];else if (type === 'object') obj = {};else return data;\n\n if (type === 'array') {\n for (var i = 0, len = data.length; i < len; i++) {\n data[i] = function () {\n if (data[i] === 0) {\n return data[i];\n }\n\n return data[i];\n }();\n\n if (data[i]) {\n delete data[i].$parent;\n }\n\n obj.push(deepClone(data[i]));\n }\n } else if (type === 'object') {\n for (var key in data) {\n if (data) {\n delete data.$parent;\n }\n\n obj[key] = deepClone(data[key]);\n }\n }\n\n return obj;\n};\n/**\r\n * 根据字段数组排序\r\n */\n\nvar sortArrys = function sortArrys(list, prop) {\n list.sort(function (a, b) {\n if (a[prop] > b[prop]) {\n return -1;\n }\n\n if (a[prop] < b[prop]) {\n return 1;\n }\n\n return 0;\n });\n return list;\n};\n/**\r\n * 设置px像素\r\n */\n\nvar setPx = function setPx(val) {\n var defval = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n if (Object(_validate__WEBPACK_IMPORTED_MODULE_0__[\"validatenull\"])(val)) val = defval;\n if (Object(_validate__WEBPACK_IMPORTED_MODULE_0__[\"validatenull\"])(val)) return '';\n val = val + '';\n\n if (val.indexOf('%') === -1) {\n val = val + 'px';\n }\n\n return val;\n};\n/**\r\n * 字符串数据类型转化\r\n */\n\nvar detailDataType = function detailDataType(value, type) {\n if (Object(_validate__WEBPACK_IMPORTED_MODULE_0__[\"validatenull\"])(value)) return value;\n\n if (type === 'number') {\n return Number(value);\n } else if (type === 'string') {\n return value + '';\n } else {\n return value;\n }\n}; // 获取url中的参数\n\nvar getUrlParams = function getUrlParams(url) {\n var result = {\n url: '',\n params: {}\n };\n var list = url.split('?');\n result.url = list[0];\n var params = list[1];\n\n if (params) {\n var _list = params.split('&');\n\n _list.forEach(function (ele) {\n var dic = ele.split('=');\n var label = dic[0];\n var value = dic[1];\n result.params[label] = value;\n });\n }\n\n return result;\n};\n/**\r\n * 数组的数据类型转化\r\n */\n\nvar detailDic = function detailDic() {\n var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var type = arguments.length > 2 ? arguments[2] : undefined;\n var valueKey = props.value || global_variable__WEBPACK_IMPORTED_MODULE_1__[\"DIC_PROPS\"].value;\n var childrenKey = props.children || global_variable__WEBPACK_IMPORTED_MODULE_1__[\"DIC_PROPS\"].children;\n list.forEach(function (ele) {\n ele[valueKey] = detailDataType(ele[valueKey], type);\n if (ele[childrenKey]) detailDic(ele[childrenKey], props, type);\n });\n return list;\n};\n/**\r\n * 根据字典的value显示label\r\n */\n\nvar findByValue = function findByValue(dic, value, props) {\n // 如果为空直接返回\n if (Object(_validate__WEBPACK_IMPORTED_MODULE_0__[\"validatenull\"])(dic)) return value;\n var result = '';\n var isArray = value instanceof Array;\n var list = isArray ? value : [value];\n props = props || global_variable__WEBPACK_IMPORTED_MODULE_1__[\"DIC_PROPS\"];\n result = [];\n\n for (var i = 0; i < list.length; i++) {\n result.push(findLabelNode(dic, list[i], props) || list[i]);\n }\n\n if (isArray) {\n return result.join(global_variable__WEBPACK_IMPORTED_MODULE_1__[\"DIC_SHOW_SPLIT\"]).toString();\n }\n\n return result.join();\n};\n/**\r\n * 过滤字典翻译字段和空字段\r\n */\n\nvar filterParams = function filterParams(form) {\n var list = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['', '$'];\n var deep = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n var data = deep ? deepClone(form) : form;\n\n for (var o in data) {\n if (list.includes('')) {\n if (Object(_validate__WEBPACK_IMPORTED_MODULE_0__[\"validatenull\"])(data[o])) delete data[o];\n }\n\n if (list.includes('$')) {\n if (o.indexOf('$') !== -1) delete data[o];\n }\n }\n\n return data;\n};\n/**\r\n * 处理存在group分组的情况\r\n */\n\nvar detailDicGroup = function detailDicGroup() {\n var dic = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var list = deepClone(dic);\n var groupsKey = props[global_variable__WEBPACK_IMPORTED_MODULE_1__[\"DIC_PROPS\"].groups] || global_variable__WEBPACK_IMPORTED_MODULE_1__[\"DIC_PROPS\"].groups;\n dic.forEach(function (ele) {\n if (ele[groupsKey]) {\n list = list.concat(ele[groupsKey]);\n }\n });\n return list;\n};\n/**\r\n * 根据label去找到节点\r\n */\n\nvar findLabelNode = function findLabelNode(dic, value, props, obj) {\n var result;\n if (!obj) dic = detailDicGroup(dic, props);\n\n var rev = function rev(dic1) {\n var labelKey = props.label || global_variable__WEBPACK_IMPORTED_MODULE_1__[\"DIC_PROPS\"].label;\n var valueKey = props.value || global_variable__WEBPACK_IMPORTED_MODULE_1__[\"DIC_PROPS\"].value;\n var childrenKey = props.children || global_variable__WEBPACK_IMPORTED_MODULE_1__[\"DIC_PROPS\"].children;\n\n for (var i = 0; i < dic1.length; i++) {\n var ele = dic1[i];\n var children = ele[childrenKey] || [];\n\n if (ele[valueKey] === value) {\n result = obj ? ele : ele[labelKey];\n } else {\n rev(children);\n }\n }\n };\n\n rev(dic);\n return result;\n};\n/**\r\n * 获取多层data\r\n */\n\nvar getDeepData = function getDeepData(res) {\n return (Array.isArray(res) ? res : res.data) || [];\n};\nvar getObjValue = function getObjValue(data) {\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var type = arguments.length > 2 ? arguments[2] : undefined;\n var list = params.split('.');\n var result = data;\n\n if (list[0] === '' && type !== 'object') {\n return getDeepData(data);\n } else if (list[0] !== '') {\n list.forEach(function (ele) {\n result = result[ele];\n });\n }\n\n return result;\n};\n/**\r\n * 根据值查找对应的序号\r\n */\n\nvar findArray = function findArray(dic, value, valueKey, obj) {\n valueKey = valueKey || global_variable__WEBPACK_IMPORTED_MODULE_1__[\"DIC_PROPS\"].value;\n\n for (var i = 0; i < dic.length; i++) {\n if (dic[i][valueKey] === value) {\n return obj ? dic[i] : i;\n }\n }\n\n return -1;\n};\n/**\r\n * 根据位数获取*密码程度\r\n */\n\nvar getPasswordChar = function getPasswordChar() {\n var result = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n\n var _char = arguments.length > 1 ? arguments[1] : undefined;\n\n var len = result.toString().length;\n result = '';\n\n for (var i = 0; i < len; i++) {\n result = result + _char;\n }\n\n return result;\n};\nvar arraySort = function arraySort() {\n var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var prop = arguments.length > 1 ? arguments[1] : undefined;\n var callback = arguments.length > 2 ? arguments[2] : undefined;\n return list.filter(function (ele) {\n return !Object(_validate__WEBPACK_IMPORTED_MODULE_0__[\"validatenull\"])(ele[prop]);\n }).sort(function (a, b) {\n return callback(a, b);\n }).concat(list.filter(function (ele) {\n return Object(_validate__WEBPACK_IMPORTED_MODULE_0__[\"validatenull\"])(ele[prop]);\n }));\n};\nvar clearVal = function clearVal(obj) {\n var list = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n if (!obj) return {};\n Object.keys(obj).forEach(function (ele) {\n if (list.includes(ele)) return;else if (ele.includes('$')) delete obj[ele];else if (!Object(_validate__WEBPACK_IMPORTED_MODULE_0__[\"validatenull\"])(obj[ele])) {\n var type = getObjType(obj[ele]);\n if (type === 'array') obj[ele] = [];else if (type === 'object') obj[ele] = {};else if (['number', 'boolean'].includes(type)) obj[ele] = undefined;else obj[ele] = '';\n }\n });\n return obj;\n};\n/**\r\n * 验证是否存在true/false\r\n */\n\nvar vaildData = function vaildData(val, dafult) {\n if (typeof val === 'boolean') {\n return val;\n }\n\n return !Object(_validate__WEBPACK_IMPORTED_MODULE_0__[\"validatenull\"])(val) ? val : dafult;\n};\n\n//# sourceURL=webpack://AVUE/./src/utils/util.js?");
|
5379
5379
|
|
5380
5380
|
/***/ }),
|
5381
5381
|
|
@@ -5411,7 +5411,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
5411
5411
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
5412
5412
|
|
5413
5413
|
"use strict";
|
5414
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"version\", function() { return version; });\nvar version = '2.9.
|
5414
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"version\", function() { return version; });\nvar version = '2.9.7';\n\n//# sourceURL=webpack://AVUE/./src/version.js?");
|
5415
5415
|
|
5416
5416
|
/***/ }),
|
5417
5417
|
|