Commit e78c402a248ff252ee93e724396c62d806087fab

Authored by 648540858
2 parents 72c1b36d 5d673fb0

Merge remote-tracking branch 'origin/wvp-28181-2.0' into commercial

# Conflicts:
#	sql/mysql.sql
#	src/main/java/com/genersoft/iot/vmp/gb28181/bean/Device.java
#	src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
Showing 29 changed files with 1333 additions and 528 deletions
sql/mysql.sql
1   --- MariaDB dump 10.19 Distrib 10.7.3-MariaDB, for Linux (x86_64)
  1 +-- MySQL dump 10.13 Distrib 8.0.29, for Linux (x86_64)
2 2 --
3 3 -- Host: 127.0.0.1 Database: wvp3
4 4 -- ------------------------------------------------------
5   --- Server version 8.0.0-dmr
  5 +-- Server version 8.0.29-0ubuntu0.22.04.2
6 6  
7 7 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
8 8 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
9 9 /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
10   -/*!40101 SET NAMES utf8mb4 */;
  10 +/*!50503 SET NAMES utf8mb4 */;
11 11 /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
12 12 /*!40103 SET TIME_ZONE='+00:00' */;
13 13 /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
... ... @@ -21,36 +21,36 @@
21 21  
22 22 DROP TABLE IF EXISTS `device`;
23 23 /*!40101 SET @saved_cs_client = @@character_set_client */;
24   -/*!40101 SET character_set_client = utf8 */;
  24 +/*!50503 SET character_set_client = utf8mb4 */;
25 25 CREATE TABLE `device` (
26   - `id` int(11) NOT NULL AUTO_INCREMENT,
27   - `deviceId` varchar(50) NOT NULL,
28   - `name` varchar(255) DEFAULT NULL,
29   - `manufacturer` varchar(255) DEFAULT NULL,
30   - `model` varchar(255) DEFAULT NULL,
31   - `firmware` varchar(255) DEFAULT NULL,
32   - `transport` varchar(50) DEFAULT NULL,
33   - `streamMode` varchar(50) DEFAULT NULL,
34   - `online` varchar(50) DEFAULT NULL,
35   - `registerTime` varchar(50) DEFAULT NULL,
36   - `keepaliveTime` varchar(50) DEFAULT NULL,
37   - `ip` varchar(50) NOT NULL,
38   - `createTime` varchar(50) NOT NULL,
39   - `updateTime` varchar(50) NOT NULL,
40   - `port` int(11) NOT NULL,
41   - `expires` int(11) NOT NULL,
42   - `subscribeCycleForCatalog` int(11) NOT NULL,
43   - `subscribeCycleForMobilePosition` int(11) NOT NULL,
44   - `mobilePositionSubmissionInterval` int(11) NOT NULL DEFAULT '5',
45   - `subscribeCycleForAlarm` int(11) NOT NULL,
46   - `hostAddress` varchar(50) NOT NULL,
47   - `audioChannelForReceive` varchar(50) NOT NULL,
48   - `audioChannelForSend` varchar(50) NOT NULL,
49   - `charset` varchar(50) NOT NULL,
50   - `ssrcCheck` int(11) DEFAULT '0',
51   - PRIMARY KEY (`id`),
52   - UNIQUE KEY `device_deviceId_uindex` (`deviceId`)
53   -) ENGINE=InnoDB AUTO_INCREMENT=47 DEFAULT CHARSET=utf8mb4;
  26 + `id` int NOT NULL AUTO_INCREMENT,
  27 + `deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  28 + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  29 + `manufacturer` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  30 + `model` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  31 + `firmware` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  32 + `transport` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  33 + `streamMode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  34 + `online` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  35 + `registerTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  36 + `keepaliveTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  37 + `ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  38 + `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  39 + `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  40 + `port` int NOT NULL,
  41 + `expires` int NOT NULL,
  42 + `subscribeCycleForCatalog` int NOT NULL,
  43 + `hostAddress` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  44 + `charset` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  45 + `subscribeCycleForMobilePosition` int DEFAULT NULL,
  46 + `mobilePositionSubmissionInterval` int DEFAULT '5',
  47 + `subscribeCycleForAlarm` int DEFAULT NULL,
  48 + `ssrcCheck` int DEFAULT '0',
  49 + `geoCoordSys` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  50 + `treeType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  51 + PRIMARY KEY (`id`) USING BTREE,
  52 + UNIQUE KEY `device_deviceId_uindex` (`deviceId`) USING BTREE
  53 +) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
54 54 /*!40101 SET character_set_client = @saved_cs_client */;
55 55  
56 56 --
... ... @@ -68,20 +68,20 @@ UNLOCK TABLES;
68 68  
69 69 DROP TABLE IF EXISTS `device_alarm`;
70 70 /*!40101 SET @saved_cs_client = @@character_set_client */;
71   -/*!40101 SET character_set_client = utf8 */;
  71 +/*!50503 SET character_set_client = utf8mb4 */;
72 72 CREATE TABLE `device_alarm` (
73   - `id` int(11) NOT NULL AUTO_INCREMENT,
74   - `deviceId` varchar(50) NOT NULL,
75   - `channelId` varchar(50) NOT NULL,
76   - `alarmPriority` varchar(50) NOT NULL,
77   - `alarmMethod` varchar(50) DEFAULT NULL,
78   - `alarmTime` varchar(50) NOT NULL,
79   - `alarmDescription` varchar(255) DEFAULT NULL,
80   - `longitude` double DEFAULT NULL,
81   - `latitude` double DEFAULT NULL,
82   - `alarmType` varchar(50) DEFAULT NULL,
83   - PRIMARY KEY (`id`) USING BTREE
84   -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  73 + `id` int NOT NULL AUTO_INCREMENT,
  74 + `deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  75 + `channelId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  76 + `alarmPriority` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  77 + `alarmMethod` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  78 + `alarmTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  79 + `alarmDescription` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  80 + `longitude` double DEFAULT NULL,
  81 + `latitude` double DEFAULT NULL,
  82 + `alarmType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  83 + PRIMARY KEY (`id`) USING BTREE
  84 +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
85 85 /*!40101 SET character_set_client = @saved_cs_client */;
86 86  
87 87 --
... ... @@ -99,43 +99,48 @@ UNLOCK TABLES;
99 99  
100 100 DROP TABLE IF EXISTS `device_channel`;
101 101 /*!40101 SET @saved_cs_client = @@character_set_client */;
102   -/*!40101 SET character_set_client = utf8 */;
  102 +/*!50503 SET character_set_client = utf8mb4 */;
103 103 CREATE TABLE `device_channel` (
104   - `id` int(11) NOT NULL AUTO_INCREMENT,
105   - `channelId` varchar(50) NOT NULL,
106   - `name` varchar(255) DEFAULT NULL,
107   - `manufacture` varchar(50) DEFAULT NULL,
108   - `model` varchar(50) DEFAULT NULL,
109   - `owner` varchar(50) DEFAULT NULL,
110   - `civilCode` varchar(50) DEFAULT NULL,
111   - `block` varchar(50) DEFAULT NULL,
112   - `address` varchar(50) DEFAULT NULL,
113   - `parentId` varchar(50) DEFAULT NULL,
114   - `safetyWay` int(11) DEFAULT NULL,
115   - `registerWay` int(11) DEFAULT NULL,
116   - `certNum` varchar(50) DEFAULT NULL,
117   - `certifiable` int(11) DEFAULT NULL,
118   - `errCode` int(11) DEFAULT NULL,
119   - `endTime` varchar(50) DEFAULT NULL,
120   - `secrecy` varchar(50) DEFAULT NULL,
121   - `ipAddress` varchar(50) DEFAULT NULL,
122   - `port` int(11) DEFAULT NULL,
123   - `password` varchar(255) DEFAULT NULL,
124   - `PTZType` int(11) DEFAULT NULL,
125   - `status` int(11) DEFAULT NULL,
126   - `longitude` double DEFAULT NULL,
127   - `latitude` double DEFAULT NULL,
128   - `streamId` varchar(50) DEFAULT NULL,
129   - `deviceId` varchar(50) NOT NULL,
130   - `parental` varchar(50) DEFAULT NULL,
131   - `hasAudio` bit(1) DEFAULT NULL,
132   - `createTime` varchar(50) NOT NULL,
133   - `updateTime` varchar(50) NOT NULL,
134   - `subCount` int(11) DEFAULT '0',
135   - PRIMARY KEY (`id`),
136   - UNIQUE KEY `device_channel_id_uindex` (`id`),
137   - UNIQUE KEY `device_channel_pk` (`channelId`,`deviceId`)
138   -) ENGINE=InnoDB AUTO_INCREMENT=81657 DEFAULT CHARSET=utf8mb4;
  104 + `id` int NOT NULL AUTO_INCREMENT,
  105 + `channelId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  106 + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  107 + `manufacture` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  108 + `model` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  109 + `owner` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  110 + `civilCode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  111 + `block` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  112 + `address` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  113 + `parentId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  114 + `safetyWay` int DEFAULT NULL,
  115 + `registerWay` int DEFAULT NULL,
  116 + `certNum` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  117 + `certifiable` int DEFAULT NULL,
  118 + `errCode` int DEFAULT NULL,
  119 + `endTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  120 + `secrecy` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  121 + `ipAddress` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  122 + `port` int DEFAULT NULL,
  123 + `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  124 + `PTZType` int DEFAULT NULL,
  125 + `status` int DEFAULT NULL,
  126 + `longitude` double DEFAULT NULL,
  127 + `latitude` double DEFAULT NULL,
  128 + `streamId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  129 + `deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  130 + `parental` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  131 + `hasAudio` bit(1) DEFAULT NULL,
  132 + `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  133 + `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  134 + `subCount` int DEFAULT '0',
  135 + `longitudeGcj02` double DEFAULT NULL,
  136 + `latitudeGcj02` double DEFAULT NULL,
  137 + `longitudeWgs84` double DEFAULT NULL,
  138 + `latitudeWgs84` double DEFAULT NULL,
  139 + `businessGroupId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  140 + PRIMARY KEY (`id`) USING BTREE,
  141 + UNIQUE KEY `device_channel_id_uindex` (`id`) USING BTREE,
  142 + UNIQUE KEY `device_channel_pk` (`channelId`,`deviceId`) USING BTREE
  143 +) ENGINE=InnoDB AUTO_INCREMENT=19314 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
139 144 /*!40101 SET character_set_client = @saved_cs_client */;
140 145  
141 146 --
... ... @@ -153,24 +158,24 @@ UNLOCK TABLES;
153 158  
154 159 DROP TABLE IF EXISTS `device_mobile_position`;
155 160 /*!40101 SET @saved_cs_client = @@character_set_client */;
156   -/*!40101 SET character_set_client = utf8 */;
  161 +/*!50503 SET character_set_client = utf8mb4 */;
157 162 CREATE TABLE `device_mobile_position` (
158   - `id` int(11) NOT NULL AUTO_INCREMENT,
159   - `deviceId` varchar(50) NOT NULL,
160   - `channelId` varchar(50) NOT NULL,
161   - `deviceName` varchar(255) DEFAULT NULL,
162   - `time` varchar(50) NOT NULL,
163   - `longitude` double NOT NULL,
164   - `latitude` double NOT NULL,
165   - `altitude` double DEFAULT NULL,
166   - `speed` double DEFAULT NULL,
167   - `direction` double DEFAULT NULL,
168   - `reportSource` varchar(50) DEFAULT NULL,
169   - `geodeticSystem` varchar(50) DEFAULT NULL,
170   - `cnLng` varchar(50) DEFAULT NULL,
171   - `cnLat` varchar(50) DEFAULT NULL,
172   - PRIMARY KEY (`id`)
173   -) ENGINE=InnoDB AUTO_INCREMENT=6108 DEFAULT CHARSET=utf8mb4;
  163 + `id` int NOT NULL AUTO_INCREMENT,
  164 + `deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  165 + `channelId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  166 + `deviceName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  167 + `time` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  168 + `longitude` double NOT NULL,
  169 + `latitude` double NOT NULL,
  170 + `altitude` double DEFAULT NULL,
  171 + `speed` double DEFAULT NULL,
  172 + `direction` double DEFAULT NULL,
  173 + `reportSource` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  174 + `geodeticSystem` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  175 + `cnLng` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  176 + `cnLat` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  177 + PRIMARY KEY (`id`) USING BTREE
  178 +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
174 179 /*!40101 SET character_set_client = @saved_cs_client */;
175 180  
176 181 --
... ... @@ -188,23 +193,23 @@ UNLOCK TABLES;
188 193  
189 194 DROP TABLE IF EXISTS `gb_stream`;
190 195 /*!40101 SET @saved_cs_client = @@character_set_client */;
191   -/*!40101 SET character_set_client = utf8 */;
  196 +/*!50503 SET character_set_client = utf8mb4 */;
192 197 CREATE TABLE `gb_stream` (
193   - `gbStreamId` int(11) NOT NULL AUTO_INCREMENT,
194   - `app` varchar(255) NOT NULL,
195   - `stream` varchar(255) NOT NULL,
196   - `gbId` varchar(50) NOT NULL,
197   - `name` varchar(255) DEFAULT NULL,
198   - `longitude` double DEFAULT NULL,
199   - `latitude` double DEFAULT NULL,
200   - `streamType` varchar(50) DEFAULT NULL,
201   - `mediaServerId` varchar(50) DEFAULT NULL,
202   - `status` int(11) DEFAULT NULL,
203   - `createStamp` bigint(20) DEFAULT NULL,
204   - PRIMARY KEY (`gbStreamId`) USING BTREE,
205   - UNIQUE KEY `app` (`app`,`stream`) USING BTREE,
206   - UNIQUE KEY `gbId` (`gbId`) USING BTREE
207   -) ENGINE=InnoDB AUTO_INCREMENT=300769 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  198 + `gbStreamId` int NOT NULL AUTO_INCREMENT,
  199 + `app` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  200 + `stream` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  201 + `gbId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  202 + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  203 + `longitude` double DEFAULT NULL,
  204 + `latitude` double DEFAULT NULL,
  205 + `streamType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  206 + `mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  207 + `status` int DEFAULT NULL,
  208 + `createStamp` bigint DEFAULT NULL,
  209 + PRIMARY KEY (`gbStreamId`) USING BTREE,
  210 + UNIQUE KEY `app` (`app`,`stream`) USING BTREE,
  211 + UNIQUE KEY `gbId` (`gbId`) USING BTREE
  212 +) ENGINE=InnoDB AUTO_INCREMENT=301679 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
208 213 /*!40101 SET character_set_client = @saved_cs_client */;
209 214  
210 215 --
... ... @@ -222,19 +227,19 @@ UNLOCK TABLES;
222 227  
223 228 DROP TABLE IF EXISTS `log`;
224 229 /*!40101 SET @saved_cs_client = @@character_set_client */;
225   -/*!40101 SET character_set_client = utf8 */;
  230 +/*!50503 SET character_set_client = utf8mb4 */;
226 231 CREATE TABLE `log` (
227   - `id` int(11) NOT NULL AUTO_INCREMENT,
228   - `name` varchar(50) NOT NULL,
229   - `type` varchar(50) NOT NULL,
230   - `uri` varchar(200) NOT NULL,
231   - `address` varchar(50) NOT NULL,
232   - `result` varchar(50) NOT NULL,
233   - `timing` bigint(20) NOT NULL,
234   - `username` varchar(50) NOT NULL,
235   - `createTime` varchar(50) NOT NULL,
236   - PRIMARY KEY (`id`) USING BTREE
237   -) ENGINE=InnoDB AUTO_INCREMENT=1552 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  232 + `id` int NOT NULL AUTO_INCREMENT,
  233 + `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  234 + `type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  235 + `uri` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  236 + `address` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  237 + `result` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  238 + `timing` bigint NOT NULL,
  239 + `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  240 + `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  241 + PRIMARY KEY (`id`) USING BTREE
  242 +) ENGINE=InnoDB AUTO_INCREMENT=21611 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
238 243 /*!40101 SET character_set_client = @saved_cs_client */;
239 244  
240 245 --
... ... @@ -252,34 +257,34 @@ UNLOCK TABLES;
252 257  
253 258 DROP TABLE IF EXISTS `media_server`;
254 259 /*!40101 SET @saved_cs_client = @@character_set_client */;
255   -/*!40101 SET character_set_client = utf8 */;
  260 +/*!50503 SET character_set_client = utf8mb4 */;
256 261 CREATE TABLE `media_server` (
257   - `id` varchar(255) NOT NULL,
258   - `ip` varchar(50) NOT NULL,
259   - `hookIp` varchar(50) NOT NULL,
260   - `sdpIp` varchar(50) NOT NULL,
261   - `streamIp` varchar(50) NOT NULL,
262   - `httpPort` int(11) NOT NULL,
263   - `httpSSlPort` int(11) NOT NULL,
264   - `rtmpPort` int(11) NOT NULL,
265   - `rtmpSSlPort` int(11) NOT NULL,
266   - `rtpProxyPort` int(11) NOT NULL,
267   - `rtspPort` int(11) NOT NULL,
268   - `rtspSSLPort` int(11) NOT NULL,
269   - `autoConfig` int(11) NOT NULL,
270   - `secret` varchar(50) NOT NULL,
271   - `streamNoneReaderDelayMS` int(11) NOT NULL,
272   - `rtpEnable` int(11) NOT NULL,
273   - `rtpPortRange` varchar(50) NOT NULL,
274   - `sendRtpPortRange` varchar(50) NOT NULL,
275   - `recordAssistPort` int(11) NOT NULL,
276   - `defaultServer` int(11) NOT NULL,
277   - `createTime` varchar(50) NOT NULL,
278   - `updateTime` varchar(50) NOT NULL,
279   - `hookAliveInterval` int(11) NOT NULL,
280   - PRIMARY KEY (`id`) USING BTREE,
281   - UNIQUE KEY `media_server_i` (`ip`,`httpPort`) USING BTREE
282   -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  262 + `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  263 + `ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  264 + `hookIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  265 + `sdpIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  266 + `streamIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  267 + `httpPort` int NOT NULL,
  268 + `httpSSlPort` int NOT NULL,
  269 + `rtmpPort` int NOT NULL,
  270 + `rtmpSSlPort` int NOT NULL,
  271 + `rtpProxyPort` int NOT NULL,
  272 + `rtspPort` int NOT NULL,
  273 + `rtspSSLPort` int NOT NULL,
  274 + `autoConfig` int NOT NULL,
  275 + `secret` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  276 + `streamNoneReaderDelayMS` int NOT NULL,
  277 + `rtpEnable` int NOT NULL,
  278 + `rtpPortRange` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  279 + `sendRtpPortRange` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  280 + `recordAssistPort` int NOT NULL,
  281 + `defaultServer` int NOT NULL,
  282 + `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  283 + `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  284 + `hookAliveInterval` int NOT NULL,
  285 + PRIMARY KEY (`id`) USING BTREE,
  286 + UNIQUE KEY `media_server_i` (`ip`,`httpPort`) USING BTREE
  287 +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
283 288 /*!40101 SET character_set_client = @saved_cs_client */;
284 289  
285 290 --
... ... @@ -297,36 +302,36 @@ UNLOCK TABLES;
297 302  
298 303 DROP TABLE IF EXISTS `parent_platform`;
299 304 /*!40101 SET @saved_cs_client = @@character_set_client */;
300   -/*!40101 SET character_set_client = utf8 */;
  305 +/*!50503 SET character_set_client = utf8mb4 */;
301 306 CREATE TABLE `parent_platform` (
302   - `id` int(11) NOT NULL AUTO_INCREMENT,
303   - `enable` int(11) DEFAULT NULL,
304   - `name` varchar(255) DEFAULT NULL,
305   - `serverGBId` varchar(50) NOT NULL,
306   - `serverGBDomain` varchar(50) DEFAULT NULL,
307   - `serverIP` varchar(50) DEFAULT NULL,
308   - `serverPort` int(11) DEFAULT NULL,
309   - `deviceGBId` varchar(50) NOT NULL,
310   - `deviceIp` varchar(50) DEFAULT NULL,
311   - `devicePort` varchar(50) DEFAULT NULL,
312   - `username` varchar(255) DEFAULT NULL,
313   - `password` varchar(50) DEFAULT NULL,
314   - `expires` varchar(50) DEFAULT NULL,
315   - `keepTimeout` varchar(50) DEFAULT NULL,
316   - `transport` varchar(50) DEFAULT NULL,
317   - `characterSet` varchar(50) DEFAULT NULL,
318   - `catalogId` varchar(50) NOT NULL,
319   - `ptz` int(11) DEFAULT NULL,
320   - `rtcp` int(11) DEFAULT NULL,
321   - `status` bit(1) DEFAULT NULL,
322   - `shareAllLiveStream` int(11) DEFAULT NULL,
323   - `startOfflinePush` int(11) DEFAULT '0',
324   - `administrativeDivision` varchar(50) NOT NULL,
325   - `catalogGroup` int(11) DEFAULT '1',
326   - PRIMARY KEY (`id`),
327   - UNIQUE KEY `parent_platform_id_uindex` (`id`),
328   - UNIQUE KEY `parent_platform_pk` (`serverGBId`)
329   -) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  307 + `id` int NOT NULL AUTO_INCREMENT,
  308 + `enable` int DEFAULT NULL,
  309 + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  310 + `serverGBId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  311 + `serverGBDomain` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  312 + `serverIP` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  313 + `serverPort` int DEFAULT NULL,
  314 + `deviceGBId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  315 + `deviceIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  316 + `devicePort` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  317 + `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  318 + `password` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  319 + `expires` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  320 + `keepTimeout` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  321 + `transport` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  322 + `characterSet` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  323 + `catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  324 + `ptz` int DEFAULT NULL,
  325 + `rtcp` int DEFAULT NULL,
  326 + `status` bit(1) DEFAULT NULL,
  327 + `shareAllLiveStream` int DEFAULT NULL,
  328 + `startOfflinePush` int DEFAULT '0',
  329 + `administrativeDivision` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  330 + `catalogGroup` int DEFAULT '1',
  331 + PRIMARY KEY (`id`) USING BTREE,
  332 + UNIQUE KEY `parent_platform_id_uindex` (`id`) USING BTREE,
  333 + UNIQUE KEY `parent_platform_pk` (`serverGBId`) USING BTREE
  334 +) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
330 335 /*!40101 SET character_set_client = @saved_cs_client */;
331 336  
332 337 --
... ... @@ -344,14 +349,14 @@ UNLOCK TABLES;
344 349  
345 350 DROP TABLE IF EXISTS `platform_catalog`;
346 351 /*!40101 SET @saved_cs_client = @@character_set_client */;
347   -/*!40101 SET character_set_client = utf8 */;
  352 +/*!50503 SET character_set_client = utf8mb4 */;
348 353 CREATE TABLE `platform_catalog` (
349   - `id` varchar(50) NOT NULL,
350   - `platformId` varchar(50) NOT NULL,
351   - `name` varchar(255) NOT NULL,
352   - `parentId` varchar(50) DEFAULT NULL,
353   - PRIMARY KEY (`id`) USING BTREE
354   -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  354 + `id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  355 + `platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  356 + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  357 + `parentId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  358 + PRIMARY KEY (`id`) USING BTREE
  359 +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
355 360 /*!40101 SET character_set_client = @saved_cs_client */;
356 361  
357 362 --
... ... @@ -369,14 +374,14 @@ UNLOCK TABLES;
369 374  
370 375 DROP TABLE IF EXISTS `platform_gb_channel`;
371 376 /*!40101 SET @saved_cs_client = @@character_set_client */;
372   -/*!40101 SET character_set_client = utf8 */;
  377 +/*!50503 SET character_set_client = utf8mb4 */;
373 378 CREATE TABLE `platform_gb_channel` (
374   - `id` int(11) NOT NULL AUTO_INCREMENT,
375   - `platformId` varchar(50) NOT NULL,
376   - `catalogId` varchar(50) NOT NULL,
377   - `deviceChannelId` int(11) NOT NULL,
378   - PRIMARY KEY (`id`)
379   -) ENGINE=InnoDB AUTO_INCREMENT=250 DEFAULT CHARSET=utf8mb4;
  379 + `id` int NOT NULL AUTO_INCREMENT,
  380 + `platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  381 + `catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  382 + `deviceChannelId` int NOT NULL,
  383 + PRIMARY KEY (`id`) USING BTREE
  384 +) ENGINE=InnoDB AUTO_INCREMENT=4889 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
380 385 /*!40101 SET character_set_client = @saved_cs_client */;
381 386  
382 387 --
... ... @@ -394,15 +399,15 @@ UNLOCK TABLES;
394 399  
395 400 DROP TABLE IF EXISTS `platform_gb_stream`;
396 401 /*!40101 SET @saved_cs_client = @@character_set_client */;
397   -/*!40101 SET character_set_client = utf8 */;
  402 +/*!50503 SET character_set_client = utf8mb4 */;
398 403 CREATE TABLE `platform_gb_stream` (
399   - `platformId` varchar(50) NOT NULL,
400   - `catalogId` varchar(50) NOT NULL,
401   - `gbStreamId` int(11) NOT NULL,
402   - `id` int(11) NOT NULL AUTO_INCREMENT,
403   - PRIMARY KEY (`id`),
404   - UNIQUE KEY `platform_gb_stream_pk` (`platformId`,`catalogId`,`gbStreamId`)
405   -) ENGINE=InnoDB AUTO_INCREMENT=301210 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  404 + `platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  405 + `catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  406 + `gbStreamId` int NOT NULL,
  407 + `id` int NOT NULL AUTO_INCREMENT,
  408 + PRIMARY KEY (`id`) USING BTREE,
  409 + UNIQUE KEY `platform_gb_stream_pk` (`platformId`,`catalogId`,`gbStreamId`) USING BTREE
  410 +) ENGINE=InnoDB AUTO_INCREMENT=302077 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
406 411 /*!40101 SET character_set_client = @saved_cs_client */;
407 412  
408 413 --
... ... @@ -420,29 +425,29 @@ UNLOCK TABLES;
420 425  
421 426 DROP TABLE IF EXISTS `stream_proxy`;
422 427 /*!40101 SET @saved_cs_client = @@character_set_client */;
423   -/*!40101 SET character_set_client = utf8 */;
  428 +/*!50503 SET character_set_client = utf8mb4 */;
424 429 CREATE TABLE `stream_proxy` (
425   - `id` int(11) NOT NULL AUTO_INCREMENT,
426   - `type` varchar(50) NOT NULL,
427   - `app` varchar(255) NOT NULL,
428   - `stream` varchar(255) NOT NULL,
429   - `url` varchar(255) DEFAULT NULL,
430   - `src_url` varchar(255) DEFAULT NULL,
431   - `dst_url` varchar(255) DEFAULT NULL,
432   - `timeout_ms` int(11) DEFAULT NULL,
433   - `ffmpeg_cmd_key` varchar(255) DEFAULT NULL,
434   - `rtp_type` varchar(50) DEFAULT NULL,
435   - `mediaServerId` varchar(50) DEFAULT NULL,
436   - `enable_hls` bit(1) DEFAULT NULL,
437   - `enable_mp4` bit(1) DEFAULT NULL,
438   - `enable` bit(1) NOT NULL,
439   - `status` bit(1) NOT NULL,
440   - `enable_remove_none_reader` bit(1) NOT NULL,
441   - `createTime` varchar(50) NOT NULL,
442   - `name` varchar(255) DEFAULT NULL,
443   - PRIMARY KEY (`id`),
444   - UNIQUE KEY `stream_proxy_pk` (`app`,`stream`)
445   -) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4;
  430 + `id` int NOT NULL AUTO_INCREMENT,
  431 + `type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  432 + `app` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  433 + `stream` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  434 + `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  435 + `src_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  436 + `dst_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  437 + `timeout_ms` int DEFAULT NULL,
  438 + `ffmpeg_cmd_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  439 + `rtp_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  440 + `mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  441 + `enable_hls` bit(1) DEFAULT NULL,
  442 + `enable_mp4` bit(1) DEFAULT NULL,
  443 + `enable` bit(1) NOT NULL,
  444 + `status` bit(1) NOT NULL,
  445 + `enable_remove_none_reader` bit(1) NOT NULL,
  446 + `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  447 + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  448 + PRIMARY KEY (`id`) USING BTREE,
  449 + UNIQUE KEY `stream_proxy_pk` (`app`,`stream`) USING BTREE
  450 +) ENGINE=InnoDB AUTO_INCREMENT=61 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
446 451 /*!40101 SET character_set_client = @saved_cs_client */;
447 452  
448 453 --
... ... @@ -460,21 +465,21 @@ UNLOCK TABLES;
460 465  
461 466 DROP TABLE IF EXISTS `stream_push`;
462 467 /*!40101 SET @saved_cs_client = @@character_set_client */;
463   -/*!40101 SET character_set_client = utf8 */;
  468 +/*!50503 SET character_set_client = utf8mb4 */;
464 469 CREATE TABLE `stream_push` (
465   - `id` int(11) NOT NULL AUTO_INCREMENT,
466   - `app` varchar(255) NOT NULL,
467   - `stream` varchar(255) NOT NULL,
468   - `totalReaderCount` varchar(50) DEFAULT NULL,
469   - `originType` int(11) DEFAULT NULL,
470   - `originTypeStr` varchar(50) DEFAULT NULL,
471   - `createStamp` bigint(20) DEFAULT NULL,
472   - `aliveSecond` int(11) DEFAULT NULL,
473   - `mediaServerId` varchar(50) DEFAULT NULL,
474   - `serverId` varchar(50) not NULL,
475   - PRIMARY KEY (`id`),
476   - UNIQUE KEY `stream_push_pk` (`app`,`stream`)
477   -) ENGINE=InnoDB AUTO_INCREMENT=300838 DEFAULT CHARSET=utf8mb4;
  470 + `id` int NOT NULL AUTO_INCREMENT,
  471 + `app` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  472 + `stream` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  473 + `totalReaderCount` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  474 + `originType` int DEFAULT NULL,
  475 + `originTypeStr` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  476 + `createStamp` bigint DEFAULT NULL,
  477 + `aliveSecond` int DEFAULT NULL,
  478 + `mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  479 + `serverId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  480 + PRIMARY KEY (`id`) USING BTREE,
  481 + UNIQUE KEY `stream_push_pk` (`app`,`stream`) USING BTREE
  482 +) ENGINE=InnoDB AUTO_INCREMENT=305291 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
478 483 /*!40101 SET character_set_client = @saved_cs_client */;
479 484  
480 485 --
... ... @@ -492,17 +497,17 @@ UNLOCK TABLES;
492 497  
493 498 DROP TABLE IF EXISTS `user`;
494 499 /*!40101 SET @saved_cs_client = @@character_set_client */;
495   -/*!40101 SET character_set_client = utf8 */;
  500 +/*!50503 SET character_set_client = utf8mb4 */;
496 501 CREATE TABLE `user` (
497   - `id` int(11) NOT NULL AUTO_INCREMENT,
498   - `username` varchar(255) NOT NULL,
499   - `password` varchar(255) NOT NULL,
500   - `roleId` int(11) NOT NULL,
501   - `createTime` varchar(50) NOT NULL,
502   - `updateTime` varchar(50) NOT NULL,
503   - PRIMARY KEY (`id`) USING BTREE,
504   - UNIQUE KEY `user_username_uindex` (`username`) USING BTREE
505   -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  502 + `id` int NOT NULL AUTO_INCREMENT,
  503 + `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  504 + `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  505 + `roleId` int NOT NULL,
  506 + `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  507 + `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  508 + PRIMARY KEY (`id`) USING BTREE,
  509 + UNIQUE KEY `user_username_uindex` (`username`) USING BTREE
  510 +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
506 511 /*!40101 SET character_set_client = @saved_cs_client */;
507 512  
508 513 --
... ... @@ -511,8 +516,7 @@ CREATE TABLE `user` (
511 516  
512 517 LOCK TABLES `user` WRITE;
513 518 /*!40000 ALTER TABLE `user` DISABLE KEYS */;
514   -INSERT INTO `user` VALUES
515   - (1,'admin','21232f297a57a5a743894a0e4a801fc3',1,'2021 - 04 - 13 14:14:57','2021 - 04 - 13 14:14:57');
  519 +INSERT INTO `user` VALUES (1,'admin','21232f297a57a5a743894a0e4a801fc3',1,'2021 - 04 - 13 14:14:57','2021 - 04 - 13 14:14:57');
516 520 /*!40000 ALTER TABLE `user` ENABLE KEYS */;
517 521 UNLOCK TABLES;
518 522  
... ... @@ -522,15 +526,15 @@ UNLOCK TABLES;
522 526  
523 527 DROP TABLE IF EXISTS `user_role`;
524 528 /*!40101 SET @saved_cs_client = @@character_set_client */;
525   -/*!40101 SET character_set_client = utf8 */;
  529 +/*!50503 SET character_set_client = utf8mb4 */;
526 530 CREATE TABLE `user_role` (
527   - `id` int(11) NOT NULL AUTO_INCREMENT,
528   - `name` varchar(50) NOT NULL,
529   - `authority` varchar(50) NOT NULL,
530   - `createTime` varchar(50) NOT NULL,
531   - `updateTime` varchar(50) NOT NULL,
532   - PRIMARY KEY (`id`) USING BTREE
533   -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  531 + `id` int NOT NULL AUTO_INCREMENT,
  532 + `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  533 + `authority` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  534 + `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  535 + `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  536 + PRIMARY KEY (`id`) USING BTREE
  537 +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
534 538 /*!40101 SET character_set_client = @saved_cs_client */;
535 539  
536 540 --
... ... @@ -539,8 +543,7 @@ CREATE TABLE `user_role` (
539 543  
540 544 LOCK TABLES `user_role` WRITE;
541 545 /*!40000 ALTER TABLE `user_role` DISABLE KEYS */;
542   -INSERT INTO `user_role` VALUES
543   - (1,'admin','0','2021-04-13 14:14:57','2021-04-13 14:14:57');
  546 +INSERT INTO `user_role` VALUES (1,'admin','0','2021-04-13 14:14:57','2021-04-13 14:14:57');
544 547 /*!40000 ALTER TABLE `user_role` ENABLE KEYS */;
545 548 UNLOCK TABLES;
546 549 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
... ... @@ -553,4 +556,4 @@ UNLOCK TABLES;
553 556 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
554 557 /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
555 558  
556   --- Dump completed on 2022-04-18 10:50:27
  559 +-- Dump completed on 2022-06-26 17:33:30
... ...
sql/update.sql
... ... @@ -17,7 +17,10 @@ alter table stream_push
17 17 add serverId varchar(50) not null;
18 18 alter table device
19 19 add geoCoordSys varchar(50) not null;
  20 +alter table device
  21 + add treeType varchar(50) not null;
20 22 update device set device.geoCoordSys='WGS84';
  23 +update device set device.treeType='CivilCode';
21 24 alter table device_channel
22 25 add longitudeGcj02 double default null;
23 26 alter table device_channel
... ... @@ -26,4 +29,6 @@ alter table device_channel
26 29 add longitudeWgs84 double default null;
27 30 alter table device_channel
28 31 add latitudeWgs84 double default null;
  32 +alter table device_channel
  33 + add businessGroupId varchar(50) default null;
29 34  
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/bean/ChannelIdType.java 0 โ†’ 100644
  1 +package com.genersoft.iot.vmp.gb28181.bean;
  2 +
  3 +/**
  4 + * ๅ›ฝๆ ‡็ฑปๅž‹็ผ–็ ,ๅ›ฝๆ ‡็ผ–็ ไธญ11-13ไฝไธบ็ฑปๅž‹็ผ–็ 
  5 + * ่ฏฆ่ง ้™„ ๅฝ• D ็ผ–็ ่ง„ๅˆ™ A
  6 + * @author lin
  7 + */
  8 +public class ChannelIdType {
  9 + /**
  10 + * ไธญๅฟƒไฟกไปคๆŽงๅˆถๆœๅŠกๅ™จ็ผ–็ 
  11 + */
  12 + public final static String CENTRAL_SIGNALING_CONTROL_SERVER = "200";
  13 +
  14 + /**
  15 + * ไธšๅŠกๅˆ†็ป„็ผ–็ 
  16 + */
  17 + public final static String BUSINESS_GROUP = "215";
  18 +
  19 + /**
  20 + * ่™šๆ‹Ÿ็ป„็ป‡็ผ–็ 
  21 + */
  22 + public final static String VIRTUAL_ORGANIZATION = "216";
  23 +}
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/bean/Device.java
... ... @@ -138,6 +138,11 @@ public class Device {
138 138 */
139 139 private String geoCoordSys;
140 140  
  141 + /**
  142 + * ๆ ‘็ฑปๅž‹ ๅ›ฝๆ ‡่ง„ๅฎšไบ†ไธค็งๆ ‘็š„ๅฑ•็Žฐๆ–นๅผ ่กŒๆ”ฟๅŒบๅˆ’๏ผšCivilCode ๅ’ŒไธšๅŠกๅˆ†็ป„:BusinessGroup
  143 + */
  144 + private String treeType;
  145 +
141 146  
142 147 public String getDeviceId() {
143 148 return deviceId;
... ... @@ -339,4 +344,12 @@ public class Device {
339 344 this.geoCoordSys = geoCoordSys;
340 345 }
341 346  
  347 +
  348 + public String getTreeType() {
  349 + return treeType;
  350 + }
  351 +
  352 + public void setTreeType(String treeType) {
  353 + this.treeType = treeType;
  354 + }
342 355 }
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannel.java
... ... @@ -194,6 +194,11 @@ public class DeviceChannel {
194 194 */
195 195 private int channelType;
196 196  
  197 + /**
  198 + * ไธšๅŠกๅˆ†็ป„
  199 + */
  200 + private String businessGroupId;
  201 +
197 202 public int getId() {
198 203 return id;
199 204 }
... ... @@ -506,4 +511,12 @@ public class DeviceChannel {
506 511 public void setChannelType(int channelType) {
507 512 this.channelType = channelType;
508 513 }
  514 +
  515 + public String getBusinessGroupId() {
  516 + return businessGroupId;
  517 + }
  518 +
  519 + public void setBusinessGroupId(String businessGroupId) {
  520 + this.businessGroupId = businessGroupId;
  521 + }
509 522 }
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java
... ... @@ -406,7 +406,10 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
406 406 if (parentPlatform == null) {
407 407 return false;
408 408 }
409   - logger.info("[ๅ‘้€ ็งปๅŠจไฝ็ฝฎ่ฎข้˜…] {}/{}->{},{}", parentPlatform.getServerGBId(), gpsMsgInfo.getId(), gpsMsgInfo.getLng(), gpsMsgInfo.getLat());
  409 + if (logger.isDebugEnabled()) {
  410 + logger.debug("[ๅ‘้€ ็งปๅŠจไฝ็ฝฎ่ฎข้˜…] {}/{}->{},{}", parentPlatform.getServerGBId(), gpsMsgInfo.getId(), gpsMsgInfo.getLng(), gpsMsgInfo.getLat());
  411 + }
  412 +
410 413 try {
411 414 String characterSet = parentPlatform.getCharacterSet();
412 415 StringBuffer deviceStatusXml = new StringBuffer(600);
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java
... ... @@ -141,6 +141,7 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen
141 141 device.setStreamMode("UDP");
142 142 device.setCharset("GB2312");
143 143 device.setGeoCoordSys("WGS84");
  144 + device.setTreeType("CivilCode");
144 145 device.setDeviceId(deviceId);
145 146 }
146 147 device.setIp(received);
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java
... ... @@ -249,23 +249,26 @@ public class XmlUtil {
249 249 }else {
250 250 deviceChannel.setParentId(parentId);
251 251 }
252   - }else {
253   - if (deviceChannel.getChannelId().length() <= 10) { // ๆญคๆ—ถไธบ่กŒๆ”ฟๅŒบๅˆ’, ไธŠไธ‹็บง่กŒๆ”ฟๅŒบๅˆ’ไฝฟ็”จDeviceIdๅ…ณ่”
254   - deviceChannel.setParentId(deviceChannel.getChannelId().substring(0, deviceChannel.getChannelId().length() - 2));
255   - }else if (deviceChannel.getChannelId().length() == 20) {
256   - if (Integer.parseInt(deviceChannel.getChannelId().substring(10, 13)) == 216) { // ่™šๆ‹Ÿ็ป„็ป‡
257   - deviceChannel.setParentId(businessGroupID);
258   - }else if (Integer.parseInt(device.getDeviceId().substring(10, 13) )== 118) {//NVR ๅฆ‚ๆžœไธŠ็บง่ฎพๅค‡็ผ–ๅทๆ˜ฏNVRๅˆ™็›ดๆŽฅๅฐ†NVR็š„็ผ–ๅท่ฎพ็ฝฎ็ป™้€š้“็š„ไธŠ็บง็ผ–ๅท
259   - deviceChannel.setParentId(device.getDeviceId());
260   - }else if (deviceChannel.getCivilCode() != null) {
261   - // ่ฎพๅค‡๏ผŒ ๆ— parentId็š„20ไฝๆ˜ฏไฝฟ็”จCivilCode่กจ็คบไธŠ็บง็š„่ฎพๅค‡๏ผŒ
262   - // ๆณจ๏ผš215 ไธšๅŠกๅˆ†็ป„ๆ˜ฏ้œ€่ฆๆœ‰parentId็š„
263   - deviceChannel.setParentId(deviceChannel.getCivilCode());
264   - }
265   - }else {
266   - deviceChannel.setParentId(deviceChannel.getDeviceId());
267   - }
268 252 }
  253 + deviceChannel.setBusinessGroupId(businessGroupID);
  254 +
  255 +// else {
  256 +// if (deviceChannel.getChannelId().length() <= 10) { // ๆญคๆ—ถไธบ่กŒๆ”ฟๅŒบๅˆ’, ไธŠไธ‹็บง่กŒๆ”ฟๅŒบๅˆ’ไฝฟ็”จDeviceIdๅ…ณ่”
  257 +// deviceChannel.setParentId(deviceChannel.getChannelId().substring(0, deviceChannel.getChannelId().length() - 2));
  258 +// }else if (deviceChannel.getChannelId().length() == 20) {
  259 +// if (Integer.parseInt(deviceChannel.getChannelId().substring(10, 13)) == 216) { // ่™šๆ‹Ÿ็ป„็ป‡
  260 +// deviceChannel.setBusinessGroupId(businessGroupID);
  261 +// }else if (Integer.parseInt(device.getDeviceId().substring(10, 13) )== 118) {//NVR ๅฆ‚ๆžœไธŠ็บง่ฎพๅค‡็ผ–ๅทๆ˜ฏNVRๅˆ™็›ดๆŽฅๅฐ†NVR็š„็ผ–ๅท่ฎพ็ฝฎ็ป™้€š้“็š„ไธŠ็บง็ผ–ๅท
  262 +// deviceChannel.setParentId(device.getDeviceId());
  263 +// }else if (deviceChannel.getCivilCode() != null) {
  264 +// // ่ฎพๅค‡๏ผŒ ๆ— parentId็š„20ไฝๆ˜ฏไฝฟ็”จCivilCode่กจ็คบไธŠ็บง็š„่ฎพๅค‡๏ผŒ
  265 +// // ๆณจ๏ผš215 ไธšๅŠกๅˆ†็ป„ๆ˜ฏ้œ€่ฆๆœ‰parentId็š„
  266 +// deviceChannel.setParentId(deviceChannel.getCivilCode());
  267 +// }
  268 +// }else {
  269 +// deviceChannel.setParentId(deviceChannel.getDeviceId());
  270 +// }
  271 +// }
269 272  
270 273 if (XmlUtil.getText(itemDevice, "SafetyWay") == null
271 274 || XmlUtil.getText(itemDevice, "SafetyWay") == "") {
... ...
src/main/java/com/genersoft/iot/vmp/service/IDeviceService.java
1 1 package com.genersoft.iot.vmp.service;
2 2  
3 3 import com.genersoft.iot.vmp.gb28181.bean.Device;
  4 +import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
4 5 import com.genersoft.iot.vmp.gb28181.bean.SyncStatus;
  6 +import com.genersoft.iot.vmp.vmanager.bean.BaseTree;
5 7  
6 8 import java.util.List;
7 9  
... ... @@ -110,4 +112,21 @@ public interface IDeviceService {
110 112 * @param device ่ฎพๅค‡ไฟกๆฏ
111 113 */
112 114 void updateDevice(Device device);
  115 +
  116 + /**
  117 + * ๆ ‘ๅฝขๆŸฅ่ฏขๆŽฅๅฃ
  118 + * @param deviceId ่ฎพๅค‡ID
  119 + * @param parentId ็ˆถID
  120 + * @param onlyCatalog ๅช่Žทๅ–็›ฎๅฝ•
  121 + * @return
  122 + */
  123 + List<BaseTree<DeviceChannel>> queryVideoDeviceTree(String deviceId, String parentId, boolean onlyCatalog);
  124 +
  125 + /**
  126 + * ๆŸฅ่ฏขๆ ‘่Š‚็‚นไธ‹็š„้€š้“
  127 + * @param deviceId ่ฎพๅค‡ID
  128 + * @param parentId ็ˆถID
  129 + * @return
  130 + */
  131 + List<DeviceChannel> queryVideoDeviceInTreeNode(String deviceId, String parentId);
113 132 }
... ...
src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java
1 1 package com.genersoft.iot.vmp.service.impl;
2 2  
3 3 import com.genersoft.iot.vmp.conf.DynamicTask;
4   -import com.genersoft.iot.vmp.gb28181.bean.Device;
5   -import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
6   -import com.genersoft.iot.vmp.gb28181.bean.SsrcTransaction;
  4 +import com.genersoft.iot.vmp.gb28181.bean.*;
7 5 import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
8 6 import com.genersoft.iot.vmp.gb28181.task.ISubscribeTask;
9 7 import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander;
... ... @@ -12,20 +10,23 @@ import com.genersoft.iot.vmp.gb28181.utils.Coordtransform;
12 10 import com.genersoft.iot.vmp.service.IDeviceService;
13 11 import com.genersoft.iot.vmp.gb28181.task.impl.CatalogSubscribeTask;
14 12 import com.genersoft.iot.vmp.gb28181.task.impl.MobilePositionSubscribeTask;
15   -import com.genersoft.iot.vmp.gb28181.bean.SyncStatus;
16 13 import com.genersoft.iot.vmp.service.IMediaServerService;
17 14 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
18 15 import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
19 16 import com.genersoft.iot.vmp.storager.dao.DeviceChannelMapper;
20 17 import com.genersoft.iot.vmp.storager.dao.DeviceMapper;
21 18 import com.genersoft.iot.vmp.utils.DateUtil;
  19 +import com.genersoft.iot.vmp.vmanager.bean.BaseTree;
22 20 import org.slf4j.Logger;
23 21 import org.slf4j.LoggerFactory;
24 22 import org.springframework.beans.factory.annotation.Autowired;
  23 +import org.springframework.jdbc.support.incrementer.AbstractIdentityColumnMaxValueIncrementer;
25 24 import org.springframework.stereotype.Service;
26 25 import org.springframework.util.StringUtils;
27 26  
28 27 import java.time.Instant;
  28 +import java.util.ArrayList;
  29 +import java.util.Collections;
29 30 import java.util.List;
30 31 import java.util.concurrent.TimeUnit;
31 32  
... ... @@ -341,4 +342,180 @@ public class DeviceServiceImpl implements IDeviceService {
341 342 }
342 343 storage.updateChannels(device.getDeviceId(), deviceChannels);
343 344 }
  345 +
  346 +
  347 + @Override
  348 + public List<BaseTree<DeviceChannel>> queryVideoDeviceTree(String deviceId, String parentId, boolean onlyCatalog) {
  349 + Device device = deviceMapper.getDeviceByDeviceId(deviceId);
  350 + if (device == null) {
  351 + return null;
  352 + }
  353 + if (parentId == null || parentId.equals(deviceId)) {
  354 + // ๅญ—ๆ น่Š‚็‚นๅผ€ๅง‹ๆŸฅ่ฏข
  355 + List<DeviceChannel> rootNodes = getRootNodes(deviceId, "CivilCode".equals(device.getTreeType()), true, !onlyCatalog);
  356 + return transportChannelsToTree(rootNodes, "");
  357 + }
  358 +
  359 + if ("CivilCode".equals(device.getTreeType())) {
  360 + if (parentId.length()%2 != 0) {
  361 + return null;
  362 + }
  363 + // ไฝฟ็”จ่กŒๆ”ฟๅŒบๅˆ’ๅฑ•็คบๆ ‘
  364 + if (parentId.length() > 10) {
  365 + // TODO ๅฏ่ƒฝๆ˜ฏ่กŒๆ”ฟๅŒบๅˆ’ไธŽไธšๅŠกๅˆ†็ป„ๆททๆ‚็š„ๆƒ…ๅฝข
  366 + return null;
  367 + }
  368 +
  369 + if (parentId.length() == 10 ) {
  370 + if (onlyCatalog) {
  371 + return null;
  372 + }
  373 + // parentIdไธบ่กŒไธš็ผ–็ ๏ผŒ ๅ…ถไธ‹ไธไผšๅ†ๆœ‰่กŒๆ”ฟๅŒบๅˆ’
  374 + List<DeviceChannel> channels = deviceChannelMapper.getChannelsByCivilCode(deviceId, parentId);
  375 + List<BaseTree<DeviceChannel>> trees = transportChannelsToTree(channels, parentId);
  376 + return trees;
  377 + }
  378 + // ๆŸฅ่ฏขๅ…ถไธ‹็š„่กŒๆ”ฟๅŒบๅˆ’ๅ’Œๆ‘„ๅƒๆœบ
  379 + List<DeviceChannel> channelsForCivilCode = deviceChannelMapper.getChannelsWithCivilCodeAndLength(deviceId, parentId, parentId.length() + 2);
  380 + if (!onlyCatalog) {
  381 + List<DeviceChannel> channels = deviceChannelMapper.getChannelsByCivilCode(deviceId, parentId);
  382 + channelsForCivilCode.addAll(channels);
  383 + }
  384 + List<BaseTree<DeviceChannel>> trees = transportChannelsToTree(channelsForCivilCode, parentId);
  385 + return trees;
  386 +
  387 + }
  388 + // ไฝฟ็”จไธšๅŠกๅˆ†็ป„ๅฑ•็คบๆ ‘
  389 + if ("BusinessGroup".equals(device.getTreeType())) {
  390 + if (parentId.length() < 14 ) {
  391 + return null;
  392 + }
  393 + List<DeviceChannel> deviceChannels = deviceChannelMapper.queryChannels(deviceId, parentId, null, null, null);
  394 + List<BaseTree<DeviceChannel>> trees = transportChannelsToTree(deviceChannels, parentId);
  395 + return trees;
  396 + }
  397 +
  398 + return null;
  399 + }
  400 +
  401 + @Override
  402 + public List<DeviceChannel> queryVideoDeviceInTreeNode(String deviceId, String parentId) {
  403 + Device device = deviceMapper.getDeviceByDeviceId(deviceId);
  404 + if (device == null) {
  405 + return null;
  406 + }
  407 + if (parentId == null || parentId.equals(deviceId)) {
  408 + // ๅญ—ๆ น่Š‚็‚นๅผ€ๅง‹ๆŸฅ่ฏข
  409 + List<DeviceChannel> rootNodes = getRootNodes(deviceId, "CivilCode".equals(device.getTreeType()), false, true);
  410 + return rootNodes;
  411 + }
  412 +
  413 + if ("CivilCode".equals(device.getTreeType())) {
  414 + if (parentId.length()%2 != 0) {
  415 + return null;
  416 + }
  417 + // ไฝฟ็”จ่กŒๆ”ฟๅŒบๅˆ’ๅฑ•็คบๆ ‘
  418 + if (parentId.length() > 10) {
  419 + // TODO ๅฏ่ƒฝๆ˜ฏ่กŒๆ”ฟๅŒบๅˆ’ไธŽไธšๅŠกๅˆ†็ป„ๆททๆ‚็š„ๆƒ…ๅฝข
  420 + return null;
  421 + }
  422 +
  423 + if (parentId.length() == 10 ) {
  424 + // parentIdไธบ่กŒไธš็ผ–็ ๏ผŒ ๅ…ถไธ‹ไธไผšๅ†ๆœ‰่กŒๆ”ฟๅŒบๅˆ’
  425 + List<DeviceChannel> channels = deviceChannelMapper.getChannelsByCivilCode(deviceId, parentId);
  426 + return channels;
  427 + }
  428 + // ๆŸฅ่ฏขๅ…ถไธ‹็š„่กŒๆ”ฟๅŒบๅˆ’ๅ’Œๆ‘„ๅƒๆœบ
  429 + List<DeviceChannel> channels = deviceChannelMapper.getChannelsByCivilCode(deviceId, parentId);
  430 + return channels;
  431 +
  432 + }
  433 + // ไฝฟ็”จไธšๅŠกๅˆ†็ป„ๅฑ•็คบๆ ‘
  434 + if ("BusinessGroup".equals(device.getTreeType())) {
  435 + if (parentId.length() < 14 ) {
  436 + return null;
  437 + }
  438 + List<DeviceChannel> deviceChannels = deviceChannelMapper.queryChannels(deviceId, parentId, null, null, null);
  439 + return deviceChannels;
  440 + }
  441 +
  442 + return null;
  443 + }
  444 +
  445 + private List<BaseTree<DeviceChannel>> transportChannelsToTree(List<DeviceChannel> channels, String parentId) {
  446 + if (channels == null) {
  447 + return null;
  448 + }
  449 + List<BaseTree<DeviceChannel>> treeNotes = new ArrayList<>();
  450 + if (channels.size() == 0) {
  451 + return treeNotes;
  452 + }
  453 + for (DeviceChannel channel : channels) {
  454 +
  455 + BaseTree<DeviceChannel> node = new BaseTree<>();
  456 + node.setId(channel.getChannelId());
  457 + node.setDeviceId(channel.getDeviceId());
  458 + node.setName(channel.getName());
  459 + node.setPid(parentId);
  460 + node.setBasicData(channel);
  461 + node.setParent(false);
  462 + if (channel.getChannelId().length() > 8) {
  463 + String gbCodeType = channel.getChannelId().substring(10, 13);
  464 + node.setParent(gbCodeType.equals(ChannelIdType.BUSINESS_GROUP) || gbCodeType.equals(ChannelIdType.VIRTUAL_ORGANIZATION) );
  465 + }else {
  466 + node.setParent(true);
  467 + }
  468 + treeNotes.add(node);
  469 + }
  470 + Collections.sort(treeNotes);
  471 + return treeNotes;
  472 + }
  473 +
  474 + private List<DeviceChannel> getRootNodes(String deviceId, boolean isCivilCode, boolean haveCatalog, boolean haveChannel) {
  475 + if (!haveCatalog && !haveChannel) {
  476 + return null;
  477 + }
  478 + List<DeviceChannel> result = new ArrayList<>();
  479 + if (isCivilCode) {
  480 + // ไฝฟ็”จ่กŒๆ”ฟๅŒบๅˆ’
  481 + Integer length= deviceChannelMapper.getChannelMinLength(deviceId);
  482 + if (length == null) {
  483 + return null;
  484 + }
  485 + if (length <= 10) {
  486 + if (haveCatalog) {
  487 + List<DeviceChannel> provinceNode = deviceChannelMapper.getChannelsWithCivilCodeAndLength(deviceId, null, length);
  488 + if (provinceNode != null && provinceNode.size() > 0) {
  489 + result.addAll(provinceNode);
  490 + }
  491 + }
  492 +
  493 + if (haveChannel) {
  494 + // ๆŸฅ่ฏข้‚ฃไบ›civilCodeไธๅœจ้€š้“ไธญ็š„ไธ่ง„่Œƒ้€š้“๏ผŒๆ”พ็ฝฎๅœจๆ น็›ฎๅฝ•
  495 + List<DeviceChannel> nonstandardNode = deviceChannelMapper.getChannelWithoutCiviCode(deviceId);
  496 + if (nonstandardNode != null && nonstandardNode.size() > 0) {
  497 + result.addAll(nonstandardNode);
  498 + }
  499 + }
  500 + }else {
  501 + if (haveChannel) {
  502 + List<DeviceChannel> deviceChannels = deviceChannelMapper.queryChannels(deviceId, null, null, null, null);
  503 + if (deviceChannels != null && deviceChannels.size() > 0) {
  504 + result.addAll(deviceChannels);
  505 + }
  506 + }
  507 + }
  508 +
  509 + }else {
  510 + // ไฝฟ็”จไธšๅŠกๅˆ†็ป„+่™šๆ‹Ÿ็ป„็ป‡
  511 +
  512 + // ๅช่Žทๅ–ไธšๅŠกๅˆ†็ป„
  513 + List<DeviceChannel> deviceChannels = deviceChannelMapper.getBusinessGroups(deviceId, ChannelIdType.BUSINESS_GROUP);
  514 + if (deviceChannels != null && deviceChannels.size() > 0) {
  515 + result.addAll(deviceChannels);
  516 + }
  517 + }
  518 + return result;
  519 + }
  520 +
344 521 }
... ...
src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
... ... @@ -142,7 +142,7 @@ public class PlayServiceImpl implements IPlayService {
142 142 result.onCompletion(()->{
143 143 // ็‚นๆ’ญ็ป“ๆŸๆ—ถ่ฐƒ็”จๆˆชๅ›พๆŽฅๅฃ
144 144 // TODO ๅบ”่ฏฅๅœจไธŠๆตๆ—ถ่ฐƒ็”จๆ›ดๅฅฝ๏ผŒ็ป“ๆŸไนŸๅฏ่ƒฝๆ˜ฏ้”™่ฏฏ็ป“ๆŸ
145   - String path = "static/static/snap/";
  145 + String path = "snap";
146 146 String fileName = deviceId + "_" + channelId + ".jpg";
147 147 ResponseEntity responseEntity = (ResponseEntity)result.getResult();
148 148 if (responseEntity != null && responseEntity.getStatusCode() == HttpStatus.OK) {
... ...
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
1 1 package com.genersoft.iot.vmp.storager.dao;
2 2  
  3 +import com.genersoft.iot.vmp.gb28181.bean.Device;
3 4 import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
4 5 import com.genersoft.iot.vmp.gb28181.bean.DeviceChannelInPlatform;
5 6 import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
... ... @@ -17,10 +18,12 @@ public interface DeviceChannelMapper {
17 18  
18 19 @Insert("INSERT INTO device_channel (channelId, deviceId, name, manufacture, model, owner, civilCode, block, " +
19 20 "address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " +
20   - "ipAddress, port, password, PTZType, status, streamId, longitude, latitude, longitudeGcj02, latitudeGcj02, longitudeWgs84, latitudeWgs84, createTime, updateTime) " +
  21 + "ipAddress, port, password, PTZType, status, streamId, longitude, latitude, longitudeGcj02, latitudeGcj02, " +
  22 + "longitudeWgs84, latitudeWgs84, createTime, updateTime, businessGroupId) " +
21 23 "VALUES ('${channelId}', '${deviceId}', '${name}', '${manufacture}', '${model}', '${owner}', '${civilCode}', '${block}'," +
22 24 "'${address}', ${parental}, '${parentId}', ${safetyWay}, ${registerWay}, '${certNum}', ${certifiable}, ${errCode}, '${secrecy}', " +
23   - "'${ipAddress}', ${port}, '${password}', ${PTZType}, ${status}, '${streamId}', ${longitude}, ${latitude}, ${longitudeGcj02}, ${latitudeGcj02}, ${longitudeWgs84}, ${latitudeWgs84},'${createTime}', '${updateTime}')")
  25 + "'${ipAddress}', ${port}, '${password}', ${PTZType}, ${status}, '${streamId}', ${longitude}, ${latitude}, ${longitudeGcj02}, " +
  26 + "${latitudeGcj02}, ${longitudeWgs84}, ${latitudeWgs84},'${createTime}', '${updateTime}', '${businessGroupId}')")
24 27 int add(DeviceChannel channel);
25 28  
26 29 @Update(value = {" <script>" +
... ... @@ -54,6 +57,7 @@ public interface DeviceChannelMapper {
54 57 "<if test='latitudeGcj02 != null'>, latitudeGcj02=${latitudeGcj02}</if>" +
55 58 "<if test='longitudeWgs84 != null'>, longitudeWgs84=${longitudeWgs84}</if>" +
56 59 "<if test='latitudeWgs84 != null'>, latitudeWgs84=${latitudeWgs84}</if>" +
  60 + "<if test='businessGroupId != null'>, businessGroupId=#{businessGroupId}</if>" +
57 61 "WHERE deviceId='${deviceId}' AND channelId='${channelId}'"+
58 62 " </script>"})
59 63 int update(DeviceChannel channel);
... ... @@ -143,7 +147,7 @@ public interface DeviceChannelMapper {
143 147 "(channelId, deviceId, name, manufacture, model, owner, civilCode, block, subCount, " +
144 148 " address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " +
145 149 " ipAddress, port, password, PTZType, status, streamId, longitude, latitude, longitudeGcj02, latitudeGcj02, " +
146   - " longitudeWgs84, latitudeWgs84, createTime, updateTime) " +
  150 + " longitudeWgs84, latitudeWgs84, createTime, updateTime, businessGroupId) " +
147 151 "values " +
148 152 "<foreach collection='addChannels' index='index' item='item' separator=','> " +
149 153 "('${item.channelId}', '${item.deviceId}', '${item.name}', '${item.manufacture}', '${item.model}', " +
... ... @@ -152,7 +156,8 @@ public interface DeviceChannelMapper {
152 156 "'${item.certNum}', ${item.certifiable}, ${item.errCode}, '${item.secrecy}', " +
153 157 "'${item.ipAddress}', ${item.port}, '${item.password}', ${item.PTZType}, ${item.status}, " +
154 158 "'${item.streamId}', ${item.longitude}, ${item.latitude},${item.longitudeGcj02}, " +
155   - "${item.latitudeGcj02},${item.longitudeWgs84}, ${item.latitudeWgs84},'${item.createTime}', '${item.updateTime}')" +
  159 + "${item.latitudeGcj02},${item.longitudeWgs84}, ${item.latitudeWgs84},'${item.createTime}', '${item.updateTime}', " +
  160 + "'${item.businessGroupId}') " +
156 161 "</foreach> " +
157 162 "ON DUPLICATE KEY UPDATE " +
158 163 "updateTime=VALUES(updateTime), " +
... ... @@ -183,7 +188,8 @@ public interface DeviceChannelMapper {
183 188 "longitudeGcj02=VALUES(longitudeGcj02), " +
184 189 "latitudeGcj02=VALUES(latitudeGcj02), " +
185 190 "longitudeWgs84=VALUES(longitudeWgs84), " +
186   - "latitudeWgs84=VALUES(latitudeWgs84) " +
  191 + "latitudeWgs84=VALUES(latitudeWgs84), " +
  192 + "businessGroupId=VALUES(businessGroupId) " +
187 193 "</script>")
188 194 int batchAdd(List<DeviceChannel> addChannels);
189 195  
... ... @@ -221,6 +227,7 @@ public interface DeviceChannelMapper {
221 227 "<if test='item.latitudeGcj02 != null'>, latitudeGcj02=${item.latitudeGcj02}</if>" +
222 228 "<if test='item.longitudeWgs84 != null'>, longitudeWgs84=${item.longitudeWgs84}</if>" +
223 229 "<if test='item.latitudeWgs84 != null'>, latitudeWgs84=${item.latitudeWgs84}</if>" +
  230 + "<if test='item.businessGroupId != null'>, businessGroupId=#{item.businessGroupId}</if>" +
224 231 "WHERE deviceId='${item.deviceId}' AND channelId='${item.channelId}'"+
225 232 "</foreach>" +
226 233 "</script>"})
... ... @@ -277,4 +284,33 @@ public interface DeviceChannelMapper {
277 284  
278 285 @Select("select * from device_channel where longitude*latitude > 0 and deviceId = #{deviceId}")
279 286 List<DeviceChannel> getAllChannelWithCoordinate(String deviceId);
  287 +
  288 +
  289 + @Select(value = {" <script>" +
  290 + "select * " +
  291 + "from device_channel " +
  292 + "where deviceId=#{deviceId}" +
  293 + " <if test='parentId != null' > and left(channelId, ${parentId.length()}) = #{parentId}</if>" +
  294 + " <if test='length != null' > and length(channelId)=${length}</if>" +
  295 + " </script>"})
  296 + List<DeviceChannel> getChannelsWithCivilCodeAndLength(String deviceId, String parentId, Integer length);
  297 +
  298 + @Select(value = {" <script>" +
  299 + "select * " +
  300 + "from device_channel " +
  301 + "where deviceId=#{deviceId} and length(channelId)>14 and civilCode=#{parentId}" +
  302 + " </script>"})
  303 + List<DeviceChannel> getChannelsByCivilCode(String deviceId, String parentId);
  304 +
  305 + @Select("select min(length(channelId)) as minLength " +
  306 + "from device_channel " +
  307 + "where deviceId=#{deviceId}")
  308 + Integer getChannelMinLength(String deviceId);
  309 +
  310 + @Select("select * from device_channel where deviceId=#{deviceId} and civilCode not in " +
  311 + "(select civilCode from device_channel where deviceId=#{deviceId} group by civilCode)")
  312 + List<DeviceChannel> getChannelWithoutCiviCode(String deviceId);
  313 +
  314 + @Select("select * from device_channel where deviceId=#{deviceId} and SUBSTRING(channelId, 11, 3)=#{typeCode}")
  315 + List<DeviceChannel> getBusinessGroups(String deviceId, String typeCode);
280 316 }
... ...
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java
... ... @@ -39,6 +39,7 @@ public interface DeviceMapper {
39 39 "subscribeCycleForAlarm," +
40 40 "ssrcCheck," +
41 41 "geoCoordSys," +
  42 + "treeType," +
42 43 "online" +
43 44 ") VALUES (" +
44 45 "#{deviceId}," +
... ... @@ -63,6 +64,7 @@ public interface DeviceMapper {
63 64 "#{subscribeCycleForAlarm}," +
64 65 "#{ssrcCheck}," +
65 66 "#{geoCoordSys}," +
  67 + "#{treeType}," +
66 68 "#{online}" +
67 69 ")")
68 70 int add(Device device);
... ... @@ -90,6 +92,7 @@ public interface DeviceMapper {
90 92 "<if test=\"subscribeCycleForAlarm != null\">, subscribeCycleForAlarm=${subscribeCycleForAlarm}</if>" +
91 93 "<if test=\"ssrcCheck != null\">, ssrcCheck=${ssrcCheck}</if>" +
92 94 "<if test=\"geoCoordSys != null\">, geoCoordSys=#{geoCoordSys}</if>" +
  95 + "<if test=\"treeType != null\">, treeType=#{treeType}</if>" +
93 96 "WHERE deviceId='${deviceId}'"+
94 97 " </script>"})
95 98 int update(Device device);
... ...
src/main/java/com/genersoft/iot/vmp/vmanager/bean/BaseTree.java 0 โ†’ 100644
  1 +package com.genersoft.iot.vmp.vmanager.bean;
  2 +
  3 +import org.jetbrains.annotations.NotNull;
  4 +
  5 +import java.text.Collator;
  6 +import java.util.Comparator;
  7 +
  8 +/**
  9 + * @author lin
  10 + */
  11 +public class BaseTree<T> implements Comparable<BaseTree>{
  12 + private String id;
  13 +
  14 + private String deviceId;
  15 + private String pid;
  16 + private String name;
  17 + private boolean parent;
  18 +
  19 + private T basicData;
  20 +
  21 + public String getId() {
  22 + return id;
  23 + }
  24 +
  25 + public void setId(String id) {
  26 + this.id = id;
  27 + }
  28 +
  29 + public String getDeviceId() {
  30 + return deviceId;
  31 + }
  32 +
  33 + public void setDeviceId(String deviceId) {
  34 + this.deviceId = deviceId;
  35 + }
  36 +
  37 + public String getPid() {
  38 + return pid;
  39 + }
  40 +
  41 + public void setPid(String pid) {
  42 + this.pid = pid;
  43 + }
  44 +
  45 + public String getName() {
  46 + return name;
  47 + }
  48 +
  49 + public void setName(String name) {
  50 + this.name = name;
  51 + }
  52 +
  53 + public T getBasicData() {
  54 + return basicData;
  55 + }
  56 +
  57 + public void setBasicData(T basicData) {
  58 + this.basicData = basicData;
  59 + }
  60 +
  61 + public boolean isParent() {
  62 + return parent;
  63 + }
  64 +
  65 + public void setParent(boolean parent) {
  66 + this.parent = parent;
  67 + }
  68 +
  69 + @Override
  70 + public int compareTo(@NotNull BaseTree treeNode) {
  71 + if (this.parent || treeNode.isParent()) {
  72 + if (!this.parent && !treeNode.isParent()) {
  73 + Comparator cmp = Collator.getInstance(java.util.Locale.CHINA);
  74 + return cmp.compare(treeNode.getName(), this.getName());
  75 + }else {
  76 + if (this.isParent()) {
  77 + return 1;
  78 + }else {
  79 + return -1;
  80 + }
  81 + }
  82 + }else{
  83 + Comparator cmp = Collator.getInstance(java.util.Locale.CHINA);
  84 + return cmp.compare(treeNode.getName(), this.getName());
  85 + }
  86 + }
  87 +}
... ...
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java
... ... @@ -15,6 +15,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
15 15 import com.genersoft.iot.vmp.service.IDeviceService;
16 16 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
17 17 import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
  18 +import com.genersoft.iot.vmp.vmanager.bean.BaseTree;
18 19 import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
19 20 import com.github.pagehelper.PageInfo;
20 21 import io.swagger.annotations.Api;
... ... @@ -479,4 +480,99 @@ public class DeviceQuery {
479 480 resp.setStatus(HttpServletResponse.SC_NOT_FOUND);
480 481 }
481 482 }
  483 +
  484 + /**
  485 + * ๆŸฅ่ฏขๅ›ฝๆ ‡ๆ ‘
  486 + * @param deviceId ่ฎพๅค‡ID
  487 + * @param parentId ็ˆถID
  488 + * @param page ๅฝ“ๅ‰้กต
  489 + * @param count ๆฏ้กตๆกๆ•ฐ
  490 + * @return ๅ›ฝๆ ‡่ฎพๅค‡
  491 + */
  492 + @ApiOperation("ๆŸฅ่ฏขๅ›ฝๆ ‡ๆ ‘")
  493 + @ApiImplicitParams({
  494 + @ApiImplicitParam(name = "deviceId", value = "่ฎพๅค‡ID", required = true, dataTypeClass = String.class),
  495 + @ApiImplicitParam(name = "parentId", value = "็ˆถID", required = false, dataTypeClass = String.class),
  496 + @ApiImplicitParam(name = "onlyCatalog", value = "ๅช่Žทๅ–็›ฎๅฝ•", required = false, dataTypeClass = Boolean.class),
  497 + @ApiImplicitParam(name="page", value = "ๅฝ“ๅ‰้กต", required = true, dataTypeClass = Integer.class),
  498 + @ApiImplicitParam(name="count", value = "ๆฏ้กตๆกๆ•ฐ", required = true, dataTypeClass = Integer.class),
  499 + })
  500 + @GetMapping("/tree/{deviceId}")
  501 + public ResponseEntity<PageInfo> getTree(@PathVariable String deviceId, @RequestParam(required = false) String parentId, @RequestParam(required = false) Boolean onlyCatalog, int page, int count){
  502 +
  503 +
  504 + if (page <= 0) {
  505 + page = 1;
  506 + }
  507 + if (onlyCatalog == null) {
  508 + onlyCatalog = false;
  509 + }
  510 +
  511 + List<BaseTree<DeviceChannel>> treeData = deviceService.queryVideoDeviceTree(deviceId, parentId, onlyCatalog);
  512 + if (treeData == null || (page - 1) * count > treeData.size()) {
  513 + PageInfo<BaseTree<DeviceChannel>> pageInfo = new PageInfo<>();
  514 + pageInfo.setPageNum(page);
  515 + pageInfo.setTotal(treeData == null? 0 : treeData.size());
  516 + pageInfo.setSize(0);
  517 + pageInfo.setList(new ArrayList<>());
  518 + return new ResponseEntity<>(pageInfo,HttpStatus.OK);
  519 + }
  520 +
  521 + int toIndex = Math.min(page * count, treeData.size());
  522 + // ๅค„็†ๅˆ†้กต
  523 + List<BaseTree<DeviceChannel>> trees = treeData.subList((page - 1) * count, toIndex);
  524 + PageInfo<BaseTree<DeviceChannel>> pageInfo = new PageInfo<>();
  525 + pageInfo.setPageNum(page);
  526 + pageInfo.setTotal(treeData.size());
  527 + pageInfo.setSize(trees.size());
  528 + pageInfo.setList(trees);
  529 +
  530 + return new ResponseEntity<>(pageInfo,HttpStatus.OK);
  531 + }
  532 +
  533 +
  534 + /**
  535 + * ๆŸฅ่ฏขๅ›ฝๆ ‡ๆ ‘ไธ‹็š„้€š้“
  536 + * @param deviceId ่ฎพๅค‡ID
  537 + * @param parentId ็ˆถID
  538 + * @param page ๅฝ“ๅ‰้กต
  539 + * @param count ๆฏ้กตๆกๆ•ฐ
  540 + * @return ๅ›ฝๆ ‡่ฎพๅค‡
  541 + */
  542 + @ApiOperation("ๆŸฅ่ฏขๅ›ฝๆ ‡ๆ ‘ไธ‹็š„้€š้“")
  543 + @ApiImplicitParams({
  544 + @ApiImplicitParam(name = "deviceId", value = "่ฎพๅค‡ID", required = true, dataTypeClass = String.class),
  545 + @ApiImplicitParam(name = "parentId", value = "็ˆถID", required = false, dataTypeClass = String.class),
  546 + @ApiImplicitParam(name="page", value = "ๅฝ“ๅ‰้กต", required = true, dataTypeClass = Integer.class),
  547 + @ApiImplicitParam(name="count", value = "ๆฏ้กตๆกๆ•ฐ", required = true, dataTypeClass = Integer.class),
  548 + })
  549 + @GetMapping("/tree/channel/{deviceId}")
  550 + public ResponseEntity<PageInfo> getChannelInTreeNode(@PathVariable String deviceId, @RequestParam(required = false) String parentId, int page, int count){
  551 +
  552 +
  553 + if (page <= 0) {
  554 + page = 1;
  555 + }
  556 +
  557 + List<DeviceChannel> treeData = deviceService.queryVideoDeviceInTreeNode(deviceId, parentId);
  558 + if (treeData == null || (page - 1) * count > treeData.size()) {
  559 + PageInfo<BaseTree<DeviceChannel>> pageInfo = new PageInfo<>();
  560 + pageInfo.setPageNum(page);
  561 + pageInfo.setTotal(treeData == null? 0 : treeData.size());
  562 + pageInfo.setSize(0);
  563 + pageInfo.setList(new ArrayList<>());
  564 + return new ResponseEntity<>(pageInfo,HttpStatus.OK);
  565 + }
  566 +
  567 + int toIndex = Math.min(page * count, treeData.size());
  568 + // ๅค„็†ๅˆ†้กต
  569 + List<DeviceChannel> trees = treeData.subList((page - 1) * count, toIndex);
  570 + PageInfo<DeviceChannel> pageInfo = new PageInfo<>();
  571 + pageInfo.setPageNum(page);
  572 + pageInfo.setTotal(treeData.size());
  573 + pageInfo.setSize(trees.size());
  574 + pageInfo.setList(trees);
  575 +
  576 + return new ResponseEntity<>(pageInfo,HttpStatus.OK);
  577 + }
482 578 }
... ...
src/main/resources/logback-spring-local.xml
... ... @@ -11,6 +11,11 @@
11 11 <!--ๆ ผๅผๅŒ–่พ“ๅ‡บ๏ผš%d่กจ็คบๆ—ฅๆœŸ๏ผŒ%thread่กจ็คบ็บฟ็จ‹ๅ๏ผŒ%-5level๏ผš็บงๅˆซไปŽๅทฆๆ˜พ็คบ5ไธชๅญ—็ฌฆๅฎฝๅบฆ%msg๏ผšๆ—ฅๅฟ—ๆถˆๆฏ๏ผŒ%nๆ˜ฏๆข่กŒ็ฌฆ -->
12 12 <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50}:%L - %msg%n</pattern>
13 13 </encoder>
  14 + <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
  15 + <!--ไธŽThresholdFilter็š„ๅŒบๅˆซ,ๅ…่ฎธonmatch-->
  16 + <!--่ฎพ็ฝฎๆ—ฅๅฟ—็บงๅˆซ ๆŽฅๆ”ถinfo็บงๅˆซ็š„ๆ—ฅๅฟ—-->
  17 + <level>DEBUG</level>
  18 + </filter>
14 19 </appender>
15 20  
16 21 <!-- ๆŒ‰็…งๆฏๅคฉ็”Ÿๆˆๆ—ฅๅฟ—ๆ–‡ไปถ DEBUGไปฅไธŠ็บงๅˆซ็š„ๆ—ฅๅฟ—,ไป…็”จไบŽๆต‹่ฏ•็Žฏๅขƒ,ๆญฃๅผ็Žฏๅขƒไธบinfo็บงๅˆซไปฅไธŠ็š„ๆ—ฅๅฟ—-->
... ...
web_src/package-lock.json
... ... @@ -22,7 +22,9 @@
22 22 "vue-clipboards": "^1.3.0",
23 23 "vue-contextmenujs": "^1.3.13",
24 24 "vue-cookies": "^1.7.4",
25   - "vue-router": "^3.1.6"
  25 + "vue-giant-tree": "^0.1.5",
  26 + "vue-router": "^3.1.6",
  27 + "vue-ztree-2.0": "^1.0.4"
26 28 },
27 29 "devDependencies": {
28 30 "autoprefixer": "^7.1.2",
... ... @@ -116,6 +118,17 @@
116 118 "integrity": "sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug==",
117 119 "dev": true
118 120 },
  121 + "node_modules/@ztree/ztree_v3": {
  122 + "version": "3.5.48",
  123 + "resolved": "https://registry.npmmirror.com/@ztree/ztree_v3/-/ztree_v3-3.5.48.tgz",
  124 + "integrity": "sha512-4dSA1g26T3j/O3I89+r/Palg+a+xwMGRS1etZoggnCGBPoOrwW8VGA3zitJCK/Yd7eEMX+LfKTRJjEGiWpoN3w==",
  125 + "dependencies": {
  126 + "jquery": ">=1.4.4"
  127 + },
  128 + "engines": {
  129 + "node": ">=0.10.0"
  130 + }
  131 + },
119 132 "node_modules/accepts": {
120 133 "version": "1.3.7",
121 134 "resolved": "https://registry.npm.taobao.org/accepts/download/accepts-1.3.7.tgz",
... ... @@ -6034,6 +6047,11 @@
6034 6047 "node": ">=0.10.0"
6035 6048 }
6036 6049 },
  6050 + "node_modules/jquery": {
  6051 + "version": "3.6.0",
  6052 + "resolved": "https://registry.npmmirror.com/jquery/-/jquery-3.6.0.tgz",
  6053 + "integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw=="
  6054 + },
6037 6055 "node_modules/js-base64": {
6038 6056 "version": "2.6.4",
6039 6057 "resolved": "https://registry.npm.taobao.org/js-base64/download/js-base64-2.6.4.tgz?cache=0&sync_timestamp=1599897619557&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",
... ... @@ -13067,6 +13085,15 @@
13067 13085 "resolved": "https://registry.npm.taobao.org/vue-cookies/download/vue-cookies-1.7.4.tgz?cache=0&sync_timestamp=1598941352058&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-cookies%2Fdownload%2Fvue-cookies-1.7.4.tgz",
13068 13086 "integrity": "sha1-0kHQoEMdoHlYN2UdELTXPnyNPo0="
13069 13087 },
  13088 + "node_modules/vue-giant-tree": {
  13089 + "version": "0.1.5",
  13090 + "resolved": "https://registry.npmmirror.com/vue-giant-tree/-/vue-giant-tree-0.1.5.tgz",
  13091 + "integrity": "sha512-P3KEHSZU2NkpWl6frss+sJLO0DLrtarMNLeTV/IGU2/w50rgrlKbKNr/ckK6BBVdWXAJYlYf6HUTNkKvGq5hlg==",
  13092 + "dependencies": {
  13093 + "@ztree/ztree_v3": "^3.5.44",
  13094 + "jquery": "^3.5.1"
  13095 + }
  13096 + },
13070 13097 "node_modules/vue-hot-reload-api": {
13071 13098 "version": "2.3.4",
13072 13099 "resolved": "https://registry.npm.taobao.org/vue-hot-reload-api/download/vue-hot-reload-api-2.3.4.tgz",
... ... @@ -13174,6 +13201,11 @@
13174 13201 "integrity": "sha1-HuO8mhbsv1EYvjNLsV+cRvgvWCU=",
13175 13202 "dev": true
13176 13203 },
  13204 + "node_modules/vue-ztree-2.0": {
  13205 + "version": "1.0.4",
  13206 + "resolved": "https://registry.npmmirror.com/vue-ztree-2.0/-/vue-ztree-2.0-1.0.4.tgz",
  13207 + "integrity": "sha512-d7KZsquEYpM0jD/k1uwOMFCd08L6++7zwRESaL2sF43OtRFCump8BxcLpjusBIHpFadPvOSMMnK5P41y+ZiTlA=="
  13208 + },
13177 13209 "node_modules/watchpack": {
13178 13210 "version": "1.7.4",
13179 13211 "resolved": "https://registry.npm.taobao.org/watchpack/download/watchpack-1.7.4.tgz?cache=0&sync_timestamp=1600385388649&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwatchpack%2Fdownload%2Fwatchpack-1.7.4.tgz",
... ... @@ -14418,6 +14450,14 @@
14418 14450 "integrity": "sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug==",
14419 14451 "dev": true
14420 14452 },
  14453 + "@ztree/ztree_v3": {
  14454 + "version": "3.5.48",
  14455 + "resolved": "https://registry.npmmirror.com/@ztree/ztree_v3/-/ztree_v3-3.5.48.tgz",
  14456 + "integrity": "sha512-4dSA1g26T3j/O3I89+r/Palg+a+xwMGRS1etZoggnCGBPoOrwW8VGA3zitJCK/Yd7eEMX+LfKTRJjEGiWpoN3w==",
  14457 + "requires": {
  14458 + "jquery": ">=1.4.4"
  14459 + }
  14460 + },
14421 14461 "accepts": {
14422 14462 "version": "1.3.7",
14423 14463 "resolved": "https://registry.npm.taobao.org/accepts/download/accepts-1.3.7.tgz",
... ... @@ -19487,6 +19527,11 @@
19487 19527 "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=",
19488 19528 "dev": true
19489 19529 },
  19530 + "jquery": {
  19531 + "version": "3.6.0",
  19532 + "resolved": "https://registry.npmmirror.com/jquery/-/jquery-3.6.0.tgz",
  19533 + "integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw=="
  19534 + },
19490 19535 "js-base64": {
19491 19536 "version": "2.6.4",
19492 19537 "resolved": "https://registry.npm.taobao.org/js-base64/download/js-base64-2.6.4.tgz?cache=0&sync_timestamp=1599897619557&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",
... ... @@ -25351,6 +25396,15 @@
25351 25396 "resolved": "https://registry.npm.taobao.org/vue-cookies/download/vue-cookies-1.7.4.tgz?cache=0&sync_timestamp=1598941352058&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-cookies%2Fdownload%2Fvue-cookies-1.7.4.tgz",
25352 25397 "integrity": "sha1-0kHQoEMdoHlYN2UdELTXPnyNPo0="
25353 25398 },
  25399 + "vue-giant-tree": {
  25400 + "version": "0.1.5",
  25401 + "resolved": "https://registry.npmmirror.com/vue-giant-tree/-/vue-giant-tree-0.1.5.tgz",
  25402 + "integrity": "sha512-P3KEHSZU2NkpWl6frss+sJLO0DLrtarMNLeTV/IGU2/w50rgrlKbKNr/ckK6BBVdWXAJYlYf6HUTNkKvGq5hlg==",
  25403 + "requires": {
  25404 + "@ztree/ztree_v3": "^3.5.44",
  25405 + "jquery": "^3.5.1"
  25406 + }
  25407 + },
25354 25408 "vue-hot-reload-api": {
25355 25409 "version": "2.3.4",
25356 25410 "resolved": "https://registry.npm.taobao.org/vue-hot-reload-api/download/vue-hot-reload-api-2.3.4.tgz",
... ... @@ -25447,6 +25501,11 @@
25447 25501 "integrity": "sha1-HuO8mhbsv1EYvjNLsV+cRvgvWCU=",
25448 25502 "dev": true
25449 25503 },
  25504 + "vue-ztree-2.0": {
  25505 + "version": "1.0.4",
  25506 + "resolved": "https://registry.npmmirror.com/vue-ztree-2.0/-/vue-ztree-2.0-1.0.4.tgz",
  25507 + "integrity": "sha512-d7KZsquEYpM0jD/k1uwOMFCd08L6++7zwRESaL2sF43OtRFCump8BxcLpjusBIHpFadPvOSMMnK5P41y+ZiTlA=="
  25508 + },
25450 25509 "watchpack": {
25451 25510 "version": "1.7.4",
25452 25511 "resolved": "https://registry.npm.taobao.org/watchpack/download/watchpack-1.7.4.tgz?cache=0&sync_timestamp=1600385388649&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwatchpack%2Fdownload%2Fwatchpack-1.7.4.tgz",
... ...
web_src/package.json
... ... @@ -24,7 +24,9 @@
24 24 "vue-clipboards": "^1.3.0",
25 25 "vue-contextmenujs": "^1.3.13",
26 26 "vue-cookies": "^1.7.4",
27   - "vue-router": "^3.1.6"
  27 + "vue-giant-tree": "^0.1.5",
  28 + "vue-router": "^3.1.6",
  29 + "vue-ztree-2.0": "^1.0.4"
28 30 },
29 31 "devDependencies": {
30 32 "autoprefixer": "^7.1.2",
... ...
web_src/src/components/DeviceList.vue
... ... @@ -56,11 +56,11 @@
56 56 @mouseover="getTooltipContent(scope.row.deviceId)">ๅˆทๆ–ฐ
57 57 </el-button>
58 58 <el-divider direction="vertical"></el-divider>
59   - <el-button type="text" size="medium" icon="el-icon-video-camera" v-bind:disabled="scope.row.online==0"
  59 + <el-button type="text" size="medium" icon="el-icon-video-camera"
60 60 @click="showChannelList(scope.row)">้€š้“
61 61 </el-button>
62 62 <el-divider direction="vertical"></el-divider>
63   - <el-button size="medium" icon="el-icon-location" v-bind:disabled="scope.row.online==0" type="text"
  63 + <el-button size="medium" icon="el-icon-location" type="text"
64 64 @click="showDevicePosition(scope.row)">ๅฎšไฝ
65 65 </el-button>
66 66 <el-divider direction="vertical"></el-divider>
... ... @@ -192,7 +192,7 @@ export default {
192 192  
193 193 },
194 194 showChannelList: function (row) {
195   - this.$router.push(`/channelList/${row.deviceId}/0/15/1`);
  195 + this.$router.push(`/channelList/${row.deviceId}/0`);
196 196 },
197 197 showDevicePosition: function (row) {
198 198 this.$router.push(`/map?deviceId=${row.deviceId}`);
... ...
web_src/src/components/channelList.vue
... ... @@ -7,104 +7,116 @@
7 7 ้€š้“ๅˆ—่กจ
8 8 </div>
9 9 <div class="page-header-btn">
10   - ๆœ็ดข:
11   - <el-input @input="search" style="margin-right: 1rem; width: auto;" size="mini" placeholder="ๅ…ณ้”ฎๅญ—"
12   - prefix-icon="el-icon-search" v-model="searchSrt" clearable></el-input>
  10 + <div v-if="!showTree" style="display: inline;">
  11 + ๆœ็ดข:
  12 + <el-input @input="search" style="margin-right: 1rem; width: auto;" size="mini" placeholder="ๅ…ณ้”ฎๅญ—"
  13 + prefix-icon="el-icon-search" v-model="searchSrt" clearable></el-input>
13 14  
14   - ้€š้“็ฑปๅž‹:
15   - <el-select size="mini" @change="search" style="margin-right: 1rem;" v-model="channelType" placeholder="่ฏท้€‰ๆ‹ฉ"
16   - default-first-option>
17   - <el-option label="ๅ…จ้ƒจ" value=""></el-option>
18   - <el-option label="่ฎพๅค‡" value="false"></el-option>
19   - <el-option label="ๅญ็›ฎๅฝ•" value="true"></el-option>
20   - </el-select>
21   - ๅœจ็บฟ็Šถๆ€:
22   - <el-select size="mini" style="margin-right: 1rem;" @change="search" v-model="online" placeholder="่ฏท้€‰ๆ‹ฉ"
23   - default-first-option>
24   - <el-option label="ๅ…จ้ƒจ" value=""></el-option>
25   - <el-option label="ๅœจ็บฟ" value="true"></el-option>
26   - <el-option label="็ฆป็บฟ" value="false"></el-option>
27   - </el-select>
  15 + ้€š้“็ฑปๅž‹:
  16 + <el-select size="mini" @change="search" style="margin-right: 1rem;" v-model="channelType" placeholder="่ฏท้€‰ๆ‹ฉ"
  17 + default-first-option>
  18 + <el-option label="ๅ…จ้ƒจ" value=""></el-option>
  19 + <el-option label="่ฎพๅค‡" value="false"></el-option>
  20 + <el-option label="ๅญ็›ฎๅฝ•" value="true"></el-option>
  21 + </el-select>
  22 + ๅœจ็บฟ็Šถๆ€:
  23 + <el-select size="mini" style="margin-right: 1rem;" @change="search" v-model="online" placeholder="่ฏท้€‰ๆ‹ฉ"
  24 + default-first-option>
  25 + <el-option label="ๅ…จ้ƒจ" value=""></el-option>
  26 + <el-option label="ๅœจ็บฟ" value="true"></el-option>
  27 + <el-option label="็ฆป็บฟ" value="false"></el-option>
  28 + </el-select>
  29 + </div>
28 30 <el-button icon="el-icon-refresh-right" circle size="mini" @click="refresh()"></el-button>
  31 + <el-button v-if="showTree" icon="iconfont icon-list" circle size="mini" @click="switchList()"></el-button>
  32 + <el-button v-if="!showTree" icon="iconfont icon-tree" circle size="mini" @click="switchTree()"></el-button>
29 33 </div>
30 34 </div>
31 35 <devicePlayer ref="devicePlayer" v-loading="isLoging"></devicePlayer>
32   - <!--่ฎพๅค‡ๅˆ—่กจ-->
33   - <el-table ref="channelListTable" :data="deviceChannelList" :height="winHeight" style="width: 100%" header-row-class-name="table-header">
34   - <el-table-column prop="channelId" label="้€š้“็ผ–ๅท" min-width="200">
35   - </el-table-column>
36   - <el-table-column prop="deviceId" label="่ฎพๅค‡็ผ–ๅท" min-width="200">
37   - </el-table-column>
38   - <el-table-column prop="name" label="้€š้“ๅ็งฐ" min-width="200">
39   - </el-table-column>
40   - <el-table-column label="ๅฟซ็…ง" min-width="120">
41   - <template v-slot:default="scope">
42   - <el-image
43   - :src="getSnap(scope.row)"
44   - :preview-src-list="getBigSnap(scope.row)"
45   - @error="getSnapErrorEvent(scope.row.deviceId, scope.row.channelId)"
46   - :fit="'contain'"
47   - style="width: 60px">
48   - <div slot="error" class="image-slot">
49   - <i class="el-icon-picture-outline"></i>
50   - </div>
51   - </el-image>
52   - </template>
53   - </el-table-column>
54   - <el-table-column prop="subCount" label="ๅญ่Š‚็‚นๆ•ฐ" min-width="120">
55   - </el-table-column>
56   - <el-table-column prop="manufacture" label="ๅŽ‚ๅฎถ" min-width="120">
57   - </el-table-column>
58   - <el-table-column label="ไฝ็ฝฎไฟกๆฏ" min-width="200">
59   - <template slot-scope="scope">
60   - <span v-if="scope.row.longitude*scope.row.latitude > 0">{{ scope.row.longitude }},<br>{{ scope.row.latitude }}</span>
61   - <span v-if="scope.row.longitude*scope.row.latitude === 0">ๆ— </span>
62   - </template>
63   - </el-table-column>
64   - <el-table-column prop="ptztypeText" label="ไบ‘ๅฐ็ฑปๅž‹" min-width="120"/>
65   - <el-table-column label="ๅผ€ๅฏ้Ÿณ้ข‘" min-width="120">
66   - <template slot-scope="scope">
67   - <el-switch @change="updateChannel(scope.row)" v-model="scope.row.hasAudio" active-color="#409EFF">
68   - </el-switch>
69   - </template>
70   - </el-table-column>
71   - <el-table-column label="็Šถๆ€" min-width="120">
72   - <template slot-scope="scope">
73   - <div slot="reference" class="name-wrapper">
74   - <el-tag size="medium" v-if="scope.row.status === 1">ๅœจ็บฟ</el-tag>
75   - <el-tag size="medium" type="info" v-if="scope.row.status === 0">็ฆป็บฟ</el-tag>
76   - </div>
77   - </template>
78   - </el-table-column>
  36 + <el-container v-loading="isLoging" style="height: 82vh;">
  37 + <el-aside width="auto" style="height: 82vh; background-color: #ffffff; overflow: auto" v-if="showTree" >
  38 + <DeviceTree ref="deviceTree" :device="device" :onlyCatalog="true" :clickEvent="treeNodeClickEvent" ></DeviceTree>
  39 + </el-aside>
  40 + <el-main style="padding: 5px;">
  41 + <el-table ref="channelListTable" :data="deviceChannelList" :height="winHeight" style="width: 100%" header-row-class-name="table-header">
  42 + <el-table-column prop="channelId" label="้€š้“็ผ–ๅท" min-width="200">
  43 + </el-table-column>
  44 + <el-table-column prop="deviceId" label="่ฎพๅค‡็ผ–ๅท" min-width="200">
  45 + </el-table-column>
  46 + <el-table-column prop="name" label="้€š้“ๅ็งฐ" min-width="200">
  47 + </el-table-column>
  48 + <el-table-column label="ๅฟซ็…ง" min-width="120">
  49 + <template v-slot:default="scope">
  50 + <el-image
  51 + :src="getSnap(scope.row)"
  52 + :preview-src-list="getBigSnap(scope.row)"
  53 + @error="getSnapErrorEvent(scope.row.deviceId, scope.row.channelId)"
  54 + :fit="'contain'"
  55 + style="width: 60px">
  56 + <div slot="error" class="image-slot">
  57 + <i class="el-icon-picture-outline"></i>
  58 + </div>
  59 + </el-image>
  60 + </template>
  61 + </el-table-column>
  62 + <el-table-column prop="subCount" label="ๅญ่Š‚็‚นๆ•ฐ" min-width="120">
  63 + </el-table-column>
  64 + <el-table-column prop="manufacture" label="ๅŽ‚ๅฎถ" min-width="120">
  65 + </el-table-column>
  66 + <el-table-column label="ไฝ็ฝฎไฟกๆฏ" min-width="200">
  67 + <template slot-scope="scope">
  68 + <span v-if="scope.row.longitude*scope.row.latitude > 0">{{ scope.row.longitude }},<br>{{ scope.row.latitude }}</span>
  69 + <span v-if="scope.row.longitude*scope.row.latitude === 0">ๆ— </span>
  70 + </template>
  71 + </el-table-column>
  72 + <el-table-column prop="ptztypeText" label="ไบ‘ๅฐ็ฑปๅž‹" min-width="120"/>
  73 + <el-table-column label="ๅผ€ๅฏ้Ÿณ้ข‘" min-width="120">
  74 + <template slot-scope="scope">
  75 + <el-switch @change="updateChannel(scope.row)" v-model="scope.row.hasAudio" active-color="#409EFF">
  76 + </el-switch>
  77 + </template>
  78 + </el-table-column>
  79 + <el-table-column label="็Šถๆ€" min-width="120">
  80 + <template slot-scope="scope">
  81 + <div slot="reference" class="name-wrapper">
  82 + <el-tag size="medium" v-if="scope.row.status === 1">ๅœจ็บฟ</el-tag>
  83 + <el-tag size="medium" type="info" v-if="scope.row.status === 0">็ฆป็บฟ</el-tag>
  84 + </div>
  85 + </template>
  86 + </el-table-column>
79 87  
80 88  
81   - <el-table-column label="ๆ“ไฝœ" min-width="280" fixed="right">
82   - <template slot-scope="scope">
83   - <!-- <el-button size="mini" icon="el-icon-video-play" v-if="scope.row.parental == 0" @click="sendDevicePush(scope.row)">ๆ’ญๆ”พ</el-button> -->
84   - <el-button size="medium" icon="el-icon-video-play" type="text" @click="sendDevicePush(scope.row)">ๆ’ญๆ”พ</el-button>
85   - <el-button size="medium" icon="el-icon-switch-button" type="text" style="color: #f56c6c" v-if="!!scope.row.streamId"
86   - @click="stopDevicePush(scope.row)">ๅœๆญข
87   - </el-button>
88   - <el-divider direction="vertical"></el-divider>
89   - <el-button size="medium" icon="el-icon-s-open" type="text" v-if="scope.row.subCount > 0 || scope.row.parental === 1"
90   - @click="changeSubchannel(scope.row)">ๆŸฅ็œ‹
91   - </el-button>
92   - <el-divider v-if="scope.row.subCount > 0 || scope.row.parental === 1" direction="vertical"></el-divider>
93   - <el-button size="medium" icon="el-icon-video-camera" type="text" @click="queryRecords(scope.row)">่ฎพๅค‡ๅฝ•ๅƒ
94   - </el-button>
95   - </template>
96   - </el-table-column>
97   - </el-table>
98   - <el-pagination
99   - style="float: right"
100   - @size-change="handleSizeChange"
101   - @current-change="currentChange"
102   - :current-page="currentPage"
103   - :page-size="count"
104   - :page-sizes="[15, 25, 35, 50]"
105   - layout="total, sizes, prev, pager, next"
106   - :total="total">
107   - </el-pagination>
  89 + <el-table-column label="ๆ“ไฝœ" min-width="280" fixed="right">
  90 + <template slot-scope="scope">
  91 + <el-button size="medium" v-bind:disabled="device == null || device.online === 0" icon="el-icon-video-play" type="text" @click="sendDevicePush(scope.row)">ๆ’ญๆ”พ</el-button>
  92 + <el-button size="medium" v-bind:disabled="device == null || device.online === 0" icon="el-icon-switch-button" type="text" style="color: #f56c6c" v-if="!!scope.row.streamId"
  93 + @click="stopDevicePush(scope.row)">ๅœๆญข
  94 + </el-button>
  95 + <el-divider direction="vertical"></el-divider>
  96 + <el-button size="medium" icon="el-icon-s-open" type="text" v-if="scope.row.subCount > 0 || scope.row.parental === 1"
  97 + @click="changeSubchannel(scope.row)">ๆŸฅ็œ‹
  98 + </el-button>
  99 + <el-divider v-if="scope.row.subCount > 0 || scope.row.parental === 1" direction="vertical"></el-divider>
  100 + <el-button size="medium" v-bind:disabled="device == null || device.online === 0" icon="el-icon-video-camera" type="text" @click="queryRecords(scope.row)">่ฎพๅค‡ๅฝ•ๅƒ
  101 + </el-button>
  102 + </template>
  103 + </el-table-column>
  104 + </el-table>
  105 + <el-pagination
  106 + style="float: right"
  107 + @size-change="handleSizeChange"
  108 + @current-change="currentChange"
  109 + :current-page="currentPage"
  110 + :page-size="count"
  111 + :page-sizes="[15, 25, 35, 50]"
  112 + layout="total, sizes, prev, pager, next"
  113 + :total="total">
  114 + </el-pagination>
  115 + </el-main>
  116 + </el-container>
  117 +
  118 + <!--่ฎพๅค‡ๅˆ—่กจ-->
  119 +
108 120 </div>
109 121 </template>
110 122  
... ... @@ -114,12 +126,14 @@ import uiHeader from &#39;../layout/UiHeader.vue&#39;
114 126 import moment from "moment";
115 127 import DviceService from "./service/DeviceService";
116 128 import DeviceService from "./service/DeviceService";
  129 +import DeviceTree from "./common/DeviceTree";
117 130  
118 131 export default {
119 132 name: 'channelList',
120 133 components: {
121 134 devicePlayer,
122   - uiHeader
  135 + uiHeader,
  136 + DeviceTree
123 137 },
124 138 data() {
125 139 return {
... ... @@ -134,12 +148,13 @@ export default {
134 148 searchSrt: "",
135 149 channelType: "",
136 150 online: "",
137   - winHeight: window.innerHeight - 250,
138   - currentPage: parseInt(this.$route.params.page),
139   - count: parseInt(this.$route.params.count),
  151 + winHeight: window.innerHeight - 200,
  152 + currentPage: 1,
  153 + count: 15,
140 154 total: 0,
141 155 beforeUrl: "/deviceList",
142 156 isLoging: false,
  157 + showTree: false,
143 158 loadSnap: {}
144 159 };
145 160 },
... ... @@ -172,19 +187,16 @@ export default {
172 187 initParam: function () {
173 188 this.deviceId = this.$route.params.deviceId;
174 189 this.parentChannelId = this.$route.params.parentChannelId;
175   - this.currentPage = parseInt(this.$route.params.page);
176   - this.count = parseInt(this.$route.params.count);
  190 + this.currentPage = 1;
  191 + this.count = 15;
177 192 if (this.parentChannelId == "" || this.parentChannelId == 0) {
178 193 this.beforeUrl = "/deviceList"
179 194 }
180 195  
181 196 },
182 197 currentChange: function (val) {
183   - var url = `/${this.$router.currentRoute.name}/${this.deviceId}/${this.parentChannelId}/${this.count}/${val}`
184   - this.$router.push(url).then(() => {
185   - this.initParam();
186   - this.initData();
187   - })
  198 + this.currentPage = val;
  199 + this.initData();
188 200 },
189 201 handleSizeChange: function (val) {
190 202 this.count = val;
... ... @@ -316,28 +328,48 @@ export default {
316 328 })
317 329 },
318 330 showSubchannels: function (channelId) {
319   - let that = this;
  331 + if (!this.showTree) {
  332 + this.$axios({
  333 + method: 'get',
  334 + url: `/api/device/query/sub_channels/${this.deviceId}/${this.parentChannelId}/channels`,
  335 + params: {
  336 + page: this.currentPage,
  337 + count: this.count,
  338 + query: this.searchSrt,
  339 + online: this.online,
  340 + channelType: this.channelType
  341 + }
  342 + }).then( (res) =>{
  343 + this.total = res.data.total;
  344 + this.deviceChannelList = res.data.list;
  345 + // ้˜ฒๆญขๅ‡บ็Žฐ่กจๆ ผ้”™ไฝ
  346 + this.$nextTick(() => {
  347 + this.$refs.channelListTable.doLayout();
  348 + })
  349 + }).catch(function (error) {
  350 + console.log(error);
  351 + });
  352 + }else {
  353 + this.$axios({
  354 + method: 'get',
  355 + url: `/api/device/query/tree/channel/${this.deviceId}`,
  356 + params: {
  357 + parentId: this.parentChannelId,
  358 + page: this.currentPage,
  359 + count: this.count,
  360 + }
  361 + }).then((res)=> {
  362 + this.total = res.data.total;
  363 + this.deviceChannelList = res.data.list;
  364 + // ้˜ฒๆญขๅ‡บ็Žฐ่กจๆ ผ้”™ไฝ
  365 + this.$nextTick(() => {
  366 + this.$refs.channelListTable.doLayout();
  367 + })
  368 + }).catch(function (error) {
  369 + console.log(error);
  370 + });
  371 + }
320 372  
321   - this.$axios({
322   - method: 'get',
323   - url: `/api/device/query/sub_channels/${this.deviceId}/${this.parentChannelId}/channels`,
324   - params: {
325   - page: that.currentPage,
326   - count: that.count,
327   - query: that.searchSrt,
328   - online: that.online,
329   - channelType: that.channelType
330   - }
331   - }).then(function (res) {
332   - that.total = res.data.total;
333   - that.deviceChannelList = res.data.list;
334   - // ้˜ฒๆญขๅ‡บ็Žฐ่กจๆ ผ้”™ไฝ
335   - that.$nextTick(() => {
336   - that.$refs.channelListTable.doLayout();
337   - })
338   - }).catch(function (error) {
339   - console.log(error);
340   - });
341 373 },
342 374 search: function () {
343 375 this.currentPage = 1;
... ... @@ -355,6 +387,29 @@ export default {
355 387 },
356 388 refresh: function () {
357 389 this.initData();
  390 + },
  391 + switchTree: function (){
  392 + this.showTree = true;
  393 + this.deviceChannelList = [];
  394 + this.parentChannelId = 0;
  395 + this.currentPage = 1;
  396 +
  397 + },
  398 + switchList: function (){
  399 + this.showTree = false;
  400 + this.deviceChannelList = [];
  401 + this.parentChannelId = 0;
  402 + this.currentPage = 1;
  403 + this.initData();
  404 + },
  405 + treeNodeClickEvent: function (device, data, isCatalog) {
  406 + console.log(device)
  407 + if (!!!data.channelId) {
  408 + this.parentChannelId = device.deviceId;
  409 + }else {
  410 + this.parentChannelId = data.channelId;
  411 + }
  412 + this.initData();
358 413 }
359 414  
360 415 }
... ...
web_src/src/components/common/DeviceTree.vue
... ... @@ -4,7 +4,7 @@
4 4 <el-header>่ฎพๅค‡ๅˆ—่กจ</el-header>
5 5 <el-main style="background-color: #ffffff;">
6 6 <div class="device-tree-main-box">
7   - <el-tree :props="defaultProps" :load="loadNode" lazy @node-click="handleNodeClick"@node-contextmenu="handleContextMenu" style="min-width: 100%; display:inline-block !important;">
  7 + <el-tree ref="gdTree" :props="defaultProps" :load="loadNode" lazy @node-click="handleNodeClick"@node-contextmenu="handleContextMenu" node-key="id" style="min-width: 100%; display:inline-block !important;">
8 8 <span class="custom-tree-node" slot-scope="{ node, data }" style="width: 100%">
9 9 <span v-if="node.data.type === 0 && node.data.online" title="ๅœจ็บฟ่ฎพๅค‡" class="device-online iconfont icon-jiedianleizhukongzhongxin2"></span>
10 10 <span v-if="node.data.type === 0 && !node.data.online " title="็ฆป็บฟ่ฎพๅค‡" class="device-offline iconfont icon-jiedianleizhukongzhongxin2"></span>
... ... @@ -47,98 +47,112 @@ export default {
47 47 }
48 48 };
49 49 },
50   - props: ['clickEvent', 'contextMenuEvent'],
  50 + props: ['device', 'onlyCatalog', 'clickEvent', 'contextMenuEvent'],
51 51 methods: {
52 52 handleNodeClick(data,node,element) {
53   - console.log("็‚นๅ‡ปไบ‹ไปถ")
54   - console.log(data)
  53 + let deviceNode = this.$refs.gdTree.getNode(data.userData.deviceId)
55 54 if(typeof (this.clickEvent) == "function") {
56   - this.clickEvent(data.userData)
  55 + this.clickEvent(deviceNode.data.userData, data.userData, data.type === 2)
57 56 }
58 57 },
59 58 handleContextMenu(event,data,node,element) {
60 59 console.log("ๅณ้”ฎ็‚นๅ‡ปไบ‹ไปถ")
  60 + let deviceNode = this.$refs.gdTree.getNode(data.userData.deviceId)
61 61 if(typeof (this.contextMenuEvent) == "function") {
62   - this.contextMenuEvent(event, data.userData)
  62 + this.contextMenuEvent(deviceNode.data.userData, event, data.userData, data.type === 2)
63 63 }
64 64 },
65 65 loadNode: function(node, resolve){
  66 + console.log(this.device)
66 67 if (node.level === 0) {
67   - this.deviceService.getAllDeviceList((data)=>{
68   - console.log(data)
69   - if (data.length > 0) {
70   - let nodeList = []
71   - for (let i = 0; i < data.length; i++) {
72   - console.log(data[i].name)
73   - let node = {
74   - name: data[i].name || data[i].deviceId,
75   - isLeaf: false,
76   - id: data[i].deviceId,
77   - type: data[i].online,
78   - online: data[i].online === 1,
79   - userData: data[i]
  68 + if (this.device) {
  69 + let node = {
  70 + name: this.device.name || this.device.deviceId,
  71 + isLeaf: false,
  72 + id: this.device.deviceId,
  73 + type: this.device.online,
  74 + online: this.device.online === 1,
  75 + userData: this.device
  76 + }
  77 + resolve([node])
  78 + }else {
  79 + this.deviceService.getAllDeviceList((data)=>{
  80 + console.log(data)
  81 + if (data.length > 0) {
  82 + let nodeList = []
  83 + for (let i = 0; i < data.length; i++) {
  84 + console.log(data[i].name)
  85 + let node = {
  86 + name: data[i].name || data[i].deviceId,
  87 + isLeaf: false,
  88 + id: data[i].deviceId,
  89 + type: data[i].online,
  90 + online: data[i].online === 1,
  91 + userData: data[i]
  92 + }
  93 + nodeList.push(node);
80 94 }
81   - nodeList.push(node);
  95 + resolve(nodeList)
  96 + }else {
  97 + resolve([])
82 98 }
83   - resolve(nodeList)
84   - }else {
85   - resolve([])
86   - }
87   - }, (list)=>{
  99 + }, (list)=>{
88 100 console.log("่ฎพๅค‡ๅŠ ่ฝฝๅฎŒๆˆ")
89   - }, (error)=>{
  101 + }, (error)=>{
90 102  
91   - })
92   - }
93   - if (node.level === 1) {
  103 + })
  104 + }
  105 + }else {
94 106 let channelArray = []
95   - this.deviceService.getAllChannel(true, true, node.data.id, catalogData =>{
  107 +
  108 + this.deviceService.getTree(node.data.userData.deviceId, node.data.id, this.onlyCatalog, catalogData =>{
  109 + console.log(catalogData)
96 110 channelArray = channelArray.concat(catalogData)
97 111 this.channelDataHandler(channelArray, resolve)
98 112 },(endCatalogData) => {
99   - this.deviceService.getAllChannel(false, true, node.data.id, channelData => {
100   - channelArray = channelArray.concat(channelData)
101   - this.channelDataHandler(channelArray, resolve)
102   - }, endChannelList => {
103 113  
104   - })
105   - })
106   - }else if (node.level > 1){
107   - let channelArray = []
108   - this.deviceService.getAllSubChannel(true, node.data.deviceId, node.data.id, (catalogData)=>{
109   - channelArray = channelArray.concat(catalogData)
110   - this.channelDataHandler(channelArray, resolve)
111   - }, (endCatalogData)=>{
112   - this.deviceService.getAllSubChannel(false, node.data.deviceId, node.data.id, (channelData)=>{
113   - channelArray = channelArray.concat(channelData)
114   - this.channelDataHandler(channelArray, resolve)
115   - })
116 114 })
117 115 }
  116 +
118 117 },
119 118 channelDataHandler: function (data, resolve) {
120 119 if (data.length > 0) {
121 120 let nodeList = []
122   - for (let i = 0; i < data.length; i++) {
  121 + for (let i = 0; i <data.length; i++) {
  122 + let item = data[i];
123 123 let type = 3;
124   - if (data[i].subCount > 0 || data[i].parental === 1) {
  124 + if (item.id.length <= 10) {
125 125 type = 2;
126   - }else if (data[i].ptztype === 1 ) { // 1-็ƒๆœบ;2-ๅŠ็ƒ;3-ๅ›บๅฎšๆžชๆœบ;4-้ฅๆŽงๆžชๆœบ
127   - type = 4;
128   - }else if (data[i].ptztype === 2) {
129   - type = 5;
130   - }else if (data[i].ptztype === 3 || data[i].ptztype === 4) {
131   - type = 6;
  126 + }else {
  127 + if (item.id.length > 14) {
  128 + let channelType = item.id.substring(10, 13)
  129 + console.log("channelType: " + channelType)
  130 + if (channelType === '215' || channelType === '216') {
  131 + type = 2;
  132 + }
  133 + console.log(type)
  134 + if (item.basicData.ptztype === 1 ) { // 1-็ƒๆœบ;2-ๅŠ็ƒ;3-ๅ›บๅฎšๆžชๆœบ;4-้ฅๆŽงๆžชๆœบ
  135 + type = 4;
  136 + }else if (item.basicData.ptztype === 2) {
  137 + type = 5;
  138 + }else if (item.basicData.ptztype === 3 || item.basicData.ptztype === 4) {
  139 + type = 6;
  140 + }
  141 + }else {
  142 + if (item.basicData.subCount > 0 || item.basicData.parental === 1) {
  143 + type = 2;
  144 + }
  145 + }
132 146 }
133 147 let node = {
134   - name: data[i].name || data[i].channelId,
135   - isLeaf: data[i].subCount === 0,
136   - id: data[i].channelId,
137   - deviceId: data[i].deviceId,
  148 + name: item.name || item.basicData.channelId,
  149 + isLeaf: type !== 2,
  150 + id: item.id,
  151 + deviceId: item.deviceId,
138 152 type: type,
139   - online: data[i].status === 1,
140   - hasGPS: data[i].longitude*data[i].latitude !== 0,
141   - userData: data[i]
  153 + online: item.basicData.status === 1,
  154 + hasGPS: item.basicData.longitude*item.basicData.latitude !== 0,
  155 + userData: item.basicData
142 156 }
143 157 nodeList.push(node);
144 158 }
... ... @@ -146,6 +160,9 @@ export default {
146 160 }else {
147 161 resolve([])
148 162 }
  163 + },
  164 + reset: function (){
  165 + this.$forceUpdate();
149 166 }
150 167 },
151 168 destroyed() {
... ...
web_src/src/components/common/DeviceTreeForZtree.vue 0 โ†’ 100644
  1 +<template>
  2 + <div id="DeviceTree" style="width: 100%;height: 100%; background-color: #FFFFFF; overflow: auto">
  3 + <el-container>
  4 + <el-header>่ฎพๅค‡ๅˆ—่กจ</el-header>
  5 + <el-main style="background-color: #ffffff;">
  6 + <div class="device-tree-main-box">
  7 + <tree
  8 + :nodes="nodes"
  9 + @onClick="onClick"
  10 + @onCheck="onCheck"
  11 + @onExpand="onExpand"
  12 + @onCreated="handleCreated"
  13 + />
  14 + </div>
  15 + </el-main>
  16 + </el-container>
  17 + </div>
  18 +</template>
  19 +
  20 +<script>
  21 +import DeviceService from "../service/DeviceService.js";
  22 +import tree from "vue-giant-tree";
  23 +
  24 +export default {
  25 + name: 'DeviceTreeForZtree',
  26 + components: {
  27 + tree
  28 + },
  29 + data() {
  30 + return {
  31 + deviceService: new DeviceService(),
  32 + device: null,
  33 + nodes:[],
  34 + setting: {
  35 + callback: {
  36 + beforeExpand: this.beforeExpand
  37 + },
  38 + // async: {
  39 + // enable: true,
  40 + // type: "get",
  41 + // url: `/api/device/query/tree`,
  42 + // contentType: "application/json",
  43 + // // autoParam: ["pid=parentId"],
  44 + // },
  45 + check: {
  46 + enable: false,
  47 + },
  48 + edit: {
  49 + enable: false,
  50 + }
  51 + },
  52 + defaultProps: {
  53 + children: 'children',
  54 + label: 'name',
  55 + isLeaf: 'isLeaf'
  56 + }
  57 + };
  58 + },
  59 + props: ['clickEvent', 'contextMenuEvent'],
  60 + mounted() {
  61 + this.deviceService.getAllDeviceList((data)=>{
  62 + console.log(data)
  63 + for (let i = 0; i < data.length; i++) {
  64 + console.log(data[i].name)
  65 + let node = {
  66 + name: data[i].name || data[i].deviceId,
  67 + id: data[i].deviceId,
  68 + isParent: true,
  69 + }
  70 + this.nodes.push(node)
  71 + }
  72 + }, (list)=>{
  73 + console.log("่ฎพๅค‡ๅŠ ่ฝฝๅฎŒๆˆ")
  74 + })
  75 + },
  76 + methods: {
  77 + onClick(evt, treeId, treeNode) {
  78 + console.log(evt)
  79 + console.log(treeId)
  80 + console.log(treeNode)
  81 + },
  82 + onCheck(evt, treeId, treeNode) {
  83 + console.log(evt)
  84 + },
  85 + beforeExpand(treeId, treeNode) {
  86 + console.log(treeId)
  87 + console.log(treeNode)
  88 + return true;
  89 + },
  90 + onExpand(evt, treeId, treeNode) {
  91 + // console.log(evt)
  92 + // console.log(treeId)
  93 + // console.log(treeNodes)
  94 + },
  95 + handleCreated(ztreeObj) {
  96 + console.log(ztreeObj)
  97 + }
  98 + }
  99 +}
  100 +</script>
  101 +
  102 +<style>
  103 +.device-tree-main-box{
  104 + text-align: left;
  105 +}
  106 +.device-online{
  107 + color: #252525;
  108 +}
  109 +.device-offline{
  110 + color: #727272;
  111 +}
  112 +</style>
... ...
web_src/src/components/dialog/deviceEdit.vue
... ... @@ -45,6 +45,12 @@
45 45 <el-option key="GCJ02" label="GCJ02" value="GCJ02"></el-option>
46 46 </el-select>
47 47 </el-form-item>
  48 + <el-form-item label="็›ฎๅฝ•็ป“ๆž„" prop="treeType" >
  49 + <el-select v-model="form.treeType" style="float: left; width: 100%" >
  50 + <el-option key="WGS84" label="่กŒๆ”ฟๅŒบๅˆ’" value="CivilCode"></el-option>
  51 + <el-option key="GCJ02" label="ไธšๅŠกๅˆ†็ป„" value="BusinessGroup"></el-option>
  52 + </el-select>
  53 + </el-form-item>
48 54 <el-form-item label="็›ฎๅฝ•่ฎข้˜…" title="0ไธบๅ–ๆถˆ่ฎข้˜…" prop="subscribeCycleForCatalog" >
49 55 <el-input v-model="form.subscribeCycleForCatalog" clearable ></el-input>
50 56 </el-form-item>
... ...
web_src/src/components/live.vue
... ... @@ -107,20 +107,24 @@ export default {
107 107 console.log(idx);
108 108 this.clear(idx.substring(idx.length - 1))
109 109 },
110   - clickEvent: function (data) {
111   - if (data.channelId && data.subCount == 0) {
112   - this.sendDevicePush(data)
  110 + clickEvent: function (device, data, isCatalog) {
  111 + if (data.channelId && !isCatalog) {
  112 + if (device.online === 0) {
  113 + this.$message.error('่ฎพๅค‡็ฆป็บฟ!ไธๅ…่ฎธ็‚นๆ’ญ');
  114 + }else {
  115 + this.sendDevicePush(data)
  116 + }
113 117 }
114 118 },
115   - contextMenuEvent: function (data) {
  119 + contextMenuEvent: function (device, event, data, isCatalog) {
116 120  
117 121 },
118 122 //้€š็Ÿฅ่ฎพๅค‡ไธŠไผ ๅช’ไฝ“ๆต
119 123 sendDevicePush: function (itemData) {
120   - if (itemData.status === 0) {
121   - this.$message.error('่ฎพๅค‡็ฆป็บฟ!');
122   - return
123   - }
  124 + // if (itemData.status === 0) {
  125 + // this.$message.error('่ฎพๅค‡็ฆป็บฟ!');
  126 + // return
  127 + // }
124 128 this.save(itemData)
125 129 let deviceId = itemData.deviceId;
126 130 // this.isLoging = true;
... ...
web_src/src/components/map.vue
... ... @@ -16,7 +16,8 @@
16 16 <el-descriptions class="margin-top" :title="channel.name" :column="1" :colon="true" size="mini" :labelStyle="labelStyle" >
17 17 <el-descriptions-item label="็ผ–ๅท" >{{channel.channelId}}</el-descriptions-item>
18 18 <el-descriptions-item label="ๅž‹ๅท">{{channel.model}}</el-descriptions-item>
19   - <el-descriptions-item label="็ป็บฌๅบฆ" >{{channel.longitude}},{{channel.latitude}}</el-descriptions-item>
  19 + <el-descriptions-item label="็ปๅบฆ" >{{channel[longitudeStr]}}</el-descriptions-item>
  20 + <el-descriptions-item label="็บฌๅบฆ" >{{channel[latitudeStr]}}</el-descriptions-item>
20 21 <el-descriptions-item label="็”ŸไบงๅŽ‚ๅ•†">{{channel.manufacture}}</el-descriptions-item>
21 22 <el-descriptions-item label="่กŒๆ”ฟๅŒบๅŸŸ" >{{channel.civilCode}}</el-descriptions-item>
22 23 <el-descriptions-item label="่ฎพๅค‡ๅฝ’ๅฑž" >{{channel.owner}}</el-descriptions-item>
... ... @@ -28,7 +29,7 @@
28 29 </el-descriptions-item>
29 30 </el-descriptions>
30 31 <div style="padding-top: 10px">
31   - <el-button type="primary" size="small" title="ๆ’ญๆ”พ" icon="el-icon-video-play" @click="play(channel)"></el-button>
  32 + <el-button v-bind:disabled="device == null || device.online === 0" type="primary" size="small" title="ๆ’ญๆ”พ" icon="el-icon-video-play" @click="play(channel)"></el-button>
32 33 <el-button type="primary" size="small" title="็ผ–่พ‘ไฝ็ฝฎ" icon="el-icon-edit" @click="edit(channel)"></el-button>
33 34 <el-button type="primary" size="small" title="่ฝจ่ฟนๆŸฅ่ฏข" icon="el-icon-map-location" @click="getTrace(channel)"></el-button>
34 35 </div>
... ... @@ -64,11 +65,14 @@ export default {
64 65 layer: null,
65 66 lineLayer: null,
66 67 channel: null,
  68 + device: null,
67 69 infoBoxId: null,
68 70 labelStyle: {
69 71 width: "56px"
70 72 },
71 73 isLoging: false,
  74 + longitudeStr: "longitude",
  75 + latitudeStr: "latitude",
72 76 };
73 77 },
74 78 created() {
... ... @@ -78,17 +82,27 @@ export default {
78 82 setTimeout(()=>{ // ๅปถ่ฟŸไปฅ็ญ‰ๅพ…ๅœฐๅ›พๅŠ ่ฝฝๅฎŒๆˆ TODO ๅŽ็ปญไฟฎๆ”นไธบ้€š่ฟ‡ๆ˜ฏๅฎž้™…่ฟ™๏ผ›็Šถๆ€ๅŠ ๅ›ž่ฐƒๅฎŒๆˆ
79 83 this.deviceService.getAllChannel(false, false, this.$route.query.deviceId, this.channelsHandler)
80 84 }, 1000)
81   -
  85 + }
  86 + if (window.mapParam.coordinateSystem == "GCJ-02") {
  87 + this.longitudeStr = "longitudeGcj02";
  88 + this.latitudeStr = "latitudeGcj02";
  89 + }else if (window.mapParam.coordinateSystem == "WGS84") {
  90 + this.longitudeStr = "longitudeWgs84";
  91 + this.latitudeStr = "latitudeWgs84";
  92 + }else {
  93 + this.longitudeStr = "longitude";
  94 + this.latitudeStr = "latitude";
82 95 }
83 96 },
84 97 destroyed() {
85 98  
86 99 },
87 100 methods: {
88   - clickEvent: function (data) {
89   - if (data.channelId && data.subCount == 0) {
  101 + clickEvent: function (device, data, isCatalog) {
  102 + this.device = device;
  103 + if (data.channelId && !isCatalog) {
90 104 // ็‚นๅ‡ป้€š้“
91   - if (data.longitude * data.latitude === 0) {
  105 + if (data[this.longitudeStr] * data[this.latitudeStr] === 0) {
92 106 this.$message.error('ๆœช่Žทๅ–ๅˆฐไฝ็ฝฎไฟกๆฏ');
93 107 } else {
94 108 if (this.layer != null) {
... ... @@ -96,26 +110,29 @@ export default {
96 110 }
97 111 this.closeInfoBox()
98 112 this.layer = this.$refs.map.addLayer([{
99   - position: [data.longitude, data.latitude],
  113 + position: [data[this.longitudeStr], data[this.latitudeStr]],
100 114 image: {
101 115 src: this.getImageByChannel(data),
102 116 anchor: [0.5, 1]
103 117 },
104 118 data: data
105 119 }], this.featureClickEvent)
106   - this.$refs.map.panTo([data.longitude, data.latitude], mapParam.maxZoom)
  120 + this.$refs.map.panTo([data[this.longitudeStr], data[this.latitudeStr]], mapParam.maxZoom)
107 121 }
108 122 }
109 123 },
110   - contextmenuEventHandler: function (event, data) {
111   - if (data.channelId && data.subCount == 0) {
  124 + contextmenuEventHandler: function (device, event, data, isCatalog) {
  125 + console.log(device)
  126 + console.log(device.online)
  127 + this.device = device;
  128 + if (data.channelId && !isCatalog) {
112 129 // ็‚นๅ‡ป้€š้“
113 130 this.$contextmenu({
114 131 items: [
115 132 {
116 133 label: "ๆ’ญๆ”พ",
117 134 icon: "el-icon-video-play",
118   - disabled: false,
  135 + disabled: device.online === 0,
119 136 onClick: () => {
120 137 this.play(data);
121 138 }
... ... @@ -183,22 +200,11 @@ export default {
183 200 this.clean()
184 201 this.closeInfoBox()
185 202 let params = [];
186   - let longitudeStr;
187   - let latitudeStr;
188   - if (window.mapParam.coordinateSystem == "GCJ-02") {
189   - longitudeStr = "longitudeGcj02";
190   - latitudeStr = "latitudeGcj02";
191   - }else if (window.mapParam.coordinateSystem == "WGS84") {
192   - longitudeStr = "longitudeWgs84";
193   - latitudeStr = "latitudeWgs84";
194   - }else {
195   - longitudeStr = "longitude";
196   - latitudeStr = "latitude";
197   - }
  203 +
198 204  
199 205 for (let i = 0; i < channels.length; i++) {
200   - let longitude = channels[i][longitudeStr];
201   - let latitude = channels[i][latitudeStr];
  206 + let longitude = channels[i][this.longitudeStr];
  207 + let latitude = channels[i][this.latitudeStr];
202 208 if (longitude * latitude === 0) {
203 209 continue;
204 210 }
... ... @@ -217,7 +223,7 @@ export default {
217 223 this.layer = this.$refs.map.addLayer(params, this.featureClickEvent)
218 224 console.log(4)
219 225 if (params.length === 1) {
220   - this.$refs.map.panTo([channels[0][longitudeStr], channels[0][latitudeStr]], mapParam.maxZoom)
  226 + this.$refs.map.panTo([channels[0][this.longitudeStr], channels[0][this.latitudeStr]], mapParam.maxZoom)
221 227 } else if (params.length > 1) {
222 228 this.$refs.map.fit(this.layer)
223 229 } else {
... ... @@ -266,19 +272,7 @@ export default {
266 272 this.channel = channels[0]
267 273 }
268 274 this.$nextTick(() => {
269   - let longitudeStr;
270   - let latitudeStr;
271   - if (window.mapParam.coordinateSystem == "GCJ-02") {
272   - longitudeStr = "longitudeGcj02";
273   - latitudeStr = "latitudeGcj02";
274   - }else if (window.mapParam.coordinateSystem == "WGS84") {
275   - longitudeStr = "longitudeWgs84";
276   - latitudeStr = "latitudeWgs84";
277   - }else {
278   - longitudeStr = "longitude";
279   - latitudeStr = "latitude";
280   - }
281   - let position = [this.channel[longitudeStr], this.channel[latitudeStr]];
  275 + let position = [this.channel[this.longitudeStr], this.channel[this.latitudeStr]];
282 276 this.infoBoxId = this.$refs.map.openInfoBox(position, this.$refs.infobox, [0, -50])
283 277 })
284 278 },
... ...
web_src/src/components/service/DeviceService.js
... ... @@ -133,6 +133,49 @@ class DeviceService{
133 133 if (typeof (callback) == "function") callback(res.data)
134 134 }).catch(errorCallback);
135 135 }
  136 +
  137 + getTree(deviceId, id, param3, param4) {
  138 +
  139 + }
  140 +
  141 + getTree(deviceId, parentId, onlyCatalog, callback, endCallback, errorCallback) {
  142 + let currentPage = 1;
  143 + let count = 100;
  144 + let catalogList = []
  145 + this.getTreeIteration(deviceId, parentId, onlyCatalog, catalogList, currentPage, count, callback, endCallback, errorCallback)
  146 + }
  147 +
  148 + getTreeIteration(deviceId, parentId, onlyCatalog, catalogList, currentPage, count, callback, endCallback, errorCallback) {
  149 + this.getTreeInfo(deviceId, parentId, onlyCatalog, currentPage, count, (data) => {
  150 + if (data.list) {
  151 + if (typeof (callback) == "function") callback(data.list)
  152 + catalogList = catalogList.concat(data.list);
  153 + if (catalogList.length < data.total) {
  154 + currentPage ++
  155 + this.getTreeIteration(deviceId, parentId, onlyCatalog, catalogList, currentPage, count, callback, endCallback, errorCallback)
  156 + }else {
  157 + if (typeof (endCallback) == "function") endCallback(catalogList)
  158 + }
  159 + }
  160 + }, errorCallback)
  161 + }
  162 + getTreeInfo(deviceId, parentId, onlyCatalog, currentPage, count, callback, errorCallback) {
  163 + if (onlyCatalog == null || typeof onlyCatalog === "undefined") {
  164 + onlyCatalog = false;
  165 + }
  166 + this.$axios({
  167 + method: 'get',
  168 + url: `/api/device/query/tree/${deviceId}`,
  169 + params:{
  170 + page: currentPage,
  171 + count: count,
  172 + parentId: parentId,
  173 + onlyCatalog: onlyCatalog
  174 + }
  175 + }).then((res) =>{
  176 + if (typeof (callback) == "function") callback(res.data)
  177 + }).catch(errorCallback);
  178 + }
136 179 }
137 180  
138 181 export default DeviceService;
... ...
web_src/src/router/index.js
... ... @@ -59,7 +59,7 @@ export default new VueRouter({
59 59 component: streamProxyList,
60 60 },
61 61 {
62   - path: '/channelList/:deviceId/:parentChannelId/:count/:page',
  62 + path: '/channelList/:deviceId/:parentChannelId/',
63 63 name: 'channelList',
64 64 component: channelList,
65 65 },
... ...
web_src/static/css/iconfont.css
1 1 @font-face {
2 2 font-family: "iconfont"; /* Project id 1291092 */
3   - src: url('iconfont.woff2?t=1650436696596') format('woff2');
  3 + src: url('iconfont.woff2?t=1655453611360') format('woff2'),
  4 + url('iconfont.woff?t=1655453611360') format('woff'),
  5 + url('iconfont.ttf?t=1655453611360') format('truetype');
4 6 }
5 7  
6 8 .iconfont {
... ... @@ -11,6 +13,30 @@
11 13 -moz-osx-font-smoothing: grayscale;
12 14 }
13 15  
  16 +.icon-list:before {
  17 + content: "\e7de";
  18 +}
  19 +
  20 +.icon-tree:before {
  21 + content: "\e7df";
  22 +}
  23 +
  24 +.icon-shipin:before {
  25 + content: "\e7db";
  26 +}
  27 +
  28 +.icon-shipin1:before {
  29 + content: "\e7dc";
  30 +}
  31 +
  32 +.icon-shipin2:before {
  33 + content: "\e7dd";
  34 +}
  35 +
  36 +.icon-LC_icon_gps_fill:before {
  37 + content: "\e7da";
  38 +}
  39 +
14 40 .icon-jiedianleizhukongzhongxin1:before {
15 41 content: "\e9d0";
16 42 }
... ...
web_src/static/css/iconfont.woff2
No preview for this file type