修改7305人员信息取模组件,文本自动居中

This commit is contained in:
liub
2026-03-19 09:13:48 +08:00
parent ede41f68fd
commit 61f00e1cbf
8 changed files with 405 additions and 222 deletions

View File

@ -114,20 +114,20 @@
<view class="btnSend fright" v-on:click.stop="sendUsr">发送</view>
<view class="clear"></view>
<textToDotMatrixFor7305 class="TextToHex" ref="textToHex" :txts="formData.textLines"
:bgColor="'#FFFFFF'" :color="'#000000'" :fontSize="11" />
:bgColor="'#FFFFFF'" :color="'#000000'" :fontSize="13" />
</view>
<view class="item">
<text class="lbl">单位</text>
<input class="value" v-model="formData.textLines[0]" placeholder="请输入单位" placeholder-class="usrplace" />
<input class="value" v-model="formData.inputLines[0]" placeholder="请输入单位" placeholder-class="usrplace" />
</view>
<view class="item">
<text class="lbl">部门</text>
<input class="value" v-model="formData.textLines[1]" placeholder="请输入姓名" placeholder-class="usrplace" />
<input class="value" v-model="formData.inputLines[1]" placeholder="请输入姓名" placeholder-class="usrplace" />
</view>
<view class="item">
<text class="lbl">姓名</text>
<input class="value" v-model="formData.textLines[2]" placeholder="请输入职位" placeholder-class="usrplace" />
<input class="value" v-model="formData.inputLines[2]" placeholder="请输入职位" placeholder-class="usrplace" />
</view>
</view>
@ -272,9 +272,10 @@
liangDu: '100',
id: '',
deviceId: '',
textLines: ['', '', ''],
textLines: [],
mode: '',
bleStatu: ''
bleStatu: '',
inputLines:[]
},
inteval: 500,
device: {
@ -1195,8 +1196,9 @@ debugger;
these.showBleUnConnect()
return;
}
debugger;
let err = false;
this.formData.textLines.find((txt) => {
this.formData.inputLines.find((txt) => {
if (txt.length === 0 || txt.length > 5) {
console.log("txt=", txt);
err = true;
@ -1213,12 +1215,16 @@ debugger;
});
return;
}
this.formData.textLines=[this.formData.inputLines[0],this.formData.inputLines[1],this.formData.inputLines[2]];
showLoading(these, {
text: "请稍候..."
text: "发送中..."
});
this.setBleFormData();
let task = async () => {
var sendTxtPackge = (rgbdata, type, str) => {
var sendTxtPackge = (rgbdata, type, str,index) => {
var promise = new Promise((resolve, reject) => {
try {
@ -1261,7 +1267,7 @@ debugger;
.toString(16).padStart(2, '0'));
console.log(`发送数据块 ${chunkIndex + 1}/${numChunks}:`, hexArray
.join(' '));
updateLoading(these,{text:'正在发送'+((index-1)*14+chunkIndex + 1)+'/42'})
ble.sendData(f.deviceId, chunk, f.writeServiceId, f
.wirteCharactId, 100).then(() => {
chunkIndex++;
@ -1318,7 +1324,7 @@ debugger;
try {
// console.log("1111");
await sendTxtPackge(rgb, h3dic[i], str);
await sendTxtPackge(rgb, h3dic[i], str,i+1);
// console.log("222222");
} catch (ex) {
flag = false;
@ -1371,9 +1377,9 @@ debugger;
res = res.data;
let personnelInfo = res.personnelInfo;
if (personnelInfo) {
these.formData.textLines[2] = personnelInfo.unitName;
these.formData.textLines[1] = personnelInfo.name;
these.formData.textLines[0] = personnelInfo.position;
these.formData.inputLines[2] = personnelInfo.unitName;
these.formData.inputLines[1] = personnelInfo.name;
these.formData.inputLines[0] = personnelInfo.position;
}
}