import {upcloud_base_wh,upcloud_base_common} from "@/config/serviceSettings";
// 货位 ——> 依赖 逻辑区

export const warehouseLocator = {

    remoteUrl: { url: upcloud_base_wh+'/locator/page', method: 'get' },

    // 组件用于form组件时，隐藏表单项含id code
    items: [
        { hidden: true, type: 'input', name: 'warehouseLocatorId', label: 'ID', value: '' },
        { hidden: true, type: 'input', name: 'warehouseLocatorCode', label: '编码', value: '' },
    ],

    // seach-modal配置
    defSearchConfig: {
        name: 'warehouseLocatorName',
        label: '货位',
        title: '货位',
        value: '',
        rowKey: 'warehouseLocatorId',
        destroyOnClose: true,
        targetClick: true,
        targetValueKey: 'warehouseLocatorName',
    },

    // modal的搜索栏
    defToolBar: {
        items: [
            { type: 'input', name: 'warehouseLocatorName', label: '货位名称', value: '' },
            { type: 'input', name: 'warehouseLocatorCode', label: '货位编码', value: '' }
        ]
    },

    // modal的table配置
    defTableCol: [
        { dataIndex: 'warehouseLocatorId', title: 'ID', hidden: true },
        { dataIndex: 'warehouseLocatorName', title: '货位名称' },
        { dataIndex: 'warehouseLocatorCode', title: '货位编码' },
        {
            dataIndex: 'warehouseLocatorType', title: '货位类型',
            remoteUrl: { url: upcloud_base_common+'/dict/listbytype?dicttypeCodes=wms_loctype', method: 'post' },
            replaceFields: {
                value: 'dictCode',
                label: 'dictName'
            }
        }
    ]

};

