25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 

1 satır
14 KiB

  1. {"ast":null,"code":"import { createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, createCommentVNode as _createCommentVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, withModifiers as _withModifiers, createBlock as _createBlock } from \"vue\";\nconst _hoisted_1 = {\n key: 0,\n class: \"fas fa-save me-2\"\n};\nconst _hoisted_2 = {\n key: 1,\n class: \"spinner-border spinner-border-sm me-2\",\n role: \"status\",\n \"aria-hidden\": \"true\"\n};\nexport function render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_BCardHeader = _resolveComponent(\"BCardHeader\");\n const _component_BFormInput = _resolveComponent(\"BFormInput\");\n const _component_BCol = _resolveComponent(\"BCol\");\n const _component_BRow = _resolveComponent(\"BRow\");\n const _component_BButton = _resolveComponent(\"BButton\");\n const _component_BCardBody = _resolveComponent(\"BCardBody\");\n const _component_BCard = _resolveComponent(\"BCard\");\n const _component_Layout = _resolveComponent(\"Layout\");\n return _openBlock(), _createBlock(_component_Layout, null, {\n default: _withCtx(() => [_createVNode(_component_BRow, null, {\n default: _withCtx(() => [_createVNode(_component_BCol, {\n sm: \"12\"\n }, {\n default: _withCtx(() => [_createVNode(_component_BCard, {\n \"no-body\": \"\",\n class: \"shadow-sm\"\n }, {\n default: _withCtx(() => [_createVNode(_component_BCardHeader, {\n class: \"bg-primary text-white\"\n }, {\n default: _withCtx(() => _cache[3] || (_cache[3] = [_createElementVNode(\"h5\", {\n class: \"mb-0 d-flex align-items-center\"\n }, [_createElementVNode(\"i\", {\n class: \"fas fa-user-edit me-2\"\n }), _createTextVNode(\" ویرایش پروفایل \")], -1 /* HOISTED */)])),\n _: 1 /* STABLE */\n }), _createVNode(_component_BCardBody, {\n class: \"p-4\"\n }, {\n default: _withCtx(() => [_createElementVNode(\"form\", {\n onSubmit: _cache[2] || (_cache[2] = _withModifiers((...args) => $setup.saveUserInfo && $setup.saveUserInfo(...args), [\"prevent\"]))\n }, [_createCommentVNode(\" Name input \"), _createVNode(_component_BRow, {\n class: \"mb-4\"\n }, {\n default: _withCtx(() => [_createVNode(_component_BCol, {\n sm: \"12\"\n }, {\n default: _withCtx(() => [_cache[4] || (_cache[4] = _createElementVNode(\"label\", {\n for: \"userName\",\n class: \"form-label\"\n }, [_createElementVNode(\"i\", {\n class: \"fas fa-user me-2\"\n }), _createTextVNode(\" نام کاربری \")], -1 /* HOISTED */)), _createVNode(_component_BFormInput, {\n id: \"userName\",\n modelValue: $setup.userName,\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = $event => $setup.userName = $event),\n type: \"text\",\n placeholder: \"نام خود را وارد کنید\",\n required: \"\",\n class: \"form-control\"\n }, null, 8 /* PROPS */, [\"modelValue\"])]),\n _: 1 /* STABLE */\n })]),\n _: 1 /* STABLE */\n }), _createCommentVNode(\" Password input (optional) \"), _createVNode(_component_BRow, {\n class: \"mb-4\"\n }, {\n default: _withCtx(() => [_createVNode(_component_BCol, {\n sm: \"12\"\n }, {\n default: _withCtx(() => [_cache[5] || (_cache[5] = _createElementVNode(\"label\", {\n for: \"userPassword\",\n class: \"form-label\"\n }, [_createElementVNode(\"i\", {\n class: \"fas fa-key me-2\"\n }), _createTextVNode(\" رمز عبور \")], -1 /* HOISTED */)), _createVNode(_component_BFormInput, {\n id: \"userPassword\",\n modelValue: $setup.userPassword,\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = $event => $setup.userPassword = $event),\n type: \"password\",\n placeholder: \"رمز عبور جدید را وارد کنید\",\n class: \"form-control\"\n }, null, 8 /* PROPS */, [\"modelValue\"])]),\n _: 1 /* STABLE */\n })]),\n _: 1 /* STABLE */\n }), _createVNode(_component_BRow, {\n class: \"text-center\"\n }, {\n default: _withCtx(() => [_createVNode(_component_BCol, {\n sm: \"12\"\n }, {\n default: _withCtx(() => [_createVNode(_component_BButton, {\n type: \"submit\",\n variant: \"success\",\n class: \"px-4 py-2\",\n disabled: $setup.loading\n }, {\n default: _withCtx(() => [!$setup.loading ? (_openBlock(), _createElementBlock(\"i\", _hoisted_1)) : _createCommentVNode(\"v-if\", true), $setup.loading ? (_openBlock(), _createElementBlock(\"span\", _hoisted_2)) : _createCommentVNode(\"v-if\", true), _cache[6] || (_cache[6] = _createTextVNode(\" ذخیره \"))]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"disabled\"])]),\n _: 1 /* STABLE */\n })]),\n _: 1 /* STABLE */\n })], 32 /* NEED_HYDRATION */)]),\n _: 1 /* STABLE */\n })]),\n _: 1 /* STABLE */\n })]),\n _: 1 /* STABLE */\n })]),\n _: 1 /* STABLE */\n })]),\n _: 1 /* STABLE */\n });\n}","map":{"version":3,"names":["key","class","role","_createBlock","_component_Layout","default","_withCtx","_createVNode","_component_BRow","_component_BCol","sm","_component_BCard","_component_BCardHeader","_cache","_createElementVNode","_createTextVNode","_","_component_BCardBody","onSubmit","_withModifiers","args","$setup","saveUserInfo","_createCommentVNode","for","_component_BFormInput","id","modelValue","userName","$event","type","placeholder","required","userPassword","_component_BButton","variant","disabled","loading","_createElementBlock","_hoisted_1","_hoisted_2"],"sources":["C:\\Users\\hp\\Desktop\\satari\\Vue\\Admin\\src\\views\\live-preview\\pages\\editProfile.vue"],"sourcesContent":["<script>\r\nimport { computed, ref } from \"vue\";\r\nimport { useStore } from \"vuex\";\r\nimport Layout from \"@/layout/custom.vue\";\r\nimport axios from \"axios\";\r\nimport { toast } from \"vue3-toastify\";\r\nimport \"vue3-toastify/dist/index.css\";\r\nimport Swal from \"sweetalert2\";\r\nexport default {\r\n name: \"SAMPLE-PAGE\",\r\n components: {\r\n Layout,\r\n },\r\n setup() {\r\n const loading = ref(false);\r\n const store = useStore();\r\n const url = process.env.VUE_APP_ROOT_URL;\r\n const token = localStorage.getItem(\"token\");\r\n const user = computed(() => store.getters[\"user/getUser\"]);\r\n const userName = ref(user.value.name);\r\n const userPassword = ref(\"\");\r\n\r\n const saveUserInfo = () => {\r\n if (!userName.value) {\r\n Swal.fire({\r\n icon: \"warning\",\r\n title: \"خطا\",\r\n text: \"لطفا نام کاربری را وارد نمایید...\",\r\n confirmButtonText: \"باشه\",\r\n confirmButtonColor: \"#3085d6\",\r\n });\r\n return;\r\n }\r\n loading.value = true;\r\n const updatedUser = {\r\n name: userName.value,\r\n password: userPassword.value,\r\n };\r\n\r\n axios\r\n .post(`${url}/edit-profile`, updatedUser, {\r\n headers: {\r\n Authorization: `Bearer ${token}`,\r\n },\r\n })\r\n .then((resp) => {\r\n console.log(resp.data.msg);\r\n toast.success(`${resp.data.msg}`, {\r\n position: \"top-right\",\r\n autoClose: 3000,\r\n });\r\n loading.value = false;\r\n })\r\n .catch((err) => {\r\n console.log(err);\r\n toast.error(\"ویرایش پروفایل انجام نشد...\", {\r\n position: \"top-right\",\r\n autoClose: 3000,\r\n });\r\n loading.value = false;\r\n });\r\n };\r\n\r\n return {\r\n userName,\r\n userPassword,\r\n saveUserInfo,\r\n loading,\r\n };\r\n },\r\n};\r\n</script>\r\n\r\n<template>\r\n <Layout>\r\n <BRow>\r\n <BCol sm=\"12\">\r\n <BCard no-body class=\"shadow-sm\">\r\n <BCardHeader class=\"bg-primary text-white\">\r\n <h5 class=\"mb-0 d-flex align-items-center\">\r\n <i class=\"fas fa-user-edit me-2\"></i> ویرایش پروفایل\r\n </h5>\r\n </BCardHeader>\r\n <BCardBody class=\"p-4\">\r\n <form @submit.prevent=\"saveUserInfo\">\r\n <!-- Name input -->\r\n <BRow class=\"mb-4\">\r\n <BCol sm=\"12\">\r\n <label for=\"userName\" class=\"form-label\">\r\n <i class=\"fas fa-user me-2\"></i> نام کاربری\r\n </label>\r\n <BFormInput\r\n id=\"userName\"\r\n v-model=\"userName\"\r\n type=\"text\"\r\n placeholder=\"نام خود را وارد کنید\"\r\n required\r\n class=\"form-control\"\r\n />\r\n </BCol>\r\n </BRow>\r\n\r\n <!-- Password input (optional) -->\r\n <BRow class=\"mb-4\">\r\n <BCol sm=\"12\">\r\n <label for=\"userPassword\" class=\"form-label\">\r\n <i class=\"fas fa-key me-2\"></i> رمز عبور\r\n </label>\r\n <BFormInput\r\n id=\"userPassword\"\r\n v-model=\"userPassword\"\r\n type=\"password\"\r\n placeholder=\"رمز عبور جدید را وارد کنید\"\r\n class=\"form-control\"\r\n />\r\n </BCol>\r\n </BRow>\r\n\r\n <BRow class=\"text-center\">\r\n <BCol sm=\"12\">\r\n <BButton\r\n type=\"submit\"\r\n variant=\"success\"\r\n class=\"px-4 py-2\"\r\n :disabled=\"loading\"\r\n >\r\n <i v-if=\"!loading\" class=\"fas fa-save me-2\"></i>\r\n <span\r\n v-if=\"loading\"\r\n class=\"spinner-border spinner-border-sm me-2\"\r\n role=\"status\"\r\n aria-hidden=\"true\"\r\n ></span>\r\n ذخیره\r\n </BButton>\r\n </BCol>\r\n </BRow>\r\n </form>\r\n </BCardBody>\r\n </BCard>\r\n </BCol>\r\n </BRow>\r\n </Layout>\r\n</template>\r\n\r\n<style scoped>\r\nh5 {\r\n font-size: 1.5rem;\r\n font-weight: bold;\r\n}\r\n\r\nlabel {\r\n font-weight: 500;\r\n}\r\n\r\n.BButton {\r\n font-size: 1rem;\r\n}\r\n\r\n.shadow-sm {\r\n box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1) !important;\r\n}\r\n\r\n.BCardHeader {\r\n border-bottom: none !important;\r\n}\r\n\r\n.BCardBody {\r\n background-color: #f8f9fa;\r\n}\r\n</style>\r\n"],"mappings":";;EAAAA,GAAA;EA8HuCC,KAAK,EAAC;;;EA9H7CD,GAAA;EAiIsBC,KAAK,EAAC,uCAAuC;EAC7CC,IAAI,EAAC,QAAQ;EACb,aAAW,EAAC;;;;;;;;;;;uBAzDhCC,YAAA,CAoESC,iBAAA;IA9IXC,OAAA,EAAAC,QAAA,CA2EI,MAkEO,CAlEPC,YAAA,CAkEOC,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