feat: add btn cancel
This commit is contained in:
parent
f12c9e9df6
commit
b36caa48e2
2 changed files with 37 additions and 16 deletions
|
|
@ -41,6 +41,7 @@ import {
|
|||
SaveButton,
|
||||
UndoButton,
|
||||
EditButton,
|
||||
CancelButton,
|
||||
} from 'src/components/button';
|
||||
import { RequestWork } from 'src/stores/request-list/types';
|
||||
import { storeToRefs } from 'pinia';
|
||||
|
|
@ -893,6 +894,20 @@ function storeDataLocal() {
|
|||
window.open(url, '_blank');
|
||||
}
|
||||
|
||||
async function closeTab() {
|
||||
dialogWarningClose(t, {
|
||||
message: t('dialog.message.close'),
|
||||
action: () => {
|
||||
window.close();
|
||||
},
|
||||
cancel: () => {},
|
||||
});
|
||||
}
|
||||
|
||||
function closeAble() {
|
||||
return window.opener !== null;
|
||||
}
|
||||
|
||||
watch(
|
||||
() => pageState.mode,
|
||||
() => toggleMode(pageState.mode),
|
||||
|
|
@ -1267,7 +1282,15 @@ async function submitAccepted() {
|
|||
{{ $t('general.view', { msg: $t('general.example') }) }}
|
||||
</MainButton>
|
||||
|
||||
<div class="row q-gutter-x-sm">
|
||||
<CancelButton
|
||||
outlined
|
||||
id="btn-close"
|
||||
@click="closeTab()"
|
||||
:label="$t('dialog.action.close')"
|
||||
v-if="pageState.mode === 'info' && closeAble()"
|
||||
/>
|
||||
|
||||
<div class="row q-gutter-x-sm q-ml-xs">
|
||||
<UndoButton
|
||||
outlined
|
||||
v-if="pageState.mode === 'edit'"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue