wenhongquan 2 år sedan
förälder
incheckning
70ca6a4f80
7 ändrade filer med 1816 tillägg och 1420 borttagningar
  1. 24 25
      .env.dev
  2. 3 3
      index.html
  3. 651 560
      public/meeting.js
  4. 317 317
      public/webClient/initWebSocket.js
  5. 673 434
      public/webClient/webClient_initWnd.js
  6. 135 79
      src/components/MarkerMap/index.tsx
  7. 13 2
      src/store/useMarkerStore.ts

+ 24 - 25
.env.dev

@@ -3,30 +3,29 @@
 NODE_ENV = dev
 
 
-#VITE_API_SERVER = 'http://10.11.208.17:30876'
-#VITE_MAP_SERVER = 'http://10.11.208.19:21009'
-#VITE_MAP_KEY = '38025fbc9e3f4e1fb64b34b2b55080ab'
-#VITE_LOGIN_SERVER = 'http://10.11.208.32:9999'
+VITE_API_SERVER = 'http://10.11.208.17:30876'
+VITE_MAP_SERVER = 'http://10.11.208.19:21009'
+VITE_MAP_KEY = '38025fbc9e3f4e1fb64b34b2b55080ab'
+VITE_LOGIN_SERVER = 'http://10.11.208.32:9999'
+VITE_DH_SERVER = 'http://sqdh.xt.wenhq.top:8083'
+VITE_SP_USER = 'huashe'
+VITE_MAP_SOLUTION = '12887'
+VITE_URL_YXJC = 'http://10.11.208.13:30080/tles-hcdp-web/#/OperationMonitoring'
+VITE_URL_ZHDD = 'http://10.11.208.13:30080/tles-hcdp-web/#/HCdpView'
+VITE_URL_YJZH = 'http://10.11.208.12:31000/sqpchd/#/home'
+VITE_URL_YXJCS = 'http://10.11.208.39:9999/screen/#/home/country-home'
 
-#VITE_DH_SERVER = 'http://sqdh.xt.wenhq.top:8083'
-#VITE_SP_USER = 'huashe1'
-#VITE_MAP_SOLUTION = '12887'
-#VITE_URL_YXJC = 'http://10.11.208.13:30080/tles-hcdp-web/#/OperationMonitoring'
-#VITE_URL_ZHDD = 'http://10.11.208.13:30080/tles-hcdp-web/#/HCdpView'
-#VITE_URL_YJZH = 'http://10.11.208.12:31000/sqpchd/#/home'
-#VITE_URL_YXJCS = 'http://10.11.208.39:9999/screen/#/home/country-home'
-
-VITE_API_SERVER = 'https://tocc.jtj.suqian.gov.cn:9999/server'
-VITE_MAP_SERVER = 'https://tocc.jtj.suqian.gov.cn:21100'
-VITE_MAP_KEY = '63b68d77877a4ed686e8bc30894975e5'
-VITE_LOGIN_SERVER = 'https://tocc.jtj.suqian.gov.cn:9999'
-VITE_BG_SERVER = 'https://tocc.jtj.suqian.gov.cn:30030/sqbg'
-VITE_DH_SERVER = 'http://sqtestdh.xt.wenhq.top:8083'
-VITE_SP_USER = 'huashe2'
-VITE_MAP_KEY = '63b68d77877a4ed686e8bc30894975e5'
-VITE_MAP_SOLUTION = '222525'
-VITE_URL_YXJC = 'http://10.11.230.144:30080/tles-hcdp-web/#/OperationMonitoring'
-VITE_URL_ZHDD = 'http://10.11.230.144:30080/tles-hcdp-web/#/HCdpView'
-VITE_URL_YJZH = 'http://10.11.230.154:31000/sqpchd/#/home'
-VITE_URL_YXJCS = 'http://10.11.230.150:30010/screen/#/home/country-home'
+#VITE_API_SERVER = 'https://tocc.jtj.suqian.gov.cn:9999/server'
+#VITE_MAP_SERVER = 'https://tocc.jtj.suqian.gov.cn:21100'
+#VITE_MAP_KEY = '63b68d77877a4ed686e8bc30894975e5'
+#VITE_LOGIN_SERVER = 'https://tocc.jtj.suqian.gov.cn:9999'
+#VITE_BG_SERVER = 'https://tocc.jtj.suqian.gov.cn:30030/sqbg'
+#VITE_DH_SERVER = 'http://sqtestdh.xt.wenhq.top:8083'
+#VITE_SP_USER = 'huashe2'
+#VITE_MAP_KEY = '63b68d77877a4ed686e8bc30894975e5'
+#VITE_MAP_SOLUTION = '222525'
+#VITE_URL_YXJC = 'http://10.11.230.144:30080/tles-hcdp-web/#/OperationMonitoring'
+#VITE_URL_ZHDD = 'http://10.11.230.144:30080/tles-hcdp-web/#/HCdpView'
+#VITE_URL_YJZH = 'http://10.11.230.154:31000/sqpchd/#/home'
+#VITE_URL_YXJCS = 'http://10.11.230.150:30010/screen/#/home/country-home'
 

+ 3 - 3
index.html

@@ -16,8 +16,8 @@
     <!-- <script src="./flexible.js"></script> -->
     <script src="./login.js?time=2"></script>
     <script src="./webClient/defaultConfig.js?time=113"></script>
-    <script src="./webClient/initWebSocket.js?time=113"></script>
-    <script src="./webClient/webClient_initWnd.js?time=1167"></script>
+    <script src="./webClient/initWebSocket.js?time=124"></script>
+    <script src="./webClient/webClient_initWnd.js?time=1221"></script>
 
 
 
@@ -26,7 +26,7 @@
     <!--    <script src="../webClient/webClient_initWnd.js"></script>-->
     <script src="./js/common.js?time=3"></script>
 
-    <script src="./meeting.js?time=15"></script>
+    <script src="./meeting.js?time=42"></script>
     <script src="./js/videoplay.js?time=2"></script>
 
     <!-- <script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.1.1/build/g6.js"></script> -->

+ 651 - 560
public/meeting.js

@@ -1,16 +1,25 @@
 
 
+function guid() {
+    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
+        var r = Math.random() * 16 | 0,
+            v = c == 'x' ? r : (r & 0x3 | 0x8);
+        return v.toString(16);
+    });
+}
 var Meeting = function Meeting() {
     this.localUserInfo = {
-        //创建会议的参数对象
-        name: "", //会议名称
-        masterId: "", //主持人用户ID
-        masterName: "", //主持人名字
-        masterNumber: "", //主持人号码
-        region: "", //号码对应的PAAS域ID
-        record: true, //是否录像录音true:录像录音 false:不录
-        type: "video", //会议类型“audio”: 音频会议 “video”: 音视频会议
-        mode: "group", //会议模式“p2p”:点对点“group”:群聊
+      //创建会议的参数对象
+      id: `MID${guid()}`,
+      masterDomain: '3981f448463d4cdb8735083a5114e626',
+      name: '', //会议名称
+      // masterId: "", //主持人用户ID
+      masterName: 'zhihui', //主持人名字
+      masterNumber: '', //主持人号码
+      region: '', //号码对应的PAAS域ID
+      record: true, //是否录像录音true:录像录音 false:不录
+      type: 'video', //会议类型“audio”: 音频会议 “video”: 音视频会议
+      mode: 'group', //会议模式“p2p”:点对点“group”:群聊
     };
     this.InvitedMembers = {
         //邀请会议的参数对象
@@ -53,12 +62,13 @@ var Meeting = function Meeting() {
         member: [],
     };
     this.inviteSelf = {
-        userName: "",
-        department: "",
-        userId: "",
-        region: "",
-        number: "",
-        type: "client",
+      inviteId: '',
+      department: '',
+      inviteName: '',
+      inviteDomain:'',
+      region: '',
+      inviteNumber: '',
+      type: 'client',
     };
     this.meetingInfoback = ""; //各个接口返回信息
     this.$Message = {
@@ -72,574 +82,655 @@ var Meeting = function Meeting() {
 };
 
 Meeting.prototype = {
-    initSocket(userCode, callback) {
-        const self = this;
-        //初始websocket实例,保存在window中方便调用。一个浏览器tab页面只能初始化一次。所有的控件窗口,通过该websocket实例去生成不同的窗口实例,不同的控件窗口通过自己的窗口实例去调用初始化、关闭、隐藏等
-        window.theSocket = this.theSocket = new InitWebSocketClass(
-            userCode,
-            localStorage.getItem("token"), {
-                //客户端登陆成功通知;
-                loginSuccess: (v) => {
-                    console.log("loginSuccess-->", v);
-                    // self.initWnd();
-                },
-                //客户端窗口被拉起通知
-                onCreateVideoSuccess: (v) => {
-                    console.log("客户端onCreateVideoSuccess-----", v);
-                },
-                //重点:统一分发客户端ws消息;vue 可以统一用$bus分发.第三方消息分发自定
-                onSocketBackInfos: (data) => {
-                    //视频窗口创建成功通知
-                    if (
-                        data &&
-                        data.method === "createVideoDialogReuslt" &&
-                        data.params.result === 0
-                    ) {
-                        if (data.params.handleName === "#" + this.targetid) {
-                            //客户端窗口创建好后,界面显示窗口;
-                            callback && callback()
-                            self[self.targetid].resize();
-                            this.$Message.warning("视频窗口创建成功!");
-                        }
-                    }
-                },
+  initSocket(userCode, callback) {
+    const self = this;
+    //初始websocket实例,保存在window中方便调用。一个浏览器tab页面只能初始化一次。所有的控件窗口,通过该websocket实例去生成不同的窗口实例,不同的控件窗口通过自己的窗口实例去调用初始化、关闭、隐藏等
+    window.theSocket = this.theSocket = new InitWebSocketClass(
+      userCode,
+      localStorage.getItem('token'),
+      {
+        //客户端登陆成功通知;
+        loginSuccess: (v) => {
+          console.log('loginSuccess-->', v);
+          // self.initWnd();
+        },
+        //客户端窗口被拉起通知
+        onCreateVideoSuccess: (v) => {
+          console.log('客户端onCreateVideoSuccess-----', v);
+        },
+        //重点:统一分发客户端ws消息;vue 可以统一用$bus分发.第三方消息分发自定
+        onSocketBackInfos: (data) => {
+          //视频窗口创建成功通知
+          if (
+            data &&
+            data.method === 'createVideoDialogReuslt' &&
+            data.params.result === 0
+          ) {
+            if (data.params.handleName === '#' + this.targetid) {
+              //客户端窗口创建好后,界面显示窗口;
+              callback && callback();
+              self[self.targetid].resize();
+              this.$Message.warning('视频窗口创建成功!');
             }
+          }
+        },
+      },
+    );
+    //socket实例初始化websocket回调方法;
+    window.theSocket
+      .initWebSocket()
+      .then((v) => {
+        if (v) {
+          this.$Message.warning('视频插件登陆完成!');
+        }
+        callback();
+      })
+      .catch((v) => {
+        this.$Message.warning(
+          '若要观看实时视频,请先安装视频插件大华应急指挥调度实战平台客户端打开失败, 请尝试刷新页面重试',
         );
-        //socket实例初始化websocket回调方法;
-        window.theSocket
-            .initWebSocket()
-            .then((v) => {
-                if (v) {
-                    this.$Message.warning("视频插件登陆完成!");
-                }
-                callback();
-            })
-            .catch((v) => {
-                this.$Message.warning("若要观看实时视频,请先安装视频插件大华应急指挥调度实战平台客户端打开失败, 请尝试刷新页面重试");
-            });
-
-    },
-    //初始化视频窗口实例,先获取自己用户code,再初始化窗口,严格按照封装参数传,别漏了
-    getUserCode(callback) {
-        let self = this;
-
-        $.ajax({
-            type: "GET",
-            url: setting.URL + "/ras/user/info",
-            contentType: "application/json", //如果提交的是json数据类型,则必须有此参数,表示提交的数据类型
-            dateType: "json",
-            beforeSend: (xhr) => {
-                xhr.setRequestHeader("X-Subject-Token", localStorage.getItem("token"));
-                xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
-            },
-            success: (res) => {
-                if(typeof res === 'string'){
-                    res=JSON.parse(res);
-                }
-
-                console.log(res && res.userCode)
-                //obj
-                if (res && res.userCode) {
-                    let {
-                        userCode
-                    } = res;
-                    //初始化websocket;
-
-
-                    return self.initSocket(userCode, callback);
-                }
-            },
-        });
-    },
-    //初始化视频窗口-dom
-    initWnd() {
-        //左边窗口类型参数 分割 2行2列
-        const typeObj = {
-            rows: 1,
-            cols: 1,
-            wndSpaceing: 0,
-            embedVideoMode: true,
-            playerCtrlBarEnable: false,
-            displayMode: 3,
-            playMode: 0,
-            playParams: {},
-            webControlExpend: true
-        };
-        //左边窗口实例
-        window[this.targetid] = this[this.targetid] = new VideoPlay(
-            "#" + this.targetid,
-            window.theSocket.websocket, //一个浏览器tab页面公用一个
-            window.theSocket.socketCode, //一个浏览器tab页面公用一个
-            typeObj
-        );
-        //左边窗口初始化
-        this[this.targetid].init();
-    },
-    //播放视频
-    playVideo(item) {
+      });
+  },
+  //初始化视频窗口实例,先获取自己用户code,再初始化窗口,严格按照封装参数传,别漏了
+  getUserCode(callback) {
+    let self = this;
 
-        if (!window.theSocket.websocket) {
-            this.$Message.warning("请先打开视频插件");
-            return;
-        }
-        if (item.type == "client") {
-            this.slectOptionmini(item.userId).then((arr) => {
-                if (arr) {
-                    this[this.targetid].openAppVideo(arr);
-                }
-            });
-        } else if (item.type == "single") {
-            //播放单兵视频
-            this.pullFlow(item.channelId);
-        } else if (item.type == "vehicle") {
-            //播放车载视频
-            this.pullFlow(item.channelId);
-        } else if (item.type == "uav_dev") {
-            //播放无人机视频
-            this.pullFlow(item.channelId);
+    $.ajax({
+      type: 'GET',
+      url: setting.URL + '/ras/user/info',
+      contentType: 'application/json', //如果提交的是json数据类型,则必须有此参数,表示提交的数据类型
+      dateType: 'json',
+      beforeSend: (xhr) => {
+        xhr.setRequestHeader('X-Subject-Token', localStorage.getItem('token'));
+        xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');
+      },
+      success: (res) => {
+        if (typeof res === 'string') {
+          res = JSON.parse(res);
         }
-    },
-    //   setDesignDivision(rows, cols) {
-    //     // console.log(this.localUserInfo);
-    //     const params = JSON.stringify({
-    //         loginIp: setting.URL,
-    //         method: "SetDesignDivision",
-    //         userCode: this.localUserInfo.masterId,
-    //         params: {
-    //             handleName:'#vPlayArea',
-    //             rows: Number(rows),
-    //             cols: Number(cols)
-    //         },
-    //         socketCode: window.theSocket.socketCode
-    //     });
-    //     console.log(params);
-    //     this.webSocketSend(params);
-    // },
-    //设备视频拉流
-    pullFlow(chinnelId) {
 
-        if (chinnelId) {
-            this[this.targetid].showBrower(true);
-            this[this.targetid].dragResize(0, 0, 0, 0);
-            window[this.targetid] && window[this.targetid].realTimeVideo && window[this.targetid].realTimeVideo([{
-                "channelId": chinnelId
-            }]);
+        console.log(res && res.userCode);
+        //obj
+        if (res && res.userCode) {
+          let { userCode } = res;
+          //初始化websocket;
+
+          return self.initSocket(userCode, callback);
         }
-    },
-    /*  创建会商  */
-    async creatMeeting() {
-        let _this = this;
-        if (!_this.localUserInfo.name) {
-            _this.$Message.warning("请创建会商名称");
-            return;
+      },
+    });
+  },
+  //初始化视频窗口-dom
+  initWnd() {
+    //左边窗口类型参数 分割 2行2列
+    const typeObj = {
+      rows: 1,
+      cols: 1,
+      wndSpaceing: 0,
+      embedVideoMode: true,
+      playerCtrlBarEnable: false,
+      displayMode: 3,
+      playMode: 0,
+      playParams: {},
+      webControlExpend: true,
+    };
+    if (window[this.targetid] && window[this.targetid] instanceof VideoPlay) {
+      this[this.targetid] = window[this.targetid];
+      return;
+    }
+    //左边窗口实例
+    window[this.targetid] = this[this.targetid] = new VideoPlay(
+      '#' + this.targetid,
+      window.theSocket.websocket, //一个浏览器tab页面公用一个
+      window.theSocket.socketCode, //一个浏览器tab页面公用一个
+      typeObj,
+    );
+    //左边窗口初始化
+    this[this.targetid].init();
+  },
+  //播放视频
+  playVideo(item) {
+    if (!window.theSocket.websocket) {
+      this.$Message.warning('请先打开视频插件');
+      return;
+    }
+    if (item.type == 'client') {
+      this.slectOptionmini(item.userId).then((arr) => {
+        if (arr) {
+          this[this.targetid].openAppVideo(arr);
         }
-        await $.ajax({
-            type: "POST",
-            url: setting.URL + "/mcu/meeting",
-            contentType: "application/json", //如果提交的是json数据类型,则必须有此参数,表示提交的数据类型
-            dateType: "json",
-            data: JSON.stringify(_this.localUserInfo),
-            beforeSend: function(xhr) {
-                xhr.setRequestHeader("X-Subject-Token", localStorage.getItem("token"));
-                xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
-                //xhr.setRequestHeader("Origin",null);
-            },
-            success: function(res) {
-                //obj
-                _this.InvitedMembers.id = res.id; //创建了会议id,保存起来,为了邀请成员;
-                _this.InvitedMembersSingle.id = res.id; //单兵;
-                _this.InvitedMembersVehicle.id = res.id; //车载;
-                _this.InvitedMembersUav.id = res.id; //无人机;
-                _this.InvitedMembersTalkie.id = res.id; //单兵;
-                _this.meetingId = res.id;
-                localStorage.setItem("meetingId", res.id);
-                _this._debug("创建会商返回的信息", res);
-                // _this.searchMeetingMember(); //add创建会商然后,开始查会议成员显示在列表中;
-            },
-            error: function(data) {},
-        });
-    },
-    /* 邀请会商成员 */
-    startInvite(member) {
-        let _this = this;
-        _this.InvitedMembers.member = [
-            _this.inviteSelf,
-            ...([member] || []),
-            //   {
-            //     type: "tandemPhone",
-            //     number: _this.outLinenum,
-            //     userName: _this.outLinenum,
-            //     region: _this.paasId,
-            //   },
-        ];
-        $.ajax({
-            type: "POST",
-            url: setting.URL + "/mcu/meeting/member",
-            contentType: "application/json", //如果提交的是json数据类型,则必须有此参数,表示提交的数据类型
-            dateType: "json",
-            data: JSON.stringify(_this.InvitedMembers),
-            beforeSend: function(xhr) {
-                xhr.setRequestHeader("X-Subject-Token", localStorage.getItem("token"));
-                xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
-            },
-            success: function(res) {
-                //obj
-                _this._debug("邀请会商成后的信息", res);
-                //_this.searchMeetingMember(); //add创建会商然后,开始查会议成员显示在列表中;
-            },
-            error: function(data) {
-                if (data.responseJSON.code == "mcuIdNotExist") {
-                    _this.$Message.warning("未创建会商");
-                } else if (data.responseJSON.code == "mcuIdInvalid") {
-                    _this.$Message.warning("会议ID无效");
-                } else if (data.responseJSON.code == "mcuMeetingMemMax") {
-                    _this.$Message.warning("会议用户数满");
-                }
-            },
-        });
-    },
-    /*  关闭会商操作 */
-    deleteMeeting() {
-        try {
-            let _this = this;
-            let deleteMeetingId = _this.meetingId;
-            if (!deleteMeetingId) {
-                _this.$Message.warning("未创建会商");
-                _this._debug("未创建会商", "");
-                return;
-            }
-            $.ajax({
-                type: "DELETE",
-                url: setting.URL + "/mcu/meeting/" + deleteMeetingId,
-                contentType: "application/json", //如果提交的是json数据类型,则必须有此参数,表示提交的数据类型
-                dateType: "json",
-                data: JSON.stringify(_this.localUserInfo),
-                beforeSend: function(xhr) {
-                    xhr.setRequestHeader("X-Subject-Token", localStorage.getItem("token"));
-                    xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
-                },
-                success: function(res) {
-                    //obj
-                    _this._debug("关闭会议成功", res);
-                    localStorage.removeItem("meetingId");
-                    _this.meetingId = ""; //置空
-                    _this.meetMemberList = []; //置空
-                    _this.meetMemberList2 = []; //置空
-                },
-                error: function(data) {
-                    //obj
-                    _this._debug("关闭会议错误提示", data);
-                    if (data.responseJSON.code === "mcuIdNotExist") {
-                        _this.$Message.warning("未创建会商");
-                    }
-                },
-            });
-        } catch (E) {}
-    },
-
-
-
-
-
-    deleteAllMeeting(callback) {
-        let _this = this;
-        let s = "?";
-        var index = 0;
-        var doindex = 0;
-        let searchParams = {
-            "userDomain": "",
-            "userId": _this.localUserInfo.userId,
-            "local": "0"
-        };
-        for (let k in searchParams) {
-            s = s + k + "=" + searchParams[k] + "&"
+      });
+    } else if (item.type == 'single') {
+      //播放单兵视频
+      this.pullFlow(item.channelId);
+    } else if (item.type == 'vehicle') {
+      //播放车载视频
+      this.pullFlow(item.channelId);
+    } else if (item.type == 'uav_dev') {
+      //播放无人机视频
+      this.pullFlow(item.channelId);
+    }
+  },
+  //   setDesignDivision(rows, cols) {
+  //     // console.log(this.localUserInfo);
+  //     const params = JSON.stringify({
+  //         loginIp: setting.URL,
+  //         method: "SetDesignDivision",
+  //         userCode: this.localUserInfo.masterId,
+  //         params: {
+  //             handleName:'#vPlayArea',
+  //             rows: Number(rows),
+  //             cols: Number(cols)
+  //         },
+  //         socketCode: window.theSocket.socketCode
+  //     });
+  //     console.log(params);
+  //     this.webSocketSend(params);
+  // },
+  //设备视频拉流
+  pullFlow(chinnelId) {
+    if (chinnelId) {
+      if (this[this.targetid]) {
+        this[this.targetid].showBrower(true);
+        this[this.targetid].dragResize(0, 0, 0, 0);
+      }
+      window[this.targetid] &&
+        window[this.targetid].realTimeVideo &&
+        window[this.targetid].realTimeVideo([
+          {
+            channelId: chinnelId,
+          },
+        ]);
+    }
+  },
+  /*  创建会商  */
+  async creatMeeting() {
+    let _this = this;
+    if (!_this.localUserInfo.name) {
+      _this.$Message.warning('请创建会商名称');
+      return;
+    }
+  // debugger
+    await $.ajax({
+      type: 'POST',
+      url: setting.URL + '/mcu/meeting',
+      contentType: 'application/json', //如果提交的是json数据类型,则必须有此参数,表示提交的数据类型
+      dateType: 'json',
+      data: JSON.stringify(_this.localUserInfo),
+      beforeSend: function (xhr) {
+        xhr.setRequestHeader('X-Subject-Token', localStorage.getItem('token'));
+        xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');
+        //xhr.setRequestHeader("Origin",null);
+      },
+      success: function (res) {
+        //obj
+        _this.InvitedMembers.id = res.id; //创建了会议id,保存起来,为了邀请成员;
+        _this.InvitedMembersSingle.id = res.id; //单兵;
+        _this.InvitedMembersVehicle.id = res.id; //车载;
+        _this.InvitedMembersUav.id = res.id; //无人机;
+        _this.InvitedMembersTalkie.id = res.id; //单兵;
+        _this.meetingId = res.id;
+        localStorage.setItem('meetingId', res.id);
+        _this._debug('创建会商返回的信息', res);
+        // _this.searchMeetingMember(); //add创建会商然后,开始查会议成员显示在列表中;
+      },
+      error: function (data) {},
+    });
+  },
+  /* 邀请会商成员 */
+  startInvite(member) {
+    let _this = this;
+    _this.InvitedMembers.member = [
+      _this.inviteSelf,
+      ...([member] || []),
+      //   {
+      //     type: "tandemPhone",
+      //     number: _this.outLinenum,
+      //     userName: _this.outLinenum,
+      //     region: _this.paasId,
+      //   },
+    ];
+    $.ajax({
+      type: 'POST',
+      url: setting.URL + '/mcu/meeting/member',
+      contentType: 'application/json', //如果提交的是json数据类型,则必须有此参数,表示提交的数据类型
+      dateType: 'json',
+      data: JSON.stringify(_this.InvitedMembers),
+      beforeSend: function (xhr) {
+        xhr.setRequestHeader('X-Subject-Token', localStorage.getItem('token'));
+        xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');
+      },
+      success: function (res) {
+        //obj
+        _this._debug('邀请会商成后的信息', res);
+        //_this.searchMeetingMember(); //add创建会商然后,开始查会议成员显示在列表中;
+      },
+      error: function (data) {
+        if (data.responseJSON.code == 'mcuIdNotExist') {
+          _this.$Message.warning('未创建会商');
+        } else if (data.responseJSON.code == 'mcuIdInvalid') {
+          _this.$Message.warning('会议ID无效');
+        } else if (data.responseJSON.code == 'mcuMeetingMemMax') {
+          _this.$Message.warning('会议用户数满');
         }
-        s = s.substr(0, s.length - 1);
-        //console.log(s);
-        $.ajax({
-            type: 'GET',
-            url: setting.URL + "/imu/group/list" + s,
-            contentType: "application/json", //如果提交的是json数据类型,则必须有此参数,表示提交的数据类型
-            dateType: 'json',
-            beforeSend: function(xhr) {
-                xhr.setRequestHeader("X-Subject-Token", localStorage.getItem("token"));
-                xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
-                //xhr.setRequestHeader("Origin",null);
-            },
-            success: function(res) { //string
-                if (res) {
-                    _this.allGroupColumnsData = JSON.parse(res).results;
-                    _this._debug("查询所有该用户参与的群组信息success", res);
-
-                    //所有与我有关的会商;
-                    let allRelateMeeting = [];
-                    if (JSON.parse(res).results !== null) {
-                        JSON.parse(res).results.forEach((item) => {
-                            if (item.meetId) {
-                                index++;
-
-                                allRelateMeeting.push(item);
-                                $.ajax({
-                                    type: "DELETE",
-                                    url: setting.URL + "/mcu/meeting/" + item.meetId,
-                                    contentType: "application/json", //如果提交的是json数据类型,则必须有此参数,表示提交的数据类型
-                                    dateType: "json",
-                                    data: JSON.stringify(_this.localUserInfo),
-                                    beforeSend: function(xhr) {
-                                        xhr.setRequestHeader("X-Subject-Token", localStorage.getItem("token"));
-                                        xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
-                                    },
-                                    success: function(res) {
-                                        //obj
-                                        doindex++;
-                                        if (doindex == index) {
-                                            callback();
-                                        }
+      },
+    });
+  },
+  /*  关闭会商操作 */
+  deleteMeeting() {
+    debugger
+    try {
+      let _this = this;
+      let deleteMeetingId = _this.meetingId;
+      if (!deleteMeetingId) {
+        _this.$Message.warning('未创建会商');
+        _this._debug('未创建会商', '');
+        return;
+      }
+      $.ajax({
+        type: 'DELETE',
+        url: setting.URL + '/mcu/meeting/' + deleteMeetingId,
+        contentType: 'application/json', //如果提交的是json数据类型,则必须有此参数,表示提交的数据类型
+        dateType: 'json',
+        data: JSON.stringify(_this.localUserInfo),
+        beforeSend: function (xhr) {
+          xhr.setRequestHeader(
+            'X-Subject-Token',
+            localStorage.getItem('token'),
+          );
+          xhr.setRequestHeader(
+            'Content-Type',
+            'application/json;charset=UTF-8',
+          );
+        },
+        success: function (res) {
+          //obj
+          _this._debug('关闭会议成功', res);
+          localStorage.removeItem('meetingId');
+          _this.meetingId = ''; //置空
+          _this.meetMemberList = []; //置空
+          _this.meetMemberList2 = []; //置空
+        },
+        error: function (data) {
+          //obj
+          _this._debug('关闭会议错误提示', data);
+          if (data.responseJSON.code === 'mcuIdNotExist') {
+            _this.$Message.warning('未创建会商');
+          }
+        },
+      });
+    } catch (E) {}
+  },
 
-                                    },
-                                    error: function(data) {
-                                        //obj
-                                        doindex++;
-                                        if (doindex == index) {
-                                            callback();
-                                        }
-
-                                    },
-                                });
+  deleteAllMeeting(callback) {
+    let _this = this;
+    let s = '?';
+    var index = 0;
+    var doindex = 0;
+    let searchParams = {
+      userDomain: '',
+      userId: localStorage.getItem('userId'),
+      local: '0',
+    };
+    for (let k in searchParams) {
+      s = s + k + '=' + searchParams[k] + '&';
+    }
+    s = s.substr(0, s.length - 1);
+    //console.log(s);
+    $.ajax({
+      type: 'GET',
+      url: setting.URL + '/imu/group/list' + s,
+      contentType: 'application/json', //如果提交的是json数据类型,则必须有此参数,表示提交的数据类型
+      dateType: 'json',
+      beforeSend: function (xhr) {
+        xhr.setRequestHeader('X-Subject-Token', localStorage.getItem('token'));
+        xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');
+        //xhr.setRequestHeader("Origin",null);
+      },
+      success: function (res) {
+        //string
+        if (res) {
+          _this.allGroupColumnsData = JSON.parse(res).results;
+          _this._debug('查询所有该用户参与的群组信息success', res);
 
-                            }
-                        });
-                    } else {
-                        callback();
-                    }
-                    _this._debug("查询所有该用户参与的会商success", allRelateMeeting);
-                }
-            },
-            error: function(data) {
-                callback();
+          //所有与我有关的会商;
+          let allRelateMeeting = [];
+          if (JSON.parse(res).results !== null) {
+            JSON.parse(res).results.forEach((item) => {
+              if (item.meetId) {
+                index++;
 
-            }
-        });
-    },
-    /* 通过deviceCode查询设备channelId */
-    searchChinnelId(deviceCode, deviceType) {
-        let _this = this;
-        return new Promise((resolve) => {
-            $.ajax({
-                type: "GET",
-                url: setting.URL + "/videoService/devicesManager/devices/" + deviceCode,
-                contentType: "application/json", //如果提交的是json数据类型,则必须有此参数,表示提交的数据类型
-                dateType: "json",
-                beforeSend: function(xhr) {
+                allRelateMeeting.push(item);
+                $.ajax({
+                  type: 'DELETE',
+                  url: setting.URL + '/mcu/meeting/' + item.meetId,
+                  contentType: 'application/json', //如果提交的是json数据类型,则必须有此参数,表示提交的数据类型
+                  dateType: 'json',
+                  data: JSON.stringify(_this.localUserInfo),
+                  beforeSend: function (xhr) {
                     xhr.setRequestHeader(
-                        "X-Subject-Token",
-                        localStorage.getItem("token")
+                      'X-Subject-Token',
+                      localStorage.getItem('token'),
                     );
                     xhr.setRequestHeader(
-                        "Content-Type",
-                        "application/json;charset=UTF-8"
+                      'Content-Type',
+                      'application/json;charset=UTF-8',
                     );
-                    //xhr.setRequestHeader("Origin",null);
-                },
-                success: function(res) {
+                  },
+                  success: function (res) {
                     //obj
-                    if (res) {
-                        if (deviceType == "single") {
-                            //单兵
-                            _this.channelId = res.encoderUnit.channels[0].channelId;
-                            resolve(res.encoderUnit.channels[0].channelId);
-                            _this._debug(
-                                "单兵channelId",
-                                res.encoderUnit.channels[0].channelId
-                            );
-                        } else if (deviceType == "vehicle") {
-                            //车载
-                            _this.channelId = res.encoderUnit.channels[0].channelId;
-                            resolve(res.encoderUnit.channels[0].channelId);
-                            _this._debug(
-                                "车载channelId",
-                                res.encoderUnit.channels[0].channelId
-                            );
-                        } else if (deviceType == "uav") {
-                            //无人机
-                            _this.channelId = res.encoderUnit.channels[0].channelId;
-                            resolve(res.encoderUnit.channels[0].channelId);
-                            _this._debug(
-                                "无人机channelId",
-                                res.encoderUnit.channels[0].channelId
-                            );
-                        } else if (deviceType == "talkie") {
-                            //对讲机
-                            if (res.encoderUnit.channels[0].channelId) {
-                                _this.channelId = res.encoderUnit.channels[0].channelId;
-                                resolve(res.encoderUnit.channels[0].channelId);
-                            }
-                            _this._debug(
-                                "对讲机channelId",
-                                res.devAudioUnit.channels[0].channelId
-                            );
-                        }
+                    doindex++;
+                    if (doindex == index) {
+                      callback();
                     }
-                },
-                error: function(data) {
-                    //
-                },
-            });
-        });
-    },
-    queryUser(userCode) {
-        let _this = this;
-        return new Promise((resolve) => {
-            $.ajax({
-                type: "GET",
-                url: setting.URL + "/ras/user/" + userCode,
-                contentType: "application/json", //如果提交的是json数据类型,则必须有此参数,表示提交的数据类型
-                dateType: "json",
-                beforeSend: function(xhr) {
-                    xhr.setRequestHeader(
-                        "X-Subject-Token",
-                        localStorage.getItem("token")
-                    );
-                    xhr.setRequestHeader(
-                        "Content-Type",
-                        "application/json;charset=UTF-8"
-                    );
-                },
-                success: function(res) {
+                  },
+                  error: function (data) {
                     //obj
-                    if (res && res.chnId) {
-                        resolve(res);
+                    doindex++;
+                    if (doindex == index) {
+                      callback();
                     }
-                },
-                error: function(data) {},
+                  },
+                });
+              }
             });
-        });
-    },
-    /* app拉流 */
-    slectOptionmini(userCode) {
-        let _this = this;
-        return new Promise((resolve) => {
-            $.ajax({
-                type: "GET",
-                url: setting.URL + "/ras/user/" + userCode,
-                contentType: "application/json", //如果提交的是json数据类型,则必须有此参数,表示提交的数据类型
-                dateType: "json",
-                beforeSend: function(xhr) {
-                    xhr.setRequestHeader(
-                        "X-Subject-Token",
-                        localStorage.getItem("token")
-                    );
-                    xhr.setRequestHeader(
-                        "Content-Type",
-                        "application/json;charset=UTF-8"
-                    );
-                },
-                success: function(res) {
-                    //obj
-                    if (res && res.chnId) {
-                        let arr = [{
-                            channelId: res.chnId,
-                            userCode: res.userCode,
-                            regionId: res.paasId,
-                            domainId: "",
-                        }, ];
-                        resolve(arr);
-                    }
-                },
-                error: function(data) {},
-            });
-        });
-    },
-    /* 打开客户端 */
-    async openClient(callback) {
-        return this.getUserCode(callback);
-    },
-    closeClient() {
-        try {
-            this.theSocket &&
-                this.theSocket.closeClient &&
-                this.theSocket.closeClient();
-        } catch (E) {}
-    },
-    closeVideo() {
-        try {
-            // this.theSocket.closeAllVideo && this.theSocket.closeAllVideo();
-            this[this.targetid].closeAllVideo();
-            this[this.targetid].showBrower(false);
-            setTimeout(() => {
-                this[this.targetid].showBrower(false);
-            }, 100);
-
-
-        } catch (E) {}
-    },
-    /* 获取群聊fromName */
-    async getLocalUserInfo() {
-        let _this = this;
-        await $.ajax({
-            type: "GET",
-            url: setting.URL + "/ras/user/info",
-            contentType: "application/json", //如果提交的是json数据类型,则必须有此参数,表示提交的数据类型
-            dateType: "json",
-            beforeSend: function(xhr) {
-                xhr.setRequestHeader("X-Subject-Token", localStorage.getItem("token"));
-                xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
-            },
-            success: function(res) {
-                //obj
-                _this.loginPassword = res.loginPassword; //获取登录为密码.为登录用户话机注册做准备(需要res解密)
-
-                _this.localUserInfo.masterName = res.userName;
-                _this.localUserInfo.masterId = res.userCode;
-                _this.localUserInfo.masterNumber = res.userPhone;
-                _this.localUserInfo.region = res.paasId;
+          } else {
+            callback();
+          }
+          _this._debug('查询所有该用户参与的会商success', allRelateMeeting);
+        }
+      },
+      error: function (data) {
+        callback();
+      },
+    });
+  },
+  /* 通过deviceCode查询设备channelId */
+  searchChinnelId(deviceCode, deviceType) {
+    let _this = this;
+    return new Promise((resolve) => {
+      $.ajax({
+        type: 'GET',
+        url: setting.URL + '/videoService/devicesManager/devices/' + deviceCode,
+        contentType: 'application/json', //如果提交的是json数据类型,则必须有此参数,表示提交的数据类型
+        dateType: 'json',
+        beforeSend: function (xhr) {
+          xhr.setRequestHeader(
+            'X-Subject-Token',
+            localStorage.getItem('token'),
+          );
+          xhr.setRequestHeader(
+            'Content-Type',
+            'application/json;charset=UTF-8',
+          );
+          //xhr.setRequestHeader("Origin",null);
+        },
+        success: function (res) {
+          //obj
+          if (res) {
+            if (deviceType == 'single') {
+              //单兵
+              _this.channelId = res.encoderUnit.channels[0].channelId;
+              resolve(res.encoderUnit.channels[0].channelId);
+              _this._debug(
+                '单兵channelId',
+                res.encoderUnit.channels[0].channelId,
+              );
+            } else if (deviceType == 'vehicle') {
+              //车载
+              _this.channelId = res.encoderUnit.channels[0].channelId;
+              resolve(res.encoderUnit.channels[0].channelId);
+              _this._debug(
+                '车载channelId',
+                res.encoderUnit.channels[0].channelId,
+              );
+            } else if (deviceType == 'uav') {
+              //无人机
+              _this.channelId = res.encoderUnit.channels[0].channelId;
+              resolve(res.encoderUnit.channels[0].channelId);
+              _this._debug(
+                '无人机channelId',
+                res.encoderUnit.channels[0].channelId,
+              );
+            } else if (deviceType == 'talkie') {
+              //对讲机
+              if (res.encoderUnit.channels[0].channelId) {
+                _this.channelId = res.encoderUnit.channels[0].channelId;
+                resolve(res.encoderUnit.channels[0].channelId);
+              }
+              _this._debug(
+                '对讲机channelId',
+                res.devAudioUnit.channels[0].channelId,
+              );
+            }
+          }
+        },
+        error: function (data) {
+          //
+        },
+      });
+    });
+  },
+  queryUser(userCode) {
+    let _this = this;
+    return new Promise((resolve) => {
+      $.ajax({
+        type: 'GET',
+        url: setting.URL + '/ras/user/' + userCode,
+        contentType: 'application/json', //如果提交的是json数据类型,则必须有此参数,表示提交的数据类型
+        dateType: 'json',
+        beforeSend: function (xhr) {
+          xhr.setRequestHeader(
+            'X-Subject-Token',
+            localStorage.getItem('token'),
+          );
+          xhr.setRequestHeader(
+            'Content-Type',
+            'application/json;charset=UTF-8',
+          );
+        },
+        success: function (res) {
+          //obj
+          if (res) {
+            resolve(JSON.parse(res));
+          }
+        },
+        error: function (data) {
+          // debugger
+        },
+      });
+    });
+  },
+  queryDevice(deviceCode) {
+    let _this = this;
+    return new Promise((resolve) => {
+      $.ajax({
+        type: 'GET',
+        url: setting.URL + '/videoService/devicesManager/devices/' + deviceCode,
+        contentType: 'application/json', //如果提交的是json数据类型,则必须有此参数,表示提交的数据类型
+        dateType: 'json',
+        beforeSend: function (xhr) {
+          xhr.setRequestHeader(
+            'X-Subject-Token',
+            localStorage.getItem('token'),
+          );
+          xhr.setRequestHeader(
+            'Content-Type',
+            'application/json;charset=UTF-8',
+          );
+        },
+        success: (res) => {
+          if (res) {
+            try {
+              // $.ajax({
+              //   type: 'POST',
+              //   url: setting.URL + '/rvsl/ecd',
+              //   contentType: 'application/json', //如果提交的是json数据类型,则必须有此参数,表示提交的数据类型
+              //   dateType: 'json',
+              //   data: JSON.stringify({ deviceCode: [res.deviceCode] }),
+              //   beforeSend: function (xhr) {
+              //     xhr.setRequestHeader(
+              //       'X-Subject-Token',
+              //       localStorage.getItem('token'),
+              //     );
+              //     xhr.setRequestHeader(
+              //       'Content-Type',
+              //       'application/json;charset=UTF-8',
+              //     );
+              //   },
+              //   success: function (res1) {
+              //     _this.localUserInfo.masterDomain = res1.data[0].ecdId;
+              //     resolve(res);
+              //   },
+              //   error: function (data) {},
+              // });
+            } catch (error) {
+              //  resolve(res);
+            } finally { 
+              resolve(res);
+            }
+             
 
-                _this.InvitedMembers.inviteId = res.userCode;
-                _this.InvitedMembers.inviteName = res.userName;
-                _this.InvitedMembers.inviteNumber = res.userPhone;
-                _this.inviteSelf = {
-                    userName: res.userName + "(系统APP接入)",
-                    department: res.deptName,
-                    userId: res.userCode,
-                    region: res.paasId,
-                    number: res.userPhone,
-                    type: "client",
-                };
-                //单兵
-                _this.InvitedMembersSingle.inviteId = res.userCode;
-                _this.InvitedMembersSingle.inviteName = res.userName;
-                _this.InvitedMembersSingle.inviteNumber = res.userPhone;
-                //车载
-                _this.InvitedMembersVehicle.inviteId = res.userCode;
-                _this.InvitedMembersVehicle.inviteName = res.userName;
-                _this.InvitedMembersVehicle.inviteNumber = res.userPhone;
-                //无人机
-                _this.InvitedMembersUav.inviteId = res.userCode;
-                _this.InvitedMembersUav.inviteName = res.userName;
-                _this.InvitedMembersUav.inviteNumber = res.userPhone;
-                //对讲机
-                _this.InvitedMembersTalkie.inviteId = res.userCode;
-                _this.InvitedMembersTalkie.inviteName = res.userName;
-                _this.InvitedMembersTalkie.inviteNumber = res.userPhone;
-            },
-            error: function (data) {
-                 _this.$Message.error('获取视屏用户失败');
-            },
-        });
-    },
-    _debug(tip, res) {
-        let _this = this;
-        _this.meetingInfoback += tip + "--》  " + JSON.stringify(res) + "\n\n";
-        // let container = _this.$el.querySelector("#meetResBack textarea");
-        // container.scrollTop = container.scrollHeight;
-    },
-    settargetId(id) {
-        let _this = this;
-        if (id != "") {
-            _this.targetid = id;
+             //obj
+           }
+        },
+        error: function (data) {
+          // debugger
+        },
+      });
+    });
+  },
+  /* app拉流 */
+  slectOptionmini(userCode) {
+    let _this = this;
+    return new Promise((resolve) => {
+      $.ajax({
+        type: 'GET',
+        url: setting.URL + '/ras/user/' + userCode,
+        contentType: 'application/json', //如果提交的是json数据类型,则必须有此参数,表示提交的数据类型
+        dateType: 'json',
+        beforeSend: function (xhr) {
+          xhr.setRequestHeader(
+            'X-Subject-Token',
+            localStorage.getItem('token'),
+          );
+          xhr.setRequestHeader(
+            'Content-Type',
+            'application/json;charset=UTF-8',
+          );
+        },
+        success: function (res) {
+          //obj
+          if (res && res.chnId) {
+            let arr = [
+              {
+                channelId: res.chnId,
+                userCode: res.userCode,
+                regionId: res.paasId,
+                domainId: '',
+              },
+            ];
+            resolve(arr);
+          }
+        },
+        error: function (data) {},
+      });
+    });
+  },
+  /* 打开客户端 */
+  async openClient(callback) {
+    return this.getUserCode(callback);
+  },
+  closeClient() {
+    try {
+      this.theSocket &&
+        this.theSocket.closeClient &&
+        this.theSocket.closeClient();
+    } catch (E) {}
+  },
+  closeVideo() {
+    try {
+      // this.theSocket.closeAllVideo && this.theSocket.closeAllVideo();
+      this[this.targetid].closeAllVideo();
+      this[this.targetid].showBrower(false);
+      setTimeout(() => {
+        this[this.targetid].showBrower(false);
+      }, 100);
+    } catch (E) {}
+  },
+  /* 获取群聊fromName */
+  async getLocalUserInfo() {
+    let _this = this;
+    await $.ajax({
+      type: 'GET',
+      url: setting.URL + '/ras/user/info',
+      contentType: 'application/json', //如果提交的是json数据类型,则必须有此参数,表示提交的数据类型
+      dateType: 'json',
+      beforeSend: function (xhr) {
+        xhr.setRequestHeader('X-Subject-Token', localStorage.getItem('token'));
+        xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');
+      },
+      success: function (res) {
+        if ( !(res instanceof Object)){ 
+          res = JSON.parse(res);
         }
+        //obj
+        _this.loginPassword = res.loginPassword; //获取登录为密码.为登录用户话机注册做准备(需要res解密)
 
-        _this.initWnd();
+        _this.localUserInfo.masterName = res.userName;
+        // _this.localUserInfo.masterId = res.userCode;
+        _this.localUserInfo.masterNumber = res.userPhone;
+        _this.localUserInfo.region = res.paasId;
 
+        _this.InvitedMembers.inviteId = res.userCode;
+        _this.InvitedMembers.inviteName = res.userName;
+        _this.InvitedMembers.inviteDomain = '3981f448463d4cdb8735083a5114e626';
+        _this.InvitedMembers.inviteNumber = res.userPhone;
+        // _this.inviteSelf = {
+        //   inviteName: res.userName + '(系统APP接入)',
+        //   department: res.deptName,
+        //   inviteDomain: '3981f448463d4cdb8735083a5114e626',
+        //   inviteId: res.userCode,
+        //   region: res.paasId,
+        //   inviteNumber: res.userPhone,
+        //   type: 'client',
+        // };
+        //单兵
+        _this.InvitedMembersSingle.inviteId = res.userCode;
+        _this.InvitedMembersSingle.inviteName = res.userName;
+        _this.InvitedMembersSingle.inviteNumber = res.userPhone;
+        //车载
+        _this.InvitedMembersVehicle.inviteId = res.userCode;
+        _this.InvitedMembersVehicle.inviteName = res.userName;
+        _this.InvitedMembersVehicle.inviteNumber = res.userPhone;
+        //无人机
+        _this.InvitedMembersUav.inviteId = res.userCode;
+        _this.InvitedMembersUav.inviteName = res.userName;
+        _this.InvitedMembersUav.inviteNumber = res.userPhone;
+        //对讲机
+        _this.InvitedMembersTalkie.inviteId = res.userCode;
+        _this.InvitedMembersTalkie.inviteName = res.userName;
+        _this.InvitedMembersTalkie.inviteNumber = res.userPhone;
+
+        // debugger
+      },
+      error: function (data) {
+        _this.$Message.error('获取视屏用户失败');
+      },
+    });
+  },
+  _debug(tip, res) {
+    let _this = this;
+    _this.meetingInfoback += tip + '--》  ' + JSON.stringify(res) + '\n\n';
+    // let container = _this.$el.querySelector("#meetResBack textarea");
+    // container.scrollTop = container.scrollHeight;
+  },
+  settargetId(id) {
+    let _this = this;
+    if (id != '') {
+      _this.targetid = id;
     }
+
+    _this.initWnd();
+  },
 };

+ 317 - 317
public/webClient/initWebSocket.js

@@ -11,341 +11,341 @@ function getRandomString(len = 10) {
     return randomString;
 }
 class InitWebSocketClass {
-    // console.log(1111);
-    // 为了防止user获取不到,从外面调用ras/user/info接口传入userCode,不要从cookie读,否则可能第一次出现读取不到的状况
-    constructor(
-        userCode = localStorage.getItem("userId"),
-        token = localStorage.getItem("token"),
-        options,
-        socketCode = getRandomString()
-    ) {
-        this.websocket = null; // 初始化websocket
-        this.socketCode = socketCode;
-        this.defaults = {
-            // 默认配置,可以通过option覆盖
-            protocol: defaultConfig.protocol, // 协议
-            letLoginIp: defaultConfig.loginIp, // 环境配置
-            letPort: defaultConfig.port, // 端口配置
-            letUserCode: userCode, // 用户code
-            letUserName: "system", // 环境登陆账号
-            wsUri: "ws://localhost:1234",
-            token: token, // token
-            getVersion: null, // option里面的获取版本信息的回调函数通知
-            loginSuccess: null, // 登陆成功会调通知
-            errorInfo: null, // 异常回调通知
-            onCreateVideoSuccess: false, // 客户端被拉起通知
-            oncheckSocket: null,
-            onCreateGroupChatSuccess: null, // 群聊创建成功通知
-            onSocketBackInfos: null // 客户端返回信息
-        };
-        this.settings = Object.assign({}, this.defaults, options); // 覆盖默认配置操作
-        this.websocketOnerror = false;
-        this.ClientLocalVersion = 0; // 获取本地版本号
-        this.timeId = null;
+  // console.log(1111);
+  // 为了防止user获取不到,从外面调用ras/user/info接口传入userCode,不要从cookie读,否则可能第一次出现读取不到的状况
+  constructor(
+    userCode = localStorage.getItem('userId'),
+    token = localStorage.getItem('token'),
+    options,
+    socketCode = getRandomString(),
+  ) {
+    this.websocket = null; // 初始化websocket
+    this.socketCode = socketCode;
+    this.defaults = {
+      // 默认配置,可以通过option覆盖
+      protocol: defaultConfig.protocol, // 协议
+      letLoginIp: defaultConfig.loginIp, // 环境配置
+      letPort: defaultConfig.port, // 端口配置
+      letUserCode: userCode, // 用户code
+      letUserName: localStorage.getItem('userName'), // 环境登陆账号
+      wsUri: 'ws://localhost:1234',
+      token: token, // token
+      getVersion: null, // option里面的获取版本信息的回调函数通知
+      loginSuccess: null, // 登陆成功会调通知
+      errorInfo: null, // 异常回调通知
+      onCreateVideoSuccess: false, // 客户端被拉起通知
+      oncheckSocket: null,
+      onCreateGroupChatSuccess: null, // 群聊创建成功通知
+      onSocketBackInfos: null, // 客户端返回信息
+    };
+    this.settings = Object.assign({}, this.defaults, options); // 覆盖默认配置操作
+    this.websocketOnerror = false;
+    this.ClientLocalVersion = 0; // 获取本地版本号
+    this.timeId = null;
+  }
+  getSettings() {
+    return this.settings;
+  }
+
+  webSocketSend(data) {
+    // console.log(data);
+    // console.log(this.websocket);
+    if (this.websocket == null) {
+      return;
     }
-    getSettings() {
-        return this.settings;
+    if (this.websocket.readyState === 1) {
+      // console.log(this.websocket.readyState)
+      this.websocket.send(data);
+    } else {
+      setTimeout(() => {
+        this.webSocketSend(data);
+      }, 1000);
     }
-    webSocketSend(data) {
-        // console.log(data);
-        // console.log(this.websocket);
-        if (this.websocket == null) {
-            return;
+  }
+
+  initWebSocket() {
+    // 初始化WebSocket
+
+    return new Promise((resolve, reject) => {
+      try {
+        if (typeof WebSocket === 'function') {
+          this.WebSocket = WebSocket;
         }
-        if (this.websocket.readyState === 1) {
-            // console.log(this.websocket.readyState)
-            this.websocket.send(data);
-        } else {
-            setTimeout(() => {
-                this.webSocketSend(data);
-            }, 1000);
+        if (this.websocket && this.websocket.readyState === 1) {
+          this.websocket.close();
         }
-    }
-
-    initWebSocket() {
-        // 初始化WebSocket
+        const settings = this.settings;
+        window.initWebSocket = this.websocket = new WebSocket(settings.wsUri);
+        this.websocket.onopen = () => {
+          this.login();
+        };
+        this.websocket.onclose = () => {
+          // DISCONNECTED
+        };
+        this.websocket.onmessage = (evt) => {
+          // console.log(evt);
+          if (evt && evt.data) {
+            if (evt.data === 'client is runing!') {
+              // 用隐藏方法,只断连接去拉视频后的返回
+              this.startNotice();
+              this.settings.loginSuccess &&
+                this.settings.loginSuccess('success');
+              resolve('success');
 
-        return new Promise((resolve, reject) => {
-            try {
-                if (typeof WebSocket === "function") {
-                    this.WebSocket = WebSocket;
-                }
-                if (this.websocket && this.websocket.readyState === 1) {
-                    this.websocket.close();
-                }
-                const settings = this.settings;
-                window.initWebSocket = this.websocket = new WebSocket(
-                    settings.wsUri
+              return;
+            }
+            const data = JSON.parse(evt.data);
+            // console.log(data);
+            if (data && data.params && data.params.loginResult === 0) {
+              this.startNotice(); // 去获取本地版本号
+              this.settings.loginSuccess &&
+                this.settings.loginSuccess('success');
+              resolve('success');
+            } else if (data && data.method === 'notifyClientLocalVersion') {
+              this.ClientLocalVersion = Number(
+                JSON.parse(evt.data).params.clientVersion,
+              );
+              this.settings.getVersion &&
+                this.settings.getVersion(
+                  Number(JSON.parse(evt.data).params.clientVersion),
                 );
-                this.websocket.onopen = () => {
-                    this.login();
-                };
-                this.websocket.onclose = () => {
-                    // DISCONNECTED
-                };
-                this.websocket.onmessage = evt => {
-                    // console.log(evt);
-                    if (evt && evt.data) {
-                        if (evt.data === "client is runing!") {
-                            // 用隐藏方法,只断连接去拉视频后的返回
-                            this.startNotice();
-                            this.settings.loginSuccess &&
-                                this.settings.loginSuccess("success");
-                            resolve("success");
-                             
-                            return;
-                        }
-                        const data = JSON.parse(evt.data);
-                        // console.log(data);
-                        if (
-                            data &&
-                            data.params &&
-                            data.params.loginResult === 0
-                        ) {
-                            this.startNotice(); // 去获取本地版本号
-                            this.settings.loginSuccess &&
-                                this.settings.loginSuccess("success");
-                            resolve("success");
-                        } else if (
-                            data &&
-                            data.method === "notifyClientLocalVersion"
-                        ) {
-                            this.ClientLocalVersion = Number(
-                                JSON.parse(evt.data).params.clientVersion
-                            );
-                            this.settings.getVersion &&
-                                this.settings.getVersion(
-                                    Number(
-                                        JSON.parse(evt.data).params
-                                        .clientVersion
-                                    )
-                                );
-                        } else if (
-                            data &&
-                            data.method === "createVideoDialogReuslt"
-                        ) {
-                            // 客户端被拉起通知
-                            const createVideoReuslt = Number(
-                                JSON.parse(evt.data).params.result
-                            );
-                            const flag = createVideoReuslt === 0;
-                            this.settings.onCreateVideoSuccess &&
-                                this.settings.onCreateVideoSuccess(flag);
-                        } else if (data && data.method === "runinfo") {
-                            // 运行异常状态通知
-                            this.settings.errorInfo &&
-                                this.settings.errorInfo(data.params.info);
-                        } else {
-                            //
-                        }
-                        // 重点:统一分发客户端ws消息
-                        this.settings.onSocketBackInfos &&
-                            this.settings.onSocketBackInfos(data);
-                    }
-                };
-                this.websocket.onerror = () => {
-                    this.websocketOnerror = true;
-                    reject("error");
-                };
-            } catch (exception) {
-                // this.debug('ERROR: ' + exception);
-              
+            } else if (data && data.method === 'createVideoDialogReuslt') {
+              // 客户端被拉起通知
+              const createVideoReuslt = Number(
+                JSON.parse(evt.data).params.result,
+              );
+              const flag = createVideoReuslt === 0;
+              this.settings.onCreateVideoSuccess &&
+                this.settings.onCreateVideoSuccess(flag);
+            } else if (data && data.method === 'runinfo') {
+              // 运行异常状态通知
+              this.settings.errorInfo &&
+                this.settings.errorInfo(data.params.info);
+            } else {
+              //
             }
-        });
-    }
-    login() {
-        this.checkSocket();
-        const params = {
-            loginIp: this.settings.letLoginIp,
-            method: "login",
-            params: {
-                loginPort: "8320",
-                // protocol: this.settings.protocol,
-                token: this.settings.token,
-                userName: this.settings.letUserName,
-                userId: this.settings.letUserCode,
-                browser: "chrome",
-                version: "80.0.3987.100",
-                platform: "win64",
-            },
-            userCode: this.settings.letUserCode,
-            // socketCode: this.socketCode,
-            // webTitle: document.title // 视频存在的tab业标题不能重复
+            // 重点:统一分发客户端ws消息
+            this.settings.onSocketBackInfos &&
+              this.settings.onSocketBackInfos(data);
+          }
         };
-        console.log(params);
+        this.websocket.onerror = () => {
+          this.websocketOnerror = true;
+          reject('error');
+        };
+      } catch (exception) {
+        // this.debug('ERROR: ' + exception);
+      }
+    });
+  }
+  login() {
+    this.checkSocket();
+
+    const params = {
+      loginIp: this.settings.letLoginIp,
+      method: 'login',
+      params: {
+        loginPort: '8320',
+        // protocol: this.settings.protocol,
+        token: this.settings.token,
+        userName: this.settings.letUserName,
+        userId: this.settings.letUserCode,
+        browser: 'chrome',
+        version: '80.0.3987.100',
+        platform: 'win64',
+      },
+      userCode: this.settings.letUserCode,
+      // socketCode: this.socketCode,
+      // webTitle: document.title // 视频存在的tab业标题不能重复
+    };
+    console.log(params);
+    this.webSocketSend(JSON.stringify(params));
+    this.timer();
+  }
+  UpdateWebTitle() {
+    //切换路由的的时候需要调用此方法更新页面标题。路由标题名不能重复。
+    // this.checkSocket();
+    const params = {
+      loginIp: this.settings.letLoginIp,
+      method: 'UpdateWebTitle',
+      params: {
+        webTitle: document.title,
+      },
+      userCode: this.settings.letUserCode,
+      socketCode: this.socketCode,
+    };
+    this.webSocketSend(JSON.stringify(params));
+  }
+  // 客户端心跳
+  timer() {
+    this.timeId = setInterval(() => {
+      const params = {
+        loginIp: this.settings.letLoginIp,
+        method: 'heartbeat',
+        userCode: this.settings.letUserCode,
+        // socketCode: this.socketCode
+      };
+      if (this.websocket) {
         this.webSocketSend(JSON.stringify(params));
-        this.timer();
+      }
+    }, 10000);
+  }
+  // 停止socket连接
+  stopWebSocket() {
+    if (this.websocket) {
+      this.websocket.close();
     }
-    UpdateWebTitle() {
-            //切换路由的的时候需要调用此方法更新页面标题。路由标题名不能重复。
-            // this.checkSocket();
-            const params = {
-                loginIp: this.settings.letLoginIp,
-                method: "UpdateWebTitle",
-                params: {
-                    webTitle: document.title
-                },
-                userCode: this.settings.letUserCode,
-                socketCode: this.socketCode
-            };
-            this.webSocketSend(JSON.stringify(params));
+    this.websocket = null;
+    this.timeId && clearInterval(this.timeId);
+  }
+  //检查socket状态,通过oncheckSocket回调参数,可以判断本地有木有安装客户端
+  checkSocket() {
+    if (this.websocket != null) {
+      let stateStr;
+      // console.log(this.websocket.readyState);
+      switch (this.websocket.readyState) {
+        case 0: {
+          stateStr = 'CONNECTING';
+          break;
         }
-        // 客户端心跳
-    timer() {
-            this.timeId = setInterval(() => {
-                const params = {
-                    loginIp: this.settings.letLoginIp,
-                    method: "heartbeat",
-                    userCode: this.settings.letUserCode,
-                    // socketCode: this.socketCode
-                };
-                if (this.websocket) {
-                    this.webSocketSend(JSON.stringify(params));
-                }
-            }, 10000);
+        case 1: {
+          stateStr = 'OPEN';
+          break;
         }
-        // 停止socket连接
-    stopWebSocket() {
-            if (this.websocket) {
-                this.websocket.close();
-            }
-            this.websocket = null;
-            this.timeId && clearInterval(this.timeId);
+        case 2: {
+          stateStr = 'CLOSING';
+          break;
         }
-        //检查socket状态,通过oncheckSocket回调参数,可以判断本地有木有安装客户端
-    checkSocket() {
-            if (this.websocket != null) {
-                let stateStr;
-                // console.log(this.websocket.readyState);
-                switch (this.websocket.readyState) {
-                    case 0:
-                        {
-                            stateStr = "CONNECTING";
-                            break;
-                        }
-                    case 1:
-                        {
-                            stateStr = "OPEN";
-                            break;
-                        }
-                    case 2:
-                        {
-                            stateStr = "CLOSING";
-                            break;
-                        }
-                    case 3:
-                        {
-                            stateStr = "CLOSED";
-                            break;
-                        }
-                    default:
-                        {
-                            stateStr = "UNKNOW";
-                            break;
-                        }
-                }
-                this.settings.oncheckSocket &&
-                    this.settings.oncheckSocket(stateStr === "OPEN");
-            } else {
-                //
-            }
+        case 3: {
+          stateStr = 'CLOSED';
+          break;
         }
-        //获取本地客户端版本号
-    startNotice() {
-            const params = JSON.stringify({
-                loginIp: this.settings.letLoginIp,
-                method: "getClientVersion",
-                userCode: this.settings.letUserCode,
-                socketCode: this.socketCode
-            });
-            this.webSocketSend(params);
+        default: {
+          stateStr = 'UNKNOW';
+          break;
         }
-        // 升级客户端方法
-    setClientDownInfo() {
-        const origin = location.origin;
-        const params = JSON.stringify({
-            loginIp: this.settings.letLoginIp,
-            method: "setClientDownInfo",
-            params: {
-                newClientVersion: this.ClientLocalVersion, // 获取的本地版本号
-                clientDownUrl: `${origin}/data/VSL/DSSEnterpriseClient/DSS_LightWeight_Client.zip` // 客户端在服务器上的地址,本地调试放开下面你的getCookie("ip")
-                    // "clientDownUrl": `http://${getCookie("ip")}:8314/TheNextWebApp/resources/DSS_LightWeight_Client.zip` // 客户端在服务器上的地址文件
-            },
-            userCode: this.settings.letUserCode,
-            socketCode: this.socketCode
-        });
-        this.webSocketSend(params);
+      }
+      this.settings.oncheckSocket &&
+        this.settings.oncheckSocket(stateStr === 'OPEN');
+    } else {
+      //
     }
-    closeClient() {
-            const params = {
-                loginIp: this.settings.letLoginIp,
-                method: "logout",
-                userCode: this.settings.letUserCode,
-                socketCode: this.socketCode
-            };
-            this.webSocketSend(JSON.stringify(params));
-            this.stopWebSocket();
-            this.websocket = null;
-        }
-        // 通用方法第三方传方法名和参数体
-    commonUse(method, paramsObj) {
-            const params = JSON.stringify({
-                loginIp: this.settings.letLoginIp,
-                method: method,
-                userCode: this.settings.letUserCode,
-                params: paramsObj,
-                socketCode: this.socketCode
-            });
-            this.webSocketSend(params);
-        }
-        // 创建群聊界面
-    openCreateGroupChatDlg() {
-            const params = JSON.stringify({
-                loginIp: this.settings.letLoginIp,
-                method: "openCreateGroupChatDlg",
-                userCode: this.settings.letUserCode,
-                socketCode: this.socketCode
-            });
-            this.webSocketSend(params);
-        }
-        // 创建群聊会商-邀请一个用户进去会商
+  }
+  //获取本地客户端版本号
+  startNotice() {
+    const params = JSON.stringify({
+      loginIp: this.settings.letLoginIp,
+      method: 'getVersion',
+      userCode: this.settings.letUserCode,
+    //   socketCode: this.socketCode,
+    });
+    this.webSocketSend(params);
+  }
+  // 升级客户端方法
+  setClientDownInfo() {
+    const origin = location.origin;
+    const params = JSON.stringify({
+      loginIp: this.settings.letLoginIp,
+      method: 'setClientDownInfo',
+      params: {
+        newClientVersion: this.ClientLocalVersion, // 获取的本地版本号
+        clientDownUrl: `${origin}/data/VSL/DSSEnterpriseClient/DSS_LightWeight_Client.zip`, // 客户端在服务器上的地址,本地调试放开下面你的getCookie("ip")
+        // "clientDownUrl": `http://${getCookie("ip")}:8314/TheNextWebApp/resources/DSS_LightWeight_Client.zip` // 客户端在服务器上的地址文件
+      },
+      userCode: this.settings.letUserCode,
+      socketCode: this.socketCode,
+    });
+    this.webSocketSend(params);
+  }
+  closeClient() {
+    // const params = {
+    //     loginIp: this.settings.letLoginIp,
+    //     method: "logout",
+    //     userCode: this.settings.letUserCode,
+    //     socketCode: this.socketCode
+    // };
+    // this.webSocketSend(JSON.stringify(params));
+    // this.stopWebSocket();
+    // this.websocket = null;
+  }
+  // 通用方法第三方传方法名和参数体
+  commonUse(method, paramsObj) {
+    const params = JSON.stringify({
+      loginIp: this.settings.letLoginIp,
+      method: method,
+      userCode: this.settings.letUserCode,
+      params: paramsObj,
+      socketCode: this.socketCode,
+    });
+    this.webSocketSend(params);
+  }
+  // 创建群聊界面
+  openCreateGroupChatDlg() {
+    const params = JSON.stringify({
+      loginIp: this.settings.letLoginIp,
+      method: 'openCreateGroupChatDlg',
+      userCode: this.settings.letUserCode,
+      socketCode: this.socketCode,
+    });
+    this.webSocketSend(params);
+  }
+  // 创建群聊会商-邀请一个用户进去会商
     createGroupChat(obj) {
-            const params = JSON.stringify({
-                loginIp: this.settings.letLoginIp,
-                method: "createGroupChat",
-                userCode: this.settings.letUserCode,
-                socketCode: this.socketCode,
-                params: {
-                    chatName: obj.chatName,
-                    bOpenDirect: obj.bOpenDirect, // 是否打开音视频通话标志,true 创建成功后打开音视频通话,false 创建成功后不打开音视频通话
-                    memberInfo: [
-                        // 成员信息
-                        {
-                            memberId: obj.memberId, // 成员id
-                            memberName: obj.memberName, // 成员名称
-                            regionId: obj.regionId, // 成员的pass域id
-                            memberType: obj.memberType, // 成员类型,Integer ,1 单兵;2 普通电话;3 对讲机;4 app|客户端;6 可是话机; 7 汇接话机(PSTN、手机号码等); 8 车载;9 无人机喊话云台; 10 无人机地面站对讲平台; 11 ipc; 12 NVR
-                            memberCode: obj.memberCode, // 成员设备编码
-                            memberNumber: obj.memberNumber // 成员号码
-                        }
-                    ]
-                }
-            });
-            this.webSocketSend(params);
-        }
-        // 打开客户端指定模块
-    openClientModule(moduleID) {
-        const params = JSON.stringify({
-            loginIp: this.settings.letLoginIp,
-            method: "openClientModule",
-            userCode: this.settings.letUserCode,
-            params: {
-                moduleID: moduleID // 模块ID,0 视频监控;1 录像回放;2 视频上墙;3 下载中心
-            },
-            socketCode: this.socketCode
+        const ccp1 = JSON.stringify({
+          loginIp: this.settings.letLoginIp,
+          method: 'registerSoftPhone',
+          userCode: this.settings.letUserCode,
         });
-        this.webSocketSend(params);
-    }
+      this.webSocketSend(ccp1);
+      
+      setTimeout(() => {
+         const ccp = JSON.stringify({
+           loginIp: this.settings.letLoginIp,
+           method: 'createGroupChat',
+           params: obj,
+           userCode: this.settings.letUserCode,
+         });
+          this.webSocketSend(ccp);
+      }, 1000);
+      
+       
+
+    // const params = JSON.stringify({
+    //   loginIp: this.settings.letLoginIp,
+    //   method: 'createGroupChat',
+    //   userCode: this.settings.letUserCode,
+    //   socketCode: this.socketCode,
+    //   params: {
+    //     chatName: obj.chatName,
+    //     bOpenDirect: obj.bOpenDirect, // 是否打开音视频通话标志,true 创建成功后打开音视频通话,false 创建成功后不打开音视频通话
+    //     memberInfo: [
+    //       // 成员信息
+    //       {
+    //         memberId: obj.memberId, // 成员id
+    //         memberName: obj.memberName, // 成员名称
+    //         regionId: obj.regionId, // 成员的pass域id
+    //         memberType: obj.memberType, // 成员类型,Integer ,1 单兵;2 普通电话;3 对讲机;4 app|客户端;6 可是话机; 7 汇接话机(PSTN、手机号码等); 8 车载;9 无人机喊话云台; 10 无人机地面站对讲平台; 11 ipc; 12 NVR
+    //         memberCode: obj.memberCode, // 成员设备编码
+    //         memberNumber: obj.memberNumber, // 成员号码
+    //       },
+    //     ],
+    //   },
+    // });
+  
+  }
+  // 打开客户端指定模块
+  openClientModule(moduleID) {
+    const params = JSON.stringify({
+      loginIp: this.settings.letLoginIp,
+      method: 'openClientModule',
+      userCode: this.settings.letUserCode,
+      params: {
+        moduleID: moduleID, // 模块ID,0 视频监控;1 录像回放;2 视频上墙;3 下载中心
+      },
+      socketCode: this.socketCode,
+    });
+    this.webSocketSend(params);
+  }
 }
 
 window.InitWebSocketClass = InitWebSocketClass;

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 673 - 434
public/webClient/webClient_initWnd.js


+ 135 - 79
src/components/MarkerMap/index.tsx

@@ -259,12 +259,14 @@ export default defineComponent({
           });
         case '单兵': {
           var callback = () => {
-               if(marker['stat']==='online'){
+            if (marker['stat'] === 'online') {
+                //  debugger
                 mainstore.videoisshow = true;
                 // // try {
                   // daHuaStore.DAHUAUserObj(marker["userId"]).then(deviceUser=>{
                     mainstore.videotitle = marker["userName"] + "";
                   // });
+                 
 
                   const userid = marker['userId'];
                   const dievicecode = marker['deviceCode']+"";
@@ -272,99 +274,153 @@ export default defineComponent({
                   const channelid = marker['channelId']+"";
                   window.isdanbing = true;
 
-                  async function cremetting(){
-                    await window.metting.getLocalUserInfo();
-                    const res = await window.metting.queryUser(userid);
+                 async function cremetting() {
+                   await window.metting.deleteAllMeeting(() => { });
+                    // await window.metting.getLocalUserInfo();
+                    // const res = await window.metting.queryDevice(userid);
+              
     
-                    window.metting.localUserInfo.name = "danbing_Meeting";
+                    // window.metting.localUserInfo.name = "danbing_Meeting";
     
-                    await window.metting.creatMeeting();
-                    await window.metting.startInvite({
-                        userName: res.userName,
-                        userId: res.userCode,
-                        region: res.paasId,
-                        type: "single",
-                        // speak:'true',
-                        number: res.userPhone,
-                        deviceId: dievicecode,
-                        channelId: channelid,
-                    });
+                    // await window.metting.creatMeeting();
+                    // await window.metting.startInvite({
+                    //     userName: res.deviceName,
+                    //     userId: res.deviceCode,
+                    //     region: res.paasId+"",
+                    //     type: "single",
+                    //   speak: true,
+                    //    isfocus:true,
+                    //    userDomain:"3981f448463d4cdb8735083a5114e626",
+                    //     deviceId: dievicecode,
+                    //     channelId: channelid,
+                    // });
+                   
+                   
+                   
+                  //  await window.metting.getLocalUserInfo();
+
+                  //  window.metting.queryDevice(userid).then(res => {
+                  //    const chartParams = {
+                  //      chatName: "测试会商名称",
+                  //      groupType: 2,
+                  //      bOpenDirect: true,
+
+                  //      //  groupType: 2, //1 群聊 传2 会商 传3 群聊会会商
+                  //      memberInfo: [
+                  //        {
+                  //          memberId: res.deviceCode, // 成员id
+                  //          memberName: res.deviceName, // 成员名称
+                  //          memberType: 4, // 成员类型,Integer ,1 单兵;2 普通电话;3 对讲机;4 app|客户端;6 可是话机; 7 汇接话机(PSTN、手机号码等); 8 车载;9 无人机喊话云台; 10 无人机地面站对讲平台; 11 ipc; 12 NVR
+                  //          memberNumber: res.deviceCode, 
+                  //          isOpenVideo: false,
+                  //          deviceId: dievicecode,
+                  //          channelId: channelid,
+                  //          domainCode: '3981f448463d4cdb8735083a5114e626',
+                  //          region: res.paasId + "",
+
+
+                  //        }
+                  //      ]
+
+
+
+                  //    };
+
+
+                  //    window.theSocket && window.theSocket.createGroupChat(chartParams);
+                  //  });
+
+                 }
+              // cremetting();
+              // return;
+              var meeting = null;
+              if (window.metting) {
+                meeting = window.metting;
+                // meeting.settargetId("vPlayArea");
+              } else { 
+                meeting = new Meeting();
+                meeting.$Message = ElMessage;
+                meeting.openClient(() => { })
+              }
+              
+              // meeting.openClient(() => {
+
+                meeting.settargetId("vPlayArea");
+                meeting.playVideo({
+                  type: 'single',
+                  deviceId: marker['deviceCode'],
+                  channelId: channelid,
+                });
+                window.metting = meeting;
+                cremetting();
+
+                setTimeout(() => {
+                  try {
+                    if (window.vPlayArea) {
+                      window.vPlayArea.resize();
+                      window.vPlayArea.dragResize(0, 0, 0, 0)
+                    }
+                  } catch (E) {
                   }
+
+                }, 1000);
+              // });
                   
 
-                  if(window.metting){
-                    const meeting = window.metting;
-                    meeting.settargetId("vPlayArea");
-                      meeting.playVideo({
-                        type: 'single',
-                        deviceId: marker['deviceCode'],
-                        channelId: channelid,
-                      });
-                      cremetting();
+                  // if(window.metting){
+                  //   const meeting = window.metting;
+                  //   meeting.settargetId("vPlayArea");
+                  //     meeting.playVideo({
+                  //       type: 'single',
+                  //       deviceId: marker['deviceCode'],
+                  //       channelId: channelid,
+                  //     });
+                  //     cremetting();
                      
-                      setTimeout(() => {
-                        try{
-                          if(window.vPlayArea){
-                            window.vPlayArea.resize();
-                            window.vPlayArea.dragResize(0,0,0,0)
-                        }
-                        }catch(E){
-                        }
+                  //     setTimeout(() => {
+                  //       try{
+                  //         if(window.vPlayArea){
+                  //           window.vPlayArea.resize();
+                  //           window.vPlayArea.dragResize(0,0,0,0)
+                  //       }
+                  //       }catch(E){
+                  //       }
                         
-                      }, 500);
+                  //     }, 500);
                       
       
-                   }else{
-                    const meeting = new Meeting();
-                    meeting.$Message = ElMessage;
-                    if(window.theSocket){
-                      meeting.settargetId("vPlayArea");
-                      meeting.playVideo({
-                        type: 'single',
-                        deviceId: marker['deviceCode'],
-                        channelId: channelid,
-                      });
-                      window.metting = meeting;
-                      setTimeout(() => {
-                        try{
-                          if(window.vPlayArea){
-                            window.vPlayArea.resize();
-                            window.vPlayArea.dragResize(0,0,0,0)
-                        }
-                        }catch(E){
-                        }
+                  //  }else{
+                  //   const meeting = new Meeting();
+                  //   meeting.$Message = ElMessage;
+                  //   if(window.theSocket){
+                  //     meeting.settargetId("vPlayArea");
+                  //     meeting.playVideo({
+                  //       type: 'single',
+                  //       deviceId: marker['deviceCode'],
+                  //       channelId: channelid,
+                  //     });
+                  //     cremetting();
+                  //     window.metting = meeting;
+                  //     setTimeout(() => {
+                  //       try{
+                  //         if(window.vPlayArea){
+                  //           window.vPlayArea.resize();
+                  //           window.vPlayArea.dragResize(0,0,0,0)
+                  //       }
+                  //       }catch(E){
+                  //       }
                         
-                      }, 500);
+                  //     }, 500);
       
-                    }else{
-                      meeting.openClient(() => {
-                      
-                        meeting.settargetId("vPlayArea");
-                        meeting.playVideo({
-                          type: 'single',
-                          deviceId: marker['deviceCode'],
-                          channelId: channelid,
-                        });
-                        window.metting = meeting;
-                        cremetting();
-      
-                        setTimeout(() => {
-                          try{
-                            if(window.vPlayArea){
-                              window.vPlayArea.resize();
-                              window.vPlayArea.dragResize(0,0,0,0)
-                          }
-                          }catch(E){
-                          }
-                          
-                        }, 1000);
+                  //   }else{
+                     
                         
                      
-                      });
+                  //     });
       
-                    }
+                  //   }
       
-                    }
+                  //   }
 
                }else{
                 ElMessage.warning('设备离线,请联系大华相关人员');

+ 13 - 2
src/store/useMarkerStore.ts

@@ -133,8 +133,19 @@ export default defineStore<'marker', MarkerStateType, {}, MainActionsType>(
           const { data } = await getAllvideoDevice();
           let videoData = [];
           for (var index in data) {
-            if (data[index].gpsX) {
-              videoData.push(data[index]);
+            var cp = data[index];
+
+            // if (!cp.gpsX) {
+            //   cp['channelId'] = '6565283731802368';
+
+            //   cp["gpsX"] = 118.28 + (parseInt(index) * 3) / 10;
+            //   cp["gpsY"] = 33.97 + (parseInt(index) * 3) / 10;
+            // }
+            // cp['isOnline'] = true;
+            // cp['status'] = 1;
+            //  console.log(cp);
+            if (cp.gpsX) {
+              videoData.push(cp);
             }
           }
           this.videoSurveillance = [];

Vissa filer visades inte eftersom för många filer har ändrats