Pārlūkot izejas kodu

Merge branch 'feature/1.5.3-update-20250331' into develop

# Conflicts:
#	dist/index.html
#	public/domain.js
wuyunfeng 2 mēneši atpakaļ
vecāks
revīzija
07caecfd5f

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 1
dist/index.html


+ 51 - 1
languages/en.js

@@ -1783,6 +1783,56 @@ module.exports = {
     deviceStatusLightEnable: 'Enable status light',
     userEnable: 'Enable only when in use',
     coordinate: 'Coordinate',
-    chooseCoordinate: 'Choose Coordinate'
+    chooseCoordinate: 'Choose Coordinate',
+    voiceType: 'Communication Protocol',
+    chooseVoiceType: 'Select Communication Protocol',
+    voiceTypeError: 'Different communication protocol with the department, cannot play',
+    huayiSleep: 'HuaYi Sleep Monitoring',
+    sleepWakeful: 'Awake',
+    sleepLight: 'Light Sleep',
+    sleepDeep: 'Deep Sleep',
+    rickLevel: 'Risk Level',
+    rickFree: 'No Risk',
+    rickLow: 'Low Risk',
+    rickMiddle: 'Medium Risk',
+    rickHigh: 'High Risk',
+    vitalData: 'Vital Signs Data',
+    choiceMode: 'Selection Mode',
+    displayMinute: 'Display by Minute',
+    displayHour: 'Display by Hour',
+    heartRateReport: 'Heart Rate Report',
+    breatheReport: 'Breathing Report',
+    heartRateData: 'Heart Rate Data',
+    breatheData: 'Breathing Data',
+    sleepReport: 'Sleep Report',
+    referenceValue: 'Reference Value: ',
+    movementReport: 'Movement Report',
+    movementData: 'Movement Data',
+    deviceParams: 'Device Parameters',
+    heartRateValueLimits: 'Heart Rate Upper Limit',
+    heartRateValueLowest: 'Heart Rate Lower Limit',
+    breatheValueLimits: 'Breathing Upper Limit',
+    breatheValueLowest: 'Breathing Lower Limit',
+    outBedAlarmSwitch: 'Out-of-Bed Alarm Switch',
+    outBedRemindStartTime: 'Out-of-Bed Reminder Start Time',
+    outBedRemindEndTime: 'Out-of-Bed Reminder End Time',
+    outBedRemindLimits: 'Out-of-Bed Reminder Time Limit',
+    deviceLightSwitch: 'Device Light Switch',
+    lightOffTime: 'Light Off Time',
+    lightOnTime: 'Light On Time',
+    averageValue: 'Average Value',
+    maximumValue: 'Maximum Value',
+    minimumValue: 'Minimum Value',
+    valueHighNumber: 'High Value Count',
+    valueLowNumber: 'Low Value Count',
+    valueHighLowNumber: 'Irregular Count',
+    deepSleepRatio: 'Deep Sleep Ratio',
+    awakeCount: 'Awake Count',
+    sleepTime: 'Sleep Duration',
+    shallowSleepRatio: 'Light Sleep Ratio',
+    deepSleepContinuity: 'Deep Sleep Continuity',
+    outBedCount: 'Out-of-Bed Count',
+    movementCount: 'Movement Count',
+    noThirdPartyId: 'Device data error, unable to save device settings'
   }
 }

+ 51 - 1
languages/es.js

@@ -1783,6 +1783,56 @@ module.exports = {
     deviceStatusLightEnable: 'Habilitar luz de estado',
     userEnable: 'Habilitar solo cuando se utilice',
     coordinate: 'Coordenada',
-    chooseCoordinate: 'Elegir Coordenada'
+    chooseCoordinate: 'Elegir Coordenada',
+    voiceType: 'Protocolo de comunicación',
+    chooseVoiceType: 'Seleccionar protocolo de comunicación',
+    voiceTypeError: 'Protocolo de comunicación diferente con el departamento, no se puede reproducir',
+    huayiSleep: 'Monitoreo de Sueño HuaYi',
+    sleepWakeful: 'Despierto',
+    sleepLight: 'Sueño Ligero',
+    sleepDeep: 'Sueño Profundo',
+    rickLevel: 'Nivel de Riesgo',
+    rickFree: 'Sin Riesgo',
+    rickLow: 'Riesgo Bajo',
+    rickMiddle: 'Riesgo Medio',
+    rickHigh: 'Riesgo Alto',
+    vitalData: 'Datos de Signos Vitales',
+    choiceMode: 'Modo de Selección',
+    displayMinute: 'Mostrar por Minuto',
+    displayHour: 'Mostrar por Hora',
+    heartRateReport: 'Reporte de Frecuencia Cardíaca',
+    breatheReport: 'Reporte de Respiración',
+    heartRateData: 'Datos de Frecuencia Cardíaca',
+    breatheData: 'Datos de Respiración',
+    sleepReport: 'Reporte de Sueño',
+    referenceValue: 'Valor de Referencia: ',
+    movementReport: 'Reporte de Movimiento',
+    movementData: 'Datos de Movimiento',
+    deviceParams: 'Parámetros del Dispositivo',
+    heartRateValueLimits: 'Límite Superior de Frecuencia Cardíaca',
+    heartRateValueLowest: 'Límite Inferior de Frecuencia Cardíaca',
+    breatheValueLimits: 'Límite Superior de Respiración',
+    breatheValueLowest: 'Límite Inferior de Respiración',
+    outBedAlarmSwitch: 'Interruptor de Alarma de Salida de Cama',
+    outBedRemindStartTime: 'Hora de Inicio del Recordatorio de Salida de Cama',
+    outBedRemindEndTime: 'Hora de Fin del Recordatorio de Salida de Cama',
+    outBedRemindLimits: 'Límite de Tiempo del Recordatorio de Salida de Cama',
+    deviceLightSwitch: 'Interruptor de Luz del Dispositivo',
+    lightOffTime: 'Hora de Apagar la Luz',
+    lightOnTime: 'Hora de Encender la Luz',
+    averageValue: 'Valor Promedio',
+    maximumValue: 'Valor Máximo',
+    minimumValue: 'Valor Mínimo',
+    valueHighNumber: 'Recuento de Valores Altos',
+    valueLowNumber: 'Recuento de Valores Bajos',
+    valueHighLowNumber: 'Recuento Irregular',
+    deepSleepRatio: 'Proporción de Sueño Profundo',
+    awakeCount: 'Recuento de Despierto',
+    sleepTime: 'Duración del Sueño',
+    shallowSleepRatio: 'Proporción de Sueño Ligero',
+    deepSleepContinuity: 'Continuidad del Sueño Profundo',
+    outBedCount: 'Recuento de Salida de Cama',
+    movementCount: 'Recuento de Movimiento',
+    noThirdPartyId: 'Error en los datos del dispositivo, no se puede guardar la configuración del dispositivo'
   }
 }

+ 51 - 1
languages/ru-RU.js

@@ -1806,6 +1806,56 @@ module.exports = {
     deviceStatusLightEnable: 'Активирован ли индикатор состояния',
     userEnable: 'Активировать только при использовании',
     coordinate: 'Координаты',
-    chooseCoordinate: 'Выбрать координаты'
+    chooseCoordinate: 'Выбрать координаты',
+    voiceType: 'Протокол связи',
+    chooseVoiceType: 'Выбор протокола связи',
+    voiceTypeError: 'Разный протокол связи с отделением, невозможно воспроизвести',
+    huayiSleep: 'Мониторинг сна HuaYi',
+    sleepWakeful: 'Бодрствующий',
+    sleepLight: 'Лёгкий сон',
+    sleepDeep: 'Глубокий сон',
+    rickLevel: 'Уровень риска',
+    rickFree: 'Без риска',
+    rickLow: 'Низкий риск',
+    rickMiddle: 'Средний риск',
+    rickHigh: 'Высокий риск',
+    vitalData: 'Данные жизненных показателей',
+    choiceMode: 'Режим выбора',
+    displayMinute: 'Отображение по минутам',
+    displayHour: 'Отображение по часам',
+    heartRateReport: 'Отчёт о сердечном ритме',
+    breatheReport: 'Отчёт о дыхании',
+    heartRateData: 'Данные сердечного ритма',
+    breatheData: 'Данные дыхания',
+    sleepReport: 'Отчёт о сне',
+    referenceValue: 'Эталонное значение: ',
+    movementReport: 'Отчёт о движениях',
+    movementData: 'Данные движений',
+    deviceParams: 'Параметры устройства',
+    heartRateValueLimits: 'Верхний предел сердечного ритма',
+    heartRateValueLowest: 'Нижний предел сердечного ритма',
+    breatheValueLimits: 'Верхний предел дыхания',
+    breatheValueLowest: 'Нижний предел дыхания',
+    outBedAlarmSwitch: 'Переключатель сигнализации покидания кровати',
+    outBedRemindStartTime: 'Время начала напоминания о покидании кровати',
+    outBedRemindEndTime: 'Время окончания напоминания о покидании кровати',
+    outBedRemindLimits: 'Лимит времени напоминания о покидании кровати',
+    deviceLightSwitch: 'Переключатель света устройства',
+    lightOffTime: 'Время выключения света',
+    lightOnTime: 'Время включения света',
+    averageValue: 'Среднее значение',
+    maximumValue: 'Максимальное значение',
+    minimumValue: 'Минимальное значение',
+    valueHighNumber: 'Количество высоких значений',
+    valueLowNumber: 'Количество низких значений',
+    valueHighLowNumber: 'Количество нерегулярных значений',
+    deepSleepRatio: 'Доля глубокого сна',
+    awakeCount: 'Количество пробуждений',
+    sleepTime: 'Продолжительность сна',
+    shallowSleepRatio: 'Доля лёгкого сна',
+    deepSleepContinuity: 'Непрерывность глубокого сна',
+    outBedCount: 'Количество покиданий кровати',
+    movementCount: 'Количество движений',
+    noThirdPartyId: 'Ошибка данных устройства, невозможно сохранить настройки устройства'
   }
 }

+ 51 - 1
languages/zh-CN.js

@@ -1783,6 +1783,56 @@ module.exports = {
     deviceStatusLightEnable: '状态灯是否启用',
     userEnable: '仅在使用中启用',
     coordinate: '坐标',
-    chooseCoordinate: '选择坐标'
+    chooseCoordinate: '选择坐标',
+    voiceType: '通信协议',
+    chooseVoiceType: '选择通信协议',
+    voiceTypeError: '与科室的通讯协议不同,无法播放',
+    huayiSleep: '华屹睡眠监测',
+    sleepWakeful: '清醒',
+    sleepLight: '浅睡',
+    sleepDeep: '熟睡',
+    rickLevel: '风险等级',
+    rickFree: '⽆⻛险',
+    rickLow: '低⻛险',
+    rickMiddle: '中⻛险',
+    rickHigh: '⾼⻛险',
+    vitalData: '体征数据',
+    choiceMode: '选择模式',
+    displayMinute: '按照分钟显示',
+    displayHour: '按照小时显示',
+    heartRateReport: '心率报告',
+    breatheReport: '呼吸报告',
+    heartRateData: '心率数据',
+    breatheData: '呼吸数据',
+    sleepReport: '睡眠报告',
+    referenceValue: '参考值: ',
+    movementReport: '体动报告',
+    movementData: '体动数据',
+    deviceParams: '设备参数',
+    heartRateValueLimits: '心率阈值上限',
+    heartRateValueLowest: '心率阈值下限',
+    breatheValueLimits: '呼吸阈值上限',
+    breatheValueLowest: '呼吸阈值下限',
+    outBedAlarmSwitch: '离床报警开关',
+    outBedRemindStartTime: '离床提醒开始时间',
+    outBedRemindEndTime: '离床提醒结束时间',
+    outBedRemindLimits: '离床提醒时限',
+    deviceLightSwitch: '设备灯光开关',
+    lightOffTime: '灯光关闭时间',
+    lightOnTime: '灯光开启时间',
+    averageValue: '平均值',
+    maximumValue: '最大值',
+    minimumValue: '最小值',
+    valueHighNumber: '过高值次数',
+    valueLowNumber: '过低值次数',
+    valueHighLowNumber: '不规律次数',
+    deepSleepRatio: '深睡比例',
+    awakeCount: '清醒次数',
+    sleepTime: '睡眠时长',
+    shallowSleepRatio: '浅睡比例',
+    deepSleepContinuity: '深睡连续性',
+    outBedCount: '离床次数',
+    movementCount: '体动次数',
+    noThirdPartyId: '设备数据错误,无法保存设备设置'
   }
 }

+ 51 - 1
languages/zh-TW.js

@@ -1746,6 +1746,56 @@ module.exports = {
     deviceStatusLightEnable: '狀態燈是否啟用',
     userEnable: '僅在使用中啟用',
     coordinate: '座標',
-    chooseCoordinate: '選擇座標'
+    chooseCoordinate: '選擇座標',
+    voiceType: '通訊協議',
+    chooseVoiceType: '選擇通訊協議',
+    voiceTypeError: '與科室的通訊協議不同,無法播放',
+    huayiSleep: '華屹睡眠監測',
+    sleepWakeful: '清醒',
+    sleepLight: '淺睡',
+    sleepDeep: '熟睡',
+    rickLevel: '風險等級',
+    rickFree: '無風險',
+    rickLow: '低風險',
+    rickMiddle: '中風險',
+    rickHigh: '高風險',
+    vitalData: '體徵數據',
+    choiceMode: '選擇模式',
+    displayMinute: '按照分鐘顯示',
+    displayHour: '按照小時顯示',
+    heartRateReport: '心率報告',
+    breatheReport: '呼吸報告',
+    heartRateData: '心率數據',
+    breatheData: '呼吸數據',
+    sleepReport: '睡眠報告',
+    referenceValue: '參考值: ',
+    movementReport: '體動報告',
+    movementData: '體動數據',
+    deviceParams: '設備參數',
+    heartRateValueLimits: '心率閾值上限',
+    heartRateValueLowest: '心率閾值下限',
+    breatheValueLimits: '呼吸閾值上限',
+    breatheValueLowest: '呼吸閾值下限',
+    outBedAlarmSwitch: '離床報警開關',
+    outBedRemindStartTime: '離床提醒開始時間',
+    outBedRemindEndTime: '離床提醒結束時間',
+    outBedRemindLimits: '離床提醒時限',
+    deviceLightSwitch: '設備燈光開關',
+    lightOffTime: '燈光關閉時間',
+    lightOnTime: '燈光開啟時間',
+    averageValue: '平均值',
+    maximumValue: '最大值',
+    minimumValue: '最小值',
+    valueHighNumber: '過高值次數',
+    valueLowNumber: '過低值次數',
+    valueHighLowNumber: '不規律次數',
+    deepSleepRatio: '深睡比例',
+    awakeCount: '清醒次數',
+    sleepTime: '睡眠時長',
+    shallowSleepRatio: '淺睡比例',
+    deepSleepContinuity: '深睡連續性',
+    outBedCount: '離床次數',
+    movementCount: '體動次數',
+    noThirdPartyId: '裝置數據錯誤,無法儲存裝置設定'
   }
 }

+ 4 - 4
public/domain.js

@@ -1,12 +1,12 @@
 const domain = {
-  serverUrl: 'http://192.168.1.56:8005',
-  DeviceUrl: 'http://192.168.1.56:8006',
-  mediaUrl: 'http://192.168.1.56:8004',
+  serverUrl: 'http://8.129.220.143:8005',
+  DeviceUrl: 'http://8.129.220.143:8006',
+  mediaUrl: 'http://8.129.220.143:8004',
   OnlineSystemUrl: 'http://api.base.wdklian.com',
   gateWayUrl:'http://8.129.220.143:8014',
   fileServer: 'http://8.129.220.143:8012',
   apiMode: 'dev',
-  uiVersion: 3, // 1 医院版,2 月子中心版,3养老院版
+  uiVersion: 1, // 1 医院版,2 月子中心版,3养老院版
   enableBroadcast: true, //广播使能
   enableMobile: true,  //手机使能
   enableEntraceguard: true,  //门禁使能

+ 115 - 0
src/api/ncs_huayi_sleep.js

@@ -0,0 +1,115 @@
+import request from '@/utils/request'
+
+/** 获取华屹睡眠检测仪的id */
+export function getDeviceId(device_code) {
+  return request({
+    url: `/huayisleep/device_id/${device_code}`,
+    method: 'GET'
+  })
+}
+
+/** 获取设备的状态 */
+export function getDeviceStatus(device_code) {
+  return request({
+    url: `/huayisleep/device_status/${device_code}`,
+    method: 'GET'
+  })
+}
+
+/** 获取睡眠分析的参考值 */
+export function getSleepReference(reference_type) {
+  return request({
+    url: `/huayisleep/sleep_reference/${reference_type}`,
+    method: 'GET'
+  })
+}
+
+/** 获取设备参数 */
+export function getDeviceParams(third_party_id) {
+  return request({
+    url: `/huayisleep/device_params/${third_party_id}`,
+    method: 'GET'
+  })
+}
+
+/** 设备离床预警设置 */
+export function setDeviceSettings(third_party_id, action_code, deviceSettings) {
+  return request({
+    url: `/huayisleep/device_settings/${third_party_id}/${action_code}`,
+    method: 'POST',
+    data: deviceSettings,
+    headers: { 'Content-Type': 'application/json' }
+  })
+}
+
+/** 每日心率统计 */
+export function getDailyHeartRate(third_party_id, date, date_format = 'MINUTE') {
+  return request({
+    url: `/huayisleep/daily_heart_rate/${third_party_id}`,
+    method: 'GET',
+    params: { date, date_format }
+  })
+}
+
+/** 每日呼吸统计 */
+export function getDailyBreath(third_party_id, date, date_format = 'MINUTE') {
+  return request({
+    url: `/huayisleep/daily_breath/${third_party_id}`,
+    method: 'GET',
+    params: { date, date_format }
+  })
+}
+
+/** 每日睡眠统计 */
+export function getDailySleep(third_party_id, date) {
+  return request({
+    url: `/huayisleep/daily_sleep/${third_party_id}`,
+    method: 'GET',
+    params: { date }
+  })
+}
+
+/** 获取历史心率数据 */
+export function getHistoryHeartRate(third_party_id, date_format, start_date, end_date) {
+  return request({
+    url: `/huayisleep/history_heart_rate/${third_party_id}`,
+    method: 'GET',
+    params: { date_format, start_date, end_date }
+  })
+}
+
+/** 体动统计 */
+export function getMovementData(third_party_id, start_time, end_time, page, page_size) {
+  return request({
+    url: `/huayisleep/movement/${third_party_id}`,
+    method: 'GET',
+    params: { start_time, end_time, page, page_size }
+  })
+}
+
+/** 获取历史呼吸数据 */
+export function getHistoryBreath(third_party_id, date_format, start_date, end_date) {
+  return request({
+    url: `/huayisleep/history_Breath/${third_party_id}`,
+    method: 'GET',
+    params: { date_format, start_date, end_date }
+  })
+}
+
+/** 获取历史呼吸数据(按年来统计) */
+export function getYearlyHistoryBreath(third_party_id, date_format, start_date, end_date) {
+  return request({
+    url: `/huayisleep/yearly_history_breath/${third_party_id}`,
+    method: 'GET',
+    params: { date_format, start_date, end_date }
+  })
+}
+
+/** 获取历史睡眠数据 */
+export function getHistorySleep(third_party_id, date_format, start_date, end_date) {
+  return request({
+    url: `/huayisleep/history_sleep/${third_party_id}`,
+    method: 'GET',
+    params: { date_format, start_date, end_date }
+  })
+}

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 0
src/icons/svg/heart_rate.svg


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 0
src/icons/svg/sleep_monitoring.svg


+ 7 - 0
src/router/index.js

@@ -124,6 +124,13 @@ export const partRoutes = [
         meta: { title: i18n.t('tab.userLocationManage'), icon: 'el-icon-watch-1', noCache: true } // 用户设备
       },
       {
+        path: 'huayi_sleep',
+        component: () => import('@/views/ncs-device/huayi_sleep'),
+        name: 'huayi-sleep',
+        hidden: !enableCustomerDevice,
+        meta: { title: i18n.t('zy20241209.huayiSleep'), icon: 'sleep_monitoring', noCache: true } // 用户设备
+      },
+      {
         path: 'sos',
         component: () => import('@/views/ncs-sos-device-setting/sos_device_setting'),
         name: 'sos-device',

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 6 - 6
src/utils/domain.js


+ 13 - 0
src/utils/enum/RiskLevelEnum.js

@@ -0,0 +1,13 @@
+import createEnum from '@/utils/enum/createEnum'
+import i18n from '@/utils/i18n'
+
+export const RISK_LEVEL_TYPE = createEnum(
+  {
+    UNKNOWN: ['UNKNOWN', i18n.t('member.unknown')],
+    FREE: ['FREE', i18n.t('zy20241209.rickFree')],
+    LOW: ['LOW', i18n.t('zy20241209.rickLow')],
+    MIDDLE: ['MIDDLE', i18n.t('zy20241209.rickMiddle')],
+    HIGH: ['HIGH', i18n.t('zy20241209.rickHigh')],
+    NO_DATA: ['NO_DATA', i18n.t('action.dateNull')]
+  }
+)

+ 12 - 0
src/utils/enum/SleepStageEnum.js

@@ -0,0 +1,12 @@
+import createEnum from '@/utils/enum/createEnum'
+import i18n from '@/utils/i18n'
+
+export const SLEEP_STAGE_TYPE = createEnum(
+  {
+    UNKNOWN: ['UNKNOWN', i18n.t('member.unknown')],
+    WAKEFUL: ['WAKEFUL', i18n.t('zy20241209.sleepWakeful')],
+    LIGHT: ['LIGHT', i18n.t('zy20241209.sleepLight')],
+    DEEP: ['DEEP', i18n.t('zy20241209.sleepDeep')],
+    NO_DATA: ['NO_DATA', i18n.t('action.dateNull')]
+  }
+)

+ 48 - 26
src/views/ncs-broadcast/index.vue

@@ -74,7 +74,7 @@
         <audio ref="audio" loop autoplay playsinline :srcObject.prop="stream" v-if="stream" style="width: 300px;height:100px;"></audio>
       </div>
       <span slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="streamingStop(true)">{{ this.$t('broadcast.stop') }}</el-button>
+        <el-button type="primary" @click="streamingStop('rtc',true)">{{ this.$t('broadcast.stop') }}</el-button>
       </span>
     </el-dialog>
 
@@ -98,7 +98,7 @@
         </audio>
       </div>
       <span slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="streamingStop(true)">{{ this.$t('broadcast.stop') }}</el-button>
+        <el-button type="primary" @click="streamingStop('sip', true)">{{ this.$t('broadcast.stop') }}</el-button>
       </span>
     </el-dialog>
 
@@ -230,6 +230,7 @@ import { AG_GRID_LOCALE_CN } from '@/utils/AgGridVueLocaleCn'
 import ButtonCellRenderList from '@/components/AgGridCellRender/ButtonCellRenderList'
 import * as API_Broadcast from '@/api/calling-broadcast'
 import * as API_ServiceInfo from '@/api/ncs_service_info'
+import * as API_Part from '@/api/ncs_partInfo'
 import { unix2Date } from '@/utils/Foundation'
 import * as API_FrameGroup from '@/api/ncs_frameGroup'
 import ListFilter from '@/components/AgGridCustomFilter/ListFilter'
@@ -374,6 +375,9 @@ export default {
         }, width: 150, cellRenderer: this.statusFormatter
       },
       {
+        headerName: this.$t('zy20241209.voiceType'), field: 'voice_type', sortable: true, filter: 'agTextColumnFilter', width: 150
+      },
+      {
         headerName: this.$t('broadcast.broadcastMode'), field: 'broadcast_mode', sortable: true, filterFramework: 'RadioFilter', filterParams: {
           listData: this.broadcastMode
         }, width: 150,
@@ -456,9 +460,9 @@ export default {
                 buttonType: 'success',
                 onClick: () => {
                   if (this.stream === null) {
-                    this.streamingStart(param.data.id)
+                    this.streamingStart(param.data)
                   } else {
-                    this.streamingStop(true)
+                    this.streamingStop(param.data.voice_type, true)
                   }
                 }
               }
@@ -514,7 +518,7 @@ export default {
 
     const _this = this
     //每分钟检查一次websocket状态,如果掉线,则重连
-    if (this.serverInfo.voice_type === "rtc") {
+    if (this.serverInfo.voice_type !== undefined && this.serverInfo.voice_type.toLowerCase() === 'rtc') {
       setInterval(function () {
         if (_this.janus === null) {
           if (_this.rtcServer !== null && _this.rtcServer !== "") {
@@ -564,13 +568,20 @@ export default {
     },
     deleteSingle(row) {
       this.handlerDelete(row.id)
-      if (this.serverInfo.voice_type === "rtc") {
+      if (this.serverInfo.voice_type.toLowerCase() === "rtc") {
         this.deleteStreaming(row.id)
       }
     },
     playBroadcast(row) {
       console.log(row)
-      if (this.serverInfo.voice_type === "rtc") {
+      if (row.voice_type !== null && row.voice_type !== "" && row.voice_type.toLowerCase() !== this.serverInfo.voice_type.toLowerCase()) {
+        this.$alert(this.$t('zy20241209.voiceTypeError'), this.$t('action.systemPrompt'),{
+          confirmButtonText: this.$t('action.yes'),
+        })
+        return;
+      }
+
+      if (this.serverInfo.voice_type.toLowerCase() === "rtc") {
         API_Broadcast.manulStart(row.id).then(res => {
           const result = res.data
           if (!result.success) {
@@ -602,7 +613,7 @@ export default {
     },
     stopBroadcast(row) {
       console.log(row)
-      if (this.serverInfo.voice_type === "rtc") {
+      if (this.serverInfo.voice_type.toLowerCase() === "rtc") {
         row.playing = false
         this.gridApi.redrawRows()
         this.manulPlay = false
@@ -775,7 +786,7 @@ export default {
           delete this.formmodel.id
           this.formmodel.part_id = this.$store.getters.partId
           //判断 janus 是否连接状态
-          if (this.serverInfo.voice_type === "rtc") {
+          if (this.serverInfo.voice_type.toLowerCase() === "rtc") {
             if (this.janus === null) {
               if (this.rtcServer === null || this.rtcServer === "") {
                 this.getRtcServer()
@@ -790,7 +801,7 @@ export default {
           API_Broadcast.add(this.formmodel).then(result => {
             console.log(result)
             if (result) {
-              if (this.serverInfo.voice_type === "rtc") {
+              if (this.serverInfo.voice_type.toLowerCase() === "rtc") {
                 if (result.id) {
                   this.createStreaming(result.id, result.audio_port);
                 } else {
@@ -892,7 +903,7 @@ export default {
 
       if (result.finished){
         this.auditionTotalMsg = null
-        this.streamingStop(false)
+        this.streamingStop('rtc', false)
         this.$message({
           type: 'success',
           message: this.$t('broadcast.auditionEnd')
@@ -1085,13 +1096,17 @@ export default {
             type: 'error',
             message: this.$t('action.failedGetReturnMessage')
           })
-          return;
         }
       }})
     },
-    streamingStart(id) {
-      if (this.serverInfo.voice_type === "rtc") {
-        API_Broadcast.auditionStart(id).then(res => {
+    streamingStart(data) {
+      console.log(data)
+      let voiceType = data.voice_type
+      if (voiceType === null || voiceType === undefined || voiceType === "") {
+        voiceType = this.serverInfo.voice_type.toLowerCase()
+      }
+      if (voiceType.toLowerCase() === "rtc") {
+        API_Broadcast.auditionStart(data.id).then(res => {
           const result = res.data
           if (!result.success) {
             this.$message({
@@ -1099,11 +1114,11 @@ export default {
               message: result.message
             })
           } else {
-            this.pluginHandle.send({message: {request: "watch", id: id}})
+            this.pluginHandle.send({message: {request: "watch", id: data.id}})
           }
         })
       } else {
-        API_Broadcast.getBroadcastFileList(id).then(res => {
+        API_Broadcast.getBroadcastFileList(data.id).then(res => {
           const filesUri = res.files_uri
           for (let i = 0; i < filesUri.length; i++) {
             this.audioList.push(DeviceUrl + filesUri[i])
@@ -1122,12 +1137,12 @@ export default {
       if (this.audioIndex < this.audioList.length - 1) {
         this.audioIndex++
       } else {
-        this.streamingStop("")
+        this.streamingStop('sip', '')
       }
     },
-    streamingStop(personClose) {
-      if (this.serverInfo.voice_type === "rtc") {
-        this.pluginHandle.send({message: {request: "stop"}})
+    streamingStop(voiceType, personClose) {
+      if (voiceType.toLowerCase() === 'rtc') {
+        this.pluginHandle.send({message: {request: 'stop'}})
         this.pluginHandle.hangup()
         this.onCleanup()
         if (personClose) {
@@ -1163,10 +1178,17 @@ export default {
       API_ServiceInfo.getServiceInfo().then(response => {
         this.serverInfo = response;
         console.log("response", response)
+      })
 
-        if (response.voice_type === "rtc") {
-          if (this.rtcServer === null || this.rtcServer === "") {
-            this.getRtcServer()
+      API_Part.getPartSetting(this.$store.getters.partId).then(res => {
+        if (res.voice_type !== null && res.voice_type !== "") {
+          this.serverInfo.voice_type = res.voice_type.toLowerCase()
+          console.log("this.serverInfo.voice_type ===> " + this.serverInfo.voice_type)
+          if (this.serverInfo.voice_type.toLowerCase() === "rtc") {
+
+            if (this.rtcServer === null || this.rtcServer === "") {
+              this.getRtcServer()
+            }
           }
         }
       })
@@ -1178,8 +1200,8 @@ export default {
     },
     Time() {
       setInterval(() => {
-        if (this.audioList.length > 0) {
-          this.audioTotalTime = this.$refs.audios.duration
+        if (this.audioList.length > 0 && this.$refs.audios && this.$refs.audios.duration !== undefined) {
+          this.audioTotalTime = this.$refs.audios.duration;
         }
         if (this.audioTotalTime !== 0 && !isNaN(this.audioTotalTime)) {
           this.audioTime += 1

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1027 - 0
src/views/ncs-device/huayi_sleep.vue


+ 26 - 14
src/views/ncs-orginazition/components/partInfoEdit.vue

@@ -837,18 +837,13 @@
           </el-row>
 
           <el-row>
-            <el-col :span="8">
-              <el-form-item :label="this.$t('action.icon')">
-                <el-upload
-                    class="avatar-uploader"
-                    :action="`${uploadurl}?scene=avatar`"
-                    :show-file-list="false"
-                    :on-success="uploaded"
-                    :before-upload="handleShopLogoBefore"
-                >
-                  <img v-if="imageUrl" :src="imageUrl" class="avatar">
-                  <i v-else class="el-icon-plus avatar-uploader-icon" />
-                </el-upload>
+            <el-col :span="8" v-if="isShow">
+              <el-form-item :label="this.$t('zy20241209.voiceType')" prop="voice_type">
+                <el-select v-model="formmodel.voice_type"
+                           :placeholder="this.$t('zy20241209.chooseVoiceType')"
+                           filterable clearable>
+                  <el-option v-for="item in voiceType" :key="item" :label="item" :value="item" />
+                </el-select>
               </el-form-item>
             </el-col>
 
@@ -872,7 +867,23 @@
               </el-form-item>
             </el-col>
 
-<!--              <el-form-item :label="this.$t('action.excelUpload')">-->
+            <el-col :span="8">
+              <el-form-item :label="this.$t('action.icon')">
+                <el-upload
+                    class="avatar-uploader"
+                    :action="`${uploadurl}?scene=avatar`"
+                    :show-file-list="false"
+                    :on-success="uploaded"
+                    :before-upload="handleShopLogoBefore"
+                >
+                  <img v-if="imageUrl" :src="imageUrl" class="avatar">
+                  <i v-else class="el-icon-plus avatar-uploader-icon" />
+                </el-upload>
+              </el-form-item>
+            </el-col>
+
+
+            <!--              <el-form-item :label="this.$t('action.excelUpload')">-->
 <!--                <el-upload-->
 <!--                    class="excel-uploader"-->
 <!--                    :action="`${excelUploadUrl}`"-->
@@ -986,7 +997,8 @@ export default {
       ],
       deviceButtonBlueCodeTransfer: [
         { key : 'Blue Code', value : 'BLUE_CODE' }
-      ]
+      ],
+      voiceType: ['RTC', 'SIP'],
     }
   },
   async mounted() {