优化更新
This commit is contained in:
@@ -181,23 +181,23 @@ export function getDictItemByCode(code) {
|
||||
```typescript
|
||||
// src/views/system/param/columns.ts
|
||||
{
|
||||
label: '参数类型',
|
||||
prop: 'type',
|
||||
title: '参数类型',
|
||||
key: 'type',
|
||||
width: 100,
|
||||
render(record) {
|
||||
return h(ElTag,
|
||||
{ type: record.row.type == 0 ? 'primary' : 'warning' },
|
||||
{ default: () => record.row.type == 0 ? '系统' : '业务' });
|
||||
return h(NTag,
|
||||
{ bordered: false, type: record.type == 0 ? 'info' : 'warning' },
|
||||
{ default: () => record.type == 0 ? '系统' : '业务' });
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
prop: 'status',
|
||||
title: '状态',
|
||||
key: 'status',
|
||||
width: 100,
|
||||
render(record) {
|
||||
return h(ElTag,
|
||||
{ type: record.row.status == 1 ? 'success' : 'danger' },
|
||||
{ default: () => record.row.status == 1 ? '正常' : '禁用' });
|
||||
return h(NTag,
|
||||
{ bordered: false, type: 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)" />
|
||||
// n-select 的 options 中 value 为字符串,后端需要数字时需转换
|
||||
// options: [{ label: '业务', value: 1 }] 直接使用数字
|
||||
```
|
||||
|
||||
搜索表单中的 `options` 的 `value` 为字符串 `'0'`/`'1'`,后端筛选字段期望数字。前端 API 传参时自动转换。
|
||||
|
||||
@@ -55,13 +55,13 @@ class ExampleAddView(PermissionRequired, View):
|
||||
|
||||
```vue
|
||||
<!-- src/views/system/position/index.vue -->
|
||||
<el-button type="primary" @click="handleAdd" v-perm="['sys:position:add']">
|
||||
<n-button type="primary" @click="handleAdd" v-perm="['sys:position:add']">
|
||||
添加岗位
|
||||
</el-button>
|
||||
<el-button type="danger" @click="handleDelete()" :disabled="!selectionData.length"
|
||||
</n-button>
|
||||
<n-button type="danger" @click="handleDelete()" :disabled="!selectionData.length"
|
||||
v-perm="['sys:position:batchDelete']">
|
||||
删除
|
||||
</el-button>
|
||||
</n-button>
|
||||
```
|
||||
|
||||
### TableAction auth 属性
|
||||
|
||||
@@ -157,7 +157,7 @@ location /uploads/ {
|
||||
```
|
||||
|
||||
:::tip 温馨提示
|
||||
后端的文件访问地址需要与前端 `DJANGO_FILE_URL` 配置一致。开发环境为 `http://file.django.elevue`,生产环境需要配置为实际的文件服务域名。
|
||||
后端的文件访问地址需要与前端 `DJANGO_FILE_URL` 配置一致。开发环境为 `http://file.django.naivevue`,生产环境需要配置为实际的文件服务域名。
|
||||
:::
|
||||
|
||||
## 总结
|
||||
|
||||
Reference in New Issue
Block a user