fix:打印机名称设置放到导航栏

This commit is contained in:
shijing 2025-03-17 14:31:31 +08:00
parent c869c1b8fd
commit 135b950432
3 changed files with 29 additions and 4 deletions

View File

@ -1,5 +1,10 @@
<template>
<div class="user-bar">
<div class="screen panel-item" @click="printerSetting">
<el-icon>
<el-icon-printer :size="26"/>
</el-icon>
</div>
<scan-dialog ref="scanDialog" :type="'info'" @closed="scanClose"> </scan-dialog>
<div class="screen panel-item hidden-sm-and-down" @click="screen">
<el-icon>
@ -84,7 +89,16 @@
</template>
</el-dropdown>
</div>
<el-dialog title="打印机设置" v-model="setNameVisible" width="600px">
<el-form label-width="100px">
<el-form-item label="打印机名称">
<el-input v-model="printer_name"></el-input>
</el-form-item>
</el-form>
<el-footer>
<el-button type="primary" @click="savePrinter">保存</el-button>
</el-footer>
</el-dialog>
<el-dialog
v-model="searchVisible"
:width="700"
@ -111,6 +125,7 @@ export default {
userName: "",
userNameF: "",
visible:false,
setNameVisible:false,
searchVisible: false,
msg: false,
msgList: {},
@ -122,6 +137,7 @@ export default {
params:{},
scanId:'',
scanType:'',
printer_name:'',
scanVisible:false,
};
},
@ -140,6 +156,7 @@ export default {
var userInfo = this.$TOOL.data.get("USER_INFO");
this.userName = userInfo.username;
this.userNameF = this.userName.substring(0, 1);
this.printer_name = localStorage.getItem("printer_name") || "";
},
methods: {
openBook() {
@ -229,6 +246,12 @@ export default {
var element = document.documentElement;
this.$TOOL.screen(element);
},
printerSetting(){
this.setNameVisible=true;
},
savePrinter(){
this.$TOOL.setPrint(this.printer_name);
},
//
showMsg() {
this.msg = true;
@ -284,7 +307,7 @@ export default {
}
.user-bar .panel-item i {
font-size: 16px;
font-size: 20px;
}
.user-bar .panel-item:hover {

View File

@ -139,7 +139,9 @@ tool.screen = function (element) {
}
}
}
tool.setPrint = function (val) {
localStorage.setItem('printer_name', val)
}
/* 复制对象 */
tool.objCopy = function (obj) {
return JSON.parse(JSON.stringify(obj));

View File

@ -63,7 +63,7 @@ export default {
height: 58px;
padding: 0 10px;
font-size: 19px;
color: rgb(145,149,162);
color: #efefef;
&:hover{
background-color: rgba(255, 255, 255, 0.1) !important;
}