提交 630ddb6f authored 作者: wangyizheng's avatar wangyizheng

新增更新用户使用配置

上级 b587ab07
...@@ -8,7 +8,7 @@ export function createUserUseConfig(data) { ...@@ -8,7 +8,7 @@ export function createUserUseConfig(data) {
return httpRequest.post('/api/opera/v2/training/user-use-config', data, { headers }) return httpRequest.post('/api/opera/v2/training/user-use-config', data, { headers })
} }
// 添加用户使用配置 // 用户使用配置
export function userUseConfig(id, params = {}) { export function userUseConfig(id, params = {}) {
var headers = { var headers = {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
...@@ -25,7 +25,7 @@ export function deleteUserUseConfig(id, params = {}) { ...@@ -25,7 +25,7 @@ export function deleteUserUseConfig(id, params = {}) {
} }
// 更新用户使用配置 // 更新用户使用配置
export function upateUserUseConfig(id, data = {}) { export function updateUserUseConfig(id, data = {}) {
var headers = { var headers = {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
} }
......
...@@ -156,7 +156,7 @@ ...@@ -156,7 +156,7 @@
</el-dialog> </el-dialog>
</div> </div>
<div> <div>
<el-dialog title="基金投资与净值表现sds" :visible.sync="fundDialogFormVisible" width="90%" center> <el-dialog title="基金投资与净值表现" :visible.sync="fundDialogFormVisible" width="90%" center>
<el-card :body-style="{ padding: '0px' }"> <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">
<div> <div>
......
...@@ -290,6 +290,8 @@ export default { ...@@ -290,6 +290,8 @@ export default {
} }
</script> </script>
<style scoped> <style>
.el-drawer {
overflow: auto;
}
</style> </style>
...@@ -70,7 +70,6 @@ ...@@ -70,7 +70,6 @@
<el-table-column fixed="right" label="操作"> <el-table-column fixed="right" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select size="mini" :value="opera" @change="operation" placeholder="请选择"> <el-select size="mini" :value="opera" @change="operation" placeholder="请选择">
<el-option :value="{ tag: 'detail', row: scope.row }" label="详情"></el-option>
<el-option :value="{ tag: 'edit', row: scope.row }" label="编辑"></el-option> <el-option :value="{ tag: 'edit', row: scope.row }" label="编辑"></el-option>
<el-option :value="{ tag: 'delete', row: scope.row }" label="删除"></el-option> <el-option :value="{ tag: 'delete', row: scope.row }" label="删除"></el-option>
</el-select> </el-select>
...@@ -192,6 +191,7 @@ export default { ...@@ -192,6 +191,7 @@ export default {
case 'detail': case 'detail':
break break
case 'edit': case 'edit':
this.$router.push({ path: '/training/useruseconfigs/update', query: { id: opera.row.id } })
break break
case 'delete': case 'delete':
this.handleDelete(opera.row.id) this.handleDelete(opera.row.id)
...@@ -292,6 +292,8 @@ export default { ...@@ -292,6 +292,8 @@ export default {
} }
</script> </script>
<style scoped> <style>
.el-drawer {
overflow: auto;
}
</style> </style>
<template>
<div>
<el-card class="box-card">
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item :to="{ path: '/training/useruseconfigs' }">用户使用配置管理</el-breadcrumb-item>
<el-breadcrumb-item>编辑用户使用配置</el-breadcrumb-item>
</el-breadcrumb>
</el-card>
<div>
<el-card class="box-card">
<el-form :model="updateForm" size="mini">
<el-form-item label="案例" :label-width="formLabelWidth">
<el-input disabled v-model="caseName" size="mini"></el-input>
</el-form-item>
<el-form-item>
<el-divider content-position="left">配置</el-divider>
</el-form-item>
<div v-for="(updateOption, updateOptionIndex) in updateForm.options" :key="'updateOption-' + updateOptionIndex" style="margin-top: 2%">
<i style="margin-left: 15%" class="el-icon-circle-plus-outline" @click="addOptions(updateOptionIndex)">添加</i>
<i class="el-icon-remove-outline" @click="removeOptions(updateOptionIndex)">删除</i>
<el-card class="box-card" style="margin-left: 10%; margin-top: 2%">
<div style="margin-top: 2%">
<span style="margin-left: 2%">
<span>配置项:</span>
<el-input size="mini" v-model="updateForm.options[updateOptionIndex]" placeholder="配置项" style="width: 50%"></el-input>
</span>
</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-card>
</div>
</div>
</template>
<script>
import * as userUseConfigApi from '@/api/user-use-config'
export default {
name: 'update',
data() {
return {
id: 0,
caseName: '',
formLabelWidth: '100px',
updateForm: {
options: []
}
}
},
mounted() {
this.id = this.$route.query.id
this.getInfo(this.id)
},
methods: {
save() {
userUseConfigApi.updateUserUseConfig(this.id, this.updateForm).then(res => {
if (res.code === 0) {
this.$message.success(res.message)
return true
} else {
this.$message.error(res.message)
}
})
},
addOptions(updateOptionIndex) {
this.updateForm.options.push('')
},
removeOptions(updateOptionIndex) {
if (this.updateForm.options.length > 1) {
this.updateForm.options.splice(updateOptionIndex, 1)
}
},
getInfo(id) {
userUseConfigApi.userUseConfig(id).then(res => {
if (res.code === 0) {
var data = res.data
this.caseName = data.case.name
this.updateForm.options = data.options
return true
} else {
this.$message.error(res.message)
return false
}
})
}
}
}
</script>
<style>
</style>
...@@ -20,7 +20,8 @@ const userGroup = [ ...@@ -20,7 +20,8 @@ const userGroup = [
{ path: '/training/cases', name: 'cases', component: () => import('@/pages/v2/cases/index') }, { path: '/training/cases', name: 'cases', component: () => import('@/pages/v2/cases/index') },
{ path: '/training/characteristics', name: 'characteristics', component: () => import('@/pages/v2/characteristics/index') }, { path: '/training/characteristics', name: 'characteristics', component: () => import('@/pages/v2/characteristics/index') },
{ path: '/training/reachschemes', name: 'reach_schemes', component: () => import('@/pages/v2/reachschemes/index') }, { path: '/training/reachschemes', name: 'reach_schemes', component: () => import('@/pages/v2/reachschemes/index') },
{ path: '/training/useruseconfigs', name: 'useruseconfigs', component: () => import('@/pages/v2/useruseconfigs/index') } { path: '/training/useruseconfigs', name: 'useruseconfigs', component: () => import('@/pages/v2/useruseconfigs/index') },
{ path: '/training/useruseconfigs/update', name: 'useruseconfigs-update', component: () => import('@/pages/v2/useruseconfigs/update') }
] ]
export default [ export default [
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论