Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
x-training-admin
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
x-training-admin
Commits
2a5300a3
提交
2a5300a3
authored
2月 08, 2021
作者:
wangyizheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
编辑案例
上级
b8bfad4d
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
328 行增加
和
92 行删除
+328
-92
cases2.js
src/api/cases2.js
+2
-2
index.vue
src/pages/v2/cases/index.vue
+107
-87
update.vue
src/pages/v2/cases/update.vue
+219
-3
没有找到文件。
src/api/cases2.js
浏览文件 @
2a5300a3
...
@@ -30,9 +30,9 @@ export function Case2(id, params = {}) {
...
@@ -30,9 +30,9 @@ export function Case2(id, params = {}) {
}
}
// 更新案例
// 更新案例
export
function
updateCase2
(
data
)
{
export
function
updateCase2
(
id
,
data
)
{
var
headers
=
{
var
headers
=
{
'Content-Type'
:
'application/json'
'Content-Type'
:
'application/json'
}
}
return
httpRequest
.
put
(
'/api/opera/v2/training/cases'
,
data
,
{
headers
})
return
httpRequest
.
put
(
`/api/opera/v2/training/
${
id
}
/case`
,
data
,
{
headers
})
}
}
src/pages/v2/cases/index.vue
浏览文件 @
2a5300a3
...
@@ -136,9 +136,9 @@
...
@@ -136,9 +136,9 @@
<embed
class=
"embed"
width=
"600px"
height=
"700px"
:src=
"pdfUrl"
type=
"application/pdf"
/>
<embed
class=
"embed"
width=
"600px"
height=
"700px"
:src=
"pdfUrl"
type=
"application/pdf"
/>
</div>
</div>
<div>
<div>
<el-dialog
title=
"产品概况"
:visible
.
sync=
"productionDialogFormVisible"
width=
"
9
0%"
center
>
<el-dialog
title=
"产品概况"
:visible
.
sync=
"productionDialogFormVisible"
width=
"
4
0%"
center
>
<
el-card
:body-style=
"{ padding: '0px' }
"
>
<
div
style=
"padding: 14px;"
v-for=
"(production, productionIndex) in productionDetail"
:key=
"productionIndex
"
>
<
div
style=
"padding: 14px;"
v-for=
"(production, productionIndex) in productionDetail"
:key=
"productionIndex"
>
<
el-card
>
<div>
<div>
<span><strong>
产品信息:
</strong></span><span>
{{ production.name }}
</span>
<span><strong>
产品信息:
</strong></span><span>
{{ production.name }}
</span>
</div>
</div>
...
@@ -149,15 +149,14 @@
...
@@ -149,15 +149,14 @@
<br/>
<br/>
</div>
</div>
</div>
</div>
<el-divider
v-if=
"productionIndex < productionDetail.length - 1"
content-position=
"right"
></el-divider>
</el-card>
</div>
</div>
</el-card>
</el-dialog>
</el-dialog>
</div>
</div>
<div>
<div>
<el-dialog
title=
"基金投资与净值表现"
:visible
.
sync=
"fundDialogFormVisible"
width=
"
9
0%"
center
>
<el-dialog
title=
"基金投资与净值表现"
:visible
.
sync=
"fundDialogFormVisible"
width=
"
4
0%"
center
>
<
el-card
:body-style=
"{ padding: '0px' }
"
>
<
div
style=
"padding: 14px;"
v-for=
"(production, index) in fundDetail"
:key=
"index
"
>
<
div
style=
"padding: 14px;"
v-for=
"(production, index) in fundDetail"
:key=
"index"
>
<
el-card
>
<div>
<div>
<span><strong>
产品信息:
</strong></span><span>
{{ production.name }}
</span>
<span><strong>
产品信息:
</strong></span><span>
{{ production.name }}
</span>
</div>
</div>
...
@@ -168,15 +167,14 @@
...
@@ -168,15 +167,14 @@
<br/>
<br/>
</div>
</div>
</div>
</div>
<el-divider
v-if=
"index < fundDetail.length - 1"
content-position=
"right"
></el-divider>
</el-card>
</div>
</div>
</el-card>
</el-dialog>
</el-dialog>
</div>
</div>
<div>
<div>
<el-dialog
title=
"投资本基金涉及的费用"
:visible
.
sync=
"investDialogFormVisible"
width=
"
9
0%"
center
>
<el-dialog
title=
"投资本基金涉及的费用"
:visible
.
sync=
"investDialogFormVisible"
width=
"
4
0%"
center
>
<
el-card
:body-style=
"{ padding: '0px' }
"
>
<
div
style=
"padding: 14px;"
v-for=
"(production, index) in investDetail"
:key=
"index
"
>
<
div
style=
"padding: 14px;"
v-for=
"(production, index) in investDetail"
:key=
"index"
>
<
el-card
>
<div>
<div>
<span><strong>
产品信息:
</strong></span><span>
{{ production.name }}
</span>
<span><strong>
产品信息:
</strong></span><span>
{{ production.name }}
</span>
</div>
</div>
...
@@ -187,25 +185,24 @@
...
@@ -187,25 +185,24 @@
<br/>
<br/>
</div>
</div>
</div>
</div>
<el-divider
v-if=
"index < investDetail.length - 1"
content-position=
"right"
></el-divider>
</el-card>
</div>
</div>
</el-card>
</el-dialog>
</el-dialog>
</div>
</div>
<div>
<div>
<el-scrollbar
style=
"height: 80%"
>
<el-scrollbar
style=
"height: 80%"
>
<el-drawer
<el-drawer
title=
"创建案例"
title=
"创建案例"
:visible
.
sync=
"drawer"
:visible
.
sync=
"drawer"
:direction=
"direction"
:direction=
"direction"
:append-to-body=
"true"
:append-to-body=
"true"
:withHeader=
"true"
:withHeader=
"true"
:before-close=
"handleClose"
:before-close=
"handleClose"
ref=
"drawer"
ref=
"drawer"
size=
"50%"
>
size=
"50%"
>
<div
class=
"demo-drawer__content"
>
<div
class=
"demo-drawer__content"
>
<el-form
:model=
"addForm"
size=
"mini"
>
<el-form
:model=
"addForm"
size=
"mini"
>
<el-form-item
label=
"案例名称"
:label-width=
"formLabelWidth"
>
<el-form-item
label=
"案例名称"
:label-width=
"formLabelWidth"
style=
"margin-right: 5%"
>
<el-input
v-model=
"addForm.name"
autocomplete=
"off"
></el-input>
<el-input
v-model=
"addForm.name"
autocomplete=
"off"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"案例等级"
:label-width=
"formLabelWidth"
>
<el-form-item
label=
"案例等级"
:label-width=
"formLabelWidth"
>
...
@@ -217,37 +214,37 @@
...
@@ -217,37 +214,37 @@
</el-form-item>
</el-form-item>
<el-form-item
label=
"案例分类"
:label-width=
"formLabelWidth"
>
<el-form-item
label=
"案例分类"
:label-width=
"formLabelWidth"
>
<el-cascader
<el-cascader
v-model=
"addForm.category_id"
v-model=
"addForm.category_id"
:options=
"options"
:options=
"options"
:show-all-levels=
"false"
:show-all-levels=
"false"
filterable
filterable
:before-filter=
"searchCategory"
:before-filter=
"searchCategory"
:props=
"{value: 'id', label: 'name', emitPath: false}"
:props=
"{value: 'id', label: 'name', emitPath: false}"
placeholder=
"试试搜索:分类"
>
placeholder=
"试试搜索:分类"
>
</el-cascader>
</el-cascader>
</el-form-item>
</el-form-item>
<el-form-item
label=
"产品说明书(pdf附件)"
:label-width=
"formLabelWidth"
>
<el-form-item
label=
"产品说明书(pdf附件)"
:label-width=
"formLabelWidth"
>
<el-upload
<el-upload
class=
"upload-pdf"
class=
"upload-pdf"
action=
"/api/opera/v1/file/upload"
action=
"/api/opera/v1/file/upload"
:on-preview=
"handlePreview"
:on-preview=
"handlePreview"
:on-remove=
"handleRemove"
:on-remove=
"handleRemove"
:on-success=
"uploadSuccess"
:on-success=
"uploadSuccess"
:limit=
"1"
:limit=
"1"
:on-exceed=
"handleExceed"
>
:on-exceed=
"handleExceed"
>
<el-button
size=
"small"
type=
"primary"
>
点击上传
</el-button>
<el-button
size=
"small"
type=
"primary"
>
点击上传
</el-button>
<div
slot=
"tip"
class=
"el-upload__tip"
>
只能上传pdf文件
</div>
<div
slot=
"tip"
class=
"el-upload__tip"
>
只能上传pdf文件
</div>
</el-upload>
</el-upload>
</el-form-item>
</el-form-item>
<el-form-item
label=
"图片"
:label-width=
"formLabelWidth"
>
<el-form-item
label=
"图片"
:label-width=
"formLabelWidth"
>
<el-upload
<el-upload
action=
"/api/opera/v1/file/upload"
action=
"/api/opera/v1/file/upload"
list-type=
"picture-card"
list-type=
"picture-card"
:limit=
"1"
:limit=
"1"
:on-success=
"uploadUrlSuccess"
:on-success=
"uploadUrlSuccess"
:multiple=
"false"
:multiple=
"false"
:data=
"{ type: 'image' }"
:data=
"{ type: 'image' }"
:on-preview=
"createPictureCardPreview"
>
:on-preview=
"createPictureCardPreview"
>
<i
class=
"el-icon-plus"
></i>
<i
class=
"el-icon-plus"
></i>
</el-upload>
</el-upload>
<el-dialog
:visible
.
sync=
"visible"
append-to-body
>
<el-dialog
:visible
.
sync=
"visible"
append-to-body
>
...
@@ -259,64 +256,88 @@
...
@@ -259,64 +256,88 @@
<el-divider
content-position=
"left"
>
产品概况配置
</el-divider>
<el-divider
content-position=
"left"
>
产品概况配置
</el-divider>
</el-form-item>
</el-form-item>
<div
v-for=
"(item, index) in addForm.production_detail"
:key=
"'production-'+index"
>
<div
v-for=
"(item, index) in addForm.production_detail"
:key=
"'production-'+index"
>
<div
style=
"margin-left: 5%"
>
<div
style=
"margin-left: 5%
; margin-top: 2%
"
>
<i
class=
"el-icon-circle-plus-outline"
@
click=
"addNames('production_detail', index)"
>
添加
</i>
<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>
<i
class=
"el-icon-remove-outline"
@
click=
"removeNames('production_detail', index)"
>
删除
</i>
</div>
</div>
<el-form-item
style=
"margin-left: 5%; margin-top: 2%"
label-width=
"formLabelWidth"
label=
"二级标题"
>
<el-card
style=
"margin-left: 5%; margin-top: 2%; margin-right: 5%"
>
<el-input
v-model=
"item.name"
placeholder=
"请输入内容"
style=
"width: 50%"
></el-input>
<div>
</el-form-item>
<span>
<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
size=
"mini"
v-model=
"item.name"
placeholder=
"请输入内容"
style=
"width: 50%"
></el-input>
<el-input
v-model=
"keywrod.name"
placeholder=
"请输入关键词"
style=
"width: 50%"
></el-input>
</span>
<span>
关键词得分:
</span>
</div>
<el-input
v-model
.
number=
"keywrod.score"
placeholder=
"得分"
style=
"width: 20%"
></el-input>
<div
v-for=
"(keywrod, index1) in item.keywords"
:key=
"'production-'+index1"
style=
"margin-top: 2%"
>
<i
class=
"el-icon-circle-plus-outline"
@
click=
"addKeywords('production_detail', index)"
></i>
<el-card>
<i
class=
"el-icon-remove-outline"
@
click=
"removeKeywords('production_detail', index, index1)"
></i>
<span>
</el-form-item>
<span>
关键词
</span>
</div>
<el-input
size=
"mini"
v-model=
"keywrod.name"
placeholder=
"请输入关键词"
style=
"width: 40%"
></el-input>
<span
style=
"margin-left: 2%"
>
关键词得分:
</span>
<el-input
size=
"mini"
v-model
.
number=
"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>
</span>
</el-card>
</div>
</el-card>
</div>
</div>
<el-form-item>
<el-form-item>
<el-divider
content-position=
"left"
>
案例基金与净值表现配置
</el-divider>
<el-divider
content-position=
"left"
>
案例基金与净值表现配置
</el-divider>
</el-form-item>
</el-form-item>
<div
v-for=
"(fundItem, fundIndex) in addForm.fund_detail"
:key=
"'fund-'+fundIndex"
>
<div
v-for=
"(fundItem, fundIndex) in addForm.fund_detail"
:key=
"'fund-'+fundIndex"
>
<div
style=
"margin-left: 5%"
>
<div
style=
"margin-left: 5%
; margin-top: 2%
"
>
<i
class=
"el-icon-circle-plus-outline"
@
click=
"addNames('fund_detail', fundIndex)"
>
添加
</i>
<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>
<i
class=
"el-icon-remove-outline"
@
click=
"removeNames('fund_detail', fundIndex)"
>
删除
</i>
</div>
</div>
<el-form-item
style=
"margin-left: 5%; margin-top: 2%"
label-width=
"formLabelWidth"
label=
"二级标题"
>
<el-card
style=
"margin-left: 5%; margin-top: 2%; margin-right: 5%"
>
<el-input
v-model=
"fundItem.name"
placeholder=
"请输入内容"
style=
"width: 50%"
></el-input>
<div>
</el-form-item>
<span>
<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
size=
"mini"
v-model=
"fundItem.name"
placeholder=
"请输入内容"
style=
"width: 50%"
></el-input>
<el-input
v-model=
"fundKeywrod.name"
placeholder=
"请输入关键词"
style=
"width: 50%"
></el-input>
</span>
<span>
关键词得分:
</span>
</div>
<el-input
v-model
.
number=
"fundKeywrod.score"
placeholder=
"得分"
style=
"width: 20%"
></el-input>
<div
v-for=
"(fundKeywrod, fundIndex1) in fundItem.keywords"
:key=
"'fund-'+fundIndex1"
style=
"margin-top: 2%"
>
<i
class=
"el-icon-circle-plus-outline"
@
click=
"addKeywords('fund_detail', fundIndex)"
></i>
<el-card>
<i
class=
"el-icon-remove-outline"
@
click=
"removeKeywords('fund_detail', fundIndex, fundIndex1)"
></i>
<span>
</el-form-item>
<span>
关键词
</span>
</div>
<el-input
size=
"mini"
v-model=
"fundKeywrod.name"
placeholder=
"请输入关键词"
style=
"width: 40%"
></el-input>
<span
style=
"margin-left: 2%"
>
关键词得分:
</span>
<el-input
size=
"mini"
v-model
.
number=
"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>
</span>
</el-card>
</div>
</el-card>
</div>
</div>
<el-form-item>
<el-form-item>
<el-divider
content-position=
"left"
>
案例投资本基金净值表现配置
</el-divider>
<el-divider
content-position=
"left"
>
案例投资本基金净值表现配置
</el-divider>
</el-form-item>
</el-form-item>
<div
v-for=
"(investItem, investIndex) in addForm.invest_detail"
:key=
"'invest-'+investIndex"
>
<div
v-for=
"(investItem, investIndex) in addForm.invest_detail"
:key=
"'invest-'+investIndex"
>
<div
style=
"margin-left: 5%"
>
<div
style=
"margin-left: 5%
; margin-top: 2%
"
>
<i
class=
"el-icon-circle-plus-outline"
@
click=
"addNames('invest_detail', investIndex)"
>
添加
</i>
<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>
<i
class=
"el-icon-remove-outline"
@
click=
"removeNames('invest_detail', investIndex)"
>
删除
</i>
</div>
</div>
<el-form-item
style=
"margin-left: 5%; margin-top: 2%"
label-width=
"formLabelWidth"
label=
"二级标题"
>
<el-card
style=
"margin-left: 5%; margin-top: 2%; margin-right: 5%"
>
<el-input
v-model=
"investItem.name"
placeholder=
"请输入内容"
style=
"width: 50%"
></el-input>
<div>
</el-form-item>
<span>
<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
size=
"mini"
v-model=
"investItem.name"
placeholder=
"请输入内容"
style=
"width: 50%"
></el-input>
<el-input
v-model=
"investKeyword.name"
placeholder=
"请输入关键词"
style=
"width: 50%"
></el-input>
</span>
<span>
关键词得分:
</span>
</div>
<el-input
v-model
.
number=
"investKeyword.score"
placeholder=
"得分"
style=
"width: 20%"
></el-input>
<div
v-for=
"(investKeyword, investIndex1) in investItem.keywords"
:key=
"'invest-'+investIndex1"
style=
"margin-top: 2%"
>
<i
class=
"el-icon-circle-plus-outline"
@
click=
"addKeywords('invest_detail', investIndex)"
></i>
<el-card>
<span>
<span>
关键词
</span>
<el-input
size=
"mini"
v-model=
"investKeyword.name"
placeholder=
"请输入关键词"
style=
"width: 40%"
></el-input>
<span
style=
"margin-left: 2%"
>
关键词得分:
</span>
<el-input
size=
"mini"
v-model
.
number=
"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>
<i
class=
"el-icon-remove-outline"
@
click=
"removeKeywords('invest_detail', investIndex, investIndex1)"
></i>
</el-form-item>
</span>
</div>
</el-card>
</div>
</el-card>
</div>
</div>
<el-form-item>
<el-form-item>
<el-divider
content-position=
"left"
></el-divider>
<el-divider
content-position=
"left"
></el-divider>
...
@@ -635,7 +656,6 @@ export default {
...
@@ -635,7 +656,6 @@ export default {
if
(
!
this
.
addForm
.
accessory
)
{
if
(
!
this
.
addForm
.
accessory
)
{
this
.
addForm
.
accessory
=
file
.
url
this
.
addForm
.
accessory
=
file
.
url
}
}
this
.
visible
=
true
},
},
handleRemove
(
file
,
fileList
)
{
handleRemove
(
file
,
fileList
)
{
console
.
log
(
file
,
fileList
)
console
.
log
(
file
,
fileList
)
...
...
src/pages/v2/cases/update.vue
浏览文件 @
2a5300a3
...
@@ -37,20 +37,30 @@
...
@@ -37,20 +37,30 @@
<el-upload
<el-upload
class=
"upload-pdf"
class=
"upload-pdf"
action=
"/api/opera/v1/file/upload"
action=
"/api/opera/v1/file/upload"
:on-preview=
"handlePreview"
:on-remove=
"handleRemove"
:on-remove=
"handleRemove"
:on-success=
"uploadSuccess"
:on-success=
"uploadSuccess"
:file-list=
"accessoryFiles"
:limit=
"1"
:limit=
"1"
:on-preview=
"handlePreview"
:on-exceed=
"handleExceed"
>
:on-exceed=
"handleExceed"
>
<el-button
size=
"small"
type=
"primary"
>
点击上传
</el-button>
<el-button
size=
"small"
type=
"primary"
>
点击上传
</el-button>
<div
slot=
"tip"
class=
"el-upload__tip"
>
只能上传pdf文件
</div>
<div
slot=
"tip"
class=
"el-upload__tip"
>
只能上传pdf文件
</div>
</el-upload>
</el-upload>
<el-popover
placement=
"right"
width=
"500"
trigger=
"click"
v-if=
"updateForm.accessory"
>
<embed
class=
"embed"
width=
"600px"
height=
"700px"
:src=
"updateForm.accessory"
type=
"application/pdf"
/>
<el-button
slot=
"reference"
size=
"mini"
round
>
预览pdf
</el-button>
</el-popover>
</el-form-item>
</el-form-item>
<el-form-item
label=
"图片"
:label-width=
"formLabelWidth"
>
<el-form-item
label=
"图片"
:label-width=
"formLabelWidth"
>
<el-upload
<el-upload
action=
"/api/opera/v1/file/upload"
action=
"/api/opera/v1/file/upload"
list-type=
"picture-card"
list-type=
"picture-card"
:limit=
"1"
:limit=
"1"
:file-list=
"urlFiles"
:on-success=
"uploadUrlSuccess"
:on-success=
"uploadUrlSuccess"
:multiple=
"false"
:multiple=
"false"
:data=
"
{ type: 'image' }"
:data=
"
{ type: 'image' }"
...
@@ -62,6 +72,101 @@
...
@@ -62,6 +72,101 @@
<el-input
:v-model=
"updateForm.url"
:value=
"updateForm.url"
></el-input>
<el-input
:v-model=
"updateForm.url"
:value=
"updateForm.url"
></el-input>
</el-dialog>
</el-dialog>
</el-form-item>
</el-form-item>
<el-form-item>
<el-divider
content-position=
"left"
>
产品概况配置
</el-divider>
</el-form-item>
<div
v-for=
"(item, index) in updateForm.production_detail"
:key=
"'production-'+index"
>
<div
style=
"margin-left: 5%; margin-top: 2%"
>
<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>
</div>
<el-card
style=
"margin-top: 2%"
>
<div>
<span>
二级标题:
<el-input
size=
"mini"
v-model=
"item.name"
placeholder=
"请输入内容"
style=
"width: 50%"
></el-input>
</span>
</div>
<div
v-for=
"(keywrod, index1) in item.keywords"
:key=
"'production-'+index1"
style=
"margin-top: 2%"
>
<el-card>
<span>
<span>
关键词:
</span>
<el-input
size=
"mini"
v-model=
"keywrod.name"
placeholder=
"请输入关键词"
style=
"width: 50%"
></el-input>
<span
style=
"margin-left: 2%"
>
关键词得分:
</span>
<el-input
size=
"mini"
v-model
.
number=
"keywrod.score"
placeholder=
"得分"
style=
"width: 10%"
></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>
</span>
</el-card>
</div>
</el-card>
</div>
<el-form-item>
<el-divider
content-position=
"left"
>
案例基金与净值表现配置
</el-divider>
</el-form-item>
<div
v-for=
"(fundItem, fundIndex) in updateForm.fund_detail"
:key=
"'fund-'+fundIndex"
>
<div
style=
"margin-left: 5%; margin-top: 2%"
>
<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-card
style=
"margin-top: 2%"
>
<div>
<span>
二级标题:
<el-input
size=
"mini"
v-model=
"fundItem.name"
placeholder=
"请输入内容"
style=
"width: 50%"
></el-input>
</span>
</div>
<div
v-for=
"(fundKeywrod, fundIndex1) in fundItem.keywords"
:key=
"'fund-'+fundIndex1"
style=
"margin-top: 2%"
>
<el-card>
<span>
<span>
关键词:
</span>
<el-input
size=
"mini"
v-model=
"fundKeywrod.name"
placeholder=
"请输入关键词"
style=
"width: 50%"
></el-input>
<span
style=
"margin-left: 2%"
>
关键词得分:
</span>
<el-input
size=
"mini"
v-model
.
number=
"fundKeywrod.score"
placeholder=
"得分"
style=
"width: 10%"
></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>
</span>
</el-card>
</div>
</el-card>
</div>
<el-form-item>
<el-divider
content-position=
"left"
>
案例投资本基金净值表现配置
</el-divider>
</el-form-item>
<div
v-for=
"(investItem, investIndex) in updateForm.invest_detail"
:key=
"'invest-'+investIndex"
>
<div
style=
"margin-left: 5%; margin-top: 2%"
>
<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-card
style=
"margin-top: 2%"
>
<div>
<span>
二级标题:
<el-input
size=
"mini"
v-model=
"investItem.name"
placeholder=
"请输入内容"
style=
"width: 50%"
></el-input>
</span>
</div>
<div
v-for=
"(investKeyword, investIndex1) in investItem.keywords"
:key=
"'invest-'+investIndex1"
style=
"margin-top: 2%"
>
<el-card>
<span>
<span>
关键词:
</span>
<el-input
size=
"mini"
v-model=
"investKeyword.name"
placeholder=
"请输入关键词"
style=
"width: 50%"
></el-input>
<span
style=
"margin-left: 2%"
>
关键词得分:
</span>
<el-input
size=
"mini"
v-model
.
number=
"investKeyword.score"
placeholder=
"得分"
style=
"width: 10%"
></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>
</span>
</el-card>
</div>
</el-card>
</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
type=
"primary"
@
click=
"save"
>
保 存
</el-button>
</div>
</el-form-item>
</el-form>
</el-form>
</el-card>
</el-card>
</div>
</div>
...
@@ -70,6 +175,7 @@
...
@@ -70,6 +175,7 @@
<
script
>
<
script
>
import
*
as
categoryApi
from
'@/api/categories'
import
*
as
categoryApi
from
'@/api/categories'
import
*
as
casesApi
from
'@/api/cases2'
export
default
{
export
default
{
name
:
'update'
,
name
:
'update'
,
data
()
{
data
()
{
...
@@ -78,6 +184,8 @@ export default {
...
@@ -78,6 +184,8 @@ export default {
formLabelWidth
:
'100px'
,
formLabelWidth
:
'100px'
,
options
:
[],
options
:
[],
visible
:
false
,
visible
:
false
,
accessoryFiles
:
[],
urlFiles
:
[],
updateForm
:
{
updateForm
:
{
name
:
''
,
name
:
''
,
level
:
''
,
level
:
''
,
...
@@ -121,9 +229,54 @@ export default {
...
@@ -121,9 +229,54 @@ export default {
}
}
},
},
mounted
()
{
mounted
()
{
this
.
id
=
this
.
$route
.
query
.
id
this
.
getInfo
(
this
.
id
)
this
.
categoryList
()
this
.
categoryList
()
},
},
methods
:
{
methods
:
{
save
()
{
casesApi
.
updateCase2
(
this
.
id
,
this
.
updateForm
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
this
.
$message
.
success
(
res
.
message
)
return
true
}
else
{
this
.
$message
.
error
(
res
.
message
)
return
false
}
})
},
getInfo
(
id
)
{
casesApi
.
Case2
(
id
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
var
data
=
res
.
data
this
.
updateForm
.
name
=
data
.
name
this
.
updateForm
.
level
=
data
.
level
if
(
data
.
categories
)
{
this
.
updateForm
.
category_id
=
data
.
categories
[
0
].
id
}
this
.
updateForm
.
accessory
=
data
.
accessory
this
.
updateForm
.
url
=
data
.
url
if
(
data
.
production_detail
)
{
this
.
updateForm
.
production_detail
=
data
.
production_detail
}
if
(
data
.
invest_detail
)
{
this
.
updateForm
.
invest_detail
=
data
.
invest_detail
}
if
(
data
.
fund_detail
)
{
this
.
updateForm
.
fund_detail
=
data
.
fund_detail
}
if
(
data
.
accessory
)
{
this
.
accessoryFiles
=
[{
url
:
data
.
accessory
,
name
:
data
.
accessory
}]
}
if
(
data
.
url
)
{
this
.
urlFiles
=
[{
url
:
data
.
url
}]
}
}
else
{
this
.
$message
.
error
(
res
.
message
)
return
false
}
})
},
searchCategory
(
keyword
)
{
searchCategory
(
keyword
)
{
categoryApi
.
categories
({
name
:
keyword
,
page
:
1
,
limit
:
10
}).
then
(
res
=>
{
categoryApi
.
categories
({
name
:
keyword
,
page
:
1
,
limit
:
10
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
...
@@ -175,7 +328,6 @@ export default {
...
@@ -175,7 +328,6 @@ export default {
if
(
!
this
.
updateForm
.
accessory
)
{
if
(
!
this
.
updateForm
.
accessory
)
{
this
.
updateForm
.
accessory
=
file
.
url
this
.
updateForm
.
accessory
=
file
.
url
}
}
this
.
visible
=
true
},
},
handleRemove
(
file
,
fileList
)
{
handleRemove
(
file
,
fileList
)
{
console
.
log
(
file
,
fileList
)
console
.
log
(
file
,
fileList
)
...
@@ -209,7 +361,71 @@ export default {
...
@@ -209,7 +361,71 @@ export default {
if
(
!
this
.
updateForm
.
url
)
{
if
(
!
this
.
updateForm
.
url
)
{
this
.
updateForm
.
url
=
file
.
url
this
.
updateForm
.
url
=
file
.
url
}
}
this
.
updateForm
=
true
this
.
visible
=
true
},
addNames
(
detailName
,
index
)
{
switch
(
detailName
)
{
case
'production_detail'
:
this
.
updateForm
.
production_detail
.
push
({
name
:
''
,
keywords
:
[{
name
:
''
,
score
:
0
}]
})
break
case
'fund_detail'
:
this
.
updateForm
.
fund_detail
.
push
({
name
:
''
,
keywords
:
[{
name
:
''
,
score
:
0
}]
})
break
case
'invest_detail'
:
this
.
updateForm
.
invest_detail
.
push
({
name
:
''
,
keywords
:
[{
name
:
''
,
score
:
0
}]
})
break
}
},
removeNames
(
detailName
,
index
)
{
switch
(
detailName
)
{
case
'production_detail'
:
if
(
this
.
updateForm
.
production_detail
.
length
>
1
)
{
this
.
updateForm
.
production_detail
.
splice
(
index
,
1
)
}
break
case
'fund_detail'
:
if
(
this
.
updateForm
.
fund_detail
.
length
>
1
)
{
this
.
updateForm
.
fund_detail
.
splice
(
index
,
1
)
}
break
case
'invest_detail'
:
if
(
this
.
updateForm
.
invest_detail
.
length
>
1
)
{
this
.
updateForm
.
invest_detail
.
splice
(
index
,
1
)
}
break
}
},
addKeywords
(
detailName
,
index
)
{
switch
(
detailName
)
{
case
'production_detail'
:
this
.
updateForm
.
production_detail
[
index
].
keywords
.
push
({
name
:
''
,
score
:
0
})
break
case
'fund_detail'
:
this
.
updateForm
.
fund_detail
[
index
].
keywords
.
push
({
name
:
''
,
score
:
0
})
break
case
'invest_detail'
:
this
.
updateForm
.
invest_detail
[
index
].
keywords
.
push
({
name
:
''
,
score
:
0
})
break
}
},
removeKeywords
(
detailName
,
index
,
index1
)
{
switch
(
detailName
)
{
case
'production_detail'
:
if
(
this
.
updateForm
.
production_detail
[
index
].
keywords
.
length
>
1
)
{
this
.
updateForm
.
production_detail
[
index
].
keywords
.
splice
(
index1
,
1
)
}
break
case
'fund_detail'
:
if
(
this
.
updateForm
.
fund_detail
[
index
].
keywords
.
length
>
1
)
{
this
.
updateForm
.
fund_detail
[
index
].
keywords
.
splice
(
index1
,
1
)
}
break
case
'invest_detail'
:
if
(
this
.
updateForm
.
invest_detail
[
index
].
keywords
.
length
>
1
)
{
this
.
updateForm
.
invest_detail
[
index
].
keywords
.
splice
(
index1
,
1
)
}
break
}
}
}
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论