Browse Source

fit: 个人极端赋分规则

main
wxc 1 year ago
parent
commit
5e20580922
  1. 8
      src/api/sensitivePerception/riskPersonnel.ts
  2. 28
      src/api/sensitivePerception/riskScoreRule.ts
  3. 6
      src/api/work/negative.ts
  4. 8
      src/components/description-pair.vue
  5. 136
      src/components/model-risk-tree.vue
  6. 33
      src/components/model-tree.vue
  7. 2
      src/components/negative/verify-description.vue
  8. 6
      src/style/public.scss
  9. 134
      src/views/sensitivePerception/DepartNegative.vue
  10. 20
      src/views/sensitivePerception/DictContent.vue
  11. 51
      src/views/sensitivePerception/Model.vue
  12. 8
      src/views/sensitivePerception/ModelClue.vue
  13. 4
      src/views/sensitivePerception/ModelClueTask.vue
  14. 248
      src/views/sensitivePerception/PersonnelRisk.vue
  15. 138
      src/views/sensitivePerception/PoliceNegative.vue
  16. 216
      src/views/sensitivePerception/RiskClue.vue
  17. 149
      src/views/sensitivePerception/RiskPersonnel.vue
  18. 296
      src/views/sensitivePerception/RiskScoreRule.vue
  19. 32
      src/views/work/Query.vue
  20. 8
      vite.config.ts

8
src/api/sensitivePerception/riskPersonnel.ts

@ -0,0 +1,8 @@
import request from "@/api/request";
export function listRiskPersonnel(query) {
return request.get({
url: '/risk/personal',
query
});
}

28
src/api/sensitivePerception/riskScoreRule.ts

@ -0,0 +1,28 @@
import request from "@/api/request";
export function listRiskScoreRuleTree() {
return request.get({
url: '/risk/scoreRule/tree'
});
}
export function addRiskScoreRule(body) {
return request.post({
url: '/risk/scoreRule',
body
});
}
export function updateRiskScoreRule(body) {
return request.put({
url: '/risk/scoreRule',
body
});
}
export function delRiskScoreRule(id) {
return request.del({
url: `/risk/scoreRule/${id}`
});
}

6
src/api/work/negative.ts

@ -61,3 +61,9 @@ export function getCompletionInfo(id) {
url: `/negative/completion/${id}`
});
}
export function calculateScore() {
return request.post({
url: `/negative/score/calculate`
});
}

8
src/components/description-pair.vue

@ -1,12 +1,12 @@
<template>
<div class="text-center description-value" :size="size">
<span>{{ value1 }}</span>
<span class="separator">/</span>
<span v-if="value1">{{ value1 }}</span>
<span class="separator" v-if="value1">/</span>
<span class="value2">{{ value2 }}</span>
</div>
<div class="text-center description-label" :size="size">
<span>{{ label1 }}</span>
<span>/</span>
<span v-if="value1">{{ label1 }}</span>
<span v-if="value1">/</span>
<span>{{ label2 }}</span>
</div>
</template>

136
src/components/model-risk-tree.vue

@ -0,0 +1,136 @@
<template>
<el-input v-model="filterText" placeholder="搜索" class="mb-10">
<template #prefix>
<el-icon class="el-input__icon"><search /></el-icon>
</template>
</el-input>
<div class="tree-container">
<el-scrollbar>
<el-tree
:data="treeData"
node-key="value"
:render-content="renderContent"
:default-expanded-keys="[ROOT_ID]"
:props="{
label: 'riskName',
}"
:filter-node-method="filterNode"
@node-click="handleClick"
ref="treeRef"
/>
</el-scrollbar>
</div>
</template>
<script lang="ts" setup>
import Icon from "@/components/icon/index.vue";
import {
listRiskScoreRuleTree
} from "@/api/sensitivePerception/riskScoreRule";
const ROOT_ID = 0;
const treeData = ref([
{
riskName: "全部",
value: ROOT_ID,
children: [],
},
]);
const list = ref([]);
const total = ref(0);
onMounted(() => {
listRiskScoreRuleTree().then((data) => {
treeData.value[0].children = data;
});
});
function renderContent(
h,
{
node,
data,
store,
}: {
node: Node;
data: Tree;
store: Node["store"];
}
) {
console.log(node);
return h(
"div",
{
class: "flex v-center",
},
h(
Icon,
{
name: "el-icon-Folder",
class: "mr-8",
},
node.label
),
h(
"span",
{
title: node.label,
},
node.label
)
);
}
const filterText = ref("");
const treeRef = ref(null);
const filterNode = (value: string, data: Tree) => {
if (!value) return true;
return data.label.includes(value);
};
watch(filterText, (val) => {
treeRef.value!.filter(val);
});
const props = defineProps({
modelValue: {
type: Array,
defalut: [],
},
});
const emit = defineEmits(["update:modelValue"]);
function handleClick(node) {
if (node.value === ROOT_ID) {
emit("update:modelValue", null);
return;
}
const arr = [];
getModelId(arr, node);
emit("update:modelValue", arr);
}
function getModelId(arr, node) {
if (node.type === "model") {
arr.push(node.value);
} else if (node.children && node.children.length) {
node.children.forEach((item) => {
getModelId(arr, item);
});
}
}
</script>
<style lang="scss" scoped>
:deep() {
.el-tree-node.is-current {
& > .el-tree-node__content {
background: #e1e5ff;
}
}
}
.tree-container {
height: calc(100% - 42px);
}
</style>

33
src/components/model-tree.vue

@ -4,15 +4,19 @@
<el-icon class="el-input__icon"><search /></el-icon>
</template>
</el-input>
<el-tree
:data="treeData"
node-key="value"
:render-content="renderContent"
:default-expanded-keys="[ROOT_ID]"
:filter-node-method="filterNode"
@node-click="handleClick"
ref="treeRef"
/>
<div class="tree-container">
<el-scrollbar>
<el-tree
:data="treeData"
node-key="value"
:render-content="renderContent"
:default-expanded-keys="[ROOT_ID]"
:filter-node-method="filterNode"
@node-click="handleClick"
ref="treeRef"
/>
</el-scrollbar>
</div>
</template>
<script lang="ts" setup>
import Icon from "@/components/icon/index.vue";
@ -66,7 +70,13 @@ function renderContent(
},
node.label
),
h("span", null, node.label)
h(
"span",
{
title: node.label,
},
node.label
)
);
}
@ -119,4 +129,7 @@ function getModelId(arr, node) {
}
}
}
.tree-container {
height: calc(100% - 42px);
}
</style>

2
src/components/negative/verify-description.vue

@ -105,7 +105,7 @@
>
<div class="col col-6">
<label>问题风险指数</label>
<label>问题分值</label>
<span
style="color: var(--danger-color)"
class="text-bold"

6
src/style/public.scss

@ -174,6 +174,7 @@ svg+span {
.container {
padding: 20px;
box-sizing: border-box;
}
.pointer:hover {
@ -401,10 +402,13 @@ svg+span {
left: 50%;
transform: translate(-50%, -50%);
}
.h100 {
height: 100%;
}
.h-280 {
height: 280px;
}
.tips {
p {
line-height: 20px;

134
src/views/sensitivePerception/DepartNegative.vue

@ -5,8 +5,14 @@
<el-row>
<el-col :span="6">
<el-form-item label="单位类型">
<el-select v-model="query.departLevel">
<el-option value="3" label="所队"></el-option>
<el-select v-model="query.departGroupId" clearable>
<el-option value="10" label="派出所"></el-option>
<el-option value="11" label="交警大队"></el-option>
<el-option value="13" label="刑侦大队"></el-option>
<el-option value="14" label="禁毒大队"></el-option>
<el-option value="15" label="治安大队"></el-option>
<el-option value="16" label="人境大队"></el-option>
<el-option value="12" label="其他"></el-option>
</el-select>
</el-form-item>
</el-col>
@ -85,7 +91,8 @@
/>
<el-table-column label="风险指数" align="center" width="160">
<template #default="{ row }">
<span>/</span>
<span :type="getType(score)" class="score-theme" v-if="row.score">{{ Math.round(row.score) }}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="操作">
@ -212,7 +219,7 @@
>
<description-pair
label1="110接处警量"
label2="问题数"
label2="110接处警问题数"
:value1="
negativeInfo.jcj110BusinessSize
"
@ -228,7 +235,7 @@
>
<description-pair
label1="122接处警量"
label2="问题数"
label2="122接处警问题数"
:value1="
negativeInfo.jcj122BusinessSize
"
@ -238,7 +245,7 @@
<el-col :span="12">
<description-pair
label1="执法办案"
label2="问题数"
label2="执法办案问题数"
:value1="
negativeInfo.zfbaBusinessSize
"
@ -250,33 +257,48 @@
</el-row>
</el-col>
<el-col :span="8">
<h5>风险指数</h5>
<h5 style="margin-bottom: 0">风险指数</h5>
<div class="flex center">
<el-progress
type="dashboard"
:percentage="78"
:percentage="score"
:stroke-width="16"
:width="250"
color="#DC6231"
:width="220"
:color="colors2"
>
<div style="line-height: 64px" class="mt-40">
<span
<div class="score-progress-body">
<div v-if="score">
<div>
<span
class="score-progress_score score-theme text-bold"
:type="getType(score)"
>{{ score }}</span
>
<span></span>
</div>
<div
style="font-size: 14px"
class="mb-16"
>
分险指标值
</div>
</div>
<div
v-else
style="
font-weight: 600;
font-size: 60px;
color: #e87749;
line-height: 84px;
color: #999;
"
>78</span
>
<span style="font-size: 18px; color: #999"
></span
-
</div>
<div
class="score-progress_title score-theme"
:type="getType(score)"
>
</div>
<div style="font-size: 14px" class="mb-10">
分险指标值
</div>
<div style="color: #e87749; font-size: 28px">
中风险
{{ getScoreLabel() }}
</div>
</div>
</el-progress>
</div>
@ -330,7 +352,7 @@
:color="colors"
labelPosition="top"
/>
<el-empty v-if="policeBarList.length === 0" />
<el-empty v-if="problemTypeBarList.length === 0" />
</el-scrollbar>
</el-col>
<el-col :span="8">
@ -372,7 +394,7 @@
</template>
</el-table-column>
</el-table>
<div class="flex end mt-8">
<div class="flex end mt-8 mb-20">
<el-pagination
@size-change="getNegativeList"
@current-change="getNegativeList"
@ -539,6 +561,7 @@ const radarOption = ref({
const problemTypeBarList = ref([]);
const score = ref(0);
async function getProfileData() {
loading.value = true;
negativeQuery.value.involveDepartId = activeRow.value.departId;
@ -547,7 +570,9 @@ async function getProfileData() {
beginTime: time.value.length ? time.value[0] : "",
endTime: time.value.length ? time.value[1] : "",
});
score.value = Math.round(data.score);
console.log(data.expression);
console.log(data.remarks);
departInfo.value = data.departInfo;
negativeInfo.value = data.negativeInfo;
problemSourcesPieOptions.value.series[0].data = data.problemSourcesList;
@ -581,6 +606,63 @@ function handleAction(row) {
negativeShow.value = true;
activeNegativeId.value = row.id;
}
const colors2 = [
{ color: "var(--success-color)", percentage: 60 },
{ color: "#DC6231", percentage: 80 },
{ color: "var(--danger-color)", percentage: 100 },
];
function getType(val) {
if (val < 60) {
return "success";
}
if (val < 80) {
return "warning";
}
return "danger";
}
function getScoreLabel() {
if (score.value === 0) {
return "无法预测";
}
if (score.value < 60) {
return "低风险";
}
if (score.value < 80) {
return "中风险";
}
return "高风险";
}
</script>
<style lang="scss" scoped>
main {
overflow: hidden;
}
.col {
--label-width: 60px;
}
.score-progress-body {
text-align: center;
font-size: 18px;
.score-progress_score {
font-size: 60px;
line-height: 84px;
}
.score-progress_title {
font-size: 26px;
line-height: 22px;
}
}
.score-theme {
&[type="success"] {
color: var(--success-color);
}
&[type="warning"] {
color: #e87749;
}
&[type="danger"] {
color: var(--danger-color);
}
}
</style>

20
src/views/sensitivePerception/DictContent.vue

@ -1,5 +1,5 @@
<template>
<div class="container">
<div class="container" v-loading="loading">
<header class="mb-20">
<div class="flex between">
<div>
@ -15,13 +15,9 @@
<el-col :span="12"> </el-col>
<el-col :span="12">
<div class="flex end">
<el-button type="primary" @click="getList">
<template #icon>
<icon name="el-icon-Search" />
</template>
查询</el-button
<el-button type="primary" @click="handleCalculate">
重新计算分值</el-button
>
<el-button @click="reset">重置</el-button>
</div>
</el-col>
</el-row>
@ -193,6 +189,7 @@
</template>
<script lang="ts" setup>
import { BASE_PATH } from "@/api/request";
import { calculateScore } from "@/api/work/negative";
import { DICT_CONTENT_ROOT_ID } from "@/enums/appEnums";
import {
listDictContentTree,
@ -285,6 +282,15 @@ function getScoreRange(row) {
const max = Math.max(...sorceSet);
return `${min}-${max}`
}
const loading = ref(false)
async function handleCalculate() {
await feedback.confirm("确定要重新计算风险指数?");
loading.value = true
await calculateScore()
feedback.msgSuccess("风险指数计算完成");
loading.value = false
}
</script>
<style lang="scss" scoped>
.file-link {

51
src/views/sensitivePerception/Model.vue

@ -120,7 +120,7 @@
@size-change="getList"
@current-change="getList"
:current-page="query.current"
:page-sizes="[9, 18, 36]"
:page-sizes="[12, 24, 48]"
v-model:page-size="query.size"
v-model:current-page="query.current"
layout="total, sizes, prev, pager, next"
@ -157,6 +157,29 @@
/>
</el-select>
</el-form-item>
<el-form-item
label="风险因素"
:rules="{
required: true,
message: '请选择风险因素',
}"
prop="riskScoreRuleId"
v-if="form.classId === GRJDBLFX_CLASS_ID"
>
<el-tree-select
class="flex-1"
v-model="form.riskScoreRuleId"
:data="treeOptions"
clearable
node-key="id"
:props="{
label: 'riskName',
}"
placeholder="请选择风险因素"
filterable
style="width: 340px"
/>
</el-form-item>
<el-form-item
label="模型名称"
prop="modelName"
@ -200,6 +223,13 @@
>
<model-icon-picker v-model="form.icon" />
</el-form-item>
<el-form-item
label="数据类型"
prop="modelDataType"
v-if="form.classId === GRJDBLFX_CLASS_ID"
>
<el-checkbox value="2" label="提醒通知" />
</el-form-item>
<el-form-item
label="数据类型"
prop="modelDataType"
@ -207,6 +237,7 @@
required: true,
message: '请选择数据类型',
}"
v-else
>
<el-radio-group v-model="form.modelDataType" class="block">
<el-radio
@ -218,6 +249,7 @@
>
</el-radio-group>
</el-form-item>
<el-form-item
label="分发方式"
prop="distributionMethod"
@ -583,7 +615,11 @@ import {
ModelDataType,
} from "@/enums/dictEnums";
import { WEEKS } from "@/enums/appEnums";
import { MENU_ROOT_ID } from "@/enums/appEnums";
import { listModelClass } from "@/api/sensitivePerception/modelClass";
import {
listRiskScoreRuleTree
} from "@/api/sensitivePerception/riskScoreRule";
import {
addModel,
updateModel,
@ -607,10 +643,13 @@ const dict = catchStore.getDicts([
"modelDataType",
]);
//
const GRJDBLFX_CLASS_ID = 6;
const router = useRouter();
const query = ref({
size: 9,
size: 12,
current: 1,
});
const total = ref(0);
@ -626,17 +665,23 @@ function getList() {
function reset() {
query.value = {
size: 9,
size: 12,
current: 1,
};
getList();
}
const treeOptions = ref([]);
onMounted(() => {
getList();
listModelClass().then((data) => {
classes.value = data;
});
listRiskScoreRuleTree().then((data) => {
treeOptions.value = data;
});
});
function handleChangeClass(id) {

8
src/views/sensitivePerception/ModelClue.vue

@ -1,10 +1,10 @@
<template>
<div class="container">
<el-row :gutter="20">
<el-col :span="5">
<div class="container h100">
<el-row :gutter="20" class="h100">
<el-col :span="6" class="h100">
<model-tree v-model="query.modelIds" />
</el-col>
<el-col :span="19">
<el-col :span="18">
<header>
<el-form :label-width="140">
<el-row>

4
src/views/sensitivePerception/ModelClueTask.vue

@ -91,12 +91,12 @@
@click="handleStatisticsShow(row.id)"
>任务统计</el-button
>
<el-button
<!-- <el-button
type="primary"
link
@click="handleCluesShow(row.id)"
>查看详情</el-button
>
> -->
</template>
</el-table-column>
</el-table>

248
src/views/sensitivePerception/PersonnelRisk.vue

@ -1,248 +0,0 @@
<template>
<div class="container">
<header>
<el-form :label-width="114">
<el-row>
<el-col :span="6">
<el-form-item label="姓名">
<el-input
placeholder="请输入"
v-model="query.name"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="性别">
<el-input
placeholder="请输入"
v-model="query.six"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="年龄">
<el-input
placeholder="请输入"
v-model="query.age"
type="number"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="学历">
<el-input
placeholder="请输入"
v-model="query.education"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="管控单位">
<el-input
placeholder="请输入"
v-model="query.departName"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="身份证号">
<el-input
placeholder="请输入"
v-model="query.idCode"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="人员标签">
<el-input
placeholder="请输入"
v-model="query.tag"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="高风险因素">
<el-input placeholder="请输入" v-model="query.ys" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="高风险分级处置">
<el-input
placeholder="请输入"
v-model="query.fjcl"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="风险指数">
<el-input placeholder="请输入" v-model="query.ss" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="mb-25 flex end">
<div>
<el-button type="primary" @click="getList">
<template #icon>
<icon name="el-icon-Search" />
</template>
查询</el-button
>
<el-button @click="reset">重置</el-button>
</div>
</div>
</header>
<div class="table-container">
<el-table :data="list">
<el-table-column label="姓名" prop="name" width="80" />
<el-table-column label="性别" prop="six" width="60" />
<el-table-column label="年龄" prop="age" width="60" />
<el-table-column label="学历" prop="education" width="80" />
<el-table-column label="身份证号" prop="idCode" width="180" />
<el-table-column
label="管控单位"
prop="departName"
width="120"
/>
<el-table-column label="人员标签" prop="roleDesc">
<template #default="{ row }">
<div class="flex gap">
<el-tag v-for="tag in row.tag.split(',')">{{
tag
}}</el-tag>
</div>
</template>
</el-table-column>
<el-table-column label="高风险因素" prop="fx">
<template #default="{ row }">
<div class="flex gap">
<span v-for="(val, index) in row.fx.split(',')" :style="{color: index === 0? '#FF0000' : index === 1 ? '#E59300' : ''}">{{
val
}}</span>
</div>
</template>
</el-table-column>
<el-table-column
label="高风险指数"
prop="fxzs"
width="120"
align="center"
/>
<el-table-column label="操作" width="160">
<template #default="{ row }">
<el-button type="primary" link @click="show = true"
>查看详情</el-button
>
</template>
</el-table-column>
</el-table>
</div>
</div>
<el-dialog
title="风险人员详情"
v-model="show"
width="80vw"
top="2vh"
>
<img src="/imgs/lmgz/1.png" alt="">
</el-dialog>
</template>
<script lang="ts" setup>
const query = ref({});
const list = ref<any[]>([
{
name: "伍豪",
age: 32,
six: "男",
education: "本科",
idCode: "430400197301022122",
departName: "坡子街派出所",
tag: "涉相关警情人员,特定对象,涉诉讼人员",
fx: "矛盾纠纷,重点场所异常行为,重大疾病",
fxzs: 97,
},
{
name: "张单单",
age: 39,
six: "女",
education: "初中",
idCode: "430400197301022121",
departName: "坡子街派出所",
tag: "特定对象,涉诉讼人员",
fx: "收入低下,诉求不满或长期未化解,网络浏览偏好",
fxzs: 88,
},
{
name: "谌婷民",
age: 51,
six: "男",
education: "小学",
idCode: "430400197301982128",
departName: "坡子街派出所",
tag: "涉相关警情人员,特定对象,涉诉讼人员",
fx: "精神疾病未及时治疗,重大疾病,家庭变故",
fxzs: 78,
},
{
name: "牧志会",
age: 38,
six: "男",
education: "初中",
idCode: "430400197301021289",
departName: "坡子街派出所",
tag: "涉相关警情人员,涉诉讼人员",
fx: "扬言滋事、自杀等个人极端行,暴力伤害行为",
fxzs: 89,
},
{
name: "都勤锦",
age: 66,
six: "男",
education: "高中",
idCode: "430400197301066547",
departName: "坡子街派出所",
tag: "特定对象,涉诉讼人员",
fx: "矛盾纠纷,重点场所异常行为,重大疾病",
fxzs: 91,
},
{
name: "未言婕",
age: 38,
six: "女",
education: "小学",
idCode: "43040019730102212X",
departName: "坡子街派出所",
tag: "涉相关警情人员,涉诉讼人员",
fx: "重大疾病,收入低下",
fxzs: 66,
},
{
name: "施丹",
age: 51,
six: "女",
education: "小学",
idCode: "430400198103212211",
departName: "坡子街派出所",
tag: "涉诉讼人员",
fx: "矛盾纠纷,重点场所异常行为,重大疾病",
fxzs: 98,
},
{
name: "志会",
age: 35,
six: "男",
education: "大学",
idCode: "430400197301022121",
departName: "坡子街派出所",
tag: "涉相关警情人员,特定对象,涉诉讼人员",
fx: "重点场所异常行为,重大疾病",
fxzs: 99,
},
]);
const show = ref(false)
</script>
<style lang="scss" scoped>
</style>

138
src/views/sensitivePerception/PoliceNegative.vue

@ -3,6 +3,19 @@
<header>
<el-form :label-width="114">
<el-row>
<el-col :span="6">
<el-form-item label="单位分组">
<el-select v-model="query.departGroupId" clearable>
<el-option value="10" label="派出所"></el-option>
<el-option value="11" label="交警大队"></el-option>
<el-option value="13" label="刑侦大队"></el-option>
<el-option value="14" label="禁毒大队"></el-option>
<el-option value="15" label="治安大队"></el-option>
<el-option value="16" label="人境大队"></el-option>
<el-option value="12" label="其他"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="统计时间">
<date-time-range-picker-ext
@ -52,13 +65,13 @@
</header>
<div class="table-container" v-loading="mainLoading">
<el-table :data="list">
<el-table-column label="姓名" prop="name" />
<el-table-column label="性别">
<el-table-column label="姓名" prop="name" width="120" />
<el-table-column label="性别" width="100" align="center">
<template #default="{ row }">
<span>{{ getGenderFromIdCode(row.idCode) }}</span>
</template>
</el-table-column>
<el-table-column label="职务">
<el-table-column label="职务" align="center" width="160">
<template #default="{ row }">
<span v-if="row.position">{{ row.position }}</span>
<span v-else>{{
@ -66,8 +79,12 @@
}}</span>
</template>
</el-table-column>
<el-table-column label="警号" prop="empNo" />
<el-table-column label="入职时间" prop="employmentDate" />
<el-table-column label="警号" prop="empNo" width="160" />
<el-table-column
label="入职时间"
prop="employmentDate"
width="160"
/>
<el-table-column label="所属单位" prop="departName">
<template #default="{ row }">
<span
@ -87,7 +104,8 @@
/>
<el-table-column label="风险指数" align="center" width="160">
<template #default="{ row }">
<span>/</span>
<span :type="getType(score)" class="score-theme" v-if="row.score">{{ Math.round(row.score) }}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="操作" width="160">
@ -225,7 +243,7 @@
>
<description-pair
label1="110接处警量"
label2="问题数"
label2="110接处警问题数"
:value1="
negativeInfo.jcj110BusinessSize
"
@ -241,7 +259,7 @@
>
<description-pair
label1="122接处警量"
label2="问题数"
label2="122接处警问题数"
:value1="
negativeInfo.jcj122BusinessSize
"
@ -251,7 +269,7 @@
<el-col :span="12">
<description-pair
label1="执法办案"
label2="问题数"
label2="执法办案问题数"
:value1="
negativeInfo.zfbaBusinessSize
"
@ -272,19 +290,36 @@
:width="220"
:color="colors"
>
<div
:type="getType()"
class="score-progress-body"
>
<div>
<span class="score-progress_score color">{{ score }}</span>
<span></span>
<div class="score-progress-body">
<div v-if="score">
<div>
<span
class="score-progress_score score-theme text-bold"
:type="getType(score)"
>{{ score }}</span
>
<span></span>
</div>
<div
style="font-size: 14px"
class="mb-16"
>
分险指标值
</div>
</div>
<div style="font-size: 14px" class="mb-16">
分险指标值
<div
v-else
style="
font-size: 60px;
line-height: 84px;
color: #999;
"
>
-
</div>
<div
class="score-progress_title color"
class="score-progress_title score-theme"
:type="getType(score)"
>
{{ getScoreLabel() }}
</div>
@ -311,7 +346,7 @@
/>
</el-col>
<el-col :span="8">
<h5>风险问题构成</h5>
<h5>风险构成</h5>
<v-charts
style="height: 320px"
:option="radarOption"
@ -375,6 +410,7 @@
:id="activeNegativeId"
@close="negativeShow = false"
/>
</template>
<script lang="ts" setup>
import vCharts from "vue-echarts";
@ -399,6 +435,7 @@ const query = ref({
moment().startOf("year").format("YYYY-MM-DD HH:mm:ss"),
moment().format("YYYY-MM-DD HH:mm:ss"),
],
departGroupId: '10'
});
const list = ref<any[]>([]);
const total = ref(0);
@ -421,6 +458,7 @@ function reset() {
moment().startOf("year").format("YYYY-MM-DD HH:mm:ss"),
moment().format("YYYY-MM-DD HH:mm:ss"),
],
departGroupId: '10'
};
getList();
}
@ -504,14 +542,32 @@ const time = ref([]);
const radarOption = ref({
radar: {
indicator: [],
indicator: [
{ name: "110接处警", max: 100 },
{ name: "122接处警", max: 100 },
{ name: "人境窗口服务", max: 100 },
{ name: "车驾管服务", max: 100 },
{ name: "交警执法", max: 100 },
{ name: "执法办案", max: 100 },
{ name: "专项工作", max: 100 },
{ name: "安保维稳", max: 100 },
{ name: "治安防控", max: 100 },
{ name: "行政管理", max: 100 },
{ name: "服务基层", max: 100 },
{ name: "队伍管理", max: 100 },
{ name: "其他", max: 100 },
],
},
series: [
{
type: "radar",
data: [
{
value: [],
value: [0, 0, 80, 31, 0, 0, 31, 0, 0],
},
{
value: [0, 0, 61, 21, 0, 0, 10, 0, 0],
},
],
label: {
@ -530,15 +586,16 @@ async function getProfileData() {
beginTime: time.value.length ? time.value[0] : "",
endTime: time.value.length ? time.value[1] : "",
});
score.value = data.score
score.value = Math.round(data.score);
console.log(data.expression);
console.log(data.remarks);
policeInfo.value = data.policeInfo;
negativeInfo.value = data.negativeInfo;
problemSourcesPieOptions.value.series[0].data = data.problemSourcesList;
businessTypePieOptions.value.series[0].data = data.businessTypeList;
radarOption.value.radar.indicator = data.problemTypeRadarIndicator;
radarOption.value.series[0].data[0].value = data.problemTypeRadarData;
// radarOption.value.radar.indicator = data.problemTypeRadarIndicator;
// radarOption.value.series[0].data[0].value = data.problemTypeRadarData;
loading.value = false;
}
@ -569,20 +626,23 @@ const colors = [
{ color: "var(--danger-color)", percentage: 100 },
];
function getType() {
if (score.value < 60) {
function getType(val) {
if (val < 60) {
return "success";
}
if (score.value < 60) {
if (val < 80) {
return "warning";
}
return "danger";
}
function getScoreLabel() {
if (score.value === 0) {
return "无法预测";
}
if (score.value < 60) {
return "低风险";
}
if (score.value < 60) {
if (score.value < 80) {
return "中风险";
}
return "高风险";
@ -603,20 +663,16 @@ function getScoreLabel() {
font-size: 26px;
line-height: 22px;
}
&[type=success] {
.color {
color: var(--success-color);
}
}
.score-theme {
&[type="success"] {
color: var(--success-color);
}
&[type=wraning] {
.color {
color: #e87749;
}
&[type="warning"] {
color: #e87749;
}
&[type=danger] {
.color {
color: var(--danger-color);
}
&[type="danger"] {
color: var(--danger-color);
}
}
</style>

216
src/views/sensitivePerception/RiskClue.vue

@ -0,0 +1,216 @@
<template>
<div class="container h100">
<el-row :gutter="20" class="h100">
<el-col :span="6" class="h100">
<model-risk-tree v-model="query.modelIds" />
</el-col>
<el-col :span="18">
<header>
<el-form :label-width="140">
<el-row>
<el-col :span="8">
<el-form-item label="预警时间">
<date-time-range-picker-ext
v-model="query.createTime"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="涉及单位">
<depart-tree-select
v-model="query.involveDepartId"
:check-strictly="false"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="预警内容">
<el-input
placeholder="请输入"
v-model="query.thingDesc"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="分发状态">
<el-select
v-model="query.distributionState"
clearable
>
<el-option
v-for="item in dict.distributionState"
:label="item.dictLabel"
:value="item.dictValue"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="flex end mb-20">
<div>
<el-button type="primary" @click="getList">
<template #icon>
<icon name="el-icon-Search" />
</template>
查询</el-button
>
<el-button @click="reset">重置</el-button>
</div>
</div>
</header>
<div class="table-container">
<el-table :data="list">
<el-table-column
label="预警时间"
prop="createTime"
width="150"
/>
<!-- <el-table-column-->
<!-- label="预警模型"-->
<!-- prop="modelName"-->
<!-- width="160"-->
<!-- show-overflow-tooltip-->
<!-- />-->
<el-table-column
label="涉及单位"
show-overflow-tooltip
width="200"
>
<template #default="{ row }">
<span>{{ row.involveParentDepartName }}</span><span v-if="row.involveDepartName"><br>{{ row.involveDepartName }}</span>
</template>
</el-table-column>
<el-table-column
label="涉及人员"
prop="involvePoliceName"
width="100"
>
<template #default="{ row }">
<div v-if="row.involvePoliceName">
<div v-for="item in row.involvePoliceName.split(' ')" class="text-nowrap">{{
item }}</div>
</div>
<div v-else></div>
</template>
</el-table-column>
<el-table-column
label="预警内容"
prop="thingDesc"
show-overflow-tooltip
/>
<el-table-column
label="分发状态"
align="center"
width="120"
>
<template #default="{ row }">
<span>{{
getDictLable(
dict.distributionState,
row.distributionState
)
}}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="180">
<template #default="{ row }">
<el-button
type="primary"
link
@click="handleShowDetail(row)"
>查看详情</el-button
>
<el-button
v-if="row.negativeId"
type="primary"
link
@click="handleAction(row)"
>处理详情</el-button
>
</template>
</el-table-column>
</el-table>
</div>
<div class="flex end mt-8">
<el-pagination
@size-change="getList"
@current-change="getList"
:current-page="query.current"
:page-sizes="[9, 18, 36]"
v-model:page-size="query.size"
v-model:current-page="query.current"
layout="total, sizes, prev, pager, next"
:total="total"
v-if="list.length"
>
</el-pagination>
</div>
</el-col>
</el-row>
</div>
</template>
<script lang="ts" setup>
import { listModelClue } from "@/api/sensitivePerception/modelClue";
import useCatchStore from "@/stores/modules/catch";
import { getDictLable } from "@/utils/util";
const catchStore = useCatchStore();
const dict = catchStore.getDicts(["distributionState","handleState"]);
const query = ref({});
const list = ref([]);
const total = ref(0);
onMounted(() => {
getList();
});
const route = useRoute();
watch(
() => route.query.modelId,
(val) => {
query.value.modelIds = [val];
}
);
watch(
() => query.value.modelIds,
() => {
getList();
}
);
function getList() {
listModelClue(query.value).then((data) => {
list.value = data.records;
total.value = data.total;
});
}
function reset() {
query.value = {};
getList();
}
const show = ref(false);
const activeModelClue = ref({});
function handleShowDetail(row) {
activeModelClue.value = row;
show.value = true;
}
const activeNegativeId = ref('')
const negativeShow = ref(false)
function handleAction(row) {
negativeShow.value = true;
activeNegativeId.value = row.negativeId;
}
</script>
<style lang="scss" scoped>
</style>

149
src/views/sensitivePerception/RiskPersonnel.vue

@ -0,0 +1,149 @@
<template>
<div class="container">
<header>
<el-form :label-width="114">
<el-row>
<el-col :span="6">
<el-form-item label="姓名">
<el-input
placeholder="请输入"
v-model="query.name"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="年龄">
<el-input
placeholder="请输入"
v-model="query.age"
type="number"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="管控单位">
<depart-tree-select v-model="query.controlDepartId" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="身份证号">
<el-input
placeholder="请输入"
v-model="query.idCode"
clearable
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="mb-25 flex end">
<div>
<el-button type="primary" @click="getList">
<template #icon>
<icon name="el-icon-Search" />
</template>
查询</el-button
>
<el-button @click="reset">重置</el-button>
</div>
</div>
</header>
<div class="table-container">
<el-table :data="list">
<el-table-column label="姓名" prop="name" width="120" />
<el-table-column label="性别" prop="gender" width="60" align="center" >
<template #default="{ row }">
<span v-if="row.gender == 1"></span>
<span v-if="row.gender == 2"></span>
</template>
</el-table-column>
<el-table-column label="年龄" prop="age" width="60" />
<el-table-column label="身份证号" prop="idCode" width="180" />
<el-table-column label="手机号" prop="mobileNumber" width="120" />
<el-table-column
label="管控单位"
prop="controlDepartName"
width="120"
/>
<el-table-column label="人员标签">
<template #default="{ row }">
<div class="flex gap" v-if="row.tags">
<el-tag v-for="item in row.tags.split(',')" :key="item">{{ item }}</el-tag>
</div>
</template>
</el-table-column>
<el-table-column label="高风险因素">
<template #default="{ row }">
<div class="flex gap">
</div>
</template>
</el-table-column>
<el-table-column
label="高风险指数"
prop="riskScore"
width="120"
align="center"
/>
<el-table-column label="操作" width="160">
<template #default="{ row }">
<el-button type="primary" link @click="show = true"
>查看详情</el-button
>
</template>
</el-table-column>
</el-table>
</div>
<div class="flex end mt-8">
<el-pagination
@size-change="getList"
@current-change="getList"
:current-page="query.current"
:page-sizes="[10, 20, 50]"
:page-size="query.size"
v-model:current-page="query.current"
layout="total, sizes, prev, pager, next"
:total="total"
>
</el-pagination>
</div>
</div>
<el-dialog
title="风险人员详情"
v-model="show"
width="80vw"
top="2vh"
>
<img src="/imgs/lmgz/1.png" alt="">
</el-dialog>
</template>
<script lang="ts" setup>
import { listRiskPersonnel } from "@/api/sensitivePerception/riskPersonnel";
const query = ref({});
const list = ref<any[]>([]);
const total = ref(false)
const show = ref(false)
function getList() {
listRiskPersonnel(query.value).then(data => {
list.value = data.records
total.value = data.total
})
}
function reset() {
query.value = {}
getList()
}
onMounted(() => {
getList()
})
</script>
<style lang="scss" scoped>
</style>

296
src/views/sensitivePerception/RiskScoreRule.vue

@ -0,0 +1,296 @@
<template>
<div class="container" v-loading="loading">
<header class="mb-20">
<div class="flex between">
<div>
<el-button type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增</el-button
>
</div>
<div style="width: 50%">
<el-row>
</el-row>
</div>
</div>
<div class="flex between mt-10 v-center">
<div>
<div><span class="text-primary">个人极端暴力风险指数</span> =基础因素得分百分比 × 15%诱发因素得分百分比 × 30%行为因素得分百分比 × 45%管控因素得分百分比 × 10%</div>
</div>
<a
class="flex v-center gap file-link"
:href="`${BASE_PATH}/templates/长沙公安数字督察灵敏感知体系问题赋分及风险预警机制.pdf`"
target="__blank"
>
<icon name="local-icon-pdf" :size="38" />
<span>个人极端风险赋分规则.pdf</span>
</a>
</div>
</header>
<div class="table-container">
<el-table :data="scoreRules" row-key="id">
<el-table-column
label="问题条目"
prop="riskName"
show-overflow-tooltip
width="180"
/>
<el-table-column label="因素分值" prop="score" width="200" align="center">
</el-table-column>
<el-table-column
label="赋分规则"
prop="ruleDesc"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="因素权重"
prop="weight"
width="100"
align="center"
/>
<el-table-column
label="开启状态"
width="100"
>
<template #default="{ row }">
<el-tag type="success" v-if="row.status === true"
>开启</el-tag
>
<el-tag type="danger" v-if="row.status === false"
>关闭</el-tag
>
</template>
</el-table-column>
<el-table-column label="最后更新时间" prop="updateTime" width="180" />
<el-table-column label="操作" width="160">
<template #default="{ row }">
<el-button type="primary" link @click="handleEdit(row)"
>编辑</el-button
>
<el-button type="danger" link @click="handleDelete(row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</div>
</div>
<el-dialog
v-model="show"
:title="mode === 'add' ? '新增赋分规则' : '编辑赋分规则'"
width="600"
>
<el-form label-width="120" ref="formRef" :model="formData">
<el-form-item
label="父级节点"
:rules="{
required: true,
message: '请选择父级节点',
}"
prop="pid"
>
<el-tree-select
class="flex-1"
v-model="formData.pid"
:data="treeOptions"
clearable
node-key="id"
:props="{
label: 'riskName',
}"
:default-expanded-keys="[MENU_ROOT_ID]"
placeholder="请选择父级节点"
check-strictly
filterable
/>
</el-form-item>
<el-form-item
label="风险因素"
prop="riskName"
:rules="{
required: true,
message: '请输入风险因素',
}"
>
<el-input
v-model="formData.riskName"
placeholder="请输入"
clearable
/>
</el-form-item>
<el-form-item label="因素分值" prop="score">
<el-input
v-model="formData.score"
placeholder="请输入序号"
type="number"
clearable
/>
</el-form-item>
<el-form-item label="赋分规则" prop="ruleDesc">
<el-input
v-model="formData.ruleDesc"
placeholder="请输入序号"
type="textarea"
clearable
/>
</el-form-item>
<el-form-item label="因素权重" prop="weight">
<el-input
v-model="formData.weight"
placeholder="请输入序号"
type="number"
clearable
/>
</el-form-item>
<el-form-item label="序号" prop="sort">
<el-input
v-model="formData.sortId"
placeholder="请输入序号"
type="number"
clearable
/>
</el-form-item>
<el-form-item
label="状态"
prop="status"
>
<el-switch
v-model="formData.status"
inline-prompt
active-text="开启"
inactive-text="关闭"
:active-value="true"
:inactive-value="false"
/>
</el-form-item>
</el-form>
<footer class="flex end">
<el-button @click="show = false">取消</el-button>
<el-button type="primary" @click="submit">确定</el-button>
</footer>
</el-dialog>
</template>
<script lang="ts" setup>
import { BASE_PATH } from "@/api/request";
import { calculateScore } from "@/api/work/negative";
import { MENU_ROOT_ID } from "@/enums/appEnums";
import {
listRiskScoreRuleTree,
addRiskScoreRule,
updateRiskScoreRule,
delRiskScoreRule
} from "@/api/sensitivePerception/riskScoreRule";
import feedback from "@/utils/feedback";
const scoreRules = ref([]);
const treeOptions = ref([
{
id: MENU_ROOT_ID,
riskName: "顶级",
children: [],
},
]);
function getList() {
listRiskScoreRuleTree().then((data) => {
scoreRules.value = data;
treeOptions.value[0].children = data;
});
}
getList();
const show = ref(false);
const formData = ref({
status: 0
});
const formRef = ref();
const mode = ref<string>("add");
watch(mode, (val) => {
if (val === "add") {
formData.value = {};
formRef.value.resetFields();
}
});
async function submit() {
await formRef.value.validate();
if (mode.value === "add") {
await addRiskScoreRule(formData.value);
const parentCode = formData.value.parentCode;
formData.value = {};
formRef.value.resetFields();
formData.value.parentCode = parentCode;
} else {
await updateRiskScoreRule(formData.value);
}
show.value = false;
getList();
}
function handleAdd() {
show.value = true;
mode.value = "add";
}
function handleEdit(row) {
show.value = true;
mode.value = "edit";
formData.value = {...row};
}
const handleDelete = async (row) => {
await feedback.confirm(`确定要删除 "${row.name}"?`);
await delRiskScoreRule(row.id);
getList();
feedback.msgSuccess("删除成功");
};
function getScoreRange(row) {
const sorceSet = new Set();
row.children.forEach((item) => {
if (item.score) {
sorceSet.add(item.score);
}
item.children.forEach((j) => {
if (j.score) {
sorceSet.add(j.score);
}
});
});
if (sorceSet.size === 0) {
return ''
}
if (sorceSet.size === 1) {
return sorceSet.values().next().value
}
const min = Math.min(...sorceSet);
const max = Math.max(...sorceSet);
return `${min}-${max}`
}
const loading = ref(false)
async function handleCalculate() {
await feedback.confirm("确定要重新计算风险指数?");
loading.value = true
await calculateScore()
feedback.msgSuccess("风险指数计算完成");
loading.value = false
}
</script>
<style lang="scss" scoped>
.file-link {
font-size: 16px;
text-decoration: none;
color: #19257d;
padding: 0 8px;
border-radius: 8px;
&:hover {
background-color: #eee;
}
}
</style>

32
src/views/work/Query.vue

@ -99,9 +99,9 @@
v-model="query[item.key]"
@update="getList"
/>
<div class="form-row flex v-center">
<div class="form-row flex">
<label class="text-center">其他选项</label>
<div class="flex gap-20">
<div class="flex wrap query-box">
<el-tree-select
:data="dictProblemSources"
:props="{ value: 'id' }"
@ -130,7 +130,7 @@
</el-select>
<el-select
size="small"
style="width: 146px"
style="width: 120px"
placeholder="核查情况"
clearable
v-model="query.checkStatus"
@ -144,7 +144,7 @@
</el-select>
<el-select
size="small"
style="width: 146px"
style="width: 120px"
placeholder="是否整改"
clearable
v-model="query.isRectifyCode"
@ -158,7 +158,7 @@
</el-select>
<el-select
size="small"
style="width: 146px"
style="width: 120px"
placeholder="办理状态"
clearable
v-model="query.processingStatus"
@ -173,7 +173,7 @@
</el-select>
<el-select
size="small"
style="width: 146px"
style="width: 150px"
placeholder="流程阶段"
clearable
v-model="query.flowKey"
@ -187,7 +187,7 @@
</el-select>
<el-select
size="small"
style="width: 146px"
style="width: 120px"
placeholder="是否超时"
clearable
v-model="query.timeoutFlag"
@ -197,7 +197,7 @@
</el-select>
<el-select
size="small"
style="width: 146px"
style="width: 120px"
placeholder="申请延期"
clearable
v-model="query.extensionFlag"
@ -205,6 +205,8 @@
<el-option label="已申请" :value="true" />
<el-option label="未申请" :value="false" />
</el-select>
<el-input placeholder="任务ID" size="small" style="width: 146px" clearable />
</div>
</div>
</el-form>
@ -495,7 +497,7 @@
</el-form-item>
</el-col>
</el-row>
<el-row v-if="form.problemSourcesCode === ProblemSources.ZXDC">
<el-row v-if="formData.problemSourcesCode === ProblemSources.ZXDC">
<el-col :span="12">
<el-form-item
label="专项督察"
@ -507,7 +509,7 @@
}"
>
<el-select
v-model="form.specialSupervision"
v-model="formData.specialSupervision"
clearable
>
<el-option
@ -531,7 +533,7 @@
>
<el-input
placeholder="请输入"
v-model="form.reportNumber"
v-model="formData.reportNumber"
/>
</el-form-item>
</el-col>
@ -888,8 +890,11 @@ function handleSelectInvolveProblem(vals) {
padding: 8px 0;
box-shadow: inset 0px -1px 0px 0px #ebebeb;
label {
width: 126px;
width: 120px;
line-height: 24px;
padding-right: 12px;
box-sizing: border-box;
text-align: right;
& + * {
width: calc(100% - 126px);
}
@ -901,4 +906,7 @@ function handleSelectInvolveProblem(vals) {
margin-bottom: 0;
}
}
.query-box {
gap: 10px 20px;
}
</style>

8
vite.config.ts

@ -70,10 +70,10 @@ export default ({ mode }) => {
},
postcss: {
plugins: [
// postCssPxToRem({
// rootValue: 192,
// propList: ['*'],
// })
postCssPxToRem({
rootValue: 192,
propList: ['*'],
})
]
}
},

Loading…
Cancel
Save