extraFile支持非必填
This commit is contained in:
parent
960681a2e8
commit
88f7178ef2
|
|
@ -29,11 +29,11 @@ export default OakComponent({
|
|||
type: 'primary',
|
||||
executeText: '',
|
||||
buttonProps: {},
|
||||
afterCommit: () => {},
|
||||
afterCommit: () => { },
|
||||
beforeCommit: (() => true) as () => boolean | undefined | Promise<boolean | undefined>,
|
||||
},
|
||||
methods: {
|
||||
getEfIds() {
|
||||
getEfIds(strict?: boolean) {
|
||||
const { efPaths } = this.props;
|
||||
const { oakFullpath } = this.state;
|
||||
assert(efPaths && efPaths.length > 0);
|
||||
|
|
@ -45,13 +45,15 @@ export default OakComponent({
|
|||
: oakFullpath;
|
||||
const data =
|
||||
this.features.runningTree.getFreshValue(path2);
|
||||
assert(
|
||||
data,
|
||||
`efPath为${path}的路径上取不到extraFile数据,请设置正确的相对路径`
|
||||
);
|
||||
if (strict) {
|
||||
assert(
|
||||
data,
|
||||
`efPath为${path}的路径上取不到extraFile数据,请设置正确的相对路径`
|
||||
);
|
||||
}
|
||||
return (
|
||||
data as EntityDict['extraFile']['OpSchema'][]
|
||||
).map((ele) => ele.id);
|
||||
)?.map((ele) => ele.id);
|
||||
})
|
||||
.flat()
|
||||
.filter((ele) => !!ele) as string[];
|
||||
|
|
@ -60,8 +62,10 @@ export default OakComponent({
|
|||
return [];
|
||||
},
|
||||
async upload() {
|
||||
const ids = this.getEfIds();
|
||||
assert(ids.length > 0);
|
||||
const ids = this.getEfIds(true);
|
||||
if (ids.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const promises: Promise<void>[] = [];
|
||||
ids.forEach((id) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue