扫码修改

lh_dev_ksck
yewj 2 months ago
parent de317f9591
commit 44abacf603

@ -5,7 +5,8 @@ VUE_APP_TITLE = UDI管理系统
ENV = 'development'
# 开发环境
VUE_APP_BASE_API = 'http://192.168.0.166:9991'
# VUE_APP_BASE_API = 'http://192.168.0.166:9991'
VUE_APP_BASE_API = 'http://192.168.0.227:9160/UDI_WMS_MC/'
VUE_APP_SYNC_API ="http://127.0.0.1:10001"

@ -29,6 +29,8 @@ const KeyScaner = /** @class */ (function () {
// console.log('appendChar:', c, this.keybufs)
};
KeyScaner.prototype.onKeyDown = function (ev) {
var charCode = ev.key.charCodeAt(0);
this.lastTime = new Date().getTime();
if (ev.key == "Alt") {
if (ev.shiftKey || ev.ctrlKey || ev.metaKey) {
@ -51,7 +53,16 @@ const KeyScaner = /** @class */ (function () {
this.completeInput(); //立即完成输入
} else {
if (ev.key.length == 1) {
var charCode = ev.key.charCodeAt(0);
if (ev.altKey && ev.key === '0' && this.altBuf.length === 1 && this.altBuf[0] === '1') {
console.log('altBuf:', this.altBuf);
this.appendChar("\r");
// this.appendChar("enter");
this.altBuf = [];
this.completeInput();
return;
}
// console.log("key="+charCode);
if (charCode >= 48 && charCode <= 57) {
if (ev.altKey) {
@ -75,18 +86,21 @@ const KeyScaner = /** @class */ (function () {
};
KeyScaner.prototype.onKeyUp = function (ev) {
this.lastTime = new Date().getTime();
if (ev.charCode === 29) {
/**
* if (ev.charCode === 29) {
var str = this.altBuf.join("");
var num = parseInt(str);
var c = String.fromCharCode(num);
this.appendChar(c);
this.altBuf = [];
console.log('onKeyUp success:', ev.charCode, this.keybufs);
} else if (ev.key == "Alt") {
} else
*/
if (ev.key == "Alt") {
if (this.altBuf && this.altBuf.length > 0) {
var str = this.altBuf.join("");
var num = parseInt(str);
var c = String.fromCharCode(num);
this.appendChar(c);
this.altBuf = [];
}
@ -98,14 +112,16 @@ const KeyScaner = /** @class */ (function () {
KeyScaner.prototype.onKeyPress = function (ev) {
this.lastTime = new Date().getTime();
const char = String.fromCharCode(ev.charCode);
console.log('KeyPress:', ev.charCode, char);
/**
* if (ev.charCode === 29) {
this.appendChar(char);
// console.log('KeyPress success:', ev.charCode, this.keybufs);
} else
*/
if (char == '\n') {
this.appendChar("\r");
this.completeInput();
}

@ -1836,6 +1836,7 @@ export default {
var inputer = document.getElementById("inputer");
window.sc = new A.KeyScaner(inputer); //DOM
sc.onInput = function (text) {
console.log("text:"+text);
if (text.includes("delete")) {
that.codeFormData.code = "";
that.sictomText = "";

Loading…
Cancel
Save