update 1.0.10
This commit is contained in:
parent
8950b56476
commit
86203f9b4f
@ -1,3 +1,9 @@
|
||||
# 1.0.10
|
||||
|
||||
1. 查看库存界面新增右键菜单,支持快速跳转到立创商城、查看数据手册等功能
|
||||
2. 在不支持放置器件的页面放置器件新增提示信息
|
||||
3. 修改 README 文档
|
||||
|
||||
# 1.0.9
|
||||
|
||||
1. 修复全在线客户端无法获取器件数据的问题
|
||||
|
||||
13
README.md
13
README.md
@ -10,7 +10,7 @@ LEYE 电子元器件库存管理系统 EDA 联动扩展
|
||||
|
||||
本扩展允许用户通过立创商城 C 编号、立创商城订单导入元器件,支持从库存内查询、放置器件,支持通过 BOM 批量出库。
|
||||
|
||||
使用本扩展需要在本地安装 [LEYE Service 服务端](https://lrurl.top/LeyeService)(目前仅提供 Windows 版,[服务端开源](/backend/server.js)),数据均储存在本地,不会上传。
|
||||
使用本扩展需要在本地安装 [LEYE Service 服务端](https://lrurl.top/LeyeService)(目前仅提供 Windows 版,[服务端开源](https://gitea.miri.site/Mr_Fang/eext-leye/src/branch/master/backend/server.js)),数据均储存在本地,不会上传。
|
||||
|
||||
## [介绍视频](https://www.bilibili.com/video/BV1nvcFzpEuP/)
|
||||
|
||||
@ -64,10 +64,13 @@ V2.2 用户菜单栏将直接出现“LEYE”选项;V3 用户若未开启“
|
||||
|
||||
## 配置项说明
|
||||
|
||||
| 配置项 | 说明 | 默认值 |
|
||||
| :------------- | :----------------------------------------------------------------------- | :----------------------- |
|
||||
| 服务器地址 | LEYE Service 服务器地址 | `http://localhost:21816` |
|
||||
| 允许拉起服务端 | 允许通过 [`leye://open`](leye://open) 拉起本地安装的 LEYE Service 服务端 | `true` |
|
||||
| 配置项 | 说明 | 默认值 |
|
||||
| :--------------- | :----------------------------------------------------------------------- | :----------------------- |
|
||||
| 服务器地址 | LEYE Service 服务器地址 | `http://localhost:21816` |
|
||||
| 允许拉起服务端 | 允许通过 [`leye://open`](leye://open) 拉起本地安装的 LEYE Service 服务端 | `true` |
|
||||
| 出库自动填充 BOM | 打开出库界面自动读取 BOM 并填充 | `false` |
|
||||
| | | |
|
||||
| 自动检查更新 | 允许在启动 EDA 时检查更新 | `true` |
|
||||
|
||||
## 已知问题
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
"uuid": "944f7c94a8ca485e848f1118effcbb9a",
|
||||
"displayName": "LEYE",
|
||||
"description": "LEYE 电子元器件库存管理系统 EDA 联动扩展",
|
||||
"version": "1.0.9",
|
||||
"version": "1.0.10",
|
||||
"publisher": "Mr_Fang",
|
||||
"engines": {
|
||||
"eda": "^3.2.80"
|
||||
|
||||
@ -651,6 +651,10 @@ video {
|
||||
z-index: 50;
|
||||
}
|
||||
|
||||
.z-\[100\] {
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.order-1 {
|
||||
order: 1;
|
||||
}
|
||||
@ -688,6 +692,11 @@ video {
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.my-1 {
|
||||
margin-top: 0.25rem;
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
.mb-1 {
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
@ -983,6 +992,10 @@ video {
|
||||
scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
||||
}
|
||||
|
||||
.cursor-not-allowed {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.cursor-pointer {
|
||||
cursor: pointer;
|
||||
}
|
||||
@ -1585,6 +1598,11 @@ video {
|
||||
color: rgb(30 64 175 / var(--tw-text-opacity, 1));
|
||||
}
|
||||
|
||||
.text-gray-300 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(209 213 219 / var(--tw-text-opacity, 1));
|
||||
}
|
||||
|
||||
.text-gray-400 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(156 163 175 / var(--tw-text-opacity, 1));
|
||||
|
||||
@ -195,6 +195,29 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
id="context-menu"
|
||||
class="hidden fixed bg-white border border-gray-200 shadow-xl rounded-md py-1 z-[100] w-40 text-xs text-gray-700 shadow-2xl"
|
||||
>
|
||||
<div id="cm-view-info" class="px-3 py-2 text-gray-300 cursor-not-allowed flex items-center">
|
||||
<span>查看详情</span>
|
||||
</div>
|
||||
<div id="cm-view-product" class="px-3 py-2 hover:bg-blue-50 hover:text-blue-600 cursor-pointer flex items-center">
|
||||
<span>查看产品链接</span>
|
||||
</div>
|
||||
<div id="cm-view-datasheet" class="px-3 py-2 hover:bg-blue-50 hover:text-blue-600 cursor-pointer flex items-center">
|
||||
<span>查看数据手册</span>
|
||||
</div>
|
||||
<div class="border-t border-gray-100 my-1"></div>
|
||||
<div id="cm-add-lcsc-car" class="px-3 py-2 text-gray-300 cursor-not-allowed flex items-center">
|
||||
<span>立创商城加购</span>
|
||||
</div>
|
||||
<div class="border-t border-gray-100 my-1"></div>
|
||||
<div id="cm-edit" class="px-3 py-2 hover:bg-blue-50 hover:text-blue-600 cursor-pointer flex items-center">
|
||||
<span>编辑</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
@ -220,6 +243,11 @@
|
||||
const editNameInput = document.getElementById('edit-name-input');
|
||||
const editLcscInput = document.getElementById('edit-lcsc-input');
|
||||
const dialogIdDisplay = document.getElementById('dialog-id-display');
|
||||
const contextMenu = document.getElementById('context-menu');
|
||||
const cmViewProduct = document.getElementById('cm-view-product');
|
||||
const cmViewDatasheet = document.getElementById('cm-view-datasheet');
|
||||
const cmAddLcscCarDatasheet = document.getElementById('cm-add-lcsc-car');
|
||||
const cmEdit = document.getElementById('cm-edit');
|
||||
|
||||
const SERVER = eda.sys_Storage.getExtensionUserConfig('server-host') ?? 'http://localhost:21816/api';
|
||||
const AUTO_RUN = eda.sys_Storage.getExtensionUserConfig('server-auto-run') ?? true;
|
||||
@ -554,8 +582,34 @@
|
||||
}
|
||||
};
|
||||
|
||||
tableBody.oncontextmenu = (e) => {
|
||||
const row = e.target.closest('tr');
|
||||
if (row && row.dataset.row) {
|
||||
e.preventDefault();
|
||||
|
||||
selectRow(row);
|
||||
|
||||
contextMenu.classList.remove('hidden');
|
||||
|
||||
let x = e.clientX;
|
||||
let y = e.clientY;
|
||||
const menuWidth = 160;
|
||||
const menuHeight = 110;
|
||||
|
||||
if (x + menuWidth > window.innerWidth) x -= menuWidth;
|
||||
if (y + menuHeight > window.innerHeight) y -= menuHeight;
|
||||
|
||||
contextMenu.style.left = `${x}px`;
|
||||
contextMenu.style.top = `${y}px`;
|
||||
}
|
||||
};
|
||||
|
||||
placeButton.onclick = async () => {
|
||||
if (!selectedRowData) return;
|
||||
if ((await eda.dmt_SelectControl.getCurrentDocumentInfo()).documentType !== EDMT_EditorDocumentType.SCHEMATIC_PAGE) {
|
||||
eda.sys_Message.showToastMessage('只有原理图页可放置器件', ESYS_ToastMessageType.WARNING);
|
||||
return;
|
||||
}
|
||||
await eda.sys_IFrame.closeIFrame('leye-main');
|
||||
try {
|
||||
await eda.sch_PrimitiveComponent.placeComponentWithMouse({
|
||||
@ -674,8 +728,40 @@
|
||||
}
|
||||
};
|
||||
|
||||
cmViewProduct.onclick = () => {
|
||||
if (selectedRowData && selectedRowData.lcscId) {
|
||||
const url = `https://so.szlcsc.com/global.html?c=&k=${selectedRowData.lcscId}`;
|
||||
eda.sys_Window.open(url, ESYS_WindowOpenTarget.BLANK);
|
||||
}
|
||||
};
|
||||
|
||||
cmViewDatasheet.onclick = async () => {
|
||||
if (selectedRowData && selectedRowData.uuid) {
|
||||
const data = await eda.lib_Device.get(selectedRowData.uuid);
|
||||
if (data && data.property && data.property.otherProperty && data.property.otherProperty['Datasheet']) {
|
||||
const url = data.property.otherProperty['Datasheet'];
|
||||
eda.sys_Window.open(String(url), ESYS_WindowOpenTarget.BLANK);
|
||||
} else {
|
||||
eda.sys_Message.showToastMessage('该器件无数据手册属性', ESYS_ToastMessageType.WARNING);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
cmAddLcscCarDatasheet.onclick = () => {
|
||||
// cmViewProduct.click();
|
||||
eda.sys_Message.showToastMessage('暂不支持', ESYS_ToastMessageType.INFO);
|
||||
};
|
||||
|
||||
cmEdit.onclick = () => {
|
||||
editBtn.click();
|
||||
};
|
||||
|
||||
document.getElementById('cancel-btn').onclick = () => eda.sys_IFrame.closeIFrame('leye-main');
|
||||
|
||||
document.addEventListener('click', () => {
|
||||
contextMenu.classList.add('hidden');
|
||||
});
|
||||
|
||||
initInventoryData();
|
||||
});
|
||||
</script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user