vr-uniapp/src/views/layout/index.vue

568 lines
24 KiB
Vue
Raw Normal View History

<template>
2024-09-02 10:16:16 +00:00
<div v-loading.fullscreen.lock="loading" class="app-wrapper no-copy" element-loading-background="rgba(255,255,255,1)" element-loading-custom-class="loading-custom">
<template v-if="!loading_content">
<template v-if="!is_empty">
<navbar v-model="form.model" :save-disabled="save_disabled" @preview="preview_event" @save="save_event" @save-close="save_close_event" />
<div class="app-wrapper-content flex-row">
2024-09-14 07:21:54 +00:00
<app-main :diy-data="form.diy_data" :tabs-data="form.tabs_data" :header="form.header" :footer="form.footer" @right-update="right_update" @import="import_data_event" @export="export_data_event" @clear="clear_data_event"></app-main>
<settings :key="key" :value="diy_data_item"></settings>
</div>
</template>
<template v-else>
<no-data height="100vh" img-width="260px" size="16px" text="编辑数据有误"></no-data>
</template>
2024-08-22 09:53:35 +00:00
</template>
2024-09-06 09:05:00 +00:00
<preview v-model="preview_dialog" :data-id="diy_id"></preview>
2024-09-29 10:38:06 +00:00
<template-import v-model="import_temp_visible_dialog" @confirm="handleImportConfirm"></template-import>
</div>
</template>
<script setup lang="ts">
2024-10-23 09:06:41 +00:00
import { is_obj, set_cookie, get_cookie } from '@/utils';
2024-09-23 09:34:56 +00:00
import { Settings, AppMain } from './components/index';
import defaultSettings from './components/main/index';
2024-10-10 02:10:15 +00:00
import defaultConfigSetting from '@/config/setting';
2024-12-30 01:31:58 +00:00
import defaultConfigConst from '@/config/const/index';
import { article_default_parameter, goods_default_parameter } from '@/config/const/data-tabs';
import defaultCustom from '@/config/const/custom';
2024-11-14 10:16:48 +00:00
import { cloneDeep, isEmpty, omit } from 'lodash';
import DiyAPI, { diyData, headerAndFooter, diyConfig } from '@/api/diy';
2024-09-02 03:39:47 +00:00
import CommonAPI from '@/api/common';
import { commonStore } from '@/store';
const common_store = commonStore();
interface diy_data_item {
2024-08-22 09:53:35 +00:00
id: string;
model: {
2024-08-23 09:14:43 +00:00
logo: string;
name: string;
2024-08-23 09:14:43 +00:00
is_enable: string;
describe: string;
};
header: headerAndFooter;
footer: headerAndFooter;
2024-09-14 07:21:54 +00:00
tabs_data: Array<any>;
diy_data: Array<any>;
}
const temp_form = ref<diy_data_item>({
2024-08-22 09:53:35 +00:00
id: '',
model: {
2024-08-23 09:14:43 +00:00
logo: '',
2024-10-08 02:24:57 +00:00
name: 'DIY模版',
2024-08-23 09:14:43 +00:00
is_enable: '1',
describe: '',
},
header: {
name: '页面设置',
2024-09-05 06:29:43 +00:00
show_tabs: '1',
key: 'page-settings',
com_data: defaultSettings.header_nav,
},
footer: {
name: '底部导航',
2024-09-05 06:29:43 +00:00
show_tabs: '0',
key: 'footer-nav',
com_data: defaultSettings.footer_nav,
},
2024-09-14 07:21:54 +00:00
tabs_data: [],
diy_data: [],
});
const form = ref<diy_data_item>({
id: '',
model: {
logo: '',
name: '',
is_enable: '1',
describe: '',
},
header: {
name: '页面设置',
show_tabs: '1',
key: 'page-settings',
com_data: {},
},
footer: {
name: '底部导航',
show_tabs: '0',
key: 'footer-nav',
com_data: {},
},
2024-09-14 07:21:54 +00:00
tabs_data: [],
diy_data: [],
});
const diy_data_item = ref({});
const key = ref('');
2024-09-14 07:21:54 +00:00
const right_update = (item: any, diy: [Array<any>], header: headerAndFooter, footer: headerAndFooter, tabs_data: [Array<any>]) => {
diy_data_item.value = item;
form.value.diy_data = diy;
form.value.header = header;
form.value.footer = footer;
2024-09-14 07:21:54 +00:00
form.value.tabs_data = tabs_data;
// 生成随机id
key.value = Math.random().toString(36).substring(2);
};
2024-09-29 10:38:06 +00:00
const import_temp_visible_dialog = ref(false);
// 导入数据
2024-09-30 09:12:42 +00:00
const import_data_event = () => {
2024-09-29 10:38:06 +00:00
import_temp_visible_dialog.value = true;
};
const handleImportConfirm = () => {
// 导入成功
2024-09-30 09:12:42 +00:00
init();
2024-09-05 06:36:28 +00:00
};
// 导出数据
2024-09-05 06:36:28 +00:00
const export_data_event = () => {
2024-09-06 09:05:00 +00:00
save_formmat_form_data(form.value, false, true);
2024-09-05 06:36:28 +00:00
};
// 清空数据
const clear_data_event = () => {
let new_tem_form = cloneDeep(temp_form.value);
form.value.header.show_tabs = '1';
form.value.footer.show_tabs = '0';
form.value.header.com_data = new_tem_form.header.com_data;
form.value.footer.com_data = new_tem_form.footer.com_data;
2024-09-14 07:21:54 +00:00
form.value.tabs_data = [];
form.value.diy_data = [];
2024-10-19 03:51:32 +00:00
// 数据清空之后将公共沉浸模式判断为false
common_store.set_is_immersion_model(false);
diy_data_item.value = new_tem_form.header;
};
//#region 页面初始化数据 ---------------------start
// 页面加载
onMounted(() => {
common_init();
});
2024-08-22 09:53:35 +00:00
const is_empty = ref(false);
const init = () => {
2024-09-05 06:36:28 +00:00
if (get_id()) {
DiyAPI.getInit({ id: get_id() }).then((res: any) => {
2024-11-23 08:09:15 +00:00
const new_data = res.data?.data || undefined;
if (new_data) {
let data = form_data_transfor_diy_data(new_data);
2024-10-11 02:56:45 +00:00
// 默认数据合并
data.header.com_data = default_merge(data.header.com_data, 'header_nav');
data.footer.com_data = default_merge(data.footer.com_data, 'footer_nav');
2024-11-23 08:09:15 +00:00
2024-10-11 02:56:45 +00:00
data.diy_data = data_merge(data.diy_data);
data.tabs_data = data_merge(data.tabs_data);
2024-10-19 03:33:06 +00:00
// 判断默认数据是否开启沉浸式
if (data.header.com_data.style.immersive_style === '1') {
common_store.set_is_immersion_model(true);
}
2024-10-11 02:56:45 +00:00
form.value = data;
2024-09-05 06:36:28 +00:00
} else {
is_empty.value = true;
}
loading_event();
2024-09-05 06:36:28 +00:00
});
2024-09-02 10:16:16 +00:00
} else {
temp_form.value.header.com_data = defaultSettings.header_nav;
temp_form.value.footer.com_data = defaultSettings.footer_nav;
form.value = cloneDeep(temp_form.value);
loading_event();
}
};
2024-10-11 02:56:45 +00:00
// 数据合并
const data_merge = (list: string[]) => {
list.forEach((item: any) => {
2024-10-11 08:18:28 +00:00
item.com_data = default_merge(item.com_data, item.key);
2024-10-11 02:56:45 +00:00
});
return list;
};
// 浅层数据合并
const default_merge = (data: any, key: string) => {
2024-10-11 10:40:37 +00:00
if (data.style) {
data.style = Object.assign({}, cloneDeep((defaultSettings as any)[key.replace(/-/g, '_')]).style, data.style);
2024-12-02 06:05:39 +00:00
// 历史的值,赋值给新的值
if (key == 'header_nav' && !isEmpty(data.style.position_color)) {
data.style.location_color = data.style.position_color;
}
2024-10-11 10:40:37 +00:00
} else {
data.style = cloneDeep((defaultSettings as any)[key.replace(/-/g, '_')]).style;
}
2024-12-30 01:31:58 +00:00
// 兼融老数据
if (!isEmpty(data.style.common_style)) {
data.style.common_style = Object.assign({}, cloneDeep(defaultConfigConst), data.style.common_style);
}
2024-10-11 10:40:37 +00:00
if (data.content) {
data.content = Object.assign({}, cloneDeep((defaultSettings as any)[key.replace(/-/g, '_')]).content, data.content);
} else {
data.content = cloneDeep((defaultSettings as any)[key.replace(/-/g, '_')]).content;
}
2024-10-11 02:56:45 +00:00
return data;
};
2024-09-02 03:39:47 +00:00
// 初始化公共数据
const common_init = () => {
2024-10-23 09:06:41 +00:00
if (get_cookie('attachment_host') || get_cookie('attachment_host') !== 'null' || get_cookie('attachment_host') !== null) {
CommonAPI.getInit().then((res: any) => {
common_store.set_common(res.data);
set_cookie('attachment_host', res.data.config.attachment_host);
init();
});
} else {
// 将localStorage中的数据读取出
// 判断localStorage中是否有数据
if (localStorage.getItem('diy_init_common')) {
const data = JSON.parse(localStorage.getItem('diy_init_common') || '');
common_store.set_common(data);
// 清除缓存
localStorage.removeItem('diy_init_common');
init();
}
}
2024-09-02 03:39:47 +00:00
};
2024-09-02 10:16:16 +00:00
// 加载动画
const loading = ref(true);
const loading_content = ref(true);
const loading_event = () => {
loading_content.value = false;
setTimeout(() => {
loading.value = false;
}, 1000);
2024-09-02 10:16:16 +00:00
};
//#endregion 页面初始化数据 ---------------------end
//#region 顶部导航回调方法 ---------------------start
2024-09-06 09:05:00 +00:00
const preview_dialog = ref(false);
const diy_id = ref('');
const preview_event = () => {
save_formmat_form_data(form.value, false, false, true);
};
const save_disabled = ref(false);
const save_event = (bool: boolean) => {
save_disabled.value = bool;
save_formmat_form_data(form.value);
};
const save_close_event = (bool: boolean) => {
save_disabled.value = bool;
save_formmat_form_data(form.value, true);
};
2024-09-23 09:34:56 +00:00
// save_formmat_form_data: 保存数据, data 数据, close 是否关闭, is_export 是否导出, is_preview 是否预览
2024-09-06 09:05:00 +00:00
const save_formmat_form_data = (data: diy_data_item, close: boolean = false, is_export: boolean = false, is_preview: boolean = false) => {
const clone_form = cloneDeep(data);
2024-09-05 06:29:43 +00:00
clone_form.header.show_tabs = '1';
2024-12-02 06:05:39 +00:00
// 去除位置颜色
clone_form.header.com_data.style = omit(cloneDeep(clone_form.header.com_data.style), ['position_color']);
2024-09-05 06:29:43 +00:00
clone_form.footer.show_tabs = '0';
2024-09-18 03:03:06 +00:00
// 字段比coupon多
const new_array_1 = ['goods-list', 'article-list'];
// 数据比正常list多一级
2024-09-14 10:59:08 +00:00
const new_array_2 = ['goods-tabs', 'article-tabs'];
2024-09-18 03:03:06 +00:00
// 数据格式简单
const new_array_3 = ['coupon'];
// 层级更深
const new_array_4 = ['data-magic'];
2024-09-18 05:56:29 +00:00
// 自定义数据
const new_array_5 = ['custom'];
2024-11-25 10:23:36 +00:00
// 导航组
const new_array_6 = ['nav-group'];
clone_form.diy_data = clone_form.diy_data.map((item: any) => {
2024-09-14 10:59:08 +00:00
if (new_array_1.includes(item.key)) {
2025-02-06 09:15:03 +00:00
// 商品或文章的数据处理
goods_or_article_data_processing(item.com_data.content, item.key == new_array_1[0]);
2024-09-14 10:59:08 +00:00
} else if (new_array_2.includes(item.key)) {
2024-09-18 09:09:22 +00:00
item.com_data.content.tabs_active_index = 0;
2025-02-06 09:15:03 +00:00
item.com_data.content.tabs_list.forEach((item0: any) => {
// 商品或文章的数据处理
goods_or_article_data_processing(item0, item.key == new_array_1[0]);
2024-09-14 10:59:08 +00:00
});
2024-09-18 03:03:06 +00:00
} else if (new_array_3.includes(item.key)) {
2024-10-09 10:32:47 +00:00
item.com_data.content.data_ids = item.com_data.content.data_list.map((item: any) => item.id).join(',') || '';
2024-09-18 03:03:06 +00:00
item.com_data.content.data_list = [];
item.com_data.content.data_auto_list = [];
2024-10-10 02:10:15 +00:00
if (item.com_data.content.data_type == '1') {
item.com_data.content.type = defaultConfigSetting.coupon_ids;
item.com_data.content.number = defaultConfigSetting.page_size;
}
2024-09-18 03:03:06 +00:00
} else if (new_array_4.includes(item.key)) {
2025-02-06 09:15:03 +00:00
item.com_data.content.data_magic_list.forEach((item1: any) => {
2024-11-22 03:33:34 +00:00
if (item1.data_content.data_type == 'goods') {
item1.data_content.goods_ids = item1.data_content.goods_list.map((item2: any) => item2.data.id).join(',') || '';
item1.data_content.goods_list = item1.data_content.goods_list.map((item3: any) => {
2024-11-14 10:16:48 +00:00
return {
2024-11-22 03:33:34 +00:00
...item3,
2024-11-14 10:16:48 +00:00
data: [],
2024-11-22 03:33:34 +00:00
data_id: item3.data.id,
2024-11-14 10:16:48 +00:00
};
});
2024-12-02 06:05:39 +00:00
// 判断值是否存在
if (!isEmpty(item1.data_content.data_source_content)) {
// 清除自定义里的数据
item1.data_content.data_source_content.data_ids = [];
item1.data_content.data_source_content.data_list = [];
item1.data_content.data_source_content.data_auto_list = [];
2024-12-02 09:10:44 +00:00
item1.data_content.data_source_content.data_type = 0;
2024-12-02 06:05:39 +00:00
} else {
2024-12-02 09:10:44 +00:00
item1.data_content.data_source_content = { data_type: 0, data_ids: '', data_list: [], data_auto_list: []}
2024-12-02 06:05:39 +00:00
}
2024-11-22 03:33:34 +00:00
} else if (item1.data_content.data_type == 'custom') {
2025-02-06 09:15:03 +00:00
// 自定义里的数据处理
custom_data_processing(item1.data_content);
2024-11-22 03:33:34 +00:00
// 清除商品里的数据
item1.data_content.goods_ids = '';
item1.data_content.goods_list= [];
} else {
// 清除商品里的数据
item1.data_content.goods_ids = '';
item1.data_content.goods_list= [];
2024-12-02 06:05:39 +00:00
// 判断值是否存在
if (!isEmpty(item1.data_content.data_source_content)) {
// 清除自定义里的数据
2024-12-02 09:10:44 +00:00
item1.data_content.data_source_content.data_type = 0;
2024-12-02 06:05:39 +00:00
item1.data_content.data_source_content.data_ids = '';
item1.data_content.data_source_content.data_list = [];
item1.data_content.data_source_content.data_auto_list = [];
} else {
2024-12-02 09:10:44 +00:00
item1.data_content.data_source_content = { data_type: 0, data_ids: '', data_list: [], data_auto_list: []}
2024-12-02 06:05:39 +00:00
}
2024-11-14 10:16:48 +00:00
}
});
} else if (new_array_5.includes(item.key)) {
// 从数据中剔除data_source_content_value字段
item.com_data.content = omit(cloneDeep(item.com_data.content), ['data_source_content_value']);
2025-02-06 09:15:03 +00:00
// 自定义数据处理
custom_data_processing(item.com_data.content);
2024-11-25 10:23:36 +00:00
} else if (new_array_6.includes(item.key)) {
item.com_data.content.nav_content_list = item.com_data.content.nav_content_list.map((item0: any) => ({...omit(item0, 'tabs_name') }));
2025-02-06 09:15:03 +00:00
} else if (['data-tabs'].includes(item.key)) {
item.com_data.content.tabs_active_index = 0;
2025-02-06 09:15:03 +00:00
const new_tabs_list = item?.com_data?.content?.tabs_list || [];
new_tabs_list.forEach((item: any) => {
item.tabs_name = 'content';
2025-02-06 09:15:03 +00:00
if (item.tabs_data_type == 'goods' || item.tabs_data_type == 'article') {
const new_com_data = item.tabs_data_type == 'goods' ? item.goods_config : item.article_config;
// 商品或文章的数据处理
goods_or_article_data_processing(new_com_data.content, item.tabs_data_type == 'goods');
// 是商品的时候需要将其他的两个数据清楚掉,避免下次切换时出现问题
if (item.tabs_data_type == 'goods') {
2025-02-07 07:58:50 +00:00
// item.article_config = cloneDeep(article_default_parameter);
// item.custom_config = cloneDeep(defaultCustom)
delete item.article_config;
delete item.custom_config;
2025-02-06 09:15:03 +00:00
} else {
// 是文章时清除掉其他的内容
2025-02-07 07:58:50 +00:00
// item.goods_config = cloneDeep(goods_default_parameter);
// item.custom_config = cloneDeep(defaultCustom)
delete item.goods_config;
delete item.custom_config;
2025-02-06 09:15:03 +00:00
}
} else if (item.tabs_data_type == 'custom') {
const new_com_data = item.custom_config;
// 从数据中剔除data_source_content_value字段
new_com_data.content = omit(cloneDeep(new_com_data.content), ['data_source_content_value']);
// 自定义数据处理
custom_data_processing(new_com_data.content);
// 是自定义的时候清除掉其他的内容,避免下次点击时出现问题
2025-02-07 07:58:50 +00:00
delete item.goods_config;
delete item.article_config;
// item.goods_config = cloneDeep(goods_default_parameter);
// item.article_config = cloneDeep(article_default_parameter);
2025-02-06 09:15:03 +00:00
}
});
2024-09-14 10:34:41 +00:00
}
return {
...item,
2024-09-05 06:29:43 +00:00
show_tabs: '0',
};
});
2024-08-22 09:53:35 +00:00
// 数据改造
const new_data = diy_data_transfor_form_data(clone_form);
2024-10-11 08:18:28 +00:00
DiyAPI.save(new_data)
.then((res) => {
setTimeout(() => {
save_disabled.value = false;
}, 500);
// 如果是导出或预览模式,则不显示保存成功的消息
if (!(is_export || is_preview)) {
ElMessage.success('保存成功');
2024-09-06 09:05:00 +00:00
}
2024-10-11 08:18:28 +00:00
if (close) {
ElMessageBox.confirm('您确定要关闭本页吗?', '提示')
.then(() => {
// 关闭页面
window.close();
})
.catch(() => {});
} else {
// 判断是否需要导出
if (is_export) {
const index = window.location.href.lastIndexOf('?s=');
const pro_url = window.location.href.substring(0, index);
const new_url = import.meta.env.VITE_APP_BASE_API == '/dev-api' ? import.meta.env.VITE_APP_BASE_API_URL : pro_url;
window.open(new_url + '?s=diyapi/diydownload/id/' + res.data + '.html', '_blank');
}
if (is_preview) {
preview_dialog.value = true;
diy_id.value = String(res.data);
}
form.value.id = String(res.data);
history.pushState({}, '', '?s=diy/saveinfo/id/' + res.data + '.html');
2024-09-06 09:05:00 +00:00
}
2024-10-11 08:18:28 +00:00
})
.catch((err) => {
save_disabled.value = false;
2024-10-11 08:18:28 +00:00
});
};
2025-02-06 09:15:03 +00:00
/**
* 商品或文章数据处理函数
* 该函数根据提供的数据类型和是否为商品的标志处理数据内容的结构
* 主要目的是为了标准化数据处理逻辑使得数据格式符合预期的要求
*
* @param new_com_data_content 传入的新数据内容对象包含需要处理的数据列表和其他相关信息
* @param is_goods 是否为商品的标志用于决定数据处理的具体方式
*/
const goods_or_article_data_processing = (new_com_data_content: any, is_goods: boolean) => {
// 判断数据类型,如果为'0',则进行详细的数据处理
if (new_com_data_content.data_type == '0') {
// 提取数据ID列表用于后续的数据查询或处理
new_com_data_content.data_ids = new_com_data_content.data_list.map((item: any) => item.data.id).join(',') || '';
// 重构数据列表,保留原始数据结构的同时,添加或修改必要的字段
new_com_data_content.data_list = new_com_data_content.data_list.map((item1: any) => {
return {
...item1,
data: [],
data_id: item1.data.id,
};
});
// 设置分类ID、数量、排序规则等默认值确保数据的一致性和完整性
new_com_data_content.category_ids = defaultConfigSetting.category_ids;
new_com_data_content.number = defaultConfigSetting.page_size;
new_com_data_content.order_by_rule = defaultConfigSetting.order_by_rule;
new_com_data_content.order_by_type = defaultConfigSetting.order_by_type;
// 根据是否为商品决定是否设置品牌ID或封面标志
if (is_goods) {
new_com_data_content.brand_ids = defaultConfigSetting.brand_ids;
} else {
new_com_data_content.is_cover = defaultConfigSetting.is_cover;
}
} else {
// 如果数据类型不是'0'清空数据ID列表和数据列表确保数据处理的一致性
new_com_data_content.data_ids = '';
new_com_data_content.data_list = [];
}
// 清空自动数据列表,为后续的数据处理或展示做准备
new_com_data_content.data_auto_list = [];
};
2025-02-06 09:15:03 +00:00
/**
* 自定义数据处理函数
* 该函数用于处理新组件数据内容根据数据是否为自定义以及数据类型对数据进行相应的处理和格式化
* @param {any} new_com_data_content - 新组件的数据内容对象包含数据源和显示数据等信息
*/
const custom_data_processing = (new_com_data_content: any) => {
// 判断数据是否为自定义且数据类型为0假设0代表某种特定数据类型
if (new_com_data_content.is_custom_data == '1' && new_com_data_content.data_source_content.data_type === 0) {
// 手动的数据内容
const data_list = cloneDeep(new_com_data_content.data_source_content.data_list);
// 数据改造,存放手动的id
new_com_data_content.data_source_content.data_ids = data_list.map((list_item: any) => list_item.data[new_com_data_content?.show_data.data_key || 'id'] || '').join(',') || '';
// 数据改造,存放手动的清除里边的data
new_com_data_content.data_source_content.data_list = data_list.map((list_item: any) => {
return {
...list_item,
data: [],
data_id: list_item.data[new_com_data_content?.show_data.data_key || 'id'],
};
});
} else {
// 如果数据不是自定义或数据类型不是0清空相关数据字段
new_com_data_content.data_source_content.data_ids = [];
new_com_data_content.data_source_content.data_list = [];
}
// 自动数据清空
new_com_data_content.data_source_content.data_auto_list = [];
};
//#endregion 顶部导航回调方法 ---------------------end
2025-02-06 09:15:03 +00:00
2024-08-22 09:53:35 +00:00
// 数据改造
const diy_data_transfor_form_data = (clone_form: diy_data_item) => {
return {
id: clone_form.id,
2024-08-23 09:14:43 +00:00
logo: clone_form.model.logo,
2024-08-22 09:53:35 +00:00
name: clone_form.model.name,
2024-08-23 09:14:43 +00:00
is_enable: clone_form.model.is_enable,
describe: clone_form.model.describe,
2024-08-22 09:53:35 +00:00
config: JSON.stringify({
2024-08-22 10:40:15 +00:00
header: clone_form.header,
footer: clone_form.footer,
2024-08-22 09:53:35 +00:00
diy_data: clone_form.diy_data,
2024-09-20 04:06:47 +00:00
tabs_data: clone_form.tabs_data,
2024-08-22 09:53:35 +00:00
}),
};
};
const form_data_transfor_diy_data = (clone_form: diyData) => {
let temp_config = clone_form.config;
let new_tem_form = cloneDeep(temp_form.value);
try {
return {
id: clone_form.id,
model: {
logo: clone_form.logo,
name: clone_form.name,
is_enable: clone_form.is_enable,
describe: clone_form.describe,
},
header: is_obj(temp_config) ? (temp_config as diyConfig).header : JSON.parse(temp_config as string).header,
footer: is_obj(temp_config) ? (temp_config as diyConfig).footer : JSON.parse(temp_config as string).footer,
2024-09-14 07:21:54 +00:00
tabs_data: is_obj(temp_config) ? (temp_config as diyConfig).tabs_data : JSON.parse(temp_config as string).tabs_data,
diy_data: is_obj(temp_config) ? (temp_config as diyConfig).diy_data : JSON.parse(temp_config as string).diy_data,
};
} catch (error) {
return {
id: clone_form.id,
model: {
logo: clone_form.logo,
name: clone_form.name,
is_enable: clone_form.is_enable,
describe: clone_form.describe,
},
header: new_tem_form.header,
footer: new_tem_form.footer,
2024-09-14 07:21:54 +00:00
tabs_data: new_tem_form.tabs_data,
diy_data: new_tem_form.diy_data,
};
}
2024-08-22 09:53:35 +00:00
};
2024-09-05 06:36:28 +00:00
// 截取document.location.search字符串内id/后面的所有字段
const get_id = () => {
let new_id = '';
2024-09-25 10:19:18 +00:00
if (document.location.search.indexOf('id/') != -1) {
2024-09-05 06:36:28 +00:00
new_id = document.location.search.substring(document.location.search.indexOf('id/') + 3);
// 去除字符串的.html
let html_index = new_id.indexOf('.html');
2024-09-25 10:19:18 +00:00
if (html_index != -1) {
2024-09-05 06:36:28 +00:00
new_id = new_id.substring(0, html_index);
}
return new_id;
} else {
return new_id;
}
};
</script>
<style scoped lang="scss">
.app-wrapper {
background-color: #f0f2f5;
.app-wrapper-content {
2024-09-03 06:27:36 +00:00
height: calc(100vh - 6rem);
}
}
.no-copy {
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently supported by Chrome and Opera */
}
</style>