This commit is contained in:
nisen
2024-09-05 15:31:50 +08:00
parent 1200a1ab27
commit fac0a060e4
11 changed files with 33 additions and 148 deletions

View File

@@ -374,9 +374,7 @@ export function usePage(_url, params, init = true,listing = false) {
state.totalPage = r.data.total/10 || 1;
state.total = r.data.total;
state.loading = false;
}).catch(err => {
state.loading = false;
})
});
}
init && fetch();
@@ -500,9 +498,6 @@ export async function request(_url, params) {
if (res.code === 0 || res.code === 200) {
return res;
}
if (res.code === 4 ){
return Promise.reject(res);
}
if (res.code === 1000 || res.code === 1002) {
window.location.href = process.env.VUE_APP_LOGIN_URL + encodeURIComponent(window.location.protocol + process.env.VUE_APP_BOE_API_URL + process.env.VUE_APP_BASE + router.currentRoute.value.fullPath)
localStorage.removeItem('refreshPage')

View File

@@ -487,20 +487,18 @@ const columns = ref([
key: "teacher",
width: "20%",
align: "center",
ellipsis: true,
customRender: ({ record }) => {
// const teachers = record.offteachers;
// return teachers.map((teacher, index) => {
// // 如果需要显示为列表形式
// return (
// <div key={index}>
// {teacher.teacherName}
// {index !== teachers.length - 1 && ', '}
// </div>
// );
// });
return record.offteachers.map(item=>item.teacherName).join(',')
},
const teachers = record.offteachers;
return teachers.map((teacher, index) => {
// 如果需要显示为列表形式
return (
<div key={index}>
{teacher.teacherName}
{index !== teachers.length - 1 && ', '}
</div>
);
});
},
},
{

View File

@@ -189,7 +189,7 @@ export default {
pageSize: 10,
currentPage: 1,
tableDataTotal: 0,
projectName: null,
projectName: undefined,
projectNameListNot: [
{
id: 1,
@@ -377,7 +377,7 @@ export default {
ctx.emit("update:Tvisible", false);
state.currentPage = 1;
state.name = "";
state.projectName = null;
state.projectName = undefined;
state.tabledata = [];
};
const afterVisibleChange = (bol) => {
@@ -389,9 +389,6 @@ export default {
};
const selectProjectName = (value) => {
state.projectName = value;
if(value === undefined){
state.projectName = null;
}
};
//催促
const godie = () => {
@@ -518,7 +515,7 @@ export default {
state.tableDataTotalLoading = true;
state.currentPage = 1;
state.name = "";
state.projectName = null;
state.projectName = "";
getData();
}

View File

@@ -192,7 +192,7 @@ export default {
pageSize: 10,
currentPage: 1,
tableDataTotal: 0,
projectName: null,
projectName: undefined,
projectNameListNot: [
{
id: 1,
@@ -384,7 +384,7 @@ export default {
ctx.emit("update:CommonModelVisible", false);
state.currentPage = 1;
state.name = "";
state.projectName = null;
state.projectName = undefined;
state.tabledata = [];
};
const afterVisibleChange = (bol) => {
@@ -396,9 +396,6 @@ export default {
};
const selectProjectName = (value) => {
state.projectName = value;
if(value === undefined){
state.projectName = null;
}
};
//催促
const godie = () => {
@@ -526,7 +523,7 @@ export default {
state.tableDataTotalLoading = true;
state.currentPage = 1;
state.name = "";
state.projectName = null;
state.projectName = undefined;
getData();
}

View File

@@ -442,10 +442,6 @@ export default {
{/* 导出数据 */ }
function exportData() {
if(state.tabledata.length==0){
message.error("没有数据可以导出");
return
}
// window.open(`${process.env.VUE_APP_BASE_API}/admin/exam/manage/exportExam?chapterId=${props.datasource.chapterId}&targetId=${props.datasource.routerId}&taskId=${props.datasource.courseId}&type=${1}`)
window.open(`${process.env.VUE_APP_BASE_API}/admin/exam/manage/exportExam?currentStageId=${props.datasource.chapterId}&type=${1}&pid=${props.datasource.routerId}&targetId=${props.datasource.routerId}&taskId=${props.datasource.courseId}&taskType=${props.datasource.type}`)

View File

@@ -1,48 +0,0 @@
<template>
<a-select
:getPopupContainer="
(triggerNode) => {
return triggerNode.parentNode || document.body;
}
"
v-model:value="numValue"
style="width: 100%;"
placeholder="请选择项目编号"
:options="options"
showSearch
allowClear
@change="handleChange"
>
</a-select>
</template>
<script setup>
import {computed, defineEmits, defineProps, onMounted, ref, watch} from 'vue';
import { useStore } from "vuex";
const props = defineProps({
value: String,
label: String,
})
const emit = defineEmits(['update:value','update:label'])
const store = useStore();
const numValue = ref(props.value||null)
const handleChange = (value,option)=>{
emit('update:value',value || '')
emit('update:label',option?.label || '')
}
onMounted(() => {
// console.log(store.state.project_number,'store.state.project_number')
});
const options = computed(()=>store.state.project_number.map(e => {
return{
value: e.value,
label: e.name
}
}))
</script>
<style lang="scss" scoped>
::v-deep .ant-select-selector{
border-radius: 8px !important;
}
</style>

View File

@@ -91,11 +91,6 @@
导出
</a-button>
</a-col>
<a-col>
<a-button class="cus-btn" style="background: #4ea6ff; color: #fff; width: 150px" @click="exportStudy">
导出详细学习记录
</a-button>
</a-col>
</a-row>
<div style="margin-top: 20px">
<a-table
@@ -126,8 +121,7 @@ import dialog from "@/utils/dialog";
import {ONLINE_COURSE_DEL} from "@/api/ThirdApi";
import {useStore} from "vuex";
import {useAsyncStu, useResetRef} from "@/utils/useCommon";
import {downLoadXlsx} from "@/utils/zipdownload";
import {message} from "ant-design-vue";
const props = defineProps({
permissions: {
type: String,
@@ -329,12 +323,7 @@ function reset() {
function exportStu() {
window.open(`${process.env.VUE_APP_BASE_API}/admin/student/exportOnlineStudent?type=3&&thirdType=8&pid=${searchParams.value.pid}`);
}
function exportStudy() {
if(studentList.value.length == 0){
return message.warning('暂无可导出的学习记录')
}
downLoadXlsx(`${process.env.VUE_APP_BASE_API}/admin/student/exportOnlineStudentDetail?type=4&&thirdType=8&pid=${searchParams.value.pid}`,'在线课学员学习记录')
}
defineExpose({
searchStu,
loading,

View File

@@ -131,6 +131,5 @@ async function init() {
initDict("course_pic"); //课程封面
initDict("job_type"); //岗位
initDict("band"); //band
initDict("examine_cover") //讲师认证封面图
initDict("project_number") //项目编号
initDict("examine_cover")
}

View File

@@ -5,16 +5,7 @@ const mimeMap = {
xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
zip: 'application/zip'
}
export function downLoadXlsx(str, filename) {
axios({
method: 'get',
url: str,
responseType: 'blob',
headers: { 'Authorization': 'Bearer ' + getCookieForName("token") }
}).then(res => {
resolveBlob(res, mimeMap.xlsx,filename)
})
}
const baseUrl = process.env.VUE_APP_ACT_API
export function downLoadZip(str, filename) {
var url = baseUrl + str

View File

@@ -1993,17 +1993,16 @@ const columns6 = [
align: "center",
ellipsis: true,
customRender: ({ record }) => {
// const teachers = record.offteachers;
// return teachers.map((teacher, index) => {
// // 如果需要显示为列表形式
// return (
// <div key={index}>
// {teacher.teacherName}
// {index !== teachers.length - 1 && ', '}
// </div>
// );
// });
return record.offteachers.map(item=>item.teacherName).join(',')
const teachers = record.offteachers;
return teachers.map((teacher, index) => {
// 如果需要显示为列表形式
return (
<div key={index}>
{teacher.teacherName}
{index !== teachers.length - 1 && ', '}
</div>
);
});
}
},

View File

@@ -147,13 +147,6 @@
<a-radio :style="radioStyle" :value="0"></a-radio>
</a-radio-group>
</div>
<div class="num" v-if="projectInfo.boeFlag === 1">
<div class="num_text">项目编号</div>
<div class="num_input">
<!-- <a-input style="border-radius: 8px;" show-count allowClear maxlength="30" v-model:value="projectInfo.numValue" placeholder="请输入项目编号" /> -->
<ProjectNumber v-model:value="projectInfo.numValue" v-model:label="projectInfo.numLabel"></ProjectNumber>
</div>
</div>
</div>
<div class="name name2">
<div class="namebox">
@@ -276,7 +269,7 @@ import * as api2 from "../../api/indexAudit";
import {validateName} from "@/api/index1";
import dayjs from "dayjs";
import {scrollLoad} from "@/api/method";
import ProjectNumber from "@/components/project/ProjectNumber";
export default {
name: "projectAdd",
components: {
@@ -286,7 +279,6 @@ export default {
TrainClass,
NameInput,
OrgClass,
ProjectNumber
},
setup() {
const store = useStore();
@@ -342,12 +334,6 @@ export default {
state.projectInfo.parentName = routers.query.parentName;
state.projectInfo.parentId = routers.query.parentId;
});
watch(()=>state.projectInfo.boeFlag,(val)=>{
if(!val){
state.projectInfo.numValue = ''
state.projectInfo.numLabel = ''
}
})
function getProjectInfo() {
state.projectInfo.parentName = routers.query.parentName;
@@ -786,20 +772,6 @@ export default {
}
}
.num{
display: flex;
justify-content: center;
align-items: center;
.num_text{
color: #6f6f6f;
font-size: 14px;
// margin-right: 7px;
}
.num_input{
width: 184px;
}
}
.filebox {
margin-left: 14px;
flex: 1;