bug修改
This commit is contained in:
parent
2f086a614e
commit
1a30c404cb
|
@ -32,7 +32,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
// 获取数据
|
// 获取数据
|
||||||
showData(row, id) {
|
showData(row, id) {
|
||||||
this.divId = id;
|
this.divId = id || 'waterChar';
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.dialogFormVisible = true;
|
this.dialogFormVisible = true;
|
||||||
this.chartData = [];
|
this.chartData = [];
|
||||||
|
|
|
@ -118,7 +118,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
// 曲线图
|
// 曲线图
|
||||||
graph(row) {
|
graph(row) {
|
||||||
this.$refs['water'].showData(row);
|
this.$refs['water'].showData(row, 'elecMonth');
|
||||||
},
|
},
|
||||||
//标准时间转yyyy-mm-dd
|
//标准时间转yyyy-mm-dd
|
||||||
standardToTime() {
|
standardToTime() {
|
||||||
|
|
|
@ -118,7 +118,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
// 曲线图
|
// 曲线图
|
||||||
graph(row) {
|
graph(row) {
|
||||||
this.$refs['water'].showData(row);
|
this.$refs['water'].showData(row, 'waterMonth');
|
||||||
},
|
},
|
||||||
//标准时间转yyyy-mm-dd
|
//标准时间转yyyy-mm-dd
|
||||||
standardToTime() {
|
standardToTime() {
|
||||||
|
|
|
@ -445,7 +445,7 @@ export default {
|
||||||
},
|
},
|
||||||
sensorEdit(row) {
|
sensorEdit(row) {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: '传感器管理',
|
name: 'Sensor management',
|
||||||
path: '/sensor',
|
path: '/sensor',
|
||||||
query: { deviceId: row.id },
|
query: { deviceId: row.id },
|
||||||
});
|
});
|
||||||
|
@ -453,7 +453,7 @@ export default {
|
||||||
sensorData(row) {
|
sensorData(row) {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: '站点最新数据',
|
name: '站点最新数据',
|
||||||
path: '/sensorIotData',
|
path: '/sensorData',
|
||||||
query: { deviceCode: row.code, deviceId: row.id },
|
query: { deviceCode: row.code, deviceId: row.id },
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -134,7 +134,7 @@ export default {
|
||||||
historical(row) {
|
historical(row) {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/showdata',
|
path: '/showdata',
|
||||||
name: '历史数据',
|
name: 'History data',
|
||||||
query: { dataKey: row.dataKey, deviceCode: this.queryForm.deviceCode },
|
query: { dataKey: row.dataKey, deviceCode: this.queryForm.deviceCode },
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -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>
|
|
@ -468,14 +468,14 @@ export default {
|
||||||
sensorData(row) {
|
sensorData(row) {
|
||||||
debugger;
|
debugger;
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: '传感器数据',
|
name: 'Sensor data',
|
||||||
path: '/sensorData',
|
path: '/sensorData',
|
||||||
query: { deviceCode: row.code, deviceId: row.id },
|
query: { deviceCode: row.code, deviceId: row.id },
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
sensorEdit(row) {
|
sensorEdit(row) {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: '传感器管理',
|
name: 'Sensor management',
|
||||||
path: '/sensor',
|
path: '/sensor',
|
||||||
query: { deviceId: row.id, projectId: this.queryForm.projectId },
|
query: { deviceId: row.id, projectId: this.queryForm.projectId },
|
||||||
});
|
});
|
||||||
|
|
|
@ -447,15 +447,15 @@ export default {
|
||||||
},
|
},
|
||||||
sensorData(row) {
|
sensorData(row) {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: '传感器数据',
|
name: 'Sensor data',
|
||||||
path: '/sensorIotData',
|
path: '/sensorData',
|
||||||
query: { deviceCode: row.code, deviceId: row.id },
|
query: { deviceCode: row.code, deviceId: row.id },
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
sensorEdit(row) {
|
sensorEdit(row) {
|
||||||
console.log(row);
|
console.log(row);
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: '传感器管理',
|
name: 'Sensor management',
|
||||||
path: '/sensor',
|
path: '/sensor',
|
||||||
query: { deviceId: row.id, projectId: this.queryForm.projectId },
|
query: { deviceId: row.id, projectId: this.queryForm.projectId },
|
||||||
});
|
});
|
||||||
|
|
|
@ -98,7 +98,7 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.queryForm.pageNo = 1;
|
this.queryForm.page = 1;
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
},
|
},
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
|
@ -106,7 +106,7 @@ export default {
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
},
|
},
|
||||||
handleCurrentChange(val) {
|
handleCurrentChange(val) {
|
||||||
this.queryForm.pageNo = val;
|
this.queryForm.page = val;
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -109,7 +109,7 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.queryForm.pageNo = 1;
|
this.queryForm.page = 1;
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
},
|
},
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
|
@ -117,7 +117,7 @@ export default {
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
},
|
},
|
||||||
handleCurrentChange(val) {
|
handleCurrentChange(val) {
|
||||||
this.queryForm.pageNo = val;
|
this.queryForm.page = val;
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -108,7 +108,7 @@ export default {
|
||||||
}, 500);
|
}, 500);
|
||||||
},
|
},
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.queryForm.pageNo = 1;
|
this.queryForm.page = 1;
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
},
|
},
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
|
|
|
@ -207,7 +207,7 @@
|
||||||
<vab-query-form-right-panel>
|
<vab-query-form-right-panel>
|
||||||
<el-pagination
|
<el-pagination
|
||||||
:background="background"
|
:background="background"
|
||||||
:current-page="queryForm.pageNo"
|
:current-page="queryForm.page"
|
||||||
:layout="layout"
|
:layout="layout"
|
||||||
:page-size="queryForm.pageSize"
|
:page-size="queryForm.pageSize"
|
||||||
:total="total"
|
:total="total"
|
||||||
|
|
|
@ -86,7 +86,7 @@
|
||||||
<vab-query-form-right-panel>
|
<vab-query-form-right-panel>
|
||||||
<el-pagination
|
<el-pagination
|
||||||
:background="background"
|
:background="background"
|
||||||
:current-page="queryForm.pageNo"
|
:current-page="queryForm.page"
|
||||||
:layout="layout"
|
:layout="layout"
|
||||||
:page-size="queryForm.pageSize"
|
:page-size="queryForm.pageSize"
|
||||||
:total="total"
|
:total="total"
|
||||||
|
|
|
@ -73,7 +73,7 @@
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination
|
<el-pagination
|
||||||
:background="background"
|
:background="background"
|
||||||
:current-page="queryForm.pageNo"
|
:current-page="queryForm.page"
|
||||||
:layout="layout"
|
:layout="layout"
|
||||||
:page-size="queryForm.pageSize"
|
:page-size="queryForm.pageSize"
|
||||||
:total="total"
|
:total="total"
|
||||||
|
@ -155,7 +155,7 @@ export default {
|
||||||
this.$refs['edit'].showEdit(row);
|
this.$refs['edit'].showEdit(row);
|
||||||
},
|
},
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.queryForm.pageNo = 1;
|
this.queryForm.page = 1;
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
},
|
},
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
|
@ -163,7 +163,7 @@ export default {
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
},
|
},
|
||||||
handleCurrentChange(val) {
|
handleCurrentChange(val) {
|
||||||
this.queryForm.pageNo = val;
|
this.queryForm.page = val;
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
},
|
},
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
|
|
|
@ -73,7 +73,7 @@
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination
|
<el-pagination
|
||||||
:background="background"
|
:background="background"
|
||||||
:current-page="queryForm.pageNo"
|
:current-page="queryForm.page"
|
||||||
:layout="layout"
|
:layout="layout"
|
||||||
:page-size="queryForm.pageSize"
|
:page-size="queryForm.pageSize"
|
||||||
:total="total"
|
:total="total"
|
||||||
|
@ -155,7 +155,7 @@ export default {
|
||||||
this.$refs['edit'].showEdit(row);
|
this.$refs['edit'].showEdit(row);
|
||||||
},
|
},
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.queryForm.pageNo = 1;
|
this.queryForm.page = 1;
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
},
|
},
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
|
@ -163,7 +163,7 @@ export default {
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
},
|
},
|
||||||
handleCurrentChange(val) {
|
handleCurrentChange(val) {
|
||||||
this.queryForm.pageNo = val;
|
this.queryForm.page = val;
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
},
|
},
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
|
|
Loading…
Reference in New Issue