zmc
2023-12-21 635e1b3c0d48c2db884794cb8bc26d6ff1591ffa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<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>