Ver código fonte

修改问题和样式走查

lex 1 ano atrás
pai
commit
777cbc364f

+ 4 - 4
src/views/unit-test/unit-create/modals/newspaper-item.module.less

@@ -31,7 +31,8 @@
         color: #333333;
         line-height: 30px;
         margin-bottom: 4px;
-        font-family: 'DINA' !important;
+        font-family: DINAlternate, DINAlternate;
+        font-weight: bold;
 
         span {
           margin-left: 1px;
@@ -80,9 +81,8 @@
   color: #F67146;
   background-color: #FFF5F2;
   border-color: #FFB39B;
-
   font-size: 13px;
-  height: 26px;
+  height: 30px;
   padding-top: 2px;
-  line-height: 25px;
+  line-height: 28px;
 }

+ 42 - 2
src/views/unit-test/unit-create/uni-last.module.less

@@ -10,15 +10,18 @@
     margin-bottom: 15px;
     line-height: 22px;
     font-size: 16px;
+
     .editIcon {
       font-size: 18px;
       margin-right: 6px;
     }
   }
+
   .infoWrap {
     background-color: #fff;
     border-radius: 10px;
     padding: 8px 0px;
+
     p {
       font-size: 15px;
       font-weight: 500;
@@ -26,22 +29,44 @@
       line-height: 21px;
       margin-bottom: 15px;
     }
+
     .loctionIconWrap {
-      margin-left: 5px;
+      // margin-left: 5px;
+
       span {
         line-height: 22px;
         vertical-align: inherit;
       }
     }
+
     .wrapValue {
       font-weight: 500;
       color: #333333;
       line-height: 21px;
     }
+
+    .inputControl {
+      :global {
+        .van-field__body {
+          justify-content: flex-end;
+          margin-right: 8px;
+        }
+
+        .van-field__control {
+          width: 58px;
+          height: 33px;
+          background: #F4F4F4;
+          border-radius: 8px;
+          text-align: center;
+        }
+      }
+    }
+
     .heightValue {
       padding-bottom: 15px !important;
       margin-bottom: 8px;
     }
+
     input::-webkit-input-placeholder,
     input::-ms-input-placeholder {
       font-size: 15px;
@@ -52,6 +77,7 @@
         padding: 8px 12px;
         font-size: 15px;
       }
+
       .van-cell__title {
         font-size: 15px;
         font-weight: 500;
@@ -60,11 +86,13 @@
         margin-bottom: 15px;
         flex: 0 auto;
       }
+
       .van-field__control {
         color: #f67146;
       }
     }
   }
+
   .tabsWrap {
     position: relative;
     margin-top: 10px;
@@ -74,6 +102,7 @@
         .van-tabs__nav {
           padding-left: 0;
           padding-right: 0;
+
           .van-tab:first-child {
             padding-left: 0;
           }
@@ -88,11 +117,13 @@
       z-index: 2000;
     }
   }
+
   .DialogTitle {
     display: flex;
     flex-direction: row;
     align-items: center;
     padding: 20px 25px;
+
     span {
       width: 4px;
       height: 14px;
@@ -100,6 +131,7 @@
       border-radius: 2px;
       margin-right: 6px;
     }
+
     p {
       height: 25px;
       font-size: 18px;
@@ -108,33 +140,41 @@
       line-height: 25px;
     }
   }
+
   .DialogConent {
     padding: 0 25px 30px;
+
     p {
       font-size: 16px;
       line-height: 26px;
       color: #333;
     }
   }
+
   :global {
     .van-tab__text {
       font-size: 16px;
     }
+
     .van-tabs__line {
       bottom: 20px;
       width: 20px;
     }
+
     .van-cell__title {
       margin-bottom: 0 !important;
     }
+
     .exercisDetailDialog {
       border-radius: 10px;
+
       .van-dialog__header {
         padding-top: 0px !important;
       }
     }
+
     .van-dialog {
       top: 47%;
     }
   }
-}
+}

+ 2 - 1
src/views/unit-test/unit-create/uni-last.tsx

@@ -262,7 +262,8 @@ export default defineComponent({
             <Field
               v-model={forms.value.expiryDate}
               type="number"
-              placeholder="请输入截止日期"
+              center
+              class={styles.inputControl}
               input-align="right"
               label="截止时间"
               maxlength={3}

+ 15 - 1
src/views/unit-test/unit-create/unit-edit-test/add-unit-item.module.less

@@ -127,11 +127,23 @@
     padding: 20px 0;
   }
 
+
   .activeCell {
+    .partContent {
+      span {
+        color: #131415;
+      }
+    }
+
     :global {
       .van-cell__title {
         color: #F67146;
       }
+
+      .van-stepper__input {
+        text-align: center;
+        color: #131415;
+      }
     }
   }
 
@@ -161,8 +173,10 @@
       padding-top: 8px;
     }
 
-    .van-field__control {
+    .van-field__control,
+    .van-stepper__input {
       text-align: center;
+      color: #AAAAAA;
     }
   }
 

+ 20 - 13
src/views/unit-test/unit-create/unit-edit-test/add-unit-item.tsx

@@ -10,7 +10,8 @@ import {
   Popup,
   Radio,
   RadioGroup,
-  showToast
+  showToast,
+  Stepper
 } from 'vant'
 import iconDelete from '../image/icon-delete2.png'
 import iconMusic from '../image/icon-music.png'
@@ -43,8 +44,9 @@ export default defineComponent({
       actions: [] as any,
       partShow: false,
       checkedPart: null as any, // 选择小节类型
-      startPart: null, // 开始小节
-      endPart: null // 结束小节
+      partLength: 0, // 小节长度
+      startPart: null as any, // 开始小节
+      endPart: null as any // 结束小节
     })
 
     const isEdit = computed(() => {
@@ -297,6 +299,7 @@ export default defineComponent({
                 state.partShow = true
                 state.startPart = item.partStart
                 state.endPart = item.partEnd
+                state.partLength = item.partLength
                 if (item.partEnd === item.partLength) {
                   state.checkedPart = '1'
                 } else {
@@ -489,19 +492,23 @@ export default defineComponent({
                   ),
                   label: () => (
                     <div class={styles.partContent}>
-                      <Field
-                        type="number"
-                        maxlength={3}
-                        class={styles.partInput}
+                      <Stepper
                         v-model={state.startPart}
-                      />
-                      <span>至</span>
-                      <Field
-                        type="number"
-                        maxlength={3}
+                        min={1}
+                        max={state.partLength}
                         class={styles.partInput}
+                        showMinus={false}
+                        showPlus={false}
+                      ></Stepper>
+                      <span>至</span>
+                      <Stepper
                         v-model={state.endPart}
-                      />
+                        min={state.startPart}
+                        max={state.partLength}
+                        class={styles.partInput}
+                        showMinus={false}
+                        showPlus={false}
+                      ></Stepper>
                       <span>小节</span>
                     </div>
                   )

+ 15 - 2
src/views/unit-test/unit-create/unit-edit-test/index.module.less

@@ -40,11 +40,12 @@
       position: relative;
 
       .dotMain {
-        font-size: 24px;
+        font-size: 20px;
+        font-family: DINAlternate, DINAlternate;
+        font-weight: bold;
         color: #333333;
         line-height: 30px;
         margin-bottom: 4px;
-        font-family: 'DINA' !important;
 
         span {
           margin-left: 1px;
@@ -230,6 +231,10 @@
     .van-field__control {
       text-align: center;
     }
+
+    .van-stepper {
+      width: 100%;
+    }
   }
 
   .partBtn {
@@ -238,4 +243,12 @@
     font-size: 18px;
     font-weight: 500;
   }
+}
+
+.settingStatus {
+  :global {
+    .van-popup__close-icon--top-right {
+      top: 22px;
+    }
+  }
 }

+ 27 - 7
src/views/unit-test/unit-create/unit-edit-test/index.tsx

@@ -1,6 +1,6 @@
 import { computed, defineComponent, onMounted, reactive, watch } from 'vue'
 import styles from './index.module.less'
-import { Button, CellGroup, Col, Dialog, Field, Icon, Popup, Row, showToast } from 'vant'
+import { Button, CellGroup, Col, Dialog, Field, Icon, Popup, Row, showToast, Stepper } from 'vant'
 import iconMenu from '../image/icon-menu.png'
 import iconDelte from '../image/icon-delete.png'
 import iconEdit from '../image/icon-edit.png'
@@ -73,8 +73,12 @@ export default defineComponent({
       // if (unitData['level' + state.level]?.questionList.length <= 0) {
       unitData['level' + state.level].totalScore = query.totalScore
       unitData['level' + state.level].questionNum = query.questionNum
-      unitData['level' + state.level].passScore = query.totalScore
-      unitData['level' + state.level].timeMinutes = query.timeMinutes
+      if (unitData['level' + state.level].passScore <= 0) {
+        unitData['level' + state.level].passScore = query.totalScore
+      }
+      if (unitData['level' + state.level].timeMinutes <= 0) {
+        unitData['level' + state.level].timeMinutes = query.timeMinutes
+      }
       unitData['level' + state.level].level = query.level
       // }
     }
@@ -218,9 +222,15 @@ export default defineComponent({
           {{ title: () => <div class={styles.dialogDelete}>删除题目</div> }}
         </Dialog>
 
-        <Popup position="bottom" round v-model:show={state.settingStatus} closeable>
+        <Popup
+          position="bottom"
+          round
+          v-model:show={state.settingStatus}
+          closeable
+          class={styles.settingStatus}
+        >
           <div class={styles.partContainer}>
-            <div class={styles.partTitle}>请选择练习小节</div>
+            <div class={styles.partTitle}>修改</div>
             <CellGroup class={styles.cellGroup} border={false}>
               <Field
                 inputAlign="right"
@@ -233,6 +243,14 @@ export default defineComponent({
                 center
               >
                 {{
+                  input: () => (
+                    <Stepper
+                      v-model={state.pScore}
+                      max={wTotalScore.value}
+                      showMinus={false}
+                      showPlus={false}
+                    ></Stepper>
+                  ),
                   extra: () => (
                     <div class={styles.loctionIconWrap}>
                       <span>
@@ -244,15 +262,17 @@ export default defineComponent({
               </Field>
               <Field
                 inputAlign="right"
-                label="测时长"
+                label="测时长"
                 type="number"
                 maxlength={3}
                 autocomplete="off"
                 class={styles.inputControl}
-                v-model={state.pTime}
                 center
               >
                 {{
+                  input: () => (
+                    <Stepper v-model={state.pTime} showMinus={false} showPlus={false}></Stepper>
+                  ),
                   extra: () => (
                     <div class={styles.loctionIconWrap}>
                       <span> 分钟</span>

+ 6 - 6
src/views/unit-test/unit-create/unit-edit-test/music-list.tsx

@@ -47,9 +47,6 @@ export default defineComponent({
         if (Array.isArray(res?.data)) {
           data.musicTree = res.data
         }
-        nextTick(() => {
-          getList()
-        })
       } catch (error) {
         console.log(error)
       }
@@ -172,9 +169,12 @@ export default defineComponent({
     const onDetail = (row: any) => {
       emit('confirm', row)
     }
-    onMounted(() => {
-      getSubjects()
-      getTree()
+    onMounted(async () => {
+      await getTree()
+      nextTick(async () => {
+        await getSubjects()
+        await getList()
+      })
     })
 
     return () => (