|
@@ -106,6 +106,9 @@
|
|
"
|
|
"
|
|
>
|
|
>
|
|
<template #[item]="scope" v-for="item in renderSlots">
|
|
<template #[item]="scope" v-for="item in renderSlots">
|
|
|
|
+ <template v-if="scope.column.dataIndex === 'INDEX'">
|
|
|
|
+ {{scope.index + 1}}
|
|
|
|
+ </template>
|
|
<slot
|
|
<slot
|
|
v-if="item && renderTableProps.columns && renderTableProps.columns.length > 0"
|
|
v-if="item && renderTableProps.columns && renderTableProps.columns.length > 0"
|
|
:name="item"
|
|
:name="item"
|
|
@@ -126,6 +129,12 @@
|
|
const route = useRoute()
|
|
const route = useRoute()
|
|
const emit = defineEmits(['expand', 'update:filterParam'])
|
|
const emit = defineEmits(['expand', 'update:filterParam'])
|
|
const renderSlots = Object.keys(slots)
|
|
const renderSlots = Object.keys(slots)
|
|
|
|
+ const tableIndexColumn = {
|
|
|
|
+ title: '序号',
|
|
|
|
+ dataIndex: 'INDEX',
|
|
|
|
+ width: 50,
|
|
|
|
+ align: 'center'
|
|
|
|
+ }
|
|
|
|
|
|
const props = defineProps(
|
|
const props = defineProps(
|
|
Object.assign({}, tableProps(), {
|
|
Object.assign({}, tableProps(), {
|
|
@@ -241,7 +250,7 @@
|
|
watch(
|
|
watch(
|
|
() => props.columns,
|
|
() => props.columns,
|
|
(newVal) => {
|
|
(newVal) => {
|
|
- data.columnsSetting = newVal
|
|
|
|
|
|
+ data.columnsSetting = [tableIndexColumn, ...newVal]
|
|
}
|
|
}
|
|
)
|
|
)
|
|
|
|
|
|
@@ -294,7 +303,7 @@
|
|
}
|
|
}
|
|
// 列设置
|
|
// 列设置
|
|
const columnChange = (v) => {
|
|
const columnChange = (v) => {
|
|
- data.columnsSetting = v
|
|
|
|
|
|
+ data.columnsSetting = [tableIndexColumn, ...v]
|
|
getTableProps()
|
|
getTableProps()
|
|
}
|
|
}
|
|
// 列清空
|
|
// 列清空
|
|
@@ -319,7 +328,7 @@
|
|
})) ||
|
|
})) ||
|
|
false
|
|
false
|
|
data.needTotalList = initTotalList(props.columns)
|
|
data.needTotalList = initTotalList(props.columns)
|
|
- data.columnsSetting = props.columns
|
|
|
|
|
|
+ data.columnsSetting = [tableIndexColumn, ...props.columns]
|
|
loadData()
|
|
loadData()
|
|
}
|
|
}
|
|
|
|
|