Browse Source

设置定时加载

master
lucky 4 years ago
parent
commit
7070c33946
  1. 57
      src/components/amount.vue
  2. 68
      src/components/curve.vue
  3. 6
      src/components/humidity.vue
  4. 9
      src/components/temperature.vue
  5. 7
      src/components/toolbar.vue
  6. 2
      src/views/jht.vue
  7. 2
      src/views/xh.vue
  8. 2
      src/views/yj.vue

57
src/components/amount.vue

@ -3,7 +3,7 @@
<div class="title-value">
<div class="word">吞吐量实时统计</div>
</div>
<div :style="{ width: '92%', height: '90%',margin: '8% 3% auto 5%' }" id="throughput"></div>
<div :style="{ width: '94%', height: '90%',margin: '6% 3% auto 5%' }" id="throughput"></div>
</div>
</template>
@ -29,10 +29,8 @@ export default defineComponent({
let arr = []
if (carOfInLists && carOfInLists.length) {
carOfInLists.forEach((item) => {
arr.push(item.temp)
arr.push(item.carOfIn)
})
} else {
arr = [45, 55, 56, 73, 76, 95, 98]
}
return arr
},
@ -43,10 +41,8 @@ export default defineComponent({
let arr = []
if (carOfOutLists && carOfOutLists.length) {
carOfOutLists.forEach((item) => {
arr.push(item.temp)
arr.push(item.carOfOut)
})
} else {
arr = [15, 25, 26, 33, 46, 55, 68]
}
return arr
},
@ -59,36 +55,16 @@ export default defineComponent({
carOfInLists.forEach((item) => {
arr.push(item.time)
})
} else {
arr = ['5月5日', '5月6日', '5月6日', '5月7日', '5月8日', '5月9日', '5月10日']
}
return arr
},
},
watch: {
carOfInLists: {
deep: true,
handler(value) {
if (value) {
this.getOptions()
}
},
},
carOfOutLists: {
deep: true,
handler(value) {
if (value) {
this.getOptions()
}
},
},
},
created() {
//
this.getMbpsByTime()
setInterval(() => {
//
this.getMbpsByTime()
}, 3000)
},
mounted() {
@ -124,12 +100,12 @@ export default defineComponent({
this.myCharts.setOption({
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#6a7985',
},
},
},
grid: {
left: '6%',
right: '15%',
bottom: '15%',
containLabel: true,
},
xAxis: {
type: 'category',
@ -139,6 +115,7 @@ export default defineComponent({
yAxis: {
type: 'value',
name: '数量',
min: 0,
splitLine: {
show: true,
lineStyle: {
@ -149,7 +126,6 @@ export default defineComponent({
series: [
{
name: '吞进量',
data: weightOfIns,
type: 'line',
lineStyle: {
color: '#FC8452',
@ -172,11 +148,12 @@ export default defineComponent({
},
]),
},
data: weightOfIns,
},
{
name: '吐出量',
data: weightOfOuts,
type: 'line',
smooth: true,
lineStyle: {
color: '#73C0DE',
},
@ -185,7 +162,6 @@ export default defineComponent({
color: '#73C0DE',
},
},
smooth: true,
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
@ -198,6 +174,7 @@ export default defineComponent({
},
]),
},
data: weightOfOuts,
},
],
})

68
src/components/curve.vue

@ -42,10 +42,8 @@ export default defineComponent({
let arr = []
if (weightOfInLists && weightOfInLists.length) {
weightOfInLists.forEach((item) => {
arr.push(item.temp)
arr.push(item.weightOfIn)
})
} else {
arr = [45, 55, 56, 73, 76, 95, 98]
}
return arr
},
@ -56,10 +54,8 @@ export default defineComponent({
let arr = []
if (weightOfOutLists && weightOfOutLists.length) {
weightOfOutLists.forEach((item) => {
arr.push(item.temp)
arr.push(item.weightOfOut)
})
} else {
arr = [15, 25, 26, 33, 46, 55, 68]
}
return arr
},
@ -72,36 +68,19 @@ export default defineComponent({
weightOfInLists.forEach((item) => {
arr.push(item.time)
})
} else {
arr = ['10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00']
}
return arr
},
},
watch: {
weightOfInLists: {
deep: true,
handler(value) {
if (value) {
this.getOptions()
}
},
},
weightOfOutLists: {
deep: true,
handler(value) {
if (value) {
this.getOptions()
}
},
},
created() {
setInterval(() => {
//
this.getMbpsByTime(this.currentIndex)
}, 4000)
},
mounted() {
//
// this.getMbpsByTime()
//
this.getOptions()
},
@ -118,7 +97,7 @@ export default defineComponent({
* @param {number} startTime 开始时间
* @param {number} queryType 查询类型(0-按天,1-按周,2-按月,3-按年)
*/
async getMbpsByTime(queryType = 0) {
async getMbpsByTime(queryType) {
try {
const { parkId, warehouseId } = this.$route.query
const param = { parkId: parkId || 2, warehouseId: warehouseId || 7, queryType }
@ -138,14 +117,6 @@ export default defineComponent({
const comparisonChart = document.getElementById('comparisonChart')
this.myCharts = echarts.init(comparisonChart)
this.myCharts.setOption({
// title: {
// text: '线',
// textStyle: {
// color: '#03D7FA',
// fontWeight: 'normal',
// fontSize: '16rem',
// },
// },
tooltip: {
trigger: 'axis',
axisPointer: {
@ -156,10 +127,10 @@ export default defineComponent({
},
},
grid: {
x: 30,
y: 50,
x2: 0,
y2: 30,
left: '0',
right: '6%',
bottom: '15%',
containLabel: true,
},
xAxis: {
type: 'category',
@ -170,26 +141,13 @@ export default defineComponent({
type: 'value',
name: '重量(吨)',
min: 0,
splitNumber: 4,
// splitNumber: 4,
splitLine: {
show: true,
lineStyle: {
color: 'rgba(255,255,255,0.1)',
},
},
axisLine: {
show: false,
},
axisLabel: {
show: false,
margin: 20,
textStyle: {
color: '#d1e6eb',
},
},
axisTick: {
show: false,
},
},
series: [
{

6
src/components/humidity.vue

@ -63,8 +63,10 @@ export default defineComponent({
},
created() {
//
this.getTeamAndHumidity()
setInterval(() => {
//
this.getTeamAndHumidity()
}, 4500)
},
mounted() {

9
src/components/temperature.vue

@ -62,9 +62,14 @@ export default defineComponent({
},
},
created() {
setInterval(() => {
//
this.getTeamAndHumidity()
}, 3500)
},
mounted() {
//
this.getTeamAndHumidity()
//
this.getOptions()
},

7
src/components/toolbar.vue

@ -64,8 +64,11 @@ export default defineComponent({
this.getNowFormatDate()
}, 1000)
this.getTeamAndHumidity()
this.getFireOrFlood()
setInterval(() => {
//
this.getTeamAndHumidity()
this.getFireOrFlood()
}, 3000)
},
methods: {

2
src/views/jht.vue

@ -58,7 +58,7 @@
<!-- 生产 https://www.tall.wiki/kangfu-v1/?key=E83239936 -->
<!-- 测试 https://www.tall.wiki/kangfu-v1/?key=230659446 -->
<div class="screen">
<img class="frame2" src="../assets/fullScreen.png" />
<img @click="$router.push('/vs')" class="frame2" src="../assets/fullScreen.png" />
</div>
</div>
</div>

2
src/views/xh.vue

@ -57,7 +57,7 @@
<!-- 生产 https://www.tall.wiki/kangfu-v1/?key=E83239936 -->
<!-- 测试 https://www.tall.wiki/kangfu-v1/?key=230659446 -->
<div class="screen">
<img class="frame2" src="../assets/fullScreen.png" />
<img @click="$router.push('/vs')" class="frame2" src="../assets/fullScreen.png" />
</div>
</div>
</div>

2
src/views/yj.vue

@ -57,7 +57,7 @@
<!-- 生产 https://www.tall.wiki/kangfu-v1/?key=E83239936 -->
<!-- 测试 https://www.tall.wiki/kangfu-v1/?key=230659446 -->
<div class="screen">
<img class="frame2" src="../assets/fullScreen.png" />
<img @click="$router.push('/vs')" class="frame2" src="../assets/fullScreen.png" />
</div>
</div>
</div>

Loading…
Cancel
Save