|
@@ -508,6 +508,7 @@ const templateCaches = [];
|
|
const componentCaches = [];
|
|
const componentCaches = [];
|
|
const materials = [];
|
|
const materials = [];
|
|
const pngs = [];
|
|
const pngs = [];
|
|
|
|
+let jsDiagrams = [];
|
|
|
|
|
|
const components = [
|
|
const components = [
|
|
{
|
|
{
|
|
@@ -645,6 +646,7 @@ const groupChange = async (name: string) => {
|
|
loading.value = true;
|
|
loading.value = true;
|
|
pngs.push(...(await getFolders('png')));
|
|
pngs.push(...(await getFolders('png')));
|
|
pngs.push(...(await getFolders('svg', true)));
|
|
pngs.push(...(await getFolders('svg', true)));
|
|
|
|
+ pngs.push(...jsDiagrams);
|
|
loading.value = false;
|
|
loading.value = false;
|
|
const _pngs: string = await localforage.getItem('le5leV-pngs');
|
|
const _pngs: string = await localforage.getItem('le5leV-pngs');
|
|
if (_pngs) {
|
|
if (_pngs) {
|
|
@@ -1182,15 +1184,24 @@ const dragStart = async (event: DragEvent | MouseEvent|TouchEvent, item: any) =>
|
|
}
|
|
}
|
|
} else if (item.data) {
|
|
} else if (item.data) {
|
|
// 普通图元
|
|
// 普通图元
|
|
- data = item.data;
|
|
|
|
- if(data.name==='table'){
|
|
|
|
- if(data.tableType === 'longlist'){
|
|
|
|
- const _data = new Array(100).fill(0)
|
|
|
|
- .map((_, row) => new Array(10).fill(0)
|
|
|
|
- .map((_, column) => `${row}, ${column}`));
|
|
|
|
- _data.splice(0, 0, new Array(10).fill(0).map((_, i) =>String.fromCharCode(65+i)));
|
|
|
|
- data.data = _data;
|
|
|
|
- console.log("data",data);
|
|
|
|
|
|
+ if(item.fullname || item.subClassName){
|
|
|
|
+ // data = item;
|
|
|
|
+ item.name = item.fullname;
|
|
|
|
+ item.width = item.data.rect.width*4;
|
|
|
|
+ item.height = item.data.rect.height*4;
|
|
|
|
+ delete item.rect;
|
|
|
|
+ data = item;
|
|
|
|
+ }else{
|
|
|
|
+ data = item.data;
|
|
|
|
+ if(data.name==='table'){
|
|
|
|
+ if(data.tableType === 'longlist'){
|
|
|
|
+ const _data = new Array(100).fill(0)
|
|
|
|
+ .map((_, row) => new Array(10).fill(0)
|
|
|
|
+ .map((_, column) => `${row}, ${column}`));
|
|
|
|
+ _data.splice(0, 0, new Array(10).fill(0).map((_, i) =>String.fromCharCode(65+i)));
|
|
|
|
+ data.data = _data;
|
|
|
|
+ // console.log("data",data);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else if (item.image) {
|
|
} else if (item.image) {
|
|
@@ -2210,6 +2221,19 @@ const manageConfirm = () => {
|
|
};
|
|
};
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
|
+ //js线性图元
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ if (globalThis.meta2dTools?.length !== globalThis.jsDiagramNum) {
|
|
|
|
+ let jsLoadInterval = setInterval(() => {
|
|
|
|
+ if (globalThis.meta2dTools?.length == globalThis.jsDiagramNum) {
|
|
|
|
+ getJsDiagram();
|
|
|
|
+ clearInterval(jsLoadInterval);
|
|
|
|
+ }
|
|
|
|
+ }, 500);
|
|
|
|
+ } else {
|
|
|
|
+ getJsDiagram();
|
|
|
|
+ }
|
|
|
|
+ },100);
|
|
groupChange('方案');
|
|
groupChange('方案');
|
|
document.addEventListener('dragstart', dragstart, false);
|
|
document.addEventListener('dragstart', dragstart, false);
|
|
document.addEventListener('dragend', dragend, false);
|
|
document.addEventListener('dragend', dragend, false);
|
|
@@ -2222,6 +2246,32 @@ onMounted(() => {
|
|
}, 2000);
|
|
}, 2000);
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+function getJsDiagram() {
|
|
|
|
+ if (globalThis.registerToolsNew) {
|
|
|
|
+ (window as any).registerToolsNew();
|
|
|
|
+ const temJSClass = [];
|
|
|
|
+ const temJSMaterial = [];
|
|
|
|
+ globalThis.meta2dTools.forEach((item: any) => {
|
|
|
|
+ if (temJSClass.indexOf(item.subClassName) === -1) {
|
|
|
|
+ temJSClass.push(item.subClassName);
|
|
|
|
+ temJSMaterial.push({
|
|
|
|
+ name: item.subClassName,
|
|
|
|
+ show: true,
|
|
|
|
+ list: [],
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ temJSMaterial.forEach((_class: any) => {
|
|
|
|
+ if (_class.name === item.subClassName) {
|
|
|
|
+ _class.list.push(item);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ jsDiagrams.push(...temJSMaterial);
|
|
|
|
+ // 切换回页面仍需要注册,所以此处不清空
|
|
|
|
+ // window.meta2dTools = undefined;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
const changeAssets = (e)=>{
|
|
const changeAssets = (e)=>{
|
|
if(e){
|
|
if(e){
|
|
activeAssets.value = 'system';
|
|
activeAssets.value = 'system';
|
|
@@ -2474,6 +2524,9 @@ onUnmounted(() => {
|
|
stroke-dasharray: none;
|
|
stroke-dasharray: none;
|
|
opacity: 1;
|
|
opacity: 1;
|
|
}
|
|
}
|
|
|
|
+ path{
|
|
|
|
+ stroke: var(--color) !important;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|