From 6fcb00f27e80b38cea4ccb059112ad7cf99d8745 Mon Sep 17 00:00:00 2001 From: baoshiwei <baoshiwei@shlanbao.cn> Date: 星期五, 25 十月 2024 15:18:22 +0800 Subject: [PATCH] 新增干草配方历史功能模块 --- src/views/dry/dataDefine/DryHerbFormula.data.ts | 222 ++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 155 insertions(+), 67 deletions(-) diff --git a/src/views/dry/dataDefine/DryHerbFormula.data.ts b/src/views/dry/dataDefine/DryHerbFormula.data.ts index 2cd5ccd..20c04a9 100644 --- a/src/views/dry/dataDefine/DryHerbFormula.data.ts +++ b/src/views/dry/dataDefine/DryHerbFormula.data.ts @@ -1,4 +1,7 @@ import { BasicColumn, FormSchema } from '/@/components/Table' +import {render} from "/@/utils/common/renderUtils"; +import {rules} from "/@/utils/helper/validator"; +import {queryById} from "/@/views/dry/api/DryHerbInfo.api" //鍒楄〃鏁版嵁 export const columns: BasicColumn[] = [ { @@ -6,16 +9,24 @@ align: 'center', dataIndex: 'herbId_dictText', }, - // { - // title: '鑽潗鍚嶇О', - // align: 'center', - // dataIndex: 'herbName', - // }, + { + title: '閰嶆柟鍚嶇О', + align: 'center', + dataIndex: 'name', + }, { title: '閫傜敤璁惧', align: 'center', dataIndex: 'eqpType_dictText', }, + { + title: '閰嶆柟鍒嗙被', + align: 'center', + dataIndex: 'category', + customRender: ({ text }) => { + return render.renderDict(text, 'formula_category'); + }, + }, { title: '鐩爣鍚按鐜�', align: 'center', @@ -36,26 +47,41 @@ align: 'center', dataIndex: 'windTemp', }, - { - title: '鐜娓╁害', - align: 'center', - dataIndex: 'envTemp', - }, - { - title: '鐜婀垮害', - align: 'center', - dataIndex: 'envHum', - }, + { + title: '椋庢満鍒濆棰戠巼', + align: 'center', + dataIndex: 'fanSpeed', + }, + // { + // title: '鐜娓╁害', + // align: 'center', + // dataIndex: 'envTemp', + // }, + // { + // title: '鐜婀垮害', + // align: 'center', + // dataIndex: 'envHum', + // }, { title: '鑽℃枡寤舵椂ms', align: 'center', dataIndex: 'delay', }, - { - title: '缈绘枡娆℃暟', - align: 'center', - dataIndex: 'turn', - }, + // { + // title: '缈绘枡娆℃暟', + // align: 'center', + // dataIndex: 'turn', + // }, + { + title: '鍚按鐜囪ˉ鍋�', + align: 'center', + dataIndex: 'moisOffset', + }, + { + title: '鍐烽鏃堕暱', + align: 'center', + dataIndex: 'coolingDuration', + }, // { // title: '绉熸埛id', // align: 'center', @@ -69,7 +95,7 @@ field: 'herbId', component: 'JSearchSelect', componentProps: { - dict: 'dry_herb,name,id', + dict: 'dry_herb_info,name,id', }, colProps: { span: 6 }, }, @@ -80,18 +106,31 @@ label: '鑽潗', field: 'herbId', component: 'JSearchSelect', - componentProps: { - dict: 'dry_herb,name,id', + componentProps: ({formModel})=>{ + return { + dict: 'dry_herb_info,name,id', + onChange: e => { + let param = { + id: e, + } + queryById(param).then(res => { + formModel.name = res.name + }) + }, + } }, dynamicRules: ({ model, schema }) => { return [{ required: true, message: '璇烽�夋嫨鑽潗!' }] }, }, - // { - // label: '鑽潗鍚嶇О', - // field: 'herbName', - // component: 'Input', - // }, + { + label: '閰嶆柟鍚嶇О', + field: 'name', + component: 'Input', + dynamicRules: ({ model, schema }) => { + return [{ required: true, message: '璇疯緭鍏ラ厤鏂瑰悕绉�!' }, { ...rules.duplicateCheckRule('dry_herb_formula', 'name', model, schema)[0] }] + }, + }, { label: '璁惧绫诲瀷', field: 'eqpType', @@ -103,6 +142,16 @@ return [{ required: true, message: '璇疯澶囪澶囩被鍨�!' }] }, }, + { + label: '閰嶆柟鍒嗙被', + field: 'category', + component: 'JDictSelectTag', + componentProps: { + dictCode: 'formula_category', + placeholder: '璇烽�夋嫨閰嶆柟鍒嗙被', + stringToNumber: true, + }, + }, { label: '鐩爣鍚按鐜�', field: 'target', @@ -155,32 +204,45 @@ } }, }, - { - 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: 'fanSpeed', + component: 'Input', + dynamicRules: ({ model, schema }) => { + return [{ required: false }, { pattern: /^-?\d+\.?\d*$/, message: '璇疯緭鍏ユ暟瀛�!' }] + }, + renderComponentContent: () => { + return { + suffix: () => 'Hz', + } + }, + }, + // { + // 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', @@ -194,19 +256,45 @@ } }, }, - { - label: '缈绘枡娆℃暟', - field: 'turn', - component: 'Input', - dynamicRules: ({ model, schema }) => { - return [{ required: false }, { pattern: /^-?\d+\.?\d*$/, message: '璇疯緭鍏ユ暟瀛�!' }] - }, - renderComponentContent: () => { - return { - suffix: () => '娆�', - } - }, - }, + // { + // 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: 'coolingDuration', + component: 'Input', + dynamicRules: ({ model, schema }) => { + return [{ required: false }, { pattern: /^-?\d+\.?\d*$/, message: '璇疯緭鍏ユ暟瀛�!' }] + }, + renderComponentContent: () => { + return { + suffix: () => 'min', + } + }, + }, // TODO 涓婚敭闅愯棌瀛楁锛岀洰鍓嶅啓姝讳负ID { label: '', -- Gitblit v1.9.3