| | |
| | | <template> |
| | | <el-table |
| | | :data="currentList" |
| | | style="width: 1158px" |
| | | @selection-change="handleSelectionChange" |
| | | :header-cell-style="{ |
| | | background: '#f3f6fb', |
| | | color: '#666', |
| | |
| | | :highlight-current-row="true" |
| | | empty-text="暂无数据" |
| | | > |
| | | <el-table-column type="index" :index="indexMethod" label="序号" width="80"> |
| | | </el-table-column> |
| | | <el-table-column v-if="multiplechoice" type="selection" width="50" align="center" /> |
| | | <el-table-column label="序号" align="center" key="id" prop="id" /> |
| | | <el-table-column |
| | | v-for="(item, index) in tableLabel" |
| | | :key="index" |
| | |
| | | :formatter="formatData" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="100"> |
| | | <el-table-column |
| | | label="操作" |
| | | align="center" |
| | | width="120" |
| | | class-name="small-padding fixed-width" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" @click.native="$emit('details', scope.row)" |
| | | >查看详情</el-button |
| | | <el-button |
| | | v-if="controlxz" |
| | | size="medium" |
| | | type="text" |
| | | @click.native="$emit('handleUpdate', scope.row)" |
| | | ><span class="button-zx" |
| | | ><i class="el-icon-s-promotion"></i>选择</span |
| | | ></el-button |
| | | > |
| | | <el-button |
| | | v-if="controlsc" |
| | | size="medium" |
| | | type="text" |
| | | @click.native="$emit('details', scope.row)" |
| | | ><span style="color: red" |
| | | ><i class="el-icon-delete"></i>删除</span |
| | | ></el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | |
| | | import dayjs from "dayjs"; |
| | | export default { |
| | | data() { |
| | | return {}; |
| | | return { |
| | | ids: [], |
| | | }; |
| | | }, |
| | | props: { |
| | | currentList: { |
| | |
| | | type: Array, |
| | | default: () => [], |
| | | }, |
| | | currentIndex: { |
| | | type: Number, |
| | | required: true, |
| | | controlsc: { |
| | | type: Boolean, |
| | | default: true, |
| | | }, |
| | | controlxz: { |
| | | type: Boolean, |
| | | default: true, |
| | | }, |
| | | multiplechoice:{ |
| | | type: Boolean, |
| | | default: true, |
| | | } |
| | | |
| | | }, |
| | | created() {}, |
| | | |
| | | methods: { |
| | | indexMethod(index) { |
| | | return parseInt(this.currentIndex) - 9 + index; |
| | | }, |
| | | // 数据过滤 |
| | | formatData(row, column, cellValue) { |
| | | if (column.property === "createType") { |
| | |
| | | return dayjs(cellValue).format("YYYY.MM.DD HH:mm:ss"); |
| | | } |
| | | return cellValue; |
| | | }, |
| | | // 多选框选中数据 |
| | | handleSelectionChange(selection) { |
| | | $emit("handleSelectionChange", selection); |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | box-sizing: border-box; |
| | | } |
| | | </style> |
| | | |