You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.4 KiB
62 lines
1.4 KiB
<template>
|
|
<Transfer
|
|
:dataSource="userClaims"
|
|
:targetKeys="targetClaims"
|
|
:titles="[L('Assigned'), L('Available')]"
|
|
:render="(item) => item.title"
|
|
:list-style="getListStyle"
|
|
@change="handleChange"
|
|
/>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { computed, onMounted, ref } from 'vue';
|
|
import { Transfer } from 'ant-design-vue';
|
|
import { getActivedList } from '/@/api/identity/claim';
|
|
import { useLocalization } from '/@/hooks/abp/useLocalization';
|
|
|
|
const emits = defineEmits(['change']);
|
|
const props = defineProps({
|
|
targetClaims: {
|
|
type: [Array] as PropType<string[]>,
|
|
required: true,
|
|
default: () => [],
|
|
},
|
|
listStyle: {
|
|
type: Object,
|
|
required: false,
|
|
},
|
|
});
|
|
|
|
const { L } = useLocalization('AbpIdentityServer');
|
|
const userClaims = ref<
|
|
{
|
|
key: string;
|
|
title: string;
|
|
}[]
|
|
>([]);
|
|
const defaultListStyle = {
|
|
width: '48%',
|
|
height: '500px',
|
|
minHeight: '500px',
|
|
};
|
|
|
|
const getListStyle = computed(() => {
|
|
return {...defaultListStyle, ...props.listStyle}
|
|
});
|
|
|
|
onMounted(() => {
|
|
getActivedList().then((res) => {
|
|
userClaims.value = res.items.map((item) => {
|
|
return {
|
|
key: item.name,
|
|
title: item.name,
|
|
};
|
|
});
|
|
});
|
|
});
|
|
|
|
function handleChange(targetKeys, direction, moveKeys) {
|
|
emits('change', targetKeys, direction, moveKeys);
|
|
}
|
|
</script>
|
|
|