Ver código fonte

瑞都看板多语言

yanghao 1 semana atrás
pai
commit
8c6c8bacf8

+ 13 - 0
src/locales/en.ts

@@ -180,6 +180,19 @@ export default {
     'rdkb1vue290085-18': 'Percentage of original value',
     'rdkb1vue290085-19': 'Distribution and value of equipment in Iraq (USD)',
     'rdkb1vue290085-20': 'Distribution and value of equipment in Libya (Dinars)',
+    'rdkb1vue290085-21': 'Home',
+    'rdkb1vue290085-22': 'DPR',
+    'rdkb1vue290085-23': 'Fracturing layers',
+    'rdkb1vue290085-24': 'Total wells',
+    'rdkb1vue290085-25': 'Devices',
+    'rdkb1vue290085-26': 'Repair Work Orders',
+    'rdkb1vue290085-27': 'Not filled in',
+    'rdkb1vue290085-28': 'To be inspected‌',
+    'rdkb1vue290085-29': 'Pending for maintenance',
+    'rdkb1vue290085-30': 'RUI DU',
+    'rdkb1vue290085-31': 'Device status',
+    'rdkb1vue290085-32': 'Usage status',
+
     'assetvalue502656-0': 'ASSET VALUE',
     'devicelist400115-0': 'Project Department Statistics',
     'devicelist400115-1': 'Select date',

+ 13 - 0
src/locales/zh-CN.ts

@@ -180,6 +180,19 @@ export default {
     'rdkb1vue290085-18': '原值占比',
     'rdkb1vue290085-19': '伊拉克设备分布及价值(美元)',
     'rdkb1vue290085-20': '利比亚设备分布及价值(第纳尔)',
+    'rdkb1vue290085-21': '看板首页',
+    'rdkb1vue290085-22': '生产日报',
+    'rdkb1vue290085-23': '压裂层数',
+    'rdkb1vue290085-24': '总井数',
+    'rdkb1vue290085-25': '设备总数',
+    'rdkb1vue290085-26': '维修工单',
+    'rdkb1vue290085-27': '运行未填写',
+    'rdkb1vue290085-28': '待巡检',
+    'rdkb1vue290085-29': '待保养',
+    'rdkb1vue290085-30': '瑞都',
+    'rdkb1vue290085-31': '设备状态',
+    'rdkb1vue290085-32': '设备使用状态',
+
     'assetvalue502656-0': '资产价值',
     'devicelist400115-0': '项目部统计',
     'devicelist400115-1': '选择日期',

+ 5 - 5
src/views/pms/map/Map.vue

@@ -109,11 +109,11 @@ const markerThemeMap: Record<'online' | 'offline', MarkerTheme> = {
   }
 }
 
-const statusOptions = [
-  { label: '全部', value: 'all' },
-  { label: '在线', value: 'online' },
-  { label: '离线', value: 'offline' }
-] as const
+const statusOptions = computed(() => [
+  { label: t('map.mapvue383073-22'), value: 'all' },
+  { label: t('map.mapvue383073-23'), value: 'online' },
+  { label: t('map.mapvue383073-24'), value: 'offline' }
+])
 
 const totalCount = computed(() => devices.value.length)
 const onlineCount = computed(() => devices.value.filter((item) => isOnline(item)).length)

+ 7 - 5
src/views/pms/stat/rdkb.vue

@@ -11,18 +11,20 @@ import rdStatusSwitch from './rdkb/rd-status-switch.vue'
 import rdSafeDay from './rdkb/rd-safe-day.vue'
 import rdDeviceCategory from './rdkb/rd-device-category.vue'
 import rdProductionBriefs from './rdkb/rdProductionBriefs.vue'
+import { useI18n } from 'vue-i18n'
+const { t } = useI18n()
 
 defineOptions({
   name: 'IotRdStatt'
 })
 
-const company = ref('瑞都')
+const company = ref(t('stat.rdkb1vue290085-30'))
 const activePage = ref<'home' | 'production'>('home')
 
-const pageTabs = [
-  { label: '看板首页', value: 'home' },
-  { label: '生产日报', value: 'production' }
-] as const
+const pageTabs = computed(() => [
+  { label: t('stat.rdkb1vue290085-21'), value: 'home' },
+  { label: t('stat.rdkb1vue290085-22'), value: 'production' }
+])
 
 const wrapperRef = ref<HTMLDivElement>()
 const scale = ref(1)

+ 9 - 5
src/views/pms/stat/rdkb/rd-status-switch.vue

@@ -6,12 +6,16 @@ type ActiveStatus = 'device' | 'use'
 
 const activeStatus = ref<ActiveStatus>('device')
 
-const statusOptions: Array<{ label: string; value: ActiveStatus }> = [
-  { label: '设备状态', value: 'device' },
-  { label: '设备使用状态', value: 'use' }
-]
+const { t } = useI18n()
 
-const activeTitle = computed(() => (activeStatus.value === 'device' ? '设备状态' : '设备使用状态'))
+const statusOptions: Array<{ label: string; value: ActiveStatus }> = computed(() => [
+  { label: t('stat.rdkb1vue290085-31'), value: 'device' },
+  { label: t('stat.rdkb1vue290085-32'), value: 'use' }
+])
+
+const activeTitle = computed(() =>
+  activeStatus.value === 'device' ? t('stat.rdkb1vue290085-31') : t('stat.rdkb1vue290085-32')
+)
 
 watch(activeStatus, () => {
   nextTick(() => window.dispatchEvent(new Event('rdkb:resize')))

+ 13 - 12
src/views/pms/stat/rdkb/rdsummary.vue

@@ -17,38 +17,38 @@ type CardKey =
 
 type CardConfig = SummaryCardConfig<CardKey>
 
-const cardConfigs: CardConfig[] = [
+const cardConfigs: CardConfig[] = computed(() => [
   {
     key: 'layers',
-    title: '压裂层数',
+    title: t('stat.rdkb1vue290085-23'),
     icon: 'i-solar:clipboard-remove-linear',
     accent: THEME.color.orange.strong,
     glow: THEME.color.orange.glow
   },
   {
     key: 'wells',
-    title: '总井数',
+    title: t('stat.rdkb1vue290085-24'),
     icon: 'i-solar:clipboard-remove-linear',
     accent: THEME.color.orange.strong,
     glow: THEME.color.orange.glow
   },
   {
     key: 'device',
-    title: '设备数',
+    title: t('stat.rdkb1vue290085-25'),
     icon: 'i-material-symbols:device-hub-rounded',
     accent: THEME.color.blue.strong,
     glow: THEME.color.blue.glow
   },
   {
     key: 'maintain',
-    title: '维修工单',
+    title: t('stat.rdkb1vue290085-26'),
     icon: 'i-material-symbols:home-repair-service',
     accent: THEME.color.orange.strong,
     glow: THEME.color.orange.glow
   },
   {
     key: 'unfilledCount',
-    title: '运行未填写',
+    title: t('stat.operationNotFilled'),
     icon: 'i-solar:clipboard-remove-linear',
     accent: THEME.color.orange.strong,
     glow: THEME.color.orange.glow
@@ -56,19 +56,19 @@ const cardConfigs: CardConfig[] = [
 
   {
     key: 'bytodo',
-    title: '待巡检',
+    title: t('stat.rdkb1vue290085-28'),
     icon: 'i-solar:shield-warning-linear',
     accent: THEME.color.orange.strong,
     glow: THEME.color.orange.glow
   },
   {
     key: 'inspectttodo',
-    title: '待保养',
+    title: t('stat.rdkb1vue290085-29'),
     icon: 'i-solar:map-point-search-linear',
     accent: THEME.color.orange.strong,
     glow: THEME.color.orange.glow
   }
-]
+])
 
 function createDefaultCardState(): Record<CardKey, CardStateItem> {
   return {
@@ -86,7 +86,7 @@ function createDefaultCardState(): Record<CardKey, CardStateItem> {
 const cardState = reactive<Record<CardKey, CardStateItem>>(createDefaultCardState())
 
 const summaryCards = computed(() =>
-  cardConfigs.map((card) => ({
+  cardConfigs.value.map((card) => ({
     ...card,
     value: cardState[card.key].value,
     loading: cardState[card.key].loading
@@ -267,8 +267,9 @@ onMounted(() => {
     <div class="panel-title summary-panel__title">
       <div class="icon-decorator">
         <span></span>
-        <span></span>
-      </div>{{ t('stat.rdsummaryv637921-0') }}</div>
+        <span></span> </div
+      >{{ t('stat.rdsummaryv637921-0') }}</div
+    >
 
     <div class="summary-panel__grid grid grid-cols-7 flex-1">
       <article