master
loveflow 11 months ago
parent 5d17a45beb
commit 48a926702c

@ -16,6 +16,6 @@ window.$SYSTEMCONFIG = {
};
window.$SERVICE = {
BASEURL:"http://1.94.45.26:10004/zhapi"
BASEURL:"http://121.41.91.94:8080/zhapi"
//BASEURL: "http://1.94.45.26:10006/zhapi", //后端服务地址
};

@ -47,3 +47,19 @@ export function CompanySum(params) {
params,
});
}
//企业详情风险整改信息
export function RectificationInformation(params) {
return request({
url: "/tbRectificationOfAProblem/RectificationInformation",
method: "post",
params,
});
}
//企业详情分数类型
export function CompanyDetails(params) {
return request({
url: "/tbRectificationOfAProblem/CompanyDetails",
method: "post",
params,
});
}

@ -88,11 +88,11 @@ export function TaskTemplateList(params) {
});
}
//处置方式管理-删除
export function DispositionRemove(params) {
export function DispositionRemove(data) {
return request({
url: "/tbRulesSetting/DispositionRemove",
method: "post",
params,
data,
});
}
//处置方式管理-任务单新增

@ -28,6 +28,16 @@ export function groupByReduce(arr, property, perty) {
return acc;
}, {});
}
//归类-求和
export function groupSum(list, property, perty) {
return list.reduce((acc, item) => {
if (!acc[item[property]]) {
acc[item[property]] = 0;
}
acc[item[property]] += item[perty];
return acc;
}, {});
}
//list根据属性去重
export function uniqueByProperty(arr, prop) {

@ -47,9 +47,9 @@ export default {
this.option = {
grid: {
left: "14",
left: "5%",
top: "5%", //
right: "0",
right: "5%",
bottom: "0",
},
xAxis: {

@ -7,11 +7,8 @@
let bgImg = require("@/assets/images/team/gauge.png");
export default {
props: {
chartObj: {
type: Object,
default: () => {
return {};
},
riskScore: {
type: [Number, String],
},
},
data() {
@ -24,28 +21,6 @@ export default {
},
methods: {
setOption() {
let dataList = this.chartObj.data;
let maxArr = [];
let maxValue = 0;
let xData = [];
let yData = [];
let total = 0;
dataList.forEach((item) => {
xData.push(item.name);
yData.push(item.value);
if (maxValue < item.value) {
maxValue = item.value;
}
});
dataList.forEach((item) => {
maxArr.push(maxValue);
total = total + item.value;
});
if (!total) {
total = 1;
}
this.option = {
tooltip: {
trigger: "item",
@ -75,7 +50,7 @@ export default {
type: "bar",
data: [
{
value: 80,
value: parseInt(this.riskScore),
itemStyle: {
//color: "rgba(35, 176, 176, 1)",
shadowColor: "rgba(35, 176, 176, 0.5)",
@ -180,7 +155,7 @@ export default {
},
data: [
{
value: 80,
value: parseInt(this.riskScore),
name: "",
},
],
@ -266,7 +241,7 @@ export default {
},
},
watch: {
chartObj: {
riskScore: {
handler(newval) {
this.setOption();
},

@ -96,12 +96,12 @@
</div>
<div class="zgBody zgGaugeBody" v-if="chartType == 'gauge'">
<div class="topWrap">
<div class="label">民爆</div>
<div class="label">易制毒</div>
<div class="label">重点消防单位</div>
<div class="label" v-for="item in companyTypes" :key="item">
{{ item }}
</div>
</div>
<div class="midWrap canvasDefault">
<gaugeWrap :chartObj="qyObj"></gaugeWrap>
<gaugeWrap :riskScore="riskScore"></gaugeWrap>
</div>
<div class="btmWrap">
<div class="tableWrap">
@ -147,8 +147,10 @@ import {
CompanySumList,
RectificationOverview,
CompanySum,
RectificationInformation,
CompanyDetails,
} from "@/api/enterpriseTeamWork/problemRectify/index.js";
import { groupByReduce } from "@/loveflow/util.js";
import { groupSum } from "@/loveflow/util.js";
export default {
components: { screenMain, barWrap, gaugeWrap, pieWrap, mapWrap },
mixins: [tableListMixins, commonMixins],
@ -175,12 +177,12 @@ export default {
},
{
// slot: "riskSlot",
prop: "abarbeitungStatus",
prop: "riskType",
label: "扣分项",
},
{
//slot: "ysSlot",
prop: "changeContent",
prop: "factorAnomalyDetail",
label: "要素异常信息",
},
],
@ -190,15 +192,17 @@ export default {
timeValue: "",
title: "各区域整改企业数量",
companyList: [],
url: {
list: "/tbRectificationOfAProblem/RectificationOfAProblemListDetails",
},
pieObj: {
total: 0,
color: ["#2B82F3", "#66C3FF", "#E4FEF0", "#FF745A", "#FEF699"],
data: [],
name: "总数",
},
url: {
list: "/tbRectificationOfAProblem/RectificationInformation",
},
riskScore: 0,
companyTypes: [],
};
},
mounted() {
@ -235,13 +239,17 @@ export default {
RectificationOverview().then((res) => {
if (res.code == 200) {
let data = res.data || [];
let temp = groupSum(data, "area", "count");
this.qyObj.data = [];
for (let i = 0; i < data.length; i++) {
Object.keys(temp).forEach((key) => {
this.qyObj.data.push({
name: data[i]["area"],
value: data[i]["count"],
name: key,
value: temp[key],
});
}
});
}
});
CompanySum().then((res) => {
@ -268,36 +276,27 @@ export default {
this.searchParam.endTime = year + "-" + month + "-" + day + " 23:59:59";
this.getOverList();
},
//
changeChart(val) {
this.getOverList();
},
areaChange(val) {
this.chartType = "pie";
OverviewList(this.searchParam).then((res) => {
RectificationOverview({ area: val }).then((res) => {
if (res.code == 200) {
let data = res.data || [];
/* let obj = groupByReduce(data, "companyId");
/* let obj = groupSum(data, "companyId");
console.log(this.companyList); */
this.pieObj.data = [];
this.pieObj.data.push(
{
name: "未按要求整改",
value: 2,
},
{
name: "整改中",
value: 12,
},
{
name: "按照要求整改",
value: 21,
},
{
name: "已整改",
value: 31,
}
);
this.pieObj.total = data.length;
let total = 0;
for (let i = 0; i < data.length; i++) {
this.pieObj.data.push({
name: data[i]["abarbeitung_status"],
value: data[i]["count"],
});
total += data[i]["count"];
}
this.pieObj.total = total;
}
});
},
@ -321,8 +320,19 @@ export default {
console.log(obj);
this.title = obj.companyName;
this.chartType = "gauge";
this.queryParam.companyName = obj.companyName;
this.searchQuery();
if (obj.companyId) {
this.queryParam.companyId = obj.companyId;
this.searchQuery();
CompanyDetails({ companyId: obj.companyId }).then((res) => {
if (res.code == 200) {
let data = res.data || {};
this.companyTypes = data.companyTypes;
this.riskScore = data.RiskScore;
}
});
}
},
mapClick(e) {
console.log(e);

@ -45,7 +45,7 @@ export default {
},
},
{
value: 4,
value: 2,
name: "",
itemStyle: {
normal: {

@ -372,11 +372,11 @@ export default {
label: "纳入监管次数",
},
{
prop: "total",
prop: "rectificationNoNum",
label: "连续未整改次数",
},
{
prop: "risk",
prop: "controlDeductionItem",
//slot: "riskSlot",
label: "未整改项",
},

@ -231,7 +231,13 @@ export default {
},
del() {
console.log(this.delArr);
DispositionRemove(this.delArr).then((res) => {
let list = [];
for (let i = 0; i < this.delArr.length; i++) {
list.push({
id: this.delArr[i],
});
}
DispositionRemove(list).then((res) => {
if (res.code == 200) {
this.$message({
message: "删除成功",

Loading…
Cancel
Save