Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
x-training-admin
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
x-training-admin
Commits
cd9acc06
提交
cd9acc06
authored
2月 06, 2021
作者:
wangyizheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
案例列表|添加案例
上级
559e0dd9
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
201 行增加
和
33 行删除
+201
-33
cases2.js
src/api/cases2.js
+1
-1
index.vue
src/pages/v2/cases/index.vue
+200
-32
没有找到文件。
src/api/cases2.js
浏览文件 @
cd9acc06
...
...
@@ -18,7 +18,7 @@ export function createCase2(data) {
var
headers
=
{
'Content-Type'
:
'application/json'
}
return
httpRequest
.
post
(
'/api/opera/v2/training/case
s
'
,
data
,
{
headers
})
return
httpRequest
.
post
(
'/api/opera/v2/training/case'
,
data
,
{
headers
})
}
// 案例详情
...
...
src/pages/v2/cases/index.vue
浏览文件 @
cd9acc06
...
...
@@ -41,7 +41,7 @@
<el-table-column
label=
"案例分类"
>
<template
slot-scope=
"scope"
>
<div
slot=
"reference"
class=
"name-wrapper"
v-if=
"scope.row.categories"
>
<el-tag
type=
""
effect=
"plain"
size=
"mini"
v-for=
"(category,
index) in scope.row.categories"
:key=
"i
ndex"
>
<el-tag
type=
""
effect=
"plain"
size=
"mini"
v-for=
"(category,
categoryIndex) in scope.row.categories"
:key=
"categoryI
ndex"
>
{{
category
.
name
}}
</el-tag>
</div>
...
...
@@ -151,7 +151,7 @@
<div>
<el-dialog
title=
"产品概况"
:visible
.
sync=
"productionDialogFormVisible"
width=
"90%"
center
>
<el-card
:body-style=
"{ padding: '0px' }"
>
<div
style=
"padding: 14px;"
v-for=
"(production,
index) in productionDetail"
:key=
"i
ndex"
>
<div
style=
"padding: 14px;"
v-for=
"(production,
productionIndex) in productionDetail"
:key=
"productionI
ndex"
>
<div>
<span><strong>
产品信息:
</strong></span><span>
{{ production.name }}
</span>
</div>
...
...
@@ -162,7 +162,7 @@
<br/>
</div>
</div>
<el-divider
v-if=
"
i
ndex < productionDetail.length - 1"
content-position=
"right"
></el-divider>
<el-divider
v-if=
"
productionI
ndex < productionDetail.length - 1"
content-position=
"right"
></el-divider>
</div>
</el-card>
</el-dialog>
...
...
@@ -206,10 +206,13 @@
</el-dialog>
</div>
<div>
<el-scrollbar
style=
"height: 80%"
>
<el-drawer
title=
"创建案例"
:visible
.
sync=
"drawer"
:direction=
"direction"
:append-to-body=
"true"
:withHeader=
"true"
:before-close=
"handleClose"
ref=
"drawer"
size=
"50%"
>
...
...
@@ -242,6 +245,7 @@
action=
"/api/opera/v1/file/upload"
:on-preview=
"handlePreview"
:on-remove=
"handleRemove"
:on-success=
"uploadSuccess"
:limit=
"1"
:on-exceed=
"handleExceed"
>
<el-button
size=
"small"
type=
"primary"
>
点击上传
</el-button>
...
...
@@ -253,6 +257,7 @@
action=
"/api/opera/v1/file/upload"
list-type=
"picture-card"
:limit=
"1"
:on-success=
"uploadUrlSuccess"
:multiple=
"false"
:data=
"{ type: 'image' }"
:on-preview=
"createPictureCardPreview"
>
...
...
@@ -266,7 +271,7 @@
<el-form-item>
<el-divider
content-position=
"left"
>
产品概况配置
</el-divider>
</el-form-item>
<div
v-for=
"(item, index) in addForm.production_detail"
:key=
"
index"
>
<div
v-for=
"(item, index) in addForm.production_detail"
:key=
"'production-'+
index"
>
<div
style=
"margin-left: 5%"
>
<i
class=
"el-icon-circle-plus-outline"
@
click=
"addNames('production_detail', index)"
>
添加
</i>
<i
class=
"el-icon-remove-outline"
@
click=
"removeNames('production_detail', index)"
>
删除
</i>
...
...
@@ -274,15 +279,61 @@
<el-form-item
style=
"margin-left: 5%; margin-top: 2%"
label-width=
"formLabelWidth"
label=
"二级标题"
>
<el-input
v-model=
"item.name"
placeholder=
"请输入内容"
style=
"width: 50%"
></el-input>
</el-form-item>
<div
v-for=
"(keywrod, index1) in item.keywords"
:key=
"
index1"
style=
"margin-top: 2%"
>
<el-form-item
style=
"margin-left: -1
%"
label=
"关键词"
:label-width=
"formLabelWidth"
>
<div
v-for=
"(keywrod, index1) in item.keywords"
:key=
"'production-'+
index1"
style=
"margin-top: 2%"
>
<el-form-item
style=
"margin-left: 2
%"
label=
"关键词"
:label-width=
"formLabelWidth"
>
<el-input
v-model=
"keywrod.name"
placeholder=
"请输入关键词"
style=
"width: 50%"
></el-input>
<el-input
v-model=
"keywrod.score"
placeholder=
"请输入得分"
style=
"width: 20%"
></el-input>
<i
class=
"el-icon-circle-plus-outline"
@
click=
"addKeyword('production_detail', index1)"
></i>
<i
class=
"el-icon-remove-outline"
@
click=
"removeKeyword('production_detail', index1)"
></i>
<span>
关键词得分:
</span>
<el-input
v-model=
"keywrod.score"
placeholder=
"得分"
style=
"width: 20%"
></el-input>
<i
class=
"el-icon-circle-plus-outline"
@
click=
"addKeywords('production_detail', index)"
></i>
<i
class=
"el-icon-remove-outline"
@
click=
"removeKeywords('production_detail', index, index1)"
></i>
</el-form-item>
</div>
</div>
<el-form-item>
<el-divider
content-position=
"left"
>
案例基金与净值表现配置
</el-divider>
</el-form-item>
<div
v-for=
"(fundItem, fundIndex) in addForm.fund_detail"
:key=
"'fund-'+fundIndex"
>
<div
style=
"margin-left: 5%"
>
<i
class=
"el-icon-circle-plus-outline"
@
click=
"addNames('fund_detail', fundIndex)"
>
添加
</i>
<i
class=
"el-icon-remove-outline"
@
click=
"removeNames('fund_detail', fundIndex)"
>
删除
</i>
</div>
<el-form-item
style=
"margin-left: 5%; margin-top: 2%"
label-width=
"formLabelWidth"
label=
"二级标题"
>
<el-input
v-model=
"fundItem.name"
placeholder=
"请输入内容"
style=
"width: 50%"
></el-input>
</el-form-item>
<div
v-for=
"(fundKeywrod, fundIndex1) in fundItem.keywords"
:key=
"'fund-'+fundIndex1"
style=
"margin-top: 2%"
>
<el-form-item
style=
"margin-left: 2%"
label=
"关键词"
:label-width=
"formLabelWidth"
>
<el-input
v-model=
"fundKeywrod.name"
placeholder=
"请输入关键词"
style=
"width: 50%"
></el-input>
<span>
关键词得分:
</span>
<el-input
v-model=
"fundKeywrod.score"
placeholder=
"得分"
style=
"width: 20%"
></el-input>
<i
class=
"el-icon-circle-plus-outline"
@
click=
"addKeywords('fund_detail', fundIndex)"
></i>
<i
class=
"el-icon-remove-outline"
@
click=
"removeKeywords('fund_detail', fundIndex, fundIndex1)"
></i>
</el-form-item>
</div>
</div>
<el-form-item>
<el-divider
content-position=
"left"
>
案例投资本基金净值表现配置
</el-divider>
</el-form-item>
<div
v-for=
"(investItem, investIndex) in addForm.invest_detail"
:key=
"'invest-'+investIndex"
>
<div
style=
"margin-left: 5%"
>
<i
class=
"el-icon-circle-plus-outline"
@
click=
"addNames('invest_detail', investIndex)"
>
添加
</i>
<i
class=
"el-icon-remove-outline"
@
click=
"removeNames('invest_detail', investIndex)"
>
删除
</i>
</div>
<el-form-item
style=
"margin-left: 5%; margin-top: 2%"
label-width=
"formLabelWidth"
label=
"二级标题"
>
<el-input
v-model=
"investItem.name"
placeholder=
"请输入内容"
style=
"width: 50%"
></el-input>
</el-form-item>
<div
v-for=
"(investKeyword, investIndex1) in investItem.keywords"
:key=
"'invest-'+investIndex1"
style=
"margin-top: 2%"
>
<el-form-item
style=
"margin-left: 2%"
label=
"关键词"
:label-width=
"formLabelWidth"
>
<el-input
v-model=
"investKeyword.name"
placeholder=
"请输入关键词"
style=
"width: 50%"
></el-input>
<span>
关键词得分:
</span>
<el-input
v-model=
"investKeyword.score"
placeholder=
"得分"
style=
"width: 20%"
></el-input>
<i
class=
"el-icon-circle-plus-outline"
@
click=
"addKeywords('invest_detail', investIndex)"
></i>
<i
class=
"el-icon-remove-outline"
@
click=
"removeKeywords('invest_detail', investIndex, investIndex1)"
></i>
</el-form-item>
</div>
</div>
<el-form-item>
<el-divider
content-position=
"left"
></el-divider>
</el-form-item>
<el-form-item>
<div
class=
"demo-drawer__footer"
style=
"margin-left: 60%"
>
<el-button
@
click=
"cancelForm"
>
取 消
</el-button>
...
...
@@ -292,6 +343,7 @@
</el-form>
</div>
</el-drawer>
</el-scrollbar>
</div>
</div>
</template>
...
...
@@ -301,7 +353,7 @@ import * as casesApi from '@/api/cases2'
import
pdf
from
'vue-pdf'
import
*
as
categoryApi
from
'@/api/categories'
export
default
{
name
:
'index'
,
name
:
'
cases-
index'
,
components
:
{
pdf
},
...
...
@@ -346,7 +398,7 @@ export default {
keywords
:
[
{
name
:
''
,
score
:
''
score
:
'
0
'
}
]
}
...
...
@@ -357,7 +409,7 @@ export default {
keywords
:
[
{
name
:
''
,
score
:
''
score
:
0
}
]
}
...
...
@@ -368,7 +420,7 @@ export default {
keywords
:
[
{
name
:
''
,
score
:
''
score
:
0
}
]
}
...
...
@@ -378,18 +430,7 @@ export default {
formLabelWidth
:
'100px'
,
loading
:
false
,
options
:
[],
visible
:
false
,
production_detail
:
[
{
name
:
''
,
keyword
:
[
{
name
:
''
,
score
:
''
}
]
}
]
visible
:
false
}
},
methods
:
{
...
...
@@ -489,6 +530,48 @@ export default {
this
.
drawer
=
false
clearTimeout
(
this
.
timer
)
},
initAddForm
()
{
this
.
addForm
=
{
name
:
''
,
level
:
''
,
category_id
:
0
,
accessory
:
''
,
url
:
''
,
production_detail
:
[
{
name
:
''
,
keywords
:
[
{
name
:
''
,
score
:
'0'
}
]
}
],
fund_detail
:
[
{
name
:
''
,
keywords
:
[
{
name
:
''
,
score
:
0
}
]
}
],
invest_detail
:
[
{
name
:
''
,
keywords
:
[
{
name
:
''
,
score
:
0
}
]
}
]
}
},
handleClose
(
done
)
{
if
(
this
.
loading
)
{
return
...
...
@@ -496,8 +579,16 @@ export default {
this
.
$confirm
(
'确定要提交表单吗?'
)
.
then
(
_
=>
{
this
.
loading
=
true
console
.
log
(
this
.
addForm
)
// 提交表单
casesApi
.
createCase2
(
this
.
addForm
).
then
(
res
=>
{
if
(
res
.
code
===
0
&&
res
.
message
===
'SUCCESS'
)
{
this
.
list
({
page
:
this
.
currentPage
,
limit
:
this
.
limit
})
this
.
initAddForm
()
this
.
$message
.
success
(
'添加案例成功'
)
}
else
{
this
.
$message
.
warning
(
res
.
message
)
}
})
this
.
timer
=
setTimeout
(()
=>
{
done
()
// 动画关闭需要一定的时间
...
...
@@ -557,8 +648,8 @@ export default {
})
},
handlePreview
(
file
)
{
if
(
!
this
.
mainForm
.
url
)
{
this
.
mainForm
.
url
=
file
.
url
if
(
!
this
.
addForm
.
accessory
)
{
this
.
addForm
.
accessory
=
file
.
url
}
this
.
visible
=
true
},
...
...
@@ -569,7 +660,18 @@ export default {
if
(
response
.
code
===
0
)
{
var
data
=
response
.
data
var
imageInfo
=
data
[
0
]
this
.
addForm
.
accessory
=
imageInfo
.
accessory
this
.
addForm
.
accessory
=
imageInfo
.
url
this
.
visible
=
false
}
else
{
console
.
log
(
'文件上传失败'
)
this
.
$message
.
error
(
'文件上传失败'
)
}
},
uploadUrlSuccess
(
response
,
file
,
fileList
)
{
if
(
response
.
code
===
0
)
{
var
data
=
response
.
data
var
imageInfo
=
data
[
0
]
this
.
addForm
.
url
=
imageInfo
.
url
this
.
visible
=
false
}
else
{
console
.
log
(
'文件上传失败'
)
...
...
@@ -584,11 +686,77 @@ export default {
this
.
addForm
.
url
=
file
.
url
}
this
.
visible
=
true
},
addNames
(
detailName
,
index
)
{
switch
(
detailName
)
{
case
'production_detail'
:
this
.
addForm
.
production_detail
.
push
({
name
:
''
,
keywords
:
[{
name
:
''
,
score
:
0
}]
})
break
case
'fund_detail'
:
this
.
addForm
.
fund_detail
.
push
({
name
:
''
,
keywords
:
[{
name
:
''
,
score
:
0
}]
})
break
case
'invest_detail'
:
this
.
addForm
.
invest_detail
.
push
({
name
:
''
,
keywords
:
[{
name
:
''
,
score
:
0
}]
})
break
}
},
removeNames
(
detailName
,
index
)
{
switch
(
detailName
)
{
case
'production_detail'
:
if
(
this
.
addForm
.
production_detail
.
length
>
1
)
{
this
.
addForm
.
production_detail
.
splice
(
index
,
1
)
}
break
case
'fund_detail'
:
if
(
this
.
addForm
.
fund_detail
.
length
>
1
)
{
this
.
addForm
.
fund_detail
.
splice
(
index
,
1
)
}
break
case
'invest_detail'
:
if
(
this
.
addForm
.
invest_detail
.
length
>
1
)
{
this
.
addForm
.
invest_detail
.
splice
(
index
,
1
)
}
break
}
},
addKeywords
(
detailName
,
index
)
{
switch
(
detailName
)
{
case
'production_detail'
:
this
.
addForm
.
production_detail
[
index
].
keywords
.
push
({
name
:
''
,
score
:
0
})
break
case
'fund_detail'
:
this
.
addForm
.
fund_detail
[
index
].
keywords
.
push
({
name
:
''
,
score
:
0
})
break
case
'invest_detail'
:
this
.
addForm
.
invest_detail
[
index
].
keywords
.
push
({
name
:
''
,
score
:
0
})
break
}
},
removeKeywords
(
detailName
,
index
,
index1
)
{
switch
(
detailName
)
{
case
'production_detail'
:
if
(
this
.
addForm
.
production_detail
[
index
].
keywords
.
length
>
1
)
{
this
.
addForm
.
production_detail
[
index
].
keywords
.
splice
(
index1
,
1
)
}
break
case
'fund_detail'
:
if
(
this
.
addForm
.
fund_detail
[
index
].
keywords
.
length
>
1
)
{
this
.
addForm
.
fund_detail
[
index
].
keywords
.
splice
(
index1
,
1
)
}
break
case
'invest_detail'
:
if
(
this
.
addForm
.
invest_detail
[
index
].
keywords
.
length
>
1
)
{
this
.
addForm
.
invest_detail
[
index
].
keywords
.
splice
(
index1
,
1
)
}
break
}
}
}
}
</
script
>
<
style
scoped
>
<
style
>
.el-drawer
{
overflow
:
auto
;
}
</
style
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论