mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-23 17:55:39 +08:00
讲师管理定位高亮
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
placement="right"
|
placement="right"
|
||||||
width="70%"
|
width="70%"
|
||||||
>
|
>
|
||||||
<div class="drawerMains">
|
<div class="drawerMains" ref="drawerContent">
|
||||||
<div class="headers" style="margin-top:-24px;">
|
<div class="headers" style="margin-top:-24px;">
|
||||||
<div class="headerTitle">{{ name }}</div>
|
<div class="headerTitle">{{ name }}</div>
|
||||||
<img
|
<img
|
||||||
@@ -33,12 +33,13 @@
|
|||||||
<div class="table" style="padding-bottom:72px;">
|
<div class="table" style="padding-bottom:72px;">
|
||||||
<a-table
|
<a-table
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data-source="searchTrue?searchList:tableData"
|
:data-source="tableData"
|
||||||
:pagination="false"
|
:pagination="false"
|
||||||
:scroll="{ x: 'max-content' }"
|
:scroll="{ x: 'max-content' }"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
||||||
|
:custom-row="customRow"
|
||||||
>
|
>
|
||||||
<template #action="{ record }">
|
<template #action="{ record }">
|
||||||
<div class="action">
|
<div class="action">
|
||||||
@@ -71,6 +72,14 @@ const props = defineProps({
|
|||||||
default: ""
|
default: ""
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
const drawerContent = ref(null)
|
||||||
|
const customRow = (record) => {
|
||||||
|
return {
|
||||||
|
style:{
|
||||||
|
backgroundColor: searchTrue.value && searchList.value.some(item => item.id === record.id) ? '#b1ffbd !important' : '',
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
watch(()=>props.visible,(val)=>{
|
watch(()=>props.visible,(val)=>{
|
||||||
if(val){
|
if(val){
|
||||||
loading.value = true
|
loading.value = true
|
||||||
@@ -100,6 +109,7 @@ const resetData = () => {
|
|||||||
searchData(false)
|
searchData(false)
|
||||||
}
|
}
|
||||||
const searchData = (val) => {
|
const searchData = (val) => {
|
||||||
|
// drawerContent.value.scrollTo({top:200,behavior: 'smooth'})
|
||||||
searchTrue.value = val
|
searchTrue.value = val
|
||||||
if(!nameUserNo.value&&!dateValue.value){
|
if(!nameUserNo.value&&!dateValue.value){
|
||||||
searchList.value = tableData.value;
|
searchList.value = tableData.value;
|
||||||
@@ -121,6 +131,11 @@ const searchData = (val) => {
|
|||||||
return isNameMatch || isDateInRange;
|
return isNameMatch || isDateInRange;
|
||||||
});
|
});
|
||||||
searchList.value = filteredList;
|
searchList.value = filteredList;
|
||||||
|
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'})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const selectedRowKeys = ref([])
|
const selectedRowKeys = ref([])
|
||||||
@@ -300,12 +315,12 @@ const queryDrawer = () => {
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
|
|
||||||
.largeDrawerInside {
|
.largeDrawerInside {
|
||||||
.drawerMains {
|
.drawerMains {
|
||||||
min-width: 600px;
|
min-width: 600px;
|
||||||
// margin: 0px 32px 0px 32px;
|
// margin: 0px 32px 0px 32px;
|
||||||
overflow-x: auto;
|
height:100%;
|
||||||
|
overflow: auto;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding:24px;
|
padding:24px;
|
||||||
@@ -319,6 +334,7 @@ const queryDrawer = () => {
|
|||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
|
|
||||||
.headerTitle {
|
.headerTitle {
|
||||||
|
margin: 24px 0;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
|
|||||||
Reference in New Issue
Block a user