1
0

noticeFile.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <scroll-view>
  3. <view class="detail content">
  4. <view class="title">通知公告</view>
  5. <u-line length="95%" margin="auto" color="#000"/>
  6. <scroll-view scroll-y="true" style="padding: 30rpx 60rpx;box-sizing: border-box;height: calc(100vh - 900rpx);">
  7. <view v-for="(it,idx) in info" :key="idx" class="detailItem" v-if="info.length">
  8. <view v-if="!isCardInfo">{{it.GGBT}}</view>
  9. <view v-if="!isCardInfo">{{it.FBSJ ? it.FBSJ.slice(0,10) : null}}</view>
  10. <view v-if="isCardInfo">{{it.WJBT}}</view>
  11. <view v-if="isCardInfo">{{it.FBRQ ? it.FBRQ.slice(0,10) : null}}</view>
  12. </view>
  13. <view v-else>
  14. 暂无通知。
  15. </view>
  16. </scroll-view>
  17. </view>
  18. <view class="overview content">
  19. <view class="title">已发布文件</view>
  20. <view class="cardList">
  21. <view v-for="(it,idx) in cardList" :key="idx" :style="{'background-color':it.color}" class="card" @click="clickCard(it)">
  22. <view :style="{'background': it.iconColor}">
  23. <image :src="it.icon"></image>
  24. </view>
  25. <view>{{it.text}}</view>
  26. </view>
  27. </view>
  28. </view>
  29. </scroll-view>
  30. </template>
  31. <script setup>
  32. import {ref} from "vue"
  33. import { onReady, onShow } from "@dcloudio/uni-app"
  34. import { ApiRequest } from "@/utils/request.js"
  35. const info = ref([])
  36. const s4 = new SM4Util()
  37. const isCardInfo = ref(false)
  38. const cardList = ref([
  39. {
  40. icon: "../../static/notice/u31.svg",
  41. iconColor: "linear-gradient(to bottom, rgb(0,196,213), rgb(0,218,151))",
  42. text: "党建工作",
  43. color: "rgb(200,245,225)",
  44. code: "P0102"
  45. },
  46. {
  47. icon: "../../static/notice/u32.svg",
  48. iconColor: "linear-gradient(to bottom, rgb(53,153,253), rgb(137,100,244))",
  49. text: "委发文件",
  50. color: "rgb(255,219,224)",
  51. code: "P0103"
  52. },
  53. {
  54. icon: "../../static/notice/u33.svg",
  55. iconColor: "linear-gradient(to bottom, rgb(0,136,255), rgb(0,181,255))",
  56. text: "行政工作",
  57. color: "rgb(207,232,245)",
  58. code: "P0101"
  59. },
  60. {
  61. icon: "../../static/notice/u34.svg",
  62. iconColor: "linear-gradient(to bottom, rgb(226,76,246), rgb(254,86,224))",
  63. text: "相关知识",
  64. color: "rgb(255,236,207)",
  65. code: "P0104"
  66. }
  67. ])
  68. //获取所有通知消息
  69. function getNotice(){
  70. ApiRequest({
  71. url: '/g2app/dataabase/queryDataByColWithPage3',
  72. method: 'POST',
  73. data:{
  74. colums: "ID,GGBT,FBSJ,FBFW",
  75. order: "FBSJ",
  76. pageno: 1,
  77. pagesize: 999,
  78. sqlwhere: "and FBZT=1 and GGBK='C01' and (FBFWMANUSERID like '%0c67561f-5d0d-48fd-a90b-90d69a98fbac%' or FBFWMANUSERID='全部')",
  79. tablename: "SX_TZGG"
  80. }
  81. }).then(res=>{
  82. if(res.code === 0 && res.success){
  83. info.value = res.data
  84. }
  85. })
  86. }
  87. //点击卡片获取通知
  88. function clickCard(it){
  89. isCardInfo.value = true
  90. ApiRequest({
  91. url: '/g2app/dataabase/queryMainDataAndChildDataWithPage',
  92. method: 'POST',
  93. data: JSON.stringify({
  94. data: s4.encryptData_CBC(JSON.stringify({
  95. tablename: "SX_FBLIST",
  96. pageno: 1,
  97. pagesize: 999,
  98. childtablename: "SX_FBLIST_02",
  99. colums: "ID,WJBT,FBBM,LM ,GKFW,FBRQ",
  100. childcolums: "TOP 1 ID,USERID,READSTATUS",
  101. order: "FBRQ desc",
  102. sqlwhere: `and LM in('${it.code}') and ( GKFW ISNULL OR GKFW LIKE '0c67561f-5d0d-48fd-a90b-90d69a98fbac')`
  103. }))
  104. })
  105. }).then(obj=>{
  106. let res = strToJson(s4.decryptData_CBC(obj.data))
  107. info.value = res.data
  108. })
  109. }
  110. onReady(()=>{
  111. getNotice()
  112. })
  113. </script>
  114. <style lang="scss" scoped>
  115. body{
  116. background-color: #0063d0;
  117. }
  118. .content{
  119. margin: 50rpx;
  120. background-color: #fff;
  121. border-radius: 20rpx;
  122. width: calc(100vw - 100rpx);
  123. }
  124. .title{
  125. padding: 30rpx 60rpx;
  126. font-size: 50rpx;
  127. font-weight: 600;
  128. }
  129. .detail{
  130. height: calc(100vh - 750rpx);
  131. .detailItem{
  132. display: flex;
  133. justify-content: space-between;
  134. font-size: 40rpx;
  135. >uni-view{
  136. margin: 20rpx 0;
  137. }
  138. }
  139. }
  140. .overview{
  141. height: 500rpx;
  142. .cardList{
  143. height: 50%;
  144. border-radius: 10rpx;
  145. display: flex;
  146. justify-content: space-around;
  147. .card{
  148. width: 23%;
  149. display: flex;
  150. justify-content: center;
  151. align-items: center;
  152. font-weight: 500;
  153. border-radius: 10rpx;
  154. >uni-view:nth-of-type(1){
  155. width: 150rpx;
  156. height: 150rpx;
  157. margin-right: 100rpx;
  158. border-radius: 20rpx;
  159. display: flex;
  160. justify-content: center;
  161. align-items: center;
  162. }
  163. uni-image{
  164. width: 70rpx;
  165. height: 70rpx;
  166. }
  167. }
  168. }
  169. }
  170. </style>