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

fix: bug修改

上级 279babfb
......@@ -28,7 +28,7 @@ export function getReportDetail(id) {
// 验证是否有未完成的答题记录
export function checkRecord(id, type) {
return httpRequest.post(`/api/xtraining/api/v1/answer/${id}/check-record/${type}`, {
return httpRequest.post(`/api/xtraining/api/v1/answer/${id}/check-record/${type}`, {}, {
headers: { 'Content-Type': 'application/json' }
})
}
......@@ -23,7 +23,7 @@
</div>
<div class="step-content2" v-if="stepsIndex === 1">
<div class="form-box">
<el-form ref="form" :model="form" label-width="80px">
<el-form ref="form" :model="form" label-width="80px" :disabled="$route.query.type === 1 ? false : true">
<el-form-item label="标题">
<el-input v-model="form.title"></el-input>
</el-form-item>
......@@ -58,11 +58,11 @@
<div class="text">{{ registerText }}</div>
</div>
<div class="mian-btn">
<el-button type="primary" @click="cacheReport">保存</el-button>
<el-button type="primary" @click="cacheReport" v-if="$route.query.type != 1">保存</el-button>
<el-button type="primary" @click="stepsIndex--" v-if="stepsIndex != 0">上一步</el-button>
<el-button v-if="stepsIndex == 0" type="primary" @click="registerNextBtn">下一步</el-button>
<el-button v-if="stepsIndex == 1" type="primary" @click="formNextBtn">下一步</el-button>
<el-button type="primary" @click="submitReport" v-if="stepsIndex == 2">完成</el-button>
<el-button type="primary" @click="submitReport" v-if="stepsIndex == 2 && $route.query.type != 1">完成</el-button>
</div>
</div>
</div>
......@@ -106,21 +106,29 @@ export default {
})
},
registerNextBtn() {
if (this.registerIndex === 4) {
if (this.$route.query.type) {
this.stepsIndex++
this.registerIndex = 0
} else {
this.$message({ message: '请完成当前步骤', type: 'warning' })
if (this.registerIndex === 4) {
this.stepsIndex++
this.registerIndex = 0
} else {
this.$message({ message: '请完成当前步骤', type: 'warning' })
}
}
},
formNextBtn() {
const isNull = Object.values(this.form).findIndex(item => {
return item === ''
})
if (isNull === -1) {
if (this.$route.query.type) {
this.stepsIndex++
} else {
this.$message({ message: '请在发布视频完善信息', type: 'warning' })
const isNull = Object.values(this.form).findIndex(item => {
return item === ''
})
if (isNull === -1) {
this.stepsIndex++
} else {
this.$message({ message: '请在发布视频完善信息', type: 'warning' })
}
}
},
// 提交报告
......@@ -176,12 +184,14 @@ export default {
getReportDetail(id) {
getReportDetail(id).then(res => {
const cachData = res.data.detail.answer.commit_report
if (this.$route.query.type === 1) {
this.stepsIndex = cachData[1].steps
this.registerIndex = cachData[1].registerIndex
this.dataIndex = cachData[1].dataIndex
}
this.form.title = cachData[0].title
this.form.dec = cachData[0].dec
this.form.url = cachData[0].url
this.stepsIndex = cachData[1].steps
this.registerIndex = cachData[1].registerIndex
this.dataIndex = cachData[1].dataIndex
// this.stepsIndex = cachData[1].steps
})
},
......
......@@ -2,6 +2,7 @@
<div class="box-card">
<div class="tit-box">
<span class="title">{{ title }}</span>
<slot name="tips"></slot>
<span class="err-btn" v-if="isErrorBtn && $route.path !== '/product-analysis/report'" @click="$emit('errorResolution')">错误解析</span>
</div>
<slot></slot>
......@@ -33,13 +34,14 @@ export default {
}
.tit-box {
display: flex;
justify-content: space-between;
// justify-content: space-between;
color: #4cac94;
cursor: pointer;
}
.err-btn {
position: relative;
z-index: 9999;
margin-left: auto;
}
.title {
font-size: 18px;
......
<template>
<box title="业绩比较基准" class="compares-box" :id="firstItem.id" :isErrorBtn="isErrorBtn()" @errorResolution="errorResolution">
<div slot="tips" class="tips">
<i class="el-icon-warning-outline"></i>
<div class="text">提示:本案例中所出现的指数为单一参照指数,故比重默认为100%。</div>
</div>
<ul>
<li v-for="(item, index) in inputList" :key="index">
<div class="input-box">
......@@ -74,6 +78,19 @@ export default {
</script>
<style lang="scss" scoped>
.tips{
display: flex;
align-items: center;
margin-left: 15px;
i{
color: rgba(153, 153, 153, 1);
}
.text{
font-size: 12px;
color: #999999;
margin-left: 5px;
}
}
ul {
padding-left: 20px;
padding-top: 23px;
......
......@@ -39,6 +39,7 @@ export default {
this.$emit('errorResolution', this.data)
},
isClass(item) {
console.log(item, '=123')
if (this.$route.path === '/product-analysis/result') {
return item.is_correct ? '' : 'active'
}
......
<template>
<box title="投资策略" :isErrorBtn="isErrorBtn()" @errorResolution="errorResolution">
<textarea :class="`isDomActive ${isClass(item)}`" v-for="(item, index) in data.completions" v-model="item.commit_answer" :key="index" :id="item.id"></textarea>
<textarea :disabled="$route.path !== '/product-analysis/result' ? false : true" :class="`isDomActive ${isClass(item)}`" v-for="(item, index) in data.completions" v-model="item.commit_answer" :key="index" :id="item.id"></textarea>
</box>
</template>
......@@ -45,6 +45,8 @@ textarea {
display: block;
padding: 15px;
box-sizing: border-box;
position: relative;
z-index: 999;
&.active{
background: #FFFFFF;
border: 1px solid #C11818;
......
<template>
<box title="投资目标" :isErrorBtn="isErrorBtn()" @errorResolution="errorResolution">
<textarea :class="`isDomActive ${isClass(item)}`" v-for="(item, index) in data.completions" v-model="item.commit_answer" :key="index" :id="item.id"></textarea>
<textarea :disabled="$route.path !== '/product-analysis/result' ? false : true" :class="`isDomActive ${isClass(item)}`" v-for="(item, index) in data.completions" v-model="item.commit_answer" :key="index" :id="item.id"></textarea>
</box>
</template>
......@@ -45,6 +45,8 @@ textarea {
display: block;
padding: 15px;
box-sizing: border-box;
position: relative;
z-index: 999;
&.active{
background: #FFFFFF;
border: 1px solid #C11818;
......
<template>
<div class="report-box">
<slot></slot>
<div class="title">产品分析报告<span @click="errorResolutionTit" v-if="$route.path !== '/product-analysis/report'">错误解析</span></div>
<template v-if="Object.keys(titleData).length">
<div class="title">产品分析报告<span @click="errorResolutionTit" v-if="$route.path !== '/product-analysis/report' && !this.titleData.completions[0].is_correct">错误解析</span></div>
<input v-if="$route.path !== '/product-analysis/result'" type="text" class="code isDomActive" placeholder="请输入基金简称+基金代码" v-model="titleValue"/>
<input v-else type="text" :class="`code isDomActive ${titleData.completions[0].is_correct ? '' : 'active'}`" placeholder="请输入基金简称+基金代码" v-model="titleValue"/>
</template>
......@@ -72,7 +72,8 @@ export default {
},
// 保存答案
cacheCaseAnswer() {
cacheCaseAnswer(this.cases.id, { answers: JSON.stringify(this.getAnswer(1)) })
const data = this.getAnswer(1)
cacheCaseAnswer(this.cases.id, { answers: JSON.stringify(data) })
.then(res => { this.$message({ type: 'success', message: '保存成功' }) })
.catch(err => { this.$message.error(err.message || '稍后再试') })
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论