Jelajahi Sumber

评审规则添加字段

XW 1 tahun lalu
induk
melakukan
f234817b0a

+ 17 - 8
TEAMModelOS/ClientApp/src/view/signupActivity/createActivity.vue

@@ -934,14 +934,19 @@ export default {
                     this.$Message.success('创建成功!')
                     this.$router.go(-1)
                 } else {
-                    this.$api.blob.deletePrefix({
-                        "cntr": this.isArea ? this.areaId : this.$store.state.userInfo.schoolCode,
-                        "prefix": `activity/${this.createData.id}`
-                    }).then(res => {
-                        if(res.status) {
-                            console.log('删除成功');
-                        }
-                    })
+                    if(res.code === 25 || res.code === 26 || res.code === 27) {
+                        this.$Message.warning('填报信息未配置学段、学科,无法进行作品分配!')
+                    }
+                    if(params.Activity.poster || params.Activity.attachment.length) {
+                        this.$api.blob.deletePrefix({
+                            "cntr": this.isArea ? this.areaId : this.$store.state.userInfo.schoolCode,
+                            "prefix": `activity/${this.createData.id}`
+                        }).then(res => {
+                            if(res.status) {
+                                console.log('删除成功');
+                            }
+                        })
+                    }
                 }
             }).finally(() => {
                 this.isLoading = false
@@ -1075,6 +1080,10 @@ export default {
                             })
                         }
                     }
+                    if(!this.createData.modules.length) {
+                        this.$Message.warning('请先选择一个模块')
+                        break
+                    }
                     if(needBreak) break
                     // 加入发布活动页面前需保存学校列表、填报信息
                     this.createData.invitedSchools = []

+ 95 - 2
TEAMModelOS/ClientApp/src/view/signupActivity/infoComponent/ruleDrawer.vue

@@ -3,8 +3,11 @@
         <template v-if="ruleInfo">
             <div v-if="!ruleDrawerAdd" class="see-rule">
                 <p style="font-size: 18px; font-weight: bold;">{{ ruleInfo.name }}</p>
-                <p style="margin: 5px 0 10px 0;">描述:{{ ruleInfo.desc }}</p>
-                <!-- <p style="margin: 5px 0;">总分:{{ ruleInfo.score }}</p> -->
+                <p style="margin: 5px 0 10px 0;">规则描述:{{ ruleInfo.desc }}</p>
+                <p style="margin: 5px 0 10px 0;">评审方式:{{ ruleInfo.scoreDetail ? '对细项评分' : '只打总分' }}</p>
+                <p style="margin: 5px 0 10px 0;">评审次数:{{ ruleInfo.taskCount }}</p>
+                <p style="margin: 5px 0 10px 0;">统分规则:{{ scoreWord[ruleInfo.scoreRule] }}</p>
+                <p style="margin: 5px 0 10px 0;">作品分配:{{ distributeWord[ruleInfo.distribute] }}</p>
                 <div class="create-form">
                     <div class="rule-header">
                         <span>分项</span>
@@ -30,6 +33,33 @@
                     <FormItem label="规则描述">
                         <Input v-special-char v-model="ruleInfo.desc" placeholder="请输入规则描述" />
                     </FormItem>
+                    <FormItem label="评审方式">
+                        <RadioGroup v-model="ruleInfo.scoreDetail">
+                            <Radio :label="0">
+                                <span>只打总分</span>
+                            </Radio>
+                            <Radio :label="1">
+                                <span>对细项评分</span>
+                            </Radio>
+                        </RadioGroup>
+                    </FormItem>
+                    <FormItem label="评审次数">
+                        <InputNumber v-model="ruleInfo.taskCount" :min="1" :precision="0" />
+                    </FormItem>
+                    <FormItem label="统分规则">
+                        <Select v-model="ruleInfo.scoreRule">
+                            <Option v-for="item in scoreRuleList" :value="item.value" :key="item.value" :disabled="item.disabled">{{ item.label }}</Option>
+                        </Select>
+                    </FormItem>
+                    <FormItem label="作品分配">
+                        <Select v-model="ruleInfo.distribute">
+                            <Option v-for="item in distributeList" :value="item.value" :key="item.value">{{ item.label }}</Option>
+                        </Select>
+                        <span>
+                            <Icon type="md-alert" color="#ffad16" size="17" />
+                            填报信息的学段、学科需与专家信息一致才能匹配成功
+                        </span>
+                    </FormItem>
                     <!-- <FormItem label="规则分值">
                         <Input v-model="ruleInfo.score" placeholder="请输入分值" />
                     </FormItem> -->
@@ -95,18 +125,52 @@ export default {
     data () {
         return {
             ruleInfo: undefined,
+            scoreRuleList: [],
+            scoreWord: {
+                only: '按评审分数',
+                avg: '按平均分',
+                top: '按最高分',
+                rmLowAvg: '去掉最低分的平均分',
+                rmTopAvg: '去掉最高分的平均分',
+                rmLowTopAvg: '去掉最高分和最低分的平均分',
+            },
+            distributeList: [],
+            distributeWord: {
+                none: '不需要匹配',
+                period: '只匹配学段',
+                subject: '只匹配学科',
+                periodAndSubject: '同时匹配学科和学段',
+            },
         }
     },
     created () {
         this.ruleInfo = this.ruleDrawerAdd === 2 && !this.ruleInfoParent?.id ? {
             name: '',
             desc: null,
+            scoreDetail: 0,
+            taskCount: 1,
+            scoreRule: 'only',
+            distribute: 'none',
             owner: this.isArea ? this.areaId : this.$store.state.userInfo.schoolCode,
             sourceName: this.ruleInfoParent?.name,
             upsertAsTemplate: 0, //是否存为模板 0否  1是
             trees: this.dataRuleMould,
             isAdd: true, //判断是否为新增
         } : this.ruleInfoParent
+        this.scoreRuleList = [
+            {label: '按评审分数', value: 'only', disabled: false },
+            {label: '按平均分', value: 'avg', disabled: true },
+            {label: '按最高分', value: 'top', disabled: true },
+            {label: '去掉最低分的平均分', value: 'rmLowAvg', disabled: true},
+            {label: '去掉最高分的平均分', value: 'rmTopAvg', disabled: true},
+            {label: '去掉最高分和最低分的平均分', value: 'rmLowTopAvg', disabled: true},
+        ]
+        this.distributeList = [
+            {label: '不需要匹配', value: 'none'},
+            {label: '只匹配学段', value: 'period'},
+            {label: '只匹配学科', value: 'subject'},
+            {label: '同时匹配学科和学段', value: 'periodAndSubject'},
+        ]
     },
     watch: {
         ruleDrawerAdd: {
@@ -115,6 +179,10 @@ export default {
                 this.ruleInfo = n === 2 && !this.ruleInfoParent?.id ? {
                     name: '',
                     desc: null,
+                    scoreDetail: 0,
+                    taskCount: 1,
+                    scoreRule: 'only',
+                    distribute: 'none',
                     owner: this.isArea ? this.areaId : this.$store.state.userInfo.schoolCode,
                     sourceName: this.ruleInfoParent?.name,
                     upsertAsTemplate: 0, //是否存为模板 0否  1是
@@ -129,6 +197,10 @@ export default {
                 this.ruleInfo = this.ruleDrawerAdd === 2 && !n?.id ? {
                     name: '',
                     desc: null,
+                    scoreDetail: 0,
+                    taskCount: 1,
+                    scoreRule: 'only',
+                    distribute: 'none',
                     owner: this.isArea ? this.areaId : this.$store.state.userInfo.schoolCode,
                     sourceName: this.ruleInfoParent?.name,
                     upsertAsTemplate: 0, //是否存为模板 0否  1是
@@ -138,6 +210,27 @@ export default {
             },
             deep: true,
         },
+        "ruleInfo.taskCount": {
+            handler(n, o) {
+                this.scoreRuleList = this.scoreRuleList.map(item => {
+                    if(n === 1) {
+                        item.disabled = item.value != 'only'
+                    } else if(n === 2) {
+                        item.disabled = item.value === 'only' || item.value === 'rmLowAvg' || item.value === 'rmTopAvg' || item.value === 'rmLowTopAvg'
+                    } else if(n === 3) {
+                        item.disabled = item.value === 'only' || item.value === 'rmLowTopAvg'
+                    } else {
+                        item.disabled = item.value === 'only'
+                    }
+                    return item
+                })
+                if(n === 1) {
+                    this.ruleInfo.scoreRule = 'only'
+                } else if(n < 4) {
+                    this.ruleInfo.scoreRule = 'avg'
+                }
+            },
+        },
     },
     computed: {
         isArea() {