Merge branch 'main' of http://61.139.16.27:26684/zy_oyj/sgxt_web
This commit is contained in:
@ -196,7 +196,14 @@ export const publicRoutes = [
|
|||||||
title: "布控预警",
|
title: "布控预警",
|
||||||
icon: "article"
|
icon: "article"
|
||||||
}
|
}
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
|
path: "/fouColorWarning",
|
||||||
|
name: "fouColorWarning",
|
||||||
|
meta: { title: "四色预警", icon: "article" },
|
||||||
|
component: () => import("@/views/backOfficeSystem/fourColorManage/warningControl/fouColorWarning/index"),
|
||||||
|
},
|
||||||
|
{
|
||||||
path: "/behaviorWarnings",
|
path: "/behaviorWarnings",
|
||||||
name: "behaviorWarnings",
|
name: "behaviorWarnings",
|
||||||
meta: { title: "行为预警", icon: "article" },
|
meta: { title: "行为预警", icon: "article" },
|
||||||
@ -680,24 +687,44 @@ export const publicRoutes = [
|
|||||||
icon: "article"
|
icon: "article"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/tacticalResearch",
|
path: "/ResearchHome",
|
||||||
name: "tacticalResearch",
|
name: "ResearchHome",
|
||||||
component: () => import("@/views/backOfficeSystem/JudgmentHome/tacticalResearch/index.vue"),
|
component: () => import("@/views/backOfficeSystem/JudgmentHome/ResearchHome/index"),
|
||||||
meta: {
|
meta: {
|
||||||
title: "战术研判",
|
title: "战术研判",
|
||||||
icon: "article"
|
icon: "article"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/strategicResearch",
|
path: "/situationHome",
|
||||||
name: "strategicResearch",
|
name: "situationHome",
|
||||||
component: () => import("@/views/backOfficeSystem/JudgmentHome/strategicResearch/index.vue"),
|
component: () => import("@/views/backOfficeSystem/JudgmentHome/situationHome/index"),
|
||||||
meta: {
|
meta: {
|
||||||
title: "战略研判",
|
title: "战略研判",
|
||||||
icon: "article"
|
icon: "article"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 后面写的研判
|
||||||
|
// {
|
||||||
|
// path: "/tacticalResearch",
|
||||||
|
// name: "tacticalResearch",
|
||||||
|
// component: () => import("@/views/backOfficeSystem/JudgmentHome/tacticalResearch/index.vue"),
|
||||||
|
// meta: {
|
||||||
|
// title: "战术研判",
|
||||||
|
// icon: "article"
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// path: "/strategicResearch",
|
||||||
|
// name: "strategicResearch",
|
||||||
|
// component: () => import("@/views/backOfficeSystem/JudgmentHome/strategicResearch/index.vue"),
|
||||||
|
// meta: {
|
||||||
|
// title: "战略研判",
|
||||||
|
// icon: "article"
|
||||||
|
// }
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
path: "/judgmentCommand",
|
path: "/judgmentCommand",
|
||||||
name: "judgmentCommand",
|
name: "judgmentCommand",
|
||||||
@ -854,36 +881,19 @@ export const publicRoutes = [
|
|||||||
icon: "article"
|
icon: "article"
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
|
// {
|
||||||
|
// path: "/fouColorWarning",
|
||||||
|
// name: "fouColorWarning",
|
||||||
|
// meta: { title: "四色预警", icon: "article" },
|
||||||
|
// component: () => import("@/views/backOfficeSystem/fourColorManage/warningControl/fouColorWarning/index"),
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
path: "/fouColorWarning",
|
|
||||||
name: "fouColorWarning",
|
|
||||||
meta: { title: "四色预警", icon: "article" },
|
|
||||||
component: () => import("@/views/backOfficeSystem/fourColorManage/warningControl/fouColorWarning/index"),
|
|
||||||
}, {
|
|
||||||
path: "/CollectCrculate",
|
path: "/CollectCrculate",
|
||||||
name: "CollectCrculate",
|
name: "CollectCrculate",
|
||||||
component: () => import("@/views/backOfficeSystem/HumanIntelligence/CollectCrculate/index"),
|
component: () => import("@/views/backOfficeSystem/HumanIntelligence/CollectCrculate/index"),
|
||||||
meta: { title: "信息采集", icon: "article" },
|
meta: { title: "信息采集", icon: "article" },
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: "/ResearchHome",
|
|
||||||
name: "ResearchHome",
|
|
||||||
component: () => import("@/views/backOfficeSystem/JudgmentHome/ResearchHome/index"),
|
|
||||||
meta: {
|
|
||||||
title: "战术研判",
|
|
||||||
icon: "article"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
path: "/situationHome",
|
|
||||||
name: "situationHome",
|
|
||||||
component: () => import("@/views/backOfficeSystem/JudgmentHome/situationHome/index"),
|
|
||||||
meta: {
|
|
||||||
title: "战略研判",
|
|
||||||
icon: "article"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|||||||
@ -161,6 +161,25 @@ const initChart = () => {
|
|||||||
}
|
}
|
||||||
}, 100);
|
}, 100);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 暴露方法给父组件,用于获取图表图片数据
|
||||||
|
defineExpose({
|
||||||
|
getChartImage: () => {
|
||||||
|
if (myChart.value) {
|
||||||
|
return myChart.value.getDataURL({
|
||||||
|
type: 'png',
|
||||||
|
pixelRatio: 2,
|
||||||
|
backgroundColor: '#fff'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
resizeChart: () => {
|
||||||
|
if (myChart.value) {
|
||||||
|
myChart.value.resize();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@ -190,6 +190,25 @@ watch([
|
|||||||
], () => {
|
], () => {
|
||||||
initChart();
|
initChart();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 暴露方法给父组件,用于获取图表图片数据
|
||||||
|
defineExpose({
|
||||||
|
getChartImage: () => {
|
||||||
|
if (chartInstance.value) {
|
||||||
|
return chartInstance.value.getDataURL({
|
||||||
|
type: 'png',
|
||||||
|
pixelRatio: 2,
|
||||||
|
backgroundColor: '#fff'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
resizeChart: () => {
|
||||||
|
if (chartInstance.value) {
|
||||||
|
chartInstance.value.resize();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
:deep(div) {
|
:deep(div) {
|
||||||
|
|||||||
@ -111,7 +111,10 @@
|
|||||||
|
|
||||||
<h2>2.总结分析</h2>
|
<h2>2.总结分析</h2>
|
||||||
<p style="min-height: 100px;" v-loading="loading">{{ textContent }} </p>
|
<p style="min-height: 100px;" v-loading="loading">{{ textContent }} </p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<el-button style="position: fixed;bottom: 0;left: 45%;" type="primary" size="default"
|
||||||
|
@click="downloadWithStyles">下载</el-button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<AddForm ref="addForm" :dict="{ D_GS_XS_LX }" />
|
<AddForm ref="addForm" :dict="{ D_GS_XS_LX }" />
|
||||||
@ -125,6 +128,8 @@ import { getItem, setItem } from '@/utils/storage'
|
|||||||
import { fxbgDywdtj, getDictItem, fxbgJqlxtj, fxbgJqlytj, fxbgYdfx, fxbgXsfx, fxgbCljgf, fxgbCzlfx, fxbgTj } from '@/api/semanticAnalysis'
|
import { fxbgDywdtj, getDictItem, fxbgJqlxtj, fxbgJqlytj, fxbgYdfx, fxbgXsfx, fxgbCljgf, fxgbCzlfx, fxbgTj } from '@/api/semanticAnalysis'
|
||||||
import { completions } from '@/api/semanticAnalysis'
|
import { completions } from '@/api/semanticAnalysis'
|
||||||
import { reactive, ref, onMounted, getCurrentInstance, nextTick, computed, watch } from "vue";
|
import { reactive, ref, onMounted, getCurrentInstance, nextTick, computed, watch } from "vue";
|
||||||
|
import { downloadDocWithStyle } from '@/utils/export.js';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
// 数据
|
// 数据
|
||||||
search: {
|
search: {
|
||||||
@ -158,10 +163,15 @@ const tabHeight = ref(0)
|
|||||||
// 表格高度计算
|
// 表格高度计算
|
||||||
const tabHeightFn = () => {
|
const tabHeightFn = () => {
|
||||||
tabHeight.value = window.innerHeight - 300
|
tabHeight.value = window.innerHeight - 300
|
||||||
window.onresize = function () {
|
window.onresize = function() {
|
||||||
tabHeightFn();
|
tabHeightFn();
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
const downloadDocWithStyle = () => {
|
||||||
|
if (!tableBox.value?.innerHTML) return;
|
||||||
|
downloadDocWithStyle(tableBox.value?.innerHTML)
|
||||||
|
}
|
||||||
|
|
||||||
const pageData = reactive({
|
const pageData = reactive({
|
||||||
parameter: {},
|
parameter: {},
|
||||||
total: 0,
|
total: 0,
|
||||||
|
|||||||
@ -13,10 +13,9 @@
|
|||||||
<!-- 表格 -->
|
<!-- 表格 -->
|
||||||
<div class="tabBox">
|
<div class="tabBox">
|
||||||
<MyTable :tableData="pageData.tableData" :tableColumn="pageData.tableColumn" :tableHeight="pageData.tableHeight"
|
<MyTable :tableData="pageData.tableData" :tableColumn="pageData.tableColumn" :tableHeight="pageData.tableHeight"
|
||||||
:key="pageData.keyCount" :tableConfiger="pageData.tableConfiger" :controlsWidth="pageData.controlsWidth"
|
:key="pageData.keyCount" :tableConfiger="pageData.tableConfiger" :controlsWidth="pageData.controlsWidth">
|
||||||
>
|
|
||||||
<template #yjlx="{ row }">
|
<template #yjlx="{ row }">
|
||||||
<DictTag :tag="false" :value="row.yjlx" :options="dict.D_BZ_TPYJLX" />
|
<DictTag :tag="false" :value="row.yjlx" :options="dict.D_BZ_TPYJLX" />
|
||||||
</template>
|
</template>
|
||||||
<template #controls="{ row }">
|
<template #controls="{ row }">
|
||||||
<el-link type="primary" size="small" @click="opneModel(row)">打开研判报告</el-link>
|
<el-link type="primary" size="small" @click="opneModel(row)">打开研判报告</el-link>
|
||||||
@ -31,21 +30,21 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<YpModel v-model="showModel" @SaveReport="SaveReport" :heightNumber="436" v-model:textContent="textContent"></YpModel>
|
<YpModel v-model="showModel" @SaveReport="SaveReport" :heightNumber="436" v-model:textContent="textContent"></YpModel>
|
||||||
<Yjdict ref="yjdict" :dict="dict"/>
|
<Yjdict ref="yjdict" :dict="dict" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import YpModel from '@/components/ypModel/index.vue'
|
import YpModel from '@/components/ypModel/index.vue'
|
||||||
import emitter from "@/utils/eventBus.js";
|
import emitter from "@/utils/eventBus.js";
|
||||||
import { getYjxxPageList,getSsyjpzMxgzxl,mxglJqxqGetPageList } from "@/api/model";
|
import { getYjxxPageList, getSsyjpzMxgzxl, mxglJqxqGetPageList } from "@/api/model";
|
||||||
import PageTitle from "@/components/aboutTable/PageTitle.vue";
|
import PageTitle from "@/components/aboutTable/PageTitle.vue";
|
||||||
import MyTable from "@/components/aboutTable/MyTable.vue";
|
import MyTable from "@/components/aboutTable/MyTable.vue";
|
||||||
import Pages from "@/components/aboutTable/Pages.vue";
|
import Pages from "@/components/aboutTable/Pages.vue";
|
||||||
import Search from "@/components/aboutTable/Search.vue";
|
import Search from "@/components/aboutTable/Search.vue";
|
||||||
import { timeValidate } from '@/utils/tools'
|
import { timeValidate } from '@/utils/tools'
|
||||||
import { completions } from '@/api/semanticAnalysis'
|
import { completions } from '@/api/semanticAnalysis'
|
||||||
import { reactive, ref, onMounted, getCurrentInstance, watch } from "vue";
|
import { reactive, ref, onMounted, getCurrentInstance, watch } from "vue";
|
||||||
import { textStyle, Firstlevelheading, Subheading, BiheadlinegTitle, newTotitle,BigTitle,fbtool, headTitle, report, signature } from '../content.js'
|
import { textStyle, Firstlevelheading, Subheading, BiheadlinegTitle, newTotitle, BigTitle, fbtool, headTitle, report, signature } from '../content.js'
|
||||||
import Yjdict from './yjdict.vue'
|
import Yjdict from './yjdict.vue'
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
item: {
|
item: {
|
||||||
@ -59,45 +58,70 @@ const props = defineProps({
|
|||||||
const queryFrom = ref({})
|
const queryFrom = ref({})
|
||||||
const searchBox = ref(); //搜索框
|
const searchBox = ref(); //搜索框
|
||||||
const yjdict = ref(null)//详情弹窗
|
const yjdict = ref(null)//详情弹窗
|
||||||
const ItemData=ref()//模型数据
|
const ItemData = ref()//模型数据
|
||||||
const showModel = ref(false)
|
const showModel = ref(false)
|
||||||
const textContent=ref('')//报告数据
|
const textContent = ref('')//报告数据
|
||||||
const SaveReport = () => {
|
const SaveReport = () => {
|
||||||
}
|
}
|
||||||
|
/** 获取原始报备内容
|
||||||
|
* @param {Array} resArr 预警信息
|
||||||
|
* @param {Array} dictArr 预警类型
|
||||||
|
* @returns {String} 原始报备内容
|
||||||
|
*/
|
||||||
|
const getOriginStr = (resArr, dictArr) => {
|
||||||
|
/** 标题前文 */
|
||||||
|
const preStr = BigTitle("林芝市公安局情指中心") + BigTitle("研判专刊(初稿)") + newTotitle({
|
||||||
|
org: "市公安局情指中心编",
|
||||||
|
time: timeValidate()
|
||||||
|
}) + fbtool(`同类事件发生${resArr.length}次以上预警`)
|
||||||
|
/** 警情内容 */
|
||||||
|
let contentStr = resArr.map((item, index) => {
|
||||||
|
const lx = dictArr.find(items => {
|
||||||
|
return items.value == item.yjlx
|
||||||
|
}).zdmc
|
||||||
|
return Subheading(`${index + 1}.警情内容`) +
|
||||||
|
textStyle(`警情内容:${item.bjnr},报警人姓名:${item.bjrmc},报警地址:${item.bjdz},报警类型:${lx},报警时间:${item.bjsj}\n`)
|
||||||
|
}).join('')
|
||||||
|
const endStr = Subheading(`解决方案`) + textStyle('加载中。。。')
|
||||||
|
return preStr + contentStr + endStr
|
||||||
|
}
|
||||||
const opneModel = (row) => {
|
const opneModel = (row) => {
|
||||||
showModel.value = true
|
showModel.value = true
|
||||||
textContent.value = ''
|
textContent.value = ''
|
||||||
mxglJqxqGetPageList({
|
mxglJqxqGetPageList({
|
||||||
yjid: row.id,
|
yjid: row.id,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
|
res = Array.isArray(res) ? res : []
|
||||||
let str = {
|
let str = {
|
||||||
model: "deepseek-32b",
|
model: "deepseek-32b",
|
||||||
prompt: `# 角色定位\n你是一名资深警务人员,尤其擅长对警情、案件、线索等非结构化文本数据进行阅读理解,并从中提取各种对象特征信息进行结构化,并总结各种对象之间的关联关系。\n`,
|
prompt: `# 角色定位\n你是一名资深警务人员,尤其擅长对警情、案件、线索等非结构化文本数据进行阅读理解,并从中提取各种对象特征信息进行结构化,并总结各种对象之间的关联关系。\n`,
|
||||||
max_tokens: 1000,
|
max_tokens: 1000,
|
||||||
}
|
}
|
||||||
res.forEach(item => {
|
res.forEach(item => {
|
||||||
const lx = props.dict.D_BZ_JQLY.find(items => {
|
const lx = props.dict.D_BZ_JQLY.find(items => {
|
||||||
return items.value == item.yjlx
|
return items.value == item.yjlx
|
||||||
}).zdmc
|
}).zdmc
|
||||||
str.prompt+=`警情内容:${item.bjnr},报警人姓名:${item.bjrmc},报警地址:${item.bjdz},报警类型:${lx},报警时间:${item.bjsj}\n`
|
str.prompt += `警情内容:${item.bjnr},报警人姓名:${item.bjrmc},报警地址:${item.bjdz},报警类型:${lx},报警时间:${item.bjsj}\n`
|
||||||
})
|
})
|
||||||
str.prompt += `根据以上警情信息,总结出一个解决方案`
|
str.prompt += `根据以上警情信息,总结出一个解决方案`
|
||||||
|
textContent.value = getOriginStr(res, props.dict.D_BZ_JQLY)
|
||||||
let jsonMatch
|
let jsonMatch
|
||||||
completions(str).then(reslve => {
|
completions(str).then(reslve => {
|
||||||
jsonMatch = reslve.choices[0].text
|
jsonMatch = reslve.choices[0].text
|
||||||
|
textContent.value = '' // 重置为空
|
||||||
textContent.value += BigTitle("林芝市公安局情指中心") + BigTitle("研判专刊(初稿)") + newTotitle({
|
textContent.value += BigTitle("林芝市公安局情指中心") + BigTitle("研判专刊(初稿)") + newTotitle({
|
||||||
org: "市公安局情指中心编",
|
org: "市公安局情指中心编",
|
||||||
time: timeValidate()
|
time: timeValidate()
|
||||||
}) + fbtool(`同类事件发生${res.length}次以上预警`)
|
}) + fbtool(`同类事件发生${res.length}次以上预警`)
|
||||||
res.forEach((item,index) => {
|
res.forEach((item, index) => {
|
||||||
const lx = props.dict.D_BZ_JQLY.find((items) => {
|
const lx = props.dict.D_BZ_JQLY.find((items) => {
|
||||||
return items.value == item.yjlx
|
return items.value == item.yjlx
|
||||||
}).zdmc
|
}).zdmc
|
||||||
textContent.value += Subheading(`${index + 1}.警情内容`) +
|
textContent.value += Subheading(`${index + 1}.警情内容`) +
|
||||||
// textStyle(`预警名称:${item.yjBt},预警人员姓名:${item.yjRyxm},身份证号:${item.yjRysfzh},车牌号:${item.yjClcph},预警地址:${item.yjDz},预警类型:${lx},预警内容:${item.yjnr},预警时间:${item.yjsj}\n`)
|
// textStyle(`预警名称:${item.yjBt},预警人员姓名:${item.yjRyxm},身份证号:${item.yjRysfzh},车牌号:${item.yjClcph},预警地址:${item.yjDz},预警类型:${lx},预警内容:${item.yjnr},预警时间:${item.yjsj}\n`)
|
||||||
textStyle(`警情内容:${item.bjnr},报警人姓名:${item.bjrmc},报警地址:${item.bjdz},报警类型:${lx},报警时间:${item.bjsj}\n`)
|
textStyle(`警情内容:${item.bjnr},报警人姓名:${item.bjrmc},报警地址:${item.bjdz},报警类型:${lx},报警时间:${item.bjsj}\n`)
|
||||||
})
|
})
|
||||||
textContent.value+=Subheading(`解决方案`)+textStyle(jsonMatch?jsonMatch:'暂无解决方案')
|
textContent.value += Subheading(`解决方案`) + textStyle(jsonMatch ? jsonMatch : '暂无解决方案')
|
||||||
})
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
@ -127,8 +151,8 @@ const pageData = reactive({
|
|||||||
controlsWidth: 300,
|
controlsWidth: 300,
|
||||||
tableColumn: [
|
tableColumn: [
|
||||||
{ label: "预警时间", prop: "yjsj", showOverflowTooltip: true },
|
{ label: "预警时间", prop: "yjsj", showOverflowTooltip: true },
|
||||||
{ label: "类型", prop: "yjlx" ,showSolt:true },
|
{ label: "类型", prop: "yjlx", showSolt: true },
|
||||||
{ label: "内容", prop: "yjnr", showOverflowTooltip: true},
|
{ label: "内容", prop: "yjnr", showOverflowTooltip: true },
|
||||||
// ypbg
|
// ypbg
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
@ -141,15 +165,15 @@ const openYjdict = (val) => {
|
|||||||
yjdict.value.init(val)
|
yjdict.value.init(val)
|
||||||
}
|
}
|
||||||
watch(() => props.item, (val) => {
|
watch(() => props.item, (val) => {
|
||||||
ItemData.value=val
|
ItemData.value = val
|
||||||
},{deep:true})
|
}, { deep: true })
|
||||||
|
|
||||||
// 获取列表
|
// 获取列表
|
||||||
const getList = () => {
|
const getList = () => {
|
||||||
const promes = {
|
const promes = {
|
||||||
...pageData.pageConfiger,
|
...pageData.pageConfiger,
|
||||||
...queryFrom.value,
|
...queryFrom.value,
|
||||||
mxid:props.item.id,
|
mxid: props.item.id,
|
||||||
}
|
}
|
||||||
getYjxxPageList(promes).then((res) => {
|
getYjxxPageList(promes).then((res) => {
|
||||||
pageData.tableData = res.records
|
pageData.tableData = res.records
|
||||||
@ -158,8 +182,8 @@ const getList = () => {
|
|||||||
};
|
};
|
||||||
// 搜索
|
// 搜索
|
||||||
const onSearch = (val) => {
|
const onSearch = (val) => {
|
||||||
queryFrom.value.startTime = val.startTime&&val.startTime.length > 0 ? val.startTime[0] : '';
|
queryFrom.value.startTime = val.startTime && val.startTime.length > 0 ? val.startTime[0] : '';
|
||||||
queryFrom.value.endTime = val.startTime&&val.startTime.length > 0 ? val.startTime[1] : '';
|
queryFrom.value.endTime = val.startTime && val.startTime.length > 0 ? val.startTime[1] : '';
|
||||||
pageData.pageConfiger.pageCurrent = 1;
|
pageData.pageConfiger.pageCurrent = 1;
|
||||||
getList();
|
getList();
|
||||||
};
|
};
|
||||||
@ -180,7 +204,7 @@ const retenHome = () => {
|
|||||||
// 表格高度计算
|
// 表格高度计算
|
||||||
const tabHeightFn = () => {
|
const tabHeightFn = () => {
|
||||||
pageData.tableHeight = window.innerHeight - searchBox.value.offsetHeight - 250;
|
pageData.tableHeight = window.innerHeight - searchBox.value.offsetHeight - 250;
|
||||||
window.onresize = function () {
|
window.onresize = function() {
|
||||||
tabHeightFn();
|
tabHeightFn();
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -188,7 +212,7 @@ const tabHeightFn = () => {
|
|||||||
const yzSsyjpzMxgzxl = (params) => {
|
const yzSsyjpzMxgzxl = (params) => {
|
||||||
// getYjgzpzMxgzxl({id:'26aefb9f4c7c41b3a4bfb5b68449328b'}).then((res) => {
|
// getYjgzpzMxgzxl({id:'26aefb9f4c7c41b3a4bfb5b68449328b'}).then((res) => {
|
||||||
// })
|
// })
|
||||||
getSsyjpzMxgzxl({id:'88c166e670da48e59324906648794b05'}).then((res) => {
|
getSsyjpzMxgzxl({ id: '88c166e670da48e59324906648794b05' }).then((res) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const warningDetails = (row) => {
|
const warningDetails = (row) => {
|
||||||
|
|||||||
@ -45,6 +45,7 @@ const initCharts = (data) => {
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
data.forEach(item => {
|
data.forEach(item => {
|
||||||
|
item.count = isNaN(Number(item?.count) || 0) ? 0 : item.count;
|
||||||
if (item.yj_jb == '10') countData[0].value = item.count;
|
if (item.yj_jb == '10') countData[0].value = item.count;
|
||||||
if (item.yj_jb == '20') countData[1].value = item.count;
|
if (item.yj_jb == '20') countData[1].value = item.count;
|
||||||
if (item.yj_jb == '30') countData[2].value = item.count;
|
if (item.yj_jb == '30') countData[2].value = item.count;
|
||||||
@ -94,12 +95,16 @@ const createChartOption = (data, colors) => {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
formatter: (name) => {
|
formatter: (name) => {
|
||||||
const item = data.find(d => d.name === name);
|
const item = data.find(d => d.name === name);
|
||||||
let percentage = ((item.value / total) * 100).toFixed(2);
|
// 确保value是有效数字,total不为0
|
||||||
return `${name} ${item.value} {${item.colorType}|(${percentage}%)}`
|
const value = Number(item.value) || 0;
|
||||||
|
const totalValue = Number(total) || 0;
|
||||||
|
let percentage = (totalValue > 0 && value > 0) ? ((value / totalValue) * 100).toFixed(2) : '0.00';
|
||||||
|
// let percentage = ((item.value / total) * 100).toFixed(2);
|
||||||
|
return `${name} ${item.value} {${item.colorType}|(${percentage}%)}`
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user