refactor: replace common confirm dialogs with maintenance CRUD dialogs and streamline form handling in MasterDetailMntC.vue and SingleRecordMnt.vue

This commit is contained in:
skytek_xinliang
2026-03-26 16:01:20 +08:00
parent ec3fbace1a
commit 389ec56480
32 changed files with 2549 additions and 2763 deletions
@@ -117,33 +117,65 @@ v-bind="{ ...menuProps, ...tooltipProps }" :aria-label="toolbarActions.settingsL
</v-col>
</template>
<script setup>
<script setup lang="ts">
import { mdiBellOutline, mdiCogOutline, mdiHelp, mdiLogout, mdiMagnify, mdiMenu, mdiMessageTextOutline, mdiPaletteOutline } from '@mdi/js'
import { computed } from 'vue'
import type { AdminLayoutActionType, AdminLayoutFeatures, AdminLayoutSearchConfig, AdminLayoutToolbarActions, AdminLayoutToolbarCounts } from './types'
const props = defineProps({
isMobile: { type: Boolean, default: false },
features: { type: Object, default: () => ({}) },
searchValue: { type: String, default: '' },
searchConfig: { type: Object, default: () => ({}) },
toolbarActions: { type: Object, default: () => ({}) },
toolbarCounts: { type: Object, default: () => ({}) },
logoutLabel: { type: String, default: '' },
themeToggleLabel: { type: String, default: '' },
showFavoritesBar: { type: Boolean, default: true },
showBreadcrumbBar: { type: Boolean, default: true },
interface Props {
isMobile?: boolean
features?: AdminLayoutFeatures
searchValue?: string
searchConfig?: AdminLayoutSearchConfig
toolbarActions?: AdminLayoutToolbarActions
toolbarCounts?: AdminLayoutToolbarCounts
logoutLabel?: string
themeToggleLabel?: string
showFavoritesBar?: boolean
showBreadcrumbBar?: boolean
}
const props = withDefaults(defineProps<Props>(), {
isMobile: false,
features: () => ({
showThemeToggle: false,
showFavorites: true,
showBreadcrumb: true,
showSearch: true,
showToolbarActions: true,
showUserInfo: true,
}),
searchValue: '',
searchConfig: () => ({
placeholder: '',
label: '',
}),
toolbarActions: () => ({
notificationsLabel: '',
messagesLabel: '',
helpLabel: '',
settingsLabel: '',
}),
toolbarCounts: () => ({
notifications: 0,
messages: 0,
}),
logoutLabel: '',
themeToggleLabel: '',
showFavoritesBar: true,
showBreadcrumbBar: true,
})
const emit = defineEmits([
'toggle-drawer',
'update:searchValue',
'search',
'action',
'logout',
'toggle-theme',
'update:showFavoritesBar',
'update:showBreadcrumbBar',
])
const emit = defineEmits<{
'toggle-drawer': []
'update:searchValue': [value: string]
search: []
action: [type: AdminLayoutActionType]
logout: []
'toggle-theme': []
'update:showFavoritesBar': [value: boolean]
'update:showBreadcrumbBar': [value: boolean]
}>()
const searchValueModel = computed({
get: () => props.searchValue,