添加首页修改
parent
1a088979c8
commit
347ab12069
@ -0,0 +1,227 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div class="title">PRODUCT CENTER</div>
|
||||||
|
<div class="subTitle">产品中心</div>
|
||||||
|
<div class="productList">
|
||||||
|
<template v-for="(i,k) in (data.productCenterData||[])">
|
||||||
|
|
||||||
|
<div class="productItem">
|
||||||
|
<i class="del el-icon-circle-close" @click="data.productCenterData.splice(k, 1);"></i>
|
||||||
|
<div class="link" @click="openLinkDialog(i)">
|
||||||
|
跳转到
|
||||||
|
</div>
|
||||||
|
<div class="imageArea">
|
||||||
|
<UploadEl :data="i" field="homeConfigTypePic"/>
|
||||||
|
</div>
|
||||||
|
<div class="imageAreaModel">
|
||||||
|
<span contenteditable="true" @blur="edit1('configTypeDesc', k,$event)">
|
||||||
|
{{ i.configTypeDesc }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="titleArea">
|
||||||
|
<span contenteditable="true" @blur="edit1('homeConfigTypeName', k,$event)">
|
||||||
|
{{ i.homeConfigTypeName }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<br v-if="(k+1) % 4===0"/>
|
||||||
|
|
||||||
|
<div class="productItem" style="vertical-align: top" v-if="k === data.productCenterData.length-1">
|
||||||
|
<div style="width:100%;height:100%;"
|
||||||
|
@click="data.productCenterData.push({homeConfigTypePic:'',configTypeDesc:'介绍',homeConfigTypeName:'名称'})">
|
||||||
|
<i class="el-icon-circle-plus" style="font-size: 3vw; line-height: 16.7vw"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
<el-dialog
|
||||||
|
title="跳转到"
|
||||||
|
:visible.sync="linkDialogVisible"
|
||||||
|
width="50%">
|
||||||
|
|
||||||
|
<el-cascader
|
||||||
|
style="width:40vw"
|
||||||
|
@change="pageChange"
|
||||||
|
size="small"
|
||||||
|
v-model="linkDialogForm.linkData"
|
||||||
|
:props="{checkStrictly: true, value: 'id', label: 'name', children: 'list'}"
|
||||||
|
:options="productData"></el-cascader>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="linkDialogVisible = false">关 闭</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import UploadEl from "@/components/editEl/uploadEl.vue";
|
||||||
|
import {getHwWeb} from "@/api/hwWeb";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ProductCenter',
|
||||||
|
props: ['data'],
|
||||||
|
components: {UploadEl},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
productData: [],
|
||||||
|
linkDialogVisible: false,
|
||||||
|
linkDialogForm: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
getHwWeb(7).then(res => {
|
||||||
|
this.productData = JSON.parse(res?.data?.webJsonString || '{}').productList || []
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
openLinkDialog(e) {
|
||||||
|
this.linkDialogVisible = true
|
||||||
|
this.linkDialogForm = e || {}
|
||||||
|
},
|
||||||
|
pageChange(e) {
|
||||||
|
this.linkDialogForm.linkData = e
|
||||||
|
this.$props.data.productCenterData.linkData = e
|
||||||
|
},
|
||||||
|
edit1(key, index, e) {
|
||||||
|
this.$props.data.productCenterData[index][key] = e.target.innerText
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
@import "~@/style.less";
|
||||||
|
|
||||||
|
.title {
|
||||||
|
margin-top: 4.2vw;
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 2.5vw;
|
||||||
|
letter-spacing: 2px;
|
||||||
|
color: #0003;
|
||||||
|
}
|
||||||
|
|
||||||
|
.subTitle {
|
||||||
|
margin-top: 0.4vw;
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 1.9vw;
|
||||||
|
letter-spacing: 2px;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.productList {
|
||||||
|
position: relative;
|
||||||
|
margin-top: 4vw;
|
||||||
|
|
||||||
|
.productItem {
|
||||||
|
display: inline-block;
|
||||||
|
width: 14.5vw;
|
||||||
|
height: 22vw;
|
||||||
|
margin: 0 1vw;
|
||||||
|
box-shadow: 0 0 10px #0003;
|
||||||
|
position: relative;
|
||||||
|
margin-top: 2vw;
|
||||||
|
|
||||||
|
.del {
|
||||||
|
z-index: 2;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.link {
|
||||||
|
z-index: 2;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 4px;
|
||||||
|
right: 4px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #409eff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.imageArea {
|
||||||
|
width: 12.5vw;
|
||||||
|
height: 12.5vw;
|
||||||
|
padding: 1vw;
|
||||||
|
position: relative;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.imageAreaModel {
|
||||||
|
position: absolute;
|
||||||
|
width: 14.5vw;
|
||||||
|
height: 7.5vw;
|
||||||
|
top: 7vw;
|
||||||
|
left: 0;
|
||||||
|
opacity: 0;
|
||||||
|
background-image: radial-gradient(transparent 1px, fade(@standard-color, 80) 1px);
|
||||||
|
backdrop-filter: saturate(50%) blur(4px);
|
||||||
|
transition: all 0.3s;
|
||||||
|
overflow: auto;
|
||||||
|
|
||||||
|
span {
|
||||||
|
display: inline-block;
|
||||||
|
width: 10vw;
|
||||||
|
//height: 2.5vw;
|
||||||
|
padding: 2.25vw;
|
||||||
|
color: #fefefe;
|
||||||
|
font-size: 0.9vw;
|
||||||
|
line-height: 1.7vw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.titleArea {
|
||||||
|
width: 100%;
|
||||||
|
height: calc(100% - 14.5vw);
|
||||||
|
text-align: center;
|
||||||
|
background-color: #d8eaff;
|
||||||
|
transition: all 0.2s;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
transition: all 0.2s;
|
||||||
|
position: absolute;
|
||||||
|
top: 0%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
content: "";
|
||||||
|
border: 1vw solid #0000;
|
||||||
|
border-top-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
span {
|
||||||
|
transition: all 0.2s;
|
||||||
|
display: grid;
|
||||||
|
place-items: center;
|
||||||
|
height: 100%;
|
||||||
|
font-size: 1.4vw;
|
||||||
|
letter-spacing: 2px;
|
||||||
|
color: @standard-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.productItem:hover {
|
||||||
|
|
||||||
|
|
||||||
|
.imageAreaModel {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.titleArea {
|
||||||
|
background-color: @standard-color;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
border-top-color: #5c8eff;
|
||||||
|
}
|
||||||
|
|
||||||
|
span {
|
||||||
|
color: #fefefe;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Loading…
Reference in New Issue