checkpoint
This commit is contained in:
parent
61845dc62b
commit
d580b6ccad
|
|
@ -8,6 +8,7 @@ export const masterDetailParseHash = (md: MDLocal) => {
|
||||||
md.params.hash = {};
|
md.params.hash = {};
|
||||||
md.params.tabs = {};
|
md.params.tabs = {};
|
||||||
|
|
||||||
|
let has_detail = false;
|
||||||
for (const h of raw_hash.split("#")) {
|
for (const h of raw_hash.split("#")) {
|
||||||
if (h) {
|
if (h) {
|
||||||
if (h.includes("=")) {
|
if (h.includes("=")) {
|
||||||
|
|
@ -15,6 +16,9 @@ export const masterDetailParseHash = (md: MDLocal) => {
|
||||||
if (tab_name && tab_val) {
|
if (tab_name && tab_val) {
|
||||||
md.params.hash[tab_name] = tab_val;
|
md.params.hash[tab_name] = tab_val;
|
||||||
}
|
}
|
||||||
|
if (tab_name === md.name) {
|
||||||
|
has_detail = true;
|
||||||
|
}
|
||||||
} else if (h.includes("~")) {
|
} else if (h.includes("~")) {
|
||||||
const [tab_name, tab_val] = h.split("~");
|
const [tab_name, tab_val] = h.split("~");
|
||||||
if (tab_name && tab_val) {
|
if (tab_name && tab_val) {
|
||||||
|
|
@ -24,6 +28,10 @@ export const masterDetailParseHash = (md: MDLocal) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!has_detail) {
|
||||||
|
md.selected = null;
|
||||||
|
}
|
||||||
|
|
||||||
md.params.links = md.params.links.filter((e) => e);
|
md.params.links = md.params.links.filter((e) => e);
|
||||||
|
|
||||||
const parsed_link = parseLink();
|
const parsed_link = parseLink();
|
||||||
|
|
@ -69,9 +77,15 @@ export const masterDetailApplyParams = (md: MDLocal) => {
|
||||||
delete md.params.hash[md.name];
|
delete md.params.hash[md.name];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let has_detail = false;
|
||||||
for (const [k, v] of Object.entries(md.params.hash)) {
|
for (const [k, v] of Object.entries(md.params.hash)) {
|
||||||
|
if (k === md.name) {
|
||||||
|
has_detail = true;
|
||||||
|
}
|
||||||
|
|
||||||
hash += `#${k}=${v}`;
|
hash += `#${k}=${v}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const [k, v] of Object.entries(md.params.tabs)) {
|
for (const [k, v] of Object.entries(md.params.tabs)) {
|
||||||
hash += `#${k}~${v}`;
|
hash += `#${k}~${v}`;
|
||||||
}
|
}
|
||||||
|
|
@ -79,16 +93,20 @@ export const masterDetailApplyParams = (md: MDLocal) => {
|
||||||
if (!isEditor) {
|
if (!isEditor) {
|
||||||
location.hash = hash;
|
location.hash = hash;
|
||||||
}
|
}
|
||||||
if(!isEditor){
|
|
||||||
if(md.props.tab_mode === "v-tab" || md.props.tab_mode === "h-tab"){
|
if (!isEditor) {
|
||||||
try{
|
if (md.props.tab_mode === "v-tab" || md.props.tab_mode === "h-tab") {
|
||||||
if(row && md?.childs?.form?.fm && md?.childs?.form?.fm?.status === "ready" && md.selected?.id){
|
try {
|
||||||
|
if (
|
||||||
|
row &&
|
||||||
|
md?.childs?.form?.fm &&
|
||||||
|
md?.childs?.form?.fm?.status === "ready" &&
|
||||||
|
md.selected?.id
|
||||||
|
) {
|
||||||
md.childs.form.fm.reload();
|
md.childs.form.fm.reload();
|
||||||
// console.log("MASUK???")
|
// console.log("MASUK???")
|
||||||
}
|
}
|
||||||
}catch(ex){
|
} catch (ex) {}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,6 @@ export const SheetCn: FC<{
|
||||||
local.render();
|
local.render();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log(typeof onInit)
|
|
||||||
if (typeof onInit === "function") {
|
if (typeof onInit === "function") {
|
||||||
onInit({
|
onInit({
|
||||||
data: local,
|
data: local,
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,9 @@ export const Typeahead = lazify(
|
||||||
);
|
);
|
||||||
|
|
||||||
/** Master - Detail - List - Form */
|
/** Master - Detail - List - Form */
|
||||||
// export const MasterDetail = lazify(
|
export const MasterDetail = lazify(
|
||||||
// async () => (await import("lib/comps/md/MasterDetail")).MasterDetail
|
async () => (await import("lib/comps/md/MasterDetail")).MasterDetail
|
||||||
// );
|
);
|
||||||
export const MDRenderMaster = lazify(
|
export const MDRenderMaster = lazify(
|
||||||
async () => (await import("lib/comps/md/parts/MDMaster")).MDRenderMaster
|
async () => (await import("lib/comps/md/parts/MDMaster")).MDRenderMaster
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import { hashSum } from "lib/utils/hash-sum";
|
||||||
import { getPathname } from "lib/utils/pathname";
|
import { getPathname } from "lib/utils/pathname";
|
||||||
|
|
||||||
const w = window as any;
|
const w = window as any;
|
||||||
|
|
||||||
export const overrideNav = (arg?: { local?: any }) => {
|
export const overrideNav = (arg?: { local?: any }) => {
|
||||||
if (isEditor) return;
|
if (isEditor) return;
|
||||||
if (!w.prasi_menu || arg?.local) {
|
if (!w.prasi_menu || arg?.local) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue