Files
tekelanew_acs/acs/nladmin-ui/node_modules/.cache/babel-loader/07085e3572298ba8a70f63d7ccf89c44.json
2024-12-05 09:33:18 +08:00

1 line
16 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"remainingRequest":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\babel-loader\\lib\\index.js!D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\src\\views\\system\\build\\index.vue?vue&type=script&lang=js","dependencies":[{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\src\\views\\system\\build\\index.vue","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\\cache-loader\\dist\\cjs.js","mtime":1732872824662},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\vue-loader\\lib\\index.js","mtime":1732872825835}],"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.default = void 0;\nrequire(\"core-js/modules/es6.object.keys\");\nrequire(\"core-js/modules/web.dom.iterable\");\nvar _typeof2 = _interopRequireDefault(require(\"D:/data/hanguodoushan/acs2/nladmin-ui/node_modules/@babel/runtime/helpers/typeof.js\"));\nvar _objectSpread2 = _interopRequireDefault(require(\"D:/data/hanguodoushan/acs2/nladmin-ui/node_modules/@babel/runtime/helpers/objectSpread2.js\"));\nrequire(\"core-js/modules/es6.function.name\");\nrequire(\"core-js/modules/es6.array.find\");\nrequire(\"core-js/modules/es6.array.find-index\");\nrequire(\"core-js/modules/es6.regexp.split\");\nrequire(\"core-js/modules/es6.regexp.replace\");\nvar _vuedraggable = _interopRequireDefault(require(\"vuedraggable\"));\nvar _throttleDebounce = require(\"throttle-debounce\");\nvar _fileSaver = require(\"file-saver\");\nvar _clipboard = _interopRequireDefault(require(\"clipboard\"));\nvar _render = _interopRequireDefault(require(\"@/views/system/build/render/render\"));\nvar _config = require(\"./generator/config\");\nvar _index = require(\"./utils/index\");\nvar _html = require(\"@/views/system/build/generator/html\");\nvar _js = require(\"@/views/system/build/generator/js\");\nvar _css = require(\"@/views/system/build/generator/css\");\nvar _db = require(\"./utils/db\");\nvar _drawingDefalut = _interopRequireDefault(require(\"./generator/drawingDefalut\"));\nvar _DraggableItem = _interopRequireDefault(require(\"@/views/system/build/components/DraggableItem\"));\nvar _RightPanel = _interopRequireDefault(require(\"@/views/system/build/components/RightPanel\"));\nvar _FormDrawer = _interopRequireDefault(require(\"@/views/system/build/components/FormDrawer\"));\nvar _JsonDrawer = _interopRequireDefault(require(\"@/views/system/build/components/JsonDrawer\"));\nvar _CodeTypeDialog = _interopRequireDefault(require(\"@/views/system/build/components/CodeTypeDialog\"));\nvar _loadBeautifier = _interopRequireDefault(require(\"./utils/loadBeautifier\"));\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n// 版本可能不同\n\nvar beautifier;\nvar emptyActiveData = {\n style: {},\n autosize: {}\n};\nvar oldActiveId;\nvar tempActiveData;\nvar drawingListInDB = (0, _db.getDrawingList)();\nvar formConfInDB = (0, _db.getFormConf)();\nvar idGlobal = (0, _db.getIdGlobal)();\nvar _default = exports.default = {\n components: {\n draggable: _vuedraggable.default,\n render: _render.default,\n FormDrawer: _FormDrawer.default,\n JsonDrawer: _JsonDrawer.default,\n RightPanel: _RightPanel.default,\n CodeTypeDialog: _CodeTypeDialog.default,\n DraggableItem: _DraggableItem.default\n },\n data: function data() {\n return {\n idGlobal: idGlobal,\n formConf: _config.formConf,\n inputComponents: _config.inputComponents,\n selectComponents: _config.selectComponents,\n layoutComponents: _config.layoutComponents,\n labelWidth: 100,\n drawingList: _drawingDefalut.default,\n drawingData: {},\n activeId: _drawingDefalut.default[0].formId,\n drawerVisible: false,\n formData: {},\n dialogVisible: false,\n jsonDrawerVisible: false,\n generateConf: null,\n showFileName: false,\n activeData: _drawingDefalut.default[0],\n saveDrawingListDebounce: (0, _throttleDebounce.debounce)(340, _db.saveDrawingList),\n saveIdGlobalDebounce: (0, _throttleDebounce.debounce)(340, _db.saveIdGlobal),\n leftComponents: [{\n title: '输入型组件',\n list: _config.inputComponents\n }, {\n title: '选择型组件',\n list: _config.selectComponents\n }, {\n title: '布局型组件',\n list: _config.layoutComponents\n }]\n };\n },\n computed: {},\n watch: {\n // eslint-disable-next-line func-names\n 'activeData.__config__.label': function activeData__config__Label(val, oldVal) {\n if (this.activeData.placeholder === undefined || !this.activeData.__config__.tag || oldActiveId !== this.activeId) {\n return;\n }\n this.activeData.placeholder = this.activeData.placeholder.replace(oldVal, '') + val;\n },\n activeId: {\n handler: function handler(val) {\n oldActiveId = val;\n },\n immediate: true\n },\n drawingList: {\n handler: function handler(val) {\n this.saveDrawingListDebounce(val);\n if (val.length === 0) this.idGlobal = 100;\n },\n deep: true\n },\n idGlobal: {\n handler: function handler(val) {\n this.saveIdGlobalDebounce(val);\n },\n immediate: true\n }\n },\n mounted: function mounted() {\n var _this = this;\n if (Array.isArray(drawingListInDB) && drawingListInDB.length > 0) {\n this.drawingList = drawingListInDB;\n } else {\n this.drawingList = _drawingDefalut.default;\n }\n this.activeFormItem(this.drawingList[0]);\n if (formConfInDB) {\n this.formConf = formConfInDB;\n }\n (0, _loadBeautifier.default)(function (btf) {\n beautifier = btf;\n });\n var clipboard = new _clipboard.default('#copyNode', {\n text: function text(trigger) {\n var codeStr = _this.generateCode();\n _this.$notify({\n title: '成功',\n message: '代码已复制到剪切板,可粘贴。',\n type: 'success'\n });\n return codeStr;\n }\n });\n clipboard.on('error', function (e) {\n _this.$message.error('代码复制失败');\n });\n },\n methods: {\n setObjectValueReduce: function setObjectValueReduce(obj, strKeys, data) {\n var arr = strKeys.split('.');\n arr.reduce(function (pre, item, i) {\n if (arr.length === i + 1) {\n pre[item] = data;\n } else if (!(0, _index.isObjectObject)(pre[item])) {\n pre[item] = {};\n }\n return pre[item];\n }, obj);\n },\n setRespData: function setRespData(component, resp) {\n var _component$__config__ = component.__config__,\n dataPath = _component$__config__.dataPath,\n renderKey = _component$__config__.renderKey,\n dataConsumer = _component$__config__.dataConsumer;\n if (!dataPath || !dataConsumer) return;\n var respData = dataPath.split('.').reduce(function (pre, item) {\n return pre[item];\n }, resp);\n\n // 将请求回来的数据,赋值到指定属性。\n // 以el-tabel为例根据Element文档应该将数据赋值给el-tabel的data属性所以dataConsumer的值应为'data';\n // 此时赋值代码可写成 component[dataConsumer] = respData\n // 但为支持更深层级的赋值dataConsumer的值为'options.data',使用setObjectValueReduce\n this.setObjectValueReduce(component, dataConsumer, respData);\n var i = this.drawingList.findIndex(function (item) {\n return item.__config__.renderKey === renderKey;\n });\n if (i > -1) this.$set(this.drawingList, i, component);\n },\n fetchData: function fetchData(component) {\n var _this2 = this;\n var _component$__config__2 = component.__config__,\n dataType = _component$__config__2.dataType,\n method = _component$__config__2.method,\n url = _component$__config__2.url;\n if (dataType === 'dynamic' && method && url) {\n this.setLoading(component, true);\n this.$axios({\n method: method,\n url: url\n }).then(function (resp) {\n _this2.setLoading(component, false);\n _this2.setRespData(component, resp.data);\n });\n }\n },\n setLoading: function setLoading(component, val) {\n var directives = component.directives;\n if (Array.isArray(directives)) {\n var t = directives.find(function (d) {\n return d.name === 'loading';\n });\n if (t) t.value = val;\n }\n },\n activeFormItem: function activeFormItem(currentItem) {\n this.activeData = currentItem;\n this.activeId = currentItem.__config__.formId;\n },\n onEnd: function onEnd(obj) {\n if (obj.from !== obj.to) {\n this.fetchData(tempActiveData);\n this.activeData = tempActiveData;\n this.activeId = this.idGlobal;\n }\n },\n addComponent: function addComponent(item) {\n var clone = this.cloneComponent(item);\n this.fetchData(clone);\n this.drawingList.push(clone);\n this.activeFormItem(clone);\n },\n cloneComponent: function cloneComponent(origin) {\n var clone = (0, _index.deepClone)(origin);\n var config = clone.__config__;\n config.span = this.formConf.span; // 生成代码时会根据span做精简判断\n this.createIdAndKey(clone);\n clone.placeholder !== undefined && (clone.placeholder += config.label);\n tempActiveData = clone;\n return tempActiveData;\n },\n createIdAndKey: function createIdAndKey(item) {\n var _this3 = this;\n var config = item.__config__;\n config.formId = ++this.idGlobal;\n config.renderKey = \"\".concat(config.formId).concat(+new Date()); // 改变renderKey后可以实现强制更新组件\n if (config.layout === 'colFormItem') {\n item.__vModel__ = \"field\".concat(this.idGlobal);\n } else if (config.layout === 'rowFormItem') {\n config.componentName = \"row\".concat(this.idGlobal);\n !Array.isArray(config.children) && (config.children = []);\n delete config.label; // rowFormItem无需配置label属性\n }\n if (Array.isArray(config.children)) {\n config.children = config.children.map(function (childItem) {\n return _this3.createIdAndKey(childItem);\n });\n }\n return item;\n },\n AssembleFormData: function AssembleFormData() {\n this.formData = (0, _objectSpread2.default)({\n fields: (0, _index.deepClone)(this.drawingList)\n }, this.formConf);\n },\n generate: function generate(data) {\n // 设置要运行的方法\n var func = this[\"exec\".concat((0, _index.titleCase)(this.operationType))];\n this.generateConf = data;\n // 运行方法\n func && func(data);\n },\n execRun: function execRun(data) {\n this.AssembleFormData();\n this.drawerVisible = true;\n },\n execDownload: function execDownload(data) {\n // console.log(data)\n var codeStr = this.generateCode();\n var blob = new Blob([codeStr], {\n type: 'text/plain;charset=utf-8'\n });\n (0, _fileSaver.saveAs)(blob, data.fileName);\n },\n execCopy: function execCopy(data) {\n document.getElementById('copyNode').click();\n },\n empty: function empty() {\n var _this4 = this;\n this.$confirm('确定要清空所有组件吗?', '提示', {\n type: 'warning'\n }).then(function () {\n _this4.drawingList = [];\n _this4.idGlobal = 100;\n }).catch(function () {});\n },\n drawingItemCopy: function drawingItemCopy(item, list) {\n var clone = (0, _index.deepClone)(item);\n clone = this.createIdAndKey(clone);\n list.push(clone);\n this.activeFormItem(clone);\n },\n drawingItemDelete: function drawingItemDelete(index, list) {\n var _this5 = this;\n list.splice(index, 1);\n this.$nextTick(function () {\n var len = _this5.drawingList.length;\n if (len) {\n _this5.activeFormItem(_this5.drawingList[len - 1]);\n }\n });\n },\n generateCode: function generateCode() {\n var type = this.generateConf.type;\n this.AssembleFormData();\n var script = (0, _html.vueScript)((0, _js.makeUpJs)(this.formData, type));\n var html = (0, _html.vueTemplate)((0, _html.makeUpHtml)(this.formData, type));\n var css = (0, _html.cssStyle)((0, _css.makeUpCss)(this.formData));\n return beautifier.html(html + script + css, _index.beautifierConf.html);\n },\n showJson: function showJson() {\n this.AssembleFormData(); // 拷贝值到this.formData\n this.jsonDrawerVisible = true;\n },\n download: function download() {\n this.dialogVisible = true;\n this.showFileName = true;\n this.operationType = 'download';\n },\n run: function run() {\n this.dialogVisible = true;\n this.showFileName = false;\n this.operationType = 'run';\n },\n copy: function copy() {\n this.dialogVisible = true;\n this.showFileName = false;\n this.operationType = 'copy';\n },\n tagChange: function tagChange(newTag) {\n var _this6 = this;\n newTag = this.cloneComponent(newTag);\n var config = newTag.__config__;\n newTag.__vModel__ = this.activeData.__vModel__;\n config.formId = this.activeId;\n config.span = this.activeData.__config__.span;\n this.activeData.__config__.tag = config.tag;\n this.activeData.__config__.tagIcon = config.tagIcon;\n this.activeData.__config__.document = config.document;\n if ((0, _typeof2.default)(this.activeData.__config__.defaultValue) === (0, _typeof2.default)(config.defaultValue)) {\n config.defaultValue = this.activeData.__config__.defaultValue;\n }\n Object.keys(newTag).forEach(function (key) {\n if (_this6.activeData[key] !== undefined) {\n newTag[key] = _this6.activeData[key];\n }\n });\n this.activeData = newTag;\n this.updateDrawingList(newTag, this.drawingList);\n },\n updateDrawingList: function updateDrawingList(newTag, list) {\n var _this7 = this;\n var index = list.findIndex(function (item) {\n return item.__config__.formId === _this7.activeId;\n });\n if (index > -1) {\n list.splice(index, 1, newTag);\n } else {\n list.forEach(function (item) {\n if (Array.isArray(item.__config__.children)) _this7.updateDrawingList(newTag, item.__config__.children);\n });\n }\n },\n refreshJson: function refreshJson(data) {\n this.drawingList = (0, _index.deepClone)(data.fields);\n delete data.fields;\n this.formConf = data;\n }\n }\n};",null]}