城阳运营端pc前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

151 lines
4.8 KiB

<template>
<div class="mw-cpt a-fade-in"
5 years ago
:ref="item.tempOnlyId"
@click="focusCpt">
<!-- 最顶部标题组件 -->
<page-header v-if="item.componentFrontId==='resi-titleList-home-gridNameTitle'"
:item=item
:isFocused=isFocused></page-header>
<!-- 新消息组件 -->
<div class="mw-cpt-new_msg"
5 years ago
v-else-if="item.componentFrontId==='resi-floatingList-mine-newMessageButton'">
<div class="d-cpt-wrap">
5 years ago
<img v-if="item.demoData.ico"
:src="item.demoData.ico">
<img v-else
src="@/assets/img/modules/wx-mini/index-set/page/msg.png">
<span>{{ item.demoData.text }}</span>
</div>
</div>
<!-- 爱心互助 -->
<heart v-else-if="item.componentFrontId==='resi-functionList-heart-banner'
||item.componentFrontId==='resi-functionList-heart-new'
||item.componentFrontId==='resi-functionList-heart-history'"
:item=item
:isFocused=isFocused></heart>
<!-- 党建声音最新发布特色文章轮播图新闻最新发布带标签专题文章 -->
<div v-else-if="item.componentFrontId==='resi-functionList-voice-newsList'
||item.componentFrontId==='resi-functionList-voice-newsList2'
4 years ago
||item.componentFrontId==='resi-topList-voice-hotNewsSwiper'
||item.componentFrontId==='resi-functionList-voice-listwithtag'
4 years ago
||item.componentFrontId==='resi-functionList-voice-speciallist'">
<voice :item=item
:isFocused=isFocused></voice>
</div>
5 years ago
<!-- 党群议事结案项目最新议题 -->
<div v-else-if="item.componentFrontId==='resi-functionList-hall-latestIssueList'
||item.componentFrontId==='resi-functionList-hall-closedProjectList'">
<issue :item=item
:isFocused=isFocused></issue>
</div>
<!-- 积分银行积分排名党员积分排行 -->
4 years ago
<div v-else-if="item.componentFrontId==='resi-functionList-score-rank'||item.componentFrontId==='resi-functionList-top-party'
||item.componentFrontId==='resi-functionList-score-rank-2'">
<score :item=item
:isFocused=isFocused></score>
5 years ago
</div>
4 years ago
<!-- 扩展功能更多功能1更多功能2快捷入口问卷调查 -->
<div v-else-if="item.componentFrontId==='resi-functionList-extend-moreFunctionIcons'
4 years ago
||item.componentFrontId==='resi-functionList-extend-moreFunctionIcons2'
||item.componentFrontId==='resi-functionList-extend-quickentry'
||item.componentFrontId==='resi-functionList-extend-question'">
4 years ago
<extended :item=item
:isFocused=isFocused></extended>
5 years ago
</div>
<!-- 楼院小组推荐小组 -->
<div v-else-if="item.componentFrontId==='resi-functionList-group-recommendGroupSlider'">
<group :item=item
:isFocused=isFocused></group>
5 years ago
</div>
5 years ago
<!-- 占位组件 -->
5 years ago
<div class="mw-cpt-placeholder"
v-else>
<div class="d-cpt-wrap">
{{ item.componentName }}
</div>
</div>
<!-- 操作区 -->
<div class="d-cpt-operate a-scale-in"
5 years ago
z
5 years ago
:class="{'z-small': item.region!=='functionList'}"
v-show="isFocused"
@click.stop>
<div class="d-cpt-btn"
v-show="item.region==='functionList'"
@click="changeCptDisplayOrder('up')">
<img src="@/assets/img/modules/wx-mini/index-set/up.png">
<p>上移</p>
</div>
5 years ago
<div class="d-cpt-btn"
4 years ago
5 years ago
@click="delCpt">
<img src="@/assets/img/modules/wx-mini/index-set/del.png">
<p>删除</p>
</div>
5 years ago
<div class="d-cpt-btn"
v-show="item.region==='functionList'"
@click="changeCptDisplayOrder('down')">
<img src="@/assets/img/modules/wx-mini/index-set/down.png">
<p>下移</p>
</div>
</div>
</div>
</template>
<script>
import nextTick from 'dai-js/tools/nextTick'
import pageHeader from './pageHeader.vue'
import heart from './heart'
import voice from './voice'
import issue from './issue'
4 years ago
import extended from './extended'
import score from './score'
import group from './group'
export default {
name: 'cptItem',
data () {
return {}
},
components: {
pageHeader,
heart,
voice,
issue,
4 years ago
extended,
score,
group,
},
props: {
isFocused: Boolean,
item: Object
},
methods: {
delCpt () {
this.$emit('del', this.item)
},
async changeCptDisplayOrder (direction) {
this.$emit('sort', this.item, direction)
await nextTick(200)
const { item: { tempOnlyId } } = this
this.$refs[tempOnlyId].scrollIntoViewIfNeeded(false)
},
focusCpt () {
4 years ago
console.log(this.item)
this.$emit('focus', this.item)
}
}
}
</script>
<style lang="scss" src="@/assets/scss/modules/wx-mini/index-set.scss"></style>