diff --git a/web/src/components/table/fieldRender/index.vue b/web/src/components/table/fieldRender/index.vue index 414ab659..f076b667 100644 --- a/web/src/components/table/fieldRender/index.vue +++ b/web/src/components/table/fieldRender/index.vue @@ -5,7 +5,7 @@ import type { TagProps } from 'element-plus' import { timeFormat, openUrl } from '/@/components/table' +import useCurrentInstance from '/@/utils/useCurrentInstance' + +const { proxy } = useCurrentInstance() + interface Props { row: TableRow field: TableColumn @@ -76,9 +80,15 @@ const props = withDefaults(defineProps(), { property: '', }) -const changeField = (value: any, type: string, field: keyof TableRow) => { - if (type == 'switch') { - props.row[field] = value +const changeField = (value: any, fieldName: keyof TableRow) => { + if (props.field.render == 'switch') { + props.row[fieldName] = value + proxy.eventBus.emit('onTableFieldChange', { + value: value, + row: props.row, + field: fieldName, + render: props.field.render, + }) } } diff --git a/web/src/views/backend/auth/menu.vue b/web/src/views/backend/auth/menu.vue index 6a182859..8ef27d26 100644 --- a/web/src/views/backend/auth/menu.vue +++ b/web/src/views/backend/auth/menu.vue @@ -121,16 +121,18 @@