8d5897ec01e221f00fc9ac7974a94267fb5bcb9a.svn-base 74 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695
  1. <template>
  2. <div class="dashboard-editor-container">
  3. <div style="background: #F4F4F4;height: 10px;" />
  4. <div v-if="news==1" style="display:none;" class="news"><b>消息提醒:</b>撒料计划未分配完善,请及时进行计划分配</div>
  5. <div v-if="news==2" style="display:none;" class="news"><b>消息提醒:</b>预混计划未分配完善,请及时进行计划分配</div>
  6. <div v-if="news==3" style="display:none;" class="news"><b>消息提醒:</b>剩料计划未分配完善,请及时进行计划分配</div>
  7. <div class="bottom">
  8. <!-- <h4>{{ date }}</h4> -->
  9. <el-row :gutter="20" style="margin-top: 10px;">
  10. <el-col :span="6">
  11. <div class="grid-content one">
  12. <div class="Left">
  13. <i class="iconfont icon-shuaxin" />
  14. </div>
  15. <div class="Right">
  16. <span>昨日混料准确率:</span>{{ row1.list.yesRateHL }}<br>
  17. <span>近30天混料准确率:</span>{{ row1.list.monRateHL }}
  18. </div>
  19. </div>
  20. </el-col>
  21. <el-col :span="6">
  22. <div class="grid-content two">
  23. <div class="Left">
  24. <i class="iconfont icon-zhunqueshuai2" />
  25. </div>
  26. <div class="Right">
  27. <span>昨日撒料准确率:</span>{{ row1.list.yesRateSL }}<br>
  28. <span>近30天撒料准确率:</span>{{ row1.list.monRateSL }}
  29. </div>
  30. </div>
  31. </el-col>
  32. <el-col :span="6">
  33. <div class="grid-content three">
  34. <div class="Left">
  35. <i class="iconfont icon-zhinengsiwei" style="font-size: 40px;" />
  36. </div>
  37. <div class="Right">
  38. <span>昨日撒料正确率:</span>{{ row1.list.yesRateSLR }}<br>
  39. <span>近30天撒料正确率:</span>{{ row1.list.monRateSLR }}
  40. </div>
  41. </div>
  42. </el-col>
  43. <el-col :span="6">
  44. <div class="grid-content four">
  45. <div class="Left">
  46. <i class="iconfont icon-siliaotoufangjilu" style="font-size: 50px;" />
  47. </div>
  48. <div class="Right">
  49. <span>昨日撒料偏差:</span><span v-if="row1.list.temtime !== ''">{{ row1.list.temtime }} min</span><br>
  50. <span>近30天撒料偏差:</span><span v-if="row1.list.montime !== ''">{{ row1.list.montime }} min</span>
  51. </div>
  52. </div>
  53. </el-col>
  54. </el-row>
  55. <el-row :gutter="20" style="margin-top: 20px;">
  56. <el-col :span="6">
  57. <div class="grid-content" style="height:500px;background: #fff;">
  58. <div style="height: 250px; border-bottom: 1px solid #000;">
  59. <!-- <div class="Title">今日计划统计</div> -->
  60. <b style="padding-left: 10px;line-height: 50px;font-size: 20px;">今日计划统计</b><br>
  61. <div style="text-align: center;">
  62. <b style="padding-right: 10px;font-size: 14px;">完成车次:{{ row2.chart1.chartLine_data.data1 }}</b>
  63. <b style="padding-right: 10px;font-size: 14px;">计划车次:{{ row2.chart1.chartLine_data.data2 }}</b>
  64. </div>
  65. <div id="row2chartLine1" style="height: 150px;" />
  66. </div>
  67. <div style="height: 250px;">
  68. <div style="text-align: center;padding-top:50px;">
  69. <b style="padding-right: 5px;font-size: 14px;">完成重量:{{ row2.chart2.chartLine_data.data1 }}kg</b>
  70. <b style="padding-right: 5px;font-size: 14px;">计划重量:{{ row2.chart2.chartLine_data.data2 }}kg</b>
  71. </div>
  72. <div id="row2chartLine2" style="height: 150px;" />
  73. </div>
  74. </div>
  75. </el-col>
  76. <el-col :span="18" style="margin-top:-20px;">
  77. <div class="grid-content" style="height:500px;">
  78. <div style="height:350px;">
  79. <div style="font-size:14px;color:#666;margin:0 auto;position: relative;">
  80. <span style="line-height:30px;position:absolute;right:190px;top:30px;"><i class="el-icon-caret-top" style="color:#ff3131;line-height:30px;font-size:30px;" /><b style="line-height:32px;">开始重量</b></span>
  81. <span style="line-height:30px;position:absolute;right:100px;top:30px;"><i class="el-icon-caret-top" style="color:#61a5e8;line-height:30px;font-size:30px;" /><b style="line-height:32px;">结束重量</b></span>
  82. </div>
  83. <div class="Title">实时监控</div>
  84. <div id="row2chartLine3" style="height: 90%;" />
  85. </div>
  86. <div class="car" style="position: relative;">
  87. <p style="position: absolute;left:50px;top:-50px;">当前车辆数:3</p>
  88. <i ref="left" class="el-icon-arrow-left" @click="handleLeft" />
  89. <el-row :gutter="20" class="carList">
  90. <el-col v-for="(item,index) in list" :key="index" :span="8">
  91. <div ref="list" class="list" :style="{'background': item.background,'color':item.color}" @mouseover="mouseOver" @mouseleave="mouseLeave" @click="handleList(index,item.id)">
  92. <el-row :gutter="20">
  93. <el-col :span="12" class="list-l">
  94. <!-- 车辆/描述 -->
  95. <p><span>车辆:</span>{{ item.A1 }}</p>
  96. <el-tooltip placement="top">
  97. <p slot="content">
  98. <span v-if="item.states == 1">饲料:{{ item.A2 }}</span>
  99. <span v-if="item.states == 2">栏舍:{{ item.A2 }}</span>
  100. </p>
  101. <p>
  102. <span v-if="item.states == 1">饲料:{{ item.A2 }}</span>
  103. <span v-if="item.states == 2">栏舍:{{ item.A2 }}</span>
  104. </p>
  105. </el-tooltip>
  106. <p><span>完成重量:</span>{{ item.A3 }}</p>
  107. <p><span>完成度:</span>{{ item.A4 }}</p>
  108. </el-col>
  109. <el-col :span="12" class="list-r">
  110. <!-- 栏舍/饲料 -->
  111. <el-tooltip placement="top">
  112. <p slot="content"> <span>描述:</span> {{ item.A5 }} </p>
  113. <p> <span>描述:</span> {{ item.A5 }} </p>
  114. </el-tooltip>
  115. <p><span>计划重量:</span>{{ item.A6 }}</p>
  116. <p><span>剩余重量:</span>{{ item.A7 }}</p>
  117. <p><span>车辆已载重:</span>{{ item.A8 }}</p>
  118. </el-col>
  119. </el-row>
  120. </div>
  121. </el-col>
  122. </el-row>
  123. <i ref="right" class="el-icon-arrow-right" @click="handleRight" />
  124. </div>
  125. </div>
  126. </el-col>
  127. </el-row>
  128. <el-row :gutter="20">
  129. <!-- 计划统计 -->
  130. <el-col :span="12" style="position: relative;">
  131. <div class="Title">计划统计</div>
  132. <div style="background: #fff;height:50px;">
  133. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('row3chartLine1')">导出</el-button>
  134. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleTable('row3chartLine1')">切换表格</el-button>
  135. </div>
  136. <div id="row3chartLine1" style="background: #fff;height:350px;" />
  137. <div v-if="row3.chart1.isTable" class="table" style="position: absolute;width:97%;top:19px;">
  138. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('row3chartLine1')">导出</el-button>
  139. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleChart('row3chartLine1')">切换图表</el-button>
  140. <el-table
  141. :key="row3.chart1.table.tableKey"
  142. v-loading="row3.chart1.table.listLoading"
  143. element-loading-text="给我一点时间"
  144. :data="row3.chart1.table.list"
  145. border
  146. fit
  147. highlight-current-row
  148. style="width: 100%;"
  149. height="400"
  150. :row-style="rowStyle"
  151. :cell-style="cellStyle"
  152. class="elTable table-fixed"
  153. >
  154. <el-table-column label="日期" sortable min-width="110px" align="center" prop="日期" />
  155. <el-table-column label="计划执行重量(kg)" sortable min-width="110px" align="center" prop="实际量" />
  156. <el-table-column label="配方理论重量(kg)" sortable min-width="110px" align="center" prop="理论量" />
  157. <el-table-column label="计划准确率" sortable min-width="110px" align="center" prop="field1" />
  158. <el-table-column label="计划取消重量(kg)" sortable min-width="110px" align="center" prop="计划取消重量" />
  159. <el-table-column label="计划准确率(去除取消重量)" sortable min-width="110px" align="center" prop="field3" />
  160. <el-table-column label="计划正确数" sortable min-width="110px" align="center" prop="正确数" />
  161. <el-table-column label="计划数" sortable min-width="110px" align="center" prop="计划数" />
  162. <el-table-column label="计划正确率" sortable min-width="110px" align="center" prop="field2" />
  163. </el-table>
  164. </div>
  165. </el-col>
  166. <!-- 泌乳牛采食量 -->
  167. <el-col :span="12" style="position: relative;">
  168. <div class="Title">泌乳牛采食量</div>
  169. <div style="background: #fff;height:50px;">
  170. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('row3chartLine2')">导出</el-button>
  171. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleTable('row3chartLine2')">切换表格</el-button>
  172. </div>
  173. <div id="row3chartLine2" style="background: #fff;height:350px;" />
  174. <div v-if="row3.chart2.isTable" class="table" style="position: absolute;width:97%;top:19px;">
  175. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('row3chartLine2')">导出</el-button>
  176. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleChart('row3chartLine2')">切换图表</el-button>
  177. <el-table
  178. :key="row3.chart2.table.tableKey"
  179. v-loading="row3.chart2.table.listLoading"
  180. element-loading-text="给我一点时间"
  181. :data="row3.chart2.table.list"
  182. border
  183. fit
  184. highlight-current-row
  185. style="width: 100%;"
  186. height="400"
  187. :row-style="rowStyle"
  188. :cell-style="cellStyle"
  189. class="elTable table-fixed"
  190. >
  191. <el-table-column label="日期" sortable min-width="110px" align="center" prop="日期" />
  192. <el-table-column label="泌乳牛采食量(kg)" sortable min-width="110px" align="center" prop="field1" />
  193. <el-table-column label="泌乳牛产奶量(kg)" sortable min-width="110px" align="center" prop="field2" />
  194. </el-table>
  195. </div>
  196. </el-col>
  197. </el-row>
  198. <el-row :gutter="20">
  199. <!-- 成本统计 -->
  200. <el-col :span="8">
  201. <div class="Title">成本统计</div>
  202. <div id="row4chartLine1" style="background: #fff;height:400px;" />
  203. </el-col>
  204. <!-- 出库统计 -->
  205. <el-col :span="8">
  206. <div class="Title">出库统计</div>
  207. <div id="row4chartLine2" style="background: #fff;height:400px;" />
  208. </el-col>
  209. <el-col :span="8">
  210. <div class="Title">库存预警</div>
  211. <div id="table" style="height: 400px;background: #fff;">
  212. <el-table
  213. :key="row4.table.tableKey"
  214. v-loading="row4.table.listLoading"
  215. element-loading-text="给我一点时间"
  216. :data="row4.table.list"
  217. border
  218. fit
  219. highlight-current-row
  220. style="width: 100%;background: #fff;"
  221. height="400"
  222. :row-style="rowStyle"
  223. :cell-style="cellStyle"
  224. class="elTable table-fixed"
  225. >
  226. <el-table-column label="序号" type="index" min-width="80px" align="center" />
  227. <el-table-column label="饲料名称" min-width="80px" align="center" prop="feedname" />
  228. <el-table-column label="库存量(kg)" min-width="70px" align="center" prop="stockweight" />
  229. <el-table-column label="剩余使用天数" min-width="80px" align="center" prop="ldays" />
  230. </el-table>
  231. <!-- <span style="line-height: 50px;color:#82CBB3;text-align: center;width: 100%;display: inline-block;cursor:pointer;" @click="handleMore">查看更多</span> -->
  232. </div>
  233. </el-col>
  234. </el-row>
  235. </div>
  236. </div>
  237. </template>
  238. <script>
  239. import { GetDataByName, GetReportform } from '@/api/common'
  240. import Cookies from 'js-cookie'
  241. import { parseTime } from '@/utils/index.js'
  242. import echarts from 'echarts'
  243. import { json2excel } from '@/utils/index.js'
  244. require('echarts/theme/macarons')
  245. var myKey = 0
  246. export default {
  247. name: 'DashboardEditor',
  248. data() {
  249. return {
  250. date: parseTime(new Date(), '{y}-{m}-{d}'),
  251. 'list': [],
  252. news: 1,
  253. row1: {
  254. getdataListParm: {
  255. name: 'getHomepageStr',
  256. page: 1,
  257. offset: 1,
  258. pagecount: 10,
  259. returntype: 'Map',
  260. parammaps: {
  261. pastureid: Cookies.get('pastureid')
  262. }
  263. },
  264. listLoading: true,
  265. list: ''
  266. },
  267. row2: {
  268. chart1: {
  269. chartLine: null,
  270. chartLine_data: {}
  271. },
  272. chart2: {
  273. chartLine: null,
  274. chartLine_data: {}
  275. },
  276. chart3: {
  277. chartLine: null,
  278. chartLine_data: {},
  279. getdataListParm: {
  280. name: 'getBarmilkList',
  281. page: 1,
  282. offset: 1,
  283. pagecount: 3,
  284. returntype: 'Map',
  285. parammaps: {
  286. pastureid: Cookies.get('pastureid'),
  287. enable: ''
  288. }
  289. },
  290. list: [],
  291. total: 0,
  292. listLoading: true,
  293. pageNum: '',
  294. pages: '',
  295. getdataListParmList: {
  296. name: 'getBarmilkList',
  297. page: 1,
  298. offset: 1,
  299. pagecount: 3,
  300. returntype: 'Map',
  301. parammaps: {
  302. pastureid: Cookies.get('pastureid'),
  303. enable: ''
  304. }
  305. },
  306. list2: [],
  307. total2: 0,
  308. listLoading2: true,
  309. pageNum2: '',
  310. pages2: ''
  311. }
  312. },
  313. row3: {
  314. chartDate: [],
  315. chart1: {
  316. chartLine: null,
  317. chartLine_data: {},
  318. getdataListParm: {
  319. name: 'getAccuracyAllJH',
  320. page: 1,
  321. offset: 1,
  322. pagecount: 10,
  323. returntype: 'Map',
  324. parammaps: {
  325. pastureid: Cookies.get('pastureid'),
  326. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  327. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  328. inputDatetime: [new Date(), new Date()]
  329. }
  330. },
  331. list: [],
  332. total: 0,
  333. listLoading: true,
  334. isChart: true,
  335. isTable: false,
  336. table: {
  337. tableKey: 1,
  338. list: [],
  339. total: 0,
  340. listLoading: false
  341. }
  342. },
  343. chart2: {
  344. chartLine: null,
  345. chartLine_data: {},
  346. getdataListParm: {
  347. name: 'getFeedEffMR',
  348. page: 1,
  349. offset: 1,
  350. pagecount: 10,
  351. returntype: 'Map',
  352. parammaps: {
  353. pastureid: Cookies.get('pastureid'),
  354. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  355. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  356. inputDatetime: [new Date(), new Date()]
  357. }
  358. },
  359. list: [],
  360. total: 0,
  361. listLoading: true,
  362. isChart: true,
  363. isTable: false,
  364. table: {
  365. tableKey: 1,
  366. list: [],
  367. total: 0,
  368. listLoading: false
  369. }
  370. }
  371. },
  372. row4: {
  373. chart1: {
  374. chartLine: null,
  375. chartLine_data: {},
  376. getdataListParm: {
  377. name: 'getBarmilkList',
  378. page: 1,
  379. offset: 1,
  380. pagecount: 10,
  381. returntype: 'Map',
  382. parammaps: {
  383. pastureid: Cookies.get('pastureid'),
  384. enable: ''
  385. }
  386. },
  387. list: [],
  388. total: 0,
  389. listLoading: true
  390. },
  391. chart2: {
  392. chartLine: null,
  393. chartLine_data: {},
  394. getdataListParm: {
  395. name: 'getBarmilkList',
  396. page: 1,
  397. offset: 1,
  398. pagecount: 10,
  399. returntype: 'Map',
  400. parammaps: {
  401. pastureid: Cookies.get('pastureid'),
  402. enable: ''
  403. }
  404. },
  405. list: [],
  406. total: 0,
  407. listLoading: true
  408. },
  409. table: {
  410. getdataListParm: {
  411. name: 'getFsWarnList',
  412. page: 1,
  413. offset: 1,
  414. pagecount: 5,
  415. returntype: 'Map',
  416. parammaps: {
  417. pastureid: Cookies.get('pastureid')
  418. }
  419. },
  420. tableKey: 1,
  421. list: [],
  422. total: 0,
  423. listLoading: true,
  424. temp: {}
  425. }
  426. },
  427. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  428. cellStyle: { padding: 0 + 'px' },
  429. timer: ''
  430. }
  431. },
  432. created() {
  433. this.getTimeFn()
  434. this.getList()
  435. this.getChart3List()
  436. this.getChart4()
  437. this.getChart5()
  438. this.getChart6()
  439. this.getChart7()
  440. this.getTable8()
  441. },
  442. mounted() {
  443. const that = this
  444. let num = 0
  445. // 创建并执行定时器
  446. this.timer = setInterval(() => {
  447. // 当num等于100时清除定时器
  448. if (num >= 3) {
  449. // clearInterval(that.timer)
  450. num = 0
  451. console.log('关闭了定时器===')
  452. }
  453. myKey = num
  454. if (myKey == 0) {
  455. this.$refs.list[0].style.background = '#7ac3ec'
  456. this.$refs.list[0].style.color = '#f7f941'
  457. this.$refs.list[1].style.background = '#7ac3ec'
  458. this.$refs.list[1].style.color = '#fff'
  459. this.$refs.list[2].style.background = '#7ac3ec'
  460. this.$refs.list[2].style.color = '#fff'
  461. this.row2.chart3.chartLine_data = {
  462. data1: ['06:34:10', '06:34:11', '06:34:12', '06:34:13', '06:34:14', '06:34:14', '06:34:15', '06:34:16', '06:34:17', '06:34:18', '06:34:19', '06:34:20', '06:34:21', '06:34:22', '06:34:23', '06:34:29', '06:34:44', '06:34:59', '06:35:14', '06:35:29', '06:35:44', '06:35:59', '06:36:14', '06:36:29', '06:36:44', '06:36:59', '06:37:14', '06:37:28', '06:37:29', '06:37:44', '06:37:59', '06:38:14', '06:38:29', '06:38:44', '06:38:59', '06:38:59', '06:39:14', '06:39:29', '06:39:44', '06:39:59', '06:40:08', '06:40:14', '06:40:29', '06:40:44', '06:40:59', '06:41:14', '06:41:29', '06:41:40', '06:41:44', '06:41:59', '06:42:14', '06:42:29', '06:42:44', '06:42:59', '06:43:09', '06:43:14', '06:43:29', '06:43:44', '06:43:59', '06:44:14', '06:44:29', '06:44:44'],
  463. data2: [141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 341.46, 341.46, 341.46, 341.46, 341.46, 341.46, 341.46, 437.73, 437.73, 437.73, 437.73, 437.73, 437.73, 687.33, 687.33, 687.33, 687.33, 687.33, 687.33, 687.33, 959.24, 959.24, 959.24, 959.24, 959.24, 959.24, 959.24, 1107.6, 1107.6, 1107.6, 1107.6, 1107.6, 1107.6, 1107.6],
  464. data3: [-8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -11, -9, -4, -8, -10, -8, -8, 0, -1, 32, 88, 142, 143, 141, 154, 215, 250, 256, 338, 337, 329, 325, 409, 420, 438, 434, 432, 447, 439, 496, 655, 680, 678, 670, 669, 741, 752, 924, 958, 962, 955, 961, 956, 956, 968],
  465. data4: [
  466. ['06:34:10', -8],
  467. ['06:37:28', 142],
  468. ['06:37:29', 143],
  469. ['06:38:59', 338],
  470. ['06:38:59', 337],
  471. ['06:40:08', 438],
  472. ['06:40:08', 438],
  473. ['06:41:40', 680],
  474. ['06:41:44', 678],
  475. ['06:43:09', 958],
  476. ['06:43:09', 958]
  477. ]
  478. }
  479. this.roadChartLine3(this.row2.chart3.chartLine_data)
  480. } else if (myKey == 1) {
  481. this.$refs.list[0].style.background = '#7ac3ec'
  482. this.$refs.list[0].style.color = '#fff'
  483. this.$refs.list[myKey].style.background = '#7ac3ec'
  484. this.$refs.list[myKey].style.color = '#f7f941'
  485. this.$refs.list[2].style.background = '#7ac3ec'
  486. this.$refs.list[2].style.color = '#fff'
  487. this.row2.chart3.chartLine_data = {
  488. data1: ['06:43:09', '06:43:14', '06:43:29', '06:43:44', '06:43:59', '06:44:14', '06:44:29', '06:44:44', '06:44:44', '06:44:59', '06:45:14', '06:45:30', '06:45:45', '06:46:00', '06:46:15', '06:46:30', '06:46:45', '06:47:00', '06:47:15', '06:47:30', '06:47:40', '06:47:45', '06:48:00', '06:48:15', '06:48:30', '06:48:45', '06:49:00', '06:49:15', '06:49:20', '06:49:30', '06:49:45', '06:50:00', '06:50:15', '06:50:30', '06:50:45', '06:51:00', '06:51:15', '06:51:30', '06:51:45', '06:52:00', '06:52:15', '06:52:30', '06:52:45', '06:53:00', '06:53:14', '06:53:15', '06:53:30', '06:53:45', '06:54:00', '06:54:15', '06:54:30', '06:54:45', '06:55:00', '06:55:15', '06:55:30'],
  489. data2: [959.24, 959.24, 959.24, 959.24, 959.24, 959.24, 959.24, 1107.6, 1107.6, 1107.6, 1107.6, 1107.6, 1107.6, 1107.6, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 3233.97, 3233.97, 3233.97, 3233.97, 3233.97, 3233.97, 3233.97, 3233.97, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38],
  490. data3: [958, 962, 955, 961, 956, 956, 968, 1100, 1099, 1102, 1115, 1103, 1217, 1266, 1681, 1919, 1968, 2139, 2426, 2479, 2486, 2489, 2480, 2502, 2498, 2769, 3097, 3224, 3236, 3242, 3238, 3282, 3320, 3369, 3411, 3458, 3499, 3540, 3580, 3632, 3668, 3708, 3753, 3798, 3830, 3830],
  491. data4: [
  492. ['06:44:44', 1100],
  493. ['06:44:44', 1099],
  494. ['06:47:40', 2486],
  495. ['06:47:45', 2489],
  496. ['06:49:20', 3236],
  497. ['06:49:20', 3236],
  498. ['06:53:14', 3830],
  499. ['06:53:15', 3830]
  500. ]
  501. }
  502. this.roadChartLine3(this.row2.chart3.chartLine_data)
  503. } else if (myKey == 2) {
  504. this.$refs.list[0].style.background = '#7ac3ec'
  505. this.$refs.list[0].style.color = '#fff'
  506. this.$refs.list[1].style.background = '#7ac3ec'
  507. this.$refs.list[1].style.color = '#fff'
  508. this.$refs.list[myKey].style.background = '#7ac3ec'
  509. this.$refs.list[myKey].style.color = '#f7f941'
  510. this.row2.chart3.chartLine_data = {
  511. data1: ['06:53:14', '06:53:15', '06:53:30', '06:53:45', '06:54:00', '06:54:15', '06:54:30', '06:54:45', '06:55:00', '06:55:15', '06:55:30', '06:55:45', '06:56:00', '06:56:15', '06:56:30', '06:56:45', '06:57:00', '06:57:15', '06:57:30', '06:57:45', '06:58:00', '06:58:16', '06:58:31', '06:58:46', '06:59:01', '06:59:03', '06:59:16', '06:59:31', '06:59:46', '07:00:01', '07:00:16', '07:00:31', '07:00:46', '07:01:01', '07:01:16', '07:01:31', '07:01:46', '07:02:01', '07:02:01', '07:02:16', '07:02:31', '07:02:46', '07:03:01', '07:03:16', '07:03:31', '07:03:46', '07:04:01', '07:04:16', '07:04:31', '07:04:46', '07:05:01', '07:05:16', '07:05:20', '07:05:31', '07:05:46', '07:06:01', '07:06:16', '07:06:31', '07:06:46', '07:07:01', '07:07:10', '07:07:16', '07:07:31', '07:07:46', '07:08:01', '07:08:16', '07:08:31', '07:08:46', '07:09:01', '07:09:16', '07:09:31', '07:09:46'],
  512. data2: [3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 351.82, 351.82, 351.82, 351.82, 351.82, 351.82, 351.82, -16.48, -16.48, -16.48, -16.48, -16.48, -16.48, -16.48, -16.48, -16.48, -16.48, -16.48],
  513. data3: [3837, 3840, 3832, 3829, 3842, 3817, 3825, 3822, 3850, 3820, 3830, 3837, 3833, 3830, 3832, 3829, 3814, 3681, 3575, 3423, 3268, 3138, 3036, 3032, 3039, 3032, 3017, 3025, 3036, 2926, 2895, 2696, 2315, 1831, 1379, 1232, 1232, 1227, 1228, 1224, 1225, 1213, 1230, 1209, 1221, 1225, 1231, 1138, 928, 736, 708, 707, 674, 540, 530, 527, 437, 390, 356, 325, 307, 309, 310, 308, 294, 308, 306, 293, 278, 226],
  514. data4: [
  515. ['06:59:01', 3036],
  516. ['06:59:03', 3032],
  517. ['07:02:01', 1232],
  518. ['07:02:01', 1232],
  519. ['07:05:16', 736],
  520. ['07:05:20', 708],
  521. ['07:07:10', 356],
  522. ['07:07:10', 356]
  523. ]
  524. }
  525. this.roadChartLine3(this.row2.chart3.chartLine_data)
  526. }
  527. console.log(num++)
  528. }, 1000000)
  529. },
  530. methods: {
  531. getTimeFn() {
  532. const that = this
  533. const end = new Date()
  534. const start = new Date()
  535. start.setTime(start.getTime() - 3600 * 1000 * 24 * 20)
  536. that.row3.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
  537. that.row3.chartDate[1] = parseTime(end, '{y}-{m}-{d}')
  538. that.row3.chart1.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  539. that.row3.chart1.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  540. that.row3.chart1.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  541. that.row3.chart1.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  542. that.row3.chart2.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  543. that.row3.chart2.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  544. that.row3.chart2.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  545. that.row3.chart2.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  546. },
  547. getList() {
  548. this.row1.listLoading = true
  549. GetDataByName(this.row1.getdataListParm).then(response => {
  550. console.log('row1数据', response.data.list)
  551. if (response.data.list !== null) {
  552. if (response.data.list[0].monRateHL == undefined) { response.data.list[0].monRateHL = '' }
  553. if (response.data.list[0].monRateSL == undefined) { response.data.list[0].monRateSL = '' }
  554. if (response.data.list[0].monRateSLR == undefined) { response.data.list[0].monRateSLR = '' }
  555. if (response.data.list[0].yesRateHL == undefined) { response.data.list[0].yesRateHL = '' }
  556. if (response.data.list[0].yesRateHL == undefined) { response.data.list[0].yesRateHL = '' }
  557. if (response.data.list[0].yesRateSL == undefined) { response.data.list[0].yesRateSL = '' }
  558. if (response.data.list[0].yesRateSLR == undefined) { response.data.list[0].yesRateSLR = '' }
  559. if (response.data.list[0].temtime == undefined) { response.data.list[0].temtime = '' }
  560. if (response.data.list[0].montime == undefined) { response.data.list[0].montime = '' }
  561. this.row1.list = response.data.list[0]
  562. this.row2.chart1.chartLine_data.data1 = parseFloat(response.data.list[0].doneTimes)
  563. this.row2.chart1.chartLine_data.data2 = parseFloat(response.data.list[0].planTimes)
  564. this.row2.chart2.chartLine_data.data1 = parseFloat(response.data.list[0].doneWeight)
  565. this.row2.chart2.chartLine_data.data2 = parseFloat(response.data.list[0].planWeight)
  566. this.roadChartLine1(this.row2.chart1.chartLine_data)
  567. this.roadChartLine2(this.row2.chart2.chartLine_data)
  568. } else {
  569. this.row1.list.data1.monRateHL = ''
  570. this.row1.list.data1.monRateSL = ''
  571. this.row1.list.data1.monRateSLR = ''
  572. this.row1.list.data1.yesRateHL = ''
  573. this.row1.list.data1.yesRateSL = ''
  574. this.row1.list.data1.yesRateSLR = ''
  575. this.row1.list.data1.temtime = ''
  576. this.row1.list.data1.montime = ''
  577. this.row2.chart1.chartLine_data.data1 = ''
  578. this.row2.chart1.chartLine_data.data2 = ''
  579. this.row2.chart2.chartLine_data.data1 = ''
  580. this.row2.chart2.chartLine_data.data2 = ''
  581. }
  582. setTimeout(() => {
  583. this.row1.listLoading = false
  584. }, 100)
  585. })
  586. },
  587. // 今日计划统计-完成车次
  588. roadChartLine1(chartLine_data) {
  589. if (this.row2.chart1.chartLine != null) {
  590. this.row2.chart1.chartLine.dispose()
  591. }
  592. this.row2.chart1.chartLine = echarts.init(document.getElementById('row2chartLine1'))
  593. var option = {
  594. // 标题组件,包含主标题和副标题
  595. title: {
  596. show: true,
  597. x: 'center',
  598. textStyle: {
  599. fontSize: '15',
  600. color: 'green',
  601. fontWeight: 'bold'
  602. }
  603. },
  604. // 提示框组件
  605. tooltip: {
  606. // 是否显示提示框组件,包括提示框浮层和 axisPointe
  607. show: false,
  608. // 触发类型: item:数据项触发,axis:坐标轴触发
  609. trigger: 'item',
  610. formatter: '{a} <br/>{b}: {c} ({d}%)'
  611. },
  612. // 系列列表。每个系列通过 type 决定自己的图表类型
  613. series: [{
  614. // 系列名称,用于tooltip的显示,legend 的图例筛选,在 setOption 更新数据和配置项时用于指定对应的系列。
  615. name: '任务进度',
  616. type: 'pie',
  617. // 饼图的半径,数组的第一项是内半径,第二项是外半径
  618. radius: ['80%', '70%'],
  619. // 是否启用防止标签重叠策略,默认开启
  620. avoidLabelOverlap: false,
  621. hoverAnimation: false,
  622. // 标签的视觉引导线样式,在 label 位置 设置为'outside'的时候会显示视觉引导线
  623. labelLine: {
  624. normal: {
  625. show: false
  626. }
  627. },
  628. data: [{
  629. value: chartLine_data.data1, // 数据值
  630. name: '完成率', // 数据项名称
  631. selected: false, // 该数据项是否被选中
  632. // 单个扇区的标签配置
  633. label: {
  634. normal: {
  635. show: true, // 是显示标签
  636. position: 'center',
  637. fontSize: 20,
  638. // 标签内容格式器,支持字符串模板和回调函数两种形式,字符串模板与回调函数返回的字符串均支持用 \n 换行
  639. formatter: '{b}\n{d}%'
  640. }
  641. }
  642. }, {
  643. value: chartLine_data.data2 - chartLine_data.data1,
  644. label: {
  645. normal: {
  646. show: false
  647. }
  648. }
  649. }]
  650. }],
  651. color: ['#409EFF', '#B7DBFF']
  652. }
  653. this.row2.chart1.chartLine.setOption(option)
  654. window.onresize = function() {
  655. this.row2.chart1.chartLine.resize()
  656. }
  657. },
  658. // 今日计划统计-完成重量
  659. roadChartLine2(chartLine_data) {
  660. if (this.row2.chart2.chartLine != null) {
  661. this.row2.chart2.chartLine.dispose()
  662. }
  663. this.row2.chart2.chartLine = echarts.init(document.getElementById('row2chartLine2'))
  664. var option = {
  665. // 标题组件,包含主标题和副标题
  666. title: {
  667. show: true,
  668. x: 'center',
  669. textStyle: {
  670. fontSize: '15',
  671. color: 'green',
  672. fontWeight: 'bold'
  673. }
  674. },
  675. // 提示框组件
  676. tooltip: {
  677. // 是否显示提示框组件,包括提示框浮层和 axisPointe
  678. show: false,
  679. // 触发类型: item:数据项触发,axis:坐标轴触发
  680. trigger: 'item',
  681. formatter: '{a} <br/>{b}: {c} ({d}%)'
  682. },
  683. // 系列列表。每个系列通过 type 决定自己的图表类型
  684. series: [{
  685. // 系列名称,用于tooltip的显示,legend 的图例筛选,在 setOption 更新数据和配置项时用于指定对应的系列。
  686. name: '任务进度',
  687. type: 'pie',
  688. // 饼图的半径,数组的第一项是内半径,第二项是外半径
  689. radius: ['80%', '70%'],
  690. // 是否启用防止标签重叠策略,默认开启
  691. avoidLabelOverlap: false,
  692. hoverAnimation: false,
  693. // 标签的视觉引导线样式,在 label 位置 设置为'outside'的时候会显示视觉引导线
  694. labelLine: {
  695. normal: {
  696. show: false
  697. }
  698. },
  699. data: [{
  700. value: chartLine_data.data1, // 数据值
  701. name: '完成率', // 数据项名称
  702. selected: false, // 该数据项是否被选中
  703. // 单个扇区的标签配置
  704. label: {
  705. normal: {
  706. show: true, // 是显示标签
  707. position: 'center',
  708. fontSize: 20,
  709. // 标签内容格式器,支持字符串模板和回调函数两种形式,字符串模板与回调函数返回的字符串均支持用 \n 换行
  710. formatter: '{b}\n{d}%'
  711. }
  712. }
  713. }, {
  714. value: chartLine_data.data2 - chartLine_data.data1,
  715. label: {
  716. normal: {
  717. show: false
  718. }
  719. }
  720. }]
  721. }],
  722. color: ['#409EFF', '#B7DBFF']
  723. }
  724. this.row2.chart2.chartLine.setOption(option)
  725. window.onresize = function() {
  726. this.row2.chart2.chartLine.resize()
  727. }
  728. },
  729. // 实时监控
  730. getChart3() {
  731. this.row2.chart3.listLoading = true
  732. GetDataByName(this.row2.chart3.getdataListParm).then(response => {
  733. console.log('实时监控数据', response.data.list)
  734. if (response.data.list !== null) {
  735. console.log(this.$refs.list)
  736. this.$refs.list[myKey].style.background = '#7ac3ec'
  737. // var evenNumbers = []// 偶数
  738. // var oddNumbers = []// 奇数
  739. // for (let i = 0; i < response.data.list.data4.length; i++) {
  740. // console.log(response.data.list.data4[i])
  741. // if (i == 0) {
  742. // oddNumbers.push(response.data.list.data4[i])
  743. // } else {
  744. // if (i % 2 == 0) {
  745. // evenNumbers.push(response.data.list.data4[i])
  746. // } else {
  747. // oddNumbers.push(response.data.list.data4[i])
  748. // }
  749. // }
  750. // }
  751. // response.data.list.data4 = oddNumbers
  752. // response.data.list.data5 = evenNumbers
  753. console.log(this.$refs)
  754. this.row2.chart3.chartLine_data = {
  755. data1: ['06:34:10', '06:34:11', '06:34:12', '06:34:13', '06:34:14', '06:34:14', '06:34:15', '06:34:16', '06:34:17', '06:34:18', '06:34:19', '06:34:20', '06:34:21', '06:34:22', '06:34:23', '06:34:29', '06:34:44', '06:34:59', '06:35:14', '06:35:29', '06:35:44', '06:35:59', '06:36:14', '06:36:29', '06:36:44', '06:36:59', '06:37:14', '06:37:28', '06:37:29', '06:37:44', '06:37:59', '06:38:14', '06:38:29', '06:38:44', '06:38:59', '06:38:59', '06:39:14', '06:39:29', '06:39:44', '06:39:59', '06:40:08', '06:40:14', '06:40:29', '06:40:44', '06:40:59', '06:41:14', '06:41:29', '06:41:40', '06:41:44', '06:41:59', '06:42:14', '06:42:29', '06:42:44', '06:42:59', '06:43:09', '06:43:14', '06:43:29', '06:43:44', '06:43:59', '06:44:14', '06:44:29', '06:44:44'],
  756. data2: [141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 341.46, 341.46, 341.46, 341.46, 341.46, 341.46, 341.46, 437.73, 437.73, 437.73, 437.73, 437.73, 437.73, 687.33, 687.33, 687.33, 687.33, 687.33, 687.33, 687.33, 959.24, 959.24, 959.24, 959.24, 959.24, 959.24, 959.24, 1107.6, 1107.6, 1107.6, 1107.6, 1107.6, 1107.6, 1107.6],
  757. data3: [-8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -11, -9, -4, -8, -10, -8, -8, 0, -1, 32, 88, 142, 143, 141, 154, 215, 250, 256, 338, 337, 329, 325, 409, 420, 438, 434, 432, 447, 439, 496, 655, 680, 678, 670, 669, 741, 752, 924, 958, 962, 955, 961, 956, 956, 968],
  758. data4: [
  759. ['06:34:10', -8],
  760. ['06:37:28', 142],
  761. ['06:37:29', 143],
  762. ['06:38:59', 338],
  763. ['06:38:59', 337],
  764. ['06:40:08', 438],
  765. ['06:40:08', 438],
  766. ['06:41:40', 680],
  767. ['06:41:44', 678],
  768. ['06:43:09', 958],
  769. ['06:43:09', 958]
  770. ]
  771. }
  772. this.row2.chart3.total = response.data.total
  773. this.row2.chart3.pageNum = response.data.pageNum
  774. this.row2.chart3.pages = response.data.pages
  775. // this.roadChartLine3(this.row2.chart3.chartLine_data)
  776. } else {
  777. this.row2.chart3.list = []
  778. }
  779. setTimeout(() => {
  780. this.row2.chart3.listLoading = false
  781. }, 100)
  782. })
  783. },
  784. roadChartLine3(chartLine_data) {
  785. if (this.row2.chart3.chartLine != null) {
  786. this.row2.chart3.chartLine.dispose()
  787. }
  788. this.row2.chart3.chartLine = echarts.init(document.getElementById('row2chartLine3'))
  789. var option = {
  790. title: {
  791. text: '',
  792. subtext: ''
  793. },
  794. color: ['#ff3131', '#61a5e8', '#ff3131', '#61a5e8'], // 关键加上这句话,legend的颜色和折线的自定义颜色就一致了
  795. legend: {
  796. data: [
  797. { name: '设计重量', icon: 'rectangle' },
  798. { name: '实际重量', icon: 'rectangle' },
  799. { name: '开始重量', icon: 'triangle' },
  800. { name: '结束重量', icon: 'triangle' }
  801. ],
  802. right: '20%',
  803. textStyle: {
  804. fontSize: 12,
  805. color: '#666'
  806. }
  807. },
  808. /* grid:{y:15},*/
  809. tooltip: {
  810. trigger: 'axis'
  811. },
  812. calculable: true,
  813. yAxis: [
  814. {
  815. type: 'value',
  816. name: '重量(kg)',
  817. splitLine: { show: false }, // 去除网格线
  818. axisLabel: {
  819. show: true,
  820. textStyle: {
  821. color: '#666' // 这里用参数代替了
  822. }
  823. }
  824. }
  825. ],
  826. xAxis: [
  827. {
  828. type: 'category',
  829. splitLine: { show: false }, // 去除网格线
  830. name: '时间',
  831. data: chartLine_data.data1,
  832. axisLabel: {
  833. show: true,
  834. textStyle: {
  835. color: '#666' // 这里用参数代替了
  836. }
  837. }
  838. }
  839. ],
  840. series: [{
  841. symbol: 'none',
  842. name: '实际重量',
  843. type: 'line',
  844. // step: 'end',
  845. data: chartLine_data.data3,
  846. smooth: true,
  847. barWidth: '37',
  848. itemStyle: {
  849. normal: {
  850. lineStyle: { color: '#61a5e8' }
  851. }
  852. }
  853. }, {
  854. symbol: 'none',
  855. name: '设计重量',
  856. type: 'line',
  857. barWidth: '37',
  858. data: chartLine_data.data2,
  859. itemStyle: {
  860. normal: {
  861. lineStyle: { color: '#61a5e8' }
  862. }
  863. }
  864. }, {
  865. name: '开始重量',
  866. symbol: 'triangle',
  867. symbolSize: 10,
  868. type: 'scatter',
  869. data: chartLine_data.data4
  870. }, {
  871. name: '结束重量',
  872. symbol: 'triangle',
  873. symbolSize: 10,
  874. type: 'scatter',
  875. data: chartLine_data.data5
  876. }]
  877. }
  878. this.row2.chart3.chartLine.setOption(option)
  879. window.onresize = function() {
  880. this.row2.chart3.chartLine.resize()
  881. }
  882. },
  883. // 图三轮询列表
  884. getChart3List() {
  885. this.row2.chart3.listLoading2 = true
  886. GetDataByName(this.row2.chart3.getdataListParmList).then(response => {
  887. console.log('实时监控数据', response.data.list)
  888. this.list = [
  889. { 'id': 1, 'A1': '1', 'A2': '进口燕麦草,1号苜蓿,棉籽', 'A3': '958kg', 'A4': '99.89%', 'A5': '新配方', 'A6': '959kg', 'A7': '1kg', 'A8': '958kg', states: 1, 'color': '#fff', 'background': '#7ac3ec' },
  890. { 'id': 2, 'A1': '1', 'A2': '青贮苜蓿,湿储玉米,啤酒糟,青贮玉米,水', 'A3': '2872', 'A4': '99.89%', 'A5': '新配方', 'A6': '2875.14', 'A7': '3.14kg', 'A8': '3830kg', states: 1, 'color': '#fff', 'background': '#7ac3ec' },
  891. { 'id': 3, 'A1': '1', 'A2': '17号,5号南', 'A3': '3860kg', 'A4': '99.75%', 'A5': '新配方', 'A6': '3869.52', 'A7': '9.52kg', 'A8': '3860kg', states: 2, 'color': '#fff', 'background': '#7ac3ec' }
  892. ]
  893. this.carLength = this.list.length
  894. if (response.data.list !== null) {
  895. this.row2.chart3.total2 = response.data.total
  896. this.row2.chart3.pageNum2 = response.data.pageNum
  897. this.row2.chart3.pages2 = response.data.pages
  898. this.getChart3()
  899. if (this.row2.chart3.getdataListParmList.offset == 1) {
  900. this.$refs.left.style.color = '#ccc'
  901. } else {
  902. // this.$refs.left.style.color = '#000'
  903. this.$refs.left.style.color = '#ccc'
  904. }
  905. if (response.data.pageNum == response.data.pages) {
  906. this.$refs.right.style.color = '#ccc'
  907. } else {
  908. // this.$refs.right.style.color = '#000'
  909. this.$refs.right.style.color = '#ccc'
  910. }
  911. } else {
  912. this.row2.chart3.list2 = []
  913. }
  914. setTimeout(() => {
  915. this.row2.chart3.listLoading2 = false
  916. }, 100)
  917. })
  918. },
  919. // 向左切换
  920. handleLeft() {
  921. console.log('左')
  922. if (this.row2.chart3.getdataListParmList.offset > 1) {
  923. this.row2.chart3.getdataListParmList.offset = this.row2.chart3.getdataListParmList.offset - 1
  924. this.$refs.left.style.color = '#ccc'
  925. this.$refs.right.style.color = '#000'
  926. }
  927. },
  928. // 向右切换
  929. handleRight() {
  930. if (this.row2.chart3.pageNum2 !== this.row2.chart3.pages2) {
  931. this.row2.chart3.getdataListParmList.offset = this.row2.chart3.getdataListParmList.offset + 1
  932. this.$refs.left.style.color = '#000'
  933. this.$refs.right.style.color = '#ccc'
  934. }
  935. },
  936. // 移入
  937. mouseOver() {
  938. console.log('移入')
  939. clearInterval(this.timer)
  940. },
  941. // 移除
  942. mouseLeave() {
  943. const that = this
  944. let num = 0
  945. // 创建并执行定时器
  946. this.timer = setInterval(() => {
  947. // 当num等于100时清除定时器
  948. if (num >= 3) {
  949. // clearInterval(that.timer)
  950. num = 0
  951. console.log('关闭了定时器===')
  952. }
  953. myKey = num
  954. if (myKey == 0) {
  955. this.$refs.list[0].style.background = '#7ac3ec'
  956. this.$refs.list[0].style.color = '#f7f941'
  957. this.$refs.list[1].style.background = '#7ac3ec'
  958. this.$refs.list[1].style.color = '#fff'
  959. this.$refs.list[2].style.background = '#7ac3ec'
  960. this.$refs.list[2].style.color = '#fff'
  961. this.row2.chart3.chartLine_data = {
  962. data1: ['06:34:10', '06:34:11', '06:34:12', '06:34:13', '06:34:14', '06:34:14', '06:34:15', '06:34:16', '06:34:17', '06:34:18', '06:34:19', '06:34:20', '06:34:21', '06:34:22', '06:34:23', '06:34:29', '06:34:44', '06:34:59', '06:35:14', '06:35:29', '06:35:44', '06:35:59', '06:36:14', '06:36:29', '06:36:44', '06:36:59', '06:37:14', '06:37:28', '06:37:29', '06:37:44', '06:37:59', '06:38:14', '06:38:29', '06:38:44', '06:38:59', '06:38:59', '06:39:14', '06:39:29', '06:39:44', '06:39:59', '06:40:08', '06:40:14', '06:40:29', '06:40:44', '06:40:59', '06:41:14', '06:41:29', '06:41:40', '06:41:44', '06:41:59', '06:42:14', '06:42:29', '06:42:44', '06:42:59', '06:43:09', '06:43:14', '06:43:29', '06:43:44', '06:43:59', '06:44:14', '06:44:29', '06:44:44'],
  963. data2: [141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 341.46, 341.46, 341.46, 341.46, 341.46, 341.46, 341.46, 437.73, 437.73, 437.73, 437.73, 437.73, 437.73, 687.33, 687.33, 687.33, 687.33, 687.33, 687.33, 687.33, 959.24, 959.24, 959.24, 959.24, 959.24, 959.24, 959.24, 1107.6, 1107.6, 1107.6, 1107.6, 1107.6, 1107.6, 1107.6],
  964. data3: [-8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -11, -9, -4, -8, -10, -8, -8, 0, -1, 32, 88, 142, 143, 141, 154, 215, 250, 256, 338, 337, 329, 325, 409, 420, 438, 434, 432, 447, 439, 496, 655, 680, 678, 670, 669, 741, 752, 924, 958, 962, 955, 961, 956, 956, 968],
  965. data4: [
  966. ['06:34:10', -8],
  967. ['06:37:28', 142],
  968. ['06:37:29', 143],
  969. ['06:38:59', 338],
  970. ['06:38:59', 337],
  971. ['06:40:08', 438],
  972. ['06:40:08', 438],
  973. ['06:41:40', 680],
  974. ['06:41:44', 678],
  975. ['06:43:09', 958],
  976. ['06:43:09', 958]
  977. ]
  978. }
  979. this.roadChartLine3(this.row2.chart3.chartLine_data)
  980. } else if (myKey == 1) {
  981. this.$refs.list[0].style.background = '#7ac3ec'
  982. this.$refs.list[0].style.color = '#fff'
  983. this.$refs.list[myKey].style.background = '#7ac3ec'
  984. this.$refs.list[myKey].style.color = '#f7f941'
  985. this.$refs.list[2].style.background = '#7ac3ec'
  986. this.$refs.list[2].style.color = '#fff'
  987. this.row2.chart3.chartLine_data = {
  988. data1: ['06:43:09', '06:43:14', '06:43:29', '06:43:44', '06:43:59', '06:44:14', '06:44:29', '06:44:44', '06:44:44', '06:44:59', '06:45:14', '06:45:30', '06:45:45', '06:46:00', '06:46:15', '06:46:30', '06:46:45', '06:47:00', '06:47:15', '06:47:30', '06:47:40', '06:47:45', '06:48:00', '06:48:15', '06:48:30', '06:48:45', '06:49:00', '06:49:15', '06:49:20', '06:49:30', '06:49:45', '06:50:00', '06:50:15', '06:50:30', '06:50:45', '06:51:00', '06:51:15', '06:51:30', '06:51:45', '06:52:00', '06:52:15', '06:52:30', '06:52:45', '06:53:00', '06:53:14', '06:53:15', '06:53:30', '06:53:45', '06:54:00', '06:54:15', '06:54:30', '06:54:45', '06:55:00', '06:55:15', '06:55:30'],
  989. data2: [959.24, 959.24, 959.24, 959.24, 959.24, 959.24, 959.24, 1107.6, 1107.6, 1107.6, 1107.6, 1107.6, 1107.6, 1107.6, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 3233.97, 3233.97, 3233.97, 3233.97, 3233.97, 3233.97, 3233.97, 3233.97, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38],
  990. data3: [958, 962, 955, 961, 956, 956, 968, 1100, 1099, 1102, 1115, 1103, 1217, 1266, 1681, 1919, 1968, 2139, 2426, 2479, 2486, 2489, 2480, 2502, 2498, 2769, 3097, 3224, 3236, 3242, 3238, 3282, 3320, 3369, 3411, 3458, 3499, 3540, 3580, 3632, 3668, 3708, 3753, 3798, 3830, 3830],
  991. data4: [
  992. ['06:44:44', 1100],
  993. ['06:44:44', 1099],
  994. ['06:47:40', 2486],
  995. ['06:47:45', 2489],
  996. ['06:49:20', 3236],
  997. ['06:49:20', 3236],
  998. ['06:53:14', 3830],
  999. ['06:53:15', 3830]
  1000. ]
  1001. }
  1002. this.roadChartLine3(this.row2.chart3.chartLine_data)
  1003. } else if (myKey == 2) {
  1004. this.$refs.list[0].style.background = '#7ac3ec'
  1005. this.$refs.list[0].style.color = '#fff'
  1006. this.$refs.list[1].style.background = '#7ac3ec'
  1007. this.$refs.list[1].style.color = '#fff'
  1008. this.$refs.list[myKey].style.background = '#7ac3ec'
  1009. this.$refs.list[myKey].style.color = '#f7f941'
  1010. this.row2.chart3.chartLine_data = {
  1011. data1: ['06:53:14', '06:53:15', '06:53:30', '06:53:45', '06:54:00', '06:54:15', '06:54:30', '06:54:45', '06:55:00', '06:55:15', '06:55:30', '06:55:45', '06:56:00', '06:56:15', '06:56:30', '06:56:45', '06:57:00', '06:57:15', '06:57:30', '06:57:45', '06:58:00', '06:58:16', '06:58:31', '06:58:46', '06:59:01', '06:59:03', '06:59:16', '06:59:31', '06:59:46', '07:00:01', '07:00:16', '07:00:31', '07:00:46', '07:01:01', '07:01:16', '07:01:31', '07:01:46', '07:02:01', '07:02:01', '07:02:16', '07:02:31', '07:02:46', '07:03:01', '07:03:16', '07:03:31', '07:03:46', '07:04:01', '07:04:16', '07:04:31', '07:04:46', '07:05:01', '07:05:16', '07:05:20', '07:05:31', '07:05:46', '07:06:01', '07:06:16', '07:06:31', '07:06:46', '07:07:01', '07:07:10', '07:07:16', '07:07:31', '07:07:46', '07:08:01', '07:08:16', '07:08:31', '07:08:46', '07:09:01', '07:09:16', '07:09:31', '07:09:46'],
  1012. data2: [3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 351.82, 351.82, 351.82, 351.82, 351.82, 351.82, 351.82, -16.48, -16.48, -16.48, -16.48, -16.48, -16.48, -16.48, -16.48, -16.48, -16.48, -16.48],
  1013. data3: [3837, 3840, 3832, 3829, 3842, 3817, 3825, 3822, 3850, 3820, 3830, 3837, 3833, 3830, 3832, 3829, 3814, 3681, 3575, 3423, 3268, 3138, 3036, 3032, 3039, 3032, 3017, 3025, 3036, 2926, 2895, 2696, 2315, 1831, 1379, 1232, 1232, 1227, 1228, 1224, 1225, 1213, 1230, 1209, 1221, 1225, 1231, 1138, 928, 736, 708, 707, 674, 540, 530, 527, 437, 390, 356, 325, 307, 309, 310, 308, 294, 308, 306, 293, 278, 226],
  1014. data4: [
  1015. ['06:59:01', 3036],
  1016. ['06:59:03', 3032],
  1017. ['07:02:01', 1232],
  1018. ['07:02:01', 1232],
  1019. ['07:05:16', 736],
  1020. ['07:05:20', 708],
  1021. ['07:07:10', 356],
  1022. ['07:07:10', 356]
  1023. ]
  1024. }
  1025. this.roadChartLine3(this.row2.chart3.chartLine_data)
  1026. }
  1027. console.log(num++)
  1028. }, 5000)
  1029. console.log('移除')
  1030. },
  1031. // 点击
  1032. handleList(key, id) {
  1033. console.log(id)
  1034. clearInterval(this.timer)
  1035. for (var i in this.$refs.list) {
  1036. if (i == key) {
  1037. this.$refs.list[i].style.background = '#7ac3ec'
  1038. this.$refs.list[i].style.color = '#f7f941'
  1039. // this.getChart3()
  1040. } else {
  1041. this.$refs.list[i].style.background = '#7ac3ec'
  1042. this.$refs.list[i].style.color = '#fff'
  1043. }
  1044. }
  1045. if (id == 1) {
  1046. this.row2.chart3.chartLine_data = {
  1047. data1: ['06:34:10', '06:34:11', '06:34:12', '06:34:13', '06:34:14', '06:34:14', '06:34:15', '06:34:16', '06:34:17', '06:34:18', '06:34:19', '06:34:20', '06:34:21', '06:34:22', '06:34:23', '06:34:29', '06:34:44', '06:34:59', '06:35:14', '06:35:29', '06:35:44', '06:35:59', '06:36:14', '06:36:29', '06:36:44', '06:36:59', '06:37:14', '06:37:28', '06:37:29', '06:37:44', '06:37:59', '06:38:14', '06:38:29', '06:38:44', '06:38:59', '06:38:59', '06:39:14', '06:39:29', '06:39:44', '06:39:59', '06:40:08', '06:40:14', '06:40:29', '06:40:44', '06:40:59', '06:41:14', '06:41:29', '06:41:40', '06:41:44', '06:41:59', '06:42:14', '06:42:29', '06:42:44', '06:42:59', '06:43:09', '06:43:14', '06:43:29', '06:43:44', '06:43:59', '06:44:14', '06:44:29', '06:44:44'],
  1048. data2: [141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 341.46, 341.46, 341.46, 341.46, 341.46, 341.46, 341.46, 437.73, 437.73, 437.73, 437.73, 437.73, 437.73, 687.33, 687.33, 687.33, 687.33, 687.33, 687.33, 687.33, 959.24, 959.24, 959.24, 959.24, 959.24, 959.24, 959.24, 1107.6, 1107.6, 1107.6, 1107.6, 1107.6, 1107.6, 1107.6],
  1049. data3: [-8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -11, -9, -4, -8, -10, -8, -8, 0, -1, 32, 88, 142, 143, 141, 154, 215, 250, 256, 338, 337, 329, 325, 409, 420, 438, 434, 432, 447, 439, 496, 655, 680, 678, 670, 669, 741, 752, 924, 958, 962, 955, 961, 956, 956, 968],
  1050. data4: [
  1051. ['06:34:10', -8],
  1052. ['06:37:28', 142],
  1053. ['06:37:29', 143],
  1054. ['06:38:59', 338],
  1055. ['06:38:59', 337],
  1056. ['06:40:08', 438],
  1057. ['06:40:08', 438],
  1058. ['06:41:40', 680],
  1059. ['06:41:44', 678],
  1060. ['06:43:09', 958],
  1061. ['06:43:09', 958]
  1062. ]
  1063. }
  1064. this.roadChartLine3(this.row2.chart3.chartLine_data)
  1065. } else if (id == 2) {
  1066. this.row2.chart3.chartLine_data = {
  1067. data1: ['06:43:09', '06:43:14', '06:43:29', '06:43:44', '06:43:59', '06:44:14', '06:44:29', '06:44:44', '06:44:44', '06:44:59', '06:45:14', '06:45:30', '06:45:45', '06:46:00', '06:46:15', '06:46:30', '06:46:45', '06:47:00', '06:47:15', '06:47:30', '06:47:40', '06:47:45', '06:48:00', '06:48:15', '06:48:30', '06:48:45', '06:49:00', '06:49:15', '06:49:20', '06:49:30', '06:49:45', '06:50:00', '06:50:15', '06:50:30', '06:50:45', '06:51:00', '06:51:15', '06:51:30', '06:51:45', '06:52:00', '06:52:15', '06:52:30', '06:52:45', '06:53:00', '06:53:14', '06:53:15', '06:53:30', '06:53:45', '06:54:00', '06:54:15', '06:54:30', '06:54:45', '06:55:00', '06:55:15', '06:55:30'],
  1068. data2: [959.24, 959.24, 959.24, 959.24, 959.24, 959.24, 959.24, 1107.6, 1107.6, 1107.6, 1107.6, 1107.6, 1107.6, 1107.6, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 3233.97, 3233.97, 3233.97, 3233.97, 3233.97, 3233.97, 3233.97, 3233.97, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38],
  1069. data3: [958, 962, 955, 961, 956, 956, 968, 1100, 1099, 1102, 1115, 1103, 1217, 1266, 1681, 1919, 1968, 2139, 2426, 2479, 2486, 2489, 2480, 2502, 2498, 2769, 3097, 3224, 3236, 3242, 3238, 3282, 3320, 3369, 3411, 3458, 3499, 3540, 3580, 3632, 3668, 3708, 3753, 3798, 3830, 3830],
  1070. data4: [
  1071. ['06:44:44', 1100],
  1072. ['06:44:44', 1099],
  1073. ['06:47:40', 2486],
  1074. ['06:47:45', 2489],
  1075. ['06:49:20', 3236],
  1076. ['06:49:20', 3236],
  1077. ['06:53:14', 3830],
  1078. ['06:53:15', 3830]
  1079. ]
  1080. }
  1081. this.roadChartLine3(this.row2.chart3.chartLine_data)
  1082. } else if (id == 3) {
  1083. this.row2.chart3.chartLine_data = {
  1084. data1: ['06:53:14', '06:53:15', '06:53:30', '06:53:45', '06:54:00', '06:54:15', '06:54:30', '06:54:45', '06:55:00', '06:55:15', '06:55:30', '06:55:45', '06:56:00', '06:56:15', '06:56:30', '06:56:45', '06:57:00', '06:57:15', '06:57:30', '06:57:45', '06:58:00', '06:58:16', '06:58:31', '06:58:46', '06:59:01', '06:59:03', '06:59:16', '06:59:31', '06:59:46', '07:00:01', '07:00:16', '07:00:31', '07:00:46', '07:01:01', '07:01:16', '07:01:31', '07:01:46', '07:02:01', '07:02:01', '07:02:16', '07:02:31', '07:02:46', '07:03:01', '07:03:16', '07:03:31', '07:03:46', '07:04:01', '07:04:16', '07:04:31', '07:04:46', '07:05:01', '07:05:16', '07:05:20', '07:05:31', '07:05:46', '07:06:01', '07:06:16', '07:06:31', '07:06:46', '07:07:01', '07:07:10', '07:07:16', '07:07:31', '07:07:46', '07:08:01', '07:08:16', '07:08:31', '07:08:46', '07:09:01', '07:09:16', '07:09:31', '07:09:46'],
  1085. data2: [3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 351.82, 351.82, 351.82, 351.82, 351.82, 351.82, 351.82, -16.48, -16.48, -16.48, -16.48, -16.48, -16.48, -16.48, -16.48, -16.48, -16.48, -16.48],
  1086. data3: [3837, 3840, 3832, 3829, 3842, 3817, 3825, 3822, 3850, 3820, 3830, 3837, 3833, 3830, 3832, 3829, 3814, 3681, 3575, 3423, 3268, 3138, 3036, 3032, 3039, 3032, 3017, 3025, 3036, 2926, 2895, 2696, 2315, 1831, 1379, 1232, 1232, 1227, 1228, 1224, 1225, 1213, 1230, 1209, 1221, 1225, 1231, 1138, 928, 736, 708, 707, 674, 540, 530, 527, 437, 390, 356, 325, 307, 309, 310, 308, 294, 308, 306, 293, 278, 226],
  1087. data4: [
  1088. ['06:59:01', 3036],
  1089. ['06:59:03', 3032],
  1090. ['07:02:01', 1232],
  1091. ['07:02:01', 1232],
  1092. ['07:05:16', 736],
  1093. ['07:05:20', 708],
  1094. ['07:07:10', 356],
  1095. ['07:07:10', 356]
  1096. ]
  1097. }
  1098. this.roadChartLine3(this.row2.chart3.chartLine_data)
  1099. }
  1100. // if (key % 2 == 0) {
  1101. // this.row2.chart3.chartLine_data = {
  1102. // }
  1103. // this.roadChartLine3(this.row2.chart3.chartLine_data)
  1104. // } else {
  1105. // this.row2.chart3.chartLine_data = {
  1106. // }
  1107. // this.roadChartLine3(this.row2.chart3.chartLine_data)
  1108. // }
  1109. },
  1110. // 计划统计
  1111. getChart4() {
  1112. this.row3.chart1.listLoading = true
  1113. GetReportform(this.row3.chart1.getdataListParm).then(response => {
  1114. console.log('计划统计数据', response.data.list)
  1115. if (response.data.list !== null) {
  1116. this.row3.chart1.table.list = response.data.data
  1117. this.row3.chart1.chartLine_data = response.data.list
  1118. this.row3.chart1.total = response.data.total
  1119. this.roadChartLine4(this.row3.chart1.chartLine_data)
  1120. } else {
  1121. this.row3.chart1.list = []
  1122. }
  1123. setTimeout(() => {
  1124. this.row3.chart1.listLoading = false
  1125. }, 100)
  1126. })
  1127. },
  1128. roadChartLine4(chartLine_data) {
  1129. if (this.row3.chart1.chartLine != null) {
  1130. this.row3.chart1.chartLine.dispose()
  1131. }
  1132. this.row3.chart1.chartLine = echarts.init(document.getElementById('row3chartLine1'))
  1133. var option = {
  1134. title: {
  1135. text: ''
  1136. },
  1137. tooltip: {
  1138. trigger: 'axis'
  1139. },
  1140. legend: {
  1141. data: ['计划准确率', '计划正确率', '计划准确率(去除取消重量)'],
  1142. top: 10
  1143. },
  1144. grid: {
  1145. top: '20%',
  1146. left: '0%',
  1147. right: '8%',
  1148. containLabel: true
  1149. },
  1150. toolbox: {
  1151. show: true,
  1152. right: '2%',
  1153. feature: {}
  1154. },
  1155. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data1, name: '日期' },
  1156. yAxis: {
  1157. type: 'value', name: '百分比', axisLabel: { formatter: '{value} %' }
  1158. },
  1159. series: [
  1160. { name: '计划准确率', type: 'line', data: chartLine_data.data2 },
  1161. { name: '计划正确率', type: 'line', data: chartLine_data.data3 },
  1162. { name: '计划准确率(去除取消重量)', type: 'line', data: chartLine_data.data4 }
  1163. ]
  1164. }
  1165. this.row3.chart1.chartLine.setOption(option)
  1166. window.onresize = function() {
  1167. this.row3.chart1.chartLine.resize()
  1168. }
  1169. },
  1170. // 泌乳牛采食量
  1171. getChart5() {
  1172. this.row3.chart2.listLoading = true
  1173. GetReportform(this.row3.chart2.getdataListParm).then(response => {
  1174. console.log('泌乳牛采食量数据', response.data.list)
  1175. if (response.data.list !== null) {
  1176. this.row3.chart2.table.list = response.data.data
  1177. this.row3.chart2.chartLine_data = response.data.list
  1178. this.row3.chart2.total = response.data.total
  1179. this.roadChartLine5(this.row3.chart2.chartLine_data)
  1180. } else {
  1181. this.row3.chart2.list = []
  1182. }
  1183. setTimeout(() => {
  1184. this.row3.chart2.listLoading = false
  1185. }, 100)
  1186. })
  1187. },
  1188. roadChartLine5(chartLine_data) {
  1189. if (this.row3.chart2.chartLine != null) {
  1190. this.row3.chart2.chartLine.dispose()
  1191. }
  1192. this.row3.chart2.chartLine = echarts.init(document.getElementById('row3chartLine2'))
  1193. var option = {
  1194. tooltip: {
  1195. trigger: 'axis'
  1196. },
  1197. legend: {
  1198. data: ['泌乳牛采食量', '泌乳牛产奶量'],
  1199. right: 10
  1200. },
  1201. xAxis: [
  1202. {
  1203. type: 'category',
  1204. data: chartLine_data.data1
  1205. }
  1206. ],
  1207. yAxis: [
  1208. {
  1209. type: 'value',
  1210. name: '泌乳牛采食量',
  1211. axisLabel: {
  1212. formatter: '{value} '
  1213. }
  1214. }, {
  1215. type: 'value',
  1216. name: '泌乳牛产奶量',
  1217. axisLabel: {
  1218. formatter: '{value} '
  1219. }
  1220. }
  1221. ],
  1222. series: [{
  1223. name: '泌乳牛采食量',
  1224. type: 'bar',
  1225. itemStyle: { /* 设置柱状颜色*/
  1226. normal: {
  1227. color: '#61a5e8'
  1228. }
  1229. },
  1230. data: chartLine_data.data2
  1231. }, {
  1232. name: '泌乳牛产奶量',
  1233. type: 'line',
  1234. itemStyle: { /* 设置折线颜色*/
  1235. normal: {
  1236. color: '#ff2d2d'
  1237. }
  1238. },
  1239. yAxisIndex: 1,
  1240. data: chartLine_data.data3
  1241. }]
  1242. }
  1243. this.row3.chart2.chartLine.setOption(option)
  1244. window.onresize = function() {
  1245. this.row3.chart2.chartLine.resize()
  1246. }
  1247. },
  1248. // 成本统计
  1249. getChart6() {
  1250. this.row4.chart1.listLoading = true
  1251. GetReportform(this.row4.chart1.getdataListParm).then(response => {
  1252. console.log('成本统计数据', response.data.list)
  1253. if (response.data.list !== null) {
  1254. this.row4.chart1.table.list = response.data.data
  1255. this.row4.chart1.chartLine_data = response.data.list
  1256. this.row4.chart1.chartLine_data = {
  1257. data1: ['09/16', '09/17', '09/18', '09/19', '09/20', '09/21', '09/22', '09/23', '09/24', '09/25', '09/26', '09/27', '09/28', '09/29', '09/30'],
  1258. data2: [1.5, 1.8, 2.2, 1.9, 1.8, 1.7, 2.0, 2.7, 2.4, 1.7, 1.8, 1.7, 2.7, 2.4, 2.1],
  1259. data3: [50, 65, 70, 45, 42, 45, 29, 39, 47, 56, 67, 72, 75, 68, 66]
  1260. }
  1261. this.row4.chart1.total = response.data.total
  1262. this.roadChartLine6(this.row4.chart1.chartLine_data)
  1263. } else {
  1264. this.row4.chart1.list = []
  1265. }
  1266. setTimeout(() => {
  1267. this.row4.chart1.listLoading = false
  1268. }, 100)
  1269. })
  1270. },
  1271. roadChartLine6(chartLine_data) {
  1272. if (this.row4.chart1.chartLine != null) {
  1273. this.row4.chart1.chartLine.dispose()
  1274. }
  1275. this.row4.chart1.chartLine = echarts.init(document.getElementById('row4chartLine1'))
  1276. var option = {
  1277. title: {
  1278. text: ''
  1279. },
  1280. grid: {
  1281. left: '8%',
  1282. right: '8%',
  1283. bottom: '3%',
  1284. containLabel: true
  1285. },
  1286. tooltip: {
  1287. trigger: 'axis'
  1288. },
  1289. legend: {
  1290. data: ['泌乳牛采食量', '泌乳牛产奶量']
  1291. },
  1292. xAxis: [
  1293. {
  1294. type: 'category',
  1295. data: chartLine_data.data1,
  1296. axisPointer: {
  1297. type: 'shadow'
  1298. },
  1299. name: '日期'
  1300. }
  1301. ],
  1302. yAxis: [
  1303. {
  1304. type: 'value',
  1305. name: '公斤奶\n饲料成本(元)',
  1306. axisLabel: {
  1307. formatter: '{value}'
  1308. }
  1309. }, {
  1310. type: 'value',
  1311. name: '单头牛\n饲料成本(元)',
  1312. axisLabel: {
  1313. formatter: '{value}'
  1314. }
  1315. }
  1316. ],
  1317. series: [
  1318. {
  1319. name: '泌乳牛采食量',
  1320. type: 'bar',
  1321. itemStyle: { /* 设置柱状颜色*/
  1322. normal: {
  1323. color: '#61a5e8'
  1324. }
  1325. },
  1326. data: chartLine_data.data2
  1327. }, {
  1328. name: '泌乳牛产奶量',
  1329. type: 'line',
  1330. yAxisIndex: 1,
  1331. itemStyle: { /* 设置柱状颜色*/
  1332. normal: {
  1333. color: '#ff3131'
  1334. }
  1335. },
  1336. data: chartLine_data.data3
  1337. }
  1338. ]
  1339. }
  1340. this.row4.chart1.chartLine.setOption(option)
  1341. window.onresize = function() {
  1342. this.row4.chart1.chartLine.resize()
  1343. }
  1344. },
  1345. getChart7() {
  1346. this.row4.chart2.listLoading = true
  1347. GetReportform(this.row4.chart2.getdataListParm).then(response => {
  1348. console.log('出库统计数据', response.data.list)
  1349. if (response.data.list !== null) {
  1350. this.row4.chart2.table.list = response.data.data
  1351. this.row4.chart2.chartLine_data = response.data.list
  1352. this.row4.chart2.chartLine_data = {
  1353. data1: ['09/16', '09/17', '09/18', '09/19', '09/20', '09/21', '09/22', '09/23', '09/24', '09/25', '09/26', '09/27', '09/28', '09/29', '09/30'],
  1354. data2: [3860, 3200, 3560, 3428, 3108, 2986, 2670, 3120, 3204, 3150, 2850, 3220, 3321, 3125, 3410],
  1355. data3: [120, 225, 0, 0, 124, 0, 159, 122, 0, 85, 62, 55, 0, 0, 75],
  1356. data4: [4800, 5572, 6820, 3880, 4830, 8800, 4575, 3850, 3896, 4285, 3800, 6562, 6720, 3580, 4120]
  1357. }
  1358. this.row4.chart2.total = response.data.total
  1359. this.roadChartLine7(this.row4.chart2.chartLine_data)
  1360. } else {
  1361. this.row4.chart2.list = []
  1362. }
  1363. setTimeout(() => {
  1364. this.row4.chart2.listLoading = false
  1365. }, 100)
  1366. })
  1367. },
  1368. roadChartLine7(chartLine_data) {
  1369. if (this.row4.chart2.chartLine != null) {
  1370. this.row4.chart2.chartLine.dispose()
  1371. }
  1372. this.row4.chart2.chartLine = echarts.init(document.getElementById('row4chartLine2'))
  1373. var option = {
  1374. title: {
  1375. text: ''
  1376. },
  1377. grid: {
  1378. left: '3%',
  1379. right: '8%',
  1380. bottom: '3%',
  1381. containLabel: true
  1382. },
  1383. tooltip: {
  1384. trigger: 'axis'
  1385. },
  1386. legend: {
  1387. data: ['系统用量', '人工用量', '金额']
  1388. },
  1389. xAxis: [
  1390. {
  1391. type: 'category',
  1392. data: chartLine_data.data1,
  1393. name: '日期'
  1394. }
  1395. ],
  1396. yAxis: [
  1397. {
  1398. type: 'value',
  1399. name: '重量(kg)',
  1400. axisLabel: {
  1401. formatter: '{value}'
  1402. }
  1403. }, {
  1404. type: 'value',
  1405. name: '金额(元)',
  1406. axisLabel: {
  1407. formatter: '{value}'
  1408. }
  1409. }
  1410. ],
  1411. series: [
  1412. {
  1413. name: '系统用量',
  1414. type: 'bar',
  1415. stack: '广告',
  1416. itemStyle: { /* 设置柱状颜色*/
  1417. normal: {
  1418. color: '#61a5e8'
  1419. }
  1420. },
  1421. data: chartLine_data.data2
  1422. }, {
  1423. name: '人工用量',
  1424. type: 'bar',
  1425. stack: '广告',
  1426. itemStyle: { /* 设置柱状颜色*/
  1427. normal: {
  1428. color: 'orange'
  1429. }
  1430. },
  1431. data: chartLine_data.data3
  1432. }, {
  1433. name: '金额',
  1434. type: 'line',
  1435. yAxisIndex: 1,
  1436. data: chartLine_data.data4,
  1437. itemStyle: { /* 设置折线颜色*/
  1438. normal: {
  1439. color: '#ff3131'
  1440. }
  1441. }
  1442. }
  1443. ]
  1444. }
  1445. this.row4.chart2.chartLine.setOption(option)
  1446. window.onresize = function() {
  1447. this.row4.chart2.chartLine.resize()
  1448. }
  1449. },
  1450. getTable8() {
  1451. this.row4.table.listLoading = true
  1452. GetDataByName(this.row4.table.getdataListParm).then(response => {
  1453. console.log('库存预警table数据', response.data.list)
  1454. if (response.data.list !== null) {
  1455. this.row4.table.list = response.data.list
  1456. this.row4.table.total = response.data.total
  1457. } else {
  1458. this.row4.table.list = []
  1459. }
  1460. setTimeout(() => {
  1461. this.row4.table.listLoading = false
  1462. }, 100)
  1463. })
  1464. },
  1465. // 更多
  1466. handleMore() {
  1467. this.$router.push({ path: '/inventoryManagement/Warning' })
  1468. },
  1469. // 导出
  1470. handleExport(item) {
  1471. // 计划统计
  1472. if (item == 'row3chartLine1') {
  1473. console.log(this.row3.chart1.table.list)
  1474. var excelDatasTabChart1 = [
  1475. {
  1476. tHeader: ['日期', '计划执行重量(kg)', '配方理论重量(kg)', '计划准确率', '计划取消重量(kg)', '计划准确率(去除取消重量)', '计划正确数', '计划数', '计划正确率'],
  1477. filterVal: ['日期', '实际量', '理论量', 'field1', '计划取消重量', 'field3', '正确数', '计划数', 'field2'],
  1478. tableDatas: this.row3.chart1.table.list,
  1479. sheetName: '计划统计'
  1480. }
  1481. ]
  1482. json2excel(excelDatasTabChart1, '计划统计', true, 'xlsx')
  1483. } else if (item == 'row3chartLine2') {
  1484. // 泌乳牛采食量
  1485. var excelDatasTabChart2 = [
  1486. {
  1487. tHeader: ['日期', '泌乳牛采食量(kg)', '泌乳牛产奶量(kg)'],
  1488. filterVal: ['日期', 'field1', 'field2'],
  1489. tableDatas: this.row3.chart2.table.list,
  1490. sheetName: '泌乳牛采食量'
  1491. }
  1492. ]
  1493. json2excel(excelDatasTabChart2, '泌乳牛采食量', true, 'xlsx')
  1494. }
  1495. },
  1496. handleTable(item) {
  1497. if (item == 'row3chartLine1') {
  1498. console.log('计划统计表格')
  1499. this.row3.chart1.isTable = true
  1500. this.row3.chart1.isChart = false
  1501. } else if (item == 'row3chartLine2') {
  1502. console.log('泌乳牛采食量表格')
  1503. this.row3.chart2.isTable = true
  1504. this.row3.chart2.isChart = false
  1505. }
  1506. },
  1507. handleChart(item) {
  1508. // 显示切换图表
  1509. if (item == 'row3chartLine1') {
  1510. console.log('计划统计图表')
  1511. this.row3.chart1.isTable = false
  1512. this.row3.chart1.isChart = true
  1513. } else if (item == 'row3chartLine2') {
  1514. console.log('泌乳牛采食量图表')
  1515. this.row3.chart2.isTable = false
  1516. this.row3.chart2.isChart = true
  1517. }
  1518. }
  1519. }
  1520. }
  1521. </script>
  1522. <style lang="scss" scoped>
  1523. .Title{
  1524. 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;
  1525. }
  1526. .dashboard-editor-container {
  1527. background-color: #F4F4F4;
  1528. min-height: 100vh;
  1529. .news{
  1530. width: 70%;
  1531. height: 30px;
  1532. background: #fff;
  1533. margin: 0 auto;
  1534. border-radius: 10px;
  1535. text-align: center;
  1536. line-height: 30px;
  1537. color: red;
  1538. b{color: #000;}
  1539. }
  1540. .bottom{
  1541. padding:0 30px;
  1542. h4{text-align: right;}
  1543. .grid-content{
  1544. background: #fff;height: 90px;
  1545. border-radius: 10px;
  1546. }
  1547. .one{
  1548. border: 1px solid #82CBB3;height: 90px;
  1549. .Left{
  1550. float: left;
  1551. width: 65px;
  1552. text-align: center;
  1553. i{font-size: 36px;color:#82CBB3;line-height: 90px;}
  1554. }
  1555. .Right{
  1556. float: left;
  1557. margin-top:15px;
  1558. height: 60px;
  1559. font-weight: 600;
  1560. font-size: 14px;
  1561. line-height: 30px;
  1562. span{
  1563. display: inline-block;
  1564. width: 130px;
  1565. text-align: right;
  1566. }
  1567. }
  1568. }
  1569. .two{
  1570. border: 1px solid #FF9900;
  1571. .Left{
  1572. float: left;
  1573. width: 65px;
  1574. text-align: center;
  1575. i{font-size: 36px;color:#FF9900;line-height: 90px;}
  1576. }
  1577. .Right{
  1578. float: left;
  1579. margin-top:15px;
  1580. height: 60px;
  1581. font-weight: 600;
  1582. font-size: 14px;
  1583. line-height: 30px;
  1584. span{
  1585. display: inline-block;
  1586. width: 130px;
  1587. text-align: right;
  1588. }
  1589. }
  1590. }
  1591. .three{
  1592. border: 1px solid #0099FF;
  1593. .Left{
  1594. float: left;
  1595. width: 65px;
  1596. text-align: center;
  1597. i{font-size: 36px;color:#0099FF;line-height: 90px;}
  1598. }
  1599. .Right{
  1600. float: left;
  1601. height: 60px;
  1602. font-weight: 600;
  1603. font-size: 14px;
  1604. line-height: 30px;
  1605. margin-top:15px;
  1606. span{
  1607. display: inline-block;
  1608. width: 130px;
  1609. text-align: right;
  1610. }
  1611. }
  1612. }
  1613. .four{
  1614. border: 1px solid #FF5C5C;
  1615. .Left{
  1616. float: left;
  1617. width: 55px;
  1618. text-align: center;
  1619. i{font-size: 36px;color:#FF5C5C;line-height: 90px;}
  1620. }
  1621. .Right{
  1622. float: left;
  1623. flex: 1;
  1624. height: 60px;
  1625. font-weight: 600;
  1626. font-size: 14px;
  1627. line-height: 30px;
  1628. margin-top:15px;
  1629. span{
  1630. display: inline-block;
  1631. width: 150px;
  1632. text-align: right;
  1633. }
  1634. }
  1635. }
  1636. .car{
  1637. width:100%;height:150px;
  1638. display:flex;
  1639. display: -webkit-flex;
  1640. -webkit-flex-direction:row;
  1641. i{font-size: 50px;width:50px;display: block;line-height: 150px;}
  1642. .carList{
  1643. flex:1;height: 130px;
  1644. .list{
  1645. height: 130px;color: #fff;
  1646. // box-shadow: #000 0px 0px 10px;
  1647. // border-radius: 10px;
  1648. .list-l{
  1649. p{
  1650. padding-left:10px;font-size:13px;line-height: 16px; text-overflow: ellipsis;white-space:nowrap; overflow:hidden;
  1651. }
  1652. }
  1653. .list-r{
  1654. p{
  1655. font-size:13px;line-height: 16px;text-overflow: ellipsis;white-space:nowrap; overflow:hidden;
  1656. }
  1657. }
  1658. }
  1659. }
  1660. }
  1661. }
  1662. }
  1663. </style>