|
@@ -1,222 +1,120 @@
|
|
<template>
|
|
<template>
|
|
- <div class="sectorBox">
|
|
|
|
- <div class="sectorItemBox" @click="addModule('adSector',8,adSector)" @drag="drag('adSector',8,adSector)" @dragend="dragend('adSector',8,adSector)" >
|
|
|
|
- <div class="sectorItem">
|
|
|
|
- <img src="http://img.bjzxtw.org.cn/pre/image/png/20250604/1748998088187321.png" />
|
|
|
|
- </div>
|
|
|
|
- <div class="sectorItemTitle">通栏广告</div>
|
|
|
|
|
|
+ <div class="sectorBox">
|
|
|
|
+ <div class="sectorItemBox"
|
|
|
|
+ @click="addModule('adSector', 12, adSector)"
|
|
|
|
+ @drag="drag('adSector', 12, adSector)"
|
|
|
|
+ @dragend="dragend('adSector', 12, adSector)"
|
|
|
|
+ >
|
|
|
|
+ <div class="sectorItem">
|
|
|
|
+ <img src="http://img.bjzxtw.org.cn/pre/image/png/20250604/1748998088187321.png" />
|
|
|
|
+ </div>
|
|
|
|
+ <div class="sectorItemTitle">通栏广告</div>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
- <div class="sectorItemBox" @click="addModule('mainListSector',92,mainListSector)" @drag="drag('mainListSector',33,mainListSector)" @dragend="dragend('mainListSector',33,mainListSector)" >
|
|
|
|
- <div class="sectorItem">
|
|
|
|
- <img src="@/assets/template/sector/listSector.png"/>
|
|
|
|
- </div>
|
|
|
|
- <div class="sectorItemTitle">主文章列表</div>
|
|
|
|
- </div>
|
|
|
|
- <div class="sectorItemBox" @click="addModule('listSector',33,listSector)" @drag="drag('listSector',33,listSector)" @dragend="dragend('listSector',33,listSector)" >
|
|
|
|
- <div class="sectorItem">
|
|
|
|
- <img src="@/assets/template/sector/newsSector.png"/>
|
|
|
|
- </div>
|
|
|
|
- <div class="sectorItemTitle">次级文章列表</div>
|
|
|
|
- </div>
|
|
|
|
- <div class="sectorItemBox" @click="addModule('friendShipLinkSector',20,friendShipLinkSector)" @drag="drag('friendShipLinkSector',20,friendShipLinkSector)" @dragend="dragend('friendShipLinkSector',20,friendShipLinkSector)" >
|
|
|
|
- <div class="sectorItem">
|
|
|
|
- <img src="@/assets/template/sector/linkSector.png"/>
|
|
|
|
- </div>
|
|
|
|
- <div class="sectorItemTitle">友情链接</div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
|
export default {
|
|
export default {
|
|
- props: {
|
|
|
|
- type: {
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
- data() {
|
|
|
|
- return {
|
|
|
|
- //添加通栏广告模块 start---------------------------------------->
|
|
|
|
- adSector:{
|
|
|
|
- sectorName:"adSector",//板块名称
|
|
|
|
- componentList:[
|
|
|
|
- {
|
|
|
|
- component_type:3,//组件类型 1=新闻(单个) 2=新闻(多个) 3=广告 4=友情链接 5=底部导航 6=静态html组件 7=文字 8=评论
|
|
|
|
- component_style:1,//该组件使用哪个展示样式
|
|
|
|
- component_name:"",
|
|
|
|
- sort:1,
|
|
|
|
- componentData:{
|
|
|
|
- ad_id:"",//广告位id
|
|
|
|
- text:"通栏广告", //广告位名称
|
|
|
|
- width:1200, //广告位宽度
|
|
|
|
- height:60, //广告位高度
|
|
|
|
- }//该组件不请求指定类型的数据,但是后端需要返回imgUrl
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
- },
|
|
|
|
- //添加通栏广告模块 start---------------------------------------->
|
|
|
|
|
|
+ props: {
|
|
|
|
+ type: {
|
|
|
|
|
|
- //文章列表板块 start---------------------------------------->
|
|
|
|
- listSector:{
|
|
|
|
- sectorName:"listSector",//板块名称
|
|
|
|
- componentList:[
|
|
|
|
- {
|
|
|
|
- component_type:7,//纯文本
|
|
|
|
- component_style:1,//该组件使用哪个展示样式
|
|
|
|
- component_name:"styleTitle",
|
|
|
|
- sort:1,
|
|
|
|
- componentData:{
|
|
|
|
- text:"板块标题"
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- component_type:1,
|
|
|
|
- component_style:1,//该组件使用哪个展示样式
|
|
|
|
- component_name:"listNews",
|
|
|
|
- sort:2,
|
|
|
|
- componentData:{
|
|
|
|
- category_id:[],
|
|
|
|
- page:1,
|
|
|
|
- pageSize:5,
|
|
|
|
- listType:[
|
|
|
|
- "title",
|
|
|
|
- "created_time"
|
|
|
|
- ]
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- component_type:1,
|
|
|
|
- component_style:1,//该组件使用哪个展示样式
|
|
|
|
- component_name:"listNews",
|
|
|
|
- sort:3,
|
|
|
|
- componentData:{
|
|
|
|
- category_id:[],
|
|
|
|
- page:1,
|
|
|
|
- pageSize:5,
|
|
|
|
- listType:[
|
|
|
|
- "title",
|
|
|
|
- "created_time"
|
|
|
|
- ]
|
|
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ //添加通栏广告模块 start---------------------------------------->
|
|
|
|
+ adSector: {
|
|
|
|
+ "sectorName": "adSector",//板块名称
|
|
|
|
+ "componentList": [
|
|
|
|
+ {
|
|
|
|
+ "component_type": 2,//组件类型 1=新闻(选择导航池id)2=广告(输入广告位名称)
|
|
|
|
+ "component_style": 1,//组件选择了哪个版式
|
|
|
|
+ "sort": 1,
|
|
|
|
+ "componentData": {}
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ "ad": {
|
|
|
|
+ "width": 1200, //宽度
|
|
|
|
+ "height": 90, //高度
|
|
|
|
+ "name": "",//广告名称
|
|
|
|
+ "price": 0,//价格
|
|
|
|
+ "introduce":"",//介绍
|
|
|
|
+ "website_id": "",//网站id
|
|
|
|
+ "thumb": "https://img.bjzxtw.org.cn/pre/image/png/20250530/1748588901281358.png",//示例图 - 默认值
|
|
|
|
+ "typeid": 2,//广告类型 - 2 图片
|
|
|
|
+ "ad_tag": ""//广告标识 - 网站标识 + 页面名称 + sort
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //添加通栏广告模块 start---------------------------------------->
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ //添加模块
|
|
|
|
+ addModule(type, h, jsonData) {
|
|
|
|
+ let data = {
|
|
|
|
+ source: "click",//添加方式为点击
|
|
|
|
+ type: type,
|
|
|
|
+ h: h,
|
|
|
|
+ jsonData: jsonData
|
|
}
|
|
}
|
|
- },
|
|
|
|
- ]
|
|
|
|
- },
|
|
|
|
- //文章列表板块 end---------------------------------------->
|
|
|
|
-
|
|
|
|
- //友情链接板块 start---------------------------------------->
|
|
|
|
- friendShipLinkSector:{
|
|
|
|
- sectorName:"friendShipLinkSector",//友情链接无需提交数据
|
|
|
|
- componentList:[
|
|
|
|
- {
|
|
|
|
- component_type:7, //纯文本
|
|
|
|
- component_style:1,//该组件使用哪个展示样式
|
|
|
|
- component_name:"styleTitle",
|
|
|
|
- sort:1,
|
|
|
|
- componentData:{
|
|
|
|
- text:"板块标题"
|
|
|
|
|
|
+ console.log(data);
|
|
|
|
+ this.$store.commit('template/addModule', data);
|
|
|
|
+ },
|
|
|
|
+ //拖拽开始
|
|
|
|
+ drag(type, h, jsonData) {
|
|
|
|
+ let data = {
|
|
|
|
+ type: type,
|
|
|
|
+ h: h,
|
|
|
|
+ jsonData: jsonData
|
|
}
|
|
}
|
|
- },
|
|
|
|
- {
|
|
|
|
- component_type:4,
|
|
|
|
- component_style:1,//该组件使用哪个展示样式
|
|
|
|
- component_name:"",
|
|
|
|
- sort:1,
|
|
|
|
- componentData:{}
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
- },
|
|
|
|
- //友情链接板块 end---------------------------------------->
|
|
|
|
-
|
|
|
|
- //主文章列表 start---------------------------------------->
|
|
|
|
- mainListSector:{
|
|
|
|
- sectorName:"mainListSector",//主文章列表
|
|
|
|
- componentList:[
|
|
|
|
- {
|
|
|
|
- component_type:9, //页面必备组件类型
|
|
|
|
- component_style:1,
|
|
|
|
- component_name:"listMain",
|
|
|
|
- sort:1,
|
|
|
|
- componentData:{
|
|
|
|
- category_id:[],
|
|
|
|
- page:1,
|
|
|
|
- pageSize:1,
|
|
|
|
- listType:[
|
|
|
|
- "title",
|
|
|
|
- "created_time",//创建时间
|
|
|
|
- //"author",//作者
|
|
|
|
- //"imgUrl",//缩略图片
|
|
|
|
- //"introduce",//描述
|
|
|
|
- ]
|
|
|
|
|
|
+ this.$store.commit('template/drag', data);
|
|
|
|
+ },
|
|
|
|
+ //拖拽结束
|
|
|
|
+ dragend(type, h, jsonData) {
|
|
|
|
+ let data = {
|
|
|
|
+ type: type,
|
|
|
|
+ h: h,
|
|
|
|
+ jsonData: jsonData
|
|
}
|
|
}
|
|
- },
|
|
|
|
- ]
|
|
|
|
- }
|
|
|
|
- //主文章列表 end---------------------------------------->
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- methods: {
|
|
|
|
- //添加模块
|
|
|
|
- addModule(type,h,jsonData){
|
|
|
|
- let data = {
|
|
|
|
- source:"click",//添加方式为点击
|
|
|
|
- type: type,
|
|
|
|
- h: h,
|
|
|
|
- jsonData: jsonData
|
|
|
|
- }
|
|
|
|
- console.log(data);
|
|
|
|
- this.$store.commit('template/addModule',data);
|
|
|
|
- },
|
|
|
|
- //拖拽开始
|
|
|
|
- drag(type,h,jsonData){
|
|
|
|
- let data = {
|
|
|
|
- type: type,
|
|
|
|
- h: h,
|
|
|
|
- jsonData: jsonData
|
|
|
|
- }
|
|
|
|
- this.$store.commit('template/drag',data);
|
|
|
|
- },
|
|
|
|
- //拖拽结束
|
|
|
|
- dragend(type,h,jsonData){
|
|
|
|
- let data = {
|
|
|
|
- type: type,
|
|
|
|
- h: h,
|
|
|
|
- jsonData: jsonData
|
|
|
|
- }
|
|
|
|
- this.$store.commit('template/dragend',data);
|
|
|
|
|
|
+ this.$store.commit('template/dragend', data);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped lang="less">
|
|
<style scoped lang="less">
|
|
- .sectorBox {
|
|
|
|
|
|
+.sectorBox {
|
|
height: 100%;
|
|
height: 100%;
|
|
|
|
+
|
|
.sectorItemBox {
|
|
.sectorItemBox {
|
|
- box-sizing: border-box;
|
|
|
|
- padding: 0 20px 40px 20px;
|
|
|
|
- cursor: pointer;
|
|
|
|
- .sectorItem {
|
|
|
|
- border: 1px solid #333644;
|
|
|
|
- padding: 10px;
|
|
|
|
- border-radius: 8px;
|
|
|
|
- &:hover {
|
|
|
|
- background: #333644;
|
|
|
|
- transform: scale(1.1);
|
|
|
|
- transition: all 0.2s ease-in-out;
|
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ padding: 0 20px 40px 20px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+
|
|
|
|
+ .sectorItem {
|
|
|
|
+ border: 1px solid #333644;
|
|
|
|
+ padding: 10px;
|
|
|
|
+ border-radius: 8px;
|
|
|
|
+
|
|
|
|
+ &:hover {
|
|
|
|
+ background: #333644;
|
|
|
|
+ transform: scale(1.1);
|
|
|
|
+ transition: all 0.2s ease-in-out;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ img {
|
|
|
|
+ display: block;
|
|
|
|
+ width: 100%;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- img {
|
|
|
|
- display: block;
|
|
|
|
- width: 100%;
|
|
|
|
|
|
+
|
|
|
|
+ .sectorItemTitle {
|
|
|
|
+ color: #fff;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ padding: 10px 0 0 0;
|
|
|
|
+ text-align: center;
|
|
}
|
|
}
|
|
- }
|
|
|
|
- .sectorItemTitle {
|
|
|
|
- color: #fff;
|
|
|
|
- font-size: 14px;
|
|
|
|
- padding: 10px 0 0 0;
|
|
|
|
- text-align: center;
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+}
|
|
</style>
|
|
</style>
|