index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  1. <template>
  2. <div class="app-container">
  3. <headerdiv ref="headerDiv" :currentindexP = currentindexNew :menuNameP= itemName></headerdiv>
  4. <div style="display: inline-flex">
  5. <div class='leftTree'>
  6. <el-input
  7. placeholder="输入关键字进行过滤"
  8. v-model="filterText"
  9. style="margin-top:1rem">
  10. </el-input>
  11. <div style="height:83vh;">
  12. <el-scrollbar style="height:110%;">
  13. <el-tree
  14. :data="areaData"
  15. lazy
  16. show-checkbox
  17. :expand-on-click-node="false"
  18. node-key="id"
  19. :default-expanded-keys="expandedKeys"
  20. :props="defaultProps"
  21. :filter-node-method="filterNode"
  22. :default-expand-all= 'isExpand'
  23. ref="tree"
  24. @check-change = 'treeChange'
  25. style="background-color:#04283C;color:#C5D0D4"
  26. >
  27. </el-tree>
  28. </el-scrollbar>
  29. </div>
  30. </div>
  31. <div style="z-index:1000;width:150rem">
  32. <div class="divtitle">
  33. <img src="../../assets/images/icon.png" style="width:1.8rem;height:1.8rem;margin-top:0.3rem"/>
  34. <div style="font-size:1.6rem;font-family: Adobe Heiti Std;font-weight: normal;color: #DFEEF3;margin-left:0.5rem">巡检记录</div>
  35. </div>
  36. <div style="margin-top:1rem">
  37. <el-form :model="queryForm" ref="queryForm" :inline="true" label-width="10rem">
  38. <el-form-item label="时间" prop="areaCode">
  39. <el-date-picker
  40. v-model="queryForm.dateArry"
  41. @change='buttonChange'
  42. type="datetimerange"
  43. value-format="yyyy-MM-dd HH:mm:ss"
  44. range-separator="至"
  45. start-placeholder="开始时间"
  46. end-placeholder="结束时间"
  47. style="width:40rem">
  48. </el-date-picker>
  49. </el-form-item>
  50. <el-form-item label="巡检器" prop="deviceCode">
  51. <el-select v-model="queryForm.deviceCode" placeholder="请选择设备" clearable size="small" style="width:15rem">
  52. <el-option
  53. v-for="dict in deviceList"
  54. :key="dict.deviceCode"
  55. :label="dict.deviceName"
  56. :value="dict.deviceCode"
  57. />
  58. </el-select>
  59. </el-form-item>
  60. <el-form-item label="巡检点" prop="checkpointCard">
  61. <el-select v-model="queryForm.checkpointCard" placeholder="请选择巡检点" clearable size="small" style="width:15rem">
  62. <el-option
  63. v-for="dict in locationList"
  64. :key="dict.locationCode"
  65. :label="dict.locationName"
  66. :value="dict.locationCode"
  67. />
  68. </el-select>
  69. </el-form-item>
  70. <el-form-item label="巡检员" prop="patrolmanCard">
  71. <el-select v-model="queryForm.patrolmanCard" placeholder="请选择巡检员" clearable size="small" style="width:15rem" @change='buttonChange'>
  72. <el-option
  73. v-for="dict in patorlmanList"
  74. :key="dict.card"
  75. :label="dict.name"
  76. :value="dict.card"
  77. />
  78. </el-select>
  79. </el-form-item>
  80. <el-form-item>
  81. <el-button type="primary" icon="el-icon-search" size="mini" @click="getList">搜索</el-button>
  82. <el-button type="primary" icon="el-icon-search" size="mini" :disabled="buttonDisabled" @click="getTrail">轨迹</el-button>
  83. <el-button type="primary" icon="el-icon-refresh" size="mini">重置</el-button>
  84. <el-button type="primary" icon="el-icon-refresh" size="mini" @click="exportQuery">导出</el-button>
  85. </el-form-item>
  86. </el-form>
  87. </div>
  88. <!-- <el-row :gutter="10" class="mb8">
  89. <el-col :span="1.5">
  90. <el-button
  91. style="width:8rem;height:3.2rem;"
  92. type="primary"
  93. plain
  94. icon="el-icon-plus"
  95. @click="handleAdd"
  96. v-hasPermi="['qdtl:area:add']"
  97. >新增</el-button>
  98. </el-col>
  99. <el-col :span="1.5">
  100. <el-button
  101. style="width:8rem;height:3.2rem;"
  102. type="primary"
  103. plain
  104. icon="el-icon-edit"
  105. :disabled="single"
  106. @click="handleUpdate"
  107. v-hasPermi="['qdtl:area:edit']"
  108. >修改</el-button>
  109. </el-col>
  110. <el-col :span="1.5">
  111. <el-button
  112. style="width:8rem;height:3.2rem;"
  113. type="primary"
  114. plain
  115. icon="el-icon-delete"
  116. :disabled="multiple"
  117. @click="handleDelete"
  118. v-hasPermi="['qdtl:area:remove']"
  119. >删除</el-button>
  120. </el-col>
  121. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  122. </el-row> -->
  123. <el-table :data="logList" stripe
  124. class="my_table"
  125. :row-class-name="tableRowClassName"
  126. :max-height="tableHeight"
  127. :header-cell-style="{background:'#24A3B3 50%',color: '#C5D0D4'}">
  128. <!-- <el-table-column type="selection" width="55" align="center" /> -->
  129. <el-table-column type="index" width="55" align="center" label='序号'/>
  130. <el-table-column label="巡检员" align="center" prop="patrolmanName" />
  131. <el-table-column label="巡检点" align="center" prop="checkpointName" />
  132. <el-table-column label="巡检点卡号" align="center" prop="checkpointCard" />
  133. <el-table-column label="巡检器名称" align="center" prop="deviceName" />
  134. <el-table-column label="巡检设备号" align="center" prop="deviceCode" />
  135. <el-table-column label="所属区域" align="center" prop="areaName" />
  136. <el-table-column label="巡检卡号" align="center" prop="patrolmanCard" />
  137. <el-table-column label="时间" align="center" prop="createTime" />
  138. </el-table>
  139. <pagination
  140. style="position:fixed;top:90rem;right:5rem;"
  141. v-show="total>0"
  142. :total="total"
  143. :page.sync="queryForm.pageNum"
  144. :limit.sync="queryForm.pageSize"
  145. :layout="layout"
  146. @pagination="getList"
  147. />
  148. </div>
  149. </div>
  150. <el-dialog title="查看轨迹" :visible.sync="open" width="100rem" append-to-body @open="openMap" v-if="open">
  151. <div style="height:65rem">
  152. <div style="height:60rem;width:95rem;">
  153. <mapdiv ref='mapv' :pointObj='pointArry'></mapdiv>
  154. </div>
  155. <!-- <div slot="footer" class="dialog-footer" style="text-align:center">
  156. <el-button type="primary" @click="submitForm">确 定</el-button>
  157. <el-button type="primary" @click="cancel">取 消</el-button>
  158. <el-button type="primary" @click="deleteLocation">清 除</el-button>
  159. </div> -->
  160. </div>
  161. </el-dialog>
  162. </div>
  163. </template>
  164. <script>
  165. import { listVideo,queryCamera,editCamera } from "@/api/qdtl/video";
  166. import { getDicts } from "@/api/system/dict/data";
  167. import { listLocation } from "@/api/qdtl/location";
  168. import { listDevice } from "@/api/qdtl/device";
  169. import { getPatrolman,getLog,getTrail } from "@/api/qdtl/data";
  170. import { httpRequest } from "@/api/data/http";
  171. import videodiv from "@/components/Videoplayer/index.vue"
  172. import headerdiv from '@/components/HeaderDiv/index.vue'
  173. import mapdiv from "@/components/map/index.vue"
  174. export default {
  175. dicts: ['tl_area_type','tl_device_type','tl_xun_area'],
  176. data() {
  177. return {
  178. itemName:'巡检监测',
  179. isExpand:true,
  180. videoMap:new Map(),
  181. nameObj:{
  182. channel:'',
  183. name:''
  184. },
  185. areaData:[],
  186. // videoMap:new Map(),
  187. expandedKeys:[],
  188. videoIndex:1,
  189. currentindexNew:2,
  190. remarkName:false,
  191. logList:[],
  192. open:false,
  193. locationList:[],
  194. buttonDisabled:true,
  195. deviceList:[],
  196. patorlmanList:[],
  197. data: [{
  198. }],
  199. defaultProps: {
  200. children: 'children',
  201. label: 'label',
  202. id:'value'
  203. },
  204. filterText:'',
  205. layout:"total, prev, pager, next,jumper",
  206. tableHeight:600,
  207. ccode:'',
  208. jsonArry:[],
  209. total: 0,
  210. trailData:[],
  211. queryForm: {
  212. pageNum: 1,
  213. pageSize: 10,
  214. areaCode: null,
  215. areaName: null,
  216. areaType: null,
  217. areaId:null,
  218. },
  219. creamData:[],
  220. pointIdArry:[],
  221. pointArry:[],
  222. regionIndexCode:'',
  223. queryParams:{
  224. url:'http://2.90.220.252:9017/artemis-web/debug',
  225. params:'{"httpMethod":"POST","path":"/api/resource/v1/regions","headers":{},"query":{},"parameter":{},"body":{"pageNo": 1,"pageSize": 200,"treeCode": "0"},"contentType":"application/json;charset=UTF-8","mock":false,"appKey":"27794545","appSecret":"5Xi27Gl7JrbHHF1MpdaB"}'
  226. },
  227. videoParams:{
  228. url:'http://2.90.220.252:9017/artemis-web/debug',
  229. // params:'{"httpMethod":"POST","path":"/api/resource/v1/regions/regionIndexCode/cameras","headers":{},"query":{},"parameter":{},"body":{"pageNo": 1,"pageSize": 200,"regionIndexCode": "'+this.regionIndexCode+'"},"contentType":"application/json;charset=UTF-8","mock":false,"appKey":"27794545","appSecret":"5Xi27Gl7JrbHHF1MpdaB"}'
  230. },
  231. };
  232. },
  233. components:{
  234. videodiv,
  235. headerdiv,
  236. mapdiv
  237. },
  238. watch: {
  239. filterText(val) {
  240. this.$refs.tree.filter(val);
  241. }
  242. },
  243. created() {
  244. // this.getvideo()
  245. this.getTableHeight();
  246. },
  247. mounted(){
  248. this.getTree();
  249. this.listLocation();
  250. this.listDevice();
  251. this.getPatrolman();
  252. this.getList();
  253. },
  254. beforeDestroy(){
  255. },
  256. methods:{
  257. exportQuery(){
  258. this.download('/qdtl/log/export', {
  259. ...this.queryForm
  260. }, `巡检监测_${new Date().getTime()}.xlsx`)
  261. },
  262. getTableHeight(){
  263. var h = document.body.clientHeight;
  264. this.tableHeight = h*0.6
  265. // console.log(1111111111);
  266. console.log(this.tableHeight);
  267. },
  268. getTrail(){
  269. var trail = {};
  270. trail.areaId = this.queryForm.areaId
  271. trail.patrolmanCard = this.queryForm.patrolmanCard
  272. trail.deviceCode = this.queryForm.deviceCode
  273. trail.checkpointCard = this.queryForm.checkpointCard
  274. trail.endTime = this.queryForm.endTime
  275. trail.beginTime = this.queryForm.beginTime
  276. getTrail(trail).then(response=>{
  277. console.log(response);
  278. this.trailData = response.data
  279. this.pointArry.data = this.trailData;
  280. this.pointArry.type = 8
  281. this.open = true
  282. })
  283. },
  284. getList(){
  285. console.log(this.queryForm);
  286. getLog(this.queryForm).then(response =>{
  287. console.log(response);
  288. this.logList = response.rows
  289. this.total = response.total
  290. })
  291. },
  292. openMap(){
  293. console.log(11111111)
  294. this.pointArry.data = this.trailData;
  295. this.pointArry.type = 8
  296. console.log(this.pointArry);
  297. },
  298. getTree(){
  299. var treeDate = {
  300. label:'所有',
  301. value:1
  302. }
  303. treeDate.children = this.dict.type.tl_xun_area
  304. this.areaData.push(treeDate);
  305. },
  306. listLocation(){
  307. listLocation().then(response =>{
  308. this.locationList = response.rows
  309. })
  310. },
  311. listDevice(){
  312. listDevice().then(response =>{
  313. this.deviceList = response.rows
  314. })
  315. },
  316. getPatrolman(){
  317. getPatrolman().then(response =>{
  318. this.patorlmanList = response.rows
  319. })
  320. },
  321. tableRowClassName({ row, rowIndex }) {
  322. if ((rowIndex + 1) % 2 === 0) {
  323. return "warning-row";
  324. } else {
  325. return "success-row";
  326. }
  327. },
  328. filterNode(value, data) {
  329. if (!value) return true;
  330. return data.label.indexOf(value) !== -1;
  331. },
  332. treeChange(data, node){
  333. let tree = this.$refs.tree;
  334. let array = tree.getCheckedNodes().concat(tree.getHalfCheckedNodes())
  335. var areaArray = []
  336. for(var index in array){
  337. if(array[index].value != 1){
  338. areaArray.push(array[index].value);
  339. }
  340. }
  341. this.queryForm.areaId = areaArray.join(',')
  342. this.getList();
  343. // console.log(this.queryForm.areaId)
  344. },
  345. buttonChange(){
  346. console.log(this.queryForm.dateArry != null);
  347. console.log(this.queryForm.patrolmanCard != null);
  348. console.log(this.queryForm.patrolmanCard != '');
  349. if(this.queryForm.dateArry != null){
  350. var start = this.queryForm.dateArry[0];
  351. var end = this.queryForm.dateArry[1];
  352. this.queryForm.beginTime = start;
  353. this.queryForm.endTime = end;
  354. var startDay = new Date(start).setHours(0,0,0,0);;
  355. var endDay = new Date(end).setHours(0,0,0,0);;
  356. if(startDay == endDay && this.queryForm.patrolmanCard != null && this.queryForm.patrolmanCard != ''){
  357. this.buttonDisabled = false
  358. }else{
  359. this.buttonDisabled = true
  360. }
  361. }
  362. console.log(this.buttonDisabled)
  363. }
  364. }
  365. };
  366. </script>
  367. <style>
  368. .leftTree{
  369. /* float:left; */
  370. width:32rem;
  371. background-color:#04283C;
  372. padding: 10px;
  373. padding-top:0 ;
  374. min-height: 95vh;
  375. z-index:1001;
  376. }
  377. .app-container{
  378. padding:0
  379. }
  380. .divtitle{
  381. background: url("~@/assets/images/title2@2x.png") no-repeat;
  382. background-size: 100% 100%;
  383. width:100%;
  384. height:3.9rem;
  385. padding-top:0.8rem;
  386. padding-left:2rem;
  387. display: inline-flex
  388. /* float: left; */
  389. }
  390. .el-range-editor--medium .el-range-separator{
  391. color:white
  392. }
  393. </style>