feat: 运营管理开发

dev
xiangcongshuai 4 months ago
parent 73f21f1ed9
commit ff60507e8e

@ -0,0 +1,44 @@
import request from '@/utils/request'
/** 查询任务列表 */
export function queryTaskList(data, page, size) {
return request({
url: `/taskRecord/taskList?page=${page}&size=${size}`,
method: 'post',
data
})
}
/** 取消任务 */
export function cancelTask(data) {
return request({
url: `/taskRecord/cancelTask`,
method: 'post',
data
})
}
/** 删除任务 */
export function deleteTask(data) {
return request({
url: `/taskRecord/deleteTask`,
method: 'post',
data
})
}
/** 查询案件列表 */
export function queryCaseList(data, page, size) {
return request({
url: `/mro/caseList?page=${page}&size=${size}`,
method: 'post',
data
})
}
/** 案件一键分析 */
export function caseAnalysis(data) {
return request({
url: `/mro/caseAnalysis`,
method: 'post',
data
})
}

@ -88,4 +88,12 @@ export function queryPromptDetails(data) {
method: 'post',
data
})
}
/** 执行提示词提取任务 */
export function executePromptExtractTask(data) {
return request({
url: `/taskRecord/executePromptExtractTask`,
method: 'post',
data
})
}

@ -170,6 +170,13 @@ export const asyncRoutes = [
permission: 'p_taskList',
component: () => import('@/views/operationManagement/TaskList/index.vue'),
meta: { title: '任务列表', affix: false }
},
{
path: '/handle-cases',
name: 'HandleCases',
permission: 'p_handleCases',
component: () => import('@/views/operationManagement/HandleCases/index.vue'),
meta: { title: '案件批量处理', affix: false }
}
]
},

@ -7,8 +7,8 @@
<div class="top">
<span>{{ detailsInfo.parentIndexName }}</span>
<span style="margin-top: 16px;">
<span v-if="detailsInfo.indexResult ==='true'" class="success"></span>
<span v-if="detailsInfo.indexResult ==='false'" class="error"></span>
<span v-if="detailsInfo.indexResult ==='true'" class="success"></span>
<span v-if="detailsInfo.indexResult ==='false'" class="error"></span>
<span>{{ detailsInfo.indexName }}</span>
</span>

@ -0,0 +1,148 @@
<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-video-play" @click="handleAnalysisAll"></el-button>
</div>
<vxe-grid ref="modelTable" :checkbox-config="{ checkMethod: checCheckboxkMethod}" :row-config="{isHover: true}" v-bind="gridOptions" style="margin-top: 20px">
<template #operate="{row}">
<el-button :disabled="['1'].includes(row.analysisStatus)" type="text" @click="handleAnalysis(row)"></el-button>
</template>
<template #identifyResult="{row}">
<span>{{ getTypeName(row.identifyResult,'identify_result') }}</span>
</template>
<template #analysisStatus="{row}">
<span>{{ getTypeName(row.analysisStatus,'case_analysis_status') }}</span>
</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 { queryCaseList, caseAnalysis } from '@/api/operationManagement'
export default {
name: 'HandleCases',
mixins: [mixin],
data() {
return {
//
searchData: [
{ label: '案件名称', model: 'caseName', type: 'input' },
{ label: '认定结果', model: 'identifyResult', type: 'selectMultiple', option: JSON.parse(sessionStorage.getItem('identify_result')) },
{ label: '分析状态', model: 'analysisStatus', type: 'selectMultiple', option: JSON.parse(sessionStorage.getItem('case_analysis_status')) }
],
//
gridOptions: {
...mixin.data().gridOptions,
columns: [
{ type: 'checkbox', width: '50px' },
// { type: 'checkbox', width: '50px', disabled: function(row) {
// return ['1', '2'].includes(row.analysisStatus)
// } },
{ title: '序号', type: 'seq', width: '50px' },
{ title: '案件名称', field: 'caseName' },
{ title: '认定结果', field: 'identifyResult', slots: { default: 'identifyResult' }},
{ title: '分析状态', field: 'analysisStatus', slots: { default: 'analysisStatus' }},
{ title: '最新分析时间', field: 'analysisSuccessTime' },
{ title: '操作', slots: { default: 'operate' }, fixed: 'right', width: '150px' }
],
data: []
}
}
},
mounted() {
this.tableHeight(390)
},
methods: {
//
fetchData() {
queryCaseList({ ...this.searchFormData }, this.queryForm.page, this.queryForm.size).then(res => {
this.gridOptions.data = res.data.records
this.queryForm.total = res.data.total
})
},
checCheckboxkMethod({ row }) {
//
if (['1'].includes(row.analysisStatus)) {
return false// ture
} else {
return true
}
},
handleAnalysisAll() {
const item = this.$refs.modelTable.getCheckboxRecords()
if (item.length === 0) {
this.$baseMessage.error('请至少选择一条数据!')
return
}
const list = []
for (const items of item) {
list.push(items.caseId)
}
this.handlecaseAnalysis(list)
},
getTypeName(val, type) {
for (const item of JSON.parse(sessionStorage.getItem(type))) {
if (item.value === val) {
return item.label
}
}
},
async handlecaseAnalysis(list) {
const loading = this.$baseLoading(1, '执行中...')
const res = await caseAnalysis(list)
loading.close()
if (res.code === 200) {
this.$baseMessage.success('分析成功')
this.fetchData()
}
},
handleAnalysis(row) {
row.analysisStatus = '1'
this.handlecaseAnalysis([row.caseId])
},
//
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 {
.header {
display: flex;
flex-direction: row-reverse;
}
border-radius: 8px;
background: white;
padding: 20px;
box-sizing: border-box;
margin-top: 10px;
height: calc(100% - 123px);
}
}
</style>

@ -1,16 +1,15 @@
<template>
<div class="content">
<cs-search title="指标检索" :data="searchData" :span="6" direction="row" @onSearch="onSearch" @getData="onSearch" />
<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>
<el-button v-if="row.taskStatus=== '0' ||row.taskStatus=== '1' " type="text" @click="handleCancel(row)"></el-button>
<el-button v-if="row.taskStatus!=='2' " type="text" style="color: red" @click="handleDel(row)"></el-button>
</template>
<template #taskStatus="{row}">
<span>{{ getTypeName(row.taskStatus) }}</span>
</template>
</vxe-grid>
<div style="text-align: center">
@ -27,8 +26,9 @@
</template>
<script>
import mixin from '@/views/mixin'
import { queryIndexData, deleteModelIndex } from '@/api/indexRule'
import { queryTaskList, deleteTask, cancelTask } from '@/api/operationManagement'
export default {
name: 'Index',
@ -37,23 +37,20 @@ export default {
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' }
{ label: '案件名称', model: 'caseName', type: 'input' },
{ label: '任务状态', model: 'taskStatus', type: 'select', option: JSON.parse(sessionStorage.getItem('task_status')) }
],
//
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: '任务名称', field: 'taskName' },
{ title: '案件名称', field: 'caseName' },
{ title: '任务状态', field: 'taskStatus', slots: { default: 'taskStatus' }},
{ title: '操作人', field: 'createUserName' },
{ title: '任务创建时间', field: 'createTime' },
{ title: '任务取消时间', field: 'cancelTime' },
{ title: '操作', slots: { default: 'operate' }, fixed: 'right', width: '150px' }
],
data: []
@ -66,19 +63,33 @@ export default {
methods: {
//
fetchData() {
queryIndexData({ ...this.searchFormData }, this.queryForm.page, this.queryForm.size).then(res => {
this.gridOptions.data = res.data.result
queryTaskList({ ...this.searchFormData }, this.queryForm.page, this.queryForm.size).then(res => {
this.gridOptions.data = res.data.records
this.queryForm.total = res.data.total
})
},
getTypeName(val) {
for (const item of JSON.parse(sessionStorage.getItem('task_status'))) {
if (item.value === val) {
return item.label
}
}
},
//
handleDel(row) {
this.$baseConfirm('确定要删除吗?', null, async() => {
const { code, msg } = await deleteModelIndex(row.id)
const { code, msg } = await deleteTask([row.taskId])
code === 200 ? this.$baseMessage.success(msg || '删除成功!') : this.$baseMessage.error(msg || '删除失败!')
this.fetchData()
})
},
handleCancel(row) {
this.$baseConfirm('确定要取消吗?', null, async() => {
const { code, msg } = await cancelTask([row.taskId])
code === 200 ? this.$baseMessage.success(msg || '取消成功!') : this.$baseMessage.error(msg || '取消失败!')
this.fetchData()
})
},
//
onSearch(data, callback) {
this.searchFormData = Object.assign({}, data)

@ -0,0 +1,218 @@
<template>
<cs-drawer
:drawer-option="drawerOption"
@onReset="handleReset"
@onSubmit="handleSubmit"
>
<template slot="content">
<div class="DataExtract">
<div class="header">
<span style="margin-bottom: 16px;">{{ dataInfo.name }}</span>
<span>{{ getTypeName(dataInfo.type) }}</span>
</div>
<el-form ref="myForm" :model="ruleForm" :rules="rules" label-width="120px">
<el-form-item label="提取范围" prop="type">
<el-radio-group v-model="ruleForm.type" @change="changeType">
<el-radio :label="0">全部案件</el-radio>
<el-radio :label="1">指定案件</el-radio>
<el-radio :label="2">指定笔录</el-radio>
<el-radio :disabled="dataInfo.type === '1'" :label="3">指定证据</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-show="ruleForm.type === 1" label="案件名称" prop="caseIdList">
<el-select v-model="ruleForm.caseIdList" multiple style="width: 100%;" placeholder="请选择案件名称">
<el-option
v-for="item in caseOptions"
:key="item.id"
:label="item.caseName"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item v-if="ruleForm.type === 2 || ruleForm.type === 3 " label="案件名称" prop="caseId">
<el-select v-model="ruleForm.caseId" style="width: 100%;" placeholder="请选择案件名称" @change="selectCase">
<el-option
v-for="item in caseOptions"
:key="item.id"
:label="item.caseName"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item v-if="ruleForm.type === 2" label="案件笔录" prop="recordIdList">
<el-select v-model="ruleForm['recordIdList']" multiple style="width: 100%;" placeholder="请选择案件笔录">
<el-option
v-for="item in recordOptions"
:key="item.id"
:label="item.confessionMaterial"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item v-if="ruleForm.type === 3" label="案件证据" prop="evidenceIdList">
<el-select v-model="ruleForm['evidenceIdList']" multiple style="width: 100%;" placeholder="请选择案件证据">
<el-option
v-for="item in evidenceOptions"
:key="item.id"
:label="item.evidenceName"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-form>
</div>
</template>
</cs-drawer>
</template>
<script>
import { queryCaseList } from '@/api/caseManagement'
import { queryRecordList, queryEvidenceList } from '@/api/caseDetails'
import { executePromptExtractTask } from '@/api/promptManagement'
export default {
name: 'DataExtract',
data() {
return {
drawerOption: {
show: false,
title: '数据提取任务',
width: '40%'
},
dataInfo: {
name: '',
type: ''
},
promptType: JSON.parse(sessionStorage.getItem('prompt_type')),
ruleForm: {
type: 0,
caseId: '',
caseIdList: [],
recordIdList: [],
evidenceIdList: []
},
caseOptions: [],
recordOptions: [],
evidenceOptions: [],
rules: {
type: [{ required: true, message: '请选择提取范围!', trigger: 'change' }],
caseIdList: [{ required: true, message: '请选择案件名称!', trigger: 'change' }],
caseId: [{ required: true, message: '请选择案件名称!', trigger: 'change' }],
recordIdList: [{ required: true, message: '请选择案件笔录!', trigger: 'change' }],
evidenceIdList: [{ required: true, message: '请选择案件证据!', trigger: 'change' }]
}
}
},
mounted() {
this.getCaseList()
},
methods: {
//
show(data) {
this.dataInfo = JSON.parse(JSON.stringify(data))
this.drawerOption.show = true
this.ruleForm = {
type: 0,
caseId: '',
caseIdList: [],
recordIdList: [],
evidenceIdList: []
}
},
getCaseList() {
queryCaseList({}, 1, 9999).then(res => {
if (res.code === 200) {
this.caseOptions = res.data.records
}
})
},
//
getRecordData() {
queryRecordList({ caseId: this.ruleForm.caseId }, 1, 999999).then(res => {
this.recordOptions = res.data.result
})
},
//
getEvidenceData() {
queryEvidenceList({ caseId: this.ruleForm.caseId }, 1, 999999).then(res => {
this.evidenceOptions = res.data.records
})
},
getTypeName(val) {
for (const item of this.promptType) {
if (item.value === val) {
return item.label
}
}
},
//
handleReset() {
this.$refs.myForm.resetFields()
this.$refs.myForm.clearValidate()
},
changeType(val) {
this.$refs.myForm.resetFields()
this.ruleForm.caseId = ''
this.ruleForm.caseIdList = []
this.ruleForm.recordIdList = []
this.ruleForm.evidenceIdList = []
this.ruleForm.type = val
this.$refs.myForm.clearValidate()
console.log('11111', this.ruleForm)
},
selectCase() {
this.getRecordData()
this.getEvidenceData()
},
handleSubmit() {
this.$refs.myForm.validate(valid => {
if (valid) {
const loading = this.$baseLoading(1, '保存中...')
const params = {
type: this.ruleForm.type,
promptId: this.dataInfo.id
}
if (this.ruleForm.type === 1) {
params.caseId = this.ruleForm.caseIdList.join(',')
} else if (this.ruleForm.type === 2) {
params.caseId = this.ruleForm.caseId
params.recordId = this.ruleForm.recordIdList.join(',')
} else if (this.ruleForm.type === 3) {
params.caseId = this.ruleForm.caseId
params.evidenceId = this.ruleForm.evidenceIdList.join(',')
}
executePromptExtractTask(params).then(res => {
loading.close()
if (res.code === 200) {
this.drawerOption.show = false
this.$baseMessage.success('提取成功')
}
}).catch(() => { loading.close() })
}
})
}
}
}
</script>
<style scoped lang="scss">
.DataExtract {
.header {
background: #F6F8F9;
border-radius: 8px 8px 8px 8px;
padding: 16px;
margin-bottom: 24px;
display: flex;
flex-direction: column;
margin-left: 36px;
span {
font-size: 16px;
color: #333333;
}
}
}
</style>

@ -12,6 +12,7 @@
<el-button type="primary" icon="el-icon-circle-plus-outline" style="position: absolute;right: 24px;top: 12px;" @click="handleAdd"></el-button>
<vxe-grid v-bind="gridOptions" style="margin-top: 20px">
<template #operate="{row}">
<el-button v-if="row.type !=='3'" type="text" @click="dataExtract(row)"></el-button>
<el-button type="text" @click="handleEdit(row)"></el-button>
<el-button v-if="row.type ==='2'" type="text" style="color: red" @click="handleDel(row)"></el-button>
</template>
@ -28,6 +29,7 @@
/>
</div>
</div>
<DataExtract ref="DataExtractRef" />
</div>
</div>
</template>
@ -35,9 +37,10 @@
<script>
import mixin from '@/views/mixin'
import { queryPromptList, delPrompt } from '@/api/promptManagement'
import DataExtract from './DataExtract.vue'
export default {
name: 'PromptConfig',
components: { DataExtract },
mixins: [mixin],
data() {
return {
@ -88,6 +91,10 @@ export default {
}
}
},
//
dataExtract(row) {
this.$refs.DataExtractRef.show(row)
},
//
handleAdd() {
this.$router.push({ path: `/add-prompt` })

@ -8,7 +8,7 @@
<template>
<div class="config-content">
<el-row :gutter="10" style="height: 100%">
<el-row :gutter="10" style="height: 100%;margin: 0">
<el-col :span="4" style="height: 100%">
<div class="left-tree">
<div class="left-title">字典值名称</div>
@ -58,7 +58,7 @@
<div class="content">
<h4>字典值信息</h4>
<el-button type="primary" icon="el-icon-circle-plus-outline" @click="handleAdd"></el-button>
<vxe-grid v-bind="gridOptions" style="margin-top: 20px">
<vxe-grid v-bind="gridOptions" >
<template #operate="{row}">
<el-button type="text" @click="handleEditInfo(row)"></el-button>
<el-button type="text" style="color: red" @click="handleDel(row)"></el-button>
@ -114,7 +114,7 @@ export default {
}
},
mounted() {
this.tableHeight(370)
this.tableHeight(360)
this.fetchData()
},
methods: {

Loading…
Cancel
Save