WXL (wul)
昨天 08881d6b6412822d5035f63a0775ca1f213c8668
测试完成
已修改13个文件
已删除2个文件
已添加5个文件
7715 ■■■■■ 文件已修改
dist (2).zip 补丁 | 查看 | 原始文档 | blame | 历史
dist (3).zip 补丁 | 查看 | 原始文档 | blame | 历史
dist.zip 补丁 | 查看 | 原始文档 | blame | 历史
src/views/followvisit/again/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/followvisit/complaint/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/followvisit/discharge/ClickCall.vue 1219 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/followvisit/discharge/index.vue 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/followvisit/discharge/js/cti-manager.js 202 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/followvisit/discharge/js/json2.js 506 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/followvisit/discharge/js/prototype.js 4874 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/followvisit/discharge/js/websocket.js 826 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/followvisit/discharge/outpatientService.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/followvisit/mzsatisfaction/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/followvisit/record/detailpage/index.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/followvisit/record/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/followvisit/zbAgain/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/followvisit/zysatisfaction/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/patient/propaganda/QuestionnaireTask.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/patient/propaganda/particty.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
vue.config.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dist (2).zip
Binary files differ
dist (3).zip
Binary files differ
dist.zip
Binary files differ
src/views/followvisit/again/index.vue
@@ -245,7 +245,7 @@
          <div class="documentf">
            <div class="document">
              <el-button type="success" size="medium" @click="onthatday()"
                >当日服务</el-button
                >今日服务</el-button
              >
            </div>
          </div>
src/views/followvisit/complaint/index.vue
@@ -253,7 +253,7 @@
          <div class="documentf">
            <div class="document">
              <el-button type="success" size="medium" @click="onthatday()"
                >当日服务</el-button
                >今日服务</el-button
              >
            </div>
          </div>
src/views/followvisit/discharge/ClickCall.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,1219 @@
<template>
  <div class="websocket-demo">
    <div>
      <h3>Websocket接口测试DEMO</h3>
      <div class="config-area">
        <div class="input-group">
          <label>CTI_WS_URL</label>
          <input
            type="text"
            v-model="config.cti_ws_url"
            placeholder="ws://40.78.0.169:6688"
          />
          <label>坐席工号</label>
          <input type="text" v-model="config.seatname" placeholder="8000" />
          <label>坐席分机</label>
          <input type="text" v-model="config.seatnum" placeholder="8000" />
          <label>密码</label>
          <input type="text" v-model="config.password" placeholder="123456" />
        </div>
        <div class="input-group">
          <label>外线号码</label>
          <input type="text" v-model="config.phone" placeholder="10086" />
          <label>UUID</label>
          <input type="text" v-model="config.uuid" />
          <label>其他坐席</label>
          <input type="text" v-model="config.other" placeholder="8001" />
          <label>技能组</label>
          <input type="text" v-model="config.group" placeholder="a3" />
          <label>外呼参数id</label>
          <input type="text" v-model="config.paramid" placeholder="3" />
        </div>
      </div>
      <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
      <div class="button-area">
        <!-- ç¬¬ä¸€è¡ŒæŒ‰é’® -->
        <div class="button-row">
          <button @click="seatlogin">签入</button>
          <button @click="seatlogout">签出</button>
          <button @click="afk">示忙</button>
          <button @click="online">示闲</button>
          <button @click="pickup">代答</button>
        </div>
        <!-- ç¬¬äºŒè¡ŒæŒ‰é’® -->
        <div class="button-row">
          <button @click="hangup">挂机</button>
          <button @click="callout">外呼</button>
          <button @click="transfer">通话转移</button>
          <button @click="transferresume">通话转移收回</button>
          <button @click="hold">通话保持</button>
          <button @click="holdresume">通话保持收回</button>
          <button @click="remove">通话强拆</button>
          <button @click="insert">通话强插</button>
          <button @click="monitor">监听</button>
          <button @click="monitor_to_talk">监听转通话</button>
          <button @click="monitor_end">监听结束</button>
          <button @click="choosecall">选择</button>
          <button @click="replacecall">代接</button>
          <button @click="three">三方通话</button>
        </div>
        <!-- ç¬¬ä¸‰è¡ŒæŒ‰é’® -->
        <div class="button-row">
          <button @click="handoff_ready">咨询开始</button>
          <button @click="handoff_call">咨询呼叫</button>
          <button @click="handoff_resume">咨询收回</button>
          <button @click="handoff_transfer">咨询转移</button>
          <button @click="handoff_three">咨询三方</button>
          <button @click="record_start">开始通话录音</button>
          <button @click="record_stop">停止通话录音</button>
        </div>
        <!-- ç¬¬å››è¡ŒæŒ‰é’® -->
        <div class="button-row">
          <button @click="openseatlist">打开坐席状态</button>
          <button @click="closeseatlist">关闭坐席状态</button>
          <button @click="openqueues">打开队列信息</button>
          <button @click="closequeues">关闭队列信息</button>
          <button @click="opencalllist">打开通话信息</button>
          <button @click="closecalllist">关闭通话信息</button>
          <button @click="openroutelist">打开路由信息</button>
          <button @click="closeroutelist">关闭路由信息</button>
        </div>
        <!-- ç¬¬äº”行按钮 -->
        <div class="button-row">
          <button @click="seatlist">获取坐席信息</button>
          <button @click="queues">获取队列信息</button>
          <button @click="calllist">获取通话信息</button>
          <button @click="routelist">获取路由信息</button>
          <button @click="batch">获取外呼参数信息</button>
          <button @click="batch_start">开始外呼任务</button>
          <button @click="batch_stop">停止外呼任务</button>
        </div>
      </div>
      <!-- æ—¥å¿—显示区域 -->
      <h3>协议日志区<button @click="testclear">清除</button></h3>
      <div id="msg" class="log-area">{{ logs }}</div>
    </div>
  </div>
</template>
<script>
export default {
  name: "WebsocketDemo",
  data() {
    return {
      config: {
        cti_ws_url: "wss://9.208.2.190:8092/cal-api/",
        seatname: "8000",
        seatnum: "8000",
        password: "123456",
        phone: "10086",
        uuid: "",
        other: "8001",
        group: "a3",
        paramid: "3",
      },
      logs: "",
      ws: null,
      isConnected: false,
    };
  },
  mounted() {
    this.initializeWebSocket();
  },
  beforeUnmount() {
    this.disconnectWebSocket();
  },
  methods: {
    // åˆå§‹åŒ–WebSocket连接
    initializeWebSocket() {
      try {
        // æ ¹æ®å½“前页面协议自动选择WS协议
        const isHttps = window.location.protocol === "https:";
        this.config.cti_ws_url = isHttps
          ? "wss://9.208.2.190:8092/cal-api/"
          : "ws://40.78.0.169:6688";
        if (typeof window.WebSocket === "undefined") {
          this.addLog("错误: æµè§ˆå™¨ä¸æ”¯æŒWebSocket");
          return;
        }
        this.connectWebSocket();
      } catch (error) {
        this.addLog(`初始化WebSocket错误: ${error.message}`);
        // å°è¯•使用备用地址
        this.config.cti_ws_url = "wss://9.208.2.190:8092/cal-api/";
        setTimeout(() => this.connectWebSocket(), 2000);
      }
    },
    // è¿žæŽ¥WebSocket
    connectWebSocket() {
      if (this.ws && this.ws.readyState === WebSocket.OPEN) {
        this.addLog("WebSocket已连接");
        return;
      }
      try {
        let wsUrl = this.config.cti_ws_url;
        // ç¡®ä¿HTTPS页面使用WSS
        if (
          window.location.protocol === "https:" &&
          wsUrl.startsWith("ws://")
        ) {
          wsUrl = wsUrl.replace("ws://", "wss://");
        }
        this.ws = new WebSocket(wsUrl);
        this.ws.onopen = () => {
          this.isConnected = true;
          this.addLog("WebSocket连接成功");
        };
        this.ws.onmessage = (event) => {
          this.handleWebSocketMessage(event);
        };
        this.ws.onclose = (event) => {
          this.isConnected = false;
          this.addLog(`WebSocket连接关闭: ${event.code} ${event.reason}`);
          // è‡ªåŠ¨é‡è¿ž
          setTimeout(() => this.connectWebSocket(), 3000);
        };
        this.ws.onerror = (error) => {
          this.addLog(`WebSocket错误: ${error.message}`);
          // å°è¯•备用URL
          if (!wsUrl.includes("9.208.2.190")) {
            this.config.cti_ws_url = "wss://9.208.2.190:8092/cal-api/";
            setTimeout(() => this.connectWebSocket(), 3000);
          }
        };
      } catch (error) {
        this.addLog(`连接WebSocket失败: ${error.message}`);
        // å°è¯•备用URL
        this.config.cti_ws_url = "wss://9.208.2.190:8092/cal-api/";
        setTimeout(() => this.connectWebSocket(), 3000);
      }
    },
    // å¤„理WebSocket消息
    handleWebSocketMessage(event) {
      const reader = new FileReader();
      reader.onloadend = (e) => {
        const message = reader.result;
        this.addLog(`收到消息: ${message}`);
        try {
          const obj = JSON.parse(message);
          // å¤„理心跳包
          if (obj.cmd === "system" && obj.action === "keepalive") {
            this.keepalive(obj.seatname, obj.seatnum);
          }
          // è‡ªåŠ¨è®¾ç½®UUID
          if (obj.cmd === "control" && obj.action === "tp_callin") {
            this.config.uuid = obj.uuid;
            this.addLog(`自动设置UUID: ${obj.uuid}`);
          }
        } catch (error) {
          this.addLog(`消息解析错误: ${error.message}`);
        }
      };
      reader.readAsText(event.data);
    },
    // æ–­å¼€WebSocket连接
    disconnectWebSocket() {
      if (this.ws) {
        this.ws.close();
        this.ws = null;
        this.isConnected = false;
        this.addLog("WebSocket已断开");
      }
    },
    // å‘送WebSocket消息
    sendWebSocketMessage(message) {
      if (!this.isConnected || !this.ws) {
        this.addLog("错误: WebSocket未连接");
        return false;
      }
      try {
        const messageStr =
          typeof message === "string" ? message : JSON.stringify(message);
        this.ws.send(messageStr);
        this.addLog(`发送消息: ${messageStr}`);
        return true;
      } catch (error) {
        this.addLog(`发送消息失败: ${error.message}`);
        return false;
      }
    },
    // éªŒè¯å‚æ•°
    validateParams(params, requiredFields) {
      for (const field of requiredFields) {
        if (!params[field] || params[field].toString().trim() === "") {
          this.addLog(`错误: ${field} ä¸èƒ½ä¸ºç©º`);
          return false;
        }
      }
      return true;
    },
    // ==================== WebSocket.js åŠŸèƒ½æ•´åˆ ====================
    // ç­¾å…¥
    seatlogin() {
      const { seatname, seatnum, password, cti_ws_url } = this.config;
      if (
        !this.validateParams({ seatname, seatnum }, ["seatname", "seatnum"])
      ) {
        return;
      }
      // é‡æ–°è¿žæŽ¥WebSocket(原js文件中的逻辑)
      this.connectWebSocket();
      setTimeout(() => {
        const protocol = {
          cmd: "system",
          action: "seatlogin",
          seatname: seatname,
          seatnum: seatnum,
          password: password,
          timestamp: Date.now(),
        };
        this.sendWebSocketMessage(protocol);
      }, 1000);
    },
    // ç­¾å‡º
    seatlogout() {
      const { seatname, seatnum } = this.config;
      if (
        !this.validateParams({ seatname, seatnum }, ["seatname", "seatnum"])
      ) {
        return;
      }
      const protocol = {
        cmd: "system",
        action: "seatlogout",
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
      this.ws.close();
    },
    // ç¤ºå¿™
    afk() {
      const { seatname, seatnum } = this.config;
      if (
        !this.validateParams({ seatname, seatnum }, ["seatname", "seatnum"])
      ) {
        return;
      }
      const protocol = {
        cmd: "system",
        action: "afk",
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // ç¤ºé—²
    online() {
      const { seatname, seatnum } = this.config;
      if (
        !this.validateParams({ seatname, seatnum }, ["seatname", "seatnum"])
      ) {
        return;
      }
      const protocol = {
        cmd: "system",
        action: "online",
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // ä»£ç­”
    pickup() {
      const { seatname, seatnum } = this.config;
      if (!this.validateParams({ seatnum }, ["seatnum"])) {
        return;
      }
      const protocol = {
        cmd: "control",
        action: "pickup",
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // æŒ‚机
    hangup() {
      const { seatname, seatnum } = this.config;
      if (!this.validateParams({ seatnum }, ["seatnum"])) {
        return;
      }
      const protocol = {
        cmd: "control",
        action: "hangup",
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // å¤–呼
    callout() {
      const { seatname, seatnum, phone } = this.config;
      if (!this.validateParams({ seatnum, phone }, ["seatnum", "phone"])) {
        return;
      }
      const protocol = {
        cmd: "control",
        action: "callout",
        phone: phone,
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // é€šè¯è½¬ç§»
    transfer() {
      const { seatname, seatnum, phone, uuid } = this.config;
      if (
        !this.validateParams({ seatnum, phone, uuid }, [
          "seatnum",
          "phone",
          "uuid",
        ])
      ) {
        return;
      }
      const protocol = {
        cmd: "control",
        action: "transfer",
        uuid: uuid,
        phone: phone,
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // é€šè¯è½¬ç§»æ”¶å›ž
    transferresume() {
      const { seatname, seatnum, phone, uuid } = this.config;
      if (
        !this.validateParams({ seatnum, phone, uuid }, [
          "seatnum",
          "phone",
          "uuid",
        ])
      ) {
        return;
      }
      const protocol = {
        cmd: "control",
        action: "transferresume",
        uuid: uuid,
        phone: phone,
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // é€šè¯ä¿æŒ
    hold() {
      const { seatname, seatnum, uuid } = this.config;
      if (!this.validateParams({ seatnum, uuid }, ["seatnum", "uuid"])) {
        return;
      }
      const protocol = {
        cmd: "control",
        action: "hold",
        uuid: uuid,
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // é€šè¯ä¿æŒæ”¶å›ž
    holdresume() {
      const { seatname, seatnum, uuid } = this.config;
      if (!this.validateParams({ seatnum, uuid }, ["seatnum", "uuid"])) {
        return;
      }
      const protocol = {
        cmd: "control",
        action: "holdresume",
        uuid: uuid,
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // é€šè¯å¼ºæ‹†
    remove() {
      const { seatname, seatnum, phone } = this.config;
      if (!this.validateParams({ seatnum, phone }, ["seatnum", "phone"])) {
        return;
      }
      const protocol = {
        cmd: "control",
        action: "remove",
        phone: phone,
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // é€šè¯å¼ºæ’
    insert() {
      const { seatname, seatnum, phone } = this.config;
      if (!this.validateParams({ seatnum, phone }, ["seatnum", "phone"])) {
        return;
      }
      const protocol = {
        cmd: "control",
        action: "insert",
        phone: phone,
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // ç›‘听
    monitor() {
      const { seatname, seatnum, phone } = this.config;
      if (!this.validateParams({ seatnum, phone }, ["seatnum", "phone"])) {
        return;
      }
      const protocol = {
        cmd: "control",
        action: "monitor",
        phone: phone,
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // ç›‘听转通话
    monitor_to_talk() {
      const { seatname, seatnum, phone } = this.config;
      if (!this.validateParams({ seatnum, phone }, ["seatnum", "phone"])) {
        return;
      }
      const protocol = {
        cmd: "control",
        action: "monitor_to_talk",
        phone: phone,
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // ç›‘听结束
    monitor_end() {
      const { seatname, seatnum, phone } = this.config;
      if (!this.validateParams({ seatnum, phone }, ["seatnum", "phone"])) {
        return;
      }
      const protocol = {
        cmd: "control",
        action: "monitor_end",
        phone: phone,
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // é€‰æ‹©é€šè¯
    choosecall() {
      const { seatname, seatnum, uuid } = this.config;
      if (!this.validateParams({ seatnum, uuid }, ["seatnum", "uuid"])) {
        return;
      }
      const protocol = {
        cmd: "control",
        action: "choosecall",
        uuid: uuid,
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // ä»£æŽ¥
    replacecall() {
      const { seatname, seatnum, phone } = this.config;
      if (!this.validateParams({ seatnum, phone }, ["seatnum", "phone"])) {
        return;
      }
      const protocol = {
        cmd: "control",
        action: "replacecall",
        phone: phone,
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // ä¸‰æ–¹é€šè¯
    three() {
      const { seatname, seatnum, phone } = this.config;
      if (!this.validateParams({ seatnum, phone }, ["seatnum", "phone"])) {
        return;
      }
      const protocol = {
        cmd: "control",
        action: "three",
        phone: phone,
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // å’¨è¯¢å¼€å§‹
    handoff_ready() {
      const { seatname, seatnum, uuid } = this.config;
      if (!this.validateParams({ seatnum, uuid }, ["seatnum", "uuid"])) {
        return;
      }
      const protocol = {
        cmd: "control",
        action: "handoff_ready",
        uuid: uuid,
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // å’¨è¯¢å‘¼å«
    handoff_call() {
      const { seatname, seatnum, other, uuid } = this.config;
      if (
        !this.validateParams({ seatnum, other, uuid }, [
          "seatnum",
          "other",
          "uuid",
        ])
      ) {
        return;
      }
      const protocol = {
        cmd: "control",
        action: "handoff_call",
        uuid: uuid,
        phone: other,
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // å’¨è¯¢æ”¶å›ž
    handoff_resume() {
      const { seatname, seatnum, uuid } = this.config;
      if (!this.validateParams({ seatnum, uuid }, ["seatnum", "uuid"])) {
        return;
      }
      const protocol = {
        cmd: "control",
        action: "handoff_resume",
        uuid: uuid,
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // å’¨è¯¢è½¬ç§»
    handoff_transfer() {
      const { seatname, seatnum, other, uuid } = this.config;
      if (
        !this.validateParams({ seatnum, other, uuid }, [
          "seatnum",
          "other",
          "uuid",
        ])
      ) {
        return;
      }
      const protocol = {
        cmd: "control",
        action: "handoff_transfer",
        uuid: uuid,
        phone: other,
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // å’¨è¯¢ä¸‰æ–¹
    handoff_three() {
      const { seatname, seatnum, uuid } = this.config;
      if (!this.validateParams({ seatnum, uuid }, ["seatnum", "uuid"])) {
        return;
      }
      const protocol = {
        cmd: "control",
        action: "handoff_three",
        uuid: uuid,
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // å¼€å§‹é€šè¯å½•音
    record_start() {
      const { seatname, seatnum, uuid } = this.config;
      if (!this.validateParams({ seatnum, uuid }, ["seatnum", "uuid"])) {
        return;
      }
      const protocol = {
        cmd: "control",
        action: "record_start",
        uuid: uuid,
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // åœæ­¢é€šè¯å½•音
    record_stop() {
      const { seatname, seatnum, uuid } = this.config;
      if (!this.validateParams({ seatnum, uuid }, ["seatnum", "uuid"])) {
        return;
      }
      const protocol = {
        cmd: "control",
        action: "record_stop",
        uuid: uuid,
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // æ‰“开坐席状态
    openseatlist() {
      const { seatname, seatnum } = this.config;
      if (!this.validateParams({ seatnum }, ["seatnum"])) {
        return;
      }
      const protocol = {
        cmd: "status",
        action: "openseatlist",
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // å…³é—­åå¸­çŠ¶æ€
    closeseatlist() {
      const { seatname, seatnum } = this.config;
      if (!this.validateParams({ seatnum }, ["seatnum"])) {
        return;
      }
      const protocol = {
        cmd: "status",
        action: "closeseatlist",
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // æ‰“开队列信息
    openqueues() {
      const { seatname, seatnum } = this.config;
      if (!this.validateParams({ seatnum }, ["seatnum"])) {
        return;
      }
      const protocol = {
        cmd: "status",
        action: "openqueues",
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // å…³é—­é˜Ÿåˆ—信息
    closequeues() {
      const { seatname, seatnum } = this.config;
      if (!this.validateParams({ seatnum }, ["seatnum"])) {
        return;
      }
      const protocol = {
        cmd: "status",
        action: "closequeues",
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // æ‰“开通话信息
    opencalllist() {
      const { seatname, seatnum } = this.config;
      if (!this.validateParams({ seatnum }, ["seatnum"])) {
        return;
      }
      const protocol = {
        cmd: "status",
        action: "opencalllist",
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // å…³é—­é€šè¯ä¿¡æ¯
    closecalllist() {
      const { seatname, seatnum } = this.config;
      if (!this.validateParams({ seatnum }, ["seatnum"])) {
        return;
      }
      const protocol = {
        cmd: "status",
        action: "closecalllist",
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // æ‰“开路由信息
    openroutelist() {
      const { seatname, seatnum } = this.config;
      if (!this.validateParams({ seatnum }, ["seatnum"])) {
        return;
      }
      const protocol = {
        cmd: "status",
        action: "openroutelist",
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // å…³é—­è·¯ç”±ä¿¡æ¯
    closeroutelist() {
      const { seatname, seatnum } = this.config;
      if (!this.validateParams({ seatnum }, ["seatnum"])) {
        return;
      }
      const protocol = {
        cmd: "status",
        action: "closeroutelist",
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // èŽ·å–åå¸­ä¿¡æ¯
    seatlist() {
      const { group } = this.config;
      if (!this.validateParams({ group }, ["group"])) {
        return;
      }
      const protocol = {
        cmd: "status",
        action: "seatlist",
        group: group,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // èŽ·å–é˜Ÿåˆ—ä¿¡æ¯
    queues() {
      const protocol = {
        cmd: "status",
        action: "queues",
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // èŽ·å–é€šè¯ä¿¡æ¯
    calllist() {
      const protocol = {
        cmd: "status",
        action: "calllist",
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // èŽ·å–è·¯ç”±ä¿¡æ¯
    routelist() {
      const protocol = {
        cmd: "status",
        action: "routelist",
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // èŽ·å–å¤–å‘¼å‚æ•°ä¿¡æ¯
    batch() {
      const { paramid } = this.config;
      if (!this.validateParams({ paramid }, ["paramid"])) {
        return;
      }
      const protocol = {
        cmd: "status",
        action: "batch",
        paramid: paramid,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // å¼€å§‹å¤–呼任务
    batch_start() {
      const { seatname, seatnum } = this.config;
      if (!this.validateParams({ seatnum }, ["seatnum"])) {
        return;
      }
      const protocol = {
        cmd: "system",
        action: "batch_start",
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // åœæ­¢å¤–呼任务
    batch_stop() {
      const { seatname, seatnum } = this.config;
      if (!this.validateParams({ seatnum }, ["seatnum"])) {
        return;
      }
      const protocol = {
        cmd: "system",
        action: "batch_stop",
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // å¿ƒè·³åŒ…
    keepalive(seatname, seatnum) {
      if (!this.validateParams({ seatnum }, ["seatnum"])) {
        return;
      }
      const protocol = {
        cmd: "system",
        action: "keepalive",
        seatname: seatname,
        seatnum: seatnum,
        timestamp: Date.now(),
      };
      this.sendWebSocketMessage(protocol);
    },
    // æ¸…除日志
    testclear() {
      this.logs = "";
      this.addLog("日志已清除");
    },
    // æ·»åŠ æ—¥å¿—
    addLog(message) {
      const timestamp = new Date().toLocaleTimeString();
      this.logs += `[${timestamp}] ${message}\n`;
      // é™åˆ¶æ—¥å¿—长度,防止内存溢出
      const logLines = this.logs.split("\n");
      if (logLines.length > 100) {
        this.logs = logLines.slice(-50).join("\n");
      }
    },
  },
};
</script>
<style scoped>
.websocket-demo {
  font-family: Arial, sans-serif;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}
.config-area {
  margin-bottom: 20px;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #f9f9f9;
}
.input-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.input-group label {
  font-weight: bold;
  min-width: 80px;
}
.input-group input {
  padding: 5px 10px;
  border: 1px solid #ccc;
  border-radius: 3px;
  width: 120px;
}
.button-area {
  margin-bottom: 20px;
}
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}
.button-row button {
  padding: 8px 15px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background-color: #f0f0f0;
  cursor: pointer;
  transition: background-color 0.3s;
  font-size: 12px;
}
.button-row button:hover {
  background-color: #e0e0e0;
}
.button-row button:active {
  background-color: #d0d0d0;
  transform: translateY(1px);
}
.log-area {
  height: 300px;
  overflow-y: auto;
  border: 1px solid #ccc;
  padding: 10px;
  background-color: #f5f5f5;
  white-space: pre-wrap;
  font-family: "Courier New", monospace;
  font-size: 12px;
  line-height: 1.4;
}
h3 {
  color: #333;
  border-bottom: 2px solid #eee;
  padding-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
h3 button {
  padding: 5px 10px;
  font-size: 12px;
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 3px;
  cursor: pointer;
}
/* å“åº”式设计 */
@media (max-width: 768px) {
  .websocket-demo {
    padding: 10px;
  }
  .input-group {
    flex-direction: column;
    align-items: flex-start;
  }
  .input-group input {
    width: 100%;
  }
  .button-row {
    flex-direction: column;
  }
  .button-row button {
    width: 100%;
    margin-bottom: 5px;
  }
}
</style>
src/views/followvisit/discharge/index.vue
@@ -132,7 +132,17 @@
            placeholder="请输入主治医生"
          ></el-input>
        </el-form-item>
        <el-form-item label="日期限制" prop="status">
          <el-select v-model="endOut" placeholder="请选择">
            <el-option
              v-for="item in endOuts"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="患者范围" prop="status">
          <el-cascader
            v-model="topqueryParams.scopetype"
@@ -259,7 +269,7 @@
          <div class="documentf">
            <div class="document">
              <el-button type="success" size="medium" @click="onthatday()"
                >当日服务</el-button
                >今日服务</el-button
              >
            </div>
          </div>
@@ -443,6 +453,7 @@
          prop="drname"
        />
        <el-table-column
          v-if="orgname != '丽水市中医院'"
          label="随访人员"
          align="center"
          key="updateBy"
@@ -450,6 +461,7 @@
          width="120"
        />
        <el-table-column
          v-if="orgname != '丽水市中医院'"
          label="经管医生"
          align="center"
          key="managementDoctor"
@@ -1175,6 +1187,17 @@
        qystatus: "",
        btstatus: "",
      },
      endOut: 1,
      endOuts: [
        {
          value: 0,
          label: "截止至当日服务",
        },
        {
          value: 1,
          label: "全部服务",
        },
      ],
      topicoptionssort: [
        {
          value: 0,
@@ -1214,6 +1237,7 @@
        leaveldeptcodes: [],
        leavehospitaldistrictcodes: [],
      },
      orgname: "",
      propss: { multiple: true },
      options: [],
@@ -1315,6 +1339,7 @@
    this.serviceState = store.getters.serviceState;
    this.checkboxlist = store.getters.checkboxlist;
    this.errtype = this.$route.query.errtype;
    this.orgname = localStorage.getItem("orgname");
    this.leavehospitaldistrictcode =
      this.$route.query.leavehospitaldistrictcode;
    this.sourcetype[0].children = store.getters.belongDepts.map((dept) => {
@@ -1345,13 +1370,21 @@
    /** æŸ¥è¯¢éšè®¿æœåŠ¡åˆ—è¡¨ */
    getList(refresh) {
      // é»˜è®¤å…¨éƒ¨
      if (this.topqueryParams.searchscope == 3) {
        this.topqueryParams.leaveldeptcodes = store.getters.belongDepts.map(
          (obj) => obj.deptCode
        );
        this.topqueryParams.leavehospitaldistrictcodes =
          store.getters.belongWards.map((obj) => obj.districtCode);
      }
      console.log(this.endOut);
      if (this.endOut == 0) {
        this.topqueryParams.endOutHospTime = this.formatDateToYYYYMMDDHHMMSS(
          this.getEndOfDay()
        );
      } else {
        this.topqueryParams.endOutHospTime = null;
      }
      // æŽ¥å—异常跳转
      if (this.errtype) {
@@ -1408,6 +1441,22 @@
        });
        this.total = response.total;
      });
    },
    // æ—¶é—´
    getEndOfDay() {
      const date = new Date(); // åˆ›å»ºä¸€ä¸ªè¡¨ç¤ºå½“前时间的Date对象
      date.setHours(23, 59, 59, 0); // å°†æ—¶é—´è®¾ç½®ä¸º23:59:59.000
      return date;
    },
    formatDateToYYYYMMDDHHMMSS(date) {
      const year = date.getFullYear();
      const month = String(date.getMonth() + 1).padStart(2, "0"); // æœˆä»½è¡¥é›¶
      const day = String(date.getDate()).padStart(2, "0"); // æ—¥æœŸè¡¥é›¶
      const hours = String(date.getHours()).padStart(2, "0");
      const minutes = String(date.getMinutes()).padStart(2, "0");
      const seconds = String(date.getSeconds()).padStart(2, "0");
      return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
    },
    affiliation() {
      this.topqueryParams.managementDoctorCode = store.getters.hisUserId;
@@ -1796,7 +1845,7 @@
      let type = "";
      console.log(row, "rwo");
      if (row.preachformson) {
        if (row.preachformson.includes("3")) {
        if (row.preachformson.includes("3") || row.type == 1) {
          type = 1;
        }
      }
src/views/followvisit/discharge/js/cti-manager.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,202 @@
// cti-manager.js - ç§»é™¤prototype依赖的版本
(function(root, factory) {
    if (typeof define === 'function' && define.amd) {
        define([], factory);
    } else if (typeof module === 'object' && module.exports) {
        module.exports = factory();
    } else {
        root.CTIManager = factory();
    }
}(this, function() {
    'use strict';
    // ç®€å•的对象扩展方法
    function extend(target, source) {
        if (!source) return target;
        for (var key in source) {
            if (source.hasOwnProperty(key)) {
                target[key] = source[key];
            }
        }
        return target;
    }
    function CTIManager(options) {
        var defaultOptions = {
            autoReconnect: true,
            maxReconnectAttempts: 5,
            debug: true
        };
        this.options = extend({}, defaultOptions);
        this.options = extend(this.options, options || {});
        this.websocket = null;
        this.isLoggedIn = false;
        this.currentCall = null;
        this.seatInfo = {};
        this.eventHandlers = {};
        this.init();
    }
    CTIManager.prototype = {
        init: function() {
            this.setupEventHandlers();
        },
        setupEventHandlers: function() {
            // é»˜è®¤äº‹ä»¶å¤„理器
            this.on('login_success', this.handleLoginSuccess.bind(this));
            this.on('login_failed', this.handleLoginFailed.bind(this));
            this.on('call_start', this.handleCallStart.bind(this));
            this.on('call_end', this.handleCallEnd.bind(this));
            this.on('seat_status_change', this.handleSeatStatusChange.bind(this));
        },
        connect: function(url) {
            try {
                // ç¡®ä¿CTIWebSocket已全局可用
                if (typeof CTIWebSocket === 'undefined') {
                    this.trigger('error', { type: 'dependency_error', message: 'CTIWebSocket未定义' });
                    return false;
                }
                this.websocket = new CTIWebSocket({
                    url: url,
                    debug: this.options.debug,
                    reconnectInterval: 3000,
                    maxReconnectAttempts: this.options.maxReconnectAttempts
                });
                this.bindWebSocketEvents();
                return true;
            } catch (error) {
                this.trigger('error', { type: 'connection_error', error: error });
                return false;
            }
        },
        bindWebSocketEvents: function() {
            var self = this;
            this.websocket.on('open', function() {
                self.trigger('connected');
            });
            this.websocket.on('close', function() {
                self.isLoggedIn = false;
                self.trigger('disconnected');
            });
            this.websocket.on('error', function(error) {
                self.trigger('error', error);
            });
            // ç›‘听特定的CTI消息
            this.websocket.on('cti:system:keepalive', function(data) {
                self.trigger('keepalive', data);
            });
            this.websocket.on('cti:control:tp_callin', function(data) {
                self.trigger('call_incoming', data);
                if (data.uuid) {
                    self.trigger('uuid_received', data.uuid);
                }
            });
        },
        // ç™»å½•相关方法
        login: function(seatname, seatnum, password) {
            if (!this.websocket || !this.websocket.isConnected) {
                this.trigger('error', { type: 'not_connected', message: 'WebSocket未连接' });
                return false;
            }
            return this.websocket.seatlogin(seatname, seatnum, password);
        },
        logout: function() {
            if (this.websocket && this.isLoggedIn) {
                var result = this.websocket.seatlogout(this.seatInfo.seatname, this.seatInfo.seatnum);
                if (result) {
                    this.isLoggedIn = false;
                    this.seatInfo = {};
                }
                return result;
            }
            return false;
        },
        // å‘¼å«æŽ§åˆ¶æ–¹æ³•
        makeCall: function(phoneNumber) {
            if (!this.isLoggedIn) {
                this.trigger('error', { type: 'not_logged_in', message: '坐席未登录' });
                return false;
            }
            return this.websocket.callout(this.seatInfo.seatname, this.seatInfo.seatnum, phoneNumber);
        },
        hangupCall: function(uuid) {
            if (!this.isLoggedIn) {
                return false;
            }
            var callUuid = uuid || (this.currentCall ? this.currentCall.uuid : '');
            return this.websocket.hangup(this.seatInfo.seatname, this.seatInfo.seatnum, callUuid);
        },
        // åå¸­çŠ¶æ€æŽ§åˆ¶
        setAfk: function() {
            if (this.isLoggedIn) {
                return this.websocket.afk(this.seatInfo.seatname, this.seatInfo.seatnum);
            }
            return false;
        },
        setOnline: function() {
            if (this.isLoggedIn) {
                return this.websocket.online(this.seatInfo.seatname, this.seatInfo.seatnum);
            }
            return false;
        },
        // äº‹ä»¶ç®¡ç†
        on: function(event, handler) {
            if (!this.eventHandlers[event]) {
                this.eventHandlers[event] = [];
            }
            this.eventHandlers[event].push(handler);
        },
        off: function(event, handler) {
            if (this.eventHandlers[event]) {
                var index = this.eventHandlers[event].indexOf(handler);
                if (index > -1) {
                    this.eventHandlers[event].splice(index, 1);
                }
            }
        },
        trigger: function(event, data) {
            if (this.eventHandlers[event]) {
                this.eventHandlers[event].forEach(function(handler) {
                    if (typeof handler === 'function') {
                        handler(data);
                    }
                });
            }
        },
        destroy: function() {
            if (this.websocket) {
                this.websocket.close();
                this.websocket = null;
            }
            this.eventHandlers = {};
        }
    };
    return CTIManager;
}));
src/views/followvisit/discharge/js/json2.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,506 @@
//  json2.js
//  2016-05-01
//  Public Domain.
//  NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
//  See http://www.JSON.org/js.html
//  This code should be minified before deployment.
//  See http://javascript.crockford.com/jsmin.html
//  USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
//  NOT CONTROL.
//  This file creates a global JSON object containing two methods: stringify
//  and parse. This file is provides the ES5 JSON capability to ES3 systems.
//  If a project might run on IE8 or earlier, then this file should be included.
//  This file does nothing on ES5 systems.
//      JSON.stringify(value, replacer, space)
//          value       any JavaScript value, usually an object or array.
//          replacer    an optional parameter that determines how object
//                      values are stringified for objects. It can be a
//                      function or an array of strings.
//          space       an optional parameter that specifies the indentation
//                      of nested structures. If it is omitted, the text will
//                      be packed without extra whitespace. If it is a number,
//                      it will specify the number of spaces to indent at each
//                      level. If it is a string (such as "\t" or "&nbsp;"),
//                      it contains the characters used to indent at each level.
//          This method produces a JSON text from a JavaScript value.
//          When an object value is found, if the object contains a toJSON
//          method, its toJSON method will be called and the result will be
//          stringified. A toJSON method does not serialize: it returns the
//          value represented by the name/value pair that should be serialized,
//          or undefined if nothing should be serialized. The toJSON method
//          will be passed the key associated with the value, and this will be
//          bound to the value.
//          For example, this would serialize Dates as ISO strings.
//              Date.prototype.toJSON = function (key) {
//                  function f(n) {
//                      // Format integers to have at least two digits.
//                      return (n < 10)
//                          ? "0" + n
//                          : n;
//                  }
//                  return this.getUTCFullYear()   + "-" +
//                       f(this.getUTCMonth() + 1) + "-" +
//                       f(this.getUTCDate())      + "T" +
//                       f(this.getUTCHours())     + ":" +
//                       f(this.getUTCMinutes())   + ":" +
//                       f(this.getUTCSeconds())   + "Z";
//              };
//          You can provide an optional replacer method. It will be passed the
//          key and value of each member, with this bound to the containing
//          object. The value that is returned from your method will be
//          serialized. If your method returns undefined, then the member will
//          be excluded from the serialization.
//          If the replacer parameter is an array of strings, then it will be
//          used to select the members to be serialized. It filters the results
//          such that only members with keys listed in the replacer array are
//          stringified.
//          Values that do not have JSON representations, such as undefined or
//          functions, will not be serialized. Such values in objects will be
//          dropped; in arrays they will be replaced with null. You can use
//          a replacer function to replace those with JSON values.
//          JSON.stringify(undefined) returns undefined.
//          The optional space parameter produces a stringification of the
//          value that is filled with line breaks and indentation to make it
//          easier to read.
//          If the space parameter is a non-empty string, then that string will
//          be used for indentation. If the space parameter is a number, then
//          the indentation will be that many spaces.
//          Example:
//          text = JSON.stringify(["e", {pluribus: "unum"}]);
//          // text is '["e",{"pluribus":"unum"}]'
//          text = JSON.stringify(["e", {pluribus: "unum"}], null, "\t");
//          // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
//          text = JSON.stringify([new Date()], function (key, value) {
//              return this[key] instanceof Date
//                  ? "Date(" + this[key] + ")"
//                  : value;
//          });
//          // text is '["Date(---current time---)"]'
//      JSON.parse(text, reviver)
//          This method parses a JSON text to produce an object or array.
//          It can throw a SyntaxError exception.
//          The optional reviver parameter is a function that can filter and
//          transform the results. It receives each of the keys and values,
//          and its return value is used instead of the original value.
//          If it returns what it received, then the structure is not modified.
//          If it returns undefined then the member is deleted.
//          Example:
//          // Parse the text. Values that look like ISO date strings will
//          // be converted to Date objects.
//          myData = JSON.parse(text, function (key, value) {
//              var a;
//              if (typeof value === "string") {
//                  a =
//   /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
//                  if (a) {
//                      return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
//                          +a[5], +a[6]));
//                  }
//              }
//              return value;
//          });
//          myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
//              var d;
//              if (typeof value === "string" &&
//                      value.slice(0, 5) === "Date(" &&
//                      value.slice(-1) === ")") {
//                  d = new Date(value.slice(5, -1));
//                  if (d) {
//                      return d;
//                  }
//              }
//              return value;
//          });
//  This is a reference implementation. You are free to copy, modify, or
//  redistribute.
/*jslint
    eval, for, this
*/
/*property
    JSON, apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
    getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
    lastIndex, length, parse, prototype, push, replace, slice, stringify,
    test, toJSON, toString, valueOf
*/
// Create a JSON object only if one does not already exist. We create the
// methods in a closure to avoid creating global variables.
if (typeof JSON !== "object") {
    JSON = {};
}
(function () {
    "use strict";
    var rx_one = /^[\],:{}\s]*$/;
    var rx_two = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g;
    var rx_three = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g;
    var rx_four = /(?:^|:|,)(?:\s*\[)+/g;
    var rx_escapable = /[\\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
    var rx_dangerous = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
    function f(n) {
        // Format integers to have at least two digits.
        return n < 10
            ? "0" + n
            : n;
    }
    function this_value() {
        return this.valueOf();
    }
    if (typeof Date.prototype.toJSON !== "function") {
        Date.prototype.toJSON = function () {
            return isFinite(this.valueOf())
                ? this.getUTCFullYear() + "-" +
                        f(this.getUTCMonth() + 1) + "-" +
                        f(this.getUTCDate()) + "T" +
                        f(this.getUTCHours()) + ":" +
                        f(this.getUTCMinutes()) + ":" +
                        f(this.getUTCSeconds()) + "Z"
                : null;
        };
        Boolean.prototype.toJSON = this_value;
        Number.prototype.toJSON = this_value;
        String.prototype.toJSON = this_value;
    }
    var gap;
    var indent;
    var meta;
    var rep;
    function quote(string) {
// If the string contains no control characters, no quote characters, and no
// backslash characters, then we can safely slap some quotes around it.
// Otherwise we must also replace the offending characters with safe escape
// sequences.
        rx_escapable.lastIndex = 0;
        return rx_escapable.test(string)
            ? "\"" + string.replace(rx_escapable, function (a) {
                var c = meta[a];
                return typeof c === "string"
                    ? c
                    : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
            }) + "\""
            : "\"" + string + "\"";
    }
    function str(key, holder) {
// Produce a string from holder[key].
        var i;          // The loop counter.
        var k;          // The member key.
        var v;          // The member value.
        var length;
        var mind = gap;
        var partial;
        var value = holder[key];
// If the value has a toJSON method, call it to obtain a replacement value.
        if (value && typeof value === "object" &&
                typeof value.toJSON === "function") {
            value = value.toJSON(key);
        }
// If we were called with a replacer function, then call the replacer to
// obtain a replacement value.
        if (typeof rep === "function") {
            value = rep.call(holder, key, value);
        }
// What happens next depends on the value's type.
        switch (typeof value) {
        case "string":
            return quote(value);
        case "number":
// JSON numbers must be finite. Encode non-finite numbers as null.
            return isFinite(value)
                ? String(value)
                : "null";
        case "boolean":
        case "null":
// If the value is a boolean or null, convert it to a string. Note:
// typeof null does not produce "null". The case is included here in
// the remote chance that this gets fixed someday.
            return String(value);
// If the type is "object", we might be dealing with an object or an array or
// null.
        case "object":
// Due to a specification blunder in ECMAScript, typeof null is "object",
// so watch out for that case.
            if (!value) {
                return "null";
            }
// Make an array to hold the partial results of stringifying this object value.
            gap += indent;
            partial = [];
// Is the value an array?
            if (Object.prototype.toString.apply(value) === "[object Array]") {
// The value is an array. Stringify every element. Use null as a placeholder
// for non-JSON values.
                length = value.length;
                for (i = 0; i < length; i += 1) {
                    partial[i] = str(i, value) || "null";
                }
// Join all of the elements together, separated with commas, and wrap them in
// brackets.
                v = partial.length === 0
                    ? "[]"
                    : gap
                        ? "[\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "]"
                        : "[" + partial.join(",") + "]";
                gap = mind;
                return v;
            }
// If the replacer is an array, use it to select the members to be stringified.
            if (rep && typeof rep === "object") {
                length = rep.length;
                for (i = 0; i < length; i += 1) {
                    if (typeof rep[i] === "string") {
                        k = rep[i];
                        v = str(k, value);
                        if (v) {
                            partial.push(quote(k) + (
                                gap
                                    ? ": "
                                    : ":"
                            ) + v);
                        }
                    }
                }
            } else {
// Otherwise, iterate through all of the keys in the object.
                for (k in value) {
                    if (Object.prototype.hasOwnProperty.call(value, k)) {
                        v = str(k, value);
                        if (v) {
                            partial.push(quote(k) + (
                                gap
                                    ? ": "
                                    : ":"
                            ) + v);
                        }
                    }
                }
            }
// Join all of the member texts together, separated with commas,
// and wrap them in braces.
            v = partial.length === 0
                ? "{}"
                : gap
                    ? "{\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "}"
                    : "{" + partial.join(",") + "}";
            gap = mind;
            return v;
        }
    }
// If the JSON object does not yet have a stringify method, give it one.
    if (typeof JSON.stringify !== "function") {
        meta = {    // table of character substitutions
            "\b": "\\b",
            "\t": "\\t",
            "\n": "\\n",
            "\f": "\\f",
            "\r": "\\r",
            "\"": "\\\"",
            "\\": "\\\\"
        };
        JSON.stringify = function (value, replacer, space) {
// The stringify method takes a value and an optional replacer, and an optional
// space parameter, and returns a JSON text. The replacer can be a function
// that can replace values, or an array of strings that will select the keys.
// A default replacer method can be provided. Use of the space parameter can
// produce text that is more easily readable.
            var i;
            gap = "";
            indent = "";
// If the space parameter is a number, make an indent string containing that
// many spaces.
            if (typeof space === "number") {
                for (i = 0; i < space; i += 1) {
                    indent += " ";
                }
// If the space parameter is a string, it will be used as the indent string.
            } else if (typeof space === "string") {
                indent = space;
            }
// If there is a replacer, it must be a function or an array.
// Otherwise, throw an error.
            rep = replacer;
            if (replacer && typeof replacer !== "function" &&
                    (typeof replacer !== "object" ||
                    typeof replacer.length !== "number")) {
                throw new Error("JSON.stringify");
            }
// Make a fake root object containing our value under the key of "".
// Return the result of stringifying the value.
            return str("", {"": value});
        };
    }
// If the JSON object does not yet have a parse method, give it one.
    if (typeof JSON.parse !== "function") {
        JSON.parse = function (text, reviver) {
// The parse method takes a text and an optional reviver function, and returns
// a JavaScript value if the text is a valid JSON text.
            var j;
            function walk(holder, key) {
// The walk method is used to recursively walk the resulting structure so
// that modifications can be made.
                var k;
                var v;
                var value = holder[key];
                if (value && typeof value === "object") {
                    for (k in value) {
                        if (Object.prototype.hasOwnProperty.call(value, k)) {
                            v = walk(value, k);
                            if (v !== undefined) {
                                value[k] = v;
                            } else {
                                delete value[k];
                            }
                        }
                    }
                }
                return reviver.call(holder, key, value);
            }
// Parsing happens in four stages. In the first stage, we replace certain
// Unicode characters with escape sequences. JavaScript handles many characters
// incorrectly, either silently deleting them, or treating them as line endings.
            text = String(text);
            rx_dangerous.lastIndex = 0;
            if (rx_dangerous.test(text)) {
                text = text.replace(rx_dangerous, function (a) {
                    return "\\u" +
                            ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
                });
            }
// In the second stage, we run the text against regular expressions that look
// for non-JSON patterns. We are especially concerned with "()" and "new"
// because they can cause invocation, and "=" because it can cause mutation.
// But just to be safe, we want to reject all unexpected forms.
// We split the second stage into 4 regexp operations in order to work around
// crippling inefficiencies in IE's and Safari's regexp engines. First we
// replace the JSON backslash pairs with "@" (a non-JSON character). Second, we
// replace all simple value tokens with "]" characters. Third, we delete all
// open brackets that follow a colon or comma or that begin the text. Finally,
// we look to see that the remaining characters are only whitespace or "]" or
// "," or ":" or "{" or "}". If that is so, then the text is safe for eval.
            if (
                rx_one.test(
                    text
                        .replace(rx_two, "@")
                        .replace(rx_three, "]")
                        .replace(rx_four, "")
                )
            ) {
// In the third stage we use the eval function to compile the text into a
// JavaScript structure. The "{" operator is subject to a syntactic ambiguity
// in JavaScript: it can begin a block or an object literal. We wrap the text
// in parens to eliminate the ambiguity.
                j = eval("(" + text + ")");
// In the optional fourth stage, we recursively walk the new structure, passing
// each name/value pair to a reviver function for possible transformation.
                return (typeof reviver === "function")
                    ? walk({"": j}, "")
                    : j;
            }
// If the text is not JSON parseable, then a SyntaxError is thrown.
            throw new SyntaxError("JSON.parse");
        };
    }
}());
src/views/followvisit/discharge/js/prototype.js
¶Ô±ÈÐÂÎļþ
ÎļþÌ«´ó
src/views/followvisit/discharge/js/websocket.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,826 @@
var ws;
//--------------------------------��������websocket-----------------------------------------//
function initwebsocket(cti_ws_url) {
    if ('WebSocket' in window) {
        ws = new WebSocket(cti_ws_url);
    } else {
        alert("do not suports  websocket");
    }
    ws.onopen = function(evt) {
         alert("open websocket success");
    }
    ws.onclose = function(evt) {
        alert("websocket close");
    }
    //��������
    ws.onmessage = function(evt) {
            var reader = new FileReader();
            reader.onloadend = function(e) {
                        console.log(this.result);
                        var msgdiv = document.getElementById("msg");
                        var span = document.createElement("span");
                        span.innerHTML = "receive_msg:"+this.result + "<br />";
                        msgdiv.appendChild(span);
                        var obj = eval('(' + this.result + ')');
                        if(obj.cmd=="system"&&obj.action=="keepalive"){
                            keepalive(obj.seatname,obj.seatnum);
                            }
                            var uuid = document.getElementById("uuid");
                            if(obj.cmd=="control"&&obj.action=="tp_callin"){
                            uuid.value=obj.uuid;
                            }
                    };
            reader.readAsText(event.data);
    }
    ws.onerror = function(evt) {
        alert("websocket error");
    }
}
function sendmessage(protocolStr){
    console.log();
        var msgdiv = document.getElementById("msg");
                        var span = document.createElement("span");
                        span.innerHTML = "send_msg:"+protocolStr + "<br />";
                        msgdiv.appendChild(span);
    ws.send(protocolStr);
}
function testclear(){
        var msgdiv = document.getElementById("msg");
        msgdiv.innerHTML="";
}
//--------------------------------command send-----------------------------------------//
//��ϯǩ��
function seatlogin(seatname,seatnum,password,cti_ws_url) {
    if ('WebSocket' in window) {
        ws = new WebSocket(cti_ws_url);
    } else {
        alert("do not suports  websocket");
    }
    ws.onopen = function(evt) {
         alert("open websocket success");
             if(seatname=="")
        {
            alert("seatname is  null");
            return;
        }
        if(seatnum=="")
        {
            alert("seatnum is  null");
            return;
        }
        var protocol={"cmd":"system","action":"seatlogin","seatname":"<seatname>","seatnum":"<seatnum>","password":"<password>","timestamp":"<timestamp>"};
        protocol.seatname=seatname;
        protocol.seatnum=seatnum;
        protocol.password=password;
        var protocolStr=JSON.stringify(protocol);
        sendmessage(protocolStr);
    }
    ws.onclose = function(evt) {
        alert("websocket close");
    }
    //��������
    ws.onmessage = function(evt) {
            var reader = new FileReader();
            reader.onloadend = function(e) {
                        console.log(this.result);
                        var msgdiv = document.getElementById("msg");
                        var span = document.createElement("span");
                        span.innerHTML = "receive_msg:"+this.result + "<br />";
                        msgdiv.appendChild(span);
                        var obj = eval('(' + this.result + ')');
                        if(obj.cmd=="system"&&obj.action=="keepalive"){
                            keepalive(obj.seatname,obj.seatnum);
                            }
                            var uuid = document.getElementById("uuid");
                            if(obj.cmd=="control"&&obj.action=="tp_callin"){
                            uuid.value=obj.uuid;
                            }
                    };
            reader.readAsText(event.data);
    }
    ws.onerror = function(evt) {
        alert("websocket error");
    }
    //ws.send(protocolStr);
}
//��ϯǩ��
function seatlogout(seatname,seatnum) {
    if(seatname=="")
    {
        alert("seatname is  null");
        return;
    }
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    var protocol={"cmd":"system","action":"seatlogout","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.seatname=seatname;
    protocol.seatnum=seatnum;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
    ws.close();
}
//����
function afk(seatname,seatnum) {
    if(seatname=="")
    {
        alert("seatname is  null");
        return;
    }
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    var protocol={"cmd":"system","action":"afk","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.seatname=seatname;
    protocol.seatnum=seatnum;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//����
function online(seatname,seatnum) {
    if(seatname=="")
    {
        alert("seatname is  null");
        return;
    }
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    var protocol={"cmd":"system","action":"online","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.seatname=seatname;
    protocol.seatnum=seatnum;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//���
function callout(seatname,seatnum,phone) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    if(phone=="")
    {
        alert("phone is  null");
        return;
    }
    var protocol={"cmd":"control","action":"callout","phone":"<phone>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.phone=phone;
    protocol.seatname=seatname;
    protocol.seatnum=seatnum;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//ת��
function transfer(seatname,seatnum,phone,uuid) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    if(phone=="")
    {
        alert("phone is  null");
        return;
    }
    if(uuid=="")
    {
        alert("uuid is  null");
        return;
    }
    var protocol={"cmd":"control","action":"transfer","uuid":"<uuid>","phone":"<phone>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.phone=phone;
    protocol.seatname=seatname;
    protocol.seatnum=seatnum;
    protocol.uuid=uuid;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//ת���ջ�
function transferresume(seatname,seatnum,phone,uuid) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    if(phone=="")
    {
        alert("phone is  null");
        return;
    }
    if(uuid=="")
    {
        alert("uuid is  null");
        return;
    }
    var protocol={"cmd":"control","action":"transferresume","uuid":"<uuid>","phone":"<phone>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.phone=phone;
    protocol.seatname=seatname;
    protocol.seatnum=seatnum;
    protocol.uuid=uuid;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//ͨ������
function hold(seatname,seatnum,uuid) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    if(uuid=="")
    {
        alert("uuid is  null");
        return;
    }
    var protocol={"cmd":"control","action":"hold","uuid":"<uuid>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.uuid=uuid;
    protocol.seatname=seatname;
    protocol.seatnum=seatnum;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//ͨ�������ջ�
function holdresume(seatname,seatnum,uuid) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    if(uuid=="")
    {
        alert("uuid is  null");
        return;
    }
    var protocol={"cmd":"control","action":"holdresume","uuid":"<uuid>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.uuid=uuid;
    protocol.seatname=seatname;
    protocol.seatnum=seatnum;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//����
function pickup(seatname,seatnum) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    var protocol={"cmd":"control","action":"pickup","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.seatnum=seatnum;
    protocol.seatname=seatname;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//�Ҷ�
function hangup(seatname,seatnum) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    var protocol={"cmd":"control","action":"hangup","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.seatnum=seatnum;
    protocol.seatname=seatname;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//ͨ��ǿ��
function remove(seatname,seatnum,phone) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    if(phone=="")
    {
        alert("phone is  null");
        return;
    }
    var protocol={"cmd":"control","action":"remove","phone":"<phone>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.phone=phone;
    protocol.seatname=seatname;
    protocol.seatnum=seatnum;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//ͨ��ǿ��
function insert(seatname,seatnum,phone) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    if(phone=="")
    {
        alert("phone is  null");
        return;
    }
    var protocol={"cmd":"control","action":"insert","phone":"<phone>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.phone=phone;
    protocol.seatname=seatname;
    protocol.seatnum=seatnum;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//����
function monitor(seatname,seatnum,phone) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    if(phone=="")
    {
        alert("phone is  null");
        return;
    }
    var protocol={"cmd":"control","action":"monitor","phone":"<phone>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.phone=phone;
    protocol.seatname=seatname;
    protocol.seatnum=seatnum;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//����תͨ��
function monitor_to_talk(seatname,seatnum,phone) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    if(phone=="")
    {
        alert("phone is  null");
        return;
    }
    var protocol={"cmd":"control","action":"monitor_to_talk","phone":"<phone>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.phone=phone;
    protocol.seatname=seatname;
    protocol.seatnum=seatnum;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//��������
function monitor_end(seatname,seatnum,phone) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    if(phone=="")
    {
        alert("phone is  null");
        return;
    }
    var protocol={"cmd":"control","action":"monitor_end","phone":"<phone>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.phone=phone;
    protocol.seatname=seatname;
    protocol.seatnum=seatnum;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//ѡ��
function choosecall(seatname,seatnum,uuid) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    if(uuid=="")
    {
        alert("uuid is  null");
        return;
    }
    var protocol={"cmd":"control","action":"choosecall","uuid":"<uuid>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.uuid=uuid;
    protocol.seatname=seatname;
    protocol.seatnum=seatnum;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//����
function replacecall(seatname,seatnum,phone) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    if(phone=="")
    {
        alert("phone is  null");
        return;
    }
    var protocol={"cmd":"control","action":"replacecall","phone":"<phone>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.phone=phone;
    protocol.seatname=seatname;
    protocol.seatnum=seatnum;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//����ͨ��
function three(seatname,seatnum,phone) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    if(phone=="")
    {
        alert("phone is  null");
        return;
    }
    var protocol={"cmd":"control","action":"three","phone":"<phone>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.phone=phone;
    protocol.seatname=seatname;
    protocol.seatnum=seatnum;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//������ϯ״̬
function openseatlist(seatname,seatnum) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    var protocol={"cmd":"status","action":"openseatlist","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.seatnum=seatnum;
    protocol.seatname=seatname;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//�ر���ϯ״̬
function closeseatlist(seatname,seatnum) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    var protocol={"cmd":"status","action":"closeseatlist","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.seatnum=seatnum;
    protocol.seatname=seatname;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//�����Ŷ���Ϣ
function openqueues(seatname,seatnum) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    var protocol={"cmd":"status","action":"openqueues","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.seatnum=seatnum;
    protocol.seatname=seatname;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//�ر��Ŷ���Ϣ
function closequeues(seatname,seatnum) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    var protocol={"cmd":"status","action":"closequeues","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.seatnum=seatnum;
    protocol.seatname=seatname;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//����ͨ����Ϣ
function opencalllist(seatname,seatnum) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    var protocol={"cmd":"status","action":"opencalllist","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.seatnum=seatnum;
    protocol.seatname=seatname;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//�ر�ͨ����Ϣ
function closecalllist(seatname,seatnum) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    var protocol={"cmd":"status","action":"closecalllist","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.seatnum=seatnum;
    protocol.seatname=seatname;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//�����м���Ϣ
function openroutelist(seatname,seatnum) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    var protocol={"cmd":"status","action":"openroutelist","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.seatnum=seatnum;
    protocol.seatname=seatname;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//�ر��м���Ϣ
function closeroutelist(seatname,seatnum) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    var protocol={"cmd":"status","action":"closeroutelist","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.seatnum=seatnum;
    protocol.seatname=seatname;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//��ȡ��ϯ��Ϣ
function seatlist(group) {
    if(group=="")
    {
        alert("group is  null");
        return;
    }
    var protocol={"cmd":"status","action":"seatlist","group":"<group>","timestamp":"<timestamp>"};
    protocol.group=group;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//��ȡ�Ŷ���Ϣ
function queues() {
    var protocol={"cmd":"status","action":"queues","timestamp":"<timestamp>"};
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//��ȡͨ����Ϣ
function calllist() {
    var protocol={"cmd":"status","action":"calllist","timestamp":"<timestamp>"};
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//��ȡ�м���Ϣ
function routelist() {
    var protocol={"cmd":"status","action":"routelist","timestamp":"<timestamp>"};
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//��ȡ�������������Ϣ
function batch(paramid) {
    if(paramid=="")
    {
        alert("paramid is  null");
        return;
    }
    var protocol={"cmd":"status","action":"batch","paramid":"<paramid>","timestamp":"<timestamp>"};
    protocol.paramid=paramid;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//��ʼ�������
function batch_start(seatname,seatnum) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    var protocol={"cmd":"system","action":"batch_start","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.seatnum=seatnum;
    protocol.seatname=seatname;
    var protocolStr=JSON.stringify(protocol);
  sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//�ر��������
function batch_stop(seatname,seatnum) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    var protocol={"cmd":"system","action":"batch_stop","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.seatnum=seatnum;
    protocol.seatname=seatname;
    var protocolStr=JSON.stringify(protocol);
  sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//ͨ����ѯ��ʼ
function handoff_ready(seatname,seatnum,uuid) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    if(uuid=="")
    {
        alert("uuid is  null");
        return;
    }
    var protocol={"cmd":"control","action":"handoff_ready","uuid":"<uuid>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.uuid=uuid;
    protocol.seatname=seatname;
    protocol.seatnum=seatnum;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//��ѯ
function handoff_call(seatname,seatnum,phone,uuid) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    if(phone=="")
    {
        alert("phone is  null");
        return;
    }
    if(uuid=="")
    {
        alert("uuid is  null");
        return;
    }
    var protocol={"cmd":"control","action":"handoff_call","uuid":"<uuid>","phone":"<phone>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.phone=phone;
    protocol.seatname=seatname;
    protocol.seatnum=seatnum;
    protocol.uuid=uuid;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//��ѯ�ջ�
function handoff_resume(seatname,seatnum,uuid) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    if(uuid=="")
    {
        alert("uuid is  null");
        return;
    }
    var protocol={"cmd":"control","action":"handoff_resume","uuid":"<uuid>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.seatname=seatname;
    protocol.seatnum=seatnum;
    protocol.uuid=uuid;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//��ѯת��
function handoff_transfer(seatname,seatnum,phone,uuid) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    if(phone=="")
    {
        alert("phone is  null");
        return;
    }
    if(uuid=="")
    {
        alert("uuid is  null");
        return;
    }
    var protocol={"cmd":"control","action":"handoff_transfer","uuid":"<uuid>","phone":"<phone>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.phone=phone;
    protocol.seatname=seatname;
    protocol.seatnum=seatnum;
    protocol.uuid=uuid;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//��ѯ����
function handoff_three(seatname,seatnum,uuid) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    if(uuid=="")
    {
        alert("uuid is  null");
        return;
    }
    var protocol={"cmd":"control","action":"handoff_three","uuid":"<uuid>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.seatname=seatname;
    protocol.seatnum=seatnum;
    protocol.uuid=uuid;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//����
function keepalive(seatname,seatnum) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    var protocol={"cmd":"system","action":"keepalive","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.seatnum=seatnum;
    protocol.seatname=seatname;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
}
//ͨ������¼��
function record_start(seatname,seatnum,uuid) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    if(uuid=="")
    {
        alert("uuid is  null");
        return;
    }
    var protocol={"cmd":"control","action":"record_start","uuid":"<uuid>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.uuid=uuid;
    protocol.seatname=seatname;
    protocol.seatnum=seatnum;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//ͨ��ֹͣ¼��
function record_stop(seatname,seatnum,uuid) {
    if(seatnum=="")
    {
        alert("seatnum is  null");
        return;
    }
    if(uuid=="")
    {
        alert("uuid is  null");
        return;
    }
    var protocol={"cmd":"control","action":"record_stop","uuid":"<uuid>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
    protocol.uuid=uuid;
    protocol.seatname=seatname;
    protocol.seatnum=seatnum;
    var protocolStr=JSON.stringify(protocol);
    sendmessage(protocolStr);
    //ws.send(protocolStr);
}
//---------------------------------------------------------------------------------//
src/views/followvisit/discharge/outpatientService.vue
@@ -251,7 +251,7 @@
          <div class="documentf">
            <div class="document">
              <el-button type="success" size="medium" @click="onthatday()"
                >当日服务</el-button
                >今日服务</el-button
              >
            </div>
          </div>
src/views/followvisit/mzsatisfaction/index.vue
@@ -252,7 +252,7 @@
          <div class="documentf">
            <div class="document">
              <el-button type="success" size="medium" @click="onthatday()"
                >当日服务</el-button
                >今日服务</el-button
              >
            </div>
          </div>
src/views/followvisit/record/detailpage/index.vue
@@ -1721,7 +1721,10 @@
      }, 3000);
    },
    yuyingetdetail() {
      this.tableDatatop.forEach((item, index) => {
     const dataToSubmit = JSON.parse(JSON.stringify(this.tableDatatop));
  dataToSubmit.forEach((item, index) => {
    // å¯¹æ‹·è´çš„æ•°æ®è¿›è¡Œæ“ä½œï¼Œä¸å½±å“åŽŸå§‹çš„ scriptResult æ•°ç»„
        item.scriptResult = item.scriptResult.join("&");
        item.templatequestionnum = index + 1;
        item.subId = this.id;
@@ -1733,8 +1736,9 @@
        item.patid = this.patid;
        item.templateid = item.templateID;
      });
      let obj = {
        serviceSubtaskDetailList: this.tableDatatop,
    serviceSubtaskDetailList: dataToSubmit, // æäº¤å¤„理后的副本
        param1: this.taskid,
        param2: this.patid,
        subId: this.id,
src/views/followvisit/record/index.vue
@@ -214,7 +214,7 @@
          <div class="documentf">
            <div class="document">
              <el-button type="success" size="medium" @click="onthatday()"
                >当日服务</el-button
                >今日服务</el-button
              >
            </div>
          </div>
src/views/followvisit/zbAgain/index.vue
@@ -245,7 +245,7 @@
          <div class="documentf">
            <div class="document">
              <el-button type="success" size="medium" @click="onthatday()"
                >当日服务</el-button
                >今日服务</el-button
              >
            </div>
          </div>
src/views/followvisit/zysatisfaction/index.vue
@@ -252,7 +252,7 @@
          <div class="documentf">
            <div class="document">
              <el-button type="success" size="medium" @click="onthatday()"
                >当日服务</el-button
                >今日服务</el-button
              >
            </div>
          </div>
src/views/patient/propaganda/QuestionnaireTask.vue
@@ -1460,7 +1460,7 @@
        this.leavehospitaldistrictcodes[0] ||
        this.diagglist[0] ||
        this.operationcodes[0] ||
        this.form.longTask == 2
        this.form.longTask == 2||this.serviceType==14
      ) {
      } else {
        this.$modal.msgError("请选择任务关联条件");
src/views/patient/propaganda/particty.vue
@@ -1474,7 +1474,9 @@
        this.deptcodesWards[0] ||
        this.leavehospitaldistrictcodes[0] ||
        this.diagglist[0] ||
        this.operationcodes[0]
        this.operationcodes[0] ||
        this.form.longTask == 2 ||
        this.serviceType == 14
      ) {
      } else {
        this.$modal.msgError("请选择任务关联条件");
vue.config.js
@@ -47,7 +47,8 @@
        pathRewrite: {
          ['^' + process.env.VUE_APP_BASE_API]: ''
        }
      }
      },
    },
    disableHostCheck: true
  },