Browse Source

fix(front): 修复ready

Go 5 years ago
parent
commit
8b20e0d05e

+ 4 - 0
front/project/www/app.less

@@ -398,6 +398,10 @@
   white-space: pre;
 }
 
+.u-s-n {
+  user-select: none;
+}
+
 input,
 textarea {
   outline: none;

+ 3 - 0
front/project/www/routes/page/ready/index.less

@@ -74,6 +74,9 @@
       word-break: break-all;
       overflow: hidden;
 
+      p {
+        margin: 0px;
+      }
 
       .query-layout {
 

+ 16 - 7
front/project/www/routes/page/ready/page.js

@@ -145,7 +145,10 @@ export default class extends Page {
           isFaq: true,
         });
         this.categoryMap = getMap(result.category, 'id');
-        const list = formatTreeData(result.category, 'id', 'title', 'parentId');
+        const list = formatTreeData(result.category, 'id', 'title', 'parentId').map((row) => {
+          if (row.isRoom) row.children = [];
+          return row;
+        });
         const readPlates = ((result.read || {}).plates || []).map((row, index) => {
           row.title = row.plate;
           row.key = `${index + 1}`;
@@ -290,7 +293,7 @@ export default class extends Page {
     } else {
       this.refreshList(item);
     }
-    this.setState({ current: key });
+    this.setState({ current: key, open: true });
   }
 
   refreshRead() {
@@ -315,7 +318,7 @@ export default class extends Page {
   }
 
   renderView() {
-    const { list, current, scrollCurrent } = this.state;
+    const { list, current, scrollCurrent, open } = this.state;
     let detail = {};
     return (
       <div>
@@ -327,13 +330,19 @@ export default class extends Page {
                 return (
                   <div
                     className={`page-item ${item.key === current ? 'active' : ''}`}
-                    onClick={() => this.changePage(item.key)}
+                    onClick={() => {
+                      if (item.key === current) {
+                        this.setState({ open: !open });
+                      } else {
+                        this.changePage(item.key);
+                      }
+                    }}
                   >
                     {item.children && item.children.length > 0 && <Assets name="dropdown_hover" className="up" />}
                     {<Assets name="dropdown_normal" className="down" />}
                     {(!item.children || item.children.length === 0) && <Assets name="dropdown_hover" className="change" />}
                     <div className="page-item-title">{item.title}</div>
-                    {current === item.key &&
+                    {current === item.key && open &&
                       item.children &&
                       item.children.map(child => {
                         return (
@@ -417,11 +426,11 @@ export default class extends Page {
   }
 
   renderList() {
-    const { articles = [] } = this.state;
+    const { articles = [], scrollCurrent } = this.state;
     return articles.map(item => {
       return (
         <div className="p-t-1 m-b-2" id={item.categoryId}>
-          <div className="t-1 t-s-18 m-b-1">{item.title}</div>
+          <div className="t-1 t-s-18 m-b-1">{scrollCurrent === item.categoryId ? <span className="t-4">{item.title}</span> : item.title}</div>
           <div className="t-2" dangerouslySetInnerHTML={{ __html: item.content }} />
         </div>
       );

+ 1 - 1
front/project/www/routes/paper/process/sentence/index.js

@@ -373,7 +373,7 @@ export default class extends Component {
         );
         break;
       case 'qx':
-        content = <div className="detail-block text-block" dangerouslySetInnerHTML={{ __html: question.qxContent }} />;
+        content = <div className="detail-block text-block u-s-n" dangerouslySetInnerHTML={{ __html: question.qxContent }} />;
         break;
       default:
         break;

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

@@ -496,7 +496,7 @@ export default class extends Component {
         );
         break;
       case 'qx':
-        content = <div className="detail-block "><div className="block-text" dangerouslySetInnerHTML={{ __html: question.qxContent }} /></div>;
+        content = <div className="detail-block "><div className="block-text u-s-n" dangerouslySetInnerHTML={{ __html: question.qxContent }} /></div>;
         break;
       case 'association':
         content = (

+ 1 - 0
server/data/src/main/resources/db/migration/V6__update_paper.sql

@@ -0,0 +1 @@
+ALTER TABLE exercise_paper modify column logic_extend VARCHAR(100) NOT NULL DEFAULT '' COMMENT '逻辑';