index.vue 76 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885
  1. <template>
  2. <div ref="dashboardEditor" class="dashboard-editor-container">
  3. <div class="dashboard" style="margin-bottom: 10px;">
  4. <div class="dashboard-l">
  5. <div class="row1">
  6. <div class="row1-t">
  7. <div class="row1-t-l">
  8. <div class="img-l" />
  9. <span class="content">{{$t('dashboard.noMessage')}}</span>
  10. <!-- <div class="img-r" /> -->
  11. </div>
  12. <div class="row1-t-r">{{ date }}</div>
  13. </div>
  14. <div class="row1-c">
  15. <div class="row1-c-l">
  16. <div class="title1" :lang="$i18n.locale">
  17. <div class="img-title">
  18. <img src="../../../assets/images/index/l1.png">
  19. </div>
  20. <span class="content">{{$t('dashboard.pureBlend')}}</span>
  21. </div>
  22. <div class="row1-c-l-c" >
  23. <span>
  24. <b>{{ row1.list.yesRateHL }}</b>
  25. <br>{{$t('dashboard.yestday')}}
  26. </span>
  27. </div>
  28. <div class="row1-c-l-b" :lang="$i18n.locale">
  29. <div><span>{{$t('dashboard.yestday30')}}:</span><b>{{ row1.list.monRateHL }}</b></div>
  30. </div>
  31. </div>
  32. <div class="row1-c-r">
  33. <div class="title1">
  34. <div class="img-title">
  35. <img src="../../../assets/images/index/l4.png">
  36. </div>
  37. <span class="content">{{$t('dashboard.spreadAc')}}</span>
  38. </div>
  39. <div class="row1-c-l-c">
  40. <span>
  41. <b>{{ row1.list.yesRateSL }}</b>
  42. <br>{{$t('dashboard.yestday')}}
  43. </span>
  44. </div>
  45. <div class="row1-c-l-b" :lang="$i18n.locale">
  46. <div><span>{{$t('dashboard.yestday30S')}}:</span><b>{{ row1.list.monRateSL }}</b></div>
  47. </div>
  48. </div>
  49. </div>
  50. <div class="row1-b">
  51. <div class="row1-b-l">
  52. <div class="title1">
  53. <div class="img-title">
  54. <img src="../../../assets/images/index/l3.png">
  55. </div>
  56. <span class="content">{{$t('dashboard.SpreadingCR')}}</span>
  57. </div>
  58. <div class="row1-c-l-c">
  59. <span>
  60. <b>{{ row1.list.yesRateSLR }}</b>
  61. <br>{{$t('dashboard.yestday')}}
  62. </span>
  63. </div>
  64. <div class="row1-c-l-b" :lang="$i18n.locale">
  65. <div><span>{{$t('dashboard.yestday30S')}}:</span><b>{{ row1.list.monRateSLR }}</b></div>
  66. </div>
  67. </div>
  68. <div class="row1-b-r">
  69. <div class="title1">
  70. <div class="img-title">
  71. <img src="../../../assets/images/index/l2.png">
  72. </div>
  73. <span class="content">{{$t('dashboard.spreadSD')}}</span>
  74. </div>
  75. <div class="row1-c-l-c">
  76. <span>
  77. <b>{{ row1.list.temtime }}</b>
  78. <br>{{$t('dashboard.yestday')}}
  79. </span>
  80. </div>
  81. <div class="row1-c-l-b" :lang="$i18n.locale">
  82. <div><span>{{ $t('dashboard.yestday30SD') }}:</span><b>{{ row1.list.montime }} </b>{{ $t('dashboard.mtime') }}</div>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. <div class="row2">
  88. <div class="title">
  89. <div class="img-title" />
  90. <span class="content">{{$t('dashboard.todayTps')}}</span>
  91. </div>
  92. <b style="margin-left: 20px;">{{$t('dashboard.StatisType')}}:</b>
  93. <el-select v-model="row2.value" size="mini" :placeholder="$t('common.please')" style="width: 100px;" @change="changeType">
  94. <el-option v-for="item in row2.typeList" :key="item.id" :label="$t('dashboard.'+item.name)" :value="item.id" />
  95. </el-select>
  96. <div class="todayPlan">
  97. <div>
  98. <div id="row2chartLine1" style="height: 185px;" v-loading="row1.listLoading" />
  99. <div class="bottom" :lang="$i18n.locale">
  100. <div class="bottom-l">
  101. <div class="bottom-l-t">
  102. <b>{{ row2.chart1.chartLine_data.data1 }}</b>{{$t('dashboard.bout')}}
  103. </div>
  104. <div class="bottom-l-b">
  105. {{$t('dashboard.cTrip')}}
  106. </div>
  107. </div>
  108. <div class="bottom-r">
  109. <div class="bottom-r-t">
  110. <b>{{ row2.chart1.chartLine_data.data2 }}</b>{{$t('dashboard.bout')}}
  111. </div>
  112. <div class="bottom-r-b">
  113. {{$t('dashboard.pTrip')}}
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. <div>
  119. <div id="row2chartLine2" style="height: 185px;" v-loading="row1.listLoading" />
  120. <div class="bottom">
  121. <div class="bottom-l">
  122. <div class="bottom-l-t">
  123. <b>{{ row2.chart2.chartLine_data.data1 }}</b>kg
  124. </div>
  125. <div class="bottom-l-b">
  126. {{$t('dashboard.cWeight')}}
  127. </div>
  128. </div>
  129. <div class="bottom-r">
  130. <div class="bottom-r-t">
  131. <b>{{ row2.chart2.chartLine_data.data2 }}</b>kg
  132. </div>
  133. <div class="bottom-r-b">
  134. {{$t('dashboard.pWeight')}}
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. </div>
  140. </div>
  141. <div class="row3" style="position: relative;">
  142. <div class="title">
  143. <div class="img-title" />
  144. <span class="content"> {{$t('dashboard.costSts')}}</span>
  145. </div>
  146. <div v-if="row4.chart1.isChart" class="button">
  147. <div class="exportTable" @click="handleExport('row4chartLine1')">{{$t('dashboard.Export')}}</div>
  148. <div class="exportTable" @click="handleTable('row4chartLine1')">{{$t('dashboard.sTable')}}</div>
  149. </div>
  150. <div v-if="row4.chart1.isChart" id="row4chartLine1" v-loading="row4.chart1.listLoading" style="background: #fff;height:310px;" />
  151. <div v-if="row4.chart1.isTable" class="table" style="position: absolute;width: 100%;">
  152. <div class="button">
  153. <div class="exportTable" @click="handleExport('row4chartLine1')">{{$t('dashboard.Export')}}</div>
  154. <div class="exportTable" @click="handleChart('row4chartLine1')">{{$t('dashboard.sTable')}}</div>
  155. </div>
  156. <el-table
  157. :key="row4.chart1.table.tableKey"
  158. v-loading="row4.chart1.table.listLoading"
  159. :element-loading-text="$t('common.tableMsg')"
  160. :data="row4.chart1.table.list"
  161. border
  162. fit
  163. highlight-current-row
  164. style="width: 100%;margin-top: 10px;"
  165. height="300"
  166. :row-style="rowStyle"
  167. :cell-style="cellStyle"
  168. class="elTable table-fixed"
  169. >
  170. <el-table-column :label="$t('dashboard.table.date')" sortable min-width="110px" align="center" prop="日期" />
  171. <el-table-column :label="$t('dashboard.table.signOx')" sortable min-width="110px" align="center" prop="field2" />
  172. <el-table-column :label="$t('dashboard.table.feedCow')" sortable min-width="120px" align="center" prop="field1" />
  173. </el-table>
  174. </div>
  175. </div>
  176. </div>
  177. <div class="dashboard-r">
  178. <div class="row1">
  179. <div class="title">
  180. <div class="img-title" />
  181. <span class="content">{{$t('dashboard.timeTitle')}}</span>
  182. </div>
  183. <div v-if="carLength>0" id="row2chartLine3" ref="row2chartLine3" style="height: 260px;" />
  184. <div v-else style="height: 260px;text-align: center;line-height: 260px;">{{$t('dashboard.monitMsg')}} </div>
  185. <div class="carsLength">{{$t('dashboard.curVeh')}}<span>{{ carLength }}</span></div>
  186. <div id="car" ref="car" v-loading="row2.chart3.listLoading2" class="car">
  187. <div ref="iconLeft" class="iconLeft" @click="handleLeft">
  188. <img v-if="row2.chart3.isLeft" src="../../../assets/images/index/row-r3.png" class="img-title">
  189. <img v-if="row2.chart3.isLeftA" src="../../../assets/images/index/row-r2.png" class="img-title">
  190. </div>
  191. <div id="carList" ref="carList" class="carList">
  192. <div v-for="(item,index) in list" ref="listW" :key="index" class="listW" :lang="$i18n.locale">
  193. <div ref="list" class="list" :style="{'background': item.background,'color':item.color,'borderColor':item.borderColor}" @click="handleList(index,item)">
  194. <div class="list-t">
  195. <div class="list-t-t">
  196. <el-tooltip :content="item.tname" placement="top">
  197. <span>{{ $t('dashboard.veh') }}:{{ item.tname }}</span>
  198. </el-tooltip>
  199. </div>
  200. <div class="list-t-t">
  201. <el-tooltip :content="item.fname" placement="top">
  202. <span v-if="item.inorout == 0">{{ $t('dashboard.feed') }}:{{ item.fname }}</span>
  203. <span v-if="item.inorout == 1">{{ $t('dashboard.fname') }}:{{ item.fname }}</span>
  204. </el-tooltip>
  205. </div>
  206. <div class="list-t-t">
  207. <el-tooltip :content="item.remark" placement="top">
  208. <span>{{ $t('dashboard.remark') }}:{{ item.remark }}</span>
  209. </el-tooltip>
  210. </div>
  211. </div>
  212. <div class="list-b">
  213. <div class="list-b-l">
  214. <div class="left">
  215. <div class="num"><b>{{ item.doneweight }}</b>Kg</div>
  216. <div class="weight">{{$t('dashboard.cWeight')}}</div>
  217. </div>
  218. <div class="right" />
  219. </div>
  220. <div class="list-b-l">
  221. <div class="left">
  222. <div class="num"><b>{{ item.leftweight }}</b>Kg</div>
  223. <div class="weight">{{$t('dashboard.rWright')}}</div>
  224. </div>
  225. <div class="right" />
  226. </div>
  227. <div class="list-b-l">
  228. <div class="left">
  229. <div class="num"><b>{{ item.nowweight }}</b>Kg</div>
  230. <div class="weight">{{$t('dashboard.vehWeight')}}</div>
  231. </div>
  232. <div class="right" />
  233. </div>
  234. <div class="list-b-l">
  235. <div class="left">
  236. <div class="num"><b>{{ item.lweight }}</b>Kg</div>
  237. <div class="weight">{{$t('dashboard.Pweight')}}</div>
  238. </div>
  239. <div class="right" />
  240. </div>
  241. <div class="list-b-l">
  242. <div class="left">
  243. <div class="num"><b>{{ item.donerate }}</b></div>
  244. <div class="weight">{{$t('dashboard.compaltRate')}}</div>
  245. </div>
  246. </div>
  247. </div>
  248. </div>
  249. <div v-if="item.isChecked" ref="checked" class="img-checked" />
  250. </div>
  251. </div>
  252. <div ref="iconRight" class="iconRight" @click="handleRight">
  253. <img v-if="row2.chart3.isRightA" src="../../../assets/images/index/row-r5.png" class="img-title">
  254. <img v-if="row2.chart3.isRight" src="../../../assets/images/index/row-r4.png" class="img-title">
  255. </div>
  256. </div>
  257. </div>
  258. <div class="row2">
  259. <div class="row2-l" style="position: relative;">
  260. <div class="title">
  261. <div class="img-title" />
  262. <span class="content">{{$t('dashboard.planSta')}}</span>
  263. </div>
  264. <div v-if="row3.chart1.isChart" class="button">
  265. <div class="exportTable" @click="handleExport('row3chartLine1')">{{$t('dashboard.Export')}}</div>
  266. <div class="exportTable" @click="handleTable('row3chartLine1')">{{$t('dashboard.sTable')}}</div>
  267. </div>
  268. <div v-if="row3.chart1.isChart" id="row3chartLine1" v-loading="row3.chart1.listLoading" style="background: #fff;height:310px;" />
  269. <div v-if="row3.chart1.isTable" class="table" style="position: absolute;width: 100%;">
  270. <div class="button">
  271. <div class="exportTable" @click="handleExport('row3chartLine1')">{{$t('dashboard.Export')}}</div>
  272. <div class="exportTable" @click="handleChart('row3chartLine1')">{{$t('dashboard.sTable')}}</div>
  273. </div>
  274. <el-table
  275. :key="row3.chart1.table.tableKey"
  276. v-loading="row3.chart1.table.listLoading"
  277. :element-loading-text="$t('common.tableMsg')"
  278. :data="row3.chart1.table.list"
  279. border
  280. fit
  281. highlight-current-row
  282. style="width: 100%;margin-top: 10px;"
  283. height="300"
  284. :row-style="rowStyle"
  285. :cell-style="cellStyle"
  286. class="elTable table-fixed"
  287. >
  288. <el-table-column :label="$t('dashboard.table.date')" sortable min-width="85px" align="center" prop="日期" />
  289. <el-table-column :label="$t('dashboard.table.PEWeight')" sortable min-width="90px" align="center" prop="实际量" />
  290. <el-table-column :label="$t('dashboard.table.FTWeight')" sortable min-width="90px" align="center" prop="理论量" />
  291. <el-table-column :label="$t('dashboard.table.PARate')" sortable min-width="85px" align="center" prop="field1" />
  292. <el-table-column :label="$t('dashboard.table.PCWeight')" sortable min-width="90px" align="center" prop="计划取消重量" />
  293. <el-table-column :label="$t('dashboard.table.PCancelWeight')" sortable min-width="100px" align="center" prop="field3" />
  294. <el-table-column :label="$t('dashboard.table.CNumP')" sortable min-width="85px" align="center" prop="正确数" />
  295. <el-table-column :label="$t('dashboard.table.PNum')" sortable min-width="85px" align="center" prop="计划数" />
  296. <el-table-column :label="$t('dashboard.table.CNumR')" sortable min-width="75px" align="center" prop="field2" />
  297. </el-table>
  298. </div>
  299. </div>
  300. <div class="row2-r" style="position: relative;">
  301. <div class="title">
  302. <div class="img-title" />
  303. <span class="content">{{$t('dashboard.mixStatic')}}</span>
  304. </div>
  305. <div v-if="row4.chart2.isChart" class="button">
  306. <div class="exportTable" @click="handleExport('row4chartLine2')">{{$t('dashboard.Export')}}</div>
  307. <div class="exportTable" @click="handleTable('row4chartLine2')">{{$t('dashboard.sTable')}}</div>
  308. </div>
  309. <div v-if="row4.chart2.isChart" id="row4chartLine2" v-loading="row4.chart2.listLoading" style="background: #fff;height:310px;" />
  310. <div v-if="row4.chart2.isTable" class="table" style="position: absolute;width:100%;">
  311. <div class="button">
  312. <div class="exportTable" @click="handleExport('row4chartLine2')">{{$t('dashboard.Export')}}</div>
  313. <div class="exportTable" @click="handleChart('row4chartLine2')">{{$t('dashboard.sTable')}}</div>
  314. </div>
  315. <el-table
  316. :key="row4.chart2.table.tableKey"
  317. v-loading="row4.chart2.table.listLoading"
  318. :element-loading-text="$t('common.tableMsg')"
  319. :data="row4.chart2.table.list"
  320. border
  321. fit
  322. highlight-current-row
  323. style="width: 100%;margin-top: 10px;"
  324. height="300"
  325. :row-style="rowStyle"
  326. :cell-style="cellStyle"
  327. class="elTable table-fixed"
  328. >
  329. <el-table-column :label="$t('dashboard.table.date')" sortable min-width="110px" align="center" prop="日期" />
  330. <el-table-column :label="$t('dashboard.yWeight')" sortable min-width="110px" align="center" prop="field1" />
  331. </el-table>
  332. </div>
  333. </div>
  334. </div>
  335. <div class="row3">
  336. <div class="row3-l" style="position: relative;">
  337. <div class="title">
  338. <div class="img-title" />
  339. <span class="content">{{$t('dashboard.miruTitle')}}</span>
  340. </div>
  341. <div v-if="row3.chart2.isChart" class="button">
  342. <div class="exportTable" @click="handleExport('row3chartLine2')">{{$t('dashboard.Export')}}</div>
  343. <div class="exportTable" @click="handleTable('row3chartLine2')">{{$t('dashboard.sTable')}}</div>
  344. </div>
  345. <div v-if="row3.chart2.isChart" id="row3chartLine2" v-loading="row3.chart2.listLoading" style="background: #fff;height:310px;" />
  346. <div v-if="row3.chart2.isTable" class="table" style="position: absolute;width: 100%;">
  347. <div class="button">
  348. <div class="exportTable" @click="handleExport('row3chartLine2')">{{$t('dashboard.Export')}}</div>
  349. <div class="exportTable" @click="handleChart('row3chartLine2')">{{$t('dashboard.sTable')}}</div>
  350. </div>
  351. <el-table
  352. :key="row3.chart2.table.tableKey"
  353. v-loading="row3.chart2.table.listLoading"
  354. :element-loading-text="$t('common.tableMsg')"
  355. :data="row3.chart2.table.list"
  356. border
  357. fit
  358. highlight-current-row
  359. style="width: 100%;margin-top: 10px;"
  360. height="300"
  361. :row-style="rowStyle"
  362. :cell-style="cellStyle"
  363. class="elTable table-fixed"
  364. >
  365. <el-table-column :label="$t('dashboard.table.date')" sortable min-width="110px" align="center" prop="日期" />
  366. <el-table-column :label="$t('dashboard.miruCow1')" sortable min-width="110px" align="center" prop="field1" />
  367. <el-table-column :label="$t('dashboard.miruMilk1')" sortable min-width="110px" align="center" prop="field2" />
  368. </el-table>
  369. </div>
  370. </div>
  371. <div class="row3-r">
  372. <div class="title">
  373. <div class="img-title" />
  374. <span class="content">{{$t('dashboard.stockAlart')}}</span>
  375. <!-- <a style="float: right;color: #009C69;font-size: 12px;margin-right: 10px;" @click="handleMore">{{$t('common.watchMore')}} &nbsp;>></a> -->
  376. </div>
  377. <div id="table" style="height: 330px;background: #fff;">
  378. <el-table
  379. :key="row4.table.tableKey"
  380. v-loading="row4.table.listLoading"
  381. :element-loading-text="$t('common.tableMsg')"
  382. :data="row4.table.list"
  383. border
  384. fit
  385. highlight-current-row
  386. style="width: 98%;background: #fff;margin-top: 10px;"
  387. height="320"
  388. :row-style="rowStyle"
  389. :cell-style="cellStyle"
  390. class="elTable table-fixed"
  391. >
  392. <el-table-column :label="$t('dashboard.stockTable.num')" type="index" min-width="80px" align="center" />
  393. <el-table-column :label="$t('dashboard.stockTable.feedName')" min-width="80px" align="center" prop="feedname" />
  394. <el-table-column :label="$t('dashboard.stockTable.stockNum')" min-width="70px" align="center" prop="stockweight" />
  395. <el-table-column :label="$t('dashboard.stockTable.lastDay')" min-width="80px" align="center" prop="ldays" />
  396. </el-table>
  397. </div>
  398. </div>
  399. </div>
  400. </div>
  401. </div>
  402. </div>
  403. </template>
  404. <script>
  405. import { GetDataByName, GetReportform } from '@/api/common'
  406. import Cookies from 'js-cookie'
  407. import { parseTime } from '@/utils/index.js'
  408. import echarts from 'echarts'
  409. import { json2excel } from '@/utils/index.js'
  410. require('echarts/theme/macarons')
  411. // var myKey = 0
  412. var that = this
  413. var carIndex = 0 // 判断是否大于当前车辆数
  414. var index = 0 // 判断当前跳到第几个车辆
  415. var timer = null
  416. export default {
  417. name: 'PastureDashboard',
  418. inject: ['reload'],
  419. data() {
  420. return {
  421. val: '这是值1',
  422. date: parseTime(new Date(), '{y}-{m}-{d}'),
  423. list: [],
  424. news: 1,
  425. carLength: 0, // 车辆
  426. myKey: 0, // 轮播Key值
  427. row1: {
  428. getdataListParm: {
  429. name: 'getHomepageStr',
  430. page: 1,
  431. offset: 1,
  432. pagecount: 10,
  433. returntype: 'Map',
  434. parammaps: {
  435. pastureid: Cookies.get('pastureid')
  436. }
  437. },
  438. listLoading: true,
  439. list: ''
  440. },
  441. row2: {
  442. value:0,
  443. typeList:[{id:0,name:'typeAll'},{id:1,name:'Fixed'},{id:2,name:'struck'}],
  444. chart1: {
  445. chartLine: null,
  446. chartLine_data: {}
  447. },
  448. chart2: {
  449. chartLine: null,
  450. chartLine_data: {}
  451. },
  452. chart3: {
  453. isLeft: true,
  454. isRight: true,
  455. chartLine: null,
  456. chartLine_data: {},
  457. getdataListParm: {
  458. name: 'getHomeprocessAnalysis',
  459. page: 1,
  460. offset: 1,
  461. pagecount: 2,
  462. returntype: 'Map',
  463. parammaps: {
  464. pastureid: Cookies.get('pastureid'),
  465. id: '',
  466. pid: ''
  467. }
  468. },
  469. list: [],
  470. total: 0,
  471. listLoading: true,
  472. pageNum: '',
  473. pages: '',
  474. getdataListParmList: {
  475. name: 'getHomepageLBList',
  476. page: 1,
  477. offset: 1,
  478. pagecount: 2,
  479. returntype: 'Map',
  480. parammaps: {
  481. pastureid: Cookies.get('pastureid')
  482. }
  483. },
  484. list2: [],
  485. total2: 0,
  486. listLoading2: true,
  487. pageNum2: '',
  488. pages2: ''
  489. }
  490. },
  491. row3: {
  492. chartDate: [],
  493. chart1: {
  494. chartLine: null,
  495. chartLine_data: {},
  496. getdataListParm: {
  497. name: 'getAccuracyAllJH',
  498. page: 1,
  499. offset: 1,
  500. pagecount: 10,
  501. returntype: 'Map',
  502. parammaps: {
  503. pastureid: Cookies.get('pastureid'),
  504. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  505. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  506. inputDatetime: [new Date(), new Date()]
  507. }
  508. },
  509. list: [],
  510. total: 0,
  511. listLoading: true,
  512. isChart: true,
  513. isTable: false,
  514. table: {
  515. tableKey: 1,
  516. list: [],
  517. total: 0,
  518. listLoading: false
  519. }
  520. },
  521. chart2: {
  522. chartLine: null,
  523. chartLine_data: {},
  524. getdataListParm: {
  525. name: 'getFeedEffMR',
  526. page: 1,
  527. offset: 1,
  528. pagecount: 10,
  529. returntype: 'Map',
  530. parammaps: {
  531. pastureid: Cookies.get('pastureid'),
  532. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  533. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  534. inputDatetime: [new Date(), new Date()]
  535. }
  536. },
  537. list: [],
  538. total: 0,
  539. listLoading: true,
  540. isChart: true,
  541. isTable: false,
  542. table: {
  543. tableKey: 1,
  544. list: [],
  545. total: 0,
  546. listLoading: false
  547. }
  548. }
  549. },
  550. row4: {
  551. chartDate: [],
  552. chart1: {
  553. chartLine: null,
  554. chartLine_data: {},
  555. getdataListParm: {
  556. name: 'getHomepageCB',
  557. page: 1,
  558. offset: 1,
  559. pagecount: 10,
  560. returntype: 'Map',
  561. parammaps: {
  562. pastureid: Cookies.get('pastureid'),
  563. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  564. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  565. inputDatetime: [new Date(), new Date()]
  566. }
  567. },
  568. list: [],
  569. total: 0,
  570. listLoading: true,
  571. isChart: true,
  572. isTable: false,
  573. table: {
  574. tableKey: 1,
  575. list: [],
  576. total: 0,
  577. listLoading: false
  578. }
  579. },
  580. chart2: {
  581. chartLine: null,
  582. chartLine_data: {},
  583. getdataListParm: {
  584. name: 'getAccuraaActHL',
  585. page: 1,
  586. offset: 1,
  587. pagecount: 10,
  588. returntype: 'Map',
  589. parammaps: {
  590. pastureid: Cookies.get('pastureid'),
  591. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  592. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  593. inputDatetime: [new Date(), new Date()]
  594. }
  595. },
  596. list: [],
  597. total: 0,
  598. listLoading: true,
  599. isChart: true,
  600. isTable: false,
  601. table: {
  602. tableKey: 1,
  603. list: [],
  604. total: 0,
  605. listLoading: false
  606. }
  607. },
  608. table: {
  609. getdataListParm: {
  610. name: 'getFsWarnList',
  611. page: 1,
  612. offset: 1,
  613. pagecount: 5,
  614. returntype: 'Map',
  615. parammaps: {
  616. pastureid: Cookies.get('pastureid')
  617. }
  618. },
  619. tableKey: 1,
  620. list: [],
  621. total: 0,
  622. listLoading: true,
  623. temp: {}
  624. }
  625. },
  626. rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
  627. cellStyle: { padding: 0 + 'px' },
  628. timer: null,
  629. clickKey: 0,
  630. isClick: false,
  631. }
  632. },
  633. watch: {
  634. isClick: {
  635. handler(newName, oldName) {
  636. if (newName == true) {
  637. setTimeout(() => {
  638. this.timer = setInterval(this.autoPlay, 15000)
  639. }, 20000)
  640. }
  641. },
  642. immediate: true
  643. }
  644. },
  645. created() {
  646. // this.reload()
  647. this.getCarLength()
  648. this.getChart3List()
  649. this.getTimeFn()
  650. this.getList()
  651. this.getChart4()
  652. this.getChart5()
  653. this.getChart6()
  654. this.getChart7()
  655. this.getTable8()
  656. },
  657. mounted() {
  658. this.timer = null
  659. this.timer = setInterval(this.autoPlay, 15000)
  660. },
  661. destroyed() {
  662. clearInterval(this.timer)
  663. },
  664. methods: {
  665. getTimeFn() {
  666. // this.reload()
  667. const that = this
  668. const end = new Date()
  669. const start = new Date()
  670. start.setTime(start.getTime() - 3600 * 1000 * 24 * 20)
  671. that.row3.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
  672. that.row3.chartDate[1] = parseTime(end, '{y}-{m}-{d}')
  673. that.row3.chart1.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  674. that.row3.chart1.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  675. that.row3.chart1.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  676. that.row3.chart1.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  677. that.row3.chart2.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  678. that.row3.chart2.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  679. that.row3.chart2.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  680. that.row3.chart2.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  681. that.row4.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
  682. that.row4.chartDate[1] = parseTime(end, '{y}-{m}-{d}')
  683. that.row4.chart1.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  684. that.row4.chart1.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  685. that.row4.chart1.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  686. that.row4.chart1.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  687. that.row4.chart2.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  688. that.row4.chart2.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  689. that.row4.chart2.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  690. that.row4.chart2.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  691. },
  692. getList() {
  693. this.row1.listLoading = true
  694. this.row1.getdataListParm.parammaps.lpplantype = this.row2.value
  695. GetDataByName(this.row1.getdataListParm).then(response => {
  696. if (response.data !== null && response.data.list !== null) {
  697. console.log('row1数据', response.data.list)
  698. if (response.data.list[0].monRateHL == undefined) { response.data.list[0].monRateHL = '' }
  699. if (response.data.list[0].monRateSL == undefined) { response.data.list[0].monRateSL = '' }
  700. if (response.data.list[0].monRateSLR == undefined) { response.data.list[0].monRateSLR = '' }
  701. if (response.data.list[0].yesRateHL == undefined) { response.data.list[0].yesRateHL = '' }
  702. if (response.data.list[0].yesRateHL == undefined) { response.data.list[0].yesRateHL = '' }
  703. if (response.data.list[0].yesRateSL == undefined) { response.data.list[0].yesRateSL = '' }
  704. if (response.data.list[0].yesRateSLR == undefined) { response.data.list[0].yesRateSLR = '' }
  705. if (response.data.list[0].temtime == undefined) { response.data.list[0].temtime = '' }
  706. if (response.data.list[0].montime == undefined) { response.data.list[0].montime = '' }
  707. this.row1.list = response.data.list[0]
  708. this.row2.chart1.chartLine_data.data1 = parseFloat(response.data.list[0].doneTimes)
  709. this.row2.chart1.chartLine_data.data2 = parseFloat(response.data.list[0].planTimes)
  710. this.row2.chart2.chartLine_data.data1 = parseFloat(response.data.list[0].doneWeight)
  711. this.row2.chart2.chartLine_data.data2 = parseFloat(response.data.list[0].planWeight)
  712. this.roadChartLine1(this.row2.chart1.chartLine_data)
  713. this.roadChartLine2(this.row2.chart2.chartLine_data)
  714. } else {
  715. this.row1.list.data1.monRateHL = ''
  716. this.row1.list.data1.monRateSL = ''
  717. this.row1.list.data1.monRateSLR = ''
  718. this.row1.list.data1.yesRateHL = ''
  719. this.row1.list.data1.yesRateSL = ''
  720. this.row1.list.data1.yesRateSLR = ''
  721. this.row1.list.data1.temtime = ''
  722. this.row1.list.data1.montime = ''
  723. this.row2.chart1.chartLine_data.data1 = ''
  724. this.row2.chart1.chartLine_data.data2 = ''
  725. this.row2.chart2.chartLine_data.data1 = ''
  726. this.row2.chart2.chartLine_data.data2 = ''
  727. }
  728. setTimeout(() => {
  729. this.row1.listLoading = false
  730. }, 100)
  731. })
  732. },
  733. changeType(){
  734. this.getList()
  735. },
  736. // 今日计划统计-完成车次
  737. roadChartLine1(chartLine_data) {
  738. console.log('chartLine_data', chartLine_data)
  739. if (this.row2.chart1.chartLine != null) {
  740. this.row2.chart1.chartLine.dispose()
  741. }
  742. this.row2.chart1.chartLine = echarts.init(document.getElementById('row2chartLine1'))
  743. if (chartLine_data.data2 == 0 || chartLine_data.data1 == 0) {
  744. chartLine_data.data1 = 0
  745. chartLine_data.data2 = 100
  746. }
  747. var option = {
  748. title: { show: true, x: 'center', textStyle: { fontSize: '15', color: 'green', fontWeight: 'bold' }},
  749. tooltip: { show: false, trigger: 'item', formatter: '{a} <br/>{b}: {c} ({d}%)' },
  750. color: ['#1bbe89', '#e4e7ec'],
  751. series: [{
  752. name: this.$t('dashboard.taskT'), type: 'pie', radius: ['80%', '70%'], avoidLabelOverlap: false, hoverAnimation: false, labelLine: { normal: { show: false }},
  753. data: [{
  754. value: chartLine_data.data1, name: this.$t('dashboard.tripCp1'), selected: false, // 单个扇区的标签配置
  755. label: { normal: { show: true, position: 'center', fontSize: this.$t('dashboard.tripCpFont'), formatter: '{b}\n{d}%' }}
  756. }, {
  757. value: chartLine_data.data2 - chartLine_data.data1,
  758. label: { normal: { show: false }
  759. }
  760. }]
  761. }]
  762. }
  763. this.row2.chart1.chartLine.setOption(option)
  764. if (this.row2.chart1.chartLine != null) {
  765. window.onresize = function() {
  766. this.row2.chart1.chartLine.resize()
  767. }
  768. }
  769. var that = this
  770. that.row2.chart1.chartLine.on('mouseover', e => {
  771. const op = that.row2.chart1.chartLine.getOption()
  772. that.row2.chart1.chartLine.dispatchAction({
  773. type: 'downplay',
  774. seriesIndex: 0,
  775. dataIndex: e.dataIndex,
  776. color: e.color
  777. })
  778. that.row2.chart1.chartLine.setOption(op, true)
  779. })
  780. },
  781. // 今日计划统计-完成重量
  782. roadChartLine2(chartLine_data) {
  783. if (this.row2.chart2.chartLine != null) {
  784. this.row2.chart2.chartLine.dispose()
  785. }
  786. this.row2.chart2.chartLine = echarts.init(document.getElementById('row2chartLine2'))
  787. if (chartLine_data.data2 == 0 || chartLine_data.data1 == 0) {
  788. chartLine_data.data1 = 0
  789. chartLine_data.data2 = 100
  790. }
  791. var option = {
  792. title: { show: true, x: 'center', textStyle: { fontSize: '15', color: 'green', fontWeight: 'bold' }},
  793. tooltip: { show: false, trigger: 'item', formatter: '{a} <br/>{b}: {c} ({d}%)' },
  794. series: [{
  795. name: this.$t('dashboard.taskT'), type: 'pie', radius: ['80%', '70%'], avoidLabelOverlap: false, hoverAnimation: false,
  796. labelLine: { normal: { show: false }},
  797. data: [{
  798. value: chartLine_data.data1, name: this.$t('dashboard.tripCp'), selected: false, label: { normal: { show: true, position: 'center', fontSize: this.$t('dashboard.tripCpFont'), formatter: '{b}\n{d}%' }}
  799. }, {
  800. value: chartLine_data.data2 - chartLine_data.data1, label: { normal: { show: false }}
  801. }]
  802. }],
  803. color: ['#529ae4', '#e4e7ec']
  804. }
  805. this.row2.chart2.chartLine.setOption(option)
  806. if (this.row2.chart2.chartLine != null) {
  807. window.onresize = function() {
  808. this.row2.chart2.chartLine.resize()
  809. }
  810. }
  811. var that = this
  812. that.row2.chart2.chartLine.on('mouseover', e => {
  813. const op = that.row2.chart2.chartLine.getOption()
  814. that.row2.chart2.chartLine.dispatchAction({
  815. type: 'downplay',
  816. seriesIndex: 0,
  817. dataIndex: e.dataIndex,
  818. color: e.color
  819. })
  820. that.row2.chart2.chartLine.setOption(op, true)
  821. })
  822. },
  823. // 实时监控
  824. getChart3() {
  825. this.row2.chart3.listLoading = true
  826. GetReportform(this.row2.chart3.getdataListParm).then(response => {
  827. console.log('实时监控数据', response.data.list)
  828. if (response.data !== null && response.data.list !== null) {
  829. var evenNumbers = []// 偶数
  830. var oddNumbers = []// 奇数
  831. for (let i = 0; i < response.data.list.data4.length; i++) {
  832. if (i == 0) {
  833. oddNumbers.push(response.data.list.data4[i])
  834. } else {
  835. if (i % 2 == 0) {
  836. evenNumbers.push(response.data.list.data4[i])
  837. } else {
  838. oddNumbers.push(response.data.list.data4[i])
  839. }
  840. }
  841. }
  842. response.data.list.data4 = oddNumbers
  843. response.data.list.data5 = evenNumbers
  844. this.row2.chart3.chartLine_data = response.data.list
  845. this.row2.chart3.total = response.data.total
  846. this.row2.chart3.pageNum = response.data.pageNum
  847. this.row2.chart3.pages = response.data.pages
  848. this.roadChartLine3(this.row2.chart3.chartLine_data)
  849. } else {
  850. this.row2.chart3.list = []
  851. this.row2.chart3.chartLine_data = []
  852. this.roadChartLine3(this.row2.chart3.chartLine_data)
  853. }
  854. setTimeout(() => {
  855. this.row2.chart3.listLoading = false
  856. }, 100)
  857. })
  858. },
  859. roadChartLine3(chartLine_data) {
  860. console.log(chartLine_data, 'chartLine_data666')
  861. if (this.row2.chart3.chartLine != null) {
  862. this.row2.chart3.chartLine.dispose()
  863. }
  864. this.row2.chart3.chartLine = echarts.init(document.getElementById('row2chartLine3'))
  865. var option = {
  866. title: {
  867. text: '',
  868. subtext: ''
  869. },
  870. color: ['#ff0000', '#5199e5', '#fdb06a', '#fb8b73'], // 关键加上这句话,legend的颜色和折线的自定义颜色就一致了
  871. grid: {
  872. bottom: '10%'
  873. },
  874. legend: [{
  875. itemWidth: 15, itemHeight: 7, right: '25%', textStyle: { fontSize: 12 },
  876. data: [{ name: this.$t('dashboard.Dweight')}, { name: this.$t('dashboard.AWeight') }]
  877. }, {
  878. itemWidth: 5, itemHeight: 5, right: '0', textStyle: { fontSize: 12 },
  879. data: [
  880. { name: this.$t('dashboard.SWeight') },
  881. { name: this.$t('dashboard.EWight') }
  882. ]
  883. }],
  884. tooltip: {
  885. trigger: 'axis',
  886. formatter: function(params) {
  887. // console.log(params, 'params')
  888. var tip = params[0].name
  889. for (let i = 0; i < params.length; i++) {
  890. if (params[i].seriesName == this.$t('dashboard.Dweight')) {
  891. tip += '<br>' + params[i].seriesName + ':' + params[i].value[1]
  892. }
  893. if (params[i].seriesName == this.$t('dashboard.AWeight') ) {
  894. tip += '<br>' + params[i].seriesName + ':' + params[i].value[1]
  895. }
  896. if (params[i].seriesName == this.$t('dashboard.SWeight')) {
  897. tip += '<br>' + params[i].seriesName + ':' + params[i].value[1]
  898. }
  899. if (params[i].seriesName == this.$t('dashboard.AWeight')) {
  900. tip += '<br>' + params[i].seriesName + ':' + params[i].value[1] + '<br>' + params[i].value[2] + params[i].value[3]
  901. }
  902. }
  903. return tip
  904. }
  905. },
  906. calculable: true,
  907. yAxis: [
  908. { type: 'value', name: this.$t('dashboard.yWeight'), splitLine: { show: false }, axisLabel: { show: true, textStyle: { color: '#666' }}}
  909. ],
  910. xAxis: [
  911. { type: 'category', splitLine: { show: false }, name: this.$t('dashboard.xTime'), data: chartLine_data.data1, axisLabel: { show: true, textStyle: { color: '#666' }}}
  912. ],
  913. toolbox: {
  914. show: false,
  915. feature: {
  916. dataZoom: { realtime: false, yAxisIndex: 'none', },
  917. restore: {},
  918. }
  919. },
  920. dataZoom: [
  921. {type: 'inside'}, //用于添加滚轮缩放
  922. {type:'slider' }, //用于添加滑动条缩放,
  923. ],
  924. series: [
  925. { symbol: 'none', name: this.$t('dashboard.Dweight') , type: 'line', data: chartLine_data.data3, itemStyle: { normal: { lineStyle: { color: '#ff0000' ,width:2}}}},
  926. { symbol: 'none', name: this.$t('dashboard.AWeight') , type: 'line', data: chartLine_data.data2, itemStyle: { normal: { lineStyle: { width:2}}}},
  927. { name: this.$t('dashboard.SWeight') , symbolSize: 6, type: 'scatter', data: chartLine_data.data4 },
  928. { name: this.$t('dashboard.EWight') , symbolSize: 6, type: 'scatter', data: chartLine_data.data5 }
  929. ]
  930. }
  931. this.row2.chart3.chartLine.setOption(option)
  932. if (this.row2.chart3.chartLine != null) {
  933. window.onresize = function() {
  934. this.row2.chart3.chartLine.resize()
  935. }
  936. }
  937. },
  938. getCarLength() {
  939. this.row2.chart3.listLoading2 = true
  940. this.row2.chart3.getdataListParmList.pagecount = 0
  941. GetDataByName(this.row2.chart3.getdataListParmList).then(response => {
  942. if (response.data.list !== null) {
  943. this.carLength = response.data.total
  944. } else {
  945. this.carLength = 0
  946. }
  947. setTimeout(() => {
  948. this.row2.chart3.listLoading2 = false
  949. }, 100)
  950. })
  951. },
  952. // 图三轮询列表
  953. getChart3List() {
  954. this.row2.chart3.listLoading2 = true
  955. this.row2.chart3.getdataListParmList.pagecount = 2
  956. GetDataByName(this.row2.chart3.getdataListParmList).then(response => {
  957. if (response.data.list !== null) {
  958. this.$set(response.data.list[0], 'background', '#f3f9f7')
  959. this.$set(response.data.list[0], 'borderColor', '#009d6a')
  960. this.$set(response.data.list[0], 'isChecked', true)
  961. if (response.data.list.length > 1) {
  962. this.$set(response.data.list[1], 'background', '#f9f9f9')
  963. this.$set(response.data.list[1], 'borderColor', '#f9f9f9')
  964. this.$set(response.data.list[1], 'isChecked', false)
  965. }
  966. this.list = response.data.list
  967. this.row2.chart3.getdataListParm.parammaps.pid = this.list[this.myKey].pid
  968. this.row2.chart3.getdataListParm.parammaps.id = this.list[this.myKey].id
  969. this.getChart3()
  970. this.row2.chart3.pageNum2 = response.data.pageNum
  971. this.row2.chart3.pages2 = response.data.pages
  972. } else {
  973. this.row2.chart3.list2 = []
  974. }
  975. if (response.data.pageNum == 1) {
  976. if (response.data.total > 2) {
  977. this.row2.chart3.isLeftA = false
  978. this.row2.chart3.isLeft = true
  979. this.row2.chart3.isRightA = true
  980. this.row2.chart3.isRight = false
  981. } else {
  982. this.row2.chart3.isLeftA = false
  983. this.row2.chart3.isLeft = true
  984. this.row2.chart3.isRightA = true
  985. this.row2.chart3.isRight = false
  986. }
  987. } else {
  988. if (response.data.pageNum * response.data.pageSize > response.data.total || response.data.pageNum * response.data.pageSize == response.data.total) {
  989. this.row2.chart3.isLeftA = true
  990. this.row2.chart3.isLeft = false
  991. this.row2.chart3.isRightA = false
  992. this.row2.chart3.isRight = true
  993. } else {
  994. this.row2.chart3.isLeftA = true
  995. this.row2.chart3.isLeft = false
  996. this.row2.chart3.isRightA = true
  997. this.row2.chart3.isRight = false
  998. }
  999. }
  1000. setTimeout(() => {
  1001. this.row2.chart3.listLoading2 = false
  1002. }, 100)
  1003. })
  1004. },
  1005. // 向左切换
  1006. handleLeft() {
  1007. console.log('左')
  1008. if (this.row2.chart3.isLeftA == false) {
  1009. console.log('前边没有啦')
  1010. } else {
  1011. console.log(this.row2.chart3.getdataListParmList.offset)
  1012. this.row2.chart3.getdataListParmList.offset = this.row2.chart3.getdataListParmList.offset - 1
  1013. this.getChart3List()
  1014. }
  1015. },
  1016. // 向右切换
  1017. handleRight() {
  1018. if (this.row2.chart3.isRightA == false) {
  1019. console.log('后边没有啦')
  1020. } else {
  1021. this.row2.chart3.getdataListParmList.offset = this.row2.chart3.getdataListParmList.offset + 1
  1022. console.log(this.row2.chart3.getdataListParmList.offset)
  1023. this.getChart3List()
  1024. }
  1025. },
  1026. handleList(key, item) {
  1027. console.log(item, key)
  1028. this.isClick = true
  1029. this.clickKey = key
  1030. clearInterval(this.timer)
  1031. for (let i = 0; i < this.list.length; i++) {
  1032. if (key == i) {
  1033. this.$set(this.list[i], 'background', '#f3f9f7')
  1034. this.$set(this.list[i], 'borderColor', '#009d6a')
  1035. this.$set(this.list[i], 'isChecked', true)
  1036. } else {
  1037. this.$set(this.list[i], 'background', '#f9f9f9')
  1038. this.$set(this.list[i], 'borderColor', '#f9f9f9')
  1039. this.$set(this.list[i], 'isChecked', false)
  1040. }
  1041. }
  1042. this.row2.chart3.getdataListParm.parammaps.pid = this.list[key].pid
  1043. this.row2.chart3.getdataListParm.parammaps.id = this.list[key].id
  1044. this.getChart3()
  1045. // this.timer = null
  1046. // clearInterval(this.timer)
  1047. // setTimeout(() => {
  1048. // this.timer = null
  1049. // this.timer = setInterval(this.autoPlay, 15000)
  1050. // }, 20000)
  1051. },
  1052. autoPlay() {
  1053. if (this.list[0].isChecked == true) {
  1054. if (this.list.length > 1) {
  1055. this.$set(this.list[1], 'background', '#f3f9f7')
  1056. this.$set(this.list[1], 'borderColor', '#009d6a')
  1057. this.$set(this.list[1], 'isChecked', true)
  1058. this.$set(this.list[0], 'background', '#f9f9f9')
  1059. this.$set(this.list[0], 'borderColor', '#f9f9f9')
  1060. this.$set(this.list[0], 'isChecked', false)
  1061. this.row2.chart3.getdataListParm.parammaps.pid = this.list[1].pid
  1062. this.row2.chart3.getdataListParm.parammaps.id = this.list[1].id
  1063. this.getChart3()
  1064. } else {
  1065. if (this.row2.chart3.isRightA == false && this.row2.chart3.isLeftA == true) {
  1066. this.row2.chart3.getdataListParmList.offset = this.row2.chart3.getdataListParmList.offset - 1
  1067. this.getChart3List()
  1068. }
  1069. }
  1070. } else {
  1071. if (this.row2.chart3.isRightA == true) {
  1072. this.row2.chart3.getdataListParmList.offset = this.row2.chart3.getdataListParmList.offset + 1
  1073. console.log(this.row2.chart3.getdataListParmList.offset)
  1074. this.getChart3List()
  1075. } else {
  1076. if (this.row2.chart3.isLeftA == true) {
  1077. this.row2.chart3.getdataListParmList.offset = this.row2.chart3.getdataListParmList.offset - 1
  1078. console.log(this.row2.chart3.getdataListParmList.offset)
  1079. this.getChart3List()
  1080. } else {
  1081. this.$set(this.list[0], 'background', '#f3f9f7')
  1082. this.$set(this.list[0], 'borderColor', '#009d6a')
  1083. this.$set(this.list[0], 'isChecked', true)
  1084. this.$set(this.list[1], 'background', '#f9f9f9')
  1085. this.$set(this.list[1], 'borderColor', '#f9f9f9')
  1086. this.$set(this.list[1], 'isChecked', false)
  1087. this.row2.chart3.getdataListParm.parammaps.pid = this.list[0].pid
  1088. this.row2.chart3.getdataListParm.parammaps.id = this.list[0].id
  1089. this.getChart3()
  1090. }
  1091. }
  1092. }
  1093. },
  1094. // 计划统计
  1095. getChart4() {
  1096. this.row3.chart1.listLoading = true
  1097. GetReportform(this.row3.chart1.getdataListParm).then(response => {
  1098. if (response.data !== null && response.data.list !== null) {
  1099. console.log('计划统计数据', response.data.list)
  1100. if(response.data.data){
  1101. for (let i = 0; i < response.data.data.length; i++) {
  1102. if (response.data.data[i].实际量 !== '' && response.data.data[i].实际量 !== undefined) {
  1103. response.data.data[i].实际量 = parseFloat(response.data.data[i].实际量)
  1104. }
  1105. if (response.data.data[i].理论量 !== '' && response.data.data[i].理论量 !== undefined) {
  1106. response.data.data[i].理论量 = parseFloat(response.data.data[i].理论量)
  1107. }
  1108. if (response.data.data[i].field1 !== '' && response.data.data[i].field1 !== undefined) {
  1109. response.data.data[i].field1 = parseFloat(response.data.data[i].field1)
  1110. }
  1111. if (response.data.data[i].计划取消重量 !== '' && response.data.data[i].计划取消重量 !== undefined) {
  1112. response.data.data[i].计划取消重量 = parseFloat(response.data.data[i].计划取消重量)
  1113. }
  1114. if (response.data.data[i].field3 !== '' && response.data.data[i].field3 !== undefined) {
  1115. response.data.data[i].field3 = parseFloat(response.data.data[i].field3)
  1116. }
  1117. if (response.data.data[i].正确数 !== '' && response.data.data[i].正确数 !== undefined) {
  1118. response.data.data[i].正确数 = parseFloat(response.data.data[i].正确数)
  1119. }
  1120. if (response.data.data[i].计划数 !== '' && response.data.data[i].计划数 !== undefined) {
  1121. response.data.data[i].计划数 = parseFloat(response.data.data[i].计划数)
  1122. }
  1123. if (response.data.data[i].field2 !== '' && response.data.data[i].field2 !== undefined) {
  1124. response.data.data[i].field2 = parseFloat(response.data.data[i].field2)
  1125. }
  1126. }
  1127. }
  1128. this.row3.chart1.table.list = response.data.data
  1129. console.log(this.row3.chart1.table.list, '123')
  1130. this.row3.chart1.chartLine_data = response.data.list
  1131. this.row3.chart1.total = response.data.total
  1132. } else {
  1133. this.row3.chart1.list = []
  1134. this.row3.chart1.chartLine_data = []
  1135. this.row3.chart1.chartLine_data.data1 = []
  1136. }
  1137. if (this.row3.chart1.chartLine_data.data1.length == 0) {
  1138. this.row3.chart1.chartLine_data.title = this.$t('common.noMsg')
  1139. } else {
  1140. this.row3.chart1.chartLine_data.title = ''
  1141. }
  1142. this.roadChartLine4(this.row3.chart1.chartLine_data)
  1143. setTimeout(() => {
  1144. this.row3.chart1.listLoading = false
  1145. }, 100)
  1146. })
  1147. },
  1148. roadChartLine4(chartLine_data) {
  1149. if (this.row3.chart1.chartLine != null) {
  1150. this.row3.chart1.chartLine.dispose()
  1151. }
  1152. this.row3.chart1.chartLine = echarts.init(document.getElementById('row3chartLine1'))
  1153. var option = {
  1154. title: { text: chartLine_data.title, x: 'center', y: 'center', textStyle: { color: '#909399', fontWeight: 'normal', fontSize: 12 }},
  1155. tooltip: { trigger: 'axis' },
  1156. color: ['#1abd88', '#549be9', '#fd8d75'],
  1157. legend: {
  1158. data: [this.$t('dashboard.table.PARate'),this.$t('dashboard.table.CNumR'),this.$t('dashboard.table.PCancelWeight')],
  1159. top: 10, itemHeight: 7, itemWidth: 15, textStyle: { fontSize: 12 }
  1160. },
  1161. grid: {
  1162. top: '30%',
  1163. left: '10%',
  1164. right: '10%',
  1165. bottom: '10%',
  1166. containLabel: true
  1167. },
  1168. toolbox: {
  1169. show: true,
  1170. right: '2%',
  1171. feature: {}
  1172. },
  1173. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data1, name: this.$t('dashboard.table.date'), },
  1174. yAxis: {
  1175. type: 'value', name: this.$t('dashboard.cant'), axisLabel: { formatter: '{value} %' }
  1176. },
  1177. series: [
  1178. { name: this.$t('dashboard.table.PARate'), type: 'line', symbol: 'none', smooth: true, itemStyle: { normal: { lineStyle: { color: '#1abd88' }}}, data: chartLine_data.data2 },
  1179. { name: this.$t('dashboard.table.CNumR'), type: 'line', symbol: 'none', smooth: true, itemStyle: { normal: { lineStyle: { color: '#549be9' }}}, data: chartLine_data.data3 },
  1180. { name: this.$t('dashboard.table.PCancelWeight'), type: 'line', symbol: 'none', smooth: true, itemStyle: { normal: { lineStyle: { color: '#fd8d75' }}}, data: chartLine_data.data4 }
  1181. ]
  1182. }
  1183. this.row3.chart1.chartLine.setOption(option)
  1184. if (this.row3.chart1.chartLine != null) {
  1185. window.onresize = function() {
  1186. this.row3.chart1.chartLine.resize()
  1187. }
  1188. }
  1189. },
  1190. // 泌乳牛干物质采食量
  1191. getChart5() {
  1192. this.row3.chart2.listLoading = true
  1193. GetReportform(this.row3.chart2.getdataListParm).then(response => {
  1194. console.log('泌乳牛干物质采食量数据', response)
  1195. if (response.data !== null && response.data.list !== null && response.data.data !== null) {
  1196. for (let i = 0; i < response.data.data.length; i++) {
  1197. if (response.data.data[i].field1 !== '' && response.data.data[i].field1 !== undefined) {
  1198. response.data.data[i].field1 = parseFloat(response.data.data[i].field1)
  1199. }
  1200. if (response.data.data[i].field2 !== '' && response.data.data[i].field2 !== undefined) {
  1201. response.data.data[i].field2 = parseFloat(response.data.data[i].field2)
  1202. }
  1203. }
  1204. this.row3.chart2.table.list = response.data.data
  1205. this.row3.chart2.chartLine_data = response.data.list
  1206. this.row3.chart2.total = response.data.total
  1207. } else {
  1208. this.row3.chart2.list = []
  1209. this.row3.chart2.chartLine_data = []
  1210. this.row3.chart2.chartLine_data.data1 = []
  1211. }
  1212. if (this.row3.chart2.chartLine_data.data1.length == 0) {
  1213. this.row3.chart2.chartLine_data.title = this.$t('common.noMsg')
  1214. } else {
  1215. this.row3.chart2.chartLine_data.title = ''
  1216. }
  1217. this.roadChartLine5(this.row3.chart2.chartLine_data)
  1218. setTimeout(() => {
  1219. this.row3.chart2.listLoading = false
  1220. }, 100)
  1221. })
  1222. },
  1223. roadChartLine5(chartLine_data) {
  1224. if (this.row3.chart2.chartLine != null) {
  1225. this.row3.chart2.chartLine.dispose()
  1226. }
  1227. this.row3.chart2.chartLine = echarts.init(document.getElementById('row3chartLine2'))
  1228. var option = {
  1229. title: { text: chartLine_data.title, x: 'center', y: 'center', textStyle: { color: '#909399', fontWeight: 'normal', fontSize: 12 }},
  1230. tooltip: { trigger: 'axis', axisPointer: { type: 'cross', crossStyle: { color: '#999' }}},
  1231. grid: { top: '26%', left: '13%', right: '13%', bottom: '10%', containLabel: true },
  1232. legend: { data: [this.$t('dashboard.miruTitle'), this.$t('dashboard.miruMilk')], right: 10, itemHeight: 7, itemWidth: 15 },
  1233. xAxis: [{ type: 'category', data: chartLine_data.data1 }],
  1234. yAxis: [{
  1235. splitLine: { show: false }, type: 'value', name: this.$t('dashboard.miruCowMilk'), axisLabel: { formatter: '{value} ' }
  1236. }, {
  1237. splitLine: { show: false }, type: 'value', name:this.$t('dashboard.miruMilk') , axisLabel: { formatter: '{value} ' }
  1238. }],
  1239. series: [{
  1240. name: this.$t('dashboard.miruTitle'), type: 'bar', barWidth: 5, itemStyle: { barBorderRadius: [18, 18, 0, 0], normal: { color: '#5199e5' }}, data: chartLine_data.data2
  1241. }, {
  1242. name: this.$t('dashboard.miruMilk'), type: 'line', barWidth: 5,
  1243. itemStyle: { barBorderRadius: [18, 18, 0, 0], normal: { color: '#36c293' }}, yAxisIndex: 1, data: chartLine_data.data3
  1244. }]
  1245. }
  1246. this.row3.chart2.chartLine.setOption(option)
  1247. if (this.row3.chart2.chartLine != null) {
  1248. window.onresize = function() {
  1249. this.row3.chart2.chartLine.resize()
  1250. }
  1251. }
  1252. },
  1253. // 成本统计
  1254. getChart6() {
  1255. this.row4.chart1.table.listLoading = true
  1256. this.row4.chart1.listLoading = true
  1257. GetReportform(this.row4.chart1.getdataListParm).then(response => {
  1258. if (response.data !== null && response.data.list !== null && response.data.data !== null && response.data.data !== '') {
  1259. console.log('成本统计数据', response.data.data)
  1260. console.log('成本统计数据', response.data.list)
  1261. for (let i = 0; i < response.data.data.length; i++) {
  1262. if (response.data.data[i].field1 !== '' && response.data.data[i].field1 !== undefined) {
  1263. response.data.data[i].field1 = parseFloat(response.data.data[i].field1)
  1264. }
  1265. if (response.data.data[i].field2 !== '' && response.data.data[i].field2 !== undefined) {
  1266. response.data.data[i].field2 = parseFloat(response.data.data[i].field2)
  1267. }
  1268. }
  1269. this.row4.chart1.table.list = response.data.data
  1270. this.row4.chart1.chartLine_data = response.data.list
  1271. this.row4.chart1.total = response.data.total
  1272. } else {
  1273. this.row4.chart1.list = []
  1274. this.row4.chart1.chartLine_data = []
  1275. this.row4.chart1.chartLine_data.data1 = []
  1276. }
  1277. if (this.row4.chart1.chartLine_data.data1.length == 0) {
  1278. this.row4.chart1.chartLine_data.title = this.$t('common.noMsg')
  1279. } else {
  1280. this.row4.chart1.chartLine_data.title = ''
  1281. }
  1282. this.roadChartLine6(this.row4.chart1.chartLine_data)
  1283. setTimeout(() => {
  1284. this.row4.chart1.listLoading = false
  1285. this.row4.chart1.table.listLoading = false
  1286. }, 100)
  1287. })
  1288. },
  1289. roadChartLine6(chartLine_data) {
  1290. if (this.row4.chart1.chartLine != null) {
  1291. this.row4.chart1.chartLine.dispose()
  1292. }
  1293. console.log(chartLine_data, '===666')
  1294. this.row4.chart1.chartLine = echarts.init(document.getElementById('row4chartLine1'))
  1295. var option = {
  1296. title: { text: chartLine_data.title, x: 'center', y: 'center', textStyle: { color: '#909399', fontWeight: 'normal', fontSize: 12 }},
  1297. grid: { top:'30%', left: '10%', right: '6%', bottom: '3%', containLabel: true },
  1298. tooltip: { trigger: 'axis', axisPointer: { type: 'cross', crossStyle: { color: '#999' }}},
  1299. legend: { data: [this.$t('dashboard.feedCow'), this.$t('dashboard.table.signOx')], itemHeight: 4, itemWidth: 15 ,},
  1300. xAxis: [{ type: 'category', data: chartLine_data.data1, axisPointer: { type: 'shadow' }, name: this.$t('dashboard.table.date') }],
  1301. yAxis: [{
  1302. splitLine: { show: false }, type: 'value', name: this.$t('dashboard.feedCows'), axisLabel: { formatter: '{value}' }
  1303. }, {
  1304. splitLine: { show: false }, type: 'value', name: this.$t('dashboard.signOxs'), axisLabel: { formatter: '{value}' }
  1305. }
  1306. ],
  1307. series: [{
  1308. name: this.$t('dashboard.feedCow'), type: 'bar', itemStyle: { normal: { color: '#1abd88' }}, data: chartLine_data.data2
  1309. }, {
  1310. name: this.$t('dashboard.table.signOx'), type: 'line', yAxisIndex: 1, itemStyle: { normal: { color: '#ff8d78' }}, data: chartLine_data.data3
  1311. }]
  1312. }
  1313. this.row4.chart1.chartLine.setOption(option)
  1314. if (this.row4.chart1.chartLine != null) {
  1315. window.onresize = function() {
  1316. this.row4.chart1.chartLine.resize()
  1317. }
  1318. }
  1319. },
  1320. // 混料实际重量统计
  1321. getChart7() {
  1322. this.row4.chart2.listLoading = true
  1323. GetReportform(this.row4.chart2.getdataListParm).then(response => {
  1324. if (response.data !== null && response.data.list !== null) {
  1325. console.log('混料实际重量统计数据', response.data.data)
  1326. if(response.data.data){
  1327. for (let i = 0; i < response.data.data.length; i++) {
  1328. if (response.data.data[i].field1 !== '' && response.data.data[i].field1 !== undefined) {
  1329. response.data.data[i].field1 = parseFloat(response.data.data[i].field1)
  1330. }
  1331. }
  1332. }
  1333. this.row4.chart2.table.list = response.data.data
  1334. this.row4.chart2.chartLine_data = response.data.list
  1335. this.row4.chart2.total = response.data.total
  1336. } else {
  1337. this.row4.chart2.list = []
  1338. this.row4.chart2.chartLine_data = []
  1339. this.row4.chart2.chartLine_data.data1 = []
  1340. }
  1341. if (this.row4.chart2.chartLine_data.data1.length == 0) {
  1342. this.row4.chart2.chartLine_data.title = this.$t('common.noMsg')
  1343. } else {
  1344. this.row4.chart2.chartLine_data.title = ''
  1345. }
  1346. this.roadChartLine7(this.row4.chart2.chartLine_data)
  1347. setTimeout(() => {
  1348. this.row4.chart2.listLoading = false
  1349. }, 100)
  1350. })
  1351. },
  1352. roadChartLine7(chartLine_data) {
  1353. if (this.row4.chart2.chartLine != null) {
  1354. this.row4.chart2.chartLine.dispose()
  1355. }
  1356. this.row4.chart2.chartLine = echarts.init(document.getElementById('row4chartLine2'))
  1357. var option = {
  1358. title: { text: chartLine_data.title, x: 'center', y: 'center', textStyle: { color: '#909399', fontWeight: 'normal', fontSize: 12 }},
  1359. grid: { left: '10%', right: '10%', bottom: '3%', containLabel: true },
  1360. tooltip: { trigger: 'axis' },
  1361. legend: { data: [''] },
  1362. xAxis: [{ type: 'category', data: chartLine_data.data1, name: this.$t('dashboard.table.date') }],
  1363. yAxis: [
  1364. { type: 'value', name: this.$t('dashboard.yWeight'), axisLabel: { formatter: '{value}' }}
  1365. ],
  1366. series: [{
  1367. name: this.$t('dashboard.yWeight'), type: 'bar', stack: '广告', itemStyle: { normal: { color: '#36C293' }}, data: chartLine_data.data2
  1368. }]
  1369. }
  1370. this.row4.chart2.chartLine.setOption(option)
  1371. if (this.row4.chart2.chartLine != null) {
  1372. window.onresize = function() {
  1373. this.row4.chart2.chartLine.resize()
  1374. }
  1375. }
  1376. },
  1377. getTable8() {
  1378. this.row4.table.listLoading = true
  1379. GetDataByName(this.row4.table.getdataListParm).then(response => {
  1380. console.log('库存预警table数据', response.data.list)
  1381. if (response.data.list !== null) {
  1382. this.row4.table.list = response.data.list
  1383. this.row4.table.total = response.data.total
  1384. } else {
  1385. this.row4.table.list = []
  1386. }
  1387. setTimeout(() => {
  1388. this.row4.table.listLoading = false
  1389. }, 100)
  1390. })
  1391. },
  1392. // 更多
  1393. handleMore() {
  1394. // this.$router.push({ path: '/inventoryManagement/Warning' })
  1395. this.$router.push({ name: 'Warning', params: { jmp: 'jmp' }})
  1396. },
  1397. // 导出
  1398. handleExport(item) {
  1399. console.log(item)
  1400. // 计划统计
  1401. if (item == 'row3chartLine1') {
  1402. console.log(this.row3.chart1.table.list)
  1403. var excelDatasTabChart1 = [
  1404. {
  1405. tHeader: this.$t('dashboard.tHeader1'),
  1406. filterVal: ['日期', '实际量', '理论量', 'field1', '计划取消重量', 'field3', '正确数', '计划数', 'field2'],
  1407. tableDatas: this.row3.chart1.table.list,
  1408. sheetName: this.$t('dashboard.sheetName1')
  1409. }
  1410. ]
  1411. json2excel(excelDatasTabChart1, this.$t('dashboard.sheetName1'), true, 'xlsx')
  1412. } else if (item == 'row3chartLine2') {
  1413. // 泌乳牛采食量
  1414. var excelDatasTabChart2 = [
  1415. {
  1416. tHeader: this.$t('dashboard.tHeader2'),
  1417. filterVal: ['日期', 'field1', 'field2'],
  1418. tableDatas: this.row3.chart2.table.list,
  1419. sheetName: this.$t('dashboard.sheetName2'),
  1420. }
  1421. ]
  1422. json2excel(excelDatasTabChart2, this.$t('dashboard.sheetName2'), true, 'xlsx')
  1423. } else if (item == 'row4chartLine1') {
  1424. // 成本统计
  1425. console.log('成本统计')
  1426. var excelDatasTabChart2 = [
  1427. {
  1428. tHeader: this.$t('dashboard.tHeader'),
  1429. filterVal: ['日期', 'field1', 'field2'],
  1430. tableDatas: this.row4.chart1.table.list,
  1431. sheetName:this.$t('dashboard.CostStatistics')
  1432. }
  1433. ]
  1434. json2excel(excelDatasTabChart2, this.$t('dashboard.CostStatistics'), true, 'xlsx')
  1435. } else if (item == 'row4chartLine2') {
  1436. console.log('混料实际重量统计')
  1437. var excelDatasTabChart4 = [
  1438. {
  1439. tHeader: this.$t('dashboard.tHeader3'),
  1440. filterVal: ['日期', 'field1'],
  1441. tableDatas: this.row4.chart2.table.list,
  1442. sheetName: this.$t('dashboard.sheetName3'),
  1443. }
  1444. ]
  1445. json2excel(excelDatasTabChart4, this.$t('dashboard.sheetName3'), true, 'xlsx')
  1446. }
  1447. },
  1448. handleTable(item) {
  1449. console.log(item)
  1450. if (item == 'row3chartLine1') {
  1451. console.log('计划统计表格')
  1452. this.row3.chart1.isTable = true
  1453. this.row3.chart1.isChart = false
  1454. } else if (item == 'row3chartLine2') {
  1455. console.log('泌乳牛采食量表格')
  1456. this.row3.chart2.isTable = true
  1457. this.row3.chart2.isChart = false
  1458. } else if (item == 'row4chartLine1') {
  1459. console.log('成本统计表格')
  1460. this.row4.chart1.isTable = true
  1461. this.row4.chart1.isChart = false
  1462. } else if (item == 'row4chartLine2') {
  1463. console.log('混料实际重量统计表格')
  1464. this.row4.chart2.isTable = true
  1465. this.row4.chart2.isChart = false
  1466. }
  1467. },
  1468. handleChart(item) {
  1469. console.log(item)
  1470. // 显示切换图表
  1471. if (item == 'row3chartLine1') {
  1472. console.log('计划统计图表')
  1473. this.row3.chart1.isTable = false
  1474. this.row3.chart1.isChart = true
  1475. this.getChart4()
  1476. } else if (item == 'row3chartLine2') {
  1477. console.log('泌乳牛采食量图表')
  1478. this.row3.chart2.isTable = false
  1479. this.row3.chart2.isChart = true
  1480. this.getChart5()
  1481. } else if (item == 'row4chartLine1') {
  1482. console.log('成本统计图表')
  1483. this.row4.chart1.isTable = false
  1484. this.row4.chart1.isChart = true
  1485. this.getChart6()
  1486. } else if (item == 'row4chartLine2') {
  1487. console.log('混料实际重量统计图表')
  1488. this.row4.chart2.isTable = false
  1489. this.row4.chart2.isChart = true
  1490. this.getChart7()
  1491. }
  1492. }
  1493. }
  1494. }
  1495. </script>
  1496. <style lang="scss" scoped>
  1497. .Title{
  1498. padding-left: 10px;border-radius: 10px;margin-top: 20px;background: #fff;height:40px;font-size:20px;line-height:40px;text-align: left;font-weight: 600;color:#333333;
  1499. }
  1500. .dashboard-editor-container {
  1501. background-color: #F4F4F4;
  1502. min-height: 100vh;
  1503. .news{
  1504. width: 70%;
  1505. height: 30px;
  1506. background: #fff;
  1507. margin: 0 auto;
  1508. border-radius: 10px;
  1509. text-align: center;
  1510. line-height: 30px;
  1511. color: red;
  1512. b{color: #000;}
  1513. }
  1514. .bottom{
  1515. padding:0 30px;
  1516. h4{text-align: right;}
  1517. .grid-content{
  1518. background: #fff;height: 90px;
  1519. border-radius: 10px;
  1520. }
  1521. .one{
  1522. border: 1px solid #82CBB3;height: 90px;
  1523. .Left{
  1524. float: left;
  1525. width: 65px;
  1526. text-align: center;
  1527. i{font-size: 36px;color:#82CBB3;line-height: 90px;}
  1528. }
  1529. .Right{
  1530. float: left;
  1531. margin-top:15px;
  1532. height: 60px;
  1533. font-weight: 600;
  1534. font-size: 14px;
  1535. line-height: 30px;
  1536. span{
  1537. display: inline-block;
  1538. width: 130px;
  1539. text-align: right;
  1540. }
  1541. }
  1542. }
  1543. .two{
  1544. border: 1px solid #FF9900;
  1545. .Left{
  1546. float: left;
  1547. width: 65px;
  1548. text-align: center;
  1549. i{font-size: 36px;color:#FF9900;line-height: 90px;}
  1550. }
  1551. .Right{
  1552. float: left;
  1553. margin-top:15px;
  1554. height: 60px;
  1555. font-weight: 600;
  1556. font-size: 14px;
  1557. line-height: 30px;
  1558. span{
  1559. display: inline-block;
  1560. width: 130px;
  1561. text-align: right;
  1562. }
  1563. }
  1564. }
  1565. .three{
  1566. border: 1px solid #0099FF;
  1567. .Left{
  1568. float: left;
  1569. width: 65px;
  1570. text-align: center;
  1571. i{font-size: 36px;color:#0099FF;line-height: 90px;}
  1572. }
  1573. .Right{
  1574. float: left;
  1575. height: 60px;
  1576. font-weight: 600;
  1577. font-size: 14px;
  1578. line-height: 30px;
  1579. margin-top:15px;
  1580. span{
  1581. display: inline-block;
  1582. width: 130px;
  1583. text-align: right;
  1584. }
  1585. }
  1586. }
  1587. .four{
  1588. border: 1px solid #FF5C5C;
  1589. .Left{
  1590. float: left;
  1591. width: 55px;
  1592. text-align: center;
  1593. i{font-size: 36px;color:#FF5C5C;line-height: 90px;}
  1594. }
  1595. .Right{
  1596. float: left;
  1597. flex: 1;
  1598. height: 60px;
  1599. font-weight: 600;
  1600. font-size: 14px;
  1601. line-height: 30px;
  1602. margin-top:15px;
  1603. span{
  1604. display: inline-block;
  1605. width: 150px;
  1606. text-align: right;
  1607. }
  1608. }
  1609. }
  1610. .car{
  1611. width:100%;height:150px;
  1612. display:flex;
  1613. display: -webkit-flex;
  1614. -webkit-flex-direction:row;
  1615. i{font-size: 50px;width:50px;display: block;line-height: 150px;}
  1616. .carList{
  1617. flex:1;height: 130px;
  1618. .list{
  1619. height: 130px;color: #fff;
  1620. // box-shadow: #000 0px 0px 10px;
  1621. // border-radius: 10px;
  1622. .list-l{
  1623. p{
  1624. padding-left:10px;font-size:13px;line-height: 16px; text-overflow: ellipsis;white-space:nowrap; overflow:hidden;
  1625. }
  1626. }
  1627. .list-r{
  1628. p{
  1629. font-size:13px;line-height: 16px;text-overflow: ellipsis;white-space:nowrap; overflow:hidden;
  1630. }
  1631. }
  1632. }
  1633. }
  1634. }
  1635. }
  1636. }
  1637. </style>
  1638. <style>
  1639. .app-main{background:#f5f5f5;}
  1640. </style>
  1641. <style lang="scss" scoped>
  1642. .dashboard-editor-container{padding-left: 10px;background: #f5f5f5;padding-bottom: 10px;}
  1643. // 公共
  1644. .img-t{position: absolute;left: 0;right: 0;margin: 30px auto;width: 31%;height: 31%;background-size: 100% 100%;}
  1645. .row1-c-l-c{
  1646. margin: 30px auto;border: 1px solid #eee;height: 40%;width: 50%;border-radius: 50%;text-align: center;display:table;
  1647. span{
  1648. height:100%;display:table-cell;vertical-align: middle;font-size:14px;color: #009C69;
  1649. b{padding-bottom: 10px;font-size: 16px;}
  1650. }
  1651. }
  1652. .row1-c-l-b{
  1653. width: 100%;text-align: center;display:table;font-size: 12px;
  1654. &:lang(en){
  1655. margin: -20px auto;
  1656. }
  1657. // div{
  1658. // font-size: 12px;height:100%;display:table-cell;vertical-align: middle;color: #323232;padding: 0 10px;width: 100%;
  1659. // span{text-align: right;width: 75%;display: block;float: left;}
  1660. // b{float: left;display: block;width: 25%;}
  1661. // }
  1662. }
  1663. .title{
  1664. height: 36px;padding-top: 7px;line-height: 36px;position: relative;
  1665. .img-title{
  1666. position: absolute;top: 10px; right:10px;bottom:0;left:20px;width: 30px;height: 30px;background: url(../../../assets/images/index/row-bg3.png) no-repeat;
  1667. }
  1668. .content{font-size: 16px;position: absolute;top: 7px;left: 55px;
  1669. // &:lang(en){
  1670. // font-size: 16px;
  1671. // }
  1672. }
  1673. }
  1674. .title1{
  1675. height: 36px;padding-top: 7px;line-height: 36px;position: relative;
  1676. &:lang(en){
  1677. line-height: 24px;
  1678. height: 24px;
  1679. }
  1680. .img-title{
  1681. position: absolute;top: 10px; right:10px;bottom:0;left:10px;
  1682. width: 25px;height: 25px;
  1683. img{width: 25px;height: 25px;}
  1684. }
  1685. .content{font-size: 16px;position: absolute;top: 7px;left: 40px;}
  1686. }
  1687. .button{
  1688. height: 30px;
  1689. .exportTable{float: right;margin-right: 5px;}
  1690. }
  1691. .dashboard{
  1692. display: flex;margin-top: 10px;
  1693. .dashboard-l{
  1694. // width: 540px;
  1695. width: 30%;
  1696. .row1{
  1697. height: 520px;
  1698. .row1-t{
  1699. background: #fff; height: 50px; color: #f28b46;
  1700. .row1-t-l{
  1701. .img-l{float:left;padding: 16px 10px 16px 20px;width: 18px;height: 18px;background: url(../../../assets/images/index/row-bg2.png) no-repeat;background-position: 0 8px;}
  1702. .content{float:left;width: 54%;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;font-size: 14px;line-height: 50px;padding-left: 3px;}
  1703. .img-r{float:left;padding: 16px 0 16px 17px;width: 30px;height: 15px;background: url(../../../assets/images/index/row-bg2.png) no-repeat;background-position: 0 -24px;}
  1704. }
  1705. .row1-t-r{padding-right: 20px;text-align: right;line-height: 50px;}
  1706. }
  1707. .row1-c{
  1708. display: flex; flex-direction: row; flex-wrap: wrap; justify-content: space-between;margin-top: 10px;
  1709. .row1-c-l{
  1710. background: #fff;width:49%;height:225px;border-radius:3px;margin-right: 1%;position: relative;
  1711. .img-t{width:49%;height:38%;background: url(../../../assets/images/index/t1.png) no-repeat; background-size: 100% 100%;}
  1712. }
  1713. .row1-c-r{
  1714. background: #fff;width:49%;height:225px;border-radius:3px;position: relative;
  1715. .img-t{width:49%;height:38%;background: url(../../../assets/images/index/t2.png) no-repeat; background-size: 100% 100%;}
  1716. }
  1717. }
  1718. .row1-b{
  1719. display: flex; flex-direction: row; flex-wrap: wrap; justify-content: space-between;margin-top: 10px;
  1720. .row1-b-l{
  1721. background: #fff;width:49%;height:225px;border-radius:3px;margin-right:1%;position: relative;
  1722. .img-t{width:49%;height:38%;background: url(../../../assets/images/index/t4.png) no-repeat; background-size: 100% 100%;}
  1723. }
  1724. .row1-b-r{
  1725. background: #fff;width:49%;height:225px;border-radius:3px;position: relative;
  1726. .img-t{width:49%;height:38%;background: url(../../../assets/images/index/t3.png) no-repeat; background-size: 100% 100%;}
  1727. }
  1728. }
  1729. }
  1730. .row2{
  1731. margin-top:10px;height: 375px;background: #fff;
  1732. .img-title{background-position: 0 0;}
  1733. .todayPlan{
  1734. display: flex; flex-direction: row;margin-top: 10px;
  1735. div{
  1736. flex: 1;position: relative;
  1737. .bottom{
  1738. width: 99%;height: 70px;background: #f9f9f9;margin: 30px auto 5px;display: flex; flex-direction: row;text-align: center;
  1739. &:lang(en){
  1740. height: 84px;
  1741. }
  1742. div{
  1743. flex: 1;height: 42px;color: #333333;
  1744. }
  1745. .bottom-l{
  1746. border-right: 1px solid #e0e0e0;margin-top: 15px;width: 100%;
  1747. .bottom-l-t{
  1748. height: 30px;
  1749. b{font-size: 18px;}
  1750. }
  1751. .bottom-l-b{font-size: 12px;}
  1752. }
  1753. .bottom-r{
  1754. margin-top: 15px;width: 100%;
  1755. .bottom-r-t{height: 30px;padding-left: 10px;}
  1756. .bottom-r-b{padding-left: 10px;font-size: 12px;}
  1757. }
  1758. }
  1759. }
  1760. }
  1761. }
  1762. .row3{
  1763. margin-top:10px;height: 375px;background: #fff;
  1764. .img-title{background-position: 0 -90px;}
  1765. }
  1766. }
  1767. .dashboard-r{
  1768. margin-left: 10px;flex:1;
  1769. .row1{
  1770. height: 520px;background: #fff;
  1771. .img-title{background-position: 0 -240px;}
  1772. #row2chartLine3{height: 270px;margin-top: 10px;}
  1773. .carsLength{
  1774. padding: 13px 0 0 22px;line-height: 38px;font-size: 18px;font-weight: 700;
  1775. }
  1776. .car{
  1777. height: 140px;position: relative;
  1778. .iconLeft{width:32px;height:32px;position:absolute;top:46px;left:15px; z-index:1;}
  1779. .iconRight{width:32px;height:32px;position:absolute;top:46px;right: 20px ;z-index:1;}
  1780. .carList{
  1781. padding:0 30px;height: 120px;overflow: hidden;display: flex;
  1782. &:lang(en){
  1783. height: 140px;
  1784. }
  1785. .listW{
  1786. background: #f3f9f7;
  1787. float: left;
  1788. // flex: 1 1;
  1789. margin: 0 5px;position: relative;width: 50%;
  1790. .list{
  1791. width: 100%;height: 100%;border-radius: 5px;border:1px solid #000;
  1792. .list-t{
  1793. display: flex;border-bottom: 1px solid #f1f1f1;
  1794. .list-t-t{
  1795. flex: 1 1;width: 0;font-size: 12px;line-height: 22px;padding: 25px 5px 15px;text-align: center;
  1796. span{ display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  1797. }
  1798. }
  1799. .list-b{
  1800. display: flex; text-align: center;margin-top: 14px;color: #323232;
  1801. .list-b-l{
  1802. flex: 1;width: 0; height: 40px; position: relative;
  1803. .left{
  1804. .num{
  1805. font-size: 12px;
  1806. b{font-size: 12px;}
  1807. }
  1808. .weight{font-size: 12px;}
  1809. }
  1810. .right{
  1811. height: 30px;width: 1px;background: #e0e0e0;position: absolute;right: 0;top: 0;bottom: 0;margin-top:auto;margin-bottom:auto
  1812. }
  1813. }
  1814. }
  1815. }
  1816. .img-checked{width: 30px;height: 28px;position: absolute;top: 0;right: 0;background: url(../../../assets/images/index/row-r6.png);}
  1817. }
  1818. }
  1819. }
  1820. }
  1821. .row2{
  1822. margin-top:10px;height: 375px;
  1823. display: flex; flex-direction: row;
  1824. .row2-l{
  1825. margin-right: 10px; background: #fff;height:375px;border-radius:3px;flex: 1;
  1826. .img-title{background-position: 0 -30px;}
  1827. }
  1828. .row2-r{
  1829. background: #fff;height:375px;border-radius:3px;flex: 1;
  1830. .img-title{background-position: 0 -60px;}
  1831. }
  1832. }
  1833. .row3{
  1834. margin-top:10px;height: 375px;
  1835. display: flex; flex-direction: row;
  1836. .row3-l{
  1837. margin-right: 10px; background: #fff;height:375px;border-radius:3px;flex: 1;
  1838. .img-title{background-position: 0 -120px;}
  1839. }
  1840. .row3-r{
  1841. background: #fff;height:375px;border-radius:3px;flex: 1;
  1842. .img-title{background-position: 0 -150px;}
  1843. }
  1844. }
  1845. }
  1846. }
  1847. </style>