/
home
/
liman
/
panel
/
js
/
File Upload :
llllll
Current File: //home/liman/panel/js/1639-legacy.191bde5c.js
"use strict";(self["webpackChunkliman"]=self["webpackChunkliman"]||[]).push([[1639],{51639:function(e,t,r){r.r(t),r.d(t,{default:function(){return m}});var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("a-form",{attrs:{form:e.form},on:{submit:e.submit}},[r("div",{staticClass:"grid grid-cols-1 md:grid-cols-3 gap-4"},[r("a-form-item",{attrs:{label:"پرچم (دسته)"}},[r("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["flag",{rules:[{required:!0,message:"لطفا مقدار را وارد کنید"},e.username("پرچم")]}],expression:"['flag',{rules: [{ required: true,message: 'لطفا مقدار را وارد کنید'},username('پرچم')]}]"}]})],1),r("a-form-item",{attrs:{label:"عنوان"}},[r("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["title",{rules:[{required:!0,message:"لطفا مقدار را وارد کنید"}]}],expression:"['title',{rules: [{ required: true,message: 'لطفا مقدار را وارد کنید'}]}]"}]})],1),r("a-form-item",{attrs:{label:"پدر ثابت"}},[r("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["parent_id"],expression:"['parent_id']"}],staticStyle:{width:"100%",direction:"rtl !important"},attrs:{"filter-option":e.filterOption,"show-search":""}},e._l(e.consts,(function(t){return r("a-select-option",{key:t.id,attrs:{value:t.id}},[e._v(" "+e._s(t.id)+" "+e._s(t.title)+" ")])})),1)],1),r("a-form-item",{staticClass:"md:col-span-3",attrs:{label:"مقدار"}},[r("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["w"],expression:"['w']"}],attrs:{"auto-size":{minRows:3,maxRows:5}}})],1)],1),e.id?r("a-button",{staticClass:"bg-primary",attrs:{type:"primary"},on:{click:e.edit}},[e._v(" ویرایش اطلاعات ")]):r("a-button",{staticClass:"bg-primary",attrs:{type:"primary"},on:{click:e.submit}},[e._v(" ثبت اطلاعات ")])],1)},a=[],s=r(37703),i=(r(49955),{name:"createConst",data:function(){return{form:this.$form.createForm(this,{name:"coordinated"}),consts:[]}},computed:{id:function(){return this.$route.params.id}},created:function(){var e=this;return(0,s.Z)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.getConsts();case 2:if(!e.id){t.next=5;break}return t.next=5,e.getConst();case 5:case"end":return t.stop()}}),t)})))()},methods:{submit:function(e){var t=this;return(0,s.Z)(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:e.preventDefault(),t.form.validateFields(function(){var e=(0,s.Z)(regeneratorRuntime.mark((function e(r,n){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(r){e.next=19;break}return e.prev=1,e.next=4,t.$store.commit("setLoading",!0);case 4:return e.next=6,t.$caxios.post("/constant",n);case 6:return t.form.resetFields(),e.next=9,t.$router.push({name:"const-list"});case 9:t.$ntSuccess("ثابت مورد نظر با موفقیت ثبت شد"),e.next=15;break;case 12:e.prev=12,e.t0=e["catch"](1),console.log(e.t0);case 15:return e.prev=15,e.next=18,t.$store.commit("setLoading",!1);case 18:return e.finish(15);case 19:case"end":return e.stop()}}),e,null,[[1,12,15,19]])})));return function(t,r){return e.apply(this,arguments)}}());case 2:case"end":return r.stop()}}),r)})))()},edit:function(e){var t=this;return(0,s.Z)(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:e.preventDefault(),t.form.validateFields(function(){var e=(0,s.Z)(regeneratorRuntime.mark((function e(r,n){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(r){e.next=19;break}return e.prev=1,e.next=4,t.$store.commit("setLoading",!0);case 4:return e.next=6,t.$caxios.put("/constant/".concat(t.id),n);case 6:return t.form.resetFields(),e.next=9,t.$router.push({name:"const-list"});case 9:t.$ntSuccess("ثابت مورد نظر با موفقیت ویرایش شد"),e.next=15;break;case 12:e.prev=12,e.t0=e["catch"](1),console.log(e.t0);case 15:return e.prev=15,e.next=18,t.$store.commit("setLoading",!1);case 18:return e.finish(15);case 19:case"end":return e.stop()}}),e,null,[[1,12,15,19]])})));return function(t,r){return e.apply(this,arguments)}}());case 2:case"end":return r.stop()}}),r)})))()},getConsts:function(){var e=this;return(0,s.Z)(regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.$store.commit("setLoading",!0);case 3:return t.next=5,e.$caxios.post("/constant/table");case 5:r=t.sent,n=r.data.rows,e.consts=n,t.next=13;break;case 10:t.prev=10,t.t0=t["catch"](0),console.log(t.t0);case 13:return t.prev=13,t.next=16,e.$store.commit("setLoading",!1);case 16:return t.finish(13);case 17:case"end":return t.stop()}}),t,null,[[0,10,13,17]])})))()},getConst:function(){var e=this;return(0,s.Z)(regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.$store.commit("setLoading",!0);case 3:return t.next=5,e.$caxios.get("/constant/id/".concat(e.id));case 5:r=t.sent,n=r.data,e.form.setFieldsValue(n),t.next=13;break;case 10:t.prev=10,t.t0=t["catch"](0),console.log(t.t0);case 13:return t.prev=13,t.next=16,e.$store.commit("setLoading",!1);case 16:return t.finish(13);case 17:case"end":return t.stop()}}),t,null,[[0,10,13,17]])})))()},filterOption:function(e,t){return t.componentOptions.children[0].text.toLowerCase().indexOf(e.toLowerCase())>=0}}}),o=i,c=r(38e3),u=(0,c.Z)(o,n,a,!1,null,"5aa9cd57",null),m=u.exports}}]); //# sourceMappingURL=1639-legacy.191bde5c.js.map
Copyright ©2k19 -
Hexid
|
Tex7ure