调整输入的大小

mast_item_banktwo
杨树林 5 years ago
parent 3610b7e687
commit 2d544818a8

@ -22,8 +22,8 @@ import FillBlot from './FillBlot';
const Size = Quill.import('attributors/style/size'); const Size = Quill.import('attributors/style/size');
const Font = Quill.import('formats/font'); const Font = Quill.import('formats/font');
// const Color = Quill.import('attributes/style/color'); // const Color = Quill.import('attributes/style/color');
Size.whitelist = ['12px', '14px', '16px', '18px', '20px', false]; Size.whitelist = ['14px', '16px', '18px', '20px', false];
Font.whitelist = ['SimSun', 'SimHei','Microsoft-YaHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']; Font.whitelist = ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif'];
window.Quill = Quill; window.Quill = Quill;
window.katex = katex; window.katex = katex;
@ -55,10 +55,11 @@ function QuillForEditor ({
// toolbar 默认值 // toolbar 默认值
const defaultConfig = [ const defaultConfig = [
'bold', 'italic', 'underline', 'bold', 'italic', 'underline',
{size: ['12px', '14px', '16px', '18px', '20px']}, {size: ['14px', '16px', '18px', '20px']},
{align: []}, {list: 'ordered'}, {list: 'bullet'}, // 列表 {align: []}, {list: 'ordered'}, {list: 'bullet'}, // 列表
{script: 'sub'}, {script: 'super'}, {script: 'sub'}, {script: 'super'},
{ 'color': [] }, { 'background': [] }, { 'color': [] }, { 'background': [] },
{ 'font': ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']},
{header: [1,2,3,4,5,false]}, {header: [1,2,3,4,5,false]},
'blockquote', 'code-block', 'blockquote', 'code-block',
'link', 'image', 'video', 'link', 'image', 'video',

@ -277,7 +277,7 @@ class ChoquesEditor extends Component{
} }
onContentChange=(value,quill)=>{ onContentChange=(value,quill)=>{
debugger // debugger
const _text = quill.getText(); const _text = quill.getText();
const reg = /^[\s\S]*.*[^\s][\s\S]*$/; const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) { if (!reg.test(_text)) {
@ -381,7 +381,10 @@ class ChoquesEditor extends Component{
// //////console.log("xuanzheshijuan"); // //////console.log("xuanzheshijuan");
// //////console.log(answerTagArray); // //////console.log(answerTagArray);
// //////console.log(!exerciseIsPublish); // //////console.log(!exerciseIsPublish);
const options=['code-block', 'image', 'formula',{size: ['14px', '16px', '18px', '20px']},
{ 'color': ['#333333','#e60000','#ff9900','#ffff00','#ffffff']},
{ 'font': ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']}
]
return( return(
<div className="padding20-30 signleEditor duoxuano" id={qNumber}> <div className="padding20-30 signleEditor duoxuano" id={qNumber}>
<style>{` <style>{`
@ -402,6 +405,12 @@ class ChoquesEditor extends Component{
#e_tips_mdEditor_question_undefined4{ #e_tips_mdEditor_question_undefined4{
display: none; display: none;
} }
.signleEditor .quill_editor_for_react_area .ql-toolbar .ql-formats .ql-size {
line-height: 20px;
}
.signleEditor .quill_editor_for_react_area .ql-toolbar .ql-formats .ql-font {
line-height: 20px;
}
`}</style> `}</style>
<p className="mb10 clearfix"> <p className="mb10 clearfix">
{/* {!question_id ? '新建' : '编辑'} */} {/* {!question_id ? '新建' : '编辑'} */}
@ -414,7 +423,7 @@ class ChoquesEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}} imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '155px'}} style={{ height: '155px'}}
placeholder="请您输入题干" placeholder="请您输入题干"
options={['code-block', 'image', 'formula']} options={options}
value={question_title} value={question_title}
onContentChange={this.onContentChange} onContentChange={this.onContentChange}
@ -448,7 +457,7 @@ class ChoquesEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}} imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '166px'}} style={{ height: '166px'}}
placeholder="请您输入题干" placeholder="请您输入题干"
options={['code-block', 'image', 'formula']} options={options}
value={item} value={item}
onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)} onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)}
/> />
@ -458,7 +467,7 @@ class ChoquesEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}} imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '166px'}} style={{ height: '166px'}}
placeholder="请您输入题干" placeholder="请您输入题干"
options={['code-block', 'image', 'formula']} options={options}
value={JSON.parse(item)} value={JSON.parse(item)}
onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)} onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)}
/> />
@ -497,7 +506,7 @@ class ChoquesEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}} imgAttrs={{width: '146px', height: '136px'}}
style={{height: '166px' }} style={{height: '166px' }}
placeholder="请您输入题目解析" placeholder="请您输入题目解析"
options={['code-block', 'image', 'formula']} options={options}
value={question_titles} value={question_titles}
onContentChange={this.onContentChanges} onContentChange={this.onContentChanges}
/> />

@ -397,6 +397,10 @@ class JudquestionEditor extends Component{
// ////////console.log(answerTagArray); // ////////console.log(answerTagArray);
// ////////console.log(!exerciseIsPublish); // ////////console.log(!exerciseIsPublish);
const params= this.props&&this.props.match&&this.props.match.params; const params= this.props&&this.props.match&&this.props.match.params;
const options=['code-block', 'image', 'formula',{size: ['14px', '16px', '18px', '20px']},
{ 'color': ['#333333','#e60000','#ff9900','#ffff00','#ffffff']},
{ 'font': ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']}
]
return( return(
<div className="padding20-30 signleEditor danxuano" id={qNumber}> <div className="padding20-30 signleEditor danxuano" id={qNumber}>
<style>{` <style>{`
@ -417,6 +421,12 @@ class JudquestionEditor extends Component{
#e_tips_mdEditor_question_undefined4{ #e_tips_mdEditor_question_undefined4{
display: none; display: none;
} }
.signleEditor .quill_editor_for_react_area .ql-toolbar .ql-formats .ql-size {
line-height: 20px;
}
.signleEditor .quill_editor_for_react_area .ql-toolbar .ql-formats .ql-font {
line-height: 20px;
}
`}</style> `}</style>
<p className="mb10 clearfix"> <p className="mb10 clearfix">
{/* {!question_id ? '新建' : '编辑'} */} {/* {!question_id ? '新建' : '编辑'} */}
@ -429,7 +439,7 @@ class JudquestionEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}} imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '155px'}} style={{ height: '155px'}}
placeholder="请您输入题干" placeholder="请您输入题干"
options={['code-block', 'image', 'formula']} options={options}
value={question_title} value={question_title}
onContentChange={this.onContentChange} onContentChange={this.onContentChange}
@ -479,7 +489,7 @@ class JudquestionEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}} imgAttrs={{width: '146px', height: '136px'}}
style={{height: '166px' }} style={{height: '166px' }}
placeholder="请您输入题目解析" placeholder="请您输入题目解析"
options={['code-block', 'image', 'formula']} options={options}
value={question_titles} value={question_titles}
onContentChange={this.onContentChanges} onContentChange={this.onContentChanges}
/> />

@ -415,6 +415,10 @@ class SingleEditor extends Component{
// //////console.log("xuanzheshijuan"); // //////console.log("xuanzheshijuan");
// //////console.log(answerTagArray); // //////console.log(answerTagArray);
// //////console.log(!exerciseIsPublish); // //////console.log(!exerciseIsPublish);
const options=['code-block', 'image', 'formula',{size: ['14px', '16px', '18px', '20px']},
{ 'color': ['#333333','#e60000','#ff9900','#ffff00','#ffffff']},
{ 'font': ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']}
]
return( return(
<div className="padding20-30 signleEditor danxuano" id={qNumber}> <div className="padding20-30 signleEditor danxuano" id={qNumber}>
@ -436,6 +440,12 @@ class SingleEditor extends Component{
#e_tips_mdEditor_question_undefined4{ #e_tips_mdEditor_question_undefined4{
display: none; display: none;
} }
.signleEditor .quill_editor_for_react_area .ql-toolbar .ql-formats .ql-size {
line-height: 20px;
}
.signleEditor .quill_editor_for_react_area .ql-toolbar .ql-formats .ql-font {
line-height: 20px;
}
`}</style> `}</style>
<p className="mb10 clearfix"> <p className="mb10 clearfix">
{/* {!question_id ? '新建' : '编辑'} */} {/* {!question_id ? '新建' : '编辑'} */}
@ -448,7 +458,7 @@ class SingleEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}} imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '155px'}} style={{ height: '155px'}}
placeholder="请您输入题干" placeholder="请您输入题干"
options={['code-block', 'image', 'formula']} options={options}
value={question_title} value={question_title}
onContentChange={this.onContentChange} onContentChange={this.onContentChange}
/> />
@ -480,7 +490,7 @@ class SingleEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}} imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '166px'}} style={{ height: '166px'}}
placeholder="请您输入题干" placeholder="请您输入题干"
options={['code-block', 'image', 'formula']} options={options}
value={item} value={item}
onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)} onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)}
/> />
@ -490,7 +500,7 @@ class SingleEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}} imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '166px'}} style={{ height: '166px'}}
placeholder="请您输入题干" placeholder="请您输入题干"
options={['code-block', 'image', 'formula']} options={options}
value={JSON.parse(item)} value={JSON.parse(item)}
onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)} onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)}
/> />
@ -531,7 +541,7 @@ class SingleEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}} imgAttrs={{width: '146px', height: '136px'}}
style={{height: '166px' }} style={{height: '166px' }}
placeholder="请您输入题目解析" placeholder="请您输入题目解析"
options={['code-block', 'image', 'formula']} options={options}
value={question_titles} value={question_titles}
onContentChange={this.onContentChanges} onContentChange={this.onContentChanges}
/> />

Loading…
Cancel
Save