/
home
/
maktab
/
admin
/
js
/
File Upload :
llllll
Current File: /home/maktab/admin/js/chunk-c8e83794.87d7180a.js.map
{"version":3,"sources":["webpack:///./src/views/gallery/edit.vue?122f","webpack:///src/views/gallery/edit.vue","webpack:///./src/views/gallery/edit.vue?a997","webpack:///./src/views/gallery/edit.vue","webpack:///./src/views/gallery/add.vue?67c4","webpack:///./src/components/imageList/index.vue?e0f7","webpack:///src/components/imageList/index.vue","webpack:///./src/components/imageList/index.vue?80a3","webpack:///./src/components/imageList/index.vue","webpack:///src/views/gallery/add.vue","webpack:///./src/views/gallery/add.vue?2398","webpack:///./src/views/gallery/add.vue","webpack:///./src/components/imageList/index.vue?8f9e"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticRenderFns","name","components","editGallery","component","attrs","loading","staticClass","model","value","callback","$$v","title","expression","ref","on","addId","removeId","submit","_v","_s","id","url","headers","fileList","getData","handleRemove","handlePreview","handleChange","length","_e","previewVisible","handleCancel","staticStyle","previewImage","getBase64","reader","data","computed","methods","file","console","has_thumb","has_watermark","subject","type","ImageList","ids","mounted","fetchInf","axios","pushImg","full_src","uid","status","response","image","files"],"mappings":"0IAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,iBAC/FE,EAAkB,G,YCKP,GACfC,YACAC,YACAC,2BCT6V,I,YCOzVC,EAAY,eACd,EACAX,EACAO,GACA,EACA,KACA,WACA,MAIa,aAAAI,E,oDClBf,IAAIX,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,SAAS,CAACO,MAAM,CAAC,SAAWX,EAAIY,UAAU,CAACR,EAAG,UAAU,CAACO,MAAM,CAAC,MAAQ,iBAAiB,CAACP,EAAG,MAAM,CAACS,YAAY,UAAU,CAACT,EAAG,cAAc,CAACO,MAAM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,IAAM,UAAU,IAAMX,EAAIwC,mBAAmB,IAClsB,EAAkB,G,YC0BtB,SAASC,EAAT,GACA,kCACA,qBACAC,mBACAA,oBAAA,oBACAA,sBAAA,gBAIe,OACfC,gBACA,OACAf,kCACAS,kBACAG,gBACAV,cAGAc,UACAf,mBACA,OACA,mEAIAgB,SACAP,wBACA,wBAEAL,yBAAA,gJACA,iDACAQ,mBAAA,OAAAK,iBAAA,OAEA,mCACA,6HALAb,GAOAC,yBAGA,IAFAJ,aACAgB,SAIA,8CACA,+BAEA,iBAGAd,yBACAe,oCACA,oCAEAhB,mBACA,OACAiB,YACAC,gBACAC,UACAhC,QACAiC,WCrF8V,I,wBCQ1VzC,EAAY,eACd,EACA,EACA,GACA,EACA,KACA,KACA,MAIa,EAAAA,E,QCGA,GACfH,aACAC,YACA4C,aAEAT,gBACA,OACAU,OACAnC,SACAN,aAGA0C,mBAAA,gJACA,wBACA,gCACA,8BACA,qHAJAA,GAOAV,UACAjB,cACA,+BAGAkB,SACAvB,kBACA,kBAGAC,qBACA,oEAGAgC,oBAAA,qLAEAC,sCAAA,gBAAAb,SACAI,eACA,mBACA,gDACAJ,4BACA,gBAGA,qDAEAI,kBACA,6JAbAQ,GAgBAE,oBAAA,WAAAvC,UAAAwC,aACA,gCACAC,MACAC,cACArD,OACAsD,UACAlC,KACAmC,SAEAlC,SAGAJ,kBAAA,wJAEA,sDACA,mBACA,wCAGAgC,4BACAtC,iBACA6C,iBACA,OAHApB,OAAA,wCAKAa,4CACAtC,iBACA6C,iBACA,QAHApB,OAAA,yBAKA,mDACA,4EAEA,gEACA,mIAGA,kDAEA,OAFA,UAEA,kJA1BAnB,KCnF4V,ICOxV,EAAY,eACd,EACAzB,EACAO,GACA,EACA,KACA,WACA,MAIa,e,oEClBf","file":"js/chunk-c8e83794.87d7180a.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('edit-gallery')}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\r\n <edit-gallery/>\r\n</template>\r\n\r\n<script>\r\nimport add from './add'\r\nexport default {\r\n name: 'edit',\r\n components:{\r\n editGallery : add\r\n }\r\n}\r\n</script>\r\n\r\n<style scoped>\r\n\r\n</style>\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./edit.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./edit.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./edit.vue?vue&type=template&id=521ef43f&scoped=true&\"\nimport script from \"./edit.vue?vue&type=script&lang=js&\"\nexport * from \"./edit.vue?vue&type=script&lang=js&\"\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 \"521ef43f\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('a-spin',{attrs:{\"spinning\":_vm.loading}},[_c('vx-card',{attrs:{\"title\":\"گالری تصاویر\"}},[_c('div',{staticClass:\" gap-5\"},[_c('a-form-item',{attrs:{\"label\":\"موضوع\"}},[_c('a-input',{staticClass:\"md:w-1/2\",attrs:{\"placeholder\":\"موضوع\"},model:{value:(_vm.title),callback:function ($$v) {_vm.title=$$v},expression:\"title\"}})],1),_c('ImageList',{ref:\"photo\",staticClass:\"mt-5\",on:{\"ok\":_vm.addId,\"remove\":_vm.removeId}})],1),_c('a-button',{staticClass:\"mt-10\",attrs:{\"type\":\"primary\"},on:{\"click\":_vm.submit}},[_c('div',{staticClass:\"px-10\"},[_vm._v(\"\\n \"+_vm._s(_vm.id? 'ویرایش':'ثبت')+\"\\n \")])])],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"clearfix\"},[_c('a-upload',{attrs:{\"action\":_vm.url,\"headers\":_vm.headers,\"list-type\":\"picture-card\",\"file-list\":_vm.fileList,\"data\":_vm.getData,\"remove\":_vm.handleRemove},on:{\"preview\":_vm.handlePreview,\"change\":_vm.handleChange}},[(_vm.fileList.length < 10)?_c('div',[_c('a-icon',{attrs:{\"type\":\"plus\"}}),_c('div',{staticClass:\"ant-upload-text\"},[_vm._v(\"\\n بارگذاری\\n \")])],1):_vm._e()]),_c('a-modal',{attrs:{\"visible\":_vm.previewVisible,\"footer\":null},on:{\"cancel\":_vm.handleCancel}},[_c('img',{staticStyle:{\"width\":\"100%\"},attrs:{\"alt\":\"example\",\"src\":_vm.previewImage}})])],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\r\n <div class=\"clearfix\">\r\n <a-upload\r\n :action=\"url\"\r\n :headers=\"headers\"\r\n list-type=\"picture-card\"\r\n :file-list=\"fileList\"\r\n :data=\"getData\"\r\n :remove=\"handleRemove\"\r\n @preview=\"handlePreview\"\r\n @change=\"handleChange\"\r\n >\r\n <div v-if=\"fileList.length < 10\">\r\n <a-icon type=\"plus\"/>\r\n <div class=\"ant-upload-text\">\r\n بارگذاری\r\n </div>\r\n </div>\r\n </a-upload>\r\n <a-modal :visible=\"previewVisible\" :footer=\"null\" @cancel=\"handleCancel\">\r\n <img alt=\"example\" style=\"width: 100%\" :src=\"previewImage\"/>\r\n </a-modal>\r\n </div>\r\n</template>\r\n<script>\r\nimport {baseURL} from '@/axios'\r\n\r\nfunction getBase64 (file) {\r\n return new Promise((resolve, reject) => {\r\n const reader = new FileReader()\r\n reader.readAsDataURL(file)\r\n reader.onload = () => resolve(reader.result)\r\n reader.onerror = error => reject(error)\r\n })\r\n}\r\n\r\nexport default {\r\n data () {\r\n return {\r\n url: `${baseURL}site/file`,\r\n previewVisible: false,\r\n previewImage: '',\r\n fileList: []\r\n }\r\n },\r\n computed: {\r\n headers () {\r\n return {\r\n 'Authorization': 'Bearer ' + localStorage.getItem('accessToken') || localStorage.accessToken\r\n }\r\n }\r\n },\r\n methods: {\r\n handleCancel () {\r\n this.previewVisible = false\r\n },\r\n async handlePreview (file) {\r\n if (!file.url && !file.preview) {\r\n file.preview = await getBase64(file.originFileObj)\r\n }\r\n this.previewImage = file.url || file.preview\r\n this.previewVisible = true\r\n },\r\n handleChange ({\r\n fileList,\r\n file\r\n }) {\r\n /* console.log(\"file.status,fileList ====>\", file.status,fileList)*/\r\n\r\n if (file.status === 'done' && file.response && file.response.id) {\r\n this.$emit('ok', file.response.id)\r\n }\r\n this.fileList = fileList\r\n\r\n },\r\n handleRemove (file) {\r\n console.log('remove', file.response.id)\r\n this.$emit('remove', file.response.id)\r\n },\r\n getData () {\r\n return {\r\n has_thumb: 1,\r\n has_watermark: 0,\r\n subject: 1,\r\n title: 1,\r\n type: 3\r\n }\r\n }\r\n }\r\n}\r\n</script>\r\n<style>\r\n/* you can make up upload button and sample style by using stylesheets */\r\n.ant-upload-select-picture-card i {\r\n font-size: 32px;\r\n color: #999;\r\n}\r\n\r\n.ant-upload-select-picture-card .ant-upload-text {\r\n margin-top: 8px;\r\n color: #666;\r\n}\r\n</style>\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=e04aab88&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nimport style0 from \"./index.vue?vue&type=style&index=0&id=e04aab88&prod&lang=css&\"\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 null,\n null\n \n)\n\nexport default component.exports","<template>\r\n <a-spin :spinning=\"loading\">\r\n <vx-card title=\"گالری تصاویر\">\r\n <div class=\" gap-5\">\r\n <a-form-item label=\"موضوع\">\r\n <a-input v-model=\"title\" placeholder=\"موضوع\" class=\"md:w-1/2\"/>\r\n </a-form-item>\r\n <ImageList ref=\"photo\" class=\"mt-5\" @ok=\"addId\" @remove=\"removeId\"/>\r\n </div>\r\n <a-button type=\"primary\" class=\"mt-10\" @click=\"submit\">\r\n <div class=\"px-10\">\r\n {{ id? 'ویرایش':'ثبت' }}\r\n </div>\r\n </a-button>\r\n </vx-card>\r\n </a-spin>\r\n</template>\r\n\r\n<script>\r\nimport ImageList from '@/components/imageList'\r\nimport axios from '@/axios'\r\n\r\nexport default {\r\n name: 'index',\r\n components: {\r\n ImageList\r\n },\r\n data () {\r\n return {\r\n ids: [],\r\n title: '',\r\n loading: false\r\n }\r\n },\r\n async mounted () {\r\n if (this.id) {\r\n this.loading = true\r\n await this.fetchInf(this.id)\r\n this.loading = false\r\n }\r\n },\r\n computed: {\r\n id () {\r\n return this.$route.params.id\r\n }\r\n },\r\n methods: {\r\n addId (id) {\r\n this.ids.push(id)\r\n // console.log(this.ids)\r\n },\r\n removeId (id) {\r\n this.ids.splice(this.ids.findIndex(x => x === id), 1)\r\n // console.log(this.ids)\r\n },\r\n async fetchInf (id) {\r\n try {\r\n const {data} = await axios.get(`/api/gallery/${id}`)\r\n console.log(data)\r\n this.title = data.title\r\n this.ids = data.file.map(x => x.id)\r\n data.file.forEach(x =>{\r\n this.pushImg(x)\r\n // console.log(x)\r\n })\r\n // console.log(this.ids)\r\n } catch (e) {\r\n console.log(e)\r\n this.$message.error('خطا در دریافت اطلاعات')\r\n }\r\n },\r\n pushImg({id,title,full_src}){\r\n this.$refs.photo.fileList.push({\r\n uid: id,\r\n status: 'done',\r\n name: title,\r\n response: {\r\n id: id,\r\n image: full_src\r\n },\r\n url: full_src\r\n })\r\n },\r\n async submit () {\r\n try {\r\n if (this.title !== '' && this.ids.length !== 0) {\r\n this.loading = true\r\n if (!this.id) {\r\n // console.log(\"this.ids ====>\", this.ids)\r\n\r\n const data = await axios.post('/api/gallery', {\r\n title: this.title,\r\n files: this.ids\r\n })\r\n } else {\r\n const data = await axios.put(`/api/gallery/${this.id}`, {\r\n title: this.title,\r\n files: this.ids\r\n })\r\n }\r\n await this.$router.push(`/setting/gallery/list`)\r\n this.$message.success('اطلاعات با موفقیت ذخیره شد')\r\n } else {\r\n if (this.title === '') this.$message.error('لطفا موضوع را وارد کنید')\r\n if (this.ids.length === 0) this.$message.error('لطفا تصاویر را آپلود کنید')\r\n }\r\n } catch (e) {\r\n this.$message.error('خطا در ثبت اطلاعات')\r\n } finally {\r\n this.loading = false\r\n }\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style scoped>\r\n\r\n</style>\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./add.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./add.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./add.vue?vue&type=template&id=2e072936&scoped=true&\"\nimport script from \"./add.vue?vue&type=script&lang=js&\"\nexport * from \"./add.vue?vue&type=script&lang=js&\"\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 \"2e072936\",\n null\n \n)\n\nexport default component.exports","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&id=e04aab88&prod&lang=css&\""],"sourceRoot":""}
Copyright ©2k19 -
Hexid
|
Tex7ure