|
@@ -27,11 +27,11 @@
|
|
|
<el-table-column type="selection" :selectable="selectable" width="55" align="center" fixed
|
|
<el-table-column type="selection" :selectable="selectable" width="55" align="center" fixed
|
|
|
v-if="selectionType" />
|
|
v-if="selectionType" />
|
|
|
<!-- 序号 -->
|
|
<!-- 序号 -->
|
|
|
- <el-table-column type="index" :label="t('common.orderindex')" align="center" :width="80" v-if="showIndex" />
|
|
|
|
|
|
|
+ <el-table-column type="index" :label="$t('common.orderindex')" align="center" :width="80" v-if="showIndex" />
|
|
|
<!-- 数据列 -->
|
|
<!-- 数据列 -->
|
|
|
<template v-for="(item, index) in columns" :key="index">
|
|
<template v-for="(item, index) in columns" :key="index">
|
|
|
<el-table-column :align="item.align ?? 'center'" :min-width="120" :width="item.width"
|
|
<el-table-column :align="item.align ?? 'center'" :min-width="120" :width="item.width"
|
|
|
- :label="item.formatLabel ? item.formatLabel() : t(item.label ?? '')" :prop="item.field" :fixed="item.fixed || false"
|
|
|
|
|
|
|
+ :label="$t(item.formatLabel ? item.formatLabel() : item.label)" :prop="item.field" :fixed="item.fixed || false"
|
|
|
:sortable="item.sortable" :show-overflow-tooltip="item.field !== 'operate'" v-if="item.show ?? true">
|
|
:sortable="item.sortable" :show-overflow-tooltip="item.field !== 'operate'" v-if="item.show ?? true">
|
|
|
<template #default="{ row, $index }">
|
|
<template #default="{ row, $index }">
|
|
|
<slot :name="item.field" :row="row" :value="row[item.field]" :index="$index">
|
|
<slot :name="item.field" :row="row" :value="row[item.field]" :index="$index">
|
|
@@ -56,7 +56,6 @@
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
|
import { defineComponent, shallowRef, PropType } from 'vue'
|
|
import { defineComponent, shallowRef, PropType } from 'vue'
|
|
|
import { handleNoneValue } from '@/filters'
|
|
import { handleNoneValue } from '@/filters'
|
|
|
-import { i18n } from '@/stores'
|
|
|
|
|
import AppTableSetting from '../table-setting/index.vue'
|
|
import AppTableSetting from '../table-setting/index.vue'
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
@@ -90,7 +89,6 @@ export default defineComponent({
|
|
|
const showTableSetting = shallowRef(false)
|
|
const showTableSetting = shallowRef(false)
|
|
|
const refresh = () => emit('refresh')
|
|
const refresh = () => emit('refresh')
|
|
|
const updateColumn = (value: Model.TableColumn[]) => emit('update:columns', value)
|
|
const updateColumn = (value: Model.TableColumn[]) => emit('update:columns', value)
|
|
|
- const { global: { t } } = i18n
|
|
|
|
|
|
|
|
|
|
// 当某一行被勾选时触发的事件
|
|
// 当某一行被勾选时触发的事件
|
|
|
const onSelect = (selection: unknown[], currentRow: unknown) => {
|
|
const onSelect = (selection: unknown[], currentRow: unknown) => {
|