优化更新
This commit is contained in:
@@ -181,23 +181,23 @@ export function getDictItemByCode(code) {
|
||||
```typescript
|
||||
// src/views/system/param/columns.ts
|
||||
{
|
||||
label: '参数类型',
|
||||
prop: 'type',
|
||||
title: '参数类型',
|
||||
dataIndex: 'type',
|
||||
width: 100,
|
||||
render(record) {
|
||||
return h(ElTag,
|
||||
{ type: record.row.type == 0 ? 'primary' : 'warning' },
|
||||
{ default: () => record.row.type == 0 ? '系统' : '业务' });
|
||||
customRender({ record }) {
|
||||
return h(Tag,
|
||||
{ color: record.type == 0 ? 'blue' : 'warning' },
|
||||
{ default: () => record.type == 0 ? '系统' : '业务' });
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
prop: 'status',
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
width: 100,
|
||||
render(record) {
|
||||
return h(ElTag,
|
||||
{ type: record.row.status == 1 ? 'success' : 'danger' },
|
||||
{ default: () => record.row.status == 1 ? '正常' : '禁用' });
|
||||
customRender({ record }) {
|
||||
return h(Tag,
|
||||
{ color: record.status == 1 ? 'success' : 'error' },
|
||||
{ default: () => record.status == 1 ? '正常' : '禁用' });
|
||||
},
|
||||
},
|
||||
```
|
||||
@@ -218,8 +218,8 @@ const options = [
|
||||
// 业务字段为数字
|
||||
formData.type = 0;
|
||||
|
||||
// el-option 绑定时需要转换
|
||||
<el-option :value="Number(item.value)" />
|
||||
// a-select-option 绑定时需要转换
|
||||
<a-select-option :value="Number(item.value)">{{ item.label }}</a-select-option>
|
||||
```
|
||||
|
||||
搜索表单中的 `options` 的 `value` 为字符串 `'0'`/`'1'`,后端筛选字段期望数字。前端 API 传参时自动转换。
|
||||
|
||||
Reference in New Issue
Block a user