forked from zhurui/management
1 line
9.4 KiB
JSON
1 line
9.4 KiB
JSON
{"remainingRequest":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\babel-loader\\lib\\index.js!C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!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":["import \"core-js/modules/es6.regexp.search\";\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 props: {\n accept: {\n type: String,\n default: \"application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n },\n uploadUrl: {\n type: String,\n default: null\n },\n title: {\n type: String,\n default: \"导入信息\"\n },\n tips: {\n type: String,\n default: \"只能上传excel文件\"\n },\n templateUrl: {\n type: String,\n default: null\n }\n },\n data: function data() {\n return {\n dialogVisible: false,\n fileList: [],\n uploadHeaders: {},\n count: 0,\n errorList: [],\n baseUrl: window.SITE_CONFIG['apiURL']\n };\n },\n created: function created() {\n this.uploadHeaders = {\n Authorization: 'Bearer ' + Cookies.get('access_token') || ''\n };\n },\n methods: {\n init: function init() {\n this.dialogVisible = true; // this.$nextTick(()=>{\n // this.$refs['uploadBtn'].$el.click();\n // })\n },\n beforeUpload: function beforeUpload(file) {\n this.count++;\n return true;\n },\n handleSuccess: function handleSuccess(res) {\n this.count--;\n\n if (res.code != 0) {\n // this.$message({\n // \ttype: \"error\",\n // \tshowClose: true,\n // \tduration: 0,\n // \tmessage: res.msg\n // })\n this.errorList.push(res.msg);\n } // 上传完后提示 上传完成信息\n\n\n if (this.count == 0) {\n if (this.errorList.length == 0) {\n this.$message({\n type: \"success\",\n message: \"上传完成\"\n });\n } else {\n // for(let i=0;i<this.errorList.length;i++){\n // \tthis.$message({\n // \t\ttype: \"error\",\n // \t\tshowClose: true,\n // \t\tduration: 0,\n // \t\tmessage: this.errorList[i]\n // \t})\n // }\n this.$notify({\n type: \"error\",\n title: '上传失败',\n dangerouslyUseHTMLString: true,\n message: this.errorList.join(\"<br>\"),\n duration: 0\n }); // 置空错误列表\n\n this.errorList = [];\n }\n }\n },\n clearFileList: function clearFileList() {\n this.$refs['upload'].clearFiles();\n\n if (this.$parent.$parent.search) {\n this.$parent.$parent.search();\n } else {\n this.$parent.$parent.resetForm(\"ruleForm\");\n }\n }\n }\n};",{"version":3,"sources":["upload-excel-or-img.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,OAAA,OAAA,MAAA,WAAA;AACA,eAAA;AACA,EAAA,KAAA,EAAA;AACA,IAAA,MAAA,EAAA;AACA,MAAA,IAAA,EAAA,MADA;AAEA,MAAA,OAAA,EAAA;AAFA,KADA;AAKA,IAAA,SAAA,EAAA;AACA,MAAA,IAAA,EAAA,MADA;AAEA,MAAA,OAAA,EAAA;AAFA,KALA;AASA,IAAA,KAAA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A;AAIA,SALA,MAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAA,OAAA,CAAA;AACA,YAAA,IAAA,EAAA,OADA;AAEA,YAAA,KAAA,EAAA,MAFA;AAGA,YAAA,wBAAA,EAAA,IAHA;AAIA,YAAA,OAAA,EAAA,KAAA,SAAA,CAAA,IAAA,CAAA,MAAA,CAJA;AAKA,YAAA,QAAA,EAAA;AALA,WAAA,EATA,CAgBA;;AACA,eAAA,SAAA,GAAA,EAAA;AACA;AAEA;AACA,KAnDA;AAoDA,IAAA,aApDA,2BAoDA;AACA,WAAA,KAAA,CAAA,QAAA,EAAA,UAAA;;AACA,UAAA,KAAA,OAAA,CAAA,OAAA,CAAA,MAAA,EAAA;AACA,aAAA,OAAA,CAAA,OAAA,CAAA,MAAA;AACA,OAFA,MAGA;AACA,aAAA,OAAA,CAAA,OAAA,CAAA,SAAA,CAAA,UAAA;AACA;AACA;AA5DA;AAtCA,CAAA","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"],"sourceRoot":"src/components/public"}]} |