2026年6月22日 :大量更新

This commit is contained in:
2026-06-22 08:51:10 +08:00
parent be39714c5e
commit 0fb69c2897
75 changed files with 1518 additions and 528 deletions
+5 -5
View File
@@ -419,17 +419,17 @@ QString ItemUtils::generateTxtFromDateItemModel(const DateItemModel &model, cons
QString ItemUtils::generateTxtFromBarcodeViewModel(const BarcodeViewModel &vm, const std::array<int, 2> counterValues, const QDateTime &time)
{
QString txt = vm.contentPattern;
auto pos = vm.contentPattern.indexOf("{t}");
auto pos = txt.indexOf("{t}");
if(pos != -1) {
txt.replace(pos, 3, generateTxtFromDateItemModel(vm.dateViewModel, time));
txt = txt.replace(pos, 3, generateTxtFromDateItemModel(vm.dateViewModel, time));
}
pos = vm.contentPattern.indexOf("{c}");
pos = txt.indexOf("{c}");
if(pos != -1) {
auto cntValue = vm.counterViewModel.counterType == COUNTER_TYPE_1 ? counterValues[0] : counterValues[1];
auto valueStr = QString("%1").arg(cntValue, 10, QChar('0'));;
auto valueStr = QString("%1").arg(cntValue, 8, 10, QLatin1Char('0'));
valueStr = valueStr.right(vm.counterViewModel.digitalNum);
txt.replace(pos, 3, valueStr);
txt = txt.replace(pos, 3, valueStr);
}
return txt;