From 363779a2bc86c41bf6f445f454cb976b4ef24c1f Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Wed, 22 Jan 2025 14:03:14 +0700 Subject: [PATCH 1/3] feat: add ready status of request data --- src/components/StatCardComponent.vue | 11 ++++++----- src/i18n/eng.ts | 1 + src/i18n/tha.ts | 3 ++- src/pages/08_request-list/MainPage.vue | 6 ++++++ src/pages/08_request-list/TableRequestList.vue | 1 + src/stores/request-list/index.ts | 1 + src/stores/request-list/types.ts | 1 + 7 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/components/StatCardComponent.vue b/src/components/StatCardComponent.vue index d39b4a5b..dfd57ed8 100644 --- a/src/components/StatCardComponent.vue +++ b/src/components/StatCardComponent.vue @@ -16,6 +16,7 @@ const props = withDefaults( | 'dark-orange' | 'cyan' | 'yellow' + | 'light-yellow' | 'red' | 'magenta' | 'blue' @@ -45,11 +46,7 @@ const props = withDefaults( >
- +
@@ -116,6 +113,10 @@ const props = withDefaults( --_color: var(--orange-4-hsl); } +.stat-card__light-yellow { + --_color: var(--yellow-6-hsl); +} + .stat-card__orange { --_color: var(--orange-5-hsl); } diff --git a/src/i18n/eng.ts b/src/i18n/eng.ts index f37ae4bc..6635eeb7 100644 --- a/src/i18n/eng.ts +++ b/src/i18n/eng.ts @@ -917,6 +917,7 @@ export default { }, Pending: 'Pending', + Ready: 'Ready', InProgress: 'In Progress', Completed: 'Completed', Canceled: 'Canceled', diff --git a/src/i18n/tha.ts b/src/i18n/tha.ts index aedfe838..9e7d0644 100644 --- a/src/i18n/tha.ts +++ b/src/i18n/tha.ts @@ -908,7 +908,8 @@ export default { Canceled: 'ยกเลิก', }, Pending: 'รอดำเนินการ', - InProgress: 'ดำเนินการ', + Ready: 'พร้อมดำเนินการ', + InProgress: 'กำลังดำเนินการ', Completed: 'เสร็จสิ้น', Canceled: 'ยกเลิก', diff --git a/src/pages/08_request-list/MainPage.vue b/src/pages/08_request-list/MainPage.vue index 7310c54b..98dd2d18 100644 --- a/src/pages/08_request-list/MainPage.vue +++ b/src/pages/08_request-list/MainPage.vue @@ -141,6 +141,12 @@ watch([() => pageState.inputSearch, () => pageState.statusFilter], () => label: 'requestList.status.Pending', color: 'orange', }, + { + icon: 'mdi:tag-check-outline', + count: stats[RequestDataStatus.Pending], + label: 'requestList.status.Ready', + color: 'light-yellow', + }, { icon: 'mdi-timer-sand', count: stats[RequestDataStatus.InProgress], diff --git a/src/pages/08_request-list/TableRequestList.vue b/src/pages/08_request-list/TableRequestList.vue index 60170cd5..6211e893 100644 --- a/src/pages/08_request-list/TableRequestList.vue +++ b/src/pages/08_request-list/TableRequestList.vue @@ -173,6 +173,7 @@ function getEmployeeName( :hsla-color=" { [RequestDataStatus.Pending]: '--orange-5-hsl', + [RequestDataStatus.Ready]: '--yellow-6-hsl', [RequestDataStatus.InProgress]: '--blue-6-hsl', [RequestDataStatus.Completed]: '--green-8-hsl', [RequestDataStatus.Canceled]: '--red-5-hsl', diff --git a/src/stores/request-list/index.ts b/src/stores/request-list/index.ts index 12e63e32..0bce74cb 100644 --- a/src/stores/request-list/index.ts +++ b/src/stores/request-list/index.ts @@ -23,6 +23,7 @@ export const useRequestList = defineStore('request-list', () => { const pageSize = ref(30); const stats = ref>({ [RequestDataStatus.Pending]: 0, + [RequestDataStatus.Ready]: 0, [RequestDataStatus.InProgress]: 0, [RequestDataStatus.Completed]: 0, [RequestDataStatus.Canceled]: 0, diff --git a/src/stores/request-list/types.ts b/src/stores/request-list/types.ts index 6759ad5c..df1b5156 100644 --- a/src/stores/request-list/types.ts +++ b/src/stores/request-list/types.ts @@ -20,6 +20,7 @@ export type RequestData = { export enum RequestDataStatus { Pending = 'Pending', + Ready = 'Ready', InProgress = 'InProgress', Completed = 'Completed', Canceled = 'Canceled', From c68cbffb9cea76466206cff432d80dae3c5ff3ab Mon Sep 17 00:00:00 2001 From: puriphatt Date: Wed, 22 Jan 2025 14:07:35 +0700 Subject: [PATCH 2/3] fix: properties => update property assignment to use index instead of push for better handling --- src/components/dialog/DialogProperties.vue | 18 +++++++++--------- src/pages/04_flow-managment/FlowDialog.vue | 1 - 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/components/dialog/DialogProperties.vue b/src/components/dialog/DialogProperties.vue index 3218b54b..231937d0 100644 --- a/src/components/dialog/DialogProperties.vue +++ b/src/components/dialog/DialogProperties.vue @@ -201,40 +201,40 @@ function changeType(fieldName: string, stepIndex: number) { (p) => p.fieldName === fieldName, ); - if (!idx) return; + if (idx < 0) return; if (defaultPropType === 'date') { - tempStep.value[stepIndex].attributes.properties.push({ + tempStep.value[stepIndex].attributes.properties[idx] = { type: defaultPropType, fieldName, - }); + }; } if (defaultPropType === 'array') { - tempStep.value[stepIndex].attributes.properties.push({ + tempStep.value[stepIndex].attributes.properties[idx] = { type: defaultPropType, fieldName, options: [], - }); + }; } if (defaultPropType === 'string') { - tempStep.value[stepIndex].attributes.properties.push({ + tempStep.value[stepIndex].attributes.properties[idx] = { type: defaultPropType, fieldName, isPhoneNumber: false, phoneNumberLength: 10, - }); + }; } if (defaultPropType === 'number') { - tempStep.value[stepIndex].attributes.properties.push({ + tempStep.value[stepIndex].attributes.properties[idx] = { type: defaultPropType, fieldName, comma: false, decimal: false, decimalPlace: 2, - }); + }; } } diff --git a/src/pages/04_flow-managment/FlowDialog.vue b/src/pages/04_flow-managment/FlowDialog.vue index 112860c4..f2287655 100644 --- a/src/pages/04_flow-managment/FlowDialog.vue +++ b/src/pages/04_flow-managment/FlowDialog.vue @@ -315,7 +315,6 @@ function triggerPropertiesDialog(step: WorkFlowPayloadStep) { v-model:user-in-table="userInTable" v-model:flow-data="flowData" v-model:register-branch-id="registerBranchId" - v-model:messenger-by-area="messengerByArea" @change-status="$emit('changeStatus')" @trigger-properties="triggerPropertiesDialog" /> From 99b39c46307943566a8c9c8c90c4ea84b6fa0658 Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Wed, 22 Jan 2025 14:46:53 +0700 Subject: [PATCH 3/3] fix: wrong stats display --- src/pages/08_request-list/MainPage.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/08_request-list/MainPage.vue b/src/pages/08_request-list/MainPage.vue index 98dd2d18..3330fd26 100644 --- a/src/pages/08_request-list/MainPage.vue +++ b/src/pages/08_request-list/MainPage.vue @@ -143,7 +143,7 @@ watch([() => pageState.inputSearch, () => pageState.statusFilter], () => }, { icon: 'mdi:tag-check-outline', - count: stats[RequestDataStatus.Pending], + count: stats[RequestDataStatus.Ready], label: 'requestList.status.Ready', color: 'light-yellow', },