licailing 4 лет назад
Родитель
Сommit
5d9501922c

+ 1 - 0
src/main/java/com/izouma/wenlvju/security/WebSecurityConfig.java

@@ -80,6 +80,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
                 .antMatchers("/programmeScore/breakdown").permitAll()
                 .antMatchers("/programmeScore/mark").permitAll()
                 .antMatchers("/participant/byProgramme").permitAll()
+                .antMatchers("/artType/allList").permitAll()
                 .antMatchers("/upload/**").permitAll()
                 .antMatchers("/files/**").permitAll()
                 .antMatchers("/static/**").permitAll()

+ 13 - 1
src/main/java/com/izouma/wenlvju/service/performance/ProgrammeService.java

@@ -786,6 +786,16 @@ public class ProgrammeService {
         Long userId = Convert.convert(Long.class, query.get("userId"));
         query.remove("userId");
 
+        Object code = query.get("code");
+        String artCode = null;
+        if (ObjectUtil.isNotNull(code)) {
+            artCode = Convert.convert(String.class, code);
+            query.remove("code");
+        }
+
+        List<ArtType> artTypes = artTypeRepo.findAll();
+
+        String finalArtCode = artCode;
         List<Long> arrangeId = arrangeJudgeRepo.findArrangeIdByExpertIdAndAuditTimes(userId, auditTimes);
         if (CollUtil.isEmpty(arrangeId)) {
             return new PageImpl<>(new ArrayList<>(), JpaUtils.toPageRequest(pageQuery), 0);
@@ -799,7 +809,9 @@ public class ProgrammeService {
             } else {
                 and.add(root.get("arrangeId").in(arrangeId));
             }
-
+            if (StrUtil.isNotBlank(finalArtCode)) {
+                and.add(root.get("specialtyId").in(artTypeService.getIds(artTypes, finalArtCode)));
+            }
             return criteriaBuilder.and(and.toArray(new Predicate[0]));
         }), JpaUtils.toPageRequest(pageQuery));
 

+ 1 - 1
src/main/java/com/izouma/wenlvju/web/performance/ProgrammeController.java

@@ -186,7 +186,7 @@ public class ProgrammeController extends BaseController {
     @PostMapping("/byScoreAdmin")
     @ApiOperation("查看分数")
     public Page<ProgrammeScoreDTO> byScoreAdmin(@RequestBody PageQuery pageQuery) {
-        Page<Programme> all = this.all(pageQuery);
+        Page<Programme> all = programmeService.all2(pageQuery);
         return programmeService.toDTOPage(all);
     }
 

+ 118 - 63
src/main/vue/src/views/performance/ProgScoreAdminList.vue

@@ -22,6 +22,19 @@
                                 </el-option>
                             </el-select>
                         </el-form-item>
+                        <el-form-item label="参赛专业">
+                            <el-cascader
+                                ref="artCascader"
+                                style="width: 100%"
+                                v-model="form.specialtyId"
+                                :props="optionProps"
+                                :options="artTypes"
+                                :show-all-levels="false"
+                                placeholder="请选择专业"
+                                clearable
+                            >
+                            </el-cascader>
+                        </el-form-item>
                         <el-form-item>
                             <el-button @click="getData" type="primary" icon="el-icon-search">查询 </el-button>
                         </el-form-item>
@@ -147,69 +160,73 @@
             center
             append-to-body
             :visible.sync="showViedo"
-            width="auto"
+            width="45vw"
         >
-            <video
-                :src="programme.video"
-                controls
-                style="max-height: 600px; max-width: 100%; margin: 0 auto"
-                v-if="programme.video"
-            >
-                您的浏览器不支持 video 标签。
-            </video>
-            <img
-                style="max-height: 600px; max-width: 100%; display: block; margin: auto"
-                :src="programme.annex"
-                alt=""
-                v-if="programme.annex"
-            />
-            <el-card shadow="never" style="width: 100%; margin: 10px auto">
-                <el-form :form="programme">
-                    <el-form-item label="分数">
-                        <span v-if="!programme.second">{{ programme.score }}</span>
-                        <el-input-number
-                            v-else
-                            v-model="programme.score"
-                            size="mini"
-                            label=""
-                            :min="0"
-                            :max="100"
-                            :step="1"
-                            :controls="true"
-                            controls-position="both"
-                        >
-                        </el-input-number>
-                    </el-form-item>
-                    <el-form-item>
-                        <span v-if="performance.status == 'RATE'" style="margin-right: 10px">
-                            <el-button
+            <div class="dialog-content">
+                <video
+                    :src="programme.video"
+                    controls
+                    style="max-height: 600px; max-width: 100%; margin: 0 auto"
+                    v-if="programme.video"
+                >
+                    您的浏览器不支持 video 标签。
+                </video>
+                <img
+                    style="max-height: 600px; max-width: 100%; display: block; margin: auto"
+                    :src="programme.annex"
+                    alt=""
+                    v-if="programme.annex"
+                />
+                <el-card shadow="never" style="width: 100%; margin: 10px auto">
+                    <el-form :form="programme">
+                        <el-form-item label="分数">
+                            <span v-if="!programme.second">{{ programme.score }}</span>
+                            <el-input-number
+                                v-else
+                                v-model="programme.score"
                                 size="mini"
-                                v-if="!programme.second"
-                                @click="programme.second = true"
-                                type="warning"
-                                >修改</el-button
+                                label=""
+                                :min="0"
+                                :max="100"
+                                :step="1"
+                                :controls="true"
+                                controls-position="both"
                             >
-                            <el-button size="mini" v-else @click="saveRow(programme)" type="primary">保存</el-button>
+                            </el-input-number>
+                        </el-form-item>
+                        <el-form-item>
+                            <span v-if="performance.status == 'RATE'" style="margin-right: 10px">
+                                <el-button
+                                    size="mini"
+                                    v-if="!programme.second"
+                                    @click="programme.second = true"
+                                    type="warning"
+                                    >修改</el-button
+                                >
+                                <el-button size="mini" v-else @click="saveRow(programme)" type="primary"
+                                    >保存</el-button
+                                >
+                                <el-button
+                                    @click="programme.second = false"
+                                    size="mini"
+                                    plain
+                                    type="danger"
+                                    v-if="programme.second"
+                                    >取消</el-button
+                                >
+                            </span>
+                            <el-button size="mini" @click="move(-1)" :disabled="index == 0">上一个</el-button>
                             <el-button
-                                @click="programme.second = false"
                                 size="mini"
-                                plain
-                                type="danger"
-                                v-if="programme.second"
-                                >取消</el-button
+                                @click="move(1)"
+                                :disabled="(page - 1) * pageSize + index == totalElements - 1"
+                                >下一个</el-button
                             >
-                        </span>
-                        <el-button size="mini" @click="move(-1)" :disabled="index == 0">上一个</el-button>
-                        <el-button
-                            size="mini"
-                            @click="move(1)"
-                            :disabled="(page - 1) * pageSize + index == totalElements - 1"
-                            >下一个</el-button
-                        >
-                        <el-button @click="showViedo = false" size="mini">关闭</el-button>
-                    </el-form-item>
-                </el-form>
-            </el-card>
+                            <el-button @click="showViedo = false" size="mini">关闭</el-button>
+                        </el-form-item>
+                    </el-form>
+                </el-card>
+            </div>
         </el-dialog>
         <review-log :dialogVisible="isShow" :total="totalElements" @close="isShow = false" ref="public"></review-log>
     </div>
@@ -219,10 +236,6 @@ import delChild from '@/mixins/delChild';
 import { mapState } from 'vuex';
 import pageableTable from '@/mixins/pageableTable';
 import ReviewLog from '../../components/ReviewLog';
-// import QrcodeVue from 'qrcode.vue';
-// import { format, isSameDay, startOfDay } from 'date-fns';
-// import endOfDay from 'date-fns/endOfDay';
-// import addHours from 'date-fns/addHours';
 
 export default {
     name: 'ProgScoreAdminList',
@@ -254,12 +267,29 @@ export default {
             showViedo: false,
             programme: {},
             index: 0,
-            isShow: false
+            isShow: false,
+            artTypes: [],
+            optionProps: {
+                value: 'id',
+                label: 'name',
+                children: 'children',
+                multiple: false,
+                emitPath: false,
+                checkStrictly: true,
+                expandTrigger: 'hover'
+            }
         };
     },
     created() {
         // this.morning = isSameDay(addHours(new Date(), 12), new Date());
-
+        this.$http
+            .post('/artType/allList')
+            .then(res => {
+                this.artTypes = this.delChild(res);
+            })
+            .catch(e => {
+                console.log(e);
+            });
         this.$http
             .post(
                 '/performance/all',
@@ -335,6 +365,9 @@ export default {
             if (!this.review) {
                 data.query.programmeStatus.push('REVIEW_FAILED');
             }
+            if (this.form.specialtyId) {
+                data.query.code = this.getCode(this.form.specialtyId);
+            }
             return data;
         },
         toggleMultipleMode(multipleMode) {
@@ -499,6 +532,28 @@ export default {
         editRow(id) {
             this.isShow = true;
             this.$refs.public.init(id);
+        },
+        getCode(value) {
+            return this.forTree(this.artTypes, value).code;
+        },
+        forTree(list, value) {
+            var result = null;
+            if (!list) {
+                return;
+            }
+            for (var i in list) {
+                if (result !== null) {
+                    break;
+                }
+                var item = list[i];
+                if (item.id == value) {
+                    result = item;
+                    break;
+                } else if (item.children && item.children.length > 0) {
+                    result = this.forTree(item.children, value);
+                }
+            }
+            return result;
         }
     }
 };

+ 72 - 56
src/main/vue/src/views/performance/ProgrammeScoreList.vue

@@ -3,6 +3,26 @@
         <div class="filters-container">
             <el-form :model="form" size="mini" inline>
                 <el-row>
+                    <el-col :span="16">
+                        <el-form-item label="参赛专业">
+                            <el-cascader
+                                ref="artCascader"
+                                style="width: 100%"
+                                v-model="form.specialtyId"
+                                :props="optionProps"
+                                :options="artTypes"
+                                :show-all-levels="false"
+                                placeholder="请选择专业"
+                                clearable
+                            >
+                            </el-cascader>
+                        </el-form-item>
+                        <el-form-item>
+                            <el-button @click="getData" type="primary" icon="el-icon-search" size="mini"
+                                >查询
+                            </el-button>
+                        </el-form-item>
+                    </el-col>
                     <!-- <el-col :span="24">
                         <el-form-item label="活动名称">
                             <el-select
@@ -263,16 +283,6 @@
                     </el-form>
                 </el-card>
             </div>
-            <!-- <video
-                :src="videoUrl"
-                controlsList="nodownload noremote footbar"
-                controls
-                style="height: 100%; max-width: 100%"
-                ref="video"
-                v-if="showViedo"
-            >
-                您的浏览器不支持 video 标签。
-            </video> -->
         </el-dialog>
     </div>
 </template>
@@ -304,6 +314,16 @@ export default {
                 { label: '未签到', value: 'UNSIGNED' },
                 { label: '已调整', value: 'ADJUSTED' }
             ],
+            artTypes: [],
+            optionProps: {
+                value: 'id',
+                label: 'name',
+                children: 'children',
+                multiple: false,
+                emitPath: false,
+                checkStrictly: true,
+                expandTrigger: 'hover'
+            },
             signForm: {},
             addresses: [],
             morning: true,
@@ -348,7 +368,7 @@ export default {
                     text1: '90分以上',
                     text2: '嗓音条件很好,音域宽广,歌唱技术全面完美,音乐感很好,演唱艺术感染力强,曲目难度大。',
                     min: 90,
-                    max: 98
+                    max: 98.99
                 }
             ],
             scoreValue: [65, 0, 0]
@@ -356,51 +376,14 @@ export default {
     },
     created() {
         this.morning = isSameDay(addHours(new Date(), 12), new Date());
-
-        // this.$http
-        //     .post(
-        //         '/performance/all',
-        //         {
-        //             size: 1000,
-        //             sort: 'year,desc',
-        //             query: {
-        //                 publish: true
-        //             }
-        //         },
-        //         { body: 'json' }
-        //     )
-        //     .then(res => {
-        //         if (res.content.length > 0) {
-        //             res.content.forEach(item => {
-        //                 this.performances.push({
-        //                     label: item.name,
-        //                     value: item.id
-        //                 });
-        //             });
-        //             this.setPerformance(res.content[0]);
-        //             this.getData();
-        //             this.$http
-        //                 .post('/performanceSchedule/all', { size: 100 }, { body: 'json' })
-        //                 .then(res => {
-        //                     if (res.content.length > 0) {
-        //                         res.content.forEach(item => {
-        //                             this.addressList.push({
-        //                                 value: item.address,
-        //                                 pid: item.performanceId
-        //                             });
-        //                         });
-        //                     }
-        //                 })
-        //                 .catch(e => {
-        //                     console.log(e);
-        //                     this.$message.error(e.error);
-        //                 });
-        //         }
-        //     })
-        //     .catch(e => {
-        //         console.log(e);
-        //         this.$message.error(e.error);
-        //     });
+        this.$http
+            .post('/artType/allList')
+            .then(res => {
+                this.artTypes = this.delChild(res);
+            })
+            .catch(e => {
+                console.log(e);
+            });
     },
     computed: {
         selection() {
@@ -454,6 +437,9 @@ export default {
             if (this.$route.query.eid) {
                 data.query.userId = this.$route.query.eid;
             }
+            if (this.form.specialtyId) {
+                data.query.code = this.getCode(this.form.specialtyId);
+            }
             // if (this.date) {
             //     if (this.morning) {
             //         data.query.showBegin = [
@@ -616,6 +602,14 @@ export default {
             const end = direction + this.index;
             this.programme = { ...this.tableData[end] };
             this.index = end;
+
+            let info = [...this.scoreOptions].find(item => {
+                return this.programme.myScore >= item.min && this.programme.myScore <= item.max;
+            });
+            this.scoreType = info ? info.value : 'D';
+            let score = (this.programme.myScore * 100).toString();
+
+            this.scoreValue = [Number(score.substr(0, 2)), Number(score.substr(2, 1)), Number(score.substr(3, 1))];
         },
         setPerformance(row) {
             this.form.performanceId = row.id;
@@ -624,6 +618,28 @@ export default {
             if (this.review) {
                 this.online = this.reviewOnline;
             }
+        },
+        getCode(value) {
+            return this.forTree(this.artTypes, value).code;
+        },
+        forTree(list, value) {
+            var result = null;
+            if (!list) {
+                return;
+            }
+            for (var i in list) {
+                if (result !== null) {
+                    break;
+                }
+                var item = list[i];
+                if (item.id == value) {
+                    result = item;
+                    break;
+                } else if (item.children && item.children.length > 0) {
+                    result = this.forTree(item.children, value);
+                }
+            }
+            return result;
         }
     }
 };