index.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. <template>
  2. <div class="data-view">
  3. <!-- 全屏显示容器 -->
  4. <dv-full-screen-container>
  5. <!-- 头部内容部分 -->
  6. <div class="headerContent">
  7. <!-- 标题装饰组件 -->
  8. <header-decoration :titleName="outputData.headerName"/>
  9. <div
  10. class="goBackButton"
  11. style="width: 12%;
  12. height:2.825rem;
  13. line-height: 2.825rem;
  14. text-align:center;
  15. position: absolute;
  16. left: 4%;
  17. top:3.8%;" >
  18. <el-date-picker
  19. class="chooseMonth"
  20. v-model="NowTime1"
  21. type="month"
  22. @change="changeTime1"
  23. format="yyyy-MM"
  24. value-format="yyyy-MM"
  25. placeholder="请选择时间">
  26. </el-date-picker>
  27. </div>
  28. <!-- 返回按钮 -->
  29. <div
  30. class="goBackButton"
  31. @click.prevent="goBack()"
  32. style="width: 12%;
  33. height:2.825rem;
  34. line-height: 2.825rem;
  35. text-align:center;
  36. position: absolute;
  37. right: 3%;
  38. top:4%;" >
  39. <dv-border-box-8>返回</dv-border-box-8>
  40. </div>
  41. <!-- 显示数据上一次更新的时间 -->
  42. <!-- <div
  43. class="changeTime"
  44. style="width: 18%;
  45. cursor: pointer;
  46. height:2.825rem;
  47. line-height: 2.825rem;
  48. text-align:center;
  49. position: absolute;
  50. left: 63%;
  51. top:4%;
  52. color: #FFFFFF;">
  53. <dv-border-box-8 >上一次更新时间:{{this.sendTime}}</dv-border-box-8>
  54. </div> -->
  55. <!-- 样品头部数据总览 -->
  56. <div class="overView">
  57. <headerContent @getUpdateTime="getTime" :NowTime1="NowTime1+'-01'"></headerContent>
  58. <dv-decoration-10 style="width:100%;height:5px;" />
  59. </div>
  60. </div>
  61. <!-- 主体内容(图表部分) -->
  62. <div class="mainContent">
  63. <div class="entrust">
  64. <div class="Number" ref="Number_refs"><entrustNumber :NowTime1="NowTime1"/> </div>
  65. <!-- <div class="Type" ><entrustType/></div> -->
  66. </div>
  67. <div class="detection">
  68. <div class="monthlyS" ref="MonthlyStatus_refs"><monthlyStatus :NowTime1="NowTime1"/></div>
  69. <div class="annualS" ref="AnnualStatus_refs"><annualStatus :NowTime1="NowTime1"/></div>
  70. <div class="monthlyN" ref="MonthlyNumber_refs"><monthlyNumber :NowTime1="NowTime1"/></div>
  71. </div>
  72. </div>
  73. </dv-full-screen-container>
  74. </div>
  75. </template>
  76. <script>
  77. //全屏展示
  78. import screenfull from 'screenfull'
  79. //大屏标题组件
  80. import headerDecoration from './headerDecoration'
  81. //头部内容组件
  82. import headerContent from './headerContent'
  83. //委托样品条目情况组件
  84. import entrustNumber from './EntrustNumber'
  85. //委托样品类型组件
  86. import entrustType from './EntrustType'
  87. // 月度检测完成情况(环形图)
  88. import monthlyStatus from './MonthlyStatus'
  89. //年度检测完成情况(环形图)
  90. import annualStatus from './AnnualStatus'
  91. //月度检测情况组件
  92. import monthlyNumber from './MonthlyNumber'
  93. export default {
  94. components:{
  95. headerDecoration,
  96. headerContent,
  97. entrustNumber,
  98. entrustType,
  99. monthlyStatus,
  100. annualStatus,
  101. monthlyNumber
  102. },
  103. data(){
  104. return{
  105. sendTime:'',
  106. outputData:{
  107. headerName:"样品管理看板"
  108. },
  109. NowTime1:'',
  110. value1:[]
  111. }
  112. },
  113. mounted() {
  114. this.getNowTime()
  115. },
  116. created() {
  117. //时间
  118. // this.currentTime()
  119. if(screenfull.isEnabled && !screenfull.isFullscreen){
  120. this.allView()
  121. }
  122. },
  123. beforeDestroy() {
  124. if(screenfull.isFullscreen){
  125. screenfull.toggle()
  126. }
  127. },
  128. methods: {
  129. getTime(val){
  130. this.sendTime = val
  131. },
  132. allView(){
  133. screenfull.request() //默认显示全屏
  134. },
  135. goBack(){
  136. this.$router.back(-1)
  137. },
  138. getNowTime(){
  139. const nowDate = new Date();
  140. const date = {
  141. year: nowDate.getFullYear(),
  142. month: nowDate.getMonth() + 1,
  143. }
  144. this.NowTime1 = date.year + '-' + date.month
  145. // console.log('页面第一次进来显示时间',date.year,date.month)
  146. //进来获取当前时间 之后获取当前月份天数 传给
  147. // console.log('页面显示的时间',this.NowTime1+"-01") //2022-11
  148. //把页面第一次进来的 当前年度月份 传给该方法处理 得到day及days
  149. // this.getDaysInMonth(date.year,date.month)
  150. },
  151. changeTime1(e){
  152. // console.log('改变时间',e) //2022-07
  153. // debugger
  154. let year = e.slice(0,4)
  155. let month = e.slice(5,7)
  156. this.NowTime1 = year + '-' + month
  157. // this.$set(this.data_key[index], "key", value);
  158. // console.log('用户操作之后 页面显示的时间',this.NowTime,year,month) //2022-11 2022 11
  159. //把年度月份传给getDaysInMonth()之前,先清理上一次数据
  160. // this.entrustNumber.diswpose() //这个方法干嘛的?? 为啥清不掉entrustNumberInit()方法的数据
  161. this.days=[]
  162. //在这里打印一下this.days数组
  163. // console.log('用户操作了时间控件之后打印this.days数组',this.days)
  164. //把用户操作时间控件改变的时间 的年度月份 传给该方法处理 得到day及days
  165. // this.getDaysInMonth(year,month)
  166. },
  167. // getDaysInMonth(year,month){
  168. // let temp = new Date(year,month,0);
  169. // this.day = temp.getDate();
  170. // // console.log('处理好的年 月 月份天数',year,month,this.day); //2022 11 30
  171. // //把月份对应天数转化为数组
  172. // for( let i=1;i <= this.day ;i++){
  173. // this.days.push(i)
  174. // }
  175. // // console.log('月份每一天',this.days)
  176. // this.getCheckSampleData(this.day)
  177. // }
  178. }
  179. }
  180. </script>
  181. <style lang="less" scoped>
  182. *body{
  183. padding: 0px;
  184. margin: 0px;
  185. }
  186. .data-view {
  187. width: 100%;
  188. height: 100%;
  189. color: #fff;
  190. z-index: 9999;
  191. #dv-full-screen-container {
  192. background-image: url('./img/stars.png');
  193. background-size: 100% 100%;
  194. display: flex;
  195. flex-direction:column;
  196. align-items: center;
  197. .headerContent{
  198. width: 100%;
  199. height: 19%;
  200. position:relative
  201. .overView{
  202. width: 100%;
  203. height: 80px;
  204. }
  205. }
  206. .mainContent{
  207. width: 100%;
  208. height:80%;
  209. display: flex;
  210. flex-direction:column;
  211. align-content:space-between;
  212. // border: 1px solid rgb(71, 17, 197);
  213. .entrust{
  214. width: 100%;
  215. height: 48%;
  216. display: flex;
  217. justify-content:space-between;
  218. // border: 1px solid rgb(17, 110, 197);
  219. .Number{
  220. width: 100%;
  221. height: 100%;
  222. display: flex;
  223. justify-content: center;
  224. // background-color: rgb(171, 163, 204);
  225. }
  226. .Type{
  227. width: 37.5%;
  228. height: 100%;
  229. margin-left: 10px;
  230. // background-color: rgb(12, 103, 131);
  231. }
  232. }
  233. .detection{
  234. width: 100%;
  235. height: 48%;
  236. margin-top: 15px;
  237. display: flex;
  238. justify-content:space-between;
  239. // border: 1px solid rgb(142, 190, 30);
  240. .monthlyS{
  241. width: 23%;
  242. height: 100%;
  243. // background-color: rgb(12, 103, 131);
  244. }
  245. .monthlyN{
  246. flex: 3;
  247. width: 50%;
  248. height: 100%;
  249. margin: 0px 10px;
  250. // background-color: rgb(171, 163, 204);
  251. }
  252. .annualS{
  253. width: 23%;
  254. height: 100%;
  255. // background-color: rgb(12, 103, 131);
  256. }
  257. }
  258. }
  259. }
  260. }
  261. </style>