fix
This commit is contained in:
parent
5029cc48d8
commit
101c439ef0
|
|
@ -19,6 +19,8 @@ export const FieldUploadSingle: FC<{
|
|||
on_change: (e: any) => void | Promise<void>;
|
||||
}> = ({ field, fm, prop, on_change, arg }) => {
|
||||
const styling = arg.upload_style ? arg.upload_style : "full";
|
||||
const disabled =
|
||||
typeof field.disabled === "function" ? field.disabled() : field.disabled;
|
||||
let value: any = fm.data[field.name];
|
||||
// let type_upload =
|
||||
const input = useLocal({
|
||||
|
|
@ -142,7 +144,7 @@ export const FieldUploadSingle: FC<{
|
|||
`
|
||||
)}
|
||||
>
|
||||
{!isEditor && (
|
||||
{!isEditor && !disabled && (
|
||||
<input
|
||||
ref={(ref) => (input.ref = ref)}
|
||||
type="file"
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@ export const MasterDetail: FC<MDProps> = (arg) => {
|
|||
const pk = fields.find((e) => e.is_pk);
|
||||
md.pk = pk;
|
||||
md.params.parse();
|
||||
|
||||
if (pk) {
|
||||
const value = md.params.hash[md.name];
|
||||
if (!value && md.selected && Object.keys(md.selected).length === 0) {
|
||||
|
|
|
|||
|
|
@ -80,6 +80,15 @@ export const masterDetailApplyParams = (md: MDLocal) => {
|
|||
}
|
||||
};
|
||||
|
||||
const cleanHash = (hash: string) => {
|
||||
return hash
|
||||
.split("#")
|
||||
.filter(function (value, index, self) {
|
||||
return self.indexOf(value) === index;
|
||||
})
|
||||
.join("#");
|
||||
};
|
||||
|
||||
export const breadcrumbPrefix = (md: MDLocal) => {
|
||||
let prefix: (BreadItem & { url: string })[] = [];
|
||||
if (md.params.links && md.params.links.length > 0) {
|
||||
|
|
@ -100,14 +109,14 @@ export const breadcrumbPrefix = (md: MDLocal) => {
|
|||
|
||||
const hashIndex = hashes.indexOf(link.hash);
|
||||
const link_hashes = hashes.slice(0, hashIndex).join("+");
|
||||
const lnk = link_hashes ? `#lnk=${link_hashes}` : ``;
|
||||
let lnk = link_hashes ? `#lnk=${link_hashes}` : ``;
|
||||
|
||||
if (p.md) {
|
||||
url = `${p.url || link.url}#${p.md.name}=${p.md.value}${lnk}`;
|
||||
} else {
|
||||
url = `${p.url || link.url}${lnk}`;
|
||||
lnk = `#${p.md.name}=${p.md.value}${lnk}`;
|
||||
}
|
||||
|
||||
url = `${p.url || link.url}${cleanHash(lnk)}`;
|
||||
|
||||
if (url) {
|
||||
navigate(url);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue