2023-06-28 21:35:03 +08:00
|
|
|
|
<template>
|
2023-12-12 23:31:53 +08:00
|
|
|
|
<div>
|
2023-12-13 14:01:13 +08:00
|
|
|
|
<transition name="el-zoom-in-top">
|
|
|
|
|
|
<!-- 查询表单 -->
|
2023-12-14 13:05:21 +08:00
|
|
|
|
<SearchForm v-if="isShowSearch" :items="searchItems" v-model="queryForm_" :search="queryData" :reset="reset" :search-col="searchCol">
|
2023-12-13 14:01:13 +08:00
|
|
|
|
<!-- 遍历父组件传入的 solts 透传给子组件 -->
|
|
|
|
|
|
<template v-for="(_, key) in useSlots()" v-slot:[key]>
|
|
|
|
|
|
<slot :name="key"></slot>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</SearchForm>
|
|
|
|
|
|
</transition>
|
2023-06-28 21:35:03 +08:00
|
|
|
|
|
2023-12-14 13:05:21 +08:00
|
|
|
|
<div class="card">
|
2023-12-12 23:31:53 +08:00
|
|
|
|
<div class="table-main">
|
|
|
|
|
|
<!-- 表格头部 操作按钮 -->
|
|
|
|
|
|
<div class="table-header">
|
|
|
|
|
|
<div class="header-button-lf">
|
|
|
|
|
|
<slot name="tableHeader" />
|
2023-06-28 21:35:03 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2023-12-12 23:31:53 +08:00
|
|
|
|
<div v-if="toolButton" class="header-button-ri">
|
|
|
|
|
|
<slot name="toolButton">
|
|
|
|
|
|
<el-button v-if="showToolButton('refresh')" icon="Refresh" circle @click="execQuery()" />
|
|
|
|
|
|
|
|
|
|
|
|
<el-button v-if="showToolButton('search') && searchItems?.length" icon="Search" circle @click="isShowSearch = !isShowSearch" />
|
2023-06-28 21:35:03 +08:00
|
|
|
|
|
2023-07-20 22:41:13 +08:00
|
|
|
|
<el-popover
|
2023-12-12 23:31:53 +08:00
|
|
|
|
placement="bottom"
|
|
|
|
|
|
title="表格配置"
|
|
|
|
|
|
popper-style="max-height: 550px; overflow: auto; max-width: 450px"
|
|
|
|
|
|
width="auto"
|
2023-07-20 22:41:13 +08:00
|
|
|
|
trigger="click"
|
|
|
|
|
|
>
|
2023-12-12 23:31:53 +08:00
|
|
|
|
<div v-for="(item, index) in tableColumns" :key="index">
|
|
|
|
|
|
<el-checkbox v-model="item.show" :label="item.label" :true-label="true" :false-label="false" />
|
|
|
|
|
|
</div>
|
2023-07-20 22:41:13 +08:00
|
|
|
|
<template #reference>
|
2023-12-12 23:31:53 +08:00
|
|
|
|
<el-button icon="Operation" circle :size="props.size"></el-button>
|
2023-07-20 22:41:13 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
</el-popover>
|
2023-12-12 23:31:53 +08:00
|
|
|
|
</slot>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2023-07-20 22:41:13 +08:00
|
|
|
|
|
2023-12-12 23:31:53 +08:00
|
|
|
|
<el-table
|
|
|
|
|
|
v-bind="$attrs"
|
|
|
|
|
|
:max-height="tableMaxHeight"
|
|
|
|
|
|
@selection-change="handleSelectionChange"
|
|
|
|
|
|
:data="state.data"
|
|
|
|
|
|
highlight-current-row
|
|
|
|
|
|
v-loading="state.loading"
|
|
|
|
|
|
:size="props.size"
|
|
|
|
|
|
:border="border"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-table-column v-if="props.showSelection" type="selection" width="40" />
|
|
|
|
|
|
|
|
|
|
|
|
<template v-for="(item, index) in tableColumns">
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
:key="index"
|
|
|
|
|
|
v-if="item.show"
|
|
|
|
|
|
:prop="item.prop"
|
|
|
|
|
|
:label="item.label"
|
|
|
|
|
|
:fixed="item.fixed"
|
|
|
|
|
|
:align="item.align"
|
|
|
|
|
|
:show-overflow-tooltip="item.showOverflowTooltip"
|
|
|
|
|
|
:min-width="item.minWidth"
|
|
|
|
|
|
:sortable="item.sortable || false"
|
|
|
|
|
|
:type="item.type"
|
|
|
|
|
|
:width="item.width"
|
|
|
|
|
|
>
|
|
|
|
|
|
<!-- 插槽:预留功能 -->
|
|
|
|
|
|
<template #default="scope" v-if="item.slot">
|
|
|
|
|
|
<slot :name="item.prop" :data="scope.row"></slot>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 枚举类型使用tab展示 -->
|
|
|
|
|
|
<template #default="scope" v-else-if="item.type == 'tag'">
|
|
|
|
|
|
<enum-tag :size="props.size" :enums="item.typeParam" :value="scope.row[item.prop]"></enum-tag>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<template #default="scope" v-else>
|
|
|
|
|
|
<!-- 配置了美化文本按钮以及文本内容大于指定长度,则显示美化按钮 -->
|
|
|
|
|
|
<el-popover
|
|
|
|
|
|
v-if="item.isBeautify && scope.row[item.prop]?.length > 35"
|
|
|
|
|
|
effect="light"
|
|
|
|
|
|
trigger="click"
|
|
|
|
|
|
placement="top"
|
|
|
|
|
|
width="600px"
|
|
|
|
|
|
>
|
|
|
|
|
|
<template #default>
|
|
|
|
|
|
<el-input :autosize="{ minRows: 3, maxRows: 15 }" disabled v-model="formatVal" type="textarea" />
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template #reference>
|
|
|
|
|
|
<el-link
|
|
|
|
|
|
@click="formatText(scope.row[item.prop])"
|
|
|
|
|
|
:underline="false"
|
|
|
|
|
|
type="success"
|
|
|
|
|
|
icon="MagicStick"
|
|
|
|
|
|
class="mr5"
|
|
|
|
|
|
></el-link>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-popover>
|
2023-06-28 21:35:03 +08:00
|
|
|
|
|
2023-12-12 23:31:53 +08:00
|
|
|
|
<span>{{ item.getValueByData(scope.row) }}</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<el-row class="mt20" type="flex" justify="end">
|
2023-07-06 20:59:22 +08:00
|
|
|
|
<el-pagination
|
|
|
|
|
|
:small="props.size == 'small'"
|
|
|
|
|
|
@current-change="handlePageChange"
|
|
|
|
|
|
@size-change="handleSizeChange"
|
|
|
|
|
|
style="text-align: right"
|
|
|
|
|
|
layout="prev, pager, next, total, sizes, jumper"
|
2023-12-11 01:00:09 +08:00
|
|
|
|
:total="state.total"
|
|
|
|
|
|
v-model:current-page="queryForm_.pageNum"
|
|
|
|
|
|
v-model:page-size="queryForm_.pageSize"
|
2023-07-06 20:59:22 +08:00
|
|
|
|
:page-sizes="pageSizes"
|
|
|
|
|
|
/>
|
2023-06-28 21:35:03 +08:00
|
|
|
|
</el-row>
|
2023-12-14 13:05:21 +08:00
|
|
|
|
</div>
|
2023-06-28 21:35:03 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
2023-07-06 20:59:22 +08:00
|
|
|
|
<script lang="ts" setup>
|
2023-12-12 23:31:53 +08:00
|
|
|
|
import { toRefs, watch, reactive, onMounted, Ref, ref, useSlots } from 'vue';
|
|
|
|
|
|
import { TableColumn } from './index';
|
2023-07-06 20:59:22 +08:00
|
|
|
|
import EnumTag from '@/components/enumtag/EnumTag.vue';
|
2023-11-29 17:34:54 +08:00
|
|
|
|
import { useThemeConfig } from '@/store/themeConfig';
|
|
|
|
|
|
import { storeToRefs } from 'pinia';
|
2023-12-12 23:31:53 +08:00
|
|
|
|
import { useVModel, useEventListener } from '@vueuse/core';
|
2023-12-11 01:00:09 +08:00
|
|
|
|
import Api from '@/common/Api';
|
2023-12-12 23:31:53 +08:00
|
|
|
|
import SearchForm from '@/components/SearchForm/index.vue';
|
|
|
|
|
|
import { SearchItem } from '../SearchForm/index';
|
|
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['update:queryForm', 'update:selectionData', 'pageChange']);
|
|
|
|
|
|
|
|
|
|
|
|
export interface PageTableProps {
|
|
|
|
|
|
size?: string;
|
|
|
|
|
|
showSelection?: boolean;
|
|
|
|
|
|
showSearch?: boolean; // 是否显示搜索表单
|
|
|
|
|
|
columns: TableColumn[]; // 列配置项 ==> 必传
|
|
|
|
|
|
data?: any[]; // 静态 table data 数据,若存在则不会使用 requestApi 返回的 data ==> 非必传
|
|
|
|
|
|
pageApi: Api; // 请求表格数据的 api
|
|
|
|
|
|
lazy?: boolean; // 是否自动执行请求 api ==> 非必传(默认为false)
|
|
|
|
|
|
beforeQueryFn?: (params: any) => any; // 执行查询时对查询参数进行处理,调整等
|
|
|
|
|
|
dataHandlerFn?: (data: any) => any; // 数据处理回调函数,用于将请求回来的数据二次加工处理等
|
|
|
|
|
|
searchItems?: SearchItem[];
|
|
|
|
|
|
queryForm?: any; // 查询表单参数 ==> 非必传(默认为{pageNum:1, pageSize: 10})
|
|
|
|
|
|
border?: boolean; // 是否带有纵向边框 ==> 非必传(默认为false)
|
|
|
|
|
|
toolButton?: ('refresh' | 'setting' | 'search')[] | boolean; // 是否显示表格功能按钮 ==> 非必传(默认为true)
|
|
|
|
|
|
searchCol?: any; // 表格搜索项 每列占比配置 ==> 非必传 { xs: 1, sm: 2, md: 2, lg: 3, xl: 4 }
|
|
|
|
|
|
}
|
2023-06-28 21:35:03 +08:00
|
|
|
|
|
2023-12-12 23:31:53 +08:00
|
|
|
|
// 接受父组件参数,配置默认值
|
|
|
|
|
|
const props = withDefaults(defineProps<PageTableProps>(), {
|
|
|
|
|
|
columns: () => [],
|
|
|
|
|
|
showSelection: false,
|
|
|
|
|
|
lazy: false,
|
|
|
|
|
|
initParam: {},
|
2023-06-28 21:35:03 +08:00
|
|
|
|
queryForm: {
|
2023-12-12 23:31:53 +08:00
|
|
|
|
pageNum: 1,
|
|
|
|
|
|
pageSize: 0,
|
2023-06-28 21:35:03 +08:00
|
|
|
|
},
|
2023-12-12 23:31:53 +08:00
|
|
|
|
border: false,
|
|
|
|
|
|
toolButton: true,
|
|
|
|
|
|
showSearch: false,
|
|
|
|
|
|
searchItems: () => [],
|
2023-12-15 17:33:22 +08:00
|
|
|
|
searchCol: () => ({ xs: 1, sm: 3, md: 3, lg: 4, xl: 5 }),
|
2023-11-29 17:34:54 +08:00
|
|
|
|
});
|
|
|
|
|
|
|
2023-12-12 23:31:53 +08:00
|
|
|
|
// 接收 columns 并设置为响应式
|
|
|
|
|
|
const tableColumns = reactive<TableColumn[]>(props.columns);
|
|
|
|
|
|
|
2023-11-29 17:34:54 +08:00
|
|
|
|
const { themeConfig } = storeToRefs(useThemeConfig());
|
2023-06-28 21:35:03 +08:00
|
|
|
|
|
|
|
|
|
|
const state = reactive({
|
2023-07-05 22:06:32 +08:00
|
|
|
|
pageSizes: [] as any, // 可选每页显示的数据量
|
2023-06-28 21:35:03 +08:00
|
|
|
|
isOpenMoreQuery: false,
|
2023-07-05 22:06:32 +08:00
|
|
|
|
defaultQueryCount: 2, // 默认显示的查询参数个数,展开后每行显示查询条件个数为该值加1。第一行用最后一列来占用按钮
|
2023-12-11 01:00:09 +08:00
|
|
|
|
loading: false,
|
|
|
|
|
|
data: [],
|
|
|
|
|
|
total: 0,
|
2023-07-04 14:13:47 +08:00
|
|
|
|
// 输入框宽度
|
2023-11-29 17:34:54 +08:00
|
|
|
|
inputWidth_: '200px' as any,
|
2023-07-20 22:41:13 +08:00
|
|
|
|
formatVal: '', // 格式化后的值
|
2023-12-12 23:31:53 +08:00
|
|
|
|
tableMaxHeight: '500px',
|
2023-11-29 17:34:54 +08:00
|
|
|
|
});
|
|
|
|
|
|
|
2023-12-12 23:31:53 +08:00
|
|
|
|
// 是否显示搜索模块
|
|
|
|
|
|
const isShowSearch = ref(props.showSearch);
|
|
|
|
|
|
|
|
|
|
|
|
// 控制 ToolButton 显示
|
|
|
|
|
|
const showToolButton = (key: 'refresh' | 'setting' | 'search') => {
|
|
|
|
|
|
return Array.isArray(props.toolButton) ? props.toolButton.includes(key) : props.toolButton;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const { pageSizes, formatVal, tableMaxHeight } = toRefs(state);
|
2023-11-29 17:34:54 +08:00
|
|
|
|
|
2023-12-11 01:00:09 +08:00
|
|
|
|
const queryForm_: Ref<any> = useVModel(props, 'queryForm', emit);
|
2023-11-29 17:34:54 +08:00
|
|
|
|
|
|
|
|
|
|
watch(
|
2023-12-11 01:00:09 +08:00
|
|
|
|
() => state.data,
|
2023-11-29 17:34:54 +08:00
|
|
|
|
(newValue: any) => {
|
|
|
|
|
|
if (newValue && newValue.length > 0) {
|
|
|
|
|
|
props.columns.forEach((item) => {
|
|
|
|
|
|
if (item.autoWidth && item.show) {
|
2023-12-11 01:00:09 +08:00
|
|
|
|
item.autoCalculateMinWidth(state.data);
|
2023-11-29 17:34:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
);
|
2023-06-28 21:35:03 +08:00
|
|
|
|
|
2023-12-13 17:32:17 +08:00
|
|
|
|
watch(isShowSearch, () => {
|
|
|
|
|
|
calcuTableHeight();
|
|
|
|
|
|
});
|
2023-12-12 23:31:53 +08:00
|
|
|
|
|
2023-12-11 01:00:09 +08:00
|
|
|
|
onMounted(async () => {
|
2023-12-12 23:31:53 +08:00
|
|
|
|
calcuTableHeight();
|
|
|
|
|
|
useEventListener(window, 'resize', calcuTableHeight);
|
2023-11-29 17:34:54 +08:00
|
|
|
|
|
2023-12-12 23:31:53 +08:00
|
|
|
|
let pageSize = queryForm_.value.pageSize;
|
2023-11-29 17:34:54 +08:00
|
|
|
|
// 如果pageSize设为0,则使用系统全局配置的pageSize
|
|
|
|
|
|
if (!pageSize) {
|
|
|
|
|
|
pageSize = themeConfig.value.defaultListPageSize;
|
|
|
|
|
|
// 可能storage已经存在配置json,则可能没值,需要清storage重试
|
|
|
|
|
|
if (!pageSize) {
|
|
|
|
|
|
pageSize = 10;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-07-05 22:06:32 +08:00
|
|
|
|
|
2023-12-11 01:00:09 +08:00
|
|
|
|
queryForm_.value.pageNum = 1;
|
|
|
|
|
|
queryForm_.value.pageSize = pageSize;
|
2023-08-04 12:22:21 +08:00
|
|
|
|
state.pageSizes = [pageSize, pageSize * 2, pageSize * 3, pageSize * 4, pageSize * 5];
|
2023-07-04 14:13:47 +08:00
|
|
|
|
|
2023-12-11 01:00:09 +08:00
|
|
|
|
if (!props.lazy) {
|
|
|
|
|
|
await reqPageApi();
|
|
|
|
|
|
}
|
2023-11-29 17:34:54 +08:00
|
|
|
|
});
|
2023-06-28 21:35:03 +08:00
|
|
|
|
|
2023-08-16 17:37:33 +08:00
|
|
|
|
const calcuTableHeight = () => {
|
2023-12-15 17:33:22 +08:00
|
|
|
|
const headerHeight = isShowSearch.value ? 322 : 242;
|
2023-12-12 23:31:53 +08:00
|
|
|
|
state.tableMaxHeight = window.innerHeight - headerHeight + 'px';
|
2023-11-29 17:34:54 +08:00
|
|
|
|
};
|
2023-07-20 22:41:13 +08:00
|
|
|
|
|
2023-12-05 23:03:51 +08:00
|
|
|
|
const formatText = (data: any) => {
|
|
|
|
|
|
state.formatVal = '';
|
|
|
|
|
|
try {
|
|
|
|
|
|
state.formatVal = JSON.stringify(JSON.parse(data), null, 4);
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
state.formatVal = data;
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2023-07-01 14:34:42 +08:00
|
|
|
|
const handleSelectionChange = (val: any) => {
|
|
|
|
|
|
emit('update:selectionData', val);
|
2023-11-29 17:34:54 +08:00
|
|
|
|
};
|
2023-06-28 21:35:03 +08:00
|
|
|
|
|
2023-12-11 01:00:09 +08:00
|
|
|
|
const reqPageApi = async () => {
|
|
|
|
|
|
try {
|
|
|
|
|
|
state.loading = true;
|
2023-12-11 11:00:20 +08:00
|
|
|
|
|
|
|
|
|
|
let qf = queryForm_.value;
|
|
|
|
|
|
if (props.beforeQueryFn) {
|
|
|
|
|
|
qf = await props.beforeQueryFn(qf);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const res = await props.pageApi?.request(qf);
|
|
|
|
|
|
if (!res) {
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
state.total = res.total;
|
2023-12-11 01:00:09 +08:00
|
|
|
|
if (props.dataHandlerFn) {
|
|
|
|
|
|
state.data = await props.dataHandlerFn(res.list);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
state.data = res.list;
|
|
|
|
|
|
}
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
state.loading = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const handlePageChange = (val: number) => {
|
|
|
|
|
|
queryForm_.value.pageNum = val;
|
2023-07-01 14:34:42 +08:00
|
|
|
|
execQuery();
|
2023-11-29 17:34:54 +08:00
|
|
|
|
};
|
2023-06-28 21:35:03 +08:00
|
|
|
|
|
|
|
|
|
|
const handleSizeChange = () => {
|
2023-07-05 22:06:32 +08:00
|
|
|
|
changePageNum(1);
|
2023-07-01 14:34:42 +08:00
|
|
|
|
execQuery();
|
2023-11-29 17:34:54 +08:00
|
|
|
|
};
|
2023-06-28 21:35:03 +08:00
|
|
|
|
|
|
|
|
|
|
const queryData = () => {
|
2023-07-04 14:13:47 +08:00
|
|
|
|
changePageNum(1);
|
2023-07-01 14:34:42 +08:00
|
|
|
|
execQuery();
|
2023-11-29 17:34:54 +08:00
|
|
|
|
};
|
2023-06-28 21:35:03 +08:00
|
|
|
|
|
|
|
|
|
|
const reset = () => {
|
2023-07-04 14:13:47 +08:00
|
|
|
|
// 将查询参数绑定的值置空,并重新粗发查询接口
|
2023-12-12 23:31:53 +08:00
|
|
|
|
for (let qi of props.searchItems) {
|
2023-12-11 01:00:09 +08:00
|
|
|
|
queryForm_.value[qi.prop] = null;
|
2023-07-04 14:13:47 +08:00
|
|
|
|
}
|
2023-08-16 17:37:33 +08:00
|
|
|
|
|
2023-07-04 14:13:47 +08:00
|
|
|
|
changePageNum(1);
|
2023-07-01 14:34:42 +08:00
|
|
|
|
execQuery();
|
2023-11-29 17:34:54 +08:00
|
|
|
|
};
|
2023-07-01 14:34:42 +08:00
|
|
|
|
|
2023-07-04 14:13:47 +08:00
|
|
|
|
const changePageNum = (pageNum: number) => {
|
2023-12-11 01:00:09 +08:00
|
|
|
|
queryForm_.value.pageNum = pageNum;
|
2023-11-29 17:34:54 +08:00
|
|
|
|
};
|
2023-07-04 14:13:47 +08:00
|
|
|
|
|
2023-12-11 01:00:09 +08:00
|
|
|
|
const execQuery = async () => {
|
|
|
|
|
|
await reqPageApi();
|
2023-11-29 17:34:54 +08:00
|
|
|
|
};
|
2023-06-28 21:35:03 +08:00
|
|
|
|
|
2023-12-11 01:00:09 +08:00
|
|
|
|
defineExpose({
|
|
|
|
|
|
search: execQuery,
|
|
|
|
|
|
});
|
2023-06-28 21:35:03 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
2023-12-12 23:31:53 +08:00
|
|
|
|
.table-box,
|
|
|
|
|
|
.table-main {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
|
|
|
|
|
|
// 表格 header 样式
|
|
|
|
|
|
.table-header {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
.header-button-lf {
|
|
|
|
|
|
float: left;
|
2023-06-28 21:35:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-12-12 23:31:53 +08:00
|
|
|
|
.header-button-ri {
|
|
|
|
|
|
float: right;
|
2023-06-28 21:35:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-12-12 23:31:53 +08:00
|
|
|
|
.el-button {
|
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
|
}
|
2023-06-28 21:35:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-12-12 23:31:53 +08:00
|
|
|
|
// el-table 表格样式
|
|
|
|
|
|
.el-table {
|
|
|
|
|
|
flex: 1;
|
2023-06-28 21:35:03 +08:00
|
|
|
|
|
2023-12-12 23:31:53 +08:00
|
|
|
|
// 修复 safari 浏览器表格错位 https://github.com/HalseySpicy/Geeker-Admin/issues/83
|
|
|
|
|
|
table {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
2023-07-04 14:13:47 +08:00
|
|
|
|
|
2023-12-12 23:31:53 +08:00
|
|
|
|
// .el-table__header th {
|
|
|
|
|
|
// height: 45px;
|
|
|
|
|
|
// font-size: 15px;
|
|
|
|
|
|
// font-weight: bold;
|
|
|
|
|
|
// color: var(--el-text-color-primary);
|
|
|
|
|
|
// background: var(--el-fill-color-light);
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// .el-table__row {
|
|
|
|
|
|
// height: 45px;
|
|
|
|
|
|
// font-size: 14px;
|
|
|
|
|
|
|
|
|
|
|
|
// .move {
|
|
|
|
|
|
// cursor: move;
|
|
|
|
|
|
|
|
|
|
|
|
// .el-icon {
|
|
|
|
|
|
// cursor: move;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// 设置 el-table 中 header 文字不换行,并省略
|
|
|
|
|
|
.el-table__header .el-table__cell > .cell {
|
|
|
|
|
|
// white-space: nowrap;
|
|
|
|
|
|
white-space: wrap;
|
|
|
|
|
|
}
|
2023-06-28 21:35:03 +08:00
|
|
|
|
|
2023-12-12 23:31:53 +08:00
|
|
|
|
// 解决表格数据为空时样式不居中问题(仅在element-plus中)
|
|
|
|
|
|
// .el-table__empty-block {
|
|
|
|
|
|
// position: absolute;
|
|
|
|
|
|
// top: 50%;
|
|
|
|
|
|
// left: 50%;
|
|
|
|
|
|
// transform: translate(-50%, -50%);
|
|
|
|
|
|
|
|
|
|
|
|
// .table-empty {
|
|
|
|
|
|
// line-height: 30px;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// table 中 image 图片样式
|
|
|
|
|
|
.table-image {
|
|
|
|
|
|
width: 50px;
|
|
|
|
|
|
height: 50px;
|
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-06-28 21:35:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-12-12 23:31:53 +08:00
|
|
|
|
::v-deep(.el-form-item__label) {
|
|
|
|
|
|
font-weight: bold;
|
2023-06-28 21:35:03 +08:00
|
|
|
|
}
|
2023-07-06 20:59:22 +08:00
|
|
|
|
</style>
|