1 line
9.7 KiB
JSON
1 line
9.7 KiB
JSON
|
|
{"remainingRequest":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\babel-loader\\lib\\index.js!D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\eslint-loader\\index.js??ref--13-0!D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\src\\views\\system\\build\\generator\\js.js","dependencies":[{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\src\\views\\system\\build\\generator\\js.js","mtime":1732871026723},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\babel.config.js","mtime":1732871025888},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1732872824662},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\babel-loader\\lib\\index.js","mtime":1732872825017},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\eslint-loader\\index.js","mtime":1732872823677}],"contextDependencies":[],"result":["\"use strict\";\n\nvar _interopRequireDefault = require(\"D:/data/hanguodoushan/acs2/nladmin-ui/node_modules/@babel/runtime/helpers/interopRequireDefault.js\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.makeUpJs = makeUpJs;\nrequire(\"core-js/modules/es6.object.keys\");\nrequire(\"core-js/modules/web.dom.iterable\");\nvar _util = require(\"util\");\nvar _index = require(\"../utils/index\");\nvar _ruleTrigger = _interopRequireDefault(require(\"./ruleTrigger\"));\nvar units = {\n KB: '1024',\n MB: '1024 / 1024',\n GB: '1024 / 1024 / 1024'\n};\nvar confGlobal;\nvar inheritAttrs = {\n file: '',\n dialog: 'inheritAttrs: false,'\n};\n\n/**\r\n * 组装js 【入口函数】\r\n * @param {Object} formConfig 整个表单配置\r\n * @param {String} type 生成类型,文件或弹窗等\r\n */\nfunction makeUpJs(formConfig, type) {\n confGlobal = formConfig = (0, _index.deepClone)(formConfig);\n var dataList = [];\n var ruleList = [];\n var optionsList = [];\n var propsList = [];\n var methodList = mixinMethod(type);\n var uploadVarList = [];\n var created = [];\n formConfig.fields.forEach(function (el) {\n buildAttributes(el, dataList, ruleList, optionsList, methodList, propsList, uploadVarList, created);\n });\n var script = buildexport(formConfig, type, dataList.join('\\n'), ruleList.join('\\n'), optionsList.join('\\n'), uploadVarList.join('\\n'), propsList.join('\\n'), methodList.join('\\n'), created.join('\\n'));\n confGlobal = null;\n return script;\n}\n\n// 构建组件属性\nfunction buildAttributes(scheme, dataList, ruleList, optionsList, methodList, propsList, uploadVarList, created) {\n var config = scheme.__config__;\n var slot = scheme.__slot__;\n buildData(scheme, dataList);\n buildRules(scheme, ruleList);\n\n // 特殊处理options属性\n if (scheme.options || slot && slot.options && slot.options.length) {\n buildOptions(scheme, optionsList);\n if (config.dataType === 'dynamic') {\n var model = \"\".concat(scheme.__vModel__, \"Options\");\n var options = (0, _index.titleCase)(model);\n var methodName = \"get\".concat(options);\n buildOptionMethod(methodName, model, methodList, scheme);\n callInCreated(methodName, created);\n }\n }\n\n // 处理props\n if (scheme.props && scheme.props.props) {\n buildProps(scheme, propsList);\n }\n\n // 处理el-upload的action\n if (scheme.action && config.tag === 'el-upload') {\n uploadVarList.push(\"\".concat(scheme.__vModel__, \"Action: '\").concat(scheme.action, \"',\\n \").concat(scheme.__vModel__, \"fileList: [],\"));\n methodList.push(buildBeforeUpload(scheme));\n // 非自动上传时,生成手动上传的函数\n if (!scheme['auto-upload']) {\n methodList.push(buildSubmitUpload(scheme));\n }\n }\n\n // 构建子级组件属性\n if (config.children) {\n config.children.forEach(function (item) {\n buildAttributes(item, dataList, ruleList, optionsList, methodList, propsList, uploadVarList, created);\n });\n }\n}\n\n// 在Created调用函数\nfunction callInCreated(methodName, created) {\n created.push(\"this.\".concat(methodName, \"()\"));\n}
|