修改大屏问题
parent
b3ddd1ae17
commit
9db50321d6
|
@ -1,5 +1,5 @@
|
||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
import dayjs from 'dayjs'
|
import dayjs from "dayjs";
|
||||||
const groupByAll = (data) => {
|
const groupByAll = (data) => {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
return request({
|
return request({
|
||||||
|
@ -7,35 +7,35 @@ const groupByAll = (data) => {
|
||||||
method: "get",
|
method: "get",
|
||||||
params: data,
|
params: data,
|
||||||
}).then((d) => {
|
}).then((d) => {
|
||||||
let tmps=(d.data||[]).map(it=>{
|
let tmps = (d.data || []).map((it) => {
|
||||||
it.sumEmissionReduction=(it.sumEstimateValue||0)-(it.sumPracticalValue||0);
|
it.sumEmissionReduction = (it.sumEstimateValue || 0) - (it.sumPracticalValue || 0);
|
||||||
it.emissionReduction=(it.estimateValue||0)-(it.practicalValue||0);
|
it.emissionReduction = (it.estimateValue || 0) - (it.practicalValue || 0);
|
||||||
return it;
|
return it;
|
||||||
})
|
});
|
||||||
let sumEmissionReduction=0;
|
let sumEmissionReduction = 0;
|
||||||
let sumEstimateValue=0;
|
let sumEstimateValue = 0;
|
||||||
let sumPracticalValue=0;
|
let sumPracticalValue = 0;
|
||||||
let emissionReduction=0;
|
let emissionReduction = 0;
|
||||||
let estimateValue=0;
|
let estimateValue = 0;
|
||||||
let practicalValue=0;
|
let practicalValue = 0;
|
||||||
tmps.forEach(it=>{
|
tmps.forEach((it) => {
|
||||||
sumEmissionReduction+=(it.sumEmissionReduction||0);
|
sumEmissionReduction += it.sumEmissionReduction || 0;
|
||||||
sumEstimateValue+=(it.sumEstimateValue||0);
|
sumEstimateValue += it.sumEstimateValue || 0;
|
||||||
sumPracticalValue+=(it.sumPracticalValue||0);
|
sumPracticalValue += it.sumPracticalValue || 0;
|
||||||
emissionReduction+=(it.emissionReduction||0);
|
emissionReduction += it.emissionReduction || 0;
|
||||||
estimateValue+=(it.estimateValue||0);
|
estimateValue += it.estimateValue || 0;
|
||||||
practicalValue+=(it.practicalValue||0);
|
practicalValue += it.practicalValue || 0;
|
||||||
});
|
});
|
||||||
tmps.push({
|
tmps.push({
|
||||||
factorType:0,
|
factorType: 0,
|
||||||
sumEmissionReduction:sumEmissionReduction,
|
sumEmissionReduction: sumEmissionReduction,
|
||||||
sumEstimateValue:sumEstimateValue,
|
sumEstimateValue: sumEstimateValue,
|
||||||
sumPracticalValue:sumPracticalValue,
|
sumPracticalValue: sumPracticalValue,
|
||||||
emissionReduction:emissionReduction,
|
emissionReduction: emissionReduction,
|
||||||
estimateValue:estimateValue,
|
estimateValue: estimateValue,
|
||||||
practicalValue:practicalValue
|
practicalValue: practicalValue,
|
||||||
})
|
});
|
||||||
resolve(tmps)
|
resolve(tmps);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -46,58 +46,60 @@ const groupCurrentMonth = (data) => {
|
||||||
url: "/manage/greenCarbonData/groupCurrentMonth",
|
url: "/manage/greenCarbonData/groupCurrentMonth",
|
||||||
method: "get",
|
method: "get",
|
||||||
params: data,
|
params: data,
|
||||||
}).then(d=>{
|
}).then((d) => {
|
||||||
let tmps=(d.data||[]).map(it=>{
|
let tmps = (d.data || []).map((it) => {
|
||||||
it.emissionReduction=(it.estimateValue||0)-(it.practicalValue||0);
|
it.emissionReduction = (it.estimateValue || 0) - (it.practicalValue || 0);
|
||||||
return it;
|
return it;
|
||||||
})
|
});
|
||||||
let emissionReduction=0;
|
let emissionReduction = 0;
|
||||||
let estimateValue=0;
|
let estimateValue = 0;
|
||||||
let practicalValue=0;
|
let practicalValue = 0;
|
||||||
tmps.forEach(it=>{
|
tmps.forEach((it) => {
|
||||||
emissionReduction+=(it.emissionReduction||0);
|
emissionReduction += it.emissionReduction || 0;
|
||||||
estimateValue+=(it.estimateValue||0);
|
estimateValue += it.estimateValue || 0;
|
||||||
practicalValue+=(it.practicalValue||0);
|
practicalValue += it.practicalValue || 0;
|
||||||
});
|
});
|
||||||
tmps.push({
|
tmps.push({
|
||||||
factorType:0,
|
factorType: 0,
|
||||||
emissionReduction:emissionReduction,
|
emissionReduction: emissionReduction,
|
||||||
estimateValue:estimateValue,
|
estimateValue: estimateValue,
|
||||||
practicalValue:practicalValue
|
practicalValue: practicalValue,
|
||||||
})
|
});
|
||||||
resolve(tmps)
|
resolve(tmps);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const getGroupData=(tmps,data,factorType,dataType)=>{
|
const getGroupData = (tmps, data, factorType, dataType) => {
|
||||||
let titles=[];
|
let titles = [];
|
||||||
let res=[];
|
let res = [];
|
||||||
let dt=dayjs(data.createTime);
|
let dt = dayjs(data.createTime);
|
||||||
for(let i=0;i<12;i++){
|
for (let i = 0; i < 12; i++) {
|
||||||
let date=dt.add(i,"month");
|
let date = dt.add(i, "month");
|
||||||
let year=date.$y;
|
let year = date.$y;
|
||||||
let month=date.$M+1;
|
let month = date.$M + 1;
|
||||||
titles.push(month+"月");
|
titles.push(month + "月");
|
||||||
let objs=tmps.filter(it=>(it.factorType==factorType||factorType==0)&& it.comId==year && it.projectId==month);
|
let objs = tmps.filter((it) => (it.factorType == factorType || factorType == 0) && it.comId == year && it.projectId == month);
|
||||||
let val=null;
|
let val = 0;
|
||||||
if(objs.length>0){
|
if (objs.length > 0) {
|
||||||
if(dataType==1){
|
objs.forEach((obj) => {
|
||||||
val=objs[0].estimateValue/1000.0
|
if (dataType == 1) {
|
||||||
|
val += obj.estimateValue / 1000.0;
|
||||||
}
|
}
|
||||||
if(dataType==2){
|
if (dataType == 2) {
|
||||||
val=objs[0].practicalValue/1000.0
|
val += obj.practicalValue / 1000.0;
|
||||||
}
|
}
|
||||||
if(dataType==3){
|
if (dataType == 3) {
|
||||||
val=((objs[0].estimateValue||0) - (val=objs[0].practicalValue||0))/1000.0
|
val += ((obj.estimateValue || 0) - (val = obj.practicalValue || 0)) / 1000.0;
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
res.push(val);
|
|
||||||
}
|
}
|
||||||
return {
|
res.push(val);
|
||||||
titles:titles,
|
}
|
||||||
datas:res
|
return {
|
||||||
}
|
titles: titles,
|
||||||
}
|
datas: res,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
const groupByYearMonth = (data) => {
|
const groupByYearMonth = (data) => {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
|
@ -105,47 +107,46 @@ const groupByYearMonth = (data) => {
|
||||||
url: "/manage/greenCarbonData/groupByYearMonth",
|
url: "/manage/greenCarbonData/groupByYearMonth",
|
||||||
method: "get",
|
method: "get",
|
||||||
params: data,
|
params: data,
|
||||||
}).then(d=>{
|
}).then((d) => {
|
||||||
let tmps=d.data||[];
|
let tmps = d.data || [];
|
||||||
let buildData={
|
let buildData = {
|
||||||
//预估
|
//预估
|
||||||
estimate: getGroupData(tmps,data,1,1),
|
estimate: getGroupData(tmps, data, 1, 1),
|
||||||
//实际
|
//实际
|
||||||
practical:getGroupData(tmps,data,1,2),
|
practical: getGroupData(tmps, data, 1, 2),
|
||||||
//减排
|
//减排
|
||||||
emissionReduction:getGroupData(tmps,data,1,3),
|
emissionReduction: getGroupData(tmps, data, 1, 3),
|
||||||
};
|
};
|
||||||
let oilData={
|
let oilData = {
|
||||||
//预估
|
//预估
|
||||||
estimate: getGroupData(tmps,data,2,1),
|
estimate: getGroupData(tmps, data, 2, 1),
|
||||||
//实际
|
//实际
|
||||||
practical:getGroupData(tmps,data,2,2),
|
practical: getGroupData(tmps, data, 2, 2),
|
||||||
//减排
|
//减排
|
||||||
emissionReduction:getGroupData(tmps,data,2,3),
|
emissionReduction: getGroupData(tmps, data, 2, 3),
|
||||||
};
|
};
|
||||||
let powerData={
|
let powerData = {
|
||||||
//预估
|
//预估
|
||||||
estimate: getGroupData(tmps,data,3,1),
|
estimate: getGroupData(tmps, data, 3, 1),
|
||||||
//实际
|
//实际
|
||||||
practical:getGroupData(tmps,data,3,2),
|
practical: getGroupData(tmps, data, 3, 2),
|
||||||
//减排
|
//减排
|
||||||
emissionReduction:getGroupData(tmps,data,3,3),
|
emissionReduction: getGroupData(tmps, data, 3, 3),
|
||||||
};
|
};
|
||||||
let totalData={
|
let totalData = {
|
||||||
//预估
|
//预估
|
||||||
estimate: getGroupData(tmps,data,0,1),
|
estimate: getGroupData(tmps, data, 0, 1),
|
||||||
//实际
|
//实际
|
||||||
practical:getGroupData(tmps,data,0,2),
|
practical: getGroupData(tmps, data, 0, 2),
|
||||||
//减排
|
//减排
|
||||||
emissionReduction:getGroupData(tmps,data,0,3),
|
emissionReduction: getGroupData(tmps, data, 0, 3),
|
||||||
};
|
};
|
||||||
resolve({
|
resolve({
|
||||||
buildData:buildData,
|
buildData: buildData,
|
||||||
oilData:oilData,
|
oilData: oilData,
|
||||||
powerData:powerData,
|
powerData: powerData,
|
||||||
totalData:totalData,
|
totalData: totalData,
|
||||||
})
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -268,7 +268,7 @@ export default {
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
type: 'pie',
|
type: 'pie',
|
||||||
radius: '70%',
|
radius: '50%',
|
||||||
avoidLabelOverlap: false,
|
avoidLabelOverlap: false,
|
||||||
bottom: is1K ? '5%' : is2K ? '15%' : '10%',
|
bottom: is1K ? '5%' : is2K ? '15%' : '10%',
|
||||||
top: '-10%',
|
top: '-10%',
|
||||||
|
|
|
@ -276,6 +276,10 @@ public class SysUserController extends BaseController {
|
||||||
@GetMapping("/getInfo")
|
@GetMapping("/getInfo")
|
||||||
public AjaxResult getInfo() {
|
public AjaxResult getInfo() {
|
||||||
SysUser user = SecurityUtils.getLoginUser().getSysUser();
|
SysUser user = SecurityUtils.getLoginUser().getSysUser();
|
||||||
|
SysDept dept= deptService.selectDeptById(user.getDeptId());
|
||||||
|
user.setComId(dept.getComId());
|
||||||
|
user.setActiveComId(dept.getComId());
|
||||||
|
user.setDept(dept);
|
||||||
AjaxResult ajax = AjaxResult.success();
|
AjaxResult ajax = AjaxResult.success();
|
||||||
ajax.put("user", user);
|
ajax.put("user", user);
|
||||||
if(Objects.nonNull(user.getRoles()) && user.getRoles().size()>0){
|
if(Objects.nonNull(user.getRoles()) && user.getRoles().size()>0){
|
||||||
|
|
|
@ -86,8 +86,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tools-bottom">
|
<div class="tools-bottom">
|
||||||
<el-button type="primary" @click="doSave">保存</el-button>
|
<el-button type="primary" @click="doSave">保存</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="test-box">
|
<div class="test-box">
|
||||||
<div class="tag-box">
|
<div class="tag-box">
|
||||||
|
@ -109,7 +109,11 @@ import useUserStore from "@/store/modules/user";
|
||||||
import { listBimModel } from "@/api/bim/bimModel";
|
import { listBimModel } from "@/api/bim/bimModel";
|
||||||
import { ElMessage, ElMessageBox } from "element-plus";
|
import { ElMessage, ElMessageBox } from "element-plus";
|
||||||
import { emitter } from "@/router/index.js";
|
import { emitter } from "@/router/index.js";
|
||||||
import { devicePositionGet,devicePositionAddItems, devicePositionUpdateItems} from "@/api/bim/bim.js";
|
import {
|
||||||
|
devicePositionGet,
|
||||||
|
devicePositionAddItems,
|
||||||
|
devicePositionUpdateItems,
|
||||||
|
} from "@/api/bim/bim.js";
|
||||||
import icons from "./icons.js";
|
import icons from "./icons.js";
|
||||||
export default {
|
export default {
|
||||||
name: "SandTableSetting",
|
name: "SandTableSetting",
|
||||||
|
@ -128,7 +132,7 @@ export default {
|
||||||
positionByModalId: "",
|
positionByModalId: "",
|
||||||
selItem: null,
|
selItem: null,
|
||||||
iconVideo: "",
|
iconVideo: "",
|
||||||
addLabels:[],
|
addLabels: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -155,55 +159,59 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
doSave() {
|
doSave() {
|
||||||
this.$confirm("确认保存修改?", "提示", {
|
this.$confirm("确认保存修改?", "提示", {
|
||||||
type:"warning",
|
type: "warning",
|
||||||
confirmButtonText: "确 认",
|
confirmButtonText: "确 认",
|
||||||
cancelButtonText: "取 消",
|
cancelButtonText: "取 消",
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
let adds=this.devices.filter((item)=>{
|
let adds = this.devices
|
||||||
return item.id==null
|
.filter((item) => {
|
||||||
}).map(item=>{
|
return item.id == null;
|
||||||
return {
|
})
|
||||||
deviceId:item.deviceId,
|
.map((item) => {
|
||||||
deviceType:item.deviceType,
|
return {
|
||||||
position:JSON.stringify( item.position),
|
deviceId: item.deviceId,
|
||||||
enabled:item.show?1:0,
|
deviceType: item.deviceType,
|
||||||
currentUser:this.userStore.name,
|
position: JSON.stringify(item.position),
|
||||||
remark:'',
|
enabled: item.show ? 1 : 0,
|
||||||
}
|
currentUser: this.userStore.name,
|
||||||
})
|
remark: "",
|
||||||
let updates=this.devices.filter((item)=>{
|
};
|
||||||
return item.id!=null
|
});
|
||||||
}).map(item=>{
|
let updates = this.devices
|
||||||
return {
|
.filter((item) => {
|
||||||
id:item.id,
|
return item.id != null;
|
||||||
position:JSON.stringify( item.position),
|
})
|
||||||
currentUser:this.userStore.name,
|
.map((item) => {
|
||||||
enabled:item.show?1:0,
|
return {
|
||||||
}
|
id: item.id,
|
||||||
})
|
position: JSON.stringify(item.position),
|
||||||
console.log("-->",adds,updates)
|
currentUser: this.userStore.name,
|
||||||
let ajaxs=[];
|
enabled: item.show ? 1 : 0,
|
||||||
if(adds.length>0){
|
};
|
||||||
ajaxs.push(devicePositionAddItems({items:adds}))
|
});
|
||||||
|
console.log("-->", adds, updates);
|
||||||
|
let ajaxs = [];
|
||||||
|
if (adds.length > 0) {
|
||||||
|
ajaxs.push(devicePositionAddItems({ items: adds }));
|
||||||
}
|
}
|
||||||
if(updates.length>0){
|
if (updates.length > 0) {
|
||||||
ajaxs.push(devicePositionUpdateItems({items:updates}))
|
ajaxs.push(devicePositionUpdateItems({ items: updates }));
|
||||||
}
|
}
|
||||||
Promise.all(ajaxs).then((res)=>{
|
Promise.all(ajaxs).then((res) => {
|
||||||
ElMessage.success("保存成功")
|
ElMessage.success("保存成功");
|
||||||
})
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
clearLabels(){
|
clearLabels() {
|
||||||
this.addLabels.forEach(id=>{
|
this.addLabels.forEach((id) => {
|
||||||
window.sandSettingApi.Label.removeBalloon(id);
|
window.sandSettingApi.Label.removeBalloon(id);
|
||||||
})
|
});
|
||||||
this.addLabels=[];
|
this.addLabels = [];
|
||||||
},
|
},
|
||||||
addDeviceLabel(){
|
addDeviceLabel() {
|
||||||
this.devices.forEach(d=>{
|
this.devices.forEach((d) => {
|
||||||
if(d.position && d.position.length>0){
|
if (d.position && d.position.length > 0) {
|
||||||
this.AddLable(d)
|
this.AddLable(d);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -229,7 +237,7 @@ export default {
|
||||||
${item.name}
|
${item.name}
|
||||||
</span>
|
</span>
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
window.sandSettingApi.Label.addBalloon({
|
window.sandSettingApi.Label.addBalloon({
|
||||||
Html: html,
|
Html: html,
|
||||||
ID: item.elId,
|
ID: item.elId,
|
||||||
|
@ -249,18 +257,22 @@ export default {
|
||||||
window.sandSettingApi.Feature.getByPosition([e.x, e.y], (n) => {
|
window.sandSettingApi.Feature.getByPosition([e.x, e.y], (n) => {
|
||||||
if (n && n["id"]) {
|
if (n && n["id"]) {
|
||||||
this.positionByModalId = n.id.split("^")[0];
|
this.positionByModalId = n.id.split("^")[0];
|
||||||
window.sandSettingApi.Public.pickupCoordinate(true, (e) => {
|
|
||||||
this.selItem.position = e;
|
|
||||||
window.sandSettingApi.Label.removeBalloon(item.elId);
|
|
||||||
this.AddLable(this.selItem);
|
|
||||||
window.sandSettingApi.Public.pickupCoordinate(false);
|
|
||||||
window.sandSettingApi.Public.clearHandler();
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
ElMessage.warning("请在模型上选点!");
|
ElMessage.warning("请在模型上选点!");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
window.sandSettingApi.Public.pickupCoordinate(true, (e) => {
|
||||||
|
if (!this.positionByModalId) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.selItem.position = e;
|
||||||
|
window.sandSettingApi.Label.removeBalloon(item.elId);
|
||||||
|
this.AddLable(this.selItem);
|
||||||
|
window.sandSettingApi.Public.pickupCoordinate(false);
|
||||||
|
window.sandSettingApi.Public.clearHandler();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
doToolsClose() {
|
doToolsClose() {
|
||||||
this.activeMenu = 0;
|
this.activeMenu = 0;
|
||||||
|
@ -298,12 +310,12 @@ export default {
|
||||||
.filter((item) => item.deviceType == this.activeMenu)
|
.filter((item) => item.deviceType == this.activeMenu)
|
||||||
.map((item) => {
|
.map((item) => {
|
||||||
item.show = item.enabled != 0;
|
item.show = item.enabled != 0;
|
||||||
item.position=this.$tryToJson(item.position,[]);
|
item.position = this.$tryToJson(item.position, []);
|
||||||
item.elId = (item.id ? item.id : cnt++) + "-" + item.deviceType;
|
item.elId = (item.id ? item.id : cnt++) + "-" + item.deviceType;
|
||||||
return item;
|
return item;
|
||||||
});
|
});
|
||||||
this.clearLabels();
|
this.clearLabels();
|
||||||
this.addDeviceLabel();
|
this.addDeviceLabel();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
initEngine() {
|
initEngine() {
|
||||||
|
@ -489,10 +501,10 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.tools-bottom{
|
.tools-bottom {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 10px;
|
bottom: 10px;
|
||||||
width:100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue