字典缓存
This commit is contained in:
@@ -40,10 +40,9 @@
|
||||
</div>
|
||||
|
||||
<!-- customTemplate 自定义模板 -->
|
||||
<div
|
||||
v-if="field.render == 'customTemplate'"
|
||||
v-html="field.customTemplate ? field.customTemplate(row, field, fieldValue, column, index) : ''"
|
||||
></div>
|
||||
<div v-if="field.render == 'customTemplate'">
|
||||
{{ field.customTemplate ? field.customTemplate(row, field, fieldValue, column, index) : '' }}
|
||||
</div>
|
||||
|
||||
<!-- 自定义组件/函数渲染 -->
|
||||
<component
|
||||
@@ -143,21 +142,22 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, inject } from 'vue'
|
||||
import type { TagProps, TableColumnCtx } from 'element-plus'
|
||||
import type { TagProps } from 'element-plus'
|
||||
import type TableStoreClass from '@/utils/tableStore'
|
||||
import { fullUrl, timeFormat } from '@/utils/common'
|
||||
import { VxeColumnProps } from 'vxe-table/types/all'
|
||||
const TableStore = inject('tableStore') as TableStoreClass
|
||||
|
||||
interface Props {
|
||||
row: TableRow
|
||||
field: TableColumn
|
||||
column: TableColumnCtx<TableRow>
|
||||
column: VxeColumnProps
|
||||
index: number
|
||||
}
|
||||
const props = defineProps<Props>()
|
||||
|
||||
// 字段值(单元格值)
|
||||
const fieldName = ref(props.field.prop)
|
||||
const fieldName = ref(props.field.field)
|
||||
const fieldValue = ref(fieldName.value ? props.row[fieldName.value] : '')
|
||||
if (fieldName.value && fieldName.value.indexOf('.') > -1) {
|
||||
let fieldNameArr = fieldName.value.split('.')
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
:border="true"
|
||||
v-loading="tableStore.table.loading"
|
||||
stripe
|
||||
size="small"
|
||||
@checkbox-change="onSelectionChange"
|
||||
v-bind="$attrs"
|
||||
:column-config="{resizable: true}"
|
||||
@@ -95,8 +96,8 @@ const pageSizes = computed(() => {
|
||||
/*
|
||||
* 记录选择的项
|
||||
*/
|
||||
const onSelectionChange = (selection: TableRow[]) => {
|
||||
tableStore.onTableAction('selection-change', selection)
|
||||
const onSelectionChange = (selection: any) => {
|
||||
// tableStore.onTableAction('selection-change', selection)
|
||||
}
|
||||
|
||||
const getRef = () => {
|
||||
|
||||
Reference in New Issue
Block a user