export const getSortConfig = function (id = 'sortBy') { return { label: '排序:', id, type: 'input-number', el: { precision: 0, min: 0, }, } } export const getGoodsCategoryListConfig = (checkStrictly = false) => { return { label: '商品分类:', id: 'categoryId', type: 'bus-cascader', el: { otherInterfaceUri: 'flower/api/flower/category/tree', props: { label: 'name', value: 'id', emitPath: false, checkStrictly, }, clearable: true, style: 'width:100%', }, } } export const getGoodsListConfig = () => { return { label: '商品:', id: 'flowerId', type: 'bus-select', el: { interfaceUri: 'flower/api/flower/list', extraQuery: { current: 1, size: 50, status: 'UP', }, props: { label: 'name', value: 'id', dataPath: 'records', queryKey: 'name', }, filterable: true, remote: true, clearable: true, style: 'width:100%', filterOptions: (list) => { return list.map((item) => { item.name = [item.name, item.color, item.levelStr] .filter((i) => !!i) .join(' · ') if (item.supplierName) { item.name += `(${item.supplierName})` } return item }) }, }, } }