chore: update
This commit is contained in:
parent
4d0e68448c
commit
1ead396b51
@ -56,7 +56,12 @@ const maxPage = ref(0);
|
|||||||
const totalPage = computed(() => {
|
const totalPage = computed(() => {
|
||||||
maxPage.value = Math.ceil(props.total / props.limit);
|
maxPage.value = Math.ceil(props.total / props.limit);
|
||||||
let r: number[] = [],
|
let r: number[] = [],
|
||||||
start = maxPage.value <= props.pages ? 1 : currentPage.value > pages ? currentPage.value - pages : 1;
|
start =
|
||||||
|
maxPage.value <= props.pages
|
||||||
|
? 1
|
||||||
|
: currentPage.value > pages
|
||||||
|
? currentPage.value - pages
|
||||||
|
: 1;
|
||||||
for (let i = start; ; i++) {
|
for (let i = start; ; i++) {
|
||||||
if (r.length >= props.pages || i > maxPage.value) {
|
if (r.length >= props.pages || i > maxPage.value) {
|
||||||
break;
|
break;
|
||||||
|
@ -202,11 +202,24 @@ onMounted(() => {
|
|||||||
<template v-for="column in columns" :key="column">
|
<template v-for="column in columns" :key="column">
|
||||||
<th v-if="tableColumnKeys.includes(column.key)">
|
<th v-if="tableColumnKeys.includes(column.key)">
|
||||||
<!-- TODO Table header slot -->
|
<!-- TODO Table header slot -->
|
||||||
<div class="layui-table-cell" :style="{ width: column.width }">
|
<div
|
||||||
|
class="layui-table-cell"
|
||||||
|
:style="{ width: column.width }"
|
||||||
|
>
|
||||||
<span>{{ column.title }}</span>
|
<span>{{ column.title }}</span>
|
||||||
<span v-if="column.sort" class="layui-table-sort layui-inline" lay-sort="">
|
<span
|
||||||
<i class="layui-edge layui-table-sort-asc" title="升序"></i>
|
v-if="column.sort"
|
||||||
<i class="layui-edge layui-table-sort-desc" title="降序"></i>
|
class="layui-table-sort layui-inline"
|
||||||
|
lay-sort=""
|
||||||
|
>
|
||||||
|
<i
|
||||||
|
class="layui-edge layui-table-sort-asc"
|
||||||
|
title="升序"
|
||||||
|
></i>
|
||||||
|
<i
|
||||||
|
class="layui-edge layui-table-sort-desc"
|
||||||
|
title="降序"
|
||||||
|
></i>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</th>
|
</th>
|
||||||
|
@ -138,26 +138,26 @@ const remove = function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const searchLeft = (e: any) => {
|
const searchLeft = (e: any) => {
|
||||||
if(e.target.value === "") {
|
if (e.target.value === "") {
|
||||||
leftDataSource.value = _leftDataSource.value;
|
leftDataSource.value = _leftDataSource.value;
|
||||||
|
}
|
||||||
|
leftDataSource.value = _leftDataSource.value.filter((item) => {
|
||||||
|
if (item.title.indexOf(e.target.value) != -1) {
|
||||||
|
return item;
|
||||||
}
|
}
|
||||||
leftDataSource.value = _leftDataSource.value.filter((item) => {
|
});
|
||||||
if(item.title.indexOf(e.target.value) != -1) {
|
};
|
||||||
return item;
|
|
||||||
};
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const searchRight = (e: any) => {
|
const searchRight = (e: any) => {
|
||||||
if(e.target.value === "") {
|
if (e.target.value === "") {
|
||||||
rightDataSource.value = _rightDataSource.value;
|
rightDataSource.value = _rightDataSource.value;
|
||||||
|
}
|
||||||
|
rightDataSource.value = _rightDataSource.value.filter((item) => {
|
||||||
|
if (item.title.indexOf(e.target.value) != -1) {
|
||||||
|
return item;
|
||||||
}
|
}
|
||||||
rightDataSource.value = _rightDataSource.value.filter((item) => {
|
});
|
||||||
if(item.title.indexOf(e.target.value) != -1) {
|
};
|
||||||
return item;
|
|
||||||
};
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -176,7 +176,12 @@ const searchRight = (e: any) => {
|
|||||||
</div>
|
</div>
|
||||||
<div class="layui-transfer-search" v-if="showSearch">
|
<div class="layui-transfer-search" v-if="showSearch">
|
||||||
<i class="layui-icon layui-icon-search"></i
|
<i class="layui-icon layui-icon-search"></i
|
||||||
><input type="input" class="layui-input" @input="searchLeft" placeholder="关键词搜索" />
|
><input
|
||||||
|
type="input"
|
||||||
|
class="layui-input"
|
||||||
|
@input="searchLeft"
|
||||||
|
placeholder="关键词搜索"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<ul class="layui-transfer-data" style="height: 320px">
|
<ul class="layui-transfer-data" style="height: 320px">
|
||||||
<li v-for="dataSource in leftDataSource" :key="dataSource">
|
<li v-for="dataSource in leftDataSource" :key="dataSource">
|
||||||
@ -218,7 +223,12 @@ const searchRight = (e: any) => {
|
|||||||
</div>
|
</div>
|
||||||
<div class="layui-transfer-search" v-if="showSearch">
|
<div class="layui-transfer-search" v-if="showSearch">
|
||||||
<i class="layui-icon layui-icon-search"></i
|
<i class="layui-icon layui-icon-search"></i
|
||||||
><input type="input" class="layui-input" @input="searchRight" placeholder="关键词搜索" />
|
><input
|
||||||
|
type="input"
|
||||||
|
class="layui-input"
|
||||||
|
@input="searchRight"
|
||||||
|
placeholder="关键词搜索"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<ul class="layui-transfer-data" style="height: 320px">
|
<ul class="layui-transfer-data" style="height: 320px">
|
||||||
<li v-for="dataSource in rightDataSource" :key="dataSource">
|
<li v-for="dataSource in rightDataSource" :key="dataSource">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user