index.vue 5.5 KB

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