mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-15 13:56:45 +08:00
体系调整
This commit is contained in:
125
src/components/project/ImageUpload.vue
Normal file
125
src/components/project/ImageUpload.vue
Normal 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: '' // 存储头像的 URL(Base64 编码或服务器 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> -->
|
||||||
|
|
||||||
@@ -74,8 +74,20 @@ const props = defineProps({
|
|||||||
type: String,
|
type: String,
|
||||||
default: '',
|
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);
|
const visible = ref(false);
|
||||||
watch(()=>props.value,(val)=>{
|
watch(()=>props.value,(val)=>{
|
||||||
if(val){
|
if(val){
|
||||||
@@ -93,12 +105,22 @@ function blur() {
|
|||||||
isOpen.value = false
|
isOpen.value = false
|
||||||
}
|
}
|
||||||
const orgName = ref('')
|
const orgName = ref('')
|
||||||
|
const systemName = ref('')
|
||||||
|
const levelName = ref('')
|
||||||
|
const neworgName = ref('')
|
||||||
const handleChange = (e,l) => {
|
const handleChange = (e,l) => {
|
||||||
console.log(e,l,'handlechange');
|
console.log(e,l,'handlechange');
|
||||||
isOpen.value = false
|
isOpen.value = false
|
||||||
// emit('update:value',e)
|
// emit('update:value',e)
|
||||||
teacherName.value = e
|
teacherName.value = e
|
||||||
orgName.value = l.orgName
|
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) {
|
function debounce(func, wait) {
|
||||||
let timeout;
|
let timeout;
|
||||||
@@ -129,8 +151,12 @@ const searchMember = (keyword) => {
|
|||||||
return {
|
return {
|
||||||
value: item.realName,
|
value: item.realName,
|
||||||
label: item.realName+'('+item.userNo+')'+item.orgName,
|
label: item.realName+'('+item.userNo+')'+item.orgName,
|
||||||
|
system: item.realName+'('+item.userNo+')'+item.systemName,
|
||||||
|
level: item.realName+'('+item.userNo+')'+item.levelName,
|
||||||
key: item.id,
|
key: item.id,
|
||||||
orgName: item.orgName
|
orgName: item.orgName,
|
||||||
|
systemName:item.systemName,
|
||||||
|
levelName:item.levelName
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
@@ -188,9 +214,13 @@ function stuStuOrgSelect(e, {selected: bool, selectedNodes, node, event}) {
|
|||||||
console.log(selectedNodes)
|
console.log(selectedNodes)
|
||||||
teacherName.value = ''
|
teacherName.value = ''
|
||||||
orgName.value = ''
|
orgName.value = ''
|
||||||
|
systemName.value = ''
|
||||||
|
levelName.value = ''
|
||||||
if(selectedNodes[0].isLeaf){
|
if(selectedNodes[0].isLeaf){
|
||||||
teacherName.value = selectedNodes[0].name
|
teacherName.value = selectedNodes[0].name
|
||||||
orgName.value = selectedNodes[0].orgName
|
orgName.value = selectedNodes[0].orgName
|
||||||
|
systemName.value = selectedNodes[0].systemName
|
||||||
|
levelName.value = selectedNodes[0].levelName
|
||||||
// emit('update:value',selectedNodes[0].realName)
|
// emit('update:value',selectedNodes[0].realName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -200,22 +230,39 @@ watch(()=>visible.value,(val)=>{
|
|||||||
stuTreeExpandedKeys.value = []
|
stuTreeExpandedKeys.value = []
|
||||||
teacherName.value = ''
|
teacherName.value = ''
|
||||||
orgName.value = ''
|
orgName.value = ''
|
||||||
|
systemName.value = ''
|
||||||
|
levelName.value = ''
|
||||||
|
neworgName.value=''
|
||||||
selectName.value = null
|
selectName.value = null
|
||||||
|
// changeneworg()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const notChange = () => {
|
const notChange = () => {
|
||||||
visible.value = false
|
visible.value = false
|
||||||
teacherName.value = ''
|
teacherName.value = ''
|
||||||
orgName.value = ''
|
orgName.value = ''
|
||||||
|
systemName.value = ''
|
||||||
|
levelName.value = ''
|
||||||
|
neworgName.value=''
|
||||||
}
|
}
|
||||||
const changeOut = () => {
|
const changeOut = () => {
|
||||||
if(!teacherName.value){
|
if(!teacherName.value){
|
||||||
message.error('请选择讲师')
|
message.error('请选择讲师')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
const neworgName = ref('')
|
||||||
|
// const changeneworg= ()=>{
|
||||||
|
// if( orgName !==null ){
|
||||||
|
// neworgName=orgName.split('/')
|
||||||
|
|
||||||
|
// neworgName= neworgName[neworgName.length-1]
|
||||||
|
// }
|
||||||
selectData.value = teacherName.value
|
selectData.value = teacherName.value
|
||||||
emit('update:value',teacherName.value)
|
emit('update:value',teacherName.value)
|
||||||
emit('update:lable',orgName.value)
|
emit('update:lable',orgName.value)
|
||||||
|
emit('update:system',systemName.value)
|
||||||
|
emit('update:level',levelName.value)
|
||||||
|
emit('update:newlable',neworgName.value)
|
||||||
notChange()
|
notChange()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -103,7 +103,9 @@
|
|||||||
<a-row :gutter="16">
|
<a-row :gutter="16">
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item label="讲师名称" name="userNo">
|
<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-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
|
|||||||
@@ -164,7 +164,7 @@
|
|||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item label="讲师体系" name="systemId">
|
<a-form-item label="讲师体系" name="systemId">
|
||||||
<a-select class="draitem" v-model:value="formParam.systemId" placeholder="请选择讲师体系" allowClear
|
<a-select class="draitem" v-model:value="formParam.systemId" placeholder="请选择讲师体系" allowClear
|
||||||
@change="changetlevel" :options="LecturerSystemList">
|
@change="changetlevel" .:options="LecturerSystemList">
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
@@ -183,6 +183,7 @@
|
|||||||
<a-input v-model:value="formParam.defaultteachingTime" style="width:80%; height: 40px; border-radius: 8px; "
|
<a-input v-model:value="formParam.defaultteachingTime" style="width:80%; height: 40px; border-radius: 8px; "
|
||||||
@blur="clearNonNumber" placeholder="0" allowClear showSearch suffix="分钟">
|
@blur="clearNonNumber" placeholder="0" allowClear showSearch suffix="分钟">
|
||||||
</a-input>
|
</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">{{
|
<span style="margin-left: 5px ;" v-if="formParam.defaultteachingTime != null">{{
|
||||||
(formParam.defaultteachingTime / 60).toFixed(2) }}小时</span>
|
(formParam.defaultteachingTime / 60).toFixed(2) }}小时</span>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -410,7 +411,7 @@ export default {
|
|||||||
teachenType: '0',
|
teachenType: '0',
|
||||||
name: null,
|
name: null,
|
||||||
certStatus: 0,//认证状态
|
certStatus: 0,//认证状态
|
||||||
defaultteachingTime: '0',
|
defaultteachingTime: null,
|
||||||
photo: 'https://p0.itc.cn/q_70/images01/20211013/f45d91616a364d6ea9c42a8db69734aa.png'
|
photo: 'https://p0.itc.cn/q_70/images01/20211013/f45d91616a364d6ea9c42a8db69734aa.png'
|
||||||
},
|
},
|
||||||
searchParam: {
|
searchParam: {
|
||||||
@@ -1007,7 +1008,7 @@ export default {
|
|||||||
teacherNameOrUserNo: null,
|
teacherNameOrUserNo: null,
|
||||||
newdepartId: null,
|
newdepartId: null,
|
||||||
levelId: null,
|
levelId: null,
|
||||||
defaultteachingTime: 0,
|
defaultteachingTime:null,
|
||||||
systemId: null,
|
systemId: null,
|
||||||
certStatus: 0,
|
certStatus: 0,
|
||||||
description: '',
|
description: '',
|
||||||
|
|||||||
@@ -5,14 +5,9 @@
|
|||||||
<div class="filter">
|
<div class="filter">
|
||||||
<a-form layout="inline" style="min-width: 1380px;">
|
<a-form layout="inline" style="min-width: 1380px;">
|
||||||
<a-form-item class="select">
|
<a-form-item class="select">
|
||||||
<a-input style="width: 276px; height: 40px; border-radius: 8px" placeholder="请输入工号/讲师姓名进行检索" showSearch
|
<a-input v-model:value="searchParam.teacherNameOrUserNo" style="width: 260px; height: 40px; border-radius: 8px"
|
||||||
allowClear v-model:name="searchParam.teacherNameOrUserNo"></a-input>
|
placeholder="请输入工号/讲师姓名进行检索" allowClear showSearch>
|
||||||
<!-- <div style="width: 276px; height: 40px; border-radius: 8px" >
|
</a-input>
|
||||||
<ProjectManager v-model:value="searchParam.userNo"
|
|
||||||
v-model:name="searchParam.teacher"
|
|
||||||
placeholder="请输入工号/讲师姓名进行检索"
|
|
||||||
@onChange="managerChange" mode="multiple"></ProjectManager>
|
|
||||||
</div> -->
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item class="select">
|
<a-form-item class="select">
|
||||||
<a-input v-model:value="searchParam.name" style="width: 260px; height: 40px; border-radius: 8px"
|
<a-input v-model:value="searchParam.name" style="width: 260px; height: 40px; border-radius: 8px"
|
||||||
@@ -226,7 +221,7 @@
|
|||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="授课时长" name="duration">
|
<a-form-item label="授课时长" name="duration">
|
||||||
<a-input v-model:value="formParam.duration" style="width:80%; height: 40px; border-radius: 8px ; "
|
<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>
|
</a-input>
|
||||||
<span style="margin-left: 5px ;" v-if="formParam.duration != null">{{ (formParam.duration / 60
|
<span style="margin-left: 5px ;" v-if="formParam.duration != null">{{ (formParam.duration / 60
|
||||||
).toFixed(2) }}小时</span>
|
).toFixed(2) }}小时</span>
|
||||||
@@ -940,9 +935,7 @@ export default {
|
|||||||
// state.teacherdialog1 = 1
|
// state.teacherdialog1 = 1
|
||||||
state.teachingdialog = true;
|
state.teachingdialog = true;
|
||||||
state.teacherdialogtitle = '查看详情'
|
state.teacherdialogtitle = '查看详情'
|
||||||
// state.userNoid = record.userNo
|
|
||||||
state.lookTeacherId = record.teacherId
|
state.lookTeacherId = record.teacherId
|
||||||
// // alert(record.grade)
|
|
||||||
TeacherSystem1(record)
|
TeacherSystem1(record)
|
||||||
gettableDatas(record)
|
gettableDatas(record)
|
||||||
// let id = record.userNo
|
// let id = record.userNo
|
||||||
@@ -1163,6 +1156,7 @@ export default {
|
|||||||
};
|
};
|
||||||
const clearNonNumber = () => {
|
const clearNonNumber = () => {
|
||||||
state.formParam.duration = state.formParam.duration.replace(/\D/g, '');
|
state.formParam.duration = state.formParam.duration.replace(/\D/g, '');
|
||||||
|
// state.formParam.duration
|
||||||
}
|
}
|
||||||
const clearscoreNumber = () => {
|
const clearscoreNumber = () => {
|
||||||
state.formParam.score = state.formParam.score.replace(/\D/g, '');
|
state.formParam.score = state.formParam.score.replace(/\D/g, '');
|
||||||
|
|||||||
@@ -5,8 +5,11 @@
|
|||||||
<a-form layout="inline">
|
<a-form layout="inline">
|
||||||
<a-form-item class="select">
|
<a-form-item class="select">
|
||||||
<div style="width: 276px; height: 40px; border-radius: 8px">
|
<div style="width: 276px; height: 40px; border-radius: 8px">
|
||||||
<ProjectManager v-model:value="searchParam.userNo" v-model:name="searchParam.name" placeholder="请输入工号/讲师姓名进行检索"
|
<!-- <ProjectManager v-model:value="searchParam.userNo" v-model:name="searchParam.name" placeholder="请输入工号/讲师姓名进行检索"
|
||||||
@onChange="managerChange" mode="multiple"></ProjectManager>
|
@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>
|
</div>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<div style="display: flex; margin-bottom: 20px">
|
<div style="display: flex; margin-bottom: 20px">
|
||||||
@@ -237,8 +240,8 @@ export default {
|
|||||||
const columns = ref([
|
const columns = ref([
|
||||||
{
|
{
|
||||||
title: '讲师体系编号 ',
|
title: '讲师体系编号 ',
|
||||||
dataIndex: 'kid',
|
dataIndex: 'id',
|
||||||
key: 'kid',
|
key: 'id',
|
||||||
elipsis: true,
|
elipsis: true,
|
||||||
align: "center",
|
align: "center",
|
||||||
width: 200,
|
width: 200,
|
||||||
|
|||||||
@@ -293,7 +293,6 @@ export default{
|
|||||||
state.teacherrecordsLoading = true
|
state.teacherrecordsLoading = true
|
||||||
state.teacherrecords.id = state.id
|
state.teacherrecords.id = state.id
|
||||||
let obj = { ...state.teacherrecords }
|
let obj = { ...state.teacherrecords }
|
||||||
|
|
||||||
// api接口
|
// api接口
|
||||||
getTeacherCourseList(obj).then((res) => {
|
getTeacherCourseList(obj).then((res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
|
|||||||
Reference in New Issue
Block a user