表格 状态添加tag

This commit is contained in:
qianlishi
2025-01-10 16:51:20 +08:00
parent 903803dfde
commit f298ba6dc9
2 changed files with 19 additions and 4 deletions

View File

@@ -3,7 +3,7 @@
* @Author: qianlishi
* @Date: 2025-01-03 01:01:14
* @LastEditors: qianlishi
* @LastEditTime: 2025-01-10 16:47:20
* @LastEditTime: 2025-01-10 16:49:28
*/
import { computed, h } from 'vue';
import { cloneDeep } from 'lodash-es';

View File

@@ -3,13 +3,13 @@
* @Author: qianlishi
* @Date: 2025-01-03 01:01:14
* @LastEditors: qianlishi
* @LastEditTime: 2025-01-10 14:44:28
* @LastEditTime: 2025-01-10 16:51:16
*/
import { computed, h } from 'vue';
import { cloneDeep } from 'lodash-es';
import { isObject } from '@/utils/is';
import { NButton } from 'naive-ui'
import { editFormShow } from '@/enums/common'
import { NButton, NTag } from 'naive-ui'
import { editFormShow, enable } from '@/enums/common'
import { FormSchema } from '@/components/Base/Jsq-crud/src/components/Jsq-searchForm';
// 表单配置
@@ -249,6 +249,21 @@ export const getTableColumns = ({ updateClick, removeSingle }) => {
title: '启用状态',
key: 'enableFlag',
align: 'center',
render(row) {
return h(
NTag,
{
style: {
marginRight: '6px'
},
type: row.enableFlag ? 'success' : 'error',
bordered: false
},
{
default: () => enable[row.enableFlag]
}
)
}
},
{
title: '最后一次登陆时间',