From 53a5b5bea0fb1efae2b1793e6735754e78982d63 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 19 十一月 2021 13:31:27 +0800 Subject: [PATCH] 2021-11-19 --- src/tabviews/zshare/actionList/printbutton/index.jsx | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx index ebedaf7..e16fd39 100644 --- a/src/tabviews/zshare/actionList/printbutton/index.jsx +++ b/src/tabviews/zshare/actionList/printbutton/index.jsx @@ -1466,6 +1466,24 @@ _fieldlen = item.fieldlength || 512 } else if (item.type === 'number') { _fieldlen = item.decimal ? item.decimal : 0 + } else if (item.type === 'rate') { + item.rateCount = item.rateCount || 5 + let allowHalf = item.allowHalf === 'true' + + if (allowHalf) { + _initval = parseFloat(_initval) + if (_initval % 0.5 !== 0) { + _initval = parseInt(_initval) + } + } else { + _initval = parseInt(_initval) + } + + if (isNaN(_initval) || _initval < 0) { + _initval = 0 + } else if (_initval > item.rateCount) { + _initval = item.rateCount + } } if (_initval === undefined) { -- Gitblit v1.8.0