提交 3ae4a214 authored 作者: wangyizheng's avatar wangyizheng

新增案例列表

上级 8c64cc56
......@@ -35,20 +35,126 @@
style="width: 100%">
<el-table-column fixed prop="id" label="ID" width="150px">
</el-table-column>
<el-table-column fixed width="150px" label="案例名称">
<el-table-column width="150px" label="案例名称">
<template slot-scope="scope">
<span>{{ scope.row.case.name }}</span>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作">
<template slot-scope="scope">
<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: 'delete', row: scope.row }" label="删除"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column width="150px" label="特征选项配置">
<template slot-scope="scope">
<el-popover
placement="right"
width="500"
trigger="click">
<el-card :body-style="{ padding: '0px' }">
<div style="padding: 14px;" v-for="(option, optionIndex) in scope.row.options" :key="'option-' + optionIndex">
<div>
<span><strong>特征选项名称:</strong></span><span>{{ option.name }}</span>
</div>
<div class="bottom clearfix">
<span><strong>特征选项配置</strong></span>
<div v-for="(option1, optionIndex1) in option.options" :key="'option1-' + optionIndex1">
<span><el-tag effect="plain" type="" size="mini">{{ option1.option }}</el-tag></span>
<span>{{ option1.option_name }}, 分数:{{ option1.score}}, </span>
<span>
答案:
<el-icon v-if="option1.answer" class="el-icon-check"></el-icon>
<el-icon v-else class="el-icon-close"></el-icon>
,
</span>
<span>
触及红线:
<el-icon v-if="option1.warning" class="el-icon-check"></el-icon>
<el-icon v-else class="el-icon-close"></el-icon>
</span>
<br/>
</div>
</div>
<el-divider v-if="optionIndex < scope.row.options.length - 1" content-position="right"></el-divider>
</div>
</el-card>
<el-button slot="reference" size="mini">查看配置</el-button>
</el-popover>
</template>
</el-table-column>
<el-table-column width="150px" label="择算分规则">
<template slot-scope="scope">
<el-popover
placement="right"
width="500"
trigger="click">
<el-card :body-style="{ padding: '0px' }">
<div style="padding: 14px;" v-for="(rule, ruleIndex) in scope.row.rules" :key="'rule-' + ruleIndex">
<div>
<span><strong>分数范围:</strong></span>
<span>{{ rule.min }} ~ {{ rule.max }}</span>
</div>
<div>
<span><strong>得分:</strong></span>
<span>{{ rule.score }}</span>
</div>
<el-divider v-if="ruleIndex < scope.row.rules.length - 1" content-position="right"></el-divider>
</div>
</el-card>
<el-button slot="reference" size="mini">查看择算分规则</el-button>
</el-popover>
</template>
</el-table-column>
<el-table-column width="150px" label="择算分规则">
<template slot-scope="scope">
<el-popover
placement="right"
width="500"
trigger="click">
<el-card :body-style="{ padding: '0px' }">
<div style="padding: 14px;" v-for="(rule, ruleIndex) in scope.row.rules" :key="'rule-' + ruleIndex">
<div>
<span><strong>分数范围:</strong></span>
<span>{{ rule.min }} ~ {{ rule.max }}</span>
</div>
<div>
<span><strong>得分:</strong></span>
<span>{{ rule.score }}</span>
</div>
<el-divider v-if="ruleIndex < scope.row.rules.length - 1" content-position="right"></el-divider>
</div>
</el-card>
<el-button slot="reference" size="mini">查看择算分规则</el-button>
</el-popover>
</template>
</el-table-column>
<el-table-column width="150px" label="风险等级规则">
<template slot-scope="scope">
<el-popover
placement="right"
width="500"
trigger="click">
<el-card :body-style="{ padding: '0px' }">
<div style="padding: 14px;" v-for="(level, levelIndex) in scope.row.levels" :key="'level-' + levelIndex">
<div>
<span><strong>分数范围:</strong></span>
<span>{{ level.min }} ~ {{ level.max }}</span>
</div>
<div>
<span><strong>风险等级规则:</strong></span>
<span><el-tag size="mini" type="" effect="plain">{{ getLevel(level.level) }}</el-tag></span>
</div>
<el-divider v-if="levelIndex < scope.row.levels.length - 1" content-position="right"></el-divider>
</div>
</el-card>
<el-button slot="reference" size="mini">查看风险等级规则</el-button>
</el-popover>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作">
<template slot-scope="scope">
<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: 'delete', row: scope.row }" label="删除"></el-option>
</el-select>
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
......@@ -78,7 +184,12 @@ export default {
limit: 10,
tableData: [],
drawer: false,
opera: ''
opera: '',
levelArr: [
{ level: 1, content: '低风险' },
{ level: 2, content: '中风险' },
{ level: 3, content: '高风险' }
]
}
},
mounted() {
......@@ -98,9 +209,24 @@ export default {
case 'edit':
break
case 'delete':
this.handleDelete(opera.row.id)
break
}
},
handleDelete(id) {
this.$confirm('确认删除?', '提示').then(_ => {
characteristicsApi.deleteCharacteristic2(id).then(res => {
if (res.code === 0) {
this.$message.success('删除成功')
this.list({ page: this.currentPage, limit: this.limit })
return true
} else {
this.$message.error(res.message)
return false
}
})
})
},
list(params = {}) {
characteristicsApi.characteristics2List(params).then(res => {
if (res.code === 0) {
......@@ -117,6 +243,16 @@ export default {
refresh() {
this.searchCaseName = ''
this.list({ page: 1, limit: this.limit })
},
getLevel(level) {
var detail = ''
for (var index in this.levelArr) {
if (this.levelArr[index].level === level) {
detail = this.levelArr[index].content
break
}
}
return detail
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论