Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
x-training-new
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
x-training-new
Commits
10567d42
提交
10567d42
authored
9月 25, 2021
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 修改bug
上级
8929ed84
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
285 行增加
和
419 行删除
+285
-419
DouYin.vue
src/modules/market-tools/components/DouYin.vue
+3
-0
Products.vue
src/modules/product-analysis/components/Products.vue
+52
-14
ProductsResult.vue
src/modules/product-analysis/components/ProductsResult.vue
+0
-156
Report.vue
src/modules/product-analysis/components/Report.vue
+217
-0
Report.vue
src/modules/product-analysis/views/Report.vue
+3
-193
Result.vue
src/modules/product-analysis/views/Result.vue
+10
-56
没有找到文件。
src/modules/market-tools/components/DouYin.vue
浏览文件 @
10567d42
...
@@ -93,6 +93,7 @@ export default {
...
@@ -93,6 +93,7 @@ export default {
registerNextBtn
()
{
registerNextBtn
()
{
if
(
this
.
registerIndex
===
4
)
{
if
(
this
.
registerIndex
===
4
)
{
this
.
stepsIndex
++
this
.
stepsIndex
++
this
.
registerIndex
=
0
}
else
{
}
else
{
this
.
$message
({
message
:
'请完成当前步骤'
,
type
:
'warning'
})
this
.
$message
({
message
:
'请完成当前步骤'
,
type
:
'warning'
})
}
}
...
@@ -133,7 +134,9 @@ export default {
...
@@ -133,7 +134,9 @@ export default {
// 获取报告
// 获取报告
getReport
()
{
getReport
()
{
getReport
().
then
(
res
=>
{
getReport
().
then
(
res
=>
{
if
(
res
.
data
.
reports
.
length
)
{
this
.
form
=
res
.
data
.
reports
[
0
].
answer
.
commit_report
this
.
form
=
res
.
data
.
reports
[
0
].
answer
.
commit_report
}
})
})
},
},
// 查看营销数据教程
// 查看营销数据教程
...
...
src/modules/product-analysis/components/Products.vue
浏览文件 @
10567d42
<
template
>
<
template
>
<box
title=
"产品概括"
>
<box
title=
"产品概括"
>
<ul>
<ul>
<li
v-for=
"(item, index) in data.completions"
:key=
"index"
:id=
"item.id"
>
<li
v-for=
"(item, index) in data.completions"
:key=
"index"
:id=
"item.id"
:class=
"item.tag"
>
<img
:src=
"iconUrl(item)"
class=
"icon"
/>
<img
:src=
"iconUrl(item)"
class=
"icon"
/>
<div
class=
"tag"
>
{{
item
.
subject
}}
</div>
<div
class=
"tag"
>
{{
item
.
subject
}}
</div>
<textarea
placeholder=
"请输入"
v-model=
"item.commit_answer"
></textarea>
<div
class=
"text"
v-if=
"$route.path === '/product-analysis/result'"
>
{{
item
.
commit_answer
}}
</div>
<textarea
v-else
placeholder=
"请输入"
v-model=
"item.commit_answer"
></textarea>
</li>
</li>
</ul>
</ul>
</box>
</box>
...
@@ -17,9 +18,6 @@ export default {
...
@@ -17,9 +18,6 @@ export default {
props
:
{
props
:
{
data
:
{
type
:
Object
}
data
:
{
type
:
Object
}
},
},
data
()
{
return
{}
},
methods
:
{
methods
:
{
iconUrl
(
item
)
{
iconUrl
(
item
)
{
const
map
=
{
const
map
=
{
...
@@ -32,6 +30,9 @@ export default {
...
@@ -32,6 +30,9 @@ export default {
}
}
return
map
[
item
.
tag
]
return
map
[
item
.
tag
]
}
}
},
mounted
()
{
console
.
log
(
this
.
data
,
'123=-='
)
}
}
}
}
</
script
>
</
script
>
...
@@ -46,19 +47,42 @@ ul {
...
@@ -46,19 +47,42 @@ ul {
margin-right
:
18px
;
margin-right
:
18px
;
margin-bottom
:
13px
;
margin-bottom
:
13px
;
width
:
198px
;
width
:
198px
;
height
:
240
px
;
padding-bottom
:
27
px
;
background
:
#f1fcf9
;
background
:
#f1fcf9
;
border
:
1px
solid
#b8ebde
;
border
:
1px
solid
#b8ebde
;
border-radius
:
12px
;
border-radius
:
12px
;
&
:nth-child
(
2
)
{
.text
{
width
:
151px
;
font-size
:
22px
;
text-align
:
center
;
margin
:
20px
auto
0
;
padding-bottom
:
10px
;
}
&
.product_overview_completion
{
background
:
#f1fcf9
;
border
:
1px
solid
#b8ebde
;
.text
{
border-bottom
:
1px
solid
#7bc1af
;
color
:
#68b8a4
;
}
textarea
{
border-bottom
:
1px
solid
#7bc1af
;
color
:
#68b8a4
;
}
}
&
.operation_mode_completion
{
background
:
#ecfafc
;
background
:
#ecfafc
;
border
:
1px
solid
#b5ebeb
;
border
:
1px
solid
#b5ebeb
;
textarea
{
textarea
{
border-bottom
:
1px
solid
#a5e1e9
;
border-bottom
:
1px
solid
#a5e1e9
;
color
:
#62c2d0
;
color
:
#62c2d0
;
}
}
.text
{
border-bottom
:
1px
solid
#a5e1e9
;
color
:
#62c2d0
;
}
}
}
&
:nth-child
(
3
)
{
&
.open_frequency_completion
{
background
:
#fffdf0
;
background
:
#fffdf0
;
border
:
1px
solid
#f0eccb
;
border
:
1px
solid
#f0eccb
;
margin-right
:
0
;
margin-right
:
0
;
...
@@ -66,31 +90,47 @@ ul {
...
@@ -66,31 +90,47 @@ ul {
border-bottom
:
1px
solid
#dad396
;
border-bottom
:
1px
solid
#dad396
;
color
:
#d9d292
;
color
:
#d9d292
;
}
}
.text
{
border-bottom
:
1px
solid
#dad396
;
color
:
#d9d292
;
}
}
}
&
:nth-child
(
4
)
{
&
.transaction_currency_completion
{
background
:
#fdf8ee
;
background
:
#fdf8ee
;
border
:
1px
solid
#ecd7aa
;
border
:
1px
solid
#ecd7aa
;
textarea
{
textarea
{
border-bottom
:
1px
solid
#e2c485
;
border-bottom
:
1px
solid
#e2c485
;
color
:
#e2c485
;
color
:
#e2c485
;
}
}
.text
{
border-bottom
:
1px
solid
#e2c485
;
color
:
#e2c485
;
}
}
&
:nth-child
(
5
)
{
}
&
.fund_manager_completion
{
background
:
#fcede9
;
background
:
#fcede9
;
border
:
1px
solid
#f2c1b6
;
border
:
1px
solid
#f2c1b6
;
textarea
{
textarea
{
border-bottom
:
1px
solid
#de9888
;
border-bottom
:
1px
solid
#de9888
;
color
:
#de9888
;
color
:
#de9888
;
}
}
.text
{
border-bottom
:
1px
solid
#de9888
;
color
:
#de9888
;
}
}
}
&
:nth-child
(
6
)
{
&
.fund_principal_completion
{
background
:
#f1fcf9
;
background
:
#f1fcf9
;
border
:
1px
solid
#b8ebde
;
border
:
1px
solid
#b8ebde
;
margin-right
:
0
;
//
margin-right: 0;
textarea
{
textarea
{
border-bottom
:
1px
solid
#7bc1af
;
border-bottom
:
1px
solid
#7bc1af
;
color
:
#7bc1af
;
color
:
#7bc1af
;
}
}
.text
{
border-bottom
:
1px
solid
#7bc1af
;
color
:
#7bc1af
;
}
}
}
.icon
{
.icon
{
width
:
82px
;
width
:
82px
;
...
@@ -110,9 +150,7 @@ ul {
...
@@ -110,9 +150,7 @@ ul {
resize
:
none
;
resize
:
none
;
margin
:
15px
auto
0
;
margin
:
15px
auto
0
;
display
:
block
;
display
:
block
;
border-bottom
:
1px
solid
#7bc1af
;
background
:
none
;
background
:
none
;
color
:
#68b8a4
;
text-align
:
center
;
text-align
:
center
;
padding-top
:
10px
;
padding-top
:
10px
;
&
:
:-
webkit-input-placeholder
{
&
:
:-
webkit-input-placeholder
{
...
...
src/modules/product-analysis/components/ProductsResult.vue
deleted
100644 → 0
浏览文件 @
8929ed84
<
template
>
<box
title=
"产品概括"
>
<ul>
<li
v-for=
"(item, index) in data.completions"
:key=
"index"
>
<img
:src=
"iconUrl(item)"
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
{}
},
methods
:
{
iconUrl
(
item
)
{
const
map
=
{
product_overview_completion
:
'https://webapp-pub.ezijing.com/x-training-new/products1.png'
,
operation_mode_completion
:
'https://webapp-pub.ezijing.com/x-training-new/products2.png'
,
open_frequency_completion
:
'https://webapp-pub.ezijing.com/x-training-new/products3.png'
,
transaction_currency_completion
:
'https://webapp-pub.ezijing.com/x-training-new/products4.png'
,
fund_manager_completion
:
'https://webapp-pub.ezijing.com/x-training-new/products5.png'
,
fund_principal_completion
:
'https://webapp-pub.ezijing.com/x-training-new/products6.png'
}
return
map
[
item
.
tag
]
}
}
}
</
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
>
src/modules/product-analysis/components/Report.vue
0 → 100644
浏览文件 @
10567d42
<
template
>
<div>
<slot></slot>
<div
class=
"title"
>
产品分析报告
</div>
<input
type=
"text"
class=
"code"
placeholder=
"请输入基金简称+基金代码"
v-model=
"titleValue"
/>
<div
v-for=
"(item, index) in completions"
:key=
"index"
>
<!-- 产品概括 -->
<product
ref=
"product"
v-if=
"item.tag === 'product_overview'"
:data=
"item"
></product>
<!-- 投资目标 -->
<invest-target
ref=
"investTarget"
v-if=
"item.tag === 'investment_objectives'"
:data=
"item"
></invest-target>
<!-- 业绩比较基准 -->
<compares
ref=
"compares"
v-if=
"item.tag === 'performance_benchmark'"
:data=
"item"
></compares>
<!-- 风险收益特征 -->
<features
ref=
"features"
v-if=
"item.tag === 'risk_return_characteristics'"
:data=
"item"
></features>
<!-- 基金涉及费用 -->
<cost
ref=
"cost"
v-if=
"item.tag === 'fund_related_expenses'"
:data=
"item"
></cost>
</div>
<!-- 提交 -->
<div
class=
"submit-btn"
@
click=
"commitCase"
v-if=
"$route.path !== '/product-analysis/result'"
>
提交报告
</div>
</div>
</
template
>
<
script
>
import
{
caseCompletions
,
getCommitCase
,
commitCase
}
from
'../api'
import
Product
from
'./Products.vue'
import
InvestTarget
from
'./InvestTarget.vue'
import
Compares
from
'./Compares.vue'
import
Features
from
'./Features.vue'
import
Cost
from
'./Cost.vue'
export
default
{
components
:
{
Product
,
InvestTarget
,
Compares
,
Features
,
Cost
},
data
()
{
return
{
completions
:
[],
resultCompletions
:
[],
titleValue
:
''
}
},
computed
:
{
cases
()
{
return
this
.
$store
.
state
.
case
}
},
mounted
()
{
this
.
getCommitCase
()
},
methods
:
{
// 模板 数据回显
caseCompletions
(
id
)
{
caseCompletions
(
id
).
then
(
res
=>
{
res
.
data
.
items
.
map
(
item
=>
{
return
item
.
completions
.
map
(
cItem
=>
{
if
(
!
Array
.
isArray
(
this
.
resultCompletions
))
{
const
findData
=
this
.
resultCompletions
.
answer
.
find
(
fItem
=>
{
return
fItem
.
id
===
cItem
.
id
})
findData
?
(
cItem
.
commit_answer
=
findData
.
commit_answer
)
:
(
cItem
.
commit_answer
=
''
)
}
else
{
cItem
.
commit_answer
=
''
}
return
cItem
})
})
this
.
completions
=
res
.
data
.
items
// 标题回显
this
.
titleValue
=
this
.
completions
.
find
(
item
=>
{
return
item
.
tag
===
'product_title'
}).
completions
[
0
].
commit_answer
})
},
// 结果
getCommitCase
()
{
getCommitCase
().
then
(
res
=>
{
this
.
resultCompletions
=
res
.
data
.
records
this
.
caseCompletions
(
this
.
cases
.
id
)
this
.
$emit
(
'getScore'
,
this
.
resultCompletions
)
})
},
// 提交
commitCase
()
{
// 产品概括数据
const
productCount
=
[]
this
.
$refs
.
product
[
0
].
data
.
completions
.
forEach
(
item
=>
{
productCount
.
push
({
id
:
item
.
id
,
commit_answer
:
item
.
commit_answer
})
})
// 投资目标
const
originalData
=
this
.
$refs
.
investTarget
[
0
].
data
.
completions
[
0
]
const
investTargetCount
=
[{
id
:
originalData
.
id
,
commit_answer
:
originalData
.
commit_answer
}]
// 业绩比较基准数据
const
comparesCount
=
[]
this
.
$refs
.
compares
[
0
].
inputList
.
forEach
(
item
=>
{
comparesCount
.
push
(
`
${
item
.
input1
.
split
(
';'
).
join
(
''
)}
,
${
item
.
input2
.
split
(
';'
).
join
(
''
)}
`
)
})
const
comparesData
=
{
id
:
this
.
$refs
.
compares
[
0
].
data
.
completions
[
0
].
id
,
commit_answer
:
comparesCount
.
join
(
';'
)
}
this
.
$refs
.
compares
[
0
].
data
.
completions
[
0
].
commit_answer
=
comparesCount
.
join
(
';'
)
// 风险收益特征数据
const
featuresCount
=
[]
this
.
$refs
.
features
[
0
].
data
.
completions
.
forEach
(
item
=>
{
featuresCount
.
push
({
id
:
item
.
id
,
commit_answer
:
item
.
commit_answer
})
})
// 基金涉及费用数据
const
costCount
=
[]
this
.
$refs
.
cost
[
0
].
data
.
completions
.
forEach
(
item
=>
{
costCount
.
push
({
id
:
item
.
id
,
commit_answer
:
item
.
commit_answer
})
})
// 标题数据
const
findTitleData
=
this
.
completions
.
find
(
item
=>
{
return
item
.
tag
===
'product_title'
}).
completions
[
0
]
const
titCount
=
[{
id
:
findTitleData
.
id
,
commit_answer
:
this
.
titleValue
}]
const
allData
=
[
...
titCount
,
...
productCount
,
...
investTargetCount
,
...[
comparesData
],
...
featuresCount
,
...
costCount
]
// 空数据的索引
let
emptyDataIndex
=
allData
.
findIndex
(
item
=>
item
.
commit_answer
===
''
)
// 判断业绩比较基准是否为空
const
hasEmptyInput
=
!!
this
.
$refs
.
compares
[
0
].
inputList
.
find
(
item
=>
{
return
item
.
input1
===
''
||
item
.
input2
===
''
})
if
(
hasEmptyInput
)
{
const
dataId
=
this
.
$refs
.
compares
[
0
].
data
.
completions
[
0
].
id
const
dataIndex
=
allData
.
findIndex
(
item
=>
item
.
id
===
dataId
)
emptyDataIndex
=
emptyDataIndex
>
dataIndex
&&
emptyDataIndex
!==
-
1
?
dataIndex
:
emptyDataIndex
}
if
(
emptyDataIndex
===
-
1
)
{
commitCase
({
answers
:
JSON
.
stringify
(
allData
)
})
.
then
(
res
=>
{
const
data
=
{
score
:
res
.
data
.
score
,
data
:
[
this
.
$refs
.
product
[
0
].
data
,
this
.
$refs
.
investTarget
[
0
].
data
,
this
.
$refs
.
compares
[
0
].
data
,
this
.
$refs
.
features
[
0
].
data
,
this
.
$refs
.
cost
[
0
].
data
,
{
tag
:
'title'
,
value
:
this
.
titleValue
}
]
}
window
.
localStorage
.
reportData
=
JSON
.
stringify
(
data
)
this
.
$message
({
message
:
'保存成功!你可以在作品展示中查看/编辑报告,查看成绩'
,
type
:
'success'
})
setTimeout
(()
=>
{
this
.
$router
.
push
({
path
:
'/product-analysis/result'
})
},
2000
)
})
.
catch
(
err
=>
{
this
.
$message
.
error
(
err
.
message
||
'稍后再试'
)
})
}
else
{
// 空数据的元素
const
emptyElement
=
document
.
querySelector
(
`[id="
${
allData
[
emptyDataIndex
].
id
}
"]`
)
let
top
=
140
if
(
emptyElement
)
{
// 空数据元素的位置
top
=
emptyElement
.
getBoundingClientRect
().
top
+
document
.
documentElement
.
scrollTop
}
window
.
scrollTo
(
0
,
top
)
this
.
$message
(
'请填写完整'
)
}
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
input
{
background
:
none
;
border
:
none
;
outline
:
none
;
}
.code
{
width
:
370px
;
margin
:
35px
auto
;
height
:
47px
;
display
:
block
;
text-align
:
center
;
border-bottom
:
1px
solid
#b4b4b4
;
&
:
:-
webkit-input-placeholder
{
color
:
#afafaf
;
}
}
.submit-btn
{
width
:
119px
;
background
:
#68b8a4
;
border-radius
:
16px
;
text-align
:
center
;
margin
:
42px
auto
;
line-height
:
32px
;
color
:
#fff
;
font-size
:
18px
;
cursor
:
pointer
;
}
.title
{
font-size
:
24px
;
font-weight
:
bold
;
color
:
#4cac94
;
line-height
:
100%
;
text-align
:
center
;
margin-top
:
27px
;
}
</
style
>
src/modules/product-analysis/views/Report.vue
浏览文件 @
10567d42
...
@@ -5,49 +5,16 @@
...
@@ -5,49 +5,16 @@
<embed
class=
"embed"
width=
"100%"
height=
"100%"
:src=
"cases.pdf_uris[0]"
/>
<embed
class=
"embed"
width=
"100%"
height=
"100%"
:src=
"cases.pdf_uris[0]"
/>
</div>
</div>
<div
class=
"right-content"
>
<div
class=
"right-content"
>
<div
class=
"title"
>
产品分析报告
</div>
<report></report>
<input
type=
"text"
class=
"code"
placeholder=
"请输入基金简称+基金代码"
v-model=
"titleValue"
/>
<div
v-for=
"(item, index) in completions"
:key=
"index"
>
<!-- 产品概括 -->
<product
ref=
"product"
v-if=
"item.tag === 'product_overview'"
:data=
"item"
></product>
<!-- 投资目标 -->
<invest-target
ref=
"investTarget"
v-if=
"item.tag === 'investment_objectives'"
:data=
"item"
></invest-target>
<!-- 业绩比较基准 -->
<compares
ref=
"compares"
v-if=
"item.tag === 'performance_benchmark'"
:data=
"item"
></compares>
<!-- 风险收益特征 -->
<features
ref=
"features"
v-if=
"item.tag === 'risk_return_characteristics'"
:data=
"item"
></features>
<!-- 基金涉及费用 -->
<cost
ref=
"cost"
v-if=
"item.tag === 'fund_related_expenses'"
:data=
"item"
></cost>
</div>
<!-- 提交 -->
<div
class=
"submit-btn"
@
click=
"commitCase"
>
提交报告
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
caseCompletions
,
getCommitCase
,
commitCase
}
from
'../api'
import
Report
from
'../components/Report.vue'
import
Product
from
'../components/Products.vue'
import
InvestTarget
from
'../components/InvestTarget.vue'
import
Compares
from
'../components/Compares.vue'
import
Features
from
'../components/Features.vue'
import
Cost
from
'../components/Cost.vue'
export
default
{
export
default
{
components
:
{
components
:
{
Report
},
Product
,
InvestTarget
,
Compares
,
Features
,
Cost
},
data
()
{
return
{
completions
:
[],
resultCompletions
:
[],
titleValue
:
''
}
},
computed
:
{
computed
:
{
cases
()
{
cases
()
{
return
this
.
$store
.
state
.
case
return
this
.
$store
.
state
.
case
...
@@ -55,132 +22,6 @@ export default {
...
@@ -55,132 +22,6 @@ export default {
},
},
mounted
()
{
mounted
()
{
this
.
$refs
.
pdf
.
style
.
height
=
`
${
document
.
documentElement
.
clientHeight
-
40
}
px`
this
.
$refs
.
pdf
.
style
.
height
=
`
${
document
.
documentElement
.
clientHeight
-
40
}
px`
console
.
log
(
this
.
$refs
.
pdf
)
this
.
getCommitCase
()
},
methods
:
{
// 模板 数据回显
caseCompletions
(
id
)
{
caseCompletions
(
id
).
then
(
res
=>
{
res
.
data
.
items
.
map
(
item
=>
{
return
item
.
completions
.
map
(
cItem
=>
{
if
(
!
Array
.
isArray
(
this
.
resultCompletions
))
{
const
findData
=
this
.
resultCompletions
.
answer
.
find
(
fItem
=>
{
return
fItem
.
id
===
cItem
.
id
})
findData
?
(
cItem
.
commit_answer
=
findData
.
commit_answer
)
:
(
cItem
.
commit_answer
=
''
)
}
else
{
cItem
.
commit_answer
=
''
}
return
cItem
})
})
this
.
completions
=
res
.
data
.
items
// 标题回显
this
.
titleValue
=
this
.
completions
.
find
(
item
=>
{
return
item
.
tag
===
'product_title'
}).
completions
[
0
].
commit_answer
})
},
// 结果
getCommitCase
()
{
getCommitCase
().
then
(
res
=>
{
this
.
resultCompletions
=
res
.
data
.
records
this
.
caseCompletions
(
this
.
cases
.
id
)
})
},
// 提交
commitCase
()
{
// 产品概括数据
const
productCount
=
[]
this
.
$refs
.
product
[
0
].
data
.
completions
.
forEach
(
item
=>
{
productCount
.
push
({
id
:
item
.
id
,
commit_answer
:
item
.
commit_answer
})
})
// 投资目标
const
originalData
=
this
.
$refs
.
investTarget
[
0
].
data
.
completions
[
0
]
const
investTargetCount
=
[{
id
:
originalData
.
id
,
commit_answer
:
originalData
.
commit_answer
}]
// 业绩比较基准数据
const
comparesCount
=
[]
this
.
$refs
.
compares
[
0
].
inputList
.
forEach
(
item
=>
{
comparesCount
.
push
(
`
${
item
.
input1
.
split
(
';'
).
join
(
''
)}
,
${
item
.
input2
.
split
(
';'
).
join
(
''
)}
`
)
})
const
comparesData
=
{
id
:
this
.
$refs
.
compares
[
0
].
data
.
completions
[
0
].
id
,
commit_answer
:
comparesCount
.
join
(
';'
)
}
this
.
$refs
.
compares
[
0
].
data
.
completions
[
0
].
commit_answer
=
comparesCount
.
join
(
';'
)
// 风险收益特征数据
const
featuresCount
=
[]
this
.
$refs
.
features
[
0
].
data
.
completions
.
forEach
(
item
=>
{
featuresCount
.
push
({
id
:
item
.
id
,
commit_answer
:
item
.
commit_answer
})
})
// 基金涉及费用数据
const
costCount
=
[]
this
.
$refs
.
cost
[
0
].
data
.
completions
.
forEach
(
item
=>
{
costCount
.
push
({
id
:
item
.
id
,
commit_answer
:
item
.
commit_answer
})
})
// 标题数据
const
findTitleData
=
this
.
completions
.
find
(
item
=>
{
return
item
.
tag
===
'product_title'
}).
completions
[
0
]
const
titCount
=
[{
id
:
findTitleData
.
id
,
commit_answer
:
this
.
titleValue
}]
const
allData
=
[
...
titCount
,
...
productCount
,
...
investTargetCount
,
...[
comparesData
],
...
featuresCount
,
...
costCount
]
// 空数据的索引
let
emptyDataIndex
=
allData
.
findIndex
(
item
=>
item
.
commit_answer
===
''
)
// 判断业绩比较基准是否为空
const
hasEmptyInput
=
!!
this
.
$refs
.
compares
[
0
].
inputList
.
find
(
item
=>
{
return
item
.
input1
===
''
||
item
.
input2
===
''
})
if
(
hasEmptyInput
)
{
const
dataId
=
this
.
$refs
.
compares
[
0
].
data
.
completions
[
0
].
id
const
dataIndex
=
allData
.
findIndex
(
item
=>
item
.
id
===
dataId
)
emptyDataIndex
=
emptyDataIndex
>
dataIndex
&&
emptyDataIndex
!==
-
1
?
dataIndex
:
emptyDataIndex
}
if
(
emptyDataIndex
===
-
1
)
{
commitCase
({
answers
:
JSON
.
stringify
(
allData
)
})
.
then
(
res
=>
{
const
data
=
{
score
:
res
.
data
.
score
,
data
:
[
this
.
$refs
.
product
[
0
].
data
,
this
.
$refs
.
investTarget
[
0
].
data
,
this
.
$refs
.
compares
[
0
].
data
,
this
.
$refs
.
features
[
0
].
data
,
this
.
$refs
.
cost
[
0
].
data
,
{
tag
:
'title'
,
value
:
this
.
titleValue
}
]
}
window
.
localStorage
.
reportData
=
JSON
.
stringify
(
data
)
this
.
$message
({
message
:
'保存成功!你可以在作品展示中查看/编辑报告,查看成绩'
,
type
:
'success'
})
setTimeout
(()
=>
{
this
.
$router
.
push
({
path
:
'/product-analysis/result'
})
},
2000
)
})
.
catch
(
err
=>
{
this
.
$message
.
error
(
err
.
message
||
'稍后再试'
)
})
}
else
{
// 空数据的元素
const
emptyElement
=
document
.
querySelector
(
`[id="
${
allData
[
emptyDataIndex
].
id
}
"]`
)
let
top
=
140
if
(
emptyElement
)
{
// 空数据元素的位置
top
=
emptyElement
.
getBoundingClientRect
().
top
+
document
.
documentElement
.
scrollTop
}
window
.
scrollTo
(
0
,
top
)
this
.
$message
(
'请填写完整'
)
}
}
}
}
}
}
</
script
>
</
script
>
...
@@ -203,41 +44,10 @@ input {
...
@@ -203,41 +44,10 @@ input {
background
:
#f8f8f8
;
background
:
#f8f8f8
;
border
:
1px
solid
#dcdcdc
;
border
:
1px
solid
#dcdcdc
;
border-radius
:
10px
;
border-radius
:
10px
;
.code
{
width
:
370px
;
margin
:
35px
auto
;
height
:
47px
;
display
:
block
;
text-align
:
center
;
border-bottom
:
1px
solid
#b4b4b4
;
&
:
:-
webkit-input-placeholder
{
color
:
#afafaf
;
}
}
.submit-btn
{
width
:
119px
;
background
:
#68b8a4
;
border-radius
:
16px
;
text-align
:
center
;
margin
:
42px
auto
;
line-height
:
32px
;
color
:
#fff
;
font-size
:
18px
;
cursor
:
pointer
;
}
.title
{
font-size
:
24px
;
font-weight
:
bold
;
color
:
#4cac94
;
line-height
:
100%
;
text-align
:
center
;
margin-top
:
27px
;
}
}
}
.pdf-left
{
.pdf-left
{
flex
:
1
;
flex
:
1
;
margin-right
:
10px
;
margin-right
:
10px
;
// height: 500px;
position
:
sticky
;
position
:
sticky
;
top
:
20px
;
top
:
20px
;
left
:
0
;
left
:
0
;
...
...
src/modules/product-analysis/views/Result.vue
浏览文件 @
10567d42
<
template
>
<
template
>
<div
class=
"result-box"
>
<div
class=
"result-box"
>
<div
class=
"pop-layer"
></div>
<div
class=
"pop-layer"
></div>
<report
@
getScore=
"getScore"
>
<div
class=
"trophy-box"
>
<div
class=
"trophy-box"
>
<img
src=
"https://webapp-pub.ezijing.com/x-training-new/trophy.png"
/>
<img
src=
"https://webapp-pub.ezijing.com/x-training-new/trophy.png"
/>
<div
class=
"text"
>
<div
class=
"text"
>
...
@@ -8,54 +9,26 @@
...
@@ -8,54 +9,26 @@
>
分
>
分
</div>
</div>
</div>
</div>
<div
class=
"title-box"
>
</report>
<div
class=
"title"
>
产品分析报告
</div>
<div
class=
"code"
>
{{
title
}}
</div>
</div>
<div
v-for=
"(item, index) in completions"
:key=
"index"
>
<!-- 产品概括 -->
<product
ref=
"product"
v-if=
"item.tag === 'product_overview'"
:data=
"item"
></product>
<!-- 投资目标 -->
<invest-target
ref=
"investTarget"
v-if=
"item.tag === 'investment_objectives'"
:data=
"item"
></invest-target>
<!-- 业绩比较基准 -->
<compares
ref=
"compares"
v-if=
"item.tag === 'performance_benchmark'"
:data=
"item"
></compares>
<!-- 风险收益特征 -->
<features
ref=
"features"
v-if=
"item.tag === 'risk_return_characteristics'"
:data=
"item"
></features>
<!-- 基金涉及费用 -->
<cost
ref=
"cost"
v-if=
"item.tag === 'fund_related_expenses'"
:data=
"item"
></cost>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
Product
from
'../components/ProductsResult.vue'
import
Report
from
'../components/Report.vue'
import
InvestTarget
from
'../components/InvestTarget.vue'
import
Compares
from
'../components/Compares.vue'
import
Features
from
'../components/Features.vue'
import
Cost
from
'../components/Cost.vue'
export
default
{
export
default
{
components
:
{
components
:
{
Report
},
Product
,
InvestTarget
,
Compares
,
Features
,
Cost
},
data
()
{
data
()
{
return
{
return
{
completions
:
[],
score
:
''
score
:
''
,
title
:
''
}
}
},
},
created
()
{
created
()
{
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
const
localData
=
JSON
.
parse
(
window
.
localStorage
.
reportData
)
},
this
.
completions
=
localData
.
data
methods
:
{
this
.
score
=
localData
.
score
getScore
(
res
)
{
this
.
title
=
this
.
completions
.
find
(
item
=>
{
this
.
score
=
res
.
score
return
item
.
tag
===
'title'
}
}).
value
}
}
}
}
</
script
>
</
script
>
...
@@ -106,24 +79,5 @@ export default {
...
@@ -106,24 +79,5 @@ export default {
}
}
}
}
}
}
.title-box
{
padding
:
28px
0
50px
;
.title
{
text-align
:
center
;
font-size
:
24px
;
font-weight
:
bold
;
color
:
#4cac94
;
line-height
:
100%
;
}
.code
{
width
:
310px
;
line-height
:
47px
;
margin
:
29px
auto
0
;
border-bottom
:
1px
solid
#b4b4b4
;
text-align
:
center
;
font-size
:
18px
;
color
:
#656565
;
}
}
}
}
</
style
>
</
style
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论