@@ -13,7 +13,8 @@
</div>
<div class="flex-1"></div>
<el-button @click="preview()">保存并预览</el-button>
- <el-button @click="save()" :loading="loading">保存</el-button>
+ <el-button @click="save()">保存</el-button>
+ <!-- :loading="loading" -->
</el-header>
<div class="full-container flex flex-row flex-1 bg-page">
<div class="component-list w-[192px]">
@@ -275,10 +276,12 @@ const handleChange = (val: string[]) => {};
const goBack = () => {};
// 预览
-const preview = () => {};
+const preview = () => {
+ save(1);
+};
// 保存
-const save = () => {
+const save = (type?: number) => {
const datas: any = {
name: diyStore.name,
siteId: '',
@@ -302,6 +305,9 @@ const save = () => {
message: '保存成功~',
type: 'success'
});
+ if (type == 1) {
+ window.open('/diy/pcdiy?id=' + res.data.id);
+ }
}
})
.catch(() => {});
@@ -38,9 +38,10 @@ import usePcdiyStore from '@/store/modules/pcdiy';
import figure from '@/assets/images/figure.png';
const diyStore = usePcdiyStore();
const props = defineProps<{
- index: number; // 确保声明 index 为可选属性
+ index: number; // 确保声明 index 为可选属性
+ row?: any;
}>();
-const componentData = diyStore.componentList[props.index];
+const componentData = props.row ? props.row : diyStore.componentList[props.index];
const dataList = computed(() => {
const chunkSize = componentData.number * componentData.count;
@@ -119,9 +119,10 @@ import { listBase } from '@/api/pmsProduct/base';
const dataList = ref<any>([{}, {}, {}, {}]);
onMounted(() => {
@@ -62,9 +62,10 @@ import { listBase } from '@/api/pmsProduct/base';
const dataList = ref<any>([{}, {}, {}, {}, {}, {}, {}, {}]);
@@ -38,9 +38,10 @@ import { listBase } from '@/api/pmsProduct/base';
const dataList = ref<any>([{}, {}, {}, {}, {}]);
@@ -48,8 +48,9 @@ const diyStore = usePcdiyStore();
index: number; // 确保声明 index 为可选属性