fix
This commit is contained in:
parent
58bd986919
commit
3e09e4b0dd
|
|
@ -147,7 +147,10 @@ export const FieldInput: FC<{
|
|||
className={cx(
|
||||
"field-inner c-flex-1 c-flex c-items-center",
|
||||
field.focused && "focused",
|
||||
disabled && "c-pointer-events-none c-bg-gray-50"
|
||||
disabled && "c-pointer-events-none",
|
||||
disabled &&
|
||||
!["checkbox"].includes(arg.sub_type) &&
|
||||
" c-bg-gray-50"
|
||||
)}
|
||||
>
|
||||
{not_ready ? (
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ export const FieldSingleCheckbox: FC<{
|
|||
list: [] as any[],
|
||||
change_timeout: null as any,
|
||||
});
|
||||
const disabled =
|
||||
typeof field.disabled === "function" ? field.disabled() : field.disabled;
|
||||
const renderOnChange = () => {
|
||||
local.render();
|
||||
if (field.on_change) {
|
||||
|
|
@ -47,6 +49,7 @@ export const FieldSingleCheckbox: FC<{
|
|||
<div className={cx(`c-flex c-flex-col c-space-y-1 c-p-0.5`)}>
|
||||
<div
|
||||
onClick={() => {
|
||||
if(!disabled){
|
||||
fm.data[field.name] = !value;
|
||||
fm.render();
|
||||
if (field.on_change) {
|
||||
|
|
@ -56,6 +59,7 @@ export const FieldSingleCheckbox: FC<{
|
|||
fm,
|
||||
});
|
||||
}
|
||||
}
|
||||
}}
|
||||
className="c-flex c-flex-row c-space-x-1 cursor-pointer c-items-center rounded-full p-0.5"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,9 @@ import { FC } from "react";
|
|||
import { FMLocal, FieldLocal } from "../../typings";
|
||||
import { PropTypeInput } from "./TypeInput";
|
||||
import * as XLSX from "xlsx";
|
||||
|
||||
const w = window as unknown as {
|
||||
serverurl: string
|
||||
}
|
||||
|
||||
export const FieldUpload: FC<{
|
||||
field: FieldLocal;
|
||||
|
|
@ -97,7 +99,7 @@ export const FieldUpload: FC<{
|
|||
let url = siteurl("/_upload");
|
||||
if (location.hostname === 'prasi.avolut.com' || location.host === 'localhost:4550') {
|
||||
const newurl = new URL(location.href);
|
||||
newurl.pathname = `/_proxy/https://julong-dev.avolut.com/_upload`;
|
||||
newurl.pathname = `/_proxy/${w.serverurl}/_upload`;
|
||||
url = newurl.toString();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,61 @@
|
|||
import * as XLSX from "xlsx";
|
||||
import { TableListProp } from "../TableList";
|
||||
import { filterWhere } from "lib/comps/filter/parser/filter-where";
|
||||
import { call_prasi_events } from "lib/exports";
|
||||
|
||||
export const export_excel = async ({
|
||||
list,
|
||||
tbl,
|
||||
on_load,
|
||||
}: {
|
||||
list: TableListProp;
|
||||
tbl: {
|
||||
columns: any[];
|
||||
sort: {
|
||||
columns: any;
|
||||
orderBy: any;
|
||||
};
|
||||
render: () => void;
|
||||
};
|
||||
on_load: () => any;
|
||||
}) => {
|
||||
const where = filterWhere(list.filter_name, list.__props);
|
||||
|
||||
call_prasi_events("tablelist", "where", [list.__props?.gen__table, where]);
|
||||
const orderBy = tbl.sort.orderBy || undefined;
|
||||
const load_args: any = {
|
||||
async reload() {},
|
||||
orderBy,
|
||||
where,
|
||||
paging: {},
|
||||
};
|
||||
if (typeof list.on_load === "function") {
|
||||
const result = await list.on_load({ ...load_args, mode: "query" });
|
||||
const data = [] as any[];
|
||||
const res = [
|
||||
{
|
||||
id: "ff4105af-aa81-4432-847b-1c97fc9eb505",
|
||||
name_goal: "Top Down",
|
||||
definition: null,
|
||||
threshold: 1,
|
||||
description: "Top Down",
|
||||
goal_employee: [
|
||||
{
|
||||
id: "440dd52c-1a18-4b53-b0da-a45f47251f36",
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
const l = document.getElementsByClassName("rdg-row");
|
||||
if (res.length) {
|
||||
res.map((e, id) => {
|
||||
if (tbl.columns.length) {
|
||||
tbl.columns.map((ex, idx) => {
|
||||
const r = null;
|
||||
console.log({ r });
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -67,7 +67,7 @@ export const HeaderProfile = lazify(
|
|||
|
||||
/** charts */
|
||||
export { PieChart } from "@/comps/charts/pie";
|
||||
// export { BarChart } from "@/comps/charts/bar";
|
||||
export { BarChart } from "@/comps/charts/bar";
|
||||
// export { LineChart } from "@/comps/charts/line";
|
||||
|
||||
/** Generator */
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ type MLocal = typeof local_default & { render: () => void };
|
|||
|
||||
export const Menu: FC<MenuProp> = (props) => {
|
||||
const imenu = props.menu;
|
||||
console.log({imenu})
|
||||
let role = props.role;
|
||||
role = props.on_init();
|
||||
let menu = get(imenu, role) || [];
|
||||
|
|
@ -76,10 +77,12 @@ export const SideBar: FC<{
|
|||
parent?: string;
|
||||
}> = ({ data: _data, local, depth, pm, mode, expanded, parent }) => {
|
||||
const PassProp = pm.PassProp;
|
||||
|
||||
w.prasi_menu.pm = pm;
|
||||
w.prasi_menu = {
|
||||
...w.prasi_menu,
|
||||
pm
|
||||
}
|
||||
const data: IMenu[] = (typeof _data[0] === "string" ? [_data] : _data) as any;
|
||||
|
||||
console.log({data})
|
||||
useEffect(() => {
|
||||
data.map((item) => {
|
||||
const menu = {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ export type MenuProp = {
|
|||
item: PrasiItem;
|
||||
style: "navbar" | "sidebar";
|
||||
on_load?: (on_done: (exec: () => void) => void) => void;
|
||||
get_menu?: (mn: Array<Record<string, IMenu[]>>) => Array<Record<string, IMenu[]>>
|
||||
};
|
||||
export type MenuActive = {
|
||||
data: any;
|
||||
|
|
|
|||
Loading…
Reference in New Issue