extraFile

This commit is contained in:
Xu Chang 2022-05-16 11:59:10 +08:00
parent 1833da49d2
commit a2260d07a0
4 changed files with 22 additions and 5 deletions

View File

@ -1,7 +1,7 @@
import { String, Int, Text, Image } from 'oak-domain/lib/types/DataType';
import { EntityShape } from 'oak-domain/lib/types/Entity';
import { FileCarrierEntityShape } from 'oak-domain/lib/types/Entity';
export interface Schema extends EntityShape {
export interface Schema extends FileCarrierEntityShape {
origin: 'qiniu' | 'unknown';
type: 'image' | 'pdf' | 'video' | 'audio' | 'file';
bucket: String<16>;

View File

@ -1,5 +1,5 @@
import { MakeOakComponent, MakeOakPage } from 'oak-frontend-base';
import { EntityDict } from 'oak-app-domain/EntityDict';
import { EntityDict } from 'oak-app-domain';
import { GeneralRuntimeContext } from '../RuntimeContext';
import aspectDict from '../aspects';
import { initialize } from '../features';

View File

@ -77,7 +77,7 @@
"node_modules",
"**/*.spec.ts",
"test",
"scripts",
"wechatMp"
"scripts",/*
"wechatMp" */
]
}

View File

@ -0,0 +1,17 @@
import { WechatMpFileCarrier } from 'oak-frontend-base';
OakComponent({
entity: 'extraFile',
formData: async (_rows, _features, _fileCarrier) => {
return {
name: 1,
}
}
}, {
methods: {
async onFilePicked() {
const fileCarrier = new WechatMpFileCarrier();
this.setFileCarrier(fileCarrier);
}
}
});