案例修改

This commit is contained in:
NiSen
2023-06-23 11:39:24 +08:00
parent a8c1bb47be
commit 0d53f1ef5e
3 changed files with 33 additions and 33 deletions

2
.env
View File

@@ -3,7 +3,7 @@ VUE_APP_BASE=/manage
# api项目基础url
VUE_APP_BASE_API=/manageApi
# systemApi
VUE_APP_NEW_API=/systemapi
VUE_APP_SYS_API=/systemapi
#文件路径
VUE_APP_FILE_PATH=/upload/
# 代理url 本地调试,不可以用在其他地方

View File

@@ -12,7 +12,7 @@ import Cookies from 'vue-cookies'
// export const BATCH_IMPORT_SCORE = process.env.VUE_APP_BASE_API + '/admin/offcourse/batchImportScore'
axios.defaults.withCredentials = true;
const http = axios.create({
baseURL: process.env.VUE_APP_NEW_API,
baseURL: process.env.VUE_APP_SYS_API,
timeout: 1000 * 15,
headers: {"Content-Type": "application/json",},
});

View File

@@ -88,7 +88,7 @@
</a-drawer>
<!-- 导入的提示框 -->
<a-modal class="modal" v-model:visible="state.AMvisible" :closable="false" :maskClosable="false" ok-text="确定"
cancel-text="取消" @ok="hideModal" @cancel="closeModal">
cancel-text="取消" @ok="closeModal" @cancel="closeModal">
<div class="importInfo" style="padding: 24px;">
<div class="imptHeader">
<span>导入</span>
@@ -115,7 +115,13 @@
<div class="progress" v-if="state.status">
<div class="nameAndProgress" style="display: flex;justify-content: space-between;padding-right: 36px;">
<span>{{ state.fileName }}</span>
<span>{{ state.status }}</span>
<span> {{
{
done: "上传成功",
uploading: "正在上传",
error: "上传失败",
removed: "正在上传",
}[state.status] }}</span>
</div>
<a-progress :percent="state.uploadpercent" status="active" :strokeColor="state.progressColor" />
</div>
@@ -134,7 +140,7 @@
<script setup>
import { reactive, ref, computed, nextTick } from 'vue';
import { Form, message } from "ant-design-vue";
import { downloadErrorData,isTopList } from '@/api/case'
import { downloadErrorData, isTopList } from '@/api/case'
import useDownload from '@/hooks/useDownload'
import CommonRecommend from "@/components/CaseManage/CommonRecommend";
defineProps({
@@ -150,7 +156,7 @@ defineProps({
const emit = defineEmits(['update:visible'])
const loading = ref(false)
const state = reactive({
status:'',//上传的状态
status: '',//上传的状态
progressColor: '',//进度条颜色
type: 1,//添加学员
stage: '',//
@@ -161,7 +167,7 @@ const state = reactive({
AMvisible: false,//导入modal框显示隐藏
uploadpercent: -1,//导入进度
fileName: '',//下载的名字
uploadAction: process.env.VUE_APP_NEW_API + '/xboe/m/boe/cases/recommend/import',//下载地址
uploadAction: process.env.VUE_APP_SYS_API + '/xboe/m/boe/cases/recommend/import',//下载地址
fileList: [],//上传列表
member: false,//收起和展开
screenHeight: document.body.clientHeight,//高度
@@ -267,12 +273,16 @@ const downloadErrorInfo = () => {
message.warn('暂无失败数据')
return
}
downloadErrorData({ importId: state.importId }).then((res) => {
if (res.status != 200) return
useDownload(res, '失败数据.xsl')
}).catch((error) => {
console.log(error);
})
let url = `${process.env.VUE_APP_SYS_API}/xboe/m/boe/cases/recommend/download?importId=` + state.importId
console.log(url);
window.open(url, '_self');
// downloadErrorData({ importId: state.importId }).then((res) => {
// if (res.status != 200) return
// console.log(res);
// useDownload(res.request.response, '失败数据.xls')
// }).catch((error) => {
// console.log(error);
// })
}
@@ -285,8 +295,8 @@ const handleRest = () => {
// 取消抽屉
const closeDrawer = () => {
state.selectedRowKeys=[]
state.selectedRow=[]
state.selectedRowKeys = []
state.selectedRow = []
resetFields()
getTopList()
emit('update:visible', false)
@@ -296,34 +306,25 @@ const closeDrawer = () => {
const handleImportInfo = () => {
state.AMvisible = true
}
//model确定按钮
const hideModal = () => {
state.fileList = []
state.status='',
state.progressColor='',
state.importId='',
state.AMvisible = false
}
// modal取消按钮
const closeModal = () => {
console.log('取消');
state.fileList = []
state.status='',
state.progressColor='',
state.importId='',
state.AMvisible = false
state.status = '',
state.progressColor = '',
state.importId = '',
state.AMvisible = false
}
//上传文件
const handleChange = (info) => {
console.log("info", info);
console.log("info", info.file.percent);
state.status = '正在上传'
state.progressColor = ''
state.uploadpercent= -1
state.uploadpercent = -1
state.fileList = []
state.fileList = info.fileList
state.fileName = info.file.name;
state.status = info.file.status
if (info) {
var FileExt = info.file.name.replace(/.+\./, "");
@@ -344,7 +345,6 @@ const handleChange = (info) => {
state.importId = info.file.response.result
message.success(`${info.file.name}上传成功`);
state.progressColor = '#52c41a'
state.status = '上传成功'
// let i = 0;
// state.timers = setInterval(() => {
// let uid = info.file.response.data;
@@ -377,7 +377,7 @@ const handleChange = (info) => {
// }, 500);
} else if (status === "error") {
state.progressColor = 'red'
state.status = '上传失败'
state.status = 'error'
message.error(`${info.file.name}上传失败`);
}
};