From f776f9a426354b54a063efa80e6dfd35f3ca68d9 Mon Sep 17 00:00:00 2001 From: lyfO_o <764716047@qq.com> Date: 星期二, 29 三月 2022 17:29:17 +0800 Subject: [PATCH] 暂时提交 --- src/api/nanoexam.js | 27 ++++++ src/views/exam/current.vue | 107 ++++++++++++++++++++++++++ src/views/exam/component/classification.vue | 65 ++++++++++++++++ 3 files changed, 199 insertions(+), 0 deletions(-) diff --git a/src/api/nanoexam.js b/src/api/nanoexam.js new file mode 100644 index 0000000..4f92996 --- /dev/null +++ b/src/api/nanoexam.js @@ -0,0 +1,27 @@ +import {getToken} from "../utils/auth"; +import request from '@/utils/request' + +const remote = 'http://222.92.213.21:8006' + +export function classificationList(params) { + return request({ + headers: { + 'Access-Control-Allow-Origin': '*', + }, + url: 'http://127.0.0.1:8083' + '/nanoweb/foreground/system/getMeta.do', + method: 'POST', + params:params + }) +} + + +export function currentExamList(data) { + return request({ + headers: { + 'Authorization': getToken() + }, + url: remote + '/nanoweb/foreground/currentExam/query.do', + method: 'post', + data + }) +} diff --git a/src/views/exam/component/classification.vue b/src/views/exam/component/classification.vue new file mode 100644 index 0000000..ce8c06f --- /dev/null +++ b/src/views/exam/component/classification.vue @@ -0,0 +1,65 @@ +<template> + <div > + <button + class="filter-btn" + v-for="(item,index) in array" + v-bind:class="{'active':index === num}" + :key="item.id" + @click="activeClick(item.id,index)">{{item.value}}</button> + </div> +</template> + +<script> + export default { + name: "classification", + props: { + array: { + type: Array, + default: () => [], + required: true + }, + }, + data(){ + return { + num:'', + isActive:false + } + }, + methods:{ + activeClick(id,index){ + this.num = index + this.$emit("setId",id) + } + } + + } + +</script> + +<style scoped> + .filter-btn{ + cursor: pointer; + min-width: 112px; + height: 32px; + border-radius: 15px; + border: 1px solid #e5e5e5; + background-color: #fff; + color: #000; + font-size: 14px; + margin-right: 20px; + margin-bottom: 10px; + } + + .filter-btn:hover{ + border-color: #fff; + background-color: #b2d8ff; + color: #fff; + } + + .active{ + background-color: #5dadff; + border-color: #5dadff; + color: #fff; + } + +</style> diff --git a/src/views/exam/current.vue b/src/views/exam/current.vue new file mode 100644 index 0000000..c419bda --- /dev/null +++ b/src/views/exam/current.vue @@ -0,0 +1,107 @@ +<template> + <div class="app-container"> + + <div class="filter-container"> + <div class="basic_search" > + <div style="display: inline-block"> + <span class="span-filter-label">考试名称:</span> + <el-input v-model="filter.keyword" style="width: 200px" placeholder="请输入内容"></el-input> + </div> + <div style="display: inline-block;margin-left: 15px"> + <span class="span-filter-label">考试时间:</span> + <el-date-picker + v-model="rangeTime" + type="datetimerange" + start-placeholder="开始日期" + end-placeholder="结束日期" + :default-time="['00:00:00','23:59:59']"> + </el-date-picker> + </div> + <div style="display: inline-block;margin-left: 15px"> + <el-button + style="margin-left: 10px;" + type="primary" + icon="el-icon-search" + @click="queryHandle"> + </el-button> + </div> + </div> + + <div class="basic_search"> + <div> + <classification :array="list" v-model="filter.type" @setId="setId"></classification> + </div> + </div> + </div> + + + + + + + </div> + +</template> + +<script> + import classification from "./component/classification"; + + import {currentExamList,classificationList} from '@/api/nanoexam' + export default { + name: "current", + components:{ + classification + }, + created(){ + this.classificationList() + this.currentExamList() + }, + data(){ + return { + rangeTime:[], + filter:{ + type:"", + keyword:"", + startExamTime:"", + endExamTime:"", + current:1, + rowCount:4, + }, + list:[ + {id:1,value:"全部"}, + {id:2,value:"4526465"}, + {id:3,value:"asdsad"}, + ] + } + }, + methods:{ + queryHandle(){ + console.log(this.filter.type) + }, + currentExamList(){ + + }, + classificationList(){ + classificationList({groupId: 2}).then(res=>{ + console.log(res.data) + }) + }, + setId(id){ + this.filter.type = id + } + } + } +</script> + +<style scoped> + .span-filter-label{ + font-size: 15px; + color: #606266; + margin-right: 4px; + margin-left: 7px; + } + + .basic_search{ + margin-bottom: 15px; + } +</style> -- Gitblit v1.9.2