阅行客电子档案
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

301 lines
8.2 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="message-center-list">
  3. <div v-if="hasMore" class="more-btn" @click="loadMore"><i class="iconfont icon-jiazaigengduo" />点击加载更多</div>
  4. <div v-for="(item,index) in items" :key="index" class="message-item" @click="handleDetail(item)">
  5. <div class="message-date">{{ item.createTime | parseTime }}</div>
  6. <div class="message-cont">
  7. <div class="message-cont-info">
  8. <span :class="['message-type-title',{'type-title1': isIndex === 0 },{'type-title2': isIndex === 1 },{'type-title3': isIndex === 2 },{'type-title4': isIndex === 3 }]">{{ titleType }}</span>
  9. <span class="is-read-tip">{{ item.isRead === 0 ? '未读' : '已读' }}</span>
  10. <div class="message-title">{{ item.noticeTitle }}</div>
  11. <ul class="message-list-info">
  12. <li>创建人{{ item.createBy }}</li>
  13. <li>创建时间{{ item.createTime | parseTime }}</li>
  14. </ul>
  15. </div>
  16. <div class="message-more">查看详情<i class="iconfont icon-chakan" /></div>
  17. </div>
  18. </div>
  19. <el-dialog :visible.sync="messageVisible" :modal-append-to-body="false" :close-on-click-modal="false" append-to-body title="消息详情">
  20. <div class="setting-dialog">
  21. <div class="message-detail">
  22. <span :class="['message-type-title',{'type-title1': isIndex === 0 },{'type-title2': isIndex === 1 },{'type-title3': isIndex === 2 },{'type-title4': isIndex === 3 }]">{{ titleType }}</span>
  23. <span class="detail-date">{{ detailInfo && detailInfo.create_by }} {{ detailInfo && detailInfo.create_time | parseTime }}</span>
  24. <div class="message-title">{{ detailInfo && detailInfo.noticeTitle }}</div>
  25. <el-input v-model="detailInfo.noticeContext" placeholder="请输入" type="textarea" :rows="10" />
  26. </div>
  27. <div slot="footer" class="dialog-footer">
  28. <el-button v-if="detailInfo.noticeType === 1" @click="dealWithCont">流程处理</el-button>
  29. <el-button type="primary" @click="messageVisible=false">确定</el-button>
  30. </div>
  31. </div>
  32. </el-dialog>
  33. <detail ref="detail" />
  34. </div>
  35. </template>
  36. <script>
  37. import { FetchInitNoticeDetails } from '@/api/system/new'
  38. import detail from '../../processCenter/module/form'
  39. export default {
  40. name: 'MessageList',
  41. components: { detail },
  42. props: {
  43. listIndex: {
  44. type: Number,
  45. default: 0
  46. },
  47. items: {
  48. type: Array,
  49. default: function() {
  50. return []
  51. }
  52. }
  53. },
  54. data() {
  55. return {
  56. isIndex: 0,
  57. titleType: '系统通知',
  58. messageVisible: false,
  59. opinionTxt: '',
  60. loading: false, // 是否正在加载中
  61. hasMore: true, // 是否还有更多数据
  62. currentPage: 1,
  63. pageSize: 10,
  64. detailInfo: {}
  65. }
  66. },
  67. watch: {
  68. listIndex: function(newValue, oldValue) {
  69. this.isIndex = newValue
  70. this.getIndex()
  71. }
  72. },
  73. created() {
  74. // this.loadData()
  75. },
  76. mounted() {
  77. },
  78. methods: {
  79. // 加载数据方法
  80. loadData() {
  81. this.loading = true
  82. setTimeout(() => {
  83. const newData = Array.from(Array(this.pageSize), (_, index) => {
  84. const key = (this.currentPage - 1) * this.pageSize + index
  85. return {
  86. key,
  87. name: `这是消息标题${key}`,
  88. age: 18 + key
  89. }
  90. })
  91. this.items = [...newData, ...this.items]
  92. console.log(this.items)
  93. this.currentPage++
  94. this.loading = false
  95. if (this.currentPage > 2) {
  96. this.hasMore = false
  97. }
  98. }, 1000)
  99. },
  100. loadMore() {
  101. if (this.loading) {
  102. return
  103. }
  104. this.loadData()
  105. },
  106. getIndex() {
  107. switch (this.isIndex) {
  108. case 0:
  109. this.titleType = '系统通知'
  110. this.opinionTxt = '这是一条系统通知'
  111. break
  112. case 1:
  113. this.titleType = '有流程达到'
  114. this.opinionTxt = '这是一条有流程达到提醒'
  115. break
  116. case 2:
  117. this.titleType = '流程完成提醒'
  118. this.opinionTxt = '这是一条流程完成提醒'
  119. break
  120. case 3:
  121. this.titleType = '赋权到期提醒'
  122. this.opinionTxt = '这是一条赋权到期提醒'
  123. break
  124. }
  125. },
  126. handleDetail(item) {
  127. switch (item.noticaType) {
  128. case 0:
  129. this.opinionTxt = '这是一条系统通知'
  130. break
  131. case 1:
  132. this.opinionTxt = '这是一条有流程达到提醒'
  133. break
  134. case 2:
  135. this.opinionTxt = '这是一条流程完成提醒'
  136. break
  137. case 3:
  138. this.opinionTxt = '这是一条赋权到期提醒'
  139. break
  140. }
  141. FetchInitNoticeDetails({ 'noticeId': item.noticeId }).then((res) => {
  142. console.log(res)
  143. this.detailInfo = res
  144. this.messageVisible = true
  145. }).catch(err => {
  146. console.log(err)
  147. })
  148. },
  149. dealWithCont() {
  150. this.$refs.detail.detailVisible = true
  151. }
  152. }
  153. }
  154. </script>
  155. <style lang='scss' scoped>
  156. [data-theme=dark] .message-center-list{
  157. background-color: transparent;
  158. .more-btn{
  159. color: #339cff;
  160. }
  161. .message-item{
  162. .message-cont{
  163. background-color: #02255f;
  164. .message-cont-info{
  165. color: #fff;
  166. .is-read-tip{
  167. color: #1890ff;
  168. border: 1px solid #339cff;
  169. background-color: #02255f;
  170. }
  171. }
  172. .message-more{
  173. color: #3a99fd;
  174. border-top: 1px solid #113d72;
  175. i{
  176. color: #3a99fd;
  177. }
  178. }
  179. }
  180. }
  181. .message-title{
  182. font-weight: 600;
  183. color: #3a99fd;
  184. }
  185. }
  186. .message-center-list{
  187. height: calc(100% - 90px);
  188. padding: 16px 30px;
  189. margin-bottom: 20px;
  190. background-color: #F5F5F5;
  191. overflow: hidden;
  192. overflow-y: scroll;
  193. .more-btn{
  194. margin-bottom: 30px;
  195. line-height: 30px;
  196. font-size: 14px;
  197. text-align: center;
  198. color: #0348F3;
  199. cursor: pointer;
  200. i{
  201. display: inline-block;
  202. }
  203. }
  204. .message-item{
  205. font-size: 14px;
  206. .message-date{
  207. text-align: center;
  208. color: #A6ADB6;
  209. }
  210. .message-cont{
  211. margin: 12px 0 16px 0;
  212. background-color: #fff;
  213. .message-cont-info{
  214. position: relative;
  215. padding: 16px 20px;
  216. color: #545B65;
  217. .is-read-tip{
  218. position: absolute;
  219. right: 20px;
  220. top: 16px;
  221. font-size: 12px;
  222. height: 20px;
  223. line-height: 20px;
  224. padding: 0 7px;
  225. color: #ED4A41;
  226. background-color: #FDEFEE;
  227. border-radius: 3px;
  228. }
  229. .message-list-info{
  230. font-size: 12px;
  231. line-height: 24px;
  232. }
  233. }
  234. .message-more{
  235. position: relative;
  236. padding: 0 20px;
  237. height: 40px;
  238. line-height: 40px;
  239. color: #545B65;
  240. border-top: 1px solid #E6E8ED;
  241. cursor: pointer;
  242. i{
  243. position: absolute;
  244. right: 10px;
  245. top: 0;
  246. font-size: 12px;
  247. color: #888D94;
  248. }
  249. }
  250. }
  251. }
  252. }
  253. .message-type-title{
  254. display: block;
  255. padding-left: 33px;
  256. height: 33px;
  257. line-height: 33px;
  258. &.type-title1{
  259. background: url('~@/assets/images/icon/xttz.png') no-repeat left center;
  260. background-size: 23px 23px;
  261. }
  262. &.type-title2{
  263. background: url('~@/assets/images/icon/lcdd.png') no-repeat left center;
  264. background-size: 23px 23px;
  265. }
  266. &.type-title3{
  267. background: url('~@/assets/images/icon/lcwc.png') no-repeat left center;
  268. background-size: 23px 23px;
  269. }
  270. &.type-title4{
  271. background: url('~@/assets/images/icon/fqdq.png') no-repeat left center;
  272. background-size: 23px 23px;
  273. }
  274. }
  275. .message-title{
  276. margin: 8px 0 20px 0;
  277. font-weight: 400;
  278. color: #0C0E1E;
  279. }
  280. .message-detail{
  281. position: relative;
  282. .detail-date{
  283. position: absolute;
  284. right: 0;
  285. top: 0;
  286. font-size: 12px;
  287. line-height: 32px;
  288. color: #A6ADB6;
  289. }
  290. .message-title{
  291. margin: 10px 0 20px 0;
  292. }
  293. }
  294. </style>