Commit 76333111 authored by “yiyousong”'s avatar “yiyousong”

fix:新增公共库预览打印

parent 88a25a20
This diff is collapsed.
......@@ -13,5 +13,6 @@
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
<script src="./JSSDK.js"></script>
</body>
</html>
......@@ -107,10 +107,11 @@ export default {
}
.page-login {
width: 100%;
background-image: linear-gradient(45deg, #333, #111);
background-size: 40px 40px;
margin: 0;
height: 100%;
height: auto;
.el-form {
margin: auto;
......
......@@ -12,6 +12,14 @@
<img class="sample-sheet-img" :src="api + materialsPreview" />
</div>
</div>
<div slot="footer" class="tac">
<el-button
type="primary"
:loading="loading"
@click="handlePrint(materialsInfo)"
>打 印</el-button
>
</div>
</el-dialog>
</div>
</template>
......@@ -48,15 +56,38 @@ export default {
data() {
return {
api: process.env.VUE_APP_API_BASE_URL + "/",
val: "",
loading: false,
};
},
methods: {
handlePrint(info) {
let _this = this;
_this.loading = true;
/* eslint-disable */
device.printer({
papertype: "A4",
printername: "", // 打印机名称 为空则为默认打印机
printertype: "url", // base64 ,normal,url
url: info.fileUrl, // url
success: (res) => {
if (res && res.code == "00000") {
_this.$message.success("打印成功");
_this.loading = false;
}
},
fail: (err) => {
_this.$message.error(err.Message);
_this.loading = false;
},
});
},
},
};
</script>
<style lang="less" scoped>
/deep/.el-dialog__body {
max-height: 86vh;
:deep(.el-dialog__body) {
height: 78vh;
overflow-y: auto;
&::-webkit-scrollbar {
width: 6px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment