|
|
@@ -309,49 +309,58 @@ export const chartsColumns = [
|
|
|
const componentsCaches = new Map<string, any>();
|
|
|
export function getModelComponent(is2DModel: boolean = false, type: string = '') {
|
|
|
if (!is2DModel) return EntryThree;
|
|
|
+
|
|
|
+ const getComponent = (name) => {
|
|
|
+ if (!componentsCaches.has(name)) {
|
|
|
+ componentsCaches.set(name, import(`./components/${name}.vue`));
|
|
|
+ }
|
|
|
+ return componentsCaches.get(name);
|
|
|
+ };
|
|
|
// @ts-ignore
|
|
|
return defineAsyncComponent(() => {
|
|
|
// 为了支持SVG组件切换时不闪烁,先行下载并缓存
|
|
|
- if (!componentsCaches.has('windowSVG')) componentsCaches.set('windowSVG', import('./components/windowSVG.vue'));
|
|
|
- if (!componentsCaches.has('windowDualSVG')) componentsCaches.set('windowDualSVG', import('./components/windowDualSVG.vue'));
|
|
|
- if (!componentsCaches.has('windowDoorSVG')) componentsCaches.set('windowDoorSVG', import('./components/windowDoorSVG.vue')); //带小门风窗
|
|
|
- if (!componentsCaches.has('SmallWindowSVG')) componentsCaches.set('SmallWindowSVG', import('./components/SmallWindowSVG.vue')); //小窗风窗
|
|
|
- if (!componentsCaches.has('windowDualAdjustSVG')) componentsCaches.set('windowDualAdjustSVG', import('./components/windowDualAdjustSVG.vue')); //小窗风窗
|
|
|
+ // if (!componentsCaches.has('windowSVG')) componentsCaches.set('windowSVG', import('./components/windowSVG.vue'));
|
|
|
+ // if (!componentsCaches.has('windowDualSVG')) componentsCaches.set('windowDualSVG', import('./components/windowDualSVG.vue'));
|
|
|
+ // if (!componentsCaches.has('windowDoorSVG')) componentsCaches.set('windowDoorSVG', import('./components/windowDoorSVG.vue')); //带小门风窗
|
|
|
+ // if (!componentsCaches.has('SmallWindowSVG')) componentsCaches.set('SmallWindowSVG', import('./components/SmallWindowSVG.vue')); //小窗风窗
|
|
|
+ // if (!componentsCaches.has('windowDualAdjustSVG')) componentsCaches.set('windowDualAdjustSVG', import('./components/windowDualAdjustSVG.vue')); //小窗风窗
|
|
|
+ // if (!componentsCaches.has('windowZDSVG')) componentsCaches.set('windowZDSVG', import('./components/windowZDSVG.vue')); //小窗风窗
|
|
|
+ // if (!componentsCaches.has('windowDualZDSVG')) componentsCaches.set('windowDualZDSVG', import('./components/windowDualZDSVG.vue')); //小窗风窗
|
|
|
switch (type) {
|
|
|
case 'sdFc1':
|
|
|
- return componentsCaches.get('windowDualSVG');
|
|
|
+ return getComponent('windowDualSVG');
|
|
|
case 'ddFc5':
|
|
|
- return componentsCaches.get('windowSVG');
|
|
|
+ return getComponent('windowSVG');
|
|
|
case 'ddFc6':
|
|
|
- return componentsCaches.get('windowSVG');
|
|
|
+ return getComponent('windowSVG');
|
|
|
case 'ddFc7':
|
|
|
- return componentsCaches.get('windowSVG');
|
|
|
+ return getComponent('windowSVG');
|
|
|
case 'ddFc8':
|
|
|
- return componentsCaches.get('windowSVG');
|
|
|
+ return getComponent('windowSVG');
|
|
|
case 'ddFc1':
|
|
|
- return componentsCaches.get('windowSVG');
|
|
|
+ return getComponent('windowZDSVG');
|
|
|
case 'ddFc2':
|
|
|
- return componentsCaches.get('windowSVG');
|
|
|
+ return getComponent('windowSVG');
|
|
|
case 'ddFc4':
|
|
|
- return componentsCaches.get('windowSVG');
|
|
|
+ return getComponent('windowSVG');
|
|
|
case 'sdFc3':
|
|
|
- return componentsCaches.get('windowDualSVG');
|
|
|
+ return getComponent('windowDualSVG');
|
|
|
case 'sdFc4':
|
|
|
- return componentsCaches.get('windowDualSVG');
|
|
|
+ return getComponent('windowDualAdjustSVG');
|
|
|
case 'sdFc2':
|
|
|
- return componentsCaches.get('windowDualSVG');
|
|
|
+ return getComponent('windowDualSVG');
|
|
|
case 'sdFc5':
|
|
|
- return componentsCaches.get('windowDualSVG');
|
|
|
+ return getComponent('windowDualZDSVG');
|
|
|
case 'threeFc8':
|
|
|
// 暂不支持,用单道的先
|
|
|
- return componentsCaches.get('windowSVG');
|
|
|
+ return getComponent('windowSVG');
|
|
|
case 'singleXkWindow':
|
|
|
- return componentsCaches.get('windowSVG');
|
|
|
+ return getComponent('windowSVG');
|
|
|
case 'sdFcZhq':
|
|
|
- return componentsCaches.get('windowDualSVG');
|
|
|
+ return getComponent('windowDualSVG');
|
|
|
default:
|
|
|
- // return componentsCaches.get('windowSVG');
|
|
|
- return componentsCaches.get('windowSVG');
|
|
|
+ // return getComponent('windowSVG');
|
|
|
+ return getComponent('windowSVG');
|
|
|
}
|
|
|
});
|
|
|
}
|