edit.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <n-drawer v-model:show="isShow" width="40%" placement="right">
  3. <n-drawer-content :title="info.username" closable>
  4. <n-descriptions
  5. label-placement="left"
  6. size="small"
  7. :column="1"
  8. bordered
  9. label-style="width: 110px"
  10. >
  11. <n-descriptions-item label="账户ID">{{ info.id }}</n-descriptions-item>
  12. <n-descriptions-item label="账户名">{{ info.username }}</n-descriptions-item>
  13. <n-descriptions-item label="用户名">{{ info.realName }}</n-descriptions-item>
  14. <n-descriptions-item label="令牌">{{ info.token }}</n-descriptions-item>
  15. <n-descriptions-item label="失效时间">{{ info.expiration }}</n-descriptions-item>
  16. <n-descriptions-item label="角色列表">
  17. <n-space>
  18. <n-tag v-for="item in info.roles" :key="item" size="small" type="success">
  19. {{ item.name }}
  20. </n-tag>
  21. </n-space>
  22. </n-descriptions-item>
  23. <n-descriptions-item label="权限列表">
  24. <n-space>
  25. <n-tag v-for="item in info.perms" :key="item" size="small" type="info">
  26. {{ item }}
  27. </n-tag>
  28. </n-space>
  29. </n-descriptions-item>
  30. </n-descriptions>
  31. </n-drawer-content>
  32. </n-drawer>
  33. </template>
  34. <script lang="ts" setup>
  35. import { ref } from 'vue';
  36. const emit = defineEmits(['reload']);
  37. const isShow = ref(false);
  38. let info: any = {
  39. value: '',
  40. tokenType: '',
  41. expiration: '',
  42. refreshToken: '',
  43. principal: {
  44. deptId: '',
  45. enabled: '',
  46. id: '',
  47. password: '',
  48. username: '',
  49. authorities: [],
  50. },
  51. };
  52. async function show(token: any) {
  53. info = token;
  54. isShow.value = true;
  55. }
  56. defineExpose({ show });
  57. </script>
  58. <style scoped lang="less"></style>