nociteDetails.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <u-navbar :titleStyle="{ color: '#fff' }" :autoBack="true" title="消息详情" :placeholder="true" :safeAreaInsetTop="true" :bgColor="proxy.$settingStore.themeColor.color">
  3. <template #left>
  4. <view class="u-navbar__content__left__item">
  5. <u-icon name="arrow-left" size="20" color="#fff"></u-icon>
  6. </view>
  7. </template>
  8. </u-navbar>
  9. <view>
  10. <view class="content">
  11. <view class="view-wrap">
  12. 标题: <text class="weight-bold">{{ data?.noticeTitle || '' }}</text>
  13. </view>
  14. <view class="view-wrap">
  15. 作者: <text class="uni-body">{{ data?.author || '' }}</text>
  16. </view>
  17. <view class="view-wrap">
  18. 发送到: <text class="uni-body">{{ data?.deptId ? proxy.$common.mapping("deptName", "deptId", data.deptId, deptList) : '' }}</text>
  19. </view>
  20. <view class="view-wrap">
  21. 内容:
  22. <rich-text :nodes="data?.noticeContent || ''" class="uni-body view-content"></rich-text>
  23. </view>
  24. <view class="view-wrap" v-if="data.fileUrl">
  25. <view v-for="(item, index) in JSON.parse(data.fileUrl)" :key="index" class="fileImg">
  26. <a :href="item.url" style="color: #333;">
  27. <image src="/static/images/system/doc.svg" alt="" v-if="item.name.split('.').pop() == 'doc'" />
  28. <image src="/static/images/system/docx.svg" alt="" v-if="item.name.split('.').pop() == 'docx'" />
  29. <image src="/static/images/system/pdf.svg" alt="" v-if="item.name.split('.').pop() == 'pdf'" />
  30. <image src="/static/images/system/ppt.svg" alt="" v-if="item.name.split('.').pop() == 'ppt'" />
  31. <image src="/static/images/system/pptx.svg" alt="" v-if="item.name.split('.').pop() == 'pptx'" />
  32. <image src="/static/images/system/xls.svg" alt="" v-if="item.name.split('.').pop() == 'xls'" />
  33. <image src="/static/images/system/xlsx.svg" alt="" v-if="item.name.split('.').pop() == 'xlsx'" />
  34. <image src="/static/images/system/zip.svg" alt="" v-if="item.name.split('.').pop() == 'zip'" />
  35. <span>{{ item.name }}</span>
  36. </a>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </template>
  42. <script setup>
  43. /*----------------------------------依赖引入-----------------------------------*/
  44. import { onReady, onLoad, onShow, onNavigationBarButtonTap } from "@dcloudio/uni-app";
  45. import { ref, onMounted, inject, shallowRef, reactive, getCurrentInstance, toRefs } from "vue";
  46. /*----------------------------------接口引入-----------------------------------*/
  47. import { infoOne } from "@/api/common/message.js";
  48. import { listDeptNoAuth } from "@/api/system/user.js";
  49. /*----------------------------------组件引入-----------------------------------*/
  50. /*----------------------------------store引入-----------------------------------*/
  51. /*----------------------------------公共方法引入-----------------------------------*/
  52. /*----------------------------------公共变量-----------------------------------*/
  53. const { proxy } = getCurrentInstance();
  54. /*----------------------------------变量声明-----------------------------------*/
  55. const data = ref();//详情数据
  56. const deptList = ref([]);//部门列表
  57. function init(options) {
  58. listDeptNoAuth().then((res) => {
  59. deptList.value = res.data;
  60. infoOne(options.moduleId).then((requset) => {
  61. data.value = requset.data
  62. });
  63. })
  64. }
  65. onLoad((options) => {
  66. init(options);
  67. });
  68. onShow(() => {
  69. //调用系统主题颜色
  70. proxy.$settingStore.systemThemeColor([1]);
  71. });
  72. </script>
  73. <style scoped lang="scss">
  74. .content {
  75. max-height:calc(100vh - 80px);
  76. padding:10px;
  77. overflow: auto;
  78. }
  79. .view-content {
  80. font-size: 12px;
  81. padding: 12px 0 0;
  82. color: #333;
  83. line-height: 24px;
  84. font-weight: normal;
  85. }
  86. .view-time {
  87. margin: 30px 0 10px;
  88. font-size: 12px;
  89. float: right;
  90. }
  91. .view-wrap{
  92. margin-top:10px;
  93. font-weight: 400;
  94. padding-bottom:8px;
  95. border-bottom:4px solid rgba(243,243,243,1);
  96. .weight-bold{
  97. font-weight: 600;
  98. }
  99. .fileImg{
  100. height:auto;
  101. image{
  102. width:20px;
  103. height:20px;
  104. vertical-align: middle;
  105. }
  106. span{
  107. margin-left:10px;
  108. }
  109. }
  110. }
  111. .view-wrap:nth-child(1){
  112. margin-top:0;
  113. }
  114. </style>