home.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. <template>
  2. <view class="container">
  3. <view class="top_bg" @click="permission = !permission"></view>
  4. <!-- 状态统计区域 -->
  5. <view class="top_types" v-if="!permission">
  6. <view class="types_box">
  7. <view class="box_num">100</view>
  8. <view class="box_info">工单数</view>
  9. </view>
  10. <view class="types_box">
  11. <view class="box_num">10</view>
  12. <view class="box_info">处理中</view>
  13. </view>
  14. <view class="types_box">
  15. <view class="box_num">50</view>
  16. <view class="box_info">已完成</view>
  17. </view>
  18. <view class="types_box">
  19. <view class="box_num">60</view>
  20. <view class="box_info">已超时</view>
  21. </view>
  22. </view>
  23. <view class="top_types2" v-else>
  24. <view class="top">
  25. <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="text" activeColor="#6FB6B8"></uni-segmented-control>
  26. </view>
  27. <view class="bottom">
  28. <view class="bottom_box">
  29. <view class="box_num">100</view>
  30. <view class="box_info">工单数</view>
  31. </view>
  32. <view class="bottom_box">
  33. <view class="box_num">10</view>
  34. <view class="box_info">处理中</view>
  35. </view>
  36. <view class="bottom_box">
  37. <view class="box_num">50</view>
  38. <view class="box_info">已完成</view>
  39. </view>
  40. <view class="bottom_box">
  41. <view class="box_num">60</view>
  42. <view class="box_info">已超时</view>
  43. </view>
  44. </view>
  45. </view>
  46. <!-- 排班区域 -->
  47. <view class="watch">
  48. <view class="watch_title">
  49. <img src="../../static/images/repairsImg/watch.png" />
  50. 排班
  51. </view>
  52. <!-- 表格区域 -->
  53. <uni-table stripe emptyText="暂无更多数据">
  54. <!-- 表头行 -->
  55. <uni-tr>
  56. <uni-th width="50" align="center">姓名</uni-th>
  57. <uni-th width="50" align="center">工种</uni-th>
  58. <uni-th width="80" align="center">状态</uni-th>
  59. <uni-th width="80" align="center">是否值班</uni-th>
  60. </uni-tr>
  61. <!-- 表格数据行 -->
  62. <uni-tr v-for="(item, index) in tableData" :key="index">
  63. <uni-td align="center">{{ item.name }}</uni-td>
  64. <uni-td align="center">{{ item.type }}</uni-td>
  65. <uni-td align="center">{{ item.status }}</uni-td>
  66. <uni-td align="center">{{ item.work }}</uni-td>
  67. </uni-tr>
  68. </uni-table>
  69. </view>
  70. <!-- 排行榜区域 -->
  71. <view class="rank">
  72. <view class="rank_title">
  73. <img src="../../static/images/repairsImg/rank.png" />
  74. 工单完成排行榜
  75. </view>
  76. <!-- 排行榜柱状图 -->
  77. <view class="rank_charts">
  78. <qiun-data-charts type="bar" :opts="opts" :chartData="chartData" />
  79. </view>
  80. </view>
  81. <!-- 悬浮按钮区域 -->
  82. <view class="fixed">
  83. <img src="../../static/images/repairsImg/add.png" />
  84. <uni-badge :offset="[5, 5]" absolute="rightTop" text="8">
  85. <img class="img" src="../../static/images/repairsImg/message.png" @click="handleGoMsg" />
  86. </uni-badge>
  87. </view>
  88. </view>
  89. </template>
  90. <script>
  91. export default {
  92. data() {
  93. return {
  94. permission: true,
  95. items: ['团队数据统计', '个人数据统计'],
  96. current: 0,
  97. chartData: {
  98. categories: ['张三', '李四', '王五', '老六', '刘八'],
  99. series: [
  100. {
  101. name: '好评数',
  102. data: [35, 36, 31, 33, 13]
  103. },
  104. {
  105. name: '完成数',
  106. data: [18, 27, 21, 24, 6]
  107. }
  108. ]
  109. },
  110. opts: {
  111. color: ['#1890FF', '#91CB74', '#FAC858', '#EE6666', '#73C0DE', '#3CA272', '#FC8452', '#9A60B4', '#ea7ccc'],
  112. padding: [15, 30, 0, 5],
  113. enableScroll: false,
  114. legend: {},
  115. xAxis: {
  116. boundaryGap: 'justify',
  117. disableGrid: false,
  118. min: 0,
  119. axisLine: false,
  120. max: 40
  121. },
  122. yAxis: {},
  123. extra: {
  124. bar: {
  125. type: 'group',
  126. width: 15,
  127. meterBorde: 1,
  128. meterFillColor: '#FFFFFF',
  129. activeBgColor: '#000000',
  130. activeBgOpacity: 0.08,
  131. linearType: 'custom',
  132. barBorderCircle: true,
  133. seriesGap: 2,
  134. categoryGap: 2
  135. }
  136. }
  137. },
  138. tableData: [
  139. {
  140. name: '张三',
  141. type: '电工',
  142. status: 0,
  143. work: 0
  144. },
  145. {
  146. name: '张三三',
  147. type: '泥工',
  148. status: 0,
  149. work: 0
  150. },
  151. {
  152. name: '张三',
  153. type: '电工',
  154. status: 0,
  155. work: 0
  156. },
  157. {
  158. name: '张三三',
  159. type: '泥工',
  160. status: 0,
  161. work: 0
  162. },
  163. {
  164. name: '张三',
  165. type: '电工',
  166. status: 0,
  167. work: 0
  168. },
  169. {
  170. name: '张三三',
  171. type: '泥工',
  172. status: 0,
  173. work: 0
  174. }
  175. ]
  176. }
  177. },
  178. mounted() {},
  179. methods: {
  180. handleGoMsg() {
  181. uni.navigateTo({
  182. url: '/pagesRepairs/message/message'
  183. })
  184. },
  185. onClickItem(e) {
  186. if (this.current != e.currentIndex) {
  187. this.current = e.currentIndex
  188. console.log(this.current)
  189. }
  190. }
  191. }
  192. }
  193. </script>
  194. <style lang="scss" scoped>
  195. .container {
  196. width: 100vw;
  197. height: calc(100vh - 102rpx);
  198. overflow-y: auto;
  199. .top_bg {
  200. height: 165rpx;
  201. background-color: #6fb6b8;
  202. }
  203. .top_types {
  204. display: flex;
  205. justify-content: space-evenly;
  206. margin: auto;
  207. margin-top: -100rpx;
  208. width: 690rpx;
  209. height: 188rpx;
  210. border-radius: 10rpx;
  211. box-shadow: 0px 0px 4rpx rgba(0, 0, 0, 0.25);
  212. background-color: #fff;
  213. .types_box {
  214. flex: 1;
  215. display: flex;
  216. flex-direction: column;
  217. justify-content: center;
  218. align-items: center;
  219. .box_num {
  220. font-size: 46rpx;
  221. color: #ff5733;
  222. }
  223. .box_info {
  224. margin-top: 10rpx;
  225. font-size: 34rpx;
  226. }
  227. }
  228. }
  229. .top_types2 {
  230. box-sizing: border-box;
  231. margin: auto;
  232. margin-top: -100rpx;
  233. padding: 0 30rpx;
  234. width: 690rpx;
  235. height: 282rpx;
  236. border-radius: 10rpx;
  237. box-shadow: 0px 0px 4rpx rgba(0, 0, 0, 0.25);
  238. background-color: #fff;
  239. .top {
  240. height: 112rpx;
  241. border-bottom: 1rpx solid #e6e6e6;
  242. }
  243. .bottom {
  244. display: flex;
  245. justify-content: space-evenly;
  246. height: 170rpx;
  247. .bottom_box {
  248. flex: 1;
  249. display: flex;
  250. flex-direction: column;
  251. justify-content: center;
  252. align-items: center;
  253. .box_num {
  254. font-size: 46rpx;
  255. color: #ff5733;
  256. }
  257. .box_info {
  258. margin-top: 10rpx;
  259. font-size: 34rpx;
  260. }
  261. }
  262. }
  263. }
  264. .watch {
  265. box-sizing: border-box;
  266. margin: 20rpx auto;
  267. padding: 0 30rpx;
  268. width: 690rpx;
  269. border-radius: 10rpx;
  270. box-shadow: 0px 0px 4rpx rgba(0, 0, 0, 0.25);
  271. .watch_title {
  272. display: flex;
  273. align-items: center;
  274. height: 95rpx;
  275. font-size: 36rpx;
  276. border-bottom: 1rpx solid #e6e6e6;
  277. img {
  278. margin-right: 14rpx;
  279. width: 44rpx;
  280. height: 44rpx;
  281. }
  282. }
  283. }
  284. .rank {
  285. box-sizing: border-box;
  286. margin: 0 auto 100rpx;
  287. padding: 0 30rpx;
  288. width: 690rpx;
  289. border-radius: 10rpx;
  290. box-shadow: 0px 0px 4rpx rgba(0, 0, 0, 0.25);
  291. .rank_title {
  292. display: flex;
  293. align-items: center;
  294. height: 95rpx;
  295. font-size: 36rpx;
  296. border-bottom: 1rpx solid #e6e6e6;
  297. img {
  298. margin-right: 14rpx;
  299. width: 41rpx;
  300. height: 41rpx;
  301. }
  302. }
  303. .rank_charts {
  304. height: 650rpx;
  305. }
  306. }
  307. .fixed {
  308. z-index: 2;
  309. position: fixed;
  310. right: 0;
  311. bottom: 155rpx;
  312. display: flex;
  313. justify-content: space-evenly;
  314. align-items: center;
  315. width: 252rpx;
  316. height: 123rpx;
  317. border-radius: 150rpx 0 0 150rpx;
  318. box-shadow: 0px 0px 7rpx rgba(0, 0, 0, 0.15);
  319. background-color: #fff;
  320. img {
  321. width: 76rpx;
  322. height: 76rpx;
  323. }
  324. .img {
  325. width: 88rpx;
  326. height: 88rpx;
  327. }
  328. }
  329. }
  330. </style>