From 852e0f0918dc58b616cc81702efbfde3940866bb Mon Sep 17 00:00:00 2001 From: bsw215583320 <baoshiwei121@163.com> Date: 星期二, 16 四月 2024 14:50:43 +0800 Subject: [PATCH] 增加生产分支 --- src/views/dry/dataDefine/DryEqpType.data.ts | 158 +++++++++++++++++++++++++++++++++++----------------- 1 files changed, 106 insertions(+), 52 deletions(-) diff --git a/src/views/dry/dataDefine/DryEqpType.data.ts b/src/views/dry/dataDefine/DryEqpType.data.ts index d350469..c7bbc49 100644 --- a/src/views/dry/dataDefine/DryEqpType.data.ts +++ b/src/views/dry/dataDefine/DryEqpType.data.ts @@ -1,65 +1,119 @@ -import { BasicColumn, FormSchema } from '/@/components/Table'; -import { rules } from '/@/utils/helper/validator'; +import { BasicColumn, FormSchema } from '/@/components/Table' +import { rules } from '/@/utils/helper/validator' //鍒楄〃鏁版嵁 export const columns: BasicColumn[] = [ - { - title: 'code', - align: 'center', - dataIndex: 'code', - }, - { - title: 'name', - align: 'center', - dataIndex: 'name', - }, -]; + { + title: '缂栫爜', + align: 'center', + dataIndex: 'code', + }, + { + title: '鍚嶇О', + align: 'center', + dataIndex: 'name', + }, + { + title: '骞茬嚗鏁堢巼', + align: 'center', + dataIndex: 'dryEfficiency', + }, + { + title: '钂告苯鍧囪��', + align: 'center', + dataIndex: 'steamConsumption', + }, + { + title: '鐢佃兘鍧囪��', + align: 'center', + dataIndex: 'powerConsumption', + }, +] //鏌ヨ鏁版嵁 export const searchFormSchema: FormSchema[] = [ - { - label: 'code', - field: 'code', - component: 'Input', - colProps: { span: 6 }, - }, - { - label: 'name', - field: 'name', - component: 'Input', - colProps: { span: 6 }, - }, -]; + { + label: '缂栫爜', + field: 'code', + component: 'Input', + colProps: { span: 6 }, + }, + { + label: '鍚嶇О', + field: 'name', + component: 'Input', + colProps: { span: 6 }, + }, +] //琛ㄥ崟鏁版嵁 export const formSchema: FormSchema[] = [ - { - label: 'code', - field: 'code', - component: 'Input', - dynamicRules: ({ model, schema }) => { - return [{ required: true, message: '璇疯緭鍏ode!' }, { ...rules.duplicateCheckRule('dry_eqp_type', 'code', model, schema)[0] }]; - }, - }, - { - label: 'name', - field: 'name', - component: 'Input', - dynamicRules: ({ model, schema }) => { - return [{ required: true, message: '璇疯緭鍏ame!' }, { ...rules.duplicateCheckRule('dry_eqp_type', 'name', model, schema)[0] }]; - }, - }, - // TODO 涓婚敭闅愯棌瀛楁锛岀洰鍓嶅啓姝讳负ID - { - label: '', - field: 'id', - component: 'Input', - show: false, - }, -]; + { + label: '缂栫爜', + field: 'code', + component: 'Input', + dynamicRules: ({ model, schema }) => { + return [{ required: true, message: '璇疯緭鍏ョ紪鐮�!' }, { ...rules.duplicateCheckRule('dry_eqp_type', 'code', model, schema)[0] }] + }, + }, + { + label: '鍚嶇О', + field: 'name', + component: 'Input', + dynamicRules: ({ model, schema }) => { + return [{ required: true, message: '璇疯緭鍏ュ悕绉�!' }, { ...rules.duplicateCheckRule('dry_eqp_type', 'name', model, schema)[0] }] + }, + }, + { + label: '骞茬嚗鏁堢巼', + field: 'dryEfficiency', + component: 'Input', + dynamicRules: ({ model, schema }) => { + return [{ required: false }, { pattern: /^-?\d+\.?\d*$/, message: '璇疯緭鍏ユ暟瀛�!' }] + }, + renderComponentContent: () => { + return { + suffix: () => 'kg/h', + } + }, + }, + { + label: '钂告苯鍧囪��', + field: 'steamConsumption', + component: 'Input', + dynamicRules: ({ model, schema }) => { + return [{ required: false }, { pattern: /^-?\d+\.?\d*$/, message: '璇疯緭鍏ユ暟瀛�!' }] + }, + renderComponentContent: () => { + return { + suffix: () => 'm鲁/kg', + } + }, + }, + { + label: '鐢佃兘鍧囪��', + field: 'powerConsumption', + component: 'Input', + dynamicRules: ({ model, schema }) => { + return [{ required: false }, { pattern: /^-?\d+\.?\d*$/, message: '璇疯緭鍏ユ暟瀛�!' }] + }, + renderComponentContent: () => { + return { + suffix: () => 'KWh/kg', + } + }, + }, + // TODO 涓婚敭闅愯棌瀛楁锛岀洰鍓嶅啓姝讳负ID + { + label: '', + field: 'id', + component: 'Input', + show: false, + }, +] /** * 娴佺▼琛ㄥ崟璋冪敤杩欎釜鏂规硶鑾峰彇formSchema * @param param */ export function getBpmFormSchema(_formData): FormSchema[] { - // 榛樿鍜屽師濮嬭〃鍗曚繚鎸佷竴鑷� 濡傛灉娴佺▼涓厤缃簡鏉冮檺鏁版嵁锛岃繖閲岄渶瑕佸崟鐙鐞唂ormSchema - return formSchema; + // 榛樿鍜屽師濮嬭〃鍗曚繚鎸佷竴鑷� 濡傛灉娴佺▼涓厤缃簡鏉冮檺鏁版嵁锛岃繖閲岄渶瑕佸崟鐙鐞唂ormSchema + return formSchema } -- Gitblit v1.9.3