|
|
@@ -6,18 +6,8 @@
|
|
|
<div class="grade_title">参数设置</div>
|
|
|
</div>
|
|
|
<div class="content_right">
|
|
|
- <template v-if="!isEdit">
|
|
|
- <el-button class="button_border" @click="StartEdit">开始编辑</el-button>
|
|
|
- <el-button class="button_background" @click="">设置完成</el-button>
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- <el-button class="button_refresh" @click="SaveEdit">
|
|
|
- <img :src="cancelIcon" alt="">
|
|
|
- 取消</el-button>
|
|
|
- <el-button class="button_background" @click="SaveEdit">
|
|
|
- <img :src="saveIcon" alt="">
|
|
|
- 保存</el-button>
|
|
|
- </template>
|
|
|
+ <el-button class="button_border" @click="StartOrSaveEdit">{{!isEdit ? '开始编辑' : '保存编辑'}}</el-button>
|
|
|
+ <el-button class="button_background" @click="FinishParamaterSetting">设置完成</el-button>
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -25,18 +15,33 @@
|
|
|
<div class="page_jg_20"></div>
|
|
|
|
|
|
<Form :inlineLayout="false"
|
|
|
+ v-model:formRef="paramsSettingFormDom"
|
|
|
:formItemList="paramsConfigFormItemList"
|
|
|
- :defaultFormData="{}"
|
|
|
+ :defaultFormData="defaultParamsConfigFormData"
|
|
|
:formDisabled="!isEdit"
|
|
|
>
|
|
|
<template #lowScoreDeleteRatio="{}">
|
|
|
- <el-radio-group :disabled="!isEdit"
|
|
|
- v-model="defaultParamsConfigFormData.lowScoreDeleteRatio">
|
|
|
- <el-radio v-for="radioItem in lowScoreDeleteRatioList" :key="radioItem.value"
|
|
|
- :value="radioItem.value">
|
|
|
- {{ radioItem.label }}
|
|
|
- </el-radio>
|
|
|
- </el-radio-group>
|
|
|
+ <div class="low_score_delete_ratio">
|
|
|
+ <el-radio-group :disabled="!isEdit"
|
|
|
+ v-model="defaultParamsConfigFormData.lowScoreDeleteRatio">
|
|
|
+ <el-radio v-for="radioItem in lowScoreDeleteRatioList" :key="radioItem.value"
|
|
|
+ :value="radioItem.value">
|
|
|
+ {{ radioItem.label }}
|
|
|
+ </el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+
|
|
|
+ <!-- <el-input v-if="defaultParamsConfigFormData.lowScoreDeleteRatio == 'custom'"
|
|
|
+ :disabled="!isEdit"
|
|
|
+ v-model.number="defaultParamsConfigFormData.customLowScoreDeleteRatio"
|
|
|
+ placeholder="请输入"/> -->
|
|
|
+
|
|
|
+ <el-input v-if="defaultParamsConfigFormData.lowScoreDeleteRatio == 'custom'"
|
|
|
+ type="number" :disabled="!isEdit"
|
|
|
+ v-model="defaultParamsConfigFormData.customLowScoreDeleteRatio"
|
|
|
+ placeholder="请输入"/>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
</template>
|
|
|
</Form>
|
|
|
|
|
|
@@ -46,22 +51,23 @@
|
|
|
:tableData="tableData"
|
|
|
:totalNum="0"
|
|
|
:hidePagination="true">
|
|
|
- <template #subject="{row}">
|
|
|
+ <template #subjectData="{row}">
|
|
|
<div class="subject_tag">
|
|
|
<el-tag
|
|
|
- v-for="item in row.subject.split('、')"
|
|
|
+ v-for="item in row.subjectData"
|
|
|
:key="item"
|
|
|
+ :disable-transitions="true"
|
|
|
type="info"
|
|
|
effect="plain"
|
|
|
>
|
|
|
- {{ item }}
|
|
|
+ {{ item.name }}
|
|
|
</el-tag>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #operation="{row}">
|
|
|
<div class="table_row_option">
|
|
|
<span :class="[isEdit ? 'el_button_editor' : 'editor_disable']">编辑</span>
|
|
|
- <span :class="[isEdit ? 'el_button_delete' : 'editor_disable']">删除</span>
|
|
|
+ <span :class="[isEdit ? 'el_button_delete' : 'editor_disable']" @click="OpenDeleteDialog(row)">删除</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
</Table>
|
|
|
@@ -77,15 +83,21 @@
|
|
|
:submitLoading="compositionSubjectFormLoading"
|
|
|
:formItemList="formItemList"
|
|
|
@close="CloseSubjectCompositionForm"
|
|
|
- @confirm="">
|
|
|
+ @confirm="HandleAddCompositionSubject">
|
|
|
</FormDialog>
|
|
|
|
|
|
+ <Dialog :visible="deleteDialogVisible"
|
|
|
+ :submitLoading="deleteSubmitLoading"
|
|
|
+ @close="CloseDeleteDialog" @confirm="HandleDeleteConfirm"></Dialog>
|
|
|
+
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import { onMounted, ref } from 'vue';
|
|
|
+import { useRoute,useRouter } from 'vue-router';
|
|
|
+
|
|
|
import Table from '@/baseComponents/Table.vue';
|
|
|
import Form from '@/baseComponents/Form.vue';
|
|
|
import FormDialog from '@/baseComponents/FormDialog.vue';
|
|
|
@@ -94,11 +106,17 @@ import {paramsConfigFormItemList} from './form'
|
|
|
import { tableColumns } from './table';
|
|
|
import {formItemList} from './formDialog'
|
|
|
|
|
|
-import cancelIcon from '@/assets/icon/cancel.svg'
|
|
|
-import saveIcon from '@/assets/icon/save_icon.png'
|
|
|
+import {
|
|
|
+ getParameterSettingListApi,getSubjectDataListApi,deleteCompositionSubjectApi,
|
|
|
+ addOrUpdateCompositionSubjectApi,finishParamaterSettingApi,saveParamaterSettingApi
|
|
|
+} from '@/api/step5Component'
|
|
|
+import { ElMessage } from 'element-plus';
|
|
|
+import Dialog from '@/baseComponents/Dialog.vue';
|
|
|
|
|
|
+const route = useRoute()
|
|
|
+const router = useRouter()
|
|
|
|
|
|
-// 参数设置 表单
|
|
|
+// 1. 参数设置 表单
|
|
|
const defaultParamsConfigFormData = ref({})
|
|
|
|
|
|
const lowScoreDeleteRatioList = ref([
|
|
|
@@ -120,47 +138,175 @@ const lowScoreDeleteRatioList = ref([
|
|
|
},
|
|
|
])
|
|
|
|
|
|
-const tableData = ref([
|
|
|
- {
|
|
|
- id:'1',
|
|
|
- compositionName:'语数英',
|
|
|
- subject:'语文、数学、英语',
|
|
|
- },
|
|
|
- {
|
|
|
- id:'2',
|
|
|
- compositionName:'物化生',
|
|
|
- subject:'物理、化学、生物',
|
|
|
- },
|
|
|
+interface TableData {
|
|
|
+ id:string,
|
|
|
+ groupSubjectName:string,
|
|
|
+ subjectData:{
|
|
|
+ name:string
|
|
|
+ }[]
|
|
|
+}
|
|
|
+const tableData = ref<TableData[]>([])
|
|
|
|
|
|
-])
|
|
|
+// 获取参数设置 的信息
|
|
|
+const GetParamaterSetting = async ()=>{
|
|
|
+ let res = await getParameterSettingListApi(route.query.id)
|
|
|
+ if(res?.code == 200){
|
|
|
+ tableData.value = res.data.groupSubjects
|
|
|
+ defaultParamsConfigFormData.value.id = res.data.id
|
|
|
+ defaultParamsConfigFormData.value.isDeleteFullScore = res.data.fullScoreStatus
|
|
|
+ defaultParamsConfigFormData.value.lowScoreDeleteRatio = res.data.lowScoreCustom ? 'custom' : res.data.lowScoreRadio
|
|
|
+ defaultParamsConfigFormData.value.customLowScoreDeleteRatio = res.data.lowScoreCustom ? res.data.lowScoreRadio : ''
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
-// 参数设置 操作
|
|
|
+
|
|
|
+// 2. 参数设置 操作
|
|
|
const isEdit = ref(false)
|
|
|
-// 开始编辑
|
|
|
-const StartEdit = ()=>{
|
|
|
- isEdit.value = true
|
|
|
-}
|
|
|
-// 保存编辑
|
|
|
-const SaveEdit = ()=>{
|
|
|
- isEdit.value = false
|
|
|
+const paramsSettingFormDom = ref() // 参数设置表单dom
|
|
|
+
|
|
|
+// 开始/保存 编辑
|
|
|
+const StartOrSaveEdit = async ()=>{
|
|
|
+ if(isEdit.value){
|
|
|
+ console.log('点击 了')
|
|
|
+ console.log('参数设置表单的值__',defaultParamsConfigFormData.value)
|
|
|
+
|
|
|
+ let params = {
|
|
|
+ id: defaultParamsConfigFormData.value.id,
|
|
|
+ evaluationId: route.query.id,
|
|
|
+ fullScoreStatus: defaultParamsConfigFormData.value.isDeleteFullScore,
|
|
|
+ lowScoreRadio: defaultParamsConfigFormData.value.lowScoreDeleteRatio == 'custom' ? defaultParamsConfigFormData.value.customLowScoreDeleteRatio : defaultParamsConfigFormData.value.lowScoreDeleteRatio,
|
|
|
+ lowScoreCustom: defaultParamsConfigFormData.value.lowScoreDeleteRatio == 'custom' ? 1 : 0
|
|
|
+ }
|
|
|
+
|
|
|
+ let res = await saveParamaterSettingApi(params)
|
|
|
+ if(res?.code == 200){
|
|
|
+ ElMessage.success(res?.msg)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ isEdit.value = !isEdit.value
|
|
|
}
|
|
|
|
|
|
|
|
|
-// 新增科目组合表单 及 操作
|
|
|
+// 3. 新增科目组合弹窗 及 操作
|
|
|
const compositionSubjectFormVisible = ref(false)
|
|
|
const compositionSubjectFormLoading = ref(false)
|
|
|
-const OpenSubjectCompositionForm = ()=>{
|
|
|
+
|
|
|
+// 打开弹窗
|
|
|
+const OpenSubjectCompositionForm = async ()=>{
|
|
|
compositionSubjectFormVisible.value = true
|
|
|
+ await GetSubjectDataList()
|
|
|
}
|
|
|
|
|
|
+// 关闭弹窗
|
|
|
const CloseSubjectCompositionForm = ()=>{
|
|
|
compositionSubjectFormVisible.value = false
|
|
|
+ compositionSubjectFormLoading.value = false
|
|
|
+}
|
|
|
+
|
|
|
+// 新增科目弹窗确认
|
|
|
+const HandleAddCompositionSubject = async (params)=>{
|
|
|
+ compositionSubjectFormLoading.value = true
|
|
|
+ const {formData,formRef} = params
|
|
|
+ console.log('表单弹窗信息',formData)
|
|
|
+ let subjectData = formData.subjectList.map(item=>{
|
|
|
+ return {
|
|
|
+ code:item
|
|
|
+ }
|
|
|
+ })
|
|
|
+ let transferParams = {
|
|
|
+ // "id": 0,
|
|
|
+ evaluationId: route.query.id,
|
|
|
+ // "evaluationGroupSubjectId": 0,
|
|
|
+ groupSubjectName: formData.groupSubjectName,
|
|
|
+ subjectData: subjectData
|
|
|
+ }
|
|
|
+
|
|
|
+ let res = undefined
|
|
|
+ res = await addOrUpdateCompositionSubjectApi(transferParams)
|
|
|
+
|
|
|
+ if(res?.code == 200){
|
|
|
+ ElMessage.success(res?.msg)
|
|
|
+ CloseSubjectCompositionForm()
|
|
|
+ // 重查数据
|
|
|
+ await GetParamaterSetting()
|
|
|
+
|
|
|
+ }else{
|
|
|
+ compositionSubjectFormLoading.value = false
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 查询科目下拉数据
|
|
|
+const GetSubjectDataList = async ()=>{
|
|
|
+ let res = await getSubjectDataListApi(route.query.id)
|
|
|
+ if(res?.code == 200){
|
|
|
+ let subjectOptions = res?.data.map(item=>{
|
|
|
+ return {
|
|
|
+ label:item.name,
|
|
|
+ value:item.code
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ formItemList.value = formItemList.value.map(item=>{
|
|
|
+ if(item.key == 'subjectList'){
|
|
|
+ item.selectList = subjectOptions
|
|
|
+ }
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+// 4. 删除科目组合
|
|
|
+//
|
|
|
+const deleteDialogVisible = ref(false)
|
|
|
+const deleteSubmitLoading = ref(false)
|
|
|
+const currentDeleteRow = ref()
|
|
|
+// 关闭删除弹窗
|
|
|
+const CloseDeleteDialog = ()=>{
|
|
|
+ deleteDialogVisible.value = false
|
|
|
+ deleteSubmitLoading.value = false
|
|
|
+
|
|
|
+}
|
|
|
+// 打开删除弹窗
|
|
|
+const OpenDeleteDialog = (row)=>{
|
|
|
+ currentDeleteRow.value = row
|
|
|
+ deleteDialogVisible.value = true
|
|
|
+}
|
|
|
+
|
|
|
+const HandleDeleteConfirm = async ()=>{
|
|
|
+ deleteSubmitLoading.value = true
|
|
|
+ let row = currentDeleteRow.value
|
|
|
+ let res = undefined
|
|
|
+ try{
|
|
|
+ res= await deleteCompositionSubjectApi(row.id)
|
|
|
+ }catch{}
|
|
|
+ if(res?.code == 200){
|
|
|
+ ElMessage.success(res?.msg)
|
|
|
+ CloseDeleteDialog()
|
|
|
+ // 重新查询
|
|
|
+ await GetParamaterSetting()
|
|
|
+ }
|
|
|
+ deleteSubmitLoading.value = false
|
|
|
}
|
|
|
|
|
|
|
|
|
+// 5. 完成参数设置
|
|
|
+const FinishParamaterSetting = async ()=>{
|
|
|
+ let params = {
|
|
|
+ id: defaultParamsConfigFormData.value.id,
|
|
|
+ evaluationId: route.query.id,
|
|
|
+ fullScoreStatus: defaultParamsConfigFormData.value.isDeleteFullScore,
|
|
|
+ lowScoreRadio: defaultParamsConfigFormData.value.lowScoreDeleteRatio == 'custom' ? defaultParamsConfigFormData.value.customLowScoreDeleteRatio : defaultParamsConfigFormData.value.lowScoreDeleteRatio,
|
|
|
+ lowScoreCustom: defaultParamsConfigFormData.value.lowScoreDeleteRatio == 'custom' ? 1 : 0
|
|
|
+ }
|
|
|
+ let res = await finishParamaterSettingApi(params)
|
|
|
+ if(res?.code == 200){
|
|
|
+ ElMessage.success(res?.msg)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
onMounted(async ()=>{
|
|
|
-
|
|
|
-
|
|
|
+ await GetParamaterSetting()
|
|
|
})
|
|
|
</script>
|
|
|
|
|
|
@@ -186,6 +332,17 @@ onMounted(async ()=>{
|
|
|
padding:4px 0;
|
|
|
color:#2e64fa;
|
|
|
font-size: 14px;
|
|
|
+}
|
|
|
|
|
|
+.low_score_delete_ratio{
|
|
|
+ display: flex;
|
|
|
+ width: 100%;
|
|
|
+ :deep(.el-input){
|
|
|
+ width: 80px;
|
|
|
+ margin-left: 8px;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
</style>
|