index.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <div class="m-container">
  3. <h2>
  4. <div class="squrt"></div>控制台 <filter-search v-if="$route.query.tabrouter === 'teamSchedule'" searchKey="ids" @reload="reloadItem"/>
  5. </h2>
  6. <div class="m-core">
  7. <tab-router @change="changeKey">
  8. <el-tab-pane v-permission="'newIndex'" lazy label="基本信息" name="baseinfo">
  9. <baseinfo v-if="activeKey === 'baseinfo'"/>
  10. </el-tab-pane>
  11. <el-tab-pane v-permission="'getIndexErrData'" lazy name="abnormal">
  12. <el-badge slot="label" class="badge" is-dot :hidden="!status.indexErrData">异常处理</el-badge>
  13. <abnormal v-if="activeKey === 'abnormal'"/>
  14. </el-tab-pane>
  15. <el-tab-pane v-permission="'getRemindMatterData'" name="reminders">
  16. <el-badge slot="label" class="badge" is-dot :hidden="!status.remindMatterData">事项提醒</el-badge>
  17. <reminders v-if="activeKey === 'reminders'"/>
  18. </el-tab-pane>
  19. <el-tab-pane v-permission="'inspectionItemPlan/queryPage'" lazy label="【乐团主管】日程安排" name="teamSchedule">
  20. <teamSchedule v-if="activeKey === 'teamSchedule'" ref="teamSchedule" />
  21. </el-tab-pane>
  22. <el-tab-pane v-permission="'inspection/queryPage'" lazy label="【分部经理】日程安排" name="ScheduleBranch">
  23. <ScheduleBranch v-if="activeKey === 'ScheduleBranch'"/>
  24. </el-tab-pane>
  25. </tab-router>
  26. </div>
  27. </div>
  28. </template>
  29. <script>
  30. import baseinfo from './baseinfo'
  31. import abnormal from './abnormal'
  32. import teamSchedule from './teamSchedule'
  33. import ScheduleBranch from './schedule-branch'
  34. import reminders from './reminders'
  35. import { hasIndexErrData } from './api'
  36. export default {
  37. name: 'Main',
  38. components: {
  39. baseinfo,
  40. abnormal,
  41. teamSchedule,
  42. ScheduleBranch,
  43. reminders,
  44. },
  45. data() {
  46. return {
  47. activeKey: '',
  48. status: {
  49. indexErrData: false,
  50. remindMatterData: false,
  51. }
  52. }
  53. },
  54. computed: {
  55. hasError() {
  56. const { indexErrData, remindMatterData } = this.status
  57. return indexErrData || remindMatterData
  58. }
  59. },
  60. watch: {
  61. '$route.query'(newValue, oldValue) {
  62. if (newValue.tabrouter !== oldValue.tabrouter) {
  63. this.$forceUpdate()
  64. this.FetchDot()
  65. }
  66. }
  67. },
  68. mounted() {
  69. this.FetchDot()
  70. },
  71. methods: {
  72. changeKey(val) {
  73. this.activeKey = val
  74. },
  75. async FetchDot() {
  76. try {
  77. const res = await hasIndexErrData()
  78. this.status = res.data
  79. this.toggleDot()
  80. } catch (error) {}
  81. },
  82. toggleDot() {
  83. const el = document.querySelector('.menu-wrapper a[href="#/main/main"] span')
  84. if (el) {
  85. if (this.hasError) {
  86. el.classList.add('main-dot')
  87. } else {
  88. el.classList.remove('main-dot')
  89. }
  90. }
  91. },
  92. __init () {
  93. getIndex().then(res => {
  94. if (res.code == 200) {
  95. // this.dataInfo = res.data
  96. let md = res.data.musicDatas || {},
  97. vd = res.data.vipDatas || {},
  98. dd = res.data.demoDatas || {}
  99. let tempDate = {
  100. mdTotal: (md.progress_num_ ? md.progress_num_ : 0) + (md.prepare_num_ ? md.prepare_num_ : 0) + (md.pause_num_ ? md.pause_num_ : 0),
  101. progress_num_: md.progress_num_ >= 0 ? md.progress_num_ : '--',
  102. prepare_num_: md.prepare_num_ >= 0 ? md.prepare_num_ : '--',
  103. pause_num_: md.pause_num_ >= 0 ? md.pause_num_ : '--',
  104. vdTotal: (vd.finished_num_ ? vd.finished_num_ : 0) + (vd.applying_num_ ? vd.applying_num_ : 0),
  105. finished_num_: vd.finished_num_ >= 0 ? vd.finished_num_ : '--',
  106. applying_num_: vd.applying_num_ >= 0 ? vd.applying_num_ : '--',
  107. ddTotal: (dd.booked_num_ ? dd.booked_num_ : 0) + (dd.unbooked_num_ ? dd.unbooked_num_ : 0),
  108. booked_num_: dd.booked_num_ >= 0 ? dd.booked_num_ : '--',
  109. unbooked_num_: dd.unbooked_num_ >= 0 ? dd.unbooked_num_ : '--'
  110. }
  111. this.dataInfo = Object.assign(res.data, tempDate)
  112. }
  113. })
  114. },
  115. reloadItem() {
  116. this.$refs.teamSchedule.getList()
  117. }
  118. }
  119. }
  120. </script>
  121. <style lang="scss" scope>
  122. .itemWrap {
  123. display: flex;
  124. flex-direction: row;
  125. justify-content: flex-start;
  126. align-items: center;
  127. flex-wrap: wrap;
  128. .item {
  129. width: 333px;
  130. height: 137px;
  131. padding: 22px 28px 20px;
  132. box-shadow: 0px 8px 20px 0px rgba(0, 0, 0, 0.1);
  133. border-radius: 6px;
  134. margin: 0 15px 3rem;
  135. h4 {
  136. display: flex;
  137. flex-direction: row;
  138. justify-content: space-between;
  139. margin-bottom: 20px;
  140. color: #323c47;
  141. font-size: 14px;
  142. }
  143. .infos {
  144. display: flex;
  145. flex-direction: row;
  146. justify-content: space-between;
  147. .sub {
  148. font-size: 14px;
  149. line-height: 20px;
  150. color: #aaa;
  151. margin-bottom: 8px;
  152. }
  153. .msg {
  154. font-size: 24px;
  155. font-weight: 500;
  156. color: rgba(68, 68, 68, 1);
  157. line-height: 28px;
  158. text-align: center;
  159. }
  160. }
  161. }
  162. }
  163. .badge{
  164. .el-badge__content.is-fixed.is-dot{
  165. top: 5px;
  166. }
  167. }
  168. </style>
  169. <style lang="less">
  170. .main-dot {
  171. position: relative;
  172. &::after{
  173. content: '';
  174. display: block;
  175. position: absolute;
  176. height: 8px;
  177. width: 8px;
  178. background-color: #F56C6C;
  179. border-radius: 50%;
  180. right: -10px;
  181. top: 15px;
  182. }
  183. }
  184. </style>