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

fix:新增公共库预览打印

parent 88a25a20
This diff is collapsed.
...@@ -13,5 +13,6 @@ ...@@ -13,5 +13,6 @@
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
<script src="./JSSDK.js"></script>
</body> </body>
</html> </html>
...@@ -107,10 +107,11 @@ export default { ...@@ -107,10 +107,11 @@ export default {
} }
.page-login { .page-login {
width: 100%;
background-image: linear-gradient(45deg, #333, #111); background-image: linear-gradient(45deg, #333, #111);
background-size: 40px 40px; background-size: 40px 40px;
margin: 0; margin: 0;
height: 100%; height: auto;
.el-form { .el-form {
margin: auto; margin: auto;
......
...@@ -12,6 +12,14 @@ ...@@ -12,6 +12,14 @@
<img class="sample-sheet-img" :src="api + materialsPreview" /> <img class="sample-sheet-img" :src="api + materialsPreview" />
</div> </div>
</div> </div>
<div slot="footer" class="tac">
<el-button
type="primary"
:loading="loading"
@click="handlePrint(materialsInfo)"
>打 印</el-button
>
</div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
...@@ -48,15 +56,38 @@ export default { ...@@ -48,15 +56,38 @@ export default {
data() { data() {
return { return {
api: process.env.VUE_APP_API_BASE_URL + "/", 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> </script>
<style lang="less" scoped> <style lang="less" scoped>
/deep/.el-dialog__body { :deep(.el-dialog__body) {
max-height: 86vh; height: 78vh;
overflow-y: auto; overflow-y: auto;
&::-webkit-scrollbar { &::-webkit-scrollbar {
width: 6px; 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