lcw
This commit is contained in:
20939
package-lock.json
generated
20939
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -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
|
||||
});
|
||||
}
|
||||
|
@ -126,8 +126,6 @@
|
||||
import PageTitle from "@/components/aboutTable/PageTitle.vue";
|
||||
// import { useExportToPDF } from './components/a.js';
|
||||
import Search from "@/components/aboutTable/Search.vue";
|
||||
import html2canvas from 'html2canvas';
|
||||
import jsPDF from 'jspdf';
|
||||
|
||||
import MaleNightingalePicture from './components/maleNightingalePicture.vue'
|
||||
import Histogram from './components/histogram.vue'
|
||||
@ -207,17 +205,14 @@ 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
|
||||
}
|
||||
// 地域统计
|
||||
|
@ -390,4 +390,19 @@ watch(()=>D_BZ_SSZT.value, (val) => {
|
||||
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>
|
||||
|
@ -108,15 +108,14 @@ const changeSize = (val) => {
|
||||
|
||||
const getList = () =>{
|
||||
let params = {
|
||||
id:item.value.id,
|
||||
sjLx:sjlx.value,
|
||||
ypid:item.value.id,
|
||||
// sjLx:sjlx.value,
|
||||
pageCurrent:pageData.pageConfiger.pageCurrent,
|
||||
pageSize:pageData.pageConfiger.pageSize,
|
||||
}
|
||||
pageData.tableConfiger.loading = true;
|
||||
qcckPost(params,'/mosty-gsxt/tsyp/getRyPage').then(res=>{
|
||||
qcckPost(params,'/jjdbYp/getPageList').then(res=>{
|
||||
pageData.tableConfiger.loading = false;
|
||||
console.log(res,'===');
|
||||
pageData.tableData = res.records || []
|
||||
pageData.total = res.total;
|
||||
}).catch(()=>{
|
||||
|
@ -53,6 +53,7 @@ import Search from "@/components/aboutTable/Search.vue";
|
||||
import { qcckPost } from "@/api/qcckApi.js";
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
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 { proxy } = getCurrentInstance();
|
||||
const { D_SG_SJLY, D_SG_TSYPGZ } = proxy.$dict("D_SG_SJLY", "D_SG_TSYPGZ"); //获取字典数据
|
||||
@ -141,7 +142,6 @@ const getLits = () => {
|
||||
...formData.value
|
||||
}
|
||||
loading.value = true;
|
||||
console.log(params);
|
||||
|
||||
qcckPost(params, '/mosty-gsxt/tsyp/selectPage').then(res => {
|
||||
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, }
|
||||
qcckPost(params, '/mosty-gsxt/wshs/getDcypbg').then(res => {
|
||||
await qcckPost(params, '/mosty-gsxt/wshs/getDcypbg').then(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.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.end}</p>`
|
||||
textContent.value = html;
|
||||
console.log(html);
|
||||
|
||||
textContent.value = html
|
||||
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>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
@ -38,6 +38,8 @@ const changeValue = (value) => {
|
||||
}
|
||||
const classIndex=ref(0)
|
||||
const handleChange = (val, index) => {
|
||||
console.log(val.tqjg);
|
||||
|
||||
classIndex.value=index
|
||||
|
||||
emitter.emit('getlistData', val.tqjg)
|
||||
|
@ -40,13 +40,11 @@ const data = {
|
||||
40: "特征识别分析",
|
||||
}
|
||||
const model = ref()
|
||||
|
||||
onMounted(() => {
|
||||
const json =props.listData ;
|
||||
const jsonString = JSON.parse(json);
|
||||
if (jsonString) {
|
||||
const jsonObject = jsonString;
|
||||
console.log(jsonObject);
|
||||
const numberData = 0
|
||||
const jx = (val) => {
|
||||
if (val) {
|
||||
const jsonObject = val;
|
||||
if (Array.isArray(jsonObject)) {
|
||||
model.value = jsonObject.reduce((acc, cur) => {
|
||||
const key = Object.keys(cur)[0];
|
||||
const prefix = key.substring(0, 2);
|
||||
@ -66,11 +64,33 @@ const jsonString = JSON.parse(json);
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
} else {
|
||||
const str = JSON.parse(jsonObject);
|
||||
jx(str)
|
||||
numberData++
|
||||
if (numberData == 3) {
|
||||
numberData=0
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
model.value = []
|
||||
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 = () => {
|
||||
emitter.emit('showDetails', true)
|
||||
}
|
||||
|
@ -349,7 +349,7 @@ const handleFx = (val) => {
|
||||
.then(({ value }) => {
|
||||
loading.value = true
|
||||
completions(val).then(res => {
|
||||
console.log(res,"分析报告数据");
|
||||
// console.log(res,"分析报告数据");
|
||||
let jsonString
|
||||
let jsonMatch = res.choices[0].text.match(/\[[\s\S]*?\]/g);
|
||||
if (!jsonMatch) {
|
||||
|
@ -4,8 +4,8 @@ function resolve(dir) {
|
||||
return path.join(__dirname, dir);
|
||||
}
|
||||
|
||||
const serverHost = "http://192.168.1.32:8006"//波哥
|
||||
// const serverHost = "http://192.168.0.231:8006"//线上
|
||||
// const serverHost = "http://192.168.1.32:8006"//波哥
|
||||
const serverHost = "http://192.168.0.231:8006"//线上
|
||||
// const serverHost = "http://192.168.1.117:8006"//周
|
||||
// const serverHost = "http://192.168.1.98:8006"//毛毛
|
||||
|
||||
|
Reference in New Issue
Block a user