Procházet zdrojové kódy

refactor(equipLedger): remove redundant formatInstallationLocation function

replace the custom formatting function with inline template rendering for installation location display directly
huoyi před 1 měsícem
rodič
revize
575c914201
1 změnil soubory, kde provedl 2 přidání a 8 odebrání
  1. 2 8
      src/views/equipManage/equipLedger/index.vue

+ 2 - 8
src/views/equipManage/equipLedger/index.vue

@@ -57,7 +57,7 @@
57
         show-overflow-tooltip />
57
         show-overflow-tooltip />
58
       <el-table-column label="安装位置" prop="installationLocation" align="center" min-width="180" show-overflow-tooltip>
58
       <el-table-column label="安装位置" prop="installationLocation" align="center" min-width="180" show-overflow-tooltip>
59
         <template #default="scope">
59
         <template #default="scope">
60
-          {{ formatInstallationLocation(scope.row.installationLocation) }}
60
+          <span>{{ scope.row.terminlName }}{{scope.row.terminlName?'/':''}}{{ scope.row.regionalName }}{{scope.row.regionalName?'/':''}}{{ scope.row.channelName }}</span>
61
         </template>
61
         </template>
62
       </el-table-column>
62
       </el-table-column>
63
       <el-table-column label="使用状态" prop="usageStatus" align="center" min-width="100">
63
       <el-table-column label="使用状态" prop="usageStatus" align="center" min-width="100">
@@ -467,13 +467,7 @@ function handleDelete(row) {
467
   }).catch(() => { })
467
   }).catch(() => { })
468
 }
468
 }
469
 
469
 
470
-function formatInstallationLocation(location) {
471
-  if (!location) return ''
472
-  if (typeof location === 'object') {
473
-    return `${location.terminlName || ''}/${location.regionalName || ''}/${location.channelName || ''}`
474
-  }
475
-  return location
476
-}
470
+
477
 
471
 
478
 function handleBatchDelete() {
472
 function handleBatchDelete() {
479
   proxy.$modal.confirm('是否确认删除选中的设备?').then(function () {
473
   proxy.$modal.confirm('是否确认删除选中的设备?').then(function () {