Compare commits
2 Commits
ff0304b4d9
...
7776e24ddd
| Author | SHA1 | Date | |
|---|---|---|---|
| 7776e24ddd | |||
| 408724cf67 |
1
.env.development
Normal file
1
.env.development
Normal file
@ -0,0 +1 @@
|
||||
VITE_API_URL=https://panelapi.cekilisevitest.gov.tr/
|
||||
1
.env.localdev
Normal file
1
.env.localdev
Normal file
@ -0,0 +1 @@
|
||||
VITE_API_URL=https://localhost:7241/
|
||||
1
.env.production
Normal file
1
.env.production
Normal file
@ -0,0 +1 @@
|
||||
VITE_API_URL=https://panelapi.cekilisevi.gov.tr/
|
||||
7
env.d.ts
vendored
7
env.d.ts
vendored
@ -1,2 +1,9 @@
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly VITE_API_URL: string;
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
readonly env: ImportMetaEnv;
|
||||
}
|
||||
@ -5,9 +5,12 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"localdev": "vite",
|
||||
"build": "run-p type-check \"build-only {@}\" --",
|
||||
"buildtest": "run-p type-check \"build-only-test {@}\" --",
|
||||
"preview": "vite preview",
|
||||
"build-only": "vite build",
|
||||
"build-only-test": "vite build --mode development",
|
||||
"type-check": "vue-tsc --build --force"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@ -2,7 +2,7 @@ import axios from 'axios'
|
||||
import { useUsersStore } from '@/stores/usersStore'
|
||||
import router from '@/router'
|
||||
|
||||
axios.defaults.baseURL = 'https://panelapi.cekilisevi.gov.tr/'
|
||||
axios.defaults.baseURL = import.meta.env.VITE_API_URL
|
||||
//axios.defaults.timeout = 2000;
|
||||
axios.defaults.headers['Content-Type'] = 'application/json; charset=utf-8'
|
||||
import { useDataStore } from '@/stores/dataStore'
|
||||
|
||||
@ -22,13 +22,20 @@
|
||||
v-if="
|
||||
usersStore.isPanelUser ||
|
||||
(!usersStore.isPanelUser &&
|
||||
piyangoStore.lotteryApprove !== 0 &&
|
||||
piyangoStore.lotteryApprove !== 1 &&
|
||||
piyangoStore.lotteryApprove !== 2 &&
|
||||
piyangoStore.lotteryApprove !== 3 &&
|
||||
!piyangoTeminatStore.isNew)
|
||||
" />
|
||||
<panel-piyango-teminat-durumu
|
||||
v-if="
|
||||
!usersStore.isPanelUser &&
|
||||
(piyangoStore.lotteryApprove === 3 || piyangoTeminatStore.isNew)
|
||||
(piyangoStore.lotteryApprove === 0 ||
|
||||
piyangoStore.lotteryApprove === 1 ||
|
||||
piyangoStore.lotteryApprove === 2 ||
|
||||
piyangoStore.lotteryApprove === 3 ||
|
||||
piyangoTeminatStore.isNew)
|
||||
" />
|
||||
</template>
|
||||
<template #footerButton>
|
||||
@ -43,7 +50,7 @@
|
||||
</panel-wrapper>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, computed,onBeforeMount } from 'vue'
|
||||
import { ref, computed, onBeforeMount } from 'vue'
|
||||
import PanelWrapper from '@/components/PanelWrapper.vue'
|
||||
|
||||
import PanelPiyangoTeminatDurumu from './panel/PanelPiyangoTeminatDurumu.vue'
|
||||
@ -143,10 +150,7 @@
|
||||
])
|
||||
|
||||
const teminatAddAction = computed(() => {
|
||||
if (
|
||||
!usersStore.isPanelUser
|
||||
)
|
||||
return NewTeminatDurum
|
||||
if (!usersStore.isPanelUser) return NewTeminatDurum
|
||||
else return ''
|
||||
})
|
||||
|
||||
|
||||
@ -12,14 +12,26 @@
|
||||
@change="OnKeyup"
|
||||
:disabled="!usersStore.isPanelUser" />
|
||||
|
||||
<template v-if="piyangoTeminatStore.piyangoTeminatFormData.state === 2">
|
||||
<template
|
||||
v-if="
|
||||
piyangoTeminatStore.piyangoTeminatFormData.state === 2 ||
|
||||
piyangoTeminatStore.piyangoTeminatFormData.state === 3
|
||||
">
|
||||
<form-date
|
||||
type="date"
|
||||
half
|
||||
modelKey="iadeTarihi"
|
||||
v-model="piyangoTeminatStore.piyangoTeminatFormData.iadeTarihi"
|
||||
label="İlan Tarihi"
|
||||
:invalidText="piyangoTeminatValidationStore.invalidTexts.iadeTarihi"
|
||||
@change="OnKeyup" />
|
||||
<form-input
|
||||
modelKey="iadeSayi"
|
||||
v-model="piyangoTeminatStore.piyangoTeminatFormData.iadeSayi"
|
||||
half
|
||||
label="Sayısı"
|
||||
@keyup="OnKeyup"
|
||||
:invalidText="piyangoTeminatValidationStore.invalidTexts.iadeSayi" />
|
||||
<form-file
|
||||
v-model="piyangoTeminatStore.piyangoTeminatFormData.iadeFile"
|
||||
elclass="panel-documents-item"
|
||||
|
||||
@ -52,6 +52,11 @@ export const usePiyangoServices = defineStore('piyangoServices', () => {
|
||||
}
|
||||
const GetPiyangoTeminatDurumList = async () => {
|
||||
if (piyangoDataStore.piyangoTeminatDurumlari.length === 0) {
|
||||
/*
|
||||
1: Açık
|
||||
2: İade
|
||||
3: Zaman Aşımı İade
|
||||
*/
|
||||
let data = await dataStore.dataGet('TeminantStates/Durumlar')
|
||||
piyangoDataStore.piyangoTeminatDurumlari = data
|
||||
}
|
||||
|
||||
@ -48,8 +48,9 @@ export const usePiyangoTeminatService = defineStore('piyangoTeminatService', ()
|
||||
)
|
||||
|
||||
if (usersStore.isPanelUser) {
|
||||
if (piyangoTeminatStore.piyangoTeminatFormData.state !== 2) {
|
||||
if (piyangoTeminatStore.piyangoTeminatFormData.state === 1) {
|
||||
piyangoTeminatStore.piyangoTeminatFormData.iadeTarihi = ''
|
||||
piyangoTeminatStore.piyangoTeminatFormData.iadeSayi = ''
|
||||
piyangoTeminatStore.piyangoTeminatFormData.iadeFile = ''
|
||||
}
|
||||
dataForm.append(
|
||||
|
||||
@ -25,6 +25,7 @@ export const usePiyangoTeminatStore = defineStore('piyangoTeminatStore', () => {
|
||||
description: '',
|
||||
file: '',
|
||||
iadeTarihi: '',
|
||||
iadeSayi: '',
|
||||
iadeFile: ''
|
||||
})
|
||||
|
||||
|
||||
@ -30,6 +30,12 @@ export const usePiyangoTeminatValidationStore = defineStore(
|
||||
'iadeTarihi',
|
||||
'Lütfen iade tarihini seçiniz.'
|
||||
)
|
||||
validationStore.IsFieldEmpty(
|
||||
piyangoTeminatStore.piyangoTeminatFormData,
|
||||
invalidTexts,
|
||||
'iadeSayi',
|
||||
'Lütfen iade sayı no giriniz.'
|
||||
)
|
||||
}
|
||||
|
||||
validationStore.IsFieldEmpty(
|
||||
|
||||
@ -8,7 +8,7 @@ export const useDataStore = defineStore('dataStore', () => {
|
||||
const globalDataStore = useGlobalDataStore()
|
||||
const toastStore = useToastStore()
|
||||
|
||||
const siteBase = ref<string>('https://panelapi.cekilisevi.gov.tr/')
|
||||
const siteBase = ref<string>(import.meta.env.VITE_API_URL)
|
||||
const apiBase = ref<string>('api/')
|
||||
const panelData = reactive<Record<string, any>>({})
|
||||
const pageData = reactive<Record<string, any>>({})
|
||||
@ -40,7 +40,7 @@ export const useDataStore = defineStore('dataStore', () => {
|
||||
}
|
||||
|
||||
const response = await axios.get(apiBase.value + api, sendData)
|
||||
//console.log('response --', api, response)
|
||||
console.log('response --', api, response)
|
||||
|
||||
if (data.full !== undefined && data.full) {
|
||||
return response
|
||||
@ -49,7 +49,7 @@ export const useDataStore = defineStore('dataStore', () => {
|
||||
}
|
||||
} catch (error: any) {
|
||||
CheckApiError(error.response.status, error.response.data)
|
||||
//console.error('Hata oluştu -:', error)
|
||||
console.error('Hata oluştu -:', error)
|
||||
return 'errorfalse'
|
||||
}
|
||||
}
|
||||
@ -86,7 +86,7 @@ export const useDataStore = defineStore('dataStore', () => {
|
||||
} catch (error: any) {
|
||||
CheckApiError(error.response.status, error.response.data)
|
||||
|
||||
//console.error('Hata oluştu:', error)
|
||||
console.error('Hata oluştu:', error)
|
||||
return Promise.resolve('errorfalse')
|
||||
}
|
||||
}
|
||||
@ -122,7 +122,7 @@ export const useDataStore = defineStore('dataStore', () => {
|
||||
} catch (error: any) {
|
||||
CheckApiError(error.response.status, error.response.data)
|
||||
|
||||
//console.error('Hata oluştu:', error)
|
||||
console.error('Hata oluştu:', error)
|
||||
return Promise.resolve('errorfalse')
|
||||
}
|
||||
}
|
||||
@ -156,7 +156,7 @@ export const useDataStore = defineStore('dataStore', () => {
|
||||
}
|
||||
} catch (error: any) {
|
||||
CheckApiError(error.response.status, error.response.data)
|
||||
//console.error('Hata oluştu:', error)
|
||||
console.error('Hata oluştu:', error)
|
||||
return Promise.resolve('errorfalse')
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,5 +11,8 @@ export default defineConfig({
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||
}
|
||||
},
|
||||
esbuild: {
|
||||
drop: process.env.NODE_ENV === 'production' ? ['console', 'debugger'] : []
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user