bug修改

This commit is contained in:
Cc 2025-02-20 15:37:28 +08:00
parent 2f086a614e
commit 1a30c404cb
15 changed files with 207 additions and 24 deletions

View File

@ -32,7 +32,7 @@ export default {
methods: {
//
showData(row, id) {
this.divId = id;
this.divId = id || 'waterChar';
this.loading = true;
this.dialogFormVisible = true;
this.chartData = [];

View File

@ -118,7 +118,7 @@ export default {
methods: {
// 线
graph(row) {
this.$refs['water'].showData(row);
this.$refs['water'].showData(row, 'elecMonth');
},
//yyyy-mm-dd
standardToTime() {

View File

@ -118,7 +118,7 @@ export default {
methods: {
// 线
graph(row) {
this.$refs['water'].showData(row);
this.$refs['water'].showData(row, 'waterMonth');
},
//yyyy-mm-dd
standardToTime() {

View File

@ -445,7 +445,7 @@ export default {
},
sensorEdit(row) {
this.$router.push({
name: '传感器管理',
name: 'Sensor management',
path: '/sensor',
query: { deviceId: row.id },
});
@ -453,7 +453,7 @@ export default {
sensorData(row) {
this.$router.push({
name: '站点最新数据',
path: '/sensorIotData',
path: '/sensorData',
query: { deviceCode: row.code, deviceId: row.id },
});
},

View File

@ -134,7 +134,7 @@ export default {
historical(row) {
this.$router.push({
path: '/showdata',
name: '历史数据',
name: 'History data',
query: { dataKey: row.dataKey, deviceCode: this.queryForm.deviceCode },
});
},

View File

@ -0,0 +1,183 @@
<template>
<div>
<el-button
type="primary"
style="display: block; margin-left: 40px"
ref="printButton"
v-print="'#printCanvas'"
>
打印
</el-button>
<div id="printCanvas" class="container">
<img src="@/assets/mb.png" />
<div class="date">{{ currentDate }}</div>
<img :src="qcodeImg" class="qrcodeimg" ass />
<div class="qrcodeSn">{{ sn }}</div>
</div>
</div>
</template>
<script setup>
import QRCode from 'qrcode';
import { ref, onMounted } from 'vue';
const canvasref = ref(null);
const qcodeImg = ref();
const props = defineProps(['url', 'id']);
console.log(props.url);
const sn = ref(props.id);
const printButton = ref(null);
const currentDate = ref('');
function getCurrentDate() {
const date = new Date();
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
currentDate.value = `${year}-${month}-${day}`;
}
onMounted(() => {
QRCode.toDataURL(props.url, (error, url) => {
if (url) {
qcodeImg.value = url;
}
if (error) console.error(error);
});
getCurrentDate(); //
});
</script>
<style second>
.container {
width: 600px;
height: 400px;
position: relative;
img {
width: 100%;
}
.qrcodeimg {
width: 110px;
height: 110px;
position: absolute;
bottom: 73px;
right: 50px;
}
.qrcodeSn {
position: absolute;
bottom: 54px;
right: 59px;
color: #000;
font-weight: bold;
}
.equipment {
position: absolute;
top: 231px;
left: 281px;
font-size: 20px;
font-weight: 500;
color: #000;
}
.date {
position: absolute;
top: 121px;
left: 180px;
font-size: 20px;
font-weight: 500;
color: #000;
}
}
</style>
<style scoped>
@media print {
@page {
size: 90mm 60mm;
margin: 0;
padding: 0;
}
body {
font-family: 'Arial', sans-serif;
font-size: 12pt;
color: #333;
margin: 0;
padding: 0;
}
.container {
width: 90mm;
height: 60mm;
position: relative;
.equipment {
position: absolute;
top: 24mm;
left: 28mm;
font-size: 6pt;
font-weight: 500;
color: #000;
}
.date {
position: absolute;
top: 71px;
left: 25mm;
font-size: 9pt;
font-weight: 500;
color: #000;
}
img {
width: 85mm;
height: 58mm;
}
.qrcodeimg {
width: 17mm;
height: 17mm;
position: absolute;
bottom: 33px;
right: 10mm;
}
.qrcodeSn {
position: absolute;
bottom: 22px;
right: 11mm;
font-size: 6pt;
color: #000;
font-weight: bold;
}
}
.containerTable {
width: 60mm;
border: 1px solid #000;
background: #ccc;
font-size: 12pt;
color: #000;
.item {
border-top: 1px solid #000;
padding-left: 10px;
height: 5mm;
line-height: 5mm;
}
.flexCss {
text-align: center;
display: flex;
.flexleft {
width: 30%;
border-right: 1px solid #000;
}
}
.footer {
border-top: 1px solid #000;
display: flex;
.footerLeft {
width: 70%;
text-align: center;
.smallsize {
font-size: 2pt;
}
}
}
}
}
</style>

View File

@ -468,14 +468,14 @@ export default {
sensorData(row) {
debugger;
this.$router.push({
name: '传感器数据',
name: 'Sensor data',
path: '/sensorData',
query: { deviceCode: row.code, deviceId: row.id },
});
},
sensorEdit(row) {
this.$router.push({
name: '传感器管理',
name: 'Sensor management',
path: '/sensor',
query: { deviceId: row.id, projectId: this.queryForm.projectId },
});

View File

@ -447,15 +447,15 @@ export default {
},
sensorData(row) {
this.$router.push({
name: '传感器数据',
path: '/sensorIotData',
name: 'Sensor data',
path: '/sensorData',
query: { deviceCode: row.code, deviceId: row.id },
});
},
sensorEdit(row) {
console.log(row);
this.$router.push({
name: '传感器管理',
name: 'Sensor management',
path: '/sensor',
query: { deviceId: row.id, projectId: this.queryForm.projectId },
});

View File

@ -98,7 +98,7 @@ export default {
});
},
handleQuery() {
this.queryForm.pageNo = 1;
this.queryForm.page = 1;
this.fetchData();
},
handleSizeChange(val) {
@ -106,7 +106,7 @@ export default {
this.fetchData();
},
handleCurrentChange(val) {
this.queryForm.pageNo = val;
this.queryForm.page = val;
this.fetchData();
},
},

View File

@ -109,7 +109,7 @@ export default {
});
},
handleQuery() {
this.queryForm.pageNo = 1;
this.queryForm.page = 1;
this.fetchData();
},
handleSizeChange(val) {
@ -117,7 +117,7 @@ export default {
this.fetchData();
},
handleCurrentChange(val) {
this.queryForm.pageNo = val;
this.queryForm.page = val;
this.fetchData();
},
},

View File

@ -108,7 +108,7 @@ export default {
}, 500);
},
handleQuery() {
this.queryForm.pageNo = 1;
this.queryForm.page = 1;
this.fetchData();
},
handleSizeChange(val) {

View File

@ -207,7 +207,7 @@
<vab-query-form-right-panel>
<el-pagination
:background="background"
:current-page="queryForm.pageNo"
:current-page="queryForm.page"
:layout="layout"
:page-size="queryForm.pageSize"
:total="total"

View File

@ -86,7 +86,7 @@
<vab-query-form-right-panel>
<el-pagination
:background="background"
:current-page="queryForm.pageNo"
:current-page="queryForm.page"
:layout="layout"
:page-size="queryForm.pageSize"
:total="total"

View File

@ -73,7 +73,7 @@
</el-table>
<el-pagination
:background="background"
:current-page="queryForm.pageNo"
:current-page="queryForm.page"
:layout="layout"
:page-size="queryForm.pageSize"
:total="total"
@ -155,7 +155,7 @@ export default {
this.$refs['edit'].showEdit(row);
},
handleQuery() {
this.queryForm.pageNo = 1;
this.queryForm.page = 1;
this.fetchData();
},
handleSizeChange(val) {
@ -163,7 +163,7 @@ export default {
this.fetchData();
},
handleCurrentChange(val) {
this.queryForm.pageNo = val;
this.queryForm.page = val;
this.fetchData();
},
handleDelete(row) {

View File

@ -73,7 +73,7 @@
</el-table>
<el-pagination
:background="background"
:current-page="queryForm.pageNo"
:current-page="queryForm.page"
:layout="layout"
:page-size="queryForm.pageSize"
:total="total"
@ -155,7 +155,7 @@ export default {
this.$refs['edit'].showEdit(row);
},
handleQuery() {
this.queryForm.pageNo = 1;
this.queryForm.page = 1;
this.fetchData();
},
handleSizeChange(val) {
@ -163,7 +163,7 @@ export default {
this.fetchData();
},
handleCurrentChange(val) {
this.queryForm.pageNo = val;
this.queryForm.page = val;
this.fetchData();
},
handleDelete(row) {