fix: cancel text and icon
This commit is contained in:
parent
c9cf2053f3
commit
d3bd7b986e
5 changed files with 40 additions and 2 deletions
|
|
@ -11,8 +11,11 @@ const props = withDefaults(
|
|||
hideToggle?: boolean;
|
||||
hideEdit?: boolean;
|
||||
hideView?: boolean;
|
||||
hideDelete?: boolean;
|
||||
useLink?: boolean;
|
||||
useUpload?: boolean;
|
||||
useCancel?: boolean;
|
||||
disableCancel?: boolean;
|
||||
disableDelete?: boolean;
|
||||
}>(),
|
||||
{
|
||||
|
|
@ -27,6 +30,7 @@ defineEmits<{
|
|||
(e: 'link'): void;
|
||||
(e: 'upload'): void;
|
||||
(e: 'delete'): void;
|
||||
(e: 'cancel'): void;
|
||||
(e: 'changeStatus'): void;
|
||||
}>();
|
||||
|
||||
|
|
@ -138,7 +142,7 @@ watch(
|
|||
</q-item>
|
||||
|
||||
<q-item
|
||||
v-if="status !== 'INACTIVE'"
|
||||
v-if="status !== 'INACTIVE' && !hideDelete"
|
||||
v-close-popup
|
||||
dense
|
||||
class="row"
|
||||
|
|
@ -166,6 +170,34 @@ watch(
|
|||
</span>
|
||||
</q-item>
|
||||
|
||||
<q-item
|
||||
v-close-popup
|
||||
dense
|
||||
class="row"
|
||||
style="white-space: nowrap"
|
||||
:clickable="!disableDelete"
|
||||
:id="`btn-kebab-delete-${idName}`"
|
||||
:class="{
|
||||
'surface-3': disableCancel,
|
||||
'app-text-muted': disableCancel,
|
||||
}"
|
||||
@click.stop="() => $emit('cancel')"
|
||||
>
|
||||
<q-icon
|
||||
size="xs"
|
||||
name="mdi-cancel"
|
||||
class="col-3"
|
||||
:class="{
|
||||
'app-text-negative': !disableCancel,
|
||||
}"
|
||||
/>
|
||||
<span class="col-9 q-px-md flex items-center">
|
||||
<slot name="labelDelete">
|
||||
{{ $t('general.cancel') }}
|
||||
</slot>
|
||||
</span>
|
||||
</q-item>
|
||||
|
||||
<q-item v-if="!hideToggle" dense>
|
||||
<q-item-section class="q-py-sm">
|
||||
<div class="q-pa-sm surface-2 rounded flex items-center">
|
||||
|
|
|
|||
|
|
@ -307,6 +307,8 @@ export default {
|
|||
'Duplicate data found. Do you want to use the data from the document?',
|
||||
|
||||
duplicateInformation: 'Data found in the system',
|
||||
cancel:
|
||||
'Are you sure you want to continue? Cancel action cannot be undone.',
|
||||
},
|
||||
info: {
|
||||
cantChange:
|
||||
|
|
|
|||
|
|
@ -303,6 +303,8 @@ export default {
|
|||
'คุณมีการเปลี่ยนแปลงที่ยังไม่ได้บันทึก คุณต้องการปิดหน้าต่างนี้หรือไม่',
|
||||
message: 'พบข้อมูลซ้ำกันต้องการใช้ข้อมูลจากเอกสารหรือไม่',
|
||||
duplicateInformation: 'พบข้อมูลในระบบ',
|
||||
cancel:
|
||||
'คุณแน่ใจหรือไม่ว่าต้องการดำเนินการต่อ? รายการนี้จะถูกยกเลิกและไม่สามารถย้อนกลับได้',
|
||||
},
|
||||
info: {
|
||||
cantChange:
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ async function fetchStats() {
|
|||
|
||||
function triggerCancel(id: string) {
|
||||
dialogWarningClose(t, {
|
||||
message: t('form.warning.cancel'),
|
||||
action: async () => {
|
||||
const res = await requestListStore.cancelRequest(id);
|
||||
if (res) {
|
||||
|
|
|
|||
|
|
@ -160,7 +160,8 @@ function getEmployeeName(
|
|||
hide-edit
|
||||
hide-toggle
|
||||
hide-view
|
||||
@delete="$emit('delete', props.row)"
|
||||
hide-delete
|
||||
@cancel="$emit('delete', props.row)"
|
||||
/>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue