Info.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <base-dialog @cancel="cancelDialog">
  3. <div slot="header">{{$t('iam.message_content')}}</div>
  4. <div slot="body">
  5. <div class="title mb-3">{{ showTitle }}</div>
  6. <div class="list-item mb-2" v-for="(item, index) in showList" :key="index">
  7. <div class="label">{{ item.label }}:</div>
  8. <div class="value">{{ item.value }}</div>
  9. </div>
  10. </div>
  11. <div slot="footer">
  12. <!-- <a-button type="primary" :loading="loading" @click="cancelDialog">{{ $t('dialog.ok') }}</a-button> -->
  13. <a-button @click="cancelDialog">{{ $t('dialog.cancel') }}</a-button>
  14. </div>
  15. </base-dialog>
  16. </template>
  17. <script>
  18. import DialogMixin from '@/mixins/dialog'
  19. import WindowsMixin from '@/mixins/windows'
  20. export default {
  21. name: 'NotificationViewInfoDialog',
  22. mixins: [DialogMixin, WindowsMixin],
  23. data () {
  24. return {
  25. loading: false,
  26. formItemLayout: {
  27. wrapperCol: {
  28. span: 18,
  29. },
  30. labelCol: {
  31. span: 3,
  32. },
  33. },
  34. content: this.params.data[0].content,
  35. }
  36. },
  37. computed: {
  38. contentList () {
  39. return (this.params.data[0].content || '').replaceAll(':', ':').split('\n')
  40. },
  41. showTitle () {
  42. const list = this.contentList.filter(str => !str.includes(':'))
  43. return list.length ? list[0] : ''
  44. },
  45. showList () {
  46. const list = this.contentList.filter(str => str.includes(':'))
  47. return list.map(str => {
  48. const t = str.split(':')
  49. let value = ''
  50. t.forEach((str, index) => {
  51. if (index === t.length - 1) {
  52. value = value + str
  53. } else if (index !== 0) {
  54. value = value + str + ':'
  55. }
  56. })
  57. return { label: t[0], value }
  58. })
  59. },
  60. },
  61. }
  62. </script>
  63. <style lang="less" scoped>
  64. .title {
  65. font-size: 18px;
  66. font-weight: bold;
  67. }
  68. .list-item {
  69. display: flex;
  70. .label {
  71. flex: 0 0 100px;
  72. }
  73. .value {
  74. flex: 1 1 auto;
  75. }
  76. }
  77. </style>