/
home
/
liman
/
panel
/
js
/
File Upload :
llllll
Current File: /home/liman/panel/js/818-legacy.8e7aaca0.js
(self["webpackChunkliman"]=self["webpackChunkliman"]||[]).push([[818],{69419:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return m}});var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("sedmed-form",{attrs:{items:e.fromItems,"initial-value":e.initialValue,okText:(e.id?"ویرایش":"ثبت")+" برند "},on:{create:e.create,update:e.update}})},a=[],i=n(11179),c=n(45525),o={name:"addEditBrand",components:{SedmedForm:c.Z},mixins:[i.Z],data:function(){return{fromItems:{name:{label:"نام برند",decorator:[{defaultKey:"required"}]},slug:{label:"کد slug",decorator:[{defaultKey:"required"},{defaultKey:"username"}]},count:{label:"تعداد",custom:{type:"number",min:0},itemCls:"w-full",initialValue:0},description:{label:"توضیحات",custom:{type:"textarea",autoSize:{minRows:3,maxRows:5}},cls:"md:col-span-3"}}}}},u=o,s=n(38e3),l=(0,s.Z)(u,r,a,!1,null,"4bcb9a11",null),m=l.exports},11179:function(e,t,n){"use strict";var r=n(37703);n(49955),n(49966),n(97244),n(776),n(50098);t["Z"]={data:function(){return{initialValue:void 0,model:void 0,view:!1}},computed:{id:function(){return this.$route.params.id},restfull:function(){return this.$route.meta.restfull},restfullPath:function(){return this.$route.meta.restfullPath||this.$route.meta.restfull},customRoute:function(){return this.$route.meta.isCustomRoute}},created:function(){var e=this;return(0,r.Z)(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,n(18847)("./".concat(e.restfull,"Tbl"));case 2:if(r=t.sent,e.model=r.default,!e.id||e.customRoute){t.next=7;break}return t.next=7,e.getData();case 7:if(!(e.initialValue&&e.initialValue.city&&e.initialValue.province)){t.next=10;break}return t.next=10,e.getCities(e.initialValue.province);case 10:case"end":return t.stop()}}),t)})))()},methods:{getData:function(){var e=arguments,t=this;return(0,r.Z)(regeneratorRuntime.mark((function n(){var r,a,i;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=e.length>0&&void 0!==e[0]?e[0]:void 0,n.prev=1,t.$store.commit("setLoading",!0),n.next=5,t.$axios.get("/".concat(t.restfullPath,"/").concat(r||t.id,"/"));case 5:a=n.sent,i=a.data,i&&i.city&&i.city.id&&i.city.parent&&i.city.parent.id?t.initialValue=Object.assign(i,{province:i.city.parent.id,city:i.city.id}):t.initialValue=i,n.next=13;break;case 10:n.prev=10,n.t0=n["catch"](1),console.log(n.t0);case 13:return n.prev=13,t.$store.commit("setLoading",!1),n.finish(13);case 16:case"end":return n.stop()}}),n,null,[[1,10,13,16]])})))()},update:function(e){var t=this;return(0,r.Z)(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.prev=0,t.$store.commit("setLoading",!0),n.next=4,t.$axios.patch("/".concat(t.restfullPath,"/").concat(t.id,"/"),e);case 4:return t.$ntSuccess("اطلاعات با موفقیت آپدیت شد"),n.next=7,t.$router.push({name:"".concat(t.restfull,"_list")});case 7:n.next=12;break;case 9:n.prev=9,n.t0=n["catch"](0),console.log(n.t0);case 12:return n.prev=12,t.$store.commit("setLoading",!1),n.finish(12);case 15:case"end":return n.stop()}}),n,null,[[0,9,12,15]])})))()},create:function(e){var t=this;return(0,r.Z)(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.prev=0,t.$store.commit("setLoading",!0),n.next=4,t.$axios.post("/".concat(t.restfullPath,"/"),e);case 4:return t.$ntSuccess("اطلاعات با موفقیت ثبت شد"),n.next=7,t.$router.push({name:"".concat(t.restfull,"_list")});case 7:n.next=12;break;case 9:n.prev=9,n.t0=n["catch"](0),console.log(n.t0);case 12:return n.prev=12,t.$store.commit("setLoading",!1),n.finish(12);case 15:case"end":return n.stop()}}),n,null,[[0,9,12,15]])})))()},toEdit:function(e){window.open("/".concat(this.restfull,"/edit/").concat(e),"_blank").focus()},setInitialValue:function(e){this.initialValue=e,this.view=!0},toView:function(e){var t=this;return(0,r.Z)(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,t.getData(e);case 2:t.view=!0;case 3:case"end":return n.stop()}}),n)})))()},deleteItem:function(e){var t=this;return(0,r.Z)(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.prev=0,t.$store.commit("setLoading",!0),n.next=4,t.$axios.delete("/".concat(t.restfullPath,"/").concat(e,"/"));case 4:return t.$ntSuccess("آیتم با موفقیت حذف شد"),n.next=7,t.$refs["".concat(t.restfull,"Tbl")].fetch();case 7:n.next=12;break;case 9:n.prev=9,n.t0=n["catch"](0),console.log(n.t0);case 12:return n.prev=12,t.$store.commit("setLoading",!1),n.finish(12);case 15:case"end":return n.stop()}}),n,null,[[0,9,12,15]])})))()}}}},18847:function(e,t,n){var r={"./brandTbl":[54660,660],"./categoryTbl":[22881,881],"./customerTbl":[61003,3],"./documentTbl":[1370,370],"./factorTbl":[13159,159],"./negotiable-typeTbl":[47429,429],"./negotiableTbl":[2941,941],"./porterTbl":[63685,685],"./productTbl":[44740,740],"./userTbl":[66896,896]};function a(e){if(!n.o(r,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=r[e],a=t[0];return n.e(t[1]).then((function(){return n(a)}))}a.keys=function(){return Object.keys(r)},a.id=18847,e.exports=a}}]); //# sourceMappingURL=818-legacy.8e7aaca0.js.map
Copyright ©2k19 -
Hexid
|
Tex7ure