From 8d68b6a1dcdf5008fba6bdac5858d1085a0e63e7 Mon Sep 17 00:00:00 2001
From: liuwh <hugeinfo123>
Date: Mon, 30 Mar 2020 23:14:04 +0800
Subject: [PATCH] 提交
---
SunshineIns/src/view/QuestionnairEditor/index.js | 27 +++++++++++++++++++++------
1 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/SunshineIns/src/view/QuestionnairEditor/index.js b/SunshineIns/src/view/QuestionnairEditor/index.js
index 2696829..734af73 100644
--- a/SunshineIns/src/view/QuestionnairEditor/index.js
+++ b/SunshineIns/src/view/QuestionnairEditor/index.js
@@ -121,13 +121,13 @@
hasScore: [...hasScore]
});
let scoresTemp = scores.concat();
- scoresTemp[index] = value;
+ scoresTemp[index] = value.replace(/\D/g, ''); //替换掉非数字部分
value = scoresTemp;
}
if (key == 'warnFlag') {
let { warnFlag } = this.state.editor;
let warnFlagTemp = warnFlag.concat();
- console.log('warnFlagTemp', warnFlagTemp)
+ console.log('warnFlagTemp', warnFlagTemp);
warnFlagTemp[index] = checked;
value = warnFlagTemp;
}
@@ -222,7 +222,8 @@
this.setState(prevState => ({
editor: {
...prevState.editor,
- options: [...prevState.editor.options, '']
+ options: [...prevState.editor.options, ''],
+ warnFlag: [...prevState.editor.warnFlag, false]
}
}));
};
@@ -476,6 +477,7 @@
<div style={{ flex: '1', display: 'flex', alignItems: 'center' }}>
<ShakeTransition shake={scoreShake[index]}>
<Input
+ type="number"
index={index}
placeholder="分值"
name={'scores'}
@@ -643,7 +645,11 @@
return (
<label
className="wowjoy-radio"
- style={{ width: `${100 / parseInt(rows)}%`, marginBottom: 8, marginRight: 30 }}
+ style={{
+ width: `${100 / parseInt(rows)}%`,
+ marginBottom: 8,
+ marginRight: 30
+ }}
key={uuid()}
>
<input
@@ -690,7 +696,11 @@
<label
className="wowjoy-checkbox"
key={uuid()}
- style={{ width: `${100 / parseInt(rows)}%`, marginBottom: 8 }}
+ style={{
+ width: `${100 / parseInt(rows)}%`,
+ marginBottom: 8,
+ marginRight: 30
+ }}
>
<input
type="checkbox"
@@ -929,7 +939,12 @@
<div className="subject-row">
<span>{index + 1}.</span>
{'input' === type ? subCompletionEl : <span>{title}</span>}
- {required && <span className="subject-title-require">*</span>}
+ {required == 'true' && (
+ <span className="subject-title-require">*</span>
+ )}
+
+ {type == 'checkbox' && <span>(多选题)</span>}
+ {type == 'radio' && <span>(单选题)</span>}
</div>
{remark && (
<div className="subject-row subject-remarks">{remarkText}</div>
--
Gitblit v1.8.0