zhangyanpeng
2024-08-03 d8e78fa8610d65f6bfa23e0dd7070672f41ba3e4
js/foundation.js
@@ -855,6 +855,9 @@
      itemMap.formatter_percent = formatter_percent;
      itemMap.formatter_split = formatter_split;
      itemMap.formatter_password = formatter_password;
      itemMap.formatter_replace = formatter_replace;
      itemMap.formatter_replace = formatter_replace;
      itemMap.formatter_replace_val = formatter_replace_val;
      
      
      itemMap.prefixorunit = formatter_prefixorunit;
@@ -1886,6 +1889,25 @@
   }
   return cellValue;
};
// //拼接的字段格式 format = "#{name}-{name}%"
function formatter_replace(row, column, cellValue, index, format) {
   // 未完成
   // if (cellValue) {
   //    return toPercent(cellValue, digit);
   // }
   return cellValue;
};
// 替换
function formatter_replace(row, column, cellValue, index, replacefield) {
   return row[replacefield];
};
// 有值替换 cellValue 有值才替换
function formatter_replace_val(row, column, cellValue, index, replacefield) {
   if (cellValue) {
      return row[replacefield]
   }
   return cellValue;
};
////////////////非通用的格式化////////////////
function formatter_earlyWarning(row, column, cellValue, index) {