���Root Mod By V1rus_Alfa
User / IP
:
216.73.217.78
Host / Server
:
195.214.235.115 / npln.ir
System
:
Linux damavand.pws-dns.net 5.14.0-503.35.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 4 05:23:43 EDT 2025 x86_64
Command
|
Upload
|
Mass Deface
|
Create
:
/
home2
/
cutunixc
/
.trash
/
pages
/
analyze
/
Viewing: dimensions.vue
<script setup lang="ts"> const { t } = useI18n() const { locale } = useI18n() definePageMeta({ title: '', middleware: ['auth'], }) useHead ({ title: t('Dimensions') }) const feildsOptions = useState<any | []>(); const { $api } = useNuxtApp() const config = useRuntimeConfig(); const loading = ref(false); const sheetsDB = useLocalForage('sheets') const toast = useToast() const localePath = useLocalePath() let form:any = reactive({ 0: { name_sheet:'', width:'183', length:'366', rotation:0, value:1, name:'ورق', name_en:'Sheet Name ' }, 1: { name_sheet:'', width:'183', length:'366', rotation:0, value:2, name:'ورق رنگ 1', name_en:'Sheet color 1' }, 2: { name_sheet:'', width:'183', length:'366', rotation:0, value:3, name:'ورق رنگ 2', name_en:'Sheet color 2' }, 3: { name_sheet:'', width:'183', length:'366', rotation:0, value:4, name:'ورق رنگ 3', name_en:'Sheet color 3' }, 4: { name_sheet:'', width:'183', length:'366', rotation:0, value:5, name:'ورق رنگ 4', name_en:'Sheet color 4' }, 5: { name_sheet:'', width:'183', length:'366', rotation:0, value:6, name:'ورق سه میل', name_en:'Sheet 3 mil' }, 6: { name_sheet:'', width:'183', length:'366', rotation:0, value:7, name:'ورق فومیزه 16 میل', name_en:'Sheet fomize 16 mil' }, 7: { name_sheet:'', width:'183', length:'366', rotation:0, value:8, name:'ورق فومیزه 3 میل', name_en:'Sheet fomize 3 mil' } }) await useAsyncData(async () => { const [feilds]:any = await Promise.all([ $api(config.public.API_URL+'/analyze/materials') ]) if(0 < JSON.parse(feilds).data.materials.length){ feildsOptions.value=JSON.parse(feilds).data.materials } return { feilds }; },{ server:true }) onMounted( async () => { const item:any = await sheetsDB.getItem('new') const res = await JSON.parse(item); if(item && feildsOptions.value.length == Object.keys(res).length){ for (let index = 0; index < Object.keys(res).length; index++) { form[index]={ name_sheet:res[index].name_sheet, width:res[index].width, length:res[index].length, rotation:res[index].rotation, value:res[index].value, name:res[index].name, name_en:res[index].name_en } } }else{ await sheetsDB.removeItem('new') for (let index = 0; index < feildsOptions.value.length; index++) { form[index]={ name_sheet:feildsOptions.value[index].title, width:'183', length:'366', rotation:0, value:feildsOptions.value[index].id, name:feildsOptions.value[index].title, name_en:feildsOptions.value[index].title_en, } } } }) const handelClick = async ()=>{ loading.value=true; for (let index = 0; index < feildsOptions.value.length; index++) { const element = form[index]; if(!element.width){ return toast.add({ title: t("Section ")+(index+1)+' '+t("width ")+t(" is the ")+(locale.value == 'en' ? element.name_en : element.name)+t(" of the required sheet"),color:"orange"}),loading.value=false; } if(!element.length){ return toast.add({ title: t("Section ")+(index+1)+' '+t("length ")+t(" is the ")+(locale.value == 'en' ? element.name_en : element.name)+t(" of the required sheet"),color:"orange"}),loading.value=false; } } await sheetsDB.setItem('new',JSON.stringify(form)) return navigateTo(localePath('/analyze/start')); } </script> <template> <div class="w-[95%] mx-auto lg:w-10/12 "> <div :dir="$i18n.locale == 'en' ? 'ltr' : 'rtl'" class=" w-full gap-3 flex justify-start !pt-1 items-center flex-col "> <div class=" w-full "> <label class="w-8/12 mx-auto flex px-2 h-10 text-black rounded-lg bg-[#f7941d] items-center justify-center"> <span class=" block px-2 text-sm "> {{ t('Sheet Name') }} </span> </label> </div> <div v-for="(row,index) in feildsOptions" class=" w-full flex flex-col gap-3 justify-start items-start border rounded-lg px-3 py-2 bg-gray-100 "> <div class="w-full flex justify-start items-center"> <label :class="$i18n.locale == 'en' ? 'text-left w-40 ' : 'text-right w-24 '" class=" block text-sm bold text-black "> {{ index+1 }}. {{ $i18n.locale == 'en' ? row.title_en : row.title }} </label> </div> <div class=" w-full flex justify-between items-center"> <div class="w-[33%] flex justify-start items-center"> <label class=" w-7/12 text-center block text-sm bold text-black "> {{ t('Sheet Name') }} : </label> <UInput v-model="form[index].name_sheet" variant="outline" class="w-5/12 " type="text" :inputClass="' !h-8 bg-white text-center !shadow-none focus:ring-1 rounded-md focus:ring-orange-600 py-0 text-xs' " /> </div> <div class="w-[33%] flex justify-start items-center"> <label class=" w-7/12 text-center block text-sm bold text-black "> {{ t('Sheet Width') }} : </label> <UInput v-model="form[index].width" variant="outline" inputmode="numeric" type="number" class="w-5/12 " :inputClass="' text-center !h-8 bg-white !shadow-none focus:ring-1 rounded-md focus:ring-orange-600 py-0 text-xs' " /> </div> <div class="w-[33%] flex justify-start items-center"> <label class=" w-7/12 text-center block text-sm bold text-black "> {{ t('Sheet Length') }} : </label> <UInput v-model="form[index].length" variant="outline" inputmode="numeric" type="number" class="w-5/12 " :inputClass="' text-center !h-8 bg-white !shadow-none focus:ring-1 rounded-md focus:ring-orange-600 py-0 text-xs' " /> </div> </div> <div class=" w-full rounded-md flex justify-between items-center "> <div class="w-3/12 h-8 mb-1"> <h2 class=" text-sm bold text-green-800 h-full w-full flex justify-start items-center px-2"> {{ t('rotation') }} : </h2> </div> <div class="w-9/12 flex justify-start items-center rounded h-full"> <URadioGroup :color="'red'" v-model="form[index].rotation" :options="[ { value: 1, label: t('active') }, { value: 0, label: t('deactive') } ]" :ui="{ wrapper: ' w-full', fieldset: 'w-full flex gap-x-3 justify-start items-center' }" /> </div> </div> </div> </div> <footer class=" bg-white flex justify-between items-center pb-2 pt-1 sm:border-r sm:border-l w-full sm:w-9/12 md:w-7/12 lg:w-6/12 2xl:w-5/12 mx-auto fixed bottom-0 right-0 left-0 border-t"> <div class="px-1 w-full"> <UButton @click="handelClick" :loading="loading" square class="w-full flex text-white rounded-sm border h-10 bg-main-700 items-center justify-center"> <span class=" block px-2 text-xs bold truncate "> {{ t('payment_5') }} </span> </UButton> </div> </footer> </div> </template>
Coded With 💗 by
0x6ick Mod By V1rus_Alfa