feat: improve code

This commit is contained in:
chenos 2021-09-04 23:31:26 +08:00
parent dde1bd4fc2
commit 1229a10df6
4 changed files with 16 additions and 6 deletions

View File

@ -509,7 +509,7 @@ Upload.Attachment = connect(
>
{file.imageUrl && (
<img
src={file.imageUrl}
src={`${file.imageUrl}?x-oss-process=style/thumbnail`}
alt={file.title}
className="ant-upload-list-item-image"
/>

View File

@ -5,6 +5,14 @@
}
.nb-upload {
.ant-upload-list-item.ant-upload-list-item-list-type-picture-card {
padding: 3px;
}
.ant-upload-list-item-thumbnail {
img {
object-fit: cover;
}
}
.ant-upload-list-item-actions {
left: auto;
right: 4px;

View File

@ -32,10 +32,12 @@ export class Field extends Model {
if (fields.length) {
props['children'] = fields;
}
const uiSchema = await this.getUiSchema();
if (uiSchema) {
// props['uiSchema1'] = uiSchema;
props['uiSchema'] = await uiSchema.toJSONSchema();
if (this.getUiSchema) {
const uiSchema = await this.getUiSchema();
if (uiSchema) {
// props['uiSchema1'] = uiSchema;
props['uiSchema'] = await uiSchema.toJSONSchema();
}
}
return props;
}

View File

@ -1,6 +1,6 @@
import { Model, ModelCtor } from '@nocobase/database';
import { actions, middlewares } from '@nocobase/actions';
import { sort } from '@nocobase/actions/src/actions/common';
import { sort } from '@nocobase/actions/lib/actions/common';
import { cloneDeep, omit } from 'lodash';
export const create = async (ctx: actions.Context, next: actions.Next) => {