management/front/dkha-web-sz-main/node_modules/.cache/vue-loader/440a70b0e3aec472d5d1a032907...

1 line
7.8 KiB
JSON

{"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\\upload-excel-or-img.vue?vue&type=script&lang=js&","dependencies":[{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\components\\public\\upload-excel-or-img.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\nimport Cookies from 'js-cookie'\nexport default {\n\tprops: {\n\t\taccept: {\n\t\t\ttype: String,\n\t\t\tdefault: \"application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n\t\t},\n\t\tuploadUrl: {\n\t\t\ttype: String,\n\t\t\tdefault: null\n\t\t},\n\t\ttitle: {\n\t\t\ttype: String,\n\t\t\tdefault: \"导入信息\"\n\t\t},\n\t\ttips: {\n\t\t\ttype: String,\n\t\t\tdefault: \"只能上传excel文件\"\n\t\t},\n\t\ttemplateUrl: {\n\t\t\ttype: String,\n\t\t\tdefault: null\n\t\t}\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tdialogVisible: false,\n\t\t\tfileList: [],\n\t\t\tuploadHeaders: {},\n\t\t\tcount:0,\n\t\t\terrorList:[],\n\t\t\tbaseUrl: window.SITE_CONFIG['apiURL']\n\t\t}\n\t},\n\tcreated() {\n\t\tthis.uploadHeaders = {\n\t\t\tAuthorization: 'Bearer ' + Cookies.get('access_token') || ''\n\t\t}\n\t},\n\tmethods: {\n\t\tinit() {\n\t\t\tthis.dialogVisible = true;\n\t\t\t// this.$nextTick(()=>{\n\t\t\t// this.$refs['uploadBtn'].$el.click();\n\t\t\t// })\n\t\t},\n\t\tbeforeUpload(file){\n\t\t\tthis.count++;\n\t\t\treturn true\n\t\t},\n\t\thandleSuccess(res) {\n\t\t\tthis.count--;\n\t\t\tif (res.code != 0) {\n\t\t\t\t// this.$message({\n\t\t\t\t// \ttype: \"error\",\n\t\t\t\t// \tshowClose: true,\n\t\t\t\t// \tduration: 0,\n\t\t\t\t// \tmessage: res.msg\n\t\t\t\t// })\n\t\t\t\tthis.errorList.push(res.msg)\n\t\t\t} \n\t\t\t// 上传完后提示 上传完成信息\n\t\t\tif(this.count==0){\n\t\t\t\tif(this.errorList.length==0){\n\t\t\t\t\tthis.$message({\n\t\t\t\t\t\ttype:\"success\",\n\t\t\t\t\t\tmessage:\"上传完成\"\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t// for(let i=0;i<this.errorList.length;i++){\n\t\t\t\t\t// \tthis.$message({\n\t\t\t\t\t// \t\ttype: \"error\",\n\t\t\t\t\t// \t\tshowClose: true,\n\t\t\t\t\t// \t\tduration: 0,\n\t\t\t\t\t// \t\tmessage: this.errorList[i]\n\t\t\t\t\t// \t})\n\t\t\t\t\t// }\n\t\t\t\t\t this.$notify({\n\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\ttitle: '上传失败',\n\t\t\t\t\t\tdangerouslyUseHTMLString:true,\n\t\t\t\t\t\tmessage: this.errorList.join(\"<br>\"),\n\t\t\t\t\t\tduration: 0\n\t\t\t\t\t});\n\t\t\t\t\t// 置空错误列表\n\t\t\t\t\tthis.errorList=[]\n\t\t\t\t}\n\n\t\t\t}\n\t\t},\n\t\tclearFileList(){\n\t\t\tthis.$refs['upload'].clearFiles();\n\t\t\tif(this.$parent.$parent.search){\n\t\t\t\tthis.$parent.$parent.search()\n\t\t\t}\n\t\t\telse{\n\t\t\t\tthis.$parent.$parent.resetForm(\"ruleForm\")\n\t\t\t}\n\t\t}\n\t}\n}\n",{"version":3,"sources":["upload-excel-or-img.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"upload-excel-or-img.vue","sourceRoot":"src/components/public","sourcesContent":["<template>\n <el-dialog\n :title=\"title\"\n :visible.sync=\"dialogVisible\"\n width=\"700px\"\n :close-on-click-modal=\"false\"\n @close=\"clearFileList\"\n >\n <div>\n <el-upload\n ref=\"upload\"\n class=\"upload-demo\"\n :accept=\"accept\"\n :action=\"baseUrl+uploadUrl\"\n :headers=\"uploadHeaders\"\n :on-success=\"handleSuccess\"\n\t\t:before-upload=\"beforeUpload\"\n multiple\n :file-list=\"fileList\"\n >\n <el-button size=\"small\" type=\"primary\" ref=\"uploadBtn\">点击上传</el-button>\n <div slot=\"tip\" class=\"el-upload__tip\">\n {{tips}}\n <a v-if=\"templateUrl\" target=\"_blank\" download :href=\"templateUrl\">下载模板</a>\n </div>\n </el-upload>\n </div>\n </el-dialog>\n</template>\n<script>\n\timport Cookies from 'js-cookie'\n\texport default {\n\t\tprops: {\n\t\t\taccept: {\n\t\t\t\ttype: String,\n\t\t\t\tdefault: \"application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n\t\t\t},\n\t\t\tuploadUrl: {\n\t\t\t\ttype: String,\n\t\t\t\tdefault: null\n\t\t\t},\n\t\t\ttitle: {\n\t\t\t\ttype: String,\n\t\t\t\tdefault: \"导入信息\"\n\t\t\t},\n\t\t\ttips: {\n\t\t\t\ttype: String,\n\t\t\t\tdefault: \"只能上传excel文件\"\n\t\t\t},\n\t\t\ttemplateUrl: {\n\t\t\t\ttype: String,\n\t\t\t\tdefault: null\n\t\t\t}\n\t\t},\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\tdialogVisible: false,\n\t\t\t\tfileList: [],\n\t\t\t\tuploadHeaders: {},\n\t\t\t\tcount:0,\n\t\t\t\terrorList:[],\n\t\t\t\tbaseUrl: window.SITE_CONFIG['apiURL']\n\t\t\t}\n\t\t},\n\t\tcreated() {\n\t\t\tthis.uploadHeaders = {\n\t\t\t\tAuthorization: 'Bearer ' + Cookies.get('access_token') || ''\n\t\t\t}\n\t\t},\n\t\tmethods: {\n\t\t\tinit() {\n\t\t\t\tthis.dialogVisible = true;\n\t\t\t\t// this.$nextTick(()=>{\n\t\t\t\t// this.$refs['uploadBtn'].$el.click();\n\t\t\t\t// })\n\t\t\t},\n\t\t\tbeforeUpload(file){\n\t\t\t\tthis.count++;\n\t\t\t\treturn true\n\t\t\t},\n\t\t\thandleSuccess(res) {\n\t\t\t\tthis.count--;\n\t\t\t\tif (res.code != 0) {\n\t\t\t\t\t// this.$message({\n\t\t\t\t\t// \ttype: \"error\",\n\t\t\t\t\t// \tshowClose: true,\n\t\t\t\t\t// \tduration: 0,\n\t\t\t\t\t// \tmessage: res.msg\n\t\t\t\t\t// })\n\t\t\t\t\tthis.errorList.push(res.msg)\n\t\t\t\t} \n\t\t\t\t// 上传完后提示 上传完成信息\n\t\t\t\tif(this.count==0){\n\t\t\t\t\tif(this.errorList.length==0){\n\t\t\t\t\t\tthis.$message({\n\t\t\t\t\t\t\ttype:\"success\",\n\t\t\t\t\t\t\tmessage:\"上传完成\"\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t// for(let i=0;i<this.errorList.length;i++){\n\t\t\t\t\t\t// \tthis.$message({\n\t\t\t\t\t\t// \t\ttype: \"error\",\n\t\t\t\t\t\t// \t\tshowClose: true,\n\t\t\t\t\t\t// \t\tduration: 0,\n\t\t\t\t\t\t// \t\tmessage: this.errorList[i]\n\t\t\t\t\t\t// \t})\n\t\t\t\t\t\t// }\n\t\t\t\t\t\t this.$notify({\n\t\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\t\ttitle: '上传失败',\n\t\t\t\t\t\t\tdangerouslyUseHTMLString:true,\n\t\t\t\t\t\t\tmessage: this.errorList.join(\"<br>\"),\n\t\t\t\t\t\t\tduration: 0\n\t\t\t\t\t\t});\n\t\t\t\t\t\t// 置空错误列表\n\t\t\t\t\t\tthis.errorList=[]\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t},\n\t\t\tclearFileList(){\n\t\t\t\tthis.$refs['upload'].clearFiles();\n\t\t\t\tif(this.$parent.$parent.search){\n\t\t\t\t\tthis.$parent.$parent.search()\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tthis.$parent.$parent.resetForm(\"ruleForm\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n</script>\n<style lang=\"scss\" scoped>\n.el-dialog {\n .el-row {\n color: #fff;\n line-height: 35px;\n\n .el-col-3 {\n text-align: right;\n }\n\n .student-img {\n width: 106px;\n height: 150px;\n }\n }\n}\n</style>\n"]}]}