ClauseNewListPopup.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template>
  2. <cwg-popup v-model:visible="visible" type="center" :mask-click="false" :showFooters="true" custom-class="clause-popup"
  3. :title="title">
  4. <view class="popup-content">
  5. <scroll-view scroll-y class="clause-content">
  6. <cwg-rich-text class="popup-text" :nodes="content" />
  7. </scroll-view>
  8. </view>
  9. <template #footer>
  10. <button @click="close">{{ t('Btn.Cancel') }}</button>
  11. <button type="primary" @click="close">{{ t('Btn.Confirm') }}</button>
  12. </template>
  13. </cwg-popup>
  14. </template>
  15. <script setup>
  16. import { computed } from 'vue';
  17. import { useI18n } from 'vue-i18n';
  18. const props = defineProps({
  19. visible: { type: Boolean, default: false },
  20. content: { type: String, default: '' },
  21. title: { type: String, default: '' }
  22. });
  23. const emit = defineEmits(['update:visible']);
  24. const { t } = useI18n();
  25. const visible = computed({
  26. get: () => props.visible,
  27. set: (val) => emit('update:visible', val)
  28. });
  29. const close = () => { visible.value = false; };
  30. </script>
  31. <style lang="scss" scoped>
  32. @import "@/uni.scss";
  33. .clause-popup {
  34. width: 90%;
  35. max-width: 800px;
  36. .clause-content {
  37. height: px2rpx(400);
  38. overflow-y: auto;
  39. padding: px2rpx(20);
  40. line-height: 1.6;
  41. view {
  42. :deep(*) {
  43. max-width: 100%;
  44. box-sizing: border-box;
  45. }
  46. :deep(p) {
  47. margin-bottom: px2rpx(12);
  48. }
  49. :deep(ul),
  50. :deep(ol) {
  51. margin-left: px2rpx(20);
  52. margin-bottom: px2rpx(12);
  53. :deep(li) {
  54. margin-bottom: px2rpx(6);
  55. }
  56. }
  57. :deep(table) {
  58. width: 100%;
  59. border-collapse: collapse;
  60. margin: px2rpx(16) 0;
  61. :deep(th),
  62. :deep(td) {
  63. border: 1px solid #e4e7ed;
  64. padding: px2rpx(8);
  65. text-align: center;
  66. }
  67. :deep(th) {
  68. font-weight: bold;
  69. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  70. }
  71. }
  72. }
  73. }
  74. }
  75. </style>