index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  1. <!--
  2. *@description:监控中心 事态感知
  3. *@author: yh Fu
  4. *@date: 2023-08-24 08:52:53
  5. *@version: V1.0.5
  6. -->
  7. <template>
  8. <div class="leftbar" :class="indentleft" ref="left">
  9. <div class="forthis">
  10. <dv-border-box-13
  11. backgroundColor="rgba(12, 19, 38, .90)"
  12. style="padding-bottom: 1rem"
  13. >
  14. <img
  15. src="@/assets/images/integrated/light.png"
  16. style="width: 100%; margin-top: 0.4rem"
  17. />
  18. <div class="this-title">·
  19. <span>事态感知</span>
  20. <dv-decoration-3
  21. style="width: 150px; height: 15px; margin-right: 1rem"
  22. />
  23. </div>
  24. <div class="i-list-con">
  25. <div class="d-l-con-icon">
  26. <div
  27. class="icon-con w-33 m-btm-no"
  28. :class="{ on: She }"
  29. @click="eventClick('She')"
  30. >
  31. <!-- -->
  32. <div class="icon icon-dot"></div>
  33. <div class="icon-text">
  34. <h6>{{ sheNum }}</h6>
  35. <h5>摄像头</h5>
  36. </div>
  37. </div>
  38. <div
  39. class="icon-con w-33 m-btm-no"
  40. :class="{ on: Chuan }"
  41. @click="eventClick('Chuan')"
  42. >
  43. <div class="icon icon-dot"></div>
  44. <div class="icon-text">
  45. <h6>{{ sensorNum }}</h6>
  46. <h5>传感器</h5>
  47. </div>
  48. </div>
  49. <div
  50. class="icon-con w-33 m-btm-no"
  51. :class="{ on: Zhi }"
  52. @click="eventClick('Zhi')"
  53. >
  54. <div class="icon icon-dot"></div>
  55. <div class="icon-text">
  56. <h6>{{ enforcementNum }}</h6>
  57. <h5>执法设备</h5>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="i-list-con h-65" style="height: 62vh">
  62. <div class="third_contain">
  63. <!-- 三级搜索框 -->
  64. <el-input v-model="queryParams.enterpriseName" class="thirdInputModel" placeholder="按企业名称搜索 " style="color:white"
  65. @change="enterpriseList">
  66. </el-input>
  67. <div style="height: 4%;"></div>
  68. <div class="sp_sbg">
  69. <div
  70. style="width: 100%;height: 9%;display: flex;"
  71. v-for="(e,index) in companyList"
  72. :key="index"
  73. class="sp_sbg_div"
  74. :class=" deviceBtn == index ? 'on': 'onno'"
  75. >
  76. <el-button
  77. :style="deviceBtn == index ? 'color:#38CCEA' : 'color:#fff'"
  78. :class=" deviceBtn == index ? 'highlightedBtn': 'notHighlightedBtn'"
  79. @click="getDeviceList(e,index)">
  80. <el-tooltip :content="e.enterpriseName" placement="top" v-if="(e.enterpriseName!=null||e.enterpriseName!='')&&e.enterpriseName.length>8">
  81. <span style="position: relative;left: -18%;">
  82. {{ e.enterpriseName.substring(0,8) }}...
  83. </span>
  84. </el-tooltip>
  85. <span style="position: relative;left: -18%;" v-else>
  86. {{ e.enterpriseName }}
  87. </span>
  88. </el-button>
  89. <div
  90. class="thirdDevice_icon thirdHighlightedBtn"
  91. @click="thirdDeviceHashighLighted(e,index)"
  92. >
  93. </div>
  94. </div>
  95. </div>
  96. <!--分页-->
  97. <div class="paging">
  98. <el-button type="button" @click="enterpriseList(10,queryParams.pageNum-1)">上一页
  99. </el-button>
  100. <span>第{{ queryParams.pageNum }}页</span>
  101. <el-button type="button" :disabled="nextbutton"
  102. @click="enterpriseList(10,queryParams.pageNum+1)">下一页
  103. </el-button>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. </dv-border-box-13>
  109. </div>
  110. </div>
  111. </template>
  112. <script>
  113. import {treeselect} from "@/api/system/dept";
  114. import Cookies from "js-cookie";
  115. import {
  116. enterpriseList,
  117. enterpriseById,
  118. selectRegulatoryinformationByEnterpriseId
  119. } from '@/api/forest';
  120. export default {
  121. name: "StatusAware",
  122. // 列表容器动态样式 当前是否为摄像头 摄像头设备列表 当前是否为传感器 传感器数量 当前是否为云广播 云广播数量
  123. props: ['indentleft', 'onShe', 'sheNum', 'onChuan', 'sensorNum', 'onLa', 'loudspeakerNum', 'onZhi', 'enforcementNum', 'deptId'],
  124. data() {
  125. return {
  126. localMark: "She", // 当前资源类型
  127. She: false,
  128. Chuan: false,
  129. La: false,
  130. Zhi: false,
  131. resourceTypeList: [
  132. {'value': 'She', 'lable': '摄像头'},
  133. {'value': 'Chuan', 'lable': '传感器'},
  134. {'value': 'La','lable': '云广播'},
  135. {'value': 'Zhi','lable': '执法设备'
  136. }],
  137. deptName: '', // 部门名称
  138. deptOptions: undefined, // 部门树选项
  139. defaultProps: {
  140. children: "children",
  141. label: "label",
  142. }, // 部门树默认props
  143. placeholderMsg: '',
  144. cgqTimer: null,
  145. thirdInput:'', // 输入框label(三级)
  146. companyList:[], // 企业列表
  147. queryParams: {
  148. pageNum: 1,
  149. pageSize: 10,
  150. enterpriseName: null
  151. },
  152. totalAllCompany:0,
  153. cameraListSearch:[],
  154. deviceBtn:null
  155. }
  156. },
  157. mounted() {
  158. this.getTreeselect();
  159. this.enterpriseList(10,1);
  160. },
  161. methods: {
  162. /**
  163. * 企业列表接口
  164. */
  165. enterpriseList(pageSize, pageNum){
  166. if (pageNum < 1) {
  167. this.$modal.msg('当前已是第一页')
  168. return
  169. } else if(pageNum > this.totalAllCompany/10+1){
  170. this.$modal.msg('当前已是最后一页')
  171. return;
  172. }
  173. this.queryParams.pageSize = pageSize;
  174. this.queryParams.pageNum = pageNum;
  175. enterpriseList({...this.queryParams ,deptId:Cookies.get("deptId")}).then(res => {
  176. this.companyList = res.data
  177. this.totalAllCompany = res.total
  178. })
  179. },
  180. getDeviceList(e,idx){
  181. this.deviceBtn=idx
  182. this.$parent.getDeviceList(e);
  183. },
  184. thirdDeviceHashighLighted(e,idx){
  185. this.deviceBtn=idx
  186. this.$parent.thirdDeviceHashighLighted(e);
  187. },
  188. /* 电视墙替换结束 */
  189. /** 部门树*/
  190. // 查询部门下拉树结构
  191. getTreeselect() {
  192. treeselect().then((response) => {
  193. console.log(response.data);
  194. this.deptOptions = response.data;
  195. });
  196. },
  197. // 单击节点
  198. handleNodeClickForParent(data) {
  199. this.$emit('handleNodeClickOfParent', data, this.localMark)
  200. },
  201. // 筛选节点
  202. filterNode(value, data) {
  203. if (!value) return true;
  204. return data.label.indexOf(value) !== -1;
  205. },
  206. /**
  207. * @description 资源点击事件 进行对应的资源展示
  208. * 摄像头 传感器 云广播
  209. * @params {String} type = she || chuan || la 显示资源的类型
  210. */
  211. eventClick(type) {
  212. this.localMark = type;
  213. this[`${type}`] = true
  214. this.$emit(`${type}ClickOfParent`)
  215. // this.deptId = Cookies.get("deptId")
  216. clearInterval(this.cgqTimer);
  217. debugger
  218. switch (type) {
  219. case "She":
  220. this.$emit('sheClick')
  221. this.jkListIcon = 'sj-icon-jkzx'
  222. break;
  223. case "Chuan":
  224. this.$emit('chuanClick')
  225. this.cgqTimer = setInterval(() => {
  226. this.$emit('chuanClick')
  227. }, 20 * 1000);
  228. this.jkListIcon = 'sj-icon-centerdata-t-firecontrol-fire-pressure-sensor'
  229. break;
  230. case "La":
  231. this.$emit('laClick');
  232. this.jkListIcon = 'sj-icon-labaguangbo'
  233. break;
  234. case "Zhi":
  235. this.$emit('zhiClick', this.deptId);
  236. this.jkListIcon = 'sj-icon-zhongzhi'
  237. break;
  238. }
  239. },
  240. // 筛选节点
  241. filterNode(value, data) {
  242. if (!value) return true;
  243. return data.label.indexOf(value) !== -1;
  244. },
  245. chuanSet() {
  246. if (this.Chuan) {
  247. this.cgqTimer = setInterval(() => {
  248. this.getMonitorDeviceAndDataList();
  249. }, 20000);
  250. }
  251. },
  252. },
  253. beforeDestroy() {
  254. clearInterval(this.cgqTimer); //关闭
  255. },
  256. watch: {
  257. 'queryParams.enterpriseName':function(val){
  258. this.enterpriseList(this.queryParams.pageSize, this.queryParams.pageNum, val)
  259. },
  260. // 根据名称筛选部门树
  261. deptName(val) {
  262. this.$refs.tree.filter(val);
  263. },
  264. // 监听当前资源类型
  265. localMark: {
  266. handler(newVal) {
  267. this.resourceTypeList.forEach(item => {
  268. // 将其他不展示类型置为false
  269. if (item.value != newVal) {
  270. this[`${item.value}`] = false
  271. } else {
  272. this.placeholderMsg = `请输入${item.lable}名称`
  273. }
  274. })
  275. },
  276. }
  277. }
  278. }
  279. </script>
  280. <style lang="scss" scoped>
  281. .inputModel{
  282. width: 100%;
  283. padding: 0 5%;
  284. }
  285. .itemPic{
  286. width: 24%;
  287. height: 100%;
  288. }
  289. .highlightedBtn{
  290. background: url('~@/assets/images/video-plaza/highLightBtn.png') 0 0 no-repeat; /* 高亮背景 */
  291. background-size: cover;
  292. }
  293. .notHighlightedBtn{
  294. background: none;
  295. }
  296. .third_contain{
  297. overflow: hidden;
  298. overflow-y: scroll;
  299. width: 99%;
  300. height: 100%;
  301. padding-left:10px;
  302. ::v-deep .el-button{
  303. width: 80%;
  304. height: 100%;
  305. margin-left: 0 !important;
  306. >span{
  307. display: inline-block;
  308. width: 100%;
  309. text-align: center;
  310. }
  311. >span >span{
  312. left: 0 !important;
  313. display: inline-block;
  314. width: 100%;
  315. text-align: center;
  316. }
  317. }
  318. ::v-deep .el-button:not(:nth-child(1)){
  319. }
  320. .thirdDevice_icon{
  321. width: 10%;
  322. margin: 1.7% 15px 0 2%;
  323. height: 70%;
  324. cursor: pointer;
  325. }
  326. .paging {
  327. height: 4%;
  328. padding: 0rem .3rem;
  329. display: flex;
  330. justify-content: center;
  331. align-content: center;
  332. span {
  333. color: #2bacf7;
  334. display: flex;
  335. align-items: center;
  336. padding: 0 1rem;
  337. }
  338. button {
  339. width: 70px;
  340. padding: 0 0.3rem;
  341. height: 1.5rem;
  342. background-color: #112543;
  343. color: #2bacf7;
  344. border: 1px solid #33467f;
  345. }
  346. button:hover {
  347. padding: 0 0.3rem;
  348. height: 1.5rem;
  349. background-color: #112543;
  350. color: #0ff7c5;
  351. border: 1px solid #1d657f;
  352. }
  353. }
  354. }
  355. .thirdInputModel{
  356. margin-top: 10px;
  357. // margin-left: 8%;
  358. // width: 95%;
  359. }
  360. .sp_sbg{
  361. overflow: hidden;
  362. overflow-y: scroll;
  363. width: 100%;
  364. height: 80%;
  365. .sp_sbg_div{
  366. background-color: rgb(35, 76, 172,0.2);
  367. margin: 5px 0px;
  368. border-radius: 5px;
  369. .el-button{
  370. background: none;
  371. outline: 0px;
  372. border: 0px;
  373. }
  374. }
  375. .sp_sbg_div.on{
  376. background-color: rgb(35, 76, 172,0.4);
  377. .el-button{
  378. span{
  379. color: #01FBFE!important;
  380. text-shadow: 0px 0px 3px #01FBFE;
  381. }
  382. }
  383. }
  384. }
  385. .sip_img{
  386. opacity: 0.8;
  387. }
  388. .sip_imgon{
  389. opacity: 1;
  390. box-shadow: 0px 5px 5px #0b3555;
  391. }
  392. .thirdHighlightedBtn{
  393. background: url('~@/assets/images/video-plaza/camera1_on.png') 0 0 no-repeat; /* 高亮背景 */
  394. background-size: 100% 100%;
  395. }
  396. .thirdDevice_icon{
  397. width: 10%;
  398. margin: 1.7% 15px 0 2%;
  399. height: 70%;
  400. cursor: pointer;
  401. }
  402. </style>