Browse Source

fix: 修复单位问题库、个人问题库的数据统计错误

master
wxc 1 week ago
parent
commit
db41bd48ab
  1. 14
      public/js/pnxclient.js
  2. 5
      src/api/sensitivePerception/profilePolice.ts
  3. 6
      src/components/negativeInfo/depart-dialog.vue
  4. 4
      src/components/negativeInfo/police-dialog.vue
  5. 39
      src/views/datav/Lmgz.vue
  6. 39
      src/views/sensitivePerception/DepartNegative.vue
  7. 17
      src/views/sensitivePerception/PoliceNegative.vue
  8. 2
      vite.config.ts

14
public/js/pnxclient.js

@ -64,15 +64,9 @@ var JIT_GW_ExtInterface = function(){
// 是否使用NPPlugin // 是否使用NPPlugin
var isUseNPPlugin = function() var isUseNPPlugin = function()
{ {
checkSessionWSURL(); // 仅检测已安装插件,避免首页加载时同步请求本地证书服务。
if ("{\"value\":\"\"}" == currentSessionWSURL) var plugin = navigator.mimeTypes && navigator.mimeTypes["application/x-jit-auth-plugin"];
{ useNPPlugin = !!(plugin && plugin.enabledPlugin);
useNPPlugin = true;
}
else
{
useNPPlugin = false;
}
} }
var addActioveX = function(){ var addActioveX = function(){
@ -870,4 +864,4 @@ var JIT_GW_ExtInterface = function(){
(function(){ (function(){
JIT_GW_ExtInterface.Init(); JIT_GW_ExtInterface.Init();
})(); })();

5
src/api/sensitivePerception/profilePolice.ts

@ -21,8 +21,9 @@ export function listNegativeByPoliceIdCode(idCode, query) {
}); });
} }
export function listNegativeMonthly(idCode) { export function listNegativeMonthly(idCode, query = {}) {
return request.get({ return request.get({
url: `/profile/police/${idCode}/month` url: `/profile/police/${idCode}/month`,
query
}); });
} }

6
src/components/negativeInfo/depart-dialog.vue

@ -60,14 +60,14 @@
</div> </div>
</section> </section>
<section class="profile-panel"> <section class="profile-panel">
<h5>投诉问题</h5> <h5>信访投诉</h5>
<div class="complaint-summary"> <div class="complaint-summary">
<svg class="complaint-icon" viewBox="0 0 48 48" fill="none" aria-hidden="true"> <svg class="complaint-icon" viewBox="0 0 48 48" fill="none" aria-hidden="true">
<path d="M10 8h28a4 4 0 0 1 4 4v20a4 4 0 0 1-4 4H23L12 44v-8h-2a4 4 0 0 1-4-4V12a4 4 0 0 1 4-4Z" stroke="currentColor" stroke-width="2.5" stroke-linejoin="round" /> <path d="M10 8h28a4 4 0 0 1 4 4v20a4 4 0 0 1-4 4H23L12 44v-8h-2a4 4 0 0 1-4-4V12a4 4 0 0 1 4-4Z" stroke="currentColor" stroke-width="2.5" stroke-linejoin="round" />
<circle cx="16" cy="22" r="2" fill="currentColor" /><circle cx="24" cy="22" r="2" fill="currentColor" /><circle cx="32" cy="22" r="2" fill="currentColor" /> <circle cx="16" cy="22" r="2" fill="currentColor" /><circle cx="24" cy="22" r="2" fill="currentColor" /><circle cx="32" cy="22" r="2" fill="currentColor" />
</svg> </svg>
<strong>{{ complaintCount }}</strong> <strong>{{ complaintCount }}</strong>
<span>投诉数量(件)</span> <span>信访投诉数(件)</span>
</div> </div>
</section> </section>
</div> </div>
@ -165,7 +165,7 @@ const time = ref([
]); ]);
const colors = [{ color: "#5B8FF9", percentage: 0 }]; const colors = [{ color: "#5B8FF9", percentage: 0 }];
// TODO: 投诉数量暂用假数据,后续替换为接口返回值。 // TODO: 信访投诉数暂用假数据,后续替换为接口返回值。
const complaintCount = ref(6); const complaintCount = ref(6);
const loading = ref(false); const loading = ref(false);

4
src/components/negativeInfo/police-dialog.vue

@ -130,6 +130,7 @@ const props = defineProps({
idCode: String, idCode: String,
activeRow: { type: Object, default: () => ({}) }, activeRow: { type: Object, default: () => ({}) },
initialTime: { type: Array, default: () => [] }, initialTime: { type: Array, default: () => [] },
profileScope: { type: Object, default: () => ({}) },
}); });
const emit = defineEmits(["update:modelValue"]); const emit = defineEmits(["update:modelValue"]);
@ -188,7 +189,7 @@ watch(
moment().format("YYYY-MM-DD HH:mm:ss"), moment().format("YYYY-MM-DD HH:mm:ss"),
]; ];
getProfileData(); getProfileData();
listNegativeMonthly(idCode).then((data) => { listNegativeMonthly(idCode, props.profileScope).then((data) => {
barOption.value.xAxis.data = data.months; barOption.value.xAxis.data = data.months;
barOption.value.series[0].data = data.values; barOption.value.series[0].data = data.values;
}); });
@ -200,6 +201,7 @@ async function getProfileData() {
loading.value = true; loading.value = true;
try { try {
const data = await getPoliceProfile(props.idCode, { const data = await getPoliceProfile(props.idCode, {
...props.profileScope,
beginTime: time.value.length ? time.value[0] : "", beginTime: time.value.length ? time.value[0] : "",
endTime: time.value.length ? time.value[1] : "", endTime: time.value.length ? time.value[1] : "",
}); });

39
src/views/datav/Lmgz.vue

@ -308,6 +308,7 @@
<negativeInfo-police-dialog <negativeInfo-police-dialog
v-model="policeDetailOpen" v-model="policeDetailOpen"
:id-code="detailId" :id-code="detailId"
:profile-scope="profileScope"
:initial-time="detailTime" :initial-time="detailTime"
/> />
</div> </div>
@ -359,11 +360,13 @@ const departDetailOpen = ref(false);
const policeDetailOpen = ref(false); const policeDetailOpen = ref(false);
const detailId = ref(""); const detailId = ref("");
const detailTime = ref([]); const detailTime = ref([]);
const profileScope = ref({});
function openDetail(item, type) { function openDetail(item, type) {
if (!item.detailId) return; if (!item.detailId) return;
detailId.value = item.detailId; detailId.value = item.detailId;
detailTime.value = [ profileScope.value = item.profileScope || {};
detailTime.value = item.initialTime || [
moment(time.value[0]).startOf("day").format("YYYY-MM-DD HH:mm:ss"), moment(time.value[0]).startOf("day").format("YYYY-MM-DD HH:mm:ss"),
moment(time.value[1]).endOf("day").format("YYYY-MM-DD HH:mm:ss"), moment(time.value[1]).endOf("day").format("YYYY-MM-DD HH:mm:ss"),
]; ];
@ -423,33 +426,47 @@ function getData3() {
}); });
} }
function withProfileScope(data, query, category) {
return data.map(item => ({
...item,
profileScope: { groupId: query.groupId, category, rankName: item.label, rankEmpNo: item.empNo },
initialTime: [
moment(query.beginTime).startOf('day').format('YYYY-MM-DD HH:mm:ss'),
moment(query.endTime).endOf('day').format('YYYY-MM-DD HH:mm:ss'),
],
}));
}
function getData4() { function getData4() {
leadNegative({ const query = {
beginTime: time.value[0], beginTime: time.value[0],
endTime: time.value[1], endTime: time.value[1],
groupId: groupId4.value groupId: groupId4.value
}).then(data => { };
list4.value = data leadNegative(query).then(data => {
list4.value = withProfileScope(data, query, 'lead');
}); });
} }
function getData5() { function getData5() {
policeNegative({ const query = {
beginTime: time.value[0], beginTime: time.value[0],
endTime: time.value[1], endTime: time.value[1],
groupId: groupId5.value groupId: groupId5.value
}).then(data => { };
list5.value = data policeNegative(query).then(data => {
list5.value = withProfileScope(data, query, 'police');
}); });
} }
function getData6() { function getData6() {
auxNegative({ const query = {
beginTime: time.value[0], beginTime: time.value[0],
endTime: time.value[1], endTime: time.value[1],
groupId: groupId6.value groupId: groupId6.value
}).then(data => { };
list6.value = data auxNegative(query).then(data => {
list6.value = withProfileScope(data, query, 'aux');
}); });
} }
@ -474,7 +491,7 @@ watch(groupId2, () => {
}) })
watch(type2, () => { watch(type2, () => {
getData1() getData2()
}) })
watch(groupId3, () => { watch(groupId3, () => {

39
src/views/sensitivePerception/DepartNegative.vue

@ -45,7 +45,8 @@
<el-form-item label="单位"> <el-form-item label="单位">
<depart-tree-select <depart-tree-select
v-model="query.departId" v-model="query.departId"
:check-strictly="false" :check-strictly="true"
:props="{ label: 'shortName', value: 'id', disabled: (data) => data.level < 2 }"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -72,7 +73,7 @@
</div> </div>
</header> </header>
<div class="table-container" v-loading="mainLoading"> <div class="table-container" v-loading="mainLoading">
<el-table :data="list"> <el-table :data="list" @sort-change="handleSortChange">
<el-table-column label="单位名称"> <el-table-column label="单位名称">
<template #default="{ row }"> <template #default="{ row }">
<span <span
@ -85,6 +86,7 @@
<el-table-column <el-table-column
label="民警人数" label="民警人数"
prop="policeSize" prop="policeSize"
sortable="custom"
align="center" align="center"
width="160" width="160"
/> />
@ -95,22 +97,19 @@
width="160" width="160"
/> />
<el-table-column <el-table-column
label="查实问题涉及人数" label="问题涉及人数"
prop="verifyPoliceSize" prop="verifyPoliceSize"
sortable="custom"
align="center" align="center"
width="160" width="160"
/> />
<el-table-column <el-table-column
label="查实问题数" label="涉及问题数"
prop="verifySize" prop="verifySize"
sortable="custom"
align="center" align="center"
width="160" width="160"
/> />
<el-table-column label="累计分值" align="center" width="160">
<template #default="{ row }">
<span>{{ Math.round(row.score) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="240"> <el-table-column label="操作" width="240">
<template #default="{ row }"> <template #default="{ row }">
<el-button <el-button
@ -144,7 +143,7 @@
</div> </div>
</div> </div>
<negativeInfo-depart-dialog v-model="show" :departId="activeRow.departId" /> <negativeInfo-depart-dialog v-model="show" :departId="activeRow.departId" :initial-time="listTime" />
<alarm-dialog <alarm-dialog
v-model="showNotification" v-model="showNotification"
@ -168,18 +167,30 @@ const query = ref({
size: 10, size: 10,
departLevel: "3", departLevel: "3",
crtTime: [ crtTime: [
// moment().startOf('year').format("YYYY-MM-DD HH:mm:ss"), moment().startOf('year').format("YYYY-MM-DD HH:mm:ss"),
// moment().format("YYYY-MM-DD HH:mm:ss"), moment().endOf('day').format("YYYY-MM-DD HH:mm:ss"),
], ],
}); });
const list = ref<any[]>([]); const list = ref<any[]>([]);
const total = ref(0); const total = ref(0);
const sort = ref({ sortField: '', sortOrder: '' });
function handleSortChange({ prop, order }) {
sort.value = { sortField: order ? prop : '', sortOrder: order || '' };
query.value.current = 1;
getList();
}
const mainLoading = ref(false); const mainLoading = ref(false);
const listTime = ref<string[]>([]);
function getList() { function getList() {
mainLoading.value = true; mainLoading.value = true;
listDepartNegative(query.value).then((data) => { const crtTime = query.value.crtTime?.length === 2
? [...query.value.crtTime]
: ["1949-01-01 00:00:00", moment().endOf('day').format("YYYY-MM-DD HH:mm:ss")];
listDepartNegative({ ...query.value, ...sort.value, crtTime }).then((data) => {
listTime.value = crtTime;
list.value = data.records; list.value = data.records;
total.value = data.total; total.value = data.total;
mainLoading.value = false; mainLoading.value = false;
@ -193,7 +204,7 @@ function reset() {
departLevel: "3", departLevel: "3",
crtTime: [ crtTime: [
moment().startOf('year').format("YYYY-MM-DD HH:mm:ss"), moment().startOf('year').format("YYYY-MM-DD HH:mm:ss"),
moment().format("YYYY-MM-DD HH:mm:ss"), moment().endOf('day').format("YYYY-MM-DD HH:mm:ss"),
], ],
}; };
getList(); getList();

17
src/views/sensitivePerception/PoliceNegative.vue

@ -51,7 +51,7 @@
</div> </div>
</header> </header>
<div class="table-container" v-loading="mainLoading"> <div class="table-container" v-loading="mainLoading">
<el-table :data="list"> <el-table :data="list" @sort-change="handleSortChange">
<el-table-column label="姓名" prop="name" width="120" /> <el-table-column label="姓名" prop="name" width="120" />
<el-table-column label="性别" width="100" align="center"> <el-table-column label="性别" width="100" align="center">
<template #default="{ row }"> <template #default="{ row }">
@ -78,15 +78,11 @@
<el-table-column <el-table-column
label="查实问题数" label="查实问题数"
prop="verifySize" prop="verifySize"
sortable="custom"
width="120" width="120"
align="center" align="center"
/> />
<el-table-column label="累计分值" align="center" width="160">
<template #default="{ row }">
<span>{{ Math.round(row.score) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="240"> <el-table-column label="操作" width="240">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="primary" link @click="handleShowProfile(row)" <el-button type="primary" link @click="handleShowProfile(row)"
@ -141,11 +137,18 @@ const query = ref({
}); });
const list = ref<any[]>([]); const list = ref<any[]>([]);
const total = ref(0); const total = ref(0);
const sortOrder = ref('');
function handleSortChange({ order }: { order: string | null }) {
sortOrder.value = order || '';
query.value.current = 1;
getList();
}
const mainLoading = ref(false); const mainLoading = ref(false);
function getList() { function getList() {
mainLoading.value = true; mainLoading.value = true;
listPoliceNegative(query.value).then((data) => { listPoliceNegative({ ...query.value, sortOrder: sortOrder.value }).then((data) => {
list.value = data.records; list.value = data.records;
total.value = data.total; total.value = data.total;
mainLoading.value = false; mainLoading.value = false;

2
vite.config.ts

@ -21,7 +21,7 @@ export default ({ mode }) => {
'process.env': env 'process.env': env
}, },
server: { server: {
host: '0.0.0.0', host: '::',
port: 5172, port: 5172,
proxy: { proxy: {
'/api/v2/': { '/api/v2/': {

Loading…
Cancel
Save