You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
107 lines
3.5 KiB
Vue
107 lines
3.5 KiB
Vue
|
|
<template>
|
|
<div class="content">
|
|
<cs-search title="指标检索" :data="searchData" :span="6" direction="row" @onSearch="onSearch" @getData="onSearch" />
|
|
<div class="index-content">
|
|
<div class="header">
|
|
<el-button type="primary" icon="el-icon-circle-plus-outline" @click="handleAdd">新增</el-button>
|
|
</div>
|
|
<vxe-grid v-bind="gridOptions" style="margin-top: 20px">
|
|
<template #operate="{row}">
|
|
<el-button type="text" @click="handleEdit(row)">编辑</el-button>
|
|
<!-- <el-button type="text" @click="handleAtlas(row)">图谱</el-button> -->
|
|
<el-button type="text" style="color: red" @click="handleDel(row)">删除</el-button>
|
|
</template>
|
|
</vxe-grid>
|
|
<div style="text-align: center">
|
|
<cs-page
|
|
:page.sync="queryForm.page"
|
|
:limit.sync="queryForm.size"
|
|
:total="queryForm.total"
|
|
@pagination="fetchData"
|
|
/>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import mixin from '@/views/mixin'
|
|
import { queryIndexData, deleteModelIndex } from '@/api/indexRule'
|
|
|
|
export default {
|
|
name: 'Index',
|
|
mixins: [mixin],
|
|
data() {
|
|
return {
|
|
// 筛选数据
|
|
searchData: [
|
|
{ label: '指标名称', model: 'name', type: 'input' },
|
|
{ label: '指标类别', model: 'indexType', type: 'select', option: JSON.parse(sessionStorage.getItem('index_type')) },
|
|
// { label: '证据名称', model: 'doer', type: 'input' },
|
|
{ label: '案件类型', model: 'caseType', type: 'select', option: JSON.parse(sessionStorage.getItem('case_type')) },
|
|
{ label: '原子指标', model: 'atomicIndexName', type: 'input' }
|
|
],
|
|
// 表格配置
|
|
gridOptions: {
|
|
...mixin.data().gridOptions,
|
|
columns: [
|
|
{ type: 'expand', width: '40px', slots: { content: 'content' }},
|
|
{ title: '序号', type: 'seq', width: '50px' },
|
|
{ title: '指标名称', field: 'name', align: 'left' },
|
|
{ title: '指标类别', field: 'indexTypeName', width: '150px' },
|
|
{ title: '指标分数', field: 'indexScore', width: '150px', sortable: true },
|
|
{ title: '原子指标数量', field: 'atomicIndexNum', width: '150px' },
|
|
{ title: '最新时间', field: 'updateTime', width: '150px' },
|
|
{ title: '操作', slots: { default: 'operate' }, fixed: 'right', width: '150px' }
|
|
],
|
|
data: []
|
|
}
|
|
}
|
|
},
|
|
mounted() {
|
|
this.tableHeight(390)
|
|
},
|
|
methods: {
|
|
// 数据查询
|
|
fetchData() {
|
|
queryIndexData({ ...this.searchFormData }, this.queryForm.page, this.queryForm.size).then(res => {
|
|
this.gridOptions.data = res.data.result
|
|
this.queryForm.total = res.data.total
|
|
})
|
|
},
|
|
// 删除
|
|
handleDel(row) {
|
|
this.$baseConfirm('确定要删除吗?', null, async() => {
|
|
const { code, msg } = await deleteModelIndex(row.id)
|
|
code === 200 ? this.$baseMessage.success(msg || '删除成功!') : this.$baseMessage.error(msg || '删除失败!')
|
|
this.fetchData()
|
|
})
|
|
},
|
|
// 筛选
|
|
onSearch(data, callback) {
|
|
this.searchFormData = Object.assign({}, data)
|
|
this.queryForm.page = 1
|
|
this.fetchData()
|
|
if (callback) callback(true)
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
.content {
|
|
height: 100%;
|
|
.index-content {
|
|
border-radius: 8px;
|
|
background: white;
|
|
padding: 20px;
|
|
box-sizing: border-box;
|
|
margin-top: 10px;
|
|
height: calc(100% - 123px);
|
|
}
|
|
}
|
|
|
|
</style>
|