agreement.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <template>
  2. <div class="ml-[20px] min-h-[70vh] px-[20px] py-[30px] w-[1000px] bg-[#fff] rounded-[var(--rounded-big)]">
  3. <div>
  4. <div>
  5. <template v-if="agreement">
  6. <div class="main-container" v-if="agreement.title && agreement.content">
  7. <h2 class="text-center">{{ agreement.title }}</h2>
  8. <div v-html="agreement.content"></div>
  9. </div>
  10. <el-empty :description="t('protocolNotConfigured')" :image-size="200" :image="img('static/resource/images/system/empty.png')" v-else />
  11. </template>
  12. </div>
  13. </div>
  14. </div>
  15. </template>
  16. <script lang="ts" setup>
  17. import { ref, reactive, computed,watch } from 'vue'
  18. import { getAgreementInfo } from '@/app/api/system'
  19. import { useRoute } from 'vue-router';
  20. const agreement = ref<any | null>(null)
  21. const route = useRoute()
  22. watch(() => route.query.key, (newVal, oldVal) => {
  23. if(route.query.key){
  24. getAgreementInfo(route.query.key).then(({ data }) => {
  25. agreement.value = data
  26. useHead({
  27. title: data.title
  28. })
  29. }).catch(err => {
  30. })
  31. }
  32. },{immediate: true})
  33. </script>
  34. <style lang="scss" scoped></style>