讲师管理bug

This commit is contained in:
zhangsir
2024-12-26 17:13:55 +08:00
parent 51022077b2
commit 9140481715
10 changed files with 143 additions and 70 deletions

View File

@@ -4,9 +4,9 @@
:closable="false"
class="largeDrawerInside"
placement="right"
width="70%"
width="80%"
>
<div class="drawerMains" ref="drawerContent">
<div class="drawerMains">
<div class="headers" style="margin-top:-24px;">
<div class="headerTitle">{{ name }}</div>
<img
@@ -22,9 +22,9 @@
<div class="item">
<a-input @pressEnter="searchData(true)" style="border-radius: 8px;width:240px;height: 40px;" v-model:value="nameUserNo" placeholder="请输入工号/讲师名称进行搜索" allowClear />
</div>
<div class="item">
<!-- <div class="item">
<a-range-picker format="YYYY-MM-DD" valueFormat="YYYY-MM-DD" style="border-radius: 8px;width:360px;height: 40px;" v-model:value="dateValue" />
</div>
</div> -->
<div class="item">
<a-button type="primary" @click="searchData(true)" style="margin-right:20px;border-radius:8px;width: 100px;height: 40px;">搜索</a-button>
<a-button type="primary" @click="resetData()" style="border-radius:8px;width: 100px;height: 40px;">重置</a-button>
@@ -32,10 +32,11 @@
</div>
<div class="table" style="padding-bottom:72px;">
<a-table
ref="drawerContent"
:columns="columns"
:data-source="tableData"
:pagination="false"
:scroll="{ x: 'max-content' }"
:scroll="{ x: 'max-content',y:tableData.length? pageHeight : null }"
row-key="id"
:loading="loading"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
@@ -80,6 +81,9 @@ const customRow = (record) => {
},
};
};
const pageHeight = computed(() => {
return window.innerHeight - 360
});
watch(()=>props.visible,(val)=>{
if(val){
loading.value = true
@@ -98,7 +102,7 @@ watch(()=>props.visible,(val)=>{
}else{
selectedRowKeys.value = []
selectsData.value = []
drawerContent.value.scrollTo({top:0,behavior: 'smooth'})
drawerContent.value?.$el.querySelector('.ant-table-body')?.scrollTo({top:0,behavior: 'smooth'})
resetData()
}
})
@@ -115,7 +119,7 @@ const searchData = (val) => {
// drawerContent.value.scrollTo({top:200,behavior: 'smooth'})
searchTrue.value = val
if(!nameUserNo.value&&!dateValue.value){
// searchList.value = tableData.value;
searchList.value = [];
return
}
//搜索 数组expenseList.value 参数名字或者工号nameUserNo.value 日期dateValue.value
@@ -137,7 +141,7 @@ const searchData = (val) => {
let scrollHeight = null
filteredList.length && (scrollHeight = tableData.value.findIndex(item => item.id === filteredList[0].id))
if(scrollHeight||scrollHeight==0){
drawerContent.value.scrollTo({top:(scrollHeight+1)*50+200,behavior: 'smooth'})
drawerContent.value?.$el.querySelector('.ant-table-body')?.scrollTo({top:scrollHeight*55,behavior: 'smooth'})
}
}
const loading = ref(false)
@@ -172,12 +176,14 @@ const columns = [
dataIndex: 'name',
key: 'name',
align: 'center',
width:120,
},
{
title: '讲师工号',
dataIndex: 'userNo',
key: 'userNo',
align: 'center',
width:120
},
{
title: '所属组织',
@@ -185,6 +191,7 @@ const columns = [
key: 'orgName',
align: 'center',
ellipsis: true,
width:100,
customCell :() => {return {style: {maxWidth: '200px',overflow: 'hidden',whiteSpace: 'nowrap',textOverflow:'ellipsis',cursor:'pointer'}}},
},
@@ -193,12 +200,15 @@ const columns = [
dataIndex: 'tsystemName',
key: 'tsystemName',
align: 'center',
width:100,
customCell :() => {return {style: {maxWidth: '200px',overflow: 'hidden',whiteSpace: 'nowrap',textOverflow:'ellipsis',cursor:'pointer'}}},
},
{
title: '讲师等级',
dataIndex: 'tlevelName',
key: 'tlevelName',
align: 'center',
width:100,
customRender: ({ text })=>{
return text||'-'
}
@@ -208,6 +218,7 @@ const columns = [
dataIndex: 'payrollPlace',
key: 'payrollPlace',
align: 'center',
width:120,
customRender: ({ text })=>{
return text||'-'
}
@@ -218,6 +229,7 @@ const columns = [
dataIndex: 'courseType',
key: 'courseType',
align: 'center',
width:120,
customRender: ({ text,record })=>{
switch (text) {
case 0:
@@ -240,18 +252,22 @@ const columns = [
dataIndex: 'courseName',
key: 'courseName',
align: 'center',
width:100,
customCell :() => {return {style: {maxWidth: '200px',overflow: 'hidden',whiteSpace: 'nowrap',textOverflow:'ellipsis',cursor:'pointer'}}},
},
{
title: '授课/开发课程日期',
dataIndex: 'teachingDate',
key: 'teachingDate',
align: 'center',
width:150
},
{
title: '授课/开发课程时长',
dataIndex: 'teachingTime',
key: 'teachingTime',
align: 'center',
width:150,
customRender: ({ text,record })=>{
return (text/60).toFixed(2)+'小时'
}
@@ -261,6 +277,7 @@ const columns = [
dataIndex: 'studys',
key: 'studys',
align: 'center',
width:100,
customRender: ({ text })=>{
return text||'0'
}
@@ -270,6 +287,7 @@ const columns = [
dataIndex: 'score',
key: 'score',
align: 'center',
width:100,
customRender: (value) => {
return (
<div>
@@ -283,12 +301,14 @@ const columns = [
dataIndex: 'levelPay',
key: 'levelPay',
align: 'center',
width:100
},
{
title: '计划费用',
dataIndex: 'expense',
key: 'expense',
align: 'center',
width:100
},
// {
// title: '应发费用',
@@ -349,7 +369,10 @@ const queryDrawer = () => {
::v-deep .ant-table-row-selected td {
// background: none !important;
}
::v-deep .ant-table-thead > tr > th {
background-color: #eff4fc !important;
text-align: center !important;
}
.largeDrawerInside {
.drawerMains {
@@ -425,7 +448,7 @@ const queryDrawer = () => {
}
.table{
::v-deep .ant-table-cell-fix-right {
width: 160px !important;
width: 120px !important;
}
}
}

View File

@@ -4,10 +4,10 @@
:closable="false"
class="largeDrawerInside"
placement="right"
width="64%"
width="76%"
:zIndex="1001"
>
<div class="drawerMains" ref="drawerContent">
<div class="drawerMains">
<div class="headers" style="margin-top:-24px;">
<div class="headerTitle">{{ name }}</div>
<img
@@ -34,9 +34,9 @@
<div class="item">
<a-input @pressEnter="searchData(true)" style="border-radius: 8px;width:240px;height: 40px;" v-model:value="nameUserNo" placeholder="请输入工号/讲师名称进行搜索" allowClear />
</div>
<div class="item">
<!-- <div class="item">
<a-range-picker format="YYYY-MM-DD" valueFormat="YYYY-MM-DD" style="border-radius: 8px;width:360px;height: 40px;" v-model:value="dateValue" />
</div>
</div> -->
<div class="item">
<a-button type="primary" @click="searchData(true)" style="margin-right:20px;border-radius:8px;width: 100px;height: 40px;">搜索</a-button>
<a-button type="primary" @click="resetData()" style="border-radius:8px;width: 100px;height: 40px;">重置</a-button>
@@ -44,10 +44,11 @@
</div>
<div class="table">
<a-table
ref="drawerContent"
:columns="columns"
:data-source="expenseList"
:pagination="false"
:scroll="{ x: 'max-content' }"
:scroll="{ x: 'max-content',y:expenseList.length? pageHeight : null }"
:loading="loadingData"
:custom-row="customRow"
>
@@ -175,6 +176,9 @@ const clickItem = (item,i) => {
indexList.value = i
resetData()
}
const pageHeight = computed(() => {
return window.innerHeight - 450
});
watch(()=>props.visible,(val)=>{
if(val){
loadingData.value = true
@@ -202,7 +206,7 @@ watch(()=>props.visible,(val)=>{
}else{
nameUserNo.value = null
dateValue.value = null
drawerContent.value.scrollTo({top:0,behavior: 'smooth'})
drawerContent.value?.$el.querySelector('.ant-table-body')?.scrollTo({top:0,behavior: 'smooth'})
}
})
const removeId = (e,i) =>{
@@ -244,7 +248,7 @@ const customRow = (record) => {
const searchData = (val) => {
searchTrue.value = val
if(!nameUserNo.value&&!dateValue.value){
// searchList.value = expenseList.value;
searchList.value = [];
return
}
//搜索 数组expenseList.value 参数名字或者工号nameUserNo.value 日期dateValue.value
@@ -266,7 +270,7 @@ const searchData = (val) => {
let scrollHeight = null
filteredList.length && (scrollHeight = expenseList.value.findIndex(item => item.id === filteredList[0].id))
if(scrollHeight||scrollHeight==0){
drawerContent.value.scrollTo({top:(scrollHeight+1)*50+300,behavior: 'smooth'})
drawerContent.value?.$el.querySelector('.ant-table-body')?.scrollTo({top:scrollHeight*55,behavior: 'smooth'})
}
}
const resetData = () => {
@@ -281,12 +285,14 @@ const columns = [
dataIndex: 'name',
key: 'name',
align: 'center',
width:120,
},
{
title: '讲师工号',
dataIndex: 'userNo',
key: 'userNo',
align: 'center',
width:120,
},
{
title: '所属组织',
@@ -294,6 +300,7 @@ const columns = [
key: 'orgName',
align: 'center',
ellipsis: true,
width:100,
customCell :() => {return {style: {maxWidth: '200px',overflow: 'hidden',whiteSpace: 'nowrap',textOverflow:'ellipsis',cursor:'pointer'}}},
},
@@ -302,12 +309,15 @@ const columns = [
dataIndex: 'tsystemName',
key: 'tsystemName',
align: 'center',
width:100,
customCell :() => {return {style: {maxWidth: '200px',overflow: 'hidden',whiteSpace: 'nowrap',textOverflow:'ellipsis',cursor:'pointer'}}},
},
{
title: '讲师等级',
dataIndex: 'tlevelName',
key: 'tlevelName',
align: 'center',
width:100,
customRender: ({ text })=>{
return text||'-'
}
@@ -317,6 +327,7 @@ const columns = [
dataIndex: 'payrollPlace',
key: 'payrollPlace',
align: 'center',
width:120,
customRender: ({ text })=>{
return text||'-'
}
@@ -327,6 +338,7 @@ const columns = [
dataIndex: 'courseType',
key: 'courseType',
align: 'center',
width:120,
customRender: ({ text,record })=>{
switch (text) {
case 0:
@@ -349,18 +361,22 @@ const columns = [
dataIndex: 'courseName',
key: 'courseName',
align: 'center',
width:100,
customCell :() => {return {style: {maxWidth: '200px',overflow: 'hidden',whiteSpace: 'nowrap',textOverflow:'ellipsis',cursor:'pointer'}}},
},
{
title: '授课/开发课程日期',
dataIndex: 'teachingDate',
key: 'teachingDate',
align: 'center',
width:150,
},
{
title: '授课/开发课程时长',
dataIndex: 'teachingTime',
key: 'teachingTime',
align: 'center',
width:150,
customRender: ({ text,record })=>{
return (text/60).toFixed(2)+'小时'
}
@@ -370,6 +386,7 @@ const columns = [
dataIndex: 'studys',
key: 'studys',
align: 'center',
width:100,
customRender: ({ text })=>{
return text||'0'
}
@@ -379,6 +396,7 @@ const columns = [
dataIndex: 'score',
key: 'score',
align: 'center',
width:100,
customRender: (value) => {
return (
<div>
@@ -392,12 +410,14 @@ const columns = [
dataIndex: 'levelPay',
key: 'levelPay',
align: 'center',
width:100,
},
{
title: '计划费用',
dataIndex: 'expense',
key: 'expense',
align: 'center',
width:100,
},
// {
// title: '应发费用',
@@ -409,6 +429,7 @@ const columns = [
title: '操作',
align: 'center',
fixed: 'right',
width:100,
customCell:()=>{return {style:{background:'#fff'}}},
slots: { customRender: "action" },
},
@@ -459,6 +480,10 @@ const config = () => {
::v-deep .ant-table-tbody > tr:not(.ant-table-row-selected):not(:hover) > td {
background: none;
}
::v-deep .ant-table-thead > tr > th {
background-color: #eff4fc !important;
text-align: center !important;
}
.delete {
min-width: 424px;
background: #ffffff;
@@ -661,7 +686,7 @@ const config = () => {
}
.table{
::v-deep .ant-table-cell-fix-right {
width: 160px !important;
width: 120px !important;
}
}
}