修改预览判断逻辑

v1.4.0
于肖磊 2025-08-11 15:33:15 +08:00
parent bcc35246ef
commit 156ee45ca2
2 changed files with 9 additions and 6 deletions

View File

@ -14,6 +14,7 @@
import { get_cookie, set_cookie, get_math } from '@/utils';
import { commonStore } from '@/store';
import { get_type } from '@/utils/common';
import { isEmpty } from 'lodash';
const common_store = commonStore();
const props = defineProps({
dataId: {
@ -53,10 +54,7 @@ watch(
set_cookie('uuid_name', uuid_val);
}
let url = common_store.common.config.preview_url;
if (url == '') {
ElMessage.error('请先配置预览地址');
dialog_visible.value = false;
} else {
if (!isEmpty(url)) {
// ?
new_link.value = url + (url.includes('?') ? '&id=' : '?id=') + props.dataId + '&system_type=default' + token.value + '&uuid=' + uuid_val;
}

View File

@ -268,8 +268,13 @@ const loading_event = () => {
const preview_dialog = ref(false);
const diy_id = ref('');
const preview_event = (bool: boolean) => {
let url = common_store.common.config.preview_url;
if (isEmpty(url)) {
ElMessage.error('请先配置预览地址');
} else {
save_disabled.value = bool;
save_formmat_form_data(form.value, false, false, true);
}
};
const save_disabled = ref(false);
const save_event = (bool: boolean) => {