|
@@ -7,7 +7,7 @@
|
|
|
<div class="topMenuRightBox">
|
|
|
<img src="@/assets/template/preview.png" class="previewImg"/>
|
|
|
<el-button type="primary" @click="gotoList">保存</el-button>
|
|
|
- <el-button type="info" @click="goStyle">退出</el-button>
|
|
|
+ <el-button type="info" @click="goStyle">上一步</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 工具栏 start ---------------------------------------->
|
|
@@ -18,53 +18,17 @@
|
|
|
<!-- 栅格布局 预览模式 start ---------------------------------------->
|
|
|
<div class="websiteBox">
|
|
|
<div class="pageTabsBox">
|
|
|
- <div :class="['pageTabsItem', editPageStatus === 1 ? 'active' : '']">首页</div>
|
|
|
- <div :class="['pageTabsItem', editPageStatus === 2 ? 'active' : '']">分类页</div>
|
|
|
- <div :class="['pageTabsItem', editPageStatus === 3 ? 'active' : '']">列表页</div>
|
|
|
- <div :class="['pageTabsItem', editPageStatus === 4 ? 'active' : '']">详情页</div>
|
|
|
- <div :class="['pageTabsItem', editPageStatus === 5 ? 'active' : '']">搜索页</div>
|
|
|
- <div :class="['pageTabsItem', editPageStatus === 6 ? 'active' : '']">自定义列表页</div>
|
|
|
- <div :class="['pageTabsItem', editPageStatus === 7 ? 'active' : '']">自定义详情页</div>
|
|
|
- </div>
|
|
|
- <div class="grid-layout-demo">
|
|
|
- <grid-layout :layout="this.$store.state.template.layout" :margin="[0,0]" :col-num="12" :row-height="rowHeight" :is-draggable="true" :is-resizable="true">
|
|
|
- <grid-item v-for="(item, index) in this.$store.state.template.layout" :key="item.i" :i="item.i" :x="item.x" :y="item.y" :w="item.w" :h="item.h" :is-resizable="false">
|
|
|
- <div class="grid-item-content">
|
|
|
- <!-- 页头板块 -->
|
|
|
- <div v-if="item.type == 'headSector'" class="moduleBox">
|
|
|
- <headSector />
|
|
|
- </div>
|
|
|
- <!-- 导航板块 -->
|
|
|
- <div v-if="item.type == 'menuSector'" class="moduleBox">
|
|
|
- <menuSector :id="item.i"/>
|
|
|
- </div>
|
|
|
- <!-- 图片标题模块 -->
|
|
|
- <div v-if="item.type == 'imgTitleSector'" class="moduleBox">
|
|
|
- <imgTitleSector />
|
|
|
- </div>
|
|
|
- <!-- 焦点图模块 -->
|
|
|
- <div v-if="item.type == 'bannerSector'" class="moduleBox">
|
|
|
- <bannerSector />
|
|
|
- </div>
|
|
|
- <!-- 多图模块 -->
|
|
|
- <div v-if="item.type == 'manyPictureSector'" class="moduleBox">
|
|
|
- <manyPictureSector />
|
|
|
- </div>
|
|
|
- <!-- 评论模块 -->
|
|
|
- <div v-if="item.type == 'commentSector'" class="moduleBox">
|
|
|
- <commentSector />
|
|
|
- </div>
|
|
|
- <!-- 双联文章列表模块 -->
|
|
|
- <div v-if="item.type == 'listSector'" class="moduleBox">
|
|
|
- <listSector />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </grid-item>
|
|
|
- </grid-layout>
|
|
|
+ <div :class="['pageTabsItem', this.$store.state.template.pageStatus === 1 ? 'active' : '']" @click="openPage(1)">首页</div>
|
|
|
+ <div :class="['pageTabsItem', this.$store.state.template.pageStatus === 2 ? 'active' : '']" @click="openPage(2)">分类页</div>
|
|
|
+ <div :class="['pageTabsItem', this.$store.state.template.pageStatus === 3 ? 'active' : '']" @click="openPage(3)">列表页</div>
|
|
|
+ <div :class="['pageTabsItem', this.$store.state.template.pageStatus === 4 ? 'active' : '']" @click="openPage(4)">详情页</div>
|
|
|
+ <div :class="['pageTabsItem', this.$store.state.template.pageStatus === 5 ? 'active' : '']" @click="openPage(5)">搜索页</div>
|
|
|
+ <div :class="['pageTabsItem', this.$store.state.template.pageStatus === 6 ? 'active' : '']" @click="openPage(6)">自定义列表页</div>
|
|
|
+ <div :class="['pageTabsItem', this.$store.state.template.pageStatus === 7 ? 'active' : '']" @click="openPage(7)">自定义详情页</div>
|
|
|
</div>
|
|
|
+ <pageIndex v-if="this.$store.state.template.pageStatus == 1"/>
|
|
|
</div>
|
|
|
<!-- 栅格布局 预览模式 end ---------------------------------------->
|
|
|
-
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -73,32 +37,17 @@
|
|
|
//引入公用样式
|
|
|
import '@/styles/global.less';
|
|
|
//引入vue-grid-layout拖拽效果
|
|
|
-import { GridLayout, GridItem } from 'vue-grid-layout';
|
|
|
+//import { GridLayout, GridItem } from 'vue-grid-layout';
|
|
|
//页面公用组件 end------------------------------------------------------------>
|
|
|
|
|
|
-//自助建站组件 start------------------------------------------------------------>
|
|
|
-//style1
|
|
|
-import headSector from './style/1/headSector.vue';
|
|
|
-import menuSector from './style/1/menuSector.vue';
|
|
|
-import imgTitleSector from './style/1/imgTitleSector.vue';
|
|
|
-import bannerSector from './style/1/bannerSector.vue';
|
|
|
-import manyPictureSector from './style/1/manyPictureSector.vue';
|
|
|
-import commentSector from './style/1/commentSector.vue';
|
|
|
-import listSector from './style/1/listSector.vue';
|
|
|
-//自助建站组件 end------------------------------------------------------------>
|
|
|
+//页面组件 start------------------------------------------------------------>
|
|
|
+import pageIndex from './page/pageIndex.vue';
|
|
|
+//页面组件 end------------------------------------------------------------>
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
- GridLayout,
|
|
|
- GridItem,
|
|
|
- //板块组件 style1
|
|
|
- headSector,
|
|
|
- menuSector,
|
|
|
- imgTitleSector,
|
|
|
- bannerSector,
|
|
|
- manyPictureSector,
|
|
|
- commentSector,
|
|
|
- listSector
|
|
|
+ //引入页面组件
|
|
|
+ pageIndex
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -106,30 +55,12 @@ export default {
|
|
|
windowStatus: false,
|
|
|
editPageStatus:1,//当前正在配置的页面 0 首页 1 分类页 2 列表页 3 详情页
|
|
|
rowHeight:10,
|
|
|
+ pageStatus:[],
|
|
|
//0.全局配置 end------------------------------------------------------------>
|
|
|
|
|
|
//1.编辑模块 start------------------------------------------------------------>
|
|
|
formLabelWidth: '120px',
|
|
|
- editModule: "",//待编辑的模块
|
|
|
//1.编辑模块 end------------------------------------------------------------>
|
|
|
-
|
|
|
- //2.保存的页面信息 start------------------------------------------------------------>
|
|
|
- pageData:{
|
|
|
- page_index:{
|
|
|
-
|
|
|
- },
|
|
|
- page_theme:{
|
|
|
-
|
|
|
- },
|
|
|
- page_list:{
|
|
|
-
|
|
|
- },
|
|
|
- page_article:{
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- //2.保存的页面信息 start------------------------------------------------------------>
|
|
|
-
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -149,35 +80,6 @@ export default {
|
|
|
path: '/templateList'
|
|
|
});
|
|
|
},
|
|
|
- //0.全局操作 end ------------------------------------------------------------>
|
|
|
-
|
|
|
- //添加模块
|
|
|
- // addModule(type) {
|
|
|
- // //type 组件名称
|
|
|
- // // 计算当前布局的最大 y 值
|
|
|
- // const maxY = Math.max(...this.layout.map(item => item.y), 0);
|
|
|
- // // type=1 顶部菜单
|
|
|
- // if(type==1){
|
|
|
- // this.layout.push({
|
|
|
- // i: this.layout.length,
|
|
|
- // x: 0,
|
|
|
- // y: maxY + 1,
|
|
|
- // w: 12,
|
|
|
- // h: 1,
|
|
|
- // type: type,
|
|
|
- // content:""
|
|
|
- // });
|
|
|
- // }
|
|
|
- // },
|
|
|
- //删除模块
|
|
|
- deleteModule(item) {
|
|
|
- //找到对应的模块删除掉
|
|
|
- for(let i = 0; i < this.layout.length; i++) {
|
|
|
- if(this.layout[i].i == item.i) {
|
|
|
- this.layout.splice(i, 1);
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
//打开弹出框
|
|
|
openWindow(item) {
|
|
|
this.editModule = item.i;
|
|
@@ -186,7 +88,12 @@ export default {
|
|
|
//关闭弹出框
|
|
|
closeWindow() {
|
|
|
this.windowStatus = false;
|
|
|
- }
|
|
|
+ },
|
|
|
+ //切换编辑的页面
|
|
|
+ openPage(num){
|
|
|
+ this.$store.commit('template/setPageStatus',num);
|
|
|
+ },
|
|
|
+ //0.全局操作 end ------------------------------------------------------------>
|
|
|
},
|
|
|
mounted(){
|
|
|
//设置网站id
|