|
|
@@ -8,7 +8,7 @@
|
|
|
|
|
|
<script setup name="Index" lang="ts">
|
|
|
import { pcLookDiy } from '@/api/diy/index';
|
|
|
-import { loadDiyComponents, getComponentGroups } from '@/views/diy/pccomponents/index';
|
|
|
+import { getComponentGroups } from '@/views/diy/pccomponents/index';
|
|
|
|
|
|
const componentList = ref<any>([]);
|
|
|
const collapse = ref<any>([]);
|
|
|
@@ -18,16 +18,15 @@ const query = route.query;
|
|
|
const formData = ref<any>({});
|
|
|
|
|
|
onMounted(() => {
|
|
|
- loadComponents();
|
|
|
if (query.id) {
|
|
|
id.value = query.id;
|
|
|
}
|
|
|
+ loadComponents();
|
|
|
});
|
|
|
|
|
|
// 加载组件
|
|
|
const loadComponents = async () => {
|
|
|
- const components = await loadDiyComponents();
|
|
|
- collapse.value = getComponentGroups(components);
|
|
|
+ collapse.value = getComponentGroups();
|
|
|
if (id.value) {
|
|
|
pcLookDiy(id.value).then((res) => {
|
|
|
if (res.code == 200) {
|