This commit is contained in:
lcw
2025-08-29 19:32:41 +08:00
parent 8a1527b9b3
commit 1a16344cf4
11 changed files with 435 additions and 21014 deletions

20939
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -133,3 +133,69 @@ export const fxgbCzlfx = (params) => {
}); });
} }
// 分析报告-地域维度统计
export const jqypDywdtj = (params) => {
return request({
url: api + "/jjdbYp/fxbgDywdtj",
method: "GET",
params
});
};
// 分析报告 - 警情类型统计
export const jqypfxbgJqlxtj = (params) => {
return request({
url: api + "/lzJcjPjdb/fxbgJqlxtj",
method: "GET",
params
});
}
// 警情来源统计
export const jqypfxbgJqlytj = (params) => {
return request({
url: api + "/jjdbYp/fxbgJqlytj",
method: "GET",
params
});
}
// 分析报告
export const jqypfxbgTj = (params) => {
return request({
url: api + "/jjdbYp/fxbgTj",
method: "GET",
params
});
}
// 分析报告-时间维度-月分析
export const jqypfxbgYdfx = (params) => {
return request({
url: api + "/jjdbYp/fxbgYdfx",
method: "GET",
params
});
}
// 分析报告-时间维度-24小时分析
export const jqypfxbgXsfx = (params) => {
return request({
url: api + "/jjdbYp/fxbgXsfx",
method: "GET",
params
});
}
// 分析报告 - 处理结果分析
export const jqypfxbgCljgf = (params) => {
return request({
url: api + "/jjdbYp/fxgbCljgfx",
method: "GET",
params
});
}
// 分析报告-处置率分析
export const jqypfxbgCzlfx = (params) => {
return request({
url: api + "/jjdbYp/fxgbCzlfx",
method: "GET",
params
});
}

View File

@ -126,8 +126,6 @@
import PageTitle from "@/components/aboutTable/PageTitle.vue"; import PageTitle from "@/components/aboutTable/PageTitle.vue";
// import { useExportToPDF } from './components/a.js'; // import { useExportToPDF } from './components/a.js';
import Search from "@/components/aboutTable/Search.vue"; import Search from "@/components/aboutTable/Search.vue";
import html2canvas from 'html2canvas';
import jsPDF from 'jspdf';
import MaleNightingalePicture from './components/maleNightingalePicture.vue' import MaleNightingalePicture from './components/maleNightingalePicture.vue'
import Histogram from './components/histogram.vue' import Histogram from './components/histogram.vue'
@ -207,17 +205,14 @@ const sortingRatio = (data) => {
// 提取所有number值 // 提取所有number值
// 计算总数 // 计算总数
const total = data.reduce((sum, item) => sum + item.number, 0); const total = data.reduce((sum, item) => sum + item.number, 0);
// 找出第一大和第二大的值及其对应的name // 找出第一大和第二大的值及其对应的name
const sortedData = [...data].sort((a, b) => b.number - a.number); const sortedData = [...data].sort((a, b) => b.number - a.number);
const dataValue = sortedData.map(item => { const dataValue = sortedData.map(item => {
return { return {
...item, ...item,
ratio: total > 0 ? (item.number / total * 100).toFixed(2) + '%' : '0%', ratio: total > 0 ? (item.number / total * 100).toFixed(2) + '%' : '0%',
} }
}) })
return dataValue return dataValue
} }
// 地域统计 // 地域统计

View File

@ -390,4 +390,19 @@ watch(()=>D_BZ_SSZT.value, (val) => {
color: red; color: red;
} }
// .bts >>>p{
// font-size: 16px; font-family: 黑体;
// color: rgb(255, 0, 140);
// }
// .psj >>>p{
// text-indent: 2em;
// }
// .minbt >>>p{
// font-size: 16px; font-family: 楷体;
// }
// .nr >>>p{
// font-size: 16px; font-family: 仿宋;
// }
</style> </style>

View File

@ -108,15 +108,14 @@ const changeSize = (val) => {
const getList = () =>{ const getList = () =>{
let params = { let params = {
id:item.value.id, ypid:item.value.id,
sjLx:sjlx.value, // sjLx:sjlx.value,
pageCurrent:pageData.pageConfiger.pageCurrent, pageCurrent:pageData.pageConfiger.pageCurrent,
pageSize:pageData.pageConfiger.pageSize, pageSize:pageData.pageConfiger.pageSize,
} }
pageData.tableConfiger.loading = true; pageData.tableConfiger.loading = true;
qcckPost(params,'/mosty-gsxt/tsyp/getRyPage').then(res=>{ qcckPost(params,'/jjdbYp/getPageList').then(res=>{
pageData.tableConfiger.loading = false; pageData.tableConfiger.loading = false;
console.log(res,'===');
pageData.tableData = res.records || [] pageData.tableData = res.records || []
pageData.total = res.total; pageData.total = res.total;
}).catch(()=>{ }).catch(()=>{

View File

@ -53,6 +53,7 @@ import Search from "@/components/aboutTable/Search.vue";
import { qcckPost } from "@/api/qcckApi.js"; import { qcckPost } from "@/api/qcckApi.js";
import { useRoute, useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import { reactive, ref, onMounted, getCurrentInstance, watch, nextTick } from "vue"; import { reactive, ref, onMounted, getCurrentInstance, watch, nextTick } from "vue";
import { jqypDywdtj, jqypfxbgJqlxtj, jqypfxbgYdfx, jqypfxbgJqlytj, jqypfxbgTj, jqypfxbgCljgf, jqypfxbgCzlfx, getDictItem } from '@/api/semanticAnalysis'
const router = useRouter(); const router = useRouter();
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const { D_SG_SJLY, D_SG_TSYPGZ } = proxy.$dict("D_SG_SJLY", "D_SG_TSYPGZ"); //获取字典数据 const { D_SG_SJLY, D_SG_TSYPGZ } = proxy.$dict("D_SG_SJLY", "D_SG_TSYPGZ"); //获取字典数据
@ -141,7 +142,6 @@ const getLits = () => {
...formData.value ...formData.value
} }
loading.value = true; loading.value = true;
console.log(params);
qcckPost(params, '/mosty-gsxt/tsyp/selectPage').then(res => { qcckPost(params, '/mosty-gsxt/tsyp/selectPage').then(res => {
let arr = res.records || []; let arr = res.records || [];
@ -153,16 +153,34 @@ const getLits = () => {
}) })
} }
const handleYp = (val) => { const handleYp = async (val) => {
await funAll(val.id)
let params = { tsypid: val.id, } let params = { tsypid: val.id, }
qcckPost(params, '/mosty-gsxt/wshs/getDcypbg').then(res => { await qcckPost(params, '/mosty-gsxt/wshs/getDcypbg').then(res => {
let data = res || {}; let data = res || {};
let html = `<p class="html_bt">${data.bt}</p>` const content = `
<p>为全面、客观、准确掌握全区公安机关的执法状况自治区公安厅基于数据统计对全区公安机关2021年度的执法状况作了客观分析。</p>
<p>一、执法状况总体分析</p>
<p>1.接处警情况</p>
<p>1.1接报警情</p>
`
// let html = `<p class="html_bt">${data.bt}</p>`
html += `<p>${data.head}</p>` html += `<p>${data.head}</p>`
html += `<p>${data.nr}</p>` // html += `<p>${data.nr}</p>`
html += `<p class="html_bt">${content}
${sortingRatioValue.fxbg}
${sortingRatioValue.jqlx}
${sortingRatioValue.jqly}
${sortingRatioValue.dywd}
${sortingRatioValue.ydfx}
${sortingRatioValue.czjgfx}
${sortingRatioValue.xlwdfx}
</p>`;
html += `<p>${data.bc}</p>` html += `<p>${data.bc}</p>`
html += `<p>${data.end}</p>` html += `<p>${data.end}</p>`
textContent.value = html; console.log(html);
textContent.value = html
showModel.value = true; showModel.value = true;
}) })
} }
@ -187,6 +205,199 @@ const tabHeightFn = () => {
}; };
const dataList = reactive({
dyTj: {
xAxisData: [],
seriesData: [],
},
jqlxTj: [],
jqlyTj: [],
CljgfTj: [],
XsfxTj: [],
})
const sortingRatioValue = reactive({
jqlx: "",
jqly: "",
dywd: "",
ydfx: "",
xlwdfx: "",
czjgfx: "",
fxbg: ""
})
const sortingRatio = (data) => {
// 提取所有number值
// 计算总数
const total = data.reduce((sum, item) => sum + item.number, 0);
// 找出第一大和第二大的值及其对应的name
const sortedData = [...data].sort((a, b) => b.number - a.number);
const dataValue = sortedData.map(item => {
return {
...item,
ratio: total > 0 ? (item.number / total * 100).toFixed(2) + '%' : '0%',
}
})
return dataValue
}
const pageData = reactive({
parameter: { bjlbList: '' }
})
const getDictItemList = () => {
const promes = {
dictCode: "00000000"
}
getDictItem(promes).then(res => {
pageData.parameter.bjlbList = res.map(item => item.dm).join(',')
console.log(pageData.parameter.bjlbList);
})
}
getDictItemList()
const funAll =async (val) => {
// await getfxbgDywdtj(val)
// await getfxbgJqlxtj(val)
// await getfxbgJqlytj(val)
// await getfxbgYdfx(val)
// await getfxgbCljgf(val)
// await getfxgbCzlfx(val)
// await getfxbgTj(val)
}
// 地域统计
const getfxbgDywdtj = (val) => {
jqypDywdtj({ypid:val}).then(res => {
dataList.dyTj.xAxisData = res.map(it => it.ssbm)
dataList.dyTj.seriesData = [];
for (let i = 0; i < res.length; i++) {
dataList.dyTj.seriesData[i] = [];
for (let j = 0; j < res.length; j++) {
dataList.dyTj.seriesData[i][j] = 0;
}
}
for (let i = 0; i < dataList.dyTj.seriesData.length; i++) {
dataList.dyTj.seriesData[i][i] = res[i].number
}
const model = sortingRatio(res)
sortingRatioValue.dywd = `<p>1.1.3地域维度</p><p>从地市分布地市来看,${model[0].ssbm}警情量最大,占到全区警情总量的${model[0].number}。其次为${model[1].ssbm}${model[2].ssbm},两市警情量较为接近。警情量最少的为${model[model.length - 1].ssbm} </p>`
// sortingRatioValue.Dywdtj = sortingRatio(res)
})
}
// 警情类型统计
const getfxbgJqlxtj = (val) => {
let params = {
...pageData.parameter,
ypid:val
}
jqypfxbgJqlxtj(params).then(res => {
// sortingRatioValue.Jqlx =
const model = sortingRatio(res)
sortingRatioValue.jqlx = `<p>1.1.1类型维度</p><p>按警情类型来看,${model[0].name}最多,占到${model[0].ratio};其次为${model[1].name}最多,占到${model[1].ratio}。</p>`
dataList.jqlxTj = res.map(item => {
return {
name: item.name,
value: item.number
}
})
})
}
// 警情来源统计
const getfxbgJqlytj = (val) => {
jqypfxbgJqlytj({ypid:val}).then(res => {
// sortingRatioValue.Lyfx =
const model = sortingRatio(res)
sortingRatioValue.jqly = `<p>1.1.2来源维度</p><p>按警情来源来看,${model[0].name}最多,占到${model[0].ratio};其次为${model[1].name}最多,占到${model[1].ratio}。</p>`
dataList.jqlyTj = res.map(item => {
return {
name: item.name,
value: item.number
}
})
})
}
//分析报告-时间维度-月分析
const getfxbgYdfx = (val) => {
jqypfxbgYdfx({ypid:val}).then(res => {
// sortingRatioValue.Ydfx =
const model = sortingRatio(res)
sortingRatioValue.ydfx = `<p >1.1.4时间维度</p> <p>我们将所有警情按照月份划分进行统计发现,每月警情分布较为平均。最高月份为${model[0].month}月,占到${model[0].number};最低月份为${model[res.length - 1].month}月,占到${model[res.length - 1].number}。考虑是因为${model[0].month}月为我区传统旅游旺季,进藏人员较多。 ${model[res.length - 1].month}月一般春节及藏历新年期间,在藏人员较少。</p>
`
// dataList.ydTj = res.map(item => {
// return {
// name: item.month,
// value: item.number
// }
// })
})
}
// 分析报告-处理结果分析
const getfxgbCljgf = (val) => {
jqypfxbgCljgf({ypid:val}).then(res => {
// sortingRatioValue.Cljgf =
const model = sortingRatio(res)
dataList.CljgfTj = res.map(item => {
return {
name: item.name,
value: item.number
}
})
let czjgfx = `从警情处置结果来看,`
model.forEach(item => {
czjgfx += `${item.name},占到${item.ratio};`
})
sortingRatioValue.czjgfx = `<p>1.2警情处置</p><p>1.2.1结果维度</p><p>${czjgfx}</p>`
})
}
// 分析报告-处置率分析
const getfxgbCzlfx = (val) => {
jqypfxbgCzlfx({ypid:val}).then(res => {
dataList.withinTj = [{
name: "超时分流(超过24小时)",
value: res.within24h ? res.within24h : 0
}, {
name: "按时分流(24小时内)",
value: res.over24h ? res.over24h : 0
}]
sortingRatioValue.xlwdfx = `<p>1.2.2效率维度</p><p>从处警效率来看24小时以内处警的占到${res.over24h}%。表明我区公安机关在接警之后能够在第一时间处警。</p>
`
// sortingRatioValue.Czlfx = sortingRatio(dataList.withinTj)
})
}
const getfxbgTj = (val) => {
jqypfxbgTj({ypid:val}).then(res => {
sortingRatioValue.fxbg = `<p>${Time()} ,全区公安机关共 接报各类警情${res.total}起,同比上升 ${res.tbbsb}%,同比上升${res.hbbsb}%</p>`
dataList.XsfxTj = res
})
}
const Time = () => {
const currentYear = new Date().getFullYear();
const startOfYear = new Date(currentYear, 0, 1); // 今年1月1日
const endOfYear = new Date(currentYear, 11, 31, 23); // 今年12月31日23:59:59.999
const year = startOfYear.getFullYear();
const month = String(startOfYear.getMonth() + 1).padStart(2, '0');
const day = String(startOfYear.getDate()).padStart(2, '0');
const endYear = endOfYear.getFullYear();
const endMonth = String(endOfYear.getMonth() + 1).padStart(2, '0');
const endDay = String(endOfYear.getDate()).padStart(2, '0');
return `${year}${month}${day}日 至${endYear}${endMonth}${endDay}`
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -273,7 +484,7 @@ const tabHeightFn = () => {
margin-top: 4px; margin-top: 4px;
border-top: 1px solid #ccc; border-top: 1px solid #ccc;
padding: 4px; padding: 4px;
box-sizing: border-box; box-sizing: border-box ;
} }
} }

View File

@ -37,7 +37,9 @@ const changeValue = (value) => {
showPopup.value = true showPopup.value = true
} }
const classIndex=ref(0) const classIndex=ref(0)
const handleChange = (val,index) => { const handleChange = (val, index) => {
console.log(val.tqjg);
classIndex.value=index classIndex.value=index
emitter.emit('getlistData', val.tqjg) emitter.emit('getlistData', val.tqjg)

View File

@ -17,7 +17,7 @@
</template> </template>
<script setup> <script setup>
import { ref, reactive, toRaw, computed, watch, nextTick, onMounted,getCurrentInstance } from "vue"; import { ref, reactive, toRaw, computed, watch, nextTick, onMounted, getCurrentInstance } from "vue";
import formNewModel from "./formNewModel.vue" import formNewModel from "./formNewModel.vue"
import emitter from "@/utils/eventBus.js"; import emitter from "@/utils/eventBus.js";
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
@ -40,13 +40,11 @@ const data = {
40: "特征识别分析", 40: "特征识别分析",
} }
const model = ref() const model = ref()
const numberData = 0
onMounted(() => { const jx = (val) => {
const json =props.listData ; if (val) {
const jsonString = JSON.parse(json); const jsonObject = val;
if (jsonString) { if (Array.isArray(jsonObject)) {
const jsonObject = jsonString;
console.log(jsonObject);
model.value = jsonObject.reduce((acc, cur) => { model.value = jsonObject.reduce((acc, cur) => {
const key = Object.keys(cur)[0]; const key = Object.keys(cur)[0];
const prefix = key.substring(0, 2); const prefix = key.substring(0, 2);
@ -59,18 +57,40 @@ const jsonString = JSON.parse(json);
} }
if (prefix === '50' || prefix === '60') { if (prefix === '50' || prefix === '60') {
acc[10].inputs.push({ label: cur[key].name, prop: key, type: "input", width: "33%" }); acc[10].inputs.push({ label: cur[key].name, prop: key, type: "input", width: "33%" });
acc[10].model[key] = cur[key].content? cur[key].content : '-'; acc[10].model[key] = cur[key].content ? cur[key].content : '-';
} else { } else {
acc[prefix].inputs.push({ label: cur[key].name, prop: key, type: "input", width: "33%" }); acc[prefix].inputs.push({ label: cur[key].name, prop: key, type: "input", width: "33%" });
acc[prefix].model[key] = cur[key].content=='-'||cur[key].content==''||cur[key].content=='无'? '/':cur[key].content ; acc[prefix].model[key] = cur[key].content == '-' || cur[key].content == '' || cur[key].content == '无' ? '/' : cur[key].content;
} }
return acc; return acc;
}, {}); }, {});
} else {
const str = JSON.parse(jsonObject);
jx(str)
numberData++
if (numberData == 3) {
numberData=0
return
}
}
} else { } else {
model.value = [] model.value = []
proxy.$message({ type: "error", message: "解析失败" }); proxy.$message({ type: "error", message: "解析失败" });
} }
}
onMounted(() => {
const json = props.listData;
const jsonString = JSON.parse(json);
jx(jsonString)
}) })
watch(() => props.listData, (val) => {
if (val) {
const json = val;
const jsonString = JSON.parse(json);
jx(jsonString)
}
},{deep:true})
const handleClose = () => { const handleClose = () => {
emitter.emit('showDetails', true) emitter.emit('showDetails', true)
} }

View File

@ -349,7 +349,7 @@ const handleFx = (val) => {
.then(({ value }) => { .then(({ value }) => {
loading.value = true loading.value = true
completions(val).then(res => { completions(val).then(res => {
console.log(res,"分析报告数据"); // console.log(res,"分析报告数据");
let jsonString let jsonString
let jsonMatch = res.choices[0].text.match(/\[[\s\S]*?\]/g); let jsonMatch = res.choices[0].text.match(/\[[\s\S]*?\]/g);
if (!jsonMatch) { if (!jsonMatch) {
@ -362,14 +362,14 @@ const handleFx = (val) => {
const promes = { const promes = {
fxlb: selectType.value, fxlb: selectType.value,
fxmc: value, fxmc: value,
tqjg:JSON.stringify(jsonString),//提取结果 tqjg: JSON.stringify(jsonString),//提取结果
xyjg: res.choices[0].text, xyjg: res.choices[0].text,
...saveData.value ...saveData.value
} }
yyfxAdd(promes).then(res => { yyfxAdd(promes).then(res => {
proxy.$message({ type: "success", message: "添加成功" }); proxy.$message({ type: "success", message: "添加成功" });
emitter.emit('getYyfxSelectPage') emitter.emit('getYyfxSelectPage')
emitter.emit('getlistData',JSON.stringify(jsonString)) emitter.emit('getlistData', JSON.stringify(jsonString))
emitter.emit('showDetails', false) emitter.emit('showDetails', false)
}).catch(err => { }).catch(err => {
console.log(err, "xxxxx"); console.log(err, "xxxxx");

View File

@ -4,8 +4,8 @@ function resolve(dir) {
return path.join(__dirname, dir); return path.join(__dirname, dir);
} }
const serverHost = "http://192.168.1.32:8006"//波哥 // const serverHost = "http://192.168.1.32:8006"//波哥
// const serverHost = "http://192.168.0.231:8006"//线上 const serverHost = "http://192.168.0.231:8006"//线上
// const serverHost = "http://192.168.1.117:8006"//周 // const serverHost = "http://192.168.1.117:8006"//周
// const serverHost = "http://192.168.1.98:8006"//毛毛 // const serverHost = "http://192.168.1.98:8006"//毛毛