index.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  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: La }"
  52. @click="eventClick('La')"
  53. >
  54. <div class="icon icon-dot"></div>
  55. <div class="icon-text">
  56. <h6>{{ loudspeakerNum }}</h6>
  57. <h5>云广播</h5>
  58. </div>
  59. </div>
  60. <div
  61. class="icon-con w-33 m-btm-no"
  62. :class="{ on: Zhi }"
  63. @click="eventClick('Zhi')"
  64. >
  65. <div class="icon icon-dot"></div>
  66. <div class="icon-text">
  67. <h6>{{ enforcementNum }}</h6>
  68. <h5>执法设备</h5>
  69. </div>
  70. </div>
  71. </div>
  72. <!-- <div class="overflow-y" style="height: 33vh;">-->
  73. <!-- <el-collapse accordion>-->
  74. <!-- <el-collapse-item v-for="(item,index) in region" :key="index">-->
  75. <!-- &lt;!&ndash; deptId &ndash;&gt;-->
  76. <!-- <template slot="title">-->
  77. <!-- <div class="d-l-con sj-collapse" :class="{on:listCurrentIndex1==item.deptId}"-->
  78. <!-- v-on:click="selectCameraByDeptId(item.deptId)">-->
  79. <!-- <div class="d-l-l-text">-->
  80. <!-- <h4 class="collapse-title">{{ item.deptName }}</h4>-->
  81. <!-- </div>-->
  82. <!-- <div class="d-l-l-count">{{ item.deptCount }}</div>-->
  83. <!-- </div>-->
  84. <!-- </template>-->
  85. <!-- </el-collapse-item>-->
  86. <!-- </el-collapse>-->
  87. <!-- </div>-->
  88. <!-- &lt;!&ndash; 横向柱状 echart &ndash;&gt;-->
  89. <!-- <div class="overflow-y" style="height: 33vh;">-->
  90. <!-- <div id="camera-chart" style="width: 100%;height:33vh;"></div>-->
  91. <!-- </div>-->
  92. <div class="sj-search">
  93. <el-input
  94. v-model="deptName"
  95. placeholder="请输入部门名称"
  96. clearable
  97. size="small"
  98. prefix-icon="el-icon-search"
  99. />
  100. </div>
  101. <div class="i-list-con h-65" style="height: 62vh">
  102. <el-tree
  103. :data="deptOptions"
  104. :props="defaultProps"
  105. :expand-on-click-node="false"
  106. :filter-node-method="filterNode"
  107. ref="tree"
  108. node-key="id"
  109. :default-expanded-keys="[100]"
  110. @node-click="handleNodeClickForParent"
  111. />
  112. </div>
  113. </div>
  114. </dv-border-box-13>
  115. </div>
  116. </div>
  117. </template>
  118. <script>
  119. import {treeselect} from "@/api/system/dept";
  120. import Cookies from "js-cookie";
  121. export default {
  122. name: "StatusAware",
  123. // 列表容器动态样式 当前是否为摄像头 摄像头设备列表 当前是否为传感器 传感器数量 当前是否为云广播 云广播数量
  124. props: ['indentleft', 'onShe', 'sheNum', 'onChuan', 'sensorNum', 'onLa', 'loudspeakerNum', 'onZhi', 'enforcementNum', 'deptId'],
  125. data() {
  126. return {
  127. localMark: "She", // 当前资源类型
  128. She: true,
  129. Chuan: false,
  130. La: false,
  131. Zhi: false,
  132. resourceTypeList: [
  133. {'value': 'She', 'lable': '摄像头'},
  134. {'value': 'Chuan', 'lable': '传感器'},
  135. {'value': 'La','lable': '云广播'},
  136. {'value': 'Zhi','lable': '执法设备'
  137. }],
  138. deptName: '', // 部门名称
  139. deptOptions: undefined, // 部门树选项
  140. defaultProps: {
  141. children: "children",
  142. label: "label",
  143. }, // 部门树默认props
  144. placeholderMsg: '',
  145. cgqTimer: null,
  146. }
  147. },
  148. mounted() {
  149. this.getTreeselect();
  150. },
  151. methods: {
  152. /* 电视墙替换结束 */
  153. /** 部门树*/
  154. // 查询部门下拉树结构
  155. getTreeselect() {
  156. treeselect().then((response) => {
  157. console.log(response.data);
  158. this.deptOptions = response.data;
  159. });
  160. },
  161. // 单击节点
  162. handleNodeClickForParent(data) {
  163. this.$emit('handleNodeClickOfParent', data, this.localMark)
  164. },
  165. // 筛选节点
  166. filterNode(value, data) {
  167. if (!value) return true;
  168. return data.label.indexOf(value) !== -1;
  169. },
  170. /**
  171. * @description 资源点击事件 进行对应的资源展示
  172. * 摄像头 传感器 云广播
  173. * @params {String} type = she || chuan || la 显示资源的类型
  174. */
  175. eventClick(type) {
  176. this.localMark = type;
  177. this[`${type}`] = true
  178. this.$emit(`${type}ClickOfParent`)
  179. // this.deptId = Cookies.get("deptId")
  180. clearInterval(this.cgqTimer);
  181. debugger
  182. switch (type) {
  183. case "She":
  184. this.$emit('sheClick')
  185. this.jkListIcon = 'sj-icon-jkzx'
  186. break;
  187. case "Chuan":
  188. this.$emit('chuanClick')
  189. this.cgqTimer = setInterval(() => {
  190. this.$emit('chuanClick')
  191. }, 20 * 1000);
  192. this.jkListIcon = 'sj-icon-centerdata-t-firecontrol-fire-pressure-sensor'
  193. break;
  194. case "La":
  195. this.$emit('laClick');
  196. this.jkListIcon = 'sj-icon-labaguangbo'
  197. break;
  198. case "Zhi":
  199. this.$emit('zhiClick', this.deptId);
  200. this.jkListIcon = 'sj-icon-zhongzhi'
  201. break;
  202. }
  203. },
  204. // 筛选节点
  205. filterNode(value, data) {
  206. if (!value) return true;
  207. return data.label.indexOf(value) !== -1;
  208. },
  209. chuanSet() {
  210. if (this.Chuan) {
  211. this.cgqTimer = setInterval(() => {
  212. this.getMonitorDeviceAndDataList();
  213. }, 20000);
  214. }
  215. },
  216. },
  217. beforeDestroy() {
  218. clearInterval(this.cgqTimer); //关闭
  219. },
  220. watch: {
  221. // 根据名称筛选部门树
  222. deptName(val) {
  223. this.$refs.tree.filter(val);
  224. },
  225. // 监听当前资源类型
  226. localMark: {
  227. handler(newVal) {
  228. this.resourceTypeList.forEach(item => {
  229. // 将其他不展示类型置为false
  230. if (item.value != newVal) {
  231. this[`${item.value}`] = false
  232. } else {
  233. this.placeholderMsg = `请输入${item.lable}名称`
  234. }
  235. })
  236. },
  237. }
  238. }
  239. }
  240. </script>