chore: update

This commit is contained in:
xiaoxian521
2022-11-24 11:48:52 +08:00
parent 7d40e36574
commit d7364d59a9
6 changed files with 23 additions and 20 deletions

View File

@@ -43,7 +43,7 @@ export const list = [
{
key: "watermark",
content: rendContent("watermark"),
title: "水印",
title: "水印(无法删除的水印哦🤓️)",
component: Watermark
},
{

View File

@@ -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
};
}

View File

@@ -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>

View File

@@ -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",