You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1844 line
58 KiB

  1. <template>
  2. <div class="box-center">
  3. <div class="titlebox1" v-if="orgType != 3">
  4. <div style="
  5. background: #ffffff;
  6. padding-left: 18px;
  7. display: flex;
  8. padding-top: 18px;
  9. ">
  10. <el-select v-model="houseTypes" @change="sysChange" style="width: 100px; margin-right: 10px" placeholder="请选择">
  11. <el-option v-for="item in options2" :key="item.value" :label="item.label" :value="item.value">
  12. </el-option>
  13. </el-select>
  14. <!-- <span class="demonstration">项目名称:</span> -->
  15. <el-select v-model="selValue" @change="selChange" style="width: 100px" placeholder="请选择">
  16. <el-option label="代理商" v-if="orgType == 0" value="0"></el-option>
  17. <el-option label="公司" v-if="orgType != 2" value="1"></el-option>
  18. <el-option label="项目" value="2"></el-option>
  19. </el-select>
  20. <!-- <div style="width: 200px">
  21. <el-select
  22. v-model="houseId"
  23. filterable
  24. placeholder="请选择"
  25. @change="change"
  26. >
  27. <el-option
  28. v-for="item in houseList"
  29. :key="item.id"
  30. :label="item.propertyName"
  31. :value="item.id"
  32. >
  33. </el-option>
  34. </el-select>
  35. </div> -->
  36. <div style="margin-left: 26px" v-if="selValue == 1">
  37. <el-select v-model="houseId" filterable placeholder="默认为全部" @change="change">
  38. <el-option v-for="item in houseList" :key="item.orgCode" :label="item.name" :value="item.orgCode">
  39. </el-option>
  40. </el-select>
  41. </div>
  42. <!-- 项目 -->
  43. <div style="margin-left: 26px" v-else-if="selValue == 2">
  44. <el-select v-model="houseId" filterable placeholder="默认为全部" @change="change">
  45. <el-option v-for="item in houseList" :key="item.id" :label="item.propertyName" :value="item.id">
  46. </el-option>
  47. </el-select>
  48. </div>
  49. <div style="margin-left: 26px" v-else>
  50. <el-select v-model="houseId" filterable placeholder="默认为全部" @change="change">
  51. <el-option v-for="item in houseList" :key="item.id" :label="item.agentName" :value="item.id">
  52. </el-option>
  53. </el-select>
  54. </div>
  55. <div style="margin-left: auto; margin-right: 10px" v-if="equ_ed_download">
  56. <el-button @click="downLoad" icon="el-icon-download">导出</el-button>
  57. </div>
  58. </div>
  59. <div style="
  60. background: #ffffff;
  61. padding-left: 18px;
  62. display: flex;
  63. padding-top: 18px;
  64. padding-right: 18px;
  65. ">
  66. <span style="min-width: 80px" class="demonstration">使用时间:</span>
  67. <div style="margin-left:15px">
  68. <!-- <div :class="{ tophove: timeType == 4 }" @click="tabtimetap(4)">
  69. 近7天
  70. </div>
  71. <div :class="{ tophove: timeType == 5 }" @click="tabtimetap(5)">
  72. 近15天
  73. </div>
  74. <div :class="{ tophove: timeType == 6 }" @click="tabtimetap(6)">
  75. 近30天
  76. </div> -->
  77. <el-button
  78. :class="{ 'el-button--primary': timeType == 4 }"
  79. @click="tabtimetap(4)"
  80. >近7天</el-button
  81. >
  82. <el-button
  83. :class="{ 'el-button--primary': timeType == 5 }"
  84. @click="tabtimetap(5)"
  85. >近15天</el-button
  86. >
  87. <el-button
  88. style="margin-right:15px"
  89. :class="{ 'el-button--primary': timeType == 6 }"
  90. @click="tabtimetap(6)"
  91. >近30天</el-button
  92. >
  93. </div>
  94. <el-date-picker @change="confirmtime" v-model="customtime" type="daterange" range-separator="-"
  95. :default-time="['00:00:00', '23:59:59']" value-format="yyyy-MM-dd" start-placeholder="开始日期"
  96. end-placeholder="结束日期" :picker-options="pickerOptions">
  97. </el-date-picker>
  98. <div style="margin-left: 10px; margin-top: 8px">
  99. <el-checkbox v-model="checked" @change="radioChange">对比时间段</el-checkbox>
  100. </div>
  101. <div v-if="checked" style="
  102. margin-left: 20px;
  103. border: 1px solid #dcdfe6;
  104. min-width: 220px;
  105. height: 32px;
  106. border-radius: 4px;
  107. max-width: 360px;
  108. font-size: 13px;
  109. line-height: 32px;
  110. text-indent: 8px;
  111. cursor: pointer;
  112. " @click="show">
  113. <div style="display: flex">
  114. <div style="min-width: 60px">
  115. {{ selectTime1 ? "时段二: " : "请选择: " }}
  116. </div>
  117. <div v-if="selectTime1" style="display: flex">
  118. <!-- {{ selectTime+ "-" + selectTime1}} -->
  119. <div style="min-width: 120px; text-align: center">
  120. {{ selectTime }}
  121. </div>
  122. <span>-</span>
  123. <div style="min-width: 120px; text-align: center; margin-right: 32px">
  124. {{ selectTime1 }}
  125. </div>
  126. </div>
  127. </div>
  128. <el-date-picker style="opacity: 0" v-model="time" @change="timeChange" ref="time" :validate-event="false"
  129. type="date" placeholder="选择日期" format="yyyy - MM - dd " value-format="yyyy-MM-dd"
  130. :picker-options="pickerOptions">
  131. </el-date-picker>
  132. </div>
  133. </div>
  134. </div>
  135. <div class="titlebox" :style="{ 'marginTop': orgType != 3 ? '120px' : '0px' }">
  136. <div class="kapiannox">
  137. <div class="alllistbox tabcard">
  138. <el-card shadow="hover" :class="compareFlag == 0 ? 'tophovese' : 'noactive'">
  139. <div @click="compareChange(0, '设备总数')">
  140. <div class="text1">
  141. 设备总数
  142. </div>
  143. <div class="text2">
  144. {{ details.equipmentQuantity || 0 }}
  145. </div>
  146. <div class="text3" v-if="selectTime1">
  147. <span>环比 {{ details1.equipmentQuantity || 0 }}</span>
  148. <span class="textUp" v-if="compare.equipmentQuantity > 0">
  149. +{{ compare.equipmentQuantity || 0 }}
  150. <i class="up"></i>
  151. </span>
  152. <span class="textDown" v-if="compare.equipmentQuantity < 0">
  153. {{ compare.equipmentQuantity || 0 }}
  154. <i class="down"></i>
  155. </span>
  156. </div>
  157. </div>
  158. </el-card>
  159. <el-card shadow="hover" :class="compareFlag == 1 ? 'tophovese' : 'noactive'">
  160. <div @click="compareChange(1, '在线设备数')">
  161. <div class="text1">
  162. 在线设备数
  163. <el-tooltip effect="light" content="筛选时间内,联网的设备;" placement="bottom-end">
  164. <i class="pop"></i>
  165. </el-tooltip>
  166. </div>
  167. <div class="text2">
  168. {{ details.onlineQuantity || 0 }}
  169. </div>
  170. <div class="text3" v-if="selectTime1">
  171. <span>环比 {{ details1.onlineQuantity || 0 }}</span>
  172. <span class="textUp" v-if="compare.onlineQuantity > 0">
  173. +{{ compare.onlineQuantity || 0 }}
  174. <i class="up"></i>
  175. </span>
  176. <span class="textDown" v-if="compare.onlineQuantity < 0">
  177. {{ compare.onlineQuantity || 0 }}
  178. <i class="down"></i>
  179. </span>
  180. </div>
  181. </div>
  182. </el-card>
  183. <el-card shadow="hover" :class="compareFlag == 2 ? 'tophovese' : 'noactive'">
  184. <div @click="compareChange(2, '在线设备平均占比')">
  185. <div class="text1">
  186. 在线设备占比
  187. </div>
  188. <div class="text2">
  189. {{ details.onlineRate || 0 }}
  190. </div>
  191. <div class="text3" v-if="selectTime1">
  192. <span>环比 {{ details1.onlineRate || 0 }}</span>
  193. <span class="textUp" v-if="compare.onlineRate > 0">
  194. +{{ compare.onlineRate || 0 }}
  195. <i class="up"></i>
  196. </span>
  197. <span class="textDown" v-if="compare.onlineRate < 0">
  198. {{ compare.onlineRate || 0 }}
  199. <i class="down"></i>
  200. </span>
  201. </div>
  202. </div>
  203. </el-card>
  204. <el-card shadow="hover" :class="compareFlag == 3 ? 'tophovese' : 'noactive'">
  205. <div @click="compareChange(3, '活跃设备数')">
  206. <div class="text1">
  207. 活跃设备数
  208. <el-tooltip effect="light" content="筛选时间内,有接待并上传录音的设备;" placement="bottom-end">
  209. <i class="pop"></i>
  210. </el-tooltip>
  211. </div>
  212. <div class="text2">
  213. {{ details.activeQuantity || 0 }}
  214. </div>
  215. <div class="text3" v-if="selectTime1">
  216. <span>环比 {{ details1.activeQuantity || 0 }}</span>
  217. <span class="textUp" v-if="compare.activeQuantity > 0">
  218. +{{ compare.activeQuantity || 0 }}
  219. <i class="up"></i>
  220. </span>
  221. <span class="textDown" v-if="compare.activeQuantity < 0">
  222. {{ compare.activeQuantity || 0 }}
  223. <i class="down"></i>
  224. </span>
  225. </div>
  226. </div>
  227. </el-card>
  228. <el-card shadow="hover" :class="compareFlag == 4 ? 'tophovese' : 'noactive'">
  229. <div @click="compareChange(4, '活跃设备平均占比')">
  230. <div class="text1">
  231. 活跃设备占比
  232. </div>
  233. <div class="text2">
  234. {{ details.activeRate || 0 }}
  235. </div>
  236. <div class="text3" v-if="selectTime1">
  237. <span>环比 {{ details1.activeRate || 0 }}</span>
  238. <span class="textUp" v-if="compare.activeRate > 0">
  239. +{{ compare.activeRate || 0 }}
  240. <i class="up"></i>
  241. </span>
  242. <span class="textDown" v-if="compare.activeRate < 0">
  243. {{ compare.activeRate || 0 }}
  244. <i class="down"></i>
  245. </span>
  246. </div>
  247. </div>
  248. </el-card>
  249. <el-card shadow="hover" :class="compareFlag == 5 ? 'tophovese' : 'noactive'">
  250. <div @click="compareChange(5, '指派次数')">
  251. <div class="text1">
  252. 指派次数
  253. <el-tooltip effect="light" content="筛选时间内,指派给设备的接待数,不包含接待中;" placement="bottom-end">
  254. <i class="pop"></i>
  255. </el-tooltip>
  256. </div>
  257. <div class="text2">
  258. {{ details.assignQuantity || 0 }}
  259. </div>
  260. <div class="text3" v-if="selectTime1">
  261. <span>环比 {{ details1.assignQuantity || 0 }}</span>
  262. <span class="textUp" v-if="compare.assignQuantity > 0">
  263. +{{ compare.assignQuantity || 0 }}
  264. <i class="up"></i>
  265. </span>
  266. <span class="textDown" v-if="compare.assignQuantity < 0">
  267. {{ compare.assignQuantity || 0 }}
  268. <i class="down"></i>
  269. </span>
  270. </div>
  271. </div>
  272. </el-card>
  273. <el-card shadow="hover" :class="compareFlag == 6 ? 'tophovese' : 'noactive'">
  274. <div @click="compareChange(6, '完整录音次数')">
  275. <div class="text1">
  276. 完整录音次数
  277. <el-tooltip effect="light" content="筛选时间内,接待中录音正常开启(指派时间与录音开启时间相差小于5分钟)和录音正常关闭(结束录音时间晚于结束接待时间)的接待数;"
  278. placement="bottom-end">
  279. <i class="pop"></i>
  280. </el-tooltip>
  281. </div>
  282. <div class="text2">
  283. {{ details.normalRecordQuantity || 0 }}
  284. </div>
  285. <div class="text3" v-if="selectTime1">
  286. <span>环比 {{ details1.normalRecordQuantity || 0 }}</span>
  287. <span class="textUp" v-if="compare.normalRecordQuantity > 0">
  288. +{{ compare.normalRecordQuantity || 0 }}
  289. <i class="up"></i>
  290. </span>
  291. <span class="textDown" v-if="compare.normalRecordQuantity < 0">
  292. {{ compare.normalRecordQuantity || 0 }}
  293. <i class="down"></i>
  294. </span>
  295. </div>
  296. </div>
  297. </el-card>
  298. <el-card shadow="hover" :class="compareFlag == 7 ? 'tophovese' : 'noactive'">
  299. <div @click="compareChange(7, '完整录音占比')">
  300. <div class="text1">完整录音占比
  301. <el-tooltip effect="light" content="筛选时间内,完整录音次数/指派次数*100%;" placement="bottom-end">
  302. <i class="pop"></i>
  303. </el-tooltip>
  304. </div>
  305. <div class="text2">
  306. {{ details.fullRecordRate || 0 }}
  307. </div>
  308. <div class="text3" v-if="selectTime1">
  309. <span>环比 {{ details1.fullRecordRate || 0 }}</span>
  310. <span class="textUp" v-if="compare.fullRecordRate > 0">
  311. +{{ compare.fullRecordRate || 0 }}
  312. <i class="up"></i>
  313. </span>
  314. <span class="textDown" v-if="compare.fullRecordRate < 0">
  315. {{ compare.fullRecordRate || 0 }}
  316. <i class="down"></i>
  317. </span>
  318. </div>
  319. </div>
  320. </el-card>
  321. <el-card shadow="hover" :class="compareFlag == 8 ? 'tophovese' : 'noactive'">
  322. <div @click="compareChange(8, '部分录音')">
  323. <div class="text1">部分录音次数
  324. <el-tooltip effect="light" content="筛选时间内,接待中录音未及时开启(指派时间与录音开启时间相差大于于5分钟)或录音提前关闭(未结束,就关闭了录音)的接待数;"
  325. placement="bottom-end">
  326. <i class="pop"></i>
  327. </el-tooltip>
  328. </div>
  329. <div class="text2">
  330. {{ details.snippetRecordQuantity || 0 }}
  331. </div>
  332. <div class="text3" v-if="selectTime1">
  333. <span>环比 {{ details1.snippetRecordQuantity || 0 }}</span>
  334. <span class="textUp" v-if="compare.snippetRecordQuantity > 0">
  335. +{{ compare.snippetRecordQuantity || 0 }}
  336. <i class="up"></i>
  337. </span>
  338. <span class="textDown" v-if="compare.snippetRecordQuantity < 0">
  339. {{ compare.snippetRecordQuantity || 0 }}
  340. <i class="down"></i>
  341. </span>
  342. </div>
  343. </div>
  344. </el-card>
  345. <el-card shadow="hover" :class="compareFlag == 9 ? 'tophovese' : 'noactive'">
  346. <div @click="compareChange(9, '未录音')">
  347. <div class="text1">未录音次数
  348. <el-tooltip effect="light" content="筛选时间内,指派的接待,没有录音的接待;" placement="bottom-end">
  349. <i class="pop"></i>
  350. </el-tooltip>
  351. </div>
  352. <div class="text2">
  353. {{ details.noRecordQuantity || 0 }}
  354. </div>
  355. <div class="text3" v-if="selectTime1">
  356. <span>环比 {{ details1.noRecordQuantity || 0 }}</span>
  357. <span class="textUp" v-if="compare.noRecordQuantity > 0">
  358. +{{ compare.noRecordQuantity || 0 }}
  359. <i class="up"></i>
  360. </span>
  361. <span class="textDown" v-if="compare.noRecordQuantity < 0">
  362. {{ compare.noRecordQuantity || 0 }}
  363. <i class="down"></i>
  364. </span>
  365. </div>
  366. </div>
  367. </el-card>
  368. <el-card shadow="hover" :class="compareFlag == 10 ? 'tophovese' : 'noactive'">
  369. <div @click="compareChange(10, '正常关机次数')">
  370. <div class="text1">正常关机次数
  371. <el-tooltip effect="light" content="筛选时间内,手动关机的次数;" placement="bottom-end">
  372. <i class="pop"></i>
  373. </el-tooltip>
  374. </div>
  375. <div class="text2">
  376. {{ details.normalShutdownQuantity || 0 }}
  377. </div>
  378. <div class="text3" v-if="selectTime1">
  379. <span>环比 {{ details1.normalShutdownQuantity || 0 }}</span>
  380. <span class="textUp" v-if="compare.normalShutdownQuantity > 0">
  381. +{{ compare.normalShutdownQuantity || 0 }}
  382. <i class="up"></i>
  383. </span>
  384. <span class="textDown" v-if="compare.normalShutdownQuantity < 0">
  385. {{ compare.normalShutdownQuantity || 0 }}
  386. <i class="down"></i>
  387. </span>
  388. </div>
  389. </div>
  390. </el-card>
  391. <el-card shadow="hover" :class="compareFlag == 11 ? 'tophovese' : 'noactive'">
  392. <div @click="compareChange(11, '低电关机次数')">
  393. <div class="text1">低电关机次数
  394. <el-tooltip effect="light" content="筛选时间内,由于电量用完关机的次数;" placement="bottom-end">
  395. <i class="pop"></i>
  396. </el-tooltip>
  397. </div>
  398. <div class="text2">
  399. {{ details.lowElectricityQuantity || 0 }}
  400. </div>
  401. <div class="text3" v-if="selectTime1">
  402. <span>环比 {{ details1.lowElectricityQuantity || 0 }}</span>
  403. <span class="textUp" v-if="compare.lowElectricityQuantity > 0">
  404. +{{ compare.lowElectricityQuantity || 0 }}
  405. <i class="up"></i>
  406. </span>
  407. <span class="textDown" v-if="compare.lowElectricityQuantity < 0">
  408. {{ compare.lowElectricityQuantity || 0 }}
  409. <i class="down"></i>
  410. </span>
  411. </div>
  412. </div>
  413. </el-card>
  414. <el-card shadow="hover" :class="compareFlag == 12 ? 'tophovese' : 'noactive'">
  415. <div @click="compareChange(12, '异常关机次数')">
  416. <div class="text1">异常关机次数
  417. </div>
  418. <div class="text2">
  419. {{ details.abnormalShutdownQuantity || 0 }}
  420. </div>
  421. <div class="text3" v-if="selectTime1">
  422. <span>环比 {{ details1.abnormalShutdownQuantity || 0 }}</span>
  423. <span class="textUp" v-if="compare.abnormalShutdownQuantity > 0">
  424. +{{ compare.abnormalShutdownQuantity || 0 }}
  425. <i class="up"></i>
  426. </span>
  427. <span class="textDown" v-if="compare.abnormalShutdownQuantity < 0">
  428. {{ compare.abnormalShutdownQuantity || 0 }}
  429. <i class="down"></i>
  430. </span>
  431. </div>
  432. </div>
  433. </el-card>
  434. </div>
  435. </div>
  436. </div>
  437. <!-- v-if="selectTime1" -->
  438. <div style="margin-top: 15px">
  439. <div class="zgutteruo">
  440. <div class="zgutteruo-tit">对比</div>
  441. <div id="compare" style="width: 100%; height: 360px"></div>
  442. </div>
  443. </div>
  444. <div style="margin-top: 15px" v-if="!selectTime1">
  445. <el-row :gutter="40">
  446. <el-col :span="12">
  447. <div class="zgutteruo">
  448. <div class="zgutteruo-tit">录音结果占比</div>
  449. <img v-if="odata1" style="width: 260px; height: 260px;margin: 50px auto;display: block;"
  450. src="/img/Elementcircle.png" alt="" />
  451. <div v-else id="mane" style="width: 100%; height: 360px;"></div>
  452. </div>
  453. </el-col>
  454. <el-col :span="12">
  455. <div class="zgutteruo">
  456. <div class="zgutteruo-tit">关机类型占比</div>
  457. <img v-if="odata2" style="width: 260px; height: 260px;margin: 50px auto;display: block;"
  458. src="/img/Elementcircle.png" alt="" />
  459. <div v-else id="mane2" style="width: 100%; height: 360px;"></div>
  460. </div>
  461. </el-col>
  462. </el-row>
  463. </div>
  464. <div class="tablebox" v-if="!selectTime1">
  465. <template>
  466. <el-table :data="tableData" style="width: 100%" :header-cell-style="{background:'#F5F7FA',color:'#333333'}">
  467. <el-table-column prop="createTime" label="日期" width="100" align="center">
  468. </el-table-column>
  469. <el-table-column prop="equipmentQuantity" label="设备总数" align="center">
  470. </el-table-column>
  471. <el-table-column prop="onlineQuantity " label="在线设备" align="center">
  472. <template slot-scope="scope">
  473. {{ scope.row.onlineQuantity || 0 }}
  474. </template>
  475. </el-table-column>
  476. <el-table-column prop="onlineRate" label="在线设备占比" align="center">
  477. <template slot-scope="scope">
  478. {{ (scope.row.onlineRate || 0) + "%" }}
  479. </template>
  480. </el-table-column>
  481. <el-table-column prop="activeQuantity" label="活跃设备" align="center">
  482. </el-table-column>
  483. <el-table-column prop="activeRate" label="活跃设备占比" align="center">
  484. <template slot-scope="scope">
  485. {{ (scope.row.activeRate || 0) + "%" }}
  486. </template>
  487. </el-table-column>
  488. <el-table-column prop="assignQuantity" label="指派次数" align="center">
  489. </el-table-column>
  490. <el-table-column prop="normalRecordQuantity" label="完整录音次数" align="center">
  491. </el-table-column>
  492. <el-table-column prop="fullRecordRate" label="完整录音占比" align="center">
  493. <template slot-scope="scope">
  494. {{ (scope.row.fullRecordRate || 0) + "%" }}
  495. </template>
  496. </el-table-column>
  497. <el-table-column prop="snippetRecordQuantity" label="部分录音" align="center">
  498. </el-table-column>
  499. <el-table-column prop="noRecordQuantity" label="未录音" align="center">
  500. </el-table-column>
  501. <el-table-column prop="normalShutdownQuantity" label="正常关机次数" align="center">
  502. </el-table-column>
  503. <el-table-column prop="lowElectricityQuantity" label="低电关机次数" align="center">
  504. </el-table-column>
  505. <el-table-column prop="abnormalShutdownQuantity" label="异常关机次数" align="center">
  506. </el-table-column>
  507. <el-table-column v-if="equ_ed_online" prop="" label="操作" fixed="right" width="200" align="center">
  508. <template slot-scope="{ row }">
  509. <el-button @click.native.prevent="goinfo(row, 0)" type="text" size="small">在线记录</el-button>
  510. <el-button @click.native.prevent="goinfo(row, 1)" type="text" size="small">指派记录</el-button>
  511. </template>
  512. </el-table-column>
  513. </el-table>
  514. </template>
  515. <div style="display: flex; justify-content: flex-end; margin-top: 10px">
  516. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
  517. :current-page="page.pageNum" :page-sizes="[10, 30, 50]" :page-size="page.pageSize"
  518. layout="total, sizes, prev, pager, next, jumper" :total="page.total">
  519. </el-pagination>
  520. </div>
  521. </div>
  522. <div class="tablebox" v-if="selectTime1">
  523. <template>
  524. <el-table :data="compareList" style="width: 100%" height="640" :header-cell-style="{background:'#F5F7FA',color:'#333333'}">
  525. <el-table-column prop="name" label="时间" align="center">
  526. </el-table-column>
  527. <el-table-column prop="time" label="时段一" align="center">
  528. <template slot-scope="{ row }">
  529. <span v-if="compareFlag == 4 || compareFlag == 7 || compareFlag == 2">
  530. {{ row.time }}%</span>
  531. <span v-else> {{ row.time }}</span>
  532. </template>
  533. </el-table-column>
  534. <el-table-column prop="time1" label="时段二" align="center">
  535. <template slot-scope="{ row }">
  536. <span v-if="compareFlag == 4 || compareFlag == 7 || compareFlag == 2">
  537. {{ row.time1 }}%</span>
  538. <span v-else> {{ row.time1 }}</span>
  539. </template>
  540. </el-table-column>
  541. <el-table-column prop="time2" label="变化" align="center">
  542. <template slot-scope="scope">
  543. <span :style="
  544. scope.row.time2.substring(0, 1) == '-' ||
  545. scope.row.time2.substring(0, 1) == '0'
  546. ? 'color:green;'
  547. : 'color:red;'
  548. ">{{ scope.row.time2 }}</span>
  549. </template>
  550. </el-table-column>
  551. </el-table>
  552. </template>
  553. <div style="display: flex; justify-content: flex-end; margin-top: 10px">
  554. <el-pagination @size-change="handleSizeChange1" @current-change="handleCurrentChange1" :current-page="pageSize"
  555. :page-sizes="[10, 30, 50]" :page-size="pageNum" layout="total, sizes, prev, pager, next, jumper"
  556. :total="total">
  557. </el-pagination>
  558. </div>
  559. </div>
  560. </div>
  561. </template>
  562. <script>
  563. import * as echarts from "echarts";
  564. import { mapGetters } from "vuex";
  565. import { exportMethodPost } from "@/util/util";
  566. import colorTheme from "@/util/theme.color"
  567. export default {
  568. data() {
  569. return {
  570. houseId: "",
  571. timeType: 0,
  572. orgType: localStorage.getItem("orgType"),
  573. selValue:
  574. localStorage.getItem("orgType") == 0
  575. ? "0"
  576. : localStorage.getItem("orgType") == 1
  577. ? "1"
  578. : "2",
  579. time: "",
  580. compareFlag: "0",
  581. selectTime: "",
  582. selectTime1: "",
  583. customtime: [],
  584. tableData: [],
  585. currentPage4: 1,
  586. currentPage3: 1,
  587. checked: false,
  588. houseList: [],
  589. compareList: [],
  590. flag: false,
  591. page: {
  592. pageNum: 1,
  593. pageSize: 10,
  594. openTime: "",
  595. closeTime: "",
  596. houseName: "",
  597. accountName: "",
  598. imei: "",
  599. total: 10,
  600. recording: "",
  601. },
  602. pickerOptions: {
  603. disabledDate(time) {
  604. //根据当前日期 --- 禁止选中之后的日期
  605. // return time.getTime() > Date.now();
  606. },
  607. },
  608. details: {
  609. equipmentQuantity: "",
  610. onlineQuantity: "",
  611. onlineRate: "",
  612. activeQuantity: "",
  613. activeRate: "",
  614. assignQuantity: "",
  615. normalRecordQuantity: "",
  616. fullRecordRate: "",
  617. snippetRecordQuantity: "",
  618. noRecordQuantity: "",
  619. normalShutdownQuantity: "",
  620. lowElectricityQuantity: "",
  621. abnormalShutdownQuantity: "",
  622. },
  623. details1: {
  624. equipmentQuantity: "",
  625. onlineQuantity: "",
  626. onlineRate: "",
  627. activeQuantity: "",
  628. activeRate: "",
  629. assignQuantity: "",
  630. normalRecordQuantity: "",
  631. fullRecordRate: "",
  632. snippetRecordQuantity: "",
  633. noRecordQuantity: "",
  634. normalShutdownQuantity: "",
  635. lowElectricityQuantity: "",
  636. abnormalShutdownQuantity: "",
  637. },
  638. compare: {
  639. equipmentQuantity: "",
  640. onlineQuantity: "",
  641. onlineRate: "",
  642. activeQuantity: "",
  643. activeRate: "",
  644. assignQuantity: "",
  645. normalRecordQuantity: "",
  646. fullRecordRate: "",
  647. snippetRecordQuantity: "",
  648. noRecordQuantity: "",
  649. normalShutdownQuantity: "",
  650. lowElectricityQuantity: "",
  651. abnormalShutdownQuantity: "",
  652. },
  653. pageSize: 30,
  654. pageNum: 1,
  655. total: 10,
  656. allCompare: {},
  657. options: [
  658. {
  659. value: "0",
  660. label: "无录音",
  661. },
  662. {
  663. value: "1",
  664. label: "部分录音",
  665. },
  666. {
  667. value: "2",
  668. label: "完整录音",
  669. },
  670. ],
  671. options2: [
  672. {
  673. label: "正式数据",
  674. value: "0,1",
  675. },
  676. {
  677. label: "测试数据",
  678. value: "2,3",
  679. },
  680. ],
  681. houseTypes: "0,1",
  682. odata1: false,
  683. odata2: false,
  684. };
  685. },
  686. computed: {
  687. ...mapGetters(["permissions"]),
  688. },
  689. created() {
  690. this.equ_ed_online = this.permissions["equ_ed_online"];
  691. this.equ_ed_download = this.permissions["equ_ed_download"];
  692. },
  693. mounted() {
  694. // return;
  695. let theRequest = this.$route.query;
  696. console.log(theRequest, '123') //此时的theRequest就是我们需要的参数;
  697. if (theRequest.houseId) {
  698. this.flag = true;
  699. this.houseId = theRequest.houseId;
  700. this.timeType = theRequest.timeType || -1;
  701. this.selValue = "2"
  702. } else {
  703. this.flag = false;
  704. // console.log(1);
  705. this.timeType = 4;
  706. }
  707. if (theRequest.startDate) {
  708. this.page.openTime = theRequest.startDate;
  709. this.page.closeTime = theRequest.endDate;
  710. this.customtime = [theRequest.startDate, theRequest.endDate];
  711. // console.log(this.customtime);
  712. this.$forceUpdate();
  713. }
  714. this.getHouseList();
  715. // this.customtime=[] ;
  716. this.tableData = [];
  717. this.tableData1 = [];
  718. // this.getTableList()
  719. },
  720. methods: {
  721. downLoad() {
  722. // this.searchForm
  723. let obj = {
  724. startDate: this.page.openTime,
  725. endDate: this.page.closeTime,
  726. agentId:
  727. localStorage.getItem("orgType") == 1
  728. ? localStorage.getItem("agentId")
  729. : this.selValue == 0
  730. ? this.houseId
  731. : null,
  732. orgCode:
  733. localStorage.getItem("orgType") == 2
  734. ? localStorage.getItem("orgCode")
  735. : this.selValue == 1
  736. ? this.houseId
  737. : null,
  738. houseId:
  739. localStorage.getItem("orgType") == 3
  740. ? localStorage.getItem("houseId")
  741. : this.selValue == 2
  742. ? this.houseId
  743. : null,
  744. timeType: this.timeType,
  745. orgType: localStorage.getItem("orgType"),
  746. queryOrgType: this.selValue / 1 + 1,
  747. houseTypes: this.houseTypes,
  748. };
  749. obj.timeType == -1 ? (obj.timeType = "") : (obj.timeType = obj.timeType);
  750. exportMethodPost(
  751. "autoSR/zk/equipment/detail/equipmentCountDetailExport",
  752. "设备使用统计",
  753. obj
  754. );
  755. },
  756. sysChange() {
  757. this.selValue = "0";
  758. this.choicValue = "";
  759. this.timeType = 4;
  760. this.houseId = "";
  761. this.getHouseList();
  762. },
  763. selChange() {
  764. this.choicValue = "";
  765. this.timeType = 4;
  766. this.houseId = "";
  767. this.getHouseList();
  768. // this.getTableList();
  769. // this.getdetail();
  770. // // 获取对比列表
  771. // this.getcompare();
  772. },
  773. // 没有对比时的折线图
  774. getNoCompare() {
  775. this.compareFlag = 0;
  776. let obj = {
  777. // current: this.pageNum,
  778. // pageSize: this.pageNum,
  779. startDate: this.page.openTime,
  780. endDate: this.page.closeTime,
  781. agentId:
  782. localStorage.getItem("orgType") == 1
  783. ? localStorage.getItem("agentId")
  784. : this.selValue == 0
  785. ? this.houseId
  786. : null,
  787. orgCode:
  788. localStorage.getItem("orgType") == 2
  789. ? localStorage.getItem("orgCode")
  790. : this.selValue == 1
  791. ? this.houseId
  792. : null,
  793. houseId:
  794. localStorage.getItem("orgType") == 3
  795. ? localStorage.getItem("houseId")
  796. : this.selValue == 2
  797. ? this.houseId
  798. : null,
  799. timeType: this.timeType,
  800. contrastStartDate: this.selectTime,
  801. contrastEndDate: this.selectTime1,
  802. orgType: localStorage.getItem("orgType"),
  803. queryOrgType: this.selValue / 1 + 1,
  804. houseTypes: this.houseTypes,
  805. };
  806. obj.timeType == -1 ? (obj.timeType = "") : (obj.timeType = obj.timeType);
  807. obj.timeType == -1 ? (obj.timeType = "") : (obj.timeType = obj.timeType);
  808. axios({
  809. url: `autoSR/zk/equipment/detail/usageTrendContrast`,
  810. method: "get",
  811. params: obj,
  812. }).then((res) => {
  813. console.log(res);
  814. });
  815. },
  816. radioChange() {
  817. this.selectTime = "";
  818. this.selectTime1 = "";
  819. this.compareList = [];
  820. this.$set(this, "time", null);
  821. this.getcompare();
  822. },
  823. goinfo(row, idx) {
  824. console.log(row, "信息");
  825. this.$router.push({
  826. path: "/Equipment/equipmentOnlineRecordList",
  827. query: {
  828. houseId: this.houseId,
  829. startDate: row.createTime,
  830. endDate: row.createTime,
  831. flag: idx,
  832. },
  833. });
  834. },
  835. compareChange(idx, str) {
  836. // if (!this.selectTime1) return;
  837. this.compareFlag = idx;
  838. this.tabChange(idx, str);
  839. },
  840. timeChange(e) {
  841. this.selectTime = "";
  842. this.selectTime1 = "";
  843. this.pageNum = 1;
  844. // this.page.pageNum=1
  845. this.timeSelect(e);
  846. this.getdetail();
  847. this.getcompare();
  848. },
  849. timeSelect(e) {
  850. console.log(this.$refs.time);
  851. if (this.timeType == -1) {
  852. this.selectTime = e;
  853. this.selectTime1 = this.timestampToTime(
  854. new Date(e).getTime() +
  855. new Date(this.page.closeTime).getTime() -
  856. new Date(this.page.openTime).getTime()
  857. );
  858. } else {
  859. // 获取今天昨天近一周
  860. // 获取一天的时间戳
  861. let num = 24 * 3600 * 1000;
  862. // 获取当前时间戳转换为日期格式
  863. if (this.timeType == 4) {
  864. num = 24 * 3600 * 1000 * 6;
  865. }
  866. if (this.timeType == 5) {
  867. num = 24 * 3600 * 1000 * 14;
  868. }
  869. if (this.timeType == 6) {
  870. num = 24 * 3600 * 1000 * 29;
  871. }
  872. this.selectTime = e;
  873. this.selectTime1 = this.timestampToTime(new Date(e).getTime() + num);
  874. }
  875. },
  876. timestampToTime(timestamp) {
  877. var date = new Date(timestamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
  878. var yyyy = date.getFullYear() + "-";
  879. var MM =
  880. (date.getMonth() + 1 < 10
  881. ? "0" + (date.getMonth() + 1)
  882. : date.getMonth() + 1) + "-";
  883. var dd =
  884. (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
  885. return yyyy + MM + dd;
  886. },
  887. change() {
  888. this.checked = false;
  889. this.selectTime = "";
  890. this.selectTime1 = "";
  891. this.getTableList();
  892. this.getdetail();
  893. // 获取对比列表
  894. this.getcompare();
  895. },
  896. show() {
  897. this.$refs.time.pickerVisible = true;
  898. },
  899. //时间补0
  900. Zeropadding(s) {
  901. return s < 10 ? "0" + s : s;
  902. },
  903. tabtimetap(i) {
  904. this.timeType = i;
  905. // this.getTableList()
  906. this.checked = false;
  907. this.selectTime = "";
  908. this.selectTime1 = "";
  909. this.pageNum = 1;
  910. this.page.pageNum = 1;
  911. //给时间选择器赋值
  912. let num = 24 * 3600 * 1000;
  913. // 获取当前时间戳转换为日期格式
  914. if (this.timeType == 4) {
  915. num = 24 * 3600 * 1000 * 7;
  916. }
  917. if (this.timeType == 5) {
  918. num = 24 * 3600 * 1000 * 15;
  919. }
  920. if (this.timeType == 6) {
  921. num = 24 * 3600 * 1000 * 30;
  922. }
  923. console.log('ashjdklasjkldasjdlks')
  924. if (i != -1) {
  925. this.customtime = [
  926. this.timestampToTime(new Date().getTime() - num),
  927. this.timestampToTime(new Date().getTime() - 24 * 3600 * 1000),
  928. ];
  929. }
  930. this.$set(this, "time", null);
  931. this.getTableList();
  932. this.getdetail();
  933. this.getcompare();
  934. },
  935. screening() {
  936. this.page.pageNum = 1;
  937. this.page.pageSize = 10;
  938. this.getTableList();
  939. },
  940. empty() {
  941. this.page = {
  942. pageNum: 1,
  943. pageSize: 10,
  944. openTime: "",
  945. closeTime: "",
  946. houseName: "",
  947. accountName: "",
  948. imei: "",
  949. total: "",
  950. };
  951. this.customtime = "";
  952. this.getTableList();
  953. },
  954. //时间选择
  955. confirmtime(e) {
  956. this.timeType = "-1";
  957. this.checked = false;
  958. this.selectTime = "";
  959. this.pageNum = 1;
  960. this.page.pageNum = 1;
  961. this.selectTime1 = "";
  962. this.$set(this, "time", null);
  963. console.log(e);
  964. if (!e) return;
  965. this.page.openTime = this.customtime[0];
  966. this.page.closeTime = this.customtime[1];
  967. this.getTableList();
  968. this.getdetail();
  969. this.getcompare();
  970. },
  971. //获取项目数据
  972. getHouseList() {
  973. if (this.selValue == 1) {
  974. this.$api.api
  975. .findMyOrg({
  976. orgType: localStorage.getItem("orgType"),
  977. agentId: localStorage.getItem("agentId"),
  978. })
  979. .then((res) => {
  980. this.houseList = res.data;
  981. this.tabtimetap(this.timeType);
  982. this.getTableList();
  983. });
  984. } else if (this.selValue == 2) {
  985. this.$api.api
  986. .findHouseByUser({
  987. orgType: localStorage.getItem("orgType"),
  988. houseId: localStorage.getItem("houseId"),
  989. houseTypes: this.houseTypes,
  990. })
  991. .then((res) => {
  992. this.houseList = res.data;
  993. this.tabtimetap(this.timeType);
  994. this.getTableList();
  995. });
  996. } else {
  997. this.$api.api
  998. .findMyAgent({
  999. orgType: localStorage.getItem("orgType"),
  1000. })
  1001. .then((res) => {
  1002. this.houseList = res.data;
  1003. this.tabtimetap(this.timeType);
  1004. this.getTableList();
  1005. });
  1006. }
  1007. // this.$api.api.findHouseByUser({
  1008. // orgType: localStorage.getItem("orgType"),
  1009. // agentId: localStorage.getItem("agentId"),
  1010. // })
  1011. // .then((res) => {
  1012. // this.houseList = res.data;
  1013. // if (!this.flag) {
  1014. // if (localStorage.getItem("orgType") == 3) {
  1015. // this.houseId = localStorage.getItem("houseId");
  1016. // } else {
  1017. // this.houseId = res.data[0].id;
  1018. // }
  1019. // }
  1020. // this.tabtimetap(this.timeType);
  1021. // this.getTableList();
  1022. // });
  1023. },
  1024. handleSizeChange(val) {
  1025. console.log("每页条" + val);
  1026. this.page.pageSize = val;
  1027. this.getTableList();
  1028. },
  1029. handleCurrentChange(val) {
  1030. console.log("当前页" + val);
  1031. this.page.pageNum = val;
  1032. this.getTableList();
  1033. },
  1034. handleSizeChange1(val) {
  1035. console.log("每页条" + val);
  1036. this.pageSize = val;
  1037. this.getcompare();
  1038. },
  1039. handleCurrentChange1(val) {
  1040. console.log("当前页" + val);
  1041. this.pageNum = val;
  1042. this.getcompare();
  1043. },
  1044. //获取对比列表接口
  1045. getcompare() {
  1046. this.compareFlag = 0;
  1047. let obj = {
  1048. current: this.pageNum,
  1049. size: this.pageSize,
  1050. startDate: this.page.openTime,
  1051. endDate: this.page.closeTime,
  1052. agentId:
  1053. localStorage.getItem("orgType") == 1
  1054. ? localStorage.getItem("agentId")
  1055. : this.selValue == 0
  1056. ? this.houseId
  1057. : null,
  1058. orgCode:
  1059. localStorage.getItem("orgType") == 2
  1060. ? localStorage.getItem("orgCode")
  1061. : this.selValue == 1
  1062. ? this.houseId
  1063. : null,
  1064. houseId:
  1065. localStorage.getItem("orgType") == 3
  1066. ? localStorage.getItem("houseId")
  1067. : this.selValue == 2
  1068. ? this.houseId
  1069. : null,
  1070. timeType: this.timeType,
  1071. contrastStartDate: this.selectTime,
  1072. contrastEndDate: this.selectTime1,
  1073. orgType: localStorage.getItem("orgType"),
  1074. queryOrgType: this.selValue / 1 + 1,
  1075. houseTypes: this.houseTypes,
  1076. };
  1077. obj.timeType == -1 ? (obj.timeType = "") : (obj.timeType = obj.timeType);
  1078. axios({
  1079. url: `autoSR/zk/equipment/detail/usageTrendContrast`,
  1080. method: "get",
  1081. params: obj,
  1082. })
  1083. .then((res) => {
  1084. console.log(res, "获取数据");
  1085. this.allCompare = res;
  1086. this.total = res.data.firstPage.total;
  1087. // 数据处理
  1088. let arr = [];
  1089. if (this.pageNum == 1) {
  1090. let obj1 = {
  1091. name: "项目合计",
  1092. first: this.details,
  1093. second: this.details1,
  1094. contrast: res.data.total,
  1095. // time:'',
  1096. // time1:''
  1097. };
  1098. arr.push(obj1);
  1099. }
  1100. res.data.firstPage.records.map((item, index) => {
  1101. let obj = {};
  1102. //当他为0的时候
  1103. obj.name =
  1104. res.data.firstPage.records[index].createTime.substring(5, 10) +
  1105. "VS" +
  1106. res.data.secondPage.records[index].createTime.substring(5, 10);
  1107. obj.first = res.data.firstPage.records[index];
  1108. obj.second = res.data.secondPage.records[index];
  1109. obj.contrast = res.data.contrast[index];
  1110. // obj.time=''
  1111. // obj.time1=''
  1112. arr.push(obj);
  1113. });
  1114. this.compareList = arr;
  1115. // console.log(this.compareList,'123')
  1116. this.tabChange(0, "设备总数");
  1117. })
  1118. .catch((err) => {
  1119. // console.log(err)
  1120. this.compareList = [];
  1121. this.tabChange(0, "设备总数");
  1122. });
  1123. },
  1124. //处理数据
  1125. tabChange(idx, str1) {
  1126. //首先获取到给定的标志,对数据进行操作和赋值
  1127. //判断情况
  1128. // console.log(idx)
  1129. let str = "";
  1130. if (idx == 0) {
  1131. str = "equipmentQuantity";
  1132. }
  1133. if (idx == 1) {
  1134. str = "onlineQuantity";
  1135. }
  1136. if (idx == 2) {
  1137. str = "onlineRate";
  1138. }
  1139. if (idx == 3) {
  1140. str = "activeQuantity";
  1141. }
  1142. if (idx == 4) {
  1143. str = "activeRate";
  1144. }
  1145. if (idx == 5) {
  1146. str = "assignQuantity";
  1147. }
  1148. if (idx == 6) {
  1149. str = "normalRecordQuantity";
  1150. }
  1151. if (idx == 7) {
  1152. str = "fullRecordRate";
  1153. }
  1154. if (idx == 8) {
  1155. str = "snippetRecordQuantity";
  1156. }
  1157. if (idx == 9) {
  1158. str = "noRecordQuantity";
  1159. }
  1160. if (idx == 10) {
  1161. str = "normalShutdownQuantity";
  1162. }
  1163. if (idx == 11) {
  1164. str = "lowElectricityQuantity";
  1165. }
  1166. if (idx == 12) {
  1167. str = "abnormalShutdownQuantity";
  1168. }
  1169. // 获取到数据后对数据进行操作
  1170. // 循环大数组,赋值
  1171. if (this.selectTime1) {
  1172. let timeDate = [];
  1173. let arr1 = [];
  1174. let arr2 = [];
  1175. this.compareList.map((item, index) => {
  1176. item.time = item.first[str];
  1177. item.time1 = item.second[str];
  1178. item.time2 = item.contrast[str] + "";
  1179. // if (index > 0) {
  1180. // timeDate.push(item.name);
  1181. // arr1.push(item.first[str]);
  1182. // arr2.push(item.second[str]);
  1183. // }
  1184. });
  1185. this.allCompare.data.first.map((item, idx) => {
  1186. timeDate.push(
  1187. item.createTime.substring(5) +
  1188. "VS" +
  1189. this.allCompare.data.second[idx].createTime.substring(5)
  1190. );
  1191. arr1.push(item[str]);
  1192. arr2.push(this.allCompare.data.second[idx][str]);
  1193. });
  1194. this.compareList = Object.assign([], this.compareList);
  1195. this.$forceUpdate();
  1196. var chartDom = document.getElementById("compare");
  1197. echarts.init(chartDom).dispose();
  1198. var myChart = echarts.init(chartDom);
  1199. var option;
  1200. option = {
  1201. color: colorTheme.colorArr,
  1202. tooltip: {
  1203. trigger: "axis",
  1204. },
  1205. legend: {
  1206. data: ["时段一", "对比时段"],
  1207. bottom: "10",
  1208. icon:"roundRect"
  1209. },
  1210. grid: {
  1211. left: 10,
  1212. right: 10,
  1213. bottom:18,
  1214. containLabel: true,
  1215. },
  1216. xAxis: {
  1217. type: "category",
  1218. data: timeDate,
  1219. axisLabel: {
  1220. //重点在这一块,其余可以忽略
  1221. textStyle: {
  1222. color: "#212121", //更改坐标轴文字颜色
  1223. },
  1224. },
  1225. axisLine: {
  1226. lineStyle: {
  1227. type: "solid",
  1228. color: "#DDE1EE", //x线的颜色
  1229. width: "1", //坐标线的宽度
  1230. },
  1231. },
  1232. },
  1233. yAxis: {
  1234. type: "value",
  1235. splitNumber: 4,
  1236. axisLabel: {
  1237. //重点在这一块,其余可以忽略
  1238. textStyle: {
  1239. color: "#212121", //更改坐标轴文字颜色
  1240. },
  1241. },
  1242. axisLine: {
  1243. lineStyle: {
  1244. ype: "solid",
  1245. color: "#DDE1EE", //x线的颜色
  1246. width: "1", //坐标线的宽度
  1247. },
  1248. },
  1249. splitLine: {
  1250. lineStyle: {
  1251. type: "dashed", // y轴分割线类型
  1252. },
  1253. },
  1254. axisTick: {
  1255. //y轴刻度线
  1256. show: false,
  1257. },
  1258. },
  1259. series: [
  1260. {
  1261. name: "时段一",
  1262. data: arr1,
  1263. type: "line",
  1264. smooth: true,
  1265. },
  1266. {
  1267. name: "对比时段",
  1268. data: arr2,
  1269. type: "line",
  1270. smooth: true,
  1271. },
  1272. ],
  1273. };
  1274. option && myChart.setOption(option);
  1275. window.addEventListener("resize", () => {
  1276. myChart.resize();
  1277. });
  1278. } else {
  1279. // console.log(this.allCompare,"第一种");
  1280. let timeDate = [];
  1281. let arr1 = [];
  1282. this.allCompare.data.first.map((item) => {
  1283. timeDate.push(item.createTime.substring(5));
  1284. arr1.push(item[str]);
  1285. });
  1286. // console.log(timeDate,arr1);
  1287. var chartDom = document.getElementById("compare");
  1288. echarts.init(chartDom).dispose();
  1289. var myChart = echarts.init(chartDom);
  1290. var option;
  1291. option = {
  1292. color: colorTheme.colorArr[0],
  1293. tooltip: {
  1294. trigger: "axis",
  1295. },
  1296. legend: {
  1297. data: [str1],
  1298. top: "10",
  1299. icon:"roundRect"
  1300. },
  1301. grid: {
  1302. left: 10,
  1303. right: 10,
  1304. bottom:18,
  1305. containLabel: true,
  1306. },
  1307. xAxis: {
  1308. type: "category",
  1309. data: timeDate,
  1310. axisLabel: {
  1311. //重点在这一块,其余可以忽略
  1312. textStyle: {
  1313. color: "#212121", //更改坐标轴文字颜色
  1314. },
  1315. },
  1316. axisLine: {
  1317. lineStyle: {
  1318. type: "solid",
  1319. color: "#DDE1EE", //x线的颜色
  1320. width: "1", //坐标线的宽度
  1321. },
  1322. },
  1323. },
  1324. yAxis: {
  1325. type: "value",
  1326. splitNumber: 4,
  1327. axisLabel: {
  1328. //重点在这一块,其余可以忽略
  1329. textStyle: {
  1330. color: "#212121", //更改坐标轴文字颜色
  1331. },
  1332. },
  1333. axisLine: {
  1334. lineStyle: {
  1335. ype: "solid",
  1336. color: "#DDE1EE", //x线的颜色
  1337. width: "1", //坐标线的宽度
  1338. },
  1339. },
  1340. splitLine: {
  1341. lineStyle: {
  1342. type: "dashed", // y轴分割线类型
  1343. },
  1344. },
  1345. axisTick: {
  1346. //y轴刻度线
  1347. show: false,
  1348. },
  1349. },
  1350. series: [
  1351. {
  1352. name: str1,
  1353. data: arr1,
  1354. type: "line",
  1355. smooth: true,
  1356. areaStyle: {
  1357. color: new echarts.graphic.LinearGradient(
  1358. 0, 0, 0, 1,
  1359. [
  1360. { offset: 0, color: colorTheme.colorArr[0] },
  1361. { offset: 1, color: "#fff" }
  1362. ]
  1363. ),
  1364. opacity: 0.1
  1365. }
  1366. },
  1367. ],
  1368. };
  1369. option && myChart.setOption(option);
  1370. window.addEventListener("resize", () => {
  1371. myChart.resize();
  1372. });
  1373. }
  1374. },
  1375. //获取统计数据
  1376. getdetail() {
  1377. let obj = {
  1378. startDate: this.page.openTime,
  1379. endDate: this.page.closeTime,
  1380. agentId:
  1381. localStorage.getItem("orgType") == 1
  1382. ? localStorage.getItem("agentId")
  1383. : this.selValue == 0
  1384. ? this.houseId
  1385. : null,
  1386. orgCode:
  1387. localStorage.getItem("orgType") == 2
  1388. ? localStorage.getItem("orgCode")
  1389. : this.selValue == 1
  1390. ? this.houseId
  1391. : null,
  1392. houseId:
  1393. localStorage.getItem("orgType") == 3
  1394. ? localStorage.getItem("houseId")
  1395. : this.selValue == 2
  1396. ? this.houseId
  1397. : null,
  1398. timeType: this.timeType,
  1399. contrastStartDate: this.selectTime,
  1400. contrastEndDate: this.selectTime1,
  1401. orgType: localStorage.getItem("orgType"),
  1402. queryOrgType: this.selValue / 1 + 1,
  1403. houseTypes: this.houseTypes,
  1404. };
  1405. obj.timeType == -1 ? (obj.timeType = "") : (obj.timeType = obj.timeType);
  1406. axios({
  1407. url: `autoSR/zk/equipment/detail/usageTrend`,
  1408. method: "get",
  1409. params: obj,
  1410. }).then((res) => {
  1411. // console.log(res)
  1412. if (res.code == 0) {
  1413. this.details = res.data.first;
  1414. if (res.data.second) {
  1415. this.details1 = res.data.second;
  1416. this.compare = res.data.contrast;
  1417. }
  1418. let itemobj = {
  1419. objopts: [
  1420. {
  1421. value: this.details.normalRecordQuantity || 0,
  1422. name: "完整录音",
  1423. },
  1424. {
  1425. value: this.details.snippetRecordQuantity || 0,
  1426. name: "部分录音",
  1427. },
  1428. { value: this.details.noRecordQuantity || 0, name: "未录音" },
  1429. ],
  1430. };
  1431. this.odata1 = itemobj.objopts.every(i => {
  1432. if (i.value == 0) {
  1433. return true
  1434. }
  1435. })
  1436. let arr = itemobj.objopts.filter((item) => {
  1437. return item.value;
  1438. });
  1439. // console.log(arr,'123')
  1440. if (arr.length > 0) {
  1441. itemobj.objopts = arr;
  1442. }
  1443. let itemobj1 = {
  1444. objopts: [
  1445. {
  1446. value: this.details.normalShutdownQuantity || 0,
  1447. name: "正常关机",
  1448. },
  1449. {
  1450. value: this.details.lowElectricityQuantity || 0,
  1451. name: "低电关机",
  1452. },
  1453. {
  1454. value: this.details.abnormalShutdownQuantity || 0,
  1455. name: "异常关机",
  1456. },
  1457. ],
  1458. };
  1459. this.odata2 = itemobj1.objopts.every(i => {
  1460. if (i.value == 0) {
  1461. return true
  1462. }
  1463. })
  1464. let arr1 = itemobj1.objopts.filter((item) => {
  1465. return item.value;
  1466. });
  1467. if (arr1.length > 0) {
  1468. itemobj1.objopts = arr1;
  1469. }
  1470. var myChart = echarts.init(document.getElementById("mane"));
  1471. var myChart1 = echarts.init(document.getElementById("mane2"));
  1472. var option = {
  1473. color: colorTheme.colorArr,
  1474. tooltip: {
  1475. trigger: "item",
  1476. },
  1477. legend: {
  1478. bottom: "1%",
  1479. icon:"roundRect",
  1480. left: "center",
  1481. },
  1482. series: [
  1483. {
  1484. name: "",
  1485. type: "pie",
  1486. radius: ["48%", "70%"],
  1487. avoidLabelOverlap: false,
  1488. data: itemobj.objopts,
  1489. },
  1490. ],
  1491. };
  1492. var option1 = {
  1493. color: colorTheme.colorArr,
  1494. tooltip: {
  1495. trigger: "item",
  1496. },
  1497. legend: {
  1498. bottom: "1%",
  1499. icon:"roundRect",
  1500. left: "center",
  1501. },
  1502. series: [
  1503. {
  1504. name: "",
  1505. type: "pie",
  1506. radius: ["48%", "70%"],
  1507. avoidLabelOverlap: false,
  1508. data: itemobj1.objopts,
  1509. },
  1510. ],
  1511. };
  1512. myChart.setOption(option);
  1513. myChart1.setOption(option1);
  1514. }
  1515. });
  1516. },
  1517. //获取table数据、
  1518. getTableList() {
  1519. var url = "";
  1520. this.tableData = [];
  1521. let obj = {
  1522. current: this.page.pageNum,
  1523. pageSize: this.page.pageSize,
  1524. startDate: this.page.openTime,
  1525. endDate: this.page.closeTime,
  1526. agentId:
  1527. localStorage.getItem("orgType") == 1
  1528. ? localStorage.getItem("agentId")
  1529. : this.selValue == 0
  1530. ? this.houseId
  1531. : null,
  1532. orgCode:
  1533. localStorage.getItem("orgType") == 2
  1534. ? localStorage.getItem("orgCode")
  1535. : this.selValue == 1
  1536. ? this.houseId
  1537. : null,
  1538. houseId:
  1539. localStorage.getItem("orgType") == 3
  1540. ? localStorage.getItem("houseId")
  1541. : this.selValue == 2
  1542. ? this.houseId
  1543. : null,
  1544. timeType: this.timeType,
  1545. orgType: localStorage.getItem("orgType"),
  1546. queryOrgType: this.selValue / 1 + 1,
  1547. houseTypes: this.houseTypes,
  1548. };
  1549. obj.timeType == -1 ? (obj.timeType = "") : (obj.timeType = obj.timeType);
  1550. axios({
  1551. url: `autoSR/zk/equipment/detail/equipmentCountDetail`,
  1552. method: "get",
  1553. params: obj,
  1554. }).then((res) => {
  1555. if (res.code == 0) {
  1556. res.data.records.forEach((item, index) => {
  1557. item.index = index + 1;
  1558. });
  1559. this.tableData = res.data.records;
  1560. this.page.total = res.data.total;
  1561. }
  1562. });
  1563. },
  1564. },
  1565. };
  1566. </script>
  1567. <style lang='less' scoped>
  1568. .box-center {
  1569. width: 100%;
  1570. padding: 5px 15px 20px;
  1571. min-width: 1000px;
  1572. }
  1573. .toptimeqhuan {
  1574. width: 230px;
  1575. height: 32px;
  1576. background: #ffffff;
  1577. border-radius: 4px;
  1578. border: 1px solid #e0e0e0;
  1579. display: flex;
  1580. align-items: center;
  1581. overflow: hidden;
  1582. cursor: pointer;
  1583. margin-right: 10px;
  1584. }
  1585. .toptimeqhuan div {
  1586. flex: 1;
  1587. text-align: center;
  1588. line-height: 32px;
  1589. font-size: 16px;
  1590. }
  1591. .tophove {
  1592. color: #ffffff;
  1593. background: #2671e2;
  1594. }
  1595. .titlebox1 {
  1596. // width: 100%;
  1597. width: calc(100% - 270px);
  1598. position: fixed;
  1599. z-index: 999;
  1600. margin-top: -16px;
  1601. background: #ffffff;
  1602. // box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.04);
  1603. box-shadow: 0px 0px 10px 0px #dadada;
  1604. border-radius: 8px;
  1605. padding-bottom: 18px;
  1606. }
  1607. .titlebox {
  1608. width: 100%;
  1609. background: #ffffff;
  1610. box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.04);
  1611. border-radius: 8px;
  1612. margin-top: 120px;
  1613. padding: 10px 0;
  1614. }
  1615. .tablebox {
  1616. width: 100%;
  1617. background: #ffffff;
  1618. box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.04);
  1619. border-radius: 8px;
  1620. margin-top: 10px;
  1621. padding: 15px;
  1622. }
  1623. .kapiannox {
  1624. width: 98%;
  1625. margin-top: 20px;
  1626. }
  1627. .tabcard {
  1628. display: grid !important;
  1629. grid-template-columns: repeat(4, 24%);
  1630. grid-column-gap: 12px;
  1631. grid-row-gap: 18px;
  1632. /deep/ .el-card__body {
  1633. padding: 8px;
  1634. cursor: pointer;
  1635. }
  1636. .text1 {
  1637. height: 16px;
  1638. font-size: 16px;
  1639. font-weight: 400;
  1640. line-height: 16px;
  1641. text-indent: 20px;
  1642. margin-top: 10px;
  1643. color: #666666;
  1644. display: flex;
  1645. align-items: center;
  1646. }
  1647. .text2 {
  1648. height: 32px;
  1649. font-size: 32px;
  1650. font-weight: normal;
  1651. line-height: 32px;
  1652. text-indent: 20px;
  1653. margin-top: 10px;
  1654. }
  1655. .text3 {
  1656. font-size: 14px;
  1657. margin: 10px 0;
  1658. width: 100%;
  1659. text-indent: 20px;
  1660. display: flex;
  1661. align-items: center;
  1662. .textUp {
  1663. font-size: 14px;
  1664. display: flex;
  1665. font-weight: 600;
  1666. color: rgba(231, 72, 60, 1);
  1667. background: rgba(253, 240, 239, 1);
  1668. align-items: center;
  1669. padding: 3px 12px 3px 0;
  1670. border-radius: 3px;
  1671. margin-left: 8px;
  1672. .up {
  1673. font-size: 14px;
  1674. display: block;
  1675. width: 20px;
  1676. height: 15px;
  1677. background: url("../../../public/img/indexIcon/indexCardUp.png") no-repeat;
  1678. background-size: 100%;
  1679. margin-left: 8px;
  1680. }
  1681. }
  1682. .textDown {
  1683. font-size: 14px;
  1684. display: flex;
  1685. font-weight: 600;
  1686. color: rgba(7, 183, 157, 1);
  1687. background: rgba(235, 250, 246, 1);
  1688. align-items: center;
  1689. padding: 3px 12px 3px 0;
  1690. border-radius: 3px;
  1691. margin-left: 8px;
  1692. .down {
  1693. display: block;
  1694. width: 20px;
  1695. height: 15px;
  1696. background: url("../../../public/img/indexIcon/indexCardDown.png") no-repeat;
  1697. background-size: 100%;
  1698. margin-left: 8px;
  1699. }
  1700. }
  1701. }
  1702. .tophovese {
  1703. border: 1px solid #2671e2 !important;
  1704. background: rgba(38, 113, 226, 0.04);
  1705. color: #666 !important;
  1706. }
  1707. }
  1708. .alllistbox {
  1709. width: 98%;
  1710. margin: 0 auto;
  1711. display: flex;
  1712. flex-wrap: wrap;
  1713. }
  1714. .alllist {
  1715. width: 16.66%;
  1716. border: 1px solid #e0e0e0;
  1717. padding-bottom: 2px;
  1718. padding-top: 4px;
  1719. cursor: pointer;
  1720. }
  1721. .alllist-text1 {
  1722. width: 100%;
  1723. font-size: 16px;
  1724. font-family: PingFangSC-Regular, PingFang SC;
  1725. font-weight: 400;
  1726. color: #333333;
  1727. line-height: 26px;
  1728. /*text-align: center;*/
  1729. padding: 5px 10px;
  1730. }
  1731. .zgutteruo {
  1732. width: 100%;
  1733. padding-bottom: 20px;
  1734. background: #ffffff;
  1735. box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.04);
  1736. border-radius: 4px;
  1737. }
  1738. .zgutteruo-tit {
  1739. width: 100%;
  1740. height: 50px;
  1741. line-height: 50px;
  1742. font-size: 16px;
  1743. color: #32363d;
  1744. font-weight: 500;
  1745. text-indent: 30px;
  1746. border-bottom: 1px solid #e0e0e0;
  1747. }
  1748. .active {
  1749. background: #eef1f4;
  1750. // border: 1px solid #2671E2;
  1751. }
  1752. .timeSel {
  1753. margin-top: 8px;
  1754. margin-left: 20px;
  1755. border: 1px solid #ccc;
  1756. padding: 0 5px;
  1757. cursor: pointer;
  1758. color: #606266;
  1759. }
  1760. .alllist-text2 {
  1761. display: flex;
  1762. justify-content: space-between;
  1763. }
  1764. .alllist-f1 {
  1765. font-size: 22px;
  1766. font-weight: bold;
  1767. }
  1768. .alllist-f2 {
  1769. font-size: 12px;
  1770. }
  1771. .demonstration {
  1772. line-height: 36px;
  1773. }
  1774. /deep/ .el-table__header-wrapper {
  1775. thead {
  1776. tr {
  1777. th {
  1778. background: #F5F7FA;
  1779. color: #333333;
  1780. }
  1781. }
  1782. }
  1783. }
  1784. .pop{
  1785. display: inline-block;
  1786. width: 18px;
  1787. height: 18px;
  1788. background: url('../../../public/img/pop.png') no-repeat;
  1789. background-size: 100%;
  1790. margin-left: 6px;
  1791. }
  1792. /deep/ .el-button--text{
  1793. color: #2671E2;
  1794. }
  1795. /deep/ .el-button--primary{
  1796. background: #2671E2 !important;
  1797. border: 1px solid #2671E2 !important;
  1798. }
  1799. </style>