hwh
2024-06-12 cae008d8286b7ee846eb91e79350a9c57166882d
HTML_09/js/public.js
@@ -264,4 +264,39 @@
      });
    });
  }  
}
//深拷贝
function deepClone(source) {
  if (typeof source !== 'object' || source == null) {
    return source;
  }
  const target = Array.isArray(source) ? [] : {};
  for (const key in source) {
    if (Object.prototype.hasOwnProperty.call(source, key)) {
      if (typeof source[key] === 'object' && source[key] !== null) {
        target[key] = deepClone(source[key]);
      } else {
        target[key] = source[key];
      }
    }
  }
  return target;
}
//调用打印
function openPrintDialog(printData, printType){
  layer.open({
    type: 2,
    title: '打印',
    // content: '../../js/hiprint/custom.html',
    content: '/views/SystemSettings/PrintModule.html',
    maxmin: true,
    area: ['100%', '100%'],
    data: printData,
    success: function (layero, index) {
      var body = layer.getChildFrame('body',index);
      body.find('#printData').val(JSON.stringify(printData));
      body.find('#printType').val(printType);
    }
  });
}