mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-24 18:22:55 +08:00
Merge branch 'zcwy_0712_bug' into master_1202
This commit is contained in:
@@ -87,7 +87,7 @@ const canSubmit = computed(() => {
|
||||
data.value.scoringQuestionVoList
|
||||
];
|
||||
|
||||
return lists.some(list => Array.isArray(list) && list.length > 0);
|
||||
return lists.some(list => Array.isArray(list) && list?.filter(item=>!item.deleted).length > 0);
|
||||
});
|
||||
// const orderList = computed(()=>[...data.value.singleStemVoList.filter(t=>!t.deleted),...data.value.multipleStemVoList.filter(t=>!t.deleted),...data.value.essayQuestionVoList.filter(t=>!t.deleted),...data.value.scoringQuestionVoList.filter(t=>!t.deleted)].sort((a,b)=>a.orderNumber-b.orderNumber))
|
||||
const orderList = computed(() => {
|
||||
@@ -103,7 +103,13 @@ const orderList = computed(() => {
|
||||
.sort((a, b) => a.orderNumber - b.orderNumber);
|
||||
});
|
||||
watch(()=>orderList.value.length,()=> orderList.value.forEach((t,i)=>t.orderNumber = i + 1))
|
||||
watchEffect(() => id && request(ASSESSMENT_DETAIL(id), {}).then((res) => data.value = res.data));
|
||||
watchEffect(() => id && request(ASSESSMENT_DETAIL(id), {}).then((res) =>{
|
||||
res.data.singleStemVoList = res.data.singleStemVoList || []
|
||||
res.data.multipleStemVoList = res.data.multipleStemVoList || []
|
||||
res.data.essayQuestionVoList = res.data.essayQuestionVoList || []
|
||||
res.data.scoringQuestionVoList = res.data.scoringQuestionVoList || []
|
||||
data.value = res.data
|
||||
}));
|
||||
const handleSave = () => {
|
||||
console.log(data);
|
||||
loading.value = true;
|
||||
@@ -112,12 +118,12 @@ const handleSave = () => {
|
||||
loading.value = false;
|
||||
return false;
|
||||
}
|
||||
const listsss = data.value.scoringQuestionVoList.map((item) => ({
|
||||
minimumEvaluation: item.minimumEvaluation || '非常不满意',
|
||||
highestEvaluation: item.highestEvaluation || '非常满意',
|
||||
orderNumber: item.orderNumber,
|
||||
assessmentId: id,
|
||||
}));
|
||||
// const listsss = data.value.scoringQuestionVoList.map((item) => ({
|
||||
// minimumEvaluation: item.minimumEvaluation || '非常不满意',
|
||||
// highestEvaluation: item.highestEvaluation || '非常满意',
|
||||
// orderNumber: item.orderNumber,
|
||||
// assessmentId: id,
|
||||
// }));
|
||||
// // 如果 assessmentId 有值调用
|
||||
// if(id){
|
||||
// request('/activitySubmit/editAssessmentScore post',listsss).then((res)=>{
|
||||
@@ -238,11 +244,11 @@ const checkVal = () => {
|
||||
return false;
|
||||
}
|
||||
// 评分
|
||||
if (data.value.scoringQuestionVoList.length && data.value.scoringQuestionVoList?.some((item) => !item.deleted && (!item.assessmentScTitle))) {
|
||||
if (data.value.scoringQuestionVoList?.length && data.value.scoringQuestionVoList?.some((item) => !item.deleted && (!item.assessmentScTitle))) {
|
||||
message.error("评分题干为必填 请确认!");
|
||||
return false;
|
||||
}
|
||||
if (data.value.scoringQuestionVoList.length && data.value.scoringQuestionVoList.reduce((pre, cur) => pre + parseInt(cur.weightScale), 0) !== 100) {
|
||||
if (data.value.scoringQuestionVoList?.filter(item=>!item.deleted)?.length && data.value.scoringQuestionVoList?.filter(item=>!item.deleted)?.reduce((pre, cur) => pre + parseInt(cur.weightScale), 0) !== 100) {
|
||||
message.error("当前权重设置是百分制 请重新配置");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,10 @@
|
||||
</template>
|
||||
<script setup>
|
||||
const props = defineProps({ index: Number, list: Array, item: Object});
|
||||
const del = () => props.item.id?(props.item.deleted = true):(props.list.splice(props.index, 1));
|
||||
const del = () => {
|
||||
const index = props.list.findIndex(t => t.orderNumber==props.item.orderNumber)||0
|
||||
props.item.id?(props.item.deleted = true):(props.list.splice(index, 1))
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.researchadd {
|
||||
|
||||
@@ -102,7 +102,10 @@ import {computed} from "vue";
|
||||
import {message} from "ant-design-vue";
|
||||
|
||||
const props = defineProps({ index: Number, list: Array, item: Object });
|
||||
const del = () => props.item.id ? (props.item.deleted = true) : (props.list.splice(props.index, 1));
|
||||
const del = () => {
|
||||
const index = props.list.findIndex(t => t.orderNumber==props.item.orderNumber)||0
|
||||
props.item.id ? (props.item.deleted = true) : (props.list.splice(index, 1))
|
||||
};
|
||||
const scoreList = computed(() => new Array(props.item.assessmentMaxScore - props.item.assessmentMinScore + 1).fill(0).map((value, index) => ({ id: index + 1, text: props.item.assessmentMinScore + index })));
|
||||
const minChange = (e) => {
|
||||
if (e > props.item.assessmentMaxScore) return message.warning("最低分不能超过最高分");
|
||||
|
||||
Reference in New Issue
Block a user