|
@@ -14,7 +14,7 @@
|
|
|
<div class="d-flex a-c">
|
|
<div class="d-flex a-c">
|
|
|
<el-button v-if="form.id" @click="setBgMusic">设置背景音乐</el-button>
|
|
<el-button v-if="form.id" @click="setBgMusic">设置背景音乐</el-button>
|
|
|
<el-button @click="router.go(-1)">取消</el-button>
|
|
<el-button @click="router.go(-1)">取消</el-button>
|
|
|
- <el-button v-if="form.id" @click="previewTpl" type="primary">预览</el-button>
|
|
|
|
|
|
|
+ <el-button @click="previewTpl" type="primary">预览</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="flex1 ov-hd d-flex">
|
|
<div class="flex1 ov-hd d-flex">
|
|
@@ -89,13 +89,10 @@ const deleteItemEvents = (item: any) => {
|
|
|
// 预览
|
|
// 预览
|
|
|
const previewTplStr = ref<string>('');
|
|
const previewTplStr = ref<string>('');
|
|
|
const previewTpl = async () => {
|
|
const previewTpl = async () => {
|
|
|
- if (!form.value?.id) {
|
|
|
|
|
- ElMessage.warning('请先选择一个页面进行预览');
|
|
|
|
|
- return;
|
|
|
|
|
- };
|
|
|
|
|
- const res: any = await httpRequests.post(`/dgtmedicine/trainpage/edit`, form.value);
|
|
|
|
|
- if (!res || res.code !== 200) return;
|
|
|
|
|
- previewTplStr.value = `${VITE_APP_PAGETPL_URL.value}?id=${form.value.id}`;
|
|
|
|
|
|
|
+ if (!list.value?.length) {
|
|
|
|
|
+ return proxy?.$modal.msgWarning('请先添加页面');
|
|
|
|
|
+ }
|
|
|
|
|
+ previewTplStr.value = `${VITE_APP_PAGETPL_URL.value}?id=${list.value[0].id}`;
|
|
|
showPreviewTpl.value = true;
|
|
showPreviewTpl.value = true;
|
|
|
};
|
|
};
|
|
|
const list = ref<any>([]);
|
|
const list = ref<any>([]);
|
|
@@ -168,7 +165,6 @@ const setIndexTpl = async (item) => {
|
|
|
const setMuisc = (item: any) => {
|
|
const setMuisc = (item: any) => {
|
|
|
if (form.value.id === item.id) {
|
|
if (form.value.id === item.id) {
|
|
|
form.value = { ...form.value, ...item }
|
|
form.value = { ...form.value, ...item }
|
|
|
- getList();
|
|
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
const changeLabel = async (item: any) => {
|
|
const changeLabel = async (item: any) => {
|