-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(projects): manage page: manage_role
- Loading branch information
1 parent
348b4f6
commit 658dc94
Showing
19 changed files
with
1,281 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<script setup lang="ts" generic="T extends Record<string, unknown>, K = never"> | ||
import { VueDraggable } from 'vue-draggable-plus'; | ||
import { $t } from '@/locales'; | ||
defineOptions({ | ||
name: 'TableColumnSetting' | ||
}); | ||
const columns = defineModel<AntDesign.TableColumnCheck[]>('columns', { | ||
required: true | ||
}); | ||
</script> | ||
|
||
<template> | ||
<APopover placement="bottomRight" trigger="click"> | ||
<AButton size="small"> | ||
<div class="flex-y-center gap-8px"> | ||
<icon-ant-design-setting-outlined class="text-icon" /> | ||
<span>{{ $t('common.columnSetting') }}</span> | ||
</div> | ||
</AButton> | ||
<template #content> | ||
<VueDraggable v-model="columns"> | ||
<div | ||
v-for="item in columns" | ||
:key="item.key" | ||
class="h-36px flex-y-center rd-4px hover:(bg-primary bg-opacity-20)" | ||
> | ||
<icon-mdi-drag class="mr-8px cursor-move text-icon" /> | ||
<ACheckbox v-model:checked="item.checked"> | ||
{{ item.title }} | ||
</ACheckbox> | ||
</div> | ||
</VueDraggable> | ||
</template> | ||
</APopover> | ||
</template> | ||
|
||
<style scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<script setup lang="ts"> | ||
defineOptions({ | ||
name: 'TableHeaderOperation' | ||
}); | ||
interface Props { | ||
disabledDelete?: boolean; | ||
loading?: boolean; | ||
} | ||
defineProps<Props>(); | ||
interface Emits { | ||
(e: 'add'): void; | ||
(e: 'delete'): void; | ||
(e: 'refresh'): void; | ||
} | ||
const emit = defineEmits<Emits>(); | ||
const columns = defineModel<AntDesign.TableColumnCheck[]>('columns', { | ||
default: () => [] | ||
}); | ||
function add() { | ||
emit('add'); | ||
} | ||
function batchDelete() { | ||
emit('delete'); | ||
} | ||
function refresh() { | ||
emit('refresh'); | ||
} | ||
</script> | ||
|
||
<template> | ||
<ASpace wrap class="justify-end lt-sm:w-200px"> | ||
<slot name="prefix"></slot> | ||
<slot name="default"> | ||
<AButton size="small" ghost type="primary" @click="add"> | ||
<div class="flex-y-center gap-8px"> | ||
<icon-ic-round-plus class="text-icon" /> | ||
<span>{{ $t('common.add') }}</span> | ||
</div> | ||
</AButton> | ||
<APopconfirm :description="$t('common.confirmDelete')" :disabled="disabledDelete" @confirm="batchDelete"> | ||
<AButton size="small" danger :disabled="disabledDelete"> | ||
<div class="flex-y-center gap-8px"> | ||
<icon-ic-round-delete class="text-icon" /> | ||
<span>{{ $t('common.batchDelete') }}</span> | ||
</div> | ||
</AButton> | ||
</APopconfirm> | ||
</slot> | ||
<AButton size="small" @click="refresh"> | ||
<div class="flex-y-center gap-8px"> | ||
<icon-mdi-refresh class="text-icon" :class="{ 'animate-spin': loading }" /> | ||
<span>{{ $t('common.refresh') }}</span> | ||
</div> | ||
</AButton> | ||
<TableColumnSetting v-model:columns="columns" /> | ||
<slot name="suffix"></slot> | ||
</ASpace> | ||
</template> | ||
|
||
<style scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { transformRecordToOption } from '@/utils/common'; | ||
|
||
export const enableStatusRecord: Record<Api.Common.EnableStatus, App.I18n.I18nKey> = { | ||
'1': 'page.manage.common.status.enable', | ||
'2': 'page.manage.common.status.disable' | ||
}; | ||
|
||
export const enableStatusOptions = transformRecordToOption(enableStatusRecord); | ||
|
||
export const userGenderRecord: Record<Api.SystemManage.UserGender, App.I18n.I18nKey> = { | ||
'1': 'page.manage.user.gender.male', | ||
'2': 'page.manage.user.gender.female' | ||
}; | ||
|
||
export const userGenderOptions = transformRecordToOption(userGenderRecord); | ||
|
||
export const menuTypeRecord: Record<Api.SystemManage.MenuType, App.I18n.I18nKey> = { | ||
'1': 'page.manage.menu.type.directory', | ||
'2': 'page.manage.menu.type.menu' | ||
}; | ||
|
||
export const menuTypeOptions = transformRecordToOption(menuTypeRecord); | ||
|
||
export const menuIconTypeRecord: Record<Api.SystemManage.IconType, App.I18n.I18nKey> = { | ||
'1': 'page.manage.menu.iconType.iconify', | ||
'2': 'page.manage.menu.iconType.local' | ||
}; | ||
|
||
export const menuIconTypeOptions = transformRecordToOption(menuIconTypeRecord); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { transformRecordToOption } from '@/utils/common'; | ||
|
||
export const yesOrNoRecord: Record<CommonType.YesOrNo, App.I18n.I18nKey> = { | ||
Y: 'common.yesOrNo.yes', | ||
N: 'common.yesOrNo.no' | ||
}; | ||
|
||
export const yesOrNoOptions = transformRecordToOption(yesOrNoRecord); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.