lyfO_o
2022-04-20 0b0876c987aee5e7b8c8537c0ea2013a1d1ad8fc
Merge remote-tracking branch 'remotes/origin/lyf' into master

# Conflicts:
# config/dev.env.js
# config/prod.env.js
已修改2个文件
已添加5个文件
306 ■■■■■ 文件已修改
config/dev.env.js 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
config/prod.env.js 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/exam.js 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/nanoexam.js 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exam/component/classification.vue 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exam/current.vue 107 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exam/index.vue 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
config/dev.env.js
@@ -18,19 +18,9 @@
  //   IMG_API: '"http://220.171.99.118:4100/upload/"',
  //     BASE_API: '"http://192.168.0.35:8006"',
  //     IMG_API: '"http://192.168.0.35:8006/upload/"',
    // BASE_API: '"http://222.92.213.21:8006/zhongtai"',
    // IMG_API: '"http://222.92.213.21:8006/zhongtai/upload/"',
    BASE_API: '"http://112.86.23.91:8006"',
    IMG_API: '"http://112.86.23.91:8006/upload/"',
    // BASE_API: '"http://222.92.213.21:8006/zhongtai_demo"',
    // IMG_API: '"http://222.92.213.21:8006/zhongtai_demo/upload/"',
    //
    // BASE_API: '"http://222.92.213.21:8006/zhongtai"',
    // IMG_API: '"http://222.92.213.21:8006/zhongtai/upload/"',
    BASE_API: '"http://222.92.213.21:8006/zhongtai"',
    IMG_API: '"http://222.92.213.21:8006/zhongtai/upload/"',
    NANO_API: '"http://127.0.0.1:8081/zhongtaiexam"',
    // BASE_API: '"http://220.171.99.118:4101/api"',
    // IMG_API: '"http://220.171.99.118:4101/api/upload/"',
};
config/prod.env.js
@@ -17,10 +17,5 @@
    BASE_API: '"http://222.92.213.21:8006/zhongtai"',
    IMG_API: '"http://222.92.213.21:8006/zhongtai/upload/"',
    // BASE_API: '"http://222.92.213.21:8006/zhongtai_demo"',
    // IMG_API: '"http://222.92.213.21:8006/zhongtai_demo/upload/"',
    // BASE_API: '"http://222.92.213.21:8006/zhongtai_demo"',
    // IMG_API: '"http://222.92.213.21:8006/zhongtai_demo/upload/"',
    NANO_API: '"http://222.92.213.21:8006/nanoweb"',
}
src/api/exam.js
对比新文件
@@ -0,0 +1,14 @@
import {getToken} from "../utils/auth";
import request from '@/utils/request'
export function getExamAuth(params) {
    return request({
        headers:{
            'Access-Control-Allow-Origin':'*',
            'Authorization':getToken()
        },
        url:process.env.NANO_API+ '/foreground/system/auth/verify.do',
        method:'get',
        params:params
    })
}
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
    })
}
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>
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>
src/views/exam/index.vue
对比新文件
@@ -0,0 +1,70 @@
<template>
    <div class="app-container">
        <el-alert
            :title="message"
            :type="flag?'success':'error'">
        </el-alert>
    </div>
</template>
<script>
    import {getExamAuth} from '@/api/exam'
    import {getToken} from "@/utils/auth"
    import Cookies from 'js-cookie'
    import request from '@/utils/request'
    export default {
        name: "current",
        created(){
            this.getExamAuth()
        },
        data(){
            return {
                pass:false,
                message: ''
            }
        },
        methods:{
            queryHandle(){
            },
            getExamAuth(){
                getExamAuth({token:getToken()})
                    .then(res=>{
                        if (res.data.code === 'failure') {
                            this.flag = false
                            this.message = res.data.message;
                        }
                        if (res.data.code === 'success') {
                            this.flag = true
                            this.message = res.data.message
                            Cookies.set('JSESSIONID',res.data.data.ssid)
                            window.open(process.env.NANO_API + "/foreground/system/noLogin/redirect?sessionId="+res.data.data.ssid )
                        }
                    })
                    .catch(err=>{
                        console.log(err)
                        this.flag = false
                        this.message = '请求出现问题,请联系管理员'
                    })
            }
        }
    }
</script>
<style scoped>
    .span-filter-label{
        font-size: 15px;
        color: #606266;
        margin-right: 4px;
        margin-left: 7px;
    }
    .basic_search{
        margin-bottom: 15px;
    }
</style>