华西海圻ELN前端工程
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.

195 lines
5.1 KiB

  1. <template>
  2. <div class="app-container home">
  3. <el-card class="box-card home-top">
  4. <div class="count-box">
  5. <div class="count-item">
  6. <div class="count-left">
  7. <img src="@/assets/images/home-icon1.jpg" />
  8. </div>
  9. <div class="count-right">
  10. <div class="count-count">{{count.formTodayCount}}</div>
  11. <div class="count-tip">{{$t('page.business.home.jrxzbd')}}</div>
  12. </div>
  13. </div>
  14. <div class="count-item">
  15. <div class="count-left">
  16. <img src="@/assets/images/home-icon1.jpg" />
  17. </div>
  18. <div class="count-right">
  19. <div class="count-count">{{count.formYtjCount}}</div>
  20. <div class="count-tip">{{$t('page.business.home.ytjbd')}}</div>
  21. </div>
  22. </div>
  23. <div class="count-item">
  24. <div class="count-left">
  25. <img src="@/assets/images/home-icon1.jpg" />
  26. </div>
  27. <div class="count-right">
  28. <div class="count-count">{{count.formTbzCount}}</div>
  29. <div class="count-tip">{{$t('page.business.home.dtjbd')}}</div>
  30. </div>
  31. </div>
  32. <div class="count-item">
  33. <div class="count-left">
  34. <img src="@/assets/images/home-icon1.jpg" />
  35. </div>
  36. <div class="count-right">
  37. <div class="count-count">{{count.studyFinishCount}}</div>
  38. <div class="count-tip">{{$t('page.business.home.bzxzsy')}}</div>
  39. </div>
  40. </div>
  41. <div class="count-item">
  42. <div class="count-left">
  43. <img src="@/assets/images/home-icon1.jpg" />
  44. </div>
  45. <div class="count-right">
  46. <div class="count-count">{{count.studyWeekCount}}</div>
  47. <div class="count-tip">{{$t('page.business.home.ywcsy')}}</div>
  48. </div>
  49. </div>
  50. </div>
  51. </el-card>
  52. <el-card class="box-card home-content">
  53. <div slot="header" class="clearfix">
  54. <span>系统通知</span>
  55. </div>
  56. <div class="notice-list" v-loading="loading">
  57. <div class="notice-item" v-for="(item,index) in noticeList" :key="index">
  58. <div class="notice-title"><el-badge is-dot class="notice-dot"></el-badge>{{item.title}}</div>
  59. <div class="notice-date">{{item.createTime}}</div>
  60. </div>
  61. <pagination
  62. v-show="noticeTotal>0"
  63. :total="noticeTotal"
  64. :page.sync="searchForm.pageNum"
  65. :limit.sync="searchForm.pageSize"
  66. @pagination="getNoticeList"
  67. />
  68. </div>
  69. </el-card>
  70. </div>
  71. </template>
  72. <script>
  73. import { home_count,home_noticeList} from "@/api/business/home/home";
  74. export default {
  75. name: "Index",
  76. data() {
  77. return {
  78. count:{
  79. formTodayCount:'',
  80. formYtjCount:'',
  81. formTbzCount:'',
  82. studyFinishCount:'',
  83. studyWeekCount:'',
  84. },
  85. loading:false,
  86. searchForm: {
  87. pageNum: 1,
  88. pageSize: 10,
  89. },
  90. noticeList:[],
  91. noticeTotal:0
  92. }
  93. },
  94. created(){
  95. this.getCount()
  96. this.getNoticeList()
  97. },
  98. methods: {
  99. getCount(){
  100. this.count = {
  101. formTodayCount:'',
  102. formYtjCount:'',
  103. formTbzCount:'',
  104. studyFinishCount:'',
  105. studyWeekCount:'',
  106. }
  107. this.$modal.loading()
  108. home_count().then(response => {
  109. this.count = response.data
  110. })
  111. .finally(() => {
  112. this.$modal.closeLoading()
  113. })
  114. },
  115. getNoticeList(){
  116. this.loading = true;
  117. this.searchForm.startDate = this.daterange && this.daterange.length > 0 ? this.daterange[0] : ''
  118. this.searchForm.endDate = this.daterange && this.daterange.length > 1 ? this.daterange[1] : ''
  119. home_noticeList(this.searchForm).then(response => {
  120. this.noticeList = response.rows;
  121. this.noticeTotal = response.total;
  122. }).finally(()=>{
  123. this.loading = false;
  124. })
  125. }
  126. }
  127. }
  128. </script>
  129. <style scoped lang="scss">
  130. .home{
  131. .home-top{
  132. margin-bottom: 20px;
  133. .count-box{
  134. display: flex;
  135. flex-direction: row;
  136. align-items: center;
  137. .count-item{
  138. flex-shrink: 0;
  139. width: 20%;
  140. display: flex;
  141. flex-direction: row;
  142. align-items: center;
  143. .count-left{
  144. flex-shrink: 0;
  145. img{
  146. width: 60px;
  147. }
  148. }
  149. .count-right{
  150. flex-grow: 1;
  151. margin-left: 20px;
  152. .count-count{
  153. font-size: 20px;
  154. font-weight: bold;
  155. }
  156. .count-tip{
  157. margin-top: 10px;
  158. }
  159. }
  160. }
  161. }
  162. }
  163. .home-content{
  164. min-height: 400px;
  165. .notice-list{
  166. .notice-item{
  167. display: flex;
  168. flex-direction: row;
  169. justify-content: space-between;
  170. border-bottom: 1px solid #eee;
  171. margin-bottom: 10px;
  172. padding-bottom: 5px;
  173. font-size: 12px;
  174. .notice-title{
  175. flex-shrink: 0;
  176. .notice-dot{
  177. margin-right: 2px;
  178. margin-top: 5px;
  179. }
  180. }
  181. .notice-date{
  182. flex-grow: 1;
  183. text-align: right;
  184. }
  185. }
  186. }
  187. }
  188. }
  189. </style>