|
|
|
|
@ -149,7 +149,7 @@
|
|
|
|
|
v-model="show" |
|
|
|
|
top="4vh" |
|
|
|
|
> |
|
|
|
|
<el-form label-width="120" ref="formRef" :model="form"> |
|
|
|
|
<el-form label-width="130" ref="formRef" :model="form"> |
|
|
|
|
<el-form-item |
|
|
|
|
label="模型名称" |
|
|
|
|
prop="modelName" |
|
|
|
|
@ -210,6 +210,261 @@
|
|
|
|
|
/> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<template v-if="form.modelingMethod === '2'"> |
|
|
|
|
<el-form-item |
|
|
|
|
label="模型结果表" |
|
|
|
|
prop="clueTableName" |
|
|
|
|
:rules="{ |
|
|
|
|
required: true, |
|
|
|
|
message: '请选择', |
|
|
|
|
}" |
|
|
|
|
> |
|
|
|
|
<el-select |
|
|
|
|
v-model="form.clueTableName" |
|
|
|
|
style="width: 340px" |
|
|
|
|
@change="handleSelectClueTableName" |
|
|
|
|
> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in clueMappingData" |
|
|
|
|
:key="item.tableName" |
|
|
|
|
:label="item.tableName" |
|
|
|
|
:value="item.tableName" |
|
|
|
|
/> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item |
|
|
|
|
label="结果字段映射" |
|
|
|
|
:rules="{ |
|
|
|
|
required: true, |
|
|
|
|
message: '请选择', |
|
|
|
|
}" |
|
|
|
|
> |
|
|
|
|
<el-row :gutter="10" style="width: 100%"> |
|
|
|
|
<el-col :span="11"> |
|
|
|
|
<div class="field-table-title"> |
|
|
|
|
数据督察预警问题表 |
|
|
|
|
</div> |
|
|
|
|
<el-table size="small" :data="modelClueColumns"> |
|
|
|
|
<el-table-column |
|
|
|
|
label="字段名" |
|
|
|
|
prop="fieldName" |
|
|
|
|
width="150" |
|
|
|
|
> |
|
|
|
|
<template #default="{ row }"> |
|
|
|
|
<div |
|
|
|
|
:class=" |
|
|
|
|
row.required |
|
|
|
|
? 'text-danger' |
|
|
|
|
: '' |
|
|
|
|
" |
|
|
|
|
> |
|
|
|
|
{{ row.fieldName }} |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column |
|
|
|
|
label="字段类型" |
|
|
|
|
prop="fieldType" |
|
|
|
|
width="80" |
|
|
|
|
align="center" |
|
|
|
|
/> |
|
|
|
|
<el-table-column |
|
|
|
|
label="描述" |
|
|
|
|
prop="fieldDesc" |
|
|
|
|
show-overflow-tooltip |
|
|
|
|
/> |
|
|
|
|
</el-table> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="2"> |
|
|
|
|
<div |
|
|
|
|
style="margin-top: 104px" |
|
|
|
|
class="text-center field-arrow" |
|
|
|
|
> |
|
|
|
|
→ |
|
|
|
|
</div> |
|
|
|
|
<div class="text-center field-arrow text-danger"> |
|
|
|
|
→ |
|
|
|
|
</div> |
|
|
|
|
<div class="text-center field-arrow">→</div> |
|
|
|
|
<div class="text-center field-arrow">→</div> |
|
|
|
|
<div class="text-center field-arrow">→</div> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="11"> |
|
|
|
|
<div class="field-table-title">模型结果表</div> |
|
|
|
|
<el-table |
|
|
|
|
size="small" |
|
|
|
|
:data="modelClueTargetColumns" |
|
|
|
|
class="field-table_target" |
|
|
|
|
> |
|
|
|
|
<el-table-column label="字段名" width="150"> |
|
|
|
|
<template #default="{ row }"> |
|
|
|
|
<el-select |
|
|
|
|
size="small" |
|
|
|
|
v-model="row.columnName" |
|
|
|
|
@change=" |
|
|
|
|
(val) => |
|
|
|
|
handleChangeColumn(val, row) |
|
|
|
|
" |
|
|
|
|
> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in fields" |
|
|
|
|
:key="item.columnName" |
|
|
|
|
:value="item.columnName" |
|
|
|
|
:disabled=" |
|
|
|
|
modelClueTargetColumns.filter( |
|
|
|
|
(field) => |
|
|
|
|
field.columnName === |
|
|
|
|
item.columnName |
|
|
|
|
).length > 0 |
|
|
|
|
" |
|
|
|
|
> |
|
|
|
|
<span class="text-small">{{ |
|
|
|
|
item.columnName |
|
|
|
|
}}</span> |
|
|
|
|
<span |
|
|
|
|
v-if="item.columnComment" |
|
|
|
|
class="text-small" |
|
|
|
|
>-</span |
|
|
|
|
> |
|
|
|
|
<span class="text-small">{{ |
|
|
|
|
item.columnComment |
|
|
|
|
}}</span> |
|
|
|
|
</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column |
|
|
|
|
label="字段类型" |
|
|
|
|
prop="dataType" |
|
|
|
|
width="80" |
|
|
|
|
align="center" |
|
|
|
|
/> |
|
|
|
|
<el-table-column |
|
|
|
|
label="描述" |
|
|
|
|
prop="columnComment" |
|
|
|
|
show-overflow-tooltip |
|
|
|
|
/> |
|
|
|
|
</el-table> |
|
|
|
|
</el-col> |
|
|
|
|
</el-row> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item |
|
|
|
|
label="同步唯一字段名" |
|
|
|
|
prop="clueUniqueFieldName" |
|
|
|
|
:rules="{ |
|
|
|
|
required: true, |
|
|
|
|
message: '请选择', |
|
|
|
|
}" |
|
|
|
|
> |
|
|
|
|
<el-select |
|
|
|
|
style="width: 340px" |
|
|
|
|
v-model="form.clueUniqueFieldName" |
|
|
|
|
> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in fields" |
|
|
|
|
:key="item.columnName" |
|
|
|
|
:value="item.columnName" |
|
|
|
|
> |
|
|
|
|
<span class="text-small">{{ |
|
|
|
|
item.columnName |
|
|
|
|
}}</span> |
|
|
|
|
<span v-if="item.columnComment" class="text-small" |
|
|
|
|
>-</span |
|
|
|
|
> |
|
|
|
|
<span class="text-small">{{ |
|
|
|
|
item.columnComment |
|
|
|
|
}}</span> |
|
|
|
|
</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item |
|
|
|
|
label="预警内容生成器" |
|
|
|
|
prop="thingDescGeneration" |
|
|
|
|
:rules="{ |
|
|
|
|
required: true, |
|
|
|
|
message: '请输入', |
|
|
|
|
}" |
|
|
|
|
> |
|
|
|
|
<el-input |
|
|
|
|
v-model="form.thingDescGeneration" |
|
|
|
|
clearable |
|
|
|
|
type="textarea" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item |
|
|
|
|
label="同步周期" |
|
|
|
|
prop="clueCycle" |
|
|
|
|
:rules="{ |
|
|
|
|
required: true, |
|
|
|
|
message: '请选择同步周期', |
|
|
|
|
}" |
|
|
|
|
> |
|
|
|
|
<el-radio-group v-model="form.clueCycle" class="block"> |
|
|
|
|
<el-radio |
|
|
|
|
v-for="item in dict.distributionCycle" |
|
|
|
|
:key="item.dictCode" |
|
|
|
|
:value="item.dictValue" |
|
|
|
|
>{{ item.dictLabel }}</el-radio |
|
|
|
|
> |
|
|
|
|
</el-radio-group> |
|
|
|
|
<!-- <div class="flex ml-20" v-if="form.clueCycle"> |
|
|
|
|
<el-form-item |
|
|
|
|
label="周" |
|
|
|
|
prop="clueCycleDayOfWeek" |
|
|
|
|
label-width="80" |
|
|
|
|
:rules="{ |
|
|
|
|
required: true, |
|
|
|
|
message: '请选择', |
|
|
|
|
}" |
|
|
|
|
v-if="form.clueCycle === DistributionCycle.WEEKLY" |
|
|
|
|
> |
|
|
|
|
<el-select |
|
|
|
|
style="width: 120px" |
|
|
|
|
clearable |
|
|
|
|
v-model="form.clueCycleDayOfWeek" |
|
|
|
|
> |
|
|
|
|
<el-option value="MON">周一</el-option> |
|
|
|
|
<el-option value="TUE">周二</el-option> |
|
|
|
|
<el-option value="WED">周三</el-option> |
|
|
|
|
<el-option value="THU">周四</el-option> |
|
|
|
|
<el-option value="FRI">周五</el-option> |
|
|
|
|
<el-option value="SAT">周六</el-option> |
|
|
|
|
<el-option value="SUN">周日</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> --> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item |
|
|
|
|
label="机构映射" |
|
|
|
|
prop="clueDepartSource" |
|
|
|
|
:rules="{ |
|
|
|
|
required: true, |
|
|
|
|
message: '请选择机构映射', |
|
|
|
|
}" |
|
|
|
|
> |
|
|
|
|
<div class="flex gap"> |
|
|
|
|
<el-select |
|
|
|
|
style="width: 340px" |
|
|
|
|
v-model="form.clueDepartSource" |
|
|
|
|
clearable |
|
|
|
|
> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in dict.departMappingSource" |
|
|
|
|
:key="item.dictCode" |
|
|
|
|
:label="item.dictLabel" |
|
|
|
|
:value="item.dictValue" |
|
|
|
|
></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
plain |
|
|
|
|
@click="router.push('/system/dict')" |
|
|
|
|
>创建机构映射</el-button |
|
|
|
|
> |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<el-form-item |
|
|
|
|
label="模型分类" |
|
|
|
|
prop="modelType" |
|
|
|
|
@ -240,7 +495,9 @@
|
|
|
|
|
> |
|
|
|
|
<el-select v-model="form.classId" style="width: 340px"> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in classes.filter(item => item.modelType === form.modelType)" |
|
|
|
|
v-for="item in classes.filter( |
|
|
|
|
(item) => item.modelType === form.modelType |
|
|
|
|
)" |
|
|
|
|
:key="item.id" |
|
|
|
|
:label="item.name" |
|
|
|
|
:value="item.id" |
|
|
|
|
@ -564,6 +821,7 @@
|
|
|
|
|
style="width: 100px" |
|
|
|
|
type="number" |
|
|
|
|
v-model="form.replyLimit" |
|
|
|
|
:min="1" |
|
|
|
|
/><span>工作日</span> |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
|
@ -630,7 +888,13 @@
|
|
|
|
|
</footer> |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
<el-dialog title="模型详情" v-model="detailShow" top="5vh" width="70vw" style="margin-bottom: 2vh"> |
|
|
|
|
<el-dialog |
|
|
|
|
title="模型详情" |
|
|
|
|
v-model="detailShow" |
|
|
|
|
top="5vh" |
|
|
|
|
width="1100" |
|
|
|
|
style="margin-bottom: 2vh" |
|
|
|
|
> |
|
|
|
|
<header class="model-info-header" style=""> |
|
|
|
|
<el-row :gutter="40"> |
|
|
|
|
<el-col :span="2"> |
|
|
|
|
@ -676,11 +940,13 @@
|
|
|
|
|
</div> |
|
|
|
|
<div class="col col-6"> |
|
|
|
|
<label>预警类型</label> |
|
|
|
|
<span>{{ form.modelDataType === "1" |
|
|
|
|
<span>{{ |
|
|
|
|
form.modelDataType === "1" |
|
|
|
|
? form.modelType === "1" |
|
|
|
|
? "预警问题" |
|
|
|
|
: "预警处置" |
|
|
|
|
: "提醒通知" }}</span> |
|
|
|
|
: "提醒通知" |
|
|
|
|
}}</span> |
|
|
|
|
</div> |
|
|
|
|
<div class="col col-6"> |
|
|
|
|
<label>分发方式</label> |
|
|
|
|
@ -735,6 +1001,20 @@
|
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="row"> |
|
|
|
|
<div class="col col-6" v-if="activeModel.clueTableName"> |
|
|
|
|
<label>模型结果表</label> |
|
|
|
|
<span>{{ activeModel.clueTableName }}</span> |
|
|
|
|
</div> |
|
|
|
|
<div class="col col-6" v-if="activeModel.clueTimeFieldName"> |
|
|
|
|
<label>同步时间字段名</label> |
|
|
|
|
<span>{{ activeModel.clueTimeFieldName }}</span> |
|
|
|
|
</div> |
|
|
|
|
<div class="col col-6" v-if="activeModel.clueUniqueFieldName"> |
|
|
|
|
<label>同步唯一字段名</label> |
|
|
|
|
<span>{{ activeModel.clueUniqueFieldName }}</span> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-divider /> |
|
|
|
|
<div class="flex end mb-20"> |
|
|
|
|
@ -856,7 +1136,8 @@ import {
|
|
|
|
|
addModel, |
|
|
|
|
updateModel, |
|
|
|
|
delModel, |
|
|
|
|
listModel |
|
|
|
|
listModel, |
|
|
|
|
listClueMappingData, |
|
|
|
|
} from "@/api/sensitivePerception/model"; |
|
|
|
|
import { listModelClue } from "@/api/sensitivePerception/modelClue"; |
|
|
|
|
import { listTopModelClueRecords } from "@/api/sensitivePerception/modelClue"; |
|
|
|
|
@ -877,6 +1158,7 @@ const dict = catchStore.getDicts([
|
|
|
|
|
"suspectProblem", |
|
|
|
|
"policeType", |
|
|
|
|
"modelType", |
|
|
|
|
"departMappingSource", |
|
|
|
|
]); |
|
|
|
|
|
|
|
|
|
// 个人极端暴力风险 |
|
|
|
|
@ -923,10 +1205,13 @@ function handleChangeClass(id) {
|
|
|
|
|
query.value.classId = id; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
watch(() => query.value.classId, () => { |
|
|
|
|
query.value.current = 1 |
|
|
|
|
watch( |
|
|
|
|
() => query.value.classId, |
|
|
|
|
() => { |
|
|
|
|
query.value.current = 1; |
|
|
|
|
getList(); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
const show = ref(false); |
|
|
|
|
const mode = ref("add"); |
|
|
|
|
@ -951,9 +1236,11 @@ function initForm() {
|
|
|
|
|
} |
|
|
|
|
const formRef = ref(null); |
|
|
|
|
|
|
|
|
|
function handleAdd() { |
|
|
|
|
const clueMappingData = ref([]); |
|
|
|
|
async function handleAdd() { |
|
|
|
|
show.value = true; |
|
|
|
|
mode.value = "add"; |
|
|
|
|
clueMappingData.value = await listClueMappingData(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function handleEdit() { |
|
|
|
|
@ -961,11 +1248,10 @@ function handleEdit() {
|
|
|
|
|
mode.value = "edit"; |
|
|
|
|
form.value = { ...activeModel.value }; |
|
|
|
|
if (activeModel.value.involveProblem) { |
|
|
|
|
form.value.involveProblem = activeModel.value.involveProblem.split(',') |
|
|
|
|
form.value.involveProblem = activeModel.value.involveProblem.split(","); |
|
|
|
|
} else { |
|
|
|
|
form.value.involveProblem = []; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function handleAddProblem() { |
|
|
|
|
@ -977,6 +1263,20 @@ function handleRemoveProblem(index) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async function handleSubmit() { |
|
|
|
|
if (form.value.modelingMethod === "2") { |
|
|
|
|
if (!modelClueTargetColumns.value[1].columnName |
|
|
|
|
) { |
|
|
|
|
feedback.msgWarning("请选择结果字段映射【红色为必填】"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
form.value.modelGeneration = { |
|
|
|
|
involveDepartName: modelClueTargetColumns.value[0].columnName, |
|
|
|
|
involveDepartId: modelClueTargetColumns.value[1].columnName, |
|
|
|
|
involvePoliceName: modelClueTargetColumns.value[2].columnName, |
|
|
|
|
involvePoliceEmpNo: modelClueTargetColumns.value[3].columnName, |
|
|
|
|
happenTime: modelClueTargetColumns.value[4].columnName, |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
await formRef.value.validate(); |
|
|
|
|
if (mode.value === "add") { |
|
|
|
|
await addModel(form.value); |
|
|
|
|
@ -1016,7 +1316,6 @@ async function handleDetailConfigShow() {
|
|
|
|
|
size: 1, |
|
|
|
|
}); |
|
|
|
|
if (data.records.length && data.records[0].data) { |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
modelClueData.value = JSON.parse(data.records[0].data); |
|
|
|
|
} |
|
|
|
|
@ -1040,6 +1339,52 @@ function goClue() {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const modelClueColumns = [ |
|
|
|
|
{ |
|
|
|
|
fieldName: "involvo_depart_name", |
|
|
|
|
fieldType: "varchar", |
|
|
|
|
fieldDesc: "涉及单位名称" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
fieldName: "involvo_depart_id", |
|
|
|
|
fieldType: "varchar", |
|
|
|
|
fieldDesc: "涉及单位ID", |
|
|
|
|
required: true, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
fieldName: "involvo_police_name", |
|
|
|
|
fieldType: "varchar", |
|
|
|
|
fieldDesc: "涉及人员姓名", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
fieldName: "involvo_police_emp_no", |
|
|
|
|
fieldType: "varchar", |
|
|
|
|
fieldDesc: "涉及人员警号", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
fieldName: "happen_time", |
|
|
|
|
fieldType: "varchar", |
|
|
|
|
fieldDesc: "发生时间", |
|
|
|
|
}, |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
function handleChangeColumn(val, row) { |
|
|
|
|
const item = fields.value.find((item) => item.columnName === val); |
|
|
|
|
|
|
|
|
|
row.dataType = item.dataType; |
|
|
|
|
row.columnComment = item.columnComment; |
|
|
|
|
} |
|
|
|
|
const modelClueTargetColumns = ref([{}, {}, {}, {}, {}]); |
|
|
|
|
|
|
|
|
|
const fields = ref([]); |
|
|
|
|
function handleSelectClueTableName(val) { |
|
|
|
|
if (val) { |
|
|
|
|
fields.value = clueMappingData.value.filter( |
|
|
|
|
(item) => item.tableName === val |
|
|
|
|
)[0].fields; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
<style lang="scss" scoped> |
|
|
|
|
.menu { |
|
|
|
|
@ -1080,4 +1425,22 @@ function goClue() {
|
|
|
|
|
box-shadow: 0px 2px 4px 0px rgba(133, 150, 248, 0.47); |
|
|
|
|
padding: 28px; |
|
|
|
|
} |
|
|
|
|
.field-table-title { |
|
|
|
|
font-weight: 700; |
|
|
|
|
color: var(--primary-color); |
|
|
|
|
margin-bottom: 8px; |
|
|
|
|
font-size: 15px; |
|
|
|
|
} |
|
|
|
|
.field-arrow { |
|
|
|
|
height: 32px; |
|
|
|
|
line-height: 32px; |
|
|
|
|
width: 100%; |
|
|
|
|
} |
|
|
|
|
.field-table_target { |
|
|
|
|
:deep() { |
|
|
|
|
.el-table--small .el-table__cell { |
|
|
|
|
padding: 2px 0; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |