/
home
/
henzagold
/
admin_report
/
js
/
File Upload :
llllll
Current File: //home/henzagold/admin_report/js/chunk-0e70b67c.9fd52dd4.js.map
{"version":3,"sources":["webpack:///./src/views/apps/product/UploadProduct.vue?4532","webpack:///./src/views/apps/product/UploadProduct.vue","webpack:///src/views/apps/product/UploadProduct.vue","webpack:///./src/views/apps/product/UploadProduct.vue?6a8e","webpack:///./src/views/apps/product/UploadProduct.vue?a9b3"],"names":["render","_vm","this","_c","_self","attrs","loading","staticClass","sendingData","uploadType","on","setRows","_v","model","value","callback","$$v","expression","firstTableCols","length","_l","mainTableCols","item","index","key","selectClear","staticStyle","filterOption","handleFocus","$event","handleChange","freeCols","item_free","dataIndex","_s","title","convertButtonEnabled","convertButtonState","convertTable","refreshSelect","_e","rows","scopedSlots","_u","fn","text","mainTableChild","sendData","staticRenderFns","name","data","firstTableChild","selectedQuery","firstKeys","created","watch","methods","window","axios","setTimeout","console","clearSth","val","res","top","left","behavior","obgMain","option","components","XUploadExcel","component"],"mappings":"yIAAA,W,yCCAA,IAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAOA,EAAG,SAAS,CAACE,MAAM,CAAC,IAAM,wBAAwB,SAAWJ,EAAIK,UAAU,CAACH,EAAG,MAAM,CAACA,EAAG,MAAM,CAACI,YAAY,4CAA4C,CAACJ,EAAG,UAAU,CAACI,YAAY,gBAAgBF,MAAM,CAAC,MAAQ,qBAAqB,CAACF,EAAG,MAAM,CAACI,YAAY,UAAU,CAACJ,EAAG,eAAe,CAACE,MAAM,CAAC,SAAWJ,EAAIO,YAAY,WAAaP,EAAIQ,WAAW,IAAM,wDAAwDC,GAAG,CAAC,OAAST,EAAIU,YAAY,GAAGR,EAAG,MAAM,CAACI,YAAY,QAAQ,CAACJ,EAAG,MAAM,CAACF,EAAIW,GAAG,mBAAmBT,EAAG,gBAAgB,CAACI,YAAY,YAAYM,MAAM,CAACC,MAAOb,EAAIQ,WAAYM,SA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AC,kBAAA,+GAfAb,GAkBAR,yBACA,0CACA,iBAEAsB,oBAAA,WACA,uBACA,mCACA,6BACA,oCACA,kCAGAlD,mBAAA,wJAOA,OANA,gBACA,iBACA,uBACA,iBACA,gBAEA,SACAmD,4BAAA,OACA,sBACA,CACA3B,QACAF,iBAEA,OACA,0CACA,qBACA,gBACA,uGAlBAtB,GAoBA0B,8BAAA,WACA,KAQA,OAPA,yCACA,6BACA0B,SAKA,GAEAzB,wBAAA,WAGA,6BAEAmB,iBACAO,+BACAC,OACAC,oBAGA,iCACA,SACA,iCACAC,sCAEA,sBACAA,OASArC,2BAAA,WAEA,wBACA,0CACA,oCACA,kCACA,sCACA,8BAMAF,wBACAgC,sBAEAjC,2BACA,OACAyC,gFAIAC,YACAC,sBCjSqX,I,wBCQjXC,EAAY,eACd,EACAvE,EACAgD,GACA,EACA,KACA,KACA,MAIa,aAAAuB,E","file":"js/chunk-0e70b67c.9fd52dd4.js","sourcesContent":["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!./UploadProduct.vue?vue&type=style&index=0&id=dd274792&prod&lang=css&\"","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('a-spin',{attrs:{\"tip\":\"در حال پردازش اطلاعات\",\"spinning\":_vm.loading}},[_c('div',[_c('div',{staticClass:\"grid grid-cols-1 lg:grid-cols-5 lg:gap-2\"},[_c('vx-card',{staticClass:\"lg:col-span-1\",attrs:{\"title\":\"واردکردن محصولات\"}},[_c('div',{staticClass:\"w-full\"},[_c('XUploadExcel',{attrs:{\"disabled\":_vm.sendingData,\"uploadType\":_vm.uploadType,\"url\":\"https://kidslandtoys.com/kernel/admin/product/import\"},on:{\"output\":_vm.setRows}})],1),_c('div',{staticClass:\"mt-3\"},[_c('div',[_vm._v(\"نوع بارگذاری:\")]),_c('a-radio-group',{staticClass:\"flex mt-2\",model:{value:(_vm.uploadType),callback:function ($$v) {_vm.uploadType=$$v},expression:\"uploadType\"}},[_c('a-radio',{staticClass:\"w-1/2\",attrs:{\"value\":1}},[_vm._v(\"\\n عادی\\n \")]),_c('a-radio',{staticClass:\"w-1/2\",attrs:{\"value\":2}},[_vm._v(\"\\n پیشرفته\\n \")])],1)],1)]),(_vm.uploadType === 2)?_c('transition',{attrs:{\"mode\":\"out-in\",\"name\":\"fade\"}},[(_vm.firstTableCols.length !== 0)?_c('vx-card',{staticClass:\"lg:col-span-4 mt-2 lg:mt-0\",attrs:{\"title\":\"تنظیم دسته ها\"}},[_c('div',{staticClass:\"w-full grid grid-cols-1 lg:grid-cols-3 gap-2\"},_vm._l((_vm.mainTableCols),function(item,index){return _c('div',{staticClass:\"rectangle-css flex-row-reverse\"},[_c('a-select',{key:_vm.selectClear,staticClass:\"text-sm xl:text-base\",staticStyle:{\"width\":\"125px\"},attrs:{\"placeholder\":\"انتخاب ستون\",\"option-filter-prop\":\"children\",\"filter-option\":_vm.filterOption},on:{\"focus\":_vm.handleFocus,\"change\":function($event){return _vm.handleChange($event,item.key)}}},_vm._l((_vm.freeCols),function(item_free,index){return _c('a-select-option',{attrs:{\"value\":item_free.dataIndex}},[_vm._v(\"\\n \"+_vm._s(item_free.title)+\"\\n \")])}),1),_c('feather-icon',{staticClass:\"ml-2 mr-2\",attrs:{\"icon\":\"ChevronsRightIcon\"}}),_c('div',{staticClass:\"text-sm xl:text-base\",staticStyle:{\"margin-inline-end\":\"auto\",\"align-self\":\"center\"}},[_vm._v(\" \"+_vm._s(item.title)+\"\\n \")])],1)}),0),_c('div',{staticClass:\"mt-5\"},[_c('a-button',{attrs:{\"disabled\":_vm.sendingData || !_vm.convertButtonEnabled || _vm.convertButtonState(),\"h\":\"\",\"type\":\"primary\"},on:{\"click\":function($event){return _vm.convertTable()}}},[_c('div',{staticClass:\"text-lg\"},[_vm._v(\"تبدیل\")])]),_c('a-button',{staticClass:\"ml-2\",attrs:{\"disabled\":_vm.sendingData,\"type\":\"danger\",\"icon\":\"undo\"},on:{\"click\":function($event){return _vm.refreshSelect()}}})],1)]):_c('vx-card',{staticClass:\"col-span-4 mt-2 lg:mt-0\",attrs:{\"title\":\"تنظیم دسته ها\"}},[_c('div',{staticClass:\"text-center\"},[_vm._v(\"لطفا فایل اکسل خود را بارگذاری کنید\")])])],1):_vm._e()],1),_c('transition-group',{attrs:{\"mode\":\"out-in\",\"name\":\"fade\"}},[(_vm.sendingData)?_c('vx-card',{key:_vm.sendingData,staticClass:\"mt-2\"},[_c('div',{staticClass:\"flex center items-center\"},[_c('a-spin'),_c('div',{staticClass:\"ml-5\"},[_vm._v(\"\\n در حال ذخیره اطلاعات\\n \")])],1)]):_vm._e(),(_vm.firstTableCols.length !== 0)?_c('vx-card',{key:_vm.firstTableCols.length,staticClass:\"mt-2\",attrs:{\"title\":\"جدول اولیه\"}},[_c('a-table',{staticClass:\"flex-row-reverse\",attrs:{\"columns\":_vm.firstTableCols,\"data-source\":_vm.rows},scopedSlots:_vm._u([{key:\"name\",fn:function(text){return _c('a',{},[_vm._v(_vm._s(text))])}}],null,false,64187105)})],1):_vm._e(),(_vm.firstTableCols.length !== 0)?_c('vx-card',{key:_vm.firstTableCols.length,staticClass:\"mt-2\",attrs:{\"title\":\"جدول نهایی\"}},[_c('a-table',{staticClass:\"flex-row-reverse\",attrs:{\"columns\":_vm.mainTableCols,\"data-source\":_vm.mainTableChild},scopedSlots:_vm._u([{key:\"name\",fn:function(text){return _c('a',{},[_vm._v(_vm._s(text))])}}],null,false,64187105)}),_c('div',{staticClass:\"mt-5\"},[_c('a-button',{attrs:{\"id\":\"last-table\",\"disabled\":_vm.sendingData || _vm.mainTableChild.length === 0,\"type\":\"primary\"},on:{\"click\":function($event){return _vm.sendData()}}},[_c('div',{staticClass:\"text-lg\"},[_vm._v(\"ثبت نهایی\")])])],1)],1):_vm._e()],1)],1)])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\r\n <a-spin tip=\"در حال پردازش اطلاعات\" :spinning=\"loading\">\r\n <div>\r\n <div class=\"grid grid-cols-1 lg:grid-cols-5 lg:gap-2\">\r\n <vx-card title=\"واردکردن محصولات\" class=\"lg:col-span-1\">\r\n <div class=\"w-full\">\r\n <XUploadExcel\r\n @output=\"setRows\"\r\n :disabled=\"sendingData\"\r\n :uploadType=\"uploadType\"\r\n url=\"https://kidslandtoys.com/kernel/admin/product/import\"/>\r\n </div>\r\n <div class=\"mt-3\">\r\n <div>نوع بارگذاری:</div>\r\n<!-- <a-radio-group class=\"flex mt-2\" :default-value-=\"2\">-->\r\n<!-- <a-radio :value=\"1\" class=\"w-1/2\">عادی</a-radio>-->\r\n<!-- <a-radio :value=\"2\" class=\"w-1/2\">پیشرفته</a-radio>-->\r\n<!-- </a-radio-group>-->\r\n <a-radio-group class=\"flex mt-2\" v-model=\"uploadType\">\r\n <a-radio :value=\"1\" class=\"w-1/2\">\r\n عادی\r\n </a-radio>\r\n <a-radio :value=\"2\" class=\"w-1/2\">\r\n پیشرفته\r\n </a-radio>\r\n </a-radio-group>\r\n </div>\r\n </vx-card>\r\n\r\n <transition mode=\"out-in\" name=\"fade\" v-if=\"uploadType === 2\">\r\n <vx-card v-if=\"firstTableCols.length !== 0\" title=\"تنظیم دسته ها\" class=\"lg:col-span-4 mt-2 lg:mt-0\">\r\n <div class=\"w-full grid grid-cols-1 lg:grid-cols-3 gap-2\">\r\n <div v-for=\"(item,index) in mainTableCols\" class=\"rectangle-css flex-row-reverse\t\">\r\n <a-select\r\n placeholder=\"انتخاب ستون\"\r\n option-filter-prop=\"children\"\r\n style=\"width: 125px\"\r\n class=\"text-sm xl:text-base\"\r\n :filter-option=\"filterOption\"\r\n @focus=\"handleFocus\"\r\n @change=\"handleChange($event,item.key)\"\r\n :key=\"selectClear\"\r\n >\r\n <a-select-option v-for=\"(item_free,index) in freeCols\" :value=\"item_free.dataIndex\">\r\n {{ item_free.title }}\r\n </a-select-option>\r\n </a-select>\r\n <feather-icon icon=\"ChevronsRightIcon\" class=\"ml-2 mr-2\"/>\r\n <div class=\"text-sm xl:text-base\" style=\"margin-inline-end: auto; align-self: center\"> {{\r\n item.title\r\n }}\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"mt-5\">\r\n <a-button :disabled=\"sendingData || !convertButtonEnabled || convertButtonState()\" h type=\"primary\" @click=\"convertTable()\">\r\n <div class=\"text-lg\">تبدیل</div>\r\n </a-button>\r\n\r\n <a-button :disabled=\"sendingData\" type=\"danger\" icon=\"undo\" @click=\"refreshSelect()\" class=\"ml-2\"/>\r\n </div>\r\n </vx-card>\r\n <vx-card v-else title=\"تنظیم دسته ها\" class=\"col-span-4 mt-2 lg:mt-0\">\r\n <div class=\"text-center\">لطفا فایل اکسل خود را بارگذاری کنید</div>\r\n </vx-card>\r\n </transition>\r\n\r\n </div>\r\n <transition-group mode=\"out-in\" name=\"fade\">\r\n <vx-card class=\"mt-2\" v-if=\"sendingData\" :key=\"sendingData\">\r\n <div class=\"flex center items-center\">\r\n <a-spin/>\r\n <div class=\"ml-5\">\r\n در حال ذخیره اطلاعات\r\n </div>\r\n </div>\r\n\r\n </vx-card>\r\n <vx-card v-if=\"firstTableCols.length !== 0\" :key=\"firstTableCols.length\" title=\"جدول اولیه\" class=\"mt-2\">\r\n <a-table class=\"flex-row-reverse\" :columns=\"firstTableCols\" :data-source=\"rows\">\r\n <a slot=\"name\" slot-scope=\"text\">{{ text }}</a>\r\n </a-table>\r\n </vx-card>\r\n <vx-card v-if=\"firstTableCols.length !== 0\" :key=\"firstTableCols.length\" title=\"جدول نهایی\" class=\"mt-2\" >\r\n <a-table class=\"flex-row-reverse\" :columns=\"mainTableCols\" :data-source=\"mainTableChild\">\r\n <a slot=\"name\" slot-scope=\"text\">{{ text }}</a>\r\n </a-table>\r\n <div class=\"mt-5\">\r\n <a-button id=\"last-table\" :disabled=\"sendingData || mainTableChild.length === 0\" type=\"primary\" @click=\"sendData()\">\r\n <div class=\"text-lg\">ثبت نهایی</div>\r\n </a-button>\r\n <!-- <a-button type=\"danger\" icon=\"undo\" @click=\"refreshSelect()\" class=\"ml-2\"/>-->\r\n </div>\r\n </vx-card>\r\n </transition-group>\r\n\r\n </div>\r\n </a-spin>\r\n\r\n\r\n</template>\r\n\r\n<script>\r\nimport XUploadExcel from '@/components/x-upload/ExcelFileSelect'\r\nimport axios from '@/axios'\r\n\r\nconst mainTableCols = [\r\n {\r\n title: 'كد كالا',\r\n dataIndex: 'product_code',\r\n key: 'product_code'\r\n },\r\n {\r\n title: 'نام كالا',\r\n dataIndex: 'title',\r\n key: 'title'\r\n },\r\n {\r\n title: 'واحد',\r\n dataIndex: 'type',\r\n key: 'type'\r\n },\r\n {\r\n title: 'موجودي',\r\n dataIndex: 'count',\r\n key: 'count'\r\n },\r\n {\r\n title: 'قیمت عمده',\r\n dataIndex: 'omde_price',\r\n key: 'omde_price'\r\n },\r\n {\r\n title: 'قیمت تک',\r\n dataIndex: 'one_price',\r\n key: 'one_price'\r\n }\r\n]\r\n\r\nexport default {\r\n name: 'UploadProduct',\r\n data () {\r\n return {\r\n loading: false,\r\n rows: undefined,\r\n firstTableCols: [],\r\n freeCols: [],\r\n firstTableChild: undefined,\r\n selectedQuery: [],\r\n firstKeys: [],\r\n selectClear: false,\r\n mainTableCols,\r\n uploadType: 2,\r\n mainTableChild: [],\r\n convertButtonEnabled: true,\r\n sendingData: false\r\n }\r\n },\r\n created () {\r\n this.mainTableCols.forEach((x) => {\r\n this.selectedQuery[x.key] = undefined\r\n this.firstKeys.push(x)\r\n }\r\n )\r\n },\r\n watch:{\r\n uploadType(val){\r\n if (val === 1){\r\n this.firstTableCols = []\r\n this.freeCols= []\r\n this.firstTableChild= undefined\r\n this.selectedQuery= []\r\n this.firstKeys= []\r\n this.selectClear = ! this.selectedQuery\r\n this.mainTableChild= []\r\n }\r\n }\r\n },\r\n methods: {\r\n async sendData () {\r\n this.loading = true\r\n window.smoothscroll()\r\n // console.log(this.mainTableChild)\r\n try {\r\n let {data} = await axios.post('/admin/product/test', this.mainTableChild)\r\n this.sendingData = true\r\n setTimeout(() => {\r\n this.sendingData = false\r\n // console.log('hjhjhjhjhjhjjhhjj')\r\n this.refreshSelect()\r\n }, 40000)\r\n this.loading = false\r\n } catch (e) {\r\n this.loading = false\r\n console.log(e)\r\n }\r\n },\r\n refreshSelect () {\r\n this.freeCols = this.firstTableCols.slice()\r\n this.clearSth()\r\n },\r\n clearSth(){\r\n this.mainTableChild = []\r\n this.selectClear = !this.selectClear\r\n this.convertButtonEnabled = true\r\n this.firstKeys.forEach((x) => {\r\n this.selectedQuery[x.key] = undefined\r\n })\r\n },\r\n async setRows (val) {\r\n this.loading = true\r\n this.rows = undefined\r\n this.firstTableCols = []\r\n this.freeCols = []\r\n this.clearSth()\r\n\r\n // console.log(val[0])\r\n await val[0].forEach((x, index) =>\r\n this.firstTableCols.push(\r\n {\r\n title: x,\r\n dataIndex: index\r\n })\r\n )\r\n this.freeCols = this.firstTableCols.slice()\r\n this.rows = val.slice(1)\r\n this.loading = false\r\n // console.log('hello ', this.rows)\r\n },\r\n convertButtonState () {\r\n let res = false\r\n this.firstKeys.forEach((x) => {\r\n if (this.selectedQuery[x.key] === undefined) {\r\n res = true\r\n }\r\n\r\n })\r\n // console.log('false')\r\n return res\r\n },\r\n convertTable () {\r\n // console.log('selected queries: ', this.selectedQuery)\r\n // console.log('rows: ', this.rows)\r\n this.convertButtonEnabled = false\r\n\r\n window.scrollTo({\r\n top: document.body.scrollHeight,\r\n left: 0,\r\n behavior: 'smooth'\r\n });\r\n\r\n this.rows.forEach((x, i) => {\r\n let obgMain = {}\r\n this.firstKeys.forEach((y) => {\r\n obgMain[y.key] = x[this.selectedQuery[y.key]]\r\n })\r\n this.mainTableChild.push(\r\n obgMain\r\n )\r\n // console.log('obg1 ', x[1])\r\n // console.log('obg2 ',this.mainTableChild[i].title)\r\n // console.log('count ',i+2)\r\n // debugger\r\n })\r\n // console.log(this.mainTableChild)\r\n },\r\n handleChange (value, key) {\r\n // console.log(`selected ${value} ${key}`)\r\n this.selectedQuery[key] = value\r\n this.freeCols = this.firstTableCols.slice()\r\n this.firstKeys.forEach((x) => {\r\n this.freeCols.forEach((y, i) => {\r\n if (y.dataIndex === this.selectedQuery[x.key]) {\r\n this.freeCols.splice(i, 1)\r\n }\r\n })\r\n })\r\n\r\n },\r\n handleFocus (val) {\r\n console.log('focus')\r\n },\r\n filterOption (input, option) {\r\n return (\r\n option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0\r\n )\r\n }\r\n },\r\n components: {\r\n XUploadExcel: XUploadExcel\r\n }\r\n}\r\n</script>\r\n<style>\r\n[dir=rtl] .ant-table-pagination.ant-pagination {\r\n direction: initial;\r\n}\r\n\r\n.rectangle-css {\r\n border: 1px solid #ccc;\r\n display: inline-block;\r\n border-radius: 10px;\r\n display: flex;\r\n padding: 10px 8px;\r\n}\r\n\r\n.ant-table-default {\r\n overflow-x: auto;\r\n}\r\n\r\n.fade-enter-active, .fade-leave-active {\r\n transition: all 1s;\r\n}\r\n\r\n.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */\r\n{\r\n opacity: 0;\r\n}\r\n</style>\r\n\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!./UploadProduct.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!./UploadProduct.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./UploadProduct.vue?vue&type=template&id=dd274792&\"\nimport script from \"./UploadProduct.vue?vue&type=script&lang=js&\"\nexport * from \"./UploadProduct.vue?vue&type=script&lang=js&\"\nimport style0 from \"./UploadProduct.vue?vue&type=style&index=0&id=dd274792&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"],"sourceRoot":""}
Copyright ©2k19 -
Hexid
|
Tex7ure