文件上传功能添加,注意使用Path.Combine处理通用路径问题(windows||docker)
This commit is contained in:
1 parent
7817c5374c
commit
244b59a3fb
135 files changed
+16937
-75
No files matched your search
@@ -0,0 +1,34 @@
|
||||
import { SelectOption } from "@/data/auto/selectOption";
|
||||
import fileTypePolicyService from "@/service/master/fileTypePolicyService";
|
||||
import { storage } from "@/store/storage";
|
||||
|
||||
export const useFileTypePolicy = () => {
|
||||
const fileTypePolicy = "x-fileTypePolicy";
|
||||
|
||||
const getSelectOption = async (blank: boolean): Promise<SelectOption[]> => {
|
||||
let selectOptions: SelectOption[] = [];
|
||||
let str = storage.get(fileTypePolicy);
|
||||
if (str === null) {
|
||||
selectOptions = await fileTypePolicyService.FindSelectOption(blank);
|
||||
storage.set(fileTypePolicy, JSON.stringify(selectOptions));
|
||||
return selectOptions;
|
||||
}
|
||||
|
||||
selectOptions = JSON.parse(str) as Array<SelectOption>;
|
||||
return selectOptions;
|
||||
};
|
||||
|
||||
const GetComposeMessage = (value: string): string => {
|
||||
let selectOptions: SelectOption[] = [];
|
||||
let str = storage.get(fileTypePolicy);
|
||||
if (str === null) {
|
||||
return '';
|
||||
}
|
||||
selectOptions = JSON.parse(str) as Array<SelectOption>;
|
||||
return selectOptions.filter((x:SelectOption) => x.BindValue === value)[0].DisplayName;
|
||||
};
|
||||
return {
|
||||
getSelectOption,
|
||||
GetComposeMessage,
|
||||
};
|
||||
};
|
||||
Reference in new issue
Block a user