index.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722
  1. <template>
  2. <div class="container">
  3. <el-row :gutter="20">
  4. <el-col :span="12">
  5. <div class="accuracy">
  6. <div class="accuracy_t">
  7. <div class="accuracy_t_l">
  8. <h4><span class="title"></span>准确性分析</h4>
  9. <el-select v-model="accuracy.value1" style="width:100px;margin-right: 5px;" class="filter-item">
  10. <el-option v-for="item in accuracy.cattleTpyeList" :key="item.value" :label="item.label"
  11. :value="item.value"> </el-option>
  12. </el-select>
  13. <el-select v-model="accuracy.value2" style="width:100px;margin-right: 5px;" class="filter-item">
  14. <el-option v-for="item in accuracy.formulaList" :key="item.value" :label="item.label"
  15. :value="item.value"> </el-option>
  16. </el-select>
  17. <el-date-picker v-model="accuracy.inputDatetime" :clearable="false" class="inputDatetime filter-item"
  18. type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
  19. style="width: 250px;" />
  20. </div>
  21. <div class="accuracy_t_r">
  22. <div class="exportTable button" @click="handleChart('accuracy')">切换图表</div>
  23. <div class="exportTable button" @click="handleExport('accuracy')">导出</div>
  24. </div>
  25. </div>
  26. <div class="accuracy_b">
  27. <el-tabs v-model="accuracy.activeName" @tab-click="handleTabClick">
  28. <el-tab-pane label="混料准确率" name="first" />
  29. <el-tab-pane label="混料正确率" name="second" />
  30. <el-tab-pane label="撒料准确率" name="third" />
  31. <el-tab-pane label="撒料正确率" name="fourth" />
  32. </el-tabs>
  33. <el-row :gutter="20">
  34. <el-col :span="6">
  35. <div class="maxdiv">
  36. <div class="title-t">最高</div>
  37. <div class="title-c">99%</div>
  38. <div class="title-b">NO.1 蒙牛3号牧场</div>
  39. </div>
  40. </el-col>
  41. <el-col :span="6">
  42. <div class="mediandiv">
  43. <div class="title-t">中位值</div>
  44. <div class="title-c">99%</div>
  45. <a class="title-b" @click="handleSeeRanking">查看排名</a>
  46. </div>
  47. </el-col>
  48. <el-col :span="6">
  49. <div class="mindiv">
  50. <div class="title-t">最低</div>
  51. <div class="title-c">99%</div>
  52. </div>
  53. </el-col>
  54. </el-row>
  55. <div v-if="accuracy.chart1.isChart">
  56. <div id="chartLine1" v-loading="accuracy.chart1.listLoading" style="height:310px;" />
  57. <a class="more" @click="handleMore">更多&gt;</a>
  58. </div>
  59. <div v-else>
  60. <el-table style="width: 100%" :max-height="320" :row-style="rowStyle" :cell-style="cellStyle" border :data="accuracy.chart1.tableDataList1">
  61. <template v-for="item in accuracy.chart1.tableTitleList1">
  62. <template>
  63. <el-table-column
  64. min-width="30"
  65. :key="item.value"
  66. :label="item.value"
  67. align="center"
  68. >
  69. <template slot-scope="scope">
  70. <span>{{ scope.row[item.name] }}</span>
  71. </template>
  72. </el-table-column>
  73. </template>
  74. </template>
  75. </el-table>
  76. </div>
  77. </div>
  78. </div>
  79. </el-col>
  80. <el-col :span="12">
  81. <div class="time">
  82. <div class="time_t">
  83. <div class="time_t_l">
  84. <h4><span class="title"></span>执行时间</h4>
  85. <el-select v-model="time.value1" style="width:100px;margin-right: 5px;" class="filter-item">
  86. <el-option v-for="item in time.cattleTpyeList" :key="item.value" :label="item.label"
  87. :value="item.value"> </el-option>
  88. </el-select>
  89. <el-select v-model="time.value2" style="width:100px;margin-right: 5px;" class="filter-item">
  90. <el-option v-for="item in time.formulaList" :key="item.value" :label="item.label"
  91. :value="item.value"> </el-option>
  92. </el-select>
  93. <el-date-picker v-model="time.inputDatetime" :clearable="false" class="inputDatetime filter-item"
  94. type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
  95. style="width: 250px;" />
  96. </div>
  97. <div class="time_t_r">
  98. <div class="exportTable button" @click="handleChart('time')">切换图表</div>
  99. <div class="exportTable button" @click="handleExport('time')">导出</div>
  100. </div>
  101. </div>
  102. <div v-if="time.chart1.isChart">
  103. <div id="chartLine2" v-loading="time.chart1.listLoading" style="height:420px;" />
  104. </div>
  105. <div v-else style="margin: 10px 10px;">
  106. <el-table :data="time.chart1.tableDataList1" border style="width: 100%;" :max-height="410" :row-style="rowStyle" :cell-style="cellStyle" class="elTable">
  107. <el-table-column label="牧场" min-width="80px" align="center" prop="title" />
  108. <el-table-column label="加料时间" min-width="80px" align="center" prop="title" />
  109. <el-table-column label="搅拌延时" min-width="80px" align="center" prop="title" />
  110. <el-table-column label="搅拌时间" min-width="80px" align="center" prop="title" />
  111. <el-table-column label="撒料时间" min-width="80px" align="center" prop="title" />
  112. </el-table>
  113. </div>
  114. </div>
  115. </el-col>
  116. </el-row>
  117. <el-row :gutter="20">
  118. <el-col :span="24">
  119. <div class="abnormal">
  120. <div class="abnormal_t">
  121. <div class="abnormal_t_l">
  122. <h4>
  123. <span class="title"></span>
  124. 异常撒料时间统计
  125. <el-tooltip class="item" effect="dark" placement="top-start">
  126. <div slot="content">
  127. 按时间段统计各牧场配方的每个班次之间<br/>
  128. 的撒料间隔时间波动,切换图表可查看各<br/>
  129. 班次撒料时间,在波动时间外的异常撒料<br/>
  130. 时间数据标红显示
  131. </div>
  132. <span class="el-icon-question"></span>
  133. </el-tooltip>
  134. </h4>
  135. <el-select v-model="abnormal.value2" style="width:100px;margin-right: 5px;" class="filter-item">
  136. <el-option v-for="item in abnormal.formulaList" :key="item.value" :label="item.label"
  137. :value="item.value"> </el-option>
  138. </el-select>
  139. <el-date-picker v-model="abnormal.inputDatetime" :clearable="false" class="inputDatetime filter-item"
  140. type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
  141. style="width: 250px;" />
  142. </div>
  143. <div class="abnormal_t_r">
  144. <div class="exportTable button" @click="handleChart('abnormal')">切换图表</div>
  145. <div class="exportTable button" @click="handleExport('abnormal')">导出</div>
  146. </div>
  147. </div>
  148. <div v-if="abnormal.chart1.isChart">
  149. <div id="chartLine3" v-loading="abnormal.chart1.listLoading" style="height:420px;" />
  150. </div>
  151. <div v-else style="margin: 10px 10px;">
  152. <el-table :data="abnormal.chart1.tableDataList1" border style="width: 100%;" :max-height="410" :row-style="rowStyle" :cell-style="cellStyle" class="elTable">
  153. <el-table-column label="牧场" min-width="130px" align="center" prop="title" />
  154. <el-table-column label="栏舍" min-width="130px" align="center" prop="title" />
  155. <el-table-column label="班次" min-width="130px" align="center" prop="title" />
  156. <el-table-column label="实际撒料时间" min-width="130px" align="center" prop="title" />
  157. </el-table>
  158. </div>
  159. </div>
  160. </el-col>
  161. </el-row>
  162. <el-dialog :title="textMap[accuracy.dialogStatus]" :visible.sync="accuracy.dialogFormVisible" :close-on-click-modal="false" width="50%">
  163. <div class="accuracy-content">
  164. <div v-if="accuracy.dialogStatus == 'more'" class="dialogmore" style="min-height: 100px;">
  165. <el-checkbox-group v-model="accuracy.more.checkedPasture">
  166. <el-checkbox border v-for="(item,index) in accuracy.more.pastureList" :label="item.id" :key="index">{{item.name}}</el-checkbox>
  167. </el-checkbox-group>
  168. </div>
  169. <div v-else class="seeRanking" style="min-height: 300px;">
  170. <el-tabs v-model="accuracy.seeRanking.activeName" @tab-click="handleSeeTabClick">
  171. <el-tab-pane label="混料准确率" name="first" />
  172. <el-tab-pane label="混料正确率" name="second" />
  173. <el-tab-pane label="撒料准确率" name="third" />
  174. <el-tab-pane label="撒料正确率" name="fourth" />
  175. </el-tabs>
  176. <div class="search">
  177. <el-input v-model="accuracy.seeRanking.name" placeholder="准确率" style="width: 180px;" class="filter-item" type="number" clearable />
  178. <span style="margin-right: 5px;">-</span>
  179. <el-input v-model="accuracy.seeRanking.name" placeholder="准确率" style="width: 180px;" class="filter-item" type="number" clearable />
  180. <el-button class="successBorder" @click="handleSearch">查询</el-button>
  181. </div>
  182. <el-table :key="accuracy.seeRanking.tableKey" v-loading="accuracy.seeRanking.listLoading" element-loading-text="给我一点时间" :data="accuracy.seeRanking.list"
  183. border fit highlight-current-row style="width: 100%;" :row-style="rowStyle" :cell-style="cellStyle"
  184. class="elTable">
  185. <el-table-column type="selection" align="center" width="50" />
  186. <el-table-column label="排名" min-width="130px" align="center" prop="id" />
  187. <el-table-column label="牧场名称" min-width="130px" align="center" prop="id" />
  188. <el-table-column label="准确率" min-width="130px" align="center" prop="id" />
  189. </el-table>
  190. </div>
  191. <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom: 40px;">
  192. <el-button v-if="accuracy.dialogStatus == 'more'" class="cancelClose cancelClose" @click="accuracy.dialogFormVisible = false; ">关闭</el-button>
  193. <el-button v-else class="cancelClose1" @click="accuracy.dialogFormVisible = false;getList(); ">关闭</el-button>
  194. <el-button class="save" :disabled="isokDisable" v-if="accuracy.dialogStatus == 'more'" @click="createData()">确认</el-button>
  195. </div>
  196. </div>
  197. </el-dialog>
  198. </div>
  199. </template>
  200. <script>
  201. import { postJson } from '@/api/common'
  202. import { mapGetters } from 'vuex'
  203. // import echarts from 'echarts'
  204. import * as echarts from 'echarts';
  205. require('echarts/theme/macarons')
  206. import Cookies from 'js-cookie'
  207. export default {
  208. name: 'Dashboard',
  209. data() {
  210. return {
  211. accuracy: {
  212. value1: '',
  213. value2: '',
  214. inputDatetime: [],
  215. cattleTpyeList: [{
  216. value: 1,
  217. label: '泌乳牛'
  218. }],
  219. formulaList: [{
  220. value: 1,
  221. label: '配方1'
  222. }],
  223. activeName: 'first',
  224. chart1: {
  225. isChart: true,
  226. listLoading: false,
  227. chartLine: null,
  228. lineData1: {
  229. month: ['12/01', '12/02', '12/03', '12/04', '12/05', '12/06', '12/07'],
  230. title: ['牧场1', '牧场2', '牧场3', '牧场4', '牧场5','牧场6', '牧场7'],
  231. dataArr: [
  232. [111, 132, 101, 134, 90, 230, 111],
  233. [222, 132, 101, 134, 90, 230, 222],
  234. [333, 132, 101, 134, 90, 230, 333],
  235. [444, 222, 101, 134, 90, 230, 444],
  236. [555, 132, 101, 134, 90, 230, 555],
  237. [111, 132, 101, 134, 90, 230, 111],
  238. [222, 132, 101, 134, 90, 230, 222],
  239. ]
  240. },
  241. tableTitleList1: [
  242. {name:"title",value:"牧场"},
  243. {name:"date1",value:"12/01"},
  244. {name:"date2",value:"12/02"},
  245. {name:"date3",value:"12/03"},
  246. {name:"date4",value:"12/04"},
  247. {name:"date5",value:"12/05"},
  248. {name:"date6",value:"12/06"},
  249. ],
  250. tableDataList1: [
  251. {"title":"牧场1","date1":201,"date2":0,"date3":"12","date4":"12","date5":"12","date6":"1"},
  252. {"title":"牧场2","date1":201,"date2":0,"date3":"12","date4":"12","date5":"12","date6":"12"},
  253. {"title":"牧场3","date1":201,"date2":0,"date3":"12","date4":"12","date5":"12","date6":"12"},
  254. {"title":"牧场3","date1":201,"date2":0,"date3":"12","date4":"12","date5":"12","date6":"12"},
  255. {"title":"牧场3","date1":201,"date2":0,"date3":"12","date4":"12","date5":"12","date6":"12"},
  256. {"title":"牧场3","date1":201,"date2":0,"date3":"12","date4":"12","date5":"12","date6":"12"},
  257. {"title":"牧场3","date1":201,"date2":0,"date3":"12","date4":"12","date5":"12","date6":"12"},
  258. ],
  259. },
  260. dialogStatus: '',
  261. dialogFormVisible: false,
  262. more:{
  263. checkedPasture:[],
  264. pastureList:[{id:1,name:'牧场1'},{id:2,name:'牧场2'}],
  265. },
  266. seeRanking:{
  267. activeName:'first',
  268. tableKey:0,
  269. listLoading:false,
  270. list:[]
  271. },
  272. },
  273. time: {
  274. value1: '',
  275. value2: '',
  276. inputDatetime: [],
  277. cattleTpyeList: [{
  278. value: 1,
  279. label: '泌乳牛'
  280. }],
  281. formulaList: [{
  282. value: 1,
  283. label: '配方1'
  284. }],
  285. chart1: {
  286. isChart: true,
  287. listLoading: false,
  288. chartLine: null,
  289. lineData1: {
  290. title:['牧场1', '牧场2', '牧场3', '牧场4', '牧场5'],
  291. arr1: [[98,156,3,123.6,146.03],[36,34,1,11,109],[160,109.3,6.6,184.1,79],[139,179.3,125.7,153.27,44],[19,82.4,55.5,132,35],[123.0,164,163,97,92],[37,37,1,110,58]],
  292. arr2: [[28,156,3,123.6,146.03],[36,34,1,11,109],[160,109.3,6.6,184.1,79],[139,179.3,125.7,153.27,44],[19,82.4,55.5,132,35],[123.0,164,163,97,92],[37,37,1,110,58]],
  293. arr3: [[28,156,3,123.6,146.03],[36,34,1,11,109],[160,109.3,6.6,184.1,79],[139,179.3,125.7,153.27,44],[19,82.4,55.5,132,35],[123.0,164,163,97,92],[37,37,1,110,58]],
  294. },
  295. tableDataList1: [
  296. {"title":"牧场1","date1":201,"date2":0,"date3":"12","date4":"12","date5":"12","date6":"1"},
  297. {"title":"牧场2","date1":201,"date2":0,"date3":"12","date4":"12","date5":"12","date6":"12"},
  298. {"title":"牧场3","date1":201,"date2":0,"date3":"12","date4":"12","date5":"12","date6":"12"},
  299. {"title":"牧场3","date1":201,"date2":0,"date3":"12","date4":"12","date5":"12","date6":"12"},
  300. {"title":"牧场3","date1":201,"date2":0,"date3":"12","date4":"12","date5":"12","date6":"12"},
  301. {"title":"牧场3","date1":201,"date2":0,"date3":"12","date4":"12","date5":"12","date6":"12"},
  302. {"title":"牧场3","date1":201,"date2":0,"date3":"12","date4":"12","date5":"12","date6":"12"},
  303. ],
  304. },
  305. },
  306. abnormal: {
  307. value1: '',
  308. value2: '',
  309. inputDatetime: [],
  310. cattleTpyeList: [{
  311. value: 1,
  312. label: '泌乳牛'
  313. }],
  314. formulaList: [{
  315. value: 1,
  316. label: '配方1'
  317. }],
  318. chart1: {
  319. isChart: true,
  320. listLoading: false,
  321. chartLine: null,
  322. lineData1: {
  323. title:['牧场1', '牧场2', '牧场3', '牧场4', '牧场5'],
  324. arr1: [120, 132, 101, 134, 90, 230, 210],
  325. arr2: [220, 132, 101, 134, 90, 230, 210],
  326. arr3: [220, 132, 101, 134, 90, 230, 210]
  327. },
  328. tableDataList1: [
  329. {"title":"牧场1","date1":201,"date2":0,"date3":"12","date4":"12","date5":"12","date6":"1"},
  330. {"title":"牧场2","date1":201,"date2":0,"date3":"12","date4":"12","date5":"12","date6":"12"},
  331. {"title":"牧场3","date1":201,"date2":0,"date3":"12","date4":"12","date5":"12","date6":"12"},
  332. {"title":"牧场3","date1":201,"date2":0,"date3":"12","date4":"12","date5":"12","date6":"12"},
  333. {"title":"牧场3","date1":201,"date2":0,"date3":"12","date4":"12","date5":"12","date6":"12"},
  334. {"title":"牧场3","date1":201,"date2":0,"date3":"12","date4":"12","date5":"12","date6":"12"},
  335. {"title":"牧场3","date1":201,"date2":0,"date3":"12","date4":"12","date5":"12","date6":"12"},
  336. ],
  337. },
  338. },
  339. textMap: {
  340. seeRanking: '查看排名',
  341. more:'更多'
  342. },
  343. isokDisable:false,
  344. rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
  345. cellStyle: { padding: 0 + 'px' },
  346. }
  347. },
  348. created() {
  349. },
  350. mounted() {
  351. if(this.accuracy.chart1.isChart){
  352. this.roadChartLine1(this.accuracy.chart1.lineData1)
  353. }
  354. if(this.time.chart1.isChart){
  355. this.roadChartLine2(this.time.chart1.lineData1)
  356. }
  357. if(this.abnormal.chart1.isChart){
  358. this.roadChartLine3(this.abnormal.chart1.lineData1)
  359. }
  360. },
  361. methods: {
  362. handleTabClick(tab, event) {
  363. console.log(tab, event);
  364. this.accuracy.chart1.isChart = true
  365. this.roadChartLine1(this.accuracy.chart1.lineData1)
  366. },
  367. handleChart(item){
  368. if(item == 'accuracy'){
  369. this.accuracy.chart1.isChart = !this.accuracy.chart1.isChart
  370. this.$nextTick(() => {
  371. if(this.accuracy.chart1.isChart){
  372. this.roadChartLine1(this.accuracy.chart1.lineData1)
  373. }
  374. });
  375. }else if(item == 'time'){
  376. this.time.chart1.isChart = !this.time.chart1.isChart
  377. this.$nextTick(() => {
  378. if(this.time.chart1.isChart){
  379. this.roadChartLine2(this.time.chart1.lineData1)
  380. }
  381. });
  382. }else{
  383. this.abnormal.chart1.isChart = !this.abnormal.chart1.isChart
  384. this.$nextTick(() => {
  385. if(this.abnormal.chart1.isChart){
  386. this.roadChartLine3(this.abnormal.chart1.lineData1)
  387. }
  388. });
  389. }
  390. },
  391. handleExport(){},
  392. handleSeeRanking(){
  393. this.accuracy.dialogStatus = 'seeRanking'
  394. this.accuracy.dialogFormVisible = true
  395. this.getSeeRankingList()
  396. },
  397. getSeeRankingList(){
  398. let page = 1
  399. let page_size = 100
  400. let url = 'api/v1/ops/pasture/list' + '?page=' + page + '&page_size=' + page_size
  401. let data = {}
  402. postJson(url, data).then(response => {
  403. if (response.code == 200) {
  404. // this.accuracy.seeRanking.list = response.data.list
  405. } else {
  406. // this.accuracy.seeRanking.list = []
  407. }
  408. })
  409. },
  410. handleSeeTabClick(tab, event){
  411. console.log(tab, event);
  412. },
  413. handleSearch(){},
  414. handleMore(){
  415. this.accuracy.dialogStatus = 'more'
  416. this.getPastureList()
  417. },
  418. getPastureList(){
  419. let page = 1
  420. let page_size = 100
  421. let url = 'api/v1/ops/pasture/list' + '?page=' + page + '&page_size=' + page_size
  422. let data = {}
  423. postJson(url, data).then(response => {
  424. if (response.code == 200) {
  425. // this.accuracy.more.pastureList = response.data.list
  426. } else {
  427. // this.accuracy.more.pastureList = []
  428. }
  429. this.accuracy.dialogFormVisible = true
  430. })
  431. },
  432. roadChartLine1(chartLine_data) {
  433. if (this.accuracy.chart1.chartLine != null) {
  434. this.accuracy.chart1.chartLine.dispose()
  435. }
  436. this.accuracy.chart1.chartLine = echarts.init(document.getElementById('chartLine1'))
  437. var option = {
  438. animation: false,
  439. tooltip: { trigger: 'axis' },
  440. legend: { data: chartLine_data.title, left: 14, bottom: 0, },
  441. grid: { left: '3%',right: '14%',top: '3%',containLabel: true},
  442. xAxis: [
  443. {
  444. type: 'category',
  445. boundaryGap: false,
  446. data: chartLine_data.month,
  447. axisLabel: { showMinLabel:true, showMaxLabel:true, },
  448. axisLine: { lineStyle: { color: '#666' } },
  449. }
  450. ],
  451. yAxis: [ { type: 'value', axisLine: {lineStyle: {color: '#666'}}, } ],
  452. color:['#4b07fa', '#0f96fc', '#ff42a9', '#ff724c', '#05fbf0', '#ffae00', '#b705fa', '#9a60b4', '#3cff00'],
  453. series: function (e) {
  454. var serie = [];
  455. for (var i = 0; i < chartLine_data.title.length; i++) {
  456. var item = {
  457. name: chartLine_data.title[i],
  458. data: chartLine_data.dataArr[i],
  459. type: 'line',
  460. smooth:true,
  461. itemStyle: { borderColor: '#fff', borderWidth: 2 },
  462. label: {
  463. // normal: { show: true },
  464. },
  465. }
  466. serie.push(item);
  467. }
  468. console.log(serie)
  469. return serie;
  470. }()
  471. };
  472. this.accuracy.chart1.chartLine.setOption(option)
  473. if (this.accuracy.chart1.chartLine !== null) {
  474. window.onresize = function() {
  475. this.accuracy.chart1.chartLine.resize()
  476. }
  477. }
  478. },
  479. roadChartLine2(chartLine_data) {
  480. if (this.time.chart1.chartLine != null) {
  481. this.time.chart1.chartLine.dispose()
  482. }
  483. this.time.chart1.chartLine = echarts.init(document.getElementById('chartLine2'))
  484. var option = {
  485. dataset: [
  486. { source: chartLine_data.arr1 },
  487. { source: chartLine_data.arr2},
  488. { source: chartLine_data.arr3 },
  489. {
  490. fromDatasetIndex: 0,
  491. transform: { type: 'boxplot' }
  492. },
  493. {
  494. fromDatasetIndex: 1,
  495. transform: { type: 'boxplot' }
  496. },
  497. {
  498. fromDatasetIndex: 2,
  499. transform: { type: 'boxplot' }
  500. }
  501. ],
  502. legend: { top: '10%' },
  503. tooltip: {
  504. trigger: 'item',
  505. axisPointer: { type: 'shadow' }
  506. },
  507. grid: {left: '10%', top: '20%', right: '10%', bottom: '15%' },
  508. xAxis: {
  509. type: 'category',
  510. boundaryGap: true,
  511. nameGap: 30,
  512. splitArea: { show: false },
  513. splitLine: { show: false }
  514. },
  515. yAxis: { type: 'value', name: '分钟', min: 0, max: 600, splitArea: { show: false } },
  516. series: [
  517. { name: '加料时间', type: 'boxplot', datasetIndex: 3 },
  518. { name: '搅拌延时', type: 'boxplot', datasetIndex: 4 },
  519. { name: '撒料时间', type: 'boxplot', datasetIndex: 5 }
  520. ]
  521. };
  522. this.time.chart1.chartLine.setOption(option)
  523. if (this.time.chart1.chartLine !== null) {
  524. window.onresize = function() {
  525. this.time.chart1.chartLine.resize()
  526. }
  527. }
  528. },
  529. roadChartLine3(chartLine_data) {
  530. if (this.abnormal.chart1.chartLine != null) {
  531. this.abnormal.chart1.chartLine.dispose()
  532. }
  533. this.abnormal.chart1.chartLine = echarts.init(document.getElementById('chartLine3'))
  534. var option = {
  535. animation: false,
  536. tooltip: { trigger: 'axis' },
  537. legend: { data: ['第一班','第二班','第三班'], right: 14, top: 0, },
  538. grid: {top: '20%',left: '3%',right: '14%',bottom: '13%',containLabel: true},
  539. xAxis: [
  540. { type: 'category', data: chartLine_data.title, }
  541. ],
  542. yAxis: [
  543. {
  544. type: 'value',
  545. axisLine: {lineStyle: {color: '#666'}},
  546. }
  547. ],
  548. series: [
  549. { name: '第一班', type: 'bar', data:chartLine_data.arr1 },
  550. { name: '第二班', type: 'bar', data:chartLine_data.arr2 },
  551. { name: '第三班', type: 'bar', data:chartLine_data.arr3 },
  552. ]
  553. };
  554. this.abnormal.chart1.chartLine.setOption(option)
  555. if (this.abnormal.chart1.chartLine !== null) {
  556. window.onresize = function() {
  557. this.abnormal.chart1.chartLine.resize()
  558. }
  559. }
  560. },
  561. }
  562. }
  563. </script>
  564. <style lang="scss" scoped>
  565. .container {
  566. margin: 10px 10px;
  567. }
  568. .accuracy,
  569. .time, .abnormal {
  570. background: #fff;
  571. height: 550px;
  572. border-radius: 5px;
  573. border: 2px solid #ededed;
  574. }
  575. .accuracy_t {
  576. margin-left: 10px;
  577. position: relative;
  578. .accuracy_t_l {
  579. h3 {
  580. line-height: 15px;
  581. }
  582. .title {
  583. width: 3px;
  584. height: 15px;
  585. background: red;
  586. display: inline-block;
  587. margin-right: 10px;
  588. }
  589. }
  590. .accuracy_t_r {
  591. position: absolute;
  592. top: 0;
  593. right: 0;
  594. .button {
  595. display: inline-block;
  596. margin-right: 10px;
  597. }
  598. }
  599. }
  600. .accuracy_b {
  601. margin: 0 10px;
  602. /deep/ .el-tabs__item {
  603. font-size: 12px
  604. }
  605. position: relative;
  606. }
  607. .more{
  608. position: absolute;
  609. bottom: -14px;right: -8px;color: blue;font-size: 12px;
  610. }
  611. .maxdiv,
  612. .mediandiv,
  613. .mindiv {
  614. text-align: center;
  615. .title-t {
  616. font-size: 12px;
  617. }
  618. .title-c {
  619. font-size: 14px;
  620. font-weight: bold;
  621. }
  622. .title-b {
  623. font-size: 14px;
  624. color: red;
  625. font-weight: bold;
  626. }
  627. }
  628. .maxdiv, .mediandiv {
  629. border-right: 2px solid #eee;
  630. }
  631. .mediandiv {
  632. .title-b {
  633. color: blue;
  634. }
  635. }
  636. .accuracy-content{
  637. /deep/ .el-checkbox{margin: 5px 5px;}
  638. /deep/ .is-bordered{margin-left: 5px;}
  639. }
  640. .time{
  641. .time_t {
  642. margin-left: 10px;
  643. position: relative;
  644. .time_t_l {
  645. h3 {
  646. line-height: 15px;
  647. }
  648. .title {
  649. width: 3px;
  650. height: 15px;
  651. background: red;
  652. display: inline-block;
  653. margin-right: 10px;
  654. }
  655. }
  656. .time_t_r {
  657. position: absolute;
  658. top: 0;
  659. right: 0;
  660. .button {
  661. display: inline-block;
  662. margin-right: 10px;
  663. }
  664. }
  665. }
  666. }
  667. .abnormal {
  668. background: #fff;
  669. margin-top: 10px;
  670. .abnormal_t {
  671. margin-left: 10px;
  672. position: relative;
  673. .abnormal_t_l {
  674. h3 {
  675. line-height: 15px;
  676. }
  677. .title {
  678. width: 3px;
  679. height: 15px;
  680. background: red;
  681. display: inline-block;
  682. margin-right: 10px;
  683. }
  684. }
  685. .abnormal_t_r {
  686. position: absolute;
  687. top: 0;
  688. right: 0;
  689. .button {
  690. display: inline-block;
  691. margin-right: 10px;
  692. }
  693. }
  694. }
  695. }
  696. .container{background: #fff;}
  697. </style>