wujingjing
2024-11-05 346b6f8d306aba92d45ac7ce6ee31be3d38662ad
src/components/chat/chatComponents/summaryCom/components/recordSetTable/RecordSetTable.vue
@@ -220,24 +220,27 @@
};
// 统计表格,需要增加累计值行,以及比例列
const tableValues = ref(getTableValues(props.data));
const storeCols = (colList: any[]) => {
   const key = colList.map((item) => item.label).join(',');
   if (!key) return;
   Local.set(key, colList);
};
const colList = ref([]);
const storeCols = (originCols: any[]) => {
   let isStored = false;
   if (originCols.length === 0) return [isStored, originCols];
   const key = originCols.map((item) => item.title).join(',');
   if (!key) return [isStored, originCols];
const getStoreCols = (colList: any[]) => {
   if (colList.length === 0) return colList;
   const key = colList.map((item) => item.label).join(',');
   if (!key) return colList;
   const storeValue = Local.get(key);
   if (!storeValue) {
      Local.set(key, originCols);
      return colList;
   } else {
      return storeValue;
   }
   return [!!storeValue, storeValue];
};
watchEffect(() => {
   colList.value =
   const originData =
      tableCols.value?.map((item, index) => {
         let isShow = true;
         if (props.data.max_cols != null) {
@@ -252,6 +255,9 @@
            isShow: isShow,
         } as TableCol;
      }) ?? [];
   const storeCols = getStoreCols(originData);
   colList.value = storeCols;
});
// 所有显示的 prop
@@ -556,6 +562,7 @@
const colFilterChange = () => {
   // 重新计算宽度
   reloadTable();
   storeCols(colList.value);
};
const tableHeight = ref(0.7 * document.body.clientHeight);