#
vincentlu
昨天 9f658fb63d1c219ae65ffcf13af6efbff5179b00
#
4个文件已修改
45 ■■■■■ 已修改文件
zy-acs-flow/src/i18n/en.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/i18n/zh.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/page/loc/LocList.jsx 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/page/loc/compDirect.js 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/i18n/en.js
@@ -343,9 +343,9 @@
                locNo: "loc No.",
                name: "name",
                code: "code",
                compDirect: "code direct",
                compDirect: "actuator direction",
                locSts: "loc sts",
                offset: "offset",
                offset: "height",
                row: "row",
                bay: "bay",
                lev: "lev",
zy-acs-flow/src/i18n/zh.js
@@ -343,9 +343,9 @@
                locNo: "库位号",
                name: "名称",
                code: "地面码",
                compDirect: "码方向",
                compDirect: "货叉方向",
                locSts: "库位状态",
                offset: "偏移量",
                offset: "高度",
                row: "排",
                bay: "列",
                lev: "层",
zy-acs-flow/src/page/loc/LocList.jsx
@@ -68,6 +68,7 @@
}));
const filters = [
    <SearchInput source="condition" alwaysOn />,
    <TextInput source="locNo" label="table.field.loc.locNo" alwaysOn />,
    <ReferenceInput source="locSts" label="table.field.loc.locSts" reference="locSts" alwaysOn>
        <AutocompleteInput label="table.field.loc.locSts" optionText="name" filterToQuery={(val) => ({ name: val })} />
@@ -75,8 +76,7 @@
    <NumberInput source="row" label="table.field.loc.row" alwaysOn />,
    <NumberInput source="bay" label="table.field.loc.bay" alwaysOn />,
    <NumberInput source="lev" label="table.field.loc.lev" alwaysOn />,
    <SearchInput source="condition" alwaysOn />,
    <ReferenceInput source="code" label="table.field.loc.code" reference="code" alwaysOn>
    <ReferenceInput source="code" label="table.field.loc.code" reference="code">
        <AutocompleteInput label="table.field.loc.code" optionText="data" filterToQuery={(val) => ({ data: val })} />
    </ReferenceInput>,
    <DateInput label='common.time.after' source="timeStart" />,
@@ -158,7 +158,8 @@
                    rowClick={(id, resource, record) => false}
                    expand={() => <LocPanel />}
                    expandSingle={true}
                    omit={['id', 'locType', 'uuid', 'statusBool', 'updateBy', 'createTime', 'createBy', 'memo']}
                    omit={['id', 'locType', 'uuid', 'zpallet', 'barcode'
                        , 'statusBool', 'updateBy', 'createTime', 'createBy', 'memo']}
                    rowSx={rowSx(drawerVal || null)}
                >
                    <NumberField source="id" />
@@ -172,11 +173,6 @@
                    <ReferenceField source="code" label="table.field.loc.code" reference="code" link={false} sortable={false}>
                        <TextField source="data" />
                    </ReferenceField>
                    <FunctionField
                        label="table.field.loc.compDirect"
                        sortable={false}
                        render={(record) => getCompDirectLabel(translate, record?.compDirect)}
                    />
                    <ReferenceField source="locSts" label="table.field.loc.locSts" reference="locSts" link={false} sortable={true}>
                        <TextField source="name" />
                    </ReferenceField>
@@ -184,6 +180,11 @@
                    <NumberField source="bay" label="table.field.loc.bay" />
                    <NumberField source="lev" label="table.field.loc.lev" />
                    <NumberField source="offset" label="table.field.loc.offset" />
                    <FunctionField
                        label="table.field.loc.compDirect"
                        sortable={false}
                        render={(record) => getCompDirectLabel(translate, record?.compDirect)}
                    />
                    <TextField source="barcode" label="table.field.loc.barcode" />
                    <TextField source="zpallet" label="table.field.loc.zpallet" />
                    <ReferenceField source="locType" label="table.field.loc.locType" reference="locType" link={false} sortable={false}>
zy-acs-flow/src/page/loc/compDirect.js
@@ -1,21 +1,15 @@
const compDirectMap = {
    1: 'page.loc.enums.compDirect.left',
    2: 'page.loc.enums.compDirect.right',
    3: 'page.loc.enums.compDirect.forward',
};
export const compDirectChoices = [
    { id: 1, name: compDirectMap[1] },
    { id: 2, name: compDirectMap[2] },
    { id: 3, name: compDirectMap[3] },
    { id: 1, name: 'page.loc.enums.compDirect.left' },
    { id: 2, name: 'page.loc.enums.compDirect.right' },
    { id: 3, name: 'page.loc.enums.compDirect.forward' },
];
export const getCompDirectLabel = (translate, compDirect, fallback = '-') => {
    const key = compDirectMap[compDirect];
    if (!key) {
    const choice = compDirectChoices.find((item) => item.id === compDirect);
    if (!choice) {
        return fallback;
    }
    return typeof translate === 'function'
        ? translate(key, { _: fallback })
        : key;
        ? translate(choice.name, { _: fallback })
        : choice.name;
};