zhangyanpeng
2024-08-27 a8961c1d00c17a5aa2658884df9479ed6fba94c3
js/foundation.js
@@ -467,7 +467,15 @@
      var token = "";
      if (Root) {
         token = Root.getToken();
         if (url.indexOf('rootbr/') != -1) {
            token = "0"
            if (url.indexOf("?") > 0) {
               url = url + "&" + "userId=" + token;
            }
            else {
               url = url + "?" + "userId=" + token;
            }
         }
         // if(localStorage.getItem("hdtoken") != token) {
         //    window.top.location.href = config.page_timeout;
         //    return
@@ -855,6 +863,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 +1897,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) {