新增:字典管理添加标签颜色功能

pull/57/head
李强 2022-05-11 17:39:35 +08:00
parent 54c63e6443
commit 220896507b
3 changed files with 30 additions and 4 deletions

View File

@ -182,6 +182,7 @@ class Dictionary(CoreModel):
parent = models.ForeignKey(to='self', related_name='sublist', db_constraint=False, on_delete=models.PROTECT,
blank=True, null=True, verbose_name="父级", help_text="父级")
type = models.IntegerField(choices=TYPE_LIST, default=0, verbose_name="数据值类型", help_text="数据值类型")
color = models.CharField(max_length=20, blank=True, null=True, verbose_name="颜色", help_text="颜色")
is_value = models.BooleanField(default=False, verbose_name="是否为value值", help_text="是否为value值,用来做具体值存放")
status = models.BooleanField(default=True, verbose_name="状态", help_text="状态")
sort = models.IntegerField(default=1, verbose_name="显示排序", null=True, blank=True, help_text="显示排序")

View File

@ -18,7 +18,7 @@ export function getButtonSettings (objectSettings) {
return {
label: item.label,
value: item.value,
color: BUTTON_VALUE_TO_COLOR_MAPPING[item.value]
color: item.color || BUTTON_VALUE_TO_COLOR_MAPPING[item.value]
}
})
}

View File

@ -223,9 +223,7 @@ export const crudOptions = (vm) => {
class: { yxtInput: true }
}
}
},
{
}, {
title: '状态',
key: 'status',
width: 80,
@ -264,6 +262,33 @@ export const crudOptions = (vm) => {
class: { yxtInput: true }
}
}
}, {
title: '标签颜色',
key: 'color',
width: 90,
search: {
disabled: true
},
type: 'select',
dict: {
data: [
{ label: 'success', value: 'success', color: 'success' },
{ label: 'primary', value: 'primary', color: 'primary' },
{ label: 'info', value: 'info', color: 'info' },
{ label: 'danger', value: 'danger', color: 'danger' },
{ label: 'warning', value: 'warning', color: 'warning' }
]
},
form: {
component: {
props: {
clearable: true
}
},
itemProps: {
class: { yxtInput: true }
}
}
}
].concat(vm.commonEndColumns({
update_datetime: {