/
home
/
henzagold
/
adminold
/
export
/
js
/
File Upload :
llllll
Current File: /home/henzagold/adminold/export/js/chunk-174924ba.d4e7697a.js.map
{"version":3,"sources":["webpack:///./src/views/city/cityList.vue","webpack:///./src/views/city/CityListModel.js","webpack:///src/views/city/cityList.vue","webpack:///./src/views/city/cityList.vue?f652","webpack:///./src/views/city/cityList.vue?7f79","webpack:///./src/components/tooltip-btn/TooltipBtn.vue","webpack:///src/components/tooltip-btn/TooltipBtn.vue","webpack:///./src/components/tooltip-btn/TooltipBtn.vue?5c10","webpack:///./src/components/tooltip-btn/TooltipBtn.vue?aaee","webpack:///./src/mixins/citiesModel.js"],"names":["render","_vm","this","_c","_self","attrs","ref","staticClass","model","scopedSlots","_u","key","fn","text","_v","_s","showPercent","record","$hasPermission","on","$event","viewCity","_e","DeleteCity","id","setDefault","value","visibleCity","callback","$$v","expression","loading","form","handleSubmit","directives","name","rawName","rules","required","message","staticStyle","isParent","maxHeight","overflow","cityModel","setLevel","replace","slot","staticRenderFns","citiesTable","XTbl","add","Xtc","filterText","filterNumber","renderSlot","noSort","mixins","components","TooltipBtn","XTable","data","tempRow","cities","percent","percent_aux","methods","row","axios","percentAux","level","parent","title","e","err","exp","Object","val","map","mounted","res","console","component","popTitle","onClick","icon","iconClass","props","default","recursiveFunction","obj","helperObject","children","hArr","filter","x","length","push","label"],"mappings":"qIAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAOA,EAAG,MAAM,CAACE,MAAM,CAAC,GAAK,mBAAmB,CAACF,EAAG,UAAU,CAACG,IAAI,aAAaC,YAAY,UAAUF,MAAM,CAAC,kBAAmB,EAAM,MAAQ,mBAAmB,CAACF,EAAG,MAAM,CAACA,EAAG,SAAS,CAACG,IAAI,cAAcD,MAAM,CAAC,MAAQJ,EAAIO,OAAOC,YAAYR,EAAIS,GAAG,CAAC,CAACC,IAAI,UAAUC,GAAG,YAAkB,IAAPC,EAAO,EAAPA,KAAQ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AAY,iBAAiBF,MAAM,CAAC,KAAOJ,EAAIoF,KAAK,cAAcpF,EAAIqF,WAAWnE,GAAG,CAAC,MAAQlB,EAAImF,YAAY,IAAI,IAAI,IAE/epC,EAAkB,GCYtB,GACAb,kBACAoD,OACAf,SACAW,YACAE,QACAC,WACAE,oBAGAtB,SACAkB,QADA,WAEA,uBC1BmW,I,YCO/VF,EAAY,eACd,EACAlF,EACAgD,GACA,EACA,KACA,WACA,MAIa,OAAAkC,E,2CClBA,QACbhB,QAAS,CACPuB,kBADO,SACWC,EAAKpB,GAAO,WACxBqB,EAAeD,EACnBC,EAAaC,SAAW,GACxB,IAAIC,EAAO,GAkBX,OAhBEA,EADY,IAAVvB,EACKpE,KAAK6D,OAAO+B,QAAO,SAAAC,GAAC,OAAIA,EAAEzB,QAAUA,KAEpCpE,KAAK6D,OAAO+B,QAAO,SAAAC,GAAC,OAAKA,EAAEzB,QAAUA,GAASyB,EAAExB,SAAWoB,EAAanE,MAE7EqE,EAAKG,OAAS,EAChBH,EAAKf,KAAI,SAAAiB,GACPA,EAAI,EAAKN,kBAAkBM,EAAGzB,EAAQ,GAClCyB,EAAEH,SACJD,EAAaC,SAASK,KAAK,CAACvE,MAAOqE,EAAEvE,GAAI0E,MAAOH,EAAEvB,MAAO7D,IAAKoF,EAAEvE,GAAIoE,SAAUG,EAAEH,WAEhFD,EAAaC,SAASK,KAAK,CAACvE,MAAOqE,EAAEvE,GAAI0E,MAAOH,EAAEvB,MAAO7D,IAAKoF,EAAEvE,eAI7DmE,EAAaC,SAEfD","file":"js/chunk-174924ba.d4e7697a.js","sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{attrs:{\"id\":\"page-user-list\"}},[_c('vx-card',{ref:\"filterCard\",staticClass:\"vx-card\",attrs:{\"removeCardAction\":false,\"title\":\"لیست دیدگاه ها\"}},[_c('div',[_c('XTable',{ref:\"citiesTable\",attrs:{\"model\":_vm.model},scopedSlots:_vm._u([{key:\"percent\",fn:function({ text }){return _c('div',{},[_vm._v(\"\\n \"+_vm._s(_vm.showPercent(text))+\"\\n \")])}},{key:\"percent_aux\",fn:function({ text }){return _c('div',{},[_vm._v(\"\\n \"+_vm._s(_vm.showPercent(text))+\"\\n \")])}},{key:\"opt\",fn:function({ record }){return _c('div',{},[_c('div',{staticClass:\"flex\"},[(_vm.$hasPermission('cities.list.view'))?_c('TooltipBtn',{staticClass:\"mr-3\",attrs:{\"icon-class\":\"w-5 h-5 text-primary\",\"icon\":\"EyeIcon\",\"title\":\"مشاهده شهر\"},on:{\"click\":function($event){return _vm.viewCity(record)}}}):_vm._e(),(_vm.$hasPermission('cities.list.remove'))?_c('TooltipBtn',{staticClass:\"mr-3\",attrs:{\"icon-class\":\"w-5 h-5 text-danger\",\"icon\":\"TrashIcon\",\"popTitle\":\"شهر حذف شود؟\"},on:{\"click\":function($event){return _vm.DeleteCity(record.id)}}}):_vm._e()],1)])}}])}),(_vm.$hasPermission('cities.list.view'))?_c('AModal',{attrs:{\"afterClose\":_vm.setDefault,\"title\":\"مشاهده شهر\",\"width\":\"80%\",\"forceRender\":\"true\"},model:{value:(_vm.visibleCity),callback:function ($$v) {_vm.visibleCity=$$v},expression:\"visibleCity\"}},[_c('div',{attrs:{\"id\":\"page-user-view\"}},[_c('ASpin',{attrs:{\"type\":\"loading\",\"spinning\":_vm.loading}},[(_vm.$hasPermission('cities.list.view.edit'))?_c('div',{attrs:{\"id\":\"user-data\"}},[_c('a-form',{attrs:{\"form\":_vm.form},on:{\"submit\":_vm.handleSubmit}},[_c('div',{staticClass:\"grid grid-cols-2 gap-4\"},[_c('a-form-item',{attrs:{\"label\":\"والد\"}},[_c('a-tree-select',{directives:[{name:\"decorator\",rawName:\"v-decorator\",value:(['parent',{rules: [{ required: true,message: 'وارد کردن والد الزامی است'}],},]),expression:\"['parent',{rules: [{ required: true,message: 'وارد کردن والد الزامی است'}],},]\"}],staticStyle:{\"width\":\"100%\"},attrs:{\"disabled\":_vm.isParent || !_vm.$hasPermission('cities.list.view.edit'),\"dropdown-style\":{ maxHeight: '400px', overflow: 'auto' },\"tree-data\":_vm.cityModel,\"placeholder\":\"شهر را انتخاب کنید\"},on:{\"change\":_vm.setLevel}})],1),_c('a-form-item',{attrs:{\"label\":\"نام شهر\"}},[_c('a-input',{directives:[{name:\"decorator\",rawName:\"v-decorator\",value:(['title', { rules: [{ required: true, message: 'لطفا نام شهر را وارد کنید' }] }]),expression:\"['title', { rules: [{ required: true, message: 'لطفا نام شهر را وارد کنید' }] }]\"}],attrs:{\"disabled\":_vm.isParent || !_vm.$hasPermission('cities.list.view.edit')}})],1),_c('a-form-item',{attrs:{\"label\":\"درصد مغازه دار\"}},[_c('a-input-number',{directives:[{name:\"decorator\",rawName:\"v-decorator\",value:(['percent', { rules: [{ required: false, message: 'لطفا مقدار را وارد کنید' }] }]),expression:\"['percent', { rules: [{ required: false, message: 'لطفا مقدار را وارد کنید' }] }]\"}],staticStyle:{\"width\":\"100%\"},attrs:{\"disabled\":!_vm.$hasPermission('cities.list.view.edit'),\"min\":\"0\",\"max\":\"100\",\"formatter\":value => `${value}%`,\"parser\":value => value.replace('%', '')}})],1),_c('a-form-item',{attrs:{\"label\":\"درصد کیفی\"}},[_c('a-input-number',{directives:[{name:\"decorator\",rawName:\"v-decorator\",value:(['percent_aux', { rules: [{ required: false, message: 'لطفا مقدار را وارد کنید' }] }]),expression:\"['percent_aux', { rules: [{ required: false, message: 'لطفا مقدار را وارد کنید' }] }]\"}],staticStyle:{\"width\":\"100%\"},attrs:{\"disabled\":!_vm.$hasPermission('cities.list.view.edit'),\"min\":\"0\",\"max\":\"100\",\"formatter\":value => `${value}%`,\"parser\":value => value.replace('%', '')}})],1)],1)]),(_vm.$hasPermission('cities.list.view.edit'))?_c('vs-button',{staticClass:\"mr-4\",attrs:{\"icon-pack\":\"feather\",\"disabled\":_vm.loading},on:{\"click\":_vm.handleSubmit}},[_vm._v(\"\\n ویرایش\\n \")]):_vm._e()],1):_vm._e()])],1),_c('div',{attrs:{\"slot\":\"footer\"},slot:\"footer\"},[_c('AButton',{on:{\"click\":_vm.setDefault}},[_vm._v(\"بستن\")])],1)]):_vm._e()],1)])],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import XTbl, {Xtc} from '@/components/x-table/index'\r\n\r\nconst citiesTable = new XTbl('https://henzagold.com/oapi/admin/cities/list', 'لیست شهر ها')\r\n// citiesTable.add(new Xtc('id', 'شناسه شهر').filterNumber().hidden());\r\ncitiesTable.add(new Xtc('title', 'نام شهر').filterText())\r\ncitiesTable.add(new Xtc('level', 'سطح').filterNumber())\r\ncitiesTable.add(new Xtc('percent', 'درصد مشتری عمده').renderSlot('percent'))\r\ncitiesTable.add(new Xtc('percent_aux', 'درصد کارشناس فروش').renderSlot('percent_aux'))\r\ncitiesTable.add(new Xtc('opt', 'عملیات').noSort().renderSlot('opt'))\r\n\r\nexport default citiesTable\r\n","<template>\r\n <div id=\"page-user-list\">\r\n <vx-card\r\n ref=\"filterCard\"\r\n :removeCardAction=\"false\"\r\n title=\"لیست دیدگاه ها\"\r\n class=\"vx-card\">\r\n <div>\r\n <XTable :model=\"model\" ref=\"citiesTable\">\r\n <div slot=\"percent\" slot-scope=\"{ text }\">\r\n {{ showPercent(text) }}\r\n </div>\r\n <div slot=\"percent_aux\" slot-scope=\"{ text }\">\r\n {{ showPercent(text) }}\r\n </div>\r\n <div slot=\"opt\" slot-scope=\"{ record }\">\r\n <div class=\"flex\">\r\n <TooltipBtn v-if=\"$hasPermission('cities.list.view')\"\r\n icon-class=\"w-5 h-5 text-primary\"\r\n @click=\"viewCity(record)\"\r\n class=\"mr-3\"\r\n icon=\"EyeIcon\"\r\n title=\"مشاهده شهر\"\r\n />\r\n <TooltipBtn v-if=\"$hasPermission('cities.list.remove')\"\r\n icon-class=\"w-5 h-5 text-danger\"\r\n @click=\"DeleteCity(record.id)\"\r\n class=\"mr-3\"\r\n icon=\"TrashIcon\"\r\n popTitle=\"شهر حذف شود؟\"\r\n />\r\n </div>\r\n </div>\r\n </XTable>\r\n <!-- modal box start -->\r\n <AModal v-if=\"$hasPermission('cities.list.view')\"\r\n :afterClose=\"setDefault\" v-model=\"visibleCity\" title=\"مشاهده شهر\" width=\"80%\" forceRender=\"true\">\r\n <div id=\"page-user-view\">\r\n <ASpin type=\"loading\" :spinning=\"loading\">\r\n <div v-if=\"$hasPermission('cities.list.view.edit')\" id=\"user-data\">\r\n <a-form :form=\"form\" @submit=\"handleSubmit\">\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n\r\n <a-form-item label=\"والد\">\r\n <a-tree-select\r\n @change=\"setLevel\"\r\n :disabled=\"isParent || !$hasPermission('cities.list.view.edit')\"\r\n style=\"width: 100%\"\r\n v-decorator=\"['parent',{rules: [{ required: true,message: 'وارد کردن والد الزامی است'}],},]\"\r\n :dropdown-style=\"{ maxHeight: '400px', overflow: 'auto' }\"\r\n :tree-data=\"cityModel\"\r\n placeholder=\"شهر را انتخاب کنید\"\r\n />\r\n </a-form-item>\r\n\r\n <a-form-item label=\"نام شهر\">\r\n <a-input\r\n :disabled=\"isParent || !$hasPermission('cities.list.view.edit')\"\r\n v-decorator=\"['title', { rules: [{ required: true, message: 'لطفا نام شهر را وارد کنید' }] }]\"\r\n />\r\n </a-form-item>\r\n\r\n\r\n <a-form-item label=\"درصد مغازه دار\">\r\n <a-input-number\r\n :disabled=\"!$hasPermission('cities.list.view.edit')\"\r\n style=\"width: 100%\"\r\n min=\"0\"\r\n max=\"100\"\r\n :formatter=\"value => `${value}%`\"\r\n :parser=\"value => value.replace('%', '')\"\r\n v-decorator=\"['percent', { rules: [{ required: false, message: 'لطفا مقدار را وارد کنید' }] }]\"\r\n />\r\n </a-form-item>\r\n\r\n\r\n <a-form-item label=\"درصد کیفی\">\r\n <a-input-number\r\n :disabled=\"!$hasPermission('cities.list.view.edit')\"\r\n style=\"width: 100%\"\r\n min=\"0\"\r\n max=\"100\"\r\n :formatter=\"value => `${value}%`\"\r\n :parser=\"value => value.replace('%', '')\"\r\n v-decorator=\"['percent_aux', { rules: [{ required: false, message: 'لطفا مقدار را وارد کنید' }] }]\"\r\n />\r\n </a-form-item>\r\n </div>\r\n </a-form>\r\n <vs-button v-if=\"$hasPermission('cities.list.view.edit')\" icon-pack=\"feather\" :disabled=\"loading\" @click=\"handleSubmit\" class=\"mr-4\">\r\n ویرایش\r\n </vs-button>\r\n </div>\r\n </ASpin>\r\n </div>\r\n <div slot=\"footer\">\r\n <AButton @click=\"setDefault\">بستن</AButton>\r\n </div>\r\n </AModal>\r\n </div>\r\n </vx-card>\r\n </div>\r\n</template>\r\n\r\n<script>\r\n import XTable from '@/components/x-table/XTable'\r\n import model from './CityListModel'\r\n import TooltipBtn from '@/components/tooltip-btn/TooltipBtn'\r\n import axios from '@/axios'\r\n import citiesModel from '@/mixins/citiesModel'\r\n\r\n export default {\r\n name: \"Cities List\",\r\n mixins:[citiesModel],\r\n components: {\r\n TooltipBtn,\r\n XTable\r\n },\r\n data () {\r\n return {\r\n tempRow: undefined,\r\n model,\r\n visibleCity: false,\r\n form: this.$form.createForm(this, {name: 'coordinated'}),\r\n cities:[],\r\n cityModel:[],\r\n loading:false,\r\n isParent:false,\r\n percent:{percent:null,percent_aux:null}\r\n }\r\n },\r\n methods: {\r\n setDefault(){\r\n this.visibleCity = false\r\n this.tempRow = null\r\n this.isParent = false\r\n },\r\n async viewCity (row) {\r\n try{\r\n this.loading = true\r\n const percent = await axios.get(`cities/get-percent/${row.id}`)\r\n const percentAux = await axios.get(`cities/get-percent-aux/${row.id}`)\r\n if(row.level === 0)\r\n this.isParent =true\r\n this.tempRow = {\r\n level:row.level,\r\n id:row.id\r\n }\r\n this.form.setFieldsValue({\r\n parent: row.parent,\r\n title: row.title,\r\n percent : percent.data,\r\n percent_aux: percentAux.data\r\n })\r\n this.loading =false\r\n this.visibleCity = true\r\n }\r\n catch (e) {\r\n this.$message.error('خطا در دریافت اطلاعات')\r\n }\r\n },\r\n async DeleteCity (id) {\r\n try {\r\n await axios.delete(`cities/${id}`)\r\n this.$message.success('شهر حذف شد')\r\n this.$refs.citiesTable.fetch()\r\n this.$store.dispatch(\"users/getCities\")\r\n } catch (e) {\r\n this.$message.error('خطا در حذف شهر')\r\n }\r\n },\r\n async handleSubmit(e) {\r\n e.preventDefault();\r\n this.form.validateFields(async (err, values) => {\r\n if (!err) {\r\n try {\r\n this.loading = true\r\n let exp = Object.assign(values, {\r\n level:this.tempRow.level\r\n });\r\n await axios.put(`cities/${this.tempRow.id}`, exp);\r\n this.$message.success('اطلاعات شهر با موفقیت تغییر یافت')\r\n this.$refs.citiesTable.fetch()\r\n this.$store.dispatch(\"users/getCities\")\r\n this.setDefault()\r\n }\r\n catch (e) {\r\n this.$message.error('خطا در ثبت تغییرات')\r\n } finally {\r\n this.loading = false\r\n this.visibleCity =false\r\n }\r\n }\r\n });\r\n },\r\n setLevel(val){\r\n this.cities.filter(value => value.id===val)\r\n .map(value => this.tempRow.level = value.level+1)\r\n },\r\n showPercent(text){\r\n return (text)?`${text}%`:'-'\r\n }\r\n },\r\n async mounted() {\r\n try{\r\n let res = await axios.post(\"cities/list\");\r\n this.cities=res.data.rows;\r\n this.cityModel = this.recursiveFunction({},0).children\r\n // console.log(this.form.getFieldDecorator())\r\n }catch (e) {\r\n console.log(e);\r\n }\r\n },\r\n }\r\n</script>\r\n\r\n<!--<style>\r\n .border {\r\n border: 1px solid grey;\r\n border-radius: 50%;\r\n }\r\n [dir] .ant-popover.ant-popover-placement-top {\r\n z-index: 1000000 !important;\r\n }\r\n .comments-list ul {\r\n margin: 0;\r\n }\r\n .comments-list .comment-item {\r\n display: -webkit-box;\r\n display: -ms-flexbox;\r\n display: flex;\r\n -ms-flex-wrap: wrap;\r\n flex-wrap: wrap;\r\n -webkit-box-align: start;\r\n -ms-flex-align: start;\r\n align-items: flex-start;\r\n }\r\n .comments-list li {\r\n margin-bottom: 30px;\r\n }\r\n .comments-list .comment-item .img {\r\n width: 65px;\r\n margin-right: 20px;\r\n }\r\n .img {\r\n max-width: 100%;\r\n height: auto;\r\n }\r\n .comments-list .comment-item .comment-body {\r\n -webkit-box-flex: 1;\r\n -ms-flex: 1;\r\n flex: 1;\r\n }\r\n .comments-list .comment-item ul {\r\n -webkit-box-flex: 0;\r\n -ms-flex: 0 100%;\r\n flex: 0 100%;\r\n padding-left: 85px;\r\n }\r\n .comments-list .comment-item h5 {\r\n margin-bottom: 15px;\r\n font-weight: 600;\r\n }\r\n .comments-list .comment-item .time {\r\n display: inline-block;\r\n margin-bottom: 15px;\r\n color: #848486;\r\n font-size: 13px;\r\n line-height: 21px;\r\n position: absolute;\r\n top: 4px;\r\n right: 0;\r\n }\r\n .comments-list .comment-item p {\r\n margin-bottom: 15px;\r\n }\r\n ul li,\r\n ol li {\r\n margin: 10px 0 0;\r\n position: relative;\r\n }\r\n .green:active,\r\n .green:visited,\r\n .green:hover {\r\n background: #f6ffed;\r\n border-color: #b7eb8f;\r\n color: #52c41a;\r\n }\r\n .red:active,\r\n .red:visited,\r\n .red:hover {\r\n background: #fff1f0;\r\n border-color: #ffa39e;\r\n color: #f5222d;\r\n }\r\n .primary:active,\r\n .primary:visited,\r\n .primary:hover {\r\n background: #feffe6;\r\n border-color: #fffb8f;\r\n color: #fadb14;\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!./cityList.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!./cityList.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./cityList.vue?vue&type=template&id=3d592d06&\"\nimport script from \"./cityList.vue?vue&type=script&lang=js&\"\nexport * from \"./cityList.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 null,\n null\n \n)\n\nexport default component.exports","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',[_c('ATooltip',{attrs:{\"title\":_vm.title}},[(_vm.popTitle)?_c('APopconfirm',{attrs:{\"ok-text\":\"بله\",\"cancel-text\":\"خیر\",\"title\":_vm.popTitle},on:{\"confirm\":_vm.onClick}},[_c('feather-icon',{staticClass:\"cursor-pointer\",attrs:{\"icon\":_vm.icon,\"svg-classes\":_vm.iconClass}})],1):_c('div',[_c('feather-icon',{staticClass:\"cursor-pointer\",attrs:{\"icon\":_vm.icon,\"svg-classes\":_vm.iconClass},on:{\"click\":_vm.onClick}})],1)],1)],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\r\n <div>\r\n <ATooltip :title=\"title\">\r\n <APopconfirm ok-text=\"بله\" @confirm=\"onClick\" cancel-text=\"خیر\" :title=\"popTitle\" v-if=\"popTitle\">\r\n <feather-icon class=\"cursor-pointer\" :icon=\"icon\" :svg-classes=\"iconClass\"/>\r\n </APopconfirm>\r\n <div v-else>\r\n <feather-icon class=\"cursor-pointer\" :icon=\"icon\" @click=\"onClick\" :svg-classes=\"iconClass\"/>\r\n </div>\r\n </ATooltip>\r\n </div>\r\n</template>\r\n\r\n<script>\r\n export default {\r\n name: \"TooltipBtn\",\r\n props: {\r\n title: {},\r\n popTitle: {},\r\n icon: {},\r\n iconClass: {\r\n default: 'w-5 h-5'\r\n },\r\n },\r\n methods: {\r\n onClick() {\r\n this.$emit('click');\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!./TooltipBtn.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!./TooltipBtn.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./TooltipBtn.vue?vue&type=template&id=00dfccd3&scoped=true&\"\nimport script from \"./TooltipBtn.vue?vue&type=script&lang=js&\"\nexport * from \"./TooltipBtn.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 \"00dfccd3\",\n null\n \n)\n\nexport default component.exports","export default {\r\n methods: {\r\n recursiveFunction(obj, level) {\r\n let helperObject = obj\r\n helperObject.children = []\r\n let hArr = []\r\n if (level === 0) {\r\n hArr = this.cities.filter(x => x.level === level)\r\n } else {\r\n hArr = this.cities.filter(x => (x.level === level && x.parent === helperObject.id))\r\n }\r\n if (hArr.length > 0) {\r\n hArr.map(x => {\r\n x = this.recursiveFunction(x, level + 1)\r\n if (x.children) {\r\n helperObject.children.push({value: x.id, label: x.title, key: x.id, children: x.children})\r\n } else {\r\n helperObject.children.push({value: x.id, label: x.title, key: x.id})\r\n }\r\n })\r\n } else {\r\n delete helperObject.children\r\n }\r\n return helperObject\r\n }\r\n }\r\n}\r\n"],"sourceRoot":""}
Copyright ©2k19 -
Hexid
|
Tex7ure