mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-11-09 02:18:55 +08:00
feat(manager): 装修组件面板三类分组,移除促销活动组件,画布对未知类型增加守卫
This commit is contained in:
@@ -6,12 +6,14 @@
|
|||||||
* notLink: true 没有链接功能
|
* notLink: true 没有链接功能
|
||||||
* notImg: true 没有选择图片功能
|
* notImg: true 没有选择图片功能
|
||||||
* close:true 右侧关闭按钮
|
* close:true 右侧关闭按钮
|
||||||
|
* group: 'base' | 'marketing' | 'tools' 组件面板分组(无 group 的条目不在面板显示,仅供抽屉使用)
|
||||||
*/
|
*/
|
||||||
export const modelData = [
|
export const modelData = [
|
||||||
|
|
||||||
{
|
{
|
||||||
type: "flexOne",
|
type: "flexOne",
|
||||||
name: "图片",
|
name: "图片",
|
||||||
|
group: "base",
|
||||||
// drawer: true,
|
// drawer: true,
|
||||||
notAdd: true,
|
notAdd: true,
|
||||||
onlyImg: true,
|
onlyImg: true,
|
||||||
@@ -31,6 +33,7 @@ export const modelData = [
|
|||||||
{
|
{
|
||||||
type: "carousel",
|
type: "carousel",
|
||||||
name: "轮播图",
|
name: "轮播图",
|
||||||
|
group: "base",
|
||||||
img: "md-image",
|
img: "md-image",
|
||||||
// onlyImg: true,
|
// onlyImg: true,
|
||||||
notTitle: false,
|
notTitle: false,
|
||||||
@@ -98,6 +101,7 @@ export const modelData = [
|
|||||||
{
|
{
|
||||||
type: "title",
|
type: "title",
|
||||||
name: "标题栏",
|
name: "标题栏",
|
||||||
|
group: "tools",
|
||||||
img: "md-image",
|
img: "md-image",
|
||||||
// notTitle:true,
|
// notTitle:true,
|
||||||
notAdd: true,
|
notAdd: true,
|
||||||
@@ -366,6 +370,7 @@ export const modelData = [
|
|||||||
{
|
{
|
||||||
type: "textPicture",
|
type: "textPicture",
|
||||||
name: "文字图片",
|
name: "文字图片",
|
||||||
|
group: "base",
|
||||||
drawer: true,
|
drawer: true,
|
||||||
notAdd: true,
|
notAdd: true,
|
||||||
|
|
||||||
@@ -411,6 +416,7 @@ export const modelData = [
|
|||||||
{
|
{
|
||||||
type: "tpl_ad_list",
|
type: "tpl_ad_list",
|
||||||
name: "广告魔方",
|
name: "广告魔方",
|
||||||
|
group: "base",
|
||||||
img: "md-image",
|
img: "md-image",
|
||||||
options: {
|
options: {
|
||||||
list: [
|
list: [
|
||||||
@@ -425,6 +431,7 @@ export const modelData = [
|
|||||||
{
|
{
|
||||||
type: "menu",
|
type: "menu",
|
||||||
name: "宫格导航",
|
name: "宫格导航",
|
||||||
|
group: "base",
|
||||||
img: "md-image",
|
img: "md-image",
|
||||||
close: true,
|
close: true,
|
||||||
options: {
|
options: {
|
||||||
@@ -475,6 +482,7 @@ export const modelData = [
|
|||||||
{
|
{
|
||||||
type: "search",
|
type: "search",
|
||||||
name: "搜索",
|
name: "搜索",
|
||||||
|
group: "base",
|
||||||
img: "md-image",
|
img: "md-image",
|
||||||
notAdd: true,
|
notAdd: true,
|
||||||
notLink: true,
|
notLink: true,
|
||||||
@@ -490,6 +498,7 @@ export const modelData = [
|
|||||||
{
|
{
|
||||||
type: "goods",
|
type: "goods",
|
||||||
name: "商品分类",
|
name: "商品分类",
|
||||||
|
group: "base",
|
||||||
img: "md-image",
|
img: "md-image",
|
||||||
notAdd: true,
|
notAdd: true,
|
||||||
notLink: true,
|
notLink: true,
|
||||||
@@ -556,6 +565,7 @@ export const modelData = [
|
|||||||
{
|
{
|
||||||
type: "notice",
|
type: "notice",
|
||||||
name: "公告",
|
name: "公告",
|
||||||
|
group: "base",
|
||||||
img: "md-image",
|
img: "md-image",
|
||||||
notAdd: false,
|
notAdd: false,
|
||||||
notLink: true,
|
notLink: true,
|
||||||
@@ -572,23 +582,12 @@ export const modelData = [
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
type: "promotions",
|
|
||||||
name: "促销活动",
|
|
||||||
img: "md-image",
|
|
||||||
notAdd: true,
|
|
||||||
notLink: true,
|
|
||||||
notImg: true,
|
|
||||||
close: true,
|
|
||||||
options: {
|
|
||||||
list: []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
notAdd: true,
|
notAdd: true,
|
||||||
notImg: true,
|
notImg: true,
|
||||||
notLink: true,
|
notLink: true,
|
||||||
drawerPromotions: true,
|
drawerPromotions: true,
|
||||||
|
group: "marketing",
|
||||||
type: "promotionDetail",
|
type: "promotionDetail",
|
||||||
promotionsType: "PINTUAN",
|
promotionsType: "PINTUAN",
|
||||||
name: "拼团活动",
|
name: "拼团活动",
|
||||||
@@ -605,6 +604,7 @@ export const modelData = [
|
|||||||
notImg: true,
|
notImg: true,
|
||||||
notLink: true,
|
notLink: true,
|
||||||
drawerPromotions: true,
|
drawerPromotions: true,
|
||||||
|
group: "marketing",
|
||||||
type: "promotionDetail",
|
type: "promotionDetail",
|
||||||
promotionsType: "LIVE",
|
promotionsType: "LIVE",
|
||||||
name: "直播活动",
|
name: "直播活动",
|
||||||
@@ -621,6 +621,7 @@ export const modelData = [
|
|||||||
notImg: true,
|
notImg: true,
|
||||||
notLink: true,
|
notLink: true,
|
||||||
drawerPromotions: true,
|
drawerPromotions: true,
|
||||||
|
group: "marketing",
|
||||||
type: "promotionDetail",
|
type: "promotionDetail",
|
||||||
promotionsType: "SECKILL",
|
promotionsType: "SECKILL",
|
||||||
name: "秒杀活动",
|
name: "秒杀活动",
|
||||||
@@ -637,6 +638,7 @@ export const modelData = [
|
|||||||
notImg: true,
|
notImg: true,
|
||||||
notLink: true,
|
notLink: true,
|
||||||
drawerPromotions: true,
|
drawerPromotions: true,
|
||||||
|
group: "marketing",
|
||||||
type: "promotionDetail",
|
type: "promotionDetail",
|
||||||
promotionsType: "KANJIA",
|
promotionsType: "KANJIA",
|
||||||
name: "砍价活动",
|
name: "砍价活动",
|
||||||
@@ -651,6 +653,7 @@ export const modelData = [
|
|||||||
{
|
{
|
||||||
type: "video",
|
type: "video",
|
||||||
name: "视频",
|
name: "视频",
|
||||||
|
group: "base",
|
||||||
img: "md-image",
|
img: "md-image",
|
||||||
notAdd: true,
|
notAdd: true,
|
||||||
notImg: true,
|
notImg: true,
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
style="margin-left: 20px"
|
style="margin-left: 20px"
|
||||||
size="small"
|
size="small"
|
||||||
plain
|
plain
|
||||||
v-if="res.type == 'promotions' || res.drawerPromotions"
|
v-if="res.drawerPromotions"
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="selectPromotions()"
|
@click="selectPromotions()"
|
||||||
>选择促销活动</el-button
|
>选择促销活动</el-button
|
||||||
@@ -95,9 +95,7 @@
|
|||||||
<div
|
<div
|
||||||
class="decorate-list"
|
class="decorate-list"
|
||||||
v-if="
|
v-if="
|
||||||
(res.type != 'tpl_ad_list' &&
|
(res.type != 'tpl_ad_list' && res.type != 'tpl_activity_list') ||
|
||||||
res.type != 'tpl_activity_list' &&
|
|
||||||
res.type != 'promotions') ||
|
|
||||||
res.drawer ||
|
res.drawer ||
|
||||||
res.drawerPromotions
|
res.drawerPromotions
|
||||||
"
|
"
|
||||||
|
|||||||
@@ -3,26 +3,30 @@
|
|||||||
<!-- 拖拽栏 ,展示栏 -->
|
<!-- 拖拽栏 ,展示栏 -->
|
||||||
<div class="model-view">
|
<div class="model-view">
|
||||||
<div class="model-view-menu">
|
<div class="model-view-menu">
|
||||||
<draggable
|
<div
|
||||||
class="model-view-menu-item"
|
v-for="grp in modelGroups"
|
||||||
:list="modelData"
|
:key="grp.key"
|
||||||
:item-key="getModelKey"
|
class="model-group"
|
||||||
:clone="cloneModel"
|
|
||||||
:move="handleMove"
|
|
||||||
:group="{ name: 'model', pull: 'clone', put: false, animation: 150 }"
|
|
||||||
:sort="false"
|
|
||||||
ghost-class="ghost"
|
|
||||||
>
|
>
|
||||||
<template #item="{ element: model }">
|
<div class="model-group-title">{{ grp.title }}</div>
|
||||||
<li
|
<draggable
|
||||||
v-if="!model.drawer && !model.drawerPromotions"
|
class="model-view-menu-item"
|
||||||
class="model-item"
|
:list="grp.list"
|
||||||
>
|
:item-key="getModelKey"
|
||||||
<img src alt />
|
:clone="cloneModel"
|
||||||
<span>{{ model.name }}</span>
|
:move="handleMove"
|
||||||
</li>
|
:group="{ name: 'model', pull: 'clone', put: false, animation: 150 }"
|
||||||
</template>
|
:sort="false"
|
||||||
</draggable>
|
ghost-class="ghost"
|
||||||
|
>
|
||||||
|
<template #item="{ element: model }">
|
||||||
|
<li class="model-item">
|
||||||
|
<img src alt />
|
||||||
|
<span>{{ model.name }}</span>
|
||||||
|
</li>
|
||||||
|
</template>
|
||||||
|
</draggable>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="model-view-content">
|
<div class="model-view-content">
|
||||||
@@ -40,6 +44,7 @@
|
|||||||
<template #item="{ element, index }">
|
<template #item="{ element, index }">
|
||||||
<div class="list">
|
<div class="list">
|
||||||
<component
|
<component
|
||||||
|
v-if="templates[element.type]"
|
||||||
class="component"
|
class="component"
|
||||||
:class="{ active: selected == index }"
|
:class="{ active: selected == index }"
|
||||||
@click="handleComponent(element, index)"
|
@click="handleComponent(element, index)"
|
||||||
@@ -108,6 +113,20 @@ export default {
|
|||||||
deep: true,
|
deep: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
// 组件面板三类分组(无 group 的条目仅供抽屉使用,不进面板)
|
||||||
|
modelGroups() {
|
||||||
|
const groups = [
|
||||||
|
{ key: "base", title: "基础组件" },
|
||||||
|
{ key: "marketing", title: "营销组件" },
|
||||||
|
{ key: "tools", title: "工具组件" },
|
||||||
|
];
|
||||||
|
return groups.map((g) => ({
|
||||||
|
...g,
|
||||||
|
list: this.modelData.filter((m) => m.group === g.key),
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
@@ -150,7 +169,10 @@ export default {
|
|||||||
API_Other.getHomeData(this.$route.query.id).then((res) => {
|
API_Other.getHomeData(this.$route.query.id).then((res) => {
|
||||||
this.contentData = JSON.parse(res.result.pageData);
|
this.contentData = JSON.parse(res.result.pageData);
|
||||||
|
|
||||||
this.handleComponent(this.contentData.list[0], 0);
|
const first = this.contentData.list[0];
|
||||||
|
if (first && this.templates[first.type]) {
|
||||||
|
this.handleComponent(first, 0);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,11 +3,20 @@
|
|||||||
.model-view-menu {
|
.model-view-menu {
|
||||||
flex: 1.5;
|
flex: 1.5;
|
||||||
min-width: 250px;
|
min-width: 250px;
|
||||||
> .model-view-menu-item {
|
.model-view-menu-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
.model-group-title {
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #303133;
|
||||||
|
margin: 10px 5px 8px;
|
||||||
|
}
|
||||||
|
.model-group:first-child .model-group-title {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.model-config {
|
.model-config {
|
||||||
flex: 2.5;
|
flex: 2.5;
|
||||||
|
|||||||
Reference in New Issue
Block a user