iam-audit-notice-template-select.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <div :class="$style.mainDiv">
  3. <a-spin tip="内容套打中..." :spinning="spinning">
  4. <ul :class="$style.templateUl">
  5. <li
  6. v-for="template in templateList"
  7. :key="template.id"
  8. :class="{ [$style.checkedLi]: checkedTemp.id === template.id }"
  9. @click="(e) => setChecked(template)"
  10. >
  11. <a-radio :checked="checkedTemp.id === template.id"></a-radio>{{ template.redheadName }}
  12. </li>
  13. </ul>
  14. </a-spin>
  15. </div>
  16. </template>
  17. <script>
  18. import components from './_import-components/iam-audit-notice-template-select-import'
  19. export default {
  20. name: 'IamAuditNoticeTemplateSelect',
  21. metaInfo: {
  22. title: 'IamAuditNoticeTemplateSelect',
  23. },
  24. components: {
  25. ...components,
  26. },
  27. props: {
  28. // 项目ID
  29. projectId: {
  30. type: String,
  31. default: '',
  32. },
  33. // 模板列表
  34. templateList: {
  35. type: Array,
  36. default: () => {
  37. return []
  38. },
  39. },
  40. },
  41. data() {
  42. return {
  43. searchform: 'searchform',
  44. checkedTemp: { id: null },
  45. spinning: false,
  46. }
  47. },
  48. methods: {
  49. // 设置单选选中
  50. setChecked(template) {
  51. this.checkedTemp = template
  52. },
  53. },
  54. }
  55. </script>
  56. <style module lang="scss">
  57. @use '@/common/design' as *;
  58. .main-div {
  59. min-height: 300px;
  60. background: #ffffff;
  61. }
  62. .left-div {
  63. background: #ffffff;
  64. border: 1px solid #e8e8e8;
  65. margin-right: 15px;
  66. }
  67. .right-div {
  68. background: #ffffff;
  69. }
  70. .template-ul {
  71. height: 100%;
  72. margin: 0;
  73. padding: 0;
  74. overflow: auto;
  75. list-style: none;
  76. border: 1px solid #e8e8e8;
  77. li {
  78. min-height: 32px;
  79. padding: 6px 12px;
  80. overflow: hidden;
  81. white-space: nowrap;
  82. text-overflow: ellipsis;
  83. transition: all 0.3s;
  84. cursor: pointer;
  85. border-bottom: 1px solid #e8e8e8;
  86. }
  87. .checked-li {
  88. background-color: #e6f7ff;
  89. }
  90. li:hover {
  91. background-color: #e6f7ff;
  92. cursor: pointer;
  93. }
  94. li:last-child {
  95. border-bottom: none;
  96. }
  97. }
  98. </style>