6881229.js.map 8.9 KB

1
  1. {"version":3,"sources":["webpack:///./components/ImageUpload.vue?997d","webpack:///./components/ImageUpload.vue?7168","webpack:///./components/ImageUpload.vue?1e96","webpack:///./components/ImageUpload.vue","webpack:///./components/ImageUpload.vue?a75d"],"names":["module","exports","name","components","draggable","props","list","type","Array","default","max","Number","disablePreview","Boolean","width","String","height","data","imageList","loading","uploadPercent","imageDialogVisible","imageUrl","computed","fulled","watch","this","JSON","parse","stringify","mounted","updateList","methods","handleUpload","file","fileList","_this","status","interval","setInterval","clearInterval","formData","FormData","forEach","append","raw","$axios","post","then","response","result","code","push","url","uid","$message","message","catch","error","console","log","msg","finally","handleRemove","index","splice","handlePictureCardPreview","$emit","end","component","_vm","_c","_self","staticClass","attrs","on","model","value","callback","$$v","expression","_l","item","key","style","_v","_e","$event","directives","rawName","staticStyle","slice","length","class","hide","ref"],"mappings":"8EACAA,EAAOC,QAAU,CAAC,C,mCCDlB,M,mGCAwP,ECIzO,CACbC,KAAM,cACNC,WAAY,CACVC,U,OAAAA,GAEFC,MAAO,CACLC,KAAM,CACJC,KAAMC,MACNC,QAAS,WAAF,MAAQ,EAAE,GAEnBC,IAAK,CACHH,KAAMI,OACNF,QAAS,IAEXG,eAAgB,CACdL,KAAMM,QACNJ,SAAS,GAEXK,MAAO,CACLP,KAAMQ,OACNN,QAAS,SAEXO,OAAQ,CACNT,KAAMQ,OACNN,QAAS,UAGbQ,KAAI,WACF,MAAO,CAELC,UAAW,GACXC,SAAS,EACTC,cAAe,EACfC,oBAAoB,EAEpBC,SAAU,GAEd,EACAC,SAAU,CACRC,OAAM,WACJ,OAAO,CACT,GAEFC,MAAO,CACLnB,KAAI,WACFoB,KAAKR,UAAYS,KAAKC,MAAMD,KAAKE,UAAUH,KAAKpB,MAClD,GAEFwB,QAAO,WACLJ,KAAKK,YACP,EACAC,QAAS,CACPC,aAAY,SAACC,EAAMC,GAAU,IAAAC,EAAA,KAG3B,GAFAV,KAAKS,SAAW,GAEI,UAAhB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,CAACwB,IAAI,gBAAgBtB,YAAY,qBAAqBC,MAAM,CAAC,UAAW,EAAK,MAAQJ,EAAI5D,IAAI,OAAS,GAAG,KAAO,GAAG,OAAS,kBAAkB,YAAY,eAAe,YAAY4D,EAAIpD,UAAU,kBAAiB,EAAM,eAAc,EAAM,YAAYoD,EAAIP,aAAa,aAAaO,EAAIJ,yBAAyB,YAAY,SAAChC,EAAMC,GAC1oDmC,EAAIrC,aAAaC,EAAMC,EACzB,IAAI,CAACoC,EAAG,IAAI,CAACE,YAAY,yCAAyC,IAAI,GAAGH,EAAIe,GAAG,KAAKd,EAAG,YAAY,CAACG,MAAM,CAAC,QAAUJ,EAAIjD,oBAAoBsD,GAAG,CAAC,iBAAiB,SAASY,GAAQjB,EAAIjD,mBAAmBkE,CAAM,IAAI,CAAChB,EAAG,MAAM,CAACG,MAAM,CAAC,MAAQ,OAAO,IAAMJ,EAAIhD,SAAS,IAAM,SAAS,EAClS,GACsB,ICQpB,EACA,KACA,WACA,MAIa,UAAA+C,U","file":"6881229.js","sourcesContent":["// extracted by extract-css-chunks-webpack-plugin\nmodule.exports = {};","export * from \"-!../node_modules/extract-css-chunks-webpack-plugin/dist/loader.js??ref--7-oneOf-1-0!../node_modules/css-loader/dist/cjs.js??ref--7-oneOf-1-1!../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../node_modules/postcss-loader/dist/cjs.js??ref--7-oneOf-1-2!../node_modules/sass-loader/dist/cjs.js??ref--7-oneOf-1-3!../node_modules/@nuxt/components/dist/loader.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./ImageUpload.vue?vue&type=style&index=0&id=596f82bc&prod&lang=scss&scoped=true\"","import mod from \"-!../node_modules/babel-loader/lib/index.js??ref--2-0!../node_modules/@nuxt/components/dist/loader.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./ImageUpload.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../node_modules/babel-loader/lib/index.js??ref--2-0!../node_modules/@nuxt/components/dist/loader.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./ImageUpload.vue?vue&type=script&lang=js\"","\nimport draggable from 'vuedraggable'\n// import { common } from '@/api'\n\nexport default {\n name: 'ImageUpload',\n components: {\n draggable,\n },\n props: {\n list: {\n type: Array,\n default: () => [],\n },\n max: {\n type: Number,\n default: 16,\n },\n disablePreview: {\n type: Boolean,\n default: false,\n },\n width: {\n type: String,\n default: '150px',\n },\n height: {\n type: String,\n default: '150px',\n },\n },\n data() {\n return {\n // 组件内部数据.\n imageList: [],\n loading: false,\n uploadPercent: 0,\n imageDialogVisible: false,\n // 预览大图的url, 每次点击都会更新\n imageUrl: '',\n }\n },\n computed: {\n fulled() {\n return 0\n },\n },\n watch: {\n list() {\n this.imageList = JSON.parse(JSON.stringify(this.list))\n },\n },\n mounted(){\n this.updateList()\n },\n methods: {\n handleUpload(file, fileList) {\n this.fileList = []\n\n if (file.status === 'ready') {\n this.loading = true\n const interval = setInterval(() => {\n if (this.uploadPercent >= 99) {\n clearInterval(interval)\n return\n }\n this.uploadPercent += 1 // 进度条进度\n }, 100)\n }\n\n const formData = new FormData()\n fileList.forEach((file) => {\n formData.append('file', file.raw)\n })\n formData.append('type', 1)\n this.$axios\n .post(`/uk-api/user_base/imagesUpload`,formData)\n .then((response) => {\n if (response.result.code === 200) {\n this.imageList.push({\n url: response.result.data,\n uid: file.uid,\n })\n\n this.updateList()\n return\n }\n this.$message({\n message: response.result.message,\n type: 'warning',\n })\n })\n .catch((error) => {\n console.log(error, 'component upload image error')\n this.$message.error(error.response.data.msg)\n })\n .finally(() => {\n this.loading = false\n // 进度条恢复到初始状态\n this.uploadPercent = 0\n })\n },\n handleRemove(index) {\n this.imageList.splice(index, 1)\n this.updateList()\n },\n handlePictureCardPreview(file) {\n this.imageUrl = file.url\n this.imageDialogVisible = true\n },\n // 每次更新imageList后手动更新父组件的数据, 不能用watch自动更新, 因为同时要watch prop值更新iamgeList, 同时watch会死循环.\n // 直接把prop数据绑定到dragable 和 el-upload的话vue和eslint会报错, 也可能造成调试困难\n updateList() {\n this.$emit('update:list', JSON.parse(JSON.stringify(this.imageList)))\n },\n end() {\n this.updateList()\n },\n },\n}\n","import { render, staticRenderFns } from \"./ImageUpload.vue?vue&type=template&id=596f82bc&scoped=true\"\nimport script from \"./ImageUpload.vue?vue&type=script&lang=js\"\nexport * from \"./ImageUpload.vue?vue&type=script&lang=js\"\nimport style0 from \"./ImageUpload.vue?vue&type=style&index=0&id=596f82bc&prod&lang=scss&scoped=true\"\n\n\n/* normalize component */\nimport normalizer from \"!../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"596f82bc\",\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}