添加首页修改

main
suixy 2 months ago
parent 1a088979c8
commit 347ab12069

@ -0,0 +1,264 @@
<template>
<div>
<div class="title">CLASSIC CASE</div>
<div class="subTitle">典型案例</div>
<div class="content">
<!-- <el-tabs v-model="activeName" :editable="true" @edit="tabEdit">-->
<el-tabs v-model="activeName">
<el-tab-pane :name="`${k}`" v-for="(i,k) in (data.classicCaseData||[])">
<template slot="label">
<span contenteditable="true" @blur="edit1('homeConfigTypeName', k,$event)">
{{ i.homeConfigTypeName }}
</span>
</template>
<transition name="fade">
<div v-if="activeName === `${k}`" style="position:relative;">
<div class="left">
<div class="caseTitle" contenteditable="true" @blur="edit1('caseInfoTitle', k,$event)">
{{ i.caseInfoTitle }}
</div>
<div class="caseInfo" contenteditable="true" @blur="edit1('caseInfoDesc', k,$event)">
{{ i.caseInfoDesc }}
</div>
<div class="getCaseInfo" @click="getCaseInfo(i)"> >></div>
</div>
<div class="learnMore" @click="getCaseInfo(i)">
<span>
想了解更多
</span>
<div class="toRight">
<i class="el-icon-arrow-right"></i>
</div>
</div>
<div class="caseImage">
<UploadEl :data="i" field="caseInfoPic"/>
</div>
</div>
</transition>
</el-tab-pane>
</el-tabs>
<el-tabs v-model="activeName" @tab-click="handleClick" v-if="false">
<el-tab-pane :label="i.homeConfigTypeName" :name="`${i.configTypeId}`"
v-for="(i,k) in (data.classicCaseData||[])">
<transition name="fade">
<div v-if="activeName === `${i.configTypeId}`" style="position:relative;">
<div class="left">
<div class="caseTitle">{{ i.caseInfoTitle }}</div>
<div class="caseInfo">
{{ i.caseInfoDesc }}
</div>
<div class="getCaseInfo" @click="getCaseInfo(i)"> >></div>
</div>
<div class="learnMore" @click="getCaseInfo(i)">
<span>
想了解更多
</span>
<div class="toRight">
<i class="el-icon-arrow-right"></i>
</div>
</div>
<div class="caseImage">
<el-image
style="width: 100%;height: 100%"
:src="i.caseInfoPic"
fit="contain"></el-image>
</div>
</div>
</transition>
</el-tab-pane>
</el-tabs>
</div>
</div>
</template>
<script>
import banner from '@/assets/image/banner.png'
import UploadEl from "@/components/editEl/uploadEl.vue";
// import {getTypicalHomeCaseInfo} from "@/api";
export default {
name: 'ProductCenter',
components: {UploadEl},
props: ['data'],
data() {
return {
banner,
activeName: "5",
info: {}
}
},
mounted() {
},
methods: {
tabEdit(e, action) {
if (action === 'remove') {
this.activeName = '0'
this.$props.data.classicCaseData.splice(parseFloat(e), 1);
}
if (action === 'add') {
this.$props.data.classicCaseData.push({
title: '请输入',
leftTitle: '请输入',
leftInfo: '请输入',
infos: [],
icon: ''
})
}
},
edit1(key, index, e) {
this.$props.data.classicCaseData[index][key] = e.target.innerText
},
getData() {
},
handleClick(tab, event) {
// getTypicalHomeCaseInfo({
// configTypeId: parseFloat(tab.name)
// }).then(e => {
// this.info = e.data
// })
},
getCaseInfo(e) {
// this.$router.push("test?id=" + e.configTypeId)
},
learnMore() {
}
}
}
</script>
<style lang="less" scoped>
@import "~@/style.less";
.content {
width: 65vw;
margin: 2.1vw auto 0;
/deep/ .el-tabs__nav-wrap::after {
display: none;
}
/deep/ .el-tabs__item {
letter-spacing: 3px;
padding: 0 30px;
height: 2.9vw;
font-size: 1.6vw;
}
/deep/ .el-tabs__item.is-active {
font-weight: 600;
color: @standard-color;
}
/deep/ .el-tabs__active-bar {
height: 4px;
background-color: @standard-color;
}
}
.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;
}
.left {
width: 52%;
padding-top: 1.7vw;
word-break: break-all;
.caseTitle {
color: #000;
font-size: 1.5vw;
text-align: left;
letter-spacing: 2px;
}
.caseInfo {
font-size: 1.1vw;
color: #666;
text-align: left;
margin-top: 0.9vw;
line-height: 1.78vw;
letter-spacing: 2px;
}
.getCaseInfo {
color: @standard-color;
font-size: 1.2vw;
margin-top: 1vw;
text-align: left;
letter-spacing: 2px;
cursor: pointer;
}
}
.learnMore {
width: 100%;
height: 4.7vw;
line-height: 4.7vw;
font-size: 1.1vw;
background-color: #3372ff;
text-align: left;
padding-left: 6vw;
color: #fefefe;
margin-top: 1.1vw;
letter-spacing: 2px;
cursor: pointer;
.toRight {
display: inline-block;
width: 2vw;
height: 2vw;
border: 1px solid #eee;
border-radius: 50%;
text-align: center;
line-height: 2vw;
font-size: 1.2vw;
margin-left: 3vw;
transition: all 1s;
}
}
.learnMore:hover {
.toRight {
margin-left: 4vw;
}
}
.caseImage {
position: absolute;
bottom: 0;
left: 55%;
width: 45%;
height: 100%;
}
.fade-enter-active {
animation: fadeInRight;
animation-duration: 0.5s;
}
.fade-leave-active {
animation: fadeOutLeft;
animation-duration: 0.5s;
}
</style>

@ -2,20 +2,57 @@
<div class="param-container" style="padding: 5vw 10vw;background-color: #fff">
<h2 class="title1" style="line-height: 40px">资料下载</h2>
<div>
<div v-for="(i,k) in data.fileList" class="fileCard" style="text-align: left;position: relative;">
<i class="del el-icon-circle-close" @click="del(k,i) "></i>
<div class="cardTitle" contenteditable="true" @blur="edit5('name',k,$event)">{{ i.name }}</div>
<div class="cardValue" contenteditable="true" @blur="edit5('value',k,$event)">{{ i.value }}</div>
<UploadFile style="position:absolute;top: 50%;right: 50px;transform: translateY(-50%)" :data="i" field="url"/>
<el-button type="warning"
style="position:absolute;top: 50%;right: 0;transform: translateY(-50%)"
icon="el-icon-key" circle
size="mini" @click="addPassword(i)"></el-button>
</div>
<div class="fileCard"
<el-table
:data="data.fileList"
style="width: 100%">
<el-table-column
width="300"
label="文件名称">
<template slot-scope="scope">
<el-input v-model="scope.row.name" placeholder="请输入内容"></el-input>
</template>
</el-table-column>
<el-table-column
prop="value"
label="文件介绍">
<template slot-scope="scope">
<el-input v-model="scope.row.value" placeholder="请输入内容"></el-input>
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="300">
<template slot-scope="scope">
<UploadFile style="width: 50px;display: inline-block" :data="scope.row"
field="url">
<el-button size="small" type="text">上传</el-button>
</UploadFile>
<el-button @click="addPassword(scope.row)" type="text" size="small">设置密码</el-button>
<el-button @click="del(scope.$index,scope.row)" type="text" size="small">删除</el-button>
</template>
</el-table-column>
</el-table>
<div style="width: 100%;height: 20px"
@click="data.fileList.push({name:'名称',value:'介绍',url:'',fileName:''})">
<i class="el-icon-circle-plus" style="font-size: 1vw; line-height: 100px"></i>
</div>
<!-- <div v-for="(i,k) in data.fileList" class="fileCard" style="text-align: left;position: relative;">-->
<!-- <i class="del el-icon-circle-close" @click="del(k,i) "></i>-->
<!-- <div class="cardTitle" contenteditable="true" @blur="edit5('name',k,$event)">{{ i.name }}</div>-->
<!-- <div class="cardValue" contenteditable="true" @blur="edit5('value',k,$event)">{{ i.value }}</div>-->
<!-- <UploadFile style="position:absolute;top: 50%;right: 50px;transform: translateY(-50%)" :data="i" field="url"/>-->
<!-- <el-button type="warning"-->
<!-- style="position:absolute;top: 50%;right: 0;transform: translateY(-50%)"-->
<!-- icon="el-icon-key" circle-->
<!-- size="mini" @click="addPassword(i)"></el-button>-->
<!-- </div>-->
<!-- <div class="fileCard"-->
<!-- @click="data.fileList.push({name:'名称',value:'介绍',url:'',fileName:''})">-->
<!-- <i class="el-icon-circle-plus" style="font-size: 1vw; line-height: 100px"></i>-->
<!-- </div>-->
</div>
<el-dialog title="设置密码" :visible.sync="setPasswordVisible">
@ -55,23 +92,32 @@ export default {
this.$props.data.fileList[index][key] = e.target.innerText
},
del(key, data) {
delHwWebDocument(data.uuid).then(res => {
if (res.code === 200) {
this.$message.success('删除成功')
this.$props.data.fileList.splice(key, 1)
} else {
this.$message.error('删除失败')
}
})
if (data.uuid) {
delHwWebDocument(data.uuid).then(res => {
if (res.code === 200) {
this.$message.success('删除成功')
this.$props.data.fileList.splice(key, 1)
} else {
this.$message.error('删除失败')
}
})
} else {
this.$message.success('删除成功')
this.$props.data.fileList.splice(key, 1)
}
},
addPassword(e) {
getHwWebDocument(e.uuid).then(res => {
this.form = {
id: e.uuid,
password: res.data.secretKey,
}
this.setPasswordVisible = true
})
if (e.uuid) {
getHwWebDocument(e.uuid).then(res => {
this.form = {
id: e.uuid,
password: res.data.secretKey,
}
this.setPasswordVisible = true
})
} else {
this.$message.error('请先上传文件')
}
},
setPassword() {
updateHwWebDocument({

@ -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>

@ -18,7 +18,7 @@ export default {
props: ['data', 'field'],
data() {
return {
imageUrl: '/prod-api' + "/file/upload",
imageUrl: '/prod-api' + "/resource/oss/upload",
}
},
methods: {

@ -4,10 +4,14 @@
class="upload-demo"
:action="imageUrl"
multiple
:show-file-list="false"
:limit="1"
:on-success="handleAvatarSuccess"
:on-change="handleChange"
:file-list="fileList">
<el-button size="small" type="primary">点击上传</el-button>
<slot>
<!-- <el-button size="small" type="primary">点击上传</el-button>-->
</slot>
</el-upload>
</div>
</template>
@ -19,19 +23,19 @@ export default {
props: ['data', 'field'],
data() {
return {
imageUrl: '/prod-api' + "/file/upload",
imageUrl: '/prod-api' + "/resource/oss/upload",
fileList: []
}
},
computed: {
fileList() {
if (this.$props.data.fileName) {
return [{url: '', name: this.$props.data.fileName}]
} else {
return []
}
},
mounted() {
if (this.$props.data.fileName) {
this.fileList = [{url: '', name: this.$props.data.fileName}]
}
},
methods: {
handleChange(file) {
console.log('文件变化', file)
},
handleAvatarSuccess(res, file, fileList) {
if (res.code === 200) {
let id = uuidv4();

@ -4,7 +4,9 @@ import Router from 'vue-router'
Vue.use(Router)
export default new Router({
routes: [
routes: [{
path: '/', redirect: '/editor',
},
{
path: '/editor', component: () => import('@/views/editPage/index.vue'),
},

@ -14,6 +14,10 @@
label="产品中心"
value="2">
</el-option>
<el-option
label="首页"
value="3">
</el-option>
</el-select>
<el-cascader
@change="pageChange"
@ -25,7 +29,7 @@
class="el-icon-upload"></i>
</el-button>
</div>
<div class="container">
<div class="container" v-if="type === '1' || type === '2'">
<div class="component" v-for="(i,k) in components">
<i class="del el-icon-circle-close" @click="components.splice(k, 1);"></i>
<i class="up el-icon-top" @click="moveUp(k);"></i>
@ -54,6 +58,10 @@
</div>
</div>
</div>
<div v-if="type === '3'">
<ClassicCase class="classicCase" :data="components ||{}"/>
<ProductCenter class="productCenter" :data="components ||{}"/>
</div>
<el-dialog
title="添加组件"
:visible.sync="addEl"
@ -152,6 +160,8 @@
</div>
</template>
<script>
import ProductCenter from '@/components/editEl/productCenter'
import ClassicCase from '@/components/editEl/classicCase'
import Carousel from "@/components/editEl/carousel.vue";
import EditEl1 from "@/components/editEl/editEl1.vue";
import EditEl2 from "@/components/editEl/editEl2.vue";
@ -174,6 +184,8 @@ import EditEl16 from "@/components/editEl/editEl16.vue";
export default {
components: {
ProductCenter,
ClassicCase,
Carousel,
EditEl1,
EditEl2,
@ -439,7 +451,7 @@ export default {
this.addEl = true
},
save() {
if (!this.value.at(-1)) {
if ((this.type === '1' || this.type === '2') && !this.value.at(-1)) {
return
}
if (this.type === '1') {
@ -481,6 +493,26 @@ export default {
}
})
}
if (this.type === '3') {
console.log(this.components)
console.log(JSON.stringify(this.components))
updateHwWeb({
webCode: '-1',
webJsonString: JSON.stringify(this.components),
}).then(res => {
if (res.code == 200) {
this.$message({
message: '保存成功',
type: 'success'
});
} else {
this.$message({
message: '保存失败',
type: 'error'
});
}
})
}
},
pageChange(e) {
@ -488,7 +520,8 @@ export default {
getHwWeb(e.at(-1)).then(res => {
this.components = JSON.parse(res?.data?.webJsonString || '[]')
})
} else {
}
if (this.type === '2') {
listHwWeb1({webCode: e[0], typeId: e[1], deviceId: e[2]}).then(e => {
this.components = JSON.parse(e.rows?.[0]?.webJsonString || '[]')
})
@ -518,9 +551,9 @@ export default {
}
},
typeChange(e) {
console.log(e)
if (e === '1') {
selectMenuTree().then(v => {
console.log(v)
this.options = v.data.find(vv => vv.webMenuId === 4).children
})
this.props = {checkStrictly: true, value: 'webMenuId', label: 'webMenuName'}
@ -533,6 +566,11 @@ export default {
})
this.props = {checkStrictly: true, value: 'id', label: 'name', children: 'list'}
}
if (e === '3') {
getHwWeb(-1).then(res => {
this.components = JSON.parse(res?.data?.webJsonString || '{}')
})
}
}
}
}

@ -7,11 +7,12 @@ module.exports = defineConfig({
// detail: https://cli.vuejs.org/config/#devserver-proxy
'/prod-api': {
// target: `http://175.27.215.92:8899/prod-api`,
// target: `http://192.168.0.8:9081`,
target: `http://1.13.177.47:8899/prod-api`, changeOrigin: true, pathRewrite: {
target: `http://192.168.0.13:9081`,
// target: `http://1.13.177.47:8899/prod-api`,
changeOrigin: true, pathRewrite: {
["^" + '/prod-api']: "",
},
},
},
},
},
})

Loading…
Cancel
Save