Browse Source

添加二次确认

lex 1 year ago
parent
commit
15f87f6bc8

+ 38 - 14
src/views/teaching-manage/after-class-training-detail/model/addMaterialTrainingClass.tsx

@@ -207,21 +207,45 @@ export default defineComponent({
 
 
     // 素材关联知识点
     // 素材关联知识点
     const handleSave = async () => {
     const handleSave = async () => {
-      state.saveLoading = true
-      const list = state.checkList.map((n: any) => {
-        const item = state.selectCheckList.find((item: any) => item.tempIndex === n)
-        return {
-          materialId: item.materialId,
-          knowledgePointId: item.knowledgePointId,
-          lessonTrainingId: props.parentData.id
-        }
+      // state.saveLoading = true
+      // const list = state.checkList.map((n: any) => {
+      //   const item = state.selectCheckList.find((item: any) => item.tempIndex === n)
+      //   return {
+      //     materialId: item.materialId,
+      //     knowledgePointId: item.knowledgePointId,
+      //     lessonTrainingId: props.parentData.id
+      //   }
+      // })
+      // try {
+      //   const res: any = await lessonTrainingDetailBatchInsert(list)
+      //   message.success('保存成功')
+      //   emit('handleSuccess')
+      // } catch (error) {}
+      // state.saveLoading = false
+      dialog.warning({
+        title: '提示',
+        content: '请确保作业曲目已添加到业务系统',
+        positiveText: '确定',
+        negativeText: '取消',
+        onPositiveClick: async () => {
+          state.saveLoading = true
+          const list = state.checkList.map((n: any) => {
+            const item = state.selectCheckList.find((item: any) => item.tempIndex === n)
+            return {
+              materialId: item.materialId,
+              knowledgePointId: item.knowledgePointId,
+              lessonTrainingId: props.parentData.id
+            }
+          })
+          try {
+            const res: any = await lessonTrainingDetailBatchInsert(list)
+            message.success('保存成功')
+            emit('handleSuccess')
+          } catch (error) {}
+          state.saveLoading = false
+        },
+        onNegativeClick: () => {}
       })
       })
-      try {
-        const res: any = await lessonTrainingDetailBatchInsert(list)
-        message.success('保存成功')
-        emit('handleSuccess')
-      } catch (error) {}
-      state.saveLoading = false
     }
     }
 
 
     return () => (
     return () => (

+ 27 - 18
src/views/teaching-manage/unit-test/unit-test-index/editAndUpdate.tsx

@@ -176,24 +176,33 @@ export default defineComponent({
             message.error('阶段自测的合格分数高于题目的总分值')
             message.error('阶段自测的合格分数高于题目的总分值')
             return
             return
           }
           }
-          const params: any = {
-            ...saveModel,
-            questionList: modalData.selectList
-          }
-          let res: any = null
-          console.log(params)
-          if (saveModel.id) {
-            res = await unitExaminationSave(params)
-          } else {
-            res = await unitExaminationSave(params)
-          }
-          if (res?.code == 200) {
-            message.success('保存成功')
-            gotoBack()
-            // emit('handleSuccess')
-          } else {
-            message.warning('保存失败')
-          }
+          dialog.warning({
+            title: '提示',
+            content: '请确保测验曲目已添加到业务系统',
+            positiveText: '确定',
+            negativeText: '取消',
+            onPositiveClick: async () => {
+              const params: any = {
+                ...saveModel,
+                questionList: modalData.selectList
+              }
+              let res: any = null
+              console.log(params)
+              if (saveModel.id) {
+                res = await unitExaminationSave(params)
+              } else {
+                res = await unitExaminationSave(params)
+              }
+              if (res?.code == 200) {
+                message.success('保存成功')
+                gotoBack()
+                // emit('handleSuccess')
+              } else {
+                message.warning('保存失败')
+              }
+            },
+            onNegativeClick: () => {}
+          })
         }
         }
       })
       })
     }
     }

+ 1 - 1
vite.config.ts

@@ -21,7 +21,7 @@ function pathResolve(dir: string) {
 // const proxyUrl = 'https://dev.lexiaoya.cn'
 // const proxyUrl = 'https://dev.lexiaoya.cn'
 // const proxyUrl = 'http://127.0.0.1:7293/'
 // const proxyUrl = 'http://127.0.0.1:7293/'
 // const proxyUrl = 'https://resource.colexiu.com/'
 // const proxyUrl = 'https://resource.colexiu.com/'
-const proxyUrl = 'https://dev.resource.colexiu.com'
+const proxyUrl = 'https://test.resource.colexiu.com'
 // https://test.resource.colexiu.com/
 // https://test.resource.colexiu.com/
 
 
 export default ({ command, mode }: ConfigEnv): UserConfig => {
 export default ({ command, mode }: ConfigEnv): UserConfig => {