Explorar o código

fix(admin): 修复后台难度分

Go %!s(int64=5) %!d(string=hai) anos
pai
achega
0c587bd51d

+ 8 - 6
front/project/admin/routes/setting/struct/page.js

@@ -245,6 +245,7 @@ export default class extends Page {
         isSentence: node.isSentence,
         isCourse: node.isCourse,
         isData: node.isData,
+        isExamination: node.isExamination,
       };
     } else {
       itemList = this.examinationItemList;
@@ -293,6 +294,7 @@ export default class extends Page {
         isSentence: node.isSentence,
         isCourse: node.isCourse,
         isData: node.isData,
+        isExamination: node.isExamination,
         parentName: this.state.exerciseMap[node.parentId].title,
       };
     } else {
@@ -380,9 +382,9 @@ export default class extends Page {
     asyncDelConfirm('删除确认', '是否删除选中节点?', () => {
       let handler;
       if (tab === 'exercise') {
-        handler = Promise.all(checkedKeys.map(row => Examination.delStruct({ id: row })));
+        handler = Promise.all(checkedKeys.checked.map(row => Exercise.delStruct({ id: row })));
       } else {
-        handler = Promise.all(checkedKeys.map(row => Examination.delStruct({ id: row })));
+        handler = Promise.all(checkedKeys.checked.map(row => Examination.delStruct({ id: row })));
       }
       return handler.then(() => {
         asyncSMessage('删除成功!');
@@ -397,13 +399,13 @@ export default class extends Page {
       <ActionLayout
         itemList={this.exerciseActionList}
         selectedKeys={this.state.selectedKeys}
-        checkedKeys={this.state.checkedKeys}
+        checkedKeys={this.state.checkedKeys ? this.state.checkedKeys.checked || [] : []}
         onAction={key => this.onAction(key)} />
       <TreeLayout autoExpandParent defaultExpandAll checkable itemList={this.state.examinationStruct} selectedKeys={this.state.selectedKeys} onSelect={(selectedKeys) => {
         this.setState({ selectedKeys });
       }} checkedKeys={this.state.checkedKeys} checkStrictly onCheck={(checkedKeys, e) => {
         if (e.node.props.level > 2) {
-          this.setState({ checkedKeys: { checkedKeys, halfCheckedKeys: e.halfCheckedKeys } });
+          this.setState({ checkedKeys });
         }
       }} />
     </Block>;
@@ -415,13 +417,13 @@ export default class extends Page {
       <ActionLayout
         itemList={this.exerciseActionList}
         selectedKeys={this.state.selectedKeys}
-        checkedKeys={this.state.checkedKeys}
+        checkedKeys={this.state.checkedKeys ? this.state.checkedKeys.checked || [] : []}
         onAction={key => this.onAction(key)} />
       <TreeLayout autoExpandParent defaultExpandAll checkable itemList={this.state.exerciseStruct} selectedKeys={this.state.selectedKeys} onSelect={(selectedKeys) => {
         this.setState({ selectedKeys });
       }} checkedKeys={this.state.checkedKeys} checkStrictly onCheck={(checkedKeys, e) => {
         if (e.node.props.level > 2) {
-          this.setState({ checkedKeys: { checkedKeys, halfCheckedKeys: e.halfCheckedKeys } });
+          this.setState({ checkedKeys });
         }
       }} />
     </Block>;

+ 3 - 3
front/project/admin/routes/subject/question/page.js

@@ -421,7 +421,7 @@ export default class extends Page {
                 ['image', 'table', 'select'],
                 [{ header: '1' }, { header: '2' }],
                 ['bold', 'underline', 'blockquote'],
-                [{ color: ['red', 'green', 'blue', 'orange', 'violet', '#d0d1d2', 'black'] }],
+                [{ color: [] }, { background: [] }],
                 [{ list: 'ordered' }, { list: 'bullet' }, { indent: '-1' }, { indent: '+1' }],
               ],
               handlers: {
@@ -626,7 +626,7 @@ export default class extends Page {
             }} />,
           )}
         </Form.Item>
-        <Form.Item labelCol={{ span: 5 }} wrapperCol={{ span: 16 }} label='难度分'>
+        {this.state.difficultScore && this.state.difficultScore.length > 0 && <Form.Item labelCol={{ span: 5 }} wrapperCol={{ span: 16 }} label='难度分'>
           {getFieldDecorator('difficultScore', {
             rules: [
               { required: true, message: '请选择难度分' },
@@ -634,7 +634,7 @@ export default class extends Page {
           })(
             <Select select={this.state.difficultScore} placeholder='请选择难度分' />,
           )}
-        </Form.Item>
+        </Form.Item>}
         {/* 阅读题,并且只有一个id才能关联 */}
         {isRc && <Form.Item labelCol={{ span: 5 }} wrapperCol={{ span: 16 }} label='阅读题模式' >
           {getFieldDecorator('rcType', {

+ 6 - 6
front/project/www/routes/paper/question/detail/index.js

@@ -400,7 +400,7 @@ export default class extends Component {
   }
 
   renderBody() {
-    const { question = { content: {} }, detail } = this.props;
+    const { question = { content: {} } } = this.props;
     const { typeset = 'one' } = question.content;
     const { hideAnalysis, showAnswer } = this.state;
     const show = typeset === 'one' ? true : !hideAnalysis;
@@ -411,7 +411,7 @@ export default class extends Component {
           {typeset === 'two' && (
             <div className="block">
               <div className="block-answer">
-                {detail && (
+                {(
                   <Switch
                     checked={showAnswer}
                     onChange={value => {
@@ -438,7 +438,7 @@ export default class extends Component {
   }
 
   renderAnalysis() {
-    const { question = { content: {} }, detail } = this.props;
+    const { question = { content: {} } } = this.props;
     const { typeset = 'one' } = question.content;
     const { hideAnalysis, analysisTab } = this.state;
     const show = typeset === 'one' ? true : !hideAnalysis;
@@ -463,7 +463,7 @@ export default class extends Component {
           {typeset === 'two' && (
             <div className="block">
               <div className="block-answer">
-                {detail && <Switch
+                {<Switch
                   checked={showAnswer}
                   onChange={value => {
                     this.setState({ showAnswer: value });
@@ -567,13 +567,13 @@ export default class extends Component {
   }
 
   renderContent() {
-    const { question = { content: {} }, detail } = this.props;
+    const { question = { content: {} } } = this.props;
     const { typeset = 'one' } = question.content;
     const { steps = [] } = question.content;
     const { showAnswer, step } = this.state;
     return (<div className="block">
       <div className="block-content">
-        {detail && typeset === 'one' && question.questionType !== 'awa' && (
+        {typeset === 'one' && question.questionType !== 'awa' && (
           <Switch
             checked={showAnswer}
             onChange={value => {

+ 2 - 6
front/src/components/Editor/index.js

@@ -7,12 +7,8 @@ const modules = {
   toolbar: {
     container: [
       [{ header: '1' }, { header: '2' }],
-      [
-        'bold',
-        'underline',
-        'blockquote',
-        { color: ['red', 'green', 'blue', 'orange', 'violet', '#d0d1d2', 'black'] },
-      ],
+      ['bold', 'underline', 'blockquote'],
+      [{ color: [] }, { background: [] }],
       [{ list: 'ordered' }, { list: 'bullet' }, { indent: '-1' }, { indent: '+1' }],
       // ['image'],
       // ['link', 'video'],

+ 3 - 0
server/gateway-api/src/main/java/com/qxgmat/service/extend/ExaminationService.java

@@ -106,6 +106,7 @@ public class ExaminationService extends AbstractService {
                     .structTwo(entity.getParentId())
                     .structThree(entity.getId())
                     .title(entity.getTitleZh())
+                    .status(1)
                     .build()
             );
         }
@@ -123,6 +124,7 @@ public class ExaminationService extends AbstractService {
                         .structTwo(entity.getParentId())
                         .structThree(entity.getId())
                         .title(entity.getTitleZh())
+                        .status(1)
                         .build()
                 );
             }else{
@@ -132,6 +134,7 @@ public class ExaminationService extends AbstractService {
                         .structTwo(entity.getParentId())
                         .structThree(entity.getId())
                         .title(entity.getTitleZh())
+                        .status(1)
                         .build()
                 );
             }