hz-zhhq-web/node_modules/.cache/babel-loader/d280e25519bed8fceac233f0ca9...

1 line
7.5 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":"E:\\hz-zhhq-web\\node_modules\\thread-loader\\dist\\cjs.js!E:\\hz-zhhq-web\\node_modules\\babel-loader\\lib\\index.js!E:\\hz-zhhq-web\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!E:\\hz-zhhq-web\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!E:\\hz-zhhq-web\\src\\views\\jurisdiction\\department\\popup\\addUpdatePop.vue?vue&type=script&lang=js","dependencies":[{"path":"E:\\hz-zhhq-web\\src\\views\\jurisdiction\\department\\popup\\addUpdatePop.vue","mtime":1737610069429},{"path":"E:\\hz-zhhq-web\\babel.config.js","mtime":1737610069371},{"path":"E:\\hz-zhhq-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"E:\\hz-zhhq-web\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"E:\\hz-zhhq-web\\node_modules\\babel-loader\\lib\\index.js","mtime":456789000000},{"path":"E:\\hz-zhhq-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"E:\\hz-zhhq-web\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.regexp.replace\";\nimport \"core-js/modules/es6.regexp.split\";\nimport \"core-js/modules/es6.function.name\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport { treeDataTranslate } from '@/utils';\nimport { deptSelect } from \"@/api/getdata\";\nexport default {\n props: [\"width\", \"dataForm\", \"title\", \"type\", \"disabled\"],\n data: function data() {\n var _this2 = this;\n var validateUrl = function validateUrl(rule, value, callback) {\n if ((_this2.dataForm.type === 1 || _this2.dataForm.type === 3) && !/\\S/.test(value)) {\n callback(new Error('菜单URL不能为空'));\n } else {\n callback();\n }\n };\n return {\n dialogVisible: true,\n typeList: ['菜单', '条件'],\n //'APP目录', 'APP菜单',\n menuList: [],\n dialogImageUrl: '',\n isDelImg: false,\n menuListTreeProps: {\n label: 'name',\n children: 'children'\n },\n dataRule: {\n name: [{\n required: true,\n message: '菜单名称不能为空',\n trigger: 'blur'\n }],\n parentName: [{\n required: false,\n message: '上级菜单不能为空',\n trigger: 'change'\n }],\n url: [{\n validator: validateUrl,\n trigger: 'blur'\n }]\n }\n };\n },\n mounted: function mounted() {\n this.selectMenu();\n // this.menuListTreeSetCurrentNode();\n },\n methods: {\n // 查询菜单下拉框\n selectMenu: function selectMenu() {\n var _this3 = this;\n var Content = {};\n deptSelect(Content).then(function (res) {\n if (res.returnCode == \"1\") {\n _this3.menuList = treeDataTranslate(res.returnData, 'id', 'parentId');\n }\n }).catch(function (err) {\n console.log(err);\n });\n },\n // 菜单树选中\n menuListTreeCurrentChangeHandle: function menuListTreeCurrentChangeHandle(data, node) {\n console.log(data);\n this.dataForm.parentId = data.id;\n this.dataForm.parentName = data.name;\n console.log(this.dataForm, '222222222222');\n this.$forceUpdate();\n },\n // 菜单树设置当前选中节点\n menuListTreeSetCurrentNode: function menuListTreeSetCurrentNode() {\n // debugger;\n // this.$refs.menuListTree.setCurrentKey(this.dataForm.parentCode)\n this.dataForm.parentName = (this.$refs.menuListTree.getCurrentNode() || {})['name'];\n },\n /*关闭弹窗 */handleClose: function handleClose() {\n var _this4 = this;\n this.dialogVisible = false;\n this.$emit(\"closeNewAlert\");\n setTimeout(function () {\n _this4.dialogVisible = true;\n });\n },\n /**提交 */submitForm: function submitForm() {\n var _this5 = this;\n this.$refs['dataForm'].validate(function (valid) {\n if (valid) {\n _this5.dataForm.isDelImg = _this5.isDelImg;\n _this5.$emit('sure', _this5.dataForm);\n }\n });\n },\n handlePictureCardPreview: function handlePictureCardPreview(file) {\n this.dialogImageUrl = file.url;\n this.dialogVisible = true;\n },\n delImg: function delImg() {\n this.dataForm.icon = '';\n this.isDelImg = true;\n },\n changeFile: function changeFile(options, fileList) {\n // console.log(1111)\n var that = this;\n // 获取文件对象\n var file = options.raw;\n //判断图片类型\n if (file.type == \"image/jpeg\" || file.type == \"image/png\" || file.type == \"image/JPG\") {\n var isJPG = true;\n } else {\n isJPG = false;\n }\n // 判断图片大小\n var isLt2M = file.size / 1024 / 1024 < 2;\n if (!isJPG) {\n this.$message.error(\"上传产品图片只能是 JPG/PNG/JPEG 格式!\");\n }\n if (!isLt2M) {\n this.$message.error(\"上传产品图片大小不能超过 2MB!\");\n }\n // 创建一个HTML5的FileReader对象\n var reader = new FileReader();\n //创建一个img对象\n var img = new Image();\n var filename = options.filename;\n if (file) {\n reader.readAsDataURL(file);\n }\n if (isJPG && isLt2M) {\n reader.onload = function (e) {\n var base64Str = reader.result.split(\",\")[1];\n var newUrl;\n img.src = e.target.result;\n if (file.size / 1024 < 20) {\n that.$set(that.dataForm, \"icon\", e.target.result);\n return;\n }\n // base64地址图片加载完毕后执行\n img.onload = function () {\n var _this = this;\n // 缩放图片需要的canvas也可以在DOM中直接定义canvas标签这样就能把压缩完的图片不转base64也能直接显示出来\n var canvas = document.createElement(\"canvas\");\n var context = canvas.getContext(\"2d\");\n var wid = img.width;\n var hei = img.height;\n // 最大尺寸限制\n\n var maxWidth = 60,\n maxHeight = 60;\n if (wid > maxWidth || hei > maxHeight) {\n if (wid / hei > maxWidth / maxHeight) {\n maxHeight = Math.round(maxWidth * (hei / wid));\n } else {\n maxWidth = Math.round(maxHeight * (wid / hei));\n }\n } else {\n maxWidth = wid;\n maxHeight = hei;\n }\n\n // canvas对图片进行缩放\n canvas.width = maxWidth;\n canvas.height = maxHeight;\n context.drawImage(img, 0, 0, maxWidth, maxHeight);\n newUrl = canvas.toDataURL(\"image/jpeg\");\n var str = newUrl.replace(\"data:image/png;base64,\", \"\");\n // 找到等号,把等号也去掉\n var equalIndex = str.indexOf(\"=\");\n if (str.indexOf(\"=\") > 0) {\n str = str.substring(0, equalIndex);\n }\n var strLength = str.length;\n var fileLength = parseInt(strLength - strLength / 8 * 2);\n var size = \"\";\n size = (fileLength / 1024).toFixed(2);\n console.log(size);\n that.isDelImg = false;\n that.$set(that.dataForm, \"icon\", newUrl);\n };\n };\n }\n }\n }\n};",null]}