feat: Implement the core Anjungan queue display system, including clinic room, entry, and counter queues, along with new stores, pages, and API endpoints.

This commit is contained in:
Fanrouver
2026-02-18 12:00:30 +07:00
parent f78bbea4b0
commit 7d07a4f00d
18 changed files with 38 additions and 38 deletions

No files matched your search

+1 -1
View File
@@ -9,7 +9,7 @@ export const useAntreanMasukScreenStore = defineStore('antreanMasukScreen', () =
id: 1,
namaScreen: "Layar Antrean Masuk 1",
nomorScreen: "AM-001",
loket: [1, 2], // Array of loket IDs
loket: [1, 2, 12, 14], // Array of loket IDs
},
{
id: 2,
+1 -1
View File
@@ -773,7 +773,7 @@ export const useClinicStore = defineStore('clinic', () => {
try {
console.log(`🔄 Fetching clinics from API (Try ${retryCount + 1})...`);
const response = await fetch('http://10.10.150.131:8089/api/v1/klinik/reguler');
const response = await fetch('http://10.10.123.140:8089/api/v1/klinik/reguler');
if (!response.ok) {
// Handle Rate Limiting with exponential backoff
+1 -1
View File
@@ -67,7 +67,7 @@ export const useDoctorStore = defineStore('doctor', () => {
for (let i = 0; i <= retries; i++) {
try {
data = await $fetch(
`http://10.10.150.131:8089/api/v1/dokter/${idklinik}`,
`http://10.10.123.140:8089/api/v1/dokter/${idklinik}`,
{ timeout: 5000 }
);
lastError = null;
+2 -2
View File
@@ -296,7 +296,7 @@ export const useLoketStore = defineStore('loket', () => {
try {
console.log(`🔄 [loketStore] Fetching loket configuration (Try ${retryCount + 1})...`);
const response = await fetch('http://10.10.150.131:8089/api/v1/klinik/loket');
const response = await fetch('http://10.10.123.140:8089/api/v1/klinik/loket');
if (!response.ok) {
if (response.status === 429 && retryCount < 3) {
@@ -435,7 +435,7 @@ export const useLoketStore = defineStore('loket', () => {
try {
console.log(`🔄 [loketStore] Fetching detail for loket ${loketId}...`);
const response = await fetch(`http://10.10.150.131:8089/api/v1/loket/${loketId}`);
const response = await fetch(`http://10.10.123.140:8089/api/v1/loket/${loketId}`);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
+2 -2
View File
@@ -10,7 +10,7 @@ export const usePermissionStore = defineStore("permission", {
const parts = path.split("/").filter(Boolean);
const group = parts[1] || "";
const role = parts.at(-1)?.toLowerCase() || "";
const url = `http://10.10.150.131:8080/api/permission?roles=${role}&groups=${group}`;
const url = `http://10.10.123.140:8089/api/permission?roles=${role}&groups=${group}`;
const { data } = await useFetch(url);
this.data = data.value;
},
@@ -18,4 +18,4 @@ export const usePermissionStore = defineStore("permission", {
return this.data?.[action] === true;
},
},
});
});
+15 -15
View File
@@ -350,7 +350,7 @@ export const useQueueStore = defineStore('queue', () => {
};
const config = useRuntimeConfig();
const wsBaseUrl = config.public?.wsBaseUrl || "ws://10.10.150.100:8084/api/v1/ws";
const wsBaseUrl = config.public?.wsBaseUrl || "ws://10.10.123.135:8084/api/v1/ws";
const { connect, disconnect, sendViaPost, isConnected } = useWebSocket({
url: wsBaseUrl,
@@ -640,7 +640,7 @@ export const useQueueStore = defineStore('queue', () => {
try {
console.log(`🔄 [queueStore] Fetching patients for loket ${loketId}...`);
const response = await fetch(`http://10.10.150.131:8089/api/v1/loket/${loketId}`);
const response = await fetch(`http://10.10.123.140:8089/api/v1/loket/${loketId}`);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
@@ -1620,7 +1620,7 @@ export const useQueueStore = defineStore('queue', () => {
// POST to external API when patient is called
try {
fetch('http://10.10.150.131:8089/api/v1/tiket/update', {
fetch('http://10.10.123.140:8089/api/v1/tiket/update', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@@ -1731,7 +1731,7 @@ export const useQueueStore = defineStore('queue', () => {
// POST to external API when patient is called
try {
const response = await fetch('http://10.10.150.131:8089/api/v1/tiket/update', {
const response = await fetch('http://10.10.123.140:8089/api/v1/tiket/update', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@@ -1789,7 +1789,7 @@ export const useQueueStore = defineStore('queue', () => {
// POST to external API when patient finishes at loket
try {
fetch('http://10.10.150.131:8089/api/v1/tiket/selesai', {
fetch('http://10.10.123.140:8089/api/v1/tiket/selesai', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@@ -1860,7 +1860,7 @@ export const useQueueStore = defineStore('queue', () => {
// POST to external API and WAIT for response
try {
const response = await fetch('http://10.10.150.131:8089/api/v1/tiket/update', {
const response = await fetch('http://10.10.123.140:8089/api/v1/tiket/update', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@@ -1952,7 +1952,7 @@ export const useQueueStore = defineStore('queue', () => {
// POST to external API and WAIT for response
try {
const response = await fetch('http://10.10.150.131:8089/api/v1/tiket/update', {
const response = await fetch('http://10.10.123.140:8089/api/v1/tiket/update', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@@ -2035,7 +2035,7 @@ export const useQueueStore = defineStore('queue', () => {
// POST to external API to revert status to sedang diproses (status 8)
try {
fetch('http://10.10.150.131:8089/api/v1/tiket/update', {
fetch('http://10.10.123.140:8089/api/v1/tiket/update', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@@ -2095,7 +2095,7 @@ export const useQueueStore = defineStore('queue', () => {
// POST to external API when patient is being processed (sedang diproses)
try {
fetch('http://10.10.150.131:8089/api/v1/tiket/update', {
fetch('http://10.10.123.140:8089/api/v1/tiket/update', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@@ -2658,7 +2658,7 @@ export const useQueueStore = defineStore('queue', () => {
case "selesai":
// Send API call to finish endpoint
try {
const apiUrl = 'http://10.10.150.100:8084/api/v1/visit/status/finish';
const apiUrl = 'http://10.10.123.135:8084/api/v1/visit/status/finish';
const requestBody = {
patient_visit_healthcare_service_id: patient.healthcareServiceId,
visit_code: patient.barcode || patient.visitCode,
@@ -2906,7 +2906,7 @@ export const useQueueStore = defineStore('queue', () => {
/**
* Register REGULER patient via API
* POST to http://10.10.150.131:8089/api/v1/tiket/generate
* POST to http://10.10.123.140:8089/api/v1/tiket/generate
*/
const registerRegulerPatientViaApi = async (clinic, paymentType, visitType = 'SEKARANG', isFastTrack = false, fastTrackData = null) => {
try {
@@ -2988,7 +2988,7 @@ export const useQueueStore = defineStore('queue', () => {
console.log('📤 [queueStore] API Body:', body);
// 3. Call API
const response = await fetch('http://10.10.150.131:8089/api/v1/tiket/generate', {
const response = await fetch('http://10.10.123.140:8089/api/v1/tiket/generate', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
@@ -3079,7 +3079,7 @@ export const useQueueStore = defineStore('queue', () => {
/**
* Check-in patient via API
* POST to http://10.10.150.131:8089/api/v1/tiket/checkin
* POST to http://10.10.123.140:8089/api/v1/tiket/checkin
*/
const checkInPatientViaApi = async (barcode) => {
try {
@@ -3095,7 +3095,7 @@ export const useQueueStore = defineStore('queue', () => {
console.log('📤 [queueStore] Check-in API Body:', body);
const response = await fetch('http://10.10.150.131:8089/api/v1/tiket/checkin', {
const response = await fetch('http://10.10.123.140:8089/api/v1/tiket/checkin', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
@@ -3368,4 +3368,4 @@ export const useQueueStore = defineStore('queue', () => {
return value;
},
},
});
});
+1 -1
View File
@@ -336,7 +336,7 @@ export const useRuangStore = defineStore('ruang', () => {
const allClinics = clinicStore.clinics;
// 2. Fetch room data from new API
const response = await fetch('http://10.10.150.131:8089/api/v1/loket/ruang');
const response = await fetch('http://10.10.123.140:8089/api/v1/loket/ruang');
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
+1 -1
View File
@@ -16,7 +16,7 @@ export const useVerificationStore = defineStore('verification', () => {
const url = config.public.verificationApiBaseUrl;
if (!url) {
console.warn('verificationApiBaseUrl is undefined in runtimeConfig, using fallback');
return 'http://10.10.150.131:8089/api/v1';
return 'http://10.10.123.140:8089/api/v1';
}
return url;
};