Jelajahi Sumber

首页多语言

lipenghui 3 hari lalu
induk
melakukan
3882ffc1a5

+ 20 - 0
src/locales/en.ts

@@ -1,4 +1,24 @@
 export default {
+  stat:{
+    deviceCount:'DeviceCount',
+    maintenanceOrder:'MaintenanceOrder',
+    operationNotFilled:'OperationNotFilled',
+    operationFilled:'OperationFilled',
+    notMaintained:'NotMaintained',
+    maintained:'Maintained',
+    notInspected:'NotInspected',
+    inspected:'Inspected',
+    mttr:'MTTR',
+    materialsUnderInventory:'MaterialsUnderInventory',
+    deviceStatus:'DeviceStatus',
+    deviceClassifyTop5:'DeviceClassifyTop5',
+    lastWeekActivity:'Activity Of Last Week',
+    orderCount:'OrderCount',
+    repairOrder:'Repair Order',
+    maintenanceWorkOrder:'MaintenanceWorkOrder',
+    inspectOrder:'Inspect Order',
+    operationRecord:'Operation Record',
+  },
   common: {
     sort:'sort',
     inputText: 'Please input',

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

@@ -1,4 +1,24 @@
 export default {
+  stat:{
+    deviceCount:'设备数',
+    maintenanceOrder:'维修工单',
+    operationNotFilled:'运行未填写',
+    operationFilled:'运行已填写',
+    notMaintained:'未保养',
+    maintained:'已保养',
+    notInspected:'未巡检',
+    inspected:'已巡检',
+    mttr:'MTTR(平均解决时间)',
+    materialsUnderInventory:'库存预警物料数量',
+    deviceStatus:'设备状态统计',
+    deviceClassifyTop5:'设备类别top5',
+    lastWeekActivity:'近一周用户活跃度',
+    orderCount:'工单数量统计',
+    repairOrder:'维修工单',
+    maintenanceWorkOrder:'保养工单',
+    inspectOrder:'巡检工单',
+    operationRecord:'运行记录',
+  },
   common: {
     sort:'排序',
     inputText: '请输入',

+ 15 - 18
src/views/Home/Index.vue

@@ -9,7 +9,7 @@
         icon="fa-solid:project-diagram"
         icon-bg-color="text-blue-500"
         icon-color="bg-blue-100"
-        title="设备数"
+        :title="t('stat.deviceCount')"
       />
     </el-col>
     <el-col :sm="3" :xs="12">
@@ -18,7 +18,7 @@
         icon="fa-solid:list"
         icon-bg-color="text-pink-500"
         icon-color="bg-blue-100"
-        title="维修工单"
+        :title="t('stat.maintenanceOrder')"
       />
     </el-col>
     <el-col :sm="3" :xs="12">
@@ -27,7 +27,7 @@
         icon="fa-solid:times-circle"
         icon-bg-color="text-purple-500"
         icon-color="bg-purple-100"
-        title="运行未填写"
+        :title="t('stat.operationNotFilled')"
       />
     </el-col>
     <el-col :sm="3" :xs="12">
@@ -36,7 +36,7 @@
         icon="fa-solid:award"
         icon-bg-color="text-purple-500"
         icon-color="bg-purple-100"
-        title="运行已填写"
+        :title="t('stat.operationFilled')"
       />
     </el-col>
     <el-col :sm="3" :xs="12">
@@ -45,7 +45,7 @@
         icon="fa-solid:times-circle"
         icon-bg-color="text-green-500"
         icon-color="bg-green-100"
-        title="未执行保养"
+        :title="t('stat.notMaintained')"
       />
     </el-col>
     <el-col :sm="3" :xs="12">
@@ -54,7 +54,7 @@
         icon="fa-solid:award"
         icon-bg-color="text-green-500"
         icon-color="bg-green-100"
-        title="已执行保养"
+        :title="t('stat.maintained')"
       />
     </el-col>
     <el-col :sm="3" :xs="12">
@@ -63,7 +63,7 @@
         icon="fa-solid:times-circle"
         icon-bg-color="text-yellow-500"
         icon-color="bg-yellow-100"
-        title="待填写巡检"
+        :title="t('stat.notInspected')"
       />
     </el-col>
     <el-col :sm="3" :xs="12">
@@ -72,7 +72,7 @@
         icon="fa-solid:award"
         icon-bg-color="text-yellow-500"
         icon-color="bg-yellow-100"
-        title="已填写巡检"
+        :title="t('stat.inspected')"
       />
     </el-col>
     <!-- 其他统计卡片... -->
@@ -154,8 +154,8 @@
       <el-card class="chart-card" shadow="never">
         <template #header>
           <div class="flex items-center justify-between">
-            <span class="text-base font-medium " style="color: #b6c8da">MTTR(平均解决时间)</span>
-            <span class="text-base font-medium " style="color: #b6c8da">库存预警物料数量</span>
+            <span class="text-base font-medium " style="color: #b6c8da">{{t('stat.mttr')}}</span>
+            <span class="text-base font-medium " style="color: #b6c8da">{{t('stat.materialsUnderInventory')}}</span>
           </div>
         </template>
         <div class="flex flex-col h-[250px]">
@@ -181,7 +181,7 @@
       <el-card class="chart-card" shadow="never">
         <template #header>
           <div class="flex items-center">
-            <span class="text-base font-medium " style="color: #b6c8da">设备状态统计</span>
+            <span class="text-base font-medium " style="color: #b6c8da">{{t('stat.deviceStatus')}}</span>
           </div>
         </template>
         <div ref="statusChartRef" class="h-[250px]"></div>
@@ -191,7 +191,7 @@
       <el-card class="chart-card" shadow="never">
         <template #header>
           <div class="flex items-center">
-            <span class="text-base font-medium " style="color: #b6c8da">设备类别TOP5数量</span>
+            <span class="text-base font-medium " style="color: #b6c8da">{{t('stat.deviceClassifyTop5')}}</span>
           </div>
         </template>
         <div ref="topContainer" class="h-[250px]"></div>
@@ -205,7 +205,7 @@
       <el-card class="chart-card" shadow="never">
         <template #header>
           <div class="flex items-center justify-between">
-            <span class="text-base font-medium " style="color: #b6c8da">近一周用户活跃度</span>
+            <span class="text-base font-medium " style="color: #b6c8da">{{t('stat.lastWeekActivity')}}</span>
           </div>
         </template>
         <div ref="activeDom" class="h-[320px]"></div>
@@ -215,7 +215,7 @@
       <el-card class="chart-card" shadow="never">
         <template #header>
           <div class="flex items-center justify-between">
-            <span class="text-base font-medium" style="color: #b6c8da">工单数量情况</span>
+            <span class="text-base font-medium" style="color: #b6c8da">{{t('stat.orderCount')}}</span>
           </div>
         </template>
         <div ref="qxRef" class="h-[320px]"></div>
@@ -278,10 +278,7 @@ const queryParams = reactive({
 const backendData = ref([])
 const statusChartRef = ref() // 设备数量统计的图表
 const deviceMessageCountChartRef = ref() // 上下行消息量统计的图表
-const writeChartRef = ref() // 上下行消息量统计的图表
-const finishedChartRef = ref() // 上下行消息量统计的图表
-const writeTodayChartRef = ref() // 上下行消息量统计的图表
-const finishedTodayChartRef = ref() // 上下行消息量统计的图表
+const { t } = useI18n() // 国际化
 // 基础统计数据
 // TODO @super:初始为 -1,然后界面展示先是加载中?试试用 cursor 改哈
 const statsData = ref<IotStatisticsSummaryRespVO>({

+ 9 - 12
src/views/pms/device/index.vue

@@ -131,32 +131,29 @@
               {{ scope.$index + 1 }}
             </template>
           </el-table-column>
-          <el-table-column :label="t('iotDevice.code')" sortable align="center" prop="deviceCode" />
-          <el-table-column :label="t('iotDevice.name')" sortable align="center" prop="deviceName">
+          <el-table-column :label="t('iotDevice.code')" sortable align="center" prop="deviceCode" min-width="150"/>
+          <el-table-column :label="t('iotDevice.name')" sortable align="center" prop="deviceName" min-width="250">
             <template #default="scope">
               <el-link :underline="false" type="primary" @click="handleDetail(scope.row.id)">
                 {{ scope.row.deviceName }}
               </el-link>
             </template>
-            <!--        <template #default="{ row }">-->
-            <!--          <div class="custom-cell">{{ row.deviceName }}</div>-->
-            <!--        </template>-->
           </el-table-column>
-          <el-table-column :label="t('iotDevice.dept')" align="center" prop="deptName" />
-          <el-table-column :label="t('iotDevice.status')" align="center" prop="deviceStatus">
+          <el-table-column :label="t('iotDevice.dept')" align="center" prop="deptName" min-width="150"/>
+          <el-table-column :label="t('iotDevice.status')" align="center" prop="deviceStatus" min-width="90">
             <template #default="scope">
               <dict-tag :type="DICT_TYPE.PMS_DEVICE_STATUS" :value="scope.row.deviceStatus" />
             </template>
           </el-table-column>
-          <el-table-column :label="t('iotDevice.assets')" align="center" prop="assetProperty">
+          <el-table-column :label="t('iotDevice.assets')" align="center" prop="assetProperty" min-width="110">
             <template #default="scope">
               <dict-tag :type="DICT_TYPE.PMS_ASSET_PROPERTY" :value="scope.row.assetProperty" />
             </template>
           </el-table-column>
-          <el-table-column :label="t('deviceForm.mfg')" align="center" prop="manufacturer" />
-          <el-table-column :label="t('deviceForm.brand')" align="center" prop="brandName" />
-          <el-table-column :label="t('deviceForm.model')" align="center" prop="model" />
-          <el-table-column :label="t('operationFill.operation')" align="center" min-width="120px">
+          <el-table-column :label="t('deviceForm.mfg')" align="center" prop="manufacturer"  min-width="200"/>
+          <el-table-column :label="t('deviceForm.brand')" align="center" prop="brandName" min-width="150"/>
+          <el-table-column :label="t('deviceForm.model')" align="center" prop="model" min-width="170"/>
+          <el-table-column :label="t('operationFill.operation')" align="center" min-width="180px" fixed="right">
             <template #default="scope">
               <el-button
                 link

+ 1 - 1
src/views/pms/failure/index.vue

@@ -149,7 +149,7 @@
             </template>
           </el-table-column>
           <!--        <el-table-column label="故障编码" align="center" prop="failureCode" />-->
-          <el-table-column :label="t('fault.faultTitle')" align="center" prop="failureName" min-width="320"/>
+          <el-table-column :label="t('fault.faultTitle')" align="left" prop="failureName" min-width="350"/>
           <el-table-column :label="t('iotMaintain.deviceCode')" align="center" prop="deviceCode" min-width="220" />
           <el-table-column :label="t('fault.deviceName')" align="center" prop="deviceName" min-width="240"/>
           <el-table-column :label="t('fault.status')" align="center" prop="status" min-width="110">

+ 9 - 33
src/views/pms/maintain/index.vue

@@ -138,10 +138,8 @@
               {{ scope.$index + 1 }}
             </template>
           </el-table-column>
-<!--          <el-table-column label="故障编码" align="center" prop="failureCode" />-->
-<!--          <el-table-column label="故障名称" align="center" prop="failureName" />-->
-          <el-table-column :label="t('iotDevice.code')" align="center" prop="deviceCode" min-width="150" />
-          <el-table-column :label="t('maintain.deviceName')" align="center" prop="deviceName" min-width="185" />
+          <el-table-column :label="t('iotDevice.code')" align="center" prop="deviceCode" min-width="180" />
+          <el-table-column :label="t('maintain.deviceName')" align="center" prop="deviceName" min-width="280" />
           <el-table-column :label="t('maintain.status')" align="center" prop="status" min-width="85" >
             <template #default="scope">
               <dict-tag :type="DICT_TYPE.PMS_MAIN_STATUS" :value="scope.row.status" />
@@ -172,35 +170,13 @@
                     />
           <el-table-column :label="t('maintain.dept')" align="center" prop="deptName" min-width="135"/>
           <el-table-column :label="t('inspect.createName')" align="center" prop="createName" min-width="130"/>
-<!--          <el-table-column-->
-<!--            :label="t('iotMaintain.startTime')"-->
-<!--            align="center"-->
-<!--            prop="maintainStartTime"-->
-<!--            :formatter="dateFormatter"-->
-<!--            width="180px"-->
-<!--          />-->
-<!--          <el-table-column-->
-<!--            :label="t('maintain.failureTime')"-->
-<!--            align="center"-->
-<!--            prop="failureTime"-->
-<!--            :formatter="dateFormatter"-->
-<!--            width="180px"-->
-<!--          />-->
-<!--          <el-table-column-->
-<!--            label="维修结束时间"-->
-<!--            align="center"-->
-<!--            prop="maintainEndTime"-->
-<!--            :formatter="dateFormatter"-->
-<!--            width="180px"-->
-<!--          />-->
-<!--          <el-table-column label="备注" align="center" prop="remark" />-->
-<!--          <el-table-column-->
-<!--            label="创建时间"-->
-<!--            align="center"-->
-<!--            prop="createTime"-->
-<!--            :formatter="dateFormatter"-->
-<!--            width="180px"-->
-<!--          />-->
+          <el-table-column
+            label="创建时间"
+            align="center"
+            prop="createTime"
+            :formatter="dateFormatter"
+            width="180px"
+          />
           <el-table-column :label="t('maintain.operation')" align="center" min-width="170" fixed="right">
             <template #default="scope">
               <el-button