init project

This commit is contained in:
2022-06-27 09:50:26 +08:00
parent b3fcd339ea
commit b5da790c94
644 changed files with 94073 additions and 0 deletions

View File

@@ -0,0 +1,92 @@
<template>
<div>
<button @click="qrcode">二维码生成</button>
<button @click="oneCode">一维码生成</button>
<button @click="create">生成</button>
<el-button @click="printDemo">打印测试</el-button>
<vue-easy-print v-show="false" ref="easyPrint" :table-show="false" :space-row="true">
<div style="font-size: 20px">
<el-row style="border: 1px solid red">
<el-col :span="6">
<div id="qrcode" class="grid-content bg-purple"/>
</el-col>
<el-col :span="18">
<el-row style="margin-top: 1%">
<el-col :span="3">桶号:</el-col>
<el-col :span="21">CP00001</el-col>
</el-row>
<el-row style="margin-top: 3%">
<el-col :span="3">重量</el-col>
<el-col :span="21">50KG</el-col>
</el-row>
<el-row style="margin-top: 3%">
<el-col :span="3">日期</el-col>
<el-col :span="21">2021-11-01</el-col>
</el-row>
</el-col>
</el-row>
<el-row style="margin-top: 2%">
<el-col :span="3">编码:</el-col>
<el-col :span="21">JZ06-LY-C3-90</el-col>
</el-row>
<el-row style="margin-top: 2%">
<el-col :span="3">牌号</el-col>
<el-col :span="21">JZ06</el-col>
</el-row>
<el-row style="margin-top: 2%">
<el-col :span="3">批次</el-col>
<el-col :span="21">FP2021001</el-col>
</el-row>
</div>
</vue-easy-print>
</div>
</template>
<script>
// http://localhost:8013/test/print
import QRCode from 'qrcodejs2' // 引入qrcode
import JsBarcode from 'jsbarcode'
import vueEasyPrint from 'vue-easy-print'
export default {
name: 'Test',
components: {
vueEasyPrint
},
mounted() {
this.qrcode()
},
methods: {
printDemo() {
this.$refs.easyPrint.print()
},
qrcode() {
// eslint-disable-next-line no-unused-vars
const qrcode1 = new QRCode('qrcode', {
width: 132,
height: 132,
text: 'https://www.baidu.com', // 二维码地址
colorDark: '#000',
colorLight: '#fff'
})
},
oneCode() {
JsBarcode('#barcode1', 'Hi!', {
fontSize: 40,
background: '#4b8b7f',
lineColor: '#ffffff',
margin: 40,
marginLeft: 80
})
},
create() {
this.oneCode()
this.qrcode()
}
}
}
</script>

View File

@@ -0,0 +1,51 @@
<template>
<div>
<button @click="qrcode">二维码生成</button>
<button @click="oneCode">一维码生成</button>
<button @click="create">生成</button>
<div>
<div id="qrcode"/> <!-- 创建一个div并设置id为qrcode -->
<svg id="barcode1"/>
</div>
</div>
</template>
<script>
// http://localhost:8013/test/print
import QRCode from 'qrcodejs2' // 引入qrcode
import JsBarcode from 'jsbarcode'
export default {
name: 'Test',
mounted() {
},
methods: {
qrcode() {
// eslint-disable-next-line no-unused-vars
const qrcode1 = new QRCode('qrcode', {
width: 132,
height: 132,
text: 'https://www.baidu.com', // 二维码地址
colorDark: '#000',
colorLight: '#fff'
})
},
oneCode() {
JsBarcode('#barcode1', 'Hi!', {
fontSize: 40,
background: '#4b8b7f',
lineColor: '#ffffff',
margin: 40,
marginLeft: 80
})
},
create() {
this.oneCode()
this.qrcode()
}
}
}
</script>

View File

@@ -0,0 +1,92 @@
<template>
<div>
<button @click="qrcode">二维码生成</button>
<button @click="oneCode">一维码生成</button>
<button @click="create">生成</button>
<el-button @click="printDemo">打印测试</el-button>
<vue-easy-print v-show="false" ref="easyPrint" :table-show="false" :space-row="true">
<div style="font-size: 20px">
<el-row style="border: 1px solid red">
<el-col :span="6">
<div id="qrcode" class="grid-content bg-purple"/>
</el-col>
<el-col :span="18">
<el-row style="margin-top: 1%">
<el-col :span="3">桶号:</el-col>
<el-col :span="21">CP00001</el-col>
</el-row>
<el-row style="margin-top: 3%">
<el-col :span="3">重量</el-col>
<el-col :span="21">50KG</el-col>
</el-row>
<el-row style="margin-top: 3%">
<el-col :span="3">日期</el-col>
<el-col :span="21">2021-11-01</el-col>
</el-row>
</el-col>
</el-row>
<el-row style="margin-top: 2%">
<el-col :span="3">编码:</el-col>
<el-col :span="21">JZ06-LY-C3-90</el-col>
</el-row>
<el-row style="margin-top: 2%">
<el-col :span="3">牌号</el-col>
<el-col :span="21">JZ06</el-col>
</el-row>
<el-row style="margin-top: 2%">
<el-col :span="3">批次</el-col>
<el-col :span="21">FP2021001</el-col>
</el-row>
</div>
</vue-easy-print>
</div>
</template>
<script>
// http://localhost:8013/test/print
import QRCode from 'qrcodejs2' // 引入qrcode
import JsBarcode from 'jsbarcode'
import vueEasyPrint from 'vue-easy-print'
export default {
name: 'Test',
components: {
vueEasyPrint
},
mounted() {
this.qrcode()
},
methods: {
printDemo() {
this.$refs.easyPrint.print()
},
qrcode() {
// eslint-disable-next-line no-unused-vars
const qrcode1 = new QRCode('qrcode', {
width: 132,
height: 132,
text: 'https://www.baidu.com', // 二维码地址
colorDark: '#000',
colorLight: '#fff'
})
},
oneCode() {
JsBarcode('#barcode1', 'Hi!', {
fontSize: 40,
background: '#4b8b7f',
lineColor: '#ffffff',
margin: 40,
marginLeft: 80
})
},
create() {
this.oneCode()
this.qrcode()
}
}
}
</script>