mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-03 13:44:47 +08:00
chore: update
This commit is contained in:
@@ -43,7 +43,7 @@ export const list = [
|
||||
{
|
||||
key: "watermark",
|
||||
content: rendContent("watermark"),
|
||||
title: "水印",
|
||||
title: "水印(无法删除的水印哦🤓️)",
|
||||
component: Watermark
|
||||
},
|
||||
{
|
||||
|
||||
@@ -26,14 +26,23 @@ export function useColumns(printRef: Ref) {
|
||||
];
|
||||
|
||||
const print = () => {
|
||||
Print(printRef.value.getTableRef().$refs.tableWrapper).toPrint;
|
||||
Print(printRef.value.getTableDoms().tableWrapper).toPrint;
|
||||
};
|
||||
|
||||
function cellStyle({ column: { property }, rowIndex }) {
|
||||
if (property === "id") {
|
||||
return rowIndex < 3
|
||||
? { background: "#87baf9" }
|
||||
: { background: "#87e8de" };
|
||||
}
|
||||
}
|
||||
|
||||
function headerCellStyle({ columnIndex }) {
|
||||
return columnIndex === 0
|
||||
? { background: "#f3b2d0" }
|
||||
: { background: "#fafafa" };
|
||||
}
|
||||
|
||||
function rowStyle({ rowIndex }) {
|
||||
return rowIndex % 2 === 1
|
||||
? { background: "#ffa39e" }
|
||||
@@ -44,7 +53,8 @@ export function useColumns(printRef: Ref) {
|
||||
columns,
|
||||
dataList,
|
||||
print,
|
||||
headerCellStyle,
|
||||
rowStyle
|
||||
rowStyle,
|
||||
cellStyle,
|
||||
headerCellStyle
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import { ref } from "vue";
|
||||
import { useColumns } from "./columns";
|
||||
|
||||
const printRef = ref();
|
||||
const { columns, dataList, print, rowStyle, headerCellStyle } =
|
||||
const { columns, dataList, print, cellStyle, rowStyle, headerCellStyle } =
|
||||
useColumns(printRef);
|
||||
</script>
|
||||
|
||||
@@ -13,22 +13,15 @@ const { columns, dataList, print, rowStyle, headerCellStyle } =
|
||||
打印
|
||||
</el-button>
|
||||
<pure-table
|
||||
rowHoverBgColor="transparent"
|
||||
ref="printRef"
|
||||
row-key="id"
|
||||
border
|
||||
:data="dataList"
|
||||
:columns="columns"
|
||||
:row-style="rowStyle"
|
||||
:cell-style="cellStyle"
|
||||
:header-cell-style="headerCellStyle"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
// 去掉鼠标悬停行背景色
|
||||
:deep(.el-table) {
|
||||
tbody tr:hover > td {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -27,7 +27,7 @@ export function useColumns(waterRef: Ref) {
|
||||
onMounted(() => {
|
||||
delay().then(() => {
|
||||
const { setWatermark } = useWatermark(
|
||||
waterRef.value.getTableRef().$refs.tableWrapper
|
||||
waterRef.value.getTableDoms().tableWrapper
|
||||
);
|
||||
setWatermark("编程即艺术", {
|
||||
font: "16px Microsoft YaHei",
|
||||
|
||||
Reference in New Issue
Block a user