NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
| 属性 | 说明 |
|---|---|
| 脚本名称 | ERP图片放大显示 |
| 作者 | yiwaima |
| 版本 | 3.2 |
| 许可证 | MIT |
| 适用网站 | https://www.erp321.com/, https://ww.erp321.com/ |
| 脚本类型 | Tampermonkey 用户脚本 |
| OpenUserJS地址 | https://openuserjs.org/scripts/yiwaima/ERP图片放大显示 |
| 支持URL | https://github.com/yiwaima/erp-image-zoom-display/issues |
| 应用图标 | https://src.erp321.com/epaas-container/static/enterprise_icon.91c92482.png |
该脚本是一个为ERP系统设计的图片放大显示工具,主要功能包括:
__CALLBACKPARAM且Method为CheckQty或LoadDataToJSON的请求XMLHttpRequest和fetch请求localStorage持久化存储位置和尺寸信息// 重写XMLHttpRequest的send方法
XMLHttpRequest.prototype.send = function(data) {
// 监控相关请求...
// 调用原始send方法
originalXHRSend.call(xhr, data);
};
// 重写window.fetch函数
window.fetch = async function(url, options) {
// 监控相关请求...
// 发送原始请求
const response = await originalFetch.call(this, url, options);
// 处理响应...
return response;
};
function createImageDisplay() {
const display = document.createElement('div');
// 设置样式和初始位置
// 添加拖动功能
// 添加提示信息容器
// 添加图片元素
document.body.appendChild(display);
return display;
}
// 保存位置
function saveDisplayPosition(top, right) {
const baseUrl = getBaseUrl();
const positions = JSON.parse(localStorage.getItem('erpImageDisplayPositions') || '{}');
positions[baseUrl] = { top, right };
localStorage.setItem('erpImageDisplayPositions', JSON.stringify(positions));
}
// 加载位置
function loadDisplayPosition() {
const baseUrl = getBaseUrl();
const positions = JSON.parse(localStorage.getItem('erpImageDisplayPositions') || '{}');
return positions[baseUrl] || null;
}
// 递归查找图片URL
function findFirstImageUrl(obj) {
// 递归遍历对象、数组或字符串
// 使用正则表达式查找URL
// 返回第一个找到的URL
}
// 提取产品信息
function extractProductInfo(obj) {
// 递归查找name和taxAfterPrice字段
// 返回产品信息对象
}
版本 3.2:
版本 3.1:
版本 3.0:
版本 2.5:
版本 2.0:
版本 1.0:
├── 基本信息与元数据
├── 图片放大框创建与拖动功能
├── 位置记忆功能
├── 响应解析与图片提取
├── 请求监控实现
└── 初始化与日志
该脚本使用MIT许可证,详见脚本头部的许可证声明。
如果您在使用过程中遇到问题,或者有任何建议,可以通过以下方式反馈:
欢迎提交Pull Request来改进这个脚本!
感谢所有使用和支持这个脚本的用户!
Rating: 10