对接左边接口

This commit is contained in:
Vce 2024-06-03 16:46:14 +08:00
parent bc6146abaf
commit 335b6642a2
3 changed files with 160 additions and 42 deletions

View File

@ -5,7 +5,7 @@ NODE_ENV = 'development'
# 后端本地 # 后端本地
# VITE_API_URL = 'http://192.168.34.221:19111' # VITE_API_URL = 'http://192.168.34.221:19111'
# VITE_API_URL = 'http://192.168.34.221:9111' #雄哥本地 # VITE_API_URL = 'http://192.168.34.221:9111' #雄哥本地
# VITE_API_URL = 'http://182.90.224.237:51234' #雄哥远程 VITE_API_URL = 'http://182.90.224.237:51234' #雄哥远程
# VITE_API_URL = 'http://192.168.34.221:28889' # VITE_API_URL = 'http://192.168.34.221:28889'
# VITE_API_URL = 'http://121.196.214.246/api' # VITE_API_URL = 'http://121.196.214.246/api'
# VITE_API_URL = 'http://jxj.zhgdyun.com:100' # VITE_API_URL = 'http://jxj.zhgdyun.com:100'
@ -24,7 +24,7 @@ NODE_ENV = 'development'
# VITE_API_URL = 'http://182.90.224.237:15551' # VITE_API_URL = 'http://182.90.224.237:15551'
# agjt # agjt
# VITE_API_URL = 'http://42.180.188.17:9809' #生产环境 # VITE_API_URL = 'http://42.180.188.17:9809' #生产环境
VITE_API_URL = 'http://42.180.188.17:11211' #测试环境 # VITE_API_URL = 'http://42.180.188.17:11211' #测试环境
# VITE_API_URL = 'http://jxj.zhgdyun.com:19812' # VITE_API_URL = 'http://jxj.zhgdyun.com:19812'
# 苏立信 # 苏立信
# VITE_API_URL = 'http://101.43.164.214:11111' # VITE_API_URL = 'http://101.43.164.214:11111'

View File

@ -103,4 +103,18 @@ export const getStatScoreApi = (params: {}) => {
export const getPersonTypeAndEduStatisticsApi = (params: {}) => { export const getPersonTypeAndEduStatisticsApi = (params: {}) => {
return http.post(BASEURL + `/xmgl/workerInfo/selectPersonTypeAndEduStatistics`, params, { headers: { noLoading: true } }); return http.post(BASEURL + `/xmgl/workerInfo/selectPersonTypeAndEduStatistics`, params, { headers: { noLoading: true } });
}; };
// 总包出勤情况分析
export const queryAttendanceOfEachCompanyApi = (params: {}) => {
return http.get(BASEURL + `/xmgl/workerAttendance/queryAttendanceOfEachCompany`, params, { headers: { noLoading: true } });
};
// 进度情况分析
// 项目总进度/项目剩余天数
export const getCountTaskProgressApi = (params: {}) => {
return http.post(BASEURL + `/xmgl/xzTaskProgress/countTaskProgress`, params, { headers: { noLoading: true } });
};
// 总包进度列表
export const queryCountEnterpriseApi = (params: {}) => {
return http.post(BASEURL + `/xmgl/xzTaskProgressTotal/countEnterprise`, params, { headers: { noLoading: true } });
};

View File

@ -10,11 +10,14 @@
<!-- <div class="numberCard" v-for="(item,i) in '0234'" :key="i">{{item}}</div> --> <!-- <div class="numberCard" v-for="(item,i) in '0234'" :key="i">{{item}}</div> -->
<div class="numberCard" v-for="(item,i) in totalPerson" :key="i">{{item}}</div> <div class="numberCard" v-for="(item,i) in totalPerson" :key="i">{{item}}</div>
<span style="margin-left:15px">考勤日环比</span> <span style="margin-left:15px">考勤日环比</span>
<div style="display:flex" v-if="typeof totalPersonRhbRatio == 'undefined'">
<div class="dayRadio">0%</div>
</div>
<div style="display:flex" v-if="totalPersonRhbRatio > 0"> <div style="display:flex" v-if="totalPersonRhbRatio > 0">
<div class="dayRadio">{{totalPersonRhbRatio}}%</div> <div class="dayRadio">{{totalPersonRhbRatio}}%</div>
<div class="iconCenter"><el-icon size="20" color="#1E90FF"><Top/></el-icon></div> <div class="iconCenter"><el-icon size="20" color="#1E90FF"><Top/></el-icon></div>
</div> </div>
<div style="display:flex" v-if="totalPersonRhbRatio === 0"> <div style="display:flex" v-if="totalPersonRhbRatio == 0">
<div class="dayRadio">{{totalPersonRhbRatio}}%</div> <div class="dayRadio">{{totalPersonRhbRatio}}%</div>
</div> </div>
<div style="display:flex" v-if="totalPersonRhbRatio < 0"> <div style="display:flex" v-if="totalPersonRhbRatio < 0">
@ -37,20 +40,21 @@
<div class="cbLine1"> <div class="cbLine1">
<div style="display:flex"> <div style="display:flex">
<span>项目总进度:</span> <span>项目总进度:</span>
<div class="numberCard" v-for="(item,i) in '023'" :key="i">{{item}}</div> <div class="numberCard" v-for="(item,i) in projectTotalProgress" :key="i">{{item}}</div>
<span style="margin-left:5px">%</span> <span style="margin-left:5px">%</span>
</div> </div>
<div style="display:flex"> <div style="display:flex">
<span style="margin-left:15px">项目剩余天数</span> <span style="margin-left:15px">项目剩余天数</span>
<div class="numberCard" v-for="(item,i) in '0234'" :key="i">{{item}}</div> <div class="numberCard" v-for="(item,i) in projectSurplusDayNum" :key="i">{{item}}</div>
<span style="margin-left:5px"></span> <span style="margin-left:5px"></span>
</div> </div>
</div> </div>
<div class="cbProcess"> <div class="cbProcess" v-if="processList.length >= 5">
<!-- v-if="listData.length>0" :list="listData" -->
<vue3-seamless-scroll <vue3-seamless-scroll
v-if="listData.length>0" :list="listData" v-if="processList.length>0" :list="processList"
:speed="1" :limitScrollNum="5" :step="0.3" :hover="true" class="scroll"> :speed="1" :limitScrollNum="5" :step="0.3" :hover="true" class="scroll">
<div class="pItem" v-for="(item,i) in listData" :key="i"> <div class="pItem" v-for="(item,i) in processList" :key="i">
<div class="pLeft"> <div class="pLeft">
<span :class="['plInner','plBgc'+(i+1)%12]"> <span :class="['plInner','plBgc'+(i+1)%12]">
<span style="margin-left:10px">Top{{i+1}}</span> <span style="margin-left:10px">Top{{i+1}}</span>
@ -58,12 +62,12 @@
</div> </div>
<div class="pRight"> <div class="pRight">
<div class="prTop"> <div class="prTop">
<div class="prtLeft">{{item.a}}</div> <div class="prtLeft">{{item.enterpriseName}}</div>
<div class="prtRight">{{item.b}}%</div> <div class="prtRight">{{item.changeAfter}}%</div>
</div> </div>
<div class="prBottom"> <div class="prBottom">
<div class="processLineBg"> <div class="processLineBg">
<div :class="['processLine','plBtnBgc'+(i+1)%12]" :style="{width:item.b+'%'}"> <div :class="['processLine','plBtnBgc'+(i+1)%12]" :style="{width:item.changeAfter+'%'}">
<div class="processLineBtn"></div> <div class="processLineBtn"></div>
</div> </div>
</div> </div>
@ -72,6 +76,33 @@
</div> </div>
</vue3-seamless-scroll> </vue3-seamless-scroll>
</div> </div>
<div class="cbProcess" v-else>
<!-- v-if="listData.length>0" :list="listData" -->
<!-- <vue3-seamless-scroll
v-if="processList.length>0" :list="processList"
:speed="1" :limitScrollNum="5" :step="0.3" :hover="true" class="scroll"> -->
<div class="pItem" v-for="(item,i) in processList" :key="i">
<div class="pLeft">
<span :class="['plInner','plBgc'+(i+1)%12]">
<span style="margin-left:10px">Top{{i+1}}</span>
</span>
</div>
<div class="pRight">
<div class="prTop">
<div class="prtLeft">{{item.enterpriseName}}</div>
<div class="prtRight">{{item.changeAfter}}%</div>
</div>
<div class="prBottom">
<div class="processLineBg">
<div :class="['processLine','plBtnBgc'+(i+1)%12]" :style="{width:item.changeAfter+'%'}">
<div class="processLineBtn"></div>
</div>
</div>
</div>
</div>
</div>
<!-- </vue3-seamless-scroll> -->
</div>
</div> </div>
</div> </div>
</div> </div>
@ -82,9 +113,13 @@
<script setup lang="ts"> <script setup lang="ts">
import { onMounted, ref } from "vue"; import { onMounted, ref } from "vue";
import * as echarts from "echarts"; import * as echarts from "echarts";
import ECharts from 'vue-echarts';
import { selectQualityStatisticsApi } from "@/api/modules/projectOverview"; import { selectQualityStatisticsApi } from "@/api/modules/projectOverview";
import { getMemberJobStatusApi, getInspectManStatusApi, getEnterpriseStatusApi, import {
getPersonTypeAndEduStatisticsApi getPersonTypeAndEduStatisticsApi,
queryAttendanceOfEachCompanyApi,
getCountTaskProgressApi,
queryCountEnterpriseApi,
} from "@/api/modules/agjtCommandApi"; } from "@/api/modules/agjtCommandApi";
import type { TabsPaneContext, ElMessageBox } from "element-plus"; import type { TabsPaneContext, ElMessageBox } from "element-plus";
import * as ElementPlusIconsVue from '@element-plus/icons-vue' import * as ElementPlusIconsVue from '@element-plus/icons-vue'
@ -105,30 +140,40 @@ const getPersonTypeAndEduStatistics = async () => {
if (res.result) { if (res.result) {
console.log("出勤人员数据/考勤日环比", res); console.log("出勤人员数据/考勤日环比", res);
totalPerson.value = res.result.personType.attendancePerson.totalPerson totalPerson.value = res.result.personType.attendancePerson.totalPerson
if(totalPerson.value.length < 4){ // if(totalPerson.value.length < 4){
let temp = 4-totalPerson.value.length // let temp = 4-totalPerson.value.length
for(let i = 0;i<temp;i++){ // for(let i = 0;i<temp;i++){
totalPerson.value = "0" + totalPerson.value // totalPerson.value = "0" + totalPerson.value
} // }
} // }
totalPersonRhbRatio.value = res.result.personType.attendancePerson.totalPersonRhbRatio totalPersonRhbRatio.value = res.result.personType.attendancePerson.totalPersonRhbRatio
} }
}; };
//
let projectCompanyWorkTotalList = ref([] as any)
let xData = ref([] as any)
let yData = ref([] as any)
//
const queryAttendanceOfEachCompany = async () => {
const res: any = await queryAttendanceOfEachCompanyApi({
projectSn: store.sn
});
if (res.result) {
console.log("获取总包出勤情况分析数据", res);
projectCompanyWorkTotalList.value = res.result.projectCompanyWorkTotalList
xData.value = projectCompanyWorkTotalList.value.map(item => item.enterpriseName.substring(0,4))
yData.value = projectCompanyWorkTotalList.value.map(item => item.attendancePersonNum)
drawBar()
}
};
//tab //tab
const handleTab = (val:string) => { const handleTab = (val:string) => {
activeIndex.value = val activeIndex.value = val
} }
// //
let testData = ref({
xData:['中铝山东','中冶沈勘','鞍山电力','鞍钢矿业','上海建工','辽宁普凡','沈阳隆基','中科过程','宏大爆破','鞍钢设计'],
yData:[78,56,66,33,53,11,77,51,78,90,],
hData:[
{a:120,b:100,c:'12%',d:'45%'},{a:120,b:100,c:'12%',d:'45%'},{a:120,b:100,c:'12%',d:'45%'},
{a:120,b:100,c:'12%',d:'45%'},{a:120,b:100,c:'12%',d:'45%'},{a:120,b:100,c:'12%',d:'45%'},
{a:120,b:100,c:'12%',d:'45%'},{a:120,b:100,c:'12%',d:'45%'},{a:120,b:100,c:'12%',d:'45%'},
{a:120,b:100,c:'12%',d:'45%'},
]
} as any)
function drawBar() { function drawBar() {
console.log("---------------------bar--------") console.log("---------------------bar--------")
type EChartsOption = echarts.EChartsOption; type EChartsOption = echarts.EChartsOption;
@ -140,28 +185,51 @@ function drawBar() {
xAxis: { xAxis: {
type: 'category', type: 'category',
// data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] // data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
data: testData.value.xData, data: xData.value,
axisLabel: { axisLabel: {
fontSize: 8, // 12px fontSize: 12, // 12px
// rotate: 45,
interval: 0, //
}, },
axisLine: { axisLine: {
lineStyle: { lineStyle: {
color: 'white' // X线 // color: 'white' // X线
color: 'rgba(200,200,200,1)'
} }
}, },
}, },
yAxis: { yAxis: {
type: 'value', type: 'value',
axisLabel: { axisLabel: {
fontSize: 8, // 12px fontSize: 12, // 12px
}, },
axisLine: { axisLine: {
lineStyle: { lineStyle: {
color: 'white' // Y线 // color: 'white' // Y线
color: 'rgba(200,200,200,1)'
} }
}, },
// show:false // show:false
splitLine: {
show: true,
lineStyle: {
// type: 'dashed', //y线
type: 'solid', //y线
color: 'rgba(102,102,102,0.25)',
width: 2.5,
},
},
}, },
dataZoom: [{
type: 'slider',
start: 0,
end: 30,
width:"100%",
height:5,
left:"center",
bottom:3
}],
grid: { grid: {
top: "8%", top: "8%",
right: "0", right: "0",
@ -171,8 +239,9 @@ function drawBar() {
}, },
series: [{ series: [{
// data: [120, 200, 150, 80, 70, 110, 130], // data: [120, 200, 150, 80, 70, 110, 130],
data: testData.value.yData, data: yData.value,
type: 'bar', type: 'bar',
barWidth: 50,
itemStyle: { itemStyle: {
color: '#3398DB' // color: '#3398DB' //
}, },
@ -187,14 +256,14 @@ function drawBar() {
tooltip: { tooltip: {
borderColor: 'rgba(50,50,50, 0.5)', borderColor: 'rgba(50,50,50, 0.5)',
backgroundColor: 'rgba(50,50,50, 0.5)', backgroundColor: 'rgba(50,50,50, 0.5)',
textStyle: { color: '#fff',fontSize:'13'}, textStyle: { color: '#fff',fontSize:'15'},
formatter: function(params) { formatter: function(params) {
console.log(params) console.log(params)
return '<div style="font-weight:bold">'+params.name+'</div>' + return '<div style="font-weight:bold">'+params.name+'</div>' +
'<div style="line-height:23px"><span style="font-size:16px;margin-right:5px;color:darkred">●</span>在册人员:'+params.data+'</div>' + '<div style="line-height:23px"><span style="font-size:16px;margin-right:5px;color:#1E90FF">●</span>在册人员:'+projectCompanyWorkTotalList.value[params.dataIndex].totalPersonNum+'</div>' +
'<div style="line-height:23px"><span style="font-size:16px;margin-right:5px;color:yellow">●</span>出勤人员总数:'+params.data+'</div>' + '<div style="line-height:23px"><span style="font-size:16px;margin-right:5px;color:#4682B4">●</span>出勤人员总数:'+projectCompanyWorkTotalList.value[params.dataIndex].attendancePersonNum+'</div>' +
'<div style="line-height:23px"><span style="font-size:16px;margin-right:5px;color:darkblue">●</span>出勤率:'+params.data+'%</div>' + '<div style="line-height:23px"><span style="font-size:16px;margin-right:5px;color:#87CEFA">●</span>出勤率:'+projectCompanyWorkTotalList.value[params.dataIndex].attendancePersonRate+'%</div>' +
'<div style="line-height:23px"><span style="font-size:16px;margin-right:5px;color:green">●</span>出勤率日环比:'+params.data+'%</div>'; '<div style="line-height:23px"><span style="font-size:16px;margin-right:5px;color:#00BFFF">●</span>出勤率日环比:'+projectCompanyWorkTotalList.value[params.dataIndex].attendancePersonRhbRate+'%</div>';
} }
} }
}; };
@ -213,9 +282,44 @@ let listData = ref([
{a:'中铝山东工程技术有限公司',b:'59'},{a:'中国华冶科工集团有限公司',b:'14'},{a:'沈阳岩土工程技术测试开发有限公司',b:'38'},{a:'永明项目管理有限公司',b:'41'}, {a:'中铝山东工程技术有限公司',b:'59'},{a:'中国华冶科工集团有限公司',b:'14'},{a:'沈阳岩土工程技术测试开发有限公司',b:'38'},{a:'永明项目管理有限公司',b:'41'},
] as any) ] as any)
//
//
let projectTotalProgress = ref("" as any)
//
let projectSurplusDayNum = ref({} as any)
// /
const getCountTaskProgress = async () => {
const res: any = await getCountTaskProgressApi({
projectSn: store.sn
});
if (res.result) {
console.log("项目总进度/项目剩余天数", res);
projectTotalProgress.value = res.result.projectTotalProgress + ""
projectSurplusDayNum.value = res.result.projectSurplusDayNum + ""
}
};
//
let processList = ref([] as any)
//
const queryCountEnterprise = async () => {
const res: any = await queryCountEnterpriseApi({
projectSn: store.sn,
isCountMainEnterprise: "1"
});
if (res.result) {
console.log("总包进度列表", res);
processList.value = res.result
}
};
onMounted(async () => { onMounted(async () => {
drawBar() // drawBar()
getPersonTypeAndEduStatistics() getPersonTypeAndEduStatistics()
queryAttendanceOfEachCompany()
getCountTaskProgress()
queryCountEnterprise()
}); });
</script> </script>
@ -359,7 +463,7 @@ onMounted(async () => {
} }
.cbProcess{ .cbProcess{
padding-top: 5px; padding-top: 5px;
height: calc(100% - 65px); height: calc(100% - 55px);
overflow: hidden; overflow: hidden;
// background-color: #fff; // background-color: #fff;
.pItem{ .pItem{