Browse Source

fix: change course measure

DESKTOP-USV654P\pc 1 day ago
parent
commit
e1d2523565
2 changed files with 7 additions and 11 deletions
  1. 1 1
      Makefile
  2. 6 10
      src/views/course/measure/components/edit.vue

+ 1 - 1
Makefile

@@ -12,7 +12,7 @@ build:
 
 
 commit:
 commit:
 	git add . && \
 	git add . && \
-	git commit --no-verify -m "fix: add course measure"
+	git commit --no-verify -m "fix: change course measure"
 
 
 checkPre:
 checkPre:
 	git checkout pre
 	git checkout pre

+ 6 - 10
src/views/course/measure/components/edit.vue

@@ -41,14 +41,7 @@
               >
               >
                 修改
                 修改
               </a-button>
               </a-button>
-              <a-button
-                class="ml-2"
-                type="primary"
-                :disabled="state.overWorkloadNumberStatus === 1"
-                @click="handelStatus"
-              >
-                锁定
-              </a-button>
+              <a-button class="ml-2" type="primary" @click="handelStatus"> 锁定 </a-button>
             </div>
             </div>
           </Descriptions.Item>
           </Descriptions.Item>
         </Descriptions>
         </Descriptions>
@@ -190,8 +183,11 @@
   const handelStatus = async () => {
   const handelStatus = async () => {
     try {
     try {
       setModalProps({ loading: true, confirmLoading: true });
       setModalProps({ loading: true, confirmLoading: true });
-      await postClassTimeStatisticsOverWorkloadNumberStatus({ id: unref(modelRef).id, status: 1 });
-      state.overWorkloadNumberStatus = 1;
+      await postClassTimeStatisticsOverWorkloadNumberStatus({
+        id: unref(modelRef).id,
+        status: state.overWorkloadNumberStatus !== 1 ? 1 : 0,
+      });
+      state.overWorkloadNumberStatus = state.overWorkloadNumberStatus !== 1 ? 1 : 0;
       createMessage.success('锁定成功');
       createMessage.success('锁定成功');
     } catch {
     } catch {
       createMessage.error('锁定失败');
       createMessage.error('锁定失败');