提交 cfb0a727 authored 作者: lihuihui's avatar lihuihui

fix: 修改bug

上级 0a3980d5
<template>
<ul class="menu">
<template v-for="(item, index) in menuList">
{{index === 0 ? '' : '|'}}<li :class="{ active: path.includes(item.path), disabled: item.disabled.includes(role)}" :key="index" @click="menuSelect(item)">{{item.label}}</li>
</template>
</ul>
<div class="menu-box">
<ul class="menu">
<template v-for="(item, index) in menuList">
{{index === 0 ? '' : '|'}}<li :class="{ active: path.includes(item.path), disabled: item.disabled.includes(role)}" :key="index" @click="menuSelect(item)">{{item.label}}</li>
</template>
</ul>
<el-button @click="selectProducts" style="height: fit-content;" type="primary" v-if="$route.path.includes('/product-analysis')">产品柜</el-button>
</div>
</template>
<script>
export default {
......@@ -34,11 +37,36 @@ export default {
} else {
this.$router.push(item.path)
}
},
selectProducts() {
this.$confirm('切换案例,当前填写的内容不会保存', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$router.push({ path: '/product-analysis' })
})
// if (this.$route.path === '/product-analysis/report') {
// this.$confirm('切换案例,当前填写的内容不会保存', '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning'
// }).then(() => {
// this.$router.push({ path: '/product-analysis' })
// })
// } else {
// this.$router.push({ path: '/product-analysis' })
// }
}
}
}
</script>
<style scoped>
.menu-box{
display: flex;
justify-content: space-between;
align-items: center;
}
.menu{
width: 780px;
height:56px;
......
......@@ -38,7 +38,7 @@ export default {
&::after{
content: '';
position: absolute;
bottom: 4px;
bottom: 2px;
left: 0;
width: 100%;
height: 5px;
......
<template>
<box title="产品概括">
<ul>
<li v-for="(item, index) in data.completions" :key="index">
<img :src="`https://webapp-pub.ezijing.com/x-training-new/products${index + 1}.png`" class="icon" />
<div class="tag">{{ item.subject }}</div>
<div class="text">{{ item.commit_answer }}</div>
<!-- <textarea placeholder="请输入" v-model="item.commit_answer"></textarea> -->
</li>
</ul>
</box>
</template>
<script>
import Box from './Box.vue'
export default {
components: { Box },
props: {
data: { type: Object }
},
data() {
return {}
},
created() {
}
}
</script>
<style lang="scss" scoped>
ul {
padding-top: 27px;
display: flex;
flex-wrap: wrap;
margin-right: -24px;
li {
margin-right: 18px;
margin-bottom: 13px;
width: 198px;
height: fit-content;
padding-bottom: 27px;
background: #f1fcf9;
border: 1px solid #b8ebde;
border-radius: 12px;
.text{
width: 151px;
font-size: 22px;
text-align: center;
margin: 20px auto 0;
padding-bottom: 10px;
border-bottom: 1px solid #7bc1af;
color: #68b8a4;
}
&:nth-child(2) {
background: #ecfafc;
border: 1px solid #b5ebeb;
textarea {
border-bottom: 1px solid #a5e1e9;
color: #62c2d0;
}
.text{
border-bottom: 1px solid #a5e1e9;
color: #62c2d0;
}
}
&:nth-child(3) {
background: #fffdf0;
border: 1px solid #f0eccb;
margin-right: 0;
textarea {
border-bottom: 1px solid #dad396;
color: #d9d292;
}
.text{
border-bottom: 1px solid #dad396;
color: #d9d292;
}
}
&:nth-child(4) {
background: #fdf8ee;
border: 1px solid #ecd7aa;
textarea {
border-bottom: 1px solid #e2c485;
color: #e2c485;
}
.text{
border-bottom: 1px solid #e2c485;
color: #e2c485;
}
}
&:nth-child(5) {
background: #fcede9;
border: 1px solid #f2c1b6;
textarea {
border-bottom: 1px solid #de9888;
color: #de9888;
}
.text{
border-bottom: 1px solid #de9888;
color: #de9888;
}
}
&:nth-child(6) {
background: #f1fcf9;
border: 1px solid #b8ebde;
margin-right: 0;
textarea {
border-bottom: 1px solid #7bc1af;
color: #7bc1af;
}
.text{
border-bottom: 1px solid #7bc1af;
color: #7bc1af;
}
}
.icon {
width: 82px;
display: block;
margin: 36px auto 18px;
}
.tag {
text-align: center;
font-size: 16px;
color: #8e8e8e;
line-height: 100%;
}
textarea {
width: 150px;
height: 43px;
outline: none;
resize: none;
margin: 15px auto 0;
display: block;
border-bottom: 1px solid #7bc1af;
background: none;
color: #68b8a4;
text-align: center;
padding-top: 10px;
&::-webkit-input-placeholder {
font-size: 18px;
color: #cacaca;
}
}
}
}
</style>
......@@ -48,10 +48,23 @@ export default {
this.getCasesList(item.id)
},
handleGo() {
if (Array.isArray(this.$store.state.case)) {
this.selectConfirm()
} else {
this.$confirm('切换案例,当前填写的内容不会保存', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.selectConfirm()
})
}
// console.log(this.$store.state.case, '1231')
},
selectConfirm() {
const data = this.caseList.find(item => { return item.id === this.caseSelect })
this.$store.commit('setCase', data)
this.selectCase(data.id)
// console.log(this.$store.state.case, '1231')
},
getCasesList(id) {
getCasesList(id).then(res => {
......
......@@ -132,9 +132,14 @@ export default {
{ tag: 'title', value: this.titleValue }
]
}
console.log(data, 'data')
window.localStorage.reportData = JSON.stringify(data)
this.$router.push({ path: '/product-analysis/result' })
this.$message({
message: '保存成功!你可以在作品展示中查看/编辑报告,查看成绩',
type: 'success'
})
setTimeout(() => {
this.$router.push({ path: '/product-analysis/result' })
}, 3000)
}).catch(err => {
this.$message.error(err.message || '稍后再试')
})
......
......@@ -25,7 +25,7 @@
</template>
<script>
import Product from '../components/Products.vue'
import Product from '../components/ProductsResult.vue'
import InvestTarget from '../components/InvestTarget.vue'
import Compares from '../components/Compares.vue'
import Features from '../components/Features.vue'
......@@ -46,6 +46,7 @@ export default {
}
},
created() {
document.body.scrollTop = document.documentElement.scrollTop = 0
const localData = JSON.parse(window.localStorage.reportData)
this.completions = localData.data
this.score = localData.score
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论