| | |
| | | import {render} from "/@/utils/common/renderUtils"; |
| | | import {rules} from "/@/utils/helper/validator"; |
| | | import {queryById} from "/@/views/dry/api/DryHerbInfo.api" |
| | | import { getFirstWordSpell } from "/@/utils/common/renderUtils"; |
| | | //列表数据 |
| | | export const columns: BasicColumn[] = [ |
| | | { |
| | |
| | | dataIndex: 'eqpType_dictText', |
| | | }, |
| | | { |
| | | title: '配方分类', |
| | | title: '缩写', |
| | | align: 'center', |
| | | dataIndex: 'category', |
| | | customRender: ({ text }) => { |
| | | return render.renderDict(text, 'formula_category'); |
| | | dataIndex: 'abbr', |
| | | }, |
| | | { |
| | | title: '特种物料', |
| | | align: 'center', |
| | | dataIndex: 'special', |
| | | customRender: ({ text }) => { |
| | | return render.renderSwitch(text, [ |
| | | { text: '是', value: 'true' }, |
| | | { text: '否', value: 'false' }, |
| | | ]) |
| | | }, |
| | | }, |
| | | { |
| | | title: '轻质物料', |
| | | align: 'center', |
| | | dataIndex: 'light', |
| | | customRender: ({ text }) => { |
| | | return render.renderSwitch(text, [ |
| | | { text: '是', value: 'true' }, |
| | | { text: '否', value: 'false' }, |
| | | ]) |
| | | }, |
| | | }, |
| | | { |
| | | title: '初始含水率', |
| | | align: 'center', |
| | | dataIndex: 'initial', |
| | | }, |
| | | { |
| | | title: '目标含水率', |
| | |
| | | align: 'center', |
| | | dataIndex: 'fanSpeed', |
| | | }, |
| | | // { |
| | | // title: '环境温度', |
| | | // align: 'center', |
| | | // dataIndex: 'envTemp', |
| | | // }, |
| | | // { |
| | | // title: '环境湿度', |
| | | // align: 'center', |
| | | // dataIndex: 'envHum', |
| | | // }, |
| | | |
| | | { |
| | | title: '荡料延时ms', |
| | | title: '启用翻料策略', |
| | | align: 'center', |
| | | dataIndex: 'delay', |
| | | dataIndex: 'strategy', |
| | | customRender: ({ text }) => { |
| | | return render.renderSwitch(text, [ |
| | | { text: '是', value: 'true' }, |
| | | { text: '否', value: 'false' }, |
| | | ]) |
| | | }, |
| | | // { |
| | | // title: '翻料次数', |
| | | // align: 'center', |
| | | // dataIndex: 'turn', |
| | | // }, |
| | | { |
| | | title: '含水率补偿', |
| | | align: 'center', |
| | | dataIndex: 'moisOffset', |
| | | }, |
| | | |
| | | { |
| | | title: '冷风时长', |
| | | align: 'center', |
| | | dataIndex: 'coolingDuration', |
| | | }, |
| | | // { |
| | | // title: '租户id', |
| | | // align: 'center', |
| | | // dataIndex: 'tenantId', |
| | | // }, |
| | | |
| | | ] |
| | | //查询数据 |
| | | export const searchFormSchema: FormSchema[] = [ |
| | |
| | | } |
| | | queryById(param).then(res => { |
| | | formModel.name = res.name |
| | | if (res.name) { |
| | | const abbr = getFirstWordSpell(res.name); |
| | | formModel.abbr = abbr.toUpperCase(); |
| | | } else { |
| | | formModel.abbr = ''; |
| | | } |
| | | }) |
| | | }, |
| | | } |
| | |
| | | dynamicRules: ({ model, schema }) => { |
| | | return [{ required: true, message: '请输入配方名称!' }, { ...rules.duplicateCheckRule('dry_herb_formula', 'name', model, schema)[0] }] |
| | | }, |
| | | componentProps: ({ formModel }) => { |
| | | return { |
| | | onChange: (e) => { |
| | | const value = e.target.value; |
| | | // 生成拼音首字母并赋值给 abbr 字段 |
| | | if (value) { |
| | | const abbr = getFirstWordSpell(value); |
| | | formModel.abbr = abbr.toUpperCase(); |
| | | } else { |
| | | formModel.abbr = ''; |
| | | } |
| | | } |
| | | }; |
| | | }, |
| | | }, |
| | | |
| | | { |
| | | label: '设备类型', |
| | | field: 'eqpType', |
| | | component: 'JSearchSelect', |
| | | componentProps: { |
| | | dict: 'dry_eqp_type,name,id', |
| | | dict: 'dry_eqp_type,name,id' |
| | | }, |
| | | dynamicRules: ({ model, schema }) => { |
| | | return [{ required: true, message: '请设备设备类型!' }] |
| | | return [{ required: true, message: '请选择设备类型!' }] |
| | | }, |
| | | defaultValue: '1952566592372215810', |
| | | }, |
| | | { |
| | | label: '配方分类', |
| | | field: 'category', |
| | | component: 'JDictSelectTag', |
| | | componentProps: { |
| | | dictCode: 'formula_category', |
| | | placeholder: '请选择配方分类', |
| | | stringToNumber: true, |
| | | label: '首字母缩写', |
| | | field: 'abbr', |
| | | component: 'Input' |
| | | }, |
| | | { |
| | | label: '特种物料', |
| | | field: 'special', |
| | | component: 'Switch', |
| | | defaultValue: false |
| | | }, |
| | | { |
| | | label: '轻质物料', |
| | | field: 'light', |
| | | component: 'Switch', |
| | | defaultValue: false |
| | | }, |
| | | { |
| | | label: '初始含水率', |
| | | field: 'initial', |
| | | component: 'Input', |
| | | dynamicRules: ({ model, schema }) => { |
| | | return [{ required: false }, { pattern: /^-?\d+\.?\d*$/, message: '请输入数字!' }] |
| | | }, |
| | | renderComponentContent: () => { |
| | | return { |
| | | suffix: () => '%', |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | |
| | | } |
| | | }, |
| | | }, |
| | | // { |
| | | // label: '环境温度', |
| | | // field: 'envTemp', |
| | | // component: 'Input', |
| | | // dynamicRules: ({ model, schema }) => { |
| | | // return [{ required: false }, { pattern: /^-?\d+\.?\d*$/, message: '请输入数字!' }] |
| | | // }, |
| | | // renderComponentContent: () => { |
| | | // return { |
| | | // suffix: () => '℃', |
| | | // } |
| | | // }, |
| | | // }, |
| | | // { |
| | | // label: '环境湿度', |
| | | // field: 'envHum', |
| | | // component: 'Input', |
| | | // dynamicRules: ({ model, schema }) => { |
| | | // return [{ required: false }, { pattern: /^-?\d+\.?\d*$/, message: '请输入数字!' }] |
| | | // }, |
| | | // renderComponentContent: () => { |
| | | // return { |
| | | // suffix: () => 'rh', |
| | | // } |
| | | // }, |
| | | // }, |
| | | |
| | | { |
| | | label: '荡料延时', |
| | | field: 'delay', |
| | | component: 'Input', |
| | | dynamicRules: ({ model, schema }) => { |
| | | return [{ required: false }, { pattern: /^-?\d+\.?\d*$/, message: '请输入数字!' }] |
| | | }, |
| | | renderComponentContent: () => { |
| | | return { |
| | | suffix: () => 'ms', |
| | | } |
| | | }, |
| | | }, |
| | | // { |
| | | // label: '翻料次数', |
| | | // field: 'turn', |
| | | // component: 'Input', |
| | | // dynamicRules: ({ model, schema }) => { |
| | | // return [{ required: false }, { pattern: /^-?\d+\.?\d*$/, message: '请输入数字!' }] |
| | | // }, |
| | | // renderComponentContent: () => { |
| | | // return { |
| | | // suffix: () => '次', |
| | | // } |
| | | // }, |
| | | // }, |
| | | { |
| | | label: '含水率补偿', |
| | | field: 'moisOffset', |
| | | component: 'Input', |
| | | dynamicRules: ({ model, schema }) => { |
| | | return [{ required: false }, { pattern: /^-?\d+\.?\d*$/, message: '请输入数字!' }] |
| | | }, |
| | | renderComponentContent: () => { |
| | | return { |
| | | suffix: () => '%', |
| | | } |
| | | }, |
| | | label: '启用翻料策略', |
| | | field: 'strategy', |
| | | component: 'Switch', |
| | | defaultValue: false, |
| | | }, |
| | | { |
| | | label: '冷风时长', |