You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

148 lines
3.1 KiB

<template>
<el-card id="overtime-card" class="box-card" shadow="hover">
<div slot="header" class="clearfix">
<img style="width: 31px;height:32px" src="../static/icon9.png" alt="">
<span
style="padding-left: 15px"
>今日加班情况</span>
<i class="el-icon-more" style="margin-left: auto; font-size: 20px" />
</div>
<div style="position: relative;height: 100%;width: 100%;">
<div style="position: absolute;top: 0;left: 0;right: 0;bottom: 0;">
<el-table
style="width: 100%;"
size="mini"
:header-cell-style="{
'font-weight': '600',
'background': '#fff',
'color': '#515a6e',
'text-align':'left'
}"
:height="tableHeight"
:data="list"
>
<el-table-column
v-for="(item, index) in table"
:key="index"
:width="item.width"
:label="item.title"
:prop="item.key"
:show-overflow-tooltip="item['show-overflow-tooltip']"
header-align="center"
:align="item.align"
:formatter="item.formatter"
/>
</el-table>
</div>
</div>
</el-card>
</template>
<script>
import ElementResize from 'element-resize-detector'
import { defaultModalSize } from '@/settings'
export default {
name: 'Overtime',
components: {
},
props: {
myData: {
type: Array,
default: () => {
return []
}
}
},
layout: {
x: 8.5,
y: 8,
w: 3.5,
h: 11,
i: 'Overtime',
name: '今日加班情况',
data_id:'jiabanListToday',
data:null
},
data() {
return {
defaultModalSize,
tableHeight: 120,
list: [],
total: 0,
table: [
{
title: '人员',
key: 'flow.creator.name',
width: 100,
align: 'left',
},
{
title: '原因',
key: 'yuanyinshuoming',
align: 'left',
'show-overflow-tooltip': true,
minWidth: 200
},
{
title: '时间',
key: 'kaishiriqi',
align: 'left',
'show-overflow-tooltip': true,
width: 140
}
]
}
},
computed: {},
watch: {
myData(newval) {
console.log('newval', newval)
this.list = newval
},
},
created() {
},
beforeDestroy() {
},
mounted() {
this.init()
},
methods: {
init() {
const cardDom = document.getElementById('overtime-card')
const cardTitleH = 59
const elementResize = ElementResize({
strategy: 'scroll'
})
elementResize.listenTo(cardDom, (ele) => {
this.tableHeight =
cardDom.getBoundingClientRect().height -
40 -
cardTitleH
})
},
}
}
</script>
<style scoped lang="scss">
::v-deep .el-card__body {
width: 100%;
height: calc(100% - 58px);
}
::v-deep .el-table th,::v-deep .el-table td {
border-bottom-style: dashed;
}
.clearfix {
display: flex;
align-items: center;
}
::v-deep .vxe-modal--content {
padding: 0;
}
</style>