/
proc
/
self
/
root
/
home
/
liman
/
panel
/
js
/
File Upload :
llllll
Current File: //proc/self/root/home/liman/panel/js/618-legacy.f9200a1c.js
"use strict";(self["webpackChunkliman"]=self["webpackChunkliman"]||[]).push([[618],{20618:function(e,t,r){r.r(t),r.d(t,{default:function(){return l}});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),r(90869)),o={name:"createConst",mixins:[i.Z],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}}},c=o,u=r(38e3),m=(0,u.Z)(c,n,a,!1,null,"3cd33361",null),l=m.exports},90869:function(e,t,r){r(50098);t["Z"]={methods:{fa:function(e){return{pattern:/^([\u0600-\u06FF\uFB8A\u067E\u0686\u06AF\u200C ])+$/,message:" مقدار ".concat(e," باید فارسی باشد ")}},mobile:function(e){return{pattern:/^(\+98|0098|98|0)?9\d{9}$/g,message:this.msg(e)}},phone:function(e){return{pattern:/^((\+98|0098|98|0)\d1)?\d{8}$/g,message:this.msg(e)}},mail:function(e){return{type:"email",message:this.msg(e)}},url:function(e){return{type:"url",message:this.msg(e)}},username:function(e){return{pattern:/^(?!.*\.\.)(?!.*\.$)[^\W][\w.]{0,29}$/gim,message:" مقدار ".concat(e," باید شامل حروف و اعداد انگلیسی و _ باشد ")}},required:function(e){return{required:!0,message:" لطفا مقدار ".concat(e," را وارد کنید ")}},sheba:function(e){return{pattern:/^IR\d{24}$/gim,message:this.msg(e)}},card:function(e){return{pattern:/^\d{16}$/gim,message:this.msg(e)}},zip:function(e){return{pattern:/^\d{10}$/gim,message:this.msg(e)}},num:function(e){return{pattern:/^\d*$/gim,message:this.msg(e)}},len:function(e,t){return{len:t,message:" مقدار ".concat(e," باید ").concat(t," کارکتر باشد ")}},max:function(e,t){return{max:t,message:" مقدار ".concat(e," باید کمتر از ").concat(t," کارکتر باشد ")}},min:function(e,t){return{min:t,message:" مقدار ".concat(e," باید بیشتر از ").concat(t," کارکتر باشد ")}},dynamic:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return r?this[t](e,r):this[t](e)},msg:function(e){return" مقدار ".concat(e," نا معتبر است ")}}}}}]); //# sourceMappingURL=618-legacy.f9200a1c.js.map
Copyright ©2k19 -
Hexid
|
Tex7ure