chore: update @pureadmin/table

This commit is contained in:
xiaoxian521
2022-06-26 14:00:56 +08:00
parent 1848c43f0c
commit 384d5e9598
8 changed files with 38 additions and 39 deletions

View File

@@ -3,7 +3,6 @@ import { useColumns } from "./columns";
import { handleTree } from "/@/utils/tree";
import { getDeptList } from "/@/api/system";
import { FormInstance } from "element-plus";
import { PureTable } from "@pureadmin/table";
import { reactive, ref, onMounted } from "vue";
import { TableProBar } from "/@/components/ReTable";
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";

View File

@@ -1,10 +1,10 @@
<script setup lang="ts">
import { useColumns } from "./columns";
import { getRoleList } from "/@/api/system";
import { PureTable } from "@pureadmin/table";
import { reactive, ref, onMounted } from "vue";
import { type FormInstance } from "element-plus";
import { TableProBar } from "/@/components/ReTable";
import { type PaginationProps } from "@pureadmin/table";
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
defineOptions({
@@ -18,13 +18,18 @@ const form = reactive({
});
let dataList = ref([]);
let pageSize = ref(10);
let totalPage = ref(0);
let loading = ref(true);
const { columns } = useColumns();
const formRef = ref<FormInstance>();
const pagination = reactive<PaginationProps>({
total: 0,
pageSize: 10,
currentPage: 1,
background: true
});
function handleUpdate(row) {
console.log(row);
}
@@ -49,7 +54,7 @@ async function onSearch() {
loading.value = true;
let { data } = await getRoleList();
dataList.value = data.list;
totalPage.value = data.total;
pagination.total = data.total;
setTimeout(() => {
loading.value = false;
}, 500);
@@ -122,8 +127,12 @@ onMounted(() => {
:data="dataList"
:columns="columns"
:checkList="checkList"
:pagination="pagination"
:paginationSmall="size === 'small' ? true : false"
:header-cell-style="{ background: '#fafafa', color: '#606266' }"
@selection-change="handleSelectionChange"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
>
<template #operation="{ row }">
<el-button
@@ -188,17 +197,6 @@ onMounted(() => {
</el-dropdown>
</template>
</PureTable>
<el-pagination
class="flex justify-end mt-4"
:small="size === 'small' ? true : false"
v-model:page-size="pageSize"
:page-sizes="[10, 20, 30, 50]"
:background="true"
layout="total, sizes, prev, pager, next, jumper"
:total="totalPage"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</template>
</TableProBar>
</div>

View File

@@ -2,10 +2,10 @@
import tree from "./tree.vue";
import { useColumns } from "./columns";
import { getUserList } from "/@/api/system";
import { PureTable } from "@pureadmin/table";
import { reactive, ref, onMounted } from "vue";
import { TableProBar } from "/@/components/ReTable";
import { type FormInstance } from "element-plus";
import { TableProBar } from "/@/components/ReTable";
import { type PaginationProps } from "@pureadmin/table";
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
defineOptions({
@@ -18,13 +18,18 @@ const form = reactive({
status: ""
});
let dataList = ref([]);
let pageSize = ref(10);
let totalPage = ref(0);
let loading = ref(true);
const { columns } = useColumns();
const formRef = ref<FormInstance>();
const pagination = reactive<PaginationProps>({
total: 0,
pageSize: 10,
currentPage: 1,
background: true
});
function handleUpdate(row) {
console.log(row);
}
@@ -49,7 +54,7 @@ async function onSearch() {
loading.value = true;
let { data } = await getUserList();
dataList.value = data.list;
totalPage.value = data.total;
pagination.total = data.total;
setTimeout(() => {
loading.value = false;
}, 500);
@@ -134,8 +139,12 @@ onMounted(() => {
:data="dataList"
:columns="columns"
:checkList="checkList"
:pagination="pagination"
:paginationSmall="size === 'small' ? true : false"
:header-cell-style="{ background: '#fafafa', color: '#606266' }"
@selection-change="handleSelectionChange"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
>
<template #operation="{ row }">
<el-button
@@ -200,17 +209,6 @@ onMounted(() => {
</el-dropdown>
</template>
</PureTable>
<el-pagination
class="flex justify-end mt-4"
:small="size === 'small' ? true : false"
v-model:page-size="pageSize"
:page-sizes="[10, 20, 30, 50]"
:background="true"
layout="total, sizes, prev, pager, next, jumper"
:total="totalPage"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</template>
</TableProBar>
</div>