浏览代码

Merge branch 'develop' into feature/v1.3.3-broadcast-20220701

allen 3 年之前
父节点
当前提交
3ca1fd500c

+ 12 - 2
languages/en.js

@@ -136,7 +136,8 @@ module.exports = {
     statisticalSubTable: 'statistical sub table',
     statisticalSubTable: 'statistical sub table',
     byPerson: 'By Person',
     byPerson: 'By Person',
     byEvent: 'By Event',
     byEvent: 'By Event',
-    Export: 'Export'
+    export: 'Export',
+    icon: 'Icon'
   },
   },
   member: {
   member: {
     face: 'Avatar',
     face: 'Avatar',
@@ -299,6 +300,14 @@ module.exports = {
     ledVoice: 'Voice playback',
     ledVoice: 'Voice playback',
     ledVoiceStatus: 'Enable voice',
     ledVoiceStatus: 'Enable voice',
     ledFontSize: 'Font size',
     ledFontSize: 'Font size',
+    ledTiming: 'Dot matrix screen timing',
+    ledPowerOn: 'On dot matrix screen',
+    ledPowerOff: 'Off dot matrix screen',
+    ledRestart: 'Restart dot matrix screen',
+    ledRemoveAllProgram: 'Delete all programs',
+    ledUpdateDefaultProgram: 'Send default program',
+    ledOnlyTime: 'Time and date only',
+    ledAddCustom: 'Add custom',
     hostDeviceList: 'Nurse host list',
     hostDeviceList: 'Nurse host list',
     webSocketSuccess: 'WebSocket connection is successful',
     webSocketSuccess: 'WebSocket connection is successful',
     webSocketError: 'An error occurred in the WebSocket connection'
     webSocketError: 'An error occurred in the WebSocket connection'
@@ -819,7 +828,8 @@ module.exports = {
     organization: 'Organization',
     organization: 'Organization',
     roleManage: 'Role management',
     roleManage: 'Role management',
     debugging485: '485 debugging',
     debugging485: '485 debugging',
-    deviceFrame: 'Device space'
+    deviceFrame: 'Device space',
+    ledDevice: 'LED devices'
   },
   },
   deviceType: {
   deviceType: {
     NURSE_HOST: 'Nurse Host',
     NURSE_HOST: 'Nurse Host',

+ 12 - 2
languages/zh-CN.js

@@ -138,7 +138,8 @@ module.exports = {
     statisticalSubTable: '统计子表',
     statisticalSubTable: '统计子表',
     byPerson: '按人',
     byPerson: '按人',
     byEvent: '按事件',
     byEvent: '按事件',
-    export: '导出'
+    export: '导出',
+    icon: '图标'
   },
   },
   member: {
   member: {
     face: '头像',
     face: '头像',
@@ -301,6 +302,14 @@ module.exports = {
     ledVoice: '语音播放',
     ledVoice: '语音播放',
     ledVoiceStatus: '启用语音',
     ledVoiceStatus: '启用语音',
     ledFontSize: '字体大小',
     ledFontSize: '字体大小',
+    ledTiming: '点阵屏校时',
+    ledPowerOn: '开点阵屏',
+    ledPowerOff: '关点阵屏',
+    ledRestart: '重启点阵屏',
+    ledRemoveAllProgram: '删除所有节目',
+    ledUpdateDefaultProgram: '发送默认节目',
+    ledOnlyTime: '仅时间日期',
+    ledAddCustom: '添加自定义',
     hostDeviceList: '护士主机列表',
     hostDeviceList: '护士主机列表',
     webSocketSuccess: 'WebSocket连接成功',
     webSocketSuccess: 'WebSocket连接成功',
     webSocketError: 'WebSocket连接发生错误'
     webSocketError: 'WebSocket连接发生错误'
@@ -821,7 +830,8 @@ module.exports = {
     organization: '组织机构',
     organization: '组织机构',
     roleManage: '角色管理',
     roleManage: '角色管理',
     debugging485: '485调试',
     debugging485: '485调试',
-    deviceFrame: '设备空间'
+    deviceFrame: '设备空间',
+    ledDevice: 'LED点阵屏'
   },
   },
   deviceType: {
   deviceType: {
     NURSE_HOST: '护士主机',
     NURSE_HOST: '护士主机',

+ 43 - 0
src/api/ncs_led.js

@@ -0,0 +1,43 @@
+import request from '@/utils/request'
+
+/** 发送默认节目 */
+export function updateDefaultProgramHospitalId(params) {
+  return request({
+    url: '/ncs/led/update_default_program_hospital_id',
+    method: 'POST',
+    loading: true,
+    data: params
+  })
+}
+
+/** 开关屏 */
+export function powerOnOffByHospitalId(params) {
+  return request({
+    url: '/ncs/led/power_on_off_by_hospital_id',
+    method: 'POST',
+    loading: true,
+    data: params
+  })
+}
+
+/** 校时 */
+export function timing(params) {
+  return request({
+    url: '/ncs/led/timing',
+    method: 'POST',
+    loading: true,
+    data: params
+  })
+}
+
+/** 删除所有节目 */
+export function removeAllProgramByHospitalId(params) {
+  return request({
+    url: '/ncs/led/remove_all_program_by_hospital_id',
+    method: 'POST',
+    loading: true,
+    data: params
+  })
+}
+
+

+ 13 - 0
src/router/index.js

@@ -495,6 +495,19 @@ export const hospitalRoutes = [
       }
       }
     ]
     ]
   },
   },
+  {
+    path: '/hospital/ncs_led',
+    component: Layout,
+    redirect: '/ncs_led/index',
+    children: [
+      {
+        path: 'index',
+        component: () => import('@/views/hospital/ledManager'),
+        name: 'hospital_led',
+        meta: { title: i18n.t('tab.ledDevice'), icon: 'el-icon-message-solid', noCache: true }
+      }
+    ]
+  },
   { path: '*', redirect: '/404', hidden: true }
   { path: '*', redirect: '/404', hidden: true }
 ]
 ]
 export const adminRoutes = [
 export const adminRoutes = [

+ 1 - 1
src/views/customer/components/customerManager.vue

@@ -1047,7 +1047,7 @@ export default {
         in_date: (new Date()).valueOf(),
         in_date: (new Date()).valueOf(),
         out_date: (new Date()).valueOf(),
         out_date: (new Date()).valueOf(),
         mobile: '',
         mobile: '',
-        part_id: this.frame.part_id
+        part_id: this.part_view ? this.$store.getters.partId : this.frame.part_id
       }
       }
       if (Object.keys(this.frame).length > 0) {
       if (Object.keys(this.frame).length > 0) {
         this.$set(this.formmodel, 'frame_id', this.frame.id)
         this.$set(this.formmodel, 'frame_id', this.frame.id)

+ 133 - 0
src/views/hospital/ledManager.vue

@@ -0,0 +1,133 @@
+<template>
+  <div>
+    <el-card style="margin: 15px">
+      <el-form ref="editform" :rules="rules" label-width="140px" :model="formmodel">
+        <fieldset>
+          <legend>{{ this.$t('tab.ledDevice') }}</legend>
+
+          <el-row>
+            <el-form-item :label="this.$t('deviceManage.ledUpdateDefaultProgram')">
+              <el-radio v-model="isOnlyTime" :label="false">{{ this.$t('deviceManage.ledOnlyTime') }}</el-radio>
+              <el-radio v-model="isOnlyTime" :label="true">{{ this.$t('deviceManage.ledAddCustom') }}</el-radio>
+            </el-form-item>
+          </el-row>
+
+          <el-row v-if="isOnlyTime">
+<!--          <el-row>-->
+            <el-col :span="18">
+              <el-form-item :label="this.$t('deviceManage.ledAddCustom')">
+                <el-input v-model="formmodel.addCustom" :maxlength="50" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+
+          <el-row>
+            <el-form-item>
+              <el-col :span="4">
+                <el-button type="primary" @click="timing">{{ this.$t('deviceManage.ledTiming') }}</el-button>
+              </el-col>
+
+              <el-col :span="4">
+                <el-button type="primary" @click="updateDefaultProgram">{{ this.$t('deviceManage.ledUpdateDefaultProgram') }}</el-button>
+              </el-col>
+
+              <el-col :span="4">
+                <el-button type="primary" @click="deleteAllPrograms">{{ this.$t('deviceManage.ledRemoveAllProgram') }}</el-button>
+              </el-col>
+
+              <el-col :span="4">
+                <el-button type="primary" @click="powerOn">{{ this.$t('deviceManage.ledPowerOn') }}</el-button>
+              </el-col>
+
+              <el-col :span="4">
+                <el-button type="primary" @click="powerOff">{{ this.$t('deviceManage.ledPowerOff') }}</el-button>
+              </el-col>
+
+              <el-col :span="4">
+                <el-button type="primary" @click="powerRestart">{{ this.$t('deviceManage.ledRestart') }}</el-button>
+              </el-col>
+            </el-form-item>
+          </el-row>
+        </fieldset>
+      </el-form>
+    </el-card>
+  </div>
+</template>
+
+<script>
+
+import * as API_Led from '@/api/ncs_led'
+export default {
+  name: "ledManager",
+
+  data() {
+    return {
+      formmodel: {},
+      rules: {},
+      isOnlyTime: false,
+      // addCustom: '',
+      hospital_id: this.$store.getters.partId
+    }
+  },
+  async mounted() {
+    this.isOnlyTime === false
+  },
+  methods: {
+    updateDefaultProgram() {
+      let text;
+      if (this.isOnlyTime) {
+        text = this.formmodel.addCustom
+      }
+      const params = {}
+      params.hospital_id = this.hospital_id
+      params.text = text
+      API_Led.updateDefaultProgramHospitalId(params).then(r => {
+        this.$message.success(this.$t('action.saveSuccess'))
+      })
+    },
+    powerOn() {
+      const params = {}
+      params.hospital_id = this.hospital_id
+      params.on_off = 0
+      API_Led.powerOnOffByHospitalId(params).then(r => {
+        this.$message.success(this.$t('action.saveSuccess'))
+      })
+    },
+    powerOff() {
+      const params = {}
+      params.hospital_id = this.hospital_id
+      params.on_off = 1
+      API_Led.powerOnOffByHospitalId(params).then(r => {
+        this.$message.success(this.$t('action.saveSuccess'))
+      })
+    },
+    powerRestart() {
+      const params = {}
+      params.hospital_id = this.hospital_id
+      params.on_off = 2
+      API_Led.powerOnOffByHospitalId(params).then(r => {
+        this.$message.success(this.$t('action.saveSuccess'))
+      })
+    },
+    timing() {
+      const params = {}
+      params.hospital_id = this.hospital_id
+      API_Led.timing(params).then(r => {
+        this.$message.success(this.$t('action.saveSuccess'))
+      })
+    },
+    deleteAllPrograms() {
+      const params = {}
+      params.hospital_id = this.hospital_id
+      params.text = null
+      API_Led.removeAllProgramByHospitalId(params).then(r => {
+        this.$message.success(this.$t('action.saveSuccess'))
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 3 - 3
src/views/hospital/ncs_device/deviceManager.vue

@@ -366,9 +366,9 @@ export default {
         led_resolution_ratio: [
         led_resolution_ratio: [
           { required: true, message: this.$t('deviceManage.ledResolutionRatio'), trigger: 'blur' }
           { required: true, message: this.$t('deviceManage.ledResolutionRatio'), trigger: 'blur' }
         ],
         ],
-        led_voice: [
-          { required: true, message: this.$t('deviceManage.ledVoice'), trigger: 'blur' }
-        ],
+        // led_voice: [
+        //   { required: true, message: this.$t('deviceManage.ledVoice'), trigger: 'blur' }
+        // ],
         led_font_size: [
         led_font_size: [
           { required: true, message: this.$t('deviceManage.ledFontSize'), trigger: 'blur' }
           { required: true, message: this.$t('deviceManage.ledFontSize'), trigger: 'blur' }
         ],
         ],

+ 42 - 18
src/views/ncs-device/components/deviceManager.vue

@@ -376,9 +376,9 @@ export default {
         led_resolution_ratio: [
         led_resolution_ratio: [
           { required: true, message: this.$t('deviceManage.ledResolutionRatio'), trigger: 'blur' }
           { required: true, message: this.$t('deviceManage.ledResolutionRatio'), trigger: 'blur' }
         ],
         ],
-        led_voice: [
-          { required: true, message: this.$t('deviceManage.ledVoice'), trigger: 'blur' }
-        ],
+        // led_voice: [
+        //   { required: true, message: this.$t('deviceManage.ledVoice'), trigger: 'blur' }
+        // ],
         led_font_size: [
         led_font_size: [
           { required: true, message: this.$t('deviceManage.ledFontSize'), trigger: 'blur' }
           { required: true, message: this.$t('deviceManage.ledFontSize'), trigger: 'blur' }
         ],
         ],
@@ -640,17 +640,21 @@ export default {
         const deviceData = [...response.data]
         const deviceData = [...response.data]
         deviceData.forEach(item => {
         deviceData.forEach(item => {
           if (this.onlineDevice.length > 0) {
           if (this.onlineDevice.length > 0) {
-            if (item.eth_mac) {
-              const mac = this.onlineDevice.filter(p => p.toLowerCase() === item.eth_mac.toLowerCase())[0]
-              // console.log('在线设备1', mac)
-              if (mac !== undefined && mac !== null) {
-                item['online_state'] = this.$t('deviceManage.connectTrue')
-              } else {
-                item['online_state'] = this.$t('deviceManage.connectFalse')
+            if (this.isCannotBeOnline(item.device_type)) {
+              if (item.eth_mac) {
+                const mac = this.onlineDevice.filter(p => p.toLowerCase() === item.eth_mac.toLowerCase())[0]
+                // console.log('在线设备1', mac)
+                if (mac !== undefined && mac !== null) {
+                  item['online_state'] = this.$t('deviceManage.connectTrue')
+                } else {
+                  item['online_state'] = this.$t('deviceManage.connectFalse')
+                }
               }
               }
+            } else {
+              item['online_state'] = '/'
             }
             }
           } else {
           } else {
-            item['online_state'] = this.$t('deviceManage.connectFalse')
+            item['online_state'] = '/'
           }
           }
         })
         })
         this.rowData = deviceData
         this.rowData = deviceData
@@ -691,8 +695,8 @@ export default {
     },
     },
 
 
     /**
     /**
-         * 过滤状态发生变化,发送到服务器检索数据
-         */
+     * 过滤状态发生变化,发送到服务器检索数据
+     */
     filterModifed(param) {
     filterModifed(param) {
       var model = param.api.getFilterModel()
       var model = param.api.getFilterModel()
       // 连接状态不经过服务器过滤
       // 连接状态不经过服务器过滤
@@ -764,9 +768,11 @@ export default {
       if (params.value === this.$t('deviceManage.connectTrue')) {
       if (params.value === this.$t('deviceManage.connectTrue')) {
         // return '<span style="color:green;">在线</span>'
         // return '<span style="color:green;">在线</span>'
         return '<span style="color:green;">' + this.$t('deviceManage.connectTrue') + '</span>'
         return '<span style="color:green;">' + this.$t('deviceManage.connectTrue') + '</span>'
-      } else {
+      } else if (params.value === this.$t('deviceManage.connectFalse')) {
         // return '<span style="color:gray;">离线</span>'
         // return '<span style="color:gray;">离线</span>'
         return '<span style="color:gray;">' + this.$t('deviceManage.connectFalse') + '</span>'
         return '<span style="color:gray;">' + this.$t('deviceManage.connectFalse') + '</span>'
+      } else {
+        return '<span style="color:gray;"> / </span>'
       }
       }
     },
     },
     /** 删除设备 **/
     /** 删除设备 **/
@@ -1027,9 +1033,13 @@ export default {
       this.onlineDevice = JSON.parse(e.data)
       this.onlineDevice = JSON.parse(e.data)
       if (this.rowData !== null) {
       if (this.rowData !== null) {
         for (let i = 0; i < this.rowData.length; i++) {
         for (let i = 0; i < this.rowData.length; i++) {
-          if (this.rowData[i].eth_mac) {
-            const mac = this.onlineDevice.filter(p => p.toLowerCase() === this.rowData[i].eth_mac.toLowerCase())[0]
-            this.rowData[i]['online_state'] = (mac !== undefined && mac !== null) ? this.$t('deviceManage.connectTrue') : this.$t('deviceManage.connectFalse')
+          if (this.isCannotBeOnline(this.rowData[i].device_type)) {
+            if (this.rowData[i].eth_mac) {
+              const mac = this.onlineDevice.filter(p => p.toLowerCase() === this.rowData[i].eth_mac.toLowerCase())[0]
+              this.rowData[i]['online_state'] = (mac !== undefined && mac !== null) ? this.$t('deviceManage.connectTrue') : this.$t('deviceManage.connectFalse')
+            }
+          } else {
+            this.rowData[i]['online_state'] = '/'
           }
           }
         }
         }
         const rowData = [...this.rowData]
         const rowData = [...this.rowData]
@@ -1059,8 +1069,22 @@ export default {
         this.$message.success(this.$t('action.settingsSuccess'))
         this.$message.success(this.$t('action.settingsSuccess'))
         this.serverAddressDialogVisible = false
         this.serverAddressDialogVisible = false
       })
       })
+    },
+    /**
+     * 判断设备是否为模拟分机这种,无法在线是设备
+     */
+    isCannotBeOnline(val){
+      return val === DEVICE_TYPE.NURSE_HOST ||
+          val === DEVICE_TYPE.OTHER_HOST ||
+          val === DEVICE_TYPE.NURSE_HOST ||
+          val === DEVICE_TYPE.DOCTOR_HOST ||
+          val === DEVICE_TYPE.NURSE_WATCH ||
+          val === DEVICE_TYPE.WORKER_WATCH ||
+          val === DEVICE_TYPE.TRANSFER_DEVICE ||
+          val === DEVICE_TYPE.DOOR_DEVICE ||
+          val === DEVICE_TYPE.DIGIT_BED_DEVICE ||
+          val === DEVICE_TYPE.CELL_PHONE;
     }
     }
-
   }
   }
 }
 }
 </script>
 </script>

+ 90 - 4
src/views/ncs-orginazition/components/partInfoEdit.vue

@@ -492,6 +492,18 @@
               </el-form-item>
               </el-form-item>
             </el-col>
             </el-col>
           </el-row>
           </el-row>
+          <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>
 
 
         </fieldset>
         </fieldset>
 
 
@@ -516,11 +528,12 @@ import {bindDeviceTransAudio, init485Device, initData, initDeviceList} from '@/a
 import * as API_Clerk from '@/api/ncs_clerk'
 import * as API_Clerk from '@/api/ncs_clerk'
 import * as API_SystemConfig from '@/api/ncs_systemconfig'
 import * as API_SystemConfig from '@/api/ncs_systemconfig'
 import * as API_Device from '@/api/ncs_device'
 import * as API_Device from '@/api/ncs_device'
+const serverUrl = domain.serverUrl
 export default {
 export default {
   name: 'PartInfoEdit',
   name: 'PartInfoEdit',
   props: {
   props: {
     partId: {
     partId: {
-      type: Number,
+      type: String,
       default: null
       default: null
     }
     }
   },
   },
@@ -543,7 +556,9 @@ export default {
       systemConfig: {},
       systemConfig: {},
       formmodelAdmin: {},
       formmodelAdmin: {},
       noMember: true,
       noMember: true,
-      otherHostDevice: []
+      otherHostDevice: [],
+      uploadurl: serverUrl + '/ncs/upload/uploadFile',
+      imageUrl: '',
     }
     }
   },
   },
   async mounted() {
   async mounted() {
@@ -565,6 +580,9 @@ export default {
           } else {
           } else {
             this.noMember = true
             this.noMember = true
           }
           }
+          if (this.formmodel.qr_url) {
+            this.imageUrl = this.formmodel.qr_url
+          }
           if (!this.formmodel.id) {
           if (!this.formmodel.id) {
             this.formmodel = {
             this.formmodel = {
               ...this.formmodel, ...{
               ...this.formmodel, ...{
@@ -616,7 +634,7 @@ export default {
                 two_color_door_light_valid: 0,
                 two_color_door_light_valid: 0,
                 customize_hospital_call_first: 0,
                 customize_hospital_call_first: 0,
                 customize_hospital_call_second: 0,
                 customize_hospital_call_second: 0,
-                customize_hospital_call_third: 0,
+                customize_hospital_call_third: 0
               }
               }
             }
             }
           } else {
           } else {
@@ -684,6 +702,9 @@ export default {
               this.noMember = true
               this.noMember = true
             })
             })
           }
           }
+          if (this.formmodel.qr_url) {
+            this.imageUrl = this.formmodel.qr_url
+          }
           API_Part.editPartSetting(this.formmodel, this.partId).then(res => {
           API_Part.editPartSetting(this.formmodel, this.partId).then(res => {
             this.$message.success(this.$t('action.saveSuccess'))
             this.$message.success(this.$t('action.saveSuccess'))
             if (this.systemConfig.id != null) {
             if (this.systemConfig.id != null) {
@@ -782,7 +803,51 @@ export default {
       })
       })
       this.otherHostDevice = _this.otherHostDevice
       this.otherHostDevice = _this.otherHostDevice
       console.log("this.otherHostDevice", this.otherHostDevice)
       console.log("this.otherHostDevice", this.otherHostDevice)
-    }
+    },
+    /** 上传成功后的钩子 更换图片 置空存储数组*/
+    uploaded(res) {
+      this.imageUrl = serverUrl + '/' + res
+      this.formmodel.qr_url = this.imageUrl
+    },
+    /** 图片上传之前的校验 */
+    handleShopLogoBefore(file) {
+      return new Promise((resolve, reject) => {
+        const isImg = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/gif'
+        const isLt2M = file.size / 1024 / 1024 < 2
+
+        if (!isImg) {
+          this.$message.error(this.$t('action.uploaderImg2'))
+          reject()
+        }
+        if (!isLt2M) {
+          this.$message.error(this.$t('action.uploaderSize2'))
+          reject()
+        }
+        const reader = new FileReader()
+        reader.onload = (event) => {
+          const image = new Image()
+          image.onload = () => {
+            const width = image.width
+            const height = image.height
+            if (width > 500 || width < 100) {
+              this.$message.error(this.$t('action.uploaderImgMsg'))
+              reject()
+            }
+            if (width !== height) {
+              this.$message.error(this.$t('action.uploaderImgMsg2'))
+              reject()
+            }
+            if (height > 500 || height < 100) {
+              this.$message.error(this.$t('action.uploaderImgMsg3'))
+              reject()
+            }
+            resolve()
+          }
+          image.src = event.target.result
+        }
+        reader.readAsDataURL(file)
+      })
+    },
   }
   }
 }
 }
 </script>
 </script>
@@ -804,4 +869,25 @@ fieldset {
 /deep/ .m-colorPicker .box.open{
 /deep/ .m-colorPicker .box.open{
   z-index: 1000 !important;
   z-index: 1000 !important;
 }
 }
+
+/deep/ .avatar-uploader .el-upload {
+  border: 1px dashed #d9d9d9;
+  border-radius: 6px;
+  cursor: pointer;
+  position: relative;
+  overflow: hidden;
+}
+
+/deep/ .avatar-uploader .el-upload:hover {
+  border-color: #409EFF;
+}
+
+/deep/ .avatar-uploader-icon {
+  font-size: 28px;
+  color: #8c939d;
+  width: 100px;
+  height: 100px;
+  line-height: 100px;
+  text-align: center;
+}
 </style>
 </style>