体系调整

This commit is contained in:
wangxuemei
2024-09-26 16:40:00 +08:00
parent 17e75a106f
commit 8f15476af8
7 changed files with 194 additions and 23 deletions

View File

@@ -0,0 +1,125 @@
<template>
<div>
<input type="file" @change="handleFileUpload" />
<img :src="avatarUrl" alt="Avatar" v-if="avatarUrl" />
</div>
</template>
<script>
export default {
data() {
return {
avatarUrl: '' // 存储头像的 URLBase64 编码或服务器 URL
};
},
methods: {
handleFileUpload(event) {
const file = event.target.files[0]; // 获取用户选择的文件
if (!file) return;
// 创建一个 FileReader 实例
const reader = new FileReader();
// 读取文件内容,并在读取完成后设置 img 的 src
reader.onload = (e) => {
this.avatarUrl = e.target.result; // e.target.result 是 Base64 编码的字符串
};
// 读取文件内容(作为 DataURL
reader.readAsDataURL(file);
// 如果你需要上传文件到服务器,可以在这里添加代码
// 例如,使用 Axios 发送 POST 请求到服务器
}
}
};
</script>
<!-- <template>
<a-upload
:file-list="files"
:action="FILE_UPLOAD_URL"
:show-upload-list="showUploadList"
:multiple="multiple"
:before-upload="beforeUpload"
:headers="headers"
@change="handleChange"
ref="imageRef"
>
<template v-for="(_, key, index) in $slots" :key="index" v-slot:[key]>
<slot :name="key"></slot>
</template>
</a-upload>
</template>
<script setup>
import {defineProps, defineEmits, defineExpose, ref, watch} from "vue";
import {message} from "ant-design-vue";
import {FILE_UPLOAD_URL} from "@/api/config";
import {getCookieForName} from "@/api/method";
const props = defineProps({
value: {
type: Array,
default: () => []
},
multiple: {
type: Boolean,
default: fals
},
showUploadList: {
type: Boolean,
default: false
},
fileType: {
type: Array,
default: () => []
}
})
const emit = defineEmits({})
const files = ref([])
const imageRef = ref()
const headers = { token: getCookieForName("token") };
watch(props, () => {
props.value.length !== files.value.length && (files.value = props.value)
})
function handleChange({file, fileList}) {
file.response && file.response.code === 200 && (file.url = file.response.data)
files.value = fileList
emit('update:value', fileList)
}
function beforeUpload(file) {
if (!props.fileType.includes(file.name.split(".").slice(-1).join(''))) {
message.error(
"不支持该格式"
);
return false;
}
}
function remove(i) {
files.value.splice(i, 1)
emit('update:value', files.value)
}
function reUpload(i) {
if (files.value[i].status === 'ready' || files.value[i].status === 'uploading') {
imageRef.value.abort(files.value[i].raw)
files.value[i].status = 'abort';
} else if (files.value[i].status === 'fail' || files.value[i].status === 'abort') {
imageRef.value.handleStart(files.value[i].raw)
imageRef.value.submit()
}
}
function abort(i) {
imageRef.value.abort(files.value[i].raw)
}
defineExpose({reUpload, remove, abort})
</script> -->

View File

@@ -74,8 +74,20 @@ const props = defineProps({
type: String,
default: '',
},
newlable:{
type: String,
default: '',
},
system:{
type: String,
default: '',
},
level:{
type: String,
default: '',
},
})
const emit = defineEmits(['update:value','update:lable'])
const emit = defineEmits(['update:value','update:lable','update:system','update:level','update:newlable'])
const visible = ref(false);
watch(()=>props.value,(val)=>{
if(val){
@@ -93,12 +105,22 @@ function blur() {
isOpen.value = false
}
const orgName = ref('')
const systemName = ref('')
const levelName = ref('')
const neworgName = ref('')
const handleChange = (e,l) => {
console.log(e,l,'handlechange');
isOpen.value = false
// emit('update:value',e)
teacherName.value = e
orgName.value = l.orgName
systemName.value = l.systemName
levelName.value = l.levelName
if( l.orgName !==null ){
neworgName.value= orgName.value.split('/')
neworgName.value= neworgName.value[ neworgName.value.length-1]
}
console.log(neworgName,'handlechange');
};
function debounce(func, wait) {
let timeout;
@@ -129,8 +151,12 @@ const searchMember = (keyword) => {
return {
value: item.realName,
label: item.realName+'('+item.userNo+')'+item.orgName,
system: item.realName+'('+item.userNo+')'+item.systemName,
level: item.realName+'('+item.userNo+')'+item.levelName,
key: item.id,
orgName: item.orgName
orgName: item.orgName,
systemName:item.systemName,
levelName:item.levelName
}
})
}else{
@@ -188,9 +214,13 @@ function stuStuOrgSelect(e, {selected: bool, selectedNodes, node, event}) {
console.log(selectedNodes)
teacherName.value = ''
orgName.value = ''
systemName.value = ''
levelName.value = ''
if(selectedNodes[0].isLeaf){
teacherName.value = selectedNodes[0].name
orgName.value = selectedNodes[0].orgName
systemName.value = selectedNodes[0].systemName
levelName.value = selectedNodes[0].levelName
// emit('update:value',selectedNodes[0].realName)
}
}
@@ -200,22 +230,39 @@ watch(()=>visible.value,(val)=>{
stuTreeExpandedKeys.value = []
teacherName.value = ''
orgName.value = ''
systemName.value = ''
levelName.value = ''
neworgName.value=''
selectName.value = null
// changeneworg()
}
})
const notChange = () => {
visible.value = false
teacherName.value = ''
orgName.value = ''
systemName.value = ''
levelName.value = ''
neworgName.value=''
}
const changeOut = () => {
if(!teacherName.value){
message.error('请选择讲师')
return
}
const neworgName = ref('')
// const changeneworg= ()=>{
// if( orgName !==null ){
// neworgName=orgName.split('/')
// neworgName= neworgName[neworgName.length-1]
// }
selectData.value = teacherName.value
emit('update:value',teacherName.value)
emit('update:lable',orgName.value)
emit('update:system',systemName.value)
emit('update:level',levelName.value)
emit('update:newlable',neworgName.value)
notChange()
}
</script>

View File

@@ -103,7 +103,9 @@
<a-row :gutter="16">
<a-col :span="24">
<a-form-item label="讲师名称" name="userNo">
<SearchTeacher v-model:value="formParam.name"></SearchTeacher>
<a-input v-model:value="formParam.name" style="width: 276px; height: 40px; border-radius: 8px"
placeholder="请输入讲师姓名" allowClear showSearch>
</a-input>
</a-form-item>
</a-col>
<a-col :span="24">

View File

@@ -164,7 +164,7 @@
<a-col :span="24">
<a-form-item label="讲师体系" name="systemId">
<a-select class="draitem" v-model:value="formParam.systemId" placeholder="请选择讲师体系" allowClear
@change="changetlevel" :options="LecturerSystemList">
@change="changetlevel" .:options="LecturerSystemList">
</a-select>
</a-form-item>
</a-col>
@@ -183,6 +183,7 @@
<a-input v-model:value="formParam.defaultteachingTime" style="width:80%; height: 40px; border-radius: 8px; "
@blur="clearNonNumber" placeholder="0" allowClear showSearch suffix="分钟">
</a-input>
<span style="margin-left: 5px ;" v-if="formParam.defaultteachingTime == null">0.00小时</span>
<span style="margin-left: 5px ;" v-if="formParam.defaultteachingTime != null">{{
(formParam.defaultteachingTime / 60).toFixed(2) }}小时</span>
</a-form-item>
@@ -410,7 +411,7 @@ export default {
teachenType: '0',
name: null,
certStatus: 0,//认证状态
defaultteachingTime: '0',
defaultteachingTime: null,
photo: 'https://p0.itc.cn/q_70/images01/20211013/f45d91616a364d6ea9c42a8db69734aa.png'
},
searchParam: {
@@ -1007,7 +1008,7 @@ export default {
teacherNameOrUserNo: null,
newdepartId: null,
levelId: null,
defaultteachingTime: 0,
defaultteachingTime:null,
systemId: null,
certStatus: 0,
description: '',

View File

@@ -5,14 +5,9 @@
<div class="filter">
<a-form layout="inline" style="min-width: 1380px;">
<a-form-item class="select">
<a-input style="width: 276px; height: 40px; border-radius: 8px" placeholder="请输入工号/讲师姓名进行检索" showSearch
allowClear v-model:name="searchParam.teacherNameOrUserNo"></a-input>
<!-- <div style="width: 276px; height: 40px; border-radius: 8px" >
<ProjectManager v-model:value="searchParam.userNo"
v-model:name="searchParam.teacher"
placeholder="请输入工号/讲师姓名进行检索"
@onChange="managerChange" mode="multiple"></ProjectManager>
</div> -->
<a-input v-model:value="searchParam.teacherNameOrUserNo" style="width: 260px; height: 40px; border-radius: 8px"
placeholder="请输入工号/讲师姓名进行检索" allowClear showSearch>
</a-input>
</a-form-item>
<a-form-item class="select">
<a-input v-model:value="searchParam.name" style="width: 260px; height: 40px; border-radius: 8px"
@@ -226,7 +221,7 @@
<a-col :span="12">
<a-form-item label="授课时长" name="duration">
<a-input v-model:value="formParam.duration" style="width:80%; height: 40px; border-radius: 8px ; "
placeholder="0" allowClear showSearch suffix="分钟" @blur="clearscoreNumber">
placeholder="0" allowClear showSearch suffix="分钟" @blur="clearNonNumber">
</a-input>
<span style="margin-left: 5px ;" v-if="formParam.duration != null">{{ (formParam.duration / 60
).toFixed(2) }}小时</span>
@@ -940,9 +935,7 @@ export default {
// state.teacherdialog1 = 1
state.teachingdialog = true;
state.teacherdialogtitle = '查看详情'
// state.userNoid = record.userNo
state.lookTeacherId = record.teacherId
// // alert(record.grade)
TeacherSystem1(record)
gettableDatas(record)
// let id = record.userNo
@@ -1163,6 +1156,7 @@ export default {
};
const clearNonNumber = () => {
state.formParam.duration = state.formParam.duration.replace(/\D/g, '');
// state.formParam.duration
}
const clearscoreNumber = () => {
state.formParam.score = state.formParam.score.replace(/\D/g, '');

View File

@@ -5,8 +5,11 @@
<a-form layout="inline">
<a-form-item class="select">
<div style="width: 276px; height: 40px; border-radius: 8px">
<ProjectManager v-model:value="searchParam.userNo" v-model:name="searchParam.name" placeholder="请输入工号/讲师姓名进行检索"
@onChange="managerChange" mode="multiple"></ProjectManager>
<!-- <ProjectManager v-model:value="searchParam.userNo" v-model:name="searchParam.name" placeholder="请输入工号/讲师姓名进行检索"
@onChange="managerChange" mode="multiple"></ProjectManager> -->
<a-input v-model:value="searchParam.systemName" style="width: 260px; height: 40px; border-radius: 8px"
placeholder="请输入讲师体系/编号名进行检索" allowClear showSearch>
</a-input>
</div>
</a-form-item>
<div style="display: flex; margin-bottom: 20px">
@@ -237,8 +240,8 @@ export default {
const columns = ref([
{
title: '讲师体系编号 ',
dataIndex: 'kid',
key: 'kid',
dataIndex: 'id',
key: 'id',
elipsis: true,
align: "center",
width: 200,

View File

@@ -293,7 +293,6 @@ export default{
state.teacherrecordsLoading = true
state.teacherrecords.id = state.id
let obj = { ...state.teacherrecords }
// api接口
getTeacherCourseList(obj).then((res) => {
console.log(res);