Browse Source

11/25/17:15 民意感知交互1.2 (基本完成)

main
parent
commit
4a0b52829a
  1. 22
      src/api/screen/jwpy.ts
  2. 155
      src/views/datav/Jwpy.vue

22
src/api/screen/jwpy.ts

@ -19,7 +19,7 @@ export function GetBMYYBQS(PeriodId, OrgNo, TaskID) {
formData.append("PeriodSonID", -1);
formData.append("OrgNo", OrgNo);
formData.append("TaskID", TaskID);
return outrequest.post({
return outrequest.post({
url: `/out-police-service/api/DSJ/GetBMYYBQS`,
body: formData
});
@ -93,7 +93,6 @@ export function GetDITU(PeriodId) {
}
export function GetMyPeriod() {
let formData = new FormData();
return outrequest.post({
@ -103,7 +102,6 @@ export function GetMyPeriod() {
}
export function GetCustomOffLineSonPeriodSet() {
let formData = new FormData();
return outrequest.post({
@ -114,18 +112,28 @@ export function GetCustomOffLineSonPeriodSet() {
export function qx_get() {
let formData = new FormData();
formData.append("ticket", "920507&ticket=dcZcPz0WPEoQaOb14HmRETDQjFL8cKgYSW6OyR0mQcLt-eHJ7HSQn2WDxilMwCaXGOxS3LZx1p9Is1b7yOM7BVoU1o0IVRwDT1on2yQK8JU=");
return outrequest.post({
url: `/out-police-service/api/ShareSystem/qx_get`,
formData.append("ticket", "xzLVoLaYv90pNUviHmZsynIB68IuffQI2T6HO1fTgLJNiV75BHvbBR27CZZEUn5D52BsEGQv-4nxvmunuKLdqxhWcNFzQZgH-dhszHd5X3o=");
return fetch('/out-police-service/api/ShareSystem/qx_get', {
method: 'POST',
body: formData
}).then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.json();
}).then(data => {
// 这里假设返回的数据格式是[{xx:xx}],直接返回接收到的数据
return data;
});
}
export function GetOffLineStatisticsSetList(orgCode) {
let formData = new FormData();
formData.append("orgCode", orgCode);
formData.append("ticket", "920507&ticket=dcZcPz0WPEoQaOb14HmRETDQjFL8cKgYSW6OyR0mQcLt-eHJ7HSQn2WDxilMwCaXGOxS3LZx1p9Is1b7yOM7BVoU1o0IVRwDT1on2yQK8JU=");
return outrequest.post({
url: `/out-police-service/api/Business/GetOffLineStatisticsSetList`,
body: formData

155
src/views/datav/Jwpy.vue

@ -106,12 +106,12 @@
:row-style="tableRowStyle"
:show-summary='true'
>
<el-table-column prop="Name" label="单项业务" width="82px"/>
<el-table-column prop="sdcl" label="有效数" width="72px"/>
<el-table-column prop="BasicallySatisfiedNum" label="基本满意数" width="72px"/>
<el-table-column prop="sbmys" label="不满意数" width="72px"/>
<el-table-column prop="smyl" label="满意率" width="72px"/>
<el-table-column prop="smyltb" label="同比" width="86px">
<el-table-column prop="Name" label="单项业务" width="70px"/>
<el-table-column prop="sdcl" label="有效数" width="70px"/>
<el-table-column prop="BasicallySatisfiedNum" label="基本满意数" width="70px"/>
<el-table-column prop="sbmys" label="不满意数" width="70px"/>
<el-table-column prop="smyl" label="满意率" width="70px"/>
<el-table-column prop="smyltb" label="同比" width="70px">
<template v-slot="scope">
<span :style="getCellStyle(scope.row.smyltb)">{{ scope.row.smyltb }}</span>
</template>
@ -191,11 +191,11 @@
:show-summary='false'
:highlight-current-row='false'
>
<el-table-column prop="SetName" label="排名" width="75"/>
<el-table-column prop="OrganizeName" label="市州考评" width="149"/>
<el-table-column prop="FinalRP" label="滿意度" width="65"/>
<el-table-column prop="TBRp" label="上期满意度" width="65"/>
<el-table-column prop="TBRpts" label="同比上期" width="86px">
<el-table-column prop="SetName" label="排名" width="50"/>
<el-table-column prop="OrganizeName" label="市州考评" width="129"/>
<el-table-column prop="FinalRP" label="滿意度" width="50"/>
<el-table-column prop="TBRp" label="上期满意度" width="55"/>
<el-table-column prop="TBRpts" label="同比上期" width="56px">
<template v-slot="scope">
<span :style="getCellStyle(scope.row.TBRpts)">{{ scope.row.TBRpts }}</span>
</template>
@ -215,11 +215,11 @@
:row-style="tableRowStyleTableData2"
:show-summary='false'
>
<el-table-column prop="MydRanking" label="排名" width="75px"/>
<el-table-column prop="MydRanking" label="排名" width="55px"/>
<el-table-column prop="OrganizeName" label="县市考评"/>
<el-table-column prop="FinalRP" label="滿意度"/>
<el-table-column prop="TBRp" label="上期满意度"/>
<el-table-column prop="TBRpts" label="同比上期" width="86px">
<el-table-column prop="FinalRP" label="滿意度" width="66px"/>
<el-table-column prop="TBRp" label="上期满意度" width="66px"/>
<el-table-column prop="TBRpts" label="同比上期" width="66px">
<template v-slot="scope">
<span :style="getCellStyle(scope.row.TBRpts)">{{ scope.row.TBRpts }}</span>
</template>
@ -351,7 +351,6 @@ const selectOrg = ref()
watch(selectYear, (newYearID) => {
if (newYearID) {
const temp = years.value.filter(item => item.ID === selectYear.value)
console.log(temp)
if (temp.length > 0 && temp[0].PeriodName.includes("半")) {
months.value = tempMonths.value.filter(item => item.PeriodID === newYearID);
months.value.unshift({SonPeriodName: '半年度', ID: '-1'});
@ -359,7 +358,7 @@ watch(selectYear, (newYearID) => {
months.value = tempMonths.value.filter(item => item.PeriodID === newYearID);
months.value.unshift({SonPeriodName: '全年', ID: '-1'});
}
selectMonth.value = null; //
selectMonth.value = months.value[0].ID;
} else {
months.value = []; //
}
@ -372,32 +371,68 @@ const treeProps = {
children: 'children'
};
//
// region
const handleYearChange = (checkedYear) => {
console.log("年份" + selectYear.value + " 月份" + selectMonth.value + " 单位" + selectOrg.value + " task" + task.value )
console.log("年份" + selectYear.value + " 月份" + selectMonth.value + " 单位" + selectOrg.value + " task" + task.value)
getData();
}
const handleMonthChange = (checkenMonth) => {
console.log("年份" + selectYear.value + " 月份" + selectMonth.value + " 单位" + selectOrg.value + " task" + task.value )
console.log("年份" + selectYear.value + " 月份" + selectMonth.value + " 单位" + selectOrg.value + " task" + task.value)
getData();
}
const handleOrgChange = (checkedOrg) => {
console.log("年份" + selectYear.value + " 月份" + selectMonth.value + " 单位" + selectOrg.value + " task" + task.value )
getData();
//
const handleOrgChange = async (checkedOrg) => {
console.log("年份" + selectYear.value + " 月份" + selectMonth.value + " 单位" + selectOrg.value + " task" + task.value)
try {
// 使 await
const res = await GetOffLineStatisticsSetList(selectOrg.value);
console.log(res);
content.value = res;
console.log(content.value[0]);
console.log(content.value[0].ID);
task.value = content.value[0].ID;
} catch (error) {
console.error("Error fetching data:", error);
}
await getData();
};
const handleTaskChange = (checkedTask) =>{
console.log("年份" + selectYear.value + " 月份" + selectMonth.value + " 单位" + selectOrg.value + " task" + task.value )
//
const handleTaskChange = (checkedTask) => {
console.log("年份" + selectYear.value + " 月份" + selectMonth.value + " 单位" + selectOrg.value + " task" + task.value)
getData();
}
const mapDataList = ref([]);
//
const handleChartClick = async (params) => {
if (params.componentType === 'series') {
const clickedData = mapDataList.value.find(item => item.name.includes(params.name.substring(0, 2)));
console.log("地区:" + params.name + " id:" + clickedData.value + " 年:" + selectYear.value + " 月:" + selectMonth.value)
selectOrg.value = clickedData.value
try {
// 使 await
const res = await GetOffLineStatisticsSetList(clickedData.value);
console.log(res);
content.value = res;
console.log(content.value[0]);
console.log(content.value[0].ID);
task.value = content.value[0].ID;
} catch (error) {
console.error("Error fetching data:", error);
}
alert(`Clicked on ${params.name}, Value: ${clickedData ? clickedData.value : '无数据'}`);
}
await getData();
};
// endregion
const mapDataList = ref([]);
echarts.registerMap("changsha", changshaMap);
const option = ref({
geo: {
@ -651,8 +686,8 @@ onMounted(async () => {
PeriodName: item.PeriodName
}));
if (years.value.length > 0) {
console.log(years.value);
selectYear.value = years.value[0].ID; //
console.log("第一个年份" + selectYear.value)
}
//
@ -662,8 +697,17 @@ onMounted(async () => {
SonPeriodName: item.SonPeriodName,
PeriodID: item.PeriodID,
}));
if (tempMonths.value.length > 0) {
selectMonth.value = tempMonths.value[0].ID; //
const temp = years.value.filter(item => item.ID === selectYear.value)
if (temp.length > 0 && temp[0].PeriodName.includes("半")) {
months.value = tempMonths.value.filter(item => item.PeriodID === selectYear.value);
months.value.unshift({SonPeriodName: '半年度', ID: '-1'});
} else {
months.value = tempMonths.value.filter(item => item.PeriodID === selectYear.value);
months.value.unshift({SonPeriodName: '全年', ID: '-1'});
}
selectMonth.value = months.value[0].ID;
}
//
@ -671,9 +715,9 @@ onMounted(async () => {
org.value = resOrgs;
if (org.value.length > 0) {
selectOrg.value = org.value[0].id;
console.log(selectOrg.value);
}
//
const resTasks = await GetOffLineStatisticsSetList(selectOrg.value);
content.value = resTasks;
if (content.value.length > 0) {
@ -688,32 +732,30 @@ onMounted(async () => {
});
async function getData() {
function getData() {
//
GetDCQK(selectYear, selectMonth, selectOrg, task).then((res) => {
console.log("GetDCQK ==== " + res)
// taskID
GetDCQK(selectYear.value, selectMonth.value, selectOrg.value, task.value).then((res) => {
reviewOk.value = res
});
//
GetGLFW(selectYear, selectMonth, task).then((res) => {
GetGLFW(selectYear.value, selectOrg.value, task.value).then((res) => {
dcmyd.value = res
option1.value.xAxis.data = dcmyd.value[0].lstson.slice(-6).map(item => item.SonPeriodName);
option1.value.series[0].data = dcmyd.value[0].lstson.slice(-6).map(item => item.FinalRP);
});
//
GetZRSJXF(selectYear, selectMonth, selectOrg,task).then((res) => {
let temp = res.lstCity
//
GetZRSJXF(selectYear.value, selectMonth.value, selectOrg.value, task.value).then((res) => {
let temp = res.lstShen
temp = temp.filter(item => item.Name !== null);
tableData.value = temp
});
//
GetZHMYLPM(selectYear, selectMonth).then((res) => {
//
GetZHMYLPM(selectYear.value, selectMonth.value).then((res) => {
tableData1.value = res[0].lstCity
let temp = res[0].lstSheng;
const group2 = temp.filter(item => item.SetName === "(省)县市考评");
@ -722,18 +764,16 @@ function getData() {
tableData3.value = group3
});
//
GetBMYYBQS(selectYear, selectOrg, task).then((res) => {
console.log("GetBMYYBQS ==== " + res)
// ID id
GetBMYYBQS(selectYear.value, selectOrg.value, task.value).then((res) => {
bmyybqs.value = res;
option2.value.xAxis.data = bmyybqs.value.map(item => item.SonPeriodName);
option2.value.series[0].data = bmyybqs.value.map(item => item.QACount);
});
//
GetDXFX(selectYear, selectMonth, selectOrg, task).then((res) => {
console.log("GetDXFX ==== " + res)
//
GetDXFX(selectYear.value, selectMonth.value, selectOrg.value, task.value).then((res) => {
dxfx.value = res;
option3.value.xAxis.data = dxfx.value[0].lstson.map(item => item.MasterName);
option3.value.series[0].data = dxfx.value[0].lstson.map(item => item.FinalRP);
@ -742,14 +782,14 @@ function getData() {
});
//
GetRCSQQK(selectYear, selectMonth, selectOrg, task).then((res) => {
GetRCSQQK(selectYear.value, selectMonth.value, selectOrg.value, task.value).then((res) => {
let text = res
text = text.filter(item => item.Name !== null)
tableData4.value = text
});
// periodid
GetDITU(selectYear).then((res) => {
GetDITU(selectYear.value).then((res) => {
tempMap.value = res
mapDataList.value = tempMap.value.map(org => {
return {name: org.OrganizeName, value: org.OrganizeID};
@ -760,24 +800,13 @@ function getData() {
// endregion
//
const handleChartClick = (params) => {
if (params.componentType === 'series') {
const clickedData = mapDataList.value.find(item => item.name.includes(params.name.substring(0, 2)));
console.log("地区:" + params.name + " id:" + clickedData.value + " 年:" + selectYear.value + " 月:" + selectMonth.value)
GetOffLineStatisticsSetList(clickedData.value).then((res) => {
content.value = res
})
alert(`Clicked on ${params.name}, Value: ${clickedData ? clickedData.value : '无数据'}`);
}
getData();
};
// region
// endregion
// region
const fontSize = ref(11)
const headerCellStyle = ref({

Loading…
Cancel
Save