| | |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="{type,size,row,index}" slot="menu"> |
| | | <el-button icon="el-icon-view" :size="size" :type="type">预 览</el-button> |
| | | <el-button icon="el-icon-view" :size="size" :type="type" @click="viewQr(row)">预 览</el-button> |
| | | <el-button icon="el-icon-edit" :size="size" :type="type">导 出</el-button> |
| | | <el-button icon="el-icon-delete" :size="size" :type="type" >打 印</el-button> |
| | | <el-button icon="el-icon-delete" :size="size" :type="type">废 止</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | |
| | | <el-dialog |
| | | title="通行证预览" |
| | | :visible.sync="dialogVisible" |
| | | :append-to-body="true" |
| | | width="30%"> |
| | | <div id="qrCode" ref="qrCodeDiv"></div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="dialogVisible = false">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | |
| | | |
| | | </basic-container> |
| | | </template> |
| | | |
| | |
| | | import {getList, getDetail, add, update, remove} from "@/api/pass/pass"; |
| | | import option from "@/const/pass/pass"; |
| | | import {mapGetters} from "vuex"; |
| | | import QRCode from 'qrcodejs2'; |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | }, |
| | | selectionList: [], |
| | | option: option, |
| | | data: [] |
| | | data: [], |
| | | dialogVisible:false, |
| | | qrCode:"", |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | viewQr(row){ |
| | | console.log(row) |
| | | this.dialogVisible = true |
| | | this.$nextTick(()=>{ |
| | | if(this.qrcode) { // 有新的二维码地址了,先把之前的清除掉 |
| | | this.$refs.qrCodeDiv.innerHTML = '' |
| | | } |
| | | this.qrcode = new QRCode(this.$refs.qrCodeDiv, { |
| | | text: 'https://www.baidu.com/', |
| | | width: 200, |
| | | height: 200, |
| | | colorDark: "#333333", //二维码颜色 |
| | | colorLight: "#ffffff", //二维码背景色 |
| | | correctLevel: QRCode.CorrectLevel.L//容错率,L/M/H |
| | | }) |
| | | }) |
| | | |
| | | |
| | | } |
| | | } |
| | | }; |