From b8c02994bc14f4bc7f44e28aeaa0f52079a2b05e Mon Sep 17 00:00:00 2001 From: wxc <191104855@qq.com> Date: Tue, 17 Dec 2024 18:04:04 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=AE=8C=E5=96=84=E6=8F=90=E9=86=92?= =?UTF-8?q?=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/alarm/dialog.vue | 150 ++ src/components/alarm/reply.vue | 0 .../sensitivePerception/DepartNegative.vue | 162 +- src/views/sensitivePerception/Model.vue | 4 +- .../sensitivePerception/PoliceNegative.vue | 1396 ++++++++--------- src/views/sensitivePerception/RiskClue.vue | 208 +-- .../sensitivePerception/RiskPersonnel.vue | 175 +-- 7 files changed, 834 insertions(+), 1261 deletions(-) create mode 100644 src/components/alarm/dialog.vue create mode 100644 src/components/alarm/reply.vue diff --git a/src/components/alarm/dialog.vue b/src/components/alarm/dialog.vue new file mode 100644 index 0000000..ab0f185 --- /dev/null +++ b/src/components/alarm/dialog.vue @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + 工作日 + + + + + + + + \ No newline at end of file diff --git a/src/components/alarm/reply.vue b/src/components/alarm/reply.vue new file mode 100644 index 0000000..e69de29 diff --git a/src/views/sensitivePerception/DepartNegative.vue b/src/views/sensitivePerception/DepartNegative.vue index 970defa..edd4444 100644 --- a/src/views/sensitivePerception/DepartNegative.vue +++ b/src/views/sensitivePerception/DepartNegative.vue @@ -6,12 +6,30 @@ - - - - - - + + + + + + @@ -91,11 +109,15 @@ /> - {{ Math.round(row.score) }} + {{ Math.round(row.score) }} - - + 问题详情 - 预警提醒 + 预警提醒 @@ -350,7 +372,6 @@ 突出问题排名 - - - - - - - - - - - - - - - (formData2.involveDepartName = - row.shortName) - " - /> - - - - - - - + ([]); const total = ref(0); -let showNotification = ref(false) -let formData2 = ref({ - alarmTypeId: 1, - involveDepartId: '', - involveDepartName: '', - alarmContent: '' -}) const mainLoading = ref(false); function getList() { @@ -523,14 +485,6 @@ function getList() { }); } -const initFormData2 = () => { - formData2.value ={ - alarmTypeId: 1, - involveDepartId: '', - involveDepartName: '', - alarmContent: '' - } -} function reset() { query.value = { @@ -545,30 +499,13 @@ function reset() { getList(); } -const handleShowNotification = () => { - showNotification.value = true -} +let showNotification = ref(false); +const activeDepartId = ref('') +const handleShowNotification = (row) => { + showNotification.value = true; + activeDepartId.value = row.departId +}; -const handleNotification = async () => { - if(formData2.value.involveDepartId == '') { - feedback.msgWarning("请选择被提醒单位"); - return; - } - if(formData2.value.alarmContent == '') { - feedback.msgWarning("请填写提醒内容"); - return; - } - let data = { - alarmTypeId: formData2.value.alarmTypeId, - notificationDepartCode: formData2.value.involveDepartId, - notificationDepartName: formData2.value.involveDepartName, - alarmContent: formData2.value.alarmContent - } - await alarmNotificationCommit(data); - showNotification.value = false; - feedback.msgSuccess("操作成功"); - initFormData2(); -} onMounted(() => { getList(); @@ -690,7 +627,7 @@ async function getProfileData() { radarOption.value.radar.indicator = data.problemTypeRadarIndicator; radarOption.value.series[0].data[0].value = data.problemTypeRadarData; - problemTypeBarList.value = data.problemTypeBarList; + // problemTypeBarList.value = data.problemTypeBarList; loading.value = false; } @@ -751,7 +688,6 @@ function getColor(val) { } return "var(--danger-color)"; } - diff --git a/src/views/sensitivePerception/RiskClue.vue b/src/views/sensitivePerception/RiskClue.vue index 8b036f6..3a02659 100644 --- a/src/views/sensitivePerception/RiskClue.vue +++ b/src/views/sensitivePerception/RiskClue.vue @@ -90,16 +90,6 @@ - - - 预警提醒 - - - @@ -118,75 +108,6 @@ - - - - - - - - - - - - - changeDepart(row)" - style="width: 280px" - /> - - - - - - - - - - - @@ -334,7 +255,7 @@ import { listPoliceAll } from "~/api/system/police"; import { listQueryRiskPersonnel } from "@/api/sensitivePerception/riskPersonnel"; import { listRiskScoreRuleTreeOld } from "@/api/sensitivePerception/riskScoreRule"; import { disabledDate } from "@/utils/util"; -import { alarmNotificationCommit } from "~/api/work/alarm"; + import feedback from "~/utils/feedback"; const query = ref({}); @@ -353,6 +274,7 @@ onMounted(() => { treeOptions.value = data; }); }); + watch( () => query.value.riskScoreRuleId, () => { @@ -369,97 +291,6 @@ watch( const loading = ref(false); -let showNotification = ref(false); -let formData2 = ref({ - alarmTypeId: 1, - involveDepartId: "", - involveDepartName: "", - alarmContent: "", - blameName: "", - blameIdCode: "", - blameEmpNo: "", - blames: {}, - level: -1, - requestReply: true, -}); -let police = ref({}); -let polices = ref([]); -let currentClueId = ref(-1); - -const handleShowNotification = (id) => { - showNotification.value = true; - currentClueId.value = id; -}; - -const handleNotification = async () => { - if (formData2.value.involveDepartId == "") { - feedback.msgWarning("请选择被提醒单位"); - return; - } - if (formData2.value.alarmContent == "") { - feedback.msgWarning("请填写提醒内容"); - return; - } - if (formData2.value.policeIdCode == "") { - feedback.msgWarning("请选择被提醒民警"); - return; - } - let data = { - alarmTypeId: formData2.value.alarmTypeId, - notificationDepartId: formData2.value.involveDepartId, - notificationDepartName: formData2.value.involveDepartName, - alarmContent: formData2.value.alarmContent, - policeName: police.value.name, - policeIdCode: police.value.idCode, - policeNo: police.value.empNo, - }; - if (currentClueId.value != -1) { - data["clueId"] = currentClueId.value; - } - await alarmNotificationCommit(data); - showNotification.value = false; - feedback.msgSuccess("操作成功"); - initFormData2(); -}; - -const initFormData2 = () => { - formData2.value = { - alarmTypeId: 1, - involveDepartId: "", - involveDepartName: "", - alarmContent: "", - blameName: "", - blameIdCode: "", - blameEmpNo: "", - blames: {}, - level: -1, - }; -}; - -const changeDepart = (row) => { - formData2.value.involveDepartName = row.shortName; - formData2.value.level = row.level; - police.value = {}; - getPolices(row.id); -}; - -const changePolice = (data) => { - police.value = { - idCode: data.idCode, - empNo: data.empNo, - name: data.name, - }; -}; - -function getPolices(departId) { - if (departId == "") { - return; - } - listPoliceAll(departId).then((res) => { - polices.value = res; - }); -} - function getList() { loading.value = true; listRiskClues(query.value).then((data) => { @@ -469,41 +300,6 @@ function getList() { }); } -const filterJsonData = (row) => { - if (row.data == undefined) { - return ""; - } - let j = JSON.parse(row.data); - let str = ""; - if (j instanceof Array) { - j.forEach((item) => { - str += JSON.stringify(item) + "\n"; - }); - } - if (j.sourceData != undefined) { - j = JSON.parse(row.sourceData); - } - - for (let key in j) { - if (key == "eventTime") { - continue; - } - if (key == "idCode") { - continue; - } - if (key == "departId") { - continue; - } - if (key == "personId") { - continue; - } - if (key == "name") { - continue; - } - str += j[key] + "\n"; - } -}; - function reset() { query.value = {}; getList(); diff --git a/src/views/sensitivePerception/RiskPersonnel.vue b/src/views/sensitivePerception/RiskPersonnel.vue index f6731fd..5c8e757 100644 --- a/src/views/sensitivePerception/RiskPersonnel.vue +++ b/src/views/sensitivePerception/RiskPersonnel.vue @@ -148,7 +148,7 @@ 预警提醒 @@ -352,81 +352,8 @@ - - - - - - - - - - - - - changeDepart(row)" - /> - - - - - - - - - - - - + +