{"size": 2481, "ext": "js", "max_stars_repo_path": "public/js/816.js", "max_stars_repo_name": "abyllight/eat-fit", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "public/js/816.js", "max_issues_repo_name": "abyllight/eat-fit", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "public/js/816.js", "max_forks_repo_name": "abyllight/eat-fit", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 2481.0, "max_line_length": 2481, "alphanum_fraction": 0.661426844}
(self.webpackChunk=self.webpackChunk||[]).push([[816],{816:(n,e,t)=>{"use strict";t.r(e),t.d(e,{default:()=>c});var i=t(757),o=t.n(i);function s(n,e,t,i,o,s,a){try{var r=n[s](a),c=r.value}catch(n){return void t(n)}r.done?e(c):Promise.resolve(c).then(i,o)}function a(n){return function(){var e=this,t=arguments;return new Promise((function(i,o){var a=n.apply(e,t);function r(n){s(a,i,o,r,c,"next",n)}function c(n){s(a,i,o,r,c,"throw",n)}r(void 0)}))}}const r={name:"Cuisine",data:function(){return{iiko_loading:!1,cuisines:[],loading:!0,headers:[{text:"#",value:"index"},{text:"Название",align:"start",sortable:!0,value:"name"}],editedIndex:-1,editedItem:{name:"",code:""},defaultItem:{name:"",code:""}}},computed:{formTitle:function(){return-1===this.editedIndex?"Создать":"Редактировать"}},watch:{dialog:function(n){n||this.close()},dialogDelete:function(n){n||this.closeDelete()}},created:function(){this.getCuisines()},methods:{getCuisines:function(){var n=this;return a(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,axios.get("/api/cuisines").then((function(e){n.cuisines=e.data.cuisines})).catch((function(n){console.log(n)})).finally((function(){return n.loading=!1}));case 2:case"end":return e.stop()}}),e)})))()},showDetails:function(n){console.log(n)},fetchCuisines:function(){var n=this;return a(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.iiko_loading=!0,e.next=3,axios.get("/api/iiko/cuisines").then((function(e){e.data.status?n.getCuisines():n.$store.commit("SET_ALERT",{isVisible:!0,msg:e.data.msg,color:"red"})})).catch((function(n){console.log(n)})).finally((function(){return n.iiko_loading=!1}));case 3:case"end":return e.stop()}}),e)})))()}}};const c=(0,t(900).Z)(r,(function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("div",[t("v-row",[t("v-btn",{staticClass:"ma-3",attrs:{loading:n.iiko_loading,disabled:n.iiko_loading,color:"primary"},on:{click:n.fetchCuisines}},[n._v("\n            Получить данные\n        ")])],1),n._v(" "),t("v-row",[t("v-col",{attrs:{cols:"4"}},[t("v-data-table",{staticClass:"elevation-1",attrs:{headers:n.headers,items:n.cuisines,loading:n.loading,"loading-text":"Loading... Please wait"},on:{"click:row":n.showDetails},scopedSlots:n._u([{key:"item.index",fn:function(e){var t=e.index;return[n._v("\n                    "+n._s(t+1)+"\n                ")]}}])})],1)],1)],1)}),[],!1,null,null,null).exports}}]);