| | |
| | | "js-cookie": "3.0.1", |
| | | "jsencrypt": "3.0.0-rc.1", |
| | | "nprogress": "0.2.0", |
| | | "qrcode": "^1.5.3", |
| | | "qrcodejs2": "^0.0.2", |
| | | "quill": "1.3.7", |
| | | "screenfull": "5.0.2", |
| | | "sortablejs": "1.10.2", |
| | |
| | | "vue-count-to": "1.0.13", |
| | | "vue-cropper": "0.5.5", |
| | | "vue-meta": "2.4.0", |
| | | "vue-qr": "^4.0.9", |
| | | "vue-router": "3.4.9", |
| | | "vuedraggable": "2.24.3", |
| | | "vuex": "3.6.0" |
| | |
| | | <!-- </el-form>--> |
| | | <div> |
| | | <div id="printMe"> |
| | | <div ref="canvasWrapper"></div> |
| | | <div ref="canvasWrapper" id="canvasWrapper"></div> |
| | | <p>1111</p> |
| | | </div> |
| | | <button @click="print">打印</button> |
| | | <button @click="test1">生成二维码</button> |
| | | <el-button @click="print">打印</el-button> |
| | | <el-button @click="test1">生成二维码</el-button> |
| | | </div> |
| | | </el-card> |
| | | |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import QRCode from 'qrcode' |
| | | import QRCode from 'qrcodejs2' |
| | | import { listWorkshop, getWorkshop, delWorkshop, addWorkshop, updateWorkshop } from "@/api/main/bs/workshop/workshop"; |
| | | |
| | | export default { |
| | |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | this.test1(); |
| | | // this.test1(); |
| | | }, |
| | | methods: { |
| | | print() { |
| | | // 本页面直接打印(有bug单岁先不要删) |
| | | // let oldStr = window.document.body.innerHTML; |
| | | // let newStr = document.getElementById('printMe').innerHTML; |
| | | // document.body.innerHTML = newStr; |
| | | // window.print(); |
| | | // document.body.innerHTML = oldStr; |
| | | // return false; |
| | | |
| | | let printMe = document.querySelector('#printMe'); |
| | | let printWindow = window.open('', '_blank'); |
| | | printWindow.document.write(printMe.innerHTML); |
| | | printWindow.document.close(); |
| | | printWindow.focus(); |
| | | printWindow.print(); |
| | | printWindow.close(); |
| | | // 新开页面打印 |
| | | let newStr = document.getElementById('printMe').innerHTML; |
| | | let newWin = window.open('', '_blank'); |
| | | newWin.document.body.innerHTML = newStr; |
| | | newWin.print(); |
| | | return false; |
| | | }, |
| | | test1(){ |
| | | QRCode.toCanvas(this.text, { |
| | | width: 40, |
| | | // height: 40, |
| | | margin: 1, |
| | | |
| | | }, (error, canvas) => { |
| | | if (error) { |
| | | console.error(error) |
| | | return |
| | | } |
| | | // 在canvas的父元素中插入canvas元素 |
| | | this.$refs.canvasWrapper.appendChild(canvas) |
| | | document.getElementById('canvasWrapper').innerHTML = ''; |
| | | this.$nextTick(() => { |
| | | let qrCode = new QRCode('canvasWrapper',{ |
| | | width: 50, |
| | | height: 50, |
| | | text: this.text, |
| | | colorDark: '#000', |
| | | colorLight: '#fff' |
| | | }) |
| | | }) |
| | | }, |
| | | advancedQuery(){ |
| | |
| | | { |
| | | "name": "Jcdm-Mes", |
| | | "name": "Jcdm042-Mes", |
| | | "lockfileVersion": 2, |
| | | "requires": true, |
| | | "packages": {} |