<template>
|
<!-- <el-table :data="tableData" border>
|
<slot name="column" ></slot>
|
</el-table> -->
|
<FYTable @search="onSearch" ref="tableRef">
|
<template #table-column>
|
<el-table-column prop="pmName" label="处罚名称" show-overflow-tooltip width="170px" />
|
<el-table-column prop="pmTime" label="时间" :formatter="timeFormatter" width="145px" />
|
<el-table-column prop="pmReason" label="原因" show-overflow-tooltip width="300px"/>
|
<el-table-column prop="pmResult" label="结果" show-overflow-tooltip width="130px" />
|
<el-table-column prop="pmDepartment" label="部门" width="250px" />
|
<el-table-column prop="pmBasis" label="Address" />
|
<el-table-column prop="pmSceneId" label="pmSceneId" width="150px"/>
|
<el-table-column prop="pmExtension1" label="pmExtension1" width="120px" />
|
<el-table-column prop="pmExtension2" label="pmExtension2" width="120px" />
|
<el-table-column prop="pmExtension3" label="pmExtension3" width="120px" />
|
<el-table-column prop="pmRemark" label="pmRemark" width="100px"/>
|
<el-table-column fixed="right" align="right" label="操作" width="160">
|
<template #header>
|
<el-button icon="DocumentAdd" size="default" type="success" @click="add"
|
>新增</el-button
|
>
|
</template>
|
<template #default="scope">
|
<el-button
|
type="primary"
|
size="small"
|
@click="look(scope)"
|
>查看</el-button
|
>
|
</template>
|
</el-table-column>
|
</template>
|
</FYTable>
|
</template>
|
|
<script>
|
import dayjs from 'dayjs';
|
import { useDrawer } from '@/composables/drawer.js';
|
export default {
|
props: {
|
tableData: {
|
type: Array,
|
default() {
|
return [];
|
}
|
}
|
},
|
emits: ['newlyAdd','look'],
|
data() {
|
return {};
|
},
|
setup() {
|
const { drawer,openDrawer, closeDrawer } = useDrawer();
|
return { drawer, openDrawer, closeDrawer };
|
},
|
mounted() {
|
this.search();
|
},
|
methods: {
|
onSearch(page, func) {
|
func({
|
data: this.tableData,
|
total: this.tableData.length
|
});
|
},
|
search() {
|
this.$nextTick(() => {
|
this.$refs.tableRef.onSearch();
|
});
|
},
|
timeFormatter(row, column, cellValue) {
|
return dayjs(cellValue).format('YYYY-MM-DD HH:mm:ss');
|
},
|
|
add(){
|
this.$emit('newlyAdd')
|
},
|
look(scope){
|
this.$emit('look',scope.row)
|
}
|
}
|
};
|
</script>
|
|
<style scoped></style>
|