iam-quick-link.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <div :class="$style.worklink" :title="name" @click="open">
  3. <div :class="$style.linkblock">
  4. <span>
  5. <sd-icon v-if="icon" :type="JSON.parse(icon).name" :theme="JSON.parse(icon).theme" /><em>{{
  6. name
  7. }}</em>
  8. </span>
  9. </div>
  10. </div>
  11. </template>
  12. <script>
  13. import components from './_import-components/iam-quick-link-import'
  14. export default {
  15. name: 'IamQuickLink',
  16. components,
  17. props: {
  18. name: {
  19. type: String,
  20. default: '',
  21. },
  22. url: {
  23. type: String,
  24. default: undefined,
  25. },
  26. icon: {
  27. type: String,
  28. default: '',
  29. },
  30. },
  31. data() {
  32. return {}
  33. },
  34. created() {},
  35. methods: {
  36. open() {
  37. // 以 sd-ssologin 为首的单点登录
  38. if (this.url.startsWith('/sd-ssologin')) {
  39. const newWindow = window.open(this.url.split('=')[1], '_blank')
  40. newWindow.opener = null
  41. return
  42. }
  43. this.$router.push(this.url)
  44. },
  45. },
  46. }
  47. </script>
  48. <style module lang="scss">
  49. @use '@/common/design' as *;
  50. .theme {
  51. color: $primary-3;
  52. }
  53. /* stylelint-disable */
  54. main[class*='oa-home'] .worklink {
  55. height: calc((50vh - 282px) / 3);
  56. min-height: 38px;
  57. margin-top: 9px;
  58. }
  59. /* stylelint-enable */
  60. .worklink {
  61. position: relative;
  62. display: flex;
  63. align-items: center;
  64. justify-content: space-around;
  65. justify-content: space-evenly;
  66. width: 30%;
  67. height: 70px;
  68. margin-top: $padding-md;
  69. cursor: pointer;
  70. background: $layout-body-background;
  71. border: $border-width-base $border-style-base $border-color-base;
  72. border-radius: $border-radius-base * 1.25;
  73. .linkblock {
  74. display: grid;
  75. width: 100%;
  76. padding: 0 15px;
  77. }
  78. span {
  79. display: block;
  80. width: 100%;
  81. overflow: hidden;
  82. text-overflow: ellipsis;
  83. white-space: nowrap;
  84. em {
  85. font-style: normal;
  86. }
  87. }
  88. i {
  89. margin-right: 5px;
  90. font-size: $font-size-base * 1.25;
  91. }
  92. }
  93. </style>