<template>
    <div class="componentWindowBox">
        <!--开发助手-->
        <!-- <div class="testAssistant">
            <div class="testAssistantTitle">
                代码助手：
            </div>
            <div class="testAssistantContent">
                <div class="testAssistantContentItem">
                    <div>当前板块id:</div>
                    <div>{{this.$store.state.template.editSectorId}}</div>
                </div>
                <div class="testAssistantContentItem">
                    <div>当前板块所在的页面:</div>
                    <div v-if="this.$store.state.template.pageStatus == 1">首页</div>
                    <div v-if="this.$store.state.template.pageStatus == 2">分类页</div>
                    <div v-if="this.$store.state.template.pageStatus == 3">列表页</div>
                    <div v-if="this.$store.state.template.pageStatus == 4">详情页</div>
                    <div v-if="this.$store.state.template.pageStatus == 5">搜索页</div>
                    <div v-if="this.$store.state.template.pageStatus == 6">底部列表页</div>
                    <div v-if="this.$store.state.template.pageStatus == 7">底部详情页</div>
                </div>
                <div class="testAssistantContentItem">
                    <div>当前组件在此板块中的位置:</div>
                    <div>{{this.$store.state.template.editComponentSort}}</div>
                </div>
                <div class="testAssistantContentItem">
                    <div>当前板块在Json数据中的位置:</div>
                    <div>{{this.$store.state.template.editDataSort}}</div>
                </div>
                <div class="testAssistantContentItem">
                    <div>当前组件样式:</div>
                    <div>{{this.$store.state.template.editComponentStyle}}</div>
                </div>
            </div>
        </div> -->
        <div class="componentStyleBox">
            <div class="componentStyleBoxContent">
                <!--1.头条组件 start---------------------------------------->
                <div v-if="this.$store.state.template.editComponentType == 1" class="componentScrollBoxStyle1">
                    <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 1 ? 'active' : '']" @click="selectUseStyleNumber(1)">
                        <img src="http://img.bjzxtw.org.cn/pre/image/png/20250603/1748914467583559.png"/>
                        <div class="componentScrollBoxItemTitle">大标题带三个子标题</div>
                    </div>
                    <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 2 ? 'active' : '']" @click="selectUseStyleNumber(2)">
                        <img src="http://img.bjzxtw.org.cn/pre/image/png/20250603/1748935989462533.png"/>
                        <div class="componentScrollBoxItemTitle">大标题带二个子标题</div>
                    </div>
                    <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 3 ? 'active' : '']" @click="selectUseStyleNumber(3)">
                        <img src="http://img.bjzxtw.org.cn/pre/image/png/20250603/1748936908630352.png"/>
                        <div class="componentScrollBoxItemTitle">大标题一个子标题</div>
                    </div>
                    <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 4 ? 'active' : '']" @click="selectUseStyleNumber(4)">
                        <img src="http://img.bjzxtw.org.cn/pre/image/png/20250603/1748936918177835.png"/>
                        <div class="componentScrollBoxItemTitle">只显示大标题</div>
                    </div>
                    <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 5 ? 'active' : '']" @click="selectUseStyleNumber(5)">
                        <img src="http://img.bjzxtw.org.cn/pre/image/png/20250603/1748937475668303.png"/>
                        <div class="componentScrollBoxItemTitle">滚动显示三个大标题</div>
                    </div>
                    <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 6 ? 'active' : '']" @click="selectUseStyleNumber(6)">
                        <img src="http://img.bjzxtw.org.cn/pre/image/png/20250603/1748937484282250.png"/>
                        <div class="componentScrollBoxItemTitle">滚动显示两个大标题</div>
                    </div>
                </div>
                <!--1.头条组件 end---------------------------------------->

                <!--2.焦点图组件 start---------------------------------------->
                <div v-if="this.$store.state.template.editComponentType == 2" class="componentScrollBoxStyle2">
                    <div class="componentScrollbigBog">
                        <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 1 ? 'active' : '']" @click="selectUseStyleNumber(1)">
                            <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250604/174901939842760.jpg"/>
                            <div class="componentScrollBoxItemTitle">底部显示当前页码</div>
                        </div>
                    </div>
                </div>
                <!--2.焦点图组件 end---------------------------------------->

                <!--3.焦点图组件 start---------------------------------------->
                <div v-if="this.$store.state.template.editComponentType == 3" class="componentScrollBoxStyle3">
                    <div class="componentScrollbigBog">
                        <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 1 ? 'active' : '']" @click="selectUseStyleNumber(1)">
                            <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250604/1749019582186582.jpg"/>
                            <div class="componentScrollBoxItemTitle">主题色每组标题</div>
                        </div>
                    </div>
                    <div class="componentScrollbigBog">
                        <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 2 ? 'active' : '']" @click="selectUseStyleNumber(2)">
                            <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250604/1749019602825563.jpg"/>
                            <div class="componentScrollBoxItemTitle">加粗每组标题</div>
                        </div>
                    </div>
                    <div class="componentScrollbigBog">
                        <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 3 ? 'active' : '']" @click="selectUseStyleNumber(3)">
                            <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250604/1749019612825652.jpg"/>
                            <div class="componentScrollBoxItemTitle">主题色首行标题</div>
                        </div>
                    </div>
                    <div class="componentScrollbigBog">
                        <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 4 ? 'active' : '']" @click="selectUseStyleNumber(4)">
                            <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250604/1749019620385462.jpg"/>
                            <div class="componentScrollBoxItemTitle">加粗首行标题</div>
                        </div>
                    </div>
                    <div class="componentScrollbigBog">
                        <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 5 ? 'active' : '']" @click="selectUseStyleNumber(5)">
                            <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250604/174901963225883.jpg"/>
                            <div class="componentScrollBoxItemTitle">不加粗标题</div>
                        </div>
                    </div>
                </div>
                <!--3.焦点图组件 start---------------------------------------->

                <!--4.两列布局新闻组件1 左侧 start---------------------------------------->
                <div v-if="this.$store.state.template.editComponentType == 4" class="componentScrollBoxStyle2">
                    <div class="componentScrollbigBog">
                        <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 1 ? 'active' : '']" @click="selectUseStyleNumber(1)">
                            <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250605/1749102223295015.jpg"/>
                            <div class="componentScrollBoxItemTitle">左侧大图在上小图在下,右侧标题加粗</div>
                        </div>
                    </div>
                    <div class="componentScrollbigBog">
                        <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 2 ? 'active' : '']" @click="selectUseStyleNumber(2)">
                            <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250605/1749102232438519.jpg"/>
                            <div class="componentScrollBoxItemTitle">左侧标题加粗,右侧大图在上小图在下</div>
                        </div>
                    </div>
                    <div class="componentScrollbigBog">
                        <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 3 ? 'active' : '']" @click="selectUseStyleNumber(3)">
                            <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250605/1749102631511603.jpg"/>
                            <div class="componentScrollBoxItemTitle">左侧小图在上大图在下,右侧标题加粗</div>
                        </div>
                    </div>
                    <div class="componentScrollbigBog">
                        <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 4 ? 'active' : '']" @click="selectUseStyleNumber(4)">
                            <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250605/1749102640761677.jpg"/>
                            <div class="componentScrollBoxItemTitle">左侧标题加粗,右侧小图在上大图在下</div>
                        </div>
                    </div>
                </div>
                <!--4.两列布局新闻组件1 左侧 end---------------------------------------->

                <!--5.两列布局新闻组件1 右侧 start---------------------------------------->
                <div v-if="this.$store.state.template.editComponentType == 5" class="componentScrollBoxStyle3">
                    <div class="componentScrollbigBog">
                        <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 1 ? 'active' : '']" @click="selectUseStyleNumber(1)">
                            <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250605/1749112729438904.jpg"/>
                            <div class="componentScrollBoxItemTitle">左侧图片,右侧标题灰色标记</div>
                        </div>
                    </div>
                    <div class="componentScrollbigBog">
                        <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 2 ? 'active' : '']" @click="selectUseStyleNumber(2)">
                            <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250605/1749113028559940.jpg"/>
                            <div class="componentScrollBoxItemTitle">右侧图片,左侧标题灰色标记</div>
                        </div>
                    </div>
                    <div class="componentScrollbigBog">
                        <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 3 ? 'active' : '']" @click="selectUseStyleNumber(3)">
                            <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250605/1749113088790743.jpg"/>
                            <div class="componentScrollBoxItemTitle">左侧图片,右侧标题带主题色标记</div>
                        </div>
                    </div>
                    <div class="componentScrollbigBog">
                        <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 4 ? 'active' : '']" @click="selectUseStyleNumber(4)">
                            <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250605/1749113088790743.jpg"/>
                            <div class="componentScrollBoxItemTitle">右侧图片,左侧标题带主题色标记</div>
                        </div>
                    </div>
                    <div class="componentScrollbigBog">
                        <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 5 ? 'active' : '']" @click="selectUseStyleNumber(5)">
                            <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250605/1749114491210881.jpg"/>
                            <div class="componentScrollBoxItemTitle">左侧图片,右侧标题带黑色标记</div>
                        </div>
                    </div>
                    <div class="componentScrollbigBog">
                        <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 6 ? 'active' : '']" @click="selectUseStyleNumber(6)">
                            <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250605/1749115022871339.jpg"/>
                            <div class="componentScrollBoxItemTitle">右侧图片,左侧标题带黑色标记</div>
                        </div>
                    </div>
                    <div class="componentScrollbigBog">
                        <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 7 ? 'active' : '']" @click="selectUseStyleNumber(7)">
                            <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250605/1749115161954033.jpg"/>
                            <div class="componentScrollBoxItemTitle">左侧图片,左侧标题不带标记</div>
                        </div>
                    </div>
                    <div class="componentScrollbigBog">
                        <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 8 ? 'active' : '']" @click="selectUseStyleNumber(8)">
                            <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250605/1749115171142913.jpg"/>
                            <div class="componentScrollBoxItemTitle">左侧图片,左侧标题不带标记</div>
                        </div>
                    </div>
                    <div class="componentScrollbigBog">
                        <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 9 ? 'active' : '']" @click="selectUseStyleNumber(9)">
                            <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250605/174911518234957.jpg"/>
                            <div class="componentScrollBoxItemTitle">图文交错摆放样式1</div>
                        </div>
                    </div>
                    <div class="componentScrollbigBog">
                        <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 10 ? 'active' : '']" @click="selectUseStyleNumber(10)">
                            <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250605/1749115193168545.jpg"/>
                            <div class="componentScrollBoxItemTitle">图文交错摆放样式2</div>
                        </div>
                    </div>
                    <div class="componentScrollbigBog">
                        <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 11 ? 'active' : '']" @click="selectUseStyleNumber(11)">
                            <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250605/1749115201985672.jpg"/>
                            <div class="componentScrollBoxItemTitle">图文交错摆放样式3</div>
                        </div>
                    </div>
                </div>
                <!--5.两列布局新闻组件1 右侧 end---------------------------------------->

                <!--6.两列布局新闻组件2 左侧 start---------------------------------------->
                <div v-if="this.$store.state.template.editComponentType == 6" class="componentScrollBoxStyle2">
                    <div class="componentScrollbigBog">
                        <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 1 ? 'active' : '']" @click="selectUseStyleNumber(1)">
                            <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250606/1749176134863144.jpg"/>
                            <div class="componentScrollBoxItemTitle">两列图文图片置顶</div>
                        </div>
                    </div>
                    <div class="componentScrollbigBog">
                        <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 2 ? 'active' : '']" @click="selectUseStyleNumber(2)">
                            <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250606/1749176145666694.jpg"/>
                            <div class="componentScrollBoxItemTitle">两列图文图片置底</div>
                        </div>
                    </div>
                    <div class="componentScrollbigBog">
                        <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 3 ? 'active' : '']" @click="selectUseStyleNumber(3)">
                            <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250606/1749176153747911.jpg"/>
                            <div class="componentScrollBoxItemTitle">图文混合左上右下</div>
                        </div>
                    </div>
                    <div class="componentScrollbigBog">
                        <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 4 ? 'active' : '']" @click="selectUseStyleNumber(4)">
                            <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250606/1749176160202729.jpg"/>
                            <div class="componentScrollBoxItemTitle">图文混合右下左上</div>
                        </div>
                    </div>
                </div>
                <!--6.两列布局新闻组件2 左侧 end---------------------------------------->

                <!--7.两列布局新闻组件2 右侧 start---------------------------------------->
                <div v-if="this.$store.state.template.editComponentType == 7" class="componentScrollBoxStyle3">
                    <div class="componentScrollbigBog">
                        <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 1 ? 'active' : '']" @click="selectUseStyleNumber(1)">
                            <img src="	http://img.bjzxtw.org.cn/pre/image/jpeg/20250606/1749178122927942.jpg"/>
                            <div class="componentScrollBoxItemTitle">图片在上，列表在下首标题加粗</div>
                        </div>
                    </div>
                    <div class="componentScrollbigBog">
                        <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 2 ? 'active' : '']" @click="selectUseStyleNumber(2)">
                            <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250606/1749178130533785.jpg"/>
                            <div class="componentScrollBoxItemTitle">图片在下，列表在上首标题加粗</div>
                        </div>
                    </div>
                    <div class="componentScrollbigBog">
                        <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 3 ? 'active' : '']" @click="selectUseStyleNumber(3)">
                            <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250606/1749178137907893.jpg"/>
                            <div class="componentScrollBoxItemTitle">图片在上，标题在下</div>
                        </div>
                    </div>
                    <div class="componentScrollbigBog">
                        <div :class="['componentScrollBoxItem', this.$store.state.template.editComponentStyle === 4 ? 'active' : '']" @click="selectUseStyleNumber(4)">
                            <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250606/1749178143998493.jpg"/>
                            <div class="componentScrollBoxItemTitle">图片在下，标题在上</div>
                        </div>
                    </div>
                </div>
                <!--7.两列布局新闻组件2 右侧 end---------------------------------------->

                <!--8.两列布局新闻组件3 左侧上半部分 start---------------------------------------->
                <!--8.两列布局新闻组件3 左侧上半部分 end---------------------------------------->

                <!--9.两列布局新闻组件3 左侧下半部分 start---------------------------------------->
                <!--9.两列布局新闻组件3 左侧下半部分 end---------------------------------------->

                <!--10.两列布局新闻组件3 右侧部分 start---------------------------------------->
                <!--10.两列布局新闻组件3 右侧部分 end---------------------------------------->


            </div>
        </div>
        <div class="componentWindowBoxFooter">
            <el-button type="info" @click="closeEditWindow">取消</el-button>
            <el-button type="primary" @click="submitData">确定</el-button>
        </div>
    </div>
</template>

<script>
export default {
  props: {
    
  },
  data() {
    return {
      //选择的组件样式
      useStyleNumber:0,
    }
  },
  methods: {
    //选择组件样式
    selectUseStyleNumber(number){
      this.$store.commit('template/selectComponentStyleNumber',number);
    },
    //关闭选择组件样式弹出框
    closeEditWindow(){
      this.$store.commit('template/closeComponentStyleStatus');
    },
    //提交编辑的数据
    submitData(){
      //提交修改
      this.$store.commit('template/setComponentStyleNumber');
      //关闭窗口
      this.$store.commit('template/closeComponentStyleStatus');
      //当前保存完了的数据
      //console.log(this.$store.state.template.pageData);
    }
  },
  mounted() {
    
  },
};
</script>

<style scoped lang="less">
.componentWindowBoxFooter {
    text-align: right;
}

//1.头条样式选择
.componentStyleBox {
    .componentStyleBoxContent {
        height: 400px;
        margin-bottom: 30px;
        overflow-y: auto;
        padding-right: 10px;

        //样式 一行一个
        .componentScrollBoxStyle1 {
            .componentScrollBoxItem {
                box-sizing: border-box;
                cursor: pointer;
                border:2px solid #fff;
                padding: 8px;
                background: #fff;
                margin-bottom: 20px;
                .componentScrollBoxItemTitle {
                    text-align: center;
                    font-size: 14px;
                    color: #333;
                    margin-top: 10px;
                    font-weight: bold;
                }
                img {
                    display: block;
                    width: 100%;
                }
            }
            .active {
                border:2px dashed #5570F1;
                padding: 8px;
                background: #e5e5ff;
                transition: all 0.5s;
            }
        }

        //一行两个
        .componentScrollBoxStyle2 {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            .componentScrollbigBog{
                width: 50%;
                box-sizing: border-box;
                margin-bottom: 20px;
                &:nth-child(odd) {
                    padding-right: 10px;
                }
                &:nth-child(even) {
                    padding-left: 10px;
                }
                .componentScrollBoxItem {
                    width: 100%;
                    border:2px solid #FFF;
                    box-sizing: border-box;
                    cursor: pointer;
                    border:2px solid #fff;
                    padding: 8px;
                    background: #fff;
                    .componentScrollBoxItemTitle {
                        text-align: center;
                        font-size: 14px;
                        color: #333;
                        margin-top: 10px;
                        font-weight: bold;
                    }
                    img {
                        display: block;
                        width: 100%;
                    }
                }
                .active {
                    border:2px dashed #5570F1;
                    padding: 8px;
                    background: #e5e5ff;
                    transition: all 0.5s;
                }
            }
        }

        //一行三个
        .componentScrollBoxStyle3 {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 2%;  // 使用gap属性来控制元素之间的间距
            .componentScrollbigBog{
                width: 32%;
                box-sizing: border-box;
                margin-bottom: 20px;
                .componentScrollBoxItem {
                    width: 100%;
                    border:2px solid #FFF;
                    box-sizing: border-box;
                    cursor: pointer;
                    border:2px solid #fff;
                    padding: 8px;
                    background: #fff;
                    .componentScrollBoxItemTitle {
                        text-align: center;
                        font-size: 14px;
                        color: #333;
                        margin-top: 10px;
                        font-weight: bold;
                    }
                    img {
                        display: block;
                        width: 100%;
                    }
                }
                .active {
                    border:2px dashed #5570F1;
                    padding: 8px;
                    background: #e5e5ff;
                    transition: all 0.5s;
                }
            }
        }
    }
}

</style>
