Przeglądaj źródła

提交相关代码

Lijy 1 miesiąc temu
rodzic
commit
b4487942c0

+ 15 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/biReport/dragEdit/previewTable.vue

@@ -7,6 +7,7 @@ import type { TableColumnCtx, SummaryMethod  } from 'element-plus'
 import rangeFilter from "./rangeFilter.vue";
 import { rangeGetSql } from '../function';
 import { formatDate } from '@/utils/times';
+import { dropdownBoxFieldIntegration } from "../list"
 
 const rangeFilterRef = ref<InstanceType<typeof rangeFilter> | null>(null);
 
@@ -79,6 +80,18 @@ function mergeColumns({ row, rowIndex, columnIndex }: { row: any, rowIndex: numb
   return { rowspan, colspan: 1 };
 }
 
+// 渲染固定数据
+function renderingLabel(row: any, item: any) {
+  const { filed } = item
+  const list = dropdownBoxFieldIntegration.filter(em => `${em.indicate}_${em.fieldName}` == filed)
+  if(list.length) {
+    const childList = list[0].list
+    return childList.find((dd: any) => dd.value == row[item.label])?.label
+  } else {
+    return row[item.label]
+  }
+}
+
 function determinationOfDataRange() {
   const rangeFilterData = rangeFilterRef.value?.getRangeData()
   const rangeSQL = rangeGetSql(rangeFilterData, addEditData)
@@ -156,7 +169,8 @@ onMounted(() => { })
               {{ scope.row[item.label] ? formatDate(new Date(scope.row[item.label])) : '' }}
             </template>
             <template v-else>
-              {{ scope.row[item.label] }}
+              <!-- {{ scope.row[item.label] }} -->
+              {{ renderingLabel(scope.row, item) }}
             </template>
           </template>
         </el-table-column>