management/front/dkha-web-sz-main/node_modules/.cache/vue-loader/86b5f99eb11b43a995d80bc3cba...

1 line
21 KiB
JSON
Raw Normal View History

2023-12-18 13:12:25 +08:00
{"remainingRequest":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\components\\public\\img-clip.vue?vue&type=script&lang=js&","dependencies":[{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\components\\public\\img-clip.vue","mtime":1614735254000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\babel-loader\\lib\\index.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 {\n\tVueCropper\n} from \"vue-cropper\";\n\nexport default {\n\tcomponents: {\n\t\tVueCropper\n\t},\n\tprops: {\n\t\tfolderName: {\n\t\t\ttype: String,\n\t\t\tdefault: \"student\"\n\t\t},\n\t\t// 裁剪区域宽度\n\t\tclipWidth: {\n\t\t\ttype: Number,\n\t\t\tdefault: 400\n\t\t},\n\t\t// 裁剪区域高度\n\t\tclipHeight: {\n\t\t\ttype: Number,\n\t\t\tdefault: 600\n\t\t},\n\t\t// 限制图片上传大小\n\t\tsize: {\n\t\t\ttype: Number,\n\t\t\tdefault: 0.4\n\t\t},\n\t\t// 初始化 显示图片路劲\n\t\tvalue: {\n\t\t\ttype: String,\n\t\t\tdefault: \"\"\n\t\t},\n\t\t// 固定比例裁剪\n\t\tfixedNumber: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [2, 3]\n\t\t}\n\t},\n\twatch: {\n\t\tvalue(val) {\n\t\t\t// 不为空 切不相等 更新\n\t\t\tif (val) {\n\t\t\t\tthis.viewUrl = val;\n\t\t\t} else {\n\t\t\t\tthis.viewUrl = \"\";\n\t\t\t}\n\t\t}\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tIEVisible: false,\n\t\t\tpreviewVisible: false, //预览图\n\t\t\tuploadLoading: false, //正在上传\n\t\t\tviewUrl: null, //裁剪图url\n\t\t\tclipVisible: false, //显示裁剪区域\n\t\t\toption: {\n\t\t\t\timg: \"\", //裁剪图片的地址\n\t\t\t\toutputType: \"jpg\", //生成的图片格式\n\t\t\t\toutputSize: 1, //图片质量0-1\n\t\t\t\tautoCrop: true, //默认生成截图框\n\t\t\t\t// autoCropWidth: 200, //默认生成截图框宽度\n\t\t\t\t// autoCropHeight: 200, //默认生成截图框高度\n\t\t\t\tfixed: true, //固定截图\n\t\t\t\t// fixedNumber: [1, 1], //固定截图比例\n\t\t\t\tfixedBox: true //固定截图框大小 不允许改变\n\t\t\t},\n\t\t\tfileName: \"\",\n\t\t\tuploadInfo: \"\"\n\t\t};\n\t},\n\tcreated() {\n\t\tthis.IEVersion();\n\t},\n\tmethods: {\n\t\tinit(fiveUrl) {\n\t\t\tthis.viewUrl = fiveUrl\n\t\t},\n\t\t// 选择图片\n\t\tchooseImg(e) {\n\t\t\tconst files = e.target.files;\n\t\t\tconst file = e.target.files[0];\n\n\t\t\tif (!file.name.includes(\".jpg\")) {\n\t\t\t\tthis.$message.warning(\"仅支持.jpg格式的图片\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// 默认限制20MB 以内的图片\n\t\t\tif (file.size > 1024 * 1024 * 20) {\n\t\t\t\tthis.$message.warning(\"请上传小于20MB的图片\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tlet formFile = new FormData();\n\t\t\tformFile.append(\"file\", file);\n\t\t\t// staff 职工 student 学生\n\t\t\tformFile.append(\"folderName\", this.folderName);\n\n\t\t\tthis.$http({\n\t\t\t\t\turl: window.SITE_CONFIG['apiURL'] + '/system/upload',\n\t\t\t\t\tmethod: \"post\",\n\t\t\t\t\tdata: formFile\n\t\t\t\t})\n\t\t\t\t.then(({\n\t\t\t\t\tdata: res\n\t\t\t\t}) => {\n\t\t\t\t\tif (res && res.code === 0) {\n\t\t\t\t\t\tthis.$message.success(\"原图上传成功\");\n\t\t\t\t\t\tsessionStorage.setItem(\"eightPic\", res.data.path)\n\t\t\t\t\t\t// 接下来原图处理成5寸门禁需要的\n\t\t\t\t\t\tthis.setOutputSize(file.size);\n\t\t\t\t\t\tthis.fileName = file.name;\n\t\t\t\t\t\tthis.option.img = this.getObjectURL(file);\n\t\t\t\t\t\