| 1 |
- {"remainingRequest":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\node_modules\\babel-loader\\lib\\index.js!D:\\HTC\\program\\善行少年\\security-enterprise-admin\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\HTC\\program\\善行少年\\security-enterprise-admin\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\HTC\\program\\善行少年\\security-enterprise-admin\\src\\views\\modules\\oss\\oss-upload.vue?vue&type=script&lang=js","dependencies":[{"path":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\src\\views\\modules\\oss\\oss-upload.vue","mtime":1581948666000},{"path":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\babel.config.js","mtime":1581948662000},{"path":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\node_modules\\babel-loader\\lib\\index.js","mtime":456789000000},{"path":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import Cookies from 'js-cookie';\nexport default {\n data: function data() {\n return {\n visible: false,\n url: '',\n num: 0,\n fileList: []\n };\n },\n methods: {\n init: function init() {\n this.visible = true;\n this.url = \"\".concat(window.SITE_CONFIG['apiURL'], \"/sys/oss/upload?token=\").concat(Cookies.get('token'));\n this.num = 0;\n this.fileList = [];\n },\n // 上传之前\n beforeUploadHandle: function beforeUploadHandle(file) {\n if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif') {\n this.$message.error(this.$t('upload.tip', {\n 'format': 'jpg、png、gif'\n }));\n return false;\n }\n this.num++;\n },\n // 上传成功\n successHandle: function successHandle(res, file, fileList) {\n var _this = this;\n if (res.code !== 0) {\n return this.$message.error(res.msg);\n }\n this.fileList = fileList;\n this.num--;\n if (this.num === 0) {\n this.$message({\n message: this.$t('prompt.success'),\n type: 'success',\n duration: 500,\n onClose: function onClose() {\n _this.visible = false;\n _this.$emit('refreshDataList');\n }\n });\n }\n }\n }\n};",{"version":3,"names":["Cookies","data","visible","url","num","fileList","methods","init","concat","window","SITE_CONFIG","get","beforeUploadHandle","file","type","$message","error","$t","successHandle","res","_this","code","msg","message","duration","onClose","$emit"],"sources":["src/views/modules/oss/oss-upload.vue"],"sourcesContent":["<template>\r\n <el-dialog :visible.sync=\"visible\" :title=\"$t('oss.upload')\" :close-on-click-modal=\"false\" :close-on-press-escape=\"false\">\r\n <el-upload\r\n :action=\"url\"\r\n :file-list=\"fileList\"\r\n drag\r\n multiple\r\n :before-upload=\"beforeUploadHandle\"\r\n :on-success=\"successHandle\"\r\n class=\"text-center\">\r\n <i class=\"el-icon-upload\"></i>\r\n <div class=\"el-upload__text\" v-html=\"$t('upload.text')\"></div>\r\n <div class=\"el-upload__tip\" slot=\"tip\">{{ $t('upload.tip', { 'format': 'jpg、png、gif' }) }}</div>\r\n </el-upload>\r\n </el-dialog>\r\n</template>\r\n\r\n<script>\r\nimport Cookies from 'js-cookie'\r\nexport default {\r\n data () {\r\n return {\r\n visible: false,\r\n url: '',\r\n num: 0,\r\n fileList: []\r\n }\r\n },\r\n methods: {\r\n init () {\r\n this.visible = true\r\n this.url = `${window.SITE_CONFIG['apiURL']}/sys/oss/upload?token=${Cookies.get('token')}`\r\n this.num = 0\r\n this.fileList = []\r\n },\r\n // 上传之前\r\n beforeUploadHandle (file) {\r\n if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif') {\r\n this.$message.error(this.$t('upload.tip', { 'format': 'jpg、png、gif' }))\r\n return false\r\n }\r\n this.num++\r\n },\r\n // 上传成功\r\n successHandle (res, file, fileList) {\r\n if (res.code !== 0) {\r\n return this.$message.error(res.msg)\r\n }\r\n this.fileList = fileList\r\n this.num--\r\n if (this.num === 0) {\r\n this.$message({\r\n message: this.$t('prompt.success'),\r\n type: 'success',\r\n duration: 500,\r\n onClose: () => {\r\n this.visible = false\r\n this.$emit('refreshDataList')\r\n }\r\n })\r\n }\r\n }\r\n }\r\n}\r\n</script>\r\n"],"mappings":"AAkBA,OAAAA,OAAA;AACA;EACAC,IAAA,WAAAA,KAAA;IACA;MACAC,OAAA;MACAC,GAAA;MACAC,GAAA;MACAC,QAAA;IACA;EACA;EACAC,OAAA;IACAC,IAAA,WAAAA,KAAA;MACA,KAAAL,OAAA;MACA,KAAAC,GAAA,MAAAK,MAAA,CAAAC,MAAA,CAAAC,WAAA,sCAAAF,MAAA,CAAAR,OAAA,CAAAW,GAAA;MACA,KAAAP,GAAA;MACA,KAAAC,QAAA;IACA;IACA;IACAO,kBAAA,WAAAA,mBAAAC,IAAA;MACA,IAAAA,IAAA,CAAAC,IAAA,oBAAAD,IAAA,CAAAC,IAAA,qBAAAD,IAAA,CAAAC,IAAA,oBAAAD,IAAA,CAAAC,IAAA;QACA,KAAAC,QAAA,CAAAC,KAAA,MAAAC,EAAA;UAAA;QAAA;QACA;MACA;MACA,KAAAb,GAAA;IACA;IACA;IACAc,aAAA,WAAAA,cAAAC,GAAA,EAAAN,IAAA,EAAAR,QAAA;MAAA,IAAAe,KAAA;MACA,IAAAD,GAAA,CAAAE,IAAA;QACA,YAAAN,QAAA,CAAAC,KAAA,CAAAG,GAAA,CAAAG,GAAA;MACA;MACA,KAAAjB,QAAA,GAAAA,QAAA;MACA,KAAAD,GAAA;MACA,SAAAA,GAAA;QACA,KAAAW,QAAA;UACAQ,OAAA,OAAAN,EAAA;UACAH,IAAA;UACAU,QAAA;UACAC,OAAA,WAAAA,QAAA;YACAL,KAAA,CAAAlB,OAAA;YACAkB,KAAA,CAAAM,KAAA;UACA;QACA;MACA;IACA;EACA;AACA","ignoreList":[]}]}
|