电器BI调整 q=6接口代码

This commit is contained in:
xielue 2025-08-07 10:15:18 +08:00
parent 5f1bc5f444
commit e08955ad09
12 changed files with 320 additions and 147 deletions

View File

@ -29,6 +29,15 @@ export default {
created() {
this.dataType = dataTypeParam;
if (this.dataType == '6') {
api.post2('/api/web/getBiData', ["yx_v_llzj", "yx_v_cpzj", "yx_v_zlkb", "yx_v_cpzj", "yx_v_byblv", "yx_v_byblzb"]).then(res => {
console.log(res);
});
}
if (this.dataType == '3') {
this.init();
} else {
@ -37,9 +46,9 @@ export default {
this.currentComponent = 'datav2';
} else if (this.dataType == '5') {
this.currentComponent = 'datav3';
} else if (this.dataType == '6'){
} else if (this.dataType == '6') {
this.currentComponent = 'datav2';
} else{
} else {
this.currentComponent = 'datav';
}
}

View File

@ -8,9 +8,17 @@ const api = {
baseURL3: 'http://36.139.158.169:9261',
// baseURL: 'http://ppjlar.demo.natool.cn',
baseURL: 'http://xynzix.demo.natool.cn',
baseURL: 'http://39.101.165.228:9009',
//堡座
baseURL4: 'http://39.101.165.228:9009',
//尚博
baseURL5: 'http://39.101.203.37:9001',
baseURL6: 'http://127.0.0.1:9162',
// baseURL: '',
get (url) {
return new Promise((resolve, reject) => {

100
src/assets/index.html Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -9,18 +9,18 @@
<NewContain :resData="resData" style="width:100%;height:100%" />
</div>
<div class="main-container" style="width: 32%;">
<NewContain2 :resData="resData" style="width:100%;height:100%"/>
<NewContain2 :resData="resData" style="width:100%;height:100%" />
</div>
<div class="main-container" style="width: 32%;">
<NewContain3 :resData="resData" style="width:100%;height:100%"/>
<NewContain3 :resData="resData" style="width:100%;height:100%" />
</div>
</div>
<div v-if="resData" style="display:flex;height: 44%;justify-content: space-around;">
<div class="main-container" style="width: 48%;">
<NewContain4 :resData="resData" style="width:100%;height:100%"/>
<NewContain4 :resData="resData" style="width:100%;height:100%" />
</div>
<div class="main-container" style="width: 48%;">
<NewContain5 :resData="resData" style="width:100%;height:100%"/>
<NewContain5 :resData="resData" style="width:100%;height:100%" />
</div>
</div>
@ -52,23 +52,32 @@ export default {
},
created() {
// URL dataType
// const queryParams = new URLSearchParams(window.location.search);
// const dataTypeParam = queryParams.get('q');
this.$api.post('/api/pg/GetBIDemo',{
code:'11'
}).then(res=>{
const queryParams = new URLSearchParams(window.location.search);
const dataTypeParam = queryParams.get('q');
let loadData = () => {
this.$api.post('/api/pg/GetBIData', {
code: dataTypeParam
}).then(res => {
console.log(res.data)
if(res.code == 200){
if (res.code == 200) {
this.resData = res.data;
}
})
};
loadData();
setInterval(() => {
loadData();
}, 1000 * 60);
},
data() {
return {
resData:null,
dataType:'',
dataType2:'整机',
resData: null,
dataType: '',
dataType2: '整机',
switchType: 2
}
}

View File

@ -11,21 +11,10 @@
<p style="margin: 0;font-size: 19px;text-align: center;font-weight: bold;">BASIC INFORMATION</p>
</div>
<div class="ncbmc-content">
<div class="text-item">
<p class="item-left">总人数:</p>
<p class="item-right">{{resData.info.PersonNumber}}</p>
</div>
<!-- <div class="text-item">
<p class="item-left">订单数量:</p>
<p class="item-right">{{ resData.info.OrderQuantity }}</p>
</div>
<div class="text-item">
<p class="item-left">完成数:</p>
<p class="item-right">{{ resData.info.DoneQuantity }}</p>
</div> -->
<div class="text-item" v-for="(item,index) in resData.info.Contacts" :key="'person'+index">
<p class="item-left">负责人:</p>
<p class="item-right">{{item.Name}}{{ item.Phone }}</p>
<div class="text-item" v-for="(item,index) in resData.info.Infos" :key="'info'+index">
<p class="item-left">{{item.name}}:</p>
<p class="item-right">{{ item.content }}</p>
</div>
</div>

View File

@ -13,11 +13,11 @@
<div class="ncb-currenttask">
<div class="current-title">
<span class="title-decoration"></span>
<span style="color: aqua;">当前工单</span>WOOLA12134422
<span style="color: aqua;">当前工单</span>{{resData.info.OrderCode}}
</div>
<div class="current-item">
<span class="current-item-name">产品编码</span>
<span class="current-item-value">{{resData.info.OrderCode}}</span>
<span class="current-item-value">{{resData.info.InventoryCode}}</span>
</div>
<div class="current-item">
<span class="current-item-name">产品名称</span>
@ -37,7 +37,7 @@
<div style="display: flex;">
<div class="current-item">
<span class="current-item-name">完工进度</span>
<span class="current-item-value">{{resData.info.DoneRate * 100}}%</span>
<span class="current-item-value">{{parseFloat(resData.info.DoneRate * 100).toFixed(1)}}%</span>
</div>
<div class="current-item">
<span class="current-item-name">备料齐套进度</span>

View File

@ -14,39 +14,58 @@
</div>
</div>
</template>
<script>
<script>
import LabelTag from './LabelTag'
import * as echarts from 'echarts';
import * as echarts from 'echarts'
import testRes from './test'
console.log(testRes)
export default {
name: 'CenterCmp',
components: {
LabelTag,
},
props: {
resData:{
type:Object,
resData: {
type: Object,
required: true,
default: () => ({})
},
dataType: {
type: String,
default: ''
}
},
data () {
return {}
data() {
return {
chart: null
}
},
mounted() {
this.initMixedChart()
this.initChart()
window.addEventListener('resize', this.resizeChart)
},
watch: {
// resData
resData: {
deep: true,
handler(newData) {
this.updateChart(newData)
}
}
},
methods: {
initMixedChart() {
const chartDom = document.getElementById('nbc-line1');
const myChart = echarts.init(chartDom);
const actualData = this.resData.productionData.actual;
const targetData = this.resData.productionData.target;
initChart() {
const chartDom = document.getElementById('nbc-line1')
this.chart = echarts.init(chartDom)
this.updateChart(this.resData)
},
updateChart(data) {
if (!this.chart) return
const actualData = data.productionData.actual || []
const targetData = data.productionData.target || []
const timeSlots = data.productionData.timeSlots || []
const option = {
tooltip: {
trigger: 'axis',
@ -58,30 +77,30 @@ export default {
}
},
legend: {
data: ['目标产量','实际产量'],
bottom: 10, //
data: ['目标产量', '实际产量'],
bottom: 10,
textStyle: {
fontSize: '20',
color: '#fff' //
color: '#fff'
}
},
xAxis: {
type: 'category',
data:this.resData.productionData.timeSlots,
data: timeSlots,
axisLabel: {
fontSize: 14, // x
fontWeight: 'bold', // x
color: '#fff' // x
fontSize: 14,
fontWeight: 'bold',
color: '#fff'
}
},
yAxis: {
type: 'value',
axisLabel: {
fontSize: 20, // y
fontWeight: 'bold', // y
color: '#fff' // y
fontSize: 20,
fontWeight: 'bold',
color: '#fff'
},
splitLine: { // y 线
splitLine: {
show: false
}
},
@ -89,20 +108,20 @@ export default {
{
name: '实际产量',
type: 'bar',
barWidth: '35%', //
barWidth: '35%',
data: actualData,
itemStyle: {
color: 'rgb(255, 255, 204)' //
color: 'rgb(255, 255, 204)'
},
label: {
show: true,
position: 'inside',
fontSize: '18px',
fontWeight: 'bolder', // label
formatter: function(params) {
return params.value;
fontWeight: 'bolder',
formatter: function (params) {
return params.value
},
color:'red',
color: 'red'
}
},
{
@ -110,25 +129,35 @@ export default {
type: 'line',
data: targetData,
itemStyle: {
color: 'rgb(173, 216, 230)' //
color: 'rgb(173, 216, 230)'
},
label: {
show: true,
position: 'top',
fontSize: '20px',
fontWeight: 'bold', // label
formatter: function(params) {
return params.value;
fontWeight: 'bold',
formatter: function (params) {
return params.value
},
color: 'rgb(173, 216, 230)' //
color: 'rgb(173, 216, 230)'
}
}
]
};
myChart.setOption(option);
window.addEventListener('resize', () => {
myChart.resize();
});
}
this.chart.setOption(option, true) // true
},
resizeChart() {
if (this.chart) {
this.chart.resize()
}
}
},
beforeDestroy() {
window.removeEventListener('resize', this.resizeChart)
if (this.chart) {
this.chart.dispose()
this.chart = null
}
}
}

View File

@ -20,43 +20,60 @@
</div>
</template>
<script>
<script>
import LabelTag from './LabelTag'
import * as echarts from 'echarts';
import * as echarts from 'echarts'
import testRes from './test'
console.log(testRes)
export default {
name: 'CenterCmp',
components: {
LabelTag,
LabelTag
},
props: {
resData:{
type:Object,
resData: {
type: Object,
required: true
},
dataType: {
type: String,
default: ''
}
},
data () {
data() {
return {
myChart: null // ECharts
}
},
// mounted()
mounted() {
this.initMixedChart()
this.initChart()
},
watch: {
resData: {
deep: true,
handler(newVal) {
if (newVal && this.myChart) {
this.updateChart()
}
}
}
},
// methods
methods: {
initMixedChart() {
const chartDom = document.getElementById('nbc-line2');
const myChart = echarts.init(chartDom);
const actualData =this.resData.upphData.actual;
const targetData =this.resData.upphData.target;
initChart() {
const chartDom = document.getElementById('nbc-line2')
this.myChart = echarts.init(chartDom)
this.updateChart()
//
window.addEventListener('resize', this.handleResize)
},
updateChart() {
const actualData = this.resData.upphData.actual
const targetData = this.resData.upphData.target
const timeSlots = this.resData.upphData.timeSlots
const option = {
tooltip: {
trigger: 'axis',
@ -68,30 +85,30 @@ export default {
}
},
legend: {
data: ['目标UPPH','实际UPPH'],
bottom: 10, //
data: ['目标UPPH', '实际UPPH'],
bottom: 10,
textStyle: {
fontSize: '20',
color: '#fff' //
color: '#fff'
}
},
xAxis: {
type: 'category',
data:this.resData.upphData.timeSlots,
data: timeSlots,
axisLabel: {
fontSize: 14, // x
fontWeight: 'bold', // x
color: '#fff' // x
fontSize: 14,
fontWeight: 'bold',
color: '#fff'
}
},
yAxis: {
type: 'value',
axisLabel: {
fontSize: 20, // y
fontWeight: 'bold', // y
color: '#fff' // y
fontSize: 20,
fontWeight: 'bold',
color: '#fff'
},
splitLine: { // y 线
splitLine: {
show: false
}
},
@ -99,20 +116,20 @@ export default {
{
name: '实际UPPH',
type: 'bar',
barWidth: '35%', //
barWidth: '35%',
data: actualData,
itemStyle: {
color: 'rgb(255, 255, 204)' //
color: 'rgb(255, 255, 204)'
},
label: {
show: true,
position: 'inside',
fontSize: '18px',
fontWeight: 'bolder', // label
formatter: function(params) {
return params.value;
fontWeight: 'bolder',
formatter: function (params) {
return params.value
},
color: 'red',
color: 'red'
}
},
{
@ -120,25 +137,36 @@ export default {
type: 'line',
data: targetData,
itemStyle: {
color: 'rgb(173, 216, 230)' //
color: 'rgb(173, 216, 230)'
},
label: {
show: true,
position: 'top',
fontSize: '20px',
fontWeight: 'bold', // label
formatter: function(params) {
return params.value;
fontWeight: 'bold',
formatter: function (params) {
return params.value
},
color: 'rgb(173, 216, 230)' //
color: 'rgb(173, 216, 230)'
}
}
]
};
myChart.setOption(option);
window.addEventListener('resize', () => {
myChart.resize();
});
}
this.myChart.setOption(option, true) // true
},
handleResize() {
if (this.myChart) {
this.myChart.resize()
}
}
},
beforeDestroy() {
//
window.removeEventListener('resize', this.handleResize)
if (this.myChart) {
this.myChart.dispose()
this.myChart = null
}
}
}

View File

@ -1,7 +1,7 @@
import Vue from 'vue'
// import App from './App.vue'
import App from './App.vue'
// import App from './AppV2.vue'
import App from './AppV3.vue'
//import App from './AppV3.vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'