fixed(advanced-table): table-shadow styles

This commit is contained in:
JiwenBai 2019-11-12 14:12:45 +08:00
parent c11e6eb557
commit 8f80bf578b
5 changed files with 38 additions and 37 deletions

View File

@ -166,7 +166,7 @@ export default {
getData(args) { getData(args) {
this.loading = true this.loading = true
setTimeout(() => { setTimeout(() => {
let d = new Array(0).fill(0) let d = new Array(20).fill(0)
d = d.map((item, idx) => { d = d.map((item, idx) => {
return { return {
name: 'xiaobai213213132123213111121' + idx, name: 'xiaobai213213132123213111121' + idx,

View File

@ -2,7 +2,6 @@
<div class="n-filter-wraper"> <div class="n-filter-wraper">
<n-popselect <n-popselect
v-if="!loading && !error" v-if="!loading && !error"
v-model="selectedValue" v-model="selectedValue"
cancelable cancelable
:multiple="column.filterMultiple" :multiple="column.filterMultiple"
@ -13,25 +12,14 @@
<filterIcon :status="filterStatus" /> <filterIcon :status="filterStatus" />
</template> </template>
</n-popselect> </n-popselect>
<n-popover <n-popover v-else placement="bottom" trigger="click">
v-else
placement="bottom"
trigger="click"
>
<template v-slot:activator> <template v-slot:activator>
<filterIcon :status="filterStatus" /> <filterIcon :status="filterStatus" />
</template> </template>
<p <p v-if="loading" class="n-filter-tip-line">
v-if="loading"
class="n-filter-tip-line"
>
Loading... Loading...
</p> </p>
<p <p v-if="error" class="n-filter-tip-line" style="">
v-if="error"
class="n-filter-tip-line"
style=""
>
Error,refresh Error,refresh
<n-icon <n-icon
style="cursor:pointer" style="cursor:pointer"
@ -39,7 +27,9 @@
color="#999" color="#999"
size="18" size="18"
@click.stop="initItems" @click.stop="initItems"
/> >
<md-refresh />
</n-icon>
</p> </p>
</n-popover> </n-popover>
</div> </div>
@ -47,10 +37,12 @@
<script> <script>
import filterIcon from '../filterIcon' import filterIcon from '../filterIcon'
import mdRefresh from 'naive-ui/lib/icons/md-refresh'
export default { export default {
components: { components: {
filterIcon filterIcon,
mdRefresh
}, },
props: { props: {
value: { value: {
@ -79,7 +71,11 @@ export default {
}, },
computed: { computed: {
filterStatus () { filterStatus () {
return this.selectedValue !== null && this.selectedValue !== undefined && this.selectedValue.length !== 0 return (
this.selectedValue !== null &&
this.selectedValue !== undefined &&
this.selectedValue.length !== 0
)
} }
}, },
watch: { watch: {
@ -100,15 +96,18 @@ export default {
this.error = false this.error = false
if (typeof this.items === 'function') { if (typeof this.items === 'function') {
this.loading = true this.loading = true
this.items().then((items) => { this.items().then(
this.filterItems = items items => {
this.loading = false this.filterItems = items
}, (err) => { this.loading = false
console.error(err) },
this.error = true err => {
this.loading = false console.error(err)
throw err this.error = true
}) this.loading = false
throw err
}
)
} else { } else {
this.filterItems = this.items this.filterItems = this.items
} }
@ -125,8 +124,8 @@ export default {
.n-filter-wraper { .n-filter-wraper {
display: inline-block; display: inline-block;
} }
.n-filter-tip-line{ .n-filter-tip-line {
text-align:center; text-align: center;
padding:5px; padding: 5px;
} }
</style> </style>

View File

@ -29,7 +29,7 @@
transition: box-shadow 0.2s; transition: box-shadow 0.2s;
&.n-advance-table__fixed--right { &.n-advance-table__fixed--right {
box-shadow: -10px 0 16px -5px rgba(0, 0, 0, 0.2); box-shadow: -10px 0 16px -5px rgba(0, 0, 0, 0.2);
border-right: none; border-left: none;
} }
&.n-advance-table__fixed--left { &.n-advance-table__fixed--left {
box-shadow: 10px 0 16px -5px rgba(0, 0, 0, 0.2); box-shadow: 10px 0 16px -5px rgba(0, 0, 0, 0.2);
@ -49,7 +49,7 @@
.n-advance-table__fixed--right { .n-advance-table__fixed--right {
border-top-right-radius: 0; border-top-right-radius: 0;
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
border-left: $--table-td-border-right; // border-left: $--table-td-border-right;
right: 0; right: 0;
top: 0; top: 0;
@ -61,7 +61,7 @@
display: inline-block; display: inline-block;
position: absolute; position: absolute;
z-index: 100; z-index: 100;
overflow: hidden;
// box-shadow: 10px 0 16px 3px rgba(0, 0, 0, 0.2); // box-shadow: 10px 0 16px 3px rgba(0, 0, 0, 0.2);
.n-table.n-advance-table__body { .n-table.n-advance-table__body {
width: auto; width: auto;
@ -125,7 +125,7 @@
position: absolute; position: absolute;
width: 100%; width: 100%;
top: 0; top: 0;
background-color: rgba(255, 255, 255, 0.5); background-color: $--table-loading-background;
z-index: 200; z-index: 200;
} }
@include once { @include once {

View File

@ -1,4 +1,5 @@
@mixin setup-dark-advance-table { @mixin setup-dark-advance-table {
$--table-header-icon-color: $--primary-6 !global; $--table-header-icon-color: $--primary-6 !global;
$--table-scrollbar-color: rgba(255, 255, 255, 0.2) !global; $--table-scrollbar-color: rgba(255, 255, 255, 0.2) !global;
} $--table-loading-background: rgba(0, 0, 0, 0.15) !global;
}

View File

@ -1,4 +1,5 @@
@mixin setup-light-advance-table { @mixin setup-light-advance-table {
$--table-header-icon-color: $--primary-6 !global; $--table-header-icon-color: $--primary-6 !global;
$--table-scrollbar-color: #ababab !global; $--table-scrollbar-color: #ababab !global;
} $--table-loading-background: rgba(255, 255, 255, 0.5) !global;
}