浏览代码

增加设备空间的中文

vothin 2 年之前
父节点
当前提交
d6367d47a0
共有 3 个文件被更改,包括 70 次插入27 次删除
  1. 20 1
      languages/en.js
  2. 20 1
      languages/zh-CN.js
  3. 30 25
      src/views/ncs-orginazition/device-frame.vue

+ 20 - 1
languages/en.js

@@ -53,6 +53,7 @@ module.exports = {
     systemNoReturnMessage: 'The system has no return message!',
     systemNoReturnMessage: 'The system has no return message!',
     failedGetReturnMessage: 'Failed to get the return message!',
     failedGetReturnMessage: 'Failed to get the return message!',
     notDevelopedYet: 'Not yet developed',
     notDevelopedYet: 'Not yet developed',
+    search: 'Enter search',
     keywords: 'Please enter a search keyword',
     keywords: 'Please enter a search keyword',
     chooseLang: 'Choose language',
     chooseLang: 'Choose language',
     perpetualLicence: 'Perpetual License',
     perpetualLicence: 'Perpetual License',
@@ -87,6 +88,7 @@ module.exports = {
     to: 'to',
     to: 'to',
     index: 'Serial number',
     index: 'Serial number',
     null: 'None',
     null: 'None',
+    all: 'All',
     choiceData: 'Choose date and time',
     choiceData: 'Choose date and time',
     startDate: 'Start date',
     startDate: 'Start date',
     endDate: 'End date',
     endDate: 'End date',
@@ -218,8 +220,11 @@ module.exports = {
     sureDelete: 'Sure to delete',
     sureDelete: 'Sure to delete',
     allBad: 'And all the beds in it?',
     allBad: 'And all the beds in it?',
     sureDeleteBed: 'Make sure to delete the bed',
     sureDeleteBed: 'Make sure to delete the bed',
+    part: 'Department',
     room: 'Room',
     room: 'Room',
+    room2: 'Room',
     bed: 'Bed',
     bed: 'Bed',
+    bed2: 'Bed',
     newOrganization: 'New Organization',
     newOrganization: 'New Organization',
     partName: 'Department name',
     partName: 'Department name',
     inputPartName: 'Please enter the department name',
     inputPartName: 'Please enter the department name',
@@ -315,7 +320,21 @@ module.exports = {
     ledAddCustom: 'Add custom',
     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',
+    deviceLocationLevel: 'Please select the device location level',
+    assignment: 'One-click assignment',
+    assignmentMsg: 'No spare allocated devices!',
+    assignmentMsg2: 'Rooms and beds have devices, and only department-level device can be automatically assigned!',
+    assignmentMsg3: 'Start auto-assigning!',
+    assignmentMsg4: 'The automatic assignment is complete, the full level of device needs to be manually assigned, after the assignment is completed, please click [Save]!',
+    reset: 'One-click reset',
+    resetMsg: 'Are you sure you want to reset all your devices?',
+    resetMsg2: 'Reset successfully!',
+    collapse: 'Collapse display',
+    card: 'Card display',
+    devices: ' devices',
+    roomNoDevice: 'The room was not equipped',
+    bedNoDevice: 'The bed was not equipped'
   },
   },
   clerkManage: {
   clerkManage: {
     clerkEdit: 'Edit member information',
     clerkEdit: 'Edit member information',

+ 20 - 1
languages/zh-CN.js

@@ -54,6 +54,7 @@ module.exports = {
     systemNoReturnMessage: '系统无返回消息!',
     systemNoReturnMessage: '系统无返回消息!',
     failedGetReturnMessage: '未能得到返回消息!',
     failedGetReturnMessage: '未能得到返回消息!',
     notDevelopedYet: '暂未开发',
     notDevelopedYet: '暂未开发',
+    search: '输入搜索',
     keywords: '请输入搜索关键字',
     keywords: '请输入搜索关键字',
     chooseLang: '选择语言',
     chooseLang: '选择语言',
     perpetualLicence: '永久授权',
     perpetualLicence: '永久授权',
@@ -88,6 +89,7 @@ module.exports = {
     to: '至',
     to: '至',
     index: '序号',
     index: '序号',
     null: '无',
     null: '无',
+    all: '全部',
     choiceData: '选择日期时间',
     choiceData: '选择日期时间',
     startDate: '开始日期',
     startDate: '开始日期',
     endDate: '结束日期',
     endDate: '结束日期',
@@ -219,8 +221,11 @@ module.exports = {
     sureDelete: '确定要删除',
     sureDelete: '确定要删除',
     allBad: '及其中的所有床位吗?',
     allBad: '及其中的所有床位吗?',
     sureDeleteBed: '确定删除床位',
     sureDeleteBed: '确定删除床位',
+    part: '科室',
     room: '房',
     room: '房',
+    room2: '房间',
     bed: '床',
     bed: '床',
+    bed2: '床位',
     newOrganization: '新建组织',
     newOrganization: '新建组织',
     partName: '科室名称',
     partName: '科室名称',
     inputPartName: '请输入科室名称',
     inputPartName: '请输入科室名称',
@@ -316,7 +321,21 @@ module.exports = {
     ledAddCustom: '添加自定义',
     ledAddCustom: '添加自定义',
     hostDeviceList: '护士主机列表',
     hostDeviceList: '护士主机列表',
     webSocketSuccess: 'WebSocket连接成功',
     webSocketSuccess: 'WebSocket连接成功',
-    webSocketError: 'WebSocket连接发生错误'
+    webSocketError: 'WebSocket连接发生错误',
+    deviceLocationLevel: '请选择设备位置级别',
+    assignment: '一键分配',
+    assignmentMsg: '没有空余分配的设备!',
+    assignmentMsg2: '房间及床位有设备,只能自动分配科室级设备!',
+    assignmentMsg3: '开始自动分配!',
+    assignmentMsg4: '自动分配已完成,全级别设备需手动分配,分配完成后请点击【保存】!',
+    reset: '一键重置',
+    resetMsg: '确定要重置所有设备吗?',
+    resetMsg2: '已成功重置!',
+    collapse: '折叠显示',
+    card: '卡片显示',
+    devices: '台设备',
+    roomNoDevice: '房间没有设备',
+    bedNoDevice: '床位没有设备'
   },
   },
   clerkManage: {
   clerkManage: {
     clerkEdit: '编辑成员信息',
     clerkEdit: '编辑成员信息',

+ 30 - 25
src/views/ncs-orginazition/device-frame.vue

@@ -2,12 +2,12 @@
   <el-container style="height:850px; border: 1px solid #eee">
   <el-container style="height:850px; border: 1px solid #eee">
     <el-aside width="25%" style="background-color: rgb(255,255,255);border: 1px solid #eee">
     <el-aside width="25%" style="background-color: rgb(255,255,255);border: 1px solid #eee">
       <div>
       <div>
-        <el-input v-model="searchDeviceStr" placeholder="输入搜索" clearable @change="clickSearch">
-          <el-select v-model="frameType" slot="prepend" placeholder="请选择设备位置级别" @change="changeFrameType">
-            <el-option label="全部" value="all"></el-option>
-            <el-option label="科室" value="part"></el-option>
-            <el-option label="房间" value="room"></el-option>
-            <el-option label="床位" value="bed"></el-option>
+        <el-input v-model="searchDeviceStr" :placeholder="$t('action.search')" clearable @change="clickSearch">
+          <el-select v-model="frameType" slot="prepend" :placeholder="$t('deviceManage.deviceLocationLevel')" @change="changeFrameType">
+            <el-option :label="$t('action.all')" value="all"></el-option>
+            <el-option :label="$t('frameManage.part')" value="part"></el-option>
+            <el-option :label="$t('frameManage.room2')" value="room"></el-option>
+            <el-option :label="$t('frameManage.bed2')" value="bed"></el-option>
           </el-select>
           </el-select>
           <el-button slot="append" size="mini" icon="el-icon-search" @click="clickSearch"></el-button>
           <el-button slot="append" size="mini" icon="el-icon-search" @click="clickSearch"></el-button>
         </el-input>
         </el-input>
@@ -22,13 +22,14 @@
     <el-container>
     <el-container>
       <el-header style="font-size: 12px; margin-top: 10px;">
       <el-header style="font-size: 12px; margin-top: 10px;">
         <div style="text-align: left; float: left">
         <div style="text-align: left; float: left">
-          <el-button type="success" @click="onekeySave" :loading="isSave">一键分配</el-button>
-          <el-button type="danger" plain @click="onekeyDel">一键重置</el-button>
+          <el-button type="success" @click="onekeySave" :loading="isSave">{{ $t('deviceManage.assignment') }}</el-button>
+          <el-button type="danger" plain @click="onekeyDel">{{ $t('deviceManage.reset') }}</el-button>
         </div>
         </div>
         <div style="text-align: right">
         <div style="text-align: right">
-          <el-switch v-model="openType" active-text="折叠显示" inactive-text="卡片显示" style="margin-right: 20px;"></el-switch>
-          <el-button type="success" icon="el-icon-check" :loading="isSave" :disabled="needUpdateList.length === 0" @click="saveUpdate">保存</el-button>
-          <el-button icon="el-icon-close" :disabled="needUpdateList.length === 0" @click="canle">取消</el-button>
+          <el-switch v-model="openType" :active-text="$t('deviceManage.collapse')" :inactive-text="$t('deviceManage.card')" style="margin-right: 20px;"></el-switch>
+          <el-button type="success" icon="el-icon-check" :loading="isSave" :disabled="needUpdateList.length === 0" @click="saveUpdate">
+            {{ $t('action.save') }}</el-button>
+          <el-button icon="el-icon-close" :disabled="needUpdateList.length === 0" @click="canle">{{ $t('action.cancel') }}</el-button>
         </div>
         </div>
       </el-header>
       </el-header>
 
 
@@ -38,7 +39,7 @@
           <el-col :span="24">
           <el-col :span="24">
             <el-card class="box-card" shadow="hover" :body-style="{ padding: '0px', margin: '0px' }">
             <el-card class="box-card" shadow="hover" :body-style="{ padding: '0px', margin: '0px' }">
               <div slot="header" class="clearfix">
               <div slot="header" class="clearfix">
-                <span>{{ framesAndDevices.full_name }}-{{ framesAndDevices.device_size }}台设备</span>
+                <span>{{ framesAndDevices.full_name }}-{{ framesAndDevices.device_size }}{{ $t('deviceManage.devices') }}</span>
                 <!--                <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>-->
                 <!--                <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>-->
               </div>
               </div>
               <div :class="boolPart ? 'mybg' : ''" style="width: 100%; height: 100%; padding: 15px 0px 10px 0px; min-height: 80px;">
               <div :class="boolPart ? 'mybg' : ''" style="width: 100%; height: 100%; padding: 15px 0px 10px 0px; min-height: 80px;">
@@ -67,7 +68,8 @@
               <div slot="title" style="width: 100%;min-height: 50px;">
               <div slot="title" style="width: 100%;min-height: 50px;">
                 <div style="font-size: 15px;float: left;width: 10%;" :class="boolRoom ? 'mybg' : ''">{{ item.full_name }}</div>
                 <div style="font-size: 15px;float: left;width: 10%;" :class="boolRoom ? 'mybg' : ''">{{ item.full_name }}</div>
                 <div :class="boolRoom ? 'mybg' : ''"  style="margin: 0;float: left;width: 85%;">
                 <div :class="boolRoom ? 'mybg' : ''"  style="margin: 0;float: left;width: 85%;">
-                  <div v-if="item.device_dos.length === 0" style="float: left;height: 100%"><el-tag effect="plain" type="info">房间无设备</el-tag></div>
+                  <div v-if="item.device_dos.length === 0" style="float: left;height: 100%"><el-tag effect="plain" type="info">
+                    {{ $t('deviceManage.roomNoDevice') }}</el-tag></div>
                   <draggable class="selected-list" v-model="item.device_dos" tag="div" :options="dragOptions" :disabled="boolRoom" @start="roomMove" @end="onEnd" @remove="otherRemove">
                   <draggable class="selected-list" v-model="item.device_dos" tag="div" :options="dragOptions" :disabled="boolRoom" @start="roomMove" @end="onEnd" @remove="otherRemove">
                     <el-tag v-for="(t, i) in item.device_dos" :key="i" :type="getColor(i)" style="margin-bottom: 5px;"> {{ t.name }}</el-tag>
                     <el-tag v-for="(t, i) in item.device_dos" :key="i" :type="getColor(i)" style="margin-bottom: 5px;"> {{ t.name }}</el-tag>
                   </draggable>
                   </draggable>
@@ -78,7 +80,8 @@
                   <div class="clearfix" :class="boolBed ? 'mybg' : ''" style="margin: 0;padding: 15px 0px 10px 0px">
                   <div class="clearfix" :class="boolBed ? 'mybg' : ''" style="margin: 0;padding: 15px 0px 10px 0px">
                     <div style="font-size: 15px;float: left;width: 10%;margin-left: 5px;">{{ t.full_name }}</div>
                     <div style="font-size: 15px;float: left;width: 10%;margin-left: 5px;">{{ t.full_name }}</div>
                     <div style="margin: 0;float: left;width: 85%;">
                     <div style="margin: 0;float: left;width: 85%;">
-                      <div v-if="t.device_dos.length === 0" style="float: left;height: 100%"><el-tag effect="plain" type="info">床位无设备</el-tag></div>
+                      <div v-if="t.device_dos.length === 0" style="float: left;height: 100%"><el-tag effect="plain" type="info">
+                        {{ $t('deviceManage.bedNoDevice') }}</el-tag></div>
                       <draggable class="selected-list" tag="div" v-model="t.device_dos" :options="dragOptions" :disabled="boolBed" style="height: 100%" @start="bedMove" @end="onEnd" @remove="otherRemove">
                       <draggable class="selected-list" tag="div" v-model="t.device_dos" :options="dragOptions" :disabled="boolBed" style="height: 100%" @start="bedMove" @end="onEnd" @remove="otherRemove">
                         <el-tag v-for="(tt, ii) in t.device_dos" :key="ii" :type="getColor(ii)"> {{ tt.name }}</el-tag>
                         <el-tag v-for="(tt, ii) in t.device_dos" :key="ii" :type="getColor(ii)"> {{ tt.name }}</el-tag>
                       </draggable>
                       </draggable>
@@ -96,7 +99,8 @@
               <div slot="header" :class="boolRoom ? 'mybg' : ''" class="clearfix" style="width: 100%;min-height: 40px;">
               <div slot="header" :class="boolRoom ? 'mybg' : ''" class="clearfix" style="width: 100%;min-height: 40px;">
                 <div style="font-size: 15px;float: left;width: 10%;margin-top: 5px;">{{ item.full_name }}</div>
                 <div style="font-size: 15px;float: left;width: 10%;margin-top: 5px;">{{ item.full_name }}</div>
                 <div style="margin: 0;float: left;width: 85%;">
                 <div style="margin: 0;float: left;width: 85%;">
-                  <div v-if="item.device_dos.length === 0" style="float: left;height: 100%"><el-tag effect="plain" type="info">房间无设备</el-tag></div>
+                  <div v-if="item.device_dos.length === 0" style="float: left;height: 100%"><el-tag effect="plain" type="info">
+                    {{ $t('deviceManage.roomNoDevice') }}</el-tag></div>
                   <draggable class="selected-list" v-model="item.device_dos" tag="div" :options="dragOptions" :disabled="boolRoom" @start="roomMove" @end="onEnd" @remove="otherRemove">
                   <draggable class="selected-list" v-model="item.device_dos" tag="div" :options="dragOptions" :disabled="boolRoom" @start="roomMove" @end="onEnd" @remove="otherRemove">
                     <el-tag v-for="(t, i) in item.device_dos" :key="i" :type="getColor(i)" style="margin-bottom: 5px;"> {{ t.name }}</el-tag>
                     <el-tag v-for="(t, i) in item.device_dos" :key="i" :type="getColor(i)" style="margin-bottom: 5px;"> {{ t.name }}</el-tag>
                   </draggable>
                   </draggable>
@@ -109,7 +113,8 @@
                   <div class="clearfix" :class="boolBed ? 'mybg' : ''" style="margin: 0;padding: 15px 0 10px 0;min-height: 40px">
                   <div class="clearfix" :class="boolBed ? 'mybg' : ''" style="margin: 0;padding: 15px 0 10px 0;min-height: 40px">
                     <div style="font-size: 15px;float: left;width: 10%;margin: 5px">{{ t.full_name }}</div>
                     <div style="font-size: 15px;float: left;width: 10%;margin: 5px">{{ t.full_name }}</div>
                     <div style="margin: 0;float: left;width: 85%;">
                     <div style="margin: 0;float: left;width: 85%;">
-                      <div v-if="t.device_dos.length === 0" style="float: left;height: 100%"><el-tag effect="plain" type="info">床位无设备</el-tag></div>
+                      <div v-if="t.device_dos.length === 0" style="float: left;height: 100%"><el-tag effect="plain" type="info">
+                        {{ $t('deviceManage.bedNoDevice') }}</el-tag></div>
                       <draggable class="selected-list" tag="div" v-model="t.device_dos" :options="dragOptions" :disabled="boolBed" style="height: 100%" @start="bedMove" @end="onEnd" @remove="otherRemove">
                       <draggable class="selected-list" tag="div" v-model="t.device_dos" :options="dragOptions" :disabled="boolBed" style="height: 100%" @start="bedMove" @end="onEnd" @remove="otherRemove">
                         <el-tag v-for="(tt, ii) in t.device_dos" :key="ii" :type="getColor(ii)"> {{ tt.name }}</el-tag>
                         <el-tag v-for="(tt, ii) in t.device_dos" :key="ii" :type="getColor(ii)"> {{ tt.name }}</el-tag>
                       </draggable>
                       </draggable>
@@ -390,7 +395,7 @@ export default {
         this.isSave = false
         this.isSave = false
         this.API_getDeviceList()
         this.API_getDeviceList()
         this.API_getFrameAndDevice()
         this.API_getFrameAndDevice()
-        this.$message.success('保存成功!')
+        this.$message.success(this.$t('action.saveSuccess'))
       })
       })
     },
     },
     // 取消
     // 取消
@@ -406,7 +411,7 @@ export default {
       this.isSave = true
       this.isSave = true
       if (this.deviceList.length === 0) {
       if (this.deviceList.length === 0) {
         this.isSave = false
         this.isSave = false
-        this.$message.info('没有空余分配的设备!')
+        this.$message.info(this.$t('deviceManage.assignmentMsg'))
         return
         return
       }
       }
       this.canle()
       this.canle()
@@ -430,7 +435,7 @@ export default {
       // }
       // }
       if (this.framesAndDevices.device_size > this.framesAndDevices.device_dos.length) {
       if (this.framesAndDevices.device_size > this.framesAndDevices.device_dos.length) {
         this.isSave = false
         this.isSave = false
-        this.$message.info('房间及床位有设备,只能自动分配科室级设备!')
+        this.$message.info(this.$t('deviceManage.assignmentMsg2'))
           // let item
           // let item
           // while(i--){
           // while(i--){
           //   item = this.deviceList[i]
           //   item = this.deviceList[i]
@@ -443,7 +448,7 @@ export default {
           // }
           // }
           return
           return
       }
       }
-      this.$message.info('开始自动分配!')
+      this.$message.info(this.$t('deviceManage.assignmentMsg3'))
       const roomList = this.returnRoomList()
       const roomList = this.returnRoomList()
       const groupBy = (arr, func) =>
       const groupBy = (arr, func) =>
           arr.map(typeof func === 'function' ? func : val => val[func]).reduce((acc, val, i) => {
           arr.map(typeof func === 'function' ? func : val => val[func]).reduce((acc, val, i) => {
@@ -479,23 +484,23 @@ export default {
       })
       })
       this.isSave = false
       this.isSave = false
       this.changeDeviceList = this.deviceList
       this.changeDeviceList = this.deviceList
-      this.$alert('自动分配已完成,全级别设备需手动分配,分配完成后请点击【保存】!', '提示', {
-        confirmButtonText: '确定',
+      this.$alert(this.$t('deviceManage.assignmentMsg4'), this.$t('action.prompt'), {
+        confirmButtonText: this.$t('action.yes'),
         callback: action => {
         callback: action => {
-          console.log('确定')
+          console.log(this.$t('action.yes'))
         }
         }
       })
       })
     },
     },
     // 一键重置
     // 一键重置
     onekeyDel() {
     onekeyDel() {
       const _this = this
       const _this = this
-      this.$confirm('确定要重置所有设备吗?', this.$t('action.tips'), {
+      this.$confirm(this.$t('deviceManage.resetMsg'), this.$t('action.tips'), {
         confirmButtonText: this.$t('action.yes'),
         confirmButtonText: this.$t('action.yes'),
         cancelButtonText: this.$t('action.cancel'),
         cancelButtonText: this.$t('action.cancel'),
         type: 'warning'
         type: 'warning'
       }).then(() => {
       }).then(() => {
         delAllDeviceFrame(_this.$route.params.id, _this.$route.params.parent_id).then(res => {
         delAllDeviceFrame(_this.$route.params.id, _this.$route.params.parent_id).then(res => {
-          _this.$message.success('已成功重置!')
+          _this.$message.success(this.$t('deviceManage.resetMsg2'))
           _this.canle()
           _this.canle()
           _this.API_getDeviceList()
           _this.API_getDeviceList()
           _this.API_getFrameAndDevice()
           _this.API_getFrameAndDevice()