fix: 🧩 修改bar组件
This commit is contained in:
parent
d6a36abc47
commit
ef51ae18ce
|
@ -10,7 +10,7 @@ export default defineFakeRoute([
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
data: {
|
data: {
|
||||||
avatar: "https://avatars.githubusercontent.com/u/44761321",
|
avatar: "https://pic3.zhimg.com/80/v2-0888fd6c14153bb36fb630230f73a802_720w.webp",
|
||||||
username: "admin",
|
username: "admin",
|
||||||
nickname: "小铭",
|
nickname: "小铭",
|
||||||
// 一个用户可能有多个角色
|
// 一个用户可能有多个角色
|
||||||
|
@ -24,7 +24,7 @@ export default defineFakeRoute([
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
data: {
|
data: {
|
||||||
avatar: "https://avatars.githubusercontent.com/u/52823142",
|
avatar: "https://pic2.zhimg.com/v2-9ee815c09ec2e1f3a007e8d77ec06375_r.jpg",
|
||||||
username: "common",
|
username: "common",
|
||||||
nickname: "小林",
|
nickname: "小林",
|
||||||
roles: ["common"],
|
roles: ["common"],
|
||||||
|
|
|
@ -3,7 +3,6 @@ import { transformI18n } from "@/plugins/i18n";
|
||||||
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
|
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
|
||||||
import { computed, defineComponent, getCurrentInstance, nextTick, type PropType, ref, unref } from "vue";
|
import { computed, defineComponent, getCurrentInstance, nextTick, type PropType, ref, unref } from "vue";
|
||||||
import { cloneDeep, delay, getKeyList, isBoolean, isFunction } from "@pureadmin/utils";
|
import { cloneDeep, delay, getKeyList, isBoolean, isFunction } from "@pureadmin/utils";
|
||||||
|
|
||||||
import DragIcon from "@/assets/table-bar/drag.svg?component";
|
import DragIcon from "@/assets/table-bar/drag.svg?component";
|
||||||
import ExpandIcon from "@/assets/table-bar/expand.svg?component";
|
import ExpandIcon from "@/assets/table-bar/expand.svg?component";
|
||||||
import RefreshIcon from "@/assets/table-bar/refresh.svg?component";
|
import RefreshIcon from "@/assets/table-bar/refresh.svg?component";
|
||||||
|
@ -32,6 +31,34 @@ const props = {
|
||||||
tableKey: {
|
tableKey: {
|
||||||
type: [String, Number] as PropType<string | number>,
|
type: [String, Number] as PropType<string | number>,
|
||||||
default: "0"
|
default: "0"
|
||||||
|
},
|
||||||
|
dataList: {
|
||||||
|
type: Array,
|
||||||
|
default: []
|
||||||
|
},
|
||||||
|
loading: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
pagination: {
|
||||||
|
type: Object,
|
||||||
|
default: {}
|
||||||
|
},
|
||||||
|
size: {
|
||||||
|
type: String as PropType<any>,
|
||||||
|
default: "default"
|
||||||
|
},
|
||||||
|
handleSelectionChange: {
|
||||||
|
type: String as PropType<any>,
|
||||||
|
default: () => {}
|
||||||
|
},
|
||||||
|
handleSizeChange: {
|
||||||
|
type: String as PropType<any>,
|
||||||
|
default: () => {}
|
||||||
|
},
|
||||||
|
handleCurrentChange: {
|
||||||
|
type: String as PropType<any>,
|
||||||
|
default: () => {}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -52,7 +79,7 @@ export default defineComponent({
|
||||||
const dynamicColumns = ref(cloneDeep(props?.columns));
|
const dynamicColumns = ref(cloneDeep(props?.columns));
|
||||||
|
|
||||||
const getDropdownItemStyle = computed(() => {
|
const getDropdownItemStyle = computed(() => {
|
||||||
return s => {
|
return (s: string) => {
|
||||||
return {
|
return {
|
||||||
background: s === size.value ? useEpThemeStoreHook().epThemeColor : "",
|
background: s === size.value ? useEpThemeStoreHook().epThemeColor : "",
|
||||||
color: s === size.value ? "#fff" : "var(--el-text-color-primary)"
|
color: s === size.value ? "#fff" : "var(--el-text-color-primary)"
|
||||||
|
@ -161,7 +188,7 @@ export default defineComponent({
|
||||||
};
|
};
|
||||||
|
|
||||||
const isFixedColumn = (label: string) => {
|
const isFixedColumn = (label: string) => {
|
||||||
return dynamicColumns.value.filter(item => transformI18n(item.label) === transformI18n(label))[0].fixed ? true : false;
|
return !!dynamicColumns.value.filter(item => transformI18n(item.label) === transformI18n(label))[0].fixed;
|
||||||
};
|
};
|
||||||
|
|
||||||
const rendTippyProps = (content: string) => {
|
const rendTippyProps = (content: string) => {
|
||||||
|
@ -181,7 +208,7 @@ export default defineComponent({
|
||||||
|
|
||||||
return () => (
|
return () => (
|
||||||
<>
|
<>
|
||||||
<div {...attrs} class="w-[99/100] mt-2 px-2 pb-2 bg-bg_color">
|
<div {...attrs} size={props.size} class="w-[99/100] mt-2 px-2 pb-2 bg-bg_color">
|
||||||
<div class="flex justify-between w-full h-[60px] p-4">
|
<div class="flex justify-between w-full h-[60px] p-4">
|
||||||
{slots?.title ? slots.title() : <p class="font-bold truncate">{props.title}</p>}
|
{slots?.title ? slots.title() : <p class="font-bold truncate">{props.title}</p>}
|
||||||
<div class="flex items-center justify-around">
|
<div class="flex items-center justify-around">
|
||||||
|
@ -244,6 +271,24 @@ export default defineComponent({
|
||||||
size: size.value,
|
size: size.value,
|
||||||
dynamicColumns: dynamicColumns.value
|
dynamicColumns: dynamicColumns.value
|
||||||
})}
|
})}
|
||||||
|
{/*<PureTable*/}
|
||||||
|
{/* ref="tableRef"*/}
|
||||||
|
{/* columns={dynamicColumns.value}*/}
|
||||||
|
{/* adaptiveConfig={{ offsetBottom: 108 }}*/}
|
||||||
|
{/* headerCellStyle={{*/}
|
||||||
|
{/* background: "var(--el-fill-color-light)",*/}
|
||||||
|
{/* color: "var(--el-text-color-primary)"*/}
|
||||||
|
{/* }}*/}
|
||||||
|
{/* adaptive*/}
|
||||||
|
{/* align-whole="center"*/}
|
||||||
|
{/* row-key="id"*/}
|
||||||
|
{/* table-layout="auto"*/}
|
||||||
|
{/* data={props.dataList}*/}
|
||||||
|
{/* loading={props.loading}*/}
|
||||||
|
{/* pagination={props.pagination}*/}
|
||||||
|
{/* paginationSmall={props.size == "small"}*/}
|
||||||
|
{/* {...props}*/}
|
||||||
|
{/*/>*/}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
|
@ -4,9 +4,9 @@ import { useRole } from "@/hooks/monitor/useRole";
|
||||||
import { getPickerShortcuts } from "../../utils";
|
import { getPickerShortcuts } from "../../utils";
|
||||||
import { PureTableBar } from "@/components/TableBar";
|
import { PureTableBar } from "@/components/TableBar";
|
||||||
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
||||||
import PureTable from "@pureadmin/table";
|
|
||||||
import Delete from "@iconify-icons/ep/delete";
|
import Delete from "@iconify-icons/ep/delete";
|
||||||
import Refresh from "@iconify-icons/ep/refresh";
|
import Refresh from "@iconify-icons/ep/refresh";
|
||||||
|
import PureTable from "@pureadmin/table";
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "LoginLog"
|
name: "LoginLog"
|
||||||
|
@ -49,7 +49,7 @@ const { form, loading, columns, dataList, pagination, selectedNum, onSearch, cle
|
||||||
</el-popconfirm>
|
</el-popconfirm>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot="{ size, dynamicColumns }">
|
<template v-slot="{ size, dynamicColumns }">
|
||||||
<div v-if="selectedNum > 0" v-motion-fade class="bg-[var(--el-fill-color-light)] w-full h-[46px] mb-2 pl-4 flex items-center">
|
<div v-motion-fade class="bg-[var(--el-fill-color-light)] w-full h-[46px] mb-2 pl-4 flex items-center">
|
||||||
<div class="flex-auto">
|
<div class="flex-auto">
|
||||||
<span class="text-[rgba(42,46,54,0.5)] dark:text-[rgba(220,220,242,0.5)]" style="font-size: var(--el-font-size-base)"> 已选 {{ selectedNum }} 项 </span>
|
<span class="text-[rgba(42,46,54,0.5)] dark:text-[rgba(220,220,242,0.5)]" style="font-size: var(--el-font-size-base)"> 已选 {{ selectedNum }} 项 </span>
|
||||||
<el-button text type="primary" @click="onSelectionCancel"> 取消选择</el-button>
|
<el-button text type="primary" @click="onSelectionCancel"> 取消选择</el-button>
|
||||||
|
|
|
@ -39,7 +39,7 @@ const { form, loading, columns, dataList, pagination, onSearch, resetForm, handl
|
||||||
}"
|
}"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:pagination="pagination"
|
:pagination="pagination"
|
||||||
:paginationSmall="size === 'small' ? true : false"
|
:paginationSmall="size === 'small'"
|
||||||
:size="size"
|
:size="size"
|
||||||
adaptive
|
adaptive
|
||||||
align-whole="center"
|
align-whole="center"
|
||||||
|
|
Loading…
Reference in New Issue