update code
parent
cd5e3da32d
commit
4dee34f05a
|
@ -6,7 +6,14 @@ const getWorkTrainList=(trainType,deptId,projectId)=> {
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
const getGroupByDataType=(deptId,projectId)=> {
|
||||||
|
return request({
|
||||||
|
url: `bgscreen/workTrain/getGroupByDataType?deptId=${deptId||0}&projectId=${projectId||0}`,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export default{
|
export default{
|
||||||
getWorkTrainList
|
getWorkTrainList,
|
||||||
|
getGroupByDataType
|
||||||
}
|
}
|
|
@ -72,7 +72,9 @@
|
||||||
</module-one-3-1>
|
</module-one-3-1>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<module-one-1-1 label="专项培训">
|
<module-one-1-1 :label="'专项培训('+WorkTrainCnt1+')'">
|
||||||
|
<enginChart ref="chart3" :height="300"></enginChart>
|
||||||
|
<!--
|
||||||
<div style="padding:10px" class="train-list scroll">
|
<div style="padding:10px" class="train-list scroll">
|
||||||
<div v-for="(it, index) in workTrainList" :key="index" class="transition-item"
|
<div v-for="(it, index) in workTrainList" :key="index" class="transition-item"
|
||||||
@click="doShowDlgTrain(it, 0)">
|
@click="doShowDlgTrain(it, 0)">
|
||||||
|
@ -102,9 +104,11 @@
|
||||||
<img src="images/nodata.png" style="width: 240px;">
|
<img src="images/nodata.png" style="width: 240px;">
|
||||||
<div style="text-align: center;">暂无数据</div>
|
<div style="text-align: center;">暂无数据</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>-->
|
||||||
</module-one-1-1>
|
</module-one-1-1>
|
||||||
<module-one-1-1 label="应急演练">
|
<module-one-1-1 :label="'应急演练('+WorkTrainCnt2+')'">
|
||||||
|
<enginChart ref="chart4" :height="300"></enginChart>
|
||||||
|
<!--
|
||||||
<div style="padding:10px" class="train-list scroll">
|
<div style="padding:10px" class="train-list scroll">
|
||||||
<div v-for="(it, index) in emergencyDrillList" :key="index" class="transition-item"
|
<div v-for="(it, index) in emergencyDrillList" :key="index" class="transition-item"
|
||||||
@click="doShowDlgTrain(it, 1)">
|
@click="doShowDlgTrain(it, 1)">
|
||||||
|
@ -134,7 +138,7 @@
|
||||||
<img src="images/nodata.png" style="width: 240px;">
|
<img src="images/nodata.png" style="width: 240px;">
|
||||||
<div style="text-align: center;">暂无数据</div>
|
<div style="text-align: center;">暂无数据</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>-->
|
||||||
</module-one-1-1>
|
</module-one-1-1>
|
||||||
<module-one-1-1 label="特种作业人员">
|
<module-one-1-1 label="特种作业人员">
|
||||||
<div class="quality-table special-table">
|
<div class="quality-table special-table">
|
||||||
|
@ -301,12 +305,13 @@ import projectInsuranceDlg from './safe/projectInsuranceDlg.vue'
|
||||||
import AttendanceDetailDialog from './components/AttendanceDetailDialog.vue'
|
import AttendanceDetailDialog from './components/AttendanceDetailDialog.vue'
|
||||||
import JobWorkerDialog from './components/JobWorkerDialog.vue'
|
import JobWorkerDialog from './components/JobWorkerDialog.vue'
|
||||||
import debounce from 'lodash.debounce'
|
import debounce from 'lodash.debounce'
|
||||||
|
import enginChart from './engin/enginChart.vue'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
worktrainDlg,
|
worktrainDlg,
|
||||||
projectSpecialDlg,
|
projectSpecialDlg,
|
||||||
ProblemmodifyDetail,AttendanceDetailDialog,
|
ProblemmodifyDetail,AttendanceDetailDialog,
|
||||||
projectInsuranceDlg,JobWorkerDialog
|
projectInsuranceDlg,JobWorkerDialog,enginChart
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -324,6 +329,12 @@ export default {
|
||||||
fontSize: '12px',
|
fontSize: '12px',
|
||||||
height: '32px'
|
height: '32px'
|
||||||
},
|
},
|
||||||
|
//培训图表1
|
||||||
|
WorkTrainCnt1:0,
|
||||||
|
WorkTrainChart1:[],
|
||||||
|
//培训图表2
|
||||||
|
WorkTrainCnt2:0,
|
||||||
|
WorkTrainChart2:[],
|
||||||
// 专项培训数据
|
// 专项培训数据
|
||||||
workTrainList: [],
|
workTrainList: [],
|
||||||
// 应急演练数据
|
// 应急演练数据
|
||||||
|
@ -393,8 +404,9 @@ export default {
|
||||||
this.$bus.$on("projectChange", debounce(res => {
|
this.$bus.$on("projectChange", debounce(res => {
|
||||||
this.projectInfo=res;
|
this.projectInfo=res;
|
||||||
this.doDeptChane();
|
this.doDeptChane();
|
||||||
this.getWorkTrainList();
|
this.getWorkTrainChart();
|
||||||
this.getEmergencyDrillList();
|
//this.getWorkTrainList();
|
||||||
|
//this.getEmergencyDrillList();
|
||||||
this.getProjectSpecialView();
|
this.getProjectSpecialView();
|
||||||
this.getDeptSafetyWorksList();
|
this.getDeptSafetyWorksList();
|
||||||
this.getProjectInsuranceList();
|
this.getProjectInsuranceList();
|
||||||
|
@ -405,8 +417,8 @@ export default {
|
||||||
this.$bus.$on("deptChange", debounce(dept => {
|
this.$bus.$on("deptChange", debounce(dept => {
|
||||||
this.dept = dept;
|
this.dept = dept;
|
||||||
this.doDeptChane();
|
this.doDeptChane();
|
||||||
this.getWorkTrainList();
|
//this.getWorkTrainList();
|
||||||
this.getEmergencyDrillList();
|
//this.getEmergencyDrillList();
|
||||||
this.getProjectSpecialView();
|
this.getProjectSpecialView();
|
||||||
this.getDeptSafetyWorksList();
|
this.getDeptSafetyWorksList();
|
||||||
this.getProjectInsuranceList();
|
this.getProjectInsuranceList();
|
||||||
|
@ -437,8 +449,9 @@ export default {
|
||||||
this.dept=this.$root.dept||{};
|
this.dept=this.$root.dept||{};
|
||||||
this.projects=this.$root.projects||[];
|
this.projects=this.$root.projects||[];
|
||||||
this.doDeptChane();
|
this.doDeptChane();
|
||||||
this.getWorkTrainList();
|
this.getWorkTrainChart();
|
||||||
this.getEmergencyDrillList();
|
//this.getWorkTrainList();
|
||||||
|
//this.getEmergencyDrillList();
|
||||||
this.getProjectSpecialView();
|
this.getProjectSpecialView();
|
||||||
this.getDeptSafetyWorksList();
|
this.getDeptSafetyWorksList();
|
||||||
this.getProjectInsuranceList();
|
this.getProjectInsuranceList();
|
||||||
|
@ -478,6 +491,90 @@ export default {
|
||||||
this.fileTitle = _title;
|
this.fileTitle = _title;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
getWorkTrainChart(){
|
||||||
|
this.$api.workTrain.getGroupByDataType(this.dept?.id||0,this.projectInfo?.id||0).then(d => {
|
||||||
|
this.WorkTrainChart1=(d.data||[]).filter(it=>it.trainType==='a').map(it=>{return {value:it.id||0,name:it.trainTitle}});
|
||||||
|
this.WorkTrainChart2=(d.data||[]).filter(it=>it.trainType==='b').map(it=>{return {value:it.id||0,name:it.trainTitle}});
|
||||||
|
let cnt=0;
|
||||||
|
this.WorkTrainChart1.forEach(it=>{cnt+=it.value||0;})
|
||||||
|
this.WorkTrainCnt1=cnt;
|
||||||
|
cnt=0;
|
||||||
|
this.WorkTrainChart2.forEach(it=>{cnt+=it.value||0;})
|
||||||
|
this.WorkTrainCnt2=cnt;
|
||||||
|
|
||||||
|
let opt = {
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'item'
|
||||||
|
},
|
||||||
|
series: [{
|
||||||
|
type: 'pie',
|
||||||
|
radius: '60%',
|
||||||
|
data: this.WorkTrainChart1,
|
||||||
|
label: {
|
||||||
|
color: "#fff",
|
||||||
|
formatter: '{name|{b}}\n{cnt|{c}}',
|
||||||
|
rich: {
|
||||||
|
name:{
|
||||||
|
|
||||||
|
},
|
||||||
|
cnt: {
|
||||||
|
fontSize: 10,
|
||||||
|
color: '#eee'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
this.$refs.chart3.init(opt);
|
||||||
|
let tmps=this.WorkTrainChart2;
|
||||||
|
let opt2 = {
|
||||||
|
grid: {
|
||||||
|
left: 10,
|
||||||
|
right:10,
|
||||||
|
top:40,
|
||||||
|
bottom:60
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'axis',
|
||||||
|
axisPointer: {
|
||||||
|
type: 'shadow'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
color: ['#409eff'],
|
||||||
|
xAxis: {
|
||||||
|
type: 'category',
|
||||||
|
data: tmps.map(d => d.name.replace("演练","\n演练")),
|
||||||
|
axisLabel: {
|
||||||
|
color: "#fff",
|
||||||
|
fontSize:10,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
type: 'value',
|
||||||
|
axisLabel: {
|
||||||
|
show:false,
|
||||||
|
color: "#fff"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
|
||||||
|
label: {
|
||||||
|
show:true,
|
||||||
|
color: '#82c9ff',
|
||||||
|
position: 'top',
|
||||||
|
},
|
||||||
|
data: tmps.map(d => d.value),
|
||||||
|
type: 'bar'
|
||||||
|
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
this.$refs.chart4.init(opt2);
|
||||||
|
});
|
||||||
|
},
|
||||||
// 获取专项培训列表
|
// 获取专项培训列表
|
||||||
getWorkTrainList() {
|
getWorkTrainList() {
|
||||||
this.$api.workTrain.getWorkTrainList(0, this.dept?.id||0,this.projectInfo?.id||0).then(d => {
|
this.$api.workTrain.getWorkTrainList(0, this.dept?.id||0,this.projectInfo?.id||0).then(d => {
|
||||||
|
|
|
@ -37,8 +37,8 @@ module.exports = defineConfig({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'/jhapi':{
|
'/jhapi':{
|
||||||
target: `http://62.234.3.186/jhapi/`,
|
//target: `http://62.234.3.186/jhapi/`,
|
||||||
//target: `http://127.0.0.1:8090/jhapi/`,
|
target: `http://127.0.0.1:8090/jhapi/`,
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
pathRewrite: {
|
pathRewrite: {
|
||||||
'^/jhapi':'/'
|
'^/jhapi':'/'
|
||||||
|
|
Loading…
Reference in New Issue