|
|
@@ -27,11 +27,11 @@
|
|
|
<el-table-column type="selection" :selectable="selectable" width="55" align="center" fixed
|
|
|
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">
|
|
|
<el-table-column :align="item.align ?? 'center'" :min-width="120" :width="item.width"
|
|
|
- :label="$t(item.formatLabel ? item.formatLabel() : 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">
|
|
|
<template #default="{ row, $index }">
|
|
|
<slot :name="item.field" :row="row" :value="row[item.field]" :index="$index">
|
|
|
@@ -57,6 +57,7 @@
|
|
|
import { defineComponent, shallowRef, PropType } from 'vue'
|
|
|
import { handleNoneValue } from '@/filters'
|
|
|
import AppTableSetting from '../table-setting/index.vue'
|
|
|
+import { i18n } from '@/stores';
|
|
|
|
|
|
export default defineComponent({
|
|
|
inheritAttrs: false,
|
|
|
@@ -90,6 +91,8 @@ export default defineComponent({
|
|
|
const refresh = () => emit('refresh')
|
|
|
const updateColumn = (value: Model.TableColumn[]) => emit('update:columns', value)
|
|
|
|
|
|
+ const { global: { t } } = i18n
|
|
|
+
|
|
|
// 当某一行被勾选时触发的事件
|
|
|
const onSelect = (selection: unknown[], currentRow: unknown) => {
|
|
|
const el = tableRef.value
|
|
|
@@ -166,6 +169,7 @@ export default defineComponent({
|
|
|
handleValue,
|
|
|
refresh,
|
|
|
updateColumn,
|
|
|
+ t
|
|
|
}
|
|
|
},
|
|
|
})
|