fix: 修复管理端前端 lint 与构建问题
- 收敛 easyflow-ui-admin 的 lint、格式和类型问题 - 修正 demo 页面与管理端前端构建失败点 - 验证 pnpm lint 与 pnpm build 均已通过
This commit is contained in:
@@ -1,25 +1,30 @@
|
||||
import {store} from '#store/stores.svelte';
|
||||
import { store } from '#store/stores.svelte';
|
||||
|
||||
export const useUpdateEdgeData = () => {
|
||||
const updateEdgeData = (id: string, dataUpdate: any, options?: { replace: boolean }) => {
|
||||
const edge = store.getEdge(id);
|
||||
if (!edge) {
|
||||
return;
|
||||
const updateEdgeData = (
|
||||
id: string,
|
||||
dataUpdate: any,
|
||||
options?: { replace: boolean },
|
||||
) => {
|
||||
const edge = store.getEdge(id);
|
||||
if (!edge) {
|
||||
return;
|
||||
}
|
||||
|
||||
const nextData =
|
||||
typeof dataUpdate === 'function' ? dataUpdate(edge) : dataUpdate;
|
||||
edge.data = options?.replace ? nextData : { ...edge.data, ...nextData };
|
||||
|
||||
store.updateEdges((edges) => {
|
||||
return edges.map((e) => {
|
||||
if (e.id === id) {
|
||||
return edge;
|
||||
}
|
||||
|
||||
const nextData = typeof dataUpdate === 'function' ? dataUpdate(edge) : dataUpdate;
|
||||
edge.data = options?.replace ? nextData : { ...edge.data, ...nextData };
|
||||
|
||||
store.updateEdges((edges) => {
|
||||
return edges.map((e) => {
|
||||
if (e.id === id) {
|
||||
return edge;
|
||||
}
|
||||
return e;
|
||||
});
|
||||
});
|
||||
};
|
||||
return {
|
||||
updateEdgeData
|
||||
};
|
||||
return e;
|
||||
});
|
||||
});
|
||||
};
|
||||
return {
|
||||
updateEdgeData,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user