Browse Source

增加科室的时区和语言选择

vothin 4 months ago
parent
commit
b735de15ec

+ 3 - 1
languages/en.js

@@ -1639,7 +1639,9 @@ module.exports = {
     inputContainerName: 'Please enter a container name',
     inputFileAddress: 'Please enter a file storage address',
     inputMysqlAddress: 'Please enter the address of the MySQL server',
-    deleteSqlMsg: 'The data is not recoverable after the deletion operation, are you sure you want to delete this data?'
+    deleteSqlMsg: 'The data is not recoverable after the deletion operation, are you sure you want to delete this data?',
+    choiceTimeZone: 'Select Time Zone',
+    choiceLanguage: 'Select language'
   },
   wu20240322: {
     fileManager: 'File manager'

+ 3 - 1
languages/es.js

@@ -1639,7 +1639,9 @@ module.exports = {
     inputContainerName: 'Introduzca un nombre de contenedor',
     inputFileAddress: 'Introduzca una dirección de almacenamiento de archivos',
     inputMysqlAddress: 'Introduzca la dirección del servidor MySQL',
-    deleteSqlMsg: 'Los datos no se pueden recuperar después de la operación de eliminación, ¿está seguro de que desea eliminar estos datos?'
+    deleteSqlMsg: 'Los datos no se pueden recuperar después de la operación de eliminación, ¿está seguro de que desea eliminar estos datos?',
+    choiceTimeZone: 'Elegir zona horaria',
+    choiceLanguage: 'Elegir idioma'
   },
   wu20240322: {
     fileManager: 'Administrador de Archivos'

+ 3 - 1
languages/ru-RU.js

@@ -1639,7 +1639,9 @@ module.exports = {
     inputContainerName: 'Пожалуйста, введите имя контейнера',
     inputFileAddress: 'Пожалуйста, введите адрес хранения файлов',
     inputMysqlAddress: 'Пожалуйста, введите адрес сервера MySQL',
-    deleteSqlMsg: 'Данные не подлежат восстановлению после операции удаления, вы уверены, что хотите удалить эти данные?'
+    deleteSqlMsg: 'Данные не подлежат восстановлению после операции удаления, вы уверены, что хотите удалить эти данные?',
+    choiceTimeZone: 'Выберите часовой пояс',
+    choiceLanguage: 'Выбор языка'
   },
   wu20240322: {
     fileManager: 'Файловый Менеджер'

+ 3 - 1
languages/zh-CN.js

@@ -1639,7 +1639,9 @@ module.exports = {
     inputContainerName: '请输入容器名称',
     inputFileAddress: '请输入文件存储地址',
     inputMysqlAddress: '请输入mysql服务器地址',
-    deleteSqlMsg: '删除操作后数据不可复原,您确定要删除此数据?'
+    deleteSqlMsg: '删除操作后数据不可复原,您确定要删除此数据?',
+    choiceTimeZone: '选择时区',
+    choiceLanguage: '选择语言'
   },
   wu20240322: {
     fileManager: '文件管理器'

+ 10 - 0
src/utils/enum/Language.js

@@ -0,0 +1,10 @@
+import createEnum from '@/utils/enum/createEnum'
+
+export const LANGUAGE_TYPE = createEnum(
+  {
+    CN: ['cn', '中文简体'],
+    EN: ['en', 'English'],
+    ES: ['es', 'Español'],
+    RU: ['ru', 'Русский']
+  }
+)

+ 32 - 0
src/utils/enum/TimeZoneTypeEnum.js

@@ -0,0 +1,32 @@
+import createEnum from '@/utils/enum/createEnum'
+
+export const TIME_ZONE_TYPE = createEnum(
+  {
+    UTC0: ['Africa/Lome', 'UTC+0'],
+    UTC1: ['Africa/Luanda', 'UTC+1'],
+    UTC2: ['Africa/Kigali', 'UTC+2'],
+    UTC3: ['Europe/Moscow', 'UTC+3'],
+    UTC4: ['Europe/Astrakhan', 'UTC+4'],
+    UTC5: ['Asia/Karachi', 'UTC+5'],
+    UTC6: ['Asia/Dhaka', 'UTC+6'],
+    UTC7: ['Asia/Ho_Chi_Minh', 'UTC+7'],
+    UTC8: ['Asia/Shanghai', 'UTC+8'],
+    UTC9: ['Asia/Seoul', 'UTC+9'],
+    UTC10: ['Asia/Ust-Nera', 'UTC+10'],
+    UTC11: ['Asia/Magadan', 'UTC+11'],
+    UTC12: ['Asia/Anadyr', 'UTC+12'],
+    UTC13: ['Pacific/Apia', 'UTC+13'],
+    UTC14: ['Pacific/Kiritimati', 'UTC+14'],
+    UTC_1: ['Atlantic/Cape_Verde', 'UTC-1'],
+    UTC_2: ['America/Noronha', 'UTC-2'],
+    UTC_3: ['America/Sao_Paulo', 'UTC-3'],
+    UTC_4: ['America/Montserrat', 'UTC-4'],
+    UTC_5: ['America/Bogota', 'UTC-5'],
+    UTC_6: ['America/Merida', 'UTC-6'],
+    UTC_7: ['America/Creston', 'UTC-7'],
+    UTC_8: ['Pacific/Pitcairn', 'UTC-8'],
+    UTC_9: ['Pacific/Gambier', 'UTC-9'],
+    UTC_10: ['Pacific/Honolulu', 'UTC-10'],
+    UTC_11: ['Pacific/Midway', 'UTC-11']
+  }
+)

+ 35 - 12
src/views/ncs-orginazition/components/partInfoEdit.vue

@@ -843,20 +843,39 @@
             </el-col>
 
             <el-col :span="8" v-if="isShow">
-              <el-form-item :label="this.$t('action.excelUpload')">
-                <el-upload
-                    class="excel-uploader"
-                    :action="`${excelUploadUrl}`"
-                    :show-file-list="false"
-                    :on-success="excelUploaded"
-                    :before-upload="handleExcelBefore"
-                    :limit="1"
-                >
-                  <el-button size="small" type="primary">{{ this.$t('action.uploadFile') }}</el-button>
-                </el-upload>
-                <el-link :href="excelUploadDemo" type="primary" target="_blank" icon="el-icon-download" :underline="false">excel表格模板</el-link>
+              <el-form-item :label="this.$t('zy20240205.choiceTimeZone')" prop="time_zone">
+                <el-select v-model="formmodel.time_zone"
+                           :placeholder="this.$t('zy20240205.choiceTimeZone')"
+                           filterable clearable>
+                  <el-option v-for="(item,index) in timeZoneType" :key="index" :label="item.key" :value="item.value" />
+                </el-select>
               </el-form-item>
             </el-col>
+
+            <el-col :span="8" v-if="isShow">
+              <el-form-item :label="this.$t('zy20240205.choiceLanguage')" prop="language">
+                <el-select v-model="formmodel.language"
+                           :placeholder="this.$t('zy20240205.choiceLanguage')"
+                           filterable clearable>
+                  <el-option v-for="(item,index) in languageType" :key="index" :label="item.key" :value="item.value" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+
+<!--              <el-form-item :label="this.$t('action.excelUpload')">-->
+<!--                <el-upload-->
+<!--                    class="excel-uploader"-->
+<!--                    :action="`${excelUploadUrl}`"-->
+<!--                    :show-file-list="false"-->
+<!--                    :on-success="excelUploaded"-->
+<!--                    :before-upload="handleExcelBefore"-->
+<!--                    :limit="1"-->
+<!--                >-->
+<!--                  <el-button size="small" type="primary">{{ this.$t('action.uploadFile') }}</el-button>-->
+<!--                </el-upload>-->
+<!--                <el-link :href="excelUploadDemo" type="primary" target="_blank" icon="el-icon-download" :underline="false">excel表格模板</el-link>-->
+<!--              </el-form-item>-->
+            </el-col>
           </el-row>
         </fieldset>
 
@@ -887,6 +906,8 @@ import {SERIAL_TYPE} from "@/utils/enum/SerialTypeEnum";
 import {SERIAL_KEY_TYPE} from "@/utils/enum/SerialKeyTypeEnum";
 import {DEVICE_BUTTON_TYPE} from "@/utils/enum/DeviceButtonTypeEnum";
 import * as API_event from "@/api/ncs_event";
+import {TIME_ZONE_TYPE} from "@/utils/enum/TimeZoneTypeEnum";
+import {LANGUAGE_TYPE} from "@/utils/enum/Language";
 
 const serverUrl = domain.serverUrl
 const DeviceUrl = domain.DeviceUrl
@@ -924,6 +945,8 @@ export default {
       excelUploadUrl: DeviceUrl + '/ncs/excel/upload/' + this.partId,
       excelUploadDemo: serverUrl + '/upload/excel/demo/excel_demo.xlsx',
       serialType: SERIAL_TYPE.getKeyValueList(),
+      timeZoneType: TIME_ZONE_TYPE.getKeyValueList(),
+      languageType: LANGUAGE_TYPE.getKeyValueList(),
       deviceButtonFunctionStr: this.$t('zy20240611.deviceButtonFunctionStr'),
       selectKey: this.$t('zy20240611.selectKey'),
       selectTcpType: this.$t('action.choiceType'),